@alpsckr/unitycli 0.4.4 → 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.
- package/contracts/command-contract.json +591 -591
- package/contracts/package-files.json +367 -367
- package/contracts/stable-session/direct-call-semantics.json +3 -3
- package/contracts/stable-session/request-digest-v1-golden.json +2 -2
- package/contracts/tool-completion-contract.json +322 -322
- package/dist/bridge/domains/animation.js +37 -37
- package/dist/bridge/domains/animation.js.map +1 -1
- package/dist/bridge/domains/asset.js +15 -16
- package/dist/bridge/domains/asset.js.map +1 -1
- package/dist/bridge/domains/build.js +13 -13
- package/dist/bridge/domains/build.js.map +1 -1
- package/dist/bridge/domains/camera.js +7 -7
- package/dist/bridge/domains/camera.js.map +1 -1
- package/dist/bridge/domains/catalog-editor.d.ts +2 -0
- package/dist/bridge/domains/{project-tool.js → catalog-editor.js} +10 -10
- package/dist/bridge/domains/catalog-editor.js.map +1 -0
- package/dist/bridge/domains/catalog-player.d.ts +2 -0
- package/dist/bridge/domains/{runtime-tool.js → catalog-player.js} +9 -9
- package/dist/bridge/domains/catalog-player.js.map +1 -0
- package/dist/bridge/domains/code.js +1 -1
- package/dist/bridge/domains/code.js.map +1 -1
- package/dist/bridge/domains/console.js +2 -2
- package/dist/bridge/domains/console.js.map +1 -1
- package/dist/bridge/domains/doctor.js +3 -3
- package/dist/bridge/domains/doctor.js.map +1 -1
- package/dist/bridge/domains/editor.js +14 -14
- package/dist/bridge/domains/editor.js.map +1 -1
- package/dist/bridge/domains/game-object.js +16 -16
- package/dist/bridge/domains/game-object.js.map +1 -1
- package/dist/bridge/domains/lighting.d.ts +2 -0
- package/dist/bridge/domains/lighting.js +127 -0
- package/dist/bridge/domains/lighting.js.map +1 -0
- package/dist/bridge/domains/material.js +5 -5
- package/dist/bridge/domains/material.js.map +1 -1
- package/dist/bridge/domains/navmesh.js +3 -3
- package/dist/bridge/domains/navmesh.js.map +1 -1
- package/dist/bridge/domains/occlusion.js +1 -9
- package/dist/bridge/domains/occlusion.js.map +1 -1
- package/dist/bridge/domains/physics.js +14 -14
- package/dist/bridge/domains/physics.js.map +1 -1
- package/dist/bridge/domains/prefab.js +12 -12
- package/dist/bridge/domains/prefab.js.map +1 -1
- package/dist/bridge/domains/profiler.js +25 -25
- package/dist/bridge/domains/profiler.js.map +1 -1
- package/dist/bridge/domains/rendering.d.ts +2 -0
- package/dist/bridge/domains/rendering.js +71 -0
- package/dist/bridge/domains/rendering.js.map +1 -0
- package/dist/bridge/domains/runtime-reflection.d.ts +2 -0
- package/dist/bridge/domains/{reflection.js → runtime-reflection.js} +7 -7
- package/dist/bridge/domains/runtime-reflection.js.map +1 -0
- package/dist/bridge/domains/scene.js +15 -15
- package/dist/bridge/domains/scene.js.map +1 -1
- package/dist/bridge/domains/screenshot.js +6 -6
- package/dist/bridge/domains/screenshot.js.map +1 -1
- package/dist/bridge/domains/scriptable-object.js +4 -4
- package/dist/bridge/domains/scriptable-object.js.map +1 -1
- package/dist/bridge/domains/serialized-object.d.ts +2 -0
- package/dist/bridge/domains/{object.js → serialized-object.js} +6 -6
- package/dist/bridge/domains/serialized-object.js.map +1 -0
- package/dist/bridge/domains/shader.js +7 -7
- package/dist/bridge/domains/shader.js.map +1 -1
- package/dist/bridge/domains/texture.js +7 -7
- package/dist/bridge/domains/texture.js.map +1 -1
- package/dist/bridge/domains/timeline.js +4 -4
- package/dist/bridge/domains/timeline.js.map +1 -1
- package/dist/bridge/domains/ui.js +18 -18
- package/dist/bridge/domains/ui.js.map +1 -1
- package/dist/bridge/domains/volume.d.ts +2 -0
- package/dist/bridge/domains/volume.js +26 -0
- package/dist/bridge/domains/volume.js.map +1 -0
- package/dist/bridge/index.js +3 -3
- package/dist/bridge/index.js.map +1 -1
- package/dist/bridge/registry.js +15 -13
- package/dist/bridge/registry.js.map +1 -1
- package/dist/bridge/session-supervisor.js +27 -9
- package/dist/bridge/session-supervisor.js.map +1 -1
- package/dist/bridge/start-diagnostics.d.ts +19 -0
- package/dist/bridge/start-diagnostics.js +96 -0
- package/dist/bridge/start-diagnostics.js.map +1 -0
- package/dist/bridge/types.d.ts +1 -1
- package/dist/catalog-protocol.js +3 -3
- package/dist/catalog-protocol.js.map +1 -1
- package/dist/cli-commands/package.js +10 -2
- package/dist/cli-commands/package.js.map +1 -1
- package/dist/doctor.js +23 -1
- package/dist/doctor.js.map +1 -1
- package/dist/extensions/.generated-bridge-domains/cinemachine.js +14 -14
- package/dist/extensions/.generated-bridge-domains/cinemachine.js.map +1 -1
- package/dist/extensions/.generated-bridge-domains/hdrp.js +7 -7
- package/dist/extensions/.generated-bridge-domains/hdrp.js.map +1 -1
- package/dist/extensions/.generated-bridge-domains/probuilder.d.ts +3 -3
- package/dist/extensions/.generated-bridge-domains/probuilder.js +40 -40
- package/dist/extensions/.generated-bridge-domains/probuilder.js.map +1 -1
- package/dist/extensions/.generated-bridge-domains/urp.js +12 -12
- package/dist/extensions/.generated-bridge-domains/urp.js.map +1 -1
- package/dist/extensions/.generated-bridge-domains/vfx.js +27 -27
- package/dist/extensions/.generated-bridge-domains/vfx.js.map +1 -1
- package/dist/extensions/installer.d.ts +35 -0
- package/dist/extensions/installer.js +123 -0
- package/dist/extensions/installer.js.map +1 -1
- package/dist/instances.d.ts +6 -0
- package/dist/instances.js +13 -0
- package/dist/instances.js.map +1 -1
- package/dist/package-manager.js +1 -1
- package/dist/project-tool-discovery.d.ts +1 -1
- package/dist/project-tool-discovery.js +5 -5
- package/dist/project-tool-discovery.js.map +1 -1
- package/dist/runtime-code.js +2 -2
- package/dist/runtime-code.js.map +1 -1
- package/dist/services/reflect-service.d.ts +3 -3
- package/dist/services/reflect-service.js +5 -5
- package/dist/services/reflect-service.js.map +1 -1
- package/dist/tools/.generated-completion-registry.js +689 -689
- package/dist/tools/.generated-completion-registry.js.map +1 -1
- package/dist/tools/.generated-registry.d.ts +12 -12
- package/dist/tools/.generated-registry.js +12 -12
- package/dist/tools/.generated-registry.js.map +1 -1
- package/dist/tools/.generated-schemas.js +13 -13
- package/dist/tools/.generated-schemas.js.map +1 -1
- package/dist/tools/catalog.d.ts +1 -1
- package/dist/tools/catalog.js +1 -1
- package/dist/tools/code/{exec.d.ts → execute.d.ts} +1 -1
- package/dist/tools/code/{exec.js → execute.js} +5 -5
- package/dist/tools/code/execute.js.map +1 -0
- package/dist/tools/dispatcher.js +12 -8
- package/dist/tools/dispatcher.js.map +1 -1
- package/dist/tools/editor/compile.d.ts +3 -2
- package/dist/tools/editor/compile.js +23 -13
- package/dist/tools/editor/compile.js.map +1 -1
- package/dist/tools/editor/play-mode-status.js +2 -2
- package/dist/tools/editor/play-mode-status.js.map +1 -1
- package/dist/tools/editor/refresh.js +2 -2
- package/dist/tools/editor/refresh.js.map +1 -1
- package/dist/tools/metadata/derived.d.ts +0 -7
- package/dist/tools/metadata/derived.js +7 -16
- package/dist/tools/metadata/derived.js.map +1 -1
- package/dist/tools/metadata/index.d.ts +1 -1
- package/dist/tools/metadata/index.js +1 -1
- package/dist/tools/metadata/index.js.map +1 -1
- package/dist/tools/metadata/status.js +1 -1
- package/dist/tools/metadata/status.js.map +1 -1
- package/dist/tools/{runtime → player-runtime}/console.js +4 -4
- package/dist/tools/player-runtime/console.js.map +1 -0
- package/dist/tools/{runtime → player-runtime}/input/key.js +4 -4
- package/dist/tools/player-runtime/input/key.js.map +1 -0
- package/dist/tools/{runtime → player-runtime}/input/pointer.js +4 -4
- package/dist/tools/player-runtime/input/pointer.js.map +1 -0
- package/dist/tools/{runtime → player-runtime}/log.js +5 -5
- package/dist/tools/player-runtime/log.js.map +1 -0
- package/dist/tools/{runtime → player-runtime}/state.js +4 -4
- package/dist/tools/player-runtime/state.js.map +1 -0
- package/dist/tools/{runtime → player-runtime}/target-framerate/set.js +4 -4
- package/dist/tools/player-runtime/target-framerate/set.js.map +1 -0
- package/dist/tools/{runtime → player-runtime}/time-scale/set.js +4 -4
- package/dist/tools/player-runtime/time-scale/set.js.map +1 -0
- package/dist/tools/{runtime → player-runtime}/ui/capture-element.js +4 -4
- package/dist/tools/player-runtime/ui/capture-element.js.map +1 -0
- package/dist/tools/tools/group-summaries.js +17 -14
- package/dist/tools/tools/group-summaries.js.map +1 -1
- package/dist/tools/{reflect/member.js → type-inspection/get-member.js} +6 -6
- package/dist/tools/type-inspection/get-member.js.map +1 -0
- package/dist/tools/{reflect/type.js → type-inspection/get-type.js} +6 -6
- package/dist/tools/type-inspection/get-type.js.map +1 -0
- package/dist/tools/{reflect → type-inspection}/search.js +5 -5
- package/dist/tools/type-inspection/search.js.map +1 -0
- package/docs/README.md +1 -2
- package/docs/architecture.md +1 -1
- package/docs/availability-differences.md +2 -2
- package/docs/development.md +1 -1
- package/docs/error-codes.md +5 -5
- package/docs/extensions.md +2 -2
- package/docs/risk-and-side-effects.md +12 -12
- package/docs/safety-boundaries.md +7 -7
- package/docs/tool-discovery.md +1 -1
- package/docs/tool-execution.md +16 -16
- package/extensions/cinemachine/bridge/domains/cinemachine.ts +14 -14
- package/extensions/hdrp/bridge/domains/hdrp.ts +7 -7
- package/extensions/hdrp/unitypkg/Editor/Hdrp/HdrpToolSupport.cs +2 -2
- package/extensions/probuilder/bridge/domains/probuilder.ts +40 -40
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/ProBuilderErrors.cs +1 -1
- package/extensions/urp/bridge/domains/urp.ts +12 -12
- package/extensions/urp/unitypkg/Editor/Urp/UrpToolSupport.cs +2 -2
- package/extensions/vfx-graph/bridge/domains/vfx.ts +27 -27
- package/package.json +1 -1
- package/skills/unitycli/SKILL.md +1 -1
- package/skills/unitycli/manifest.json +1 -1
- package/skills/unitycli/references/operation-protocol.md +1 -1
- package/unitypkg/Editor/Bridge/BridgeHttpServer.cs +2 -2
- package/unitypkg/Editor/Commands/ProjectToolCommands.cs +7 -7
- package/unitypkg/Editor/Commands/RuntimeToolCommands.cs +6 -6
- package/unitypkg/Editor/Generated/UnityCliToolCompletionRegistry.g.cs +147 -147
- package/unitypkg/Editor/Infrastructure/CodeExecSupport.cs +4 -4
- package/unitypkg/Editor/Infrastructure/UnityCliAdmission.cs +17 -17
- package/unitypkg/Editor/Infrastructure/UnityCliCompileCoordinator.cs +61 -54
- package/unitypkg/Editor/Infrastructure/UnityCliJson.cs +0 -18
- package/unitypkg/Editor/Infrastructure/UnityCliLiveRefreshCoordinator.cs +26 -21
- package/unitypkg/Editor/Infrastructure/UnityCliObjectPatch.cs +1 -1
- package/unitypkg/Editor/Infrastructure/UnityCliObjectRef.cs +5 -5
- package/unitypkg/Editor/Infrastructure/UnityCliOperationCoordinator.cs +32 -32
- package/unitypkg/Editor/Infrastructure/UnityCliReflection.cs +12 -12
- package/unitypkg/Editor/Infrastructure/UnityCliRuntimeExecutor.cs +1 -1
- package/unitypkg/Editor/ProjectTools/ProjectToolRegistry.cs +5 -5
- package/unitypkg/Editor/Tools/{animation → animation-clip}/AnimationToolSupport.cs +3 -3
- package/unitypkg/Editor/Tools/{animation/clip → animation-clip}/create.cs +4 -4
- package/unitypkg/Editor/Tools/{animation/clip.cs → animation-clip/read.cs} +3 -3
- package/unitypkg/Editor/Tools/{animation/clip/modify.cs → animation-clip/update.cs} +5 -5
- package/unitypkg/Editor/Tools/{animation/animator → animator}/crossfade.cs +1 -1
- package/unitypkg/Editor/Tools/{animation/animator → animator}/get-info.cs +1 -1
- package/unitypkg/Editor/Tools/{animation/animator → animator}/get-parameter.cs +1 -1
- package/unitypkg/Editor/Tools/{animation/state.cs → animator/get-state.cs} +3 -3
- package/unitypkg/Editor/Tools/{animation → animator}/play.cs +5 -5
- package/unitypkg/Editor/Tools/{animation/animator → animator}/set-enabled.cs +1 -1
- package/unitypkg/Editor/Tools/{animation/animator → animator}/set-parameter.cs +1 -1
- package/unitypkg/Editor/Tools/{animation/animator → animator}/set-speed.cs +1 -1
- package/unitypkg/Editor/Tools/{animation → animator}/stop.cs +4 -4
- package/unitypkg/Editor/Tools/{controller → animator-controller}/add-blend-tree-child.cs +10 -10
- package/unitypkg/Editor/Tools/{controller → animator-controller}/add-layer.cs +6 -6
- package/unitypkg/Editor/Tools/{controller → animator-controller}/add-parameter.cs +6 -6
- package/unitypkg/Editor/Tools/{controller → animator-controller}/add-state.cs +7 -7
- package/unitypkg/Editor/Tools/{controller → animator-controller}/add-transition.cs +9 -9
- package/unitypkg/Editor/Tools/{controller → animator-controller}/assign.cs +6 -6
- package/unitypkg/Editor/Tools/{controller → animator-controller}/create-blend-tree-1d.cs +7 -7
- package/unitypkg/Editor/Tools/{controller → animator-controller}/create-blend-tree-2d.cs +7 -7
- package/unitypkg/Editor/Tools/{controller → animator-controller}/create.cs +4 -4
- package/unitypkg/Editor/Tools/{controller → animator-controller}/get-info.cs +4 -4
- package/unitypkg/Editor/Tools/{controller → animator-controller}/remove-layer.cs +8 -8
- package/unitypkg/Editor/Tools/{controller → animator-controller}/set-layer-weight.cs +6 -6
- package/unitypkg/Editor/Tools/asset/preview.cs +1 -1
- package/unitypkg/Editor/Tools/asset/{modify.cs → write-text.cs} +6 -6
- package/unitypkg/Editor/Tools/component/get.cs +1 -1
- package/unitypkg/Editor/Tools/component/list-types.cs +2 -2
- package/unitypkg/Editor/Tools/component/modify.cs +1 -1
- package/unitypkg/Editor/Tools/component/set.cs +1 -1
- package/unitypkg/Editor/Tools/console/{get.cs → read.cs} +3 -3
- package/unitypkg/Editor/Tools/editor/{play.cs → play-mode/start.cs} +5 -5
- package/unitypkg/Editor/Tools/editor/{stop.cs → play-mode/stop.cs} +5 -5
- package/unitypkg/Editor/Tools/editor/search.cs +1 -1
- package/unitypkg/Editor/Tools/{go → game-object}/GameObjectToolSupport.cs +5 -22
- package/unitypkg/Editor/Tools/{go → game-object}/create.cs +11 -11
- package/unitypkg/Editor/Tools/{go → game-object}/delete.cs +7 -7
- package/unitypkg/Editor/Tools/{go → game-object}/duplicate.cs +6 -6
- package/unitypkg/Editor/Tools/{go → game-object}/find.cs +5 -5
- package/unitypkg/Editor/Tools/{go → game-object}/look-at.cs +8 -8
- package/unitypkg/Editor/Tools/{go → game-object}/modify.cs +9 -9
- package/unitypkg/Editor/Tools/{go → game-object}/move-relative.cs +7 -7
- package/unitypkg/Editor/Tools/{scene/move-object.cs → game-object/move-to-scene.cs} +7 -7
- package/unitypkg/Editor/Tools/{go → game-object}/set-parent.cs +9 -9
- package/unitypkg/Editor/Tools/{graphics/bake-cancel.cs → lighting/bake/cancel.cs} +4 -4
- package/unitypkg/Editor/Tools/{graphics/bake-clear.cs → lighting/bake/clear.cs} +4 -4
- package/unitypkg/Editor/Tools/{graphics/bake-reflection-probe.cs → lighting/bake/reflection-probe.cs} +3 -3
- package/unitypkg/Editor/Tools/{graphics/bake-settings.cs → lighting/bake/settings.cs} +12 -12
- package/unitypkg/Editor/Tools/{graphics/bake-start.cs → lighting/bake/start.cs} +5 -5
- package/unitypkg/Editor/Tools/{graphics/bake-status.cs → lighting/bake/status.cs} +3 -3
- package/unitypkg/Editor/Tools/{graphics → lighting}/light-probe-group.cs +7 -7
- package/unitypkg/Editor/Tools/{graphics → lighting}/reflection-probe.cs +12 -12
- package/unitypkg/Editor/Tools/{graphics/skybox-get.cs → lighting/skybox/get.cs} +3 -3
- package/unitypkg/Editor/Tools/{graphics/skybox-set-ambient.cs → lighting/skybox/set-ambient.cs} +3 -3
- package/unitypkg/Editor/Tools/{graphics/skybox-set-fog.cs → lighting/skybox/set-fog.cs} +3 -3
- package/unitypkg/Editor/Tools/{graphics/skybox-set-material.cs → lighting/skybox/set-material.cs} +5 -5
- package/unitypkg/Editor/Tools/{graphics/skybox-set-properties.cs → lighting/skybox/set-properties.cs} +5 -5
- package/unitypkg/Editor/Tools/{graphics/skybox-set-reflection.cs → lighting/skybox/set-reflection.cs} +3 -3
- package/unitypkg/Editor/Tools/{graphics/skybox-set-sun.cs → lighting/skybox/set-sun.cs} +5 -5
- package/unitypkg/Editor/Tools/{project → project-settings}/ProjectSettingsToolSupport.cs +5 -5
- package/unitypkg/Editor/Tools/{project → project-settings}/audio-settings/set.cs +3 -3
- package/unitypkg/Editor/Tools/{project → project-settings}/audio-settings.cs +4 -4
- package/unitypkg/Editor/Tools/{project → project-settings}/info.cs +4 -4
- package/unitypkg/Editor/Tools/{project → project-settings}/input-settings/set.cs +3 -3
- package/unitypkg/Editor/Tools/{project → project-settings}/input-settings.cs +4 -4
- package/unitypkg/Editor/Tools/project-settings/layer/add.cs +3 -0
- package/unitypkg/Editor/Tools/project-settings/layer/remove.cs +3 -0
- package/unitypkg/Editor/Tools/{project → project-settings}/layers.cs +4 -4
- package/unitypkg/Editor/Tools/{project → project-settings}/player-settings/set.cs +4 -4
- package/unitypkg/Editor/Tools/{project → project-settings}/player-settings.cs +4 -4
- package/unitypkg/Editor/Tools/project-settings/tag/add.cs +3 -0
- package/unitypkg/Editor/Tools/project-settings/tag/remove.cs +3 -0
- package/unitypkg/Editor/Tools/{project → project-settings}/tags.cs +4 -4
- package/unitypkg/Editor/Tools/{project → project-settings}/time-settings/set.cs +3 -3
- package/unitypkg/Editor/Tools/{project → project-settings}/time-settings.cs +4 -4
- package/unitypkg/Editor/Tools/{graphics → rendering}/GraphicsToolSupport.cs +3 -3
- package/unitypkg/Editor/Tools/rendering/pipeline/info.cs +19 -0
- package/unitypkg/Editor/Tools/{graphics/pipeline-settings.cs → rendering/pipeline/settings.cs} +4 -4
- package/unitypkg/Editor/Tools/{graphics → rendering}/quality.cs +17 -17
- package/unitypkg/Editor/Tools/{graphics → rendering}/scene-debug.cs +4 -4
- package/unitypkg/Editor/Tools/rendering/stats.cs +17 -0
- package/unitypkg/Editor/Tools/{reflection → runtime-reflection}/method/find.cs +5 -5
- package/unitypkg/Editor/Tools/{reflection/method/call.cs → runtime-reflection/method/invoke.cs} +7 -7
- package/unitypkg/Editor/Tools/{reflection → runtime-reflection}/type/schema.cs +5 -5
- package/unitypkg/Editor/Tools/scene/gameobject-support.cs +1 -1
- package/unitypkg/Editor/Tools/scene/gameobject.cs +1 -1
- package/unitypkg/Editor/Tools/scene/hierarchy.cs +1 -1
- package/unitypkg/Editor/Tools/{camera/screenshot.cs → screenshot/from-camera.cs} +4 -4
- package/unitypkg/Editor/Tools/{object/modify.cs → serialized-object/patch.cs} +8 -8
- package/unitypkg/Editor/Tools/{object/get-data.cs → serialized-object/read.cs} +4 -4
- package/unitypkg/Editor/Tools/{graphics/volume.cs → volume/list.cs} +3 -3
- package/unitypkg/Editor/UnityCliBridge.cs +3 -22
- package/unitypkg/Runtime/Infrastructure/UnityCliRuntimeBridge.cs +15 -15
- package/unitypkg/Runtime/Infrastructure/UnityCliRuntimeRegistry.cs +1 -1
- package/unitypkg/Runtime/Tools/UnityCliRuntimeTools.cs +22 -22
- package/unitypkg/Shared/UnityCliBridgeQueuePolicy.cs +1 -1
- package/unitypkg/Tests/Editor/UnityCliAdmissionCoordinatorIntegrationTests.cs +7 -7
- package/unitypkg/Tests/Editor/UnityCliBridgeAdmissionIntegrationTests.cs +6 -6
- package/unitypkg/Tests/Editor/UnityCliBridgeQueuePolicyTests.cs +3 -3
- package/unitypkg/Tests/Editor/UnityCliContinuationIntegrationTests.cs +1 -1
- package/unitypkg/Tests/Editor/UnityCliRequestBudgetTests.cs +4 -4
- package/unitypkg/Tests/Editor/UnityCliRuntimeBridgeIntegrationTests.cs +15 -15
- package/unitypkg/Tests/Runtime/UnityCliRuntimeCatalogValidationTests.cs +5 -5
- package/unitypkg/package.json +1 -1
- package/dist/bridge/domains/graphics.d.ts +0 -2
- package/dist/bridge/domains/graphics.js +0 -170
- package/dist/bridge/domains/graphics.js.map +0 -1
- package/dist/bridge/domains/object.d.ts +0 -2
- package/dist/bridge/domains/object.js.map +0 -1
- package/dist/bridge/domains/package.d.ts +0 -2
- package/dist/bridge/domains/package.js +0 -2
- package/dist/bridge/domains/package.js.map +0 -1
- package/dist/bridge/domains/project-tool.d.ts +0 -2
- package/dist/bridge/domains/project-tool.js.map +0 -1
- package/dist/bridge/domains/reflection.d.ts +0 -2
- package/dist/bridge/domains/reflection.js.map +0 -1
- package/dist/bridge/domains/runtime-tool.d.ts +0 -2
- package/dist/bridge/domains/runtime-tool.js.map +0 -1
- package/dist/tools/code/exec.js.map +0 -1
- package/dist/tools/reflect/member.js.map +0 -1
- package/dist/tools/reflect/search.js.map +0 -1
- package/dist/tools/reflect/type.js.map +0 -1
- package/dist/tools/runtime/console.js.map +0 -1
- package/dist/tools/runtime/input/key.js.map +0 -1
- package/dist/tools/runtime/input/pointer.js.map +0 -1
- package/dist/tools/runtime/log.js.map +0 -1
- package/dist/tools/runtime/state.js.map +0 -1
- package/dist/tools/runtime/target-framerate/set.js.map +0 -1
- package/dist/tools/runtime/time-scale/set.js.map +0 -1
- package/dist/tools/runtime/ui/capture-element.js.map +0 -1
- package/unitypkg/Editor/Tools/graphics/pipeline-info.cs +0 -19
- package/unitypkg/Editor/Tools/graphics/stats.cs +0 -17
- package/unitypkg/Editor/Tools/project/layer/add.cs +0 -3
- package/unitypkg/Editor/Tools/project/layer/remove.cs +0 -3
- package/unitypkg/Editor/Tools/project/tag/add.cs +0 -3
- package/unitypkg/Editor/Tools/project/tag/remove.cs +0 -3
- /package/dist/tools/{runtime → player-runtime}/console.d.ts +0 -0
- /package/dist/tools/{runtime → player-runtime}/input/key.d.ts +0 -0
- /package/dist/tools/{runtime → player-runtime}/input/pointer.d.ts +0 -0
- /package/dist/tools/{runtime → player-runtime}/log.d.ts +0 -0
- /package/dist/tools/{runtime → player-runtime}/state.d.ts +0 -0
- /package/dist/tools/{runtime → player-runtime}/target-framerate/set.d.ts +0 -0
- /package/dist/tools/{runtime → player-runtime}/time-scale/set.d.ts +0 -0
- /package/dist/tools/{runtime → player-runtime}/ui/capture-element.d.ts +0 -0
- /package/dist/tools/{reflect/member.d.ts → type-inspection/get-member.d.ts} +0 -0
- /package/dist/tools/{reflect/type.d.ts → type-inspection/get-type.d.ts} +0 -0
- /package/dist/tools/{reflect → type-inspection}/search.d.ts +0 -0
- /package/unitypkg/Editor/Tools/{animation → animator}/AnimatorRuntimeToolSupport.cs +0 -0
- /package/unitypkg/Editor/Tools/{project → project-settings}/ProjectSettingsReader.cs +0 -0
- /package/unitypkg/Editor/Tools/{project → project-settings}/ProjectTagLayerToolSupport.cs +0 -0
- /package/unitypkg/Editor/Tools/{object → serialized-object}/ObjectToolSupport.cs +0 -0
|
@@ -36,7 +36,7 @@ namespace UnityCli
|
|
|
36
36
|
private static void RegisterCodeExecCommand(BridgeCommandRegistry registry)
|
|
37
37
|
{
|
|
38
38
|
registry.Register<UnityCli.Protocol.BridgeRequest>(
|
|
39
|
-
"code.
|
|
39
|
+
"code.execute",
|
|
40
40
|
"code",
|
|
41
41
|
true,
|
|
42
42
|
60000,
|
|
@@ -49,7 +49,7 @@ namespace UnityCli
|
|
|
49
49
|
private static string CodeExec(UnityCli.Protocol.BridgeRequest request, CancellationToken cancellationToken)
|
|
50
50
|
{
|
|
51
51
|
if (request.Execution != null && request.Execution.DryRun == true)
|
|
52
|
-
throw new BridgeCommandException("E_DRY_RUN_UNSUPPORTED", "Raw Bridge code.
|
|
52
|
+
throw new BridgeCommandException("E_DRY_RUN_UNSUPPORTED", "Raw Bridge code.execute dry-run cannot execute or compile caller source.", "Use the public tools run code.execute --dry-run path, which returns the CLI-side source preview without Bridge dispatch.");
|
|
53
53
|
var source = request.StringArg("sourceText");
|
|
54
54
|
// raw Bridge不读取调用方路径;公开CLI已按入口deadline有界读取并内联唯一源码。
|
|
55
55
|
if (string.IsNullOrWhiteSpace(source))
|
|
@@ -60,11 +60,11 @@ namespace UnityCli
|
|
|
60
60
|
var result = ExecuteCodeSource(request, source, cancellationToken);
|
|
61
61
|
WriteLog("code_exec requestId=" + request.RequestId + " ok=" + result.Ok + " exitState=" + result.ExitState);
|
|
62
62
|
var serialized = SerializeCodeExecutionResult(request.RequestId, result);
|
|
63
|
-
if (result.Ok) RecordDirectCompletionEvidence(request.RequestId, "code.
|
|
63
|
+
if (result.Ok) RecordDirectCompletionEvidence(request.RequestId, "code.execute", ResolveRequestCompletionContract(request), result.Data);
|
|
64
64
|
return serialized;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
/// <summary>所有 code.
|
|
67
|
+
/// <summary>所有 code.execute terminal 统一经过同一 Bridge envelope 与总 byte 上限。</summary>
|
|
68
68
|
private static string SerializeCodeExecutionResult(string requestId, CodeExecutionResult result)
|
|
69
69
|
{
|
|
70
70
|
object envelope = result.Ok
|
|
@@ -1398,7 +1398,7 @@ namespace UnityCli
|
|
|
1398
1398
|
/// <summary>root观察不确定时用队列冻结身份建立可执行Recovery marker;候选缺失时继续保留WorkItem。</summary>
|
|
1399
1399
|
private static AdmissionTransferResult PersistWorkItemRecoveryAfterTransferFailure(BridgeQueueState state, BridgeWorkItem item, AdmissionOwnerIdentity identity, string command, string response)
|
|
1400
1400
|
{
|
|
1401
|
-
if (identity == null || (!AdmissionDurableRootCommand(command) && command != "
|
|
1401
|
+
if (identity == null || (!AdmissionDurableRootCommand(command) && command != "catalog.editor.run" && command != "code.execute"))
|
|
1402
1402
|
return AdmissionTransferResult.TransferPending;
|
|
1403
1403
|
try
|
|
1404
1404
|
{
|
|
@@ -1439,7 +1439,7 @@ namespace UnityCli
|
|
|
1439
1439
|
private static AdmissionTransferResult TransferAdmissionAfterAcceptedWork(BridgeQueueState state, BridgeWorkItem item, AdmissionOwnerIdentity identity, string command, string response)
|
|
1440
1440
|
{
|
|
1441
1441
|
if (identity == null) return AdmissionTransferResult.NotAccepted;
|
|
1442
|
-
var directMutation = command == "
|
|
1442
|
+
var directMutation = command == "catalog.editor.run" || command == "code.execute";
|
|
1443
1443
|
if (!AdmissionDurableRootCommand(command) && !directMutation) return AdmissionTransferResult.NotAccepted;
|
|
1444
1444
|
string markerScope;
|
|
1445
1445
|
string rootScope;
|
|
@@ -1733,7 +1733,7 @@ namespace UnityCli
|
|
|
1733
1733
|
if (command == "internal.test.run.cancel") return false;
|
|
1734
1734
|
bool ownsLease;
|
|
1735
1735
|
if (!queueState.TryIsLeaseOwned(identity.RequestId, identity.RequestDigest, out ownsLease)) return false;
|
|
1736
|
-
if (command == "
|
|
1736
|
+
if (command == "catalog.editor.run" || command == "code.execute")
|
|
1737
1737
|
{
|
|
1738
1738
|
durable = ownsLease;
|
|
1739
1739
|
return true;
|
|
@@ -1769,7 +1769,7 @@ namespace UnityCli
|
|
|
1769
1769
|
/// <summary>deadline之后仍允许同字节direct request读取已发布terminal,不入队也不重新占slot。</summary>
|
|
1770
1770
|
private static string AdmissionRecoveredDirectTerminal(UnityCli.Protocol.BridgeRequest request, byte[] rawRequestBytes)
|
|
1771
1771
|
{
|
|
1772
|
-
if (request == null || rawRequestBytes == null || (request.Command != "code.
|
|
1772
|
+
if (request == null || rawRequestBytes == null || (request.Command != "code.execute" && request.Command != "catalog.editor.run")) return null;
|
|
1773
1773
|
var digest = UnityCliRequestDigest.Compute(rawRequestBytes, request.InstanceId);
|
|
1774
1774
|
object terminal;
|
|
1775
1775
|
if (!UnityCliActiveOperation.TryGetTerminal("direct-mutation", request.RequestId, digest, out terminal)) return null;
|
|
@@ -1801,8 +1801,8 @@ namespace UnityCli
|
|
|
1801
1801
|
case "internal.test.run.cancel": return "test-cancel";
|
|
1802
1802
|
case "internal.navmesh.bake.start": return "navmesh-bake";
|
|
1803
1803
|
case "internal.occlusion.bake.start": return "occlusion-bake";
|
|
1804
|
-
case "
|
|
1805
|
-
case "code.
|
|
1804
|
+
case "catalog.editor.run":
|
|
1805
|
+
case "code.execute":
|
|
1806
1806
|
return "direct-mutation";
|
|
1807
1807
|
default:
|
|
1808
1808
|
return null;
|
|
@@ -1833,7 +1833,7 @@ namespace UnityCli
|
|
|
1833
1833
|
|| command == "internal.package.embed.start" || command == "internal.package.resolve.start"
|
|
1834
1834
|
|| command == "internal.test.run.start" || command == "internal.test.run.cancel"
|
|
1835
1835
|
|| command == "internal.navmesh.bake.start" || command == "internal.occlusion.bake.start"
|
|
1836
|
-
|| command == "
|
|
1836
|
+
|| command == "catalog.editor.run" || command == "code.execute";
|
|
1837
1837
|
}
|
|
1838
1838
|
|
|
1839
1839
|
private static string AdmissionAcceptedTopDigest(BridgeQueueState state, string response, AdmissionOwnerIdentity identity, string command)
|
|
@@ -1867,7 +1867,7 @@ namespace UnityCli
|
|
|
1867
1867
|
|| UnityCliPackageEmbedCoordinator.IsCommand(command) || UnityCliPackageResolveCoordinator.IsCommand(command)
|
|
1868
1868
|
|| UnityCliTestRunCoordinator.IsCommand(command) || UnityCliNavMeshBakeCoordinator.IsCommand(command)
|
|
1869
1869
|
|| UnityCliOcclusionBakeCoordinator.IsCommand(command)
|
|
1870
|
-
|| command == "
|
|
1870
|
+
|| command == "catalog.editor.run" || command == "code.execute";
|
|
1871
1871
|
}
|
|
1872
1872
|
|
|
1873
1873
|
private static bool AdmissionBypassCommand(string command)
|
|
@@ -1875,15 +1875,15 @@ namespace UnityCli
|
|
|
1875
1875
|
if (IsDoctorAdmissionBypassCommand(command)) return true;
|
|
1876
1876
|
switch (command)
|
|
1877
1877
|
{
|
|
1878
|
-
case "
|
|
1879
|
-
case "
|
|
1880
|
-
case "
|
|
1881
|
-
case "
|
|
1882
|
-
case "
|
|
1883
|
-
case "
|
|
1884
|
-
case "
|
|
1885
|
-
case "
|
|
1886
|
-
case "
|
|
1878
|
+
case "catalog.editor.health":
|
|
1879
|
+
case "catalog.editor.groups":
|
|
1880
|
+
case "catalog.editor.summary":
|
|
1881
|
+
case "catalog.editor.describe":
|
|
1882
|
+
case "catalog.editor.list":
|
|
1883
|
+
case "catalog.player.groups":
|
|
1884
|
+
case "catalog.player.summary":
|
|
1885
|
+
case "catalog.player.describe":
|
|
1886
|
+
case "catalog.player.list":
|
|
1887
1887
|
case "internal.editor.state.snapshot":
|
|
1888
1888
|
case "internal.editor.compile.status":
|
|
1889
1889
|
case "internal.editor.refresh.status":
|
|
@@ -6,7 +6,6 @@ using System.IO;
|
|
|
6
6
|
using System.Linq;
|
|
7
7
|
using System.Text;
|
|
8
8
|
using UnityEditor;
|
|
9
|
-
using UnityEditor.Compilation;
|
|
10
9
|
using UnityCli.Protocol;
|
|
11
10
|
|
|
12
11
|
namespace UnityCli
|
|
@@ -31,30 +30,36 @@ namespace UnityCli
|
|
|
31
30
|
}
|
|
32
31
|
protected override void ValidateLoadedRoot(Dictionary<string, object> root)
|
|
33
32
|
{
|
|
34
|
-
ValidateRootContract(root, new[] { "sequence", "runId", "refresh", "path", "forceUpdate", "importRecursive", "includeWarnings", "diagnostics", "diagnosticErrorCount", "diagnosticWarningCount", "diagnosticInfoCount", "diagnosticsTruncated", "startedCycle", "startedAt", "finishedAt", "reloadObserved", "rootContractDigest" },
|
|
33
|
+
ValidateRootContract(root, new[] { "sequence", "runId", "refresh", "path", "forceUpdate", "importRecursive", "includeWarnings", "compilationObserved", "compileObservationSequence", "startedSequence", "diagnostics", "diagnosticErrorCount", "diagnosticWarningCount", "diagnosticInfoCount", "diagnosticsTruncated", "stableFrames", "startedCycle", "startedAt", "finishedAt", "reloadObserved", "rootContractDigest" },
|
|
35
34
|
"queued", "prepared", "dispatching", "awaiting_started", "compiling", "cycle_finished");
|
|
36
|
-
object sequence; object refresh; object forceUpdate; object recursive; object warnings; object diagnostics; object errorCount; object warningCount; object infoCount; object truncated;
|
|
35
|
+
object sequence; object refresh; object forceUpdate; object recursive; object warnings; object observed; object diagnostics; object errorCount; object warningCount; object infoCount; object truncated; object stableFrames;
|
|
37
36
|
if (!root.TryGetValue("sequence", out sequence) || !(sequence is long) || (long)sequence <= 0
|
|
38
37
|
|| string.IsNullOrWhiteSpace(Text(root, "runId"))
|
|
39
38
|
|| !root.TryGetValue("refresh", out refresh) || !(refresh is bool)
|
|
40
39
|
|| !root.TryGetValue("forceUpdate", out forceUpdate) || !(forceUpdate is bool)
|
|
41
40
|
|| !root.TryGetValue("importRecursive", out recursive) || !(recursive is bool)
|
|
42
41
|
|| !root.TryGetValue("includeWarnings", out warnings) || !(warnings is bool)
|
|
42
|
+
|| !root.TryGetValue("compilationObserved", out observed) || !(observed is bool)
|
|
43
|
+
|| !root.TryGetValue("compileObservationSequence", out sequence) || !(sequence is long) || (long)sequence < 0
|
|
44
|
+
|| !root.TryGetValue("startedSequence", out sequence) || !(sequence is long) || (long)sequence < 0
|
|
43
45
|
|| !root.TryGetValue("diagnostics", out diagnostics) || !(diagnostics is List<object>)
|
|
44
46
|
|| !root.TryGetValue("diagnosticErrorCount", out errorCount) || !(errorCount is long) || (long)errorCount < 0 || (long)errorCount > 1000000
|
|
45
47
|
|| !root.TryGetValue("diagnosticWarningCount", out warningCount) || !(warningCount is long) || (long)warningCount < 0 || (long)warningCount > 1000000
|
|
46
48
|
|| !root.TryGetValue("diagnosticInfoCount", out infoCount) || !(infoCount is long) || (long)infoCount < 0 || (long)infoCount > 1000000
|
|
47
|
-
|| !root.TryGetValue("diagnosticsTruncated", out truncated) || !(truncated is long) || (long)truncated < 0 || (long)truncated > 1000000
|
|
49
|
+
|| !root.TryGetValue("diagnosticsTruncated", out truncated) || !(truncated is long) || (long)truncated < 0 || (long)truncated > 1000000
|
|
50
|
+
|| !root.TryGetValue("stableFrames", out stableFrames) || !(stableFrames is long) || (long)stableFrames < 0
|
|
51
|
+
|| string.IsNullOrWhiteSpace(Text(root, "startedAt")))
|
|
48
52
|
throw new InvalidDataException("Compile active root fields are invalid.");
|
|
49
53
|
if (!string.Equals(Text(root, "rootContractDigest"), CompileRootContractDigest(root), StringComparison.Ordinal))
|
|
50
54
|
throw new InvalidDataException("Compile immutable root contract changed.");
|
|
51
55
|
ValidateBoundedDiagnostics(root, "diagnostics", "diagnosticErrorCount", "diagnosticWarningCount", "diagnosticInfoCount", "diagnosticsTruncated", (bool)warnings);
|
|
52
56
|
var phase = Text(root, "phase");
|
|
53
|
-
var fenced = HasExactEffectFence("compile", root, "
|
|
57
|
+
var fenced = HasExactEffectFence("compile", root, "asset-refresh-dispatch");
|
|
54
58
|
if ((phase == "queued" || phase == "prepared") == fenced)
|
|
55
59
|
throw new InvalidDataException("Compile effect fence is inconsistent with phase.");
|
|
56
|
-
if ((phase == "compiling" || phase == "cycle_finished")
|
|
57
|
-
|
|
60
|
+
if ((bool)observed != (phase == "compiling" || phase == "cycle_finished"))
|
|
61
|
+
throw new InvalidDataException("Compile observation state is inconsistent with phase.");
|
|
62
|
+
if ((bool)observed && (Long(root, "startedCycle") <= 0 || Long(root, "startedSequence") <= Long(root, "compileObservationSequence")))
|
|
58
63
|
throw new InvalidDataException("Compile active cycle identity is invalid.");
|
|
59
64
|
}
|
|
60
65
|
|
|
@@ -67,11 +72,20 @@ namespace UnityCli
|
|
|
67
72
|
});
|
|
68
73
|
}
|
|
69
74
|
|
|
70
|
-
protected override object Planned(object value)
|
|
75
|
+
protected override object Planned(object value)
|
|
76
|
+
{
|
|
77
|
+
var args = (StartArgs)value;
|
|
78
|
+
var effects = new List<object>();
|
|
79
|
+
if (!string.IsNullOrEmpty(args.Path)) effects.Add(new Dictionary<string, object> { { "type", "asset-import" }, { "path", args.Path } });
|
|
80
|
+
else effects.Add(new Dictionary<string, object> { { "type", "asset-refresh" } });
|
|
81
|
+
effects.Add(new Dictionary<string, object> { { "type", "script-compile" } });
|
|
82
|
+
effects.Add(new Dictionary<string, object> { { "type", "domain-reload" } });
|
|
83
|
+
return new Dictionary<string, object> { { "plannedEffects", effects } };
|
|
84
|
+
}
|
|
71
85
|
protected override Dictionary<string, object> CreateRoot(BridgeRequest request, string digest, object value)
|
|
72
86
|
{
|
|
73
87
|
var args = (StartArgs)value;
|
|
74
|
-
var root = new Dictionary<string, object> { { "requestId", request.RequestId }, { "editorSessionId", EditorSessionId() }, { "requestDigest", digest }, { "deadline", request.Execution.AbsoluteDeadlineUtc }, { "phase", "queued" }, { "sequence", NextSequenceLocked() }, { "runId", "compile-" + digest.Substring(0, 32) }, { "refresh", args.
|
|
88
|
+
var root = new Dictionary<string, object> { { "requestId", request.RequestId }, { "editorSessionId", EditorSessionId() }, { "requestDigest", digest }, { "deadline", request.Execution.AbsoluteDeadlineUtc }, { "phase", "queued" }, { "sequence", NextSequenceLocked() }, { "runId", "compile-" + digest.Substring(0, 32) }, { "refresh", string.IsNullOrEmpty(args.Path) }, { "path", args.Path }, { "forceUpdate", args.ForceUpdate ?? false }, { "importRecursive", args.ImportRecursive ?? false }, { "includeWarnings", args.IncludeWarnings ?? true }, { "compilationObserved", false }, { "compileObservationSequence", 0L }, { "startedSequence", 0L }, { "diagnostics", new List<object>() }, { "diagnosticErrorCount", 0L }, { "diagnosticWarningCount", 0L }, { "diagnosticInfoCount", 0L }, { "diagnosticsTruncated", 0L }, { "stableFrames", 0L }, { "startedAt", DateTime.UtcNow.ToString("O", CultureInfo.InvariantCulture) }, { "reloadObserved", false } };
|
|
75
89
|
root["rootContractDigest"] = CompileRootContractDigest(root);
|
|
76
90
|
return root;
|
|
77
91
|
}
|
|
@@ -81,6 +95,14 @@ namespace UnityCli
|
|
|
81
95
|
var phase = Text(root, "phase");
|
|
82
96
|
if (phase == "queued") { Update(x => x["phase"] = "prepared"); return; }
|
|
83
97
|
if (phase == "prepared") { if (!EditorApplication.isCompiling && !EditorApplication.isUpdating && !IsDomainReloading()) Dispatch(root); return; }
|
|
98
|
+
if (phase == "awaiting_started" && !EditorApplication.isCompiling && !EditorApplication.isUpdating && !IsDomainReloading())
|
|
99
|
+
{
|
|
100
|
+
var frames = Long(root, "stableFrames") + 1L;
|
|
101
|
+
root["stableFrames"] = frames;
|
|
102
|
+
Update(x => x["stableFrames"] = frames);
|
|
103
|
+
if (frames >= 3L) Complete(root);
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
84
106
|
if (phase == "cycle_finished" && !EditorApplication.isCompiling && !EditorApplication.isUpdating && !IsDomainReloading()) Complete(root);
|
|
85
107
|
}
|
|
86
108
|
protected override object BuildSuccessData(Dictionary<string, object> root)
|
|
@@ -90,17 +112,30 @@ namespace UnityCli
|
|
|
90
112
|
var assemblies = typed.Where(x => !string.IsNullOrEmpty(Text(x, "assembly"))).Select(x => Text(x, "assembly")).Distinct(StringComparer.Ordinal).Count();
|
|
91
113
|
var startedAt = Text(root, "startedAt"); var finishedAt = DateTime.UtcNow.ToString("O", CultureInfo.InvariantCulture);
|
|
92
114
|
var durationMs = DateTimeOffset.TryParse(startedAt, out var started) ? (long)Math.Max(0, (DateTimeOffset.UtcNow - started).TotalMilliseconds) : 0L;
|
|
93
|
-
var refresh = Bool(root, "refresh"); var path = string.IsNullOrEmpty(Text(root, "path")) ? null : Text(root, "path");
|
|
94
|
-
var
|
|
95
|
-
var
|
|
115
|
+
var refresh = Bool(root, "refresh"); var path = string.IsNullOrEmpty(Text(root, "path")) ? null : Text(root, "path"); var compilationTriggered = Bool(root, "compilationObserved");
|
|
116
|
+
var status = compilationTriggered ? (warnings > 0 ? "warnings" : "clean") : "unchanged";
|
|
117
|
+
var compile = new Dictionary<string, object> { { "completed", true }, { "compilationTriggered", compilationTriggered }, { "noOpReason", compilationTriggered ? null : "no-script-changes" }, { "refresh", refresh }, { "path", path }, { "startedAt", startedAt }, { "finishedAt", finishedAt }, { "durationMs", durationMs }, { "assemblyCount", (long)assemblies }, { "errorCount", (long)errors }, { "warningCount", (long)warnings }, { "status", status } };
|
|
118
|
+
var effects = new List<object>(); if (path != null) effects.Add(new Dictionary<string, object> { { "type", "asset-import" }, { "path", path } }); else if (refresh) effects.Add(new Dictionary<string, object> { { "type", "asset-refresh" } }); if (compilationTriggered) { effects.Add(new Dictionary<string, object> { { "type", "script-compile" } }); effects.Add(new Dictionary<string, object> { { "type", "domain-reload" } }); }
|
|
96
119
|
var state = new Dictionary<string, object> { { "status", "ready" }, { "compile", new Dictionary<string, object> { { "known", true }, { "value", false } } }, { "import", new Dictionary<string, object> { { "known", true }, { "value", false } } }, { "playMode", new Dictionary<string, object> { { "known", true }, { "value", EditorApplication.isPlaying ? "play" : "edit" } } } };
|
|
97
120
|
return new Dictionary<string, object> { { "compile", compile }, { "diagnostics", diagnostics }, { "editorState", state }, { "plannedEffects", effects } };
|
|
98
121
|
}
|
|
122
|
+
/// <summary>刷新前冻结事件序号;刷新后的编译是否发生完全由 Unity Asset Pipeline 决定。</summary>
|
|
99
123
|
private void Dispatch(Dictionary<string, object> root)
|
|
100
124
|
{
|
|
101
125
|
var id = Text(root, "requestId"); if (!string.IsNullOrEmpty(activeDispatchRequestId)) return; activeDispatchRequestId = id;
|
|
102
|
-
try
|
|
103
|
-
|
|
126
|
+
try
|
|
127
|
+
{
|
|
128
|
+
var observationSequence = UnityCliCompilationEventBroker.CurrentCompilationEventSequence();
|
|
129
|
+
if (UnityCliCompilationEventBroker.SequenceCorrupt) throw new BridgeCommandException("E_EXECUTION_TIMEOUT", "Compilation event sequence is corrupt; refresh is forbidden.");
|
|
130
|
+
Update(x => { x["compileObservationSequence"] = observationSequence; x["stableFrames"] = 0L; });
|
|
131
|
+
root["compileObservationSequence"] = observationSequence;
|
|
132
|
+
root = CrossEffectFence(root, "asset-refresh-dispatch", "dispatching");
|
|
133
|
+
var path = Text(root, "path");
|
|
134
|
+
if (!string.IsNullOrEmpty(path)) AssetDatabase.ImportAsset(path);
|
|
135
|
+
else AssetDatabase.Refresh(Bool(root, "forceUpdate") ? ImportAssetOptions.ForceUpdate : ImportAssetOptions.Default);
|
|
136
|
+
Update(x => { if (Text(x, "phase") == "dispatching") x["phase"] = "awaiting_started"; });
|
|
137
|
+
}
|
|
138
|
+
catch (Exception e) { Fail(root, "E_EXECUTION_TIMEOUT", "Compilation refresh result cannot be confirmed: " + e.Message + "; check the business state."); }
|
|
104
139
|
finally { activeDispatchRequestId = null; }
|
|
105
140
|
}
|
|
106
141
|
private void Complete(Dictionary<string, object> root) { if (Long(root, "diagnosticErrorCount") > 0) Fail(root, "E_UNITY_COMPILE_FAILED", "Unity reported compiler errors.", BuildCompileFailureDetails(root), new[] { "Fix the listed compiler diagnostics before retrying." }); else Succeed(root); }
|
|
@@ -108,13 +143,13 @@ namespace UnityCli
|
|
|
108
143
|
{
|
|
109
144
|
return new Dictionary<string, object>
|
|
110
145
|
{
|
|
111
|
-
{ "compile", new Dictionary<string, object> { { "completed", true }, { "errorCount", Long(root, "diagnosticErrorCount") }, { "warningCount", Long(root, "diagnosticWarningCount") }, { "status", "errors" }, { "diagnosticsTruncated", Long(root, "diagnosticsTruncated") } } },
|
|
146
|
+
{ "compile", new Dictionary<string, object> { { "completed", true }, { "compilationTriggered", true }, { "noOpReason", null }, { "errorCount", Long(root, "diagnosticErrorCount") }, { "warningCount", Long(root, "diagnosticWarningCount") }, { "status", "errors" }, { "diagnosticsTruncated", Long(root, "diagnosticsTruncated") } } },
|
|
112
147
|
{ "diagnostics", root["diagnostics"] }
|
|
113
148
|
};
|
|
114
149
|
}
|
|
115
150
|
internal void BeforeReload() { Update(x => x["reloadObserved"] = true); }
|
|
116
151
|
internal long CurrentOwnedCycle() { var root = Load(); return root != null && UnityCliSessionMutationLease.IsOwnedBy(Text(root, "requestId"), Text(root, "requestDigest")) ? Long(root, "startedCycle") : 0; }
|
|
117
|
-
internal void OnCompilationStarted(long cycle, DateTime startedAt) { Update(x => { if (Text(x, "phase") == "dispatching" || Text(x, "phase") == "awaiting_started") { x["startedCycle"] = cycle; x["
|
|
152
|
+
internal void OnCompilationStarted(long cycle, long sequence, DateTime startedAt) { Update(x => { if ((Text(x, "phase") == "dispatching" || Text(x, "phase") == "awaiting_started") && sequence > Long(x, "compileObservationSequence")) { x["startedCycle"] = cycle; x["startedSequence"] = sequence; x["compilationObserved"] = true; x["stableFrames"] = 0L; x["phase"] = "compiling"; } }); }
|
|
118
153
|
internal void OnAssemblyCompilationFinished(long cycle, List<Dictionary<string, object>> diagnostics) { Update(x => { if (Text(x, "phase") == "compiling" && Long(x, "startedCycle") == cycle) AppendBoundedDiagnostics(x, "diagnostics", "diagnosticErrorCount", "diagnosticWarningCount", "diagnosticInfoCount", "diagnosticsTruncated", Bool(x, "includeWarnings"), diagnostics); }); }
|
|
119
154
|
internal void OnCompilationFinished(long cycle, DateTime finishedAt) { Update(x => { if (Text(x, "phase") == "compiling" && Long(x, "startedCycle") == cycle) { x["finishedAt"] = finishedAt.ToString("O", CultureInfo.InvariantCulture); x["phase"] = "cycle_finished"; } }); }
|
|
120
155
|
}
|
|
@@ -128,51 +163,25 @@ namespace UnityCli
|
|
|
128
163
|
internal static void BeforeReload() { operation.BeforeReload(); }
|
|
129
164
|
internal static void Tick() { operation.Tick(); }
|
|
130
165
|
internal static long CurrentOwnedCycle() { return operation.CurrentOwnedCycle(); }
|
|
131
|
-
internal static void RequestRefreshCompilation(string requestId, string requestDigest)
|
|
132
|
-
{
|
|
133
|
-
if (!UnityCliSessionMutationLease.IsOwnedBy(requestId, requestDigest)) throw new BridgeCommandException("E_UNITY_BUSY", "Refresh root does not own the exact mutation lease.");
|
|
134
|
-
var dispatchSequence = UnityCliCompilationEventBroker.CurrentCompilationEventSequence();
|
|
135
|
-
if (UnityCliCompilationEventBroker.SequenceCorrupt)
|
|
136
|
-
throw new BridgeCommandException("E_EXECUTION_TIMEOUT", "Refresh compilation sequence is corrupt; dispatch is forbidden.");
|
|
137
|
-
var refreshRoot = UnityCliActiveOperation.Load("refresh");
|
|
138
|
-
if (refreshRoot == null || Text(refreshRoot, "requestId") != requestId || Text(refreshRoot, "requestDigest") != requestDigest)
|
|
139
|
-
throw new BridgeCommandException("E_EXECUTION_TIMEOUT", "Refresh compilation root identity cannot be proven.");
|
|
140
|
-
if (UnityCliReloadOperation.HasExactEffectFence("refresh", refreshRoot, "compile-dispatch"))
|
|
141
|
-
throw new BridgeCommandException("E_EXECUTION_TIMEOUT", "Refresh compilation effect fence was already crossed.");
|
|
142
|
-
UnityCliReloadOperation.WriteEffectFence("refresh", refreshRoot, "compile-dispatch");
|
|
143
|
-
UpdateRefresh(requestId, requestDigest, x =>
|
|
144
|
-
{
|
|
145
|
-
if (!Bool(x, "compile") || Bool(x, "compilationRequested") || Text(x, "phase") != "refresh_returned")
|
|
146
|
-
throw new BridgeCommandException("E_EXECUTION_TIMEOUT", "Refresh compilation dispatch state is invalid.");
|
|
147
|
-
x["compilationRequested"] = true; x["compileDispatchSequence"] = dispatchSequence; x["compilePhase"] = "dispatching";
|
|
148
|
-
});
|
|
149
|
-
var confirmed = UnityCliActiveOperation.Load("refresh");
|
|
150
|
-
if (confirmed == null || Text(confirmed, "requestId") != requestId || Text(confirmed, "requestDigest") != requestDigest
|
|
151
|
-
|| Text(confirmed, "compilePhase") != "dispatching" || !UnityCliReloadOperation.HasExactEffectFence("refresh", confirmed, "compile-dispatch"))
|
|
152
|
-
throw new BridgeCommandException("E_EXECUTION_TIMEOUT", "Refresh compilation post-fence state cannot be confirmed.");
|
|
153
|
-
if (!UnityCliSessionMutationLease.IsOwnedBy(requestId, requestDigest)) throw new BridgeCommandException("E_EXECUTION_TIMEOUT", "Refresh lost its exact lease before compilation dispatch.");
|
|
154
|
-
CompilationPipeline.RequestScriptCompilation();
|
|
155
|
-
UpdateRefresh(requestId, requestDigest, x => { if (Text(x, "compilePhase") == "dispatching") x["compilePhase"] = "awaiting_started"; });
|
|
156
|
-
}
|
|
157
166
|
internal static void OnCompilationStarted(long cycle, long sequence, DateTime startedAt)
|
|
158
167
|
{
|
|
159
|
-
operation.OnCompilationStarted(cycle, startedAt);
|
|
160
|
-
UpdateRefresh(
|
|
168
|
+
operation.OnCompilationStarted(cycle, sequence, startedAt);
|
|
169
|
+
UpdateRefresh(x =>
|
|
161
170
|
{
|
|
162
171
|
var phase = Text(x, "compilePhase");
|
|
163
|
-
if (Bool(x, "compile") && Bool(x, "
|
|
164
|
-
&&
|
|
165
|
-
&& sequence > Long(x, "
|
|
172
|
+
if (Bool(x, "compile") && Bool(x, "compilationObservationStarted")
|
|
173
|
+
&& phase == "awaiting_started"
|
|
174
|
+
&& sequence > Long(x, "compileObservationSequence"))
|
|
166
175
|
{
|
|
167
176
|
x["compileStartedCycle"] = cycle; x["compileStartedSequence"] = sequence;
|
|
168
|
-
x["compilePhase"] = "compiling"; x["compilationObserved"] = true;
|
|
177
|
+
x["compilePhase"] = "compiling"; x["compilationObserved"] = true; x["stableFrames"] = 0L;
|
|
169
178
|
}
|
|
170
179
|
});
|
|
171
180
|
}
|
|
172
181
|
internal static void OnAssemblyCompilationFinished(long cycle, long sequence, string assembly, List<Dictionary<string, object>> diagnostics)
|
|
173
182
|
{
|
|
174
183
|
operation.OnAssemblyCompilationFinished(cycle, diagnostics);
|
|
175
|
-
UpdateRefresh(
|
|
184
|
+
UpdateRefresh(x =>
|
|
176
185
|
{
|
|
177
186
|
if (Text(x, "compilePhase") == "compiling" && Long(x, "compileStartedCycle") == cycle
|
|
178
187
|
&& sequence > Long(x, "compileStartedSequence"))
|
|
@@ -182,19 +191,17 @@ namespace UnityCli
|
|
|
182
191
|
internal static void OnCompilationFinished(long cycle, long sequence, DateTime finishedAt)
|
|
183
192
|
{
|
|
184
193
|
operation.OnCompilationFinished(cycle, finishedAt);
|
|
185
|
-
UpdateRefresh(
|
|
194
|
+
UpdateRefresh(x =>
|
|
186
195
|
{
|
|
187
196
|
if (Text(x, "compilePhase") == "compiling" && Long(x, "compileStartedCycle") == cycle
|
|
188
197
|
&& sequence > Long(x, "compileStartedSequence"))
|
|
189
198
|
{ x["compileFinishedSequence"] = sequence; x["compilePhase"] = "cycle_finished"; }
|
|
190
199
|
});
|
|
191
200
|
}
|
|
192
|
-
private static void UpdateRefresh(
|
|
201
|
+
private static void UpdateRefresh(Action<Dictionary<string, object>> action)
|
|
193
202
|
{
|
|
194
203
|
if (!UnityCliActiveOperation.Exists("refresh")) return;
|
|
195
204
|
var root = UnityCliActiveOperation.Load("refresh");
|
|
196
|
-
if (id != null && Text(root, "requestId") != id) return;
|
|
197
|
-
if (digest != null && Text(root, "requestDigest") != digest) throw new BridgeCommandException("E_REQUEST_ID_REUSED", "Refresh request identity changed during compilation dispatch.");
|
|
198
205
|
if (!UnityCliSessionMutationLease.IsOwnedBy(Text(root, "requestId"), Text(root, "requestDigest"))) return;
|
|
199
206
|
action(root);
|
|
200
207
|
UnityCliActiveOperation.Save("refresh", root);
|
|
@@ -264,7 +271,7 @@ namespace UnityCli
|
|
|
264
271
|
private static string Text(IDictionary<string, object> value, string key) { object item; return value != null && value.TryGetValue(key, out item) && item != null ? Convert.ToString(item, CultureInfo.InvariantCulture) : string.Empty; }
|
|
265
272
|
private static bool Bool(IDictionary<string, object> value, string key) { object item; return value != null && value.TryGetValue(key, out item) && item is bool && (bool)item; }
|
|
266
273
|
private static long Long(IDictionary<string, object> value, string key) { long result; return long.TryParse(Text(value, key), out result) ? result : 0; }
|
|
267
|
-
private sealed class StartArgs { public
|
|
274
|
+
private sealed class StartArgs { public string Path { get; set; } public bool? ForceUpdate { get; set; } public bool? ImportRecursive { get; set; } public bool? IncludeWarnings { get; set; } public string ExpectedEditorSessionId { get; set; } }
|
|
268
275
|
}
|
|
269
276
|
}
|
|
270
277
|
}
|
|
@@ -12,24 +12,6 @@ namespace UnityCli
|
|
|
12
12
|
{
|
|
13
13
|
public static partial class UnityCliBridge
|
|
14
14
|
{
|
|
15
|
-
private static List<object> CapabilitiesData()
|
|
16
|
-
{
|
|
17
|
-
return new List<object> {
|
|
18
|
-
CapabilityData("camera", CameraCommands), CapabilityData("scene", SceneCommands), CapabilityData("go", GameObjectCommands), CapabilityData("asset", AssetCommands),
|
|
19
|
-
CapabilityData("screenshot", ScreenshotCommands), CapabilityData("prefab", PrefabCommands), CapabilityData("ui", UiCommands),
|
|
20
|
-
CapabilityData("material", MaterialCommands), CapabilityData("graphics", GraphicsCommands), CapabilityData("physics", PhysicsCommands), CapabilityData("scriptable-object", ScriptableObjectCommands),
|
|
21
|
-
CapabilityData("profiler", ProfilerCommands), CapabilityData("animation", AnimationCommands), CapabilityData("shader", ShaderCommands), CapabilityData("texture", TextureCommands),
|
|
22
|
-
CapabilityData("editor", EditorCommands), CapabilityData("code", CodeCommands), CapabilityData("project-tool", ProjectToolCommands), CapabilityData("runtime-tool", RuntimeToolCommands)
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
private static bool IsMutatingCommand(string command) => CommandRegistry.IsMutating(command);
|
|
27
|
-
|
|
28
|
-
private static Dictionary<string, object> CapabilityData(string domain, string[] commands)
|
|
29
|
-
{
|
|
30
|
-
return new Dictionary<string, object> { { "domain", domain }, { "route", "POST /bridge/execute" }, { "commands", (commands ?? Array.Empty<string>()).Cast<object>().ToList() } };
|
|
31
|
-
}
|
|
32
|
-
|
|
33
15
|
private static string HierarchyPath(GameObject gameObject)
|
|
34
16
|
{
|
|
35
17
|
var names = new Stack<string>();
|
|
@@ -47,14 +47,18 @@ namespace UnityCli
|
|
|
47
47
|
{
|
|
48
48
|
ValidateRootContract(root, new[]
|
|
49
49
|
{
|
|
50
|
-
"compile", "
|
|
50
|
+
"compile", "compilationObservationStarted", "compilationObserved", "compilePhase", "compileObservationSequence", "compileStartedSequence", "compileFinishedSequence", "compileStartedCycle",
|
|
51
51
|
"compileDiagnostics", "compileErrorCount", "compileWarningCount", "compileInfoCount", "compileDiagnosticsTruncated", "stableFrames",
|
|
52
52
|
"beforeDependencyGeneration", "beforeProcessedGeneration", "importObserved", "reloadObserved", "rootContractDigest"
|
|
53
53
|
}, "queued", "prepared", "dispatching", "refresh_returned", "waiting_stable");
|
|
54
|
-
object compile; object
|
|
54
|
+
object compile; object observationStarted; object observed; object sequence; object diagnostics; object errorCount; object warningCount; object infoCount; object truncated; object stableFrames;
|
|
55
55
|
if (!root.TryGetValue("compile", out compile) || !(compile is bool)
|
|
56
|
-
|| !root.TryGetValue("
|
|
56
|
+
|| !root.TryGetValue("compilationObservationStarted", out observationStarted) || !(observationStarted is bool)
|
|
57
57
|
|| !root.TryGetValue("compilationObserved", out observed) || !(observed is bool)
|
|
58
|
+
|| !root.TryGetValue("compileObservationSequence", out sequence) || !(sequence is long) || (long)sequence < 0L
|
|
59
|
+
|| !root.TryGetValue("compileStartedSequence", out sequence) || !(sequence is long) || (long)sequence < 0L
|
|
60
|
+
|| !root.TryGetValue("compileFinishedSequence", out sequence) || !(sequence is long) || (long)sequence < 0L
|
|
61
|
+
|| !root.TryGetValue("compileStartedCycle", out sequence) || !(sequence is long) || (long)sequence < 0L
|
|
58
62
|
|| !root.TryGetValue("compileDiagnostics", out diagnostics) || !(diagnostics is List<object>)
|
|
59
63
|
|| !root.TryGetValue("compileErrorCount", out errorCount) || !(errorCount is long) || (long)errorCount < 0L || (long)errorCount > 1000000L
|
|
60
64
|
|| !root.TryGetValue("compileWarningCount", out warningCount) || !(warningCount is long) || (long)warningCount < 0L || (long)warningCount > 1000000L
|
|
@@ -68,14 +72,16 @@ namespace UnityCli
|
|
|
68
72
|
if (!string.Equals(Text(root, "rootContractDigest"), RefreshRootContractDigest(root), StringComparison.Ordinal)) throw new InvalidDataException("Refresh immutable root contract changed.");
|
|
69
73
|
UnityCliCompileCoordinator.ValidateBoundedDiagnostics(root, "compileDiagnostics", "compileErrorCount", "compileWarningCount", "compileInfoCount", "compileDiagnosticsTruncated", true);
|
|
70
74
|
var compilePhase = Text(root, "compilePhase");
|
|
71
|
-
if (Array.IndexOf(new[] { "idle", "
|
|
75
|
+
if (Array.IndexOf(new[] { "idle", "awaiting_started", "compiling", "cycle_finished" }, compilePhase) < 0) throw new InvalidDataException("Refresh compile phase is invalid.");
|
|
72
76
|
var refreshFenced = HasExactEffectFence("refresh", root, "refresh-dispatch");
|
|
73
77
|
var phase = Text(root, "phase");
|
|
74
78
|
if ((phase == "queued" || phase == "prepared") == refreshFenced) throw new InvalidDataException("Refresh effect fence is inconsistent with phase.");
|
|
75
|
-
|
|
76
|
-
if ((compilePhase == "
|
|
77
|
-
if (
|
|
79
|
+
if ((bool)observationStarted != ((bool)compile && compilePhase != "idle")) throw new InvalidDataException("Refresh compile observation state is inconsistent.");
|
|
80
|
+
if ((bool)observed != (compilePhase == "compiling" || compilePhase == "cycle_finished")) throw new InvalidDataException("Refresh compile observed state is inconsistent with phase.");
|
|
81
|
+
if ((bool)observed && (Long(root, "compileStartedCycle") <= 0L || Long(root, "compileStartedSequence") <= Long(root, "compileObservationSequence")))
|
|
78
82
|
throw new InvalidDataException("Refresh compile attribution is invalid.");
|
|
83
|
+
if (compilePhase == "cycle_finished" && Long(root, "compileFinishedSequence") <= Long(root, "compileStartedSequence"))
|
|
84
|
+
throw new InvalidDataException("Refresh compile finish attribution is invalid.");
|
|
79
85
|
}
|
|
80
86
|
|
|
81
87
|
private static string RefreshRootContractDigest(Dictionary<string, object> root)
|
|
@@ -101,8 +107,8 @@ namespace UnityCli
|
|
|
101
107
|
var root = new Dictionary<string, object>
|
|
102
108
|
{
|
|
103
109
|
{ "requestId", request.RequestId }, { "editorSessionId", EditorSessionId() }, { "requestDigest", digest }, { "deadline", request.Execution.AbsoluteDeadlineUtc },
|
|
104
|
-
{ "phase", "queued" }, { "compile", args.Compile }, { "
|
|
105
|
-
{ "
|
|
110
|
+
{ "phase", "queued" }, { "compile", args.Compile }, { "compilationObservationStarted", false }, { "compilationObserved", false }, { "compilePhase", "idle" },
|
|
111
|
+
{ "compileObservationSequence", 0L }, { "compileStartedSequence", 0L }, { "compileFinishedSequence", 0L }, { "compileStartedCycle", 0L },
|
|
106
112
|
{ "compileDiagnostics", new List<object>() }, { "compileErrorCount", 0L }, { "compileWarningCount", 0L }, { "compileInfoCount", 0L }, { "compileDiagnosticsTruncated", 0L },
|
|
107
113
|
{ "stableFrames", 0L }, { "beforeDependencyGeneration", before.DependencyGeneration }, { "beforeProcessedGeneration", before.ProcessedGeneration },
|
|
108
114
|
{ "importObserved", false }, { "reloadObserved", false }
|
|
@@ -119,24 +125,22 @@ namespace UnityCli
|
|
|
119
125
|
if (phase == "queued") { if (BusyEditor()) return; Update(value => value["phase"] = "prepared"); return; }
|
|
120
126
|
if (phase == "prepared")
|
|
121
127
|
{
|
|
128
|
+
if (Bool(root, "compile"))
|
|
129
|
+
{
|
|
130
|
+
var observationSequence = UnityCliCompilationEventBroker.CurrentCompilationEventSequence();
|
|
131
|
+
if (UnityCliCompilationEventBroker.SequenceCorrupt) { Fail(root, "E_EXECUTION_TIMEOUT", "Refresh compilation event sequence is corrupt; attributed outcome is unknown."); return; }
|
|
132
|
+
Update(value => { value["compilationObservationStarted"] = true; value["compileObservationSequence"] = observationSequence; value["compilePhase"] = "awaiting_started"; value["stableFrames"] = 0L; });
|
|
133
|
+
root["compilationObservationStarted"] = true; root["compileObservationSequence"] = observationSequence; root["compilePhase"] = "awaiting_started";
|
|
134
|
+
}
|
|
122
135
|
root = CrossEffectFence(root, "refresh-dispatch", "dispatching");
|
|
123
136
|
try { AssetDatabase.Refresh(); Update(value => value["phase"] = "refresh_returned"); }
|
|
124
137
|
catch (Exception exception) { Fail(root, "E_EXECUTION_TIMEOUT", "Refresh result cannot be confirmed: " + exception.Message + "; inspect asset state."); }
|
|
125
138
|
return;
|
|
126
139
|
}
|
|
127
|
-
if (phase == "refresh_returned")
|
|
128
|
-
{
|
|
129
|
-
if (Bool(root, "compile") && !Bool(root, "compilationObserved") && !Bool(root, "compilationRequested"))
|
|
130
|
-
{
|
|
131
|
-
if (BusyEditor()) return;
|
|
132
|
-
UnityCliCompileCoordinator.RequestRefreshCompilation(Text(root, "requestId"), Text(root, "requestDigest"));
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
Update(value => value["phase"] = "waiting_stable");
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
140
|
+
if (phase == "refresh_returned") { Update(value => value["phase"] = "waiting_stable"); return; }
|
|
138
141
|
if (phase != "waiting_stable" || BusyEditor()) return;
|
|
139
|
-
|
|
142
|
+
var compilePhase = Text(root, "compilePhase");
|
|
143
|
+
if (Bool(root, "compile") && compilePhase != "awaiting_started" && compilePhase != "cycle_finished")
|
|
140
144
|
{
|
|
141
145
|
Fail(root, "E_EXECUTION_TIMEOUT", "Refresh compilation result cannot be confirmed; inspect editor.state and compile diagnostics.");
|
|
142
146
|
return;
|
|
@@ -152,6 +156,7 @@ namespace UnityCli
|
|
|
152
156
|
return;
|
|
153
157
|
}
|
|
154
158
|
var frames = Long(root, "stableFrames") + 1L;
|
|
159
|
+
root["stableFrames"] = frames;
|
|
155
160
|
Update(value => value["stableFrames"] = frames);
|
|
156
161
|
if (frames >= 3L) Succeed(root);
|
|
157
162
|
}
|
|
@@ -11,7 +11,7 @@ namespace UnityCli
|
|
|
11
11
|
public static partial class UnityCliBridge
|
|
12
12
|
{
|
|
13
13
|
/// <summary>
|
|
14
|
-
/// object.
|
|
14
|
+
/// serialized-object.patch 与 component.modify 共用的 verified SerializedProperty patch 引擎。
|
|
15
15
|
/// 公开契约只允许非空 direct replace,不保留 reflection merge/add/remove 旁路。
|
|
16
16
|
/// </summary>
|
|
17
17
|
internal static class ObjectPatch
|
|
@@ -99,7 +99,7 @@ namespace UnityCli
|
|
|
99
99
|
|
|
100
100
|
throw new BridgeCommandException("E_OBJECTREF_REQUIRED",
|
|
101
101
|
"Object reference required: pass instanceId, assetPath/guid, or path/name.",
|
|
102
|
-
"Run object.
|
|
102
|
+
"Run serialized-object.read --input '{\"instanceId\":12345}' or '{\"assetPath\":\"Assets/Mat.mat\"}'.");
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
/// <summary>解析 GameObject 引用。</summary>
|
|
@@ -127,12 +127,12 @@ namespace UnityCli
|
|
|
127
127
|
if (go != null) return go;
|
|
128
128
|
throw new BridgeCommandException("E_OBJECTREF_GAMEOBJECT_REQUIRED",
|
|
129
129
|
"No GameObject matched path/name '" + path + "' in any loaded scene.",
|
|
130
|
-
"Run
|
|
130
|
+
"Run game-object.find to locate the GameObject and obtain its instanceId, then pass that instanceId.");
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
throw new BridgeCommandException("E_OBJECTREF_GAMEOBJECT_REQUIRED",
|
|
134
134
|
"GameObject reference required: pass instanceId or path/name.",
|
|
135
|
-
"Run
|
|
135
|
+
"Run game-object.find to locate the GameObject and obtain its instanceId.");
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
/// <summary>
|
|
@@ -282,7 +282,7 @@ namespace UnityCli
|
|
|
282
282
|
var secondPath = UnityCliHierarchyPager.Path(second, budget);
|
|
283
283
|
throw new BridgeCommandException("E_OBJECTREF_AMBIGUOUS",
|
|
284
284
|
"Path '" + path + "' matches multiple GameObjects: " + firstPath + ", " + secondPath,
|
|
285
|
-
"Pass the instanceId from
|
|
285
|
+
"Pass the instanceId from game-object.find to disambiguate objects in different loaded scenes.");
|
|
286
286
|
}
|
|
287
287
|
|
|
288
288
|
/// <summary>
|
|
@@ -373,7 +373,7 @@ namespace UnityCli
|
|
|
373
373
|
}
|
|
374
374
|
throw new BridgeCommandException("E_OBJECTREF_AMBIGUOUS",
|
|
375
375
|
"Path '" + path + "' matches " + matches.Count + " GameObjects: " + string.Join(", ", candidates),
|
|
376
|
-
"Pass the full hierarchy path from a scene root, or use
|
|
376
|
+
"Pass the full hierarchy path from a scene root, or use game-object.find to obtain the instanceId.");
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
379
|
}
|