The VS Code of video editing, built for agents.
TypeScript
Remove `fetch` command and related functionality from the application
konstantin-paulusdf9d7d9f84c9
diff --git a/README.md b/README.mdindex b56a0a94..ed9c08a8 100644--- a/README.md+++ b/README.md@@ -199,7 +199,6 @@ Each command is the MCP tool of the same name: `dapi media grab` is `media_grab`| `dapi media …` | Inspect a file by id or path: `probe`, `grab`, `filmstrip`, `waveform`, `transcribe`, `listen` || `dapi models` / `dapi voices` / `dapi fonts` | Discover generation models, speech voices, local fonts || `dapi screenshot` / `dapi logs` | The app itself: capture the window, read recent console output |-| `dapi fetch` | Download a video from yt/tt/ig || `dapi whoami` | The authenticated account || `dapi report` | Report a bug in the tools or the app: diagnostics bundled, filed as a GitHub issue via `gh` |diff --git a/apps/cli/src/cli-client.ts b/apps/cli/src/cli-client.tsindex ceab127e..a6dbf310 100644--- a/apps/cli/src/cli-client.ts+++ b/apps/cli/src/cli-client.ts@@ -12,13 +12,12 @@ import type { ToolInput, ToolName, ToolOutput } from "@diffusionstudio/dapi";export const APP_NAME = "Diffusion Studio";-// Renders, AI generation, and downloads outlive the 60s default.+// Renders and AI generation outlive the 60s default.const TIMEOUTS: Record<string, number> = {export: 3_600_000,capture: 600_000,media_transcribe: 600_000,media_listen: 600_000,- fetch: 600_000,};/**diff --git a/apps/cli/src/index.ts b/apps/cli/src/index.tsindex 44d4dd04..81b176c7 100644--- a/apps/cli/src/index.ts+++ b/apps/cli/src/index.ts@@ -257,20 +257,6 @@ program.option("-l, --limit <n>", field("fonts", "limit"), numeric).action((opts: ToolInput<"fonts">) => run("fonts", opts));-program- .command("fetch")- .description(describe("fetch"))- .argument("<url>", field("fetch", "url"))- .option("-o, --output <path>", field("fetch", "output"))- .option("-f, --format <selector>", field("fetch", "format"))- .option("-a, --audio", field("fetch", "audio"))- .allowExcessArguments()- .addHelpText("after", `\nForward raw yt-dlp flags after --, e.g. dapi fetch <url> -- --sponsorblock-remove all`)- .action((url: string, opts: Omit<ToolInput<"fetch">, "url" | "raw">, cmd: Command) =>- // `raw` is every operand after `url` — the yt-dlp passthrough placed after `--`.- run("fetch", { url, ...opts, raw: cmd.args.slice(1), output: opts.output && resolve(opts.output) }),- );-// Explicit argv convention: the packaged wrapper runs this bundle on// Electron in ELECTRON_RUN_AS_NODE mode, where commander would otherwise// detect Electron and drop the script path from argv.diff --git a/apps/desktop/src/dapi/handler.ts b/apps/desktop/src/dapi/handler.tsindex f94d9c72..dcc7cc64 100644--- a/apps/desktop/src/dapi/handler.ts+++ b/apps/desktop/src/dapi/handler.ts@@ -15,7 +15,7 @@ export type MainContext = {};/** The tools that need the file system or a child process, not a window. */-export type MainToolName = "logs" | "fonts" | "fetch" | "report";+export type MainToolName = "logs" | "fonts" | "report";export type MainHandler<N extends MainToolName> = (args: ToolArgs<N>, ctx: MainContext) => Promise<ToolResult<N>>;diff --git a/apps/desktop/src/dapi/handlers/fetch.ts b/apps/desktop/src/dapi/handlers/fetch.tsdeleted file mode 100644index e00d2549..00000000--- a/apps/desktop/src/dapi/handlers/fetch.ts+++ /dev/null@@ -1,104 +0,0 @@-/* This Source Code Form is subject to the terms of the Mozilla Public- * 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 { spawn, spawnSync } from "node:child_process";-import { DapiError } from "@diffusionstudio/dapi";-import { hydrateEnv, which } from "@diffusionstudio/agent-chat/host/env";--import type { HostEnv } from "@diffusionstudio/agent-chat/host/env";-import type { MainHandler } from "../handler";--// A Finder- or Dock-launched app inherits launchd's minimal PATH-// (/usr/bin:/bin:/usr/sbin:/sbin), which is where a Homebrew or pipx yt-dlp-// is not. The login shell's PATH is read once and searched, then the usual-// install dirs; YT_DLP_PATH is an escape hatch for pinned installs. The-// hydrated env is also what yt-dlp runs with, so it finds ffmpeg for merging-// and extraction the same way.-let hostEnv: Promise<HostEnv> | undefined;--function host(): Promise<HostEnv> {- return (hostEnv ??= hydrateEnv());-}--/** Where yt-dlp is, or null when it is nowhere the app can see. */-async function resolveYtDlp(): Promise<{ bin: string; env: HostEnv["env"] } | null> {- const env = await host();- const override = env.env.YT_DLP_PATH ?? process.env.YT_DLP_PATH;- const bin = override ?? which("yt-dlp", env);- return bin ? { bin, env: env.env } : null;-}--// Fails with an actionable message before any download is attempted. Not-// found is the "not installed" case; a non-zero status means the binary is-// present but broken.-async function requireYtDlp(): Promise<{ bin: string; env: HostEnv["env"] }> {- const resolved = await resolveYtDlp();- if (!resolved) {- throw new DapiError(- "unsupported",- "yt-dlp not found. Install it (brew install yt-dlp, or pipx install yt-dlp) or set YT_DLP_PATH to its location.",- );- }- const probe = spawnSync(resolved.bin, ["--version"], { encoding: "utf8", env: resolved.env });- if (probe.error) {- if ((probe.error as NodeJS.ErrnoException).code === "ENOENT") {- throw new DapiError("unsupported", `yt-dlp is not runnable at ${resolved.bin}. Install it, or point YT_DLP_PATH at a working binary.`);- }- throw probe.error;- }- if (probe.status !== 0) {- throw new DapiError("unsupported", probe.stderr?.trim() || "yt-dlp is present but not runnable.");- }- return resolved;-}--// yt-dlp's own `after_move:filepath` reports what actually landed (post-// extraction / rename), so the name is never guessed. --quiet keeps stdout to-// those paths; stderr is kept only for the error line when it fails.-export const fetchVideo: MainHandler<"fetch"> = async ({ url, output, format, audio, raw }, ctx) => {- const { bin, env } = await requireYtDlp();-- const args = ["--quiet", "--no-warnings", "--print", "after_move:filepath"];- if (output) args.push("-o", output);- if (format) {- args.push("-f", format);- } else if (!audio) {- // Default to mp4: prefer mp4/m4a streams, then remux the merged result so- // the landed file is a .mp4 even when only WebM/mkv sources were available.- // An explicit format or audio opts out.- args.push("-f", "bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4]/bv*+ba/b", "--merge-output-format", "mp4");- }- if (audio) args.push("-x");- if (raw?.length) args.push(...raw);- args.push(url);-- return new Promise((resolve, reject) => {- const child = spawn(bin, args, { stdio: ["ignore", "pipe", "pipe"], env });- let out = "";- child.stdout.setEncoding("utf8");- child.stdout.on("data", (chunk) => (out += chunk));-- let stderr = "";- child.stderr.setEncoding("utf8");- child.stderr.on("data", (chunk: string) => {- stderr = (stderr + chunk).slice(-4096);- });-- const onAbort = () => child.kill();- ctx.signal.addEventListener("abort", onAbort, { once: true });-- child.on("error", reject);- child.on("close", (code) => {- ctx.signal.removeEventListener("abort", onAbort);- if (ctx.signal.aborted) {- reject(new DapiError("canceled", "Download canceled."));- } else if (code === 0) {- resolve({ paths: out.split("\n").map((line) => line.trim()).filter(Boolean) });- } else {- const detail = stderr.trim().split("\n").filter((l) => l.startsWith("ERROR")).pop();- reject(new Error(detail ?? `yt-dlp exited with code ${code}.`));- }- });- });-};diff --git a/apps/desktop/src/dapi/handlers/index.ts b/apps/desktop/src/dapi/handlers/index.tsindex 0faa91ad..a6987f2e 100644--- a/apps/desktop/src/dapi/handlers/index.ts+++ b/apps/desktop/src/dapi/handlers/index.ts@@ -4,10 +4,9 @@import { logs } from "./logs";import { fonts } from "./fonts";-import { fetchVideo } from "./fetch";import { report } from "./report";import type { MainHandlers } from "../handler";/** Every tool main answers itself, keyed by its catalog name. */-export const mainHandlers: MainHandlers = { logs, fonts, fetch: fetchVideo, report };+export const mainHandlers: MainHandlers = { logs, fonts, report };diff --git a/apps/desktop/src/mcp-config.ts b/apps/desktop/src/mcp-config.tsindex dfdaa4bc..90aa51ff 100644--- a/apps/desktop/src/mcp-config.ts+++ b/apps/desktop/src/mcp-config.ts@@ -86,7 +86,7 @@ export const AGENT_TARGETS: readonly AgentTarget[] = [{ id: "codex", label: "Codex", marker: ".codex", config: ".codex/config.toml", format: "toml", entry: http("url") },{ id: "antigravity", label: "Antigravity", marker: ".gemini/antigravity", config: ".gemini/config/mcp_config.json", format: "mcpServers", entry: http("serverUrl") },{ id: "gemini-cli", label: "Gemini CLI", marker: ".gemini", config: ".gemini/settings.json", format: "mcpServers", entry: http("httpUrl") },- { id: "windsurf", label: "Windsurf", marker: ".codeium/windsurf", config: ".codeium/windsurf/mcp_config.json", format: "mcpServers", entry: http("serverUrl") },+ { id: "windsurf", label: "Devin (Windsurf)", marker: ".codeium/windsurf", config: ".codeium/windsurf/mcp_config.json", format: "mcpServers", entry: http("serverUrl") },];export function agentTarget(id: AgentId): AgentTarget {diff --git a/apps/desktop/src/projects.ts b/apps/desktop/src/projects.tsindex 0a7bade3..70082180 100644--- a/apps/desktop/src/projects.ts+++ b/apps/desktop/src/projects.ts@@ -481,7 +481,6 @@ const SCRIPTS: Record<string, string> = {logs: "dapi logs",screenshot: "dapi screenshot",report: "dapi report",- fetch: "dapi fetch",};const packageJson = (name: string, displayName: string): PackageJson => ({@@ -629,7 +628,7 @@ yourself with \`npx tsc --noEmit\`.Every dapi command is a script here: \`npm run\` lists them, and\`npm run <name> -- <args>\` runs one (\`npm run grab -- b-roll/drone.mp4 -c 6\`).-All of them talk to the running app, except \`fonts\` and \`fetch\`.+All of them talk to the running app, except \`fonts\`.| Script | Command | What it does || ------ | ------- | ------------ |@@ -649,7 +648,6 @@ All of them talk to the running app, except \`fonts\` and \`fetch\`.| \`logs\` | \`dapi logs\` | Recent console output from the app. || \`screenshot\` | \`dapi screenshot\` | The whole app window as a PNG. || \`report\` | \`dapi report <title>\` | File a bug against the editor, with diagnostics attached. |-| \`fetch\` | \`dapi fetch <url>\` | Download a video with yt-dlp (installed separately). |## Referencediff --git a/apps/web/src/dapi/handler.ts b/apps/web/src/dapi/handler.tsindex 22237088..882165bf 100644--- a/apps/web/src/dapi/handler.ts+++ b/apps/web/src/dapi/handler.ts@@ -31,6 +31,6 @@ export type ToolContext = {export type ToolHandler<N extends ToolName> = (args: ToolArgs<N>, ctx: ToolContext) => Promise<ToolResult<N>>;/** The tools the renderer answers; the rest run in the main process. */-export type ServedToolName = Exclude<ToolName, "logs" | "fonts" | "fetch" | "report">;+export type ServedToolName = Exclude<ToolName, "logs" | "fonts" | "report">;export type Handlers = { readonly [N in ServedToolName]: ToolHandler<N> };diff --git a/apps/web/src/lib/mcp.ts b/apps/web/src/lib/mcp.tsindex 5f67447a..0cf753b1 100644--- a/apps/web/src/lib/mcp.ts+++ b/apps/web/src/lib/mcp.ts@@ -27,14 +27,14 @@ export type { AgentId, McpAgentStatus, McpStatus, CliStatus } from "@desktop/mai/** The icon each agent is drawn with, by the name in `assets/icons`. */export const AGENT_ICONS: Record<AgentId, string> = {- "claude-code": "claude-code",+ "claude-code": "agent.claude-code","claude-desktop": "claude",- cursor: "agent-cursor",- vscode: "github-copilot",- codex: "codex",- antigravity: "antigravity",- "gemini-cli": "gemini-cli",- windsurf: "windsurf",+ cursor: "agent.cursor",+ vscode: "agent.vscode-copilot",+ codex: "agent.codex",+ antigravity: "agent.google-antigravity",+ "gemini-cli": "agent.google-gemini-cli",+ windsurf: "agent.devin-windsurf",};const [connectedAgents, setConnectedAgents] = createSignal<number | null>(null);diff --git a/docs/guides/walkthroughs/podcast-clip.md b/docs/guides/walkthroughs/podcast-clip.mdindex 0bc66aee..213ada01 100644--- a/docs/guides/walkthroughs/podcast-clip.md+++ b/docs/guides/walkthroughs/podcast-clip.md@@ -8,10 +8,10 @@ Write the brief first: the source URL or file, how many clips are wanted, the ta## 2. Audio-only pass-Download the audio track alone with `fetch` (`audio: true`, `output: podcast.m4a`). It is a fraction of the bytes, and the best moments are found without visuals. From a shell:+Download the audio track alone with [yt-dlp](https://github.com/yt-dlp/yt-dlp). It is a fraction of the bytes, and the best moments are found without visuals:```bash-dapi fetch <url> -a -o podcast.m4a+yt-dlp -x --audio-format m4a -o podcast.m4a <url>```## 3. Segment the audio@@ -41,14 +41,19 @@ The analysis gives you seconds; a clip needs the frame. Tighten both ends agains## 6. Download the segment and lay it out-Now fetch the video, and **download with padding** — a few seconds either side of the locked range — so the trim can still be nudged without downloading again.+Now download the video, and **download with padding** — a few seconds either side of the locked range — so the trim can still be nudged without downloading again. `--download-sections` fetches just that range:++```bash+yt-dlp -f "bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4]/bv*+ba/b" --merge-output-format mp4 \+ --download-sections "*41:08-41:48" -o assets/a-roll/clip-raw.mp4 <url>+````media_probe` on the download gives the source dimensions (a podcast is almost always 1920×1080) and confirms where the padded range actually starts, since a keyframe-aligned download can begin slightly early.Give the node the **source's own aspect ratio**, scaled to the scene height, rather than the scene's box: the node is then wider than the scene, and the scene crops it. That geometry is what makes the framing in the next step possible.```tsx-const raw = "/Downloads/clip-raw.mp4";+const raw = "a-roll/clip-raw.mp4"; // library path: the download landed under assets/// Locked range, expressed in the padded download's own time.const IN = 6.4; // first word of the hookdiff --git a/docs/reference/jsx/media.md b/docs/reference/jsx/media.mdindex f9604e70..264978f0 100644--- a/docs/reference/jsx/media.md+++ b/docs/reference/jsx/media.md@@ -54,7 +54,7 @@ mkdir -p assets/b-roll && ln -s ~/Movies/drone.mp4 assets/b-roll/<video src="b-roll/drone.mp4" width={1920} height={1080} />```-Link rather than copy: the bytes stay where they are, the project holds nothing but a name for them, and the library still gets a portable path to reach them by. Give `ln -s` an absolute target — a relative link is read against the folder the link sits in, so it breaks as soon as the project moves. A directory of numbered frames is taken in whole, as one [image sequence](#image-sequences), rather than as a file each, and a link to that directory does the same. [`fetch`](../tools/fetch.md) writes to disk and nothing else, so an `output` under `assets/b-roll/` is how a download becomes an asset; `generate.*` results arrive under `assets/generated/` on their own.+Link rather than copy: the bytes stay where they are, the project holds nothing but a name for them, and the library still gets a portable path to reach them by. Give `ln -s` an absolute target — a relative link is read against the folder the link sits in, so it breaks as soon as the project moves. A directory of numbered frames is taken in whole, as one [image sequence](#image-sequences), rather than as a file each, and a link to that directory does the same. A download becomes an asset the same way: point [yt-dlp](https://github.com/yt-dlp/yt-dlp) at `assets/b-roll/` with `-o`; `generate.*` results arrive under `assets/generated/` on their own.A link is the project's, and what it points at is not. Deleting a linked asset in the panel removes the link and stops there.diff --git a/docs/reference/tools/README.md b/docs/reference/tools/README.mdindex 055898f4..5fe332a9 100644--- a/docs/reference/tools/README.md+++ b/docs/reference/tools/README.md@@ -49,7 +49,6 @@ Every tool runs inside the app, so the app has to be running. Over MCP that is a| [`logs`](./logs.md) | `dapi logs` | App logs || [`screenshot`](./screenshot.md) | `dapi screenshot` | Window screenshot || [`fonts`](./fonts.md) | `dapi fonts` | Local fonts |-| [`fetch`](./fetch.md) | `dapi fetch` | Fetch video || [`report`](./report.md) | `dapi report` | Report a bug |How the surface is divided:@@ -57,7 +56,11 @@ How the surface is divided:- **The project loop.** [`open`](./open.md) a folder, edit its JSX, [`context`](./context.md) for what the source cannot say, [`capture`](./capture.md) and [`check`](./check.md) to verify, [`export`](./export.md) when asked.- **Media inspection** (`media_*`): a file by path, without adding it to the project. Absolute paths and URLs work with or without an open project; library paths (`b-roll/clip.mp4`) need one.- **What a declaration may name.** [`models`](./models.md), [`voices`](./voices.md), [`fonts`](./fonts.md). Generation itself is declared in the project module (`generate.*`, see [jsx/generate.md](../jsx/generate.md)); no tool generates.-- **The app and the machine.** [`whoami`](./whoami.md), [`logs`](./logs.md), [`screenshot`](./screenshot.md), [`report`](./report.md), and [`fetch`](./fetch.md) for downloads.+- **The app and the machine.** [`whoami`](./whoami.md), [`logs`](./logs.md), [`screenshot`](./screenshot.md), [`report`](./report.md).++## Downloading footage++There is no download tool, and none is needed: run **[yt-dlp](https://github.com/yt-dlp/yt-dlp)** from a shell. It handles YouTube, TikTok, Instagram, Vimeo, X, direct media links and most other sites, and a download that lands under the project's `assets/` folder is a library asset (see [jsx/media.md](../jsx/media.md)).## Shared typesdiff --git a/docs/reference/tools/fetch.md b/docs/reference/tools/fetch.mddeleted file mode 100644index 99c6753f..00000000--- a/docs/reference/tools/fetch.md+++ /dev/null@@ -1,48 +0,0 @@-# fetch--Download a video with yt-dlp (installed separately). Writes files to disk only and returns their paths (a single URL can yield several, e.g. a playlist).--| | |-| --- | --- |-| MCP tool | `fetch` |-| CLI | `dapi fetch <url> [options]` |--## Input--| Field | Type | CLI | Description |-| --- | --- | --- | --- |-| `url` | `string`, required | `<url>` | video or page URL to download |-| `output` | `string` | `-o, --output <path>` | output file path or directory (yt-dlp -o template; default: yt-dlp's default) |-| `format` | `string` | `-f, --format <selector>` | yt-dlp format selector (default: prefer mp4), e.g. "bv*+ba/b" |-| `audio` | `boolean` | `-a, --audio` | extract audio only (yt-dlp -x) |-| `raw` | `string[]` | `-- <yt-dlp flags...>` | raw yt-dlp flags passed through, e.g. ["--sponsorblock-remove", "all"] |--[yt-dlp](https://github.com/yt-dlp/yt-dlp) is not bundled: install it separately (`brew install yt-dlp`, or `pipx install yt-dlp`). The download runs in the app's main process, so no project needs to be open. yt-dlp is looked up on the login shell's `PATH` (read once, so a Dock-launched app finds a Homebrew or pipx install the way a terminal does), then in the usual install folders (`~/.local/bin`, `/opt/homebrew/bin`, `/usr/local/bin`), or at `YT_DLP_PATH` when set; it runs with that same `PATH`, so it finds `ffmpeg` for merging and extraction the same way. Without it the call fails with an install hint before anything is downloaded.--This writes files to disk only; it does not touch the open project. A download becomes an asset by landing under the project's `assets/` folder (see [jsx/media.md](../jsx/media.md)).--## Format--Without `format`, the download prefers mp4/m4a streams and remuxes the result to `.mp4` (`--merge-output-format mp4`), falling back to the best available if no mp4 source exists. `audio` extracts audio only (yt-dlp `-x`) and takes precedence over the mp4 default; an explicit `format` opts out of both.--## Passthrough--`raw` is a list of yt-dlp flags appended verbatim. From a shell they go after `--`:--```sh-dapi fetch https://youtu.be/xyz -f "bv*+ba/b" -- --sponsorblock-remove all --limit-rate 2M-```--## Output--One JSON object (a single URL can yield several files, e.g. a playlist):--```ts-{ paths: string[] } // absolute paths of the files on disk, after any extraction / rename-```--The resolved path comes from yt-dlp's `after_move:filepath`, so it reflects the real name after audio extraction or renaming, not a guess.--## Errors--Fails when yt-dlp is not installed or not runnable, or when yt-dlp itself fails; its `ERROR` line is the message. Canceling the call kills the download.diff --git a/docs/skills/watch.md b/docs/skills/watch.mdindex 0e1d3d1f..c8761daf 100644--- a/docs/skills/watch.md+++ b/docs/skills/watch.md@@ -8,6 +8,8 @@ How to understand source material. Inspect only the modalities the question turn- **Transcribe speech.** For speech, `media_transcribe` writes the full transcript with word-level start/end times to a JSON file and returns its path — search the file for the line you need and read its times from there, rather than loading it whole.- **Sample the video against the audio.** Use `media_grab` to pull frames. When the audio has already pointed you at specific moments, feed those timestamps straight in from the transcript or listen output as `times` (e.g. `00:32`, `00:45`). When you need a visual pass without such cues, reach for `auto`: it scans the footage and keeps only the frames where the picture settles into a new visual state, dropping near-duplicates.+The `media_*` tools take a path or a direct media URL. Footage behind a page URL (YouTube, TikTok, Instagram, …) is downloaded first with `yt-dlp` from a shell — audio only (`yt-dlp -x --audio-format m4a -o talk.m4a <url>`) unless the question needs frames; see the [tool reference](https://github.com/yt-dlp/yt-dlp).+# Matching depth to the questionRead only as much of the footage as the answer requires — each pass costs time, and `media_listen` costs credits.diff --git a/packages/agent-chat/src/host/env.ts b/packages/agent-chat/src/host/env.tsindex 59cea3b5..0ad8f08c 100644--- a/packages/agent-chat/src/host/env.ts+++ b/packages/agent-chat/src/host/env.ts@@ -136,7 +136,7 @@ export function which(name: string, host: HostEnv): string | null {/*** Where a harness binary is: an explicit override (`DIFFUSION_CLAUDE_PATH`,- * matching the `YT_DLP_PATH` precedent), else `which`.+ * `DIFFUSION_CODEX_PATH`), else `which`.*/export function resolveBinary(name: "claude" | "codex", host: HostEnv): string | null {const override = host.env[`DIFFUSION_${name.toUpperCase()}_PATH`] ?? process.env[`DIFFUSION_${name.toUpperCase()}_PATH`];diff --git a/packages/dapi/src/catalog.ts b/packages/dapi/src/catalog.tsindex 39c70d60..f8262b2f 100644--- a/packages/dapi/src/catalog.ts+++ b/packages/dapi/src/catalog.ts@@ -22,7 +22,6 @@ import { mediaFilmstrip } from "./tools/media-filmstrip";import { mediaWaveform } from "./tools/media-waveform";import { mediaListen } from "./tools/media-listen";import { fonts } from "./tools/fonts";-import { fetchVideo } from "./tools/fetch";import { report } from "./tools/report";/**@@ -48,7 +47,6 @@ export const catalog = [logs,screenshot,fonts,- fetchVideo,report,] as const;diff --git a/packages/dapi/src/errors.ts b/packages/dapi/src/errors.tsindex 750784a0..0474a0cf 100644--- a/packages/dapi/src/errors.ts+++ b/packages/dapi/src/errors.ts@@ -22,7 +22,7 @@ export type DapiErrorCode =| "busy"/** The tool needs a signed-in account. */| "sign-in-required"- /** The platform or an external binary (yt-dlp, gh, osascript) cannot do it. */+ /** The platform or an external binary (gh, osascript) cannot do it. */| "unsupported"/** The caller or the app canceled the operation. */| "canceled";diff --git a/packages/dapi/src/index.ts b/packages/dapi/src/index.tsindex 29781afa..b996bfba 100644--- a/packages/dapi/src/index.ts+++ b/packages/dapi/src/index.ts@@ -83,5 +83,4 @@ export type MediaWaveformResult = ToolResult<"media_waveform">;export type MediaListenRequest = ToolArgs<"media_listen">;export type MediaListenResult = ToolResult<"media_listen">;export type FontsRequest = ToolArgs<"fonts">;-export type FetchRequest = ToolArgs<"fetch">;export type ReportRequest = ToolArgs<"report">;diff --git a/packages/dapi/src/tools/fetch.ts b/packages/dapi/src/tools/fetch.tsdeleted file mode 100644index d9a98f6b..00000000--- a/packages/dapi/src/tools/fetch.ts+++ /dev/null@@ -1,22 +0,0 @@-/* This Source Code Form is subject to the terms of the Mozilla Public- * 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 { z } from "zod";-import { defineTool } from "../tool";--export const fetchVideo = defineTool({- name: "fetch",- title: "Fetch video",- description:- "Download a video with yt-dlp (installed separately). Writes files to disk only and returns their paths (a single URL can yield several, e.g. a playlist).",- input: z.object({- url: z.string().min(1).describe("video or page URL to download"),- output: z.string().optional().describe("output file path or directory (yt-dlp -o template; default: yt-dlp's default)"),- format: z.string().optional().describe('yt-dlp format selector (default: prefer mp4), e.g. "bv*+ba/b"'),- audio: z.boolean().optional().describe("extract audio only (yt-dlp -x)"),- raw: z.array(z.string()).optional().describe('raw yt-dlp flags passed through, e.g. ["--sponsorblock-remove", "all"]'),- }),- output: z.object({ paths: z.array(z.string()) }),- environment: "main",-});