The VS Code of video editing, built for agents.
TypeScript
markdown cleanup
konstantin-paulus8a379a25e214
diff --git a/README.md b/README.mddeleted file mode 100644index 431bda3f..00000000--- a/README.md+++ /dev/null@@ -1,74 +0,0 @@-# Diffusion Studio--Open-source video editor: a SolidJS web app with an ECS-based engine, an-Electron desktop wrapper, and a CLI. Talks to the Diffusion Studio backend-through the published [`@diffusionstudio/api-contract`](https://www.npmjs.com/package/@diffusionstudio/api-contract)-package.--## Structure--```-apps/- web/ SolidJS + Vite SPA (the editor)- desktop/ Electron desktop app (wraps the web app)- cli/ CLI (`dapi`) and IPC protocol shared with desktop-```--## Getting Started--Requires [Node.js](https://nodejs.org) v20+.--```bash-npm install-cp apps/web/.env.example apps/web/.env-npm run dev # web app → http://localhost:5173-```--All values in `.env.example` are public; the defaults point the app at the-production API, so no local backend is needed. To develop against a local-backend instead, set `VITE_API_URL=http://localhost:3000` in `apps/web/.env`-(or leave it empty to use the Vite dev proxy, which forwards `/api` to-`http://localhost:3000`).--### Desktop App--The Electron app loads the web dev server in development:--```bash-npm run dev # terminal 1-npm run dev:desktop # terminal 2-```--### Build--```bash-npm run build:web # static build → apps/web/dist-npm run build:desktop-npm run make # package the desktop app-```--### Type Checking & Linting--```bash-npm run check-npm run lint-```--## Deployment--The web app is a static Vite build deployed on Vercel. Project settings:--- **Root Directory**: `apps/web` (Vercel detects the npm workspace and- installs from the repo root, which the `@diffusionstudio/cli` workspace- dependency requires)-- Everything else comes from `apps/web/vercel.json`: SPA rewrites, the- COOP/COEP headers required for SharedArrayBuffer, and a build command that- copies `.env.example` to `.env` so the public defaults apply.--To override build-time config (API URL, Supabase, analytics), set the-corresponding `VITE_*` variables in the Vercel dashboard — process env takes-precedence over the copied `.env` defaults.--## License--This project is licensed under the [Mozilla Public License 2.0](LICENSE).diff --git a/apps/cli/CLI_API.md b/apps/cli/api-spec.mdsimilarity index 96%rename from apps/cli/CLI_API.mdrename to apps/cli/api-spec.mdindex 684bd668..2d4c55b1 100644--- a/apps/cli/CLI_API.md+++ b/apps/cli/api-spec.md@@ -4,7 +4,7 @@ User-facing reference for the `dapi` CLI. All canvas/project commands talk to th**Top-level:** `open`, `whoami`, `context` (alias `ctx`), `mount`, `models`, `voices`.**Groups:** `selection` (alias `sel`), `node` (aliases `n`, `entity`), `project` (alias `p`), `asset` (alias `a`), `folder` (alias `fld`), `font` (alias `f`).-Selection reads and mutations live under `selection`. Anything that targets one or more nodes lives under `node` — scenes are nodes too; they are created declaratively via `mount` (`<scene key="...">`). Declarative composition happens through `mount`, which renders a Solid JSX project into the canvas (see [JSX_API.md](./JSX_API.md)); `node insert` runs the same pipeline but inserts the rendered nodes into an existing parent entity instead of mounting document roots. AI asset generation (image / video / speech / audio) is **declared in the project module** and produced on mount (see the JSX API); the `models` and `voices` commands list what's available to reference from those declarations. Inspecting an existing asset (probe / transcript / analyze / visualize / frame) lives under `asset`; writing an asset's original file back out to disk is `asset export`. Organizing the asset library into folders lives under `folder`; moving assets between folders is `asset mv`.+Selection reads and mutations live under `selection`. Anything that targets one or more nodes lives under `node` — scenes are nodes too; they are created declaratively via `mount` (`<scene key="...">`). Declarative composition happens through `mount`, which renders a Solid JSX project into the canvas (see [jsx-spec.md](./jsx-spec.md)); `node insert` runs the same pipeline but inserts the rendered nodes into an existing parent entity instead of mounting document roots. AI asset generation (image / video / speech / audio) is **declared in the project module** and produced on mount (see the JSX API); the `models` and `voices` commands list what's available to reference from those declarations. Inspecting an existing asset (probe / transcript / analyze / visualize / frame) lives under `asset`; writing an asset's original file back out to disk is `asset export`. Organizing the asset library into folders lives under `folder`; moving assets between folders is `asset mv`.Shared types used below:@@ -13,7 +13,7 @@ NodeRef = { id: number; name: string; type: string } // node ids are entity idSize = { width: number; height: number }Asset = { id: string; name: string; type: string } // asset ids are opaque strings (sqids)Folder = { id: string; name: string; type: 'folder' } // folder ids are opaque strings (sqids)-Time = number | `${number}f` | "MM:SS" // seconds, frames at 30 fps ("45f"), or a clock string — see JSX_API.md+Time = number | `${number}f` | "MM:SS" // seconds, frames at 30 fps ("45f"), or a clock string — see jsx-spec.md```Time inputs take the `Time` format unless noted otherwise. Times in **outputs** are plain seconds — except the raw records of `node ls`, which use engine units (frames at 30 fps, packed colors, dB).@@ -115,7 +115,7 @@ Essential context about the open project. Call this first to understand the canv### `dapi mount (<path> | --code <str>)`-Compiles a Solid JSX project module and executes it in the app, mounting the rendered roots into the document — like reloading a webpage, re-mounting rebuilds them in place instead of adding copies. Every top-level element declares its identity in the JSX with a `key`: `<scene key="intro">` replaces the node carrying that key (or creates it). With `--code`, the `export default () =>` wrapper is optional — a bare JSX expression (no `export default` in the source) is wrapped into a component module automatically. Full specification: [JSX_API.md](./JSX_API.md).+Compiles a Solid JSX project module and executes it in the app, mounting the rendered roots into the document — like reloading a webpage, re-mounting rebuilds them in place instead of adding copies. Every top-level element declares its identity in the JSX with a `key`: `<scene key="intro">` replaces the node carrying that key (or creates it). With `--code`, the `export default () =>` wrapper is optional — a bare JSX expression (no `export default` in the source) is wrapped into a component module automatically. Full specification: [jsx-spec.md](./jsx-spec.md).- **Output:** none.@@ -248,7 +248,7 @@ Focuses the node on the canvas and captures a screenshot, written to a PNG file### `dapi node insert <parentId> (<path> | --code <str>) [--index <N>]`-Compiles a Solid JSX project module and executes it in the app — the same pipeline as [`mount`](#dapi-mount-path---code-str), including declared asset generation — but instead of mounting the rendered roots into the document, inserts them as children of an existing entity. Because the result is inserted rather than reconciled, root elements take no `key`: every run inserts fresh entities; there is no replace-or-create matching and nothing is deleted. Full specification: [JSX_API.md](./JSX_API.md).+Compiles a Solid JSX project module and executes it in the app — the same pipeline as [`mount`](#dapi-mount-path---code-str), including declared asset generation — but instead of mounting the rendered roots into the document, inserts them as children of an existing entity. Because the result is inserted rather than reconciled, root elements take no `key`: every run inserts fresh entities; there is no replace-or-create matching and nothing is deleted. Full specification: [jsx-spec.md](./jsx-spec.md).The rendered roots must be valid as children of the target parent, following the JSX containment rules: a node parent takes any element or paint root except `<scene>` (scenes only exist at the document top level) and `<colorStop>`; a gradient paint parent takes only `<colorStop>` roots — this is how a stop is added to an existing gradient (`node insert <paintId> --code '<colorStop offset={0.5} color="#FF0055" />'`); other sub-entities take no children.@@ -278,7 +278,7 @@ Deletes one or more entities and all their descendants. Alias: `remove`.### `dapi node patch ([path] | --json <str>)`-Assigns JSX props on one or more existing entities in a single call. Every patch entry takes the same properties, with the same value requirements, as a JSX element in [`mount`](#dapi-mount-path---code-str) — the full table lives in [JSX_API.md](./JSX_API.md#element-reference) and is not repeated here; the payload type is `PatchProps` from `@diffusionstudio/jsx`. Patches are applied through the same setters as a render, so the two surfaces cannot diverge. Changes are tracked for undo like a UI edit.+Assigns JSX props on one or more existing entities in a single call. Every patch entry takes the same properties, with the same value requirements, as a JSX element in [`mount`](#dapi-mount-path---code-str) — the full table lives in [jsx-spec.md](./jsx-spec.md#element-reference) and is not repeated here; the payload type is `PatchProps` from `@diffusionstudio/jsx`. Patches are applied through the same setters as a render, so the two surfaces cannot diverge. Changes are tracked for undo like a UI edit.Any live entity is addressable — not just nodes: paints and color stops can be patched too (`color`, `offset`, `opacity`, gradient `rotation`). There is no separate rename command: renaming a node is patching its `name`.@@ -695,7 +695,7 @@ Deletes one or more folders. **Deletion cascades:** every descendant folder and## Generation reference-**Asset generation (image / video / speech / audio) is declared in the project module** (`generate.*` declarations, see the JSX API) and produced by the editor on mount. There are no CLI commands that generate; the two commands below only list what you can reference from those declarations. (Captioning is also declarative — a `<captions>` element in a mounted or inserted project, see [Captions](./JSX_API.md#captions).) Both require the app to be running.+**Asset generation (image / video / speech / audio) is declared in the project module** (`generate.*` declarations, see the JSX API) and produced by the editor on mount. There are no CLI commands that generate; the two commands below only list what you can reference from those declarations. (Captioning is also declarative — a `<captions>` element in a mounted or inserted project, see [Captions](./jsx-spec.md#captions).) Both require the app to be running.### `dapi models [type]`diff --git a/apps/cli/JSX_API.md b/apps/cli/jsx-spec.mdsimilarity index 100%rename from apps/cli/JSX_API.mdrename to apps/cli/jsx-spec.mddiff --git a/temp.sh b/temp.shdeleted file mode 100644index 9e5ae07e..00000000--- a/temp.sh+++ /dev/null@@ -1,7 +0,0 @@-dapi mount --code 'export default () => (- <scene key="intro" width={1920} height={1080}>- <rect x={100} y={100} width={400} height={300} fill="#ff5533" cornerRadius={12} />-</scene>-)'--# inPoint={5} outPoint={16} startTime="-30f"\ No newline at end of file