@gitruck/cli 1.3.8 → 1.3.9

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.
@@ -175,14 +175,16 @@ function sourceFor(b, T, f) {
175
175
  }
176
176
  /**
177
177
  * 用户覆盖套到颗粒回报的几何上(add-composite-slot-user-overrides,与客户端 `applySlotOverrides` 逐值相同):
178
- * box = 以槽位中心缩放 scale_pm/1000 倍、中心位移舞台宽高的 dx_pm / dy_pm 千分比,圆角同乘缩放;
178
+ * box = 以槽位中心缩放 scale_pm/1000 倍、中心位移 dx_px / dy_px 舞台像素(旧写法 dx_pm / dy_pm 为舞台宽高的千分比),圆角同乘缩放;
179
179
  * crop = 替换颗粒的 data-crop([上, 右, 下, 左] 比例)。
180
180
  */
181
181
  function applySlotOverrides(g, b) {
182
182
  let out = g;
183
183
  if (b.box) {
184
184
  const s = b.box.scale_pm / 1000, w = g.w * s, h = g.h * s;
185
- const cx = g.x + g.w / 2 + (b.box.dx_pm / 1000) * SW, cy = g.y + g.h / 2 + (b.box.dy_pm / 1000) * SH;
185
+ const px = "dx_px" in b.box;
186
+ const dx = px ? b.box.dx_px : (b.box.dx_pm / 1000) * SW, dy = px ? b.box.dy_px : (b.box.dy_pm / 1000) * SH;
187
+ const cx = g.x + g.w / 2 + dx, cy = g.y + g.h / 2 + dy;
186
188
  out = { ...out, x: cx - w / 2, y: cy - h / 2, w, h, radius: (g.radius || 0) * s };
187
189
  }
188
190
  if (b.crop) out = { ...out, crop: [b.crop.t_pm / 1000, b.crop.r_pm / 1000, b.crop.b_pm / 1000, b.crop.l_pm / 1000] };
@@ -529,7 +529,7 @@ gtrk composite bake --abi
529
529
  - **Cache**: the key covers the particle, the computed inputs, material file fingerprints (size + mtime), fps, browser build and encode settings; hits are reused. Changing concurrency does not change the key.
530
530
  - **Frame rate**: defaults to the project rate; `--fps` overrides (e.g. a 30fps export). Frame count = `ceil(window × fps)`, covering the whole window.
531
531
  - **Exit codes**: 0 all succeeded (cache hits included) / 1 some composite failed (the rest still bake; reasons per composite) / 2 argument or environment error / 130 cancelled.
532
- - **Machine-readable**: `--progress jsonl` prints one event per line with `type` in `start` / `browser` / `prep` / `progress` / `composite` / `cancelled` / `done`, at most 1 second apart; in this mode **closing stdin cancels** (other modes ignore stdin). `--abi` prints only `{abi, version, browser, overrides, stage}` without reading the project: `browser.pinned` says whether the pinned render component is installed; `overrides` lists the slot user overrides this version can bake (`fit` / `framing` / `crop` / `box` for the picture-in-picture window size and position / `slip_ms` for shifting a referenced clip's frames), so the client can tell whether the adjustments in a project can be baked; `stage: "canvas"` means any stage size can be baked (the composite stage follows the project canvas, so portrait and square work the same way; older versions without this field only handle 1920×1080). `--input <snapshot> --base <dir>`: use the snapshot as the timeline (for the client's unsaved state); relative material paths and the output location resolve against `--base`; the snapshot is never written back.
532
+ - **Machine-readable**: `--progress jsonl` prints one event per line with `type` in `start` / `browser` / `prep` / `progress` / `composite` / `cancelled` / `done`, at most 1 second apart; in this mode **closing stdin cancels** (other modes ignore stdin). `--abi` prints only `{abi, version, browser, overrides, stage}` without reading the project: `browser.pinned` says whether the pinned render component is installed; `overrides` lists the slot user overrides this version can bake (`fit` / `framing` / `crop` / `box` for the picture-in-picture window size and position / `slip_ms` for shifting a referenced clip's frames; `box_px` means the window's pixel offsets `dx_px` / `dy_px` can be baked), so the client can tell whether the adjustments in a project can be baked; `stage: "canvas"` means any stage size can be baked (the composite stage follows the project canvas, so portrait and square work the same way; older versions without this field only handle 1920×1080). `--input <snapshot> --base <dir>`: use the snapshot as the timeline (for the client's unsaved state); relative material paths and the output location resolve against `--base`; the snapshot is never written back.
533
533
  - `gtrk render` / `gtrk project export` bake the project's composites first: a successfully baked span shows the baked video (in Jianying / Premiere, a video clip on that layer), and **MG / OV particles lying entirely inside a composite window are no longer pre-rendered or billed**; a composite that fails to bake (missing footage, no browser, …) falls back to the rough cut with its reason reported, and never blocks export.
534
534
 
535
535
  ### `gtrk project init` / `gtrk audio lay` / `gtrk audio tighten` — audio-first project atoms (voice-over first)
package/docs/reference.md CHANGED
@@ -562,7 +562,7 @@ gtrk composite bake --abi
562
562
  - **缓存**:键含颗粒、现算输入、素材文件指纹(大小 + 修改时间)、帧率、浏览器版本与编码参数;命中直接复用。改并发不换键。
563
563
  - **帧率**:缺省 = 工程帧率;`--fps` 指定(例如导出 30fps)。帧数 = `ceil(窗口 × fps)`,盖满整个窗口。
564
564
  - **退出码**:0 全部成功(含命中缓存)/ 1 有颗失败(其余照常,逐颗给原因)/ 2 参数或环境错误 / 130 被取消。
565
- - **机读**:`--progress jsonl` 逐行输出 `type` 为 `start` / `browser` / `prep` / `progress` / `composite` / `cancelled` / `done` 的事件,相邻两行不超过 1 秒;此模式下**关闭 stdin 即取消**(其它模式不认 stdin)。`--abi` 只输出 `{abi, version, browser, overrides, stage}`,不读工程:`browser.pinned` 是钉定的渲染组件装没装;`overrides` 是本版能烤出的槽位用户覆盖(`fit` / `framing` / `crop` 裁切 / `box` 画中画窗口大小与位置 / `slip_ms` 引用片段前后挪取帧),客户端据此判断工程里的调整能否烤出;`stage: "canvas"` 表示能烤任意舞台尺寸(合成舞台随工程画布,竖屏、方形同口径;缺这个字段的老版本只认 1920×1080)。`--input <快照> --base <目录>`:以快照为时间线来源(客户端交未保存状态用),相对素材路径与产物落点按 `--base` 解析,快照不回写。
565
+ - **机读**:`--progress jsonl` 逐行输出 `type` 为 `start` / `browser` / `prep` / `progress` / `composite` / `cancelled` / `done` 的事件,相邻两行不超过 1 秒;此模式下**关闭 stdin 即取消**(其它模式不认 stdin)。`--abi` 只输出 `{abi, version, browser, overrides, stage}`,不读工程:`browser.pinned` 是钉定的渲染组件装没装;`overrides` 是本版能烤出的槽位用户覆盖(`fit` / `framing` / `crop` 裁切 / `box` 画中画窗口大小与位置 / `slip_ms` 引用片段前后挪取帧;`box_px` 表示能烤窗口的像素位移 `dx_px` / `dy_px`),客户端据此判断工程里的调整能否烤出;`stage: "canvas"` 表示能烤任意舞台尺寸(合成舞台随工程画布,竖屏、方形同口径;缺这个字段的老版本只认 1920×1080)。`--input <快照> --base <目录>`:以快照为时间线来源(客户端交未保存状态用),相对素材路径与产物落点按 `--base` 解析,快照不回写。
566
566
  - `gtrk render` / `gtrk project export` 会先烘焙工程里的合成颗粒:烘焙成功的那段以烘焙视频出画(剪映 / Pr 里是该层位上的一段视频),**时段整段落在合成窗口内的 MG / OV 不再预渲、不计费**;烘焙失败(素材丢失、找不到浏览器等)的那颗按粗剪出画并点名原因,不拦导出。
567
567
 
568
568
  ### `gtrk project init` / `gtrk audio lay` / `gtrk audio tighten` — 音频驱动工程零件(配音先行)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitruck/cli",
3
- "version": "1.3.8",
3
+ "version": "1.3.9",
4
4
  "description": "同合云成片流水线 CLI —— agent 驱动云端任务、产物拉回本地、三方工程文件(客户端/剪映/PR)互通。",
5
5
  "license": "MIT",
6
6
  "author": "Gitruck (同合云)",