Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/delivery-video/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions external_plugins/delivery-video/.codex-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "delivery-video",
"version": "1.4.0",
"description": "Record, render and gate trustworthy delivery demo videos — or defect/feedback report videos — of real, working software: real screen recordings, edge-tts narration, word-synced subtitles and a deterministic quality gate.",
"author": {
"name": "Lumos-789",
"url": "https://github.com/Lumos-789"
},
"homepage": "https://github.com/Lumos-789/delivery-video-plugin",
"repository": "https://github.com/Lumos-789/delivery-video-plugin",
"license": "MIT",
"keywords": [
"delivery",
"demo-video",
"bug-report",
"screen-recording",
"quality-gate",
"dsh"
],
"skills": "./skills/",
"interface": {
"displayName": "Delivery Video",
"shortDescription": "Record and gate delivery demo videos",
"longDescription": "Records real screen sessions of working software, renders narration and word-synced subtitles, and runs a deterministic quality gate before the video is delivered. The same pipeline produces defect/feedback videos with severity and repro/actual chips plus a hashed issue report. No static screenshots, mocks or stale footage.",
"developerName": "Lumos-789",
"category": "Productivity",
"capabilities": [
"Read",
"Write with confirmation"
]
}
}
27 changes: 27 additions & 0 deletions external_plugins/delivery-video/.zcode-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "delivery-video",
"version": "1.4.0",
"description": "Record, render and gate trustworthy delivery demo videos — or defect/feedback report videos — of real, working software: real screen recordings, edge-tts narration, word-synced subtitles and a deterministic quality gate.",
"description_i18n": {
"en": "Record, render and gate trustworthy delivery demo videos — or defect/feedback report videos — of real, working software: real screen recordings, edge-tts narration, word-synced subtitles and a deterministic quality gate.",
"zh-CN": "把真实运行的功能录成可交付的演示视频,或把缺陷录成可追溯的问题反馈视频:真实录屏、edge-tts 旁白、逐字对齐字幕与确定性质量闸,产出 1920x1080 成片与完整证据链。"
},
"author": {
"name": "Lumos-789",
"url": "https://github.com/Lumos-789"
},
"homepage": "https://github.com/Lumos-789/delivery-video-plugin",
"repository": "https://github.com/Lumos-789/delivery-video-plugin",
"license": "MIT",
"keywords": [
"delivery",
"demo-video",
"bug-report",
"screen-recording",
"acceptance",
"quality-gate",
"edge-tts",
"ffmpeg"
],
"skills": "skills"
}
304 changes: 304 additions & 0 deletions external_plugins/delivery-video/CHANGELOG.md

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions external_plugins/delivery-video/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Lumos-789

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
82 changes: 82 additions & 0 deletions external_plugins/delivery-video/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# delivery-video

A skill plugin that turns a feature that **actually runs** into a trustworthy delivery demo video — real screen recordings, synthesized narration, karaoke subtitles, and a deterministic quality gate that refuses to pass a fake or broken demo.

Most "AI demo videos" are stitched from static screenshots, mock pages or stale recordings. This plugin enforces the opposite discipline: every segment must point at a real recording with a traceable time range, the last shot must end on a verified result state, and the artifact must pass hard checks for resolution/FPS/codec, audio presence, loudness, black frames and freeze frames before anything is posted. Bitrate density is reported as an informational notice; the frames are reviewed from the generated `review/` packet and that review is recorded in `visual-critic.json`. The uploaded file is always the gated file, bound by SHA256.

In DeepSeek Harness, the skill is registered in both the Host and each live Agent scope. That lets the installed plugin win over an older same-name copy in `~/.agents/skills`, even when an Agent preset mounts the filesystem skill provider in a nearer layer.

## What it does

1. **Verify first, record second** — the workflow requires evidence that the current version really runs (git SHA, tickets, request IDs) before any recording.
2. **Case-driven structure (recommended)** — for multi-case deliveries the skill suggests listing the acceptance cases first, recording one real run per case, then assembling segments in execution order with a result shot per case. Optional, not a gate.
3. **episode.json recipe** — each shot segment binds one real take + time range + one narration line + optional crop/case chip; a `kind: "card"` segment adds a renderer-made title card for the opening, the closing result or a section break; an episode-level `chips` position (`top-left` by default, `top-right` when the product's own header sits there) keeps the label off what the viewer needs to see.
Set `intent: "feedback"` with an `issue` block to produce a defect report instead of a
delivery: severity and phase chips, a repro-steps overlay, and both `feedback.json` and a
ticket-ready `feedback.generated.md`. The gate report binds the artifact SHA256, the
episode and timeline, a normalized hash of the `feedback.json` fields and the exact
markdown bytes, so `verify_delivery.py` fails when the report was edited after rendering,
or the markdown is missing or was edited after rendering. Copy `examples/feedback-episode.example.json` as a
starting point. The same quality gate applies.
4. **Self-contained renderer** — `render.py` synthesizes every narration via edge-tts first (cached by content, word-boundary clocks), checks every segment's speed before rendering a frame, then times each segment to its narration (0.3x–3x speed is hard-checked, never clamped — out of range fails; anything outside 0.7x–1.5x is called out and disclosed), draws the label chip and karaoke subtitles, concatenates, loudness-normalizes to −14 LUFS, and runs the built-in quality gate. Output: `screen_demo.mp4` (1920×1080, 30fps, h264 with AAC audio — a non-AAC track is a gate warning `E102`, not a failure), `timeline.json`, `delivery.generated.md`, the `review/` packet, `quality_gate/report.json`.
5. **Fail-loud checks** — `preflight.py` runs the checks `render.py` makes before its first frame and prints the timing plan: the structure, intervals, crops, recording evidence and narration lints first, then the check that nothing the render writes is a take, the synthesized narration (cached) with each segment's speed, the video's length and its card share — so `PREFLIGHT=PASS` means the render clears every rule preflight checks (a truncated recording is only found while its frames are read). `render.py` enforces the same checks and refuses to render on any error. `verify_delivery.py` verifies the finished artifact, every gate binding (script, timeline, takes, generated note) and the visual review record.
6. **Attachment gate** — `render.py gate` runs the same hard checks on any mp4 before it goes into a ticket, chat or customer channel; a video rendered by this plugin is already gated by its own render.

## Prerequisites

- `python3` 3.9+
- `ffmpeg` and `ffprobe` on PATH
- `pip install "edge-tts>=7.3.1" Pillow`

`edge-tts` 7.2.8 and older can return HTTP 403 from the upstream endpoint. Use 7.3.1 or newer; the renderer fails early with an upgrade command when the installed version is too old.
Run `preflight.py`, `render.py` and `verify_delivery.py` with the same Python interpreter — preflight synthesizes the narration into the build's cache and render reuses it. Preflight fails early when ffmpeg/ffprobe, Pillow, a supported edge-tts version or a CJK font is missing. When `pip` refuses to install into the system Python (PEP 668), create a venv outside the plugin directory and use its interpreter for all three commands.

Platform setup:

- macOS: `brew install ffmpeg`, then `python3 -m pip install "edge-tts>=7.3.1" Pillow`
- Windows: install FFmpeg with `winget install --id Gyan.FFmpeg -e` (or `choco install ffmpeg`). If `python3` is not available, use `py -3` consistently and run `py -3 -m pip install "edge-tts>=7.3.1" Pillow`
- Linux: install `ffmpeg` and a CJK font such as `fonts-noto-cjk` with your package manager, then install the Python packages

The renderer needs a CJK font for Chinese labels and subtitles. macOS and Windows normally provide one; minimal Linux images often do not, and preflight reports the missing font before rendering.

## Side effects (disclosed for review)

- **Network**: narration synthesis calls the public edge-tts (Microsoft Cognitive Services) endpoint; no other network access.
- **Files**: writes its outputs only inside the build directory you pass in (`tts/` cache, per-segment clips, final mp4, `review/` packet, generated note, gate reports); for `render.py gate` without `--work`, the report goes to a `quality_gate-attachment/` folder next to the gated video; ffmpeg's stderr goes to short-lived temporary files. It never writes `visual-critic.json` and never writes into the plugin directory.
- **Commands**: runs `ffmpeg`/`ffprobe` locally; the skill never uploads, publishes or deletes anything by itself.

## Quick start

Install: `dsh plugin add /path/to/delivery-video-plugin` (DSH bundle). It exposes the skill in `skills/delivery-video/`.

1. Record real takes of the feature with your usual tool (macOS `Cmd+Shift+5`, OBS, or a scripted browser screencast — see the skill's recording reference). For two or more acceptance cases, list them first using `examples/cases.example.md` as a template, then record one real run per case.
2. Create `build/screen_demo-<slug>/episode.json` (copy `examples/episode.example.json`).
3. Run preflight, then render (use `py -3` instead of `python3` on Windows when needed). Preflight synthesizes the narration and prints the timing plan — one line per segment with narration and footage length and the speed, then the video's length and card share — so a passing preflight is followed by a render that clears every rule preflight checks:

```bash
python3 <skill>/scripts/preflight.py build/screen_demo-myfeature
python3 <skill>/scripts/render.py render build/screen_demo-myfeature
```

4. Review the frames: look at `review/sheet_NN.png` and `review/frames/`, complete `review/critic.draft.json` and save it as `visual-critic.json`. For an external delivery a second model or window does this from the packet.
5. Verify the artifact and its evidence chain:

```bash
python3 <skill>/scripts/verify_delivery.py build/screen_demo-myfeature
```

Run the unit tests with:

```bash
python3 -m unittest discover -s tests -v
```

Suggested trial prompt after install: *"用 delivery-video 把这个项目刚完成的功能录成一段 90 秒交付演示视频"* — the skill will walk verification, storyboard, recording guidance, recipe assembly, render and gating.

## Same-name skill copies

ZCode 0.17.x can keep a user-level skill and a plugin skill with the same name. If an older `~/.agents/skills/delivery-video` still exists, the unqualified `/skill delivery-video` command may select that copy. Select `delivery-video:delivery-video` in the composer, or use `/skill delivery-video:delivery-video <task>`, to run the installed plugin.

## License

MIT © Lumos-789
80 changes: 80 additions & 0 deletions external_plugins/delivery-video/README_CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# delivery-video

把**真实运行**的功能做成可信交付演示视频的 skill 插件——真实录屏、合成旁白、逐字对齐字幕,加一道拒绝放过造假或残次演示的确定性质量闸。

大多数「AI 演示视频」是静态截图、mock 页面或旧录屏拼出来的。这个插件强制相反的纪律:每个镜头必须指向一段真实录屏和可追溯的时间区间,最后一镜必须落在已回读验证的结果状态上,成片必须先过硬检查(分辨率/帧率/编码、音轨、响度、黑帧、冻结帧)才允许外发。码率密度会作为信息项保留,关键页面仍需按 1:1 目检。贴出去的文件永远是过闸的那一个文件,用 SHA256 绑定。

在 DeepSeek Harness 中,该 Skill 会同时注册到 Host 与每个 Agent 作用域。因此即使 Agent preset 在更近的文件系统层加载了 Skill,已安装插件仍会优先于 `~/.agents/skills` 里的旧同名副本。

## 它做什么

1. **先验真,再录**——工作流要求先有当前版本真实跑通的版本证据(git SHA、工单、请求 ID),才允许录制。
2. **按用例组织(推荐)**——多 case 交付时,建议先拆一张用例清单,再一个 case 一次真实运行录制,最后按执行顺序拼镜头,每个 case 以自己的结果回读收尾。属使用建议,不做强制校验。
3. **episode.json 配方**——每个录屏片段绑定一段真实原片 + 时间区间 + 一句旁白 + 可选裁切/case 徽标;`kind: "card"` 片段是渲染器生成的标题卡,用于开场、收尾结果或章节分隔;episode 级 `chips` 位置(默认 `top-left`,产品自己的页头在左上角时用 `top-right`)让标签不挡观众要看的内容。
写 `intent: "feedback"` 并添加 `issue` 块即可产出问题反馈视频:严重级别与阶段徽标、
复现步骤浮层、复现/现象片段,以及 `feedback.json` 和可直接贴工单的
`feedback.generated.md`。闸报告同时绑定成片 SHA256、脚本与时间轴、`feedback.json` 字段的归一化哈希
与 markdown 原始字节哈希,渲染后改动报告内容或删除/篡改 markdown 都会被
`verify_delivery.py` 拒绝;质量闸规则不变。可从 `examples/feedback-episode.example.json` 复制起步。
4. **自包含渲染器**——`render.py` 先用 edge-tts 合成全部旁白(按内容缓存,逐字时间钟)并在渲染任何画面之前校验每个片段的时长,再按旁白时长配速(0.3x–3x 变速硬校验,超范围直接失败,绝不自动钳制;0.7x–1.5x 之外会提示并写进说明),绘制标签徽标与逐字高亮字幕,拼接、响度归一到 −14 LUFS,并自动跑内置质量闸。输出:`screen_demo.mp4`(1920×1080、30fps、h264,音轨为 AAC——非 AAC 只会得到闸警告 `E102`,不算失败)、`timeline.json`、`delivery.generated.md`、`review/` 审片包、`quality_gate/report.json`。
5. **Fail-loud 检查**——`preflight.py` 跑 `render.py` 首帧之前的检查并打印排片表:先报结构、区间、裁切、录屏证据与旁白 lint,再核对渲染要写的文件不会覆盖素材,然后合成旁白(有缓存)并逐段给出配速、全片时长与卡片占比——所以 `PREFLIGHT=PASS` 意味着渲染能通过预检查过的每一条规则(截断的录屏要到读帧时才会发现)。`render.py` 强制执行同一套校验,有任何错误就拒绝渲染。`verify_delivery.py` 渲染后核验成片、全部闸绑定(脚本、时间轴、素材、自动说明)与视觉复核记录。
6. **附件闸**——`render.py gate` 对任意 mp4 跑同一套硬检查,贴进工单、群聊或客户渠道之前必须过;本插件渲出的成片已由渲染自带的质量闸过闸,不必再过。

## 前置依赖

- `python3` 3.9+
- PATH 里有 `ffmpeg` 和 `ffprobe`
- `pip install "edge-tts>=7.3.1" Pillow`

`edge-tts` 7.2.8 及更早版本会从上游端点收到 HTTP 403。请使用 7.3.1 或更新版本;版本过低时渲染器会直接失败并给出升级命令。
`preflight.py`、`render.py` 和 `verify_delivery.py` 要用同一个 Python 解释器运行——预检会把旁白合成的结果写进构建目录的缓存,渲染直接复用。预检会在 ffmpeg/ffprobe、Pillow、edge-tts 版本或中文字体不满足要求时直接失败。系统 Python 拒绝 `pip install` 时(PEP 668),在插件目录之外建一个 venv,三条命令都用它的解释器。

不同系统的准备方式:

- macOS:`brew install ffmpeg`,然后执行 `python3 -m pip install "edge-tts>=7.3.1" Pillow`
- Windows:用 `winget install --id Gyan.FFmpeg -e`(或 `choco install ffmpeg`)安装 FFmpeg;如果没有 `python3`,统一改用 `py -3`,并执行 `py -3 -m pip install "edge-tts>=7.3.1" Pillow`
- Linux:用包管理器安装 `ffmpeg` 和中文字体(例如 `fonts-noto-cjk`),再安装 Python 包

渲染器需要中文字体来绘制标签和字幕。macOS 和 Windows 通常自带;精简 Linux 镜像可能没有,预检会在渲染前直接报告字体缺失。

## 副作用披露(审核要求如实说明)

- **网络**:旁白合成调用公共 edge-tts(Microsoft 认知服务)端点;无其他网络访问。
- **文件**:只在你传入的构建目录内写产物(`tts/` 缓存、逐片段文件、成片、`review/` 审片包、自动说明、闸报告);`render.py gate` 不带 `--work` 时,报告写到被检视频旁的 `quality_gate-attachment/` 目录;ffmpeg 的错误输出写入短命的临时文件。不会写 `visual-critic.json`,也不会写插件目录。
- **命令**:本地执行 `ffmpeg`/`ffprobe`;本 skill 自身不上传、不发布、不删除任何东西。

## 快速开始

安装:`dsh plugin add /path/to/delivery-video-plugin`(DSH bundle),会暴露 `skills/delivery-video/` 下的 skill。

1. 用你惯用的工具录真实原片(macOS `Cmd+Shift+5`、OBS,或脚本化浏览器录屏——见 skill 内录制指引)。覆盖两条以上验收用例时,先按 `examples/cases.example.md` 拆清单,再一个 case 录一次真实运行。
2. 创建 `build/screen_demo-<slug>/episode.json`(可复制 `examples/episode.example.json`)。
3. 先预检、再渲染(Windows 没有 `python3` 时改用 `py -3`)。预检会合成旁白并打印排片表——每段一行,给出旁白时长、素材时长与配速,再给出全片时长与卡片占比——所以预检通过后,渲染能通过预检查过的每一条规则:

```bash
python3 <skill>/scripts/preflight.py build/screen_demo-myfeature
python3 <skill>/scripts/render.py render build/screen_demo-myfeature
```

4. 审片:看 `review/sheet_NN.png` 与 `review/frames/`,填好 `review/critic.draft.json` 并另存为 `visual-critic.json`;对外交付时由第二个模型或窗口基于审片包完成。
5. 核验成片与证据链:

```bash
python3 <skill>/scripts/verify_delivery.py build/screen_demo-myfeature
```

单测命令:

```bash
python3 -m unittest discover -s tests -v
```

安装后的试用 prompt:*"用 delivery-video 把这个项目刚完成的功能录成一段 90 秒交付演示视频"*——skill 会带你走完验真、分镜、录制指引、配方组装、渲染与过闸。

## 同名 Skill 副本

ZCode 0.17.x 允许用户级 Skill 和插件 Skill 同名共存。如果本机还保留旧的 `~/.agents/skills/delivery-video`,直接输入 `/skill delivery-video` 可能选中旧副本。请在输入框选择 `delivery-video:delivery-video`,或使用 `/skill delivery-video:delivery-video <任务>` 调用已安装插件。

## 许可

MIT © Lumos-789
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions external_plugins/delivery-video/cordis.patch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- insert:
- id: delivery-video
name: 'delivery-video'
Loading