chengfeng-check-updates
GitHub用于检查并管理剪辑环境相关 Skills 的 Marketplace 更新。通过脚本验证插件版本、校验和及可信来源,在用户确认后执行激活或升级,确保开发环境就绪,不涉及媒体处理本身。
Trigger Scenarios
Install
npx skills add Agentchengfeng/chengfeng-videocut-skills --skill chengfeng-check-updates -g -y
SKILL.md
Frontmatter
{
"name": "chengfeng-check-updates",
"description": "让剪辑环境就绪:检查 Skills 的 Marketplace 更新,并安装\/检查产品 Runtime(doctor 自检、报告缺什么、指引升级)。用户说检查更新、安装剪辑环境、装播放器、检查剪辑环境、剪辑环境就绪了吗、配置转录凭证时使用;不用于剪辑、字幕、画面、导出本身或项目数据迁移。",
"user-invocable": true
}
检查剪辑 Skills 更新
这是支持入口,不触碰 Product Runtime、项目、媒体或 live cache。只允许 Codex 官方 Marketplace 命令处理快照和激活。
[纯 inspect] ------------------------> [不 refresh]
[用户明确说“检查更新”] --> [Git?] --> [官方 marketplace upgrade]
| |
| v
| [可信 ref + checksum?]
| | no | yes
v v v
[local not refreshable] [停止] [compare -> confirm -> add -> reread]
1. 只读 inspect 或用户请求的检查
从当前 Skill 定位脚本,并要求用户指定已配置的 Marketplace 名称:
PLUGIN_ROOT="$(codex plugin list --json | node -e 'let s=""; process.stdin.on("data", c => s += c); process.stdin.on("end", () => { const rows = JSON.parse(s).installed || []; const hit = rows.filter(x => x.enabled && x.name === "chengfeng-videocut" && x.source && x.source.path); if (hit.length !== 1) process.exit(1); process.stdout.write(hit[0].source.path); });')"
test -n "$PLUGIN_ROOT" && test -f "$PLUGIN_ROOT/.codex-plugin/plugin.json" || { echo "chengfeng-videocut enabled plugin root unavailable" >&2; exit 1; }
UPDATE="$PLUGIN_ROOT/scripts/check-plugin-update.cjs"
node "$UPDATE" --marketplace "$marketplaceName" --inspect --json
PLUGIN_ROOT 只来自上面已启用 Plugin 行的 source.path。不要依赖未保证存在的 SKILL_DIR、硬编码开发机路径或用目录搜索猜测安装位置。
--inspect 不 refresh。用户明确说“检查更新”后,才运行:
node "$UPDATE" --marketplace "$marketplaceName" --json
current:报告 current/latest、Marketplace 与已刷新事实。update_available_confirmation_required:展示 installed、available、40-hex immutable commit、publisher SHA-256;停止等用户确认。marketplace_not_refreshable:本地 marketplace 不是远程更新源;不伪造 remote check。update_metadata_untrusted:缺 40-hex immutable commit、发布者包校验和,或 Codex snapshot 中可重算的包清单哈希不一致;裸 semver/tag 不能替代 commit,不下载、不调用plugin add。官方 CLI 没有独立 stage 命令,因此不声称已 stage。- 任何 refresh/parse/version 错误:保留结构化 JSON,停止;不复制目录、不删除 cache。
当前公开 Git 基线缺可用于激活的 immutable provenance 与 publisher checksum 时,正确结果是 update_metadata_untrusted;可见的新提交不是可安装更新。
2. 用户明确确认后才激活
确认必须发生在用户已看见 exact available version、ref 与 checksum 之后:
node "$UPDATE" --marketplace "$marketplaceName" --activate --confirmed \
--expected-version "$shownVersion" --expected-ref "$shownImmutableRef" \
--expected-sha256 "$shownPublisherSha256" --json
脚本通过官方 codex plugin marketplace upgrade 刷新 Git snapshot,重算 snapshot 内候选包的文件清单 SHA-256,并比对三个 --expected-* 值;随后才使用官方 codex plugin add。没有独立 stage:官方 refresh 的 snapshot 是唯一可检查来源。它必须从 plugin add 返回的 installed cache 路径复读 version、immutable ref、publisher SHA-256,并重算同一 inventory digest;Codex list 不含 ref/checksum 时只接受 installed .codex-plugin/update-provenance.json 的可验证来源,缺失即失败。只有四项都等于候选才报告 activated。激活成功后告知用户重启 Codex。
plugin_activation_unsupported 表示官方 CLI 没有原子选择该版本:停止,不删除 cache、复制 sources 或重装 Runtime 模拟升级。
边界
- Plugin 可升至
0.5.1,不等于 Runtime 更新;Runtime 最低兼容/Release 仍由runtime-requirements.json的0.2.0合同控制。 - 不把本地 staging、legacy cache 或 local marketplace 说成 remotely updatable。
- 不发布、不改 Product Runtime、5190、项目数据或媒体;用户确认后官方 Codex activation 是唯一写入例外。
Runtime(播放器):安装与体检
插件更新之外,本 Skill 也是环境的安装与体检入口。用户说「安装剪辑环境 / 装播放器 / 检查环境」时,走这一节即可,不需要先发起剪辑任务。
先读取并执行 Runtime 预检——它定义工具变量、
安装缺失的 Runtime、规定失败处置(含「禁止自制替代界面」禁令)。预检 ready 后跑
完整自检并原样报告:
node "$VC" doctor --json
报告:Runtime 版本与位置、doctor 每项检查结果、缺失项的修法(机器依赖指引安装;
转录凭证指引 node "$VC" config set transcription.apiKey <key>)。
已装 Runtime 低于合同要求版本时:报告两个版本号和差异,指引用户确认后升级
(升级会替换 ~/.chengfeng-videocut/app,项目数据不动);用户未确认前不动现有安装。
这一节不建项目、不打开 Studio、不转录任何媒体。装好后告诉用户:直接说「剪口播」 就能开始。
Version History
- 3e1d6ed Current 2026-08-03 01:37


