@kevlns/u-cli-mod 0.2.3 → 0.3.0

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/AGENTS.md CHANGED
@@ -13,11 +13,11 @@
13
13
  - `u-cli-mod setup <project>` - CLI + 适配包一键就绪(推荐首次入口)
14
14
  - `u-cli-mod pipeline install <project> --dry-run` - 安装预览(不写入工程)
15
15
  - `u-cli-mod pipeline install <project>` - 事务式安装适配包(自动备份/回滚/receipt)
16
- - `u-cli-mod exec <project> -- <pipeline-args>` - 执行 Pipeline 命令(工具统一绑定 `--project-path`)
17
- - Pipeline 命令全集见文末「Pipeline 工具清单」(适配版 `com.unity.pipeline` 共 154 个命令,按领域分组)
18
- - `u-cli-mod exec <project> [--wait <秒>] -- <pipeline-args>` - 长任务默认 5s 后让出控制权,结果用对应的 `command <name>_status` 轮询
16
+ - `u-cli-mod exec <project> [--wait <秒>] -- <pipeline-args>` - 执行 Pipeline 命令(工具统一绑定 `--project-path`);长任务(`run_tests`)默认 5s 后让出控制权,结果用对应的 `command <name>_status` 轮询
19
17
  - `u-cli-mod routes` / `u-cli-mod cache clean` - 路由表 / 缓存清理
20
18
 
19
+ Pipeline 命令全集见文末「Pipeline 工具清单」(适配版 `com.unity.pipeline`,按领域分组)。
20
+
21
21
  ## 使用规范(Agent 必须遵守)
22
22
 
23
23
  1. **首次对某工程执行 `exec` 前**,必须检查 `doctor` 的 `cli.state="valid"`、`pipeline.state="current"` 且 `pipeline.installed=true`。`doctor` 退出成功仅表示诊断完成,不代表工程已就绪;`pipeline.present=true` 也只表示包存在。`missing` 时先跑 `setup`;`outdated`/`invalid` 时先关闭目标 Editor,再通过 `pipeline install <project> --force` 备份并更新。升级 npm 包不会自动更新工程内适配包,不要直接 `exec`。
@@ -27,8 +27,9 @@
27
27
  5. **版本路由是精确匹配**(`m_EditorVersion` + revision 同时一致),没有"就近版本"回退;工程版本不在路由表内时如实报告支持列表,不得猜测、不得改写 `ProjectVersion.txt`。
28
28
  6. `exec` 每次调用前都会重新校验 CLI 哈希(防篡改),属正常行为;校验失败按提示跑 `u-cli-mod cli install --force` 修复即可。
29
29
  7. **读取 Editor 当前 Console 首选 `command read_console`**,`get_console_logs` 是兼容别名;`command console` 读取回调捕获流,适合 `since`/cursor 跟随,但不能代替原生 Console 快照。工具必须经 `command <名>` 调用。若实际 schema 中缺少 `read_console`,先检查 `doctor` 的 `patchVersion`/`installedPatchVersion` 和 `state`,不要将其误认成 `console` 的别名。
30
+ 8. **全量测试必须走 `--async_tests`**:Unity CLI 对同步命令有 30 秒硬性等待上限(`--timeout` 无法延长),同步 `run_tests` 全量必然超时且不入 `test_status` 跟踪。用法:`run_tests --mode EditMode --async_tests`(立即返回)→ 轮询 `test_status` 至 `completed` 拿完整 Summary;小范围用 `--filter` 缩到单命名空间/类,可直接同步等待拿 Summary。
31
+ 9. **任务身份(patchVersion 3)**:`run_tests --async_tests` 的响应含 `RunId`;`test_status --run_id <id>` 只返回该次运行的记录(不存在/被顶替时返回 `unknown_run`,**绝不回退最近一次**);`cancel_tests --run_id <id>` 定向取消(不匹配或无活动运行返回 `unknown_run`/`no_active_run` 且零副作用)。`recompile` 响应含 `runId`,`recompile_status --run_id <id>` 同语义(引擎自发编译的终态 `runId` 为 null,按 id 查询即 `unknown_run`)。连续两次 `run_tests` 会顶替旧运行的追踪槽位——旧 id 的查询会得到 `unknown_run` 而不是新运行的报告。已知限制:`recompile` 连发时后发 runId 会覆盖 pending id,前一编译批次的引擎事件终态记在后发 id 名下(旧 id 查询 `unknown_run` 正确拒绝);legacy 无参 `cancel_tests` 保持原行为(会覆写最近一次状态记录)。
30
32
 
31
- 8. **全量测试必须走 `--async_tests`**:Unity CLI 对同步命令有 30 秒硬性等待上限(`--timeout` 无法延长),同步 `run_tests` 全量必然超时且不入 `test_status` 跟踪。全量:`run_tests --mode EditMode --async_tests`(立即返回)→ 轮询 `test_status` 至 `completed` 拿完整 Summary;小范围用 `--filter` 缩到单命名空间/类,可直接同步等待拿 Summary。
32
33
  ## 典型流程
33
34
 
34
35
  ```bash
@@ -40,7 +41,9 @@ u-cli-mod exec <project> -- command run_tests --mode EditMode --async_tests
40
41
  u-cli-mod exec <project> -- command read_console --types error,warning --count 100
41
42
  ```
42
43
 
43
- `doctor.pipeline` 的 `patchVersion` 为当前路由要求的补丁版本,`installedPatchVersion` 为 receipt 记录的版本(旧 receipt 也兼容,未知为 null);`state` 为 `missing | outdated | invalid | current`。完整 expected-tree 校验通过即返回 `installed=true` / `current`,不因 receipt 缺失或陈旧要求重装。`verification` 列出内容不匹配、校验错误及仅行尾差异的文件。已安装 UTF-8 文本允许 LF/CRLF 等价,其他内容及二进制仍严格校验;生成源与 staging 保持字节级校验,新生成文本统一 LF。`sourceReady=false` 仅表示生成缓存需重建,不代表已安装包失效。
44
+ ### doctor 输出要点
45
+
46
+ `doctor.pipeline` 的 `patchVersion` 为当前路由要求的补丁版本,`installedPatchVersion` 为 receipt 记录的版本(缺失或未知为 null);`state` 为 `missing | outdated | invalid | current`。完整 expected-tree 校验通过即返回 `installed=true` / `current`,receipt 缺失或陈旧不触发重装。`verification` 列出内容不匹配、校验错误及仅行尾差异的文件。已安装 UTF-8 文本允许 LF/CRLF 等价,其他内容及二进制仍严格校验;生成源与 staging 保持字节级校验,新生成文本统一 LF。`sourceReady=false` 仅表示生成缓存需重建,不代表已安装包失效。
44
47
 
45
48
  ## Pipeline 工具清单
46
49
 
@@ -111,7 +114,7 @@ u-cli-mod exec <project> -- command read_console --types error,warning --count 1
111
114
  - `get_serialized_fields` — Read serialized fields of a component/asset. Returns each top-level field's name, type and value (object references are returned as re-usable handles). Pass 'field' to read a single SerializedProperty path.
112
115
  - `hotreload_status` — Show current hot reload registry status and statistics
113
116
  - `recompile` — Force a script recompile (works while unfocused/minimized). Poll recompile_status for completion.
114
- - `recompile_status` — Get the status of the last recompile: idle | triggered | compiling | completed | up_to_date.
117
+ - `recompile_status` — Get the status of the last recompile: idle | triggered | compiling | completed | up_to_date (optional run_id for correlated query).
115
118
  - `reload_file` — Compile and apply in-place [HotReload] edits from a source file
116
119
  - `reload_file_override` — Compile and apply hot reload file changes immediately
117
120
  - `set_serialized_field` — Set a serialized field on a component/asset. Supports primitives, enums, Vector/Color/Rect/Bounds, object references (value = an ObjectRef: asset by guid/fileId/path or scene object by instanceId/hierarchyPath), and array elements via 'name.Array.data[i]' (or 'name.Array.size' to resize).
@@ -151,10 +154,10 @@ u-cli-mod exec <project> -- command read_console --types error,warning --count 1
151
154
  - `package_status` — Status of the last async package operation (add/remove/resolve): idle | in_progress | completed | failed, with the added package, manifest, and any error.
152
155
 
153
156
  ### 测试
154
- - `cancel_tests` — Cancel running test execution
157
+ - `cancel_tests` — Cancel running test execution (optional run_id for directed cancel; mismatch = no side effects)
155
158
  - `list_tests` — List all available tests (EditMode and/or PlayMode) without running them
156
159
  - `run_tests` — Execute Unity tests with filtering options
157
- - `test_status` — Get status of running async test execution
160
+ - `test_status` — Get status of running async test execution (optional run_id for correlated query; unknown_run otherwise)
158
161
 
159
162
  ### 烘焙(光照 / NavMesh / 遮挡)
160
163
  - `bake_lighting` — Trigger an async lightmap bake of the open scene(s) via Lightmapping.BakeAsync(). Returns immediately; poll lighting_bake_status until completed.
package/README.md CHANGED
@@ -106,9 +106,9 @@ u-cli-mod cache clean
106
106
  5. 事务式安装到 `Packages/com.unity.pipeline`:staging → 校验 → 备份 → 替换 → 再校验 → receipt;任一步失败自动回滚。运行中的 Unity Editor 会 fail-closed 阻止安装。
107
107
  6. `exec` 每次调用前重新校验 CLI 哈希,并**禁止任何 `--project-path` 变体覆盖目标工程**。
108
108
 
109
- > **缓存目录说明**:用户缓存默认为 `%LOCALAPPDATA%\editor-pipeline-cli`;该目录名沿用历史名称,以避免破坏已通过验证的缓存/收据契约。工程内的安装事务目录 `Library/editor-pipeline-cli` 同理保留。这两个目录名与 npm 包名 `@kevlns/u-cli-mod` 无关,属于兼容性保留项。
109
+ > **缓存目录说明**:用户缓存固定为 `%LOCALAPPDATA%\editor-pipeline-cli`,工程内的安装事务目录固定为 `Library/editor-pipeline-cli`。两个目录名是缓存与 receipt 契约的一部分,不随 npm 包名(`@kevlns/u-cli-mod`)变化;改名会使既有缓存与 receipt 失效。
110
110
 
111
- ## 本仓库/包 与 不包含
111
+ ## 包内容与分发边界
112
112
 
113
113
  - ✅ 只包含本工具自己的 TypeScript 代码、版本路由元数据与哈希清单。
114
114
  - ✅ Unity CLI 与 `com.unity.pipeline` 在**运行时**从 Unity 官方地址下载到**用户缓存**。
@@ -121,9 +121,9 @@ u-cli-mod cache clean
121
121
 
122
122
  ```bash
123
123
  npm run check # build + lint + vitest 测试 + pack guard
124
+ ```
124
125
 
125
126
  > 发版除 `npm version` 外,还需同步 tests/scripts 中的版本断言(`cli.test.ts`、`vcli-manifest.test.ts`、`pack-guard.mjs`、`test-package-install.mjs`):grep 旧版本号应为零,再打 tag。
126
- ```
127
127
 
128
128
  `pack:guard` 会执行真实 `npm pack`(含文件清单校验),断言发布包:
129
129
 
@@ -139,7 +139,7 @@ npm run check # build + lint + vitest 测试 + pack guard
139
139
 
140
140
  ### v-cli 插件清单
141
141
 
142
- `v-cli.plugin.json` 随包发布(`package.json` 中 `vCli.manifest` 指向),声明 v-cli 命令 `unity`(平台 win32)与全部公共命令路径、参数、选项、输出与副作用元数据。`tests/vcli-manifest.test.ts` 以 `buildProgram()` 为行为源校验清单:命令树、参数、选项(flags 与描述)、usage 逐项一致,任何 CLI 定义变更未同步清单都会失败。
142
+ `v-cli.plugin.json` 随包发布(`package.json` 中 `vCli.manifest` 指向),声明 v-cli 命令 `unity`(平台 win32)与全部公共命令路径、参数、选项、输出与副作用元数据。`tests/vcli-manifest.test.ts` 以 `buildProgram()` 为行为源校验清单:命令树、参数、选项(flags 与描述)、usage 逐项一致;同一测试还把 AGENTS.md 的 154 条 Pipeline 命令目录与清单逐条互锁——两处任一未同步都会失败。
143
143
 
144
144
  ### 本地 tarball 安装矩阵(三模式验证)
145
145
 
@@ -147,7 +147,7 @@ npm run check # build + lint + vitest 测试 + pack guard
147
147
  npm run test:package
148
148
  ```
149
149
 
150
- 构建真实 tgz,并在本地验证三种消费方式:工程 devDependency(`node_modules/.bin`)、带临时 `--prefix` 的全局安装、`npx --package <本地tgz>`;每种都执行 `u-cli-mod --version` 与 `u-cli-mod routes`。**不会**向任何 registry 发布。报告:`<临时目录>/u-cli-mod-package-test-report.json`(可用 `EPC_PKG_REPORT` 覆盖)。
150
+ 构建真实 tgz,并在本地验证三种消费方式:工程 devDependency(`node_modules/.bin`)、带临时 `--prefix` 的全局安装、`npx --package <本地tgz>`;每种都执行 `u-cli-mod --version` 与 `u-cli-mod routes`。**不会**向任何 registry 发布。报告:`C:/tmp/u-cli-mod-package-test-report.json`(可用 `EPC_PKG_REPORT` 覆盖)。
151
151
 
152
152
  ### 自托管 Runner 与 Unity E2E
153
153
 
@@ -157,30 +157,30 @@ npm run e2e:windows # 完整 Unity E2E(真实下载/转换/编译/命
157
157
  ```
158
158
 
159
159
  - `preflight:runner` 只读,不下载/注册 Runner;结果 JSON 输出到 stdout。
160
- - `e2e:windows` 使用**隔离缓存**(干净环境)或显式复用已验证缓存,创建 `<临时目录>/u-cli-mod-e2e/` 下独立临时工程,全部结束后杀掉它启动的所有 Unity 进程并清理临时工程;报告写入 `<临时目录>/u-cli-mod-e2e-report.json`(分别可用 `EPC_E2E_ROOT`、`EPC_E2E_REPORT` 覆盖)。
160
+ - `e2e:windows` 默认使用隔离缓存(设 `EPC_E2E_FRESH_CACHE=0` 可复用真实用户缓存),在 `C:/tmp/u-cli-mod-e2e/` 下创建独立临时工程,全部结束后杀掉它启动的所有 Unity 进程并清理临时工程;报告写入 `C:/tmp/u-cli-mod-e2e-report.json`(分别可用 `EPC_E2E_ROOT`、`EPC_E2E_REPORT` 覆盖)。
161
161
  - 验收指标:200 次只读调用 100% 成功并记录 P50/P95、`read_console` 原生 Console 历史读取与统一清理、20 轮资源修改、5 次 Domain Reload 首次恢复、强杀重启恢复、双工程显式路由 60 次无误选、运行中 Editor 防护与 `--project-path` 覆盖拒绝。
162
162
 
163
163
  详细说明见 `docs/SELF_HOSTED_RUNNER.md`。
164
164
 
165
165
  ### GitHub Actions
166
166
 
167
- - `.github/workflows/ci.yml`:hosted windows runner 上跑 `npm ci` + `npm run check` + `npm audit --omit=dev` + 禁用扩展名扫描;push/PR 触发。
167
+ - `.github/workflows/ci.yml`:hosted windows runner 上跑 `npm ci` + `npm run check` + `npm audit --omit=dev` + 违禁产物扩展名扫描;push/PR 触发。
168
168
  - `.github/workflows/e2e-windows.yml`:**self-hosted** runner(标签 `self-hosted/windows/unity-2022.3.62f3c1`)上跑 Unity E2E;仅 `workflow_dispatch` 与受保护 `v*` tag 触发,不跑 pull_request,不发布;权限最小化(contents: read);产物 `u-cli-mod-e2e-report`。
169
+ - `.github/workflows/publish.yml`:`v*` tag 触发,GitHub 托管 runner 上以 OIDC Trusted Publisher 短期凭证发布到 npm,不保存长期 NPM_TOKEN。
169
170
 
170
171
  ## Routes
171
172
 
172
173
  | Editor | Revision | CLI | Pipeline | 状态 |
173
174
  |---|---|---|---|---|
174
175
  | `2022.3.62f3c1` | `1623fc0bbb97` | `1.0.0-beta.2` | `0.5.0-exp.1`(适配版) | 已验证(非官方移植) |
175
- | `2022.3.59f1c1` | `6f0f5d6fe989` | `1.0.0-beta.2` | `0.5.0-exp.1`(适配版) | 已验证(非官方移植;同一上游 tgz 与补丁规则,适配载荷与 62f3 逐字节一致,已在 2022.3.59f1c1 编辑器完成真机回归) |
176
+ | `2022.3.59f1c1` | `6f0f5d6fe989` | `1.0.0-beta.2` | `0.5.0-exp.1`(适配版) | 已验证(非官方移植;与 62f3 共用同一上游 tgz 与补丁规则,适配载荷逐字节一致;2022.3.59f1c1 真机回归通过) |
176
177
 
177
- 新增 Editor 版本时必须:新增 `routes/<版本>.json` 与 `routes/expected-tree/<版本>.json`、对应转换模板与补丁规则,并在该版本 Unity 上重新完成编译与回归测试。不得让相近版本复用既有路由。
178
+ 新增 Editor 版本要求:添加 `routes/<版本>.json` 与 `routes/expected-tree/<版本>.json`、对应转换模板与补丁规则,并在该版本 Unity 上完成编译与回归测试;相近版本不得复用既有路由。
178
179
 
179
180
  ## 目录
180
181
 
181
182
  ```text
182
- routes/ 精确版本路由 + expected-tree 哈希清单
183
- routes/expected-tree/ 385 文件 SHA-256 清单(含 Tests.meta)
183
+ routes/ 精确版本路由;expected-tree/ 子目录为 385 文件 SHA-256 清单(含 Tests.meta)
184
184
  templates/ Unity 生成的 .meta 模板(数据,非 Unity 源码)
185
185
  AGENTS.md AI Agent 使用规范(场景/规范/速览)
186
186
  src/ TypeScript 实现
@@ -193,11 +193,12 @@ scripts/ pack-guard / preflight-runner / e2e-windows / test-package-inst
193
193
 
194
194
  kevlns 工具家族共享同一套发布约定(tag 驱动、CI 护栏、MIT)。
195
195
 
196
- | Package | Purpose | Status |
196
+ | Package | Purpose | Version |
197
197
  | --- | --- | --- |
198
- | [`v-cli`](https://github.com/kevlns/v-cli) | 个人工具箱 CLI | v0.2.13 |
198
+ | [`v-cli`](https://github.com/kevlns/v-cli) | 个人工具箱 CLI | v0.2.14 |
199
199
  | [`xlmerge`](https://github.com/kevlns/xlmerge) | Git 中 .xlsx/.xlsm 冲突可视化解决工具 | v2.0.0 |
200
200
  | [`u-cli-mod`](https://github.com/kevlns/u-cli-mod) | Unity 精确版本路由 + CLI + pipeline 包(Windows-first,本仓库) | v0.2.3 |
201
+ | [`figma-to-uprefab`](https://github.com/kevlns/figma-to-uprefab) | Figma 导出、契约校验与 Unity UGUI staging Prefab 构建 | v0.1.1 |
201
202
 
202
203
  ## Compatibility
203
204
 
@@ -210,14 +211,14 @@ kevlns 工具家族共享同一套发布约定(tag 驱动、CI 护栏、MIT)
210
211
 
211
212
  ```bash
212
213
  npm ci
213
- npm run check # build + lint + test + pack:guard 一键
214
+ npm run check # build + lint + vitest 测试 + pack guard
214
215
  ```
215
216
 
216
217
  For bugs and feature requests, use [GitHub Issues](https://github.com/kevlns/u-cli-mod/issues).
217
218
 
218
219
  ## License
219
220
 
220
- 本工具代码为 MIT(见 LICENSE)。运行时下载的 Unity CLI 与 `com.unity.pipeline` 归其各自的 Unity 许可(如 Unity Package Distribution License)约束,不在本仓库/包内分发。本工具与 Unity 无关,非官方项目。
221
+ 本工具代码为 MIT(见 LICENSE)。运行时下载的 Unity CLI 与 `com.unity.pipeline` 归其各自的 Unity 许可(如 Unity Package Distribution License)约束,不在本仓库/包内分发。
221
222
 
222
223
  <div align="center">
223
224
 
@@ -0,0 +1,8 @@
1
+ export declare const testCommandsPatches: Array<[string, string]>;
2
+ export declare function patchTestCommands(bytes: Buffer): Buffer;
3
+ export declare const pipelineTestRunnerPatches: Array<[string, string]>;
4
+ export declare function patchPipelineTestRunner(bytes: Buffer): Buffer;
5
+ export declare const recompileCommandPatches: Array<[string, string]>;
6
+ export declare function patchRecompileCommand(bytes: Buffer): Buffer;
7
+ export declare const testExecutionResponsePatches: Array<[string, string]>;
8
+ export declare function patchTestExecutionResponse(bytes: Buffer): Buffer;
@@ -0,0 +1,591 @@
1
+ import { CliError } from './errors.js';
2
+ /**
3
+ * runId protocol patch (patchVersion 3): cross-domain-reload task identity for
4
+ * the test pipeline and recompile status, consumed by v-cli execution handles.
5
+ *
6
+ * Semantics (design of record: v-cli .vant/docs/spec/phase-a-identity-matrix.md §3):
7
+ * - run_tests --async_tests assigns a runId (GUID "N"), persisted in the request
8
+ * file and echoed in the response (TestExecutionResponse.RunId); every status
9
+ * payload written for that run (completed/error/cancelled) carries the runId.
10
+ * - test_status --run_id <id>: correlated read. Request file with matching id ->
11
+ * running; status file with matching id -> its content; anything else ->
12
+ * {"status":"unknown_run"} — NEVER another run's record, never the latest run.
13
+ * - cancel_tests --run_id <id>: directed cancel. Mismatched or no active run ->
14
+ * {"status":"unknown_run"|"no_active_run"} with ZERO side effects (the status
15
+ * file of another run is never overwritten). Matching id -> current cancel
16
+ * behaviour, with runId recorded in the cancelled payload.
17
+ * - recompile assigns a runId; engine compilation events propagate it to the
18
+ * terminal payload. Engine-spontaneous compiles (no pending command id) write
19
+ * runId:null. recompile_status --run_id mirrors the correlated-read semantics.
20
+ *
21
+ * All patches are exact-anchor string replacements over the pinned upstream
22
+ * bytes; a missing anchor is a hard error (the upstream revision moved), never
23
+ * a silent skip. Output is LF-normalized like the other patches.
24
+ */
25
+ function applyPatches(source, name, sentinel, pairs) {
26
+ let s = source.toString('utf8');
27
+ if (s.includes(sentinel)) {
28
+ // Already patched: idempotent no-op (normalized passthrough).
29
+ return Buffer.from(s.replace(/\r\n/g, '\n'), 'utf8');
30
+ }
31
+ for (const [anchor, replacement] of pairs) {
32
+ if (!s.includes(anchor)) {
33
+ throw new CliError(`${name} 缺少锚点(上游修订已变化?): ${JSON.stringify(anchor.slice(0, 80))}…`);
34
+ }
35
+ s = s.replace(anchor, replacement);
36
+ }
37
+ return Buffer.from(s.replace(/\r\n/g, '\n'), 'utf8');
38
+ }
39
+ export const testCommandsPatches = [
40
+ [
41
+ ` [CliCommand("test_status", "Get status of running async test execution", MainThreadRequired = false, Tags = new[] { "tests" })]
42
+ public static string GetTestStatus()
43
+ {
44
+ var status = PipelineTestRunner.GetTestStatus();
45
+ return status ?? "{\\"status\\":\\"no_tests\\",\\"message\\":\\"No test run in progress\\"}";
46
+ }`,
47
+ ` [CliCommand("test_status", "Get status of running async test execution; optional run_id for correlated query", MainThreadRequired = false, Tags = new[] { "tests" })]
48
+ public static string GetTestStatus(
49
+ [CliArg("run_id", "Optional run id from run_tests --async_tests: return only that run's record; unknown_run otherwise (never another run's record)")] string runId = null)
50
+ {
51
+ var status = PipelineTestRunner.GetTestStatus(string.IsNullOrEmpty(runId) ? null : runId.Trim());
52
+ return status ?? "{\\"status\\":\\"no_tests\\",\\"message\\":\\"No test run in progress\\"}";
53
+ }`,
54
+ ],
55
+ [
56
+ ` [CliCommand("cancel_tests", "Cancel running test execution", MainThreadRequired = true, Tags = new[] { "tests" })]
57
+ public static object CancelTests()
58
+ {
59
+ return PipelineTestRunner.CancelTests();
60
+ }`,
61
+ ` [CliCommand("cancel_tests", "Cancel running test execution; optional run_id for directed cancel (mismatch has no side effects)", MainThreadRequired = true, Tags = new[] { "tests" })]
62
+ public static object CancelTests(
63
+ [CliArg("run_id", "Optional run id to cancel; unknown_run/no_active_run when it is not the active run, leaving everything untouched")] string runId = null)
64
+ {
65
+ return PipelineTestRunner.CancelTests(string.IsNullOrEmpty(runId) ? null : runId.Trim());
66
+ }`,
67
+ ],
68
+ ];
69
+ export function patchTestCommands(bytes) {
70
+ return applyPatches(bytes, 'TestCommands.cs', 'CliArg("run_id"', testCommandsPatches);
71
+ }
72
+ export const pipelineTestRunnerPatches = [
73
+ // 1) request model carries the run id
74
+ [
75
+ ` public bool includeExplicit;
76
+ public bool isSync;
77
+ }`,
78
+ ` public bool includeExplicit;
79
+ public bool isSync;
80
+ public string runId;
81
+ }`,
82
+ ],
83
+ // 2) async start: assign run id, persist it, echo it, thread it through
84
+ [
85
+ ` // Save request to disk (survives domain reloads for PlayMode)
86
+ var request = new TestRequest
87
+ {
88
+ filter = filter,
89
+ filterType = filterType,
90
+ mode = testMode.ToString(),
91
+ includeExplicit = includeExplicit,
92
+ isSync = false
93
+ };
94
+ File.WriteAllText(TestRequestFile, JsonConvert.SerializeObject(request));`,
95
+ ` // Save request to disk (survives domain reloads for PlayMode)
96
+ var runId = Guid.NewGuid().ToString("N");
97
+ var request = new TestRequest
98
+ {
99
+ filter = filter,
100
+ filterType = filterType,
101
+ mode = testMode.ToString(),
102
+ includeExplicit = includeExplicit,
103
+ isSync = false,
104
+ runId = runId
105
+ };
106
+ File.WriteAllText(TestRequestFile, JsonConvert.SerializeObject(request));`,
107
+ ],
108
+ [
109
+ ` StartAsyncTestExecution(testMode, filter, filterType, includeExplicit);`,
110
+ ` StartAsyncTestExecution(testMode, filter, filterType, includeExplicit, runId);`,
111
+ ],
112
+ [
113
+ ` Result = "running",
114
+ StatusPath = TestStatusFile,
115
+ Mode = testMode.ToString(),`,
116
+ ` Result = "running",
117
+ RunId = runId,
118
+ StatusPath = TestStatusFile,
119
+ Mode = testMode.ToString(),`,
120
+ ],
121
+ // 3) async execution thread: run id into every status write
122
+ [
123
+ ` private static void StartAsyncTestExecution(TestMode testMode, string filter, string filterType, bool includeExplicit)
124
+ {`,
125
+ ` private static void StartAsyncTestExecution(TestMode testMode, string filter, string filterType, bool includeExplicit, string runId)
126
+ {`,
127
+ ],
128
+ [
129
+ ` // Async completion: write results for pollers. Set once, never overwritten.
130
+ collector.OnRunFinished = () =>
131
+ {
132
+ WriteCompletedResults(collector);
133
+ RestoreLiveServerIfDisrupted(); // B2: self-heal if a test broke the live server.
134
+ CleanupRequestFile();
135
+ UnregisterCollector(api, collector);
136
+ };`,
137
+ ` // Async completion: write results for pollers. Set once, never overwritten.
138
+ collector.OnRunFinished = () =>
139
+ {
140
+ WriteCompletedResults(collector, runId);
141
+ RestoreLiveServerIfDisrupted(); // B2: self-heal if a test broke the live server.
142
+ CleanupRequestFile();
143
+ UnregisterCollector(api, collector);
144
+ };`,
145
+ ],
146
+ [
147
+ ` if (testNames.Count == 0)
148
+ {
149
+ WriteStatusFile(new
150
+ {
151
+ status = "completed",
152
+ duration = 0.0,
153
+ summary = new { total = 0, passed = 0, failed = 0, skipped = 0, inconclusive = 0 },
154
+ results = new object[0]
155
+ });`,
156
+ ` if (testNames.Count == 0)
157
+ {
158
+ WriteStatusFile(new
159
+ {
160
+ status = "completed",
161
+ runId = runId,
162
+ duration = 0.0,
163
+ summary = new { total = 0, passed = 0, failed = 0, skipped = 0, inconclusive = 0 },
164
+ results = new object[0]
165
+ });`,
166
+ ],
167
+ [
168
+ ` Debug.LogError($"[PipelineTestRunner] Async run setup error: {ex.Message}");
169
+ WriteStatusFile(new { status = "error", message = ex.Message });`,
170
+ ` Debug.LogError($"[PipelineTestRunner] Async run setup error: {ex.Message}");
171
+ WriteStatusFile(new { status = "error", runId = runId, message = ex.Message });`,
172
+ ],
173
+ [
174
+ ` Debug.LogError($"[PipelineTestRunner] Async execution error: {ex.Message}");
175
+ WriteStatusFile(new { status = "error", message = ex.Message });`,
176
+ ` Debug.LogError($"[PipelineTestRunner] Async execution error: {ex.Message}");
177
+ WriteStatusFile(new { status = "error", runId = runId, message = ex.Message });`,
178
+ ],
179
+ // 4) post-reload reattach: recover the run id from the request file
180
+ [
181
+ ` private static void ReattachResultCollector()
182
+ {`,
183
+ ` private static void ReattachResultCollector(string runId)
184
+ {`,
185
+ ],
186
+ [
187
+ ` collector.OnRunFinished = () =>
188
+ {
189
+ WriteCompletedResults(collector);
190
+ RestoreLiveServerIfDisrupted();
191
+ CleanupRequestFile();
192
+ UnregisterCollector(api, collector);
193
+ };`,
194
+ ` collector.OnRunFinished = () =>
195
+ {
196
+ WriteCompletedResults(collector, runId);
197
+ RestoreLiveServerIfDisrupted();
198
+ CleanupRequestFile();
199
+ UnregisterCollector(api, collector);
200
+ };`,
201
+ ],
202
+ [
203
+ ` // We only need to re-register a collector — our previous one did not survive the
204
+ // reload — to capture the resumed run's completion. Runs on the main thread because
205
+ // CheckForPendingTests is invoked via EditorApplication.delayCall.
206
+ ReattachResultCollector();`,
207
+ ` // We only need to re-register a collector — our previous one did not survive the
208
+ // reload — to capture the resumed run's completion. Runs on the main thread because
209
+ // CheckForPendingTests is invoked via EditorApplication.delayCall.
210
+ ReattachResultCollector(request.runId);`,
211
+ ],
212
+ // 5) terminal report carries the run id
213
+ [
214
+ ` private static void WriteCompletedResults(TestResultCollector collector)
215
+ {`,
216
+ ` private static void WriteCompletedResults(TestResultCollector collector, string runId)
217
+ {`,
218
+ ],
219
+ [
220
+ ` var result = new
221
+ {
222
+ status = "completed",
223
+ duration = Math.Round(root.Duration, 2),`,
224
+ ` var result = new
225
+ {
226
+ status = "completed",
227
+ runId = runId,
228
+ duration = Math.Round(root.Duration, 2),`,
229
+ ],
230
+ // 6) correlated status read + helpers
231
+ [
232
+ ` /// <summary>
233
+ /// Get current test status (for async mode polling)
234
+ /// </summary>
235
+ public static string GetTestStatus()
236
+ {
237
+ if (File.Exists(TestStatusFile))
238
+ return File.ReadAllText(TestStatusFile);
239
+ if (File.Exists(TestRequestFile))
240
+ return JsonConvert.SerializeObject(new { status = "running" });
241
+ return null;
242
+ }`,
243
+ ` private class RunIdEnvelope
244
+ {
245
+ public string runId { get; set; }
246
+ }
247
+
248
+ private static string RequestRunId()
249
+ {
250
+ try
251
+ {
252
+ if (!File.Exists(TestRequestFile)) return null;
253
+ var request = JsonConvert.DeserializeObject<TestRequest>(File.ReadAllText(TestRequestFile));
254
+ return string.IsNullOrEmpty(request?.runId) ? null : request.runId;
255
+ }
256
+ catch
257
+ {
258
+ return null;
259
+ }
260
+ }
261
+
262
+ private static string StatusRunId()
263
+ {
264
+ try
265
+ {
266
+ if (!File.Exists(TestStatusFile)) return null;
267
+ var envelope = JsonConvert.DeserializeObject<RunIdEnvelope>(File.ReadAllText(TestStatusFile));
268
+ return string.IsNullOrEmpty(envelope?.runId) ? null : envelope.runId;
269
+ }
270
+ catch
271
+ {
272
+ return null;
273
+ }
274
+ }
275
+
276
+ /// <summary>
277
+ /// Get current test status (for async mode polling). With runId: correlated
278
+ /// read — only the requested run's record is returned; unknown_run otherwise.
279
+ /// </summary>
280
+ public static string GetTestStatus(string runId = null)
281
+ {
282
+ if (runId == null)
283
+ {
284
+ if (File.Exists(TestStatusFile))
285
+ return File.ReadAllText(TestStatusFile);
286
+ if (File.Exists(TestRequestFile))
287
+ return JsonConvert.SerializeObject(new { status = "running" });
288
+ return null;
289
+ }
290
+
291
+ if (File.Exists(TestRequestFile) && RequestRunId() == runId)
292
+ return JsonConvert.SerializeObject(new { status = "running", runId = runId });
293
+
294
+ if (File.Exists(TestStatusFile))
295
+ {
296
+ if (StatusRunId() == runId)
297
+ return File.ReadAllText(TestStatusFile);
298
+ return JsonConvert.SerializeObject(new
299
+ {
300
+ status = "unknown_run",
301
+ requestedRunId = runId,
302
+ message = "Requested run is not the tracked run; refusing to return another run's record."
303
+ });
304
+ }
305
+
306
+ return JsonConvert.SerializeObject(new
307
+ {
308
+ status = "unknown_run",
309
+ requestedRunId = runId,
310
+ message = "No record for the requested run id."
311
+ });
312
+ }`,
313
+ ],
314
+ // 7) error terminal payloads carry the run id (spec: ALL status payloads of a run carry runId)
315
+ [
316
+ ` if (!collector.IsComplete)
317
+ {
318
+ WriteStatusFile(new { status = "error", message = "Tests did not complete" });
319
+ return;
320
+ }`,
321
+ ` if (!collector.IsComplete)
322
+ {
323
+ WriteStatusFile(new { status = "error", runId = runId, message = "Tests did not complete" });
324
+ return;
325
+ }`,
326
+ ],
327
+ [
328
+ ` catch (Exception ex)
329
+ {
330
+ Debug.LogError($"[PipelineTestRunner] Failed to write results: {ex.Message}");
331
+ WriteStatusFile(new { status = "error", message = ex.Message });
332
+ }`,
333
+ ` catch (Exception ex)
334
+ {
335
+ Debug.LogError($"[PipelineTestRunner] Failed to write results: {ex.Message}");
336
+ WriteStatusFile(new { status = "error", runId = runId, message = ex.Message });
337
+ }`,
338
+ ],
339
+ [
340
+ ` catch (Exception ex)
341
+ {
342
+ Debug.LogError($"[PipelineTestRunner] Failed to reattach result collector: {ex.Message}");
343
+ WriteStatusFile(new { status = "error", message = ex.Message });
344
+ CleanupRequestFile();
345
+ UnregisterCollector(api, collector);
346
+ }`,
347
+ ` catch (Exception ex)
348
+ {
349
+ Debug.LogError($"[PipelineTestRunner] Failed to reattach result collector: {ex.Message}");
350
+ WriteStatusFile(new { status = "error", runId = runId, message = ex.Message });
351
+ CleanupRequestFile();
352
+ UnregisterCollector(api, collector);
353
+ }`,
354
+ ],
355
+ // 7) directed cancel: mismatch has zero side effects
356
+ [
357
+ ` public static object CancelTests()
358
+ {
359
+ if (m_ActiveCollector == null && !File.Exists(TestRequestFile) && !File.Exists(TestStatusFile))
360
+ return new { status = "no_tests", message = "No test run in progress." };
361
+
362
+ bool wasPlayMode = false;
363
+ try
364
+ {
365
+ if (File.Exists(TestRequestFile))
366
+ {
367
+ var json = File.ReadAllText(TestRequestFile);
368
+ wasPlayMode = json.Contains("PlayMode");
369
+ }
370
+ }
371
+ catch { }
372
+
373
+ InvalidatePreviousRun();
374
+ WriteStatusFile(new { status = "cancelled", message = "Test run cancelled." });`,
375
+ ` public static object CancelTests(string runId = null)
376
+ {
377
+ var hasActiveRun = File.Exists(TestRequestFile);
378
+ // Read the request file ONCE: the guard and the cancelled payload must agree even if the
379
+ // run completes (and deletes the request file) between the two reads.
380
+ var activeRunId = hasActiveRun ? RequestRunId() : null;
381
+ if (runId != null)
382
+ {
383
+ if (!hasActiveRun)
384
+ return new
385
+ {
386
+ status = "no_active_run",
387
+ requestedRunId = runId,
388
+ message = "No test run in progress; nothing was touched."
389
+ };
390
+ if (activeRunId != runId)
391
+ return new
392
+ {
393
+ status = "unknown_run",
394
+ requestedRunId = runId,
395
+ message = "Requested run is not the active run; no cancellation was performed."
396
+ };
397
+ }
398
+
399
+ if (m_ActiveCollector == null && !File.Exists(TestRequestFile) && !File.Exists(TestStatusFile))
400
+ return new { status = "no_tests", message = "No test run in progress." };
401
+
402
+ bool wasPlayMode = false;
403
+ var cancelledRunId = activeRunId;
404
+ try
405
+ {
406
+ if (File.Exists(TestRequestFile))
407
+ {
408
+ var json = File.ReadAllText(TestRequestFile);
409
+ wasPlayMode = json.Contains("PlayMode");
410
+ }
411
+ }
412
+ catch { }
413
+
414
+ InvalidatePreviousRun();
415
+ WriteStatusFile(new { status = "cancelled", runId = cancelledRunId, message = "Test run cancelled." });`,
416
+ ],
417
+ ];
418
+ export function patchPipelineTestRunner(bytes) {
419
+ return applyPatches(bytes, 'PipelineTestRunner.cs', 'requestedRunId', pipelineTestRunnerPatches);
420
+ }
421
+ export const recompileCommandPatches = [
422
+ // pending command run id survives the trigger->engine-event handoff in-process
423
+ [
424
+ ` static readonly List<string> s_Errors = new List<string>();`,
425
+ ` static readonly List<string> s_Errors = new List<string>();
426
+
427
+ // Run id assigned by the recompile command (patchVersion 3). Engine events
428
+ // propagate it into the terminal payload; engine-spontaneous compiles
429
+ // (no pending id) write runId:null. Never persists across domain reloads —
430
+ // by design: the triggering request cannot survive the reload anyway.
431
+ static string s_PendingRunId;`,
432
+ ],
433
+ [
434
+ ` if (focus)
435
+ s_FocusAction();
436
+
437
+ WriteStatus("triggered", false, null);
438
+
439
+ // Trigger asset import + compilation.
440
+ AssetDatabase.Refresh();
441
+
442
+ if (EditorApplication.isCompiling)
443
+ {
444
+ // compilationStarted has written "compiling"; a domain reload will follow on success.
445
+ return new { status = "compiling", message = "Recompilation started. Poll recompile_status until completed." };
446
+ }
447
+
448
+ // Nothing needed recompilation.
449
+ WriteStatus("up_to_date", false, null);
450
+ return new { status = "up_to_date", message = "No scripts needed recompilation." };`,
451
+ ` if (focus)
452
+ s_FocusAction();
453
+
454
+ var runId = Guid.NewGuid().ToString("N");
455
+ s_PendingRunId = runId;
456
+ WriteStatus("triggered", runId, false, null);
457
+
458
+ // Trigger asset import + compilation.
459
+ AssetDatabase.Refresh();
460
+
461
+ if (EditorApplication.isCompiling)
462
+ {
463
+ // compilationStarted has written "compiling"; a domain reload will follow on success.
464
+ return new { status = "compiling", runId = runId, message = "Recompilation started. Poll recompile_status until completed." };
465
+ }
466
+
467
+ // Nothing needed recompilation. Terminal state reached without engine events:
468
+ // clear the pending id so a later engine-spontaneous compile is NOT attributed to this run.
469
+ WriteStatus("up_to_date", runId, false, null);
470
+ s_PendingRunId = null;
471
+ return new { status = "up_to_date", runId = runId, message = "No scripts needed recompilation." };`,
472
+ ],
473
+ [
474
+ ` [CliCommand("recompile_status", "Get the status of the last recompile: idle | triggered | compiling | completed | up_to_date.", MainThreadRequired = false, Tags = new[] { "scripts/compile" })]
475
+ public static string RecompileStatus()
476
+ {
477
+ if (File.Exists(StatusFile))
478
+ return File.ReadAllText(StatusFile);
479
+ return "{\\"status\\":\\"idle\\"}";
480
+ }`,
481
+ ` private class StatusEnvelope
482
+ {
483
+ public string runId { get; set; }
484
+ }
485
+
486
+ [CliCommand("recompile_status", "Get the status of the last recompile: idle | triggered | compiling | completed | up_to_date; optional run_id for correlated query", MainThreadRequired = false, Tags = new[] { "scripts/compile" })]
487
+ public static string RecompileStatus(
488
+ [CliArg("run_id", "Optional run id from the recompile response: return only that run's terminal payload; unknown_run otherwise (null runId = engine-spontaneous compile)")] string runId = null)
489
+ {
490
+ var requested = string.IsNullOrEmpty(runId) ? null : runId.Trim();
491
+ if (requested == null)
492
+ {
493
+ if (File.Exists(StatusFile))
494
+ return File.ReadAllText(StatusFile);
495
+ return "{\\"status\\":\\"idle\\"}";
496
+ }
497
+
498
+ if (File.Exists(StatusFile))
499
+ {
500
+ string recorded;
501
+ try
502
+ {
503
+ recorded = JsonConvert.DeserializeObject<StatusEnvelope>(File.ReadAllText(StatusFile))?.runId;
504
+ }
505
+ catch
506
+ {
507
+ recorded = null;
508
+ }
509
+ if (recorded == requested)
510
+ return File.ReadAllText(StatusFile);
511
+ return JsonConvert.SerializeObject(new
512
+ {
513
+ status = "unknown_run",
514
+ requestedRunId = requested,
515
+ message = "Recorded compile status belongs to another run (runId mismatch or engine-spontaneous compile); refusing to return it."
516
+ });
517
+ }
518
+
519
+ return JsonConvert.SerializeObject(new
520
+ {
521
+ status = "unknown_run",
522
+ requestedRunId = requested,
523
+ message = "No compile status record for the requested run id."
524
+ });
525
+ }`,
526
+ ],
527
+ [
528
+ ` static void OnCompilationStarted(object _)
529
+ {
530
+ s_Errors.Clear();
531
+ WriteStatus("compiling", false, null);
532
+ }`,
533
+ ` static void OnCompilationStarted(object _)
534
+ {
535
+ s_Errors.Clear();
536
+ WriteStatus("compiling", s_PendingRunId, false, null);
537
+ }`,
538
+ ],
539
+ [
540
+ ` static void OnCompilationFinished(object _)
541
+ {
542
+ // Written before the domain reload, so it persists for pollers after the reload.
543
+ WriteStatus("completed", s_Errors.Count > 0, s_Errors.ToArray());
544
+ }`,
545
+ ` static void OnCompilationFinished(object _)
546
+ {
547
+ // Written before the domain reload, so it persists for pollers after the reload.
548
+ WriteStatus("completed", s_PendingRunId, s_Errors.Count > 0, s_Errors.ToArray());
549
+ s_PendingRunId = null;
550
+ }`,
551
+ ],
552
+ [
553
+ ` static void WriteStatus(string status, bool failed, string[] errors)
554
+ {
555
+ try
556
+ {
557
+ var payload = new { status, failed, errors = errors ?? Array.Empty<string>() };
558
+ File.WriteAllText(StatusFile, JsonConvert.SerializeObject(payload));
559
+ }
560
+ catch (Exception ex)
561
+ {
562
+ Debug.LogError($"[Recompile] Failed to write status file: {ex.Message}");
563
+ }
564
+ }`,
565
+ ` static void WriteStatus(string status, string runId, bool failed, string[] errors)
566
+ {
567
+ try
568
+ {
569
+ var payload = new { status, runId, failed, errors = errors ?? Array.Empty<string>() };
570
+ File.WriteAllText(StatusFile, JsonConvert.SerializeObject(payload));
571
+ }
572
+ catch (Exception ex)
573
+ {
574
+ Debug.LogError($"[Recompile] Failed to write status file: {ex.Message}");
575
+ }
576
+ }`,
577
+ ],
578
+ ];
579
+ export function patchRecompileCommand(bytes) {
580
+ return applyPatches(bytes, 'RecompileCommand.cs', 's_PendingRunId', recompileCommandPatches);
581
+ }
582
+ export const testExecutionResponsePatches = [
583
+ [
584
+ ` public string StatusPath { get; set; } // For async mode`,
585
+ ` public string StatusPath { get; set; } // For async mode
586
+ public string RunId { get; set; } // Async run correlation id (run_tests --async_tests; patchVersion 3)`,
587
+ ],
588
+ ];
589
+ export function patchTestExecutionResponse(bytes) {
590
+ return applyPatches(bytes, 'TestExecutionResponse.cs', 'RunId { get; set; }', testExecutionResponsePatches);
591
+ }
package/dist/transform.js CHANGED
@@ -3,6 +3,7 @@ import { dirname, join, relative, sep } from 'node:path';
3
3
  import { CliError } from './errors.js';
4
4
  import { sha256Buffer, compareTree } from './integrity.js';
5
5
  import { patchConsoleCommands } from './consolePatch.js';
6
+ import { patchPipelineTestRunner, patchRecompileCommand, patchTestCommands, patchTestExecutionResponse, } from './runIdPatch.js';
6
7
  /** Files/dirs present upstream that must NOT ship in the adapted package. */
7
8
  const REMOVE_EXACT = new Set([
8
9
  '.attestation.p7m',
@@ -143,6 +144,18 @@ export async function transformPackage(input) {
143
144
  else if (rel === 'Editor/Commands/Observability/ConsoleCommands.cs') {
144
145
  out = patchConsoleCommands(bytes);
145
146
  }
147
+ else if (rel === 'Editor/Commands/TestCommands.cs') {
148
+ out = patchTestCommands(bytes);
149
+ }
150
+ else if (rel === 'Editor/Testing/PipelineTestRunner.cs') {
151
+ out = patchPipelineTestRunner(bytes);
152
+ }
153
+ else if (rel === 'Editor/Commands/RecompileCommand.cs') {
154
+ out = patchRecompileCommand(bytes);
155
+ }
156
+ else if (rel === 'Runtime/Models/TestExecutionResponse.cs') {
157
+ out = patchTestExecutionResponse(bytes);
158
+ }
146
159
  else if (DLL_META_NAMES.includes(rel.split('/').pop())) {
147
160
  const { guid } = metaBody(bytes);
148
161
  out = Buffer.from(`fileFormatVersion: 2\nguid: ${guid}\n${dllImporterBody}`, 'utf8');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kevlns/u-cli-mod",
3
- "version": "0.2.3",
3
+ "version": "0.3.0",
4
4
  "description": "u-cli-mod: pin exact Unity Editor version routes and install the adapted com.unity.pipeline package for Unity 2022 (Windows-first). Downloads Unity assets at runtime into the user cache; the package itself contains no Unity binaries or package source. Not an official Unity project.",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -21,7 +21,7 @@
21
21
  "expectedTree": "expected-tree/2022.3.59f1c1.json",
22
22
  "templates": "2022.3.59f1c1",
23
23
  "targetUnityVersion": "2022.3",
24
- "patchVersion": 2
24
+ "patchVersion": 3
25
25
  },
26
26
  "status": "unofficial-unity-2022-port",
27
27
  "verifiedBy": "local integration run, 2022.3.62f3c1 (1623fc0bbb97); patchVersion 2 read_console + reload/restart/dual-project E2E re-verified on 2022.3.59f1c1 (6f0f5d6fe989)"
@@ -21,7 +21,7 @@
21
21
  "expectedTree": "expected-tree/2022.3.62f3c1.json",
22
22
  "templates": "2022.3.62f3c1",
23
23
  "targetUnityVersion": "2022.3",
24
- "patchVersion": 2
24
+ "patchVersion": 3
25
25
  },
26
26
  "status": "unofficial-unity-2022-port",
27
27
  "verifiedBy": "patchVersion 2 read_console + compile/reload/restart/dual-project E2E, 2022.3.62f3c1 (1623fc0bbb97)"
@@ -175,7 +175,7 @@
175
175
  "Editor/Commands/ProjectSettings/TagsLayersCommands.cs.meta": "eef560a6e622042304ca873b404d79f68ea551f7cab491ec698016f8d8a51665",
176
176
  "Editor/Commands/ProjectSettings/TimeSettingsCommands.cs": "6f68946f5d5b346ce2ef9797c73315d6cd0cf324b656c3e68ff805ec10d5e15f",
177
177
  "Editor/Commands/ProjectSettings/TimeSettingsCommands.cs.meta": "b06b10750d6947b84f1b466721f5d8462b0539b2d387bc866748d409c207fbdf",
178
- "Editor/Commands/RecompileCommand.cs": "fd6b4a1153e6d79fc153eccebcdb254ef79dfbc621085a0bb2617e744a5b119e",
178
+ "Editor/Commands/RecompileCommand.cs": "3a87f3bf3427cc92a11e6f80bbcf141573464b59883dca847fa0497c54d36295",
179
179
  "Editor/Commands/RecompileCommand.cs.meta": "32ab288b5f782fc815174eef282dcdde5f12293bb3cf2af28f61fa5001ba13af",
180
180
  "Editor/Commands/Scenes.meta": "ced3ecd39d94538d3eb060f4250c152ffbec3ebc931245dd5a8ae9042f12e52b",
181
181
  "Editor/Commands/Scenes/SceneCommands.cs": "3f0abceb468d6f2f97c914a341d00e1bf3154bd05c341b057c61b191b2c503d6",
@@ -195,7 +195,7 @@
195
195
  "Editor/Commands/Scripts/SerializedFieldCommands.cs.meta": "cbaa1805f36da34fd6cf338c2858fcfa5372d2a812c58b6d3965df4683de7aac",
196
196
  "Editor/Commands/Scripts/SerializedPropertyConverter.cs": "b6858675080c0ec0f43c9a6bc3e25d8cedcaaf4cfbb77bf3f082f0a492601644",
197
197
  "Editor/Commands/Scripts/SerializedPropertyConverter.cs.meta": "e18983336196c592427f2eb4f028efd00e4d728fda87a77646daa9409937bdad",
198
- "Editor/Commands/TestCommands.cs": "df201cab0e8649c97486d504f6f644fa944177512c7bf05c5b9ed21c6d8db208",
198
+ "Editor/Commands/TestCommands.cs": "650223ca1e2781a4de635029c3fd9c1179f2f637fc2faeccf5819e503ffa99d5",
199
199
  "Editor/Commands/TestCommands.cs.meta": "5e32a4c4b68289441ef042a28f07c55d038a3b5a414d6711865e06c1f435cf26",
200
200
  "Editor/Console.meta": "1ee017d638ba81c3092743c5fd8dea6d483fe83dd94438dad5c4aaa4fe35739e",
201
201
  "Editor/Console/EditorConsoleCaptureBootstrap.cs": "ae90a080281ae27f687ee52feb346d4b575b7eccfbdc80c7e045b93b8c245250",
@@ -213,7 +213,7 @@
213
213
  "Editor/PipelineTransactionLog.cs": "4ed4984852f0310e53345152e1a43d7c8bd720c77ebba96c72c2f29e062bf999",
214
214
  "Editor/PipelineTransactionLog.cs.meta": "180ce0fcb4df11c241702362f01a0033d71d52312aeff267d8db2601f0667ef6",
215
215
  "Editor/Testing.meta": "d9c0a5fc52394bcbbca86b6111a8ec350a107cc1782a6a63d87774bb0f4874db",
216
- "Editor/Testing/PipelineTestRunner.cs": "a0e4d381cb003731ce9b5c6f0dbc886551bebba4ddf82529cc77b7efa7162ad1",
216
+ "Editor/Testing/PipelineTestRunner.cs": "388b7004da8cb7b0799ab5cb316a6230acc176450a9f130e600caac3213d7f4d",
217
217
  "Editor/Testing/PipelineTestRunner.cs.meta": "6614faa20901d4aa609af03d16a051e8f620835713ac9b5c7adb5c3097caa72d",
218
218
  "Editor/Testing/TestResultCollector.cs": "992980f40155b7a2689445f2198a7a458d802844ae64f86e29ee9e7d7999db83",
219
219
  "Editor/Testing/TestResultCollector.cs.meta": "bdf92a1aad6bf167474a1c37aac2dc769b6aee5029d6545b6732745400de122b",
@@ -330,7 +330,7 @@
330
330
  "Runtime/Models/RuntimeInstanceDescriptor.cs.meta": "9e9081ccf9c95d2da60d50b68a3d412c566a2b013a879613ab5b808cc52c20d4",
331
331
  "Runtime/Models/StatusResponse.cs": "7fa44f6c2d0bd4a224f41e9d106d31b8c9bd0bb4fb6b255d972d6684605c0153",
332
332
  "Runtime/Models/StatusResponse.cs.meta": "f4c3ec0119f65fa2ec1d4c1371f703d5ef460a43225830c36ca284a4183a988b",
333
- "Runtime/Models/TestExecutionResponse.cs": "62ede51b04d7fd57c68edf1745e8892d755671514b8365725c8ff61b0c481d41",
333
+ "Runtime/Models/TestExecutionResponse.cs": "f67e17ce557d3f2a754b0e3500732fb9b6631bd2e38d9c35184ed377ae5ce96b",
334
334
  "Runtime/Models/TestExecutionResponse.cs.meta": "06e885e3dc0c564b1d697f5276b992044916c87067ad286c903ec64746906d77",
335
335
  "Runtime/Models/TestResult.cs": "c8f2fb061d09901653f4ecd4bfec41decfb6d2968004f9f18959259fdb5b1056",
336
336
  "Runtime/Models/TestResult.cs.meta": "f9ab286cd237565a89ece638923c947cf9cb0f1cc9447b9e8a64da1f8a733ae8",
@@ -175,7 +175,7 @@
175
175
  "Editor/Commands/ProjectSettings/TagsLayersCommands.cs.meta": "eef560a6e622042304ca873b404d79f68ea551f7cab491ec698016f8d8a51665",
176
176
  "Editor/Commands/ProjectSettings/TimeSettingsCommands.cs": "6f68946f5d5b346ce2ef9797c73315d6cd0cf324b656c3e68ff805ec10d5e15f",
177
177
  "Editor/Commands/ProjectSettings/TimeSettingsCommands.cs.meta": "b06b10750d6947b84f1b466721f5d8462b0539b2d387bc866748d409c207fbdf",
178
- "Editor/Commands/RecompileCommand.cs": "fd6b4a1153e6d79fc153eccebcdb254ef79dfbc621085a0bb2617e744a5b119e",
178
+ "Editor/Commands/RecompileCommand.cs": "3a87f3bf3427cc92a11e6f80bbcf141573464b59883dca847fa0497c54d36295",
179
179
  "Editor/Commands/RecompileCommand.cs.meta": "32ab288b5f782fc815174eef282dcdde5f12293bb3cf2af28f61fa5001ba13af",
180
180
  "Editor/Commands/Scenes.meta": "ced3ecd39d94538d3eb060f4250c152ffbec3ebc931245dd5a8ae9042f12e52b",
181
181
  "Editor/Commands/Scenes/SceneCommands.cs": "3f0abceb468d6f2f97c914a341d00e1bf3154bd05c341b057c61b191b2c503d6",
@@ -195,7 +195,7 @@
195
195
  "Editor/Commands/Scripts/SerializedFieldCommands.cs.meta": "cbaa1805f36da34fd6cf338c2858fcfa5372d2a812c58b6d3965df4683de7aac",
196
196
  "Editor/Commands/Scripts/SerializedPropertyConverter.cs": "b6858675080c0ec0f43c9a6bc3e25d8cedcaaf4cfbb77bf3f082f0a492601644",
197
197
  "Editor/Commands/Scripts/SerializedPropertyConverter.cs.meta": "e18983336196c592427f2eb4f028efd00e4d728fda87a77646daa9409937bdad",
198
- "Editor/Commands/TestCommands.cs": "df201cab0e8649c97486d504f6f644fa944177512c7bf05c5b9ed21c6d8db208",
198
+ "Editor/Commands/TestCommands.cs": "650223ca1e2781a4de635029c3fd9c1179f2f637fc2faeccf5819e503ffa99d5",
199
199
  "Editor/Commands/TestCommands.cs.meta": "5e32a4c4b68289441ef042a28f07c55d038a3b5a414d6711865e06c1f435cf26",
200
200
  "Editor/Console.meta": "1ee017d638ba81c3092743c5fd8dea6d483fe83dd94438dad5c4aaa4fe35739e",
201
201
  "Editor/Console/EditorConsoleCaptureBootstrap.cs": "ae90a080281ae27f687ee52feb346d4b575b7eccfbdc80c7e045b93b8c245250",
@@ -213,7 +213,7 @@
213
213
  "Editor/PipelineTransactionLog.cs": "4ed4984852f0310e53345152e1a43d7c8bd720c77ebba96c72c2f29e062bf999",
214
214
  "Editor/PipelineTransactionLog.cs.meta": "180ce0fcb4df11c241702362f01a0033d71d52312aeff267d8db2601f0667ef6",
215
215
  "Editor/Testing.meta": "d9c0a5fc52394bcbbca86b6111a8ec350a107cc1782a6a63d87774bb0f4874db",
216
- "Editor/Testing/PipelineTestRunner.cs": "a0e4d381cb003731ce9b5c6f0dbc886551bebba4ddf82529cc77b7efa7162ad1",
216
+ "Editor/Testing/PipelineTestRunner.cs": "388b7004da8cb7b0799ab5cb316a6230acc176450a9f130e600caac3213d7f4d",
217
217
  "Editor/Testing/PipelineTestRunner.cs.meta": "6614faa20901d4aa609af03d16a051e8f620835713ac9b5c7adb5c3097caa72d",
218
218
  "Editor/Testing/TestResultCollector.cs": "992980f40155b7a2689445f2198a7a458d802844ae64f86e29ee9e7d7999db83",
219
219
  "Editor/Testing/TestResultCollector.cs.meta": "bdf92a1aad6bf167474a1c37aac2dc769b6aee5029d6545b6732745400de122b",
@@ -330,7 +330,7 @@
330
330
  "Runtime/Models/RuntimeInstanceDescriptor.cs.meta": "9e9081ccf9c95d2da60d50b68a3d412c566a2b013a879613ab5b808cc52c20d4",
331
331
  "Runtime/Models/StatusResponse.cs": "7fa44f6c2d0bd4a224f41e9d106d31b8c9bd0bb4fb6b255d972d6684605c0153",
332
332
  "Runtime/Models/StatusResponse.cs.meta": "f4c3ec0119f65fa2ec1d4c1371f703d5ef460a43225830c36ca284a4183a988b",
333
- "Runtime/Models/TestExecutionResponse.cs": "62ede51b04d7fd57c68edf1745e8892d755671514b8365725c8ff61b0c481d41",
333
+ "Runtime/Models/TestExecutionResponse.cs": "f67e17ce557d3f2a754b0e3500732fb9b6631bd2e38d9c35184ed377ae5ce96b",
334
334
  "Runtime/Models/TestExecutionResponse.cs.meta": "06e885e3dc0c564b1d697f5276b992044916c87067ad286c903ec64746906d77",
335
335
  "Runtime/Models/TestResult.cs": "c8f2fb061d09901653f4ecd4bfec41decfb6d2968004f9f18959259fdb5b1056",
336
336
  "Runtime/Models/TestResult.cs.meta": "f9ab286cd237565a89ece638923c947cf9cb0f1cc9447b9e8a64da1f8a733ae8",
package/v-cli.plugin.json CHANGED
@@ -349,7 +349,7 @@
349
349
  "get_serialized_fields": "Read serialized fields of a component/asset. Returns each top-level field's name, type and value (object references are returned as re-usable handles). Pass 'field' to read a single SerializedProperty path.",
350
350
  "hotreload_status": "Show current hot reload registry status and statistics",
351
351
  "recompile": "Force a script recompile (works while unfocused/minimized). Poll recompile_status for completion.",
352
- "recompile_status": "Get the status of the last recompile: idle | triggered | compiling | completed | up_to_date.",
352
+ "recompile_status": "Get the status of the last recompile: idle | triggered | compiling | completed | up_to_date (optional run_id for correlated query).",
353
353
  "reload_file": "Compile and apply in-place [HotReload] edits from a source file",
354
354
  "reload_file_override": "Compile and apply hot reload file changes immediately",
355
355
  "set_serialized_field": "Set a serialized field on a component/asset. Supports primitives, enums, Vector/Color/Rect/Bounds, object references (value = an ObjectRef: asset by guid/fileId/path or scene object by instanceId/hierarchyPath), and array elements via 'name.Array.data[i]' (or 'name.Array.size' to resize)."
@@ -401,10 +401,10 @@
401
401
  {
402
402
  "group": "测试",
403
403
  "tools": {
404
- "cancel_tests": "Cancel running test execution",
404
+ "cancel_tests": "Cancel running test execution (optional run_id for directed cancel; mismatch = no side effects)",
405
405
  "list_tests": "List all available tests (EditMode and/or PlayMode) without running them",
406
406
  "run_tests": "Execute Unity tests with filtering options",
407
- "test_status": "Get status of running async test execution"
407
+ "test_status": "Get status of running async test execution (optional run_id for correlated query; unknown_run otherwise)"
408
408
  }
409
409
  },
410
410
  {