Skip to content

Commit 03f0639

Browse files
authored
Merge pull request #10 from BeatAPI/codex/v0.2.0-release
release: BeatDesign v0.2.0
2 parents 44bbd44 + 6b525bd commit 03f0639

160 files changed

Lines changed: 17090 additions & 466 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.env.example‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ VITE_APP_NAME=BeatDesign
66
VITE_APP_DESCRIPTION=The open-source, local-first AI canvas for image and video creation.
77
VITE_APP_LOGO=/logo.png
88
VITE_DEFAULT_LOCALE=en
9-
VITE_GENERATION_PROVIDER=beatapi
9+
GENERATION_PROVIDER=beatapi
1010

1111
# Local persistence
1212
DATABASE_PROVIDER=sqlite

‎.github/workflows/quality.yaml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ jobs:
2323
node-version: 22
2424
cache: pnpm
2525
- run: pnpm install --frozen-lockfile
26+
# The MCP stdio probe exercises real Project queries, so CI needs the
27+
# same local SQLite schema created by the documented quick-start flow.
28+
- run: pnpm db:push
2629
# The Vite build generates the gitignored Paraglide and TanStack Router
2730
# artifacts that TypeScript needs in a clean checkout.
2831
- run: pnpm build

‎.mcp.json‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"mcpServers": {
3+
"beatdesign": {
4+
"command": "pnpm",
5+
"args": ["--silent", "mcp"]
6+
}
7+
}
8+
}

‎ARCHITECTURE.md‎

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,59 @@ Projects
99
+ Home
1010
+ Studio
1111
+ Canvas
12+
+ Editor
1213
+ Assets
1314
+ Generation history
1415
+ Provider configuration
1516
+ Storage configuration
1617
```
1718

18-
Studio, Canvas, and Assets are three views over the same project, generation, and asset services. Switching modes never creates a second project or backend.
19+
Studio, Canvas, Editor, and Assets are views over the same project, generation, asset, and history services. Switching modes never creates a second project or backend.
20+
21+
The shared product model is asset-first:
22+
23+
- A generation creates an `Asset`; it does not own a single UI placement.
24+
- A Canvas node references an Asset, Generation, or Timeline.
25+
- A Timeline clip pins a concrete Asset and never silently follows a Canvas generation's latest output.
26+
- A Take is an alternate Asset for one clip; the original source remains recoverable.
27+
- Canvas edges describe visual organization. Generation lineage describes real derivation and is stored separately.
1928

2029
## Runtime flow
2130

22-
The browser calls local `/api` routes. Server routes validate input and call the BeatAPI adapter. The adapter submits image/video generation tasks or the stable `/v1/video-analysis/tasks` workflow, then checks `/v1/tasks/:id`. Generation state and analysis text are stored locally, while provider result URLs are indexed as project assets.
31+
The browser calls local `/api` routes. Server routes validate input and resolve a logical model through the active Generation Provider contract. BeatAPI is the built-in/default provider; forks can register another source-level provider without changing Canvas, Editor, MCP, or the asset-first request contract.
2332

2433
Provider credentials are read from environment variables or the local `config` table. Browser components never receive the raw API key.
2534

2635
Upload storage is a separate adapter boundary. File selection remains browser-local. A successful generation precheck creates a short-lived, one-time SQLite intent that binds the project, model, exact upload count, uploaded URLs, and final generation submission. Required references are promoted only after that point and immediately before task submission; they become project assets only after BeatAPI accepts the task. The built-in provider is fixed to the official `https://api.beatapi.io` endpoint. Official `BEATAPI_MANAGED_R2_*` secrets and self-hosted `R2_*` credentials are deliberately separate and never fall through to each other.
2736

37+
## Command boundary
38+
39+
UI actions, the local MCP server, and a future CLI call the same Command Kernel. The kernel owns validation and pure document operations for Canvas and Editor. Persistence boundaries remain responsible for revision checks, durable writes, and returning the authoritative document.
40+
41+
```text
42+
UI / MCP / CLI
43+
|
44+
Command envelope + validation
45+
|
46+
Canvas / Editor / Generation commands
47+
|
48+
revision-checked project persistence
49+
|
50+
SQLite + project media files
51+
```
52+
53+
MCP does not write SQLite directly or replace an entire Canvas or Timeline document. Its tools call `persistBeatDesignCommand` with a transport-controlled `origin=mcp`. The public UI route assigns `origin=ui` server-side and rejects an `origin` request field. UI-only timeline replacement exists for local autosave and undo/redo, remains revision-checked, and is rejected for MCP/CLI origins. Generation commands are asset-first and intentionally have no `placement` field; the server compiles provider media URLs from project-owned Asset IDs and the one-time generation intent before submission.
54+
55+
Canvas layout persistence is the deliberate exception on the UI side: drag, resize, viewport, and the complete visual arrangement are saved as a revision-checked snapshot. Semantic Canvas operations are also exposed through `canvas.apply`, and external agents must use those operations rather than snapshot replacement.
56+
2857
## Persistence
2958

30-
The SQLite/D1 schema contains ten tables:
59+
The SQLite/D1 schema contains twelve tables:
3160

3261
- `project`
3362
- `project_canvas_state`
63+
- `project_timeline_state`
64+
- `project_command_receipt`
3465
- `project_workflow_state`
3566
- `generation_history`
3667
- `generation_upload_intent`
@@ -40,11 +71,13 @@ The SQLite/D1 schema contains ten tables:
4071
- `project_asset_membership`
4172
- `config`
4273

74+
`project_command_receipt` stores bounded, short-lived command results for retry idempotency and powers the current MCP history tool. It is not a permanent audit log; long-term Agent Activity still needs a separate durable event contract.
75+
4376
No user, session, role, order, subscription, payment, credit, API-key, ticket, or CMS table belongs in this repository.
4477

4578
## Model catalog
4679

47-
`src/core/effects/effect-registry.ts` is the canonical user-facing catalog. `src/core/adapters/beatapi-adapter.ts` maps that catalog to BeatAPI request bodies. Do not add a second database-backed model registry.
80+
`src/core/effects/effect-registry.ts` is the canonical user-facing logical catalog. `src/core/generation-providers/` maps those logical IDs to provider bindings and adapters. `src/core/adapters/beatapi-adapter.ts` contains BeatAPI request mapping. Do not leak upstream effect IDs or field names into MCP tools, and do not add a second database-backed model registry.
4881

4982
## Deployment boundary
5083

‎CHANGELOG.md‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Changelog
2+
3+
All notable changes to BeatDesign are documented in this file.
4+
5+
## [0.2.0] - 2026-08-30
6+
7+
### Added
8+
9+
- A local stdio MCP server with 20 Project, Asset, Canvas, Generation, and Editor tools.
10+
- A shared Command Kernel with runtime schemas, revision checks, stable IDs, idempotent receipts, and project Asset validation.
11+
- Canvas-to-Editor workflows: tail-frame extraction, continuation generation nodes, Timeline nodes, and multi-asset timeline creation.
12+
- Local image, video, and audio import through both the UI and MCP.
13+
- Image clips, audio tracks, non-destructive Takes, split/trim/move/delete, undo/redo, timeline diagnostics, and browser-native MP4 export.
14+
- BeatAPI model capability discovery and asset-first generation contracts.
15+
- Codex plugin packaging plus generic MCP configuration for Claude Code, Cursor, OpenCode, and other stdio hosts.
16+
17+
### Changed
18+
19+
- Canvas and Editor now check for Agent/MCP revisions every two seconds and whenever the page regains focus.
20+
- Canvas rebases pending local layout edits onto newer Agent revisions instead of blocking visible MCP updates; snapshot restoration also removes stale shapes before rebuilding the current document.
21+
- Editor autosave adopts the canonical saved document and ignores timestamp-only differences, preventing repeated save echoes from blocking MCP updates.
22+
- Generated and imported media are persisted in project-owned local storage and indexed in SQLite.
23+
- External Canvas media writes require project-owned Asset IDs, and local image/video/audio imports validate type and size before reading file contents.
24+
- GitHub documentation now includes a product-first English/Chinese README and a BeatDesign release cover.
25+
26+
### Current boundaries
27+
28+
- Editor snapshots are semantic rather than pixel-rendered.
29+
- MP4 export remains browser-driven and is not yet available as a headless MCP tool.
30+
- Captions, transitions, speed controls, multiple named timelines, and native desktop packaging remain follow-up work.
31+
32+
[0.2.0]: https://github.com/BeatAPI/BeatDesign/releases/tag/v0.2.0

‎PROVIDERS.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Provider configuration
22

3-
BeatAPI is the fixed built-in generation and analysis provider implemented by this repository. The upstream URL is intentionally fixed to `https://api.beatapi.io`; users only provide their own BeatAPI API key.
3+
BeatAPI is the built-in and default generation/analysis provider. The official BeatAPI adapter keeps its upstream URL fixed to `https://api.beatapi.io`; users only provide their own BeatAPI API key.
44

55
Configure it in either place:
66

@@ -17,13 +17,15 @@ The adapter uses:
1717
- `GET /v1/tasks/:id`
1818
- `POST /v1/files` for supported reference files
1919

20-
Model support is defined in `src/core/effects/effect-registry.ts`, not discovered dynamically. This keeps Canvas and Studio behavior deterministic. When adding a model, update the registry, request mapping, media capability rules, and tests together.
20+
User-facing model capabilities are defined in `src/core/effects/effect-registry.ts`. Provider bindings live in `src/core/generation-providers/`; MCP and UI use the logical model id and capability schema, not BeatAPI `effectId` or raw upstream fields.
2121

2222
Kling 2.6 and Kling 3.0 Motion Control are exposed as BeatAPI models. Each run requires exactly one character image and one MP4/MOV motion video uploaded through the connected BeatAPI account. The Workspace never asks users for a KIE key; BeatAPI owns the upstream provider route, billing, polling, and output persistence.
2323

2424
Video Analysis is exposed as a stable BeatAPI workflow with Standard and Deep depth controls. The Workspace uploads one MP4/MOV input, submits the analysis task, polls `GET /v1/tasks/:id`, and stores the returned report text and usage in the local project history. Provider-specific Gemini routing remains private to BeatAPI.
2525

26-
An API with a different request or polling contract still needs its own adapter. This repository does not ship placeholder KIE, Vidu, Evolink, Gemini, Fal, Replicate, or payment-provider integrations.
26+
An API with a different request or polling contract needs its own adapter. Forks can register one in `src/config/generation-providers.ts`, bind only the logical models they support, and set server-side `GENERATION_PROVIDER=<id>`. BeatAPI is the default only when no custom provider is selected; an unknown configured id fails explicitly so it cannot accidentally submit a task to another provider. This repository does not ship placeholder KIE, Vidu, Evolink, Gemini, Fal, Replicate, or payment-provider integrations.
27+
28+
A custom provider definition owns adapter construction, readiness checks, parameter validation, model bindings, upstream model names, and upload paths. Provider credentials must stay server-side. Switching providers does not change Canvas nodes, Editor clips, Asset IDs, or MCP requests; each submitted task also records its provider/model identity so polling does not silently follow a later default-provider change.
2729

2830
## Storage
2931

0 commit comments

Comments
 (0)