Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.
TypeScript cross-platformelectronffmpegopen-sourceproduct-demorustscreen-capturescreen-recorderscreen-recordingscreen-studioscreencastspeech-to-texttypescriptvideo-editingvideo-editorwaylandwgpuwhisper
fix(agent): preserve zoom transition warnings in filler cuts
auberginewly851e24b23b5e
diff --git a/electron/ai-edition/agent-tools.test.ts b/electron/ai-edition/agent-tools.test.tsindex ac07f209e..b62b33035 100644--- a/electron/ai-edition/agent-tools.test.ts+++ b/electron/ai-edition/agent-tools.test.ts@@ -2438,6 +2438,25 @@ describe("removeFillerWords", () => {expect(next.timeline.trimRanges).toHaveLength(before.timeline.trimRanges.length + 1);});+ it("preserves addTrim warnings when removing a filler cuts a zoom transition", () => {+ const before = repeatedWordDocument();+ before.timeline.trimRanges = [];+ const zoomed = run(before, "addZoom", { startSec: 2, endSec: 3, depth: 3 }).document;+ expect(zoomed).toBeDefined();+ if (!zoomed) throw new Error("Zoom fixture failed");+ const directTrim = run(zoomed, "addTrim", {+ assetId: "asset_1",+ clipId: "clip_1",+ startSec: 1,+ endSec: 1.2,+ });+ const expected = JSON.parse(directTrim.resultJson).cutTransitions;+ expect(expected.length).toBeGreaterThan(0);+ const removed = run(zoomed, "removeFillerWords", { assetId: "asset_1", wordIds: ["filler"] });+ expect(removed.ok).toBe(true);+ expect(JSON.parse(removed.resultJson).cutTransitions).toEqual(expected);+ });+it("refuses an invalid ID atomically, including when another ID is valid", () => {const before = repeatedWordDocument();const result = run(before, "removeFillerWords", { wordIds: ["filler", "missing"] });diff --git a/electron/ai-edition/agent-tools.ts b/electron/ai-edition/agent-tools.tsindex 4c41b2a28..ae7a61a70 100644--- a/electron/ai-edition/agent-tools.ts+++ b/electron/ai-edition/agent-tools.ts@@ -1672,6 +1672,7 @@ export function executeAgentTool(requested: wordIds.length,removedCount: removed.length,removed,+ ...cutTransitionsReport(document, current),}),summary: `removed ${removed.length} filler word${removed.length === 1 ? "" : "s"}`,};diff --git a/electron/ai-edition/deep-agent/service.ts b/electron/ai-edition/deep-agent/service.tsindex beab2b0d4..7bcfcedb7 100644--- a/electron/ai-edition/deep-agent/service.ts+++ b/electron/ai-edition/deep-agent/service.ts@@ -162,7 +162,8 @@ export const TOOL_DESCRIPTIONS: Record<string, string> = {setWordText:"Correct ONE word's text, by the id getTranscriptWords returns. This changes the TRANSCRIPT and nothing else: the captions follow it, the film is untouched and no audio is cut. Use it when the transcriber misheard something — a name, a technical term — and the user asks for it to read correctly. Passing an empty string BLANKS the word: it keeps its place in the media but leaves the captions, which is how a junk token like \"(inaudible)\" is removed without cutting the speech around it. Writing the transcriber's own text back clears the correction. This is NOT how you make a spoken word go away — that removes only the label and leaves the film saying it; use addTrim, which cuts the audio with it.",removeFillerWords:- "Remove only the spoken filler-word occurrences selected by `wordIds` from getTranscriptWords. Pass the same `assetId` as that read: word IDs are numbered independently in each asset. Omit assetId only when the IDs are unique across all transcripts. Use ONLY when the user explicitly asks for filler-word cleanup. Read words in context and choose IDs yourself; the executor does not classify speech or remove every matching text. It resolves each ID to one recorded asset, valid source timestamps, and exactly one fully covering clip, then adds non-destructive trims. If any ID or target is invalid or ambiguous, nothing changes. The result lists each word and the ACTUAL trim span (which addTrim may shape), asset, clip and trim ID; report only those results.",+ "Remove only the spoken filler-word occurrences selected by `wordIds` from getTranscriptWords. Pass the same `assetId` as that read: word IDs are numbered independently in each asset. Omit assetId only when the IDs are unique across all transcripts. Use ONLY when the user explicitly asks for filler-word cleanup. Read words in context and choose IDs yourself; the executor does not classify speech or remove every matching text. It resolves each ID to one recorded asset, valid source timestamps, and exactly one fully covering clip, then adds non-destructive trims. If any ID or target is invalid or ambiguous, nothing changes. The result lists each word and the ACTUAL trim span (which addTrim may shape), asset, clip and trim ID; report only those results. " ++ CUT_TRANSITIONS_RESULT,addTrim: `Add ONE trim range: a cut of a span inside a clip (this source-time span will not be played or exported) that does NOT split the clip. Times are in seconds of the asset's source time. This is the preferred (and for 'remove silences' requests, the only) way to handle silences; it preserves the user's placed clips and only adds a cut. When you have several cuts to make, use addTrims and send them together — this one is for a single cut or a later correction. A cut belongs to ONE clip: \`clipId\` is inferred when a single clip covers the range, but when several clips draw on the same asset over it the call FAILS and lists them — pass the \`clipId\` you mean (ids come from getCurrentDocument). ${ZOOM_TRANSITIONS_NOTE} ${CUT_TRANSITIONS_RESULT}`,addTrims: `Add MANY trim ranges in one call: \`ranges\` is a list, each entry taking exactly the fields addTrim takes. Use this whenever you have more than one cut to make — 'remove the silences' on a half-hour recording is hundreds of cuts, and sending them one at a time costs one round trip each. Each range stands or falls ALONE: one that cannot be placed is refused by itself and listed in \`refused\` with its index and the reason, while every other range is still applied. Nothing is rolled back, so a single bad bound never costs you the rest. The result leads with requested / appliedCount / refusedCount so you can see a partial outcome without re-reading the document — report what was refused rather than claiming the whole list landed. ${ZOOM_TRANSITIONS_NOTE} Each applied entry carries the same \`cutTransitions\` warning addTrim reports.`,setTrim: `Move or resize an existing trim range by id. Times are source-time seconds. The cut follows to whichever clip the new range lands in, when that clip is unambiguous. ${ZOOM_TRANSITIONS_NOTE} ${CUT_TRANSITIONS_RESULT}`,