@kevlns/u-cli-mod 0.1.2 → 0.1.4
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 +11 -6
- package/README.md +9 -6
- package/dist/commands/doctor.d.ts +4 -0
- package/dist/commands/doctor.js +61 -5
- package/dist/consolePatch.d.ts +2 -0
- package/dist/consolePatch.js +370 -0
- package/dist/installer.js +1 -0
- package/dist/transform.js +4 -0
- package/package.json +1 -1
- package/routes/2022.3.59f1c1.json +2 -2
- package/routes/2022.3.62f3c1.json +3 -3
- package/routes/expected-tree/2022.3.59f1c1.json +2 -2
- package/routes/expected-tree/2022.3.62f3c1.json +2 -2
- package/v-cli.plugin.json +5 -4
package/AGENTS.md
CHANGED
|
@@ -14,17 +14,18 @@
|
|
|
14
14
|
- `u-cli-mod pipeline install <project> --dry-run` - 安装预览(不写入工程)
|
|
15
15
|
- `u-cli-mod pipeline install <project>` - 事务式安装适配包(自动备份/回滚/receipt)
|
|
16
16
|
- `u-cli-mod exec <project> -- <pipeline-args>` - 执行 Pipeline 命令(工具统一绑定 `--project-path`)
|
|
17
|
-
- Pipeline 命令全集见文末「Pipeline 工具清单」(适配版 `com.unity.pipeline` 共
|
|
17
|
+
- Pipeline 命令全集见文末「Pipeline 工具清单」(适配版 `com.unity.pipeline` 共 154 个命令,按领域分组)
|
|
18
18
|
- `u-cli-mod routes` / `u-cli-mod cache clean` - 路由表 / 缓存清理
|
|
19
19
|
|
|
20
20
|
## 使用规范(Agent 必须遵守)
|
|
21
21
|
|
|
22
|
-
1. **首次对某工程执行 `exec`
|
|
22
|
+
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`。
|
|
23
23
|
2. **禁止在 `exec` 参数中传入任何 `--project-path` 变体**(`-projectPath`、`--project_path`、大小写混合、`=` 形式等)——目标工程由工具统一绑定,传入即报错是预期保护,不要尝试绕过。
|
|
24
24
|
3. **运行中的 Unity Editor 是 fail-closed**:安装被阻止时引导用户先关闭目标工程的 Editor;除非用户显式要求,不得使用 `--allow-running-editor` 绕过。
|
|
25
25
|
4. **安装是事务式的**(staging → 校验 → 备份 → 替换 → 再校验 → receipt,失败自动回滚):不要手动清理工程内 `Packages/com.unity.pipeline` 或 `Library/editor-pipeline-cli`。
|
|
26
26
|
5. **版本路由是精确匹配**(`m_EditorVersion` + revision 同时一致),没有"就近版本"回退;工程版本不在路由表内时如实报告支持列表,不得猜测、不得改写 `ProjectVersion.txt`。
|
|
27
27
|
6. `exec` 每次调用前都会重新校验 CLI 哈希(防篡改),属正常行为;校验失败按提示跑 `u-cli-mod cli install --force` 修复即可。
|
|
28
|
+
7. **读取 Editor 当前 Console 首选 `command read_console`**,`get_console_logs` 是兼容别名;`command console` 读取回调捕获流,适合 `since`/cursor 跟随,但不能代替原生 Console 快照。工具必须经 `command <名>` 调用。若实际 schema 中缺少 `read_console`,先检查 `doctor` 的 `patchVersion`/`installedPatchVersion` 和 `state`,不要将其误认成 `console` 的别名。
|
|
28
29
|
|
|
29
30
|
## 典型流程
|
|
30
31
|
|
|
@@ -32,11 +33,14 @@
|
|
|
32
33
|
u-cli-mod doctor <project> # 1. 体检(只读)
|
|
33
34
|
u-cli-mod setup <project> # 2. 就绪(CLI + 适配包)
|
|
34
35
|
u-cli-mod exec <project> -- command editor_status # 3. 执行
|
|
36
|
+
u-cli-mod exec <project> -- command read_console --types error,warning --count 100
|
|
35
37
|
```
|
|
36
38
|
|
|
39
|
+
`doctor.pipeline` 的 `patchVersion` 为当前路由要求的补丁版本,`installedPatchVersion` 为 receipt 记录的版本(旧 receipt 也兼容,未知为 null);`state` 为 `missing | outdated | invalid | current`。只有完整 expected-tree 校验通过且没有旧 patch receipt 时才返回 `installed=true`;`sourceReady` 同样经过文件树校验。
|
|
40
|
+
|
|
37
41
|
## Pipeline 工具清单
|
|
38
42
|
|
|
39
|
-
> 安装的 `com.unity.pipeline`(适配版 0.5.0-exp.1)共 **
|
|
43
|
+
> 安装的 `com.unity.pipeline`(适配版 0.5.0-exp.1)共 **154** 个命令,经 `u-cli-mod exec <project> -- command <名> [参数]` 透传执行;参数全集以 `exec <project> -- command <名> --help` 为准。
|
|
40
44
|
|
|
41
45
|
### GameObject / 组件
|
|
42
46
|
- `add_component` — Add a component (by type name) to a GameObject.
|
|
@@ -186,9 +190,10 @@ u-cli-mod exec <project> -- command editor_status # 3. 执行
|
|
|
186
190
|
### 可观测性 / 审计
|
|
187
191
|
- `audit` — Run a Project Auditor static-analysis scan. Returns immediately; poll audit_status until status is 'completed', then read the CSV.
|
|
188
192
|
- `audit_status` — Get the status of the last audit: idle | scanning | completed | failed | interrupted | unavailable.
|
|
189
|
-
- `clear_console` — Clear the
|
|
193
|
+
- `clear_console` — Clear the Unity Editor Console and all captured pipeline console buffers.
|
|
190
194
|
- `console` — Get captured Unity console output (Editor or Player; supports tail, level filtering, and follow via a cursor)
|
|
191
|
-
- `get_console_logs` — Read
|
|
195
|
+
- `get_console_logs` — Read the current Unity Editor Console (compatibility alias for read_console).
|
|
196
|
+
- `read_console` — Read or clear the current Unity Editor Console, including entries emitted before command initialization; supports type/text filtering, paging, formatting, and stack traces.
|
|
192
197
|
- `get_performance_stats` — Read render, memory, and frame-timing stats (structured, read-only).
|
|
193
198
|
- `log` — Write a message to Unity console
|
|
194
199
|
|
|
@@ -225,4 +230,4 @@ u-cli-mod exec <project> -- command editor_status # 3. 执行
|
|
|
225
230
|
|
|
226
231
|
### Authoring 根路径
|
|
227
232
|
- `get_authoring_root` — Get the base folder (under Assets/) that bare authoring paths resolve against.
|
|
228
|
-
- `set_authoring_root` — Set the base folder (under Assets/) that bare authoring paths resolve against and are confined to. Use 'Assets' for full project access.
|
|
233
|
+
- `set_authoring_root` — Set the base folder (under Assets/) that bare authoring paths resolve against and are confined to. Use 'Assets' for full project access.
|
package/README.md
CHANGED
|
@@ -50,6 +50,8 @@ u-cli-mod setup <project> # CLI + 适配包一键就绪(推荐首次入口
|
|
|
50
50
|
u-cli-mod routes # 列出支持的 Editor 路由
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
+
升级 npm 包不会自动替换已有工程的 `Packages/com.unity.pipeline`。检查 `doctor` 的 `pipeline.state`:只有 `current` 且 `installed=true` 才表示当前补丁完整;`outdated`/`invalid` 时关闭目标 Unity Editor 后执行 `u-cli-mod pipeline install <project> --force`(自动备份)。`patchVersion` 是路由要求,`installedPatchVersion` 来自安装 receipt;仅看到上游版本 `0.5.0-exp.1` 或诊断退出码 0 不代表适配包已更新。
|
|
54
|
+
|
|
53
55
|
## Usage
|
|
54
56
|
|
|
55
57
|
> 示例中的 `<project>` 指代你的 Unity 工程目录,请替换为实际路径。
|
|
@@ -76,6 +78,7 @@ u-cli-mod setup <project>
|
|
|
76
78
|
# 执行 Unity Pipeline 命令(自动绑定目标工程)
|
|
77
79
|
u-cli-mod exec <project> -- command editor_status
|
|
78
80
|
u-cli-mod exec <project> -- command get_scene_hierarchy
|
|
81
|
+
u-cli-mod exec <project> -- command read_console --types error,warning --count 100
|
|
79
82
|
|
|
80
83
|
# 清理缓存
|
|
81
84
|
u-cli-mod cache clean
|
|
@@ -88,7 +91,7 @@ u-cli-mod cache clean
|
|
|
88
91
|
1. 读取目标工程 `ProjectSettings/ProjectVersion.txt`,要求 `m_EditorVersion` 与 `m_EditorVersionWithRevision` **同时存在且与路由完全一致**(fail-closed,无通配、无“最近版本”回退)。
|
|
89
92
|
2. 按路由下载固定版本的 Unity CLI:HTTPS 白名单(仅 Unity 官方 CDN),校验固定 SHA-256 + 文件大小 + Authenticode 签名主体与证书指纹,临时文件原子更名为最终文件。
|
|
90
93
|
3. 按路由下载固定版本的 `com.unity.pipeline` tgz:固定 SHA-256(主)+ SHA-1(交叉),安全解包(解包前逐项拒绝绝对路径、`..`、符号/硬链接等非常规条目)。
|
|
91
|
-
4. 在**用户缓存**中确定性转换:`package.json` 最低 Unity 版本、`PhysicsMaterial` 兼容、`rawRenderQueue`
|
|
94
|
+
4. 在**用户缓存**中确定性转换:`package.json` 最低 Unity 版本、`PhysicsMaterial` 兼容、`rawRenderQueue` 读取兼容、基于 `UnityEditor.LogEntries` 的 `read_console`、Roslyn DLL 的 `.meta` 转为 Unity 2022 格式(保留 GUID)、删除 `Tests` 源码与失效签名文件;输出必须与 `routes/expected-tree/*.json`(含 `Tests.meta` 共 385 个文件)逐字节一致。
|
|
92
95
|
5. 事务式安装到 `Packages/com.unity.pipeline`:staging → 校验 → 备份 → 替换 → 再校验 → receipt;任一步失败自动回滚。运行中的 Unity Editor 会 fail-closed 阻止安装。
|
|
93
96
|
6. `exec` 每次调用前重新校验 CLI 哈希,并**禁止任何 `--project-path` 变体覆盖目标工程**。
|
|
94
97
|
|
|
@@ -106,12 +109,12 @@ u-cli-mod cache clean
|
|
|
106
109
|
### 单元测试与打包守卫
|
|
107
110
|
|
|
108
111
|
```bash
|
|
109
|
-
npm run check # build + lint +
|
|
112
|
+
npm run check # build + lint + vitest 测试 + pack guard
|
|
110
113
|
```
|
|
111
114
|
|
|
112
115
|
`pack:guard` 会执行真实 `npm pack`(含文件清单校验),断言发布包:
|
|
113
116
|
|
|
114
|
-
- 包名为 `@kevlns/u-cli-mod`,tgz 文件名精确为 `kevlns-u-cli-mod-0.1.
|
|
117
|
+
- 包名为 `@kevlns/u-cli-mod`,tgz 文件名精确为 `kevlns-u-cli-mod-0.1.4.tgz`(与 package.json 版本一致);
|
|
115
118
|
- `files` 必须包含 `v-cli.plugin.json`,且清单身份字段(schemaVersion/package/command/bin/platforms)与包一致;
|
|
116
119
|
- 不出现:
|
|
117
120
|
|
|
@@ -142,7 +145,7 @@ npm run e2e:windows # 完整 Unity E2E(真实下载/转换/编译/命
|
|
|
142
145
|
|
|
143
146
|
- `preflight:runner` 只读,不下载/注册 Runner;结果 JSON 输出到 stdout。
|
|
144
147
|
- `e2e:windows` 使用**隔离缓存**(干净环境)或显式复用已验证缓存,创建 `<临时目录>/u-cli-mod-e2e/` 下独立临时工程,全部结束后杀掉它启动的所有 Unity 进程并清理临时工程;报告写入 `<临时目录>/u-cli-mod-e2e-report.json`(分别可用 `EPC_E2E_ROOT`、`EPC_E2E_REPORT` 覆盖)。
|
|
145
|
-
- 验收指标:200 次只读调用 100% 成功并记录 P50/P95
|
|
148
|
+
- 验收指标:200 次只读调用 100% 成功并记录 P50/P95、`read_console` 原生 Console 历史读取与统一清理、20 轮资源修改、5 次 Domain Reload 首次恢复、强杀重启恢复、双工程显式路由 60 次无误选、运行中 Editor 防护与 `--project-path` 覆盖拒绝。
|
|
146
149
|
|
|
147
150
|
详细说明见 `docs/SELF_HOSTED_RUNNER.md`。
|
|
148
151
|
|
|
@@ -179,9 +182,9 @@ kevlns 工具家族共享同一套发布约定(tag 驱动、CI 护栏、MIT)
|
|
|
179
182
|
|
|
180
183
|
| Package | Purpose | Status |
|
|
181
184
|
| --- | --- | --- |
|
|
182
|
-
| [`v-cli`](https://github.com/kevlns/v-cli) | 个人工具箱 CLI | v0.2.
|
|
185
|
+
| [`v-cli`](https://github.com/kevlns/v-cli) | 个人工具箱 CLI | v0.2.3 |
|
|
183
186
|
| [`xlmerge`](https://github.com/kevlns/xlmerge) | Git 中 .xlsx/.xlsm 冲突可视化解决工具 | v1.2.2 |
|
|
184
|
-
| [`u-cli-mod`](https://github.com/kevlns/u-cli-mod) | Unity 精确版本路由 + CLI + pipeline 包(Windows-first,本仓库) | v0.1.
|
|
187
|
+
| [`u-cli-mod`](https://github.com/kevlns/u-cli-mod) | Unity 精确版本路由 + CLI + pipeline 包(Windows-first,本仓库) | v0.1.4 |
|
|
185
188
|
|
|
186
189
|
## Compatibility
|
|
187
190
|
|
|
@@ -14,8 +14,12 @@ export declare function runDoctor(projectPath: string, options?: DoctorOptions):
|
|
|
14
14
|
};
|
|
15
15
|
pipeline: {
|
|
16
16
|
version: string;
|
|
17
|
+
patchVersion: number;
|
|
17
18
|
sourceReady: boolean;
|
|
19
|
+
present: boolean;
|
|
18
20
|
installed: boolean;
|
|
21
|
+
state: string;
|
|
22
|
+
installedPatchVersion: number | null;
|
|
19
23
|
};
|
|
20
24
|
unityProcesses: string[];
|
|
21
25
|
supportedVersions: string[];
|
package/dist/commands/doctor.js
CHANGED
|
@@ -1,10 +1,40 @@
|
|
|
1
1
|
import { existsSync } from 'node:fs';
|
|
2
|
+
import { readFile } from 'node:fs/promises';
|
|
2
3
|
import { join } from 'node:path';
|
|
3
4
|
import { readProjectInfo } from '../projectVersion.js';
|
|
4
|
-
import { resolveRouteForProject, listEditorVersions } from '../routes.js';
|
|
5
|
+
import { resolveRouteForProject, listEditorVersions, loadExpectedTree } from '../routes.js';
|
|
5
6
|
import { cliBinaryPath, generatedPackageDir } from '../paths.js';
|
|
6
|
-
import { sha256File } from '../integrity.js';
|
|
7
|
+
import { compareTree, sha256File } from '../integrity.js';
|
|
7
8
|
import { queryUnityProcesses } from '../unityGuard.js';
|
|
9
|
+
async function readInstalledPatchVersion(receiptPath) {
|
|
10
|
+
if (!existsSync(receiptPath))
|
|
11
|
+
return null;
|
|
12
|
+
try {
|
|
13
|
+
const receipt = JSON.parse(await readFile(receiptPath, 'utf8'));
|
|
14
|
+
if (Number.isInteger(receipt.patchVersion) && Number(receipt.patchVersion) >= 0) {
|
|
15
|
+
return Number(receipt.patchVersion);
|
|
16
|
+
}
|
|
17
|
+
if (typeof receipt.source === 'string') {
|
|
18
|
+
const match = /\(patched\s+(\d+)\)/i.exec(receipt.source);
|
|
19
|
+
if (match?.[1])
|
|
20
|
+
return Number.parseInt(match[1], 10);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
// Unknown receipt metadata never bypasses the package tree verification.
|
|
25
|
+
}
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
async function packageTreeMatches(root, expected) {
|
|
29
|
+
if (!existsSync(root))
|
|
30
|
+
return false;
|
|
31
|
+
try {
|
|
32
|
+
return (await compareTree(root, expected)).ok;
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
8
38
|
export async function runDoctor(projectPath, options = {}) {
|
|
9
39
|
const project = readProjectInfo(projectPath);
|
|
10
40
|
const route = resolveRouteForProject(project);
|
|
@@ -15,8 +45,26 @@ export async function runDoctor(projectPath, options = {}) {
|
|
|
15
45
|
cliState = hash === route.cli.sha256.toLowerCase() ? 'valid' : 'hash-mismatch';
|
|
16
46
|
}
|
|
17
47
|
const generated = generatedPackageDir(project.editorVersion);
|
|
18
|
-
const
|
|
19
|
-
const
|
|
48
|
+
const expectedTree = loadExpectedTree(project.editorVersion);
|
|
49
|
+
const pipelineRoot = join(project.projectPath, 'Packages', 'com.unity.pipeline');
|
|
50
|
+
const pipelinePresent = existsSync(join(pipelineRoot, 'package.json'));
|
|
51
|
+
const receiptPath = join(project.projectPath, 'Library', 'editor-pipeline-cli', 'receipt.json');
|
|
52
|
+
const installedPatchVersion = await readInstalledPatchVersion(receiptPath);
|
|
53
|
+
const pipelineOutdated = pipelinePresent &&
|
|
54
|
+
installedPatchVersion !== null &&
|
|
55
|
+
installedPatchVersion < route.pipeline.patchVersion;
|
|
56
|
+
const pipelineTreeMatches = pipelinePresent
|
|
57
|
+
? await packageTreeMatches(pipelineRoot, expectedTree.files)
|
|
58
|
+
: false;
|
|
59
|
+
const pipelineInstalled = pipelinePresent && pipelineTreeMatches && !pipelineOutdated;
|
|
60
|
+
const pipelineState = !pipelinePresent
|
|
61
|
+
? 'missing'
|
|
62
|
+
: pipelineOutdated
|
|
63
|
+
? 'outdated'
|
|
64
|
+
: pipelineTreeMatches
|
|
65
|
+
? 'current'
|
|
66
|
+
: 'invalid';
|
|
67
|
+
const pipelineSourceReady = await packageTreeMatches(generated, expectedTree.files);
|
|
20
68
|
let editors = [];
|
|
21
69
|
if (!options.allowRunningEditor) {
|
|
22
70
|
try {
|
|
@@ -34,7 +82,15 @@ export async function runDoctor(projectPath, options = {}) {
|
|
|
34
82
|
routeSupported: true,
|
|
35
83
|
routeRevision: route.editorRevision,
|
|
36
84
|
cli: { version: route.cli.version, path: cliPath, state: cliState },
|
|
37
|
-
pipeline: {
|
|
85
|
+
pipeline: {
|
|
86
|
+
version: route.pipeline.version,
|
|
87
|
+
patchVersion: route.pipeline.patchVersion,
|
|
88
|
+
sourceReady: pipelineSourceReady,
|
|
89
|
+
present: pipelinePresent,
|
|
90
|
+
installed: pipelineInstalled,
|
|
91
|
+
state: pipelineState,
|
|
92
|
+
installedPatchVersion,
|
|
93
|
+
},
|
|
38
94
|
unityProcesses: editors,
|
|
39
95
|
supportedVersions: listEditorVersions(),
|
|
40
96
|
};
|
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
import { CliError } from './errors.js';
|
|
2
|
+
/**
|
|
3
|
+
* Replacement body for the upstream Editor console commands.
|
|
4
|
+
*
|
|
5
|
+
* The upstream implementation only reads buffers populated from
|
|
6
|
+
* Application.logMessageReceivedThreaded. That is useful for follow/player
|
|
7
|
+
* scenarios, but it is not a snapshot of the Unity Editor Console: messages
|
|
8
|
+
* emitted before the subscription (notably compiler/importer diagnostics) can
|
|
9
|
+
* be absent. This editor-only command deliberately reflects Unity's internal
|
|
10
|
+
* LogEntries store, matching the semantics agents expect from UnityMCP's
|
|
11
|
+
* read_console tool. Exact-version routing makes this internal API usage
|
|
12
|
+
* fail-closed and testable per supported Editor revision.
|
|
13
|
+
*/
|
|
14
|
+
const CONSOLE_COMMANDS_BODY_LF = ` [CliCommand("read_console", "Read or clear the current Unity Editor Console (including entries emitted before this command).", Tags = new[] { "observability/console" })]
|
|
15
|
+
public static object ReadConsole(
|
|
16
|
+
[CliArg("action", "Action: get | clear.")] string action = "get",
|
|
17
|
+
[CliArg("types", "Comma-separated entry types: error, warning, log, or all. Defaults to error,warning.")] string types = "error,warning",
|
|
18
|
+
[CliArg("count", "Maximum entries in non-paged mode, capped at 1000.")] int count = 100,
|
|
19
|
+
[CliArg("filterText", "Optional case-insensitive substring filter over the message and stack trace.")] string filterText = null,
|
|
20
|
+
[CliArg("pageSize", "Page size (1-500). Values <= 0 disable paging and use count.")] int pageSize = 0,
|
|
21
|
+
[CliArg("cursor", "Zero-based matching-entry offset used with pageSize.")] int cursor = 0,
|
|
22
|
+
[CliArg("outputFormat", "Entry format: plain | detailed | json (named outputFormat to avoid the Unity CLI global --format option).")] string outputFormat = "detailed",
|
|
23
|
+
[CliArg("includeStacktrace", "Include the stack trace in detailed/json output.")] bool includeStacktrace = true)
|
|
24
|
+
{
|
|
25
|
+
switch ((action ?? "get").Trim().ToLowerInvariant())
|
|
26
|
+
{
|
|
27
|
+
case "clear":
|
|
28
|
+
return ClearConsole();
|
|
29
|
+
case "get":
|
|
30
|
+
var result = ReadUnityConsole(types, count, filterText, pageSize, cursor, outputFormat, includeStacktrace);
|
|
31
|
+
return new
|
|
32
|
+
{
|
|
33
|
+
success = true,
|
|
34
|
+
action = "get",
|
|
35
|
+
total = result.Total,
|
|
36
|
+
returned = result.Messages.Count,
|
|
37
|
+
cursor = result.Cursor,
|
|
38
|
+
nextCursor = result.NextCursor,
|
|
39
|
+
hasMore = result.HasMore,
|
|
40
|
+
messages = result.Messages
|
|
41
|
+
};
|
|
42
|
+
default:
|
|
43
|
+
throw new ArgumentException("Unknown action. Expected 'get' or 'clear'.", nameof(action));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
[CliCommand("get_console_logs", "Read the current Unity Editor Console (compatibility alias for read_console).", Tags = new[] { "observability/console" })]
|
|
48
|
+
public static object GetConsoleLogs(
|
|
49
|
+
[CliArg("severity", "Filter: all | log | warning | error.")] string severity = "all",
|
|
50
|
+
[CliArg("limit", "Max entries to return, capped at 1000.")] int limit = 100)
|
|
51
|
+
{
|
|
52
|
+
var requested = string.Equals(severity, "all", StringComparison.OrdinalIgnoreCase)
|
|
53
|
+
? "all"
|
|
54
|
+
: severity;
|
|
55
|
+
var result = ReadUnityConsole(requested, limit, null, 0, 0, "detailed", true);
|
|
56
|
+
return new
|
|
57
|
+
{
|
|
58
|
+
total = result.Total,
|
|
59
|
+
returned = result.Messages.Count,
|
|
60
|
+
logs = result.Messages
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
[CliCommand("clear_console", "Clear the Unity Editor Console and all captured pipeline console buffers.", Tags = new[] { "observability/console" })]
|
|
65
|
+
public static object ClearConsole()
|
|
66
|
+
{
|
|
67
|
+
var unityConsoleCleared = false;
|
|
68
|
+
string unityConsoleError = null;
|
|
69
|
+
|
|
70
|
+
try
|
|
71
|
+
{
|
|
72
|
+
var logEntriesType = GetEditorType("UnityEditor.LogEntries");
|
|
73
|
+
GetRequiredMethod(logEntriesType, "Clear").Invoke(null, null);
|
|
74
|
+
unityConsoleCleared = true;
|
|
75
|
+
}
|
|
76
|
+
catch (Exception ex)
|
|
77
|
+
{
|
|
78
|
+
unityConsoleError = UnwrapMessage(ex);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// These are two independent upstream buffers. Clear both so a
|
|
82
|
+
// subsequent console/get_console_logs call cannot return stale data.
|
|
83
|
+
ConsoleLogBuffer.Clear();
|
|
84
|
+
Unity.Pipeline.Console.ConsoleLogCapture.Buffer.Clear();
|
|
85
|
+
Unity.Pipeline.Console.ConsoleLogCapture.Buffer.Save("Temp/pipeline_console_log.json");
|
|
86
|
+
|
|
87
|
+
return new
|
|
88
|
+
{
|
|
89
|
+
success = unityConsoleCleared,
|
|
90
|
+
action = "clear",
|
|
91
|
+
cleared = unityConsoleCleared,
|
|
92
|
+
unityConsoleCleared,
|
|
93
|
+
capturedBuffersCleared = true,
|
|
94
|
+
error = unityConsoleError
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
private sealed class ConsoleReadResult
|
|
99
|
+
{
|
|
100
|
+
public int Total { get; set; }
|
|
101
|
+
public List<object> Messages { get; set; }
|
|
102
|
+
public int? Cursor { get; set; }
|
|
103
|
+
public int? NextCursor { get; set; }
|
|
104
|
+
public bool HasMore { get; set; }
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
private static ConsoleReadResult ReadUnityConsole(
|
|
108
|
+
string types,
|
|
109
|
+
int count,
|
|
110
|
+
string filterText,
|
|
111
|
+
int pageSize,
|
|
112
|
+
int cursor,
|
|
113
|
+
string format,
|
|
114
|
+
bool includeStacktrace)
|
|
115
|
+
{
|
|
116
|
+
var logEntriesType = GetEditorType("UnityEditor.LogEntries");
|
|
117
|
+
var logEntryType = GetEditorType("UnityEditor.LogEntry");
|
|
118
|
+
var staticFlags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static;
|
|
119
|
+
var instanceFlags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance;
|
|
120
|
+
|
|
121
|
+
var startGettingEntries = GetRequiredMethod(logEntriesType, "StartGettingEntries");
|
|
122
|
+
var endGettingEntries = GetRequiredMethod(logEntriesType, "EndGettingEntries");
|
|
123
|
+
var getEntry = GetRequiredMethod(logEntriesType, "GetEntryInternal");
|
|
124
|
+
var getEntryCount = logEntriesType.GetMethod("GetEntryCount", staticFlags);
|
|
125
|
+
var setConsoleFlag = GetRequiredMethod(logEntriesType, "SetConsoleFlag");
|
|
126
|
+
var setFilteringText = GetRequiredMethod(logEntriesType, "SetFilteringText");
|
|
127
|
+
var getFilteringText = GetRequiredMethod(logEntriesType, "GetFilteringText");
|
|
128
|
+
var consoleFlags = logEntriesType.GetProperty("consoleFlags", staticFlags);
|
|
129
|
+
if (consoleFlags == null)
|
|
130
|
+
throw new MissingMemberException(logEntriesType.FullName, "consoleFlags");
|
|
131
|
+
|
|
132
|
+
var modeField = GetRequiredField(logEntryType, "mode", instanceFlags);
|
|
133
|
+
var messageField = GetRequiredField(logEntryType, "message", instanceFlags);
|
|
134
|
+
var fileField = GetRequiredField(logEntryType, "file", instanceFlags);
|
|
135
|
+
var lineField = GetRequiredField(logEntryType, "line", instanceFlags);
|
|
136
|
+
var callstackStartField = logEntryType.GetField("callstackTextStartUTF16", instanceFlags);
|
|
137
|
+
|
|
138
|
+
var requestedTypes = NormalizeTypes(types);
|
|
139
|
+
var normalizedFormat = (format ?? "detailed").Trim().ToLowerInvariant();
|
|
140
|
+
var usePaging = pageSize > 0;
|
|
141
|
+
var resolvedPageSize = Math.Min(Math.Max(pageSize, 1), 500);
|
|
142
|
+
var resolvedCursor = Math.Max(cursor, 0);
|
|
143
|
+
var resolvedCount = Math.Min(Math.Max(count, 1), 1000);
|
|
144
|
+
var messages = new List<object>();
|
|
145
|
+
var totalMatches = 0;
|
|
146
|
+
var originalFlags = (int)consoleFlags.GetValue(null, null);
|
|
147
|
+
var originalFilter = (string)getFilteringText.Invoke(null, null) ?? string.Empty;
|
|
148
|
+
var started = false;
|
|
149
|
+
|
|
150
|
+
try
|
|
151
|
+
{
|
|
152
|
+
// StartGettingEntries observes the Console window's severity
|
|
153
|
+
// toggles and search filter. Temporarily make the snapshot
|
|
154
|
+
// independent from UI state, then restore both in finally.
|
|
155
|
+
setConsoleFlag.Invoke(null, new object[] { 1 << 7, true });
|
|
156
|
+
setConsoleFlag.Invoke(null, new object[] { 1 << 8, true });
|
|
157
|
+
setConsoleFlag.Invoke(null, new object[] { 1 << 9, true });
|
|
158
|
+
setFilteringText.Invoke(null, new object[] { string.Empty });
|
|
159
|
+
|
|
160
|
+
var totalEntries = (int)startGettingEntries.Invoke(null, null);
|
|
161
|
+
started = true;
|
|
162
|
+
var entry = Activator.CreateInstance(logEntryType);
|
|
163
|
+
|
|
164
|
+
for (var i = 0; i < totalEntries; i++)
|
|
165
|
+
{
|
|
166
|
+
var read = getEntry.Invoke(null, new[] { (object)i, entry });
|
|
167
|
+
if (read is bool && !(bool)read)
|
|
168
|
+
continue;
|
|
169
|
+
|
|
170
|
+
var rawMessage = (string)messageField.GetValue(entry) ?? string.Empty;
|
|
171
|
+
if (rawMessage.Length == 0)
|
|
172
|
+
continue;
|
|
173
|
+
|
|
174
|
+
var mode = (int)modeField.GetValue(entry);
|
|
175
|
+
var type = ClassifyType(mode);
|
|
176
|
+
if (!requestedTypes.Contains(type.ToLowerInvariant()))
|
|
177
|
+
continue;
|
|
178
|
+
|
|
179
|
+
var callstackStart = callstackStartField == null ? -1 : (int)callstackStartField.GetValue(entry);
|
|
180
|
+
string message;
|
|
181
|
+
string stackTrace;
|
|
182
|
+
SplitMessage(rawMessage, callstackStart, out message, out stackTrace);
|
|
183
|
+
|
|
184
|
+
if (!string.IsNullOrEmpty(filterText)
|
|
185
|
+
&& rawMessage.IndexOf(filterText, StringComparison.OrdinalIgnoreCase) < 0)
|
|
186
|
+
continue;
|
|
187
|
+
|
|
188
|
+
var matchingIndex = totalMatches;
|
|
189
|
+
totalMatches++;
|
|
190
|
+
var include = usePaging
|
|
191
|
+
? matchingIndex >= resolvedCursor && matchingIndex < resolvedCursor + resolvedPageSize
|
|
192
|
+
: messages.Count < resolvedCount;
|
|
193
|
+
if (!include)
|
|
194
|
+
continue;
|
|
195
|
+
|
|
196
|
+
if (normalizedFormat == "plain")
|
|
197
|
+
{
|
|
198
|
+
messages.Add(message);
|
|
199
|
+
continue;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
var occurrences = 1;
|
|
203
|
+
if (getEntryCount != null)
|
|
204
|
+
{
|
|
205
|
+
var occurrenceResult = getEntryCount.Invoke(null, new object[] { i });
|
|
206
|
+
if (occurrenceResult is int)
|
|
207
|
+
occurrences = (int)occurrenceResult;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
messages.Add(new
|
|
211
|
+
{
|
|
212
|
+
type,
|
|
213
|
+
message,
|
|
214
|
+
file = (string)fileField.GetValue(entry) ?? string.Empty,
|
|
215
|
+
line = (int)lineField.GetValue(entry),
|
|
216
|
+
stackTrace = includeStacktrace ? stackTrace : null,
|
|
217
|
+
occurrences
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
finally
|
|
222
|
+
{
|
|
223
|
+
try
|
|
224
|
+
{
|
|
225
|
+
if (started)
|
|
226
|
+
endGettingEntries.Invoke(null, null);
|
|
227
|
+
}
|
|
228
|
+
finally
|
|
229
|
+
{
|
|
230
|
+
consoleFlags.SetValue(null, originalFlags, null);
|
|
231
|
+
setFilteringText.Invoke(null, new object[] { originalFilter });
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
int? nextCursor = null;
|
|
236
|
+
if (usePaging && resolvedCursor + messages.Count < totalMatches)
|
|
237
|
+
nextCursor = resolvedCursor + messages.Count;
|
|
238
|
+
|
|
239
|
+
return new ConsoleReadResult
|
|
240
|
+
{
|
|
241
|
+
Total = totalMatches,
|
|
242
|
+
Messages = messages,
|
|
243
|
+
Cursor = usePaging ? (int?)resolvedCursor : null,
|
|
244
|
+
NextCursor = nextCursor,
|
|
245
|
+
HasMore = usePaging ? nextCursor.HasValue : totalMatches > messages.Count
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
private static HashSet<string> NormalizeTypes(string types)
|
|
250
|
+
{
|
|
251
|
+
var result = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
|
252
|
+
if (string.IsNullOrWhiteSpace(types))
|
|
253
|
+
{
|
|
254
|
+
result.Add("error");
|
|
255
|
+
result.Add("warning");
|
|
256
|
+
return result;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
foreach (var part in types.Split(','))
|
|
260
|
+
{
|
|
261
|
+
var normalized = part.Trim().ToLowerInvariant();
|
|
262
|
+
switch (normalized)
|
|
263
|
+
{
|
|
264
|
+
case "all":
|
|
265
|
+
result.Clear();
|
|
266
|
+
result.Add("error");
|
|
267
|
+
result.Add("warning");
|
|
268
|
+
result.Add("log");
|
|
269
|
+
return result;
|
|
270
|
+
case "warn":
|
|
271
|
+
result.Add("warning");
|
|
272
|
+
break;
|
|
273
|
+
case "exception":
|
|
274
|
+
case "assert":
|
|
275
|
+
result.Add("error");
|
|
276
|
+
break;
|
|
277
|
+
case "error":
|
|
278
|
+
case "warning":
|
|
279
|
+
case "log":
|
|
280
|
+
result.Add(normalized);
|
|
281
|
+
break;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
if (result.Count == 0)
|
|
286
|
+
{
|
|
287
|
+
result.Add("error");
|
|
288
|
+
result.Add("warning");
|
|
289
|
+
}
|
|
290
|
+
return result;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
private static string ClassifyType(int mode)
|
|
294
|
+
{
|
|
295
|
+
const int errorMask =
|
|
296
|
+
(1 << 0) | (1 << 1) | (1 << 4) | (1 << 6) | (1 << 8)
|
|
297
|
+
| (1 << 11) | (1 << 17) | (1 << 20) | (1 << 21) | (1 << 22);
|
|
298
|
+
const int warningMask = (1 << 7) | (1 << 9) | (1 << 12);
|
|
299
|
+
if ((mode & errorMask) != 0)
|
|
300
|
+
return "Error";
|
|
301
|
+
if ((mode & warningMask) != 0)
|
|
302
|
+
return "Warning";
|
|
303
|
+
return "Log";
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
private static void SplitMessage(string raw, int callstackStart, out string message, out string stackTrace)
|
|
307
|
+
{
|
|
308
|
+
if (callstackStart > 0 && callstackStart < raw.Length)
|
|
309
|
+
{
|
|
310
|
+
message = raw.Substring(0, callstackStart).TrimEnd('\\r', '\\n');
|
|
311
|
+
stackTrace = raw.Substring(callstackStart).TrimStart('\\r', '\\n');
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
message = raw.TrimEnd('\\r', '\\n');
|
|
316
|
+
stackTrace = string.Empty;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
private static Type GetEditorType(string name)
|
|
320
|
+
{
|
|
321
|
+
var type = typeof(UnityEditor.EditorApplication).Assembly.GetType(name);
|
|
322
|
+
if (type == null)
|
|
323
|
+
throw new TypeLoadException("Could not find internal Unity Editor type: " + name);
|
|
324
|
+
return type;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
private static MethodInfo GetRequiredMethod(Type type, string name)
|
|
328
|
+
{
|
|
329
|
+
var flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static;
|
|
330
|
+
var method = type.GetMethod(name, flags);
|
|
331
|
+
if (method == null)
|
|
332
|
+
throw new MissingMethodException(type.FullName, name);
|
|
333
|
+
return method;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
private static FieldInfo GetRequiredField(Type type, string name, BindingFlags flags)
|
|
337
|
+
{
|
|
338
|
+
var field = type.GetField(name, flags);
|
|
339
|
+
if (field == null)
|
|
340
|
+
throw new MissingFieldException(type.FullName, name);
|
|
341
|
+
return field;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
private static string UnwrapMessage(Exception exception)
|
|
345
|
+
{
|
|
346
|
+
var target = exception as TargetInvocationException;
|
|
347
|
+
return target != null && target.InnerException != null
|
|
348
|
+
? target.InnerException.Message
|
|
349
|
+
: exception.Message;
|
|
350
|
+
}
|
|
351
|
+
`;
|
|
352
|
+
function normalizeCrlf(bytes) {
|
|
353
|
+
return Buffer.from(bytes.toString('utf8').replace(/\r?\n/g, '\r\n'), 'utf8');
|
|
354
|
+
}
|
|
355
|
+
/** Replace the callback-buffer console commands with an Editor LogEntries snapshot reader. */
|
|
356
|
+
export function patchConsoleCommands(bytes) {
|
|
357
|
+
const source = bytes.toString('utf8');
|
|
358
|
+
if (source.includes('[CliCommand("read_console"')) {
|
|
359
|
+
return normalizeCrlf(Buffer.from(source, 'utf8'));
|
|
360
|
+
}
|
|
361
|
+
const startMarker = ' [CliCommand("get_console_logs"';
|
|
362
|
+
const normalized = source.replace(/\r\n/g, '\n');
|
|
363
|
+
const start = normalized.indexOf(startMarker);
|
|
364
|
+
const classClose = normalized.lastIndexOf(' }\n}');
|
|
365
|
+
if (start < 0 || classClose < start) {
|
|
366
|
+
throw new CliError('ConsoleCommands.cs 缺少 get_console_logs/class 闭合锚点');
|
|
367
|
+
}
|
|
368
|
+
const patched = normalized.slice(0, start) + CONSOLE_COMMANDS_BODY_LF + normalized.slice(classClose);
|
|
369
|
+
return normalizeCrlf(Buffer.from(patched, 'utf8'));
|
|
370
|
+
}
|
package/dist/installer.js
CHANGED
|
@@ -99,6 +99,7 @@ export async function installPipeline(project, route, sourceDir, expectedTree, o
|
|
|
99
99
|
editorVersion: project.editorVersion,
|
|
100
100
|
editorRevision: project.revision,
|
|
101
101
|
pipelineVersion: route.pipeline.version,
|
|
102
|
+
patchVersion: route.pipeline.patchVersion,
|
|
102
103
|
packagePath: destination,
|
|
103
104
|
backupPath: backupPath ?? null,
|
|
104
105
|
source: `${route.pipeline.packageName}@${route.pipeline.version} (patched ${route.pipeline.patchVersion})`,
|
package/dist/transform.js
CHANGED
|
@@ -2,6 +2,7 @@ import { mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync, existsSync
|
|
|
2
2
|
import { dirname, join, relative, sep } from 'node:path';
|
|
3
3
|
import { CliError } from './errors.js';
|
|
4
4
|
import { sha256Buffer, compareTree } from './integrity.js';
|
|
5
|
+
import { patchConsoleCommands } from './consolePatch.js';
|
|
5
6
|
/** Files/dirs present upstream that must NOT ship in the adapted package. */
|
|
6
7
|
const REMOVE_EXACT = new Set([
|
|
7
8
|
'.attestation.p7m',
|
|
@@ -139,6 +140,9 @@ export async function transformPackage(input) {
|
|
|
139
140
|
else if (rel === 'Editor/Commands/Materials/MaterialCommands.cs') {
|
|
140
141
|
out = patchMaterialCommands(bytes);
|
|
141
142
|
}
|
|
143
|
+
else if (rel === 'Editor/Commands/Observability/ConsoleCommands.cs') {
|
|
144
|
+
out = patchConsoleCommands(bytes);
|
|
145
|
+
}
|
|
142
146
|
else if (DLL_META_NAMES.includes(rel.split('/').pop())) {
|
|
143
147
|
const { guid } = metaBody(bytes);
|
|
144
148
|
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.1.
|
|
3
|
+
"version": "0.1.4",
|
|
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,8 +21,8 @@
|
|
|
21
21
|
"expectedTree": "expected-tree/2022.3.59f1c1.json",
|
|
22
22
|
"templates": "2022.3.59f1c1",
|
|
23
23
|
"targetUnityVersion": "2022.3",
|
|
24
|
-
"patchVersion":
|
|
24
|
+
"patchVersion": 2
|
|
25
25
|
},
|
|
26
26
|
"status": "unofficial-unity-2022-port",
|
|
27
|
-
"verifiedBy": "local integration run, 2022.3.62f3c1 (1623fc0bbb97);
|
|
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)"
|
|
28
28
|
}
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"expectedTree": "expected-tree/2022.3.62f3c1.json",
|
|
22
22
|
"templates": "2022.3.62f3c1",
|
|
23
23
|
"targetUnityVersion": "2022.3",
|
|
24
|
-
"patchVersion":
|
|
24
|
+
"patchVersion": 2
|
|
25
25
|
},
|
|
26
26
|
"status": "unofficial-unity-2022-port",
|
|
27
|
-
"verifiedBy": "
|
|
28
|
-
}
|
|
27
|
+
"verifiedBy": "patchVersion 2 read_console + compile/reload/restart/dual-project E2E, 2022.3.62f3c1 (1623fc0bbb97)"
|
|
28
|
+
}
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
"Editor/Commands/Navigation/NavigationCommands.cs": "2d2bfafb2f8563380c8708ecb97300250ee9bdc8a0f6a0512903247cf19a4ae5",
|
|
130
130
|
"Editor/Commands/Navigation/NavigationCommands.cs.meta": "f1002bd852046ce3bd7b3dbd6cc35e707429455ded5ad2c79e1fbac965bf23a9",
|
|
131
131
|
"Editor/Commands/Observability.meta": "0cef75eb0161beeff22e8ba22dac994895bd3d1bef3d86c41fe7f7e192206c73",
|
|
132
|
-
"Editor/Commands/Observability/ConsoleCommands.cs": "
|
|
132
|
+
"Editor/Commands/Observability/ConsoleCommands.cs": "68ccace32673ee6676040350a60003d10150f9978fc082ac747466db0ad65377",
|
|
133
133
|
"Editor/Commands/Observability/ConsoleCommands.cs.meta": "0b36196d922c3f6b34b49c42606a170b298694b06f6df393f3be4c75dda4c04c",
|
|
134
134
|
"Editor/Commands/Observability/ConsoleLogBuffer.cs": "abba3537972218a75536bbf503c9732bc967ae6a18872d6126080111b7a3011e",
|
|
135
135
|
"Editor/Commands/Observability/ConsoleLogBuffer.cs.meta": "2f4e7cbc14f9a3bd5fc2314ebde2ad6ee9b97a292b624f174242659889f24b72",
|
|
@@ -388,4 +388,4 @@
|
|
|
388
388
|
"package.json": "95c7387442ce3f84f5d21a4837e6392ec5b51484a400c1c55d1f64ff96022f3b",
|
|
389
389
|
"package.json.meta": "9552a2c99d7c3fd62e0747077e770fd1f86f1251f4d74d48102620168f67406c"
|
|
390
390
|
}
|
|
391
|
-
}
|
|
391
|
+
}
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
"Editor/Commands/Navigation/NavigationCommands.cs": "2d2bfafb2f8563380c8708ecb97300250ee9bdc8a0f6a0512903247cf19a4ae5",
|
|
130
130
|
"Editor/Commands/Navigation/NavigationCommands.cs.meta": "f1002bd852046ce3bd7b3dbd6cc35e707429455ded5ad2c79e1fbac965bf23a9",
|
|
131
131
|
"Editor/Commands/Observability.meta": "0cef75eb0161beeff22e8ba22dac994895bd3d1bef3d86c41fe7f7e192206c73",
|
|
132
|
-
"Editor/Commands/Observability/ConsoleCommands.cs": "
|
|
132
|
+
"Editor/Commands/Observability/ConsoleCommands.cs": "68ccace32673ee6676040350a60003d10150f9978fc082ac747466db0ad65377",
|
|
133
133
|
"Editor/Commands/Observability/ConsoleCommands.cs.meta": "0b36196d922c3f6b34b49c42606a170b298694b06f6df393f3be4c75dda4c04c",
|
|
134
134
|
"Editor/Commands/Observability/ConsoleLogBuffer.cs": "abba3537972218a75536bbf503c9732bc967ae6a18872d6126080111b7a3011e",
|
|
135
135
|
"Editor/Commands/Observability/ConsoleLogBuffer.cs.meta": "2f4e7cbc14f9a3bd5fc2314ebde2ad6ee9b97a292b624f174242659889f24b72",
|
|
@@ -388,4 +388,4 @@
|
|
|
388
388
|
"package.json": "95c7387442ce3f84f5d21a4837e6392ec5b51484a400c1c55d1f64ff96022f3b",
|
|
389
389
|
"package.json.meta": "9552a2c99d7c3fd62e0747077e770fd1f86f1251f4d74d48102620168f67406c"
|
|
390
390
|
}
|
|
391
|
-
}
|
|
391
|
+
}
|
package/v-cli.plugin.json
CHANGED
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
],
|
|
52
52
|
"output": {
|
|
53
53
|
"format": "json",
|
|
54
|
-
"description": "Diagnostics object: projectPath, editorVersion, editorRevision, routeSupported, routeRevision, cli {version, path, state}, pipeline {version, sourceReady, installed}, unityProcesses, supportedVersions."
|
|
54
|
+
"description": "Diagnostics object: projectPath, editorVersion, editorRevision, routeSupported, routeRevision, cli {version, path, state}, pipeline {version, patchVersion, installedPatchVersion, sourceReady, present, installed, state: missing|outdated|invalid|current}, unityProcesses, supportedVersions. installed/sourceReady require expected-tree integrity. Exit 0 means diagnostics completed, not readiness. Close the target Editor and use pipeline install --force for outdated/invalid. npm upgrades do not update project packages."
|
|
55
55
|
},
|
|
56
56
|
"exitCodes": {
|
|
57
57
|
"0": "success",
|
|
@@ -451,9 +451,10 @@
|
|
|
451
451
|
"tools": {
|
|
452
452
|
"audit": "Run a Project Auditor static-analysis scan. Returns immediately; poll audit_status until status is 'completed', then read the CSV.",
|
|
453
453
|
"audit_status": "Get the status of the last audit: idle | scanning | completed | failed | interrupted | unavailable.",
|
|
454
|
-
"clear_console": "Clear the
|
|
454
|
+
"clear_console": "Clear the Unity Editor Console and all captured pipeline console buffers.",
|
|
455
455
|
"console": "Get captured Unity console output (Editor or Player; supports tail, level filtering, and follow via a cursor)",
|
|
456
|
-
"get_console_logs": "Read
|
|
456
|
+
"get_console_logs": "Read the current Unity Editor Console (compatibility alias for read_console).",
|
|
457
|
+
"read_console": "Read or clear the current Unity Editor Console, including entries emitted before command initialization; supports type/text filtering, paging, formatting, and stack traces.",
|
|
457
458
|
"get_performance_stats": "Read render, memory, and frame-timing stats (structured, read-only).",
|
|
458
459
|
"log": "Write a message to Unity console"
|
|
459
460
|
}
|
|
@@ -507,4 +508,4 @@
|
|
|
507
508
|
}
|
|
508
509
|
]
|
|
509
510
|
}
|
|
510
|
-
}
|
|
511
|
+
}
|