艺术动画skill:35种艺术风格、9种解说语法,用代码让画动起来。
JavaScript agent-skillsanimationclaude-codeclaude-code-skillsclaude-skillscodexexplainer-videogenerative-arthuashu-skillsmotion-graphicsskillsvideo
feat: add configurable voice and host-image capabilities
alchaincyff178bd7754a7
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.ymlnew file mode 100644index 0000000..451114a--- /dev/null+++ b/.github/workflows/tests.yml@@ -0,0 +1,21 @@+name: Media contracts+on: [push, pull_request]+permissions:+ contents: read+jobs:+ contracts:+ runs-on: ubuntu-latest+ strategy:+ matrix:+ python: ['3.10', '3.12']+ steps:+ - uses: actions/checkout@v4+ with:+ fetch-depth: 0+ - uses: actions/setup-python@v5+ with:+ python-version: ${{ matrix.python }}+ - run: python -m pip install requests Pillow+ - run: sudo apt-get update && sudo apt-get install -y ffmpeg+ - run: python -m unittest discover -s tests -v+ - run: python scripts/check_release.py check --repo . --ref HEAD --base HEAD~1diff --git a/.gitignore b/.gitignoreindex a9473e2..d8aef2f 100644--- a/.gitignore+++ b/.gitignore@@ -23,3 +23,9 @@ __pycache__/node_modules/_archive/_private/++# User configuration stays outside the installed skill+/media.json+/voices.json+.huashu/+media.local.jsondiff --git a/CHANGELOG.md b/CHANGELOG.mdindex d1ccb61..7195a1d 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -20,3 +20,7 @@- 2026-10-05 v0.5 · 开源整理:去掉本机路径与合作项目信息;中文黑体换成思源黑体 Noto Sans SC(family 名沿用 PuHui-*),补字体许可清单;全风格样片移到 Release;加 README / LICENSE。- 2026-10-05 v0.6 · 开源第二轮:Vox 示范片的人物改用卡通帧,写实人像不再随仓库;配乐脚本换成原创示例乐谱,音轨文档改成「方法+原创示例」;洞穴段标题换成原创文字;收进长卷穿越片示范 demos/long_scroll(骨架+埃及、莫奈、8-bit 三段)与 11 号文档。++- 2026-10-08 · P0/P1本地实现:可选语音配置、已有音频/macOS系统声音/火山复刻、安装目录外私人默认、按需配置与跳过、旧koubo入口兼容;共享文件清单同步。图片能力桥接与跨宿主完整发布验收留后续。++- 2026-10-08 · P2/P3:增加现有图片与当前宿主工具桥接、需求计划/回执/透明背景/尺寸与SHA验收;旧配置保留,新增能力不自动授权;补充贡献与兼容性说明、CI及增量发布检查。三家安装重装通过,Codex在线验收通过,Claude/Kimi在线验收因账户条件待补。diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdnew file mode 100644index 0000000..4cf71c0--- /dev/null+++ b/CONTRIBUTING.md@@ -0,0 +1,39 @@+# 维护与扩展++公共代码、公共推荐放在包内;个人平台、声音和凭证引用保存在安装目录外。不要把个人经验变成所有人的默认授权。++## 本地检查++```sh+python -m pip install requests Pillow+# 另需系统安装ffmpeg/ffprobe;不会在正常Skill激活时自动安装+python -m unittest discover -s tests -v+```++单元测试不调用真实语音/生图服务。真实宿主验收见[兼容性记录](references/compatibility.md)。新增适配器必须明确:配置、探查、请求与输出契约、失败行为;不能仅替换base_url就宣称兼容另一平台。++## 图片工具桥接++读取[图片指南](references/images.md)。宿主提供实际工具声明,Agent执行调用,CLI生成计划并验收产物。回执不是平台签名来源认证。已有图片、禁用生成、无工具、未知计费、参考图权限和生成失败都需要覆盖。++独立图片API执行器仍是可选扩展,本版不自动安装、不注册账号、不借用其他Agent的登录态。++## 更新时保留用户配置++安装目录允许被替换;用户media.json不得写入其中。旧配置通过默认值合并获得新字段,新增能力默认未选择/未授权,不自动重训或重置已有音色。改变字段语义时提供显式迁移与回滚方法。++## 发布检查++审查变更后将本次公共文件暂存,再生成文件清单:++```sh+python scripts/check_release.py manifest --repo .+git add release-manifest.json+python scripts/check_release.py check --repo . --ref INDEX+# 提交后核对全部待发提交,base替换为实际远端基线+python scripts/check_release.py check --repo . --ref HEAD --base origin/main+```++检查Git对象而非仅磁盘文件;中间提交曾写入后又删除的凭证也会被检查。清单只证明受审文件集合一致,不替代代码审查、真实媒体验收和许可证核对。禁止绕过检查或重建历史去伪装成首次发布。++复用代码时也请保留原有字体、笔顺数据和角色示范的许可边界。个人反馈留个人配置;有复现证据的方法和接口经验才进入公共文档,并标注日期、范围和验证状态。diff --git a/README.md b/README.mdindex 707b920..f63ba81 100644--- a/README.md+++ b/README.md@@ -96,7 +96,7 @@ npx skills add alchaincyf/huashu-art-motion| 长卷穿越片示范(骨架+3 段+角色帧库) | 1 支,`scripts/engine/demos/long_scroll/` || 转场 | 艺术风格签名转场与解说转场,包含淡入、硬切和纸面转场 || 绘画与动画库(笔刷、渲染器、后期、骨架、镜头、图表、排版……) | 17 个,`scripts/engine/lib/` |-| 方法文档(拆解、机制、一帧先行、纯代码绘制、节奏配乐、角色、长卷……) | 12篇,`references/01`–`12` |+| 方法文档(拆解、机制、一帧先行、纯代码绘制、节奏配乐、角色、长卷……) | 核心12篇,`references/01`–`12`;另有[可选语音指南](references/capabilities.md) |```huashu-art-motion/@@ -184,3 +184,14 @@ MIT License © [花叔 Huashu](https://github.com/alchaincyf)It started as a code-only recreation of Tak's ([@cherry_mx_reds](https://x.com/cherry_mx_reds/status/2106095190285144331)) 15-second *Art History Speedrun*. The scene layouts and the girl-and-cat premise follow his original; every frame here is redrawn in code, and no frames, screenshots or audio from the original are included.Install: `npx skills add alchaincyf/huashu-art-motion`. Requires uv, ffmpeg and Playwright Chromium. The skill content is in Chinese. The ninth grammar, presenter-led explainers, ships as a reference implementation and requires your own character assets. Full-narration examples are code snapshots, not ready-to-render projects. Code and docs are MIT; the bundled stroke medians retain the Arphic Public License; bundled fonts keep their SIL OFL licenses; the Huashu character artwork, including its appearance in overview images and demo videos, is for demo use only.++## 可选媒体能力++基础代码动画不需要语音或图片账号。有素材先沿用;需要生成时,按用户选择和当前环境调用。语音支持macOS系统声音和自己的火山复刻音色;图片支持现有文件导入和当前Agent/MCP工具桥接。++- [语音与私人配置](references/capabilities.md):按需配置、可跳过,旧koubo入口兼容。+- [图片工具接入](references/images.md):先生成计划,由Agent调用工具,再验收并收纳素材。+- [兼容性与验证范围](references/compatibility.md):三家安装重装通过;Codex在线回归通过,Claude Code/Kimi在线回归受测试账户条件阻塞,待补验。+- [维护、扩展与发布](CONTRIBUTING.md):公共默认与私人配置分离,升级不覆盖个人选择,发布检查覆盖实际待发Git对象。++先运行`python scripts/capabilities.py status --explain`。新增能力默认未选择、未授权;不能从检测到Key或工具推断允许消费。独立图片API执行器为后续可选扩展,不会自动切换供应商。diff --git a/SKILL.md b/SKILL.mdindex d08c50a..fb12f70 100644--- a/SKILL.md+++ b/SKILL.md@@ -1,6 +1,6 @@---name: huashu-art-motion-description: "艺术与视频动画:拆解复刻动画;代码画35种艺术风格并让画活;9种解说动画语法,8种可按口播参数渲片段;含口播整片参考代码及框景检查;人用AI生帧。"+description: "艺术与视频动画:拆解复刻动画;代码画35种艺术风格并让画活;9种解说动画语法,8种可按口播参数渲片段;含口播整片参考代码及框景检查;人用AI生帧;可选已有录音、系统声音与语音复刻,按需配置。"---# 艺术动画@@ -26,6 +26,16 @@ description: "艺术与视频动画:拆解复刻动画;代码画35种艺术口播整片先读`references/12-口播整片与经验回流.md`;讲解员风格再读`references/动画语法/y6_presenter_explainer.md`。+## 可选口播:按需配置++任务需要新配音时,先读[语音能力指南](references/capabilities.md),运行`scripts/capabilities.py status --explain`。已有录音直接沿用;无声动画不启动配置。未选择时只询问当前需要的声音方式,可本次跳过或长期手动启用;用户已明确选择时直接应用。私人音色、参数和凭证引用保存在安装目录外,公共默认不绑定作者声音。++`scripts/koubo.py say/train/voices`保留旧调用,使用同一套配置。仅音频任务不启动画面设计或成片审片。++## 可选图片:当前工具与现有素材++需要图片时读[图片能力指南](references/images.md)。已有图片直接导入;生成图片按当前会话实际工具和用户许可选择,脚本输出调用计划,Agent执行工具后验收并复制到项目。无图片任务跳过配置;禁止生成时不换供应商绕过。语音和图片分别配置,新增能力不会自动获准。+## 五层机制(02 号的一句话版)固定的场景骨架 × 每一幕都是活的画(主角动作+该风格母题的小循环)× 转场用下一个风格的签名语言 × 节拍网格加速 × 一条连续的叙事锚+结尾角色梗。换题材照样成立。diff --git a/defaults/media.json b/defaults/media.jsonnew file mode 100644index 0000000..a04ecc4--- /dev/null+++ b/defaults/media.json@@ -0,0 +1,45 @@+{+ "schema_version": 1,+ "revision": 0,+ "preferences": {+ "voice": {+ "mode": "unconfigured",+ "provider": "volcengine",+ "voice_ref": "default",+ "system_voice": ""+ },+ "image": {+ "mode": "unconfigured",+ "provider": "auto"+ }+ },+ "policy": {+ "cloud": "ask",+ "paid_api": "ask",+ "voice_training": "ask",+ "image_generation": "ask",+ "reference_upload": "ask",+ "unknown_image_cost": "ask"+ },+ "onboarding": {+ "voice": "ask",+ "image": "ask"+ },+ "bindings": {+ "volcengine": {+ "appid_env": "VOLC_SPEECH_APPID",+ "token_env": "VOLC_SPEECH_TOKEN",+ "env_file": "",+ "registry_file": "~/.koubo/voices.json",+ "trust_env": true+ },+ "voices": {}+ },+ "provider_options": {+ "volcengine": {+ "model": "seed-tts-2.0-expressive",+ "speech_rate": 0,+ "tone_fidelity": true+ }+ }+}diff --git "a/references/03-\344\270\200\345\270\247\345\205\210\350\241\214\345\233\233\346\235\241\350\267\257\347\272\277.md" "b/references/03-\344\270\200\345\270\247\345\205\210\350\241\214\345\233\233\346\235\241\350\267\257\347\272\277.md"index 58ffcc6..f8168f4 100644--- "a/references/03-\344\270\200\345\270\247\345\205\210\350\241\214\345\233\233\346\235\241\350\267\257\347\272\277.md"+++ "b/references/03-\344\270\200\345\270\247\345\205\210\350\241\214\345\233\233\346\235\241\350\267\257\347\272\277.md"@@ -1,5 +1,7 @@# 03 · 一帧先行,再让它动:四条路线+涉及生图或角色图片时,先按[图片能力指南](images.md)选择当前可用工具或导入现有素材;私人角色素材和平台选择不作为所有用户的默认。+花叔要的方法:先设计一帧有艺术感的画面,再按要求让这帧动起来。2026-10-04 一个项目里四条路都实跑过,各有适用场景。| 路线 | 画面谁画 | 动作谁做 | 实测 | 什么时候选 |@@ -21,7 +23,7 @@- 毛色写到部位:「橘白猫(头顶、背部和尾巴橘色虎斑,口鼻、胸口、肚子、四爪白色)」。只写「橘猫」会画成全身橘。- 描述里写动作(「端杯喝茶」)会压过参考图的姿势。要保持原姿势就只写「保持参考图里的手势」。- 要动的文字(年份、标题)让模型「去掉,留成干净背景」,交给代码画;画内装饰文字逐字写进 prompt。-- 批量生图串行跑;验真看生图工具的输出目录新增文件数 = 出图数,且 PNG info 里没有 ImageMagick 的 date:create(有就说明是被拼出来的,不是模型生成的)。+- 批量生图串行跑;生成来源以实际工具调用记录、输入/输出关联和人工视觉核对为依据;PNG元数据不能证明是哪一个模型生成。素材接入见[图片能力指南](images.md)。## 路线 B 的关键:绿幕素材保留原画面坐标diff --git "a/references/10-\350\247\222\350\211\262.md" "b/references/10-\350\247\222\350\211\262.md"index a4405d5..130a346 100644--- "a/references/10-\350\247\222\350\211\262.md"+++ "b/references/10-\350\247\222\350\211\262.md"@@ -1,5 +1,7 @@# 10 · 角色:人用 AI 生帧,代码负责合成+涉及生图或角色图片时,先按[图片能力指南](images.md)选择当前可用工具或导入现有素材;私人角色素材和平台选择不作为所有用户的默认。+## 角色实现的选择同一角色可用三种方式实现(A、B的并排图见`assets/角色/花叔形象_对比.jpg`;C的效果见Kurzgesagt与白板示范片):@@ -23,7 +25,7 @@- **姿势与镜头调度对齐**(「侧身朝右伸手指向右边」);要动就一张出多帧 sprite(4×2 八帧,帧数写在开头、「同一角色」锁一致性、只给关键姿势让模型补中间、「每帧站在单元格底部居中、大小一致」)。- 绿幕 `#00B140`(白帽白 T 不能用白底)。- 定规(以花叔形象为例):**纯白**渔夫帽(模型爱画成浅灰,要写死)、圆框黑眼镜、白 T、卡其短裤、白洞洞鞋、左手腕黑手表、大头小身体。-2. **验真**:生图工具的输出目录文件数确实增加,且 PNG `.info` 为空(ImageMagick 拼的会有 date:create)。+2. **验真**:以实际工具调用记录、输入/输出关联和人工视觉核对为依据;PNG元数据不能证明是哪一个模型生成。素材接入见[图片能力指南](images.md)。3. **抠图切帧**:`scripts/key_split.py`(去绿溢、按列切姿势;白板线稿用 `--white` 只裁不抠、贴进画面用 multiply);需要保留原画面坐标时用 `scripts/key_green.py`。4. **合成**:代码只决定位置、大小、朝向、换帧时机、材质;石子、涟漪、道具等互动物件仍用代码画并对齐到手的位置。diff --git "a/references/13-\345\217\243\346\222\255\344\270\216\350\257\255\351\237\263\345\244\215\345\210\273.md" "b/references/13-\345\217\243\346\222\255\344\270\216\350\257\255\351\237\263\345\244\215\345\210\273.md"new file mode 100644index 0000000..56fc152--- /dev/null+++ "b/references/13-\345\217\243\346\222\255\344\270\216\350\257\255\351\237\263\345\244\215\345\210\273.md"@@ -0,0 +1,7 @@+# 13 · 口播与语音复刻++统一入口与配置见[可选语音指南](capabilities.md),接口细节见[口播API](口播API.md)。++已有录音先沿用;需要新配音时,按用户配置选择系统声音或已绑定的复刻音色。`scripts/koubo.py say/train/voices`保留旧调用入口,和`scripts/capabilities.py`共用同一份安装目录外的配置。++每次say只生成一条,不自动执行三候选或ASR。补配保留`--fit/--match`,完成后仍要核实台词、专名、接缝和字幕。具体模型、语速、音色与授权不从本文写死。diff --git a/references/capabilities.md b/references/capabilities.mdnew file mode 100644index 0000000..35a8872--- /dev/null+++ b/references/capabilities.md@@ -0,0 +1,91 @@+# 可选语音:配置、跳过与已有素材++本页说明可选语音:已有音频、macOS系统声音、火山复刻。图片通道见[图片能力指南](images.md)。配置共用一个外置文件;不会安装服务或插件。++## 使用前++只在任务需要语音时检查;无声动画直接进入画面流程。用户已给合适音轨就沿用,除非明确要求重新配音。仅音频任务不用启动动画设计或审片。++`S`表示本次实际读取的skill目录,不固定为作者机器或某个Agent专属目录。Claude Code、Codex、Kimi均按相同CLI调用,不依赖专属钩子。++```sh+python "$S/scripts/capabilities.py" status --explain+# 需要读取已信任项目的偏好时才加--project+python "$S/scripts/capabilities.py" status --project <项目> --explain+```++检查只读本工具配置、已选适配器的指定凭证来源和必要本地依赖,不联网验证。`configured_unverified`表示具备调用条件,不能说账户或音质已经验证;`needs_configuration`才需要选择声音方式,`prompt:false`表示用户曾选择手动配置,不主动再问。实际请求的成功以产物与回执为准。++首次缺配置时只问这次需要的一项:沿用录音、系统声音、自己的复刻,或跳过。用户已经指定时直接执行其选择;涉及新的云调用/付费/训练时使用本次已有授权,没有授权就说明缺口。不要要求用户把Key贴进聊天。++## 保存范围与跳过++普通选择只用于本次;用户说「以后/默认/记住」才保存为用户默认。普通配置位于安装目录外:macOS/Linux为`$XDG_CONFIG_HOME/huashu/media.json`(未设时`~/.config/huashu/media.json`),Windows为`%APPDATA%/huashu/media.json`。`HUASHU_CONFIG_HOME`可覆盖目录;`--config`替代默认用户文件。++Agent收集选择后生成非敏感JSON,再交脚本写入;脚本不会阻塞等待stdin交互。++```sh+# 示例JSON:{"preferences":{"voice":{"mode":"system"}}}+python "$S/scripts/capabilities.py" configure --scope user --input <选择.json>+python "$S/scripts/capabilities.py" skip --scope task # 不落盘,本次跳过+python "$S/scripts/capabilities.py" skip --scope user # 以后手动启用,不反复问+python "$S/scripts/capabilities.py" reset --field preferences.voice+python "$S/scripts/capabilities.py" reset --field onboarding.voice+```++「这次跳过」记录在本次任务状态,不能下一条动作又重开问卷。没有回答不是同意,也不执行configure。批处理缺必需配置时以非零退出码返回原因;只能在用户接受基础预览时交无声预览,不能把它叫完整口播成片。++偏好顺序:本次参数→项目偏好→用户偏好→公共默认。项目`<项目>/.huashu/media.json`只接受有限偏好与`deny`策略,不能放凭证、私人音色绑定或授予权限。`status --explain`标明字段来源;写入有跨进程锁,`--expected-revision`用于防止把基于旧配置的整份修改覆盖新配置。++## 三条声音路径++```sh+# 1. 复用已有音频,逐字节保留并生成元数据;若不需要复制,可直接引用原轨+python "$S/scripts/capabilities.py" use-audio --audio 原录音.wav --out <项目>/音频/口播.wav+# 2. 系统声音:仅macOS,固定48kHz WAV;中文默认从已安装普通话音色中选+python "$S/scripts/capabilities.py" say "要念的原文" --mode system --out <项目>/音频/口播.wav+# 3. 已配置并已授权的火山复刻+python "$S/scripts/capabilities.py" say "要念的原文" --mode clone --out <项目>/音频/口播.wav+# 旧调用保持兼容,共用同一套配置+python "$S/scripts/koubo.py" say "确认的补配台词" --out <项目>/音频/补配.wav \+ --fit 3.5 --match 原音轨.wav --match-ss 10 --match-t 3.5+```++不覆盖已存在输出。成功后写相邻`音频文件.json`,记录时长、采样率、SHA和来源;复刻记录请求模型,不冒称服务端回报的实际模型。原始PCM先以容器音频验收再导出s16le,采样率与单声道格式写进sidecar。系统音色不支持套用火山的模型和语速参数。++公共默认是「未选择声音方式」,不是作者音色。火山默认参数建议为expressive、还原模式、语速0;用户可在`provider_options.volcengine`调整。私人配置可保留不同的语速和音色。完整字段见`schemas/media.schema.json`,不要猜字段。++已有平台音色不用重训:++```sh+python "$S/scripts/capabilities.py" bind --name narrator --speaker-id S_xxx --default+```++bind只登记本地别名,不调用平台、不改原来的`~/.koubo/voices.json`、不自动开启云调用。`--default`只改变默认引用;生成方式仍需选clone。++## 火山配置与授权++凭证读取进程环境变量;也可在私人`bindings.volcengine.env_file`指定现有文件,或用`KOUBO_ENV`临时指定。环境变量优先;不自动遍历当前目录、家目录或作者工作区的.env。配置里保存变量名/文件引用,不保存Key值。++启用云复刻需要:`preferences.voice.mode=clone`、可解析音色,以及`policy.cloud`、`policy.paid_api`均为allow,或用户明确给过本次授权。`--allow-cloud`、`--allow-paid-api`只用于表达已有的本次授权,不作为工具绕过规则的办法,也不能覆盖deny。用户改变自己的禁止项时先明确改相应配置;宿主/组织限制仍有效。项目只能收紧,不能授权。++网络代理由私人`bindings.volcengine.trust_env`控制,公共默认遵从环境;不要把某台机器的代理故障经验强加给所有安装者。基础配置/已有音频只需Python标准库;音频验收需ffprobe,系统声音和拟合需ffmpeg,火山另需requests。缺依赖就报告,不自动安装。++训练是独立操作,需明确音色槽位和本次训练授权;`--force`只跳过低电平检查,不跳过授权。只有传`--default`才把训练结果设为登记表默认。++```sh+python "$S/scripts/koubo.py" train --audio 自己的录音.wav --speaker S_xxx --name 我的声音 \+ --allow-cloud --allow-paid-api --allow-voice-training+```++训练会改变远端音色。示例中的授权flags只有在用户实际同意后才可使用;不要把它当常规合成前置步骤。++## 验收与失败++拟合保留原有粗调+atempo,最多生成3次;每次可能计费。最终差异超过±0.05秒会返回失败并保留`.unfitted`候选,不冒称时长合格。合成必须收到服务端结束成功消息,近空、静音或错误响应不提交最终产物。网络超时可能已收单,标记结果不确定,不盲目重复请求。++正式片仍需逐字回读和专名试听;CLI不会自动做三候选听选或ASR。补配应检查接缝、字幕和画面时间轴;已使用video-pipeline时接它的贴回与字幕流程,独立用户也可使用自己的剪辑工程。++## 维护与进化++来源:2026-10-08,P0/P1能力配置实施。使用前读本页及相关API经验;接口的可复现故障先补测试再修代码。公共参数规律写本页或`口播API.md`,说明日期与适用范围;个人听选写私人配置/私有反馈,不能变成公共硬要求。纠正旧结论应改原文;升级配置不得清空偏好或自动启用新能力。diff --git a/references/compatibility.md b/references/compatibility.mdnew file mode 100644index 0000000..9d0d9e3--- /dev/null+++ b/references/compatibility.md@@ -0,0 +1,34 @@+# 兼容性与验证范围++验证日期:2026-10-08。以下区分安装/配置、宿主在线执行、实际媒体生成,不以一个层面的通过代替另一个。++## 安装与配置升级++在隔离Git工作区,用官方skills CLI实际执行`skills add <本地发布包> --skill huashu-art-motion --agent <宿主> --yes --copy`,每个目标连续安装两次。claude-code、codex、kimi-code-cli三个目标均成功,安装目录外media.json逐字节不变。这里验证的是覆盖式重装后的偏好保留,不冒称完整模拟了所有历史版本或所有安装器的update实现。++旧语音配置不需改写即可合并新默认字段;新增图片能力仍未选择、未授权。Codex安装副本的CLI读取了原system偏好和revision,未恢复为公共默认。++## 宿主在线运行++- Codex CLI 0.160.1:真实会话加载安装后的skill和指南,运行未配置状态、禁用生成、无工具、已有图片导入、私人system偏好保存;输出图片与源逐字节一致,配置来源符合预期。+- Claude Code 2.1.287:安装和本地CLI可用;在线会话因当前测试环境周配额返回429,未完成模型执行回归。不能据此标为在线通过,也不能据此判断Skill不兼容。+- Kimi Code CLI 0.38.0:安装和本地CLI可用;在线会话因当前测试账户访问权限返回403,未完成模型执行回归。该版本非交互`--prompt`不能同时带`--auto`或`--yolo`,重试命令已修正后仍为账户403。++这些会话使用隔离的工作区与媒体配置,复用本机既有登录;并非三个全新账号。Claude/Kimi账户条件恢复后仍需补跑在线用例。工具能力取决于实际会话,不能从宿主名称推断一定有生图。++## 实际媒体与自动测试++macOS系统声音和火山复刻已完成真实短句生成;当前Codex会话实际调用内置生图,得到带透明像素的1536×1024 PNG,并通过plan→工具调用→回执→项目复制与SHA验收。图片工具调用由Agent完成,CLI未代替调用。此测试只证明接入路径和文件属性,不代替美术质量判断。++自动测试覆盖配置合并、权限收紧、并发写入、旧PCM输出、未完成语音流、图片特性/计费选择、跨会话计划、配置撤销、图片并发替换和发布对象检查。CI在Linux上运行;真实系统声音仅验证macOS,Windows/Linux的系统声音后端尚未实现。++## 可复现的最低检查++```sh+python scripts/capabilities.py status --config <一个空JSON文件> --explain+python scripts/capabilities.py image-status --config <禁止生图的JSON> --mode generate+python scripts/capabilities.py use-image --file <现有PNG> --out <项目>/配图/新文件.png+python -m unittest discover -s tests -v+```++实际图片工具验证按images.md从当前工具schema形成快照;没有工具时明确返回unavailable,不能用虚构工具冒充成功。没有凭证或授权的CI不会调用付费媒体服务。diff --git a/references/images.md b/references/images.mdnew file mode 100644index 0000000..78fbb82--- /dev/null+++ b/references/images.md@@ -0,0 +1,97 @@+# 可选图片:已有素材与当前Agent生图++图片接入分两段:Agent观察当前工具、按用户授权调用;脚本解析选择、检查产物并保存到项目。脚本不模拟宿主工具、不借用其他Agent登录态,也不自动切换图片API。++## 先看任务,再看配置++已有图片直接用`use-image`导入。无须图片的代码动画跳过本页。新生图先读本次已加载规则中的明确偏好,再读本工具配置;用户已经要求生成时,按实际工具和既有授权执行,不再为填配置强行问一遍。++```sh+# S为本次实际加载的skill目录+python "$S/scripts/capabilities.py" image-status+python "$S/scripts/capabilities.py" use-image --file 原图.png --out <项目>/配图/素材.png+```++`preferences.image.mode`支持`unconfigured/off/existing/generate`,provider是当前工具的准确ID或auto。`off`是默认不生成的偏好,本次明确生成可覆盖;`policy.image_generation=deny`是禁止项,临时授权flags不能覆盖。将用户明确的「禁止」保存为policy,不只保存为mode。++首次缺配置时,只询问现有素材/允许当前工具生成/跳过。`skip --capability image --scope task`不落盘,`--scope user`表示长期手动启用。用户仅选择这次时不存成长期默认。既有语音配置升级后继续有效,新增图片能力保持未选择,不自动获准。++## 当前工具快照++Agent从当前会话已经暴露的工具清单(或宿主正式工具搜索)读取名称和schema,确认支持的操作,再写一份任务内快照。不能通过扫描Key、已安装skill或Agent名称推断。没有工具就写`tools: []`。++```json+{+ "host": "codex",+ "session_id": "本次任务唯一标识",+ "observed_at": 0,+ "tools": [{+ "id": "当前实际工具ID",+ "kind": "host",+ "operations": ["generate", "edit"],+ "reference_images": true,+ "transparent_background": true,+ "cost": "subscription",+ "network": "cloud"+ }]+}+```++示例不是能力声明:`observed_at`必须填写本次Unix时间,工具特性和ID必须来自本次实际schema;快照15分钟有效。host可为codex、claude-code、kimi、other,kind可为host或mcp。计费类型为subscription/paid_api/unknown/none;网络为cloud/local。订阅不代表无额度限制;不清楚计费时用unknown,不能填none。++三家宿主均走这份通用契约。某个Codex会话有image_gen,不代表所有Codex产品表面都有;Claude Code/Kimi若暴露合适MCP图片工具也可使用,若没有就导入现有图片或给出待制作素材说明。不得虚构这两家内置同名工具。++## 计划→宿主执行→验收++需求JSON:++```json+{+ "prompt": "用户确认的图片描述",+ "operation": "generate",+ "references": [],+ "transparent_background": true,+ "min_width": 512,+ "min_height": 512+}+```++改图用edit并提供参考文件;相对路径相对需求JSON。脚本验证参考图可解码并保存hash,之后变动会使旧计划失效。++```sh+python "$S/scripts/capabilities.py" image-plan --request 需求.json \+ --host-tools 当前工具.json --session 本次标识 --mode generate \+ --allow-image-generation --allow-cloud --out 执行计划.json+```++授权flags只表达用户已经给出的本次授权。云端参考图上传另需`--allow-reference-upload`;明确付费API需`--allow-paid-api`;未知计费需`--allow-unknown-image-cost`。长期允许可存入相应policy字段。项目只能设置deny,不能授予这些权利。禁止项先处理,多个已允许工具仍无法明确选择时返回needs_selection,不擅自猜平台。++拿到`host_action_required`后,Agent按该工具的真实schema调用;计划是语义要求,不是跨平台通用参数体。生成成功才写回执:++```json+{+ "status": "success",+ "plan_id": "执行计划中的ID",+ "session_id": "本次标识",+ "tool_id": "实际调用工具ID",+ "output_sha256": "实际输出文件SHA256"+}+```++保留实际工具调用记录作依据。回执是Agent提供的调用记录,不是平台签名认证;只读PNG元数据不能证明由哪个模型生成。++```sh+python "$S/scripts/capabilities.py" accept-image --plan 执行计划.json --receipt 回执.json \+ --host-tools 当前工具.json --session 本次标识 --file 宿主输出.png \+ --out <项目>/配图/正式素材.png --allow-image-generation --allow-cloud+```++验收重新核对当前授权、图片相关配置、工具、会话、参考图、文件hash、实际尺寸和透明像素。计划1小时有效;能力快照过期时先刷新,不能改旧计划假装仍有效。原图/旁车有任一存在时不覆盖;支持静态PNG/JPEG/WebP,需Pillow,工具不会自动安装。图片内容与参考身份仍要视觉核对,hash/尺寸不能代替看图。++通过后复制进项目并写相邻JSON,包含尺寸、透明性、SHA、工具ID、计划关联和`provenance: agent_reported_tool_call`。不要引用Agent缓存作为项目最终素材,也不要宣称已核实服务端未返回的模型名。++## 扩展与回流++添加图片API适配器时先选定真实供应商,再实现其鉴权、请求、输出和错误协议,并写成功/失败契约测试。一个自称OpenAI-compatible的URL不自动成为可用后端;本版没有通用API执行器或自安装器。现有MCP工具属于当前Agent工具通道,照其schema执行。++2026-10-08:P2建立选择→宿主动作→素材验收的接口。复用前读本页和供应商当前工具说明;遇到可重复失败补测试并修原逻辑,个人喜好只写私人配置。语音和图片各自启用,升级不会扩大已有授权。确定性验收与视觉质量结论分开记录。diff --git "a/references/\345\217\243\346\222\255API.md" "b/references/\345\217\243\346\222\255API.md"new file mode 100644index 0000000..c3177bd--- /dev/null+++ "b/references/\345\217\243\346\222\255API.md"@@ -0,0 +1,125 @@+# 火山豆包声音复刻 2.0 · 接口细节与实测记录++历史接口记录来自2026-09-13,查询段更新于2026-09-18;新用户先按capabilities.md配置,服务限制以调用时实际响应为准。官方文档:火山引擎文档中心「豆包语音」库(LibraryID 6561)。++## 鉴权++旧版控制台(APP ID + Access Token):++```+X-Api-App-Id: {APPID}+X-Api-Access-Key: {Access Token}+X-Api-Resource-Id: volc.megatts.voiceclone # 训练 / 查询+ seed-icl-2.0 # 合成+X-Api-Request-Id: {uuid}+Content-Type: application/json+```++新版控制台改用 `X-Api-Key`(API Key 管理里拿)。旧版官方说会逐步下线。++## 三个接口++| 用途 | 路径 |+|---|---|+| 训练音色 | `POST /api/v3/tts/voice_clone` |+| 查询状态 | `POST /api/v3/tts/get_voice` |+| 合成 | `POST /api/v3/tts/unidirectional`(HTTP chunked 流式) |++Host 一律 `https://openspeech.bytedance.com`。++### 训练++```json+{+ "speaker_id": "S_xxxxxxxx",+ "audio": { "data": "<base64>", "format": "wav" },+ "source": 2,+ "language": 0,+ "model_type": 5+}+```++- **`model_type: 5` 才是复刻 2.0。** 不传或传别的值会训成 1.0。+- **请求体是单个 `audio` 对象,不是 `audios` 数组。** v1 接口用数组,v3 改了;+ 传数组会报 `45000000 add unmapped key audios`。+- 可选:`text`(参考音频对应文本,服务端做 WER 校验,差太多返回 `45001109`)、+ `enable_audio_denoise`(降噪,会损失相似度)、+ `disable_volume_normalization`(关音量归一化,合成音量更贴参考音频)。+- 返回 `status`:0 NotFound / 1 Training / 2 Success / 3 Failed / 4 Active。+ **2 和 4 都可以直接合成。**+- 返回里 `speaker_status` 是个数组,同时含 1.0 和 2.0 两版;+ `model_type: 5` 那条才是 2.0,各自带一个一小时有效的 `demo_audio` 试听链接。++### 查询(2026-09-18实测)++v3 `get_voice`请求体使用单数`{"speaker_id":"S_xxxxxxxx"}`,不是`speaker_ids`数组。多个槽逐个查,HTTP错误必须显式报出,不能当成音色不存在。`koubo.py voices`已按此修正。++### 合成++```json+{+ "user": { "uid": "koubo" },+ "req_params": {+ "text": "...",+ "speaker": "S_xxxxxxxx",+ "model": "seed-tts-2.0-expressive",+ "tone_fidelity": true,+ "audio_params": { "format": "wav", "sample_rate": 48000, "speech_rate": -20 }+ }+}+```++响应是流式的,每行一个 JSON,音频在 `data` 字段里按 base64 分片,拼起来就是完整文件。++## 两个反直觉的参数位置++1. **`speech_rate` 必须放在 `audio_params` 里。** 放 `req_params` 顶层会被**静默忽略**——+ 不报错,返回 200,音频正常,但语速纹丝不动。+ 实测 `audio_params.speech_rate = -50` 让同一句从 10.36s 变 21.53s(正好 2 倍)。+ 取值 `[-50, 100]`,0 默认,100 = 2.0 倍速,-50 = 0.5 倍速,线性。+ 同样被静默忽略的还有 `speed_ratio`(无论放哪层)——那是别的产品线的参数名。++2. **`tone_fidelity` 放 `req_params` 顶层**,不在 `audio_params` 里。仅 2.0 音色生效。++## 采样率++`sample_rate` 支持 `[8000, 16000, 22050, 24000, 32000, 44100, 48000]`,**默认只有 24000**。+贴回 48k 剪辑工程一定要显式传 48000,否则听感发闷。+`ogg_opus` 只支持 48000。流式场景官方建议用 pcm,不建议 wav。++## 其他限制++- 参考音频 **10MB 上限算的是原始文件,不是 base64 后**(实测 9.16MB 的 wav 能过)。+ 支持 wav / mp3 / ogg / m4a / aac / pcm,pcm 仅 24k 单声道。+- 合成文本单次建议 < 300 字(约 60 秒音频),长文要自己切分再拼。+- 音色槽位每个 15 次训练机会,可重复覆盖训练。+- 「音色升级」接口(`/api/v3/tts/upgrade_voice`)只是 V1→V3 迁移,+ **不能给已有音色追加参考音频**。想换参考音频只能拿同一个槽位重训。++## 常见错误码++| 码 | 含义 | 怎么办 |+|---|---|---|+| `45000000` | 请求体字段不对 | 看 message 里的 unmapped key |+| `45001122` | `no speaker detected` | 参考音频里没人声。先查平均电平,低于 -36dB 基本就是底噪 |+| `45001109` | `WERError` | 传的 `text` 和音频内容对不上,去掉 text 或改准 |+| `45000030` | `resource not granted` | 这个 Resource-Id 对应的服务没开通 |++## 网络++`openspeech.bytedance.com` 是国内接口。如果本机开着 socks 代理,+**光给 requests 传 `proxies=None` 挡不住**——它仍会读环境里的 `ALL_PROXY`,+表现为间歇性 `SSL: UNEXPECTED_EOF_WHILE_READING`。+受影响环境可配置`bindings.volcengine.trust_env=false`;默认遵从环境代理,不对所有用户强制绕过。++## 关于「参考音频要喂多长」++历史听选中,较长的干净口播参考比三十秒更像原声。这是单一声音的经验,不是所有音色的统一默认;以用户自己的样本试听和当前服务限制为准。++我这边做过一次时长梯度实测(15/30/60/120/200/400 秒嵌套取样,每档合成 3 次),+用基频中位数和频谱质心跟真人原声比,各档差异(1.7%~8.5%)和同一档三次之间的+标准差(1.7~9.5)是同一量级,**在这两个指标上分不出高下**。++但这不构成反驳——这两个指标只覆盖音色的音高和明暗,+**完全不覆盖韵律、停顿、气口、语气**,而那些恰恰是「听起来像不像本人」的主要成分。+指标测不出差异,不等于没有差异。以耳朵为准。diff --git a/release-manifest.json b/release-manifest.jsonnew file mode 100644index 0000000..411b30f--- /dev/null+++ b/release-manifest.json@@ -0,0 +1,417 @@+{+ "schema_version": 1,+ "files": {+ ".github/workflows/tests.yml": "baaf89f4a360bb1fd1ffc1ee7ab79419f93479d5a0d6773fc033a2c8d42bbd9d",+ ".gitignore": "64ed0cc55105bb4b33ebd1baadd1eb18c74b604f6bbce0fbaa4c62b5eb425197",+ "CHANGELOG.md": "7bedbb5ed661647265c083e0e76cb82d03e1d0822564d06e0396319500eb2468",+ "CONTRIBUTING.md": "742a1a6071f6be25e82f0524a520fd6d09961be3f87d7a85940cd816ce7309a1",+ "LICENSE": "6d6a2a9caf2e6d2b76974050427053b2892d8aa4c33fd168ce63a537fcee9d96",+ "README.md": "1b404ff23c34d3d4149bb07332bf1f780c5497b2a7f955e5b711983ce77cb1ba",+ "SKILL.md": "1e4dffc3766442f2aedf4681dd492dae8345be0dfa532c2ca42194075d155cc6",+ "assets/showcase/egypt.gif": "256b946e2543192153f276dc46e0af98837c934ddb9e2e2c0c9843f0557cd54b",+ "assets/showcase/hero.png": "3b6b42bfb00f84925aebe2a10f85052dc6b4efb492e86f581f21f652b6686407",+ "assets/showcase/mario-claude.gif": "f63f2f464c1d7b477578d07359d85712086a39b615669f1d3bb015290c54741f",+ "assets/showcase/mario-clips.md": "e29421cc252a439a33c81f26c18fb89c1c5584e3ec9bb278e469ffc772b61f6e",+ "assets/showcase/mario-combo.gif": "55b5ae17a3969a59c31f0dac870af1ea913d72446917a815e703384458b6ea36",+ "assets/showcase/mario-pipe.gif": "d89e5016810a3079e738aa9aad38312f2096d00dee22e752ef9befac8faf0a03",+ "assets/showcase/monet.gif": "524e4e69ce9a2eecad6bdb2709db6587ba49aed59843a164f5e9c5b90b7a33c2",+ "assets/showcase/pixel.gif": "3eec9eb90adfa528ee7e660bb00a81128a07dcedada6273395bb623014a12db1",+ "assets/全风格总览.jpg": "99512979c3ffd709ace498647cca95b4a31e45ebe435c0ce77f9522470f93f7e",+ "assets/动画语法/t1_3b1b_总览.jpg": "eeb77f3fb238b503612ad0075b17fa2a1315c629457eecdfd8f043e33ebc410a",+ "assets/动画语法/t2_keynote_ui_总览.jpg": "2f7cb8e070512210ca4f1fccb7e86742658946f33af90fd17b84e997cb9785b9",+ "assets/动画语法/t3_finance_chart_总览.jpg": "4a761592ff73623cba1a1c065ba98a9f6fa46ff016735671f82fb3cb22ec7ee0",+ "assets/动画语法/y1_kurzgesagt_总览.jpg": "c76e685e90dc1b99e741d126c495086006e1393be4f8a16145677af457e05235",+ "assets/动画语法/y2_vox_总览.jpg": "f70957fa84faf280eb29c4231d4bfddc0c43b07a23155b2d64ce83493359c765",+ "assets/动画语法/y3_whiteboard_总览.jpg": "cc28d7e021d8bc094387f4e65627ad940417459250502e586e3f2fe9603ae841",+ "assets/动画语法/y4_storytime_总览.jpg": "6cc308bee5624a6e11f063185af67bb1625332a44aabedb22f1329b1f60cfdc5",+ "assets/动画语法/y5_kinetic_type_总览.jpg": "fbc1612a831eeaa05f03bdef32b477dc459769834f57ad6331517ebfb92651b9",+ "assets/角色/花叔形象_对比.jpg": "e2dd1082f5a6d6c66182b27b16a71ad9b6426e567ff4b406e4ebec007e044615",+ "assets/长卷穿越_总览.jpg": "3f925f5637553c2b5bc57052f65f8065dbd14837c9881bb5d8e2bb898f29dba4",+ "defaults/media.json": "8e1c98a9b5b8195f66c4060e05e5dded9bb95b797164a8b9c587bdfa5df4e0b4",+ "references/01-拆解.md": "83dd492d5b1f616a6e45302b630a7fbcaa65a16120a8df443185df2ee615cb32",+ "references/02-机制.md": "ae052d51153c8f55efe4f7dc01539d425e14fc71488c6acf3c8eb22b87352d19",+ "references/03-一帧先行四条路线.md": "1e2f5bd60e0cdf66921acf852d4fc60d632a9b2e5e2bb4c74d28066a75b0f3d1",+ "references/04-纯代码绘制.md": "b41ba3faf32d24cb020d140ba7c0e95d9ad71462049dff2f390f4a18e532b53c",+ "references/05-节奏与配乐.md": "1086c15ea216548777d2fa5552cd5c874ff89df2da84f9ffa160737930e3d98f",+ "references/06-口播驱动的艺术短片.md": "9275abd6451831515ed9aed24724062bf47dda5e5d2d804baa8313c137236bc8",+ "references/07-正面经验.md": "aacda61500b54e767b193815e64363cc3acd6a11ef0274aabadd2947f54f3412",+ "references/08-风格作者规范.md": "991512161847dec5504b3a31060268eb7fdd0f28e6224180929995a8c1a5dfbf",+ "references/09-视频动画语法.md": "bcc55abee660c2c7d5f415f38f5dbb6fd5fb32fd65bb2eb5cd4dffcf944f38b0",+ "references/10-角色.md": "0c69bc849688069ee59bfe619eb7c44c48dbeee0324ee2bcc87bbe98d41af74b",+ "references/11-长卷穿越片.md": "42f2e441687116c8d2dd789b187ada572390e242976996727a209959163a6ad6",+ "references/12-口播整片与经验回流.md": "b85f6e8b665c13a5d98ea461c10af340679a6949101ee31dd64eee7e88aed415",+ "references/13-口播与语音复刻.md": "cb12d2002f9c7a8a41b9abd711bd44a99f9929bcd66351015232cea2eda024a6",+ "references/capabilities.md": "8d0577a8128d661711a3ca26f1b60a1e3d06cc5b6191b7007326dccd0e35d2ed",+ "references/compatibility.md": "c5665580fab722a3ed784a71f5cca725fc56cebf8c8c3ad66219b24b6b97bb0e",+ "references/images.md": "313bee677064eb46ee13c88c74effeecdb536579d7e8a25e23ddf9a2a06357e3",+ "references/动画语法/t1_3b1b.md": "2a3b8caa3b14314658163b023d6d850582975be82dc504e7176ca352915df87e",+ "references/动画语法/t2_keynote_ui.md": "9e57d5a6593bbbaff0ac05f889289b3632289a6d516dea8ab50776b91b99a82a",+ "references/动画语法/t3_finance_chart.md": "0d15eee495f0a062c58b77c7c5f76884f04e097477ef8662b3b489673ad00d79",+ "references/动画语法/y1_kurzgesagt.md": "a85260b0c47948e5cc07983f88f8d264b5c2f30373ece2d1d660d0ee133a9598",+ "references/动画语法/y2_vox.md": "55d14c741d99dda8e16bc9aed704590207f238134e3e32ec4c86ee896441ffc6",+ "references/动画语法/y3_whiteboard.md": "1932f128fec943341bc0bb18a29a65ca347071faa23dccc7c1434506bcb3547f",+ "references/动画语法/y4_storytime.md": "01dcb82eba4b071a368ddcf58a418a10f40e96bb384d716bb194c3ba33260525",+ "references/动画语法/y5_kinetic_type.md": "73538b3854cbea8f81e5a84067ba30e890fcc811251714254f2c18fb9b3589f5",+ "references/动画语法/y6_presenter_explainer.md": "405318fc5aac9ce03cbc374af9633ec7d652dc8206ad3810919abdb174eff273",+ "references/口播API.md": "a9d2775fc97bf92f46cf0a6531f1921ccdcf195dd79475c575bf8f188ca5801e",+ "references/风格配方/01_cave.md": "ebdb5fc8f9a57d947ef3a325bfdaf275cbd906e36010945e05c7d2e7ef1f4d2c",+ "references/风格配方/02_egypt.md": "a3097d1936d0e482a56a9745e31f3ba9a508aa2db50fbbefba4d97cc4d481ebb",+ "references/风格配方/03_greek.md": "0caa761151cd76d1a31390f602dc6bc131dba745c6244a2b12ba037697077b50",+ "references/风格配方/04_roman.md": "4066fc1b3edfaa7ad4494646df5c6bef0a79d77cb0326d7487b2f833fbb2a81d",+ "references/风格配方/05_gothic.md": "2c33750ee754673f87828f1755c14d4c893cd0483e96ceb02fe8f0f33c3a440b",+ "references/风格配方/06_renaissance.md": "2fd2589f538747b7c2a178def2441e432a3ecc7bc5aee8e3a1f82c7a79792cc6",+ "references/风格配方/08_impressionism.md": "dd353d6e2ff550c3601a20bd529c8908118b4453d12b009e1e82761aa1822b65",+ "references/风格配方/09_postimp.md": "20aebeaf193cb1ac960c73e70a289e52f6a939949ce558ec06f7d816311fdd0a",+ "references/风格配方/10_nouveau.md": "ed5a38a201c7d4c69473a662d2e17b8a7081d09cdd2fcbeb57575da7bef3cc64",+ "references/风格配方/11_cubism.md": "0ab951ff470aa6bf6a001fe4bdd51d02367f03754a94f0dc443d27351a9aa6ba",+ "references/风格配方/12_bauhaus.md": "729623cbc414f11d1c1629dcae0d1e64452acd7fdfc5c07bd41f44149f13c59d",+ "references/风格配方/13_pop.md": "01e334a4b76ebfd0c71fa6997acafc6d02929498998f99e4544689bd5fb43913",+ "references/风格配方/14_8bit.md": "fa237f81d76cea3dae16929093814b92399829e33175aae3d26bd4cec39b6569",+ "references/风格配方/15_raytrace.md": "44498145e8b99156b2ee36446444424322f0ed6ee2e0384f34ff242fe89f68b1",+ "references/风格配方/16_2026.md": "4dfc199bdb1ed0b1fdc3ed9108bd5eb2e8078fdbb4de0e0bb5d00c6ba73f31f1",+ "references/风格配方/17_ink.md": "67f396530a9032b523151f649d0d8398562ff9f6acede3ef4aab85c831d2c032",+ "references/风格配方/18_klimt.md": "c4e96a0f531b8157e05592379a152a85a41acf2718f77883ce872e04865dfef9",+ "references/风格配方/19_munch.md": "8c629e8bd02fb82c3355c37fe040c863f067827fde269d91ac7ab97bc118939e",+ "references/风格配方/20_dunhuang.md": "3a5911346899c0f19cc5bee74bc4e8b4b1ffc9ae1c603a8a48b8277596057568",+ "references/风格配方/21_kusama.md": "f39173eb8e80dba26fcdf822a60bb5cd0da2678d8efa4a8b2d19cbb2e1468a4a",+ "references/风格配方/22_constructivism.md": "ff4adc806f0bf39d86136d805ef8e2cc48026fbcec3731fae22477fdafac846d",+ "references/风格配方/23_dali.md": "facf3f033d5dbe42ab663860490a32920423fc5950ddcabf5f44bf81b49b3f2f",+ "references/风格配方/24_hopper.md": "fd19a530f9e0544d74e7eee40a88c01fa7f675ae94d9cacf2e5af4e214c64c63",+ "references/风格配方/25_ghibli.md": "55522029929a296979180e6fac3556c7d85ea92de1369a4f11e94fbb64f48348",+ "references/风格配方/26_vaporwave.md": "30cf8e825125ff74f02bff93b975a74c96ceae9df09fae06fd7ef887fb64ec44",+ "references/风格配方/27_kirby.md": "e64b8a69ce706311b1e81aa7d0756c7d7390b2b3f84a17f18b67c3193bce2408",+ "references/风格配方/28_monet.md": "61b2bf9da6044e44ea0fa4758b3c380be8e60cfb72e2907e5afbbaa0c00d3513",+ "references/风格配方/29_seurat.md": "2c50cfb11d3bcb83b50b946126e1c0ba76f9fc3b94eab055023eea2880440f84",+ "references/风格配方/30_matisse.md": "4da4fb6d6828fa529e2827d20bf0c4e45822427348db42b7016ca4bdc336c60b",+ "references/风格配方/31_haring.md": "adcf02ce8c7dd9446e79e3393f61c411335c6f1734d584f3389f64283c5ab30b",+ "references/风格配方/32_rembrandt.md": "383f5953f5b61249c5735fef4e31f0ed05148a7ec038f580bf39ddf7dc6ba7f7",+ "references/风格配方/33_rubberhose.md": "c99886da03aa74351d78695641b403c92f5f9ab4b242feb2be45d8b8a7da9617",+ "references/风格配方/34_shadowpuppet.md": "6cd4f9a090bff6d325695e8e4656ad041871f2ff0418b4eab1a46d51bd7d7609",+ "references/风格配方/35_shinkai.md": "b327bf36ef2edc246576cbfb8f1f1857c52600691adbd651efbb1eeb75e7a554",+ "references/风格配方/36_picasso_blue.md": "7578a99b0dc416414eb2cfd5c6aa9055ded387531bfde65fd5c1f17f22e4404a",+ "references/风格配方/INDEX.md": "93628df4da963c24fa6cf4929684d3bfcef3cc65228480529bffb3c5e2ede609",+ "references/风格配方/_转场_迁移测试.md": "16e901fb8c6bb2b9ff6596bec30209471227b74440dc9d5f3ba7931c99238677",+ "references/风格配方/_音轨_艺术史速通.md": "f9c360503ec366bf0833687fd00eb2a276f1c8dc5e02ab93651e676195d10d60",+ "schemas/media.schema.json": "4b7d93ebb7edf5fa6219891f28325f68fc51f090eee756bc4cc3a3c746d48bda",+ "scripts/analyze/breakdown.py": "5badcd4e3f5694f5b8c5a6d7d353f830e972ae5c8a6f24ed75af634411eb75f3",+ "scripts/audio/synth_艺术史速通.py": "6476605af684b477d47b7f47c3c987059277de36b97bff5d77d167c27efdb40d",+ "scripts/capabilities.py": "43b1dd58d9f42efc638270cf67190ce85dda4e25fd591925c2f31e5bd6b4f63b",+ "scripts/check_release.py": "508388bdcfe87d97d486de7d76fec87b893469779af14cc75e4b72b4c17ecc60",+ "scripts/engine/clip.html": "9c9a1f2301c306e147ad53549aea986ac2943194d62b9a578a2a22d9dd7c735e",+ "scripts/engine/clip.js": "561d71fefcdbce4c783ff42775ee7a10cea957ce2617273fa435f0cae69e59fd",+ "scripts/engine/clips/t1_3b1b.js": "6e819bb9be76db0d8a7220e8aa5fedd83879b24ce6084579d7ac2641d85deaa2",+ "scripts/engine/clips/t2_keynote_ui.js": "bd96d0b6d4c55e86bf7b16852f90373b443f3eff8f6fd86ebdeec02f9d5f658a",+ "scripts/engine/clips/t3_finance_chart.js": "db7e1b44993964add4125917e7a651adc4a143259570aa4e65d85a72aae0d44b",+ "scripts/engine/clips/y1_kurzgesagt.js": "99c8656ac04dba5a218199ea272a71ad8ee34ad69125f906b22d6d1946745029",+ "scripts/engine/clips/y2_vox.js": "250d7f793ad3c331bd351e43d70565144f73bbe5ae65e8588428811dfe45cf4d",+ "scripts/engine/clips/y3_whiteboard.js": "23ff417331708353de03289860bec28206aea12acfc45e40bc53b81c5a0e340c",+ "scripts/engine/clips/y4_storytime.js": "88faca8e84364dcbf46cf28dcedc3cd488909d2d439c88d12ffdca26114a2ba8",+ "scripts/engine/clips/y5_kinetic_type.js": "dac5d0f8da6ed8b0947235c2c2ad51234454cbc42a7da29c27826ee616716ded",+ "scripts/engine/compare.py": "7bf1d5ae2926de09f69431435e93ffa4c5357532b543217cd66bdc57e00256aa",+ "scripts/engine/demos/_shared/hero.js": "96e9e520d1139aa617be7ad01901f6a9b6c31c7948f73b33ddd8d646c6cdf967",+ "scripts/engine/demos/_shared/hero/c1_0.png": "827032c6aa741f9895895224a67f81538d70ef970b10da6c3ee93e8deece3018",+ "scripts/engine/demos/_shared/hero/c1_1.png": "9ab883b0af1460fae56970739ee82bdb8f59717ae2d3f11b56ca0b5088876c5e",+ "scripts/engine/demos/_shared/hero/c1_2.png": "94882c9cbb1cc7ea82afb736412d388bfb06e30b08ffec861192443b9fb1c28c",+ "scripts/engine/demos/_shared/hero/c3_line.png": "b98528a02ccdfc1c7570e7a907990421d53d14e7f77068a31ba9ccfeb397a0da",+ "scripts/engine/demos/long_scroll/eras.js": "4c35e6e800f7d01a11f796fe052c11ca957c6c46665fd2b23927a8390357f617",+ "scripts/engine/demos/long_scroll/frames/8bit_act/01.png": "74d6834868571bd257bffa91022aa649f0a80802d5b678ff59590539c99f7cf0",+ "scripts/engine/demos/long_scroll/frames/8bit_act/02.png": "19806884da80aba0b271556b529934359587b7e4a69bd6da7b57ccfd69bbeba6",+ "scripts/engine/demos/long_scroll/frames/8bit_act/03.png": "598557fa4ba263ecd000398614e552f2afe04a148f957ef020bd05d32cccf2f3",+ "scripts/engine/demos/long_scroll/frames/8bit_act/04.png": "fa08801ea3d6b79acafaa451ac697a060b059747ffd89c0375e6ee1b0901dbb3",+ "scripts/engine/demos/long_scroll/frames/8bit_act/05.png": "469a75afeab1a7c9602f27a7f5f9fe74ae4c88227f22ba8977c1a72cb2beaab0",+ "scripts/engine/demos/long_scroll/frames/8bit_act/06.png": "1d26ed214328655a20233ec2b09e6181f431e1a4b40a2f308e4a03a8ac02f1b7",+ "scripts/engine/demos/long_scroll/frames/8bit_act/07.png": "867c900356062c27187298641969dfce81a1fbebed7808692759fba3fa74c4cb",+ "scripts/engine/demos/long_scroll/frames/8bit_act/08.png": "ae74efabbd91cca2570d51c141672d991f6e895796dc01e81dc62099568d2f74",+ "scripts/engine/demos/long_scroll/frames/8bit_act/meta.json": "80dbaba87b9237958c392562338ac324687c50220ddb0c1572a8371f92131ff8",+ "scripts/engine/demos/long_scroll/frames/8bit_walk/01.png": "422152e3831b1df4fd5e2889b413ca6c84d1646b84dca704a9f7312cc4da6bf0",+ "scripts/engine/demos/long_scroll/frames/8bit_walk/02.png": "b5bcf6a167397e8b3c06a0f8570b2abccc55d5498390d9439b3a9f5f4c792ec4",+ "scripts/engine/demos/long_scroll/frames/8bit_walk/03.png": "2d3670bc129660ef46836ec9091ec08162119e7925825734821f3aed8f470700",+ "scripts/engine/demos/long_scroll/frames/8bit_walk/04.png": "fed712a2565ddde80c82f829bd6eeddc96eaa53193b0bfd21398460f21cb558a",+ "scripts/engine/demos/long_scroll/frames/8bit_walk/05.png": "b5a663297f578133699fa6d345b9c2d36634722ecb1bc5e3a642be5b85cf6b24",+ "scripts/engine/demos/long_scroll/frames/8bit_walk/06.png": "5ae2393b76809bb3dbc929d3def67802fd2889ab12799faaceb68077e471c3d2",+ "scripts/engine/demos/long_scroll/frames/8bit_walk/07.png": "69a61db4c6910896790bf93b4d661a4860928cdb52cdccbfd4d5a94055f9b81e",+ "scripts/engine/demos/long_scroll/frames/8bit_walk/08.png": "62afb8496eebe9c0f58790d85835ebc9a0502a341c2a5c92fc81a90ee4cde0a6",+ "scripts/engine/demos/long_scroll/frames/8bit_walk/meta.json": "3391931eb00392c13c9d6d555292c5c6ed62ee1761a74160bc0b791669784891",+ "scripts/engine/demos/long_scroll/frames/egypt_dodge/01.png": "298d124a5201b9a6c2d2957471163ab9ead605690f14e1d0737f566a37d5ff0b",+ "scripts/engine/demos/long_scroll/frames/egypt_dodge/02.png": "d7849492606178176783bebb932a593a8b84fa1d68e1669c1fd801e1f9646426",+ "scripts/engine/demos/long_scroll/frames/egypt_dodge/03.png": "282257c1b3f10db6813428e19e2cd118ad1367dd2ee119edd103908930a8bfe0",+ "scripts/engine/demos/long_scroll/frames/egypt_dodge/04.png": "277517af7b758bb9ffc2d45267de6cdf5a405bb80aee1aa5569298248414a0b1",+ "scripts/engine/demos/long_scroll/frames/egypt_dodge/05.png": "d3dbc34b29655a57cb26ea7886067b1539d97f317aef3cc29ab9c88e8018ee71",+ "scripts/engine/demos/long_scroll/frames/egypt_dodge/06.png": "0a50ce8323e4adb48c06ea493d5c6ee471a80c2028670b82b6266b5bd8451fa8",+ "scripts/engine/demos/long_scroll/frames/egypt_dodge/07.png": "114f1aaaf3c157d0aa6ea6437261888e40b224cf3a4b9bff47a4b8e19e382177",+ "scripts/engine/demos/long_scroll/frames/egypt_dodge/08.png": "1716833fa180c6d3aac3ffd4b884a8fe0029438f676619cd5194a820d9ed083e",+ "scripts/engine/demos/long_scroll/frames/egypt_dodge/meta.json": "7706f4d79fa8c336e31d7c2570b47d29d3b90b2e11ac9905323df1912493e8b5",+ "scripts/engine/demos/long_scroll/frames/egypt_walk8/01.png": "7500fb8df1c49afde25c8f7ff0d082de925373f4548679ab6a9788b405aa17a4",+ "scripts/engine/demos/long_scroll/frames/egypt_walk8/02.png": "7e9b5b0f6b6c78a6f4562f0c753663e909e7a0b8324fd17cb4bf0ff4d151f90a",+ "scripts/engine/demos/long_scroll/frames/egypt_walk8/03.png": "a0cfc27ca9b366ee07af25bfdcb2b030702945bd7ad039f9d0333d77cc3998a8",+ "scripts/engine/demos/long_scroll/frames/egypt_walk8/04.png": "234955761a0485643b4310d646ab23d02c0afda2f9cae98f1e83c5384eea7ab4",+ "scripts/engine/demos/long_scroll/frames/egypt_walk8/05.png": "977c7a00b05e1394391d17e74a9aa312f5a8d1f524f3b938ec1373948099e4df",+ "scripts/engine/demos/long_scroll/frames/egypt_walk8/06.png": "c09db144378ffc255e2ec1b3d8bdf1936e7e18f4f2496cad61d4138d5d5b7304",+ "scripts/engine/demos/long_scroll/frames/egypt_walk8/07.png": "1e6286142b4457fbd35014b813742da0bd42771524823067142186cc280a1725",+ "scripts/engine/demos/long_scroll/frames/egypt_walk8/08.png": "46dccbe4ede8a6c0620ad0ca96b4413ded56d7033cbbeffb8985588257c2d842",+ "scripts/engine/demos/long_scroll/frames/egypt_walk8/meta.json": "9df61edb22b06ad111462082881fca88427909c0540f33aeef71ccbd44dff3d6",+ "scripts/engine/demos/long_scroll/frames/monet_throw/01.png": "6777d07ffceee31b1f0a2da4e9b68f74f74bf648282dae517fe4b2aecd244553",+ "scripts/engine/demos/long_scroll/frames/monet_throw/02.png": "f594484eeaa48fe388986f78e940ecaf896a3fb3a21b2fd9cf05449dca04e923",+ "scripts/engine/demos/long_scroll/frames/monet_throw/03.png": "2490009faffca1452c7b2cecd5d4525b8f2921b60d46dd85b18dd50c0ffd7433",+ "scripts/engine/demos/long_scroll/frames/monet_throw/04.png": "150ef0221b74b27fcf7a9873df41df4a11a3ab2bfec21b7fd3964a596427481c",+ "scripts/engine/demos/long_scroll/frames/monet_throw/05.png": "5aabc6f6164b99063eb8a8bd27cbc77de062f415179ec14fc8c44bb264e380af",+ "scripts/engine/demos/long_scroll/frames/monet_throw/06.png": "175c1ee674743544b28dd2e04ad8dd26ea89a1f664cd31706c7270442a68368d",+ "scripts/engine/demos/long_scroll/frames/monet_throw/07.png": "adb52ccb864ded668d02c17aa9d21acabc4c6c695561f5c7e221fee8fd8d711f",+ "scripts/engine/demos/long_scroll/frames/monet_throw/08.png": "a5befb97ddc1c17962011fd1b366c6c087c2fdc5ea4104f00f01ad0fb83a7fe8",+ "scripts/engine/demos/long_scroll/frames/monet_throw/meta.json": "01db607f2fa4e10998628a4f2b1c1ba184915d76070be2b9e92051527cd2d5cc",+ "scripts/engine/demos/long_scroll/frames/monet_walk/01.png": "0e58b3f88bddb5d2488f59846a844f4bcf62f94e860eea7598e4e011de6ab9d9",+ "scripts/engine/demos/long_scroll/frames/monet_walk/02.png": "30ee4cf8e6e594115a8e13dca65728936d70fefdc189fec970bdd96c3635c618",+ "scripts/engine/demos/long_scroll/frames/monet_walk/03.png": "cff12f6a7fca6a001c995ea01d1fc194318856de38c97464dcd4a1b216d32986",+ "scripts/engine/demos/long_scroll/frames/monet_walk/04.png": "588a7a28307b1684522ecd3d7e39a3ab4d8ea42dfc0c8596236286a084f883c0",+ "scripts/engine/demos/long_scroll/frames/monet_walk/05.png": "7f0828088ba1dfde2821c3cd6d4b3c2f3435cc3176c3713b683ea1a4004d29b9",+ "scripts/engine/demos/long_scroll/frames/monet_walk/06.png": "d66fac1d04408e301dd9cf65eff68e0e7c6d3147103e9f775a413854ae0afeeb",+ "scripts/engine/demos/long_scroll/frames/monet_walk/07.png": "75f1e003de49fa658f0b74f7d0e916503993ae838d02cb99f0b04d0286821477",+ "scripts/engine/demos/long_scroll/frames/monet_walk/08.png": "4924bafb390350414c100c52043942b6ca7e2978dd9e20446b2ae65ca0d37392",+ "scripts/engine/demos/long_scroll/frames/monet_walk/meta.json": "fef96b1af712cb3f09b9ee3f987b6e97ae24bac2366e78878796045dd60856e8",+ "scripts/engine/demos/long_scroll/lib/acts.js": "db003703801f1ecead3552e38c7083d646aac1f669d907832e48173865095e02",+ "scripts/engine/demos/long_scroll/lib/crossing.js": "18853b65e3fbc8badc1cc8100d577241faab340d4d2e685a10667fdda78cd802",+ "scripts/engine/demos/long_scroll/lib/world.js": "ba39f30231bcd510947c9dc32a1801f9e2cd0ba68a41a6aafccf2e8fb9bfa642",+ "scripts/engine/demos/long_scroll/lib/xing2_ding.js": "685a341d785f211b999cfd493d41cdb2b84df99f7b640b19b3f1e09848cab21e",+ "scripts/engine/demos/long_scroll/lib/xing2_jia.js": "d58e9e8a23152eb95854861ae35f871267820e20407a6e01eccdb2f9239278b5",+ "scripts/engine/demos/long_scroll/lib/xing2_yi.js": "7913d931861847aac8028ce47ff003d8fde9b60638ecfa08e6a9159fd808e412",+ "scripts/engine/demos/long_scroll/segments/02_egypt.js": "85d22b9c9dee0a0772a85ca2d3437fbe2c7af073be6ff2cb79a62763d11c3646",+ "scripts/engine/demos/long_scroll/segments/14_8bit.js": "cd1d348d8096b0bcf28ca946c75f3a64759f1158ce634571baf2024a97752b87",+ "scripts/engine/demos/long_scroll/segments/28_monet.js": "c7e7542792a36695f07e60e90e118e566cde9b55c007fe42162e27ff25b1023b",+ "scripts/engine/demos/t1_3b1b/eras.js": "448e7293cf5a0e724b2cfa4cab1bc7148f8027ecc0ddfc6a04ade2817acb2216",+ "scripts/engine/demos/t1_3b1b/t1_s1.js": "10f1e0b82dae1c55f53f59ae6fbae8d976773d822c749171f924121214d47b3a",+ "scripts/engine/demos/t1_3b1b/t1_s2.js": "686b2c620be37ede852c92c3952f624dfbaf5724927328e9ab45d8bc7569922f",+ "scripts/engine/demos/t1_3b1b/t1_s3.js": "042794b3c2257cae2d8616955eabdb2ec2af761e43ec4d8604d937faeb693d7b",+ "scripts/engine/demos/t2_keynote_ui/eras.js": "dff467d0c0bb90bb864707192cb7ee0b5771c3793448f4a9ffe04b579818e23a",+ "scripts/engine/demos/t2_keynote_ui/t2_s1.js": "03ad91437ccad3d7da0135c0f85e5ea152a0f386061b003422f0d8ab2fb64118",+ "scripts/engine/demos/t2_keynote_ui/t2_s2.js": "58d26b8329b9596180447046b22742c290780dd75283de1b655fead0383cf3e5",+ "scripts/engine/demos/t2_keynote_ui/t2_s3.js": "9e2e574f158350de3d1d5da50d296ebe87fd1a18b12be3b53391895a0155220d",+ "scripts/engine/demos/t3_finance_chart/eras.js": "7d8bcb0c7f1aa6e13ec6e565925ab6689541e12e5643a555b037b8d611963ab6",+ "scripts/engine/demos/t3_finance_chart/t3_s1.js": "a1ba20f354638ff97df547d3f352416850d17370f8af41169ec1b6f902fd2936",+ "scripts/engine/demos/t3_finance_chart/t3_s2.js": "a50e8b705ade4b22515851c904c8035c8c8479d712594fb0a6c5e08688a871c2",+ "scripts/engine/demos/t3_finance_chart/t3_s3.js": "45d1cd1cb0e8edf0b4b07229f9ee0ff9e4c3b4b52ec3d5e980fd23cc897a5c3e",+ "scripts/engine/demos/y1_kurzgesagt/eras.js": "0ae30c83af4116e3a2b9cc74eef918638ff49f33f43e31e499def6ae66eed098",+ "scripts/engine/demos/y1_kurzgesagt/kurzgesagt.js": "4620f12ad924a865f7bdc74e72bbc87be4f5375ac8fa7ea415aabff9179b7630",+ "scripts/engine/demos/y2_vox/eras.js": "5ff129a2d4bcfefe6d1c7602bdff9faa55f408256c6429c755e37a63249c3bce",+ "scripts/engine/demos/y2_vox/vox.js": "d288cca5eee2aee08e803025ab41dd73096f44ab50845bdde2cc8ed7e9e07ec4",+ "scripts/engine/demos/y3_whiteboard/eras.js": "e073e6936000acc885e4ec8588e3ace496c25530dc6c03a4c5e2c1543b84278f",+ "scripts/engine/demos/y3_whiteboard/whiteboard.js": "24921e56f9b3d6c1c94d77e1102c907f36882f6e812dbdc1c01a2bac094fae5d",+ "scripts/engine/demos/y4_storytime/eras.js": "c3cf9816bb94b08d6065f1b5c67d71bf9ad23b1f6b398345e27ecb0f40af396c",+ "scripts/engine/demos/y4_storytime/s1_desk.js": "e687991b4127e99efd0c73339670a30a968708817a2ec32345b2931bf7105d45",+ "scripts/engine/demos/y4_storytime/s2_screen.js": "414ebc1df2fa078fea7b0cb2dcc633d20a84ce9eda1f9fd331190b0ecd42c0da",+ "scripts/engine/demos/y4_storytime/s3_react.js": "12616dec31481b2d2f2fa9a9f086d48e8b1a48ead7e18ebff989ec9bc1eae9de",+ "scripts/engine/demos/y4_storytime/s4_wide.js": "a238d9accd8d789104be7f4d0984922698e371c38fb3780d457e907540c36602",+ "scripts/engine/demos/y4_storytime/s5_close.js": "62323752eaf8c997d700e92f5900c2a8d86365d528534338e7a0ca8bf392eb19",+ "scripts/engine/demos/y4_storytime/story.js": "945e7171975fbdfbd95c91cfca070e64f9c2a4f6ae8fc034468f1adcd9dec3e1",+ "scripts/engine/demos/y4_storytime/vo_env.js": "04739a58e5bbce262ef1f2d3c1f7988d85d2fe07139a64bee7fc2318d50bd98d",+ "scripts/engine/demos/y4_storytime/world.js": "45d9d78424c15b2d43471b5b1c211f95ef7d20fcee2c5fe510fe722eb1f31153",+ "scripts/engine/demos/y5_kinetic_type/eras.js": "540e671b8d6e7e85684332c68c079c88da674fab8ba80bc3773a27badb5c4d50",+ "scripts/engine/demos/y5_kinetic_type/k1_title.js": "b1c0d5ee07720e6f4df94dec9e6101bb5781a009e3bf7584d68dc48c413cd215",+ "scripts/engine/demos/y5_kinetic_type/k2_complete.js": "3f2d6a463508cecc5ca2327f0a6ae3f7e5b30e90d8ffe48638113244baa25be9",+ "scripts/engine/demos/y5_kinetic_type/k3_chat.js": "c810bb9c4462b7f60ff9e5eeeb8edd0e2a74d73fc42116c8a95a48210fb935a6",+ "scripts/engine/demos/y5_kinetic_type/k4_agent.js": "368d734da08e17beff2a267b2d664a99f48fc28dd911da637c2e81e295b36e90",+ "scripts/engine/demos/y5_kinetic_type/kinetic.js": "83b5ada7617db67f715203882eda22f54c846c7655418ab10744a373472a8c84",+ "scripts/engine/engine.js": "2ecd3659912e5e2fed75cc62c8eab974c99dabf1bb773699967b822d2ac05259",+ "scripts/engine/eras.js": "2ccc90bed5e9ef337f8cf3444058705dc720743a78c9315a0e5ee814cd130fc9",+ "scripts/engine/eras_gallery.js": "6e97dfe281b8360d400a657098a68dd224a1a081299b28b3137a1b1db1a8222a",+ "scripts/engine/examples/assets/K线图_横屏.png": "04a61f9be80bc4895136cfb168ed102860d96af41edab1957e326d647993cb19",+ "scripts/engine/examples/assets/营收图_竖屏.png": "5c3c9207a8ea289347463408547fdd8f19c63e68e1cbcbcdbc5de77b556b1648",+ "scripts/engine/examples/assets/财经图表_横屏.png": "95c56c106f6eed633cf2c8b6bc46465ecf335aefe5abd9bb8e91563b48c572e1",+ "scripts/engine/examples/t1_3b1b.json": "ff2ceedef8fc994bd930c25660b99d05feb81ac8a07c37d8c336b38e7634c352",+ "scripts/engine/examples/t2_keynote_ui.json": "f41f56d885225996a70b9fb9f94895df21380b3e51b9f7e2cc1a2bebf2871db5",+ "scripts/engine/examples/t3_finance_chart.json": "ca042db4d512efa2753d45ec8b2a4d67dede518c1e8015ce218817c7e7e9ccc0",+ "scripts/engine/examples/y1_kurzgesagt.json": "9dfe5f763f79928b63a3f6c26ede2340f4cf9eaf2898116bf8a8414c02258536",+ "scripts/engine/examples/y2_vox.json": "af354d13098f6914d7defad6d85e603bc15cd235991f568518eee3e3ef1ea6e5",+ "scripts/engine/examples/y3_whiteboard.json": "61bb5be6d6322a29b27d70509a6d3d73cad3a1b5e1cd58661de925ca3fdeb1c7",+ "scripts/engine/examples/y4_storytime.json": "4dd0e4bb80d5b23065acd0e14d962cd60863283a66e7e0d73ad58fbf1d8aed9b",+ "scripts/engine/examples/y5_kinetic_type.json": "2f706ad64c4205e796a5db31521b8539182ba5262ef0e443897cf0b1c788535f",+ "scripts/engine/index.html": "e286a195ce3bf96c439a99fba77412eddd3498f4f3a141f9313b5388d07d798d",+ "scripts/engine/lib/brush.js": "6e548a35b25ead20ac6e81042e8b841166d06f53cb0560326444fc125203ba64",+ "scripts/engine/lib/camera.js": "cfacc134a963015cc1354621503e5821e971d709b714e0534f518a37a06d8d5a",+ "scripts/engine/lib/chart.js": "93d3605cba7d7cf0bdda2c2dd8f9797734dd06c1f64fa18ef7a492f8755a8d27",+ "scripts/engine/lib/collage.js": "4dcd3d15f8895dc6e3d4f2e4d82766782a4e77876fb863ded9480320b8959d93",+ "scripts/engine/lib/diagram.js": "98b15ba5f883dd95eca2ff52ba1d768c10a5bea7862bd13aee6d84b875e2b8c5",+ "scripts/engine/lib/fonts.js": "8d5ac65f41bd6df79a0f913adf7f425d46c847cc5d8ed831eccdc80b1c29531d",+ "scripts/engine/lib/fonts/AlfaSlabOne-400.woff": "2f8b04d3eada32d7047255260a0e81ab74938fada1aad154f5653850a68aebe8",+ "scripts/engine/lib/fonts/Anton-400.woff": "791375bdbed00de4a3aad4811291220ead0e1405d6f8b5bdbf109798c8359ac5",+ "scripts/engine/lib/fonts/ArchivoBlack-400.woff": "c029965cfbc3cbb79431babf56d0fee6bc185f366c4fc2a0957817137d374c95",+ "scripts/engine/lib/fonts/Bangers-400.woff": "62f0a30b1d48cc21bb35b084ae5d17ad22135df5dc4c18f3f591fc5443eddf39",+ "scripts/engine/lib/fonts/Caveat-600.woff": "7a101c766f28866c5aa36ebbce5cfedcea2601f2439d3b16694b9c8eee75e9dc",+ "scripts/engine/lib/fonts/Cinzel-400.woff": "39c4e70ca598e2c0d78d355cd5fbe37017353a5de3008787a03e0d30a2d715ad",+ "scripts/engine/lib/fonts/Cinzel-700.woff": "1bb7ec5b84ee97a9eae36528d5bae3bfeddf035c19842fc1740ce44c09fac4ad",+ "scripts/engine/lib/fonts/CormorantGaramond-500.woff": "f25b87d41579955733df25af8319b168d704b5333d8ac53e991fac442e7a9844",+ "scripts/engine/lib/fonts/CormorantGaramond-500i.woff": "0ab1e72da6037d218386d9a6e148d7f5b0357e1965abf743aef30d641a5e2874",+ "scripts/engine/lib/fonts/CormorantGaramond-700.woff": "6417fd78440278f109d84cf00283fbf9b91b6d639fc5afd208a121ae7c636e61",+ "scripts/engine/lib/fonts/EBGaramond-400.woff": "61ea4fa656e4ec2c6103483625f0d6a2e1571c2be57015063b73f23392b3ff98",+ "scripts/engine/lib/fonts/EBGaramond-400i.woff": "413c5879fa73e5e168dcb59e8e692b24049756c5b961fcd8adee3db2e1624ef4",+ "scripts/engine/lib/fonts/EBGaramond-600.woff": "d0ecbbe1d933b68d32ef2629e9a46673ae5eff5ce9c04cd7f4c012504da33a11",+ "scripts/engine/lib/fonts/Exo2-800i.woff": "8296afc88a371a81345e07d852a06e45ae401d5793866fd9a7f351daf523740a",+ "scripts/engine/lib/fonts/GochiHand-400.woff": "152552ee5c95ec30b75edf3ba42f3406925462ea1a52d4c049d22f550f10167a",+ "scripts/engine/lib/fonts/IMFellEnglish-400.woff": "b915ee6c7034491df57eed8153ec2a5c3ee1ba55788a96737465d4c3239bd2a0",+ "scripts/engine/lib/fonts/IMFellEnglish-400i.woff": "7c6064b4e7ca80d131a01b9133ddaf11978d43bc954eb0d1c1dd1391371c56d6",+ "scripts/engine/lib/fonts/Inter-var.woff": "a54bc9f6ba847df43752bfb35f63aa1599ccc113b58c23bfa07c4dc88976647b",+ "scripts/engine/lib/fonts/JosefinSans-700.woff": "1e9f0aab2caa768ead521a88be3ea118d47c29a3ae052f9b5d0c2af0d6a8eb8d",+ "scripts/engine/lib/fonts/Kalam-700.woff": "53b9c2a4260ba9a1320d2a92c6dbd532fa509bdeda0897580611a9f16f1a2bda",+ "scripts/engine/lib/fonts/LICENSES.md": "00b5f86c4d5162e6fee6d600b527c052933eb2884a61a5fab0f89fa4d4656ecd",+ "scripts/engine/lib/fonts/LXGWWenKai-500.woff": "734bd187392579417ac83effe31d37b9de43c7b290bcb400800456511ed79e8f",+ "scripts/engine/lib/fonts/LibreBaskerville-400.woff": "e5134e031d30b4dcc76f3806701cafe92ff4ed5b8b6271d06d63ca3ee7af9bc4",+ "scripts/engine/lib/fonts/LibreBaskerville-700.woff": "57b9986d47ab6d7ea1964d5693c56b5e5e97c889e31ba9546815de365d356dab",+ "scripts/engine/lib/fonts/LilitaOne-400.woff": "8f4283865fad7cbb92e3b9e8ec6e48ab1225f7fb2eaa9c75741ff46d4f230456",+ "scripts/engine/lib/fonts/Marcellus-400.woff": "9893ac05a03ff1e80ecf97f73853bff1378edfdec633b6c3a67ae7c33d7018e7",+ "scripts/engine/lib/fonts/NotoSansSC-500.woff": "928d841b1ec663ebce82593568cbc19749fe652f88b8ec960723b7d87b551512",+ "scripts/engine/lib/fonts/NotoSansSC-700.woff": "dd0d39a9780eb995c499af0c20cca93b1dfdda865da70871a20890b3e406b968",+ "scripts/engine/lib/fonts/NotoSansSC-800.woff": "b57f9c645b1a4967a3c8914ed41f24d109394a8175e36af08f93e40803e84664",+ "scripts/engine/lib/fonts/NotoSansSC-900.woff": "d2d8a42438b18b65b6577434df4e41bb08c6b5051281757849af00ab743bb58f",+ "scripts/engine/lib/fonts/NotoSansSC-sub.woff": "f29be895b3e7002432e6d94756a163936e9586843864740b1fc172b1859e462d",+ "scripts/engine/lib/fonts/NotoSerifJP-600.woff": "dce02fcc08d8629226ef017472eef25b5bc152d1c32a742075fcda8f351f87d0",+ "scripts/engine/lib/fonts/NotoSerifSC-sub.woff": "be59f4f630f0fac191dbc6e8d6945da681e5613df7602b2cef8ca7049fa19b66",+ "scripts/engine/lib/fonts/OFL.txt": "67c5d5206b96f8340b95fabd02ae60701e0b20ce2594d976216f1065e5aa3822",+ "scripts/engine/lib/fonts/PlayfairDisplay-400i.woff": "30cbe57e84bc719727dc54814f708eb9fa2d05a06f04d8c196b1466ecacb74d8",+ "scripts/engine/lib/fonts/PlayfairDisplay-700.woff": "2644f0e3c7c8f79e9d0c56ad22d246294c7c2b21ea884a7a2b1a10261cb95469",+ "scripts/engine/lib/fonts/PlayfairDisplay-700i.woff": "f263323db61a414618d9cafe489d0e18adf6682cd36baa45239ed804fe26fcf1",+ "scripts/engine/lib/fonts/Poppins-600.woff": "952d2591178ef0c2dea37fb2c14f01e18433c8d59db10f6365c9e1ca9e8efe2a",+ "scripts/engine/lib/fonts/Poppins-700.woff": "282b1ac42689074c38c62378b1412544f5ab11b91ba145ce56c54802496b7d86",+ "scripts/engine/lib/fonts/Poppins-800.woff": "4c2bd05974d03c8058b14a452b2d0d869420b1671a22c35d52da4d58864e46a6",+ "scripts/engine/lib/fonts/PressStart2P-400.woff": "f831461d0239882019837f2b1cfea598743768f89c0b052102a1fd55050f5ca1",+ "scripts/engine/lib/fonts/Righteous-400.woff": "374317573c47429a8d87b5c862abc96572e90eef1a445439cc329d2768022121",+ "scripts/engine/lib/fonts/RobotoCondensed-var.woff": "d149ef1478076ad3f201676de2f58d11de18257590d9faeee2318fa3bc4b90e6",+ "scripts/engine/lib/fonts/Rye-400.woff": "2b6ae29cb40d75d69b547e7544f4ad540c5a641e7268df578a9bbc062376070e",+ "scripts/engine/lib/fonts/UnifrakturMaguntia-400.woff": "af995e1259780861fd6b8bb3dada5cb1272fc2fd24dbb2ba5b7cc4411ffde566",+ "scripts/engine/lib/fonts/cmunrm.woff": "32115abbbfb231586813333bfa5a234f4dc7f28b27df7260f42f81146ccd9097",+ "scripts/engine/lib/fonts/cmunti.woff": "d9a02b7b67874c62f47f9c9a0914c115972ab77d43e82a163baf0888eb5d4a2d",+ "scripts/engine/lib/fonts/index.json": "a0870057845b502a11037acef99b6e9cbc3994fdb5149caf3aac036140dbfbb1",+ "scripts/engine/lib/kit.js": "77821ce0ae8278c462b5669449bca473659c95317c3b62fc8b008e2bdf87209f",+ "scripts/engine/lib/motion.js": "7e70b8ef328c7497fe1403d37700fcdfbb2cc9d2175f16ea46ae3e69b49dbe15",+ "scripts/engine/lib/paint.js": "aa61a2cb14b0bbd96e072865fb8b24bdd118b4f62aca3ff2c320ca17593aca25",+ "scripts/engine/lib/post.js": "c57ba51a2242e9505a1b35dbb2645c1e3541465069c99de704c3fba9066914a3",+ "scripts/engine/lib/render.js": "5bcde2a2711759c934722d91a456f13eecb5cd6679f9b3b601df728e18c08432",+ "scripts/engine/lib/rig.js": "88c4df6dc105cafdc7249a5f31c79928db6c05b372f04e2e0f14059e8620f17f",+ "scripts/engine/lib/rig_huashu.js": "6419306bb314f89848b0adf842db0c305c2f6bc931df34388eb5389f29c1d392",+ "scripts/engine/lib/toon.js": "83a83f6562578646ea0430c25e4a83a98dad77f32d631c869a49bb34a4e0225e",+ "scripts/engine/lib/typo.js": "30db0cc68145dca22532e487da01aeb3ec97155e8b2c3a0747a009ce6638be8f",+ "scripts/engine/lib/ui.js": "2608da0a38bfd429a9fe41c1a93a5d080d54c5fcccea80e7fea764e6ca3a97bf",+ "scripts/engine/lib/util.js": "86045b05656183cd7017e43fb891aa65d1a1e76477885c4dbee81635ee8b7a1d",+ "scripts/engine/reference_films/spacex/README.md": "dd19ad3495bc4e6733290af13732a57adafb039ae6a799f3054bd17b520dc353",+ "scripts/engine/reference_films/spacex/eras_lin.js": "6605819d67486729d65a36c7cde3c7bd1b631bdf4384473180ac61e01a38c2cf",+ "scripts/engine/reference_films/spacex/eras_spacex.js": "0061954a4399c0b13896d7f482777ea2cc813ef7415c5a68c3ee56ae4a903c98",+ "scripts/engine/reference_films/spacex/eras_vox.js": "4099fdbba709a42848f2608b77fa8991b9cca43cbe98ef2bea4fe4a7acad2a84",+ "scripts/engine/reference_films/spacex/eras_wbx.js": "039cb40eba4483ceb853ece6d23068e72ede0f8cabff38aca1da17127661b4b4",+ "scripts/engine/reference_films/spacex/spacex/rockets.js": "c03146000da38e0999efcd06346956e84b72c0a5aaa2218b753f2558faf778ab",+ "scripts/engine/reference_films/spacex/spacex/scenes/s01.js": "237ce61de31f9de1bd59856eea4b1993c4cacef4965295d368f25078ad5dc560",+ "scripts/engine/reference_films/spacex/spacex/scenes/s02.js": "65c91538de70d4a7f15e80129a4af54a8ec37e6d8c01d67d5e74f52274e7e28d",+ "scripts/engine/reference_films/spacex/spacex/scenes/s03.js": "39004e9f201565a6940cd98ca4703bbb3b5b13629bb972357f6c63829891bdb5",+ "scripts/engine/reference_films/spacex/spacex/scenes/s04.js": "a59854fc3f5fcc5d97098cb77d266e28ff4dd8229d158576dba60a747465c64f",+ "scripts/engine/reference_films/spacex/spacex/scenes/s05.js": "33c4e30f049f7fdb3f495f500cc3cf8ffa32913b1268455cacd08364bfb10877",+ "scripts/engine/reference_films/spacex/spacex/scenes/s06.js": "7b751b39a2eb3bed6ea90119d713cebaebce149af1e2287386cef4072050a944",+ "scripts/engine/reference_films/spacex/spacex/scenes/s07.js": "42e8a3712d7211391e34b924a2e324db5a70cb28753535362992197ba59a5043",+ "scripts/engine/reference_films/spacex/spacex/scenes/s08.js": "23c788cc6367f1a5db8c59d2ee5a839a699fb84c4bfaf9c3b55768d6b78f0a19",+ "scripts/engine/reference_films/spacex/spacex/scenes/s09.js": "7a32c09799906726767e810f3a8ad441ba8fcf055d507a8327aaab28920d92ae",+ "scripts/engine/reference_films/spacex/spacex/scenes/s10.js": "98dada64b0641e5f284304743c9783261938e6466ab988fce52217f370cfcede",+ "scripts/engine/reference_films/spacex/spacex/scenes/s11.js": "a5611386f7703c3ecca95b90beddf8d14a746d58217a1719f0d3d2504ce43d2b",+ "scripts/engine/reference_films/spacex/spacex/scenes/s12.js": "87cb530f65504bfeac1b6c07a96821a28022d7298135a63b34149e582630161c",+ "scripts/engine/reference_films/spacex/spacex/timing.js": "00fa0e7dcaa4cd18c7f927ac457fbb8dcbb599dfec7e5dfbe9daf60732d4365b",+ "scripts/engine/reference_films/spacex/spacex/tm.js": "49d1198fcf58a4a44f48735c02ffc7443d6959c7938205bac513ddc24784bff9",+ "scripts/engine/reference_films/spacex/spacex_lin/common.js": "e0d25c4901c81e985cd591b130bb4b263fcae8da8b5ea8c61fbf46a541f11481",+ "scripts/engine/reference_films/spacex/spacex_lin/presenter_meta.js": "c4d839c0dcd1d370b8937c10c2f8cc48dd530d81e15c2b9513e624525e8a8a49",+ "scripts/engine/reference_films/spacex/spacex_lin/scenes/s01.js": "1d8db35fca961be9c2ae8861d32c5e10aa0312c54bfa817c415c572000c1424c",+ "scripts/engine/reference_films/spacex/spacex_lin/scenes/s02.js": "cb812430ad81e957b1efe1a0b990fc61e88f4e0138f34de6ce4ed79d6aede071",+ "scripts/engine/reference_films/spacex/spacex_lin/scenes/s03.js": "e305844e95fba4000a728bfd84225d78fcf3163c973409a49bb820356a31374a",+ "scripts/engine/reference_films/spacex/spacex_lin/scenes/s04.js": "8508c6d1df05bc8976249ef6538023a9d5b19e369c89cc612cc97bfb271c92a5",+ "scripts/engine/reference_films/spacex/spacex_lin/scenes/s05.js": "b7eb5e8949b557ed70fbf28d4f77850c513c172aacddfe1a75acf55fd66b8c11",+ "scripts/engine/reference_films/spacex/spacex_lin/scenes/s06.js": "7139a5b052c3c361cc750aeaffea972e43f4025481359d0d61ec6a38add8d243",+ "scripts/engine/reference_films/spacex/spacex_lin/scenes/s07.js": "67f7f39a056e7edab0e89bf0a9829081e4a1f2916221cb214ac153394ffccd2b",+ "scripts/engine/reference_films/spacex/spacex_lin/scenes/s08.js": "641497feea2324ab90bbde461851c5844bc6dd6b7d6febab8ebce60100be49b2",+ "scripts/engine/reference_films/spacex/spacex_lin/scenes/s09.js": "bfa575443084ca857ec14060262071d72480a99e022e121eb72d3a5fbb55e453",+ "scripts/engine/reference_films/spacex/spacex_lin/scenes/s10.js": "7b461f84ec85e1f08867462d5be134b9edc3a4df124753627d0d74d5d939aba2",+ "scripts/engine/reference_films/spacex/spacex_lin/scenes/s11.js": "19737e5d99a2c6cfaed9307daa8520745110fc2ac68bfdcb5b6665ee3e653838",+ "scripts/engine/reference_films/spacex/spacex_lin/scenes/s12.js": "917705ac8d9b1ab0aa8c27f74c42eb26f554934ee37389328f6bf72c75054332",+ "scripts/engine/reference_films/spacex/spacex_lin/tools/prep_presenter.py": "79bfe683a8311aa20b9a28e2e284eea7c0edfe7084128c3abf4584b6a73b46e4",+ "scripts/engine/reference_films/spacex/spacex_vox/common.js": "8a180bc158e658111c0dd76b13eca1f04f718773e016f4ac4fac2c88755cc280",+ "scripts/engine/reference_films/spacex/spacex_vox/scenes/s01.js": "db79f6015d65b62187607f8d182d0a592c5fa84759f00ab0dbdb0a1e6fd5ebc8",+ "scripts/engine/reference_films/spacex/spacex_vox/scenes/s02.js": "0f400ca0910c5a734aabcc7a5fb97e3b4ae0b6eb917e627203201f48d4c1b39e",+ "scripts/engine/reference_films/spacex/spacex_vox/scenes/s03.js": "ca6c23aa451bdbd8305c075d8815c1e3d902be766f2e565ce9c7afdbacfb4d58",+ "scripts/engine/reference_films/spacex/spacex_vox/scenes/s04.js": "528938e10fd97cb69e7028411a08bae21332ae9f5b07b56ecab0635f1f78c057",+ "scripts/engine/reference_films/spacex/spacex_vox/scenes/s05.js": "b171c07b5e742765ef9e21ef262264a4d7d9dcf3713c941f43b0c4dbf28b49cf",+ "scripts/engine/reference_films/spacex/spacex_vox/scenes/s06.js": "9968153847fb26f19c183df2ae0b1ceea12df4cc132208d99c9c32f897a1fe1d",+ "scripts/engine/reference_films/spacex/spacex_vox/scenes/s07.js": "a5ac50564fe721d114dcb70e64ef932ed373c9167c7f128b8e17f52069ddc9a7",+ "scripts/engine/reference_films/spacex/spacex_vox/scenes/s08.js": "9c12be241ac5bcfc95388d62832086cddff0b8e5cc5c7fdec75a76b959f361f2",+ "scripts/engine/reference_films/spacex/spacex_vox/scenes/s09.js": "95f64afaa6f632ea86a77c38c112e007b2560182d0acace06f7c37757bf80ff8",+ "scripts/engine/reference_films/spacex/spacex_vox/scenes/s10.js": "d186a59c8ccf38889c88baf25e3ac18efd54ac8f8b5e24f940fa2c6ab59f33bf",+ "scripts/engine/reference_films/spacex/spacex_vox/scenes/s11.js": "642d7dd53f3a48ec8596be983739cb7a1e8c679e5fbb3a9595ff802699155cf2",+ "scripts/engine/reference_films/spacex/spacex_vox/scenes/s12.js": "03804d0e8a0bbdfdddf7b36eab83c93ca7d5a0d7c464abfb3786080e74374b40",+ "scripts/engine/reference_films/spacex/spacex_wb/assets/ARPHICPL.TXT": "5590533436c70f10f2f524ee61456238c290175c6662fbe1c700b5f038a6d328",+ "scripts/engine/reference_films/spacex/spacex_wb/assets/hand_1.png": "19761f892b70430e24b8e4780c547c0b1547f584d72b840d5a23fb06bb93c0c7",+ "scripts/engine/reference_films/spacex/spacex_wb/assets/hand_2.png": "f404f8d1f597cc4d97e91123e7e57d47c4514278ebf2b897498ba9483e4215c7",+ "scripts/engine/reference_films/spacex/spacex_wb/assets/hand_3.png": "c16036d4a837b88cf977ff0a0910b08497eceef9c605eff80bfeab712e3ef10b",+ "scripts/engine/reference_films/spacex/spacex_wb/assets/make_hand.py": "5b5cedc474960ffeeff1cfab407e2a926f036a8beab0e43147327957dadf83cb",+ "scripts/engine/reference_films/spacex/spacex_wb/assets/strokes.js": "7fd46e149eedf2c1e42becaa19e3279192d2889ea223c8dcbb696653b351a17c",+ "scripts/engine/reference_films/spacex/spacex_wb/common.js": "d416da124e3a7219de49f2d4fe7f9c6a81b01ca47c5d2a0bb4cc0f8d997188bd",+ "scripts/engine/reference_films/spacex/spacex_wb/scenes/s01.js": "a9e1d970d0a4447ce375f8050cc7555c959d0c7be8cc3b0d26b864723973aac7",+ "scripts/engine/reference_films/spacex/spacex_wb/scenes/s02.js": "949855e8c87174757d3d3ffadd7ac8bfe8cb80663555c3c0eb21b1c451fe86dc",+ "scripts/engine/reference_films/spacex/spacex_wb/scenes/s03.js": "468e165e32d68ad46cbf3383b83b457341a200493388e6ebbfa25e202e560218",+ "scripts/engine/reference_films/spacex/spacex_wb/scenes/s04.js": "bba86920a73a29be003fe1ade0f59ffa1e21a2bcd8dd5ad524904c67ce87f961",+ "scripts/engine/reference_films/spacex/spacex_wb/scenes/s05.js": "057ac7bbd37ef79aafd43693def08f4225850ab094bab052557218118f430b59",+ "scripts/engine/reference_films/spacex/spacex_wb/scenes/s06.js": "82c7edb955f010899acf33409ca1745d7b2c43bb9c0f9920d78384e13eae50d5",+ "scripts/engine/reference_films/spacex/spacex_wb/scenes/s07.js": "6a1af8466ee815c8c6cbe28ba1baf35174feb5f42124dd9428c8dc7cab02dee9",+ "scripts/engine/reference_films/spacex/spacex_wb/scenes/s08.js": "0c997e30d3904d7fc1e641c8171e1cb698f70d4090ae53e5cfbe81cc7f021e66",+ "scripts/engine/reference_films/spacex/spacex_wb/scenes/s09.js": "e9a3b6fbbe19c2ffe3de94470e9d545e69822b19fa0de9d780f1dc314fee4c1b",+ "scripts/engine/reference_films/spacex/spacex_wb/scenes/s10.js": "9fecdbc75264cd94173710b6d8b0b743cc9108e0cb39c1a207fb725882c4b19c",+ "scripts/engine/reference_films/spacex/spacex_wb/scenes/s11.js": "080b86e5c76f091ba045d1a96ba875deb84639c0ef9a4e44aa42a58dfb0ab4e2",+ "scripts/engine/reference_films/spacex/spacex_wb/scenes/s12.js": "7b24f80e83e2aa209aa77b14bf82f13856bc240d2124af393f5a0e90e181974e",+ "scripts/engine/reference_films/spacex/transitions/cardFlip.js": "4044c78947d3e96afcd19c099fc3c3f06e54f6b2534fc842a570ce2d4286285b",+ "scripts/engine/reference_films/spacex/transitions/deskPullOut.js": "b8d7d3c7c6eca5585f4cb02193b23fe05b88c7615f8d494352c78018387eaa55",+ "scripts/engine/reference_films/spacex/transitions/kzBloom.js": "d16eeaa0aa5dad93df67af66d7116de260690294ab5d325938983643c97e2d2c",+ "scripts/engine/reference_films/spacex/transitions/lin_page.js": "76006697fcca8b11ddd905a104ae9fdd0f2dedd3beedc39eb495feaa50f6addc",+ "scripts/engine/reference_films/spacex/transitions/paperSlide.js": "14eb0b28a2e78a7feeaf158b81d3aef640f9776dd0bb578f21b7e6bfafe40e13",+ "scripts/engine/reference_films/spacex/transitions/vox_pull.js": "79db9ef00e31a4a44872ef57f9ce9a5a89ed631c1a83d9b7e72129e4a7355959",+ "scripts/engine/reference_films/spacex/transitions/vox_slap.js": "78f8fa308a434a33d7007b776c4e006d711fea61d4f4dab9426baeebc6c3d573",+ "scripts/engine/render.py": "eb2abd1a159a63a58fbf9da6bfc5e06febaeb31aec21ac091d351fc8159ed5dc",+ "scripts/engine/scenes/01_cave.js": "06ff3360279ecf778d78ef5e56fa6d5cd6354a18033079eed32cba6af48dd781",+ "scripts/engine/scenes/02_egypt.js": "ce4acdce7f65f41686f7e5f04336fdf150bfd53a560a20f2a83a3db495a86353",+ "scripts/engine/scenes/03_greek.js": "58e259062257ebf15d2fb141e10441119df0691e0cc2bd212922a8cffb3be184",+ "scripts/engine/scenes/04_roman.js": "a5678635c8199b61700785915de9308fcb20abbff34f98a143b50ef740faeaf8",+ "scripts/engine/scenes/05_gothic.js": "a5b24f49d1dc01cc5d5eebba9404f6c6ebd6d6de1a61ef6c2eae36c1f591b327",+ "scripts/engine/scenes/06_renaissance.js": "ab7dca1e5f6f5911a55cb132eeea405ab3d0001f2f6ceed01cc624bacbf9279e",+ "scripts/engine/scenes/08_impressionism.js": "6d5e4ee5f4329d7551ef84edc7f15d4396effd7b80e7091074c20920dabc7d24",+ "scripts/engine/scenes/09_postimp.js": "a1806dd4dfbfe32ed9a18e70174750c0e932a2a2beca832be8dc25708c76277e",+ "scripts/engine/scenes/10_nouveau.js": "4a390aa2d70b4a6afe0b35862e502ef78f42c36ff960f3ef49482be67320ca39",+ "scripts/engine/scenes/11_cubism.js": "dbdd5cba2eb07ecd75445c534d04b40d6206bbb252c28e31ecefeb08a83ee249",+ "scripts/engine/scenes/12_bauhaus.js": "647e3d52272eda0630150d04ed3f299da095c4e8e564e3fa7c84330c2993efad",+ "scripts/engine/scenes/13_pop.js": "80a893a23dc2d0a6350323b0b63a0cf4929e48908391f796422c402aa272935c",+ "scripts/engine/scenes/14_8bit.js": "3351f505bd0f272a623061a8f49993b877339c619dceb2f5e08c05933397b71e",+ "scripts/engine/scenes/15_raytrace.js": "b77169305a158c5161c6a4f30ed8f00adf0128cbfe837b0c4f37ebbc120213b4",+ "scripts/engine/scenes/16_2026.js": "915ab9a19ee937027ec1f449b8c3d358422df29d21986d237ac7c73169a5e710",+ "scripts/engine/scenes/17_ink.js": "0d3360a701f23f6b5978686645b80d4ce69c15bec2be09f017c14e4646f05760",+ "scripts/engine/scenes/18_klimt.js": "dc03848dc98d567f15561f6af4fb709050bac729e61269297c910fc312604244",+ "scripts/engine/scenes/19_munch.js": "b415408930826beea0cd512bc5d1002f70478314b3f0357e7f88a40c01bcf0c0",+ "scripts/engine/scenes/20_dunhuang.js": "33ec1c2c6a062feac415893ba232d227c715107746fd16653a573ad63c7f8780",+ "scripts/engine/scenes/21_kusama.js": "1ae771a76fd4b8c128a667f3c87227c243a43c0673d1bf68b1f7a3eba7d6e56d",+ "scripts/engine/scenes/22_constructivism.js": "79e64e9e664886b4c6e70094d161b48e8346be318ab9c84c4859beff98a83ab5",+ "scripts/engine/scenes/23_dali.js": "5ff7dd1631b654aa0adc2d7bd27e8efffcbbd4d6f330e6002c60eb89e747fdfa",+ "scripts/engine/scenes/24_hopper.js": "672605310edebdc93c35e819bd1a2e97dba874e64b025952d24e9b81809000ed",+ "scripts/engine/scenes/25_ghibli.js": "bd0f6b22b6c8cd1ff4e18f207587f4995bc2ea949196b9a85296030c7dc5efd8",+ "scripts/engine/scenes/26_vaporwave.js": "f34aa1cc5ceb0b7cf60ac03adcf804ea7e39c7641446b88db9fb89b179daf02e",+ "scripts/engine/scenes/27_kirby.js": "d82e039d7d4ba45ca01114f9330b1dcad3ddd516efa8bda7d190e85606487028",+ "scripts/engine/scenes/28_monet.js": "1ea1f0a1c77f7ea14c153b46a62daaf5fe84d3c02e73b5cb2a4a7838c7e14930",+ "scripts/engine/scenes/29_seurat.js": "a026713b9205c6a00c805dece5068722b15071f9bbb691203697c9cd0a33be23",+ "scripts/engine/scenes/30_matisse.js": "09d97003c451d9dbe723a942ea3146213943b75cac3a92ab1648e58279358aa8",+ "scripts/engine/scenes/31_haring.js": "5113c0318ed36db84acc7eac6855ec0f0a44511f6cedd3f326b78ba4e921f1ca",+ "scripts/engine/scenes/32_rembrandt.js": "47883474a7ed9aa7c5bfe39b953748da5003c601c3dcf48e3a2e6e18fd03bf4a",+ "scripts/engine/scenes/33_rubberhose.js": "08a1340dd35de98830b81abd7026be6e2361f325215793e55369f5cd1fb50ad8",+ "scripts/engine/scenes/34_shadowpuppet.js": "08186a1764be2bdc2c27806850dea2fd86761936aeba1299e8ece9bf31f381a8",+ "scripts/engine/scenes/35_shinkai.js": "8e7f5753a0ce49291ae35bc4f471b5ca62448eb9532403459395d88bc524a736",+ "scripts/engine/scenes/36_picasso_blue.js": "10023147e1e31afc162e1cfe51356867ef83595b41bbd5cc824d55532297ce09",+ "scripts/engine/scenes/index.js": "22da1210908a8083658eb53289656eeb578026b6deabc666928014d01ddae23e",+ "scripts/engine/transitions.js": "22dface64bccee924faf56a49bfa380c65c65258b462acd800fc59ca654e2c8d",+ "scripts/engine/时代作者规范.md": "0dbd47aeda3c8ebd28e51b92917afd7da7630a9f3fbcd443e29048e8b0902eeb",+ "scripts/font_subset.py": "ed826dffb4b370741602aa79caefd69157fcf6d7f9abd90a9078d4f7208896e0",+ "scripts/images.py": "a47a2663f251525bfbed5b46533e3d43415c9e10c8a2b8a9f754abf204529535",+ "scripts/key_green.py": "11ac28bb2508d6b4a240eb37a55b342a0f556943fe29a17962bbc0f93f90d303",+ "scripts/key_split.py": "889759cd6b5353b4d48d34faf3878682890e06ca79887c9ade9be401b7359f86",+ "scripts/koubo.py": "7837507e6bf02b20f8aa63efdc881c8de0d5de775b4bf31a1040bd3824348494",+ "scripts/qa.py": "435fa30c91b432b0fd25a72e139c7a883b619c251a3545c9b460de192fcc3942",+ "scripts/subzone_gate.py": "8641a3b1b38ac28c1562e454a0e370f36a73d1a0c79cddf36175c7444a9c1598",+ "tests/test_capabilities.py": "04ce548d5a72a11a87a3bd85c46a98e13f1aabafb096e3c59a6fc7a20bfdf4ad",+ "tests/test_images.py": "5fe7533ec25a2644e3685e1677186eaf1554ebbbcc390fcd56a45afbad872040",+ "tests/test_release.py": "a190d8825e23f6204263f3d00d6728bf709586bc178c980d53244a82ef198b41"+ }+}diff --git a/schemas/media.schema.json b/schemas/media.schema.jsonnew file mode 100644index 0000000..7b88da3--- /dev/null+++ b/schemas/media.schema.json@@ -0,0 +1,220 @@+{+ "type": "object",+ "properties": {+ "schema_version": {+ "type": "integer",+ "enum": [+ 1+ ]+ },+ "revision": {+ "type": "integer",+ "minimum": 0+ },+ "preferences": {+ "type": "object",+ "properties": {+ "voice": {+ "type": "object",+ "properties": {+ "mode": {+ "type": "string",+ "enum": [+ "unconfigured",+ "off",+ "provided",+ "system",+ "clone"+ ]+ },+ "provider": {+ "type": "string",+ "enum": [+ "volcengine"+ ]+ },+ "voice_ref": {+ "type": "string"+ },+ "system_voice": {+ "type": "string"+ }+ },+ "additionalProperties": false+ },+ "image": {+ "type": "object",+ "additionalProperties": false,+ "properties": {+ "mode": {+ "type": "string",+ "enum": [+ "unconfigured",+ "off",+ "existing",+ "generate"+ ]+ },+ "provider": {+ "type": "string"+ }+ }+ }+ },+ "additionalProperties": false+ },+ "policy": {+ "type": "object",+ "properties": {+ "cloud": {+ "type": "string",+ "enum": [+ "ask",+ "allow",+ "deny"+ ]+ },+ "paid_api": {+ "type": "string",+ "enum": [+ "ask",+ "allow",+ "deny"+ ]+ },+ "voice_training": {+ "type": "string",+ "enum": [+ "ask",+ "allow",+ "deny"+ ]+ },+ "image_generation": {+ "type": "string",+ "enum": [+ "ask",+ "allow",+ "deny"+ ]+ },+ "reference_upload": {+ "type": "string",+ "enum": [+ "ask",+ "allow",+ "deny"+ ]+ },+ "unknown_image_cost": {+ "type": "string",+ "enum": [+ "ask",+ "allow",+ "deny"+ ]+ }+ },+ "additionalProperties": false+ },+ "onboarding": {+ "type": "object",+ "properties": {+ "voice": {+ "type": "string",+ "enum": [+ "ask",+ "manual"+ ]+ },+ "image": {+ "type": "string",+ "enum": [+ "ask",+ "manual"+ ]+ }+ },+ "additionalProperties": false+ },+ "bindings": {+ "type": "object",+ "properties": {+ "volcengine": {+ "type": "object",+ "properties": {+ "appid_env": {+ "type": "string",+ "pattern": "[A-Za-z_][A-Za-z0-9_]*"+ },+ "token_env": {+ "type": "string",+ "pattern": "[A-Za-z_][A-Za-z0-9_]*"+ },+ "env_file": {+ "type": "string"+ },+ "registry_file": {+ "type": "string"+ },+ "trust_env": {+ "type": "boolean"+ }+ },+ "additionalProperties": false+ },+ "voices": {+ "type": "object",+ "properties": {},+ "additionalProperties": {+ "type": "object",+ "properties": {+ "speaker_id": {+ "type": "string",+ "pattern": "S_[A-Za-z0-9_-]+"+ },+ "registry_file": {+ "type": "string"+ },+ "entry": {+ "type": "string"+ }+ },+ "additionalProperties": false+ }+ }+ },+ "additionalProperties": false+ },+ "provider_options": {+ "type": "object",+ "properties": {+ "volcengine": {+ "type": "object",+ "properties": {+ "model": {+ "type": "string",+ "enum": [+ "seed-tts-2.0-expressive",+ "seed-tts-2.0-standard"+ ]+ },+ "speech_rate": {+ "type": "integer",+ "minimum": -50,+ "maximum": 100+ },+ "tone_fidelity": {+ "type": "boolean"+ }+ },+ "additionalProperties": false+ }+ },+ "additionalProperties": false+ }+ },+ "additionalProperties": false,+ "$schema": "https://json-schema.org/draft/2020-12/schema",+ "title": "Huashu media configuration"+}diff --git a/scripts/capabilities.py b/scripts/capabilities.pynew file mode 100644index 0000000..67ac042--- /dev/null+++ b/scripts/capabilities.py@@ -0,0 +1,446 @@+#!/usr/bin/env python3+"""可选语音配置。status/resolve不联网;个人配置位于skill安装目录外。"""+import argparse+from contextlib import contextmanager+import copy+import hashlib+import json+import os+from pathlib import Path+import platform+import re+import shutil+import subprocess+import sys+import tempfile+import time++ROOT = Path(__file__).resolve().parents[1]+if __name__ == "__main__":+ sys.modules.setdefault("capabilities", sys.modules[__name__])+++class ConfigError(ValueError):+ pass+++def config_path(explicit=None):+ if explicit:+ return Path(explicit).expanduser().resolve()+ if os.getenv('HUASHU_CONFIG_HOME'):+ return Path(os.environ['HUASHU_CONFIG_HOME']).expanduser() / 'media.json'+ if os.name == 'nt':+ return Path(os.environ.get('APPDATA', Path.home() / 'AppData/Roaming')) / 'huashu/media.json'+ return Path(os.environ.get('XDG_CONFIG_HOME', Path.home() / '.config')) / 'huashu/media.json'+++def read_json(path, missing=False):+ if missing and not path.exists():+ return {}+ try:+ data = json.loads(path.read_text(encoding='utf-8'))+ except (OSError, ValueError) as e:+ raise ConfigError(f'无法读取配置:{path.name}({type(e).__name__})') from None+ if not isinstance(data, dict):+ raise ConfigError('配置必须是JSON对象')+ return data+++def merge(base, patch):+ result = copy.deepcopy(base)+ for key, value in patch.items():+ result[key] = merge(result[key], value) if isinstance(value, dict) and isinstance(result.get(key), dict) else copy.deepcopy(value)+ return result+++def validate(data, schema=None, where='config'):+ # 本包schema只使用以下JSON Schema关键字;不声称实现通用schema解释器。+ schema = schema or read_json(ROOT / 'schemas/media.schema.json')+ types = {'object': dict, 'string': str, 'integer': int, 'boolean': bool}+ typ = schema.get('type')+ if typ and (not isinstance(data, types[typ]) or (typ == 'integer' and isinstance(data, bool))):+ raise ConfigError(f'{where}类型错误')+ if 'enum' in schema and data not in schema['enum']:+ raise ConfigError(f'{where}不是支持的选项')+ if isinstance(data, int) and not isinstance(data, bool):+ if data < schema.get('minimum', data) or data > schema.get('maximum', data):+ raise ConfigError(f'{where}超出范围')+ if isinstance(data, str) and 'pattern' in schema and not re.fullmatch(schema['pattern'], data):+ raise ConfigError(f'{where}格式不正确')+ if isinstance(data, dict):+ for key in schema.get('required', []):+ if key not in data:+ raise ConfigError(f'{where}.{key}缺失')+ for key, value in data.items():+ child = schema.get('properties', {}).get(key, schema.get('additionalProperties', False))+ if child is False:+ raise ConfigError(f'{where}.{key}是不支持的字段')+ if isinstance(child, dict):+ validate(value, child, f'{where}.{key}')+++def project_patch(data):+ validate(data)+ if set(data) - {'schema_version', 'revision', 'preferences', 'policy', 'onboarding'}:+ raise ConfigError('项目配置不能设置凭证绑定、网络策略或供应商底层参数')+ if any(v != 'deny' for v in data.get('policy', {}).values()):+ raise ConfigError('项目policy只能收紧为deny,不能授予云调用、付费或训练权限')+ if 'voice_ref' in data.get('preferences', {}).get('voice', {}):+ raise ConfigError('私人音色绑定保留在用户配置;本次可用--voice选择')+ return data+++def effective(explicit=None, project=None):+ defaults = read_json(ROOT / 'defaults/media.json')+ user_path = config_path(explicit)+ user = read_json(user_path, missing=True)+ validate(user)+ result = merge(defaults, user)+ sources = {'defaults': 'defaults/media.json', 'user': str(user_path), 'user_configured': bool(user)}+ origin = {}+ def note(data, label, prefix=''):+ for key, value in data.items():+ name = prefix + key+ if isinstance(value, dict): note(value, label, name + '.')+ elif name.split('.')[0] in ('preferences', 'policy', 'provider_options', 'onboarding'): origin[name] = label+ note(defaults, 'public_default'); note(user, 'user')+ if project:+ pp = Path(project).expanduser().resolve() / '.huashu/media.json'+ patch = project_patch(read_json(pp, missing=True))+ result = merge(result, patch)+ note(patch, 'project')+ sources['project'] = str(pp)+ sources['project_fields'] = sorted(patch)+ validate(result)+ sources['effective_from'] = origin+ return result, sources+++@contextmanager+def locked(path):+ path.parent.mkdir(parents=True, exist_ok=True)+ lock_path = path.with_name(path.name + '.lock')+ # 内核文件锁在进程退出后释放;不通过删除锁文件争抢所有权。+ with lock_path.open('a+b') as lock:+ if os.name == 'nt':+ import msvcrt+ if lock.seek(0, 2) == 0:+ lock.write(b'0'); lock.flush()+ lock.seek(0)+ msvcrt.locking(lock.fileno(), msvcrt.LK_LOCK, 1)+ try:+ yield+ finally:+ lock.seek(0); msvcrt.locking(lock.fileno(), msvcrt.LK_UNLCK, 1)+ else:+ import fcntl+ fcntl.flock(lock, fcntl.LOCK_EX)+ try:+ yield+ finally:+ fcntl.flock(lock, fcntl.LOCK_UN)+++def save_patch(path, patch, expected=None, reset=None):+ validate(patch)+ with locked(path):+ old = read_json(path, missing=True)+ validate(old)+ revision = old.get('revision', 0)+ if expected is not None and revision != expected:+ raise ConfigError('配置已被其他进程修改;请重读后重试')+ updated = merge(old, patch)+ if reset:+ # 只允许重置公开字段;不执行动态路径表达式。+ keys = reset.split('.')+ if keys[0] not in {'preferences', 'policy', 'bindings', 'provider_options', 'onboarding'}:+ raise ConfigError('不支持这个reset路径')+ current = updated+ for key in keys[:-1]:+ current = current.get(key, {})+ if isinstance(current, dict):+ current.pop(keys[-1], None)+ updated.update(schema_version=1, revision=revision + 1)+ validate(updated)+ fd, temp = tempfile.mkstemp(dir=path.parent, prefix='.media-')+ try:+ with os.fdopen(fd, 'w', encoding='utf-8') as f:+ json.dump(updated, f, ensure_ascii=False, indent=2); f.write('\n')+ if os.name != 'nt':+ os.chmod(temp, 0o600)+ os.replace(temp, path)+ finally:+ if os.path.exists(temp):+ os.unlink(temp)+ return {'status': 'saved', 'revision': updated['revision'], 'path': str(path)}+++def credentials(config):+ binding = config['bindings']['volcengine']+ names = (binding['appid_env'], binding['token_env'])+ values = {n: os.getenv(n) for n in names}+ env_path = os.getenv('KOUBO_ENV') or binding.get('env_file')+ if env_path and not all(values.values()):+ path = Path(env_path).expanduser()+ if path.is_file():+ for line in path.read_text(encoding='utf-8').splitlines():+ line = line.strip()+ if line.startswith('export '):+ line = line[7:]+ key, sep, value = line.partition('=')+ if sep and key.strip() in names and not values[key.strip()]:+ values[key.strip()] = value.strip().strip('\"\'')+ return tuple(values[n] for n in names)+++def speaker(config, explicit=None):+ ref = explicit or config['preferences']['voice'].get('voice_ref', 'default')+ voice = config['bindings']['voices'].get(ref)+ if voice and voice.get('speaker_id'):+ return voice['speaker_id']+ if explicit and not voice:+ # 兼容旧命令的注册表别名或平台ID。+ voice = {'entry': explicit}+ voice = voice or {'entry': 'default'}+ registry_path = Path(voice.get('registry_file') or config['bindings']['volcengine']['registry_file']).expanduser()+ registry = read_json(registry_path, missing=True)+ entry = voice.get('entry', 'default')+ if entry == 'default':+ entry = registry.get('default') or os.getenv('VOLC_KOUBO_DEFAULT_SPEAKER')+ found = registry.get('voices', {}).get(entry, {})+ return found.get('speaker_id') or (entry if isinstance(entry, str) and entry.startswith('S_') else None)+++def resolve(config, mode=None, audio=None, operation='synthesize', grants=(), voice=None):+ chosen = mode or config['preferences']['voice']['mode']+ if audio and mode is None:+ chosen = 'provided'+ result = {'capability': 'voice', 'mode': chosen, 'operation': operation, 'status': 'ready', 'reasons': []}+ if chosen == 'off':+ return dict(result, status='skipped', reasons=['语音已禁用,不生成音频'])+ if chosen == 'unconfigured':+ return dict(result, status='needs_configuration', prompt=config['onboarding']['voice'] != 'manual',+ reasons=['选择现有录音、系统声音或已绑定的复刻音色;也可本次跳过'])+ if chosen == 'provided':+ if not audio or not Path(audio).expanduser().is_file():+ return dict(result, status='needs_input', reasons=['需要提供已有音频路径'])+ return result+ if chosen == 'system':+ missing = [x for x in ('say', 'ffmpeg', 'ffprobe') if not shutil.which(x)]+ if platform.system() != 'Darwin' or missing:+ return dict(result, status='unavailable', reasons=['系统声音目前仅支持macOS,需已安装say/ffmpeg/ffprobe'])+ return dict(result, provider='macos')+ if chosen != 'clone':+ raise ConfigError('不支持的声音方式')+ result['provider'] = 'volcengine'+ if config['preferences']['voice'].get('provider', 'volcengine') != 'volcengine':+ return dict(result, status='unavailable', reasons=['P1复刻后端仅支持volcengine'])+ needs = ['cloud'] + ([] if operation == 'check' else ['paid_api'])+ if operation == 'train':+ needs.append('voice_training')+ denied = [key for key in needs if config['policy'][key] == 'deny']+ if denied:+ return dict(result, status='blocked', reasons=['显式禁止:' + ', '.join(denied)])+ pending = [key for key in needs if config['policy'][key] != 'allow' and key not in grants]+ if pending:+ return dict(result, status='needs_permission', reasons=['需要本次授权:' + ', '.join(pending)])+ appid, token = credentials(config)+ if not appid or not token:+ result['reasons'].append('缺少所选供应商凭证;仅检查已指定环境/凭证文件')+ if operation == 'synthesize' and not speaker(config, voice):+ result['reasons'].append('没有可用音色绑定;可绑定已有ID,无须重训')+ missing = [x for x in ('ffmpeg', 'ffprobe') if not shutil.which(x)]+ if missing:+ result['reasons'].append('缺少本地依赖:' + ', '.join(missing))+ import importlib.util+ if importlib.util.find_spec('requests') is None:+ result['reasons'].append('火山适配器需要requests;基础配置与已有音频不需要')+ result['status'] = 'unavailable' if result['reasons'] else 'configured_unverified'+ return result+++def inspect_audio(path):+ if not shutil.which('ffprobe'):+ raise ConfigError('音频验收需要ffprobe')+ proc = subprocess.run(['ffprobe', '-v', 'error', '-show_entries',+ 'stream=codec_type,codec_name,sample_rate,channels:format=duration', '-of', 'json', str(path)],+ capture_output=True, text=True)+ if proc.returncode:+ raise ConfigError('输出不是可解码音频')+ data = json.loads(proc.stdout)+ streams = [s for s in data.get('streams', []) if s.get('codec_type') == 'audio']+ duration = float(data.get('format', {}).get('duration', 0))+ if not streams or duration <= 0:+ raise ConfigError('输出没有有效音轨或时长')+ return {'duration': duration, **streams[0], 'sha256': hashlib.sha256(Path(path).read_bytes()).hexdigest()}+++def system_voice_for(text, configured=None):+ if configured:+ return configured+ # macOS默认英文音色可能对中文返回近空音频;只从已安装音色选,不下载。+ if re.search(r"[\u4e00-\u9fff]", text):+ result = subprocess.run(['say', '-v', '?'], capture_output=True, text=True, check=True)+ names = [m.group(1).strip() for line in result.stdout.splitlines()+ if (m := re.match(r"(.+?)\s+zh_CN\s+#", line))]+ if not names:+ raise ConfigError('没有已安装的普通话系统声音;请选择已有音色或导入录音')+ return 'Tingting' if 'Tingting' in names else names[0]+ return None+++def run_say(args, config):+ grants = [name for name in ('cloud', 'paid_api') if getattr(args, 'allow_' + name, False)]+ result = resolve(config, mode=args.mode, grants=grants, voice=args.voice)+ if result['status'] not in ('ready', 'configured_unverified'):+ print(json.dumps(result, ensure_ascii=False)); raise SystemExit(2)+ if not args.text.strip():+ raise ConfigError('合成文本不能为空')+ out = Path(args.out).expanduser()+ if out.exists():+ raise ConfigError('输出文件已存在,请指定新文件;保留已选音轨')+ if args.speech_rate is not None and not -50 <= args.speech_rate <= 100:+ raise ConfigError('火山语速须在-50~100之间')+ if args.fit is not None and args.fit <= 0:+ raise ConfigError('--fit必须为正数')+ if args.match and not Path(args.match).is_file():+ raise ConfigError('找不到响度参考音频')+ requested_format = args.format+ out.parent.mkdir(parents=True, exist_ok=True)+ import koubo+ # 临时工作区防止失败或半段响应污染最终产物。+ with tempfile.TemporaryDirectory(prefix='voice-', dir=out.parent) as temp:+ staged = Path(temp) / (out.name + '.wav' if requested_format == 'pcm' else out.name)+ if result['mode'] == 'system':+ if args.model or args.speech_rate is not None or args.no_fidelity:+ raise ConfigError('火山模型/语速参数不适用于系统声音')+ if args.format != 'wav' or args.sample_rate != 48000:+ raise ConfigError('P1系统声音输出固定为48kHz WAV')+ source = Path(temp) / 'system.aiff'+ cmd = ['say', '-o', str(source)]+ system_voice = system_voice_for(args.text, args.voice or config['preferences']['voice'].get('system_voice'))+ if system_voice:+ cmd += ['-v', system_voice]+ subprocess.run(cmd, input=args.text, text=True, check=True, capture_output=True)+ subprocess.run(['ffmpeg', '-v', 'error', '-y', '-i', str(source), '-ar', '48000', str(staged)], check=True)+ if args.fit:+ koubo.fit_duration(staged, args.fit)+ target_db = koubo.mean_volume(args.match, args.match_ss, args.match_t) if args.match else args.loudness+ if target_db is not None:+ koubo.match_loudness(staged, target_db)+ else:+ koubo.configure_backend(config)+ args = copy.copy(args)+ args.out = str(staged)+ # 先用容器音频完成拟合/电平/终止状态验收,再导出裸PCM。+ if requested_format == 'pcm': args.format = 'wav'+ args.voice = speaker(config, args.voice)+ opts = config['provider_options']['volcengine']+ args.model = args.model or opts['model']+ args.speech_rate = opts['speech_rate'] if args.speech_rate is None else args.speech_rate+ args.no_fidelity = not opts['tone_fidelity'] if args.no_fidelity is None else args.no_fidelity+ koubo.cmd_say(args)+ artifact = inspect_audio(staged)+ volume = koubo.mean_volume(staged)+ if artifact['duration'] < 0.12 or volume is None or volume < -60:+ raise ConfigError('合成音频近空或无有效声音,不作为成功产物')+ if args.fit and abs(artifact['duration'] - args.fit) > .05:+ # 保留诊断候选,但不把它当成合格的最终输出。+ candidate = out.with_name(out.stem + '.unfitted' + out.suffix)+ if not candidate.exists():+ shutil.copy2(staged, candidate)+ raise ConfigError('音频未落入目标时长±0.05秒,已保留unfitted候选;未交付为最终音频')+ if requested_format == 'pcm':+ raw = Path(temp) / 'output.pcm'+ subprocess.run(['ffmpeg', '-v', 'error', '-y', '-i', str(staged), '-ac', '1', '-ar', str(args.sample_rate), '-f', 's16le', str(raw)], check=True)+ shutil.copy2(raw, out)+ artifact.update(format='s16le', channels=1, duration=out.stat().st_size / 2 / args.sample_rate, sha256=hashlib.sha256(out.read_bytes()).hexdigest())+ else:+ shutil.copy2(staged, out)+ artifact.update(path=out.name, provider=result['provider'], mode=result['mode'], generated=True)+ if result['mode'] == 'system':+ artifact['system_voice'] = system_voice or 'system_default'+ if result['mode'] == 'clone':+ artifact['requested_model'] = args.model+ out.with_name(out.name + '.json').write_text(json.dumps(artifact, ensure_ascii=False, indent=2), encoding='utf-8')+ print(json.dumps({'status': 'complete', 'output': str(out), 'duration': artifact['duration']}, ensure_ascii=False))+++def main():+ if len(sys.argv) > 1 and sys.argv[1] in ('image-status', 'image-plan', 'accept-image', 'use-image'):+ import images+ return images.main()+ # 生成/训练命令共用原CLI,避免两套参数漂移。+ if len(sys.argv) > 1 and sys.argv[1] in ('say', 'train', 'voices'):+ import koubo+ return koubo.main()+ parser = argparse.ArgumentParser(description=__doc__)+ sub = parser.add_subparsers(dest='command', required=True)+ for name in ('status', 'resolve', 'configure', 'skip', 'reset', 'bind', 'use-audio'):+ p = sub.add_parser(name)+ p.add_argument('--config')+ p.add_argument('--project')+ if name in ('status', 'resolve'):+ p.add_argument('--mode', choices=['off', 'provided', 'system', 'clone'])+ p.add_argument('--audio'); p.add_argument('--explain', action='store_true')+ if name == 'configure':+ p.add_argument('--input', required=True); p.add_argument('--scope', choices=['user', 'project'], default='user')+ p.add_argument('--expected-revision', type=int)+ if name == 'skip':+ p.add_argument('--capability', choices=['voice', 'image'], default='voice')+ p.add_argument('--scope', choices=['task', 'user'], default='task')+ if name == 'reset':+ p.add_argument('--field', default='preferences.voice')+ if name == 'bind':+ p.add_argument('--name', required=True); p.add_argument('--speaker-id', required=True)+ p.add_argument('--default', action='store_true')+ if name == 'use-audio':+ p.add_argument('--audio', required=True); p.add_argument('--out', required=True)+ args = parser.parse_args()+ config, sources = effective(args.config, args.project)+ path = config_path(args.config)+ if args.command in ('status', 'resolve'):+ result = resolve(config, args.mode, args.audio)+ result['revision'] = config.get('revision', 0)+ result['parameters'] = config['provider_options']['volcengine'] if result.get('provider') == 'volcengine' else {}+ if args.explain:+ result['sources'] = sources+ print(json.dumps(result, ensure_ascii=False, indent=2))+ elif args.command == 'configure':+ patch = read_json(Path(args.input))+ if args.scope == 'project':+ if not args.project:+ raise ConfigError('project作用域需要--project')+ path = Path(args.project).expanduser().resolve() / '.huashu/media.json'+ project_patch(patch)+ print(json.dumps(save_patch(path, patch, args.expected_revision), ensure_ascii=False))+ elif args.command == 'skip':+ if args.scope == 'user':+ print(json.dumps(save_patch(path, {'onboarding': {args.capability: 'manual'}, 'preferences': {args.capability: {'mode': 'unconfigured'}}}), ensure_ascii=False))+ else:+ print(json.dumps({'status': 'skipped', 'scope': 'task', 'saved': False}, ensure_ascii=False))+ elif args.command == 'reset':+ print(json.dumps(save_patch(path, {}, reset=args.field), ensure_ascii=False))+ elif args.command == 'bind':+ patch = {'bindings': {'voices': {args.name: {'speaker_id': args.speaker_id}}}}+ if args.default:+ patch['preferences'] = {'voice': {'voice_ref': args.name}}+ print(json.dumps(save_patch(path, patch), ensure_ascii=False))+ elif args.command == 'use-audio':+ source, out = Path(args.audio).expanduser(), Path(args.out).expanduser()+ info = inspect_audio(source)+ if out.exists():+ raise ConfigError('输出已存在,请指定新文件')+ out.parent.mkdir(parents=True, exist_ok=True); shutil.copy2(source, out)+ info.update(path=out.name, generated=False, mode='provided')+ out.with_name(out.name + '.json').write_text(json.dumps(info, ensure_ascii=False, indent=2))+ print(json.dumps({'status': 'complete', 'output': str(out), 'generated': False}, ensure_ascii=False))+++if __name__ == '__main__':+ try:+ main()+ except (ConfigError, OSError, subprocess.SubprocessError) as e:+ message = str(e) if isinstance(e, ConfigError) else type(e).__name__+ print(json.dumps({'status': 'error', 'message': message}, ensure_ascii=False), file=sys.stderr)+ raise SystemExit(2)diff --git a/scripts/check_release.py b/scripts/check_release.pynew file mode 100644index 0000000..a44e47e--- /dev/null+++ b/scripts/check_release.py@@ -0,0 +1,111 @@+#!/usr/bin/env python3+"""增量发布检查:扫描Git实际待发对象,核最终文件清单;不推送。"""+import argparse+import hashlib+import json+from pathlib import Path+import re+import subprocess+import sys++MANIFEST='release-manifest.json'+SECRET=re.compile(rb'/Users/[A-Za-z0-9_.-]+/|/home/[A-Za-z0-9_.-]+/|-----BEGIN (?:RSA |EC |OPENSSH )?PRIVATE KEY-----|github_pat_[A-Za-z0-9_]{30,}|ghp_[A-Za-z0-9]{30,}|sk-(?:proj-|ant-)?[A-Za-z0-9_-]{24,}')+++def git(repo,*args):+ return subprocess.check_output(['git','--no-replace-objects','-C',str(repo),*args])+++def tree(repo,ref):+ files={}+ command=['ls-files','--stage','-z'] if ref=='INDEX' else ['ls-tree','-r','-z',ref]+ for row in git(repo,*command).split(b'\0'):+ if not row:continue+ meta,name=row.split(b'\t',1);parts=meta.decode().split();name=name.decode()+ mode,oid=parts[0],parts[1] if ref=='INDEX' else parts[2]+ if SECRET.search(name.encode()):raise ValueError('文件路径名含敏感形态,标识:'+hashlib.sha256(name.encode()).hexdigest()[:12])+ if mode not in ('100644','100755'):raise ValueError('不发布软链、子模块或冲突文件:'+name)+ if ref=='INDEX' and parts[2]!='0':raise ValueError('索引存在合并冲突')+ files[name]={'mode':mode,'oid':oid}+ return files+++def forbidden(name):+ p=Path(name)+ if any(x in p.parts for x in ('_private','_archive','.huashu','__pycache__','node_modules','.venv')):return True+ if p.name in ('voices.json','media.local.json'):return True+ if p.name.startswith('.env') and p.name!='.env.example':return True+ if p.name=='media.json' and name!='defaults/media.json':return True+ return p.suffix in ('.pem','.key','.p12','.pfx','.wav','.mov','.mp4','.pyc','.log')+++def inspect(repo,ref):+ hashes={}+ for name,entry in tree(repo,ref).items():+ if SECRET.search(name.encode()):raise ValueError('文件路径名含敏感形态,标识:'+hashlib.sha256(name.encode()).hexdigest()[:12])+ if forbidden(name):raise ValueError('包含私人配置或过程产物:'+name)+ data=git(repo,'cat-file','blob',entry['oid'])+ if SECRET.search(data):raise ValueError('发现私人路径或凭据形态:'+name)+ if name!=MANIFEST:hashes[name]=hashlib.sha256(data).hexdigest()+ return hashes+++def build_manifest(repo):+ if git(repo,'diff','--name-only').strip():raise ValueError('有未暂存修改,先审查并暂存再生成清单')+ return {'schema_version':1,'files':inspect(repo,'INDEX')}+++def check(repo,ref,base=None,email=None):+ if git(repo,'rev-parse','--is-shallow-repository').strip()==b'true':+ raise ValueError('浅克隆无法证明完整待发历史,请先获取完整历史')+ graft=Path(git(repo,'rev-parse','--git-path','info/grafts').decode().strip())+ if not graft.is_absolute():graft=repo/graft+ if graft.exists() and graft.stat().st_size:+ raise ValueError('存在grafts历史改写,不能作为发布依据')+ if ref!='INDEX' and git(repo,'cat-file','-t',ref).strip()!=b'commit':+ raise ValueError('此门禁仅处理commit引用;标签对象需单独审查')+ expected=inspect(repo,ref)+ spec=':'+MANIFEST if ref=='INDEX' else ref+':'+MANIFEST+ try:manifest=json.loads(git(repo,'show',spec))+ except (ValueError,subprocess.CalledProcessError):raise ValueError('缺少有效发布清单') from None+ if manifest!={'schema_version':1,'files':expected}:raise ValueError('已审清单与Git文件树不一致,需重新生成并复核')+ commits=[]+ if ref!='INDEX':+ revision=base+'..'+ref if base and set(base)!={'0'} else ref+ commits=git(repo,'rev-list',revision).decode().splitlines()+ # 每个待发提交都扫描,防止先提交秘密再删除后仅检查HEAD。+ for commit in commits:+ raw=git(repo,'cat-file','commit',commit)+ if SECRET.search(raw):raise ValueError('提交元数据/说明含私人路径或凭据形态:'+commit[:12])+ inspect(repo,commit)+ if email:+ identities=git(repo,'show','-s','--format=%ae%n%ce',commit).decode().splitlines()+ if any(x!=email for x in identities):raise ValueError('待发提交邮箱不符合配置:'+commit[:12])+ return {'status':'passed','ref':ref,'files':len(expected),'outgoing_commits_checked':len(commits)}+++def main():+ p=argparse.ArgumentParser(description=__doc__);p.add_argument('command',choices=['manifest','check'])+ p.add_argument('--repo',type=Path,required=True);p.add_argument('--ref',default='HEAD');p.add_argument('--base');p.add_argument('--author-email');p.add_argument('--pre-push',action='store_true')+ a=p.parse_args();repo=a.repo.resolve()+ if not (repo/'.git').exists():raise ValueError('必须明确指定Git仓库根,不能隐式扫描父仓库')+ if a.command=='manifest':+ (repo/MANIFEST).write_text(json.dumps(build_manifest(repo),ensure_ascii=False,indent=2)+'\n')+ print('已生成发布清单;审查后将它暂存,再运行check --ref INDEX。')+ return+ if a.pre_push:+ if git(repo,'status','--porcelain','--untracked-files=all').strip():raise ValueError('推送前工作区必须干净')+ lines=sys.stdin.read().splitlines()+ if not lines:raise ValueError('pre-push缺少真实待推送引用')+ for line in lines:+ local_ref,local_sha,remote_ref,remote_sha=line.split()+ if SECRET.search((local_ref+' '+remote_ref).encode()):raise ValueError('待推送引用名称含敏感形态')+ if set(local_sha)=={'0'}:raise ValueError('本检查不授权删除远端引用')+ print(json.dumps(check(repo,local_sha,remote_sha,a.author_email),ensure_ascii=False))+ else:print(json.dumps(check(repo,a.ref,a.base,a.author_email),ensure_ascii=False))+++if __name__=='__main__':+ try:main()+ except (ValueError,OSError,subprocess.CalledProcessError) as e:+ print('发布检查未通过:'+(str(e) if isinstance(e,ValueError) else type(e).__name__),file=sys.stderr);raise SystemExit(1)diff --git a/scripts/images.py b/scripts/images.pynew file mode 100644index 0000000..839c057--- /dev/null+++ b/scripts/images.py@@ -0,0 +1,246 @@+#!/usr/bin/env python3+"""图片接入:选择当前宿主工具、生成调用计划、验收并收纳素材。不代替Agent调用工具。"""+import argparse+import hashlib+import io+import json+import os+from pathlib import Path+import shutil+import sys+import time+import uuid++import capabilities as c+++def sha(path):+ return hashlib.sha256(Path(path).read_bytes()).hexdigest()+++def inspect_image(path):+ try:+ from PIL import Image+ except ImportError:+ raise c.ConfigError('图片验收需要Pillow;状态探查不需要。请按环境安装依赖') from None+ try:+ payload=Path(path).read_bytes()+ with Image.open(io.BytesIO(payload)) as im:+ fmt=im.format+ if fmt not in ('PNG','JPEG','WEBP'):+ raise c.ConfigError('支持PNG/JPEG/WEBP静态素材')+ if getattr(im,'n_frames',1)!=1:+ raise c.ConfigError('多帧图片请先明确选帧,不隐式截取')+ im.verify()+ with Image.open(io.BytesIO(payload)) as im:+ im.load()+ alpha=im.convert('RGBA').getchannel('A').getextrema()+ return {'width':im.width,'height':im.height,'format':fmt.lower(),+ 'has_transparency':alpha[0]<255,'has_visible_pixels':alpha[1]>0,'sha256':hashlib.sha256(payload).hexdigest()}+ except c.ConfigError:raise+ except Exception as e:+ raise c.ConfigError('图片无法完整解码:'+type(e).__name__) from None+++def runtime_tools(path, session):+ data=c.read_json(Path(path))+ if data.get('session_id')!=session or not session:+ raise c.ConfigError('宿主能力快照不属于本次会话')+ if data.get('host') not in ('codex','claude-code','kimi','other'):+ raise c.ConfigError('未知宿主;可使用other但须提供真实工具声明')+ observed=data.get('observed_at')+ if not isinstance(observed,(int,float)) or not 0<=time.time()-observed<=900:+ raise c.ConfigError('工具快照已过期,请从当前会话重新取得(15分钟内)')+ tools=data.get('tools')+ if not isinstance(tools,list):raise c.ConfigError('工具快照需要tools列表;不可用时显式给空列表')+ ids=set()+ for tool in tools:+ if not isinstance(tool,dict) or not isinstance(tool.get('id'),str) or not tool['id'].strip() or tool['id'] in ids:+ raise c.ConfigError('工具ID缺失或重复')+ ids.add(tool['id'])+ if tool.get('kind') not in ('host','mcp') or tool.get('cost') not in ('subscription','paid_api','unknown','none') or tool.get('network') not in ('cloud','local'):+ raise c.ConfigError('工具必须声明执行来源、计费类型和网络范围')+ if not isinstance(tool.get('operations'),list) or not tool['operations'] or any(x not in ('generate','edit') for x in tool['operations']):+ raise c.ConfigError('工具操作声明无效')+ for key in ('reference_images','transparent_background'):+ if not isinstance(tool.get(key),bool):raise c.ConfigError('缺少工具特性:'+key)+ return data+++def request_data(path):+ data=c.read_json(Path(path))+ if set(data)-{'prompt','operation','references','transparent_background','min_width','min_height'}:+ raise c.ConfigError('图片需求包含不支持字段')+ if not isinstance(data.get('prompt'),str) or not data['prompt'].strip():+ raise c.ConfigError('需要非空图片描述')+ data.setdefault('operation','generate');data.setdefault('references',[])+ data.setdefault('transparent_background',False);data.setdefault('min_width',1);data.setdefault('min_height',1)+ if data['operation'] not in ('generate','edit') or not isinstance(data['references'],list) or not isinstance(data['transparent_background'],bool):+ raise c.ConfigError('图片需求类型不正确')+ for key in ('min_width','min_height'):+ if type(data[key]) is not int or not 1<=data[key]<=16384:raise c.ConfigError('尺寸须为1—16384的整数')+ if data['operation']=='edit' and not data['references']:raise c.ConfigError('改图需要明确输入图片')+ refs=[]+ for item in data['references']:+ if not isinstance(item,str):raise c.ConfigError('参考图须为本地文件路径')+ p=Path(item).expanduser()+ if not p.is_absolute():p=Path(path).resolve().parent/p+ meta=inspect_image(p)+ refs.append({'path':str(p.resolve()),'sha256':meta['sha256']})+ data['references']=refs+ return data+++def choose(config, runtime=None, request=None, mode=None, provider=None, grants=()):+ prefs=config['preferences']['image']; chosen=mode or prefs['mode']+ result={'capability':'image','mode':chosen,'status':'ready','reasons':[]}+ if config['policy']['image_generation']=='deny' and chosen=='generate':+ return dict(result,status='blocked',reasons=['图片生成已被明确禁止'])+ if chosen=='off':return dict(result,status='skipped',reasons=['不启用图片生成'])+ if chosen=='existing':return dict(result,status='needs_input',reasons=['提供现有图片,通过use-image导入'])+ if chosen=='unconfigured':return dict(result,status='needs_configuration',prompt=config['onboarding']['image']!='manual',reasons=['可选现有素材、当前宿主生图或跳过'])+ if chosen!='generate':raise c.ConfigError('图片方式不支持')+ if not runtime:return dict(result,status='needs_runtime',reasons=['需当前会话实际暴露的工具快照;不能按Agent名称推断'])+ request=request or {'operation':'generate','references':[],'transparent_background':False}+ selected=provider or prefs['provider']+ candidates=[]+ for tool in runtime['tools']:+ if selected!='auto' and tool['id']!=selected:continue+ if request['operation'] not in tool['operations']:continue+ if request['references'] and not tool['reference_images']:continue+ if request['transparent_background'] and not tool['transparent_background']:continue+ candidates.append(tool)+ if not candidates:return dict(result,status='unavailable',reasons=['当前无满足要求的工具;可导入现有素材,不自动接API'])+ ready=[];missing=[];blocked=[]+ for tool in candidates:+ needs=['image_generation']+ if tool['network']=='cloud':needs.append('cloud')+ if tool['cost']=='paid_api':needs.append('paid_api')+ if tool['cost']=='unknown':needs.append('unknown_image_cost')+ if request['references'] and tool['network']=='cloud':needs.append('reference_upload')+ deny=[k for k in needs if config['policy'][k]=='deny']+ ask=[k for k in needs if config['policy'][k]!='allow' and k not in grants]+ if deny:blocked.append({'tool_id':tool['id'],'denied':deny})+ elif ask:missing.append({'tool_id':tool['id'],'needs':ask})+ else:ready.append(tool)+ if len(ready)>1:return dict(result,status='needs_selection',candidates=[x['id'] for x in ready],reasons=['多个工具可用,请选择本次供应商或设置偏好'])+ if not ready:+ return dict(result,status='needs_permission' if missing else 'blocked',candidates=missing or blocked,reasons=['探查不授予调用权;沿用用户已经明确的本次授权'])+ return dict(result,status='host_action_required',host=runtime['host'],tool=ready[0],operation=request['operation'],+ reasons=['由当前Agent按真实工具schema执行;Python不会调用宿主工具'])+++def no_overwrite(path, payload):+ path=Path(path);path.parent.mkdir(parents=True,exist_ok=True)+ with path.open('xb') as f:f.write(payload)+++def config_fingerprint(config):+ selected={'preferences':config['preferences']['image'], 'policy':{k:config['policy'][k] for k in ('image_generation','cloud','paid_api','reference_upload','unknown_image_cost')}}+ return hashlib.sha256(json.dumps(selected,sort_keys=True).encode()).hexdigest()+++def make_plan(config, request, runtime, session, out, mode=None, provider=None, grants=()):+ decision=choose(config,runtime,request,mode,provider,grants)+ if decision['status']!='host_action_required':return decision+ plan={'schema_version':1,'plan_id':str(uuid.uuid4()),'session_id':session,'created_at':time.time(),+ 'host':runtime['host'],'tool':decision['tool'],'request':request,'configuration_sha256':config_fingerprint(config),+ 'instruction':'Agent调用当前真实工具;成功后保存回执,accept-image重新核验授权与产物。'}+ no_overwrite(out,(json.dumps(plan,ensure_ascii=False,indent=2)+'\n').encode())+ return {'status':'host_action_required','plan':str(out),'plan_id':plan['plan_id'],'tool_id':plan['tool']['id']}+++def accept(config, plan_path, receipt_path, file, out, runtime, session, grants=()):+ plan=c.read_json(Path(plan_path));receipt=c.read_json(Path(receipt_path))+ if plan.get('schema_version')!=1 or plan.get('session_id')!=session or plan.get('host')!=runtime['host']:+ raise c.ConfigError('计划不属于当前宿主/会话')+ created=plan.get('created_at')+ if not isinstance(created,(int,float)) or not 0<=time.time()-created<=3600:+ raise c.ConfigError('图片计划超过1小时,重新解析当前授权与要求')+ if plan.get('configuration_sha256')!=config_fingerprint(config):+ raise c.ConfigError('图片相关配置已改变,请重新生成计划')+ req=plan.get('request')+ if not isinstance(req,dict) or not isinstance(req.get('prompt'),str) or req.get('operation') not in ('generate','edit') or not isinstance(req.get('references'),list) or type(req.get('transparent_background')) is not bool:+ raise c.ConfigError('图片计划的需求结构无效')+ if any(type(req.get(k)) is not int or not 1<=req[k]<=16384 for k in ('min_width','min_height')):+ raise c.ConfigError('图片计划尺寸无效')+ for ref in req['references']:+ if not isinstance(ref,dict) or not isinstance(ref.get('path'),str) or not isinstance(ref.get('sha256'),str):+ raise c.ConfigError('计划参考图结构无效')+ tool=plan.get('tool',{})+ if not isinstance(tool,dict):raise c.ConfigError('计划工具声明无效')+ current=next((t for t in runtime['tools'] if t['id']==tool.get('id')),None)+ if current!=tool:raise c.ConfigError('工具能力发生变化或已不可用,不能复用旧计划')+ for ref in plan['request']['references']:+ if sha(ref['path'])!=ref['sha256']:raise c.ConfigError('参考图已变化,重新生成计划')+ decision=choose(config,runtime,plan['request'],mode='generate',provider=tool['id'],grants=grants)+ if decision['status']!='host_action_required':raise c.ConfigError('当前配置不再允许接收该生成任务:'+decision['status'])+ meta=inspect_image(file)+ expected={'status':'success','plan_id':plan['plan_id'],'session_id':session,'tool_id':tool['id'],'output_sha256':meta['sha256']}+ if any(receipt.get(k)!=v for k,v in expected.items()):raise c.ConfigError('回执未成功或与计划/文件不一致')+ req=plan['request']+ if not meta['has_visible_pixels']:raise c.ConfigError('生成图片全透明,缺少可见内容')+ if meta['width']<req['min_width'] or meta['height']<req['min_height']:+ raise c.ConfigError('图片尺寸小于任务要求')+ if req['transparent_background'] and not meta['has_transparency']:+ raise c.ConfigError('要求透明背景,但产物没有实际透明像素')+ meta.update(generated=True,tool_id=tool['id'],host=runtime['host'],plan_id=plan['plan_id'],+ prompt_sha256=hashlib.sha256(req['prompt'].encode()).hexdigest(),receipt_sha256=sha(receipt_path),+ provenance='agent_reported_tool_call',source_proof='回执关联已检查,非平台签名来源认证')+ return import_artifact(file,out,meta)+++def import_artifact(file,out,meta):+ out=Path(out);sidecar=out.with_name(out.name+'.json')+ suffix={'.png':'png','.jpg':'jpeg','.jpeg':'jpeg','.webp':'webp'}.get(out.suffix.lower())+ if suffix!=meta['format']:raise c.ConfigError('目标扩展名须与真实图片格式一致;此入口不转码')+ if out.exists() or sidecar.exists():raise c.ConfigError('目标图片或元数据已存在,请使用新版本文件名')+ payload=Path(file).read_bytes()+ if hashlib.sha256(payload).hexdigest()!=meta['sha256']:raise c.ConfigError('验收期间图片已改变')+ meta=dict(meta,path=out.name)+ # 配对写入由协作脚本锁串行;不覆盖用户现有版本。+ with c.locked(out):+ if out.exists() or sidecar.exists():raise c.ConfigError('目标已被其他进程创建')+ no_overwrite(out,payload)+ no_overwrite(sidecar,(json.dumps(meta,ensure_ascii=False,indent=2)+'\n').encode())+ return {'status':'complete','output':str(out),'metadata':str(sidecar),'sha256':meta['sha256']}+++def main():+ p=argparse.ArgumentParser(description=__doc__);sub=p.add_subparsers(dest='command',required=True)+ for name in ('image-status','image-plan','accept-image','use-image'):+ q=sub.add_parser(name);q.add_argument('--config');q.add_argument('--project')+ if name!='use-image':+ q.add_argument('--host-tools');q.add_argument('--session')+ for key in ('image-generation','cloud','paid-api','reference-upload','unknown-image-cost'):+ q.add_argument('--allow-'+key,action='store_true',help='仅表达已有的本次授权,不覆盖deny')+ if name in ('image-status','image-plan'):+ q.add_argument('--mode',choices=['off','existing','generate']);q.add_argument('--provider')+ q.add_argument('--request',required=name=='image-plan')+ if name in ('image-plan','accept-image','use-image'):q.add_argument('--out',required=True)+ if name in ('accept-image','use-image'):q.add_argument('--file',required=True)+ if name=='accept-image':q.add_argument('--plan',required=True);q.add_argument('--receipt',required=True)+ a=p.parse_args();config,_=c.effective(a.config,a.project)+ grants=[key for key in ('image_generation','cloud','paid_api','reference_upload','unknown_image_cost') if getattr(a,'allow_'+key,False)]+ runtime=runtime_tools(a.host_tools,a.session) if getattr(a,'host_tools',None) else None+ if a.command=='use-image':+ meta=inspect_image(a.file);meta.update(generated=False,mode='existing',provenance='provided_file')+ result=import_artifact(a.file,a.out,meta)+ elif a.command=='accept-image':+ if not runtime:raise c.ConfigError('需要本次最新宿主工具快照')+ result=accept(config,a.plan,a.receipt,a.file,a.out,runtime,a.session,grants)+ else:+ request=request_data(a.request) if a.request else None+ if a.command=='image-status':result=choose(config,runtime,request,a.mode,a.provider,grants)+ else:+ if not runtime:raise c.ConfigError('需要本次宿主工具快照,不能猜测工具')+ result=make_plan(config,request,runtime,a.session,a.out,a.mode,a.provider,grants)+ print(json.dumps(result,ensure_ascii=False,indent=2))+ if a.command=='image-plan' and result['status']!='host_action_required':raise SystemExit(2)+++if __name__=='__main__':+ try:main()+ except (c.ConfigError,OSError,ValueError,KeyError,TypeError) as e:+ print(json.dumps({'status':'error','message':str(e) if isinstance(e,c.ConfigError) else type(e).__name__},ensure_ascii=False),file=sys.stderr)+ raise SystemExit(2)diff --git a/scripts/koubo.py b/scripts/koubo.pynew file mode 100644index 0000000..e6bbe77--- /dev/null+++ b/scripts/koubo.py@@ -0,0 +1,423 @@+#!/usr/bin/env python3+"""口播 —— 用复刻音色生成、修补视频里的口播片段。++底层是火山引擎豆包声音复刻 2.0(seed-icl-2.0)。++ say 用已有音色念一段文本,可对齐到目标时长、匹配目标响度+ train 投喂一段真人录音,训练出新音色+ voices 列出本地登记的音色 / 查线上训练状态++凭证与默认声音由capabilities.py加载安装目录外的个人配置;+此文件保留say/train/voices兼容入口,基础配置与系统声音不依赖requests。+"""+import argparse+import base64+import json+import os+import pathlib+import re+import subprocess+import sys+import tempfile+import uuid+++HOST = "https://openspeech.bytedance.com"+RES_CLONE = "volc.megatts.voiceclone" # 训练 / 查询+RES_TTS = "seed-icl-2.0" # 合成+REGISTRY = pathlib.Path.home() / ".koubo" / "voices.json"+MAX_UPLOAD = 10 * 1024 * 1024 # 参考音频上限(原始文件,非 base64)+++# ---------- 基础设施 ----------++ACTIVE_CONFIG = None+++def configure_backend(config):+ global ACTIVE_CONFIG, REGISTRY+ ACTIVE_CONFIG = config+ REGISTRY = pathlib.Path(config["bindings"]["volcengine"]["registry_file"]).expanduser()+++def load_env():+ from capabilities import credentials, effective+ config = ACTIVE_CONFIG or effective()[0]+ appid, token = credentials(config)+ if not appid or not token:+ sys.exit("缺少凭证;请配置环境变量或明确指定的env_file(不会扫描其他.env)")+ return appid, token+++def _session():+ import requests+ from capabilities import effective+ config = ACTIVE_CONFIG or effective()[0]+ session = requests.Session()+ session.trust_env = config["bindings"]["volcengine"]["trust_env"]+ return session+++def api(path, resource_id, payload, stream=False, retries=1):+ # POST超时可能已经被接受/计费;不重新生成request_id盲目重试。+ import requests+ appid, token = load_env()+ headers = {+ "X-Api-App-Id": appid, "X-Api-Access-Key": token,+ "X-Api-Resource-Id": resource_id, "X-Api-Request-Id": str(uuid.uuid4()),+ "Content-Type": "application/json",+ }+ try:+ return _session().post(HOST + path, headers=headers, json=payload,+ timeout=300, stream=stream)+ except requests.exceptions.RequestException:+ sys.exit("outcome_unknown:网络请求未确认完成;先核对服务端状态,不自动重复提交")+++def registry_load():+ if REGISTRY.is_file():+ return json.loads(REGISTRY.read_text(encoding="utf-8"))+ return {"default": None, "voices": {}}+++def registry_save(data):+ REGISTRY.parent.mkdir(parents=True, exist_ok=True)+ REGISTRY.write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")+++def resolve_speaker(name_or_id):+ """支持传音色名(登记表里的)或直接传 speaker_id。不传则用默认音色。"""+ reg = registry_load()+ if not name_or_id:+ name_or_id = reg.get("default") or os.getenv("VOLC_KOUBO_DEFAULT_SPEAKER")+ if not name_or_id:+ sys.exit("✗ 没指定音色,也没有默认音色。先跑 `koubo.py voices` 看有哪些")+ if name_or_id in reg["voices"]:+ return reg["voices"][name_or_id]["speaker_id"], name_or_id+ return name_or_id, name_or_id+++def ffprobe_duration(path):+ out = subprocess.run(+ ["ffprobe", "-v", "error", "-show_entries", "format=duration", "-of", "csv=p=0", str(path)],+ capture_output=True, text=True).stdout.strip()+ return float(out) if out else 0.0+++def mean_volume(path, ss=None, t=None):+ cmd = ["ffmpeg", "-hide_banner", "-nostats"]+ if ss is not None:+ cmd += ["-ss", str(ss)]+ if t is not None:+ cmd += ["-t", str(t)]+ cmd += ["-i", str(path), "-af", "volumedetect", "-f", "null", "-"]+ err = subprocess.run(cmd, capture_output=True, text=True).stderr+ m = re.search(r"mean_volume:\s*(-?[\d.]+) dB", err)+ return float(m.group(1)) if m else None+++# ---------- say ----------++def synthesize(text, speaker, out, fmt="wav", sample_rate=48000,+ model="seed-tts-2.0-expressive", fidelity=True, speech_rate=0):+ req = {+ "text": text,+ "speaker": speaker,+ "audio_params": {"format": fmt, "sample_rate": sample_rate},+ "model": model,+ }+ if fidelity:+ req["tone_fidelity"] = True+ if speech_rate:+ # 实测:只有放在 audio_params 里才生效,放 req_params 顶层会被静默忽略+ req["audio_params"]["speech_rate"] = int(speech_rate)++ r = api("/api/v3/tts/unidirectional", RES_TTS,+ {"user": {"uid": "koubo"}, "req_params": req}, stream=True)+ if r.status_code != 200:+ sys.exit(f"✗ HTTP {r.status_code} {r.text[:400]}")++ chunks, errs, complete = [], [], False+ for line in r.iter_lines():+ if not line:+ continue+ s = line.decode("utf-8", "ignore")+ if s.startswith("data:"):+ s = s[5:].strip()+ try:+ obj = json.loads(s)+ except ValueError:+ continue+ if obj.get("code") == 20000000:+ complete = True+ if obj.get("data"):+ chunks.append(base64.b64decode(obj["data"]))+ if obj.get("code") not in (None, 0, 20000000):+ errs.append(obj)+ if errs or not chunks or not complete:+ sys.exit("合成失败或返回不完整音频;不提交部分产物")+ pathlib.Path(out).write_bytes(b"".join(chunks))+ return pathlib.Path(out)+++def fit_duration(path, target, tol=0.05):+ """用 atempo 把音频精调到目标时长。超过 ±10% 不做,避免音质劣化。"""+ cur = ffprobe_duration(path)+ if not cur or abs(cur - target) <= tol:+ return cur, 1.0+ ratio = cur / target+ if not 0.9 <= ratio <= 1.1:+ return cur, ratio # 差太多,交给调用方决定(通常该改 speech_rate)+ tmp = pathlib.Path(tempfile.mkstemp(suffix=path.suffix)[1])+ subprocess.run(["ffmpeg", "-hide_banner", "-loglevel", "error", "-y", "-i", str(path),+ "-filter:a", f"atempo={ratio:.6f}", str(tmp)], check=True)+ tmp.replace(path)+ return ffprobe_duration(path), ratio+++def match_loudness(path, target_db):+ """把合成音量拉到跟原音轨同一水平,避免拼接处音量跳变。"""+ cur = mean_volume(path)+ if cur is None or target_db is None:+ return None+ gain = target_db - cur+ if abs(gain) < 0.5:+ return 0.0+ tmp = pathlib.Path(tempfile.mkstemp(suffix=path.suffix)[1])+ subprocess.run(["ffmpeg", "-hide_banner", "-loglevel", "error", "-y", "-i", str(path),+ "-filter:a", f"volume={gain:.2f}dB", str(tmp)], check=True)+ tmp.replace(path)+ return gain+++def cmd_say(args):+ speaker, label = resolve_speaker(args.voice)+ out = pathlib.Path(args.out)+ out.parent.mkdir(parents=True, exist_ok=True)++ # 目标响度:可以直接给 dB,也可以指给一段参考音频(通常是原音轨那几秒)+ target_db = args.loudness+ if args.match:+ target_db = mean_volume(args.match, args.match_ss, args.match_t)++ speech_rate = args.speech_rate+ for attempt in range(3):+ synthesize(args.text, speaker, out, fmt=args.format, sample_rate=args.sample_rate,+ model=args.model, fidelity=not args.no_fidelity, speech_rate=speech_rate)+ dur = ffprobe_duration(out)+ if not args.fit:+ break+ ratio = dur / args.fit+ if 0.93 <= ratio <= 1.07: # 进入 atempo 无损区间,够了+ break+ # speech_rate 是绝对值不是增量:rate r 对应 (1 + r/100) 倍速。+ # 先还原成 rate=0 时的时长,再算要多少倍速才能落到目标上。+ base = dur * (1 + speech_rate / 100)+ want = max(-50, min(100, int(round((base / args.fit - 1) * 100))))+ if want == speech_rate:+ break+ speech_rate = want+ print(f" 时长 {dur:.2f}s vs 目标 {args.fit:.2f}s,speech_rate 调到 {speech_rate} 重试")+ if speech_rate <= -50:+ print(" ⚠️ 已到最慢 0.5 倍速——文本字数偏少,塞不满这个坑位,考虑加词")+ elif speech_rate >= 100:+ print(" ⚠️ 已到最快 2 倍速——文本字数偏多,坑位装不下,考虑删词")++ info = [f"{ffprobe_duration(out):.2f}s"]+ if args.fit:+ dur, ratio = fit_duration(out, args.fit)+ info = [f"{dur:.2f}s(目标 {args.fit:.2f}s)"]+ if not 0.9 <= ratio <= 1.1:+ info.append(f"⚠️ 差 {abs(ratio-1)*100:.0f}%,超出 atempo 无损区间,没做拉伸")+ if target_db is not None:+ gain = match_loudness(out, target_db)+ if gain:+ info.append(f"响度 {gain:+.1f}dB → {target_db:.1f}dB")++ return info+++# ---------- train ----------++def prepare_audio(src, seconds=None, start=0):+ """转成 24k 单声道;优先 wav,超 10MB 自动降级到 mp3。返回临时文件路径。"""+ src = pathlib.Path(src)+ for fmt, codec, extra in (("wav", ["-c:a", "pcm_s16le"], []),+ ("mp3", [], ["-b:a", "192k"]),+ ("mp3", [], ["-b:a", "96k"])):+ tmp = pathlib.Path(tempfile.mkstemp(suffix=f".{fmt}")[1])+ cmd = ["ffmpeg", "-hide_banner", "-loglevel", "error", "-y", "-ss", str(start)]+ if seconds:+ cmd += ["-t", str(seconds)]+ cmd += ["-i", str(src), "-ac", "1", "-ar", "24000"] + codec + extra + [str(tmp)]+ subprocess.run(cmd, check=True)+ if tmp.stat().st_size <= MAX_UPLOAD:+ return tmp, fmt+ tmp.unlink()+ sys.exit("✗ 音频压到 96k mp3 仍超过 10MB,请缩短 --seconds")+++def cmd_train(args):+ src = pathlib.Path(args.audio)+ if not src.is_file():+ sys.exit(f"✗ 找不到 {src}")++ # 先挡住最常见的失败:喂进去的其实是底噪,服务端会回 45001122 no speaker detected+ vol = mean_volume(src, args.start, args.seconds)+ if vol is not None and vol < -36:+ print(f"⚠️ 这段平均电平只有 {vol:.1f} dB,很可能没有人声或人声太弱。")+ print(" 先确认这段里真的有人在说话,或换一段、或先做响度归一化。")+ if not args.force:+ sys.exit(" 确认没问题就加 --force 再跑一次。")++ audio, fmt = prepare_audio(src, args.seconds, args.start)+ dur = ffprobe_duration(audio)+ size_mb = audio.stat().st_size / 1024 / 1024+ print(f"参考音频:{dur:.0f}s {fmt} {size_mb:.1f}MB")++ payload = {+ "speaker_id": args.speaker,+ "audio": {"data": base64.b64encode(audio.read_bytes()).decode(), "format": fmt},+ "source": 2,+ "language": args.language,+ "model_type": 5, # 5 = 声音复刻 2.0+ }+ if args.reference_text:+ payload["text"] = args.reference_text+ if args.denoise:+ payload["enable_audio_denoise"] = True+ if args.keep_volume:+ payload["disable_volume_normalization"] = True++ r = api("/api/v3/tts/voice_clone", RES_CLONE, payload)+ audio.unlink(missing_ok=True)+ if r.status_code != 200:+ sys.exit(f"✗ HTTP {r.status_code} {r.text[:500]}")+ data = r.json()+ status = data.get("status")+ if status not in (2, 4):+ sys.exit(f"✗ 训练未成功 status={status} {data.get('message','')}")++ reg = registry_load()+ reg["voices"][args.name] = {+ "speaker_id": args.speaker,+ "source": str(src),+ "seconds": round(dur),+ "trained_at": data.get("create_time"),+ "remaining_trainings": data.get("available_training_times"),+ }+ if args.default:+ reg["default"] = args.name+ registry_save(reg)++ print(f"✓ 「{args.name}」训练成功 speaker_id={args.speaker} "+ f"剩余训练次数 {data.get('available_training_times')}")+ if reg["default"] == args.name:+ print(f" 已设为默认音色")+ demo = data.get("demo_audio")+ if demo:+ print(f" 官方试听(1 小时内有效):{demo}")+++# ---------- voices ----------++def cmd_voices(args):+ reg = registry_load()+ if not reg["voices"]:+ print("本地还没登记任何音色。用 `koubo.py train` 投喂一段录音。")+ print(f"(登记表位置:{REGISTRY})")+ return+ print(f"默认音色:{reg.get('default') or '(未设)'}\n")+ for name, v in reg["voices"].items():+ mark = "★" if name == reg.get("default") else " "+ print(f"{mark} {name:<24} {v['speaker_id']:<16} {v.get('seconds','?')}s ← {v.get('source','')}")+ if args.check:+ print("\n查线上状态:")+ for name, v in reg["voices"].items():+ r = api("/api/v3/tts/get_voice", RES_CLONE, {"speaker_id": v["speaker_id"]})+ try:+ st = r.json()+ st = st[0] if isinstance(st, list) else st+ if r.status_code != 200:+ print(f" {name:<24} 查询失败 HTTP {r.status_code}:{st.get('message','')}")+ continue+ print(f" {name:<24} status={st.get('status')} "+ f"剩余训练 {st.get('available_training_times','?')}")+ except ValueError:+ print(f" {name:<24} 查询失败 HTTP {r.status_code}")+++def main():+ p = argparse.ArgumentParser(description="口播 · 复刻音色生成与修补")+ sub = p.add_subparsers(dest="cmd", required=True)++ s = sub.add_parser("say", help="用复刻音色念一段文本")+ s.add_argument("text")+ s.add_argument("--out", required=True)+ s.add_argument("--voice", help="音色名或 speaker_id,不传用默认")+ s.add_argument("--fit", type=float, metavar="秒",+ help="对齐到目标时长:先调 speech_rate 粗调,再 atempo 精调")+ s.add_argument("--match", metavar="音频", help="匹配这个音频的响度(通常是原音轨)")+ s.add_argument("--match-ss", dest="match_ss", type=float, help="--match 从第几秒起算")+ s.add_argument("--match-t", dest="match_t", type=float, help="--match 取多少秒")+ s.add_argument("--loudness", type=float, metavar="dB", help="直接指定目标平均电平")+ s.add_argument("--format", default="wav", choices=["wav", "mp3", "pcm", "ogg_opus"])+ s.add_argument("--sample-rate", dest="sample_rate", type=int, default=48000,+ choices=[8000, 16000, 22050, 24000, 32000, 44100, 48000])+ s.add_argument("--model", default=None,+ choices=["seed-tts-2.0-expressive", "seed-tts-2.0-standard"])+ s.add_argument("--no-fidelity", dest="no_fidelity", action="store_true", default=None,+ help="关掉还原模式(默认开)")+ s.add_argument("--speech-rate", dest="speech_rate", type=int, default=None,+ help="火山语速-50~100;未指定时使用个人配置,公共建议为0")+ s.set_defaults(func=cmd_say)++ t = sub.add_parser("train", help="投喂真人录音,训练新音色")+ t.add_argument("--audio", required=True)+ t.add_argument("--speaker", required=True, help="控制台里的空音色槽位 ID")+ t.add_argument("--name", required=True, help="给这个音色起的名字")+ t.add_argument("--seconds", type=float, help="只取前 N 秒(不传则整条,超 10MB 自动降格式)")+ t.add_argument("--start", type=float, default=0, help="从第几秒开始取")+ t.add_argument("--reference-text", dest="reference_text",+ help="参考音频对应的文本,服务端会做 WER 校验,差太多会失败")+ t.add_argument("--language", type=int, default=0, help="0=中文 1=英文")+ t.add_argument("--denoise", action="store_true", help="开降噪(会损失相似度,样本干净时别开)")+ t.add_argument("--keep-volume", dest="keep_volume", action="store_true",+ help="关掉音量归一化,合成音量更贴近参考音频")+ t.add_argument("--default", action="store_true", help="设为默认音色")+ t.add_argument("--force", action="store_true", help="电平过低时仍然上传")+ t.set_defaults(func=cmd_train)++ v = sub.add_parser("voices", help="列出音色")+ v.add_argument("--check", action="store_true", help="同时查线上训练状态")+ v.set_defaults(func=cmd_voices)++ s.add_argument("--mode", choices=["off", "system", "clone"], help="仅覆盖本次声音方式")+ for command in (s, t, v):+ command.add_argument("--config", help="明确选择安装目录外的用户配置")+ command.add_argument("--project", help="读取该项目的受限媒体偏好")+ command.add_argument("--allow-cloud", action="store_true", help="已获得的本次云调用授权,不覆盖deny")+ command.add_argument("--allow-paid-api", action="store_true", help="已获得的本次付费调用授权,不覆盖deny")+ t.add_argument("--allow-voice-training", action="store_true", help="本次明确允许训练;不隐含于普通合成授权")+ args = p.parse_args()+ from capabilities import effective, resolve, run_say, ConfigError+ config, _ = effective(args.config, args.project)+ configure_backend(config)+ if args.cmd == "say":+ return run_say(args, config)+ if args.cmd == "train" or (args.cmd == "voices" and args.check):+ operation = "train" if args.cmd == "train" else "check"+ grants = [key for key in ("cloud", "paid_api", "voice_training") if getattr(args, "allow_" + key, False)]+ result = resolve(config, mode="clone", operation=operation, grants=grants)+ if result["status"] != "configured_unverified":+ print(json.dumps(result, ensure_ascii=False)); raise SystemExit(2)+ args.func(args)+++if __name__ == "__main__":+ from capabilities import ConfigError+ try:+ main()+ except (ConfigError, OSError, subprocess.SubprocessError) as e:+ print(str(e) if isinstance(e, ConfigError) else type(e).__name__, file=sys.stderr)+ raise SystemExit(2)diff --git a/tests/test_capabilities.py b/tests/test_capabilities.pynew file mode 100644index 0000000..ff19bea--- /dev/null+++ b/tests/test_capabilities.py@@ -0,0 +1,217 @@+import copy+import io+import json+import multiprocessing+import os+from pathlib import Path+import subprocess+import sys+import tempfile+import unittest+from unittest.mock import patch+import wave++sys.path.insert(0, str(Path(__file__).resolve().parents[1] / 'scripts'))+import capabilities as c+import koubo+++def write_setting(path, setting):+ c.save_patch(Path(path), {'preferences': {'voice': setting}})+++class MediaConfigTests(unittest.TestCase):+ def setUp(self):+ self.temp = tempfile.TemporaryDirectory()+ self.addCleanup(self.temp.cleanup)+ self.root = Path(self.temp.name)+ self.file = self.root / 'media.json'+ self.config, _ = c.effective(str(self.file))++ def clone_config(self):+ return c.merge(self.config, {'preferences': {'voice': {'mode': 'clone'}},+ 'policy': {'cloud': 'allow', 'paid_api': 'allow'},+ 'bindings': {'voices': {'default': {'speaker_id': 'S_test'}}}})++ def test_clean_install_does_not_probe_credentials(self):+ with patch.object(c, 'credentials', side_effect=AssertionError('must not read credentials')):+ result = c.resolve(self.config)+ self.assertEqual(result['status'], 'needs_configuration')+ self.assertFalse(self.file.exists())++ def test_existing_audio_wins_without_cloud(self):+ audio = self.root / 'own.wav'; audio.write_bytes(b'example')+ cfg = self.clone_config()+ with patch.object(c, 'credentials', side_effect=AssertionError()):+ result = c.resolve(cfg, audio=str(audio))+ self.assertEqual(result['mode'], 'provided')++ def test_explicit_revoice_overrides_existing_audio(self):+ with patch.object(c.platform, 'system', return_value='Darwin'), patch.object(c.shutil, 'which', return_value='/bin/tool'):+ self.assertEqual(c.resolve(self.config, mode='system', audio='old.wav')['mode'], 'system')++ def test_deny_beats_temporary_grant_before_credentials(self):+ cfg = self.clone_config(); cfg['policy']['cloud'] = 'deny'+ with patch.object(c, 'credentials', side_effect=AssertionError()):+ self.assertEqual(c.resolve(cfg, grants=['cloud', 'paid_api'])['status'], 'blocked')++ def test_credentials_do_not_grant_permission(self):+ cfg = self.clone_config(); cfg['policy']['paid_api'] = 'ask'+ with patch.object(c, 'credentials', side_effect=AssertionError()):+ self.assertEqual(c.resolve(cfg)['status'], 'needs_permission')++ def test_training_needs_separate_permission(self):+ cfg = self.clone_config()+ self.assertEqual(c.resolve(cfg, operation='train')['status'], 'needs_permission')++ def test_default_is_zero_not_author_rate(self):+ self.assertEqual(self.config['provider_options']['volcengine']['speech_rate'], 0)++ def test_known_credentials_file_only_and_environment_precedence(self):+ env = self.root / '.env';env.write_text('export VOLC_SPEECH_APPID="from-file"\nVOLC_SPEECH_TOKEN=local-test\n')+ self.config['bindings']['volcengine']['env_file'] = str(env)+ with patch.dict(os.environ, {'VOLC_SPEECH_APPID': 'from-process'}, clear=True):+ self.assertEqual(c.credentials(self.config), ('from-process', 'local-test'))++ def test_no_implicit_env_fallback(self):+ with patch.dict(os.environ, {}, clear=True):+ self.assertEqual(c.credentials(self.config), (None, None))++ def test_bind_existing_voice_without_registry_mutation(self):+ registry = self.root / 'voices.json';registry.write_text('{"default":"old","voices":{"old":{"speaker_id":"S_old"}}}')+ cfg = self.clone_config();cfg['bindings']['volcengine']['registry_file'] = str(registry)+ cfg['bindings']['voices'] = {'my_voice': {'speaker_id': 'S_new'}}+ before = registry.read_bytes()+ self.assertEqual(c.speaker(cfg, 'my_voice'), 'S_new')+ self.assertEqual(c.speaker(cfg, 'old'), 'S_old')+ self.assertEqual(before, registry.read_bytes())++ def test_project_cannot_grant_or_supply_credentials(self):+ for data in [{'policy': {'cloud': 'allow'}}, {'bindings': {'volcengine': {'env_file': '/elsewhere'}}},+ {'preferences': {'voice': {'voice_ref': 'someone'}}}]:+ with self.assertRaises(c.ConfigError):c.project_patch(data)+ c.project_patch({'policy': {'cloud': 'deny'}, 'preferences': {'voice': {'mode': 'system'}}})++ def test_unknown_schema_and_null_fail_closed(self):+ for data in [{'schema_version':2}, {'preferences':{'voice':None}}, {'policy':{'paid_api':'alow'}}, {'unknown':True}]:+ with self.assertRaises(c.ConfigError):c.validate(data)++ def test_skip_and_reset_preserve_other_preferences(self):+ c.save_patch(self.file, {'preferences': {'voice': {'mode': 'system'}}, 'policy': {'cloud': 'deny'}})+ c.save_patch(self.file, {'onboarding': {'voice':'manual'}, 'preferences':{'voice':{'mode':'unconfigured'}}})+ config,_ = c.effective(str(self.file));self.assertFalse(c.resolve(config)['prompt'])+ c.save_patch(self.file, {}, reset='preferences.voice')+ config,_ = c.effective(str(self.file));self.assertEqual(config['policy']['cloud'], 'deny')++ def test_revision_detects_stale_writer(self):+ c.save_patch(self.file, {'policy':{'cloud':'deny'}}, expected=0)+ with self.assertRaises(c.ConfigError):c.save_patch(self.file, {'policy':{'cloud':'allow'}}, expected=0)+ self.assertEqual(c.read_json(self.file)['policy']['cloud'], 'deny')++ def test_concurrent_writes_preserve_both_fields(self):+ ctx=multiprocessing.get_context('spawn')+ procs=[ctx.Process(target=write_setting,args=(str(self.file),x)) for x in [{'mode':'system'},{'system_voice':'Tingting'}]]+ for p in procs:p.start()+ for p in procs:p.join(15);self.assertEqual(p.exitcode,0)+ cfg=c.read_json(self.file)+ self.assertEqual(cfg['preferences']['voice'],{'mode':'system','system_voice':'Tingting'})+ self.assertEqual(cfg['revision'],2)++ def test_dead_lock_owner_releases_lock(self):+ command=[sys.executable,'-c', 'import sys,os;from pathlib import Path;sys.path.insert(0,sys.argv[1]);import capabilities as c\nwith c.locked(Path(sys.argv[2])): os._exit(0)',str(c.ROOT/'scripts'),str(self.file)]+ subprocess.run(command,check=True,timeout=10)+ c.save_patch(self.file, {'policy': {'cloud':'deny'}})++ def test_base_commands_work_without_site_packages(self):+ result=subprocess.run([sys.executable,'-S',str(c.ROOT/'scripts/capabilities.py'),'status','--config',str(self.file)],capture_output=True,text=True)+ self.assertEqual(result.returncode,0,result.stderr)+ self.assertEqual(json.loads(result.stdout)['status'],'needs_configuration')++ def test_network_timeout_is_not_retried(self):+ import requests+ cfg=self.clone_config();koubo.configure_backend(cfg)+ with patch.object(koubo,'load_env',return_value=('test','test')),patch.object(koubo,'_session') as session:+ session.return_value.post.side_effect=requests.exceptions.Timeout()+ with self.assertRaisesRegex(SystemExit,'outcome_unknown'):koubo.api('/test','resource',{})+ self.assertEqual(session.return_value.post.call_count,1)++ def test_proxy_setting_respects_user(self):+ cfg=self.clone_config();cfg['bindings']['volcengine']['trust_env']=True;koubo.configure_backend(cfg)+ self.assertTrue(koubo._session().trust_env)+ cfg['bindings']['volcengine']['trust_env']=False;koubo.configure_backend(cfg)+ self.assertFalse(koubo._session().trust_env)++ def test_partial_error_not_saved(self):+ import base64+ out=self.root/'bad.wav'+ class Response:+ status_code=200+ def iter_lines(self):+ return [json.dumps({'data':base64.b64encode(b'partial').decode(),'code':0}).encode(),b'{"code":45000000}']+ with patch.object(koubo,'api',return_value=Response()):+ with self.assertRaises(SystemExit):koubo.synthesize('text','S_test',out)+ self.assertFalse(out.exists())++ def test_system_platform_never_falls_back_to_cloud(self):+ with patch.object(c.platform,'system',return_value='Linux'),patch.object(c,'credentials',side_effect=AssertionError()):+ self.assertEqual(c.resolve(self.config,mode='system')['status'],'unavailable')++ def test_existing_audio_copy_preserves_bytes(self):+ source=self.root/'source.wav';out=self.root/'copy.wav'+ with wave.open(str(source),'wb') as f:+ f.setnchannels(1);f.setsampwidth(2);f.setframerate(48000);f.writeframes(b'\0\0'*4800)+ subprocess.run([sys.executable,str(c.ROOT/'scripts/capabilities.py'),'use-audio','--config',str(self.file),'--audio',str(source),'--out',str(out)],check=True,capture_output=True)+ self.assertEqual(source.read_bytes(),out.read_bytes())+ self.assertFalse(json.loads(Path(str(out)+'.json').read_text())['generated'])+++ def test_stream_eof_without_completion_never_writes(self):+ import base64+ out=self.root/'incomplete.wav'+ class Response:+ status_code=200+ def iter_lines(self):+ return [json.dumps({'data':base64.b64encode(b'partial').decode(),'code':0}).encode()]+ with patch.object(koubo,'api',return_value=Response()):+ with self.assertRaises(SystemExit):koubo.synthesize('text','S_test',out)+ self.assertFalse(out.exists())++ def test_pcm_legacy_output_preserves_samples(self):+ import argparse, base64, math, struct+ samples=b''.join(struct.pack('<h',int(6000*math.sin(i*2*math.pi*440/48000))) for i in range(12000))+ buffer=io.BytesIO()+ with wave.open(buffer,'wb') as f:+ f.setnchannels(1);f.setsampwidth(2);f.setframerate(48000);f.writeframes(samples)+ class Response:+ status_code=200+ def iter_lines(self):+ return [json.dumps({'data':base64.b64encode(buffer.getvalue()).decode(),'code':0}).encode(),b'{"code":20000000}']+ args=argparse.Namespace(mode='clone',voice=None,out=str(self.root/'raw.pcm'),text='test voice',fit=None,match=None,+ match_ss=None,match_t=None,loudness=None,format='pcm',sample_rate=48000,model=None,speech_rate=None,no_fidelity=None,+ allow_cloud=False,allow_paid_api=False)+ with patch.object(c,'resolve',return_value={'status':'configured_unverified','mode':'clone','provider':'volcengine'}),patch.object(koubo,'api',return_value=Response()),patch('sys.stdout',new_callable=io.StringIO):+ c.run_say(args,self.clone_config())+ self.assertEqual(Path(args.out).read_bytes(),samples)+ meta=json.loads(Path(args.out+'.json').read_text())+ self.assertEqual(meta['format'],'s16le');self.assertEqual(meta['channels'],1)+ self.assertAlmostEqual(meta['duration'],.25)++ def test_chinese_uses_installed_voice_only(self):+ result=subprocess.CompletedProcess([],0,'Alex en_US # Hello\nTingting zh_CN # 你好\n','')+ with patch.object(c.subprocess,'run',return_value=result) as run:+ self.assertEqual(c.system_voice_for('中文'),'Tingting')+ self.assertEqual(run.call_args.args[0],['say','-v','?'])+ with patch.object(c.subprocess,'run',return_value=subprocess.CompletedProcess([],0,'Alex en_US # Hello\n','')):+ with self.assertRaises(c.ConfigError):c.system_voice_for('中文')++ def test_near_empty_system_audio_not_delivered(self):+ import argparse+ args=argparse.Namespace(mode='system',voice=None,out=str(self.root/'silent.wav'),text='中文文本',fit=None,match=None,+ match_ss=None,match_t=None,loudness=None,format='wav',sample_rate=48000,model=None,speech_rate=None,no_fidelity=None,+ allow_cloud=False,allow_paid_api=False)+ with patch.object(c,'resolve',return_value={'status':'ready','mode':'system','provider':'macos'}),patch.object(c,'system_voice_for',return_value='Tingting'),patch.object(c.subprocess,'run'),patch.object(c,'inspect_audio',return_value={'duration':.01}),patch.object(koubo,'mean_volume',return_value=-20):+ with self.assertRaises(c.ConfigError):c.run_say(args,self.config)+ self.assertFalse(Path(args.out).exists())+++if __name__=='__main__':unittest.main()diff --git a/tests/test_images.py b/tests/test_images.pynew file mode 100644index 0000000..172b682--- /dev/null+++ b/tests/test_images.py@@ -0,0 +1,154 @@+import copy+import json+from pathlib import Path+import subprocess+import sys+import tempfile+import time+import unittest+from unittest.mock import patch+from PIL import Image++sys.path.insert(0,str(Path(__file__).resolve().parents[1]/'scripts'))+import capabilities as c+import images as im+++class ImageTests(unittest.TestCase):+ def setUp(self):+ self.tmp=tempfile.TemporaryDirectory();self.addCleanup(self.tmp.cleanup);self.root=Path(self.tmp.name)+ self.cfg,_=c.effective(str(self.root/'config.json'))+ self.tool={'id':'current.image','kind':'host','operations':['generate','edit'],'reference_images':True,'transparent_background':True,'cost':'subscription','network':'cloud'}+ self.runtime={'host':'codex','session_id':'session-a','observed_at':time.time(),'tools':[self.tool]}+ self.req={'prompt':'test','operation':'generate','references':[],'transparent_background':True,'min_width':4,'min_height':4}+ self.grants=['image_generation','cloud']+ self.source=self.root/'source.png';Image.new('RGBA',(8,8),(30,40,50,120)).save(self.source)+ self.output=self.root/'project/asset.png';self.plan=self.root/'plan.json';self.receipt=self.root/'receipt.json'++ def prepare(self):+ result=im.make_plan(self.cfg,self.req,self.runtime,'session-a',self.plan,mode='generate',grants=self.grants)+ self.assertEqual(result['status'],'host_action_required')+ data={'status':'success','plan_id':result['plan_id'],'session_id':'session-a','tool_id':self.tool['id'],'output_sha256':im.sha(self.source)}+ self.receipt.write_text(json.dumps(data))++ def accept(self,**kw):+ return im.accept(kw.get('config',self.cfg),self.plan,self.receipt,self.source,self.output,+ kw.get('runtime',self.runtime),kw.get('session','session-a'),self.grants)++ def test_old_profile_does_not_enable_new_capability(self):+ self.cfg['policy'].update(cloud='allow',paid_api='allow')+ self.assertEqual(im.choose(self.cfg,self.runtime)['status'],'needs_configuration')++ def test_deny_cannot_be_bypassed_by_flags(self):+ self.cfg['policy']['image_generation']='deny'+ self.assertEqual(im.choose(self.cfg,self.runtime,self.req,'generate',grants=self.grants)['status'],'blocked')++ def test_empty_runtime_does_not_invent_host_tool(self):+ self.runtime['tools']=[]+ self.assertEqual(im.choose(self.cfg,self.runtime,self.req,'generate',grants=self.grants)['status'],'unavailable')++ def test_multiple_tools_require_selection(self):+ self.runtime['tools'].append(dict(self.tool,id='another.image'))+ self.assertEqual(im.choose(self.cfg,self.runtime,self.req,'generate',grants=self.grants)['status'],'needs_selection')++ def test_features_filter_before_choice(self):+ self.tool['transparent_background']=False+ self.assertEqual(im.choose(self.cfg,self.runtime,self.req,'generate',grants=self.grants)['status'],'unavailable')++ def test_cloud_reference_upload_separate_permission(self):+ self.req['references']=[{'path':str(self.source),'sha256':im.sha(self.source)}]+ r=im.choose(self.cfg,self.runtime,self.req,'generate',grants=self.grants)+ self.assertEqual(r['status'],'needs_permission');self.assertIn('reference_upload',r['candidates'][0]['needs'])++ def test_unknown_price_never_means_free(self):+ self.tool['cost']='unknown'+ r=im.choose(self.cfg,self.runtime,self.req,'generate',grants=self.grants)+ self.assertEqual(r['status'],'needs_permission');self.assertIn('unknown_image_cost',r['candidates'][0]['needs'])++ def test_paid_api_needs_paid_permission(self):+ self.tool['cost']='paid_api'+ self.assertEqual(im.choose(self.cfg,self.runtime,self.req,'generate',grants=self.grants)['status'],'needs_permission')++ def test_stale_or_other_host_snapshot_rejected(self):+ file=self.root/'runtime.json'+ for changes in ({'observed_at':time.time()-901},{'session_id':'other'}):+ file.write_text(json.dumps(dict(self.runtime,**changes)))+ with self.assertRaises(c.ConfigError):im.runtime_tools(file,'session-a')++ def test_success_imports_bytes_and_reports_provenance_limit(self):+ self.prepare();self.accept()+ self.assertEqual(self.source.read_bytes(),self.output.read_bytes())+ meta=json.loads(Path(str(self.output)+'.json').read_text())+ self.assertEqual(meta['provenance'],'agent_reported_tool_call');self.assertTrue(meta['has_transparency'])++ def test_modified_output_receipt_does_not_match(self):+ self.prepare();Image.new('RGB',(8,8),'red').save(self.source)+ with self.assertRaises(c.ConfigError):self.accept()+ self.assertFalse(self.output.exists())++ def test_opaque_output_fails_transparency(self):+ Image.new('RGB',(8,8),'red').save(self.source);self.prepare()+ with self.assertRaises(c.ConfigError):self.accept()++ def test_all_transparent_output_is_not_a_valid_generated_asset(self):+ Image.new('RGBA',(8,8),(0,0,0,0)).save(self.source);self.prepare()+ with self.assertRaises(c.ConfigError):self.accept()++ def test_revoked_permission_or_changed_preference_invalidates_plan(self):+ self.prepare()+ cfg=copy.deepcopy(self.cfg);cfg['preferences']['image']['mode']='off'+ with self.assertRaises(c.ConfigError):self.accept(config=cfg)+ cfg=copy.deepcopy(self.cfg);cfg['policy']['image_generation']='deny'+ with self.assertRaises(c.ConfigError):self.accept(config=cfg)++ def test_changed_host_cannot_reuse_plan(self):+ self.prepare();runtime=copy.deepcopy(self.runtime);runtime['host']='kimi'+ with self.assertRaises(c.ConfigError):self.accept(runtime=runtime)++ def test_missing_tool_cannot_reuse_plan(self):+ self.prepare();runtime=copy.deepcopy(self.runtime);runtime['tools']=[]+ with self.assertRaises(c.ConfigError):self.accept(runtime=runtime)++ def test_different_session_cannot_reuse_plan(self):+ self.prepare()+ with self.assertRaises(c.ConfigError):self.accept(session='different')++ def test_existing_image_never_calls_host(self):+ meta=im.inspect_image(self.source);meta.update(generated=False,mode='existing')+ im.import_artifact(self.source,self.output,meta)+ self.assertEqual(self.source.read_bytes(),self.output.read_bytes())++ def test_no_overwrite_and_matching_extension(self):+ self.prepare();self.accept()+ with self.assertRaises(c.ConfigError):self.accept()+ with self.assertRaises(c.ConfigError):im.import_artifact(self.source,self.root/'wrong.jpg',im.inspect_image(self.source))++ def test_request_reference_relative_to_request_file(self):+ file=self.root/'request.json';file.write_text(json.dumps({'prompt':'test','operation':'edit','references':['source.png']}))+ result=im.request_data(file);self.assertEqual(result['references'][0]['path'],str(self.source.resolve()))++ def test_project_cannot_grant_images(self):+ with self.assertRaises(c.ConfigError):c.project_patch({'policy':{'image_generation':'allow'}})+ c.project_patch({'policy':{'image_generation':'deny'}})++ def test_cli_error_is_structured_not_traceback(self):+ r=subprocess.run([sys.executable,str(c.ROOT/'scripts/capabilities.py'),'use-image','--config',str(self.root/'config.json'),'--file',str(self.root/'missing.png'),'--out',str(self.output)],capture_output=True,text=True)+ self.assertEqual(r.returncode,2);self.assertEqual(json.loads(r.stderr)['status'],'error')+++ def test_single_payload_inspection_rejects_file_swapped_during_decode(self):+ self.prepare()+ original=im.inspect_image+ def race(path):+ info=original(path)+ Image.new('RGB',(1,1),'white').save(path)+ return info+ with patch.object(im,'inspect_image',side_effect=race):+ with self.assertRaises(c.ConfigError):self.accept()+ self.assertFalse(self.output.exists())++ def test_malformed_plan_request_is_structured_error(self):+ self.prepare();data=json.loads(self.plan.read_text());data['request']=None;self.plan.write_text(json.dumps(data))+ with self.assertRaises(c.ConfigError):self.accept()++if __name__=='__main__':unittest.main()diff --git a/tests/test_release.py b/tests/test_release.pynew file mode 100644index 0000000..3e5d651--- /dev/null+++ b/tests/test_release.py@@ -0,0 +1,79 @@+import json+from pathlib import Path+import subprocess+import sys+import tempfile+import unittest++sys.path.insert(0,str(Path(__file__).resolve().parents[1]/'scripts'))+import check_release as gate+++class ReleaseTests(unittest.TestCase):+ def setUp(self):+ self.tmp=tempfile.TemporaryDirectory();self.addCleanup(self.tmp.cleanup);self.repo=Path(self.tmp.name)+ self.git('init','-q');self.git('config','user.name','Fixture');self.git('config','user.email','[email protected]')+ (self.repo/'README.md').write_text('base\n');self.git('add','README.md');self.git('commit','-qm','base')+ self.base=self.git('rev-parse','HEAD').decode().strip()++ def git(self,*args):return gate.git(self.repo,*args)+ def manifest(self):+ (self.repo/gate.MANIFEST).write_text(json.dumps(gate.build_manifest(self.repo)))+ self.git('add',gate.MANIFEST)++ def test_incremental_commit_with_manifest_passes(self):+ (self.repo/'new.py').write_text('print(1)');self.git('add','new.py');self.manifest();self.git('commit','-qm','incremental')+ self.assertEqual(gate.check(self.repo,'HEAD',self.base,'[email protected]')['outgoing_commits_checked'],1)++ def test_stale_manifest_rejected(self):+ self.manifest();(self.repo/'README.md').write_text('changed');self.git('add','README.md')+ with self.assertRaises(ValueError):gate.check(self.repo,'INDEX')++ def test_secret_in_intermediate_commit_rejected(self):+ secret=self.repo/'secret.txt';secret.write_text('ghp_'+'a'*40);self.git('add','secret.txt');self.git('commit','-qm','leak')+ secret.rename(Path(self.tmp.name).parent/(Path(self.tmp.name).name+'-fixture-archive'))+ self.addCleanup(lambda: (Path(self.tmp.name).parent/(Path(self.tmp.name).name+'-fixture-archive')).unlink(missing_ok=True))+ self.git('add','-u');self.manifest();self.git('commit','-qm','remove')+ with self.assertRaisesRegex(ValueError,'凭据'):gate.check(self.repo,'HEAD',self.base)++ def test_private_filename_rejected(self):+ (self.repo/'voices.json').write_text('{}');self.git('add','voices.json')+ with self.assertRaises(ValueError):gate.build_manifest(self.repo)++ def test_symlink_rejected(self):+ try:(self.repo/'link').symlink_to('README.md')+ except OSError:self.skipTest('host cannot create symlinks')+ self.git('add','link')+ with self.assertRaises(ValueError):gate.build_manifest(self.repo)++ def test_real_identity_checked_only_when_requested(self):+ self.manifest();self.git('commit','-qm','release')+ with self.assertRaises(ValueError):gate.check(self.repo,'HEAD',self.base,'[email protected]')++ def test_unstaged_content_not_silently_approved(self):+ (self.repo/'README.md').write_text('unstaged')+ with self.assertRaises(ValueError):gate.build_manifest(self.repo)+++ def test_secret_in_commit_message_is_rejected(self):+ self.manifest();self.git('commit','-qm','message '+'ghp_'+'z'*40)+ with self.assertRaisesRegex(ValueError,'提交元数据'):gate.check(self.repo,'HEAD',self.base)++ def test_replace_object_cannot_hide_secret(self):+ secret=self.repo/'hidden.txt';secret.write_text('ghp_'+'b'*40);self.git('add','hidden.txt');self.git('commit','-qm','leak')+ blob=self.git('rev-parse','HEAD:hidden.txt').decode().strip()+ clean=subprocess.check_output(['git','-C',str(self.repo),'hash-object','-w','--stdin'],input=b'clean').decode().strip()+ self.git('replace',blob,clean)+ with self.assertRaisesRegex(ValueError,'凭据'):gate.inspect(self.repo,'HEAD')+++ def test_secret_in_deleted_filename_is_rejected(self):+ name='ghp_'+'c'*40+ file=self.repo/name;file.write_text('safe');self.git('add',name);self.git('commit','-qm','bad filename')+ archive=Path(self.tmp.name).parent/(Path(self.tmp.name).name+'-filename-archive');file.rename(archive)+ self.addCleanup(lambda: archive.unlink(missing_ok=True))+ self.git('add','-u');self.manifest();self.git('commit','-qm','remove filename')+ with self.assertRaisesRegex(ValueError,'路径名') as error:gate.check(self.repo,'HEAD',self.base)+ self.assertNotIn(name,str(error.exception))++if __name__=='__main__':unittest.main()