remotion-claude-agent-demo 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +160 -0
- package/apps/web/README.md +36 -0
- package/apps/web/env.example +20 -0
- package/apps/web/eslint.config.mjs +18 -0
- package/apps/web/next.config.ts +7 -0
- package/apps/web/package-lock.json +10348 -0
- package/apps/web/package.json +35 -0
- package/apps/web/postcss.config.mjs +7 -0
- package/apps/web/public/file.svg +1 -0
- package/apps/web/public/globe.svg +1 -0
- package/apps/web/public/next.svg +1 -0
- package/apps/web/public/vercel.svg +1 -0
- package/apps/web/public/window.svg +1 -0
- package/apps/web/src/app/.well-known/agent-card.json/route.ts +50 -0
- package/apps/web/src/app/background-tasks/[jobId]/cancel/route.ts +29 -0
- package/apps/web/src/app/events/stream/route.ts +58 -0
- package/apps/web/src/app/favicon.ico +0 -0
- package/apps/web/src/app/globals.css +174 -0
- package/apps/web/src/app/layout.tsx +34 -0
- package/apps/web/src/app/messages/answer/route.ts +57 -0
- package/apps/web/src/app/messages/stream/route.ts +381 -0
- package/apps/web/src/app/page.tsx +358 -0
- package/apps/web/src/app/tasks/[taskId]/cancel/route.ts +24 -0
- package/apps/web/src/app/tasks/[taskId]/route.ts +24 -0
- package/apps/web/src/app/tasks/route.ts +13 -0
- package/apps/web/src/components/chat/agent-blocks.tsx +111 -0
- package/apps/web/src/components/chat/ask-user-question-panel.tsx +172 -0
- package/apps/web/src/components/chat/session-sidebar.tsx +222 -0
- package/apps/web/src/components/chat/subagent-activity-sidebar.tsx +248 -0
- package/apps/web/src/components/chat/tool-blocks.tsx +550 -0
- package/apps/web/src/lib/a2a/activity-store.ts +150 -0
- package/apps/web/src/lib/a2a/client.ts +357 -0
- package/apps/web/src/lib/a2a/sse.ts +19 -0
- package/apps/web/src/lib/a2a/task-store.ts +111 -0
- package/apps/web/src/lib/a2a/types.ts +216 -0
- package/apps/web/src/lib/agent/answer-store.ts +109 -0
- package/apps/web/src/lib/agent/background-delivery.ts +343 -0
- package/apps/web/src/lib/agent/background-tool.ts +78 -0
- package/apps/web/src/lib/agent/background.ts +452 -0
- package/apps/web/src/lib/agent/chat.ts +543 -0
- package/apps/web/src/lib/agent/session-store.ts +26 -0
- package/apps/web/src/lib/chat/types.ts +44 -0
- package/apps/web/src/lib/env.ts +31 -0
- package/apps/web/src/lib/hooks/useA2AChat.ts +863 -0
- package/apps/web/src/lib/state/chat-atoms.ts +52 -0
- package/apps/web/src/lib/workspace.ts +9 -0
- package/apps/web/tsconfig.json +35 -0
- package/bin/remotion-agent.js +451 -0
- package/package.json +34 -0
- package/templates/.claude/CLAUDE.md +95 -0
- package/templates/.claude/README.md +129 -0
- package/templates/.claude/agents/composer-agent.md +188 -0
- package/templates/.claude/agents/crafter.md +181 -0
- package/templates/.claude/agents/creator.md +134 -0
- package/templates/.claude/agents/perceiver.md +92 -0
- package/templates/.claude/settings.json +36 -0
- package/templates/.claude/settings.local.json +39 -0
- package/templates/.claude/skills/agent-browser/SKILL.md +349 -0
- package/templates/.claude/skills/agent-browser/references/authentication.md +188 -0
- package/templates/.claude/skills/agent-browser/references/proxy-support.md +175 -0
- package/templates/.claude/skills/agent-browser/references/session-management.md +181 -0
- package/templates/.claude/skills/agent-browser/references/snapshot-refs.md +186 -0
- package/templates/.claude/skills/agent-browser/references/video-recording.md +162 -0
- package/templates/.claude/skills/agent-browser/templates/authenticated-session.sh +91 -0
- package/templates/.claude/skills/agent-browser/templates/capture-workflow.sh +68 -0
- package/templates/.claude/skills/agent-browser/templates/form-automation.sh +64 -0
- package/templates/.claude/skills/algorithmic-art/LICENSE.txt +202 -0
- package/templates/.claude/skills/algorithmic-art/SKILL.md +405 -0
- package/templates/.claude/skills/algorithmic-art/templates/generator_template.js +223 -0
- package/templates/.claude/skills/algorithmic-art/templates/viewer.html +599 -0
- package/templates/.claude/skills/asset-validator/SKILL.md +376 -0
- package/templates/.claude/skills/audio-video-sync/SKILL.md +219 -0
- package/templates/.claude/skills/bgm-manager/SKILL.md +334 -0
- package/templates/.claude/skills/remotion-best-practices/SKILL.md +45 -0
- package/templates/.claude/skills/remotion-best-practices/rules/3d.md +86 -0
- package/templates/.claude/skills/remotion-best-practices/rules/animations.md +29 -0
- package/templates/.claude/skills/remotion-best-practices/rules/assets/charts-bar-chart.tsx +173 -0
- package/templates/.claude/skills/remotion-best-practices/rules/assets/text-animations-typewriter.tsx +100 -0
- package/templates/.claude/skills/remotion-best-practices/rules/assets/text-animations-word-highlight.tsx +108 -0
- package/templates/.claude/skills/remotion-best-practices/rules/assets.md +78 -0
- package/templates/.claude/skills/remotion-best-practices/rules/audio.md +172 -0
- package/templates/.claude/skills/remotion-best-practices/rules/calculate-metadata.md +104 -0
- package/templates/.claude/skills/remotion-best-practices/rules/can-decode.md +75 -0
- package/templates/.claude/skills/remotion-best-practices/rules/charts.md +58 -0
- package/templates/.claude/skills/remotion-best-practices/rules/compositions.md +141 -0
- package/templates/.claude/skills/remotion-best-practices/rules/display-captions.md +126 -0
- package/templates/.claude/skills/remotion-best-practices/rules/extract-frames.md +229 -0
- package/templates/.claude/skills/remotion-best-practices/rules/fonts.md +152 -0
- package/templates/.claude/skills/remotion-best-practices/rules/get-audio-duration.md +58 -0
- package/templates/.claude/skills/remotion-best-practices/rules/get-video-dimensions.md +68 -0
- package/templates/.claude/skills/remotion-best-practices/rules/get-video-duration.md +58 -0
- package/templates/.claude/skills/remotion-best-practices/rules/gifs.md +138 -0
- package/templates/.claude/skills/remotion-best-practices/rules/images.md +130 -0
- package/templates/.claude/skills/remotion-best-practices/rules/import-srt-captions.md +67 -0
- package/templates/.claude/skills/remotion-best-practices/rules/lottie.md +68 -0
- package/templates/.claude/skills/remotion-best-practices/rules/maps.md +403 -0
- package/templates/.claude/skills/remotion-best-practices/rules/measuring-dom-nodes.md +35 -0
- package/templates/.claude/skills/remotion-best-practices/rules/measuring-text.md +143 -0
- package/templates/.claude/skills/remotion-best-practices/rules/parameters.md +98 -0
- package/templates/.claude/skills/remotion-best-practices/rules/sequencing.md +118 -0
- package/templates/.claude/skills/remotion-best-practices/rules/tailwind.md +11 -0
- package/templates/.claude/skills/remotion-best-practices/rules/text-animations.md +20 -0
- package/templates/.claude/skills/remotion-best-practices/rules/timing.md +179 -0
- package/templates/.claude/skills/remotion-best-practices/rules/transcribe-captions.md +19 -0
- package/templates/.claude/skills/remotion-best-practices/rules/transitions.md +122 -0
- package/templates/.claude/skills/remotion-best-practices/rules/trimming.md +53 -0
- package/templates/.claude/skills/remotion-best-practices/rules/videos.md +171 -0
- package/templates/.claude/skills/remotion-components/SKILL.md +453 -0
- package/templates/.claude/skills/render-config/SKILL.md +290 -0
- package/templates/.claude/skills/script-writer/SKILL.md +59 -0
- package/templates/.claude/skills/style-director/script-writer/SKILL.md +82 -0
- package/templates/.claude/skills/style-director/style-director/SKILL.md +287 -0
- package/templates/.claude/skills/style-director/style-director/references/audience-and-scenarios.md +43 -0
- package/templates/.claude/skills/style-director/style-director/references/interaction-innovation.md +26 -0
- package/templates/.claude/skills/style-director/style-director/references/motion-grammar.md +66 -0
- package/templates/.claude/skills/style-director/style-director/references/quality-checklist.md +29 -0
- package/templates/.claude/skills/style-director/style-director/references/scene-recipes.md +38 -0
- package/templates/.claude/skills/style-director/style-director/references/visual-style-system.md +148 -0
- package/templates/.claude/skills/subtitle-composer/SKILL.md +304 -0
- package/templates/.claude/skills/subtitle-processor/SKILL.md +308 -0
- package/templates/.claude/skills/timeline-generator/SKILL.md +253 -0
- package/templates/.claude/skills/video-preflight-check/SKILL.md +353 -0
- package/templates/.claude/skills/voice-synthesizer/SKILL.md +296 -0
- package/templates/.claude/skills/voice-synthesizer/scripts/synthesize_voice.py +315 -0
- package/templates/.claude/skills/voice-synthesizer/scripts/tts_cli.py +142 -0
- package/templates/.claude/skills/web-design-guidelines/SKILL.md +36 -0
- package/templates/.claude/skills/youtube-downloader/SKILL.md +99 -0
- package/templates/.claude/skills/youtube-downloader/scripts/download_video.py +145 -0
package/README.md
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# Remotion Claude Agent
|
|
2
|
+
|
|
3
|
+
基于 Remotion 和 Claude Agent SDK 的视频创作系统。通过 AI 编排实现从自然语言需求到产品演示视频的自动化生产。
|
|
4
|
+
|
|
5
|
+
## 项目概述
|
|
6
|
+
|
|
7
|
+
本项目是一个 **AI 驱动的视频生产平台**,支持将产品教程、Demo 演示、SaaS 介绍等需求转化为高质量的视频内容。
|
|
8
|
+
|
|
9
|
+
### 核心能力
|
|
10
|
+
|
|
11
|
+
- `perceiver` - 浏览器感知/录屏,获取内容理解
|
|
12
|
+
- `creator` - 生成脚本、分镜、风格配置
|
|
13
|
+
- `crafter` - 协调素材下载、语音合成、视频渲染
|
|
14
|
+
- `composer-agent` - Remotion 视频编排与渲染
|
|
15
|
+
|
|
16
|
+
### 工作流程
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
用户需求
|
|
20
|
+
↓
|
|
21
|
+
1. Perceiver → 浏览器感知/录屏,获取内容理解
|
|
22
|
+
↓
|
|
23
|
+
2. Creator → 生成脚本、分镜、风格配置
|
|
24
|
+
↓
|
|
25
|
+
[用户确认方案]
|
|
26
|
+
↓
|
|
27
|
+
3. Crafter → 协调素材下载、语音合成、视频渲染
|
|
28
|
+
↓
|
|
29
|
+
最终视频输出
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## 项目结构
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
remotion-claude-agent/
|
|
36
|
+
├── apps/ # Web 应用
|
|
37
|
+
│ └── web/ # Next.js 前端
|
|
38
|
+
├── workspace/ # 工作区
|
|
39
|
+
│ ├── .claude/ # Claude Agent 配置
|
|
40
|
+
│ │ ├── agents/ # 子代理(perceiver, creator, crafter, composer-agent)
|
|
41
|
+
│ │ └── skills/ # 技能库(语音合成、字幕处理、BGM 等)
|
|
42
|
+
│ └── projects/ # 项目产出目录
|
|
43
|
+
└── openspec/ # 规格说明书
|
|
44
|
+
├── specs/ # 能力规格
|
|
45
|
+
└── changes/ # 变更提案
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## 技术栈
|
|
49
|
+
|
|
50
|
+
- **前端**: Next.js (App Router), React, TypeScript, Tailwind CSS
|
|
51
|
+
- **视频引擎**: Remotion (React-based video framework)
|
|
52
|
+
- **AI 编排**: Claude Agent SDK
|
|
53
|
+
- **语音合成**: 阿里云 DashScope (cosyvoice-v3-plus)
|
|
54
|
+
- **协议**: A2A (Agent-to-Agent) Protocol v0.3.0
|
|
55
|
+
|
|
56
|
+
## 开发指南
|
|
57
|
+
|
|
58
|
+
### 环境配置
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
# 安装依赖
|
|
62
|
+
pnpm install
|
|
63
|
+
|
|
64
|
+
# 配置环境变量
|
|
65
|
+
cp .env.example .env
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### 启动开发服务器
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
# 启动 Web 应用
|
|
72
|
+
pnpm dev
|
|
73
|
+
|
|
74
|
+
# 启动指定端口
|
|
75
|
+
pnpm dev --port 3001
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### CLI 使用(npm 分发)
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# 全局安装
|
|
82
|
+
npm install -g remotion-claude-agent-demo
|
|
83
|
+
|
|
84
|
+
# 设置默认 workspace(持久化)
|
|
85
|
+
remotion-agent config set workspace /path/to/workspace
|
|
86
|
+
|
|
87
|
+
# 设置环境变量(持久化)
|
|
88
|
+
remotion-agent env set ANTHROPIC_API_KEY your_key
|
|
89
|
+
|
|
90
|
+
# 交互式初始化(写入配置)
|
|
91
|
+
remotion-agent init
|
|
92
|
+
|
|
93
|
+
# 启动 Web UI(前台)
|
|
94
|
+
remotion-agent web start --port 3000
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
配置文件路径:
|
|
98
|
+
- macOS/Linux:`~/.remotion-claude-agent/config.json`
|
|
99
|
+
- Windows:`%USERPROFILE%\\.remotion-claude-agent\\config.json`
|
|
100
|
+
|
|
101
|
+
说明:
|
|
102
|
+
- 未配置 workspace 时,默认使用启动命令时的 `pwd`
|
|
103
|
+
- 首次启动会自动初始化 workspace 下的 `.claude` 配置目录
|
|
104
|
+
|
|
105
|
+
### OpenSpec 使用
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
# 查看活动提案
|
|
109
|
+
openspec list
|
|
110
|
+
|
|
111
|
+
# 查看规格列表
|
|
112
|
+
openspec list --specs
|
|
113
|
+
|
|
114
|
+
# 验证变更
|
|
115
|
+
openspec validate [change-id] --strict
|
|
116
|
+
|
|
117
|
+
# 归档已完成的变更
|
|
118
|
+
openspec archive [change-id] --yes
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## 技能库 (Skills)
|
|
122
|
+
|
|
123
|
+
| 技能 | 描述 |
|
|
124
|
+
|------|------|
|
|
125
|
+
| `voice-synthesizer` | 使用阿里云 cosyvoice-v3-plus 语音合成,支持多音色、SSML |
|
|
126
|
+
| `subtitle-processor` | 从 VTT 文件生成 Remotion 字幕数据 |
|
|
127
|
+
| `timeline-generator` | 从 VTT 自动计算场景时长和帧数 |
|
|
128
|
+
| `bgm-manager` | 背景音乐管理与音量控制 |
|
|
129
|
+
| `asset-validator` | 素材验证,确保渲染前完整性 |
|
|
130
|
+
| `audio-video-sync` | 音视频同步,确保画面与语音完美同步 |
|
|
131
|
+
|
|
132
|
+
## 后台任务
|
|
133
|
+
|
|
134
|
+
支持独立运行的后台任务,通过 SSE 活动流实时通知前端:
|
|
135
|
+
|
|
136
|
+
- 并发控制:多个任务可并行执行
|
|
137
|
+
- 进度追踪:通过 TodoWrite 输出任务进度
|
|
138
|
+
- 自动投递:结果自动写回主会话
|
|
139
|
+
|
|
140
|
+
## A2A 协议
|
|
141
|
+
|
|
142
|
+
遵循 Agent-to-Agent Protocol v0.3.0,支持:
|
|
143
|
+
|
|
144
|
+
- `/messages/stream` - 流式消息处理
|
|
145
|
+
- `/background-tasks/[jobId]/cancel` - 取消后台任务
|
|
146
|
+
- `/events/stream` - 活动事件流(支持断线补课)
|
|
147
|
+
|
|
148
|
+
## 约定
|
|
149
|
+
|
|
150
|
+
### 文档语言
|
|
151
|
+
- 项目内的需求/设计/任务/规格等文档默认使用中文
|
|
152
|
+
- 保留 OpenSpec 固格式关键字(如 `## ADDED Requirements`)
|
|
153
|
+
|
|
154
|
+
### SDK 优先
|
|
155
|
+
- 优先使用 Claude Agent SDK 原生能力
|
|
156
|
+
- 仅在原生能力无法满足时,才引入自定义实现
|
|
157
|
+
|
|
158
|
+
## 许可证
|
|
159
|
+
|
|
160
|
+
MIT
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
|
|
2
|
+
|
|
3
|
+
## Getting Started
|
|
4
|
+
|
|
5
|
+
First, run the development server:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm run dev
|
|
9
|
+
# or
|
|
10
|
+
yarn dev
|
|
11
|
+
# or
|
|
12
|
+
pnpm dev
|
|
13
|
+
# or
|
|
14
|
+
bun dev
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
|
18
|
+
|
|
19
|
+
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
|
|
20
|
+
|
|
21
|
+
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
|
|
22
|
+
|
|
23
|
+
## Learn More
|
|
24
|
+
|
|
25
|
+
To learn more about Next.js, take a look at the following resources:
|
|
26
|
+
|
|
27
|
+
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
|
|
28
|
+
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
|
|
29
|
+
|
|
30
|
+
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
|
|
31
|
+
|
|
32
|
+
## Deploy on Vercel
|
|
33
|
+
|
|
34
|
+
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
|
|
35
|
+
|
|
36
|
+
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Anthropic API 配置(Server-side)
|
|
2
|
+
ANTHROPIC_API_KEY=
|
|
3
|
+
ANTHROPIC_BASE_URL=
|
|
4
|
+
ANTHROPIC_DEFAULT_HAIKU_MODEL=
|
|
5
|
+
ANTHROPIC_DEFAULT_OPUS_MODEL=
|
|
6
|
+
ANTHROPIC_DEFAULT_SONNET_MODEL=
|
|
7
|
+
ANTHROPIC_MODEL=
|
|
8
|
+
ANTHROPIC_REASONING_MODEL=
|
|
9
|
+
|
|
10
|
+
# A2A
|
|
11
|
+
A2A_VERSION=0.3.0
|
|
12
|
+
A2A_AGENT_NAME=Remotion Demo Agent (MVP)
|
|
13
|
+
A2A_AGENT_DESCRIPTION=Local A2A agent for chat + future demo video generation
|
|
14
|
+
|
|
15
|
+
# agent-browser (local)
|
|
16
|
+
# Set to 1 to open a visible browser window by default.
|
|
17
|
+
AGENT_BROWSER_HEADED=1
|
|
18
|
+
|
|
19
|
+
# Client-side
|
|
20
|
+
NEXT_PUBLIC_A2A_BASE_URL=http://localhost:3000
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { defineConfig, globalIgnores } from "eslint/config";
|
|
2
|
+
import nextVitals from "eslint-config-next/core-web-vitals";
|
|
3
|
+
import nextTs from "eslint-config-next/typescript";
|
|
4
|
+
|
|
5
|
+
const eslintConfig = defineConfig([
|
|
6
|
+
...nextVitals,
|
|
7
|
+
...nextTs,
|
|
8
|
+
// Override default ignores of eslint-config-next.
|
|
9
|
+
globalIgnores([
|
|
10
|
+
// Default ignores of eslint-config-next:
|
|
11
|
+
".next/**",
|
|
12
|
+
"out/**",
|
|
13
|
+
"build/**",
|
|
14
|
+
"next-env.d.ts",
|
|
15
|
+
]),
|
|
16
|
+
]);
|
|
17
|
+
|
|
18
|
+
export default eslintConfig;
|