@alpsckr/unitycli 0.4.1 → 0.4.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/README.md +15 -12
- package/contracts/init-contract.json +11 -4
- package/contracts/package-files.json +3 -3
- package/dist/cli-commands/init-discovery.d.ts +9 -2
- package/dist/cli-commands/init-discovery.js +60 -50
- package/dist/cli-commands/init-discovery.js.map +1 -1
- package/dist/cli-commands/init-help.js +13 -9
- package/dist/cli-commands/init-help.js.map +1 -1
- package/dist/cli-commands/init-skill.d.ts +1 -1
- package/dist/cli-commands/init-skill.js +92 -26
- package/dist/cli-commands/init-skill.js.map +1 -1
- package/dist/cli-commands/package.js +59 -12
- package/dist/cli-commands/package.js.map +1 -1
- package/dist/cli-commands/skill-installer.d.ts +15 -7
- package/dist/cli-commands/skill-installer.js +106 -66
- package/dist/cli-commands/skill-installer.js.map +1 -1
- package/dist/cli-commands/types.d.ts +3 -0
- package/dist/cli.js +5 -3
- package/dist/cli.js.map +1 -1
- package/dist/package-manager.d.ts +5 -1
- package/dist/package-manager.js +21 -9
- package/dist/package-manager.js.map +1 -1
- package/dist/unity-project-processes.d.ts +7 -0
- package/dist/unity-project-processes.js +54 -0
- package/dist/unity-project-processes.js.map +1 -1
- package/docs/architecture.md +3 -3
- package/docs/error-codes.md +16 -0
- package/docs/extensions.md +3 -1
- package/package.json +1 -1
- package/schemas/init.schema.json +95 -10
- package/skills/unitycli/SKILL.md +1 -1
- package/skills/unitycli/manifest.json +1 -1
- package/skills/unitycli/references/operation-protocol.md +1 -1
- package/skills/unitycli/reports/output_quality_scorecard.md +1 -1
- package/skills/unitycli/reports/trust-report.md +1 -1
- package/unitypkg/package.json +1 -1
package/docs/extensions.md
CHANGED
|
@@ -16,6 +16,8 @@ Bridge 与 AI Skill 是两个独立安装对象。先用安装协议发现并选
|
|
|
16
16
|
unitycli init help
|
|
17
17
|
unitycli init discover
|
|
18
18
|
unitycli init package --project C:\path\UnityProject
|
|
19
|
+
# 仅在用户批准正常关闭这个准确项目后使用
|
|
20
|
+
unitycli init package --project C:\path\UnityProject --close-editor
|
|
19
21
|
unitycli init package --project C:\path\UnityProject --check
|
|
20
22
|
```
|
|
21
23
|
|
|
@@ -24,7 +26,7 @@ Bridge 安装内容:
|
|
|
24
26
|
- `Packages/unitycli.install.json` — 安装元数据(项目 hash、source hash、managed-file hash、版本与支持范围)
|
|
25
27
|
- `Packages/com.alpsckr.unitycli/unitycli.files.json` — 受管文件路径清单
|
|
26
28
|
|
|
27
|
-
Skill 使用`init skill
|
|
29
|
+
Skill 使用`init skill --target <SkillDirectory>`安装到用户明确目录,或使用`.agents`/Claude workspace/user预设;它不属于Unity项目Package安装,Bridge失败也不阻止这个独立效果。
|
|
28
30
|
|
|
29
31
|
### 项目能力发现
|
|
30
32
|
|
package/package.json
CHANGED
package/schemas/init.schema.json
CHANGED
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"properties": {
|
|
53
53
|
"action": { "const": "init_help" },
|
|
54
54
|
"audience": { "const": "ai" },
|
|
55
|
-
"protocolVersion": { "
|
|
55
|
+
"protocolVersion": { "const": 2 },
|
|
56
56
|
"aiInstructions": { "type": "array", "minItems": 1, "items": { "type": "string" } },
|
|
57
57
|
"commands": { "type": "object", "additionalProperties": { "type": "string" } },
|
|
58
58
|
"nextCommand": { "type": "string" },
|
|
@@ -67,16 +67,87 @@
|
|
|
67
67
|
"action": { "const": "init_discover" },
|
|
68
68
|
"cwd": { "type": "string" },
|
|
69
69
|
"repositoryRoot": { "type": ["string", "null"] },
|
|
70
|
-
"
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
70
|
+
"unityProjects": {
|
|
71
|
+
"type": "array",
|
|
72
|
+
"items": {
|
|
73
|
+
"type": "object",
|
|
74
|
+
"properties": {
|
|
75
|
+
"path": { "type": "string" },
|
|
76
|
+
"unityVersion": { "type": "string" },
|
|
77
|
+
"relation": { "enum": ["cwd", "ancestor", "descendant"] },
|
|
78
|
+
"depth": { "type": "integer", "minimum": 0 },
|
|
79
|
+
"bridge": {
|
|
80
|
+
"type": "object",
|
|
81
|
+
"properties": {
|
|
82
|
+
"status": { "enum": ["installed", "missing", "damaged", "drifted", "conflict", "unverifiable", "not-inspected"] },
|
|
83
|
+
"installedVersion": { "type": "string" },
|
|
84
|
+
"availableVersion": { "type": "string" },
|
|
85
|
+
"reasonCode": { "type": "string" },
|
|
86
|
+
"message": { "type": "string" }
|
|
87
|
+
},
|
|
88
|
+
"required": ["status"],
|
|
89
|
+
"additionalProperties": false
|
|
90
|
+
},
|
|
91
|
+
"editor": {
|
|
92
|
+
"type": "object",
|
|
93
|
+
"properties": {
|
|
94
|
+
"status": { "enum": ["running", "stopped", "unverifiable", "not-inspected"] },
|
|
95
|
+
"processCount": { "type": "integer", "minimum": 0 },
|
|
96
|
+
"message": { "type": "string" }
|
|
97
|
+
},
|
|
98
|
+
"required": ["status"],
|
|
99
|
+
"additionalProperties": false
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"required": ["path", "unityVersion", "relation", "depth", "bridge", "editor"],
|
|
103
|
+
"additionalProperties": false
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"skill": {
|
|
107
|
+
"type": "object",
|
|
108
|
+
"properties": {
|
|
109
|
+
"workspace": { "type": "string" },
|
|
110
|
+
"recommendedTarget": { "type": "string" },
|
|
111
|
+
"explicitTargetSupported": { "const": true },
|
|
112
|
+
"status": { "enum": ["installed", "missing", "drifted", "damaged"] },
|
|
113
|
+
"targetPath": { "type": "string" },
|
|
114
|
+
"sourceHash": { "$ref": "#/$defs/sha256" },
|
|
115
|
+
"hash": { "$ref": "#/$defs/sha256" },
|
|
116
|
+
"message": { "type": "string" }
|
|
117
|
+
},
|
|
118
|
+
"required": ["workspace", "recommendedTarget", "explicitTargetSupported", "status", "targetPath", "sourceHash"],
|
|
119
|
+
"additionalProperties": false
|
|
120
|
+
},
|
|
121
|
+
"requiredDecisions": {
|
|
122
|
+
"type": "array",
|
|
123
|
+
"items": {
|
|
124
|
+
"type": "object",
|
|
125
|
+
"properties": {
|
|
126
|
+
"id": { "enum": ["bridgeProjects", "closeEditor"] },
|
|
127
|
+
"question": { "type": "string" },
|
|
128
|
+
"choices": { "type": "array", "items": { "type": "string" } },
|
|
129
|
+
"projectPath": { "type": "string" },
|
|
130
|
+
"multiple": { "type": "boolean" }
|
|
131
|
+
},
|
|
132
|
+
"required": ["id", "question", "multiple"],
|
|
133
|
+
"additionalProperties": false
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
"scan": {
|
|
137
|
+
"type": "object",
|
|
138
|
+
"properties": {
|
|
139
|
+
"scannedDirectories": { "type": "integer", "minimum": 0, "maximum": 2000 },
|
|
140
|
+
"truncated": { "type": "boolean" },
|
|
141
|
+
"maxDescendantDepth": { "const": 4 },
|
|
142
|
+
"maxScannedDirectories": { "const": 2000 },
|
|
143
|
+
"maxUnityProjects": { "const": 100 }
|
|
144
|
+
},
|
|
145
|
+
"required": ["scannedDirectories", "truncated", "maxDescendantDepth", "maxScannedDirectories", "maxUnityProjects"],
|
|
146
|
+
"additionalProperties": false
|
|
147
|
+
},
|
|
77
148
|
"nextActions": { "$ref": "#/$defs/nextActions" }
|
|
78
149
|
},
|
|
79
|
-
"required": ["action", "cwd", "repositoryRoot", "
|
|
150
|
+
"required": ["action", "cwd", "repositoryRoot", "unityProjects", "skill", "requiredDecisions", "nextActions"],
|
|
80
151
|
"additionalProperties": false
|
|
81
152
|
},
|
|
82
153
|
"packageData": {
|
|
@@ -85,6 +156,15 @@
|
|
|
85
156
|
"action": { "enum": ["init_package", "init_package_check"] },
|
|
86
157
|
"projectPath": { "type": "string" },
|
|
87
158
|
"projectIdentity": { "type": "object" },
|
|
159
|
+
"editorClose": {
|
|
160
|
+
"type": "object",
|
|
161
|
+
"properties": {
|
|
162
|
+
"status": { "enum": ["not-running", "closed"] },
|
|
163
|
+
"requested": { "type": "integer", "minimum": 0 }
|
|
164
|
+
},
|
|
165
|
+
"required": ["status", "requested"],
|
|
166
|
+
"additionalProperties": false
|
|
167
|
+
},
|
|
88
168
|
"package": {
|
|
89
169
|
"type": "object",
|
|
90
170
|
"properties": { "status": { "enum": ["installed", "missing", "damaged", "drifted", "conflict"] } },
|
|
@@ -102,6 +182,7 @@
|
|
|
102
182
|
"agent": { "enum": [".agents", "claude"] },
|
|
103
183
|
"scope": { "enum": ["workspace", "user"] },
|
|
104
184
|
"workspace": { "type": "string" },
|
|
185
|
+
"target": { "type": "string" },
|
|
105
186
|
"changes": { "type": "array" },
|
|
106
187
|
"skill": {
|
|
107
188
|
"type": "object",
|
|
@@ -117,7 +198,11 @@
|
|
|
117
198
|
},
|
|
118
199
|
"nextActions": { "$ref": "#/$defs/nextActions" }
|
|
119
200
|
},
|
|
120
|
-
"required": ["action", "
|
|
201
|
+
"required": ["action", "skill", "nextActions"],
|
|
202
|
+
"oneOf": [
|
|
203
|
+
{ "type": "object", "required": ["agent", "scope"] },
|
|
204
|
+
{ "type": "object", "required": ["target"] }
|
|
205
|
+
],
|
|
121
206
|
"additionalProperties": false
|
|
122
207
|
}
|
|
123
208
|
}
|
package/skills/unitycli/SKILL.md
CHANGED
|
@@ -27,7 +27,7 @@ FeedbackMode: off
|
|
|
27
27
|
unitycli init help
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
严格执行返回的版本化`aiInstructions`,不要依赖本Skill记忆安装步骤。先运行`init discover
|
|
30
|
+
严格执行返回的版本化`aiInstructions`,不要依赖本Skill记忆安装步骤。先运行`init discover`;当前目录只有一个Unity项目时直接采用,用户已经指定的项目、scope、host或Skill目录都是最终决定,不得重复询问。未指定Skill目录时使用发现结果的当前workspace推荐目标;明确目录使用`init skill --target <SkillDirectory>`。准确目标Unity正在运行时只询问一次是否正常关闭;同意后使用`init package --close-editor`,不得强制终止,也不得替用户决定未保存场景弹窗。Bridge与Skill是独立授权效果,一个失败只阻断自身检查,不阻断另一个;每个成功效果都立即执行对应`--check`并最终汇总全部状态。安装流程不得启动或重启Unity。用户安装请求授权所选效果,除关闭Editor外不增加确认。
|
|
31
31
|
|
|
32
32
|
## 执行骨架
|
|
33
33
|
|
|
@@ -82,4 +82,4 @@ unitycli extensions remove <id> --project <path>
|
|
|
82
82
|
unitycli extensions doctor --project <path>
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
-
安装协议先使用`unitycli init help`学习,再由`init discover
|
|
85
|
+
安装协议先使用`unitycli init help`学习,再由`init discover`只读返回当前项目计划。Bridge使用`init package --project <UnityProject>`安装;准确目标Unity正在运行且用户同意正常关闭时增加`--close-editor`,不得强制终止或替用户处理未保存场景。Skill明确目录使用`init skill --target <SkillDirectory>`,预设目标仍可使用`init skill --agent <.agents|claude> --scope <workspace|user>`,workspace scope同时传`--workspace <path>`;每种形式都用原命令加`--check`校验。用户已指定的目标不得重复询问。Bridge与Skill是独立效果,一个失败不阻断另一个。不得使用裸`init`或把两种效果合并为一个命令。Unity project文件投影完成后,如任务要求Editor效果,仍需在已连接实例中完成import/compile和业务readback。
|
|
@@ -24,7 +24,7 @@ The feedback output contract requires category, concise issue summary, optional
|
|
|
24
24
|
| Feedback privacy negatives | PASS | Secret/endpoint/path negative matrix | Novel secret formats can still exist |
|
|
25
25
|
| Concurrent JSONL validity | PASS | 16 parallel Windows PowerShell writers | Cross-session Windows desktop contention not measured |
|
|
26
26
|
| Rolling bound | PASS | Main + 3 archives, each <= 64 KiB | Longitudinal retention utility not measured |
|
|
27
|
-
| Installed bundle reachability | PASS | Public workspace/user install, drifted-update, check, and recorder smoke
|
|
27
|
+
| Installed bundle reachability | PASS | Public exact-target and preset workspace/user install, drifted-update, check, and recorder smoke | Verified with isolated filesystem targets |
|
|
28
28
|
| Clean Agent interpretation | PASS | Black-box runtime discovery transcript and main-agent audit | Human adjudication unavailable |
|
|
29
29
|
|
|
30
30
|
## Rollback Boundary
|
|
@@ -36,7 +36,7 @@ The Skill does not add confirmation, intent review, or a predefined operation ra
|
|
|
36
36
|
|
|
37
37
|
- Full repository tests: 876/876 PASS; targeted Skill/installer/docs regression: 61/61 PASS.
|
|
38
38
|
- Recorder concurrency, rotation, privacy negatives, PowerShell 5.1 BOM, and non-ASCII stdout: PASS.
|
|
39
|
-
- Public runtime install, drifted update, check, marker preservation, and installed-recorder smoke
|
|
39
|
+
- Public exact-target and preset runtime install, drifted update, check, marker preservation, and installed-recorder smoke: PASS.
|
|
40
40
|
- Resource boundary: 963 estimated initial-load tokens (691 Skill body tokens), limit 1300.
|
|
41
41
|
- Trigger fixture gate: 29/29 classifications.
|
|
42
42
|
- Output assertion gate: 5/5 with-skill cases, 100% pass rate.
|