feat(media): add image/video/audio project kinds via od media generate

Introduce non-web media surfaces (image, video, audio) as first-class
project kinds. The unifying contract is "skill workflow + project
metadata tell the agent WHAT to make; one shell command — od media
generate — is HOW bytes are produced", so any code-agent CLI with
shell access can drive it without bespoke tools.

- Frontend: New Project panel gains Image/Video/Audio tabs with model
  picker, aspect/length/duration controls, and audio kind/voice
  selection. Examples and Design Systems tabs gain layered sections.
  FileViewer renders the generated image/video/audio files.
- Shared registry: src/media/models.ts is the single source of truth
  for image/video/audio model IDs, aspects, and defaults — consumed
  by the picker AND the daemon dispatcher.
- Prompts: media-contract.ts is pinned LAST in the system prompt for
  media surfaces so its hard rules (call od media generate, don't
  emit binary in <artifact>, allowed model IDs) win over softer
  earlier wording.
- Daemon: new media.js dispatcher + media-models.js JSON view of the
  registry; cli.js gets the `od media generate` subcommand wired up
  via server.js / projects.js so the daemon writes files back into
  the project dir.
- Skills: audio-jingle, image-poster, video-shortform seed examples
  for the three surfaces.

Made-with: Cursor
This commit is contained in:
pftom
2026-04-28 22:41:14 +08:00
parent 0b61be5d96
commit 976a6eadf2
28 changed files with 2902 additions and 78 deletions
+52
View File
@@ -91,6 +91,16 @@ export const zhCN: Dict = {
'entry.resizeAria': '调整侧边栏宽度',
'entry.loadingWorkspace': '正在加载工作区…',
'newproj.surfaceLabel': '类型',
'newproj.surfaceWeb': '网页',
'newproj.surfaceImage': '图片',
'newproj.surfaceVideo': '视频',
'newproj.surfaceAudio': '音频',
'newproj.surfaceWebHint': '原型 / 幻灯 / 文档',
'newproj.surfaceImageHint': '海报 / 插画 / 设计稿',
'newproj.surfaceVideoHint': '短视频 / 动效',
'newproj.surfaceAudioHint': '音乐 / 配音 / 音效',
'newproj.tabPrototype': '原型',
'newproj.tabDeck': '幻灯片',
'newproj.tabTemplate': '从模板',
@@ -99,6 +109,30 @@ export const zhCN: Dict = {
'newproj.titleDeck': '新建幻灯片',
'newproj.titleTemplate': '从模板开始',
'newproj.titleOther': '新建项目',
'newproj.titleImage': '新建图片',
'newproj.titleVideo': '新建视频',
'newproj.titleAudio': '新建音频',
'newproj.modelLabel': '模型',
'newproj.modelHint': '选择代理调用的上游模型。',
'newproj.aspectLabel': '画幅比例',
'newproj.aspectSquare': '方形 · 1:1',
'newproj.aspectLandscape': '横版 · 16:9',
'newproj.aspectPortrait': '竖版 · 9:16',
'newproj.aspect43': '宽屏 · 4:3',
'newproj.aspect34': '高屏 · 3:4',
'newproj.imageStyleLabel': '风格备注(可选)',
'newproj.imageStylePlaceholder': '例如:编辑摄影、低饱和大地色、柔光日光',
'newproj.videoLengthLabel': '时长',
'newproj.videoLengthSeconds': '{n}秒',
'newproj.audioKindLabel': '生成什么?',
'newproj.audioKindMusic': '音乐',
'newproj.audioKindSpeech': '配音 / TTS',
'newproj.audioKindSfx': '音效 / 拟音',
'newproj.audioDurationLabel': '时长',
'newproj.audioDurationSeconds': '{n}秒',
'newproj.voiceLabel': '声线(仅 TTS',
'newproj.voicePlaceholder': '例如:温暖女声旁白,普通话,平稳语速',
'newproj.namePlaceholder': '项目名称',
'newproj.fidelityLabel': '精度',
'newproj.fidelityWireframe': '线框图',
@@ -153,6 +187,17 @@ export const zhCN: Dict = {
'examples.modePrototypeMobile': '原型 · 移动端',
'examples.modeDeck': '幻灯片',
'examples.modeDocument': '文档与模板',
'examples.modeImage': '图片',
'examples.modeVideo': '视频',
'examples.modeAudio': '音频',
'examples.surfaceLabel': '类型',
'examples.surfaceWeb': '网页',
'examples.surfaceImage': '图片',
'examples.surfaceVideo': '视频',
'examples.surfaceAudio': '音频',
'examples.tagImage': '图片',
'examples.tagVideo': '视频',
'examples.tagAudio': '音频',
'examples.scenarioGeneral': '通用',
'examples.scenarioEngineering': '工程',
'examples.scenarioProduct': '产品',
@@ -194,6 +239,11 @@ export const zhCN: Dict = {
'ds.categoryUncategorized': '未分类',
'ds.showcase': '展示',
'ds.tokens': 'Token',
'ds.surfaceLabel': '类型',
'ds.surfaceWeb': '网页',
'ds.surfaceImage': '图片',
'ds.surfaceVideo': '视频',
'ds.surfaceAudio': '音频',
'avatar.title': '账户与设置',
'avatar.localCli': '本机 CLI',
@@ -342,6 +392,8 @@ export const zhCN: Dict = {
'fileViewer.open': '打开',
'fileViewer.imageMeta': '图片 · {size}',
'fileViewer.sketchMeta': '草图 · {size}',
'fileViewer.videoMeta': '视频 · {size}',
'fileViewer.audioMeta': '音频 · {size}',
'fileViewer.reload': '重新加载',
'fileViewer.reloadDisk': '从磁盘重新加载',
'fileViewer.copy': '复制',