Building an AI Video Editor: Reviewable Commands, State Tokens, and Browser Export
说明与用途
Timeline Studio 的架构通过统一命令协议、语义验证、状态令牌管理并在浏览器、CLI 和 MCP 接口之间共享执行逻辑,提供安全、可一致的 AI 视频编辑工作流。
问题
Integrating AI‑generated media and agent‑assisted operations into a browser‑based multitrack video editor while ensuring edit validity, concurrency safety, and consistent rule application across transports.
结果
The architecture provides a robust, agent‑friendly workflow that separates source assets from timeline clips, validates edits semantically, manages concurrency with state tokens, and unifies editing rules across multiple transports, enabling safe integration of AI‑generated media.
工作流
- Inspect project via agent command
- Generate JSON plan with schemaVersion, project path, baseRevision, operations, and output
- Perform semantic dry run with project.diff to preview changes
- Review diff and approve plan
- Apply plan with project.run, ensuring state token matches inspected state
- Handle concurrency by rejecting stale plans and replanning if necessary
- Commit generation results to assets without auto‑insertion
- Export final timeline using deterministic offline rendering
证据
The local workflow is: npm run agent -- project.inspect /projects/input.timeline npm run agent -- project.diff /projects/plan.json npm run agent -- project.run /projects/plan.json
We separate transport‑shape validation from project‑aware validation. A semantic dry run uses the shared command registry and state transformations to predict the actual result without writing an archive.
The browser interface uses a state token to bind preparation to the inspected state. A reviewed edit receives a preview ID. Applying it checks that the editor still matches the reviewed snapshot; otherwise, the agent must inspect again and replan.
- 记录日期: 2026-10-14T10:56:02.434Z