Skip to content

feat(video): PixVerse 视频生成子命令#18

Merged
0xFANGO merged 2 commits into
mainfrom
ralph/listenhub-cli--250
Jun 25, 2026
Merged

feat(video): PixVerse 视频生成子命令#18
0xFANGO merged 2 commits into
mainfrom
ralph/listenhub-cli--250

Conversation

@0xFANGO

@0xFANGO 0xFANGO commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

⚠️ CI 当前为红 = 预期:package.json 声明 @marswave/listenhub-sdk: ^0.0.15,但 SDK 0.0.15 尚未发 npm,pnpm install --frozen-lockfile 因此报 ERR_PNPM_OUTDATED_LOCKFILE(lockfile ^0.0.13 vs manifest ^0.0.15)。代码本身已严谨验证(用本地 SDK 构建产物 link:vp check 0 错误,vp test 36 passed)。

转绿步骤(发包后):① 发 SDK 0.0.15 到 npm → ② 在本分支 pnpm install 重生 pnpm-lock.yaml 并提交 → ③ CI 自动转绿 → ④ 合并。

背景

api-server 已把 PixVerse 接入公开 Agent OpenAPI 层(api-server#779),SDK 已补 PixVerse 方法(sdk#20)。本 PR 为 CLI 加 video pixverse 子命令。

改动

  • source/openapi/video.ts:新增 registerPixVerse,挂 video pixverse generate / video pixverse estimate 子命令
    • generate flags:--capability(必填,枚举校验)、--model(pixverse/v6/v5/v4.5)、--language--prompt--quality--aspect-ratio--duration--source-task-id--image/--video/--audio(可重复,url 或 url:duration,上限 10/2/1)、--agent-type--source-video-id--restyle-id、lip-sync TTS flags,以及 --pixverse-json 逃生舱(覆盖嵌套字段)、--no-wait/--timeout/-j。调 createPixVerseVideoGeneration,默认轮询复用现有 pollOpenAPI + getVideoGenerationTask
    • estimate flags:--capability(必填)、--model--language--quality--duration--agent-type。调 estimatePixVerseVideoCredits,输出 {tokens, credits}
  • README.md + README.zh-CN.md:双语加 PixVerse 段 + 示例(含 fusion 走 --pixverse-json 的例子)
  • package.json@marswave/listenhub-sdk ^0.0.13^0.0.15(下一个含 PixVerse 的 SDK 版本)

验证

  • 用本地 SDK 构建产物(listenhub-sdk--249,含 PixVerse 类型)link 验证:typecheck 解析到 PixVerse 类型
  • vp check:fmt 63 文件 OK,lint+typecheck 0 警告 0 错误(56 文件)
  • vp test:5 files / 36 passed(28 预存 + 8 新 PixVerse)
  • committed package.json = ^0.0.15无 file:/link 本地路径泄漏

⚠️ 发包后须做

SDK 0.0.15 尚未发 npm,本 PR 的 pnpm-lock.yaml 仍记录旧 0.0.13(fresh checkout 上 pnpm install --frozen-lockfile 会失败)。SDK 0.0.15 发布后,在本分支 pnpm install 重生 lockfile 并提交,CLI 即 install-clean。CLI 自身发版走 prepublishOnly 流程。

Add `openapi video pixverse generate` and `openapi video pixverse estimate`
covering the public Agent API contract: capability (required), model,
language, prompt, quality, aspect-ratio, duration, source-task-id,
repeatable image/video/audio assets (url[:duration]), and key nested
pixverse fields (agent-type, source-video-id, restyle-id, lip-sync TTS)
plus a --pixverse-json escape hatch. Wires SDK createPixVerseVideoGeneration
/ estimatePixVerseVideoCredits, supports --json and the existing polling
pattern. Bilingual README + tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@0xFANGO
0xFANGO force-pushed the ralph/listenhub-cli--250 branch from a0a8ac1 to 5da2df6 Compare June 24, 2026 18:22
@0xFANGO

0xFANGO commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator Author

追加修复:lip_sync TTS flag 端到端可用

对抗验证(skills #251 交叉核对 api-server 契约)发现:--lip-sync-tts / --lip-sync-speaker-id / --lip-sync-content 只填了 pixverse.lipSyncTts*(provider 实际读这个),但 api-server 的 lip_sync 校验器门禁在嵌套 pixverse.tts={speakerId,content} 上——纯 TTS lip_sync(无外部 audio)会被 any.invalid 拒。

修复(source/openapi/video.ts):capability=lip_sync 且提供了 speaker-id + content 时,同时构造 pixverse.tts(满足校验器)+ 保留 lipSyncTts*(满足 provider),--pixverse-json 已带 tts 时不覆盖。新增测试断言两组字段共存。

验证:vp check 0 错误,vp test 36 passed。--lip-sync-* flag 现在端到端工作,无需逃生舱。

@0xFANGO
0xFANGO merged commit a40e7d0 into main Jun 25, 2026
1 check passed
@0xFANGO
0xFANGO deleted the ralph/listenhub-cli--250 branch June 25, 2026 05:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant