Drive Google Flow from Claude, Codex or a local control panel, on Mac or Windows — using your Google AI subscription credits instead of the pay-per-use video API. No browser extension.
flow_extend, the docked agent panel, and the three models Flow retires on Dec 5
GTAI-127fa15c6ec7e
diff --git a/.gitignore b/.gitignoreindex f06235c..0ca39c0 100644--- a/.gitignore+++ b/.gitignore@@ -1,2 +1,3 @@node_modulesdist+.DS_Storediff --git a/CLAUDE.md b/CLAUDE.mdindex 411843c..1571f67 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -742,3 +742,33 @@ The preview tool could not read the project while it lived in ~/Desktop; check tscene), tile menu and the Download submenu (1K/2K; 4K disabled). The left menu of a project with no videos oruploads shows no Videos/Uploads entries, plus a new `Create tool`. Checked with a test MCP: lengths quoted 21(Omni 1.2 7 s 720p), 14 (12 s 360p) and 10 (Omni 1.1 6 s) with max_credits 0, and a free image made end to end; then a 5-image agent batch (5 of 5 from the agent, in order, agent off and confirm back on Always afterwards, 0 credits) and one paid Omni 1.2 Flash clip, 3 s at 360p for 3 credits (the user's OK): 360x640, 3.0 s with sound, clean at 8 frames a second.+- EXTEND (mapped live 2026-11-24; BUILT as `flow_extend` / runExtend, verified the same day). Click a video tile -> /project/<id>/edit/<uuid> (the+ scene editor; buttons unchanged since 2026-11-21). The timeline clip is `.timeline-contents [cdkdrag]` (class `clip`;+ right-click menu: Copy, Paste, Save to Project, Download, Delete). The `+` after it is button `Add clip`, which now+ opens a menu: `Add clip` and `Extend` (menuitem text "keyboard_double_arrow_right Extend", so match /Extend/).+ Extend mode: a grey "Extend" block appears after the clip on the timeline, the prompt box becomes textbox+ "What happens next?", the chips read `Settings trigger` "4s", "Omni 1.2 Flash" and `Exit extend mode` ("Extend x").+ The Settings trigger opens slider `Extend Length` (input range min 3, max 10, step 1, value = seconds, default 4)+ with the quote link "<N> credits": 1 credit a second on a 360p clip (3 s = 3 ... 10 s = 10); a 720p clip not yet+ quoted. `Exit extend mode` leaves it with nothing added. Two paid runs (3 credits each, the user's OK): rendering takes+ ~40 s, the timeline clip carries class `is-extend-generating` and the view shows "NN%"; then "Total duration" grows,+ a `Redo Extend` button appears, and the result is the SAME clip in the SAME grid tile (a "stacks" icon, no new tile),+ so downloading that tile gives the whole longer clip: 3 -> 6 -> 9.0 s, joins seamless at 8 frames a second. Escape+ with no popover open LEAVES the editor, so runExtend presses it only while the slider shows. core.extend frames the+ prompt the way the user's own extensions worked: "Continue the scene seamlessly for N seconds ..." + "Keep the same+ characters, look, style, lighting and camera" unless the prompt already says so.+- DOCKED AGENT PANEL (2026-11-24): an agent conversation now stays open as a panel on the right (`flow-agent-panel`+ with `.agent-panel-header`: "Open session history", "Agent settings", "Close"); while it shows, the page's prompt box,+ Settings trigger and Flow Agent switch are gone. One appeared mid-session with a "Develop a storyboard" conversation+ nobody typed, and agent mode was found ON. closeAgentPanel() presses its Close (ends nothing); runGeneration and+ runExtend close it and switch the agent off before starting, setAgentMode closes it on every try, and+ closeAgentSession closes it too. With the agent on and no conversation the composer reads "What's next?".+- RETIRED MODELS REMOVED (2026-12-04, the user's call): Omni 1.1 Flash, Veo 3.1 Fast and Veo 3.1 Quality leave Flow on+ 2026-12-05. Studio lists only Omni 1.2 Flash and Veo 3.1 - Lite, and a panel whose saved state names a retired model+ switches to the default at load (without that VIDEO_COST[model] is undefined and the whole page dies). Omni 1.2+ tripled the price of an 8 s 720p clip (24, was 12), so the guides' examples are now 360p. From Google's help page+ (support.google.com/flow/answer/16526234): Extend is 1 credit a second at 360p and 3 at 720p, and needs a paid AI plan;+ upscaling to 1080p is free up to 10 s, then 1 credit a second, also paid plans only. There is no audio or+ text-to-speech price because Flow makes no audio on its own; voices work only inside video generations.+- NEVER TOUCH THE OPEN FLOW WINDOW JUST TO LOOK SOMETHING UP (2026-12-02): it is shared by every chat and app. Read+ Google's help pages instead.diff --git a/GETTING-STARTED.md b/GETTING-STARTED.mdindex d312035..41fd566 100644--- a/GETTING-STARTED.md+++ b/GETTING-STARTED.md@@ -11,9 +11,9 @@ talking to an AI assistant, or click through it yourself in its control panel, *## 1. What it costs**Flow itself: free.** All you need is a Google account (a Gmail). Flow gives every account **50 free-credits a day**; unused credits don't carry over. Stills cost nothing, and a short video clip is about 7–12-credits, so a free account makes a few clips a day. A paid Google AI plan adds more credits and unlocks-1080p downloads.+credits a day**; unused credits don't carry over. Stills cost nothing. Video costs 1 credit a second at 360p+and 3 at 720p, so an 8-second clip is 8 or 24 credits and a free account makes a few clips a day. A paid Google+AI plan adds more credits and unlocks 1080p downloads.**An AI assistant: optional, and you only need one.**@@ -183,7 +183,7 @@ asks before spending.1. *"Check my Flow session."*2. *"Create a character called Pip, a small lamplighter in a flat cartoon style."* (free)3. *"Draw three stills with Pip: a dark rooftop, him lighting a lamp, the whole hillside glowing."* (free)-4. *"Turn the first still into an 8-second clip at 720p."* (about 12 credits)+4. *"Turn the first still into an 8-second clip at 360p."* (8 credits; 24 at 720p)5. *"Record a warm narration for it."* (free)6. *"Put the narration on the clip."* (free)7. *"Add bold captions."* (free)diff --git a/OVERVIEW.md b/OVERVIEW.mdindex af6e6b8..baae63b 100644--- a/OVERVIEW.md+++ b/OVERVIEW.md@@ -74,6 +74,7 @@ Mac is the tested platform. Windows support is new and hasn't been tried on a re| **Shot Builder** | The main one. Makes a still or a video clip for each scene: opening frame, closing frame, up to three look references, continue-from-last-clip, a camera move, aspect ratio, length and quality. Before spending a single credit it reads the price Flow itself quotes and stops if it's over your limit || **Bulk Storyboard** | Hands up to 50 stills to Flow's own assistant, which draws them all at once in about a minute. Free || **Continue a Shot** | Picks up on the real last frame of a clip you already made, so the two play as one unbroken take and you cannot see the join. This is how you follow someone across a cut without them changing |+| **Extend a Shot** | Makes a clip you already have longer, 3 to 10 seconds at a time, carrying straight on from where it ends. Do it again and again for one long continuous shot. It reads Flow's price first and stops if it's over your limit. Google needs a paid AI plan for this one || **Restyle Clip** | Takes a clip you already made and changes it: relight it, change the weather, swap a background. Costs about 20 credits, and Flow shows no price beforehand, so this one always asks you first || **Camera Move Library** | 39 ready-written camera directions: 360° orbit, crash zoom, pull-back reveal, drone fly-through, seamless loop, match cut, logo resolve, and more |diff --git a/README.md b/README.mdindex 51afd75..bb2bd96 100644--- a/README.md+++ b/README.md@@ -126,8 +126,9 @@ Nothing below costs a credit until step 4, and the assistant asks before spendinwhole hillside glowing. Match each one to the last."* Free: stills cost nothing, so get the lookright here before spending.4. **Shoot it.** *"Turn those into three 10-second shots, each starting where the last one ended,- 720p, no more than 15 credits each."* This spends credits. The price is read from Flow's own- quote first and the scene is skipped if it is over your cap.+ 360p, no more than 10 credits each."* This spends credits: 30 in all, inside the 50 free ones a day+ (720p costs three times as much). The price is read from Flow's own quote first and the scene is+ skipped if it is over your cap.5. **Narrate it.** *"Record this line with a warm documentary voice."* Free, any length.6. **Cut it.** *"Join the three shots under the narration, don't freeze the last frame."*The finished file lands in `~/flow-mcp-out/<project>/`.@@ -198,6 +199,7 @@ agree on what is running. That API listens on 127.0.0.1 only and needs a per-run| `flow_trash` | Move an image, video or scene in the Flow project to Flow's Trash, where it can be restored. Exact title only; refuses if two items share it; never deletes permanently || `flow_agent_images` | Fast image batch: hands up to 50 scenes to Flow's own Agent mode, rendered in parallel (20 images in ~204 s), 0 credits. The finished images are gathered into a Flow collection and come down as ONE ZIP of originals, checked against the batch and downloaded again if one is missing; if that step fails, the batch stops and says where the images are, and never downloads them one by one. If Agent mode cannot be used at all, the batch stops with the reason. Each image is matched back to its scene by its stored prompt, so file numbers are right in any finish order. Scenes the agent drops are re-asked of it (up to 2 rounds), then re-run one by one. `references` attaches characters, places and objects once in the agent's composer (like its + button), and `scene_references` says which scenes use which, so a whole story stays on-model; scenes made one by one keep their references || `flow_edit` | Video-to-video edit of a clip already in the project (relight, weather, remove objects). Flow shows no quote first; about 20 credits for a 4 s clip |+| `flow_extend` | Make a clip in the project longer with Flow's own Extend: 3 to 10 s at a time, continuing seamlessly from its end into the same clip, so call it again for a longer single shot. The price is read first (1 credit a second at 360p, 3 at 720p) and `max_credits` applies. Google needs a paid AI plan for this one || `flow_continue` | Start a clip from the last frame of an existing one **with a character or your avatar still attached**. The composer allows a start frame or attached characters, never both, so this drives Flow's agent mode, which does both. No quote beforehand || `flow_character` | Create a reusable character from a description (Flow draws the portrait) or an image, with a personality and a stock voice; use it as `asset:<name>` || `flow_character_edit` | Restyle an existing character in place (free) and save the new portrait; name, personality and voice are kept, so every scene referencing it updates. Pass `look` with the updated description; with only a name it re-saves the current portrait |diff --git a/src/core.ts b/src/core.tsindex 9b6fb4b..2bedbc0 100644--- a/src/core.ts+++ b/src/core.ts@@ -8,7 +8,7 @@ import { KOKORO_DEFAULT_VOICE, KOKORO_MB, KOKORO_VOICES, kokoroReady, speakWithKimport { extractFirstFrame, extractFrameAt, extractLastFrame } from "./chain.js";import { burnCaptions, captionedName, captionSetup, previewCaptions, transcribe } from "./captions.js";import { presenter } from "./presenter.js";-import { characterLook, createCharacter, createProject, downloadAsset, downloadCollection, trashAsset, editCharacter, getFlowState, listAssets, forgetCharacter, listCharacters, rememberCharacter, runAgentBatch, runContinue, runEdit, runGeneration } from "./flow.js";+import { characterLook, createCharacter, createProject, downloadAsset, downloadCollection, trashAsset, editCharacter, getFlowState, listAssets, forgetCharacter, listCharacters, rememberCharacter, runAgentBatch, runContinue, runEdit, runExtend, runGeneration } from "./flow.js";import { JobQueue, type Job } from "./queue.js";import { BIN, COMPUTER, moveToBin } from "./platform.js";import { TECHNIQUES, techniqueById } from "./techniques.js";@@ -24,9 +24,9 @@ const sceneSchema = z.object({model: z.string().optional()- .describe("Model label as shown in Flow, e.g. 'Omni 1.2 Flash' (Flow's default video model since 2026-11-21), 'Veo 3.1 - Lite', 'Nano Banana Pro'. Omni 1.1 Flash, Veo 3.1 - Fast and Veo 3.1 - Quality leave Flow on Dec 5. Images default to the newest Nano Banana (2.1 today); video omitted keeps Flow's current model."),+ .describe("Model label as shown in Flow, e.g. 'Omni 1.2 Flash' (Flow's default video model since 2026-11-21), 'Veo 3.1 - Lite', 'Nano Banana Pro'. Images default to the newest Nano Banana (2.1 today); video omitted keeps Flow's current model."),aspect_ratio: z.enum(["16:9", "9:16", "1:1", "4:3", "3:4"]).optional().describe("Video supports 16:9 and 9:16 only."),- duration: z.number().int().min(3).max(15).optional().describe("Video length in seconds. Omni 1.2 Flash: any whole second from 3 to 15. Omni 1.1 Flash: 4, 6, 8 or 10. Veo 3.1 clips are fixed at 8 s."),+ duration: z.number().int().min(3).max(15).optional().describe("Video length in seconds. Omni 1.2 Flash: any whole second from 3 to 15. Leave it out for Veo 3.1 - Lite."),resolution: z.enum(["360p", "720p"]).optional().describe("Video resolution. Omni models only."),max_credits: z.number().int().min(0).default(25).describe("Safety cap: the scene is skipped (nothing spent) if Flow quotes more credits than this."),variants: z.number().int().min(1).max(4).optional().describe("Outputs per prompt (each one spends credits). Default 1."),@@ -338,6 +338,17 @@ export const shapes = {.describe("Must be true. Flow shows no quote for edits, so max_credits cannot protect you: a 4 s clip cost 20 credits when measured. The real cost is reported on the finished job."),download_quality: z.enum(["original", "upscaled"]).optional(),},+ extend: {+ project: z.string().min(1).describe("Local folder for the extended clip."),+ asset: z.string().min(1).describe("Title (or title prefix) of a video already in the Flow project; see flow_assets. Flow adds the new seconds to this same clip, so extend it again for a longer shot."),+ prompt: z+ .string()+ .min(1)+ .describe("What happens next, as one continuous moment: who does what, any spoken line in quotes at the moment it is said. 'Continue the scene seamlessly for N seconds' and 'keep the same characters, style and lighting' are added unless the prompt already says so."),+ seconds: z.number().int().min(3).max(10).default(8).describe("How many seconds to add, 3 to 10 per extension."),+ max_credits: z.number().int().min(0).default(25).describe("Safety cap: nothing is generated if Flow quotes more than this. 1 credit a second on a 360p clip, 3 on a 720p one: 10 s at 720p is 30, above the default."),+ download_quality: z.enum(["original", "upscaled"]).optional(),+ },continue_shot: {project: z.string().min(1).describe("Local folder for the new clip."),from_asset: z.string().min(1).describe("Title (or title prefix) of the video to continue from; see flow_assets."),@@ -449,6 +460,7 @@ export interface Core {characters(): Promise<unknown>;character_edit(a: Args<"character_edit">): Promise<unknown>;edit(a: Args<"edit">): Promise<unknown>;+ extend(a: Args<"extend">): Promise<unknown>;trash(a: Args<"trash">): Promise<unknown>;discard(a: Args<"discard">): Promise<unknown>;set_key(a: Args<"set_key">): Promise<unknown>;@@ -508,6 +520,7 @@ export class LocalCore implements Core {if (job.params.continue_from) return runContinue(job);if (job.params.agent_scenes) return runAgentBatch(job);if (job.params.edit_asset) return runEdit(job);+ if (job.params.extend_asset) return runExtend(job);return runGeneration(job);});@@ -720,6 +733,18 @@ export class LocalCore implements Core {return { output_dir, jobs: [jobView(job)] };}+ // Lengthens a clip with Flow's own Extend, which continues it seamlessly in the same tile. The prompt is framed the way+ // that worked in the user's own tests: "Continue the scene seamlessly for N seconds ... Keep the same ... style".+ async extend({ project, asset, prompt, seconds, max_credits, download_quality }: Args<"extend">) {+ const output_dir = projectDir(project);+ const body = prompt.trim().replace(/\.?$/, ".");+ const opening = /^\s*continue\b/i.test(body) ? "" : `Continue the scene seamlessly for ${seconds} seconds, picking up exactly where the clip ends. `;+ const keep = /\b(keep|maintain)\b[^.]*\b(same|style|look)\b/i.test(body) ? "" : " Keep the same characters, look, style, lighting and camera as the clip so far.";+ const text = `NO SUBTITLES, NO CAPTIONS, NO TEXT OF ANY KIND ON SCREEN. ${opening}${body}${keep} NO TEXT ON SCREEN: never add subtitles, captions, titles, speech transcripts, words or letters anywhere in the picture, at any moment; any speech is heard only, never written.`;+ const job = this.queue.add({ prompt: text, type: "video", max_credits, duration: seconds, extend_asset: asset, download_quality, output_dir, file_stem: this.nextStem(output_dir, "extend") });+ return { output_dir, jobs: [jobView(job)] };+ }+// Flow's composer takes a start frame OR a character, never both; agent mode takes both, so this goes that way.async continue_shot({ project, from_asset, prompt, attach, aspect_ratio, mode, download_quality, force }: Args<"continue_shot">) {// A lost queue entry is not proof that nothing ran: when the owner process is replaced mid-job the job vanishesdiff --git a/src/flow.ts b/src/flow.tsindex 38dffdc..31a8368 100644--- a/src/flow.ts+++ b/src/flow.ts@@ -76,6 +76,17 @@ async function pickAgentImageModel(page: Page): Promise<void> {// The agent settings panel replaces the composer, hiding the Agent button. Back leaves it; since 2026-11-21 the defaults// sit one level deeper ("Image defaults"), so it can take two Backs. Changes there save as they are made.+// Since 2026-11-24 an agent conversation stays open as a panel docked on the right (`flow-agent-panel`, header with+// "Open session history", "Agent settings", "Close"). While it shows, the page's own prompt box, Settings trigger and+// Flow Agent switch are gone, so every job that needs the plain composer closes it first. Closing it ends nothing.+async function closeAgentPanel(page: Page): Promise<void> {+ const close = page.locator("flow-agent-panel .agent-panel-header").getByRole("button", { name: "Close", exact: true });+ if (await close.isVisible().catch(() => false)) {+ await close.click({ timeout: 5000 }).catch(() => {});+ await pause(page, 1000);+ }+}+async function closeAgentSettings(page: Page): Promise<void> {const back = page.locator("flow-agent-panel").getByRole("button", { name: "Back", exact: true });for (let i = 0; i < 3 && (await back.isVisible().catch(() => false)); i++) {@@ -380,7 +391,7 @@ async function pickModel(page: Page, model: string): Promise<void> {await pause(page, 700);}-// Omni 1.1 Flash offers 4s/6s/8s/10s radios. Omni 1.2 Flash (2026-11-21) has a "Length" slider instead: an+// Omni 1.1 Flash (gone from Flow on 2026-12-05) had 4s/6s/8s/10s radios. Omni 1.2 Flash has a "Length" slider: an// <input type=range> 0..12 that reads "Length 3 Sec" .. "Length 15 Sec" in the popover. The slider's own value is not// in seconds, so it is moved by keys from its first step and the popover's own "<N> Sec" text is checked.async function pickDuration(page: Page, seconds: number): Promise<void> {@@ -1137,8 +1148,8 @@ export async function runGeneration(job: Job): Promise<string[]> {const s = job.params;await ensureProjectGrid(page);- const agent = agentToggle(page);- if ((await agent.getAttribute("aria-pressed")) === "true") await agent.click();+ await closeAgentPanel(page);+ await setAgentMode(page, false);const clear = page.getByRole("button", { name: "Clear prompt" });if (await clear.isVisible().catch(() => false)) await clear.click();@@ -1676,6 +1687,126 @@ export async function runEdit(job: Job): Promise<string[]> {return saved;}+// Flow's Extend (mapped and run live 2026-11-24): in the clip's scene editor, the `Add clip` button after the timeline+// clip opens a menu with "Extend"; the prompt box becomes "What happens next?", and the `Settings trigger` opens an+// "Extend Length" slider (3-10, value = seconds) with a quote. Flow adds the new seconds to the SAME clip and the same+// grid tile (no new tile), so the finished file is that tile downloaded again: 3 s + 3 s came back as one 6.0 s clip+// with a seamless join. Escape with no menu open leaves the editor, so popovers are closed by clicking their trigger.+export async function runExtend(job: Job): Promise<string[]> {+ const state = await getFlowState();+ if (!state.signedIn || !state.inProject) throw new Error(state.hint);+ const page = await getFlowPage();+ const s = job.params;+ const title = s.extend_asset!;+ const seconds = s.duration ?? 8;++ await ensureProjectGrid(page);+ await closeAgentPanel(page);+ await setAgentMode(page, false);+ const matches = (a: FlowAsset) => a.kind === "video" && a.name.toLowerCase().startsWith(title.toLowerCase());+ const found = (await scanGrid(page, (assets) => assets.some(matches))).find(matches);+ if (!found) throw new Error(`No video whose title starts with "${title}". Use flow_assets to list titles.`);+ const tile = tileOf(page, found);+ await tile.scrollIntoViewIfNeeded();+ await tile.click();+ await page.waitForURL(/\/edit\//, { timeout: 20_000 });+ await pause(page, 2500);++ const total = async () => /Total duration:?\s*(\d+):(\d+):(\d+)/.exec(await page.locator("main").first().innerText())?.slice(1).map(Number);+ const before = await total();+ const leave = async () => {+ const exit = page.getByRole("button", { name: "Exit extend mode" });+ if (await exit.isVisible().catch(() => false)) await exit.click().catch(() => {});+ await page.getByRole("button", { name: "Back button to go to previous page" }).click().catch(() => {});+ await pause(page, 2000);+ };++ await page.getByRole("button", { name: "Add clip" }).last().click();+ await page.getByRole("menuitem", { name: /Extend/ }).click({ timeout: 8000 });+ const box = page.getByRole("textbox", { name: "What happens next?" });+ await box.waitFor({ state: "visible", timeout: 10_000 });++ // Length and quote. The slider's value is the length in seconds.+ const trigger = page.getByRole("button", { name: "Settings trigger" });+ await trigger.click();+ const slider = page.getByRole("slider", { name: "Extend Length" });+ await slider.waitFor({ state: "visible", timeout: 8000 });+ // One Escape closes this popover (checked live); with nothing open, Escape would leave the editor, so only then.+ const closePopover = async () => {+ if (!(await slider.isVisible().catch(() => false))) return;+ await page.evaluate(() => (document.activeElement as HTMLElement | null)?.blur?.());+ await page.keyboard.press("Escape");+ await slider.waitFor({ state: "hidden", timeout: 4000 }).catch(() => {});+ };+ const min = Number(await slider.getAttribute("min"));+ const max = Number(await slider.getAttribute("max"));+ if (seconds < min || seconds > max) {+ await closePopover();+ await leave();+ throw new Error(`Flow extends by ${min} to ${max} s at a time; ${seconds} s is outside that. Nothing was generated.`);+ }+ await slider.focus();+ await page.keyboard.press("Home");+ for (let i = 0; i < seconds - min; i++) await page.keyboard.press("ArrowRight");+ await pause(page, 500);+ const quote = await page.getByRole("link", { name: /^\d[\d,]*\s+credits?$/ }).first().innerText();+ const cost = Number(quote.match(/\d+/)?.[0] ?? NaN);+ const landed = Number(await slider.inputValue());+ await closePopover();+ await pause(page, 400);+ if (landed !== seconds) {+ await leave();+ throw new Error(`Flow's Extend Length slider did not land on ${seconds} s (it shows ${landed} s). Nothing was generated.`);+ }+ if (Number.isNaN(cost) || cost > s.max_credits) {+ await leave();+ throw new Error(`Flow quotes ${quote} for this extension, above max_credits=${s.max_credits}. Nothing was generated. Raise max_credits or extend by fewer seconds.`);+ }+ job.credits = cost;++ await box.click();+ await page.keyboard.type(s.prompt.replace(/\s*\n+\s*/g, " ").trim(), { delay: 8 });+ await pause(page, 600);+ const start = page.getByRole("button", { name: "Start generation" });+ if (!(await start.isEnabled())) {+ await leave();+ throw new Error("Flow did not accept the extension prompt (Start generation stayed disabled). Nothing was generated.");+ }+ await start.click();++ // While it renders the timeline clip carries the class `is-extend-generating` and the view shows "NN%".+ const generating = page.locator(".timeline-contents .is-extend-generating");+ const deadline = Date.now() + EDIT_TIMEOUT_MS;+ let seen = false;+ for (;;) {+ await pause(page, 3000);+ const busy = (await generating.count()) > 0;+ const text = await page.locator("main").first().innerText();+ const pct = text.match(/(\d+)%/)?.[0];+ job.progress = pct;+ if (busy || pct) seen = true;+ else if (seen) break;+ else if (Date.now() > deadline - EDIT_TIMEOUT_MS + 20_000) {+ const failure = text.split("\n").find((l) => FAILURE_TEXT.test(l));+ throw new Error(`Flow did not start the extension${failure ? `: ${failure.slice(0, 300)}` : "."} Check the clip in Flow before trying again.`);+ }+ if (Date.now() > deadline) throw new Error("Timed out waiting for Flow to finish the extension. Check the clip in Flow before trying again: it may still finish and be charged.");+ }+ job.progress = undefined;+ const after = await total();+ const secs = (t?: number[]) => (t ? t[0] * 60 + t[1] : NaN);+ if (before && after && !(secs(after) > secs(before))) {+ const failure = (await page.locator("main").first().innerText()).split("\n").find((l) => FAILURE_TEXT.test(l));+ await page.getByRole("button", { name: "Back button to go to previous page" }).click().catch(() => {});+ throw new Error(`Flow finished but the clip did not get longer (still ${secs(before)} s)${failure ? `: ${failure.slice(0, 300)}` : ""}.`);+ }++ await page.getByRole("button", { name: "Back button to go to previous page" }).click();+ await pause(page, 2500);+ mkdirSync(s.output_dir, { recursive: true });+ return downloadAsset(found.name, join(s.output_dir, s.file_stem), s.download_quality ?? "original");+}+// The agent session panel hides the composer, so a toggle attempted underneath it does nothing at all. Leaving agent// mode on then breaks the NEXT job, which expects the plain composer - a free character build failed that way. So this// confirms the toggle actually landed rather than assuming the click worked.@@ -1687,6 +1818,7 @@ async function setAgentMode(page: Page, on: boolean): Promise<void> {for (let attempt = 0; attempt < 3; attempt++) {await clearBackdrops(page);await closeAgentSettings(page);+ await closeAgentPanel(page);if (((await agent.getAttribute("aria-pressed").catch(() => null)) === "true") === on) return;await agent.click({ timeout: 8000 }).catch((err: Error) => {const lines = err.message.split("\n").map((l) => l.trim());@@ -1739,6 +1871,7 @@ async function closeAgentSession(page: Page): Promise<void> {await page.getByRole("button", { name: "Close", exact: true }).click();await pause(page, 1000);}+ await closeAgentPanel(page);const clear = page.getByRole("button", { name: "Clear prompt" });if (await clear.isVisible().catch(() => false)) await clear.click();else {diff --git a/src/index.ts b/src/index.tsindex 0f221d0..a039d7d 100644--- a/src/index.ts+++ b/src/index.ts@@ -189,6 +189,18 @@ server.registerTool((args) => reply(core.edit(args)),);+server.registerTool(+ "flow_extend",+ {+ title: "Extend a video",+ description:+ "Lengthen a clip already in the Flow project with Flow's own Extend: it continues the shot seamlessly from the clip's end, 3 to 10 s at a time, into the SAME clip, so extend it again for a longer continuous shot. The finished, longer clip is downloaded. Flow quotes the price first and max_credits is enforced (1 credit a second on a 360p clip, 3 on a 720p one). Google offers Extend only with a paid Google AI plan. Spends credits, so ask the user before calling. Queued; use flow_wait for the file.",+ inputSchema: shapes.extend,+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },+ },+ (args) => reply(core.extend(args)),+);+server.registerTool("flow_continue",{diff --git a/src/playbook.ts b/src/playbook.tsindex d4871ad..473e20d 100644--- a/src/playbook.ts+++ b/src/playbook.ts@@ -11,10 +11,7 @@ export const PLAYBOOK = {],models: {"Omni 1.2 Flash": "Flow's default video model since 2026-11-21: better character and scene consistency, fewer jump cuts. Any length from 3 to 15 s. 720p costs 3 credits a second up to 10 s, then 6 a second (4 s = 12, 8 s = 24, 10 s = 30, 15 s = 60); 360p costs a third of that (10 s = 10, 15 s = 20). Size each clip to its words: past 10 s every second costs double. A 10 s clip is above the default max_credits of 25, so raise it (with the user's OK) or use 360p for drafts.",- "Omni 1.1 Flash": "Leaves Flow on Dec 5. 4/6/8/10 s; 720p 7/10/12/15 credits, 360p 4/5/6/7.","Veo 3.1 - Lite": "10 credits, fixed 8s.",- "Veo 3.1 - Fast": "Leaves Flow on Dec 5. 20 credits, fixed 8s.",- "Veo 3.1 - Quality": "Leaves Flow on Dec 5. 100 credits, fixed 8s. Needs max_credits raised explicitly.","Nano Banana (newest, 2.1 today)": "Images, 0 credits; picked automatically for images. Use it to make keyframes and product stills before spending on video. Pro and 2 Lite are also 0 credits, when named.",},prompt_order: "subject and action -> shot size and camera move -> location -> visual style -> lighting -> sound/dialogue",@@ -53,5 +50,6 @@ export const PLAYBOOK = {"chain_previous: true starts a scene on the last frame of the scene before it, giving one continuous take across clips.","first_frame + last_frame makes Flow animate between two stills; generate both stills as free images first for controlled transitions.","reference_images (max 3) keep a product or person consistent without fixing the first frame.",+ "flow_extend lengthens a clip in place with Flow's own Extend: 3 to 10 s at a time, seamless, into the same clip, so call it again on the same title for a longer single shot (generate a 10 s first segment, then extend it 10 s at a time). Write each extension as what happens next: 'Continue the scene seamlessly for 10 seconds. <who does what, spoken lines in quotes at their moment>. Keep the same style, character design and lighting.' The tool adds the opening and the keep-the-same line if missing. One clear beat per extension, and say what the camera does.",],};diff --git a/src/queue.ts b/src/queue.tsindex 029f4e5..222b7b1 100644--- a/src/queue.ts+++ b/src/queue.ts@@ -18,6 +18,8 @@ export interface SceneParams {chain_from?: string;reference_from?: string;edit_asset?: string;+ // Title of a video in the Flow project to lengthen with Flow's Extend; `duration` is the seconds to add (3-10).+ extend_asset?: string;agent_scenes?: string[];// The scene number each agent scene is saved as. A retry of scenes 7 and 12 keeps scene-07 and scene-12; without it// the numbers run on from file_stem.diff --git a/src/remote.ts b/src/remote.tsindex cb3bd1f..df537e1 100644--- a/src/remote.ts+++ b/src/remote.ts@@ -31,6 +31,7 @@ export class RemoteCore implements Core {characters = () => call("characters", {});character_edit = (a: unknown) => call("character_edit", a);edit = (a: unknown) => call("edit", a);+ extend = (a: unknown) => call("extend", a);trash = (a: unknown) => call("trash", a);discard = (a: unknown) => call("discard", a);set_key = (a: unknown) => call("set_key", a);diff --git a/studio/index.html b/studio/index.htmlindex ce8cec8..b67d058 100644--- a/studio/index.html+++ b/studio/index.html@@ -453,7 +453,7 @@ const guard = () => { if (!LIVE) { toast("Not connected — start Flow Studio fi// Omni 1.2 Flash (Flow's default since 2026-11-21) takes any length from 3 to 15 s: 720p is 3 credits a second up to 10 s,// then 6 a second; 360p a third of that. Quotes read from Flow's own settings popover.const omni12 = (res, d) => (res === "360p" ? (d <= 10 ? d : 10 + 2 * (d - 10)) : d <= 10 ? 3 * d : 30 + 6 * (d - 10));-const VIDEO_COST = { "Omni 1.2 Flash": omni12, "Omni 1.1 Flash": { "360p": { 4: 4, 6: 5, 8: 6, 10: 7 }, "720p": { 4: 7, 6: 10, 8: 12, 10: 15 } }, "Veo 3.1 - Lite": 10, "Veo 3.1 - Fast": 20, "Veo 3.1 - Quality": 100 };+const VIDEO_COST = { "Omni 1.2 Flash": omni12, "Veo 3.1 - Lite": 10 };const blank = () => ({ prompt: "", technique: "", chain: false, match: false, first: null, last: null, refs: [] });const DEFAULTS = {tab: "cast",@@ -466,6 +466,7 @@ const DEFAULTS = {const S = Object.assign(structuredClone(DEFAULTS), JSON.parse(localStorage.getItem("flow-studio-v2") || "{}"));const save = () => localStorage.setItem("flow-studio-v2", JSON.stringify(S));if (!["kokoro", "gemini"].includes(S.narrate.engine)) S.narrate.engine = "kokoro"; // the computer-voice engine is gone+if (!VIDEO_COST[S.shots.model]) S.shots.model = DEFAULTS.shots.model; // Omni 1.1, Veo Fast and Veo Quality left Flow on 2026-12-05let TECH = [], VOICES = { kokoro: [], gemini: [] }, CAST = [], LIB = [], GAL = [], castImage = null, pickTarget = null, busy = false;/* ---------- tabs ---------- */@@ -488,14 +489,14 @@ const hashTab = () => { const t = location.hash.slice(1); return $(`#tabs buttonaddEventListener("hashchange", () => { const t = hashTab(); if (t) showTab(t); });/* ---------- segmented controls ---------- */-// Lengths offered per model. Omni 1.2 takes any second from 3 to 15; these are the useful steps.-const durations = () => (S.shots.model.startsWith("Omni 1.2") ? [4, 6, 8, 10, 12, 15] : [4, 6, 8, 10]);+// Omni 1.2 takes any second from 3 to 15; these are the useful steps. Off for Veo, which has no length setting.+const DURATIONS = [4, 6, 8, 10, 12, 15];const SEGS = {f_aspect: { get: () => S.frames.aspect, set: (v) => (S.frames.aspect = v), opts: ["16:9", "9:16", "1:1", "4:3", "3:4"] },f_variants: { get: () => S.frames.variants, set: (v) => (S.frames.variants = +v), opts: [1, 2, 3, 4] },f_engine: { get: () => S.frames.engine, set: (v) => (S.frames.engine = v), opts: ["exact", "agent"], labels: { exact: "One by one", agent: "Flow agent · all at once" } },s_aspect: { get: () => S.shots.aspect, set: (v) => (S.shots.aspect = v), opts: ["16:9", "9:16"] },- s_duration: { get: () => S.shots.duration, set: (v) => (S.shots.duration = +v), get opts() { return durations(); } },+ s_duration: { get: () => S.shots.duration, set: (v) => (S.shots.duration = +v), opts: DURATIONS },s_resolution: { get: () => S.shots.resolution, set: (v) => (S.shots.resolution = v), opts: ["360p", "720p"] },s_quality: { get: () => S.shots.quality, set: (v) => (S.shots.quality = v), opts: ["original", "upscaled"], labels: { original: "720p", upscaled: "1080p" } },s_variants: { get: () => S.shots.variants, set: (v) => (S.shots.variants = +v), opts: [1, 2, 3, 4] },@@ -783,7 +784,7 @@ $("#k_go").onclick = async () => {const asset = $("#k_asset").value, prompt = $("#k_prompt").value.trim(), mode = $("#k_mode").value;if (!asset) return toast("Load and pick a clip first.", true);if (!prompt) return toast("Say what happens in the new clip.", true);- if (!confirm("Flow gives no price before this one. A 10-second clip cost 15 credits when measured. Continue?")) return;+ if (!confirm("Flow gives no price before this one. At its current rates a 10-second clip is about 30 credits at 720p. Continue?")) return;const cast = $("#k_cast").value.trim();try {await api("continue_shot", {@@ -1039,7 +1040,7 @@ $("#l_trash").onclick = async () => {/* ---------- roll ---------- */const sceneCost = (sc) => {const m = VIDEO_COST[S.shots.model];- const per = typeof m === "number" ? m : typeof m === "function" ? m(S.shots.resolution, S.shots.duration) : m[S.shots.resolution][S.shots.duration];+ const per = typeof m === "number" ? m : m(S.shots.resolution, S.shots.duration);return per * S.shots.variants;};function estimate() {@@ -1201,13 +1202,7 @@ function renderAll() {if ($("#n_style")) $("#n_style").value = S.narrate.style ?? "";estimate(); save();}-$("#s_model").addEventListener("change", (e) => {- S.shots.model = e.target.value;- // Omni 1.1 has no 12 or 15 s: move to the nearest length the new model offers.- const opts = durations();- if (!opts.includes(S.shots.duration)) S.shots.duration = opts.reduce((a, b) => (Math.abs(b - S.shots.duration) < Math.abs(a - S.shots.duration) ? b : a));- save(); renderAll();-});+$("#s_model").addEventListener("change", (e) => { S.shots.model = e.target.value; save(); renderAll(); });for (const [id, path] of [["f_project", "frames"], ["s_project", "shots"], ["n_project", "narrate"], ["c_project", "cut"]])$("#" + id).addEventListener("input", (e) => { S[path].project = e.target.value; save(); });(async () => {