@gitruck/cli 1.0.6 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AGENT.md CHANGED
@@ -50,6 +50,26 @@
50
50
  - **例外只有一个**:铺自产物的那几条既有链路(`gtrk matrix` 铺轨、`gtrk mg` 铺颗粒、
51
51
  `gtrk audio` / `gtrk subtitle` 建新轨)—— 它们只动自己新建的东西,不改既有 clip 的时码。
52
52
 
53
+ ## 标定数据落点纪律(全局 MUST · 2026-08-29 立 · tighten-distribution-surface)
54
+
55
+ **新增**的实测标定数据 MUST 写进对应 change 的 `design.md` 附录,MUST NOT 写进代码注释或
56
+ 随包分发的 `skills/*/SKILL.md`。
57
+
58
+ - **什么算标定数据**:写明了**取值理由 / 代价曲线 / 实测分布 / 禁区论证 / 真机实验结论**的内容
59
+ ——即别人据以能省下试错的东西。例如「MUST NOT ≥1.5:槽位 51→53、扰动 26/51、吃进 9 条真实
60
+ 短镜头」「score 集中于 0.1~0.4,0.25+ 已是强命中」「p10=2.12 / p90=4.97」。
61
+ - **什么不算、MUST NOT 迁走**(这三类留在代码里):
62
+ ① **正确性约束**——`MUST NOT` 开头的行为契约、不变量、耦合关系(如「不消耗随机序列」
63
+ 「MUST NOT 复用云端地板的校准假设」「MUST NOT 改吃 candidates 精简集」);
64
+ ② **丑话**——副作用、风险、不对称后果(如「误判 stable 丢检索粒度,误判 unstable 只是不省钱」)。
65
+ 丑话属于「怎么用」,是使用者的决策依据;
66
+ ③ **算法本体**——公式与判定式本身就是代码在做的事,注释是它的可读投影。
67
+ - **代码注释的目标口径**:只讲**是什么 + 怎么用**,不讲**为什么是这个值**。
68
+ - **存量不清洗**(主理人 260829 拍板):既有注释里的标定数据已随公开镜像与 npm 发布出去,
69
+ 删它们保护为零、却净损失维护者上下文,且那两个文件是承重墙密集区、误伤代价高。
70
+ 本纪律**只管新增**。已知的存量标定已在 `tighten-distribution-surface/design.md 附录 A`
71
+ 留档(含「改值前必须知道什么」速查表)——**改那些常量前先读它**。
72
+
53
73
  ---
54
74
 
55
75
  ## 0. 一句话流程
package/README.en.md CHANGED
@@ -8,7 +8,7 @@
8
8
  >
9
9
  > One command turns a raw talking-head recording into an editable, re-cuttable project. The cloud does the heavy lifting, your machine only assembles, and the source video never leaves it.
10
10
 
11
- **🔗 [Website](https://cloud.ai-mcn.tv/zh-CN/cli) · [Tutorial](https://hocassian.feishu.cn/wiki/HCFpwoF7SivIFbkKosgcFMcEnxk) · [Quick start](https://cloud.ai-mcn.tv/zh-CN/docs/quick-start) · [Desktop client](https://cloud.ai-mcn.tv/zh-CN/download) · [npm](https://www.npmjs.com/package/@gitruck/cli) · [User agreement](https://hocassian.feishu.cn/wiki/T6UywR8b3ik4Mgk7tP9c1b7Kn0b) · [Privacy policy](https://hocassian.feishu.cn/wiki/ZLRNwlEhfishYtkosUhcofMYnPf)**
11
+ **🔗 [Website](https://cloud.ai-mcn.tv/zh-CN/cli) · [Tutorial](https://hocassian.feishu.cn/wiki/HCFpwoF7SivIFbkKosgcFMcEnxk) · [Pricing](https://hocassian.feishu.cn/docx/DtendXStMogAbJxAOEmcCyC7n3e) · [Quick start](https://cloud.ai-mcn.tv/zh-CN/docs/quick-start) · [Desktop client](https://cloud.ai-mcn.tv/zh-CN/download) · [npm](https://www.npmjs.com/package/@gitruck/cli) · [User agreement](https://hocassian.feishu.cn/wiki/T6UywR8b3ik4Mgk7tP9c1b7Kn0b) · [Privacy policy](https://hocassian.feishu.cn/wiki/ZLRNwlEhfishYtkosUhcofMYnPf)**
12
12
 
13
13
  ![Put AI creation capabilities into your local agent](assets/gtrk-agent-intro.png)
14
14
 
@@ -27,6 +27,7 @@
27
27
  |---|---|---|
28
28
  | 🎬 | `gtrk oralcut <raw>` | Full talking-head editing loop: emits gtrk + Jianying + Premiere projects in one pass and opens the output folder |
29
29
  | ✂️ | `gtrk long2short <raw>` | Long-to-short loop: semantic segment selection + jump cuts on a long video (optional 720p-proxy smart split-screen) → per-clip gtrk + Jianying + Premiere projects (the raw file is never uploaded). **If you only want a finished cut and will not edit further, use fine-cut** `gtrk tool video_long2short_pro` |
30
+ | ⏱ | Duration cap | For `oralcut` / `long2short`, a source longer than **2 hours is rejected before upload** (nothing is extracted, uploaded or charged). Split it first and run the segments one by one — 40 minutes per segment is the house figure: `ffmpeg -ss 0 -t 2400 -i "<source>" -c copy "<source>_seg01.mp4"` (stream copy, takes seconds) |
30
31
  | 📝 | `gtrk transcript <local video\|voice-over audio>` | Video/audio to transcript: the original file is not uploaded, only the locally extracted (or, for audio input, transcoded) 16 kHz audio derivative, producing one Markdown file with a summary, timecoded record and plain text; with `--json` it also emits a sentence-timecoded `transcript.json` (the input for the `gtrk project init` fallback path) |
31
32
  | 🎵 | `gtrk music-visualizer <audio>` | Music visualization: one song → a spectrum-visualizer video (`--template` required, optional background/cover and template/color styling), with the companion driver skill `gtrk-music-visualizer` |
32
33
  | ✂️ | `gtrk split [split doc]` | Visual split dispatcher: finished cut × transcript projection → validated beat storyboard (`struct_meta.split` + `dispatch.json`), driving four lanes; `--column <id>` validates against your show's vocabulary |
@@ -58,7 +59,7 @@ The CLI calls Gitruck Cloud capabilities, so you need an API key first (it looks
58
59
 
59
60
  > Terms of record: [User agreement for the "OpenCut Gitruck Edition" client and the "gtrk CLI"](https://hocassian.feishu.cn/wiki/T6UywR8b3ik4Mgk7tP9c1b7Kn0b) · [Privacy policy](https://hocassian.feishu.cn/wiki/ZLRNwlEhfishYtkosUhcofMYnPf) — **signing in or completing registration on the website constitutes your acceptance**; when you call cloud capabilities from the CLI, you are the party primarily responsible for the legality of the content you process.
60
61
  >
61
- > Quick-start docs: [cloud.ai-mcn.tv/zh-CN/docs/quick-start](https://cloud.ai-mcn.tv/zh-CN/docs/quick-start) · Business enquiries: business@migotimes.com
62
+ > Quick-start docs: [cloud.ai-mcn.tv/zh-CN/docs/quick-start](https://cloud.ai-mcn.tv/zh-CN/docs/quick-start) · Business enquiries: business@gitruck.com
62
63
 
63
64
  ## Install & first run
64
65
 
@@ -448,6 +449,10 @@ gtrk patch set --project <dir> --track audio:1 --at 3.0 --volume 0.5
448
449
  | `--no-black-bed` | Do not lay the solid black bed track (one is laid by default) | laid by default |
449
450
  | `--force-relay` | Strip and re-lay even when you have already edited a candidate track in the client (by default it refuses and keeps that track) — **this deletes the `broll-raw-*` material registrations of confirmed source clips, orphaning those files on disk** | off |
450
451
  | `--out <file>` | Write ad-hoc results to a file; for `matrix fetch`, the raw-footage output directory (never the Jianying draft folder) | stdout / `./matrix-fetch/` |
452
+ | `--arrange <m>` | **B-roll arrangement route** — **picked automatically by material source; you normally do not pass it**: your own local footage → `cloud` (arranged in the cloud, billed by **arrangement volume**, with an estimate and a confirmation prompt first; `--yes` skips). Material from the asset matrix → `local` (arranged on your machine, not billed, unchanged byte for byte). `shadow` is an observation mode: your machine lays as usual while the cloud runs the same arrangement for comparison only. ⚠️ On the local-footage route `--arrange local` is not accepted (passing it is a parameter error), and if the cloud cannot deliver a result the command **fails outright** instead of quietly switching to a different algorithm. It is **not a way to save credits** either — asset-matrix material is billed for search. Both routes cost something; they just cost it at different steps | picked by material source |
453
+ | `--arrange-qc` | **Arrangement-time QC** (off by default): before anything is laid, check each beat's anchor sentence for whether the picture actually shows what the script says; if not, swap candidates and re-arrange, at most 2 rounds, then deliver and report honestly which lines still do not match. Zero rendering throughout — it replaces the "lay → render → look → re-lay → render again" loop. ⚠️ Judging goes through the material-understanding endpoint and is **billed per frame** (1 frame per anchor sentence per round); an estimate and a confirmation prompt come first (`--yes` skips). Orthogonal to `--arrange`: works on both the local and cloud routes | off |
454
+ | `--arrange-cost-cap <n>` | Hard cap on arrangement volume for a single cloud run: over the cap the server **refuses up front** — zero execution, zero charge (it does not cut off midway). Only meaningful with `--arrange shadow\|cloud` | uncapped |
455
+ | `--arrange-estimate-only` | **Estimate only, do not execute**: stop right at the cloud-arrangement billing confirmation, report the arrangement volume and return **successfully** (`ok:true` + `estimateOnly:true` — that is "I am deciding", not "I declined"). Zero cloud calls, zero changes to the project file. Machine-readable values live in `lay.arrange.units` / `lay.arrange.scale`. ⚠️ What it saves is **that one cloud call and its charge** (plus the candidate downloads and laying that follow), not the whole chain: the denominators of the arrangement volume still require reading the project, the plan, and re-projection. On the asset-matrix route it reports `applicable:false` rather than **0**. When given together with `--yes`, this flag wins | off |
451
456
 
452
457
  **`matrix fetch <clip_id...>` (pull raw footage during the fine cut, project-independent)**: for materials you have **searched with billing** (hits in the grant ledger), re-signs fresh download links for free by clip_id and lands them as `<clip_id>.<ext>` — when the rough cut is already exported to Jianying and one more B-roll is needed, you can pull the raw file locally and drag it straight in without going back to the client app. The flow is always **two-step**: pick clip_ids from `matrix search` → `matrix fetch` to pull (fetch itself is free of charge, performs no search, and has no confirmation gate). **Grants are persistent**: the 24h-expiring signature is no obstacle — a clip searched three days ago still fetches fine. Ungranted items are reported one by one as "not granted" with the way out (run one billed search for that keyword to obtain the grant) and never block the rest; one batch ≤ 500. **The initial scope covers video clip raws only** (the re-sign surface for image/audio materials is not open yet; such ids land in missing with a hint). Outputs never enter `.gtrk` and never land in the Jianying draft folder; material added inside Jianying does not flow back into the project (export is one-way).
453
458
  | `--json` | Machine-readable: stdout carries only the result JSON | off |
package/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
  >
9
9
  > 一条命令,把口播毛片变成可二次精修的剪辑工程。云端做重活,本地只装配,源视频不出本地。
10
10
 
11
- **🔗 [官网](https://cloud.ai-mcn.tv/zh-CN/cli) · [使用教程](https://hocassian.feishu.cn/wiki/HCFpwoF7SivIFbkKosgcFMcEnxk) · [快速开始](https://cloud.ai-mcn.tv/zh-CN/docs/quick-start) · [客户端下载](https://cloud.ai-mcn.tv/zh-CN/download) · [npm](https://www.npmjs.com/package/@gitruck/cli) · [用户协议](https://hocassian.feishu.cn/wiki/T6UywR8b3ik4Mgk7tP9c1b7Kn0b) · [隐私政策](https://hocassian.feishu.cn/wiki/ZLRNwlEhfishYtkosUhcofMYnPf)**
11
+ **🔗 [官网](https://cloud.ai-mcn.tv/zh-CN/cli) · [使用教程](https://hocassian.feishu.cn/wiki/HCFpwoF7SivIFbkKosgcFMcEnxk) · [计费说明](https://hocassian.feishu.cn/docx/DtendXStMogAbJxAOEmcCyC7n3e) · [快速开始](https://cloud.ai-mcn.tv/zh-CN/docs/quick-start) · [客户端下载](https://cloud.ai-mcn.tv/zh-CN/download) · [npm](https://www.npmjs.com/package/@gitruck/cli) · [用户协议](https://hocassian.feishu.cn/wiki/T6UywR8b3ik4Mgk7tP9c1b7Kn0b) · [隐私政策](https://hocassian.feishu.cn/wiki/ZLRNwlEhfishYtkosUhcofMYnPf)**
12
12
 
13
13
  ![把智能创作 AI 能力,装进你的本地 Agent](assets/gtrk-agent-intro.png)
14
14
 
@@ -27,6 +27,7 @@
27
27
  |---|---|---|
28
28
  | 🎬 | `gtrk oralcut <毛片>` | 智能口播剪辑闭环:一次出 gtrk + 剪映 + PR 三方工程,自动打开 |
29
29
  | ✂️ | `gtrk long2short <毛片>` | 长剪短闭环:长视频语义选段+跳剪(可选 720p 代理智能分屏)→ 逐 clip 出 gtrk + 剪映 + PR 三方工程(毛片不上传)。**只要成片、不再二次编辑请走精剪** `gtrk tool video_long2short_pro` |
30
+ | ⏱ | 时长上限 | `oralcut` / `long2short` 的源片 **> 2 小时会在上传前被拦下**(零抽取、零上传、零扣费)。超长源片先分段再逐段跑,建议 40 分钟/段:`ffmpeg -ss 0 -t 2400 -i "<源片>" -c copy "<源片名>_seg01.mp4"`(流拷贝,秒级完成) |
30
31
  | 📝 | `gtrk transcript <本地视频\|配音音频>` | 视频/音频转文字稿:原文件不上传,只传本地抽取(音频输入则转码)的 16k 音频衍生物,生成一个含总结、时码记录和纯文本的 Markdown;`--json` 时另产句级时码 `transcript.json`(`gtrk project init` 兜底路输入) |
31
32
  | 🎵 | `gtrk music-visualizer <音频>` | 音乐可视化:一首歌 → 频谱可视化成片(`--template` 必填 + 可选背景/封面 + 模板/配色样式),配套 driver skill `gtrk-music-visualizer` |
32
33
  | ✂️ | `gtrk split [拆分稿]` | 视觉拆分派单器:成片 × transcript 投影 → beat 分镜校验落地(`struct_meta.split` + `dispatch.json`),驱动四车道派单;`--column <id>` 按栏目词表校验 |
@@ -58,7 +59,7 @@ CLI 要调用同合云云端能力,需先拿一个 API Key(形如 `gc_xxxxxx
58
59
 
59
60
  > 条款正本:[《"OpenCut Gitruck Edition 客户端"与"gtrk CLI"用户协议》](https://hocassian.feishu.cn/wiki/T6UywR8b3ik4Mgk7tP9c1b7Kn0b) · [隐私政策](https://hocassian.feishu.cn/wiki/ZLRNwlEhfishYtkosUhcofMYnPf) —— 官网**登录或完成注册即代表你已同意**;用 CLI 调用云端能力时,你是所处理内容合法性的第一责任人。
60
61
  >
61
- > 快速开始文档:[cloud.ai-mcn.tv/zh-CN/docs/quick-start](https://cloud.ai-mcn.tv/zh-CN/docs/quick-start) · 对接咨询:business@migotimes.com
62
+ > 快速开始文档:[cloud.ai-mcn.tv/zh-CN/docs/quick-start](https://cloud.ai-mcn.tv/zh-CN/docs/quick-start) · 对接咨询:business@gitruck.com
62
63
 
63
64
  ## 安装 & 快速上手
64
65
 
@@ -440,6 +441,10 @@ gtrk patch set --project <dir> --track audio:1 --at 3.0 --volume 0.5
440
441
  | `--score-floor <f>` | 填充置信度地板:segment score 低于此值不采纳、槽位留空——留空处**露黑底垫轨**(默认铺;除非 `--no-black-bed` 才露主轨)。调高会收缩取材池,整段铺不满即纯黑压口播,调完先看空洞告警 | `0.2` |
441
442
  | `--no-black-bed` | 不铺纯黑底垫轨(默认铺一条) | 默认铺 |
442
443
  | `--force-relay` | 候选轨已被你在客户端编辑过时仍强剥重铺(缺省会拒铺并保留那条轨)——**会删掉已确认原片的 `broll-raw-*` 素材登记、盘上原片成孤儿** | 关 |
444
+ | `--arrange <m>` | **B-roll 编排取数路**,**按素材来源自动定档、一般不用传**:铺你自己电脑里的素材 → `cloud`(编排在云端做,按「编排量」计费,跑前报预估并征求确认,`--yes` 跳过);铺素材矩阵的素材 → `local`(编排仍在本机、不计费,逐字不动)。`shadow` 是观测档:本机照跑照铺轨、云端只对拍不采纳。⚠️ 本地素材路上 `--arrange local` 不受理(传了报参数错);云端拿不到产物时**直接报错**,不会悄悄换算法把活干完 | 按素材来源自动 |
445
+ | `--arrange-qc` | **编排期质检**(缺省关):落轨**之前**就查每个 beat 的卡点句「画面有没有给到稿子说的东西」,没给到就换候选重排,最多 2 轮,到限即交付并如实登记还差哪几句。全程零渲染——替代「铺完 → 渲 → 看 → 重铺 → 再渲」那两轮。⚠️ 判定走素材理解口、**按帧计费**(每个卡点句 1 帧/轮,命中判定缓存的不重复计费),跑前报预估并征求确认(`--yes` 跳过)。与 `--arrange` 正交:本机档与云端档都能开 | 关 |
446
+ | `--arrange-cost-cap <n>` | 云端编排单次编排量上限:超限服务端**前置拒绝**、零执行零计费(不是跑到一半掐断)。只在 `--arrange shadow\|cloud` 时有意义 | 不限 |
447
+ | `--arrange-estimate-only` | **只要预估不要执行**:走到云端编排的计价确认那一步就停,报出编排量后**成功**返回(`ok:true` + `estimateOnly:true`——那是「我在做决定」,不是「我拒绝了」),零云端调用、工程文件零改动。机读值在 `lay.arrange.units` / `lay.arrange.scale`。⚠️ 它省的是**云端那一次调用与其计费**(以及其后的候选下载与落轨),不是整条链:编排量的分母本来就要读工程、读 plan、做重投影才算得出。素材矩阵路报 `applicable:false` 而**不是 0**。与 `--yes` 同给时以本开关为准 | 关 |
443
448
  | `--out <file>` | ad-hoc 模式结果落文件;`matrix fetch` 原片落盘目录(绝不写剪映草稿目录) | stdout / `./matrix-fetch/` |
444
449
  | `--json` | 机读:stdout 只输出结果 JSON | 关 |
445
450
 
@@ -447,6 +452,31 @@ gtrk patch set --project <dir> --track audio:1 --at 3.0 --volume 0.5
447
452
 
448
453
  > **beat 窗口现场重投影**:派单消费模式在**发起第一次云端检索之前**,用「`transcript` × 当刻 `.gtrk`」重算每个 beat 的 `[track_st, track_ed]`,检索、`broll-plan.json` 与铺轨一律以重算值为准(`--lay 0` 同守;ad-hoc `search` 不受影响)。`dispatch.json` 里的时码只是**投影时刻快照**,仅在重投影不可行时兜底——**所以改完口播轨直接跑本命令即可,不必先重跑 `gtrk split`**。`--json` 恒出 `reprojection:{mode,degraded,reason?,drifted,max_offset,shrunk,dropped}`;重投影后**零存活**的 beat 会被跳过(不为它烧检索配额、也不铺)。重投影不可行(transcript 缺失 / 工程定位不到 / 主轨查不到口播素材)→ **降级用快照 + 告警 + `--json` 标注**,检索与 plan 照产、不硬崩;非 v1 工程的既有行为不变(plan 先落盘、随后版本门非 0 退出)。
449
454
  >
455
+ > **云端编排(`--arrange`)**:B-roll 的**编排决策**(哪一颗放哪、切多长、从素材的哪一段取)可以交给云端跑。
456
+ > 适用面只有一条:**本地素材上轨铺排**。素材库 / 普通素材 / 概念素材那些的匹配与铺排原来什么样、以后还什么样,
457
+ > 一个字节都不变。
458
+ >
459
+ > **不带这个参数时按素材来源自动定档**:铺你自己电脑里的素材走 `cloud`,铺素材库那些走 `local`。
460
+ > 本地素材的编排算法只在服务端迭代——改进当天生效,你不必升级客户端。
461
+ >
462
+ > ⚠️ **代价先说在前面**:本地素材的编排**只在云端完成**。云端拿不到产物(连不上 / 被拒 /
463
+ > 产物不合规)就**直接报错**,不会悄悄改用另一套算法把活干完——那会给你一份和云端不同的结果
464
+ > 而你并不知情。这条路上 `--arrange local` 不受理(传了会报参数错)。
465
+ >
466
+ > 跑前的用量确认你要是说「不跑」,**这一步就不做**(整轮铺轨中止,工程一个字节没动、plan 照常可用,随时可改主意重跑),
467
+ > 而不是换个便宜办法替你做完。
468
+ >
469
+ > ⚠️ **它不是省钱开关**:用素材矩阵的素材同样要付检索费。**两条路都要花钱,只是花在不同环节**——
470
+ > 自己的素材付编排费,矩阵素材付检索费(矩阵成员的检索是 0)。
471
+ >
472
+ > `shadow` 是观测档:本机照跑照铺轨、云端只跑一遍做对拍(**不切流**,产物仍用本机的),它不受上面那条报错规则影响。
473
+ >
474
+ > 云端两档按新计量维度**编排量**计费——要配画面的段落越多、每段候选素材越多、铺的候选轨越多就越贵。
475
+ > 跑前会报预估并征求确认,`--yes` 跳过、`--arrange-cost-cap` 设本次上限(超限**前置拒绝**,零执行零计费)。
476
+ > 完整计费口径(含既有的额度包 / 余额、阶梯价与免费档)见 **[计费说明](https://hocassian.feishu.cn/docx/DtendXStMogAbJxAOEmcCyC7n3e)**。
477
+ > ⚠️ 预估值只供双端一致性校验,**实际计费恒以服务端复算值为准**;两值不一致时服务端会拒绝执行且不计费。
478
+ > 上行的只有决策要读的字段——素材绝对路径、签名 URL、画面描述文本、派单负词、口播原文整句一律**不出你的机器**。
479
+ >
450
480
  > 候选的 `preview_url`/`cover_url` **不带签名、不会过期**(本地代理落盘后一律复用);带签名约 24h 过期的是**原片 `url`**,由客户端「确认原片」链路重签——**不必为「重签」重跑本命令**。
451
481
  >
452
482
  > **重跑会剥旧重铺,但不碰你改过的轨**:候选轨的身份按「素材前缀 + 上一轮登记指纹」认,不再认轨号(客户端保存会把 overlay 轨整体重编号)。一旦某条候选轨被判定「你编辑过」(改过 clip,或在客户端确认过原片使 material 变成 `broll-raw-*`),本次**整体不铺**:不剥任何轨、不追加新轨、`.gtrk` 逐字节不变,`broll-plan.json` 照常产出,命令给出「哪条轨 / 什么证据 / 下一步」并以非 0 退出码结束(`--json` 出 `{ok:false, refused:[…]}`)。要强行重铺加 `--force-relay`。