@alpsckr/unitycli 0.4.5 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (341) hide show
  1. package/contracts/command-contract.json +591 -591
  2. package/contracts/package-files.json +367 -367
  3. package/contracts/stable-session/direct-call-semantics.json +3 -3
  4. package/contracts/stable-session/request-digest-v1-golden.json +2 -2
  5. package/contracts/tool-completion-contract.json +322 -322
  6. package/dist/bridge/domains/animation.js +37 -37
  7. package/dist/bridge/domains/animation.js.map +1 -1
  8. package/dist/bridge/domains/asset.js +15 -16
  9. package/dist/bridge/domains/asset.js.map +1 -1
  10. package/dist/bridge/domains/build.js +13 -13
  11. package/dist/bridge/domains/build.js.map +1 -1
  12. package/dist/bridge/domains/camera.js +7 -7
  13. package/dist/bridge/domains/camera.js.map +1 -1
  14. package/dist/bridge/domains/catalog-editor.d.ts +2 -0
  15. package/dist/bridge/domains/{project-tool.js → catalog-editor.js} +10 -10
  16. package/dist/bridge/domains/catalog-editor.js.map +1 -0
  17. package/dist/bridge/domains/catalog-player.d.ts +2 -0
  18. package/dist/bridge/domains/{runtime-tool.js → catalog-player.js} +9 -9
  19. package/dist/bridge/domains/catalog-player.js.map +1 -0
  20. package/dist/bridge/domains/code.js +1 -1
  21. package/dist/bridge/domains/code.js.map +1 -1
  22. package/dist/bridge/domains/console.js +2 -2
  23. package/dist/bridge/domains/console.js.map +1 -1
  24. package/dist/bridge/domains/doctor.js +3 -3
  25. package/dist/bridge/domains/doctor.js.map +1 -1
  26. package/dist/bridge/domains/editor.js +14 -14
  27. package/dist/bridge/domains/editor.js.map +1 -1
  28. package/dist/bridge/domains/game-object.js +16 -16
  29. package/dist/bridge/domains/game-object.js.map +1 -1
  30. package/dist/bridge/domains/lighting.d.ts +2 -0
  31. package/dist/bridge/domains/lighting.js +127 -0
  32. package/dist/bridge/domains/lighting.js.map +1 -0
  33. package/dist/bridge/domains/material.js +5 -5
  34. package/dist/bridge/domains/material.js.map +1 -1
  35. package/dist/bridge/domains/navmesh.js +3 -3
  36. package/dist/bridge/domains/navmesh.js.map +1 -1
  37. package/dist/bridge/domains/occlusion.js +1 -9
  38. package/dist/bridge/domains/occlusion.js.map +1 -1
  39. package/dist/bridge/domains/physics.js +14 -14
  40. package/dist/bridge/domains/physics.js.map +1 -1
  41. package/dist/bridge/domains/prefab.js +12 -12
  42. package/dist/bridge/domains/prefab.js.map +1 -1
  43. package/dist/bridge/domains/profiler.js +25 -25
  44. package/dist/bridge/domains/profiler.js.map +1 -1
  45. package/dist/bridge/domains/rendering.d.ts +2 -0
  46. package/dist/bridge/domains/rendering.js +71 -0
  47. package/dist/bridge/domains/rendering.js.map +1 -0
  48. package/dist/bridge/domains/runtime-reflection.d.ts +2 -0
  49. package/dist/bridge/domains/{reflection.js → runtime-reflection.js} +7 -7
  50. package/dist/bridge/domains/runtime-reflection.js.map +1 -0
  51. package/dist/bridge/domains/scene.js +15 -15
  52. package/dist/bridge/domains/scene.js.map +1 -1
  53. package/dist/bridge/domains/screenshot.js +6 -6
  54. package/dist/bridge/domains/screenshot.js.map +1 -1
  55. package/dist/bridge/domains/scriptable-object.js +4 -4
  56. package/dist/bridge/domains/scriptable-object.js.map +1 -1
  57. package/dist/bridge/domains/serialized-object.d.ts +2 -0
  58. package/dist/bridge/domains/{object.js → serialized-object.js} +6 -6
  59. package/dist/bridge/domains/serialized-object.js.map +1 -0
  60. package/dist/bridge/domains/shader.js +7 -7
  61. package/dist/bridge/domains/shader.js.map +1 -1
  62. package/dist/bridge/domains/texture.js +7 -7
  63. package/dist/bridge/domains/texture.js.map +1 -1
  64. package/dist/bridge/domains/timeline.js +4 -4
  65. package/dist/bridge/domains/timeline.js.map +1 -1
  66. package/dist/bridge/domains/ui.js +18 -18
  67. package/dist/bridge/domains/ui.js.map +1 -1
  68. package/dist/bridge/domains/volume.d.ts +2 -0
  69. package/dist/bridge/domains/volume.js +26 -0
  70. package/dist/bridge/domains/volume.js.map +1 -0
  71. package/dist/bridge/index.js +3 -3
  72. package/dist/bridge/index.js.map +1 -1
  73. package/dist/bridge/registry.js +15 -13
  74. package/dist/bridge/registry.js.map +1 -1
  75. package/dist/bridge/session-supervisor.js +4 -4
  76. package/dist/bridge/session-supervisor.js.map +1 -1
  77. package/dist/bridge/types.d.ts +1 -1
  78. package/dist/catalog-protocol.js +3 -3
  79. package/dist/catalog-protocol.js.map +1 -1
  80. package/dist/extensions/.generated-bridge-domains/cinemachine.js +14 -14
  81. package/dist/extensions/.generated-bridge-domains/cinemachine.js.map +1 -1
  82. package/dist/extensions/.generated-bridge-domains/hdrp.js +7 -7
  83. package/dist/extensions/.generated-bridge-domains/hdrp.js.map +1 -1
  84. package/dist/extensions/.generated-bridge-domains/probuilder.d.ts +3 -3
  85. package/dist/extensions/.generated-bridge-domains/probuilder.js +40 -40
  86. package/dist/extensions/.generated-bridge-domains/probuilder.js.map +1 -1
  87. package/dist/extensions/.generated-bridge-domains/urp.js +12 -12
  88. package/dist/extensions/.generated-bridge-domains/urp.js.map +1 -1
  89. package/dist/extensions/.generated-bridge-domains/vfx.js +27 -27
  90. package/dist/extensions/.generated-bridge-domains/vfx.js.map +1 -1
  91. package/dist/package-manager.js +1 -1
  92. package/dist/project-tool-discovery.d.ts +1 -1
  93. package/dist/project-tool-discovery.js +5 -5
  94. package/dist/project-tool-discovery.js.map +1 -1
  95. package/dist/runtime-code.js +2 -2
  96. package/dist/runtime-code.js.map +1 -1
  97. package/dist/services/reflect-service.d.ts +3 -3
  98. package/dist/services/reflect-service.js +5 -5
  99. package/dist/services/reflect-service.js.map +1 -1
  100. package/dist/tools/.generated-completion-registry.js +689 -689
  101. package/dist/tools/.generated-completion-registry.js.map +1 -1
  102. package/dist/tools/.generated-registry.d.ts +12 -12
  103. package/dist/tools/.generated-registry.js +12 -12
  104. package/dist/tools/.generated-registry.js.map +1 -1
  105. package/dist/tools/.generated-schemas.js +13 -13
  106. package/dist/tools/.generated-schemas.js.map +1 -1
  107. package/dist/tools/catalog.d.ts +1 -1
  108. package/dist/tools/catalog.js +1 -1
  109. package/dist/tools/code/{exec.d.ts → execute.d.ts} +1 -1
  110. package/dist/tools/code/{exec.js → execute.js} +5 -5
  111. package/dist/tools/code/execute.js.map +1 -0
  112. package/dist/tools/dispatcher.js +12 -8
  113. package/dist/tools/dispatcher.js.map +1 -1
  114. package/dist/tools/editor/compile.d.ts +3 -2
  115. package/dist/tools/editor/compile.js +23 -13
  116. package/dist/tools/editor/compile.js.map +1 -1
  117. package/dist/tools/editor/play-mode-status.js +2 -2
  118. package/dist/tools/editor/play-mode-status.js.map +1 -1
  119. package/dist/tools/editor/refresh.js +2 -2
  120. package/dist/tools/editor/refresh.js.map +1 -1
  121. package/dist/tools/metadata/derived.d.ts +0 -7
  122. package/dist/tools/metadata/derived.js +7 -16
  123. package/dist/tools/metadata/derived.js.map +1 -1
  124. package/dist/tools/metadata/index.d.ts +1 -1
  125. package/dist/tools/metadata/index.js +1 -1
  126. package/dist/tools/metadata/index.js.map +1 -1
  127. package/dist/tools/metadata/status.js +1 -1
  128. package/dist/tools/metadata/status.js.map +1 -1
  129. package/dist/tools/{runtime → player-runtime}/console.js +4 -4
  130. package/dist/tools/player-runtime/console.js.map +1 -0
  131. package/dist/tools/{runtime → player-runtime}/input/key.js +4 -4
  132. package/dist/tools/player-runtime/input/key.js.map +1 -0
  133. package/dist/tools/{runtime → player-runtime}/input/pointer.js +4 -4
  134. package/dist/tools/player-runtime/input/pointer.js.map +1 -0
  135. package/dist/tools/{runtime → player-runtime}/log.js +5 -5
  136. package/dist/tools/player-runtime/log.js.map +1 -0
  137. package/dist/tools/{runtime → player-runtime}/state.js +4 -4
  138. package/dist/tools/player-runtime/state.js.map +1 -0
  139. package/dist/tools/{runtime → player-runtime}/target-framerate/set.js +4 -4
  140. package/dist/tools/player-runtime/target-framerate/set.js.map +1 -0
  141. package/dist/tools/{runtime → player-runtime}/time-scale/set.js +4 -4
  142. package/dist/tools/player-runtime/time-scale/set.js.map +1 -0
  143. package/dist/tools/{runtime → player-runtime}/ui/capture-element.js +4 -4
  144. package/dist/tools/player-runtime/ui/capture-element.js.map +1 -0
  145. package/dist/tools/tools/group-summaries.js +17 -14
  146. package/dist/tools/tools/group-summaries.js.map +1 -1
  147. package/dist/tools/{reflect/member.js → type-inspection/get-member.js} +6 -6
  148. package/dist/tools/type-inspection/get-member.js.map +1 -0
  149. package/dist/tools/{reflect/type.js → type-inspection/get-type.js} +6 -6
  150. package/dist/tools/type-inspection/get-type.js.map +1 -0
  151. package/dist/tools/{reflect → type-inspection}/search.js +5 -5
  152. package/dist/tools/type-inspection/search.js.map +1 -0
  153. package/docs/README.md +1 -2
  154. package/docs/architecture.md +1 -1
  155. package/docs/availability-differences.md +2 -2
  156. package/docs/development.md +1 -1
  157. package/docs/error-codes.md +5 -5
  158. package/docs/extensions.md +2 -2
  159. package/docs/risk-and-side-effects.md +12 -12
  160. package/docs/safety-boundaries.md +7 -7
  161. package/docs/tool-discovery.md +1 -1
  162. package/docs/tool-execution.md +16 -16
  163. package/extensions/cinemachine/bridge/domains/cinemachine.ts +14 -14
  164. package/extensions/hdrp/bridge/domains/hdrp.ts +7 -7
  165. package/extensions/hdrp/unitypkg/Editor/Hdrp/HdrpToolSupport.cs +2 -2
  166. package/extensions/probuilder/bridge/domains/probuilder.ts +40 -40
  167. package/extensions/probuilder/unitypkg/Editor/ProBuilder/ProBuilderErrors.cs +1 -1
  168. package/extensions/urp/bridge/domains/urp.ts +12 -12
  169. package/extensions/urp/unitypkg/Editor/Urp/UrpToolSupport.cs +2 -2
  170. package/extensions/vfx-graph/bridge/domains/vfx.ts +27 -27
  171. package/package.json +1 -1
  172. package/skills/unitycli/SKILL.md +1 -1
  173. package/skills/unitycli/manifest.json +1 -1
  174. package/skills/unitycli/references/operation-protocol.md +1 -1
  175. package/unitypkg/Editor/Bridge/BridgeHttpServer.cs +2 -2
  176. package/unitypkg/Editor/Commands/ProjectToolCommands.cs +7 -7
  177. package/unitypkg/Editor/Commands/RuntimeToolCommands.cs +6 -6
  178. package/unitypkg/Editor/Generated/UnityCliToolCompletionRegistry.g.cs +147 -147
  179. package/unitypkg/Editor/Infrastructure/CodeExecSupport.cs +4 -4
  180. package/unitypkg/Editor/Infrastructure/UnityCliAdmission.cs +17 -17
  181. package/unitypkg/Editor/Infrastructure/UnityCliCompileCoordinator.cs +61 -54
  182. package/unitypkg/Editor/Infrastructure/UnityCliJson.cs +0 -18
  183. package/unitypkg/Editor/Infrastructure/UnityCliLiveRefreshCoordinator.cs +26 -21
  184. package/unitypkg/Editor/Infrastructure/UnityCliObjectPatch.cs +1 -1
  185. package/unitypkg/Editor/Infrastructure/UnityCliObjectRef.cs +5 -5
  186. package/unitypkg/Editor/Infrastructure/UnityCliOperationCoordinator.cs +32 -32
  187. package/unitypkg/Editor/Infrastructure/UnityCliReflection.cs +12 -12
  188. package/unitypkg/Editor/Infrastructure/UnityCliRuntimeExecutor.cs +1 -1
  189. package/unitypkg/Editor/ProjectTools/ProjectToolRegistry.cs +5 -5
  190. package/unitypkg/Editor/Tools/{animation → animation-clip}/AnimationToolSupport.cs +3 -3
  191. package/unitypkg/Editor/Tools/{animation/clip → animation-clip}/create.cs +4 -4
  192. package/unitypkg/Editor/Tools/{animation/clip.cs → animation-clip/read.cs} +3 -3
  193. package/unitypkg/Editor/Tools/{animation/clip/modify.cs → animation-clip/update.cs} +5 -5
  194. package/unitypkg/Editor/Tools/{animation/animator → animator}/crossfade.cs +1 -1
  195. package/unitypkg/Editor/Tools/{animation/animator → animator}/get-info.cs +1 -1
  196. package/unitypkg/Editor/Tools/{animation/animator → animator}/get-parameter.cs +1 -1
  197. package/unitypkg/Editor/Tools/{animation/state.cs → animator/get-state.cs} +3 -3
  198. package/unitypkg/Editor/Tools/{animation → animator}/play.cs +5 -5
  199. package/unitypkg/Editor/Tools/{animation/animator → animator}/set-enabled.cs +1 -1
  200. package/unitypkg/Editor/Tools/{animation/animator → animator}/set-parameter.cs +1 -1
  201. package/unitypkg/Editor/Tools/{animation/animator → animator}/set-speed.cs +1 -1
  202. package/unitypkg/Editor/Tools/{animation → animator}/stop.cs +4 -4
  203. package/unitypkg/Editor/Tools/{controller → animator-controller}/add-blend-tree-child.cs +10 -10
  204. package/unitypkg/Editor/Tools/{controller → animator-controller}/add-layer.cs +6 -6
  205. package/unitypkg/Editor/Tools/{controller → animator-controller}/add-parameter.cs +6 -6
  206. package/unitypkg/Editor/Tools/{controller → animator-controller}/add-state.cs +7 -7
  207. package/unitypkg/Editor/Tools/{controller → animator-controller}/add-transition.cs +9 -9
  208. package/unitypkg/Editor/Tools/{controller → animator-controller}/assign.cs +6 -6
  209. package/unitypkg/Editor/Tools/{controller → animator-controller}/create-blend-tree-1d.cs +7 -7
  210. package/unitypkg/Editor/Tools/{controller → animator-controller}/create-blend-tree-2d.cs +7 -7
  211. package/unitypkg/Editor/Tools/{controller → animator-controller}/create.cs +4 -4
  212. package/unitypkg/Editor/Tools/{controller → animator-controller}/get-info.cs +4 -4
  213. package/unitypkg/Editor/Tools/{controller → animator-controller}/remove-layer.cs +8 -8
  214. package/unitypkg/Editor/Tools/{controller → animator-controller}/set-layer-weight.cs +6 -6
  215. package/unitypkg/Editor/Tools/asset/preview.cs +1 -1
  216. package/unitypkg/Editor/Tools/asset/{modify.cs → write-text.cs} +6 -6
  217. package/unitypkg/Editor/Tools/component/get.cs +1 -1
  218. package/unitypkg/Editor/Tools/component/list-types.cs +2 -2
  219. package/unitypkg/Editor/Tools/component/modify.cs +1 -1
  220. package/unitypkg/Editor/Tools/component/set.cs +1 -1
  221. package/unitypkg/Editor/Tools/console/{get.cs → read.cs} +3 -3
  222. package/unitypkg/Editor/Tools/editor/{play.cs → play-mode/start.cs} +5 -5
  223. package/unitypkg/Editor/Tools/editor/{stop.cs → play-mode/stop.cs} +5 -5
  224. package/unitypkg/Editor/Tools/editor/search.cs +1 -1
  225. package/unitypkg/Editor/Tools/{go → game-object}/GameObjectToolSupport.cs +5 -22
  226. package/unitypkg/Editor/Tools/{go → game-object}/create.cs +11 -11
  227. package/unitypkg/Editor/Tools/{go → game-object}/delete.cs +7 -7
  228. package/unitypkg/Editor/Tools/{go → game-object}/duplicate.cs +6 -6
  229. package/unitypkg/Editor/Tools/{go → game-object}/find.cs +5 -5
  230. package/unitypkg/Editor/Tools/{go → game-object}/look-at.cs +8 -8
  231. package/unitypkg/Editor/Tools/{go → game-object}/modify.cs +9 -9
  232. package/unitypkg/Editor/Tools/{go → game-object}/move-relative.cs +7 -7
  233. package/unitypkg/Editor/Tools/{scene/move-object.cs → game-object/move-to-scene.cs} +7 -7
  234. package/unitypkg/Editor/Tools/{go → game-object}/set-parent.cs +9 -9
  235. package/unitypkg/Editor/Tools/{graphics/bake-cancel.cs → lighting/bake/cancel.cs} +4 -4
  236. package/unitypkg/Editor/Tools/{graphics/bake-clear.cs → lighting/bake/clear.cs} +4 -4
  237. package/unitypkg/Editor/Tools/{graphics/bake-reflection-probe.cs → lighting/bake/reflection-probe.cs} +3 -3
  238. package/unitypkg/Editor/Tools/{graphics/bake-settings.cs → lighting/bake/settings.cs} +12 -12
  239. package/unitypkg/Editor/Tools/{graphics/bake-start.cs → lighting/bake/start.cs} +5 -5
  240. package/unitypkg/Editor/Tools/{graphics/bake-status.cs → lighting/bake/status.cs} +3 -3
  241. package/unitypkg/Editor/Tools/{graphics → lighting}/light-probe-group.cs +7 -7
  242. package/unitypkg/Editor/Tools/{graphics → lighting}/reflection-probe.cs +12 -12
  243. package/unitypkg/Editor/Tools/{graphics/skybox-get.cs → lighting/skybox/get.cs} +3 -3
  244. package/unitypkg/Editor/Tools/{graphics/skybox-set-ambient.cs → lighting/skybox/set-ambient.cs} +3 -3
  245. package/unitypkg/Editor/Tools/{graphics/skybox-set-fog.cs → lighting/skybox/set-fog.cs} +3 -3
  246. package/unitypkg/Editor/Tools/{graphics/skybox-set-material.cs → lighting/skybox/set-material.cs} +5 -5
  247. package/unitypkg/Editor/Tools/{graphics/skybox-set-properties.cs → lighting/skybox/set-properties.cs} +5 -5
  248. package/unitypkg/Editor/Tools/{graphics/skybox-set-reflection.cs → lighting/skybox/set-reflection.cs} +3 -3
  249. package/unitypkg/Editor/Tools/{graphics/skybox-set-sun.cs → lighting/skybox/set-sun.cs} +5 -5
  250. package/unitypkg/Editor/Tools/{project → project-settings}/ProjectSettingsToolSupport.cs +5 -5
  251. package/unitypkg/Editor/Tools/{project → project-settings}/audio-settings/set.cs +3 -3
  252. package/unitypkg/Editor/Tools/{project → project-settings}/audio-settings.cs +4 -4
  253. package/unitypkg/Editor/Tools/{project → project-settings}/info.cs +4 -4
  254. package/unitypkg/Editor/Tools/{project → project-settings}/input-settings/set.cs +3 -3
  255. package/unitypkg/Editor/Tools/{project → project-settings}/input-settings.cs +4 -4
  256. package/unitypkg/Editor/Tools/project-settings/layer/add.cs +3 -0
  257. package/unitypkg/Editor/Tools/project-settings/layer/remove.cs +3 -0
  258. package/unitypkg/Editor/Tools/{project → project-settings}/layers.cs +4 -4
  259. package/unitypkg/Editor/Tools/{project → project-settings}/player-settings/set.cs +4 -4
  260. package/unitypkg/Editor/Tools/{project → project-settings}/player-settings.cs +4 -4
  261. package/unitypkg/Editor/Tools/project-settings/tag/add.cs +3 -0
  262. package/unitypkg/Editor/Tools/project-settings/tag/remove.cs +3 -0
  263. package/unitypkg/Editor/Tools/{project → project-settings}/tags.cs +4 -4
  264. package/unitypkg/Editor/Tools/{project → project-settings}/time-settings/set.cs +3 -3
  265. package/unitypkg/Editor/Tools/{project → project-settings}/time-settings.cs +4 -4
  266. package/unitypkg/Editor/Tools/{graphics → rendering}/GraphicsToolSupport.cs +3 -3
  267. package/unitypkg/Editor/Tools/rendering/pipeline/info.cs +19 -0
  268. package/unitypkg/Editor/Tools/{graphics/pipeline-settings.cs → rendering/pipeline/settings.cs} +4 -4
  269. package/unitypkg/Editor/Tools/{graphics → rendering}/quality.cs +17 -17
  270. package/unitypkg/Editor/Tools/{graphics → rendering}/scene-debug.cs +4 -4
  271. package/unitypkg/Editor/Tools/rendering/stats.cs +17 -0
  272. package/unitypkg/Editor/Tools/{reflection → runtime-reflection}/method/find.cs +5 -5
  273. package/unitypkg/Editor/Tools/{reflection/method/call.cs → runtime-reflection/method/invoke.cs} +7 -7
  274. package/unitypkg/Editor/Tools/{reflection → runtime-reflection}/type/schema.cs +5 -5
  275. package/unitypkg/Editor/Tools/scene/gameobject-support.cs +1 -1
  276. package/unitypkg/Editor/Tools/scene/gameobject.cs +1 -1
  277. package/unitypkg/Editor/Tools/scene/hierarchy.cs +1 -1
  278. package/unitypkg/Editor/Tools/{camera/screenshot.cs → screenshot/from-camera.cs} +4 -4
  279. package/unitypkg/Editor/Tools/{object/modify.cs → serialized-object/patch.cs} +8 -8
  280. package/unitypkg/Editor/Tools/{object/get-data.cs → serialized-object/read.cs} +4 -4
  281. package/unitypkg/Editor/Tools/{graphics/volume.cs → volume/list.cs} +3 -3
  282. package/unitypkg/Editor/UnityCliBridge.cs +3 -22
  283. package/unitypkg/Runtime/Infrastructure/UnityCliRuntimeBridge.cs +15 -15
  284. package/unitypkg/Runtime/Infrastructure/UnityCliRuntimeRegistry.cs +1 -1
  285. package/unitypkg/Runtime/Tools/UnityCliRuntimeTools.cs +22 -22
  286. package/unitypkg/Shared/UnityCliBridgeQueuePolicy.cs +1 -1
  287. package/unitypkg/Tests/Editor/UnityCliAdmissionCoordinatorIntegrationTests.cs +7 -7
  288. package/unitypkg/Tests/Editor/UnityCliBridgeAdmissionIntegrationTests.cs +6 -6
  289. package/unitypkg/Tests/Editor/UnityCliBridgeQueuePolicyTests.cs +3 -3
  290. package/unitypkg/Tests/Editor/UnityCliContinuationIntegrationTests.cs +1 -1
  291. package/unitypkg/Tests/Editor/UnityCliRequestBudgetTests.cs +4 -4
  292. package/unitypkg/Tests/Editor/UnityCliRuntimeBridgeIntegrationTests.cs +15 -15
  293. package/unitypkg/Tests/Runtime/UnityCliRuntimeCatalogValidationTests.cs +5 -5
  294. package/unitypkg/package.json +1 -1
  295. package/dist/bridge/domains/graphics.d.ts +0 -2
  296. package/dist/bridge/domains/graphics.js +0 -170
  297. package/dist/bridge/domains/graphics.js.map +0 -1
  298. package/dist/bridge/domains/object.d.ts +0 -2
  299. package/dist/bridge/domains/object.js.map +0 -1
  300. package/dist/bridge/domains/package.d.ts +0 -2
  301. package/dist/bridge/domains/package.js +0 -2
  302. package/dist/bridge/domains/package.js.map +0 -1
  303. package/dist/bridge/domains/project-tool.d.ts +0 -2
  304. package/dist/bridge/domains/project-tool.js.map +0 -1
  305. package/dist/bridge/domains/reflection.d.ts +0 -2
  306. package/dist/bridge/domains/reflection.js.map +0 -1
  307. package/dist/bridge/domains/runtime-tool.d.ts +0 -2
  308. package/dist/bridge/domains/runtime-tool.js.map +0 -1
  309. package/dist/tools/code/exec.js.map +0 -1
  310. package/dist/tools/reflect/member.js.map +0 -1
  311. package/dist/tools/reflect/search.js.map +0 -1
  312. package/dist/tools/reflect/type.js.map +0 -1
  313. package/dist/tools/runtime/console.js.map +0 -1
  314. package/dist/tools/runtime/input/key.js.map +0 -1
  315. package/dist/tools/runtime/input/pointer.js.map +0 -1
  316. package/dist/tools/runtime/log.js.map +0 -1
  317. package/dist/tools/runtime/state.js.map +0 -1
  318. package/dist/tools/runtime/target-framerate/set.js.map +0 -1
  319. package/dist/tools/runtime/time-scale/set.js.map +0 -1
  320. package/dist/tools/runtime/ui/capture-element.js.map +0 -1
  321. package/unitypkg/Editor/Tools/graphics/pipeline-info.cs +0 -19
  322. package/unitypkg/Editor/Tools/graphics/stats.cs +0 -17
  323. package/unitypkg/Editor/Tools/project/layer/add.cs +0 -3
  324. package/unitypkg/Editor/Tools/project/layer/remove.cs +0 -3
  325. package/unitypkg/Editor/Tools/project/tag/add.cs +0 -3
  326. package/unitypkg/Editor/Tools/project/tag/remove.cs +0 -3
  327. /package/dist/tools/{runtime → player-runtime}/console.d.ts +0 -0
  328. /package/dist/tools/{runtime → player-runtime}/input/key.d.ts +0 -0
  329. /package/dist/tools/{runtime → player-runtime}/input/pointer.d.ts +0 -0
  330. /package/dist/tools/{runtime → player-runtime}/log.d.ts +0 -0
  331. /package/dist/tools/{runtime → player-runtime}/state.d.ts +0 -0
  332. /package/dist/tools/{runtime → player-runtime}/target-framerate/set.d.ts +0 -0
  333. /package/dist/tools/{runtime → player-runtime}/time-scale/set.d.ts +0 -0
  334. /package/dist/tools/{runtime → player-runtime}/ui/capture-element.d.ts +0 -0
  335. /package/dist/tools/{reflect/member.d.ts → type-inspection/get-member.d.ts} +0 -0
  336. /package/dist/tools/{reflect/type.d.ts → type-inspection/get-type.d.ts} +0 -0
  337. /package/dist/tools/{reflect → type-inspection}/search.d.ts +0 -0
  338. /package/unitypkg/Editor/Tools/{animation → animator}/AnimatorRuntimeToolSupport.cs +0 -0
  339. /package/unitypkg/Editor/Tools/{project → project-settings}/ProjectSettingsReader.cs +0 -0
  340. /package/unitypkg/Editor/Tools/{project → project-settings}/ProjectTagLayerToolSupport.cs +0 -0
  341. /package/unitypkg/Editor/Tools/{object → serialized-object}/ObjectToolSupport.cs +0 -0
@@ -6,12 +6,12 @@ using UnityEngine;
6
6
 
7
7
  namespace UnityCli
8
8
  {
9
- /// <summary>animation.stop — 停止/重置目标 Animator。</summary>
10
- public class AnimationStopTool : IUnityCliTool<AnimationStopTool.Request, AnimationStopTool.Result>
9
+ /// <summary>animator.stop — 停止/重置目标 Animator。</summary>
10
+ public class AnimatorStopTool : IUnityCliTool<AnimatorStopTool.Request, AnimatorStopTool.Result>
11
11
  {
12
12
  public sealed class Request { public string Target { get; set; } }
13
13
  public sealed class Result { public AnimatorInfo Animator { get; set; } public List<AnimationPlannedEffect> PlannedEffects { get; set; } }
14
- public ToolDescriptor Describe() => new() { Name = "animation.stop", Summary = "Stop and rebind an Animator on a target GameObject.", Description = "Call Animator.Rebind() and Update(0) to reset the Animator to its initial state.", Group = "animation",DestructiveHint = false, SideEffects = new[] { "scene-modify" }, Target = "editor", PlayModeSupport = "supported", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Stop animation", Input = new Request { Target = "Player" } } } };
14
+ public ToolDescriptor Describe() => new() { Name = "animator.stop", Summary = "Stop and rebind an Animator on a target GameObject.", Description = "Call Animator.Rebind() and Update(0) to reset the Animator to its initial state.", Group = "animator",DestructiveHint = false, SideEffects = new[] { "scene-modify" }, Target = "editor", PlayModeSupport = "supported", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Stop animation", Input = new Request { Target = "Player" } } } };
15
15
  public async System.Threading.Tasks.ValueTask<Result> ExecuteAsync(Request r, UnityCliProjectToolContext ctx, System.Threading.CancellationToken ct = default)
16
16
  {
17
17
  var go = GameObjectToolSupport.ResolveUniqueTarget(r.Target, "Animation stop requires --target <go>.");
@@ -38,7 +38,7 @@ namespace UnityCli
38
38
  if (observedAnimator == null || observedAnimator.GetCurrentAnimatorStateInfo(0).fullPathHash != expectedHash) throw new UnityCliBridge.BridgeCommandException("E_ANIMATION_RESET_TIMEOUT", "Animator reset proof was not available after completion.", "Inspect the AnimatorController default state and transitions.");
39
39
  UnityCliSceneMutation.MarkSceneObjectDirty(observedAnimator);
40
40
  var finalAnimator = AnimationToolSupport.BuildAnimatorInfo(observedAnimator, 0);
41
- return new Result { Animator = finalAnimator, PlannedEffects = new List<AnimationPlannedEffect> { new AnimationPlannedEffect { Type = "animation.stop", Target = GameObjectToolSupport.HierarchyPath(observedTarget), State = defaultState.name } } };
41
+ return new Result { Animator = finalAnimator, PlannedEffects = new List<AnimationPlannedEffect> { new AnimationPlannedEffect { Type = "animator.stop", Target = GameObjectToolSupport.HierarchyPath(observedTarget), State = defaultState.name } } };
42
42
  }
43
43
  }
44
44
  }
@@ -8,26 +8,26 @@ using UnityEngine;
8
8
 
9
9
  namespace UnityCli
10
10
  {
11
- /// <summary>controller.add-blend-tree-child — 向 BlendTree 添加子动画。</summary>
12
- public class ControllerAddBlendTreeChildTool : IUnityCliTool<ControllerAddBlendTreeChildTool.Request, ControllerAddBlendTreeChildTool.Result>
11
+ /// <summary>animator-controller.add-blend-tree-child — 向 BlendTree 添加子动画。</summary>
12
+ public class AnimatorControllerAddBlendTreeChildTool : IUnityCliTool<AnimatorControllerAddBlendTreeChildTool.Request, AnimatorControllerAddBlendTreeChildTool.Result>
13
13
  {
14
14
  public sealed class Request { public string ControllerPath { get; set; } public string StateName { get; set; } public string ClipPath { get; set; } public int? LayerIndex { get; set; } public float? Threshold { get; set; } public float? PositionX { get; set; } public float? PositionY { get; set; } }
15
15
  public sealed class Result { public string Path { get; set; } public string StateName { get; set; } public long ChildCount { get; set; } public List<AnimationPlannedEffect> PlannedEffects { get; set; } }
16
- public ToolDescriptor Describe() => new() { Name = "controller.add-blend-tree-child", Summary = "Add a child motion to an existing BlendTree state.", Description = "Add an AnimationClip as a child to a BlendTree state. threshold for 1D, positionX/positionY for 2D.", Group = "controller",DestructiveHint = true, SideEffects = new[] { "asset-write" }, Target = "editor", PlayModeSupport = "editor-only", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Add blend tree child", Input = new Request { ControllerPath = "Assets/Animations/Player.controller", StateName = "Move", ClipPath = "Assets/Animations/Walk.anim", Threshold = 0.5f } } } };
16
+ public ToolDescriptor Describe() => new() { Name = "animator-controller.add-blend-tree-child", Summary = "Add a child motion to an existing BlendTree state.", Description = "Add an AnimationClip as a child to a BlendTree state. threshold for 1D, positionX/positionY for 2D.", Group = "animator-controller",DestructiveHint = true, SideEffects = new[] { "asset-write" }, Target = "editor", PlayModeSupport = "editor-only", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Add blend tree child", Input = new Request { ControllerPath = "Assets/Animations/Player.controller", StateName = "Move", ClipPath = "Assets/Animations/Walk.anim", Threshold = 0.5f } } } };
17
17
  /// <summary>按 BlendTree 类型添加 child,并以 GUID、数量增量和请求值证明持久终态。</summary>
18
18
  public System.Threading.Tasks.ValueTask<Result> ExecuteAsync(Request r, UnityCliProjectToolContext ctx, System.Threading.CancellationToken ct = default)
19
19
  {
20
20
  var path = AnimationToolSupport.RequireControllerPath(r.ControllerPath);
21
21
  var controller = AnimationToolSupport.LoadControllerAsset(path);
22
- if (controller == null) throw new UnityCliBridge.BridgeCommandException("E_CONTROLLER_NOT_FOUND", "AnimatorController not found at: " + path, "Check the path or create one with controller.create.");
22
+ if (controller == null) throw new UnityCliBridge.BridgeCommandException("E_CONTROLLER_NOT_FOUND", "AnimatorController not found at: " + path, "Check the path or create one with animator-controller.create.");
23
23
  var layerIndex = r.LayerIndex ?? 0;
24
- if (layerIndex < 0 || layerIndex >= controller.layers.Length) throw new UnityCliBridge.BridgeCommandException("E_LAYER_INDEX_INVALID", "Layer index out of range.", "Run controller.get-info to inspect layers.");
24
+ if (layerIndex < 0 || layerIndex >= controller.layers.Length) throw new UnityCliBridge.BridgeCommandException("E_LAYER_INDEX_INVALID", "Layer index out of range.", "Run animator-controller.get-info to inspect layers.");
25
25
  var sm = controller.layers[layerIndex].stateMachine;
26
26
  var state = AnimationToolSupport.FindStateInLayer(sm, r.StateName);
27
- if (state == null) throw new UnityCliBridge.BridgeCommandException("E_STATE_NOT_FOUND", "State '" + r.StateName + "' not found in layer " + layerIndex + ".", "Run controller.get-info to inspect states.");
27
+ if (state == null) throw new UnityCliBridge.BridgeCommandException("E_STATE_NOT_FOUND", "State '" + r.StateName + "' not found in layer " + layerIndex + ".", "Run animator-controller.get-info to inspect states.");
28
28
  var blendTree = state.motion as BlendTree;
29
- if (blendTree == null) throw new UnityCliBridge.BridgeCommandException("E_NOT_A_BLEND_TREE", "State '" + r.StateName + "' does not have a BlendTree motion.", "Use controller.create-blend-tree-1d or create-blend-tree-2d first.");
30
- if (string.IsNullOrEmpty(r.ClipPath)) throw new UnityCliBridge.BridgeCommandException("E_CLIP_PATH_REQUIRED", "controller.add-blend-tree-child requires clipPath.", "Pass an Assets/*.anim AnimationClip path.");
29
+ if (blendTree == null) throw new UnityCliBridge.BridgeCommandException("E_NOT_A_BLEND_TREE", "State '" + r.StateName + "' does not have a BlendTree motion.", "Use animator-controller.create-blend-tree-1d or create-blend-tree-2d first.");
30
+ if (string.IsNullOrEmpty(r.ClipPath)) throw new UnityCliBridge.BridgeCommandException("E_CLIP_PATH_REQUIRED", "animator-controller.add-blend-tree-child requires clipPath.", "Pass an Assets/*.anim AnimationClip path.");
31
31
  var clipPath = SceneToolSupport.NormalizeAssetPath(r.ClipPath);
32
32
  var clip = AssetDatabase.LoadAssetAtPath<AnimationClip>(clipPath);
33
33
  if (clip == null) throw new UnityCliBridge.BridgeCommandException("E_CLIP_NOT_FOUND", "AnimationClip not found at: " + r.ClipPath, "Create the clip first.");
@@ -41,7 +41,7 @@ namespace UnityCli
41
41
  || blendTree.blendType == BlendTreeType.FreeformDirectional2D
42
42
  || blendTree.blendType == BlendTreeType.FreeformCartesian2D;
43
43
  if (!isOneDimensional && !isTwoDimensional)
44
- throw new UnityCliBridge.BridgeCommandException("E_BLEND_TREE_TYPE_UNSUPPORTED", "controller.add-blend-tree-child supports 1D and 2D BlendTrees only.", "Use a 1D or 2D BlendTree state.");
44
+ throw new UnityCliBridge.BridgeCommandException("E_BLEND_TREE_TYPE_UNSUPPORTED", "animator-controller.add-blend-tree-child supports 1D and 2D BlendTrees only.", "Use a 1D or 2D BlendTree state.");
45
45
  if (isOneDimensional && (r.PositionX.HasValue || r.PositionY.HasValue))
46
46
  throw new UnityCliBridge.BridgeCommandException("E_BLEND_TREE_CHILD_INPUT_CONFLICT", "positionX/positionY are only valid for 2D BlendTrees.", "Pass threshold for a 1D BlendTree.");
47
47
  if (isTwoDimensional && r.Threshold.HasValue)
@@ -74,7 +74,7 @@ namespace UnityCli
74
74
  var observedMatches = observedChildren == null || observedClip == null ? 0 : observedChildren.Count(child => MatchesRequestedChild(child, observedClip, isOneDimensional, threshold, position));
75
75
  if (observedChildren == null || observedChildren.Length != beforeChildren.Length + 1 || observedMatches != beforeMatches + 1 || (isOneDimensional && observedTree.useAutomaticThresholds))
76
76
  throw AnimationToolSupport.StateMismatch("E_CONTROLLER_BLEND_TREE_CHILD_STATE_MISMATCH", "BlendTree child");
77
- return new System.Threading.Tasks.ValueTask<Result>(new Result { Path = path, StateName = observedState.name, ChildCount = observedChildren.Length, PlannedEffects = new List<AnimationPlannedEffect> { new AnimationPlannedEffect { Type = "controller.add-blend-tree-child", Path = path, State = observedState.name } } });
77
+ return new System.Threading.Tasks.ValueTask<Result>(new Result { Path = path, StateName = observedState.name, ChildCount = observedChildren.Length, PlannedEffects = new List<AnimationPlannedEffect> { new AnimationPlannedEffect { Type = "animator-controller.add-blend-tree-child", Path = path, State = observedState.name } } });
78
78
  }
79
79
 
80
80
  private static bool MatchesRequestedChild(ChildMotion child, AnimationClip clip, bool oneDimensional, float threshold, Vector2 position)
@@ -7,18 +7,18 @@ using UnityEngine;
7
7
 
8
8
  namespace UnityCli
9
9
  {
10
- /// <summary>controller.add-layer — 添加层到 Controller。</summary>
11
- public class ControllerAddLayerTool : IUnityCliTool<ControllerAddLayerTool.Request, ControllerAddLayerTool.Result>
10
+ /// <summary>animator-controller.add-layer — 添加层到 Controller。</summary>
11
+ public class AnimatorControllerAddLayerTool : IUnityCliTool<AnimatorControllerAddLayerTool.Request, AnimatorControllerAddLayerTool.Result>
12
12
  {
13
13
  public sealed class Request { public string ControllerPath { get; set; } public string LayerName { get; set; } public float? Weight { get; set; } public string BlendingMode { get; set; } }
14
14
  public sealed class Result { public string Path { get; set; } public string LayerName { get; set; } public long LayerIndex { get; set; } public double Weight { get; set; } public string BlendingMode { get; set; } public List<AnimationPlannedEffect> PlannedEffects { get; set; } }
15
- public ToolDescriptor Describe() => new() { Name = "controller.add-layer", Summary = "Add a new layer to an AnimatorController.", Description = "Add a layer with a name, weight (default 1), and blending mode (override or additive).", Group = "controller",DestructiveHint = true, SideEffects = new[] { "asset-write" }, Target = "editor", PlayModeSupport = "editor-only", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Add layer", Input = new Request { ControllerPath = "Assets/Animations/Player.controller", LayerName = "UpperBody" } } } };
15
+ public ToolDescriptor Describe() => new() { Name = "animator-controller.add-layer", Summary = "Add a new layer to an AnimatorController.", Description = "Add a layer with a name, weight (default 1), and blending mode (override or additive).", Group = "animator-controller",DestructiveHint = true, SideEffects = new[] { "asset-write" }, Target = "editor", PlayModeSupport = "editor-only", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Add layer", Input = new Request { ControllerPath = "Assets/Animations/Player.controller", LayerName = "UpperBody" } } } };
16
16
  public System.Threading.Tasks.ValueTask<Result> ExecuteAsync(Request r, UnityCliProjectToolContext ctx, System.Threading.CancellationToken ct = default)
17
17
  {
18
18
  var path = AnimationToolSupport.RequireControllerPath(r.ControllerPath);
19
19
  var controller = AnimationToolSupport.LoadControllerAsset(path);
20
- if (controller == null) throw new UnityCliBridge.BridgeCommandException("E_CONTROLLER_NOT_FOUND", "AnimatorController not found at: " + path, "Check the path or create one with controller.create.");
21
- if (string.IsNullOrEmpty(r.LayerName)) throw new UnityCliBridge.BridgeCommandException("E_LAYER_NAME_REQUIRED", "controller.add-layer requires layerName.", "Pass a name for the new layer.");
20
+ if (controller == null) throw new UnityCliBridge.BridgeCommandException("E_CONTROLLER_NOT_FOUND", "AnimatorController not found at: " + path, "Check the path or create one with animator-controller.create.");
21
+ if (string.IsNullOrEmpty(r.LayerName)) throw new UnityCliBridge.BridgeCommandException("E_LAYER_NAME_REQUIRED", "animator-controller.add-layer requires layerName.", "Pass a name for the new layer.");
22
22
  var weight = r.Weight ?? 1f;
23
23
  if (float.IsNaN(weight) || float.IsInfinity(weight) || weight < 0f || weight > 1f)
24
24
  throw new UnityCliBridge.BridgeCommandException("E_LAYER_WEIGHT_INVALID", "Layer weight must be finite and within Unity's 0 to 1 range.", "Pass a finite weight from 0 to 1.");
@@ -36,7 +36,7 @@ namespace UnityCli
36
36
  var observedIndex = observedLayers == null ? -1 : observedLayers.Length - 1;
37
37
  if (observedIndex < 0 || observedLayers[observedIndex].name != r.LayerName || !Mathf.Approximately(observedLayers[observedIndex].defaultWeight, weight) || observedLayers[observedIndex].blendingMode != blendingMode)
38
38
  throw AnimationToolSupport.StateMismatch("E_CONTROLLER_ADD_LAYER_STATE_MISMATCH", "AnimatorController layer");
39
- return new System.Threading.Tasks.ValueTask<Result>(new Result { Path = path, LayerName = observedLayers[observedIndex].name, LayerIndex = observedIndex, Weight = observedLayers[observedIndex].defaultWeight, BlendingMode = observedLayers[observedIndex].blendingMode.ToString(), PlannedEffects = new List<AnimationPlannedEffect> { new AnimationPlannedEffect { Type = "controller.add-layer", Path = path } } });
39
+ return new System.Threading.Tasks.ValueTask<Result>(new Result { Path = path, LayerName = observedLayers[observedIndex].name, LayerIndex = observedIndex, Weight = observedLayers[observedIndex].defaultWeight, BlendingMode = observedLayers[observedIndex].blendingMode.ToString(), PlannedEffects = new List<AnimationPlannedEffect> { new AnimationPlannedEffect { Type = "animator-controller.add-layer", Path = path } } });
40
40
  }
41
41
  }
42
42
  }
@@ -7,18 +7,18 @@ using UnityEngine;
7
7
 
8
8
  namespace UnityCli
9
9
  {
10
- /// <summary>controller.add-parameter — 添加参数到 Controller。</summary>
11
- public class ControllerAddParameterTool : IUnityCliTool<ControllerAddParameterTool.Request, ControllerAddParameterTool.Result>
10
+ /// <summary>animator-controller.add-parameter — 添加参数到 Controller。</summary>
11
+ public class AnimatorControllerAddParameterTool : IUnityCliTool<AnimatorControllerAddParameterTool.Request, AnimatorControllerAddParameterTool.Result>
12
12
  {
13
13
  public sealed class Request { public string ControllerPath { get; set; } public string ParameterName { get; set; } public string ParameterType { get; set; } public string DefaultValue { get; set; } }
14
14
  public sealed class Result { public string Path { get; set; } public string ParameterName { get; set; } public string ParameterType { get; set; } public long TotalParameters { get; set; } public List<AnimationPlannedEffect> PlannedEffects { get; set; } }
15
- public ToolDescriptor Describe() => new() { Name = "controller.add-parameter", Summary = "Add a parameter to an AnimatorController asset.", Description = "Add a float/int/bool/trigger parameter. Optionally set a default value.", Group = "controller",DestructiveHint = true, SideEffects = new[] { "asset-write" }, Target = "editor", PlayModeSupport = "editor-only", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Add MatrixSpeed parameter", Input = new Request { ControllerPath = "Assets/Animations/Player.controller", ParameterName = "MatrixSpeed", ParameterType = "float" } } } };
15
+ public ToolDescriptor Describe() => new() { Name = "animator-controller.add-parameter", Summary = "Add a parameter to an AnimatorController asset.", Description = "Add a float/int/bool/trigger parameter. Optionally set a default value.", Group = "animator-controller",DestructiveHint = true, SideEffects = new[] { "asset-write" }, Target = "editor", PlayModeSupport = "editor-only", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Add MatrixSpeed parameter", Input = new Request { ControllerPath = "Assets/Animations/Player.controller", ParameterName = "MatrixSpeed", ParameterType = "float" } } } };
16
16
  public System.Threading.Tasks.ValueTask<Result> ExecuteAsync(Request r, UnityCliProjectToolContext ctx, System.Threading.CancellationToken ct = default)
17
17
  {
18
18
  var path = AnimationToolSupport.RequireControllerPath(r.ControllerPath);
19
19
  var controller = AnimationToolSupport.LoadControllerAsset(path);
20
- if (controller == null) throw new UnityCliBridge.BridgeCommandException("E_CONTROLLER_NOT_FOUND", "AnimatorController not found at: " + path, "Check the path or create one with controller.create.");
21
- if (string.IsNullOrEmpty(r.ParameterName)) throw new UnityCliBridge.BridgeCommandException("E_PARAMETER_NAME_REQUIRED", "controller.add-parameter requires parameterName.", "Pass a name for the new parameter.");
20
+ if (controller == null) throw new UnityCliBridge.BridgeCommandException("E_CONTROLLER_NOT_FOUND", "AnimatorController not found at: " + path, "Check the path or create one with animator-controller.create.");
21
+ if (string.IsNullOrEmpty(r.ParameterName)) throw new UnityCliBridge.BridgeCommandException("E_PARAMETER_NAME_REQUIRED", "animator-controller.add-parameter requires parameterName.", "Pass a name for the new parameter.");
22
22
  foreach (var existing in controller.parameters) if (existing.name == r.ParameterName) throw new UnityCliBridge.BridgeCommandException("E_PARAMETER_EXISTS", "Parameter '" + r.ParameterName + "' already exists.", "Use animator.set-parameter to change its default value.");
23
23
  var typeStr = (r.ParameterType ?? "float").ToLowerInvariant();
24
24
  var paramType = typeStr == "int" || typeStr == "integer" ? AnimatorControllerParameterType.Int : typeStr == "bool" || typeStr == "boolean" ? AnimatorControllerParameterType.Bool : typeStr == "trigger" ? AnimatorControllerParameterType.Trigger : AnimatorControllerParameterType.Float;
@@ -44,7 +44,7 @@ namespace UnityCli
44
44
  if (observedController != null) foreach (var candidate in observedController.parameters) if (candidate.name == r.ParameterName) { observedParameter = candidate; break; }
45
45
  if (observedParameter == null || observedParameter.type != paramType || (paramType == AnimatorControllerParameterType.Float && r.DefaultValue != null && !Mathf.Approximately(observedParameter.defaultFloat, expectedFloat)) || (paramType == AnimatorControllerParameterType.Int && r.DefaultValue != null && observedParameter.defaultInt != expectedInt) || (paramType == AnimatorControllerParameterType.Bool && r.DefaultValue != null && observedParameter.defaultBool != expectedBool))
46
46
  throw AnimationToolSupport.StateMismatch("E_CONTROLLER_ADD_PARAMETER_STATE_MISMATCH", "AnimatorController parameter");
47
- return new System.Threading.Tasks.ValueTask<Result>(new Result { Path = path, ParameterName = observedParameter.name, ParameterType = observedParameter.type.ToString(), TotalParameters = observedController.parameters.Length, PlannedEffects = new List<AnimationPlannedEffect> { new AnimationPlannedEffect { Type = "controller.add-parameter", Path = path, Parameter = observedParameter.name } } });
47
+ return new System.Threading.Tasks.ValueTask<Result>(new Result { Path = path, ParameterName = observedParameter.name, ParameterType = observedParameter.type.ToString(), TotalParameters = observedController.parameters.Length, PlannedEffects = new List<AnimationPlannedEffect> { new AnimationPlannedEffect { Type = "animator-controller.add-parameter", Path = path, Parameter = observedParameter.name } } });
48
48
  }
49
49
  }
50
50
  }
@@ -7,20 +7,20 @@ using UnityEngine;
7
7
 
8
8
  namespace UnityCli
9
9
  {
10
- /// <summary>controller.add-state — 在指定层添加状态。</summary>
11
- public class ControllerAddStateTool : IUnityCliTool<ControllerAddStateTool.Request, ControllerAddStateTool.Result>
10
+ /// <summary>animator-controller.add-state — 在指定层添加状态。</summary>
11
+ public class AnimatorControllerAddStateTool : IUnityCliTool<AnimatorControllerAddStateTool.Request, AnimatorControllerAddStateTool.Result>
12
12
  {
13
13
  public sealed class Request { public string ControllerPath { get; set; } public string StateName { get; set; } public string ClipPath { get; set; } public int? LayerIndex { get; set; } public float? Speed { get; set; } public bool? IsDefault { get; set; } }
14
14
  public sealed class Result { public string Path { get; set; } public string StateName { get; set; } public bool HasMotion { get; set; } public string MotionName { get; set; } public double Speed { get; set; } public bool IsDefault { get; set; } public List<AnimationPlannedEffect> PlannedEffects { get; set; } }
15
- public ToolDescriptor Describe() => new() { Name = "controller.add-state", Summary = "Add a new state to an AnimatorController layer.", Description = "Add a state to the specified layer. Optionally assign a motion clip and set as default state.", Group = "controller",DestructiveHint = true, SideEffects = new[] { "asset-write" }, Target = "editor", PlayModeSupport = "editor-only", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Add MatrixWalk state", Input = new Request { ControllerPath = "Assets/Animations/Player.controller", StateName = "MatrixWalk" } } } };
15
+ public ToolDescriptor Describe() => new() { Name = "animator-controller.add-state", Summary = "Add a new state to an AnimatorController layer.", Description = "Add a state to the specified layer. Optionally assign a motion clip and set as default state.", Group = "animator-controller",DestructiveHint = true, SideEffects = new[] { "asset-write" }, Target = "editor", PlayModeSupport = "editor-only", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Add MatrixWalk state", Input = new Request { ControllerPath = "Assets/Animations/Player.controller", StateName = "MatrixWalk" } } } };
16
16
  public System.Threading.Tasks.ValueTask<Result> ExecuteAsync(Request r, UnityCliProjectToolContext ctx, System.Threading.CancellationToken ct = default)
17
17
  {
18
18
  var path = AnimationToolSupport.RequireControllerPath(r.ControllerPath);
19
19
  var controller = AnimationToolSupport.LoadControllerAsset(path);
20
- if (controller == null) throw new UnityCliBridge.BridgeCommandException("E_CONTROLLER_NOT_FOUND", "AnimatorController not found at: " + path, "Check the path or create one with controller.create.");
21
- if (string.IsNullOrEmpty(r.StateName)) throw new UnityCliBridge.BridgeCommandException("E_STATE_NAME_REQUIRED", "controller.add-state requires stateName.", "Pass a name for the new state.");
20
+ if (controller == null) throw new UnityCliBridge.BridgeCommandException("E_CONTROLLER_NOT_FOUND", "AnimatorController not found at: " + path, "Check the path or create one with animator-controller.create.");
21
+ if (string.IsNullOrEmpty(r.StateName)) throw new UnityCliBridge.BridgeCommandException("E_STATE_NAME_REQUIRED", "animator-controller.add-state requires stateName.", "Pass a name for the new state.");
22
22
  var layerIndex = r.LayerIndex ?? 0;
23
- if (layerIndex < 0 || layerIndex >= controller.layers.Length) throw new UnityCliBridge.BridgeCommandException("E_LAYER_INDEX_INVALID", "Layer index out of range.", "Run controller.get-info to inspect available layers.");
23
+ if (layerIndex < 0 || layerIndex >= controller.layers.Length) throw new UnityCliBridge.BridgeCommandException("E_LAYER_INDEX_INVALID", "Layer index out of range.", "Run animator-controller.get-info to inspect available layers.");
24
24
  var sm = controller.layers[layerIndex].stateMachine;
25
25
  if (AnimationToolSupport.FindStateInLayer(sm, r.StateName) != null) throw new UnityCliBridge.BridgeCommandException("E_STATE_EXISTS", "State '" + r.StateName + "' already exists in layer " + layerIndex + ".", "Choose a different state name.");
26
26
  AnimationClip clip = null;
@@ -37,7 +37,7 @@ namespace UnityCli
37
37
  var observedState = observedController == null || layerIndex >= observedController.layers.Length ? null : AnimationToolSupport.FindStateInLayer(observedController.layers[layerIndex].stateMachine, r.StateName);
38
38
  if (observedState == null || !Mathf.Approximately(observedState.speed, r.Speed ?? 1f) || (clip != null && observedState.motion != clip) || (isDefault && observedController.layers[layerIndex].stateMachine.defaultState != observedState))
39
39
  throw AnimationToolSupport.StateMismatch("E_CONTROLLER_ADD_STATE_STATE_MISMATCH", "AnimatorController state");
40
- return new System.Threading.Tasks.ValueTask<Result>(new Result { Path = path, StateName = observedState.name, HasMotion = observedState.motion != null, MotionName = observedState.motion?.name, Speed = observedState.speed, IsDefault = observedController.layers[layerIndex].stateMachine.defaultState == observedState, PlannedEffects = new List<AnimationPlannedEffect> { new AnimationPlannedEffect { Type = "controller.add-state", Path = path, State = observedState.name } } });
40
+ return new System.Threading.Tasks.ValueTask<Result>(new Result { Path = path, StateName = observedState.name, HasMotion = observedState.motion != null, MotionName = observedState.motion?.name, Speed = observedState.speed, IsDefault = observedController.layers[layerIndex].stateMachine.defaultState == observedState, PlannedEffects = new List<AnimationPlannedEffect> { new AnimationPlannedEffect { Type = "animator-controller.add-state", Path = path, State = observedState.name } } });
41
41
  }
42
42
  }
43
43
  }
@@ -7,26 +7,26 @@ using UnityEngine;
7
7
 
8
8
  namespace UnityCli
9
9
  {
10
- /// <summary>controller.add-transition — 在状态间添加转换。</summary>
11
- public class ControllerAddTransitionTool : IUnityCliTool<ControllerAddTransitionTool.Request, ControllerAddTransitionTool.Result>
10
+ /// <summary>animator-controller.add-transition — 在状态间添加转换。</summary>
11
+ public class AnimatorControllerAddTransitionTool : IUnityCliTool<AnimatorControllerAddTransitionTool.Request, AnimatorControllerAddTransitionTool.Result>
12
12
  {
13
13
  public sealed class Request { public string ControllerPath { get; set; } public string FromState { get; set; } public string ToState { get; set; } public int? LayerIndex { get; set; } public bool? HasExitTime { get; set; } public float? Duration { get; set; } public float? ExitTime { get; set; } public string Conditions { get; set; } }
14
14
  public sealed class Result { public string Path { get; set; } public string ToState { get; set; } public bool HasExitTime { get; set; } public double Duration { get; set; } public long ConditionCount { get; set; } public List<AnimationPlannedEffect> PlannedEffects { get; set; } }
15
- public ToolDescriptor Describe() => new() { Name = "controller.add-transition", Summary = "Add a transition between two states in an AnimatorController layer.", Description = "Add a transition from fromState to toState. Supports AnyState as source. conditions is a JSON array of {parameter, mode, threshold}.", Group = "controller",DestructiveHint = true, SideEffects = new[] { "asset-write" }, Target = "editor", PlayModeSupport = "editor-only", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Add transition", Input = new Request { ControllerPath = "Assets/Animations/Player.controller", FromState = "Idle", ToState = "Walk" } } } };
15
+ public ToolDescriptor Describe() => new() { Name = "animator-controller.add-transition", Summary = "Add a transition between two states in an AnimatorController layer.", Description = "Add a transition from fromState to toState. Supports AnyState as source. conditions is a JSON array of {parameter, mode, threshold}.", Group = "animator-controller",DestructiveHint = true, SideEffects = new[] { "asset-write" }, Target = "editor", PlayModeSupport = "editor-only", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Add transition", Input = new Request { ControllerPath = "Assets/Animations/Player.controller", FromState = "Idle", ToState = "Walk" } } } };
16
16
  public System.Threading.Tasks.ValueTask<Result> ExecuteAsync(Request r, UnityCliProjectToolContext ctx, System.Threading.CancellationToken ct = default)
17
17
  {
18
18
  var path = AnimationToolSupport.RequireControllerPath(r.ControllerPath);
19
19
  var controller = AnimationToolSupport.LoadControllerAsset(path);
20
- if (controller == null) throw new UnityCliBridge.BridgeCommandException("E_CONTROLLER_NOT_FOUND", "AnimatorController not found at: " + path, "Check the path or create one with controller.create.");
21
- if (string.IsNullOrEmpty(r.FromState) || string.IsNullOrEmpty(r.ToState)) throw new UnityCliBridge.BridgeCommandException("E_STATE_NAME_REQUIRED", "controller.add-transition requires fromState and toState.", "Pass source and destination state names.");
20
+ if (controller == null) throw new UnityCliBridge.BridgeCommandException("E_CONTROLLER_NOT_FOUND", "AnimatorController not found at: " + path, "Check the path or create one with animator-controller.create.");
21
+ if (string.IsNullOrEmpty(r.FromState) || string.IsNullOrEmpty(r.ToState)) throw new UnityCliBridge.BridgeCommandException("E_STATE_NAME_REQUIRED", "animator-controller.add-transition requires fromState and toState.", "Pass source and destination state names.");
22
22
  var layerIndex = r.LayerIndex ?? 0;
23
- if (layerIndex < 0 || layerIndex >= controller.layers.Length) throw new UnityCliBridge.BridgeCommandException("E_LAYER_INDEX_INVALID", "Layer index out of range.", "Run controller.get-info to inspect available layers.");
23
+ if (layerIndex < 0 || layerIndex >= controller.layers.Length) throw new UnityCliBridge.BridgeCommandException("E_LAYER_INDEX_INVALID", "Layer index out of range.", "Run animator-controller.get-info to inspect available layers.");
24
24
  var sm = controller.layers[layerIndex].stateMachine;
25
25
  var isAnyState = string.Equals(r.FromState, "AnyState", System.StringComparison.OrdinalIgnoreCase) || string.Equals(r.FromState, "Any", System.StringComparison.OrdinalIgnoreCase);
26
26
  var toState = AnimationToolSupport.FindStateInLayer(sm, r.ToState);
27
- if (toState == null) throw new UnityCliBridge.BridgeCommandException("E_STATE_NOT_FOUND", "Destination state '" + r.ToState + "' not found in layer " + layerIndex + ".", "Run controller.get-info to inspect available states.");
27
+ if (toState == null) throw new UnityCliBridge.BridgeCommandException("E_STATE_NOT_FOUND", "Destination state '" + r.ToState + "' not found in layer " + layerIndex + ".", "Run animator-controller.get-info to inspect available states.");
28
28
  var fromState = isAnyState ? null : AnimationToolSupport.FindStateInLayer(sm, r.FromState);
29
- if (!isAnyState && fromState == null) throw new UnityCliBridge.BridgeCommandException("E_STATE_NOT_FOUND", "Source state '" + r.FromState + "' not found in layer " + layerIndex + ".", "Run controller.get-info to inspect available states.");
29
+ if (!isAnyState && fromState == null) throw new UnityCliBridge.BridgeCommandException("E_STATE_NOT_FOUND", "Source state '" + r.FromState + "' not found in layer " + layerIndex + ".", "Run animator-controller.get-info to inspect available states.");
30
30
  ctx.CommitEffect();
31
31
  Undo.RecordObject(controller, "Add Animator Transition");
32
32
  AnimatorStateTransition transition;
@@ -61,7 +61,7 @@ namespace UnityCli
61
61
  foreach (var candidate in transitions) if (candidate.destinationState == observedDestination && candidate.hasExitTime == (r.HasExitTime ?? true) && Mathf.Approximately(candidate.duration, r.Duration ?? 0.25f) && candidate.conditions.Length == conditionCount) { observedTransition = candidate; break; }
62
62
  }
63
63
  if (observedTransition == null) throw AnimationToolSupport.StateMismatch("E_CONTROLLER_TRANSITION_STATE_MISMATCH", "AnimatorController transition");
64
- return new System.Threading.Tasks.ValueTask<Result>(new Result { Path = path, ToState = observedDestination.name, HasExitTime = observedTransition.hasExitTime, Duration = observedTransition.duration, ConditionCount = observedTransition.conditions.Length, PlannedEffects = new List<AnimationPlannedEffect> { new AnimationPlannedEffect { Type = "controller.add-transition", Path = path, State = fromStateName + "->" + observedDestination.name } } });
64
+ return new System.Threading.Tasks.ValueTask<Result>(new Result { Path = path, ToState = observedDestination.name, HasExitTime = observedTransition.hasExitTime, Duration = observedTransition.duration, ConditionCount = observedTransition.conditions.Length, PlannedEffects = new List<AnimationPlannedEffect> { new AnimationPlannedEffect { Type = "animator-controller.add-transition", Path = path, State = fromStateName + "->" + observedDestination.name } } });
65
65
  }
66
66
  internal static string[] ExtractArrayItems(string json) { var items = new List<string>(); var depth = 0; var start = -1; for (var i = 0; i < json.Length; i++) { if (json[i] == '{') { if (depth == 0) start = i; depth++; } else if (json[i] == '}') { depth--; if (depth == 0 && start >= 0) { items.Add(json.Substring(start, i - start + 1)); start = -1; } } } return items.ToArray(); }
67
67
  internal static string ExtractJsonField(string json, string field) { var key = "\"" + field + "\""; var idx = json.IndexOf(key, System.StringComparison.OrdinalIgnoreCase); if (idx < 0) return null; idx = json.IndexOf(':', idx + key.Length); if (idx < 0) return null; idx++; while (idx < json.Length && char.IsWhiteSpace(json[idx])) idx++; if (idx >= json.Length) return null; if (json[idx] == '"') { var end = json.IndexOf('"', idx + 1); return end > idx ? json.Substring(idx + 1, end - idx - 1) : null; } var endIdx = idx; while (endIdx < json.Length && json[endIdx] != ',' && json[endIdx] != '}' && !char.IsWhiteSpace(json[endIdx])) endIdx++; return json.Substring(idx, endIdx - idx); }
@@ -7,18 +7,18 @@ using UnityEngine;
7
7
 
8
8
  namespace UnityCli
9
9
  {
10
- /// <summary>controller.assign — 将 Controller 分配到目标 Animator。</summary>
11
- public class ControllerAssignTool : IUnityCliTool<ControllerAssignTool.Request, ControllerAssignTool.Result>
10
+ /// <summary>animator-controller.assign — 将 Controller 分配到目标 Animator。</summary>
11
+ public class AnimatorControllerAssignTool : IUnityCliTool<AnimatorControllerAssignTool.Request, AnimatorControllerAssignTool.Result>
12
12
  {
13
13
  public sealed class Request { public string ControllerPath { get; set; } public string Target { get; set; } }
14
14
  public sealed class Result { public string ControllerName { get; set; } public string ControllerPath { get; set; } public List<AnimationPlannedEffect> PlannedEffects { get; set; } }
15
- public ToolDescriptor Describe() => new() { Name = "controller.assign", Summary = "Assign an AnimatorController asset to a target GameObject's Animator.", Description = "Resolve a target GameObject, add an Animator if missing, and assign the controller asset.", Group = "controller",DestructiveHint = false, SideEffects = new[] { "scene-modify" }, Target = "editor", PlayModeSupport = "supported", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Assign controller", Input = new Request { ControllerPath = "Assets/Animations/Player.controller", Target = "Player" } } } };
15
+ public ToolDescriptor Describe() => new() { Name = "animator-controller.assign", Summary = "Assign an AnimatorController asset to a target GameObject's Animator.", Description = "Resolve a target GameObject, add an Animator if missing, and assign the controller asset.", Group = "animator-controller",DestructiveHint = false, SideEffects = new[] { "scene-modify" }, Target = "editor", PlayModeSupport = "supported", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Assign controller", Input = new Request { ControllerPath = "Assets/Animations/Player.controller", Target = "Player" } } } };
16
16
  public System.Threading.Tasks.ValueTask<Result> ExecuteAsync(Request r, UnityCliProjectToolContext ctx, System.Threading.CancellationToken ct = default)
17
17
  {
18
18
  var path = AnimationToolSupport.RequireControllerPath(r.ControllerPath);
19
19
  var controller = AnimationToolSupport.LoadControllerAsset(path);
20
- if (controller == null) throw new UnityCliBridge.BridgeCommandException("E_CONTROLLER_NOT_FOUND", "AnimatorController not found at: " + path, "Check the path or create one with controller.create.");
21
- var go = GameObjectToolSupport.ResolveUniqueTarget(r.Target, "controller.assign requires target.");
20
+ if (controller == null) throw new UnityCliBridge.BridgeCommandException("E_CONTROLLER_NOT_FOUND", "AnimatorController not found at: " + path, "Check the path or create one with animator-controller.create.");
21
+ var go = GameObjectToolSupport.ResolveUniqueTarget(r.Target, "animator-controller.assign requires target.");
22
22
  var animator = go.GetComponent<Animator>();
23
23
  ctx.CommitEffect();
24
24
  if (animator == null) animator = UnityCliSceneMutation.AddComponent<Animator>(go);
@@ -31,7 +31,7 @@ namespace UnityCli
31
31
  var observedController = observedAnimator == null ? null : observedAnimator.runtimeAnimatorController;
32
32
  var observedPath = observedController == null ? null : AssetDatabase.GetAssetPath(observedController);
33
33
  if (observedController != controller || observedPath != path) throw AnimationToolSupport.StateMismatch("E_CONTROLLER_ASSIGN_STATE_MISMATCH", "Animator controller assignment");
34
- return new System.Threading.Tasks.ValueTask<Result>(new Result { ControllerName = observedController.name, ControllerPath = observedPath, PlannedEffects = new List<AnimationPlannedEffect> { new AnimationPlannedEffect { Type = "controller.assign", Path = observedPath, Target = GameObjectToolSupport.HierarchyPath(go) } } });
34
+ return new System.Threading.Tasks.ValueTask<Result>(new Result { ControllerName = observedController.name, ControllerPath = observedPath, PlannedEffects = new List<AnimationPlannedEffect> { new AnimationPlannedEffect { Type = "animator-controller.assign", Path = observedPath, Target = GameObjectToolSupport.HierarchyPath(go) } } });
35
35
  }
36
36
  }
37
37
  }
@@ -7,20 +7,20 @@ using UnityEngine;
7
7
 
8
8
  namespace UnityCli
9
9
  {
10
- /// <summary>controller.create-blend-tree-1d — 创建 1D BlendTree 状态。</summary>
11
- public class ControllerCreateBlendTree1DTool : IUnityCliTool<ControllerCreateBlendTree1DTool.Request, ControllerCreateBlendTree1DTool.Result>
10
+ /// <summary>animator-controller.create-blend-tree-1d — 创建 1D BlendTree 状态。</summary>
11
+ public class AnimatorControllerCreateBlendTree1DTool : IUnityCliTool<AnimatorControllerCreateBlendTree1DTool.Request, AnimatorControllerCreateBlendTree1DTool.Result>
12
12
  {
13
13
  public sealed class Request { public string ControllerPath { get; set; } public string StateName { get; set; } public string BlendParameter { get; set; } public int? LayerIndex { get; set; } }
14
14
  public sealed class Result { public string Path { get; set; } public string StateName { get; set; } public string BlendParameter { get; set; } public List<AnimationPlannedEffect> PlannedEffects { get; set; } }
15
- public ToolDescriptor Describe() => new() { Name = "controller.create-blend-tree-1d", Summary = "Create a 1D BlendTree state in an AnimatorController layer.", Description = "Add a new state with a 1D BlendTree motion using the specified blend parameter.", Group = "controller",DestructiveHint = true, SideEffects = new[] { "asset-write" }, Target = "editor", PlayModeSupport = "editor-only", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Create 1D blend tree", Input = new Request { ControllerPath = "Assets/Animations/Player.controller", StateName = "MatrixMove", BlendParameter = "Speed" } } } };
15
+ public ToolDescriptor Describe() => new() { Name = "animator-controller.create-blend-tree-1d", Summary = "Create a 1D BlendTree state in an AnimatorController layer.", Description = "Add a new state with a 1D BlendTree motion using the specified blend parameter.", Group = "animator-controller",DestructiveHint = true, SideEffects = new[] { "asset-write" }, Target = "editor", PlayModeSupport = "editor-only", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Create 1D blend tree", Input = new Request { ControllerPath = "Assets/Animations/Player.controller", StateName = "MatrixMove", BlendParameter = "Speed" } } } };
16
16
  public System.Threading.Tasks.ValueTask<Result> ExecuteAsync(Request r, UnityCliProjectToolContext ctx, System.Threading.CancellationToken ct = default)
17
17
  {
18
18
  var path = AnimationToolSupport.RequireControllerPath(r.ControllerPath);
19
19
  var controller = AnimationToolSupport.LoadControllerAsset(path);
20
- if (controller == null) throw new UnityCliBridge.BridgeCommandException("E_CONTROLLER_NOT_FOUND", "AnimatorController not found at: " + path, "Check the path or create one with controller.create.");
21
- if (string.IsNullOrEmpty(r.StateName)) throw new UnityCliBridge.BridgeCommandException("E_STATE_NAME_REQUIRED", "controller.create-blend-tree-1d requires stateName.", "Pass a name for the blend tree state.");
20
+ if (controller == null) throw new UnityCliBridge.BridgeCommandException("E_CONTROLLER_NOT_FOUND", "AnimatorController not found at: " + path, "Check the path or create one with animator-controller.create.");
21
+ if (string.IsNullOrEmpty(r.StateName)) throw new UnityCliBridge.BridgeCommandException("E_STATE_NAME_REQUIRED", "animator-controller.create-blend-tree-1d requires stateName.", "Pass a name for the blend tree state.");
22
22
  var layerIndex = r.LayerIndex ?? 0;
23
- if (layerIndex < 0 || layerIndex >= controller.layers.Length) throw new UnityCliBridge.BridgeCommandException("E_LAYER_INDEX_INVALID", "Layer index out of range.", "Run controller.get-info to inspect layers.");
23
+ if (layerIndex < 0 || layerIndex >= controller.layers.Length) throw new UnityCliBridge.BridgeCommandException("E_LAYER_INDEX_INVALID", "Layer index out of range.", "Run animator-controller.get-info to inspect layers.");
24
24
  var sm = controller.layers[layerIndex].stateMachine;
25
25
  if (AnimationToolSupport.FindStateInLayer(sm, r.StateName) != null) throw new UnityCliBridge.BridgeCommandException("E_STATE_EXISTS", "State '" + r.StateName + "' already exists.", "Choose a different state name.");
26
26
  ctx.CommitEffect();
@@ -33,7 +33,7 @@ namespace UnityCli
33
33
  var observedState = observedController == null ? null : AnimationToolSupport.FindStateInLayer(observedController.layers[layerIndex].stateMachine, r.StateName);
34
34
  var observedTree = observedState == null ? null : observedState.motion as BlendTree;
35
35
  if (observedTree == null || observedTree.blendType != BlendTreeType.Simple1D || observedTree.blendParameter != (r.BlendParameter ?? "")) throw AnimationToolSupport.StateMismatch("E_CONTROLLER_BLEND_TREE_1D_STATE_MISMATCH", "1D BlendTree");
36
- return new System.Threading.Tasks.ValueTask<Result>(new Result { Path = path, StateName = observedState.name, BlendParameter = observedTree.blendParameter, PlannedEffects = new List<AnimationPlannedEffect> { new AnimationPlannedEffect { Type = "controller.create-blend-tree-1d", Path = path, State = observedState.name } } });
36
+ return new System.Threading.Tasks.ValueTask<Result>(new Result { Path = path, StateName = observedState.name, BlendParameter = observedTree.blendParameter, PlannedEffects = new List<AnimationPlannedEffect> { new AnimationPlannedEffect { Type = "animator-controller.create-blend-tree-1d", Path = path, State = observedState.name } } });
37
37
  }
38
38
  }
39
39
  }
@@ -7,20 +7,20 @@ using UnityEngine;
7
7
 
8
8
  namespace UnityCli
9
9
  {
10
- /// <summary>controller.create-blend-tree-2d — 创建 2D BlendTree 状态。</summary>
11
- public class ControllerCreateBlendTree2DTool : IUnityCliTool<ControllerCreateBlendTree2DTool.Request, ControllerCreateBlendTree2DTool.Result>
10
+ /// <summary>animator-controller.create-blend-tree-2d — 创建 2D BlendTree 状态。</summary>
11
+ public class AnimatorControllerCreateBlendTree2DTool : IUnityCliTool<AnimatorControllerCreateBlendTree2DTool.Request, AnimatorControllerCreateBlendTree2DTool.Result>
12
12
  {
13
13
  public sealed class Request { public string ControllerPath { get; set; } public string StateName { get; set; } public string BlendParameterX { get; set; } public string BlendParameterY { get; set; } public int? LayerIndex { get; set; } public string BlendType { get; set; } }
14
14
  public sealed class Result { public string Path { get; set; } public string StateName { get; set; } public string BlendType { get; set; } public List<AnimationPlannedEffect> PlannedEffects { get; set; } }
15
- public ToolDescriptor Describe() => new() { Name = "controller.create-blend-tree-2d", Summary = "Create a 2D BlendTree state in an AnimatorController layer.", Description = "Add a new state with a 2D BlendTree motion. blendType: simpledirectional2d, simpledirectional, freesystemlessdirectional.", Group = "controller",DestructiveHint = true, SideEffects = new[] { "asset-write" }, Target = "editor", PlayModeSupport = "editor-only", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Create 2D blend tree", Input = new Request { ControllerPath = "Assets/Animations/Player.controller", StateName = "Locomotion", BlendParameterX = "SpeedX", BlendParameterY = "SpeedY" } } } };
15
+ public ToolDescriptor Describe() => new() { Name = "animator-controller.create-blend-tree-2d", Summary = "Create a 2D BlendTree state in an AnimatorController layer.", Description = "Add a new state with a 2D BlendTree motion. blendType: simpledirectional2d, simpledirectional, freesystemlessdirectional.", Group = "animator-controller",DestructiveHint = true, SideEffects = new[] { "asset-write" }, Target = "editor", PlayModeSupport = "editor-only", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Create 2D blend tree", Input = new Request { ControllerPath = "Assets/Animations/Player.controller", StateName = "Locomotion", BlendParameterX = "SpeedX", BlendParameterY = "SpeedY" } } } };
16
16
  public System.Threading.Tasks.ValueTask<Result> ExecuteAsync(Request r, UnityCliProjectToolContext ctx, System.Threading.CancellationToken ct = default)
17
17
  {
18
18
  var path = AnimationToolSupport.RequireControllerPath(r.ControllerPath);
19
19
  var controller = AnimationToolSupport.LoadControllerAsset(path);
20
- if (controller == null) throw new UnityCliBridge.BridgeCommandException("E_CONTROLLER_NOT_FOUND", "AnimatorController not found at: " + path, "Check the path or create one with controller.create.");
21
- if (string.IsNullOrEmpty(r.StateName)) throw new UnityCliBridge.BridgeCommandException("E_STATE_NAME_REQUIRED", "controller.create-blend-tree-2d requires stateName.", "Pass a name for the blend tree state.");
20
+ if (controller == null) throw new UnityCliBridge.BridgeCommandException("E_CONTROLLER_NOT_FOUND", "AnimatorController not found at: " + path, "Check the path or create one with animator-controller.create.");
21
+ if (string.IsNullOrEmpty(r.StateName)) throw new UnityCliBridge.BridgeCommandException("E_STATE_NAME_REQUIRED", "animator-controller.create-blend-tree-2d requires stateName.", "Pass a name for the blend tree state.");
22
22
  var layerIndex = r.LayerIndex ?? 0;
23
- if (layerIndex < 0 || layerIndex >= controller.layers.Length) throw new UnityCliBridge.BridgeCommandException("E_LAYER_INDEX_INVALID", "Layer index out of range.", "Run controller.get-info to inspect layers.");
23
+ if (layerIndex < 0 || layerIndex >= controller.layers.Length) throw new UnityCliBridge.BridgeCommandException("E_LAYER_INDEX_INVALID", "Layer index out of range.", "Run animator-controller.get-info to inspect layers.");
24
24
  var sm = controller.layers[layerIndex].stateMachine;
25
25
  if (AnimationToolSupport.FindStateInLayer(sm, r.StateName) != null) throw new UnityCliBridge.BridgeCommandException("E_STATE_EXISTS", "State '" + r.StateName + "' already exists.", "Choose a different state name.");
26
26
  var bt = (r.BlendType ?? "simpledirectional2d").ToLowerInvariant();
@@ -35,7 +35,7 @@ namespace UnityCli
35
35
  var observedState = observedController == null ? null : AnimationToolSupport.FindStateInLayer(observedController.layers[layerIndex].stateMachine, r.StateName);
36
36
  var observedTree = observedState == null ? null : observedState.motion as BlendTree;
37
37
  if (observedTree == null || observedTree.blendType != blendType || observedTree.blendParameter != (r.BlendParameterX ?? "") || observedTree.blendParameterY != (r.BlendParameterY ?? "")) throw AnimationToolSupport.StateMismatch("E_CONTROLLER_BLEND_TREE_2D_STATE_MISMATCH", "2D BlendTree");
38
- return new System.Threading.Tasks.ValueTask<Result>(new Result { Path = path, StateName = observedState.name, BlendType = observedTree.blendType.ToString(), PlannedEffects = new List<AnimationPlannedEffect> { new AnimationPlannedEffect { Type = "controller.create-blend-tree-2d", Path = path, State = observedState.name } } });
38
+ return new System.Threading.Tasks.ValueTask<Result>(new Result { Path = path, StateName = observedState.name, BlendType = observedTree.blendType.ToString(), PlannedEffects = new List<AnimationPlannedEffect> { new AnimationPlannedEffect { Type = "animator-controller.create-blend-tree-2d", Path = path, State = observedState.name } } });
39
39
  }
40
40
  }
41
41
  }
@@ -7,12 +7,12 @@ using UnityEngine;
7
7
 
8
8
  namespace UnityCli
9
9
  {
10
- /// <summary>controller.create — 创建 AnimatorController 资产。</summary>
11
- public class ControllerCreateTool : IUnityCliTool<ControllerCreateTool.Request, ControllerCreateTool.Result>
10
+ /// <summary>animator-controller.create — 创建 AnimatorController 资产。</summary>
11
+ public class AnimatorControllerCreateTool : IUnityCliTool<AnimatorControllerCreateTool.Request, AnimatorControllerCreateTool.Result>
12
12
  {
13
13
  public sealed class Request { public string ControllerPath { get; set; } }
14
14
  public sealed class Result { public ControllerInfo Controller { get; set; } public List<AnimationPlannedEffect> PlannedEffects { get; set; } }
15
- public ToolDescriptor Describe() => new() { Name = "controller.create", Summary = "Create a new AnimatorController asset at an Assets/*.controller path.", Description = "Create a new .controller asset with a default Base layer. Refuses to overwrite an existing controller.", Group = "controller",DestructiveHint = true, SideEffects = new[] { "asset-write" }, Target = "editor", PlayModeSupport = "editor-only", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Create controller", Input = new Request { ControllerPath = "Assets/Animations/Created.controller" } } } };
15
+ public ToolDescriptor Describe() => new() { Name = "animator-controller.create", Summary = "Create a new AnimatorController asset at an Assets/*.controller path.", Description = "Create a new .controller asset with a default Base layer. Refuses to overwrite an existing controller.", Group = "animator-controller",DestructiveHint = true, SideEffects = new[] { "asset-write" }, Target = "editor", PlayModeSupport = "editor-only", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Create controller", Input = new Request { ControllerPath = "Assets/Animations/Created.controller" } } } };
16
16
  public System.Threading.Tasks.ValueTask<Result> ExecuteAsync(Request r, UnityCliProjectToolContext ctx, System.Threading.CancellationToken ct = default)
17
17
  {
18
18
  var path = AnimationToolSupport.RequireControllerPath(r.ControllerPath);
@@ -24,7 +24,7 @@ namespace UnityCli
24
24
  var observedController = AnimationToolSupport.ReloadControllerAsset(path);
25
25
  if (observedController == null || observedController.name != controller.name || observedController.layers == null || observedController.layers.Length != 1 || observedController.parameters == null || observedController.parameters.Length != 0)
26
26
  throw AnimationToolSupport.StateMismatch("E_CONTROLLER_CREATE_STATE_MISMATCH", "AnimatorController creation");
27
- return new System.Threading.Tasks.ValueTask<Result>(new Result { Controller = new ControllerInfo { Path = path, Guid = AssetDatabase.AssetPathToGUID(path), Name = observedController.name, LayerCount = observedController.layers.Length, ParameterCount = observedController.parameters.Length }, PlannedEffects = new List<AnimationPlannedEffect> { new AnimationPlannedEffect { Type = "controller.create", Path = path } } });
27
+ return new System.Threading.Tasks.ValueTask<Result>(new Result { Controller = new ControllerInfo { Path = path, Guid = AssetDatabase.AssetPathToGUID(path), Name = observedController.name, LayerCount = observedController.layers.Length, ParameterCount = observedController.parameters.Length }, PlannedEffects = new List<AnimationPlannedEffect> { new AnimationPlannedEffect { Type = "animator-controller.create", Path = path } } });
28
28
  }
29
29
  }
30
30
  }
@@ -7,17 +7,17 @@ using UnityEngine;
7
7
 
8
8
  namespace UnityCli
9
9
  {
10
- /// <summary>controller.get-info — 读取 Controller 层/状态/参数信息。</summary>
11
- public class ControllerGetInfoTool : IUnityCliTool<ControllerGetInfoTool.Request, ControllerGetInfoTool.Result>
10
+ /// <summary>animator-controller.get-info — 读取 Controller 层/状态/参数信息。</summary>
11
+ public class AnimatorControllerGetInfoTool : IUnityCliTool<AnimatorControllerGetInfoTool.Request, AnimatorControllerGetInfoTool.Result>
12
12
  {
13
13
  public sealed class Request { public string ControllerPath { get; set; } }
14
14
  public sealed class Result { public ControllerInfo Controller { get; set; } public List<AnimatorParameterInfo> Parameters { get; set; } }
15
- public ToolDescriptor Describe() => new() { Name = "controller.get-info", Summary = "Read AnimatorController layers, states, and parameters.", Description = "Read-only: returns controller path, guid, layer count, parameter count, and parameter definitions.", Group = "controller",DestructiveHint = false, Target = "editor", PlayModeSupport = "supported", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Read controller info", Input = new Request { ControllerPath = "Assets/Animations/Player.controller" } } } };
15
+ public ToolDescriptor Describe() => new() { Name = "animator-controller.get-info", Summary = "Read AnimatorController layers, states, and parameters.", Description = "Read-only: returns controller path, guid, layer count, parameter count, and parameter definitions.", Group = "animator-controller",DestructiveHint = false, Target = "editor", PlayModeSupport = "supported", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Read controller info", Input = new Request { ControllerPath = "Assets/Animations/Player.controller" } } } };
16
16
  public System.Threading.Tasks.ValueTask<Result> ExecuteAsync(Request r, UnityCliProjectToolContext ctx, System.Threading.CancellationToken ct = default)
17
17
  {
18
18
  var path = AnimationToolSupport.RequireControllerPath(r.ControllerPath);
19
19
  var controller = AnimationToolSupport.LoadControllerAsset(path);
20
- if (controller == null) throw new UnityCliBridge.BridgeCommandException("E_CONTROLLER_NOT_FOUND", "AnimatorController not found at: " + path, "Check the path or create one with controller.create.");
20
+ if (controller == null) throw new UnityCliBridge.BridgeCommandException("E_CONTROLLER_NOT_FOUND", "AnimatorController not found at: " + path, "Check the path or create one with animator-controller.create.");
21
21
  var parameters = new List<AnimatorParameterInfo>();
22
22
  foreach (var p in controller.parameters) parameters.Add(new AnimatorParameterInfo { Name = p.name, Type = p.type.ToString(), DefaultFloat = p.defaultFloat, DefaultInt = p.defaultInt, DefaultBool = p.defaultBool });
23
23
  return new System.Threading.Tasks.ValueTask<Result>(new Result { Controller = new ControllerInfo { Path = path, Guid = AssetDatabase.AssetPathToGUID(path), Name = controller.name, LayerCount = controller.layers.Length, ParameterCount = controller.parameters.Length }, Parameters = parameters });
@@ -7,21 +7,21 @@ using UnityEngine;
7
7
 
8
8
  namespace UnityCli
9
9
  {
10
- /// <summary>controller.remove-layer — 移除 Controller 层。</summary>
11
- public class ControllerRemoveLayerTool : IUnityCliTool<ControllerRemoveLayerTool.Request, ControllerRemoveLayerTool.Result>
10
+ /// <summary>animator-controller.remove-layer — 移除 Controller 层。</summary>
11
+ public class AnimatorControllerRemoveLayerTool : IUnityCliTool<AnimatorControllerRemoveLayerTool.Request, AnimatorControllerRemoveLayerTool.Result>
12
12
  {
13
13
  public sealed class Request { public string ControllerPath { get; set; } public int? LayerIndex { get; set; } public string LayerName { get; set; } }
14
14
  public sealed class Result { public string Path { get; set; } public long RemovedLayerIndex { get; set; } public string RemovedLayerName { get; set; } public long RemainingLayerCount { get; set; } public List<AnimationPlannedEffect> PlannedEffects { get; set; } }
15
- public ToolDescriptor Describe() => new() { Name = "controller.remove-layer", Summary = "Remove a layer from an AnimatorController by index or name.", Description = "Remove a layer. The base layer (index 0) cannot be removed. Pass layerIndex or layerName.", Group = "controller",DestructiveHint = true, SideEffects = new[] { "asset-write" }, Target = "editor", PlayModeSupport = "editor-only", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Remove layer", Input = new Request { ControllerPath = "Assets/Animations/Player.controller", LayerIndex = 1 } } } };
15
+ public ToolDescriptor Describe() => new() { Name = "animator-controller.remove-layer", Summary = "Remove a layer from an AnimatorController by index or name.", Description = "Remove a layer. The base layer (index 0) cannot be removed. Pass layerIndex or layerName.", Group = "animator-controller",DestructiveHint = true, SideEffects = new[] { "asset-write" }, Target = "editor", PlayModeSupport = "editor-only", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Remove layer", Input = new Request { ControllerPath = "Assets/Animations/Player.controller", LayerIndex = 1 } } } };
16
16
  public System.Threading.Tasks.ValueTask<Result> ExecuteAsync(Request r, UnityCliProjectToolContext ctx, System.Threading.CancellationToken ct = default)
17
17
  {
18
18
  var path = AnimationToolSupport.RequireControllerPath(r.ControllerPath);
19
19
  var controller = AnimationToolSupport.LoadControllerAsset(path);
20
- if (controller == null) throw new UnityCliBridge.BridgeCommandException("E_CONTROLLER_NOT_FOUND", "AnimatorController not found at: " + path, "Check the path or create one with controller.create.");
21
- if (!r.LayerIndex.HasValue && string.IsNullOrEmpty(r.LayerName)) throw new UnityCliBridge.BridgeCommandException("E_LAYER_IDENTIFIER_REQUIRED", "controller.remove-layer requires layerIndex or layerName.", "Pass either a layer index or a layer name.");
20
+ if (controller == null) throw new UnityCliBridge.BridgeCommandException("E_CONTROLLER_NOT_FOUND", "AnimatorController not found at: " + path, "Check the path or create one with animator-controller.create.");
21
+ if (!r.LayerIndex.HasValue && string.IsNullOrEmpty(r.LayerName)) throw new UnityCliBridge.BridgeCommandException("E_LAYER_IDENTIFIER_REQUIRED", "animator-controller.remove-layer requires layerIndex or layerName.", "Pass either a layer index or a layer name.");
22
22
  var removeIndex = -1; var removeName = "";
23
- if (r.LayerIndex.HasValue) { removeIndex = r.LayerIndex.Value; if (removeIndex < 0 || removeIndex >= controller.layers.Length) throw new UnityCliBridge.BridgeCommandException("E_LAYER_NOT_FOUND", "Layer index out of range: " + removeIndex, "Run controller.get-info to inspect layers."); removeName = controller.layers[removeIndex].name; }
24
- else { for (var i = 0; i < controller.layers.Length; i++) if (controller.layers[i].name == r.LayerName) { removeIndex = i; removeName = r.LayerName; break; } if (removeIndex < 0) throw new UnityCliBridge.BridgeCommandException("E_LAYER_NOT_FOUND", "Layer not found: " + r.LayerName, "Run controller.get-info to inspect layers."); }
23
+ if (r.LayerIndex.HasValue) { removeIndex = r.LayerIndex.Value; if (removeIndex < 0 || removeIndex >= controller.layers.Length) throw new UnityCliBridge.BridgeCommandException("E_LAYER_NOT_FOUND", "Layer index out of range: " + removeIndex, "Run animator-controller.get-info to inspect layers."); removeName = controller.layers[removeIndex].name; }
24
+ else { for (var i = 0; i < controller.layers.Length; i++) if (controller.layers[i].name == r.LayerName) { removeIndex = i; removeName = r.LayerName; break; } if (removeIndex < 0) throw new UnityCliBridge.BridgeCommandException("E_LAYER_NOT_FOUND", "Layer not found: " + r.LayerName, "Run animator-controller.get-info to inspect layers."); }
25
25
  if (removeIndex == 0) throw new UnityCliBridge.BridgeCommandException("E_LAYER_BASE_IMMUTABLE", "The base layer (index 0) cannot be removed.", "Remove a non-base layer instead.");
26
26
  var controllerGuid = AssetDatabase.AssetPathToGUID(path);
27
27
  if (string.IsNullOrEmpty(controllerGuid)) throw new UnityCliBridge.BridgeCommandException("E_CONTROLLER_NOT_FOUND", "AnimatorController has no stable asset GUID: " + path, "Check the controller asset path and retry.");
@@ -50,7 +50,7 @@ namespace UnityCli
50
50
  }
51
51
  }
52
52
  if (!removalProven) throw AnimationToolSupport.StateMismatch("E_CONTROLLER_REMOVE_LAYER_STATE_MISMATCH", "AnimatorController layer removal");
53
- return new System.Threading.Tasks.ValueTask<Result>(new Result { Path = path, RemovedLayerIndex = removeIndex, RemovedLayerName = removeName, RemainingLayerCount = observedController.layers.Length, PlannedEffects = new List<AnimationPlannedEffect> { new AnimationPlannedEffect { Type = "controller.remove-layer", Path = path } } });
53
+ return new System.Threading.Tasks.ValueTask<Result>(new Result { Path = path, RemovedLayerIndex = removeIndex, RemovedLayerName = removeName, RemainingLayerCount = observedController.layers.Length, PlannedEffects = new List<AnimationPlannedEffect> { new AnimationPlannedEffect { Type = "animator-controller.remove-layer", Path = path } } });
54
54
  }
55
55
  }
56
56
  }
@@ -7,21 +7,21 @@ using UnityEngine;
7
7
 
8
8
  namespace UnityCli
9
9
  {
10
- /// <summary>controller.set-layer-weight — 设置层权重。</summary>
11
- public class ControllerSetLayerWeightTool : IUnityCliTool<ControllerSetLayerWeightTool.Request, ControllerSetLayerWeightTool.Result>
10
+ /// <summary>animator-controller.set-layer-weight — 设置层权重。</summary>
11
+ public class AnimatorControllerSetLayerWeightTool : IUnityCliTool<AnimatorControllerSetLayerWeightTool.Request, AnimatorControllerSetLayerWeightTool.Result>
12
12
  {
13
13
  public sealed class Request { public string ControllerPath { get; set; } public int? LayerIndex { get; set; } public string LayerName { get; set; } public float? Weight { get; set; } }
14
14
  public sealed class Result { public string Path { get; set; } public string LayerName { get; set; } public double Weight { get; set; } public List<AnimationPlannedEffect> PlannedEffects { get; set; } }
15
- public ToolDescriptor Describe() => new() { Name = "controller.set-layer-weight", Summary = "Set the default weight of an AnimatorController layer.", Description = "Set the default weight of a layer by index or name. Weight 0 disables the layer.", Group = "controller",DestructiveHint = true, SideEffects = new[] { "asset-write" }, Target = "editor", PlayModeSupport = "editor-only", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Set layer weight", Input = new Request { ControllerPath = "Assets/Animations/Player.controller", LayerIndex = 1, Weight = 0.5f } } } };
15
+ public ToolDescriptor Describe() => new() { Name = "animator-controller.set-layer-weight", Summary = "Set the default weight of an AnimatorController layer.", Description = "Set the default weight of a layer by index or name. Weight 0 disables the layer.", Group = "animator-controller",DestructiveHint = true, SideEffects = new[] { "asset-write" }, Target = "editor", PlayModeSupport = "editor-only", DefaultTimeoutMs = 30000, MaxTimeoutMs = 600000, Examples = new[] { new ToolExample { Description = "Set layer weight", Input = new Request { ControllerPath = "Assets/Animations/Player.controller", LayerIndex = 1, Weight = 0.5f } } } };
16
16
  public System.Threading.Tasks.ValueTask<Result> ExecuteAsync(Request r, UnityCliProjectToolContext ctx, System.Threading.CancellationToken ct = default)
17
17
  {
18
18
  var path = AnimationToolSupport.RequireControllerPath(r.ControllerPath);
19
19
  var controller = AnimationToolSupport.LoadControllerAsset(path);
20
- if (controller == null) throw new UnityCliBridge.BridgeCommandException("E_CONTROLLER_NOT_FOUND", "AnimatorController not found at: " + path, "Check the path or create one with controller.create.");
20
+ if (controller == null) throw new UnityCliBridge.BridgeCommandException("E_CONTROLLER_NOT_FOUND", "AnimatorController not found at: " + path, "Check the path or create one with animator-controller.create.");
21
21
  var idx = -1;
22
22
  if (r.LayerIndex.HasValue) idx = r.LayerIndex.Value;
23
23
  else if (!string.IsNullOrEmpty(r.LayerName)) { for (var i = 0; i < controller.layers.Length; i++) if (controller.layers[i].name == r.LayerName) { idx = i; break; } }
24
- if (idx < 0 || idx >= controller.layers.Length) throw new UnityCliBridge.BridgeCommandException("E_LAYER_NOT_FOUND", "Layer not found.", "Run controller.get-info to inspect layers.");
24
+ if (idx < 0 || idx >= controller.layers.Length) throw new UnityCliBridge.BridgeCommandException("E_LAYER_NOT_FOUND", "Layer not found.", "Run animator-controller.get-info to inspect layers.");
25
25
  var weight = r.Weight ?? 1f;
26
26
  if (float.IsNaN(weight) || float.IsInfinity(weight) || weight < 0f || weight > 1f)
27
27
  throw new UnityCliBridge.BridgeCommandException("E_LAYER_WEIGHT_INVALID", "Layer weight must be finite and within Unity's 0 to 1 range.", "Pass a finite weight from 0 to 1.");
@@ -35,7 +35,7 @@ namespace UnityCli
35
35
  var observedController = AnimationToolSupport.ReloadControllerAsset(path, controllerGuid);
36
36
  var observedLayers = observedController == null ? null : observedController.layers;
37
37
  if (observedLayers == null || idx >= observedLayers.Length || observedLayers[idx].name != expectedLayer.Name || !Mathf.Approximately(observedLayers[idx].defaultWeight, weight)) throw AnimationToolSupport.StateMismatch("E_CONTROLLER_LAYER_WEIGHT_STATE_MISMATCH", "AnimatorController layer weight");
38
- return new System.Threading.Tasks.ValueTask<Result>(new Result { Path = path, LayerName = observedLayers[idx].name, Weight = observedLayers[idx].defaultWeight, PlannedEffects = new List<AnimationPlannedEffect> { new AnimationPlannedEffect { Type = "controller.set-layer-weight", Path = path } } });
38
+ return new System.Threading.Tasks.ValueTask<Result>(new Result { Path = path, LayerName = observedLayers[idx].name, Weight = observedLayers[idx].defaultWeight, PlannedEffects = new List<AnimationPlannedEffect> { new AnimationPlannedEffect { Type = "animator-controller.set-layer-weight", Path = path } } });
39
39
  }
40
40
  }
41
41
  }
@@ -28,7 +28,7 @@ namespace UnityCli
28
28
  {
29
29
  Name = "asset.preview",
30
30
  Summary = "Return AssetPreview thumbnail metadata (width/height/transient) for an Assets/* asset.",
31
- Description = "Return terminal AssetPreview thumbnail metadata for an Assets/* asset. A cache miss waits for Editor preview generation; assets without a preview return hasPreview=false as a terminal result. Does not return image bytes; use camera.screenshot or screenshot.scene-view for rendered captures.",
31
+ Description = "Return terminal AssetPreview thumbnail metadata for an Assets/* asset. A cache miss waits for Editor preview generation; assets without a preview return hasPreview=false as a terminal result. Does not return image bytes; use screenshot.from-camera or screenshot.scene-view for rendered captures.",
32
32
  Group = "asset",
33
33
  DestructiveHint = false,
34
34
  SideEffects = new[] { "asset-preview-generation", "editor-cache-write" },