The VS Code of video editing, built for agents.
TypeScript
Update Windows documentation and enhance DAPI functionality
konstantin-paulus1324e365cfbc
diff --git a/apps/desktop/WINDOWS.md b/apps/desktop/WINDOWS.mdindex 3635d3c7..19c8fe7b 100644--- a/apps/desktop/WINDOWS.md+++ b/apps/desktop/WINDOWS.md@@ -278,10 +278,16 @@ Acceptance:Goal: every agent in the settings list connects on Windows.-Status: implemented on macOS (unit-tested), not yet run on Windows. Agent-paths are `{ root: "home" | "appData", path }`, and `appData` resolves through-Electron's `app.getPath("appData")`, so the target table has no platform-branches. The Squirrel uninstall hook removes our entry from every agent.+Status: running on Windows in the dev build (2026-09-22). Checked: the app+listens on 127.0.0.1:3274; the stdio proxy answers `initialize` when spawned+as `cmd /c <shim>\dapi.cmd mcp`, the shape Claude Desktop gets; Connect for+Codex writes the `[mcp_servers.diffusion]` table and `codex mcp list` shows+the server enabled. Still to do: a tool call from a live agent session,+Disconnect leaving the rest of the config untouched, and the other agents+in the list. Agent paths are `{ root: "home" | "appData", path }`, and+`appData` resolves through Electron's `app.getPath("appData")`, so the target+table has no platform branches. The Squirrel uninstall hook removes our entry+from every agent.Tasks:@@ -316,14 +322,17 @@ Acceptance:Goal: no dapi tool answers "macOS only".-Status: implemented on macOS, not yet run on Windows. `queryLocalFonts` was+Status: `dapi fonts` runs on Windows in the dev build (2026-09-22) with the+same output shape as macOS (style names mapped to weights, "Arial Black" under+Arial at 900); whether it also answers from a minimized window is still to be+confirmed there. `queryLocalFonts` wasprobed in Electron on macOS: it needs no user gesture, but Chromium rejects it("Page needs to be visible") once a window has been shown and then hidden orminimized. A never-shown window counts as visible, so `--hidden` launches werenever affected. The main window therefore sets `backgroundThrottling: false`,-which keeps the page visible in every state; confirm the same on Windows.-Still to do on macOS: one `dapi fonts` call against a dev build, since-the tool changed process. Google Drive's streaming drive is recognised by+which keeps the page visible in every state. The other tools in the+acceptance list (`media *`, `screenshot`, `export`, `report`) have not been+run on Windows. Google Drive's streaming drive is recognised byshape (a drive root holding `My Drive` on a machine with DriveFS), because itsletter is only in the client's database; check that on hardware.@@ -407,8 +416,11 @@ Status: task 1 runs on Windows: the dev build starts throughconfirmed on Windows; the script is `npm run link` in `apps/cli`(`scripts/dev-link.mjs`), one command on both platforms, which writes theHomebrew symlink on macOS and, on Windows, the `dapi.cmd` shim plus the user-PATH entry, edited through the registry like `cli-windows.ts` does. The shim-part ran on Windows on 2026-09-22; the PATH part is the next thing to try. Task 3 (Mica) was+PATH entry, edited through the registry like `cli-windows.ts` does. Both ran+on Windows on 2026-09-22. A terminal only sees the new PATH when its parent+process started after the change: one opened from VS Code inherits VS Code's+environment until VS Code is restarted, which is why the script says to open+a new terminal. Task 3 (Mica) wastried and dropped, see below. Tasks 4 and 5 are open.Mica, tried on Windows on 2026-09-21 and reverted: the window stays solid.diff --git a/apps/desktop/src/dapi/present.ts b/apps/desktop/src/dapi/present.tsindex 874c29e7..c699f093 100644--- a/apps/desktop/src/dapi/present.ts+++ b/apps/desktop/src/dapi/present.ts@@ -2,7 +2,7 @@* License, v. 2.0. If a copy of the MPL was not distributed with this* file, You can obtain one at http://mozilla.org/MPL/2.0/. */-import { existsSync } from "node:fs";+import { existsSync, realpathSync } from "node:fs";import { mkdir, mkdtemp, stat, writeFile } from "node:fs/promises";import { tmpdir } from "node:os";import { dirname, join } from "node:path";@@ -22,6 +22,18 @@ const INLINE_MAX_BYTES = 1 << 20;const APP_SLUG = "diffusion-studio";+/**+ * The temp dir with its real spelling. On Windows `%TEMP%` is often set with short names+ */+function tempDir(): string {+ const dir = tmpdir();+ try {+ return realpathSync.native(dir);+ } catch {+ return dir;+ }+}+export async function present(name: ToolName, args: unknown, result: unknown): Promise<Presented> {switch (name) {case "capture":@@ -45,7 +57,7 @@ export async function present(name: ToolName, args: unknown, result: unknown): P// with its timecode (`08s10f`, or `0f-08s10f` for a sheet), which is the// filename too.async function presentImages(images: TimecodedImage[], output: string | undefined, kind: string): Promise<Presented> {- const dir = output ?? (await mkdtemp(join(tmpdir(), `dapi-${kind}-`)));+ const dir = output ?? (await mkdtemp(join(tempDir(), `dapi-${kind}-`)));await mkdir(dir, { recursive: true });const written: WrittenImage[] = [];const refs: ToolOutput<"capture">["images"] = [];@@ -64,7 +76,7 @@ async function presentImages(images: TimecodedImage[], output: string | undefine* the fresh name inside it rather than an EISDIR from writeFile.*/async function singleFilePath(output: string | undefined, name: string): Promise<string> {- if (output === undefined) return join(tmpdir(), name);+ if (output === undefined) return join(tempDir(), name);const existing = await stat(output).catch(() => null);if (existing?.isDirectory()) return join(output, name);await mkdir(dirname(output), { recursive: true });@@ -83,7 +95,7 @@ async function presentPreview(}async function presentScreenshot(result: ToolResult<"screenshot">, output: string | undefined): Promise<Presented> {- const dir = output ?? tmpdir();+ const dir = output ?? tempDir();await mkdir(dir, { recursive: true });const taken = new Date();let attempt = 1;diff --git a/apps/web/src/agent-chat/store.ts b/apps/web/src/agent-chat/store.tsindex 167a033e..f3e446a3 100644--- a/apps/web/src/agent-chat/store.ts+++ b/apps/web/src/agent-chat/store.ts@@ -148,7 +148,7 @@ export function refreshHarnesses(): void {export const readyHarnesses = (): HarnessInfo[] => state.harnesses.filter((harness) => harness.status === "ready");/** Families picked before anything is remembered, best first, across every ready harness. */-const PREFERRED_MODELS = [/fable/i, /astra/i, /opus/i];+const PREFERRED_MODELS = [/astra/i, /sol/i, /fable/i, /opus/i];/*** The model the composers send with: the remembered one if its harness is