Open source CapCut alternative.
TypeScript
fix(chatgpt): preserve the editor session during preview checks
David Le46486d6807fb
diff --git a/site/src/clients/chatgpt/server/guidance.ts b/site/src/clients/chatgpt/server/guidance.tsindex 2f83d2a1..4052b85f 100644--- a/site/src/clients/chatgpt/server/guidance.ts+++ b/site/src/clients/chatgpt/server/guidance.ts@@ -22,7 +22,7 @@ const SKILLS: Record<string, string> = {"editor-overview": `# Donkey Cut in ChatGPTChatGPT plans the edit and interprets the footage with the user. Donkey Cut imports media, measures it, applies editing commands, and renders the result.-Work on the connected account's cloud projects. Use list_projects or create_project, then open_project. The user must keep the editor card open for inspection, imports, edits, undo and redo. If a tool reports no card open, ask the user to open the project card and resume when it is ready. Local projects become accessible after the user saves them to cloud in Donkey Cut.+Work on the connected account's cloud projects. Use list_projects or create_project, then open_project once. Keep that card throughout inspection, imports, edits, previews, undo and redo: reopening starts a fresh editor with empty history. The existing card shows edits immediately; render_preview and get_preview_status verify the saved preview. Recover a missing card with open_project and resume when ready. Local projects become accessible after the user saves them to cloud in Donkey Cut.Read inspect_project for current assets, selection, tracks, captions, notes and settings. An editor_state mentioned in these guides is that returned state. Times are seconds and ids come from tool results.Call list_commands to discover commands and describe_commands for their inputs. Commands marked reads run through inspect_project with projectId and commands; commands that write run through edit_project. note_source writes observations and belongs in edit_project. Each edit batch is one undo step; the user's manual edits share that history. A batch stops at the first failure, so read its results before continuing.The card offers the timeline, preview and inspector. ChatGPT provides the conversation and calls the media and caption commands. When a required asset is missing, ask the user for a file or link, or discuss suitable stock. Ask about creative choices when the answer materially changes the requested result.`,diff --git a/site/src/clients/chatgpt/server/mcp.ts b/site/src/clients/chatgpt/server/mcp.tsindex 82f592cf..89d14ec7 100644--- a/site/src/clients/chatgpt/server/mcp.ts+++ b/site/src/clients/chatgpt/server/mcp.ts@@ -54,6 +54,7 @@ export const SERVER_INSTRUCTIONS = ["Editing, previews and exports are free. Hosted AI (voiceover, music, images, caption rewriting, transcription past the monthly allowance) spends the account's credits. Imports and exports use the account's cloud storage.","You plan the edit with the user and interpret the footage; Donkey Cut supplies media inspection, signal measurements and editing commands. Use the user's assets and references. Ask for missing files, links or creative decisions when they are needed to fulfill the request. Use list_commands and describe_commands as the capability and input contract, and read_skill for guidance tailored to this ChatGPT client.","Workflow: list_projects or create_project → open_project → import_media → inspect_project → list_commands once, describe_commands for the ones you need → edit_project (batches, one undo step each) → render_preview → undo/redo → export_video.",+ "Keep the existing editor card for the whole editing session. Its undo history belongs to that card. Call open_project only to open a project initially, switch projects, or recover a missing card. After editing, the existing card shows the changes; use render_preview and get_preview_status to verify the saved preview. Reopening the project creates a fresh editor with empty history.","Every edit runs inside the Donkey Cut editor in the card, on the document the user is looking at: open_project puts that editor in the card, timeline and panels included, when the connection can edit, and edit_project, inspect_project, import_media, undo and redo answer that no card is open until it is. A read-only connection sees the current preview playing. Call render_preview only after an edit or when the card reports no current preview.","If the editor shows Reconnect, ask the user to click it to renew the embedded session and reload the editor in ChatGPT. If a tool reports no card open, ask the user to open the project card and keep it open, then resume when it is ready. When the catalog lacks an operation, explain the limit and ask for the required media or a user action in Donkey Cut.","Inspect before editing. Watch and listen to the relevant media before content-based cuts; use silence, beat, level and color measurements for timing and adjustments. Commands marked reads run through inspect_project; observations saved with note_source and other writes run through edit_project. Verify changes with the returned state, frames and audio, and give the user a preview to review. Claim only coverage and completed work confirmed by tool results.",@@ -178,7 +179,7 @@ export function createChatgptServer({title: "Open a Donkey Cut project",description:- "Open a selected cloud project in the card. When the connection can edit, the card holds the full Donkey Cut editor, timeline, media panel, inspector and preview, signed in on its own. A read-only connection sees the preview playing; a preview whose revision matches the project is current, and one from an earlier revision, or none, needs render_preview. With no projectId, show the project picker.",+ "Open a cloud project initially, switch projects, or recover a missing card. Keep the existing card during edits and preview checks: reopening creates a fresh editor with empty undo history. The editable card holds the full editor, timeline, media panel, inspector and preview. A read-only connection sees the preview; use render_preview when its revision is stale or missing. With no projectId, show the project picker.",inputSchema: z.object({ projectId: idSchema.optional() }),outputSchema: viewSchema,annotations: readOnlyAnnotations,