@kevlns/u-cli-mod 0.3.0 → 0.3.2

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/v-cli.plugin.json CHANGED
@@ -3,8 +3,10 @@
3
3
  "package": "@kevlns/u-cli-mod",
4
4
  "command": "unity",
5
5
  "bin": "u-cli-mod",
6
- "description": "Pin a Unity project to its exact editor version route, download the verified Unity CLI and install the adapted com.unity.pipeline package for Unity 2022 (Windows-first, non-official Unity tooling).",
7
- "platforms": ["win32"],
6
+ "description": "按 Unity Editor 精确版本定位工具链,校验和安装 com.unity.pipeline,并执行工程命令。",
7
+ "platforms": [
8
+ "win32"
9
+ ],
8
10
  "runtime": {
9
11
  "node": ">=20",
10
12
  "os": "win32"
@@ -12,15 +14,15 @@
12
14
  "environment": [
13
15
  {
14
16
  "name": "LOCALAPPDATA",
15
- "description": "User cache base on Windows. CLI downloads and generated pipeline packages live under %LOCALAPPDATA%\\editor-pipeline-cli (falls back to <home>\\AppData\\Local); project-scoped receipts, backups and staging live under <project>/Library/editor-pipeline-cli, never under the user cache."
17
+ "description": "Windows 用户缓存位于 %LOCALAPPDATA%/editor-pipeline-cli;未设置时使用用户 AppData/Local。工程回执、备份和暂存位于 <project>/Library/editor-pipeline-cli。"
16
18
  },
17
19
  {
18
20
  "name": "PATH",
19
- "description": "Must resolve powershell.exe; the fail-closed running-Editor guard queries Unity.exe processes through Windows PowerShell."
21
+ "description": "必须能调用 powershell.exe;通过 Windows PowerShell 检查 Unity.exe 是否占用目标工程。"
20
22
  }
21
23
  ],
22
24
  "agent": {
23
- "whenToUse": "Use for Windows-first Unity Editor 2022 workflows that must stay pinned to an exact editor version: diagnose a project against its route, list pinned routes, download the verified Unity CLI, transactionally install the adapted com.unity.pipeline package, or run Unity Pipeline CLI commands with enforced project targeting. Never use on non-Windows hosts.",
25
+ "whenToUse": "用于 Windows 的 Unity 2022 工程诊断、精确版本路由、已校验工具下载、事务式安装及明确绑定工程的 Pipeline 调用。",
24
26
  "globalOptions": [
25
27
  {
26
28
  "flags": "-V, --version",
@@ -33,14 +35,16 @@
33
35
  ],
34
36
  "commands": [
35
37
  {
36
- "path": ["doctor"],
38
+ "path": [
39
+ "doctor"
40
+ ],
37
41
  "usage": "u-cli-mod doctor <project> [options]",
38
42
  "description": "检查工程版本、路由、CLI 与 Pipeline 状态",
39
43
  "arguments": [
40
44
  {
41
45
  "name": "project",
42
46
  "required": true,
43
- "description": "Path to the Unity project; must contain ProjectSettings/ProjectVersion.txt."
47
+ "description": "Unity 工程路径,必须包含 ProjectSettings/ProjectVersion.txt。"
44
48
  }
45
49
  ],
46
50
  "options": [
@@ -51,20 +55,22 @@
51
55
  ],
52
56
  "output": {
53
57
  "format": "json",
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. pipeline.verification reports mismatches, lineEndingDifferences and error. Verified installed content is authoritative over stale/missing receipts; installed UTF-8 text tolerates LF/CRLF only, generated sources and binaries remain byte-exact. New generated text uses LF."
58
+ "description": "返回工程、版本、路由、cli、pipeline、unityProcesses 和 supportedVersions。pipeline 包含 version、patchVersion、installedPatchVersion、sourceReady、present、installed、state;退出 0 仅表示诊断完成。installed 要求完整文件树校验;生成缓存状态单独报告。verification 列出 mismatches、lineEndingDifferences、error。已安装 UTF-8 文本允许 LF/CRLF 等价,二进制与生成源要求精确字节。outdated/invalid 时关闭目标编辑器后执行 pipeline install --force;npm 更新不修改工程包。"
55
59
  },
56
60
  "exitCodes": {
57
- "0": "success",
58
- "1": "error (fail-closed project/route mismatch: unreadable project or unsupported editor version)"
61
+ "0": "成功。",
62
+ "1": "工程不可读或不匹配已登记的精确版本路由。"
59
63
  },
60
64
  "safety": [
61
- "read-only; never writes the project or the cache",
62
- "fail-closed exact m_EditorVersion + m_EditorVersionWithRevision match (no wildcard, no fallback)",
63
- "queries running Unity.exe processes via PowerShell; a failed query is reported in the unityProcesses output, not fatal"
65
+ "只读,不写入工程或缓存。",
66
+ "精确匹配 m_EditorVersion 和 m_EditorVersionWithRevision,不使用通配匹配。",
67
+ "通过 PowerShell 检查 Unity.exe;查询失败记录在 unityProcesses 中。"
64
68
  ]
65
69
  },
66
70
  {
67
- "path": ["routes"],
71
+ "path": [
72
+ "routes"
73
+ ],
68
74
  "usage": "u-cli-mod routes [options]",
69
75
  "description": "列出所有已配置的 Editor 精确路由",
70
76
  "arguments": [],
@@ -76,19 +82,22 @@
76
82
  ],
77
83
  "output": {
78
84
  "format": "json",
79
- "description": "Object { routes: [...] } with one entry per pinned route: editorVersion, editorRevision, cliVersion, cliSha256, pipelineVersion, pipelineSha256, status."
85
+ "description": "返回 routes 数组,每项包含 editorVersion、editorRevision、cliVersion、cliSha256、pipelineVersion、pipelineSha256 和 status。"
80
86
  },
81
87
  "exitCodes": {
82
- "0": "success",
83
- "1": "error (unpinned editor version or internal error)"
88
+ "0": "成功。",
89
+ "1": "Editor 版本未登记或工具内部错误。"
84
90
  },
85
91
  "safety": [
86
- "read-only; no network access",
87
- "uses only embedded pinned route metadata shipped in the package"
92
+ "只读,不联网。",
93
+ "只使用随包发布的固定路由元数据。"
88
94
  ]
89
95
  },
90
96
  {
91
- "path": ["cli", "install"],
97
+ "path": [
98
+ "cli",
99
+ "install"
100
+ ],
92
101
  "usage": "u-cli-mod cli install [options]",
93
102
  "description": "下载并校验固定版本的 Unity CLI(SHA-256 + Authenticode)",
94
103
  "arguments": [],
@@ -104,28 +113,31 @@
104
113
  ],
105
114
  "output": {
106
115
  "format": "json",
107
- "description": "Object { cacheDir, results: [...] } with one entry per route: editorVersion, cliVersion, path, state (valid|downloaded), sha256."
116
+ "description": "返回 cacheDir 和 results;每项包含 editorVersion、cliVersion、path、state(valid/downloaded)和 sha256。"
108
117
  },
109
118
  "exitCodes": {
110
- "0": "success",
111
- "1": "error (download, size, SHA-256 or Authenticode verification failure)"
119
+ "0": "成功。",
120
+ "1": "下载、大小、SHA-256 或 Authenticode 校验失败。"
112
121
  },
113
122
  "safety": [
114
- "writes only under the user cache: %LOCALAPPDATA%\\editor-pipeline-cli\\cache\\cli",
115
- "downloads from the pinned Unity official CDN HTTPS URL only",
116
- "verifies fixed SHA-256 + expected size + Authenticode signer subject and certificate thumbprint before the binary is placed",
117
- "unverified temp download is deleted on any failure; the final file is created by atomic rename"
123
+ "只写入用户缓存 %LOCALAPPDATA%/editor-pipeline-cli/cache/cli。",
124
+ "只从路由中固定的 Unity 官方 HTTPS 地址下载。",
125
+ "安装前校验 SHA-256、文件大小、Authenticode 签名主体及证书指纹。",
126
+ "失败时清理未验证的临时下载,通过原子重命名创建最终文件。"
118
127
  ]
119
128
  },
120
129
  {
121
- "path": ["pipeline", "install"],
130
+ "path": [
131
+ "pipeline",
132
+ "install"
133
+ ],
122
134
  "usage": "u-cli-mod pipeline install <project> [options]",
123
135
  "description": "按工程 Editor 版本事务式安装适配后的 com.unity.pipeline",
124
136
  "arguments": [
125
137
  {
126
138
  "name": "project",
127
139
  "required": true,
128
- "description": "Path to the Unity project; must contain ProjectSettings/ProjectVersion.txt."
140
+ "description": "Unity 工程路径,必须包含 ProjectSettings/ProjectVersion.txt。"
129
141
  }
130
142
  ],
131
143
  "options": [
@@ -144,29 +156,31 @@
144
156
  ],
145
157
  "output": {
146
158
  "format": "json",
147
- "description": "Install result object: status (Installed|AlreadyInstalled|DryRun), projectPath, editorVersion, editorRevision, pipelineVersion, packagePath, fileCount, backupPath (when replaced), plus sourceDir and sourceFileCount from the caller."
159
+ "description": "返回 status(Installed/AlreadyInstalled/DryRun)、projectPath、编辑器版本、pipelineVersion、packagePath、fileCount、backupPath、sourceDir 和 sourceFileCount。"
148
160
  },
149
161
  "exitCodes": {
150
- "0": "success",
151
- "1": "error (running-Editor guard, integrity or install failure; transactional rollback on any failure)"
162
+ "0": "成功。",
163
+ "1": "编辑器占用、完整性或安装失败;事务失败时回滚。"
152
164
  },
153
165
  "safety": [
154
- "transactional install: stage -> verify -> backup -> replace -> re-verify -> receipt; automatic rollback on any failure",
155
- "fail-closed when a matching Unity Editor is running, unless --allow-running-editor",
156
- "--dry-run never writes the project and never writes a receipt",
157
- "source and destination trees must match the pinned expected-tree (385 files, SHA-256) before and after placement",
158
- "writes only under <project>/Packages/com.unity.pipeline and <project>/Library/editor-pipeline-cli"
166
+ "按暂存、校验、备份、替换、复核、回执执行安装;失败时自动回滚。",
167
+ "目标编辑器运行时拒绝安装,除非明确指定 --allow-running-editor。",
168
+ "--dry-run 不写入工程或回执。",
169
+ "生成源和安装结果均需匹配 expected-tree 中的 385 个文件及 SHA-256。",
170
+ "只写入 <project>/Packages/com.unity.pipeline 和 <project>/Library/editor-pipeline-cli。"
159
171
  ]
160
172
  },
161
173
  {
162
- "path": ["setup"],
174
+ "path": [
175
+ "setup"
176
+ ],
163
177
  "usage": "u-cli-mod setup <project> [options]",
164
- "description": "cli install + pipeline install",
178
+ "description": "依次执行 cli install 和 pipeline install。",
165
179
  "arguments": [
166
180
  {
167
181
  "name": "project",
168
182
  "required": true,
169
- "description": "Path to the Unity project; must contain ProjectSettings/ProjectVersion.txt."
183
+ "description": "Unity 工程路径,必须包含 ProjectSettings/ProjectVersion.txt。"
170
184
  }
171
185
  ],
172
186
  "options": [
@@ -189,28 +203,30 @@
189
203
  ],
190
204
  "output": {
191
205
  "format": "json",
192
- "description": "Object { cli: {path, state, sha256} | null (null with --skip-cli), install: <pipeline install result> }."
206
+ "description": "返回 cli(path、state、sha256)与 install 结果;--skip-cli 时 cli 为 null。"
193
207
  },
194
208
  "exitCodes": {
195
- "0": "success",
196
- "1": "error (any sub-step failure; the pipeline install rolls back)"
209
+ "0": "成功。",
210
+ "1": "任一子步骤失败,Pipeline 安装事务回滚。"
197
211
  },
198
212
  "safety": [
199
- "combines the cli install and pipeline install safety contracts",
200
- "fail-closed running-Editor guard unless --allow-running-editor",
201
- "--dry-run never writes the project",
202
- "--skip-cli avoids all CLI downloads"
213
+ "同时遵循 cli install 和 pipeline install 的执行边界。",
214
+ "目标编辑器运行时拒绝操作,除非明确指定 --allow-running-editor。",
215
+ "--dry-run 不写入工程。",
216
+ "--skip-cli 不下载 CLI。"
203
217
  ]
204
218
  },
205
219
  {
206
- "path": ["exec"],
220
+ "path": [
221
+ "exec"
222
+ ],
207
223
  "usage": "u-cli-mod exec <project> [options] -- <unity-cli-args...>",
208
224
  "description": "调用路由 CLI 执行 Unity Pipeline 命令;--project-path 由工具统一绑定",
209
225
  "arguments": [
210
226
  {
211
227
  "name": "project",
212
228
  "required": true,
213
- "description": "Path to the Unity project; must contain ProjectSettings/ProjectVersion.txt."
229
+ "description": "Unity 工程路径,必须包含 ProjectSettings/ProjectVersion.txt。"
214
230
  }
215
231
  ],
216
232
  "options": [
@@ -225,24 +241,27 @@
225
241
  ],
226
242
  "output": {
227
243
  "format": "text",
228
- "description": "Unity CLI stdout/stderr pass through verbatim (stdio inherit); the wrapper prints no JSON of its own. When the wait budget expires the child keeps running and the wrapper prints the log path plus the status command to poll."
244
+ "description": "原样透传 Unity CLI 的标准输出和错误;达到等待时间后后台进程继续运行,返回日志路径和状态查询命令。"
229
245
  },
230
246
  "exitCodes": {
231
- "0": "success",
232
- "1": "guard or wrapper error (project-path override, missing or tampered CLI)",
233
- "N": "the Unity CLI's own exit code is propagated verbatim"
247
+ "0": "成功。",
248
+ "1": "参数覆盖、CLI 缺失或篡改等调用边界检查失败。",
249
+ "N": "原样返回 Unity CLI 的退出码。"
234
250
  },
235
251
  "safety": [
236
- "re-verifies the pinned CLI SHA-256 before every invocation (fail-closed on tamper)",
237
- "rejects every --project-path variant (case-insensitive: --project-path, --projectPath, -projectPath, --project_path, mixed case)",
238
- "always appends the resolved --project-path as the final argument; the wrapper owns project targeting",
239
- "no route fallback: the project must match a pinned route exactly",
240
- "the documented -- separator is consumed by the wrapper and never forwarded to the Unity CLI",
241
- "long-running pipeline commands (run_tests) hand control back after 5s by default instead of blocking on the CLI 30s wait cap; the task keeps running inside the Editor — poll test_status, and pass --wait <seconds> to wait synchronously"
252
+ "每次调用前复核固定 CLI 的 SHA-256,校验失败时拒绝执行。",
253
+ "拒绝调用方提供任何 --project-path 大小写或拼写变体。",
254
+ "在末尾附加解析后的 --project-path,由工具确定目标工程。",
255
+ "工程必须精确匹配固定路由。",
256
+ "参数分隔符 -- 由工具消费,不传给 Unity CLI。",
257
+ "长任务默认等待 5 秒后返回,任务继续在编辑器运行;用 test_status 查询,可通过 --wait 指定同步等待时长。"
242
258
  ]
243
259
  },
244
260
  {
245
- "path": ["cache", "clean"],
261
+ "path": [
262
+ "cache",
263
+ "clean"
264
+ ],
246
265
  "usage": "u-cli-mod cache clean [options]",
247
266
  "description": "清理下载缓存与生成的适配包",
248
267
  "arguments": [],
@@ -254,15 +273,15 @@
254
273
  ],
255
274
  "output": {
256
275
  "format": "json",
257
- "description": "Object { cacheRoot, removed: [absolute directory paths that were removed] }."
276
+ "description": "返回 cacheRoot 与 removed 路径列表。"
258
277
  },
259
278
  "exitCodes": {
260
- "0": "success",
261
- "1": "error"
279
+ "0": "成功。",
280
+ "1": "失败。"
262
281
  },
263
282
  "safety": [
264
- "removes only directories under the user cache root %LOCALAPPDATA%\\editor-pipeline-cli",
265
- "default scope: generated packages + pipeline downloads only; without --all the CLI cache and logs are preserved"
283
+ "只清理 %LOCALAPPDATA%/editor-pipeline-cli 缓存根下的目录。",
284
+ "默认只清理生成包和 Pipeline 下载;未指定 --all 时保留 CLI 缓存与日志。"
266
285
  ]
267
286
  }
268
287
  ],
@@ -270,247 +289,253 @@
270
289
  {
271
290
  "group": "GameObject / 组件",
272
291
  "tools": {
273
- "add_component": "Add a component (by type name) to a GameObject.",
274
- "create_gameobject": "Create an empty GameObject or a built-in primitive (cube/sphere/capsule/cylinder/plane/quad) in the active scene.",
275
- "create_gameobjects": "Batch-create N empty GameObjects or primitives in one call. Optional positions/rotations/scales are arrays of [x,y,z] (length must equal count). Returns the created identities.",
276
- "delete_gameobject": "Delete a GameObject from the scene (reversible via Undo).",
277
- "find_gameobjects": "Find GameObjects in loaded scenes by name, tag, component type, and/or hierarchy path (filters are combined). Returns structured identities.",
278
- "get_component_properties": "Get a component's serialized properties as a JSON map. Address the component by handle, or by GameObject handle + type.",
279
- "remove_component": "Remove a component from a GameObject. Provide either a component handle (target) or a GameObject handle (target) plus a type name.",
280
- "rename_gameobject": "Rename a GameObject.",
281
- "set_active": "Set a GameObject's active self-state (activeSelf).",
282
- "set_component_properties": "Set serialized properties on a component (one Undo step). 'properties' maps property name -> value; object references accept an ObjectRef handle.",
283
- "set_layer": "Set a GameObject's layer by name or numeric index (0-31).",
284
- "set_parent": "Reparent a GameObject under a new parent, or detach it to scene root when no parent is given.",
285
- "set_tag": "Set a GameObject's tag (the tag must already exist in the project).",
286
- "set_transform": "Set a GameObject's local position/rotation(euler)/scale. Omitted channels are left unchanged."
292
+ "add_component": "添加组件。",
293
+ "create_gameobject": "创建场景对象。",
294
+ "create_gameobjects": "批量创建场景对象。",
295
+ "delete_gameobject": "删除场景对象,支持撤销。",
296
+ "find_gameobjects": "按名称、标签、组件或层级路径查找场景对象。",
297
+ "get_component_properties": "读取组件序列化属性。",
298
+ "remove_component": "移除指定组件。",
299
+ "rename_gameobject": "重命名场景对象。",
300
+ "set_active": "设置对象激活状态。",
301
+ "set_component_properties": "设置组件序列化属性,支持 ObjectRef 引用。",
302
+ "set_layer": "设置对象层,编号范围 0–31。",
303
+ "set_parent": "设置父对象;未指定父对象时移至场景根。",
304
+ "set_tag": "设置工程中已存在的标签。",
305
+ "set_transform": "设置局部坐标、欧拉旋转和缩放,省略项不变。"
287
306
  }
288
307
  },
289
308
  {
290
309
  "group": "场景",
291
310
  "tools": {
292
- "add_scene_to_build": "Add a scene to the Build Settings scene list (idempotent). Optionally enable it.",
293
- "create_scene": "Create a new scene and save it to the given path under the authoring root.",
294
- "get_scene_hierarchy": "Return the GameObject tree of an open scene (or the active scene). Each node carries instanceId + hierarchyPath usable by GameObject commands.",
295
- "list_open_scenes": "List all currently open scenes with their load/active/dirty state.",
296
- "open_scene": "Open an existing scene from the given path.",
297
- "remove_scene_from_build": "Remove a scene from the Build Settings scene list (idempotent).",
298
- "save_all": "Save all open scenes that have unsaved changes.",
299
- "save_scene": "Save an open scene. Saves the active scene when no path is given.",
300
- "set_active_scene": "Set which open scene is the active scene (new objects are created in the active scene)."
311
+ "add_scene_to_build": "将场景加入构建列表。",
312
+ "create_scene": "创建并保存场景。",
313
+ "get_scene_hierarchy": "读取场景层级及 instanceId、hierarchyPath。",
314
+ "list_open_scenes": "列出已打开场景及加载、激活、未保存状态。",
315
+ "open_scene": "打开场景。",
316
+ "remove_scene_from_build": "从构建列表移除场景。",
317
+ "save_all": "保存所有已修改场景和资源。",
318
+ "save_scene": "保存场景。",
319
+ "set_active_scene": "设置活动场景。"
301
320
  }
302
321
  },
303
322
  {
304
323
  "group": "资源 / 文件",
305
324
  "tools": {
306
- "copy_asset": "Copy an asset to a new path under the authoring root. The copy gets a fresh GUID.",
307
- "create_asset": "Create a new ScriptableObject (or other UnityEngine.Object) asset of the given type at a path under the authoring root.",
308
- "create_folder": "Create a folder under the authoring root (creates intermediate folders).",
309
- "delete_asset": "Delete an asset from the project. Destructive: requires confirm=true.",
310
- "find_assets": "Find assets by type and/or name and/or label, returning their path, GUID and type. At least one filter is required.",
311
- "get_import_settings": "Read an asset's import settings, structured by importer type (texture/model/audio), including the default-platform fields and (for textures/audio) one platform override block.",
312
- "import_asset": "Import an external file (e.g. a texture, model, audio clip) into the project by copying it to a path under the authoring root, then importing it.",
313
- "move_asset": "Move (or rename via a new path) an asset to a new location under the authoring root. Preserves the asset's GUID.",
314
- "read_text_file": "Read a UTF-8 text file under the authoring root and return its contents.",
315
- "rename_asset": "Rename an asset in place (keeps it in the same folder, keeps its GUID).",
316
- "set_import_settings": "Set import settings on an asset's AssetImporter (default platform top-level properties, or a texture/audio per-platform override) and re-import it.",
317
- "write_text_file": "Write UTF-8 text to a file under the authoring root, then import it. Overwriting an existing file requires confirm=true."
325
+ "copy_asset": "复制资源。",
326
+ "create_asset": "创建指定类型的资源。",
327
+ "create_folder": "创建目录。",
328
+ "delete_asset": "删除资源。需要 confirm=true。",
329
+ "find_assets": "查找资源。",
330
+ "get_import_settings": "读取资源导入设置。",
331
+ "import_asset": "导入或重新导入资源。",
332
+ "move_asset": "移动资源。",
333
+ "read_text_file": "读取文本文件。",
334
+ "rename_asset": "重命名资源。",
335
+ "set_import_settings": "设置资源导入参数。",
336
+ "write_text_file": "写入文本文件。需要 confirm=true。"
318
337
  }
319
338
  },
320
339
  {
321
340
  "group": "预制体",
322
341
  "tools": {
323
- "apply_prefab_overrides": "Apply a prefab instance's overrides back to its source prefab asset.",
324
- "create_prefab": "Save a GameObject as a prefab asset at a project path; the source becomes a connected instance.",
325
- "create_prefab_variant": "Create a prefab variant asset that inherits from a base prefab.",
326
- "instantiate_prefab": "Instantiate a prefab asset into a loaded scene and return the created instance.",
327
- "revert_prefab_overrides": "Revert a prefab instance's overrides so it matches its source prefab asset.",
328
- "save_prefab_contents": "Open a prefab asset in an isolated prefab stage, apply a declarative edit, and save it back (nested-prefab safe).",
329
- "unpack_prefab": "Unpack a prefab instance into plain GameObjects (outermost level or completely)."
342
+ "apply_prefab_overrides": "将实例覆盖应用到预制体。",
343
+ "create_prefab": "从场景对象创建预制体。",
344
+ "create_prefab_variant": "创建预制体变体。",
345
+ "instantiate_prefab": "将预制体实例化到场景。",
346
+ "revert_prefab_overrides": "还原预制体实例覆盖。",
347
+ "save_prefab_contents": "保存预制体内容。",
348
+ "unpack_prefab": "解包预制体实例。"
330
349
  }
331
350
  },
332
351
  {
333
352
  "group": "材质 / 着色器",
334
353
  "tools": {
335
- "get_material_properties": "Read a material's shader, render queue, enabled keywords, and all shader properties with their current values (Color as [r,g,b,a], Vector as [x,y,z,w], Texture as an object reference).",
336
- "get_shader_properties": "Introspect a shader's declared property list (name, description, type Color|Vector|Float|Range|TexEnv|Int, range, textureDimension, flags). Provide 'shader' (by name) OR 'material' (read the shader off that material).",
337
- "list_shaders": "Discover available shaders so an agent can pick a valid name for set_material_properties / create_asset. Returns [{ name, assetPath|null, isBuiltin, isSupported }].",
338
- "set_material_properties": "Set shader properties on a material (Float/Range/Int=number; Color=[r,g,b,a] or \"#RRGGBBAA\" hex; Vector=[x,y,z,w]; Texture=an object reference or null to clear), optionally reassign the shader, set the render queue, and toggle keywords. Unknown names / type mismatches are reported in unknown[]."
354
+ "get_material_properties": "读取材质属性。",
355
+ "get_shader_properties": "读取着色器属性。",
356
+ "list_shaders": "列出着色器。",
357
+ "set_material_properties": "设置材质属性。"
339
358
  }
340
359
  },
341
360
  {
342
361
  "group": "脚本 / 编译 / 求值",
343
362
  "tools": {
344
- "attach_script": "Add a MonoBehaviour to a GameObject by its (compiled) type name OR by its script asset path. Provide exactly one of 'type' or 'script'. If the type isn't compiled yet, returns a recoverable error: recompile, poll recompile_status, then retry.",
345
- "cleanup_hotreload": "Remove old hot reload DLL versions and clear registry",
346
- "create_script": "Create a new C# script (default base class MonoBehaviour) from a template under the authoring root. NOTE: the type does not exist until a recompile completes — to attach it, call recompile, poll recompile_status, then attach_script.",
347
- "eval": "Evaluate C# code dynamically using Roslyn compiler",
348
- "eval_file": "Evaluate C# code read from a .cs file on disk",
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
- "hotreload_status": "Show current hot reload registry status and statistics",
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 (optional run_id for correlated query).",
353
- "reload_file": "Compile and apply in-place [HotReload] edits from a source file",
354
- "reload_file_override": "Compile and apply hot reload file changes immediately",
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)."
363
+ "attach_script": "将脚本组件添加到对象。",
364
+ "cleanup_hotreload": "清理热重载资源。",
365
+ "create_script": "创建脚本文件。",
366
+ "eval": "执行 C# 表达式或代码。",
367
+ "eval_file": "执行文件中的 C# 代码。",
368
+ "get_serialized_fields": "读取序列化字段。",
369
+ "hotreload_status": "查询热重载状态。",
370
+ "recompile": "触发编译并返回运行身份。",
371
+ "recompile_status": "按 run_id 查询编译;无法关联时返回 unknown_run。",
372
+ "reload_file": "重载脚本文件。",
373
+ "reload_file_override": "重载脚本并明确应用覆盖。",
374
+ "set_serialized_field": "设置序列化字段。"
356
375
  }
357
376
  },
358
377
  {
359
378
  "group": "动画 / Timeline",
360
379
  "tools": {
361
- "add_animator_layer": "Add a layer to an AnimatorController.",
362
- "add_animator_parameter": "Add a parameter (Float | Int | Bool | Trigger) to an AnimatorController. A duplicate name returns code 'duplicate_parameter'.",
363
- "add_animator_state": "Add a state to a layer, optionally with a motion (AnimationClip or BlendTree) and as the layer default. A layer name with no match returns code 'layer_not_found'.",
364
- "add_animator_transition": "Add a transition between two states (or from AnyState/Entry, to Exit) on a layer, with optional conditions. Validates that the states exist and each condition's parameter exists and its mode matches the parameter type.",
365
- "add_timeline_clip": "Add a clip to a named track on a TimelineAsset. For Animation tracks pass an AnimationClip asset; for Audio tracks an AudioClip. Requires the com.unity.timeline package.",
366
- "add_timeline_track": "Add a track (Animation | Audio | Activation | Control | Playable | Signal | Marker) to a TimelineAsset, optionally nested under a parent group/track. Requires the com.unity.timeline package.",
367
- "create_animation_clip": "Create an empty .anim AnimationClip asset under the authoring root, with an optional frame rate and loop flag.",
368
- "create_animator_controller": "Create an .controller AnimatorController asset (with a default Base Layer) under the authoring root.",
369
- "create_timeline": "Create a .playable TimelineAsset under the authoring root (optional frame rate). Requires the com.unity.timeline package.",
370
- "get_animation_clip": "Read an AnimationClip's metadata and all float curve bindings (optionally with keyframes).",
371
- "get_animator_controller": "Read an AnimatorController's full structure: parameters, layers, states (with motion / default), and transitions (with conditions).",
372
- "get_timeline": "Read a TimelineAsset's structure: frame rate, duration, and its tracks with their clips. Requires the com.unity.timeline package.",
373
- "remove_animation_curve": "Remove a float curve binding from an AnimationClip (SetEditorCurve(clip, binding, null)). Destructive: requires confirm=true.",
374
- "set_animation_curve": "Add or replace a single float curve binding on an AnimationClip (via AnimationUtility.SetEditorCurve). Replacing an existing binding overwrites it rather than duplicating."
380
+ "add_animator_layer": "添加动画控制器层。",
381
+ "add_animator_parameter": "添加动画参数。",
382
+ "add_animator_state": "添加动画状态。",
383
+ "add_animator_transition": "添加动画过渡。",
384
+ "add_timeline_clip": "添加 Timeline 片段。",
385
+ "add_timeline_track": "添加 Timeline 轨道。",
386
+ "create_animation_clip": "创建动画片段。",
387
+ "create_animator_controller": "创建动画控制器。",
388
+ "create_timeline": "创建 Timeline。",
389
+ "get_animation_clip": "读取动画片段。",
390
+ "get_animator_controller": "读取动画控制器。",
391
+ "get_timeline": "读取 Timeline。",
392
+ "remove_animation_curve": "移除动画曲线。需要 confirm=true。",
393
+ "set_animation_curve": "设置动画曲线。"
375
394
  }
376
395
  },
377
396
  {
378
397
  "group": "构建",
379
398
  "tools": {
380
- "build": "Trigger an async Player build and report the full BuildReport. Returns immediately (queued); poll build_status until status is 'completed'. DetailedBuildReport is included by default unless 'options' is supplied. Use dry_run to validate without building.",
381
- "build_status": "Status of the current/most recent build: idle | queued | building | completed, with the full BuildReport (files, packedAssets, buildSteps, errors, warnings) once completed. Retained until the next build.",
382
- "get_build_settings": "Read the current build configuration from EditorUserBuildSettings / EditorBuildSettings.",
383
- "list_build_profiles": "List Build Profile assets in the project (Unity 6 only). Returns feature_unavailable on earlier versions.",
384
- "list_build_targets": "List the known BuildTarget values with their group and whether build support is installed.",
385
- "set_build_settings": "Set mutable EditorUserBuildSettings fields. Does NOT manage scenes (use add_scene_to_build / remove_scene_from_build) or switch target (use switch_build_target). Use dry_run to preview.",
386
- "switch_build_target": "Switch the active build target (destructive, long-running: triggers a full reimport + domain reload). Requires confirm=true. Returns immediately; poll switch_build_target_status.",
387
- "switch_build_target_status": "Status of the last target switch: idle | switching | completed (with success + activeBuildTarget)."
399
+ "build": "执行构建。可用 dry_run 预演。",
400
+ "build_status": "查询构建状态。",
401
+ "get_build_settings": "读取构建设置。",
402
+ "list_build_profiles": "列出构建配置。",
403
+ "list_build_targets": "列出构建目标。",
404
+ "set_build_settings": "设置构建参数。可用 dry_run 预演。",
405
+ "switch_build_target": "切换构建目标。需要 confirm=true。",
406
+ "switch_build_target_status": "查询构建目标切换结果。"
388
407
  }
389
408
  },
390
409
  {
391
410
  "group": "包管理",
392
411
  "tools": {
393
- "package_add": "Add a UPM package by name@version, git URL, or 'file:' local path. Async by default (returns in_progress; poll package_status); pass wait=true to block until added. A recompile/domain reload follows — poll recompile_status. Requires confirm=true; use dry_run to preview.",
394
- "package_list": "List packages by scope: installed (default) | available (registry) | all (both). Returns the full result synchronously — available/all block until the registry query completes.",
395
- "package_remove": "Remove a UPM package by name. Async by default (returns in_progress; poll package_status); pass wait=true to block until removed. A recompile/domain reload follows — poll recompile_status. Requires confirm=true; use dry_run to preview.",
396
- "package_resolve": "Resolve/refresh packages from the manifest (re-fetch and re-link). May trigger a recompile/domain reload — poll recompile_status. Its outcome is recorded for package_status.",
397
- "package_search": "Search packages available in the registry. Provide a name (e.g. com.unity.foo) or omit to list all. Returns the full result synchronously (blocks until the registry query completes).",
398
- "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."
412
+ "package_add": "添加 UPM 包。需要 confirm=true。可用 dry_run 预演。异步操作查询 package_status;涉及编译时继续查询 recompile_status。",
413
+ "package_list": "列出已安装或注册表中的 UPM 包。",
414
+ "package_remove": "移除 UPM 包。需要 confirm=true。可用 dry_run 预演。异步操作查询 package_status;涉及编译时继续查询 recompile_status。",
415
+ "package_resolve": "解析工程包依赖。异步操作查询 package_status;涉及编译时继续查询 recompile_status。",
416
+ "package_search": "搜索注册表包。",
417
+ "package_status": "查询包操作状态。"
399
418
  }
400
419
  },
401
420
  {
402
421
  "group": "测试",
403
422
  "tools": {
404
- "cancel_tests": "Cancel running test execution (optional run_id for directed cancel; mismatch = no side effects)",
405
- "list_tests": "List all available tests (EditMode and/or PlayMode) without running them",
406
- "run_tests": "Execute Unity tests with filtering options",
407
- "test_status": "Get status of running async test execution (optional run_id for correlated query; unknown_run otherwise)"
423
+ "cancel_tests": "按 run_id 取消测试;不匹配时不产生副作用。",
424
+ "list_tests": "列出 EditMode 或 PlayMode 测试。",
425
+ "run_tests": "按过滤条件执行测试;全量使用 --async_tests。",
426
+ "test_status": "按 run_id 查询测试;无法关联时返回 unknown_run。"
408
427
  }
409
428
  },
410
429
  {
411
430
  "group": "烘焙(光照 / NavMesh / 遮挡)",
412
431
  "tools": {
413
- "bake_lighting": "Trigger an async lightmap bake of the open scene(s) via Lightmapping.BakeAsync(). Returns immediately; poll lighting_bake_status until completed.",
414
- "bake_navmesh": "Trigger an async legacy NavMesh bake of the open scene(s) via UnityEditor.AI.NavMeshBuilder. Returns immediately; poll navmesh_bake_status until completed.",
415
- "bake_navmesh_surfaces": "Bake NavMeshSurface components (AI Navigation package). v1 stub: returns package_not_found when the package is absent.",
416
- "bake_occlusion_culling": "Trigger an async occlusion-culling bake of the open scene(s) via StaticOcclusionCulling.GenerateInBackground(). Returns immediately; poll occlusion_bake_status until completed.",
417
- "cancel_lighting_bake": "Cancel an in-progress lighting bake (Lightmapping.Cancel()).",
418
- "cancel_navmesh_bake": "Cancel an in-progress NavMesh bake (NavMeshBuilder.Cancel()).",
419
- "cancel_occlusion_bake": "Cancel an in-progress occlusion bake (StaticOcclusionCulling.Cancel()).",
420
- "clear_baked_lighting": "Clear baked lightmap data for the open scene(s). Destructive: requires confirm=true.",
421
- "clear_navmesh": "Clear the baked NavMesh for the open scene(s). Destructive: requires confirm=true.",
422
- "clear_occlusion_culling": "Clear baked occlusion-culling data for the open scene(s). Destructive: requires confirm=true.",
423
- "get_lighting_settings": "Read the active LightingSettings (lightmapper, bounces, resolution, directional mode, AO, etc.).",
424
- "get_navmesh_settings": "Read the default agent's legacy NavMesh bake settings (agentRadius/Height/Slope/Climb, minRegionArea, voxelSize).",
425
- "lighting_bake_status": "Get the status of the last lighting bake: idle | baking | completed.",
426
- "navmesh_bake_status": "Get the status of the last NavMesh bake: idle | baking | completed.",
427
- "occlusion_bake_status": "Get the status of the last occlusion bake: idle | baking | completed.",
428
- "set_lighting_settings": "Apply a subset of lighting settings to the active LightingSettings. Returns { applied[], unknown[] }.",
429
- "set_navmesh_settings": "Apply a subset of legacy NavMesh bake settings to the default agent. Returns { applied[], unknown[] }."
432
+ "bake_lighting": "异步烘焙光照。",
433
+ "bake_navmesh": "异步烘焙导航网格。",
434
+ "bake_navmesh_surfaces": "烘焙 NavMeshSurface;缺少 AI Navigation 包时返回 package_not_found。",
435
+ "bake_occlusion_culling": "异步烘焙遮挡剔除。",
436
+ "cancel_lighting_bake": "取消光照烘焙。",
437
+ "cancel_navmesh_bake": "取消导航网格烘焙。",
438
+ "cancel_occlusion_bake": "取消遮挡剔除烘焙。",
439
+ "clear_baked_lighting": "清理烘焙光照数据。需要 confirm=true。",
440
+ "clear_navmesh": "清理导航网格。需要 confirm=true。",
441
+ "clear_occlusion_culling": "清理遮挡剔除数据。需要 confirm=true。",
442
+ "get_lighting_settings": "读取光照烘焙设置。",
443
+ "get_navmesh_settings": "读取导航网格设置。",
444
+ "lighting_bake_status": "查询光照烘焙状态。",
445
+ "navmesh_bake_status": "查询导航网格烘焙状态。",
446
+ "occlusion_bake_status": "查询遮挡剔除烘焙状态。",
447
+ "set_lighting_settings": "设置光照烘焙参数,返回 applied 和 unknown。",
448
+ "set_navmesh_settings": "设置导航网格参数。"
430
449
  }
431
450
  },
432
451
  {
433
452
  "group": "截图 / 捕获",
434
453
  "tools": {
435
- "capture_editor_element": "Capture a UI Toolkit VisualElement (by selector) from an EditorWindow to a PNG; returns path + base64.",
436
- "capture_game_view": "Render the game view to a PNG. source=camera (default) renders a camera and misses Screen Space - Overlay UI; source=screen captures the composited backbuffer incl. overlay canvases (Play Mode only). Returns it inline as base64, unless save_path is set (path-only result; pass include_inline_image=true to get both).",
437
- "capture_runtime_element": "Capture a UI Toolkit VisualElement (by selector) from a live runtime panel (UIDocument or PanelRenderer) to a PNG; returns path + base64.",
438
- "capture_scene_view": "Render the active Scene View to a PNG. Returns it inline as base64, unless save_path is set (path-only result; pass include_inline_image=true to get both).",
439
- "screenshot": "Capture the Scene or Game view as a PNG and return its file path"
454
+ "capture_editor_element": "截取编辑器 UI Toolkit 元素。",
455
+ "capture_game_view": "截取游戏视图;source=screen 需要运行模式并包含叠加画布,source=camera 按相机渲染。设置 save_path 时默认只返回路径,include_inline_image=true 可同时返回图片。",
456
+ "capture_runtime_element": "截取运行时 UI Toolkit 元素。",
457
+ "capture_scene_view": "截取当前场景视图。设置 save_path 时默认只返回路径,include_inline_image=true 可同时返回图片。",
458
+ "screenshot": "截取场景或游戏视图并返回文件路径。"
440
459
  }
441
460
  },
442
461
  {
443
462
  "group": "编辑器控制",
444
463
  "tools": {
445
- "editor_focus": "Bring the Unity Editor window to the foreground",
446
- "editor_pause": "Toggle pause state of Unity Editor play mode",
447
- "editor_play": "Enter Unity Editor play mode",
448
- "editor_status": "Get detailed Unity Editor status and state information",
449
- "editor_stop": "Exit Unity Editor play mode",
450
- "menu": "Execute an Editor menu item by path, or list available items when no path is given",
451
- "set_autotick": "Keep the editor ticking while unfocused by forcing EditorApplication.SignalTick at a throttled rate"
464
+ "editor_focus": "激活 Unity Editor 窗口。",
465
+ "editor_pause": "切换运行模式的暂停状态。",
466
+ "editor_play": "进入运行模式。",
467
+ "editor_status": "读取编辑器状态。",
468
+ "editor_stop": "退出运行模式。",
469
+ "menu": "执行或列出菜单项。",
470
+ "set_autotick": "在窗口失焦时保持编辑器周期更新。"
452
471
  }
453
472
  },
454
473
  {
455
474
  "group": "可观测性 / 审计",
456
475
  "tools": {
457
- "audit": "Run a Project Auditor static-analysis scan. Returns immediately; poll audit_status until status is 'completed', then read the CSV.",
458
- "audit_status": "Get the status of the last audit: idle | scanning | completed | failed | interrupted | unavailable.",
459
- "clear_console": "Clear the Unity Editor Console and all captured pipeline console buffers.",
460
- "console": "Get captured Unity console output (Editor or Player; supports tail, level filtering, and follow via a cursor)",
461
- "get_console_logs": "Read the current Unity Editor Console (compatibility alias for read_console).",
462
- "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.",
463
- "get_performance_stats": "Read render, memory, and frame-timing stats (structured, read-only).",
464
- "log": "Write a message to Unity console"
476
+ "audit": "记录或查询编辑器审计信息。",
477
+ "audit_status": "查询审计状态。",
478
+ "clear_console": "清空 Console。",
479
+ "console": "读取回调捕获的日志流,支持游标跟随。",
480
+ "get_console_logs": "读取原生 Console 日志。",
481
+ "read_console": "读取原生 Console 日志,按类型和数量过滤。",
482
+ "get_performance_stats": "读取性能统计。",
483
+ "log": "写入 Console 日志。"
465
484
  }
466
485
  },
467
486
  {
468
487
  "group": "项目设置",
469
488
  "tools": {
470
- "get_audio_settings": "Read project Audio settings (volume, rolloff scale, doppler factor).",
471
- "get_graphics_settings": "Read GraphicsSettings (default render pipeline).",
472
- "get_input_settings": "Read the legacy Input Manager axes (names and count).",
473
- "get_physics_settings": "Read Physics settings (gravity, solver iterations, bounce threshold).",
474
- "get_player_settings": "Read PlayerSettings (company/product/version, scripting backend, API level).",
475
- "get_quality_settings": "Read QualitySettings (current level, level names, vSync, anti-aliasing).",
476
- "get_tags_layers": "Read the project's tags and (named) layers.",
477
- "get_time_settings": "Read Time settings (fixedDeltaTime, maximumDeltaTime, timeScale).",
478
- "set_audio_settings": "Change project Audio settings. Requires confirm=true; use dry_run to preview. Not undoable via Ctrl+Z.",
479
- "set_graphics_settings": "Set the default render pipeline asset. Requires confirm=true; use dry_run to preview. Not undoable via Ctrl+Z.",
480
- "set_input_settings": "Tune a legacy Input Manager axis (sensitivity/gravity/dead) by name. Requires confirm=true; use dry_run to preview. Not undoable via Ctrl+Z.",
481
- "set_physics_settings": "Change Physics settings. Requires confirm=true; use dry_run to preview. Not undoable via Ctrl+Z.",
482
- "set_player_settings": "Change PlayerSettings. Requires confirm=true; use dry_run to preview. Not undoable via Ctrl+Z. Scripting backend / API level changes trigger a domain reload.",
483
- "set_quality_settings": "Change QualitySettings. Requires confirm=true; use dry_run to preview. Not undoable via Ctrl+Z.",
484
- "set_tags_layers": "Add/remove tags and assign user layer names (index 8-31). Requires confirm=true; use dry_run to preview. Not undoable via Ctrl+Z.",
485
- "set_time_settings": "Change Time settings. Requires confirm=true; use dry_run to preview. Not undoable via Ctrl+Z."
489
+ "get_audio_settings": "读取音频设置。",
490
+ "get_graphics_settings": "读取图形设置。",
491
+ "get_input_settings": "读取输入设置。",
492
+ "get_physics_settings": "读取物理设置。",
493
+ "get_player_settings": "读取应用设置。",
494
+ "get_quality_settings": "读取质量设置。",
495
+ "get_tags_layers": "读取标签与层。",
496
+ "get_time_settings": "读取时间设置。",
497
+ "set_audio_settings": "修改音频设置。需要 confirm=true。可用 dry_run 预演。",
498
+ "set_graphics_settings": "修改图形设置。需要 confirm=true。可用 dry_run 预演。",
499
+ "set_input_settings": "修改输入设置。需要 confirm=true。可用 dry_run 预演。",
500
+ "set_physics_settings": "修改物理设置。需要 confirm=true。可用 dry_run 预演。",
501
+ "set_player_settings": "修改应用设置。需要 confirm=true。可用 dry_run 预演。",
502
+ "set_quality_settings": "修改质量设置。需要 confirm=true。可用 dry_run 预演。",
503
+ "set_tags_layers": "修改标签与层。需要 confirm=true。可用 dry_run 预演。",
504
+ "set_time_settings": "修改时间设置。需要 confirm=true。可用 dry_run 预演。"
486
505
  }
487
506
  },
488
507
  {
489
508
  "group": "运行时 / 输入模拟",
490
509
  "tools": {
491
- "quit": "Gracefully quit the Unity application",
492
- "runtime_status": "Get comprehensive runtime application status",
493
- "set_target_framerate": "Set the target frame rate for the application",
494
- "set_timescale": "Set the time scale for the application",
495
- "simulate_key": "Simulate a keyboard key event (Input System). Drives the running app.",
496
- "simulate_pointer": "Simulate a mouse/pointer event at screen coordinates (Input System)."
510
+ "quit": "正常退出 Unity 应用。",
511
+ "runtime_status": "读取运行时状态。",
512
+ "set_target_framerate": "设置目标帧率。",
513
+ "set_timescale": "设置时间缩放。",
514
+ "simulate_key": "模拟键盘事件。",
515
+ "simulate_pointer": "模拟指针事件。"
497
516
  }
498
517
  },
499
518
  {
500
519
  "group": "选择 / 搜索",
501
520
  "tools": {
502
- "get_selection": "Read the current Editor selection as structured object identities.",
503
- "search": "Run a Unity Search query and return structured results.",
504
- "set_selection": "Set the Editor selection to the given assets/scene objects."
521
+ "get_selection": "读取当前选择的对象身份。",
522
+ "search": "执行 Unity Search 查询。",
523
+ "set_selection": "设置当前选择。"
505
524
  }
506
525
  },
507
526
  {
508
527
  "group": "Authoring 根路径",
509
528
  "tools": {
510
- "get_authoring_root": "Get the base folder (under Assets/) that bare authoring paths resolve against.",
511
- "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."
529
+ "get_authoring_root": "读取资源编辑根目录。",
530
+ "set_authoring_root": "设置并约束资源编辑根目录。"
512
531
  }
513
532
  }
514
533
  ]
515
- }
534
+ },
535
+ "skills": [
536
+ {
537
+ "id": "unity",
538
+ "path": "skills/unity/SKILL.md"
539
+ }
540
+ ]
516
541
  }