@alpsckr/unitycli 0.4.3 → 0.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/contracts/command-contract.json +109 -217
- package/contracts/package-files.json +374 -294
- package/contracts/stable-session/direct-call-semantics.json +8 -2
- package/contracts/tool-completion-contract.json +148 -672
- package/dist/bridge/admission.d.ts +17 -1
- package/dist/bridge/admission.js +2 -0
- package/dist/bridge/admission.js.map +1 -1
- package/dist/bridge/domains/asset.js +3 -1
- package/dist/bridge/domains/asset.js.map +1 -1
- package/dist/bridge/domains/camera.js +39 -7
- package/dist/bridge/domains/camera.js.map +1 -1
- package/dist/bridge/domains/console.js +2 -1
- package/dist/bridge/domains/console.js.map +1 -1
- package/dist/bridge/domains/doctor.d.ts +3 -0
- package/dist/bridge/domains/doctor.js +8 -0
- package/dist/bridge/domains/doctor.js.map +1 -0
- package/dist/bridge/domains/editor.js +0 -4
- package/dist/bridge/domains/editor.js.map +1 -1
- package/dist/bridge/domains/game-object.js +4 -12
- package/dist/bridge/domains/game-object.js.map +1 -1
- package/dist/bridge/domains/graphics.js +1 -16
- package/dist/bridge/domains/graphics.js.map +1 -1
- package/dist/bridge/domains/object.js +3 -0
- package/dist/bridge/domains/object.js.map +1 -1
- package/dist/bridge/domains/physics.js +1 -2
- package/dist/bridge/domains/physics.js.map +1 -1
- package/dist/bridge/domains/profiler.js +18 -7
- package/dist/bridge/domains/profiler.js.map +1 -1
- package/dist/bridge/domains/project-tool.js +4 -0
- package/dist/bridge/domains/project-tool.js.map +1 -1
- package/dist/bridge/domains/reflection.js +10 -2
- package/dist/bridge/domains/reflection.js.map +1 -1
- package/dist/bridge/domains/runtime-tool.js +3 -0
- package/dist/bridge/domains/runtime-tool.js.map +1 -1
- package/dist/bridge/domains/scene.js +3 -8
- package/dist/bridge/domains/scene.js.map +1 -1
- package/dist/bridge/domains/screenshot.js +30 -6
- package/dist/bridge/domains/screenshot.js.map +1 -1
- package/dist/bridge/domains/ui.js +3 -1
- package/dist/bridge/domains/ui.js.map +1 -1
- package/dist/bridge/index.d.ts +5 -5
- package/dist/bridge/index.js +6 -9
- package/dist/bridge/index.js.map +1 -1
- package/dist/bridge/registry.js +3 -5
- package/dist/bridge/registry.js.map +1 -1
- package/dist/bridge/session-supervisor.d.ts +6 -3
- package/dist/bridge/session-supervisor.js +145 -39
- 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 +6 -5
- package/dist/bridge/types.js +16 -2
- package/dist/bridge/types.js.map +1 -1
- package/dist/catalog-protocol.d.ts +64 -0
- package/dist/catalog-protocol.js +460 -0
- package/dist/catalog-protocol.js.map +1 -0
- package/dist/cli-commands/command.js +84 -61
- package/dist/cli-commands/command.js.map +1 -1
- package/dist/cli-commands/extensions.js +70 -50
- package/dist/cli-commands/extensions.js.map +1 -1
- package/dist/cli-commands/instances.js +1 -1
- package/dist/cli-commands/instances.js.map +1 -1
- package/dist/cli-commands/package.js +10 -2
- package/dist/cli-commands/package.js.map +1 -1
- package/dist/cli-process-owners.d.ts +6 -0
- package/dist/cli-process-owners.js +27 -0
- package/dist/cli-process-owners.js.map +1 -0
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +20 -5
- package/dist/cli.js.map +1 -1
- package/dist/contracts/command-contract.js +14 -4
- package/dist/contracts/command-contract.js.map +1 -1
- package/dist/doctor.d.ts +4 -6
- package/dist/doctor.js +451 -398
- package/dist/doctor.js.map +1 -1
- package/dist/editor-blocker-observer.d.ts +2 -1
- package/dist/editor-blocker-observer.js +40 -13
- package/dist/editor-blocker-observer.js.map +1 -1
- package/dist/extension-availability.d.ts +27 -9
- package/dist/extension-availability.js +96 -56
- package/dist/extension-availability.js.map +1 -1
- package/dist/extensions/descriptor-loader.d.ts +2 -2
- package/dist/extensions/descriptor-loader.js +3 -4
- package/dist/extensions/descriptor-loader.js.map +1 -1
- package/dist/extensions/index.d.ts +1 -1
- package/dist/extensions/index.js +1 -1
- package/dist/extensions/index.js.map +1 -1
- package/dist/extensions/installer.d.ts +57 -5
- package/dist/extensions/installer.js +263 -64
- package/dist/extensions/installer.js.map +1 -1
- package/dist/extensions/registry.js +3 -5
- package/dist/extensions/registry.js.map +1 -1
- package/dist/extensions/state-contract.d.ts +11 -0
- package/dist/extensions/state-contract.js +50 -0
- package/dist/extensions/state-contract.js.map +1 -0
- package/dist/instances.d.ts +19 -1
- package/dist/instances.js +39 -0
- package/dist/instances.js.map +1 -1
- package/dist/package-manager.d.ts +0 -24
- package/dist/package-manager.js +5 -58
- package/dist/package-manager.js.map +1 -1
- package/dist/project-tool-discovery.d.ts +5 -2
- package/dist/project-tool-discovery.js +22 -18
- package/dist/project-tool-discovery.js.map +1 -1
- package/dist/runtime-code.js +1 -1
- package/dist/runtime-code.js.map +1 -1
- package/dist/tool-name.d.ts +4 -0
- package/dist/tool-name.js +15 -0
- package/dist/tool-name.js.map +1 -0
- package/dist/tools/.generated-completion-registry.d.ts +2 -0
- package/dist/tools/.generated-completion-registry.js +763 -325
- package/dist/tools/.generated-completion-registry.js.map +1 -1
- package/dist/tools/.generated-registry.d.ts +6 -11
- package/dist/tools/.generated-registry.js +6 -11
- package/dist/tools/.generated-registry.js.map +1 -1
- package/dist/tools/.generated-schemas.js +11 -16
- package/dist/tools/.generated-schemas.js.map +1 -1
- package/dist/tools/asset/refresh-status.d.ts +3 -0
- package/dist/tools/asset/refresh-status.js +12 -0
- package/dist/tools/asset/refresh-status.js.map +1 -0
- package/dist/tools/asset/refresh.js +7 -3
- package/dist/tools/asset/refresh.js.map +1 -1
- package/dist/tools/build/player-status.d.ts +3 -0
- package/dist/tools/build/player-status.js +12 -0
- package/dist/tools/build/player-status.js.map +1 -0
- package/dist/tools/build/run.js +1 -1
- package/dist/tools/build/run.js.map +1 -1
- package/dist/tools/catalog-control.d.ts +22 -0
- package/dist/tools/catalog-control.js +335 -0
- package/dist/tools/catalog-control.js.map +1 -0
- package/dist/tools/catalog.d.ts +7 -9
- package/dist/tools/catalog.js +66 -45
- package/dist/tools/catalog.js.map +1 -1
- package/dist/tools/commands.d.ts +1 -1
- package/dist/tools/commands.js +44 -11
- package/dist/tools/commands.js.map +1 -1
- package/dist/tools/define.js +3 -2
- package/dist/tools/define.js.map +1 -1
- package/dist/tools/dispatcher.d.ts +53 -6
- package/dist/tools/dispatcher.js +277 -108
- package/dist/tools/dispatcher.js.map +1 -1
- package/dist/tools/editor/compile.js +1 -1
- package/dist/tools/editor/compile.js.map +1 -1
- package/dist/tools/editor/play-mode-status.d.ts +3 -0
- package/dist/tools/editor/play-mode-status.js +12 -0
- package/dist/tools/editor/play-mode-status.js.map +1 -0
- package/dist/tools/editor/readiness.d.ts +0 -1
- package/dist/tools/editor/readiness.js +0 -1
- package/dist/tools/editor/readiness.js.map +1 -1
- package/dist/tools/editor/refresh.d.ts +7 -3
- package/dist/tools/editor/refresh.js +20 -15
- package/dist/tools/editor/refresh.js.map +1 -1
- package/dist/tools/editor/state.d.ts +2 -2
- package/dist/tools/editor/state.js +13 -12
- package/dist/tools/editor/state.js.map +1 -1
- package/dist/tools/metadata/derived.js +1 -7
- package/dist/tools/metadata/derived.js.map +1 -1
- package/dist/tools/metadata/status.js +1 -12
- package/dist/tools/metadata/status.js.map +1 -1
- package/dist/tools/metadata/types.d.ts +0 -2
- package/dist/tools/navmesh/live.js +1 -1
- package/dist/tools/navmesh/live.js.map +1 -1
- package/dist/tools/occlusion/live.js +1 -1
- package/dist/tools/occlusion/live.js.map +1 -1
- package/dist/tools/package/deploy.js +2 -2
- package/dist/tools/package/deploy.js.map +1 -1
- package/dist/tools/package/embed.js +1 -1
- package/dist/tools/package/embed.js.map +1 -1
- package/dist/tools/package/install-status.d.ts +3 -0
- package/dist/tools/package/install-status.js +12 -0
- package/dist/tools/package/install-status.js.map +1 -0
- package/dist/tools/package/install.js +3 -3
- package/dist/tools/package/install.js.map +1 -1
- package/dist/tools/package/live-resolve.js +45 -12
- package/dist/tools/package/live-resolve.js.map +1 -1
- package/dist/tools/package/registry-clear.js.map +1 -1
- package/dist/tools/package/registry-set.js.map +1 -1
- package/dist/tools/package/remove-status.d.ts +3 -0
- package/dist/tools/package/remove-status.js +12 -0
- package/dist/tools/package/remove-status.js.map +1 -0
- package/dist/tools/package/remove.js +3 -3
- package/dist/tools/package/remove.js.map +1 -1
- package/dist/tools/package/resolve.js +3 -3
- package/dist/tools/package/resolve.js.map +1 -1
- package/dist/tools/package/restore.js +2 -2
- package/dist/tools/package/restore.js.map +1 -1
- package/dist/tools/package/scoped-registry-add.js.map +1 -1
- package/dist/tools/status/support.d.ts +13 -0
- package/dist/tools/status/support.js +28 -0
- package/dist/tools/status/support.js.map +1 -0
- package/dist/tools/test/cancel.js +2 -2
- package/dist/tools/test/cancel.js.map +1 -1
- package/dist/tools/test/run-status.d.ts +3 -0
- package/dist/tools/test/run-status.js +12 -0
- package/dist/tools/test/run-status.js.map +1 -0
- package/dist/tools/test/run.js +7 -4
- package/dist/tools/test/run.js.map +1 -1
- package/dist/tools/tools/group-summaries.js +10 -14
- package/dist/tools/tools/group-summaries.js.map +1 -1
- package/docs/architecture.md +4 -4
- package/docs/availability-differences.md +4 -4
- package/docs/command-execution.md +4 -3
- package/docs/error-codes.md +13 -5
- package/docs/extensions.md +1 -7
- package/docs/risk-and-side-effects.md +4 -3
- package/docs/safety-boundaries.md +3 -1
- package/docs/target-and-instance.md +1 -1
- package/docs/tool-discovery.md +17 -10
- package/docs/tool-execution.md +18 -7
- package/extensions/cinemachine/unitypkg/Editor/UnityCliExtensionAssembly.cs +3 -0
- package/extensions/hdrp/unitypkg/Editor/UnityCliExtensionAssembly.cs +3 -0
- package/extensions/probuilder/unitypkg/Editor/UnityCliExtensionAssembly.cs +3 -0
- package/extensions/urp/unitypkg/Editor/UnityCliExtensionAssembly.cs +3 -0
- package/extensions/vfx-graph/unitypkg/Editor/UnityCliExtensionAssembly.cs +3 -0
- package/package.json +2 -4
- package/skills/unitycli/SKILL.md +11 -2
- package/skills/unitycli/manifest.json +1 -1
- package/skills/unitycli/references/operation-protocol.md +3 -3
- package/unitypkg/Editor/AssemblyInfo.cs +5 -0
- package/unitypkg/Editor/Bridge/BridgeCommandRegistry.cs +49 -14
- package/unitypkg/Editor/Bridge/BridgeHttpServer.cs +9 -35
- package/unitypkg/Editor/Bridge/BridgeQueueState.cs +672 -0
- package/unitypkg/Editor/Bridge/BridgeWorkQueue.cs +970 -120
- package/unitypkg/Editor/BridgeStartupStateMachine.cs +59 -1
- package/unitypkg/Editor/Commands/ProjectToolCommands.cs +4 -0
- package/unitypkg/Editor/Commands/RuntimeToolCommands.cs +3 -0
- package/unitypkg/Editor/Generated/UnityCliToolCompletionRegistry.g.cs +379 -14
- package/unitypkg/Editor/Infrastructure/CodeExecSupport.cs +28 -13
- package/unitypkg/Editor/Infrastructure/RegistryOwnershipResolver.cs +132 -105
- package/unitypkg/Editor/Infrastructure/UnityCliActiveOperation.cs +138 -29
- package/unitypkg/Editor/Infrastructure/UnityCliAdmission.cs +1856 -237
- package/unitypkg/Editor/Infrastructure/UnityCliDoctorDiagnostics.cs +220 -0
- package/unitypkg/Editor/Infrastructure/UnityCliDurableStatusCoordinator.cs +118 -0
- package/unitypkg/Editor/Infrastructure/UnityCliEditorStateSnapshot.cs +2 -1
- package/unitypkg/Editor/Infrastructure/UnityCliHierarchyPager.cs +203 -0
- package/unitypkg/Editor/Infrastructure/UnityCliInstanceCleanup.cs +2 -1
- package/unitypkg/Editor/Infrastructure/UnityCliInstanceRegistry.cs +201 -63
- package/unitypkg/Editor/Infrastructure/UnityCliJson.cs +2 -3
- package/unitypkg/Editor/Infrastructure/UnityCliLiveBuildCoordinator.cs +289 -46
- package/unitypkg/Editor/Infrastructure/UnityCliLiveRefreshCoordinator.cs +87 -53
- package/unitypkg/Editor/Infrastructure/UnityCliNavMeshBakeCoordinator.cs +4 -4
- package/unitypkg/Editor/Infrastructure/UnityCliObjectRef.cs +128 -25
- package/unitypkg/Editor/Infrastructure/UnityCliObjectSerializer.cs +435 -327
- package/unitypkg/Editor/Infrastructure/UnityCliOcclusionBakeCoordinator.cs +4 -4
- package/unitypkg/Editor/Infrastructure/UnityCliOperationCoordinator.cs +351 -53
- package/unitypkg/Editor/Infrastructure/UnityCliPackageResolveCoordinator.cs +118 -18
- package/unitypkg/Editor/Infrastructure/UnityCliPackageResolveState.cs +20 -1
- package/unitypkg/Editor/Infrastructure/UnityCliReadGeneration.cs +97 -0
- package/unitypkg/Editor/Infrastructure/UnityCliReflection.cs +644 -133
- package/unitypkg/Editor/Infrastructure/UnityCliReloadOperation.cs +128 -41
- package/unitypkg/Editor/Infrastructure/UnityCliRuntimeExecutor.cs +14 -84
- package/unitypkg/Editor/Infrastructure/UnityCliSerializer.cs +220 -0
- package/unitypkg/Editor/Infrastructure/UnityCliSessionMutationLease.cs +69 -29
- package/unitypkg/Editor/Infrastructure/UnityCliTestRunCoordinator.cs +440 -54
- package/unitypkg/Editor/Infrastructure/UnityCliWaiter.cs +128 -35
- package/unitypkg/Editor/ProjectTools/IUnityCliTool.cs +9 -1
- package/unitypkg/Editor/ProjectTools/OfficialAttributeToolRegistry.cs +32 -31
- package/unitypkg/Editor/ProjectTools/ProjectToolRegistry.cs +607 -458
- package/unitypkg/Editor/ProjectTools/ProjectToolSchemaValidator.cs +35 -7
- package/unitypkg/Editor/ProjectTools/RegisteredTool.cs +501 -60
- package/unitypkg/Editor/ProjectTools/UnityCliProjectToolContext.cs +21 -0
- package/unitypkg/Editor/ProjectTools/UnityCliSchemaDeriver.cs +36 -7
- package/unitypkg/Editor/ProjectTools/UnityCliToolName.cs +30 -0
- package/unitypkg/Editor/Properties/AssemblyInfo.cs +3 -0
- package/unitypkg/Editor/Tools/asset/get-data.cs +16 -7
- package/unitypkg/Editor/Tools/build/BuildSceneStateTool.cs +23 -3
- package/unitypkg/Editor/Tools/build/BuildToolDtos.cs +2 -1
- package/unitypkg/Editor/Tools/build/scene/add.cs +6 -3
- package/unitypkg/Editor/Tools/build/scene/disable.cs +1 -1
- package/unitypkg/Editor/Tools/build/scene/enable.cs +1 -1
- package/unitypkg/Editor/Tools/build/scene/list.cs +1 -1
- package/unitypkg/Editor/Tools/build/scene/remove.cs +13 -3
- package/unitypkg/Editor/Tools/camera/CameraToolSupport.cs +38 -38
- package/unitypkg/Editor/Tools/camera/multiview.cs +13 -6
- package/unitypkg/Editor/Tools/camera/screenshot.cs +14 -7
- package/unitypkg/Editor/Tools/component/get.cs +16 -9
- package/unitypkg/Editor/Tools/component/modify.cs +6 -4
- package/unitypkg/Editor/Tools/console/clear.cs +7 -6
- package/unitypkg/Editor/Tools/console/get.cs +48 -16
- package/unitypkg/Editor/Tools/editor/EditorToolSupport.cs +143 -28
- package/unitypkg/Editor/Tools/editor/menu-items.cs +1 -1
- package/unitypkg/Editor/Tools/editor/play.cs +2 -11
- package/unitypkg/Editor/Tools/editor/selection.cs +1 -1
- package/unitypkg/Editor/Tools/editor/stop.cs +2 -11
- package/unitypkg/Editor/Tools/editor/windows.cs +1 -1
- package/unitypkg/Editor/Tools/go/GameObjectToolSupport.cs +54 -4
- package/unitypkg/Editor/Tools/go/delete.cs +1 -1
- package/unitypkg/Editor/Tools/go/find.cs +167 -70
- package/unitypkg/Editor/Tools/graphics/GraphicsToolSupport.cs +25 -0
- package/unitypkg/Editor/Tools/graphics/light-probe-group.cs +9 -3
- package/unitypkg/Editor/Tools/graphics/pipeline-info.cs +1 -1
- package/unitypkg/Editor/Tools/graphics/pipeline-settings.cs +1 -1
- package/unitypkg/Editor/Tools/graphics/quality.cs +2 -2
- package/unitypkg/Editor/Tools/graphics/reflection-probe.cs +3 -3
- package/unitypkg/Editor/Tools/graphics/stats.cs +1 -1
- package/unitypkg/Editor/Tools/object/ObjectToolSupport.cs +4 -4
- package/unitypkg/Editor/Tools/object/get-data.cs +9 -7
- package/unitypkg/Editor/Tools/object/modify.cs +7 -5
- package/unitypkg/Editor/Tools/physics/raycast.cs +24 -6
- package/unitypkg/Editor/Tools/prefab/stage.cs +1 -1
- package/unitypkg/Editor/Tools/profiler/ProfilerFrameDebuggerSupport.cs +94 -21
- package/unitypkg/Editor/Tools/profiler/ProfilerMemorySnapshotSupport.cs +397 -10
- package/unitypkg/Editor/Tools/profiler/ProfilerToolSupport.cs +18 -4
- package/unitypkg/Editor/Tools/profiler/frame-debugger/enable.cs +1 -1
- package/unitypkg/Editor/Tools/profiler/frame-debugger/events.cs +88 -87
- package/unitypkg/Editor/Tools/profiler/hierarchy.cs +278 -112
- package/unitypkg/Editor/Tools/profiler/memory-snapshot/compare.cs +9 -5
- package/unitypkg/Editor/Tools/profiler/memory-snapshot/list.cs +37 -35
- package/unitypkg/Editor/Tools/profiler/memory-snapshot/take.cs +99 -97
- package/unitypkg/Editor/Tools/project/info.cs +1 -1
- package/unitypkg/Editor/Tools/project/layers.cs +1 -1
- package/unitypkg/Editor/Tools/project/tags.cs +1 -1
- package/unitypkg/Editor/Tools/reflection/method/call.cs +9 -7
- package/unitypkg/Editor/Tools/reflection/method/find.cs +27 -37
- package/unitypkg/Editor/Tools/reflection/type/schema.cs +24 -28
- package/unitypkg/Editor/Tools/scene/gameobject/component.cs +8 -5
- package/unitypkg/Editor/Tools/scene/gameobject/components.cs +10 -7
- package/unitypkg/Editor/Tools/scene/gameobject-support.cs +104 -8
- package/unitypkg/Editor/Tools/scene/gameobject.cs +37 -16
- package/unitypkg/Editor/Tools/scene/hierarchy.cs +146 -142
- package/unitypkg/Editor/Tools/screenshot/EditorElementCaptureToolSupport.cs +77 -25
- package/unitypkg/Editor/Tools/screenshot/ScreenshotToolSupport.cs +315 -95
- package/unitypkg/Editor/Tools/screenshot/editor-element.cs +7 -5
- package/unitypkg/Editor/Tools/screenshot/game-view.cs +35 -21
- package/unitypkg/Editor/Tools/screenshot/isolated-object.cs +29 -23
- package/unitypkg/Editor/Tools/screenshot/orbit.cs +37 -25
- package/unitypkg/Editor/Tools/screenshot/scene-view.cs +25 -18
- package/unitypkg/Editor/Tools/screenshot/screen.cs +177 -17
- package/unitypkg/Editor/Tools/screenshot/surround.cs +83 -79
- package/unitypkg/Editor/Tools/ui/render-preview.cs +16 -11
- package/unitypkg/Editor/UnityCliBridge.cs +97 -34
- package/unitypkg/Runtime/Infrastructure/UnityCliRuntimeBridge.cs +753 -122
- package/unitypkg/Runtime/Properties/AssemblyInfo.cs +5 -0
- package/unitypkg/Runtime/UnityCli.Runtime.asmdef +1 -1
- package/unitypkg/Shared/AssemblyInfo.cs +4 -0
- package/unitypkg/Shared/UnityCliAdmissionPool.cs +265 -75
- package/unitypkg/Shared/UnityCliBridgeQueuePolicy.cs +410 -0
- package/unitypkg/Shared/UnityCliBridgeWorkItemState.cs +47 -0
- package/unitypkg/Shared/UnityCliExceptionProjection.cs +151 -0
- package/unitypkg/Shared/UnityCliQueuePublication.cs +30 -0
- package/unitypkg/Shared/UnityCliRequestBudget.cs +352 -0
- package/unitypkg/Shared/UnityCliRuntimeRequestPublication.cs +107 -0
- package/unitypkg/Tests/Editor/UnityCli.Editor.Tests.asmdef +2 -2
- package/unitypkg/Tests/Editor/UnityCliAdmissionCoordinatorIntegrationTests.cs +1329 -0
- package/unitypkg/Tests/Editor/UnityCliAdmissionPoolTests.cs +311 -114
- package/unitypkg/Tests/Editor/UnityCliAdmissionRepairStateTests.cs +94 -0
- package/unitypkg/Tests/Editor/UnityCliBridgeAdmissionIntegrationTests.cs +1229 -0
- package/unitypkg/Tests/Editor/UnityCliBridgeQueuePolicyTests.cs +412 -0
- package/unitypkg/Tests/Editor/UnityCliContinuationIntegrationTests.cs +292 -0
- package/unitypkg/Tests/Editor/UnityCliDiagnosticBoundaryTests.cs +120 -0
- package/unitypkg/Tests/Editor/UnityCliDurableStatusTests.cs +84 -0
- package/unitypkg/Tests/Editor/UnityCliExceptionProjectionTests.cs +72 -0
- package/unitypkg/Tests/Editor/UnityCliInstancePublicationRetryTests.cs +180 -97
- package/unitypkg/Tests/Editor/UnityCliMemoryReflectionIntegrationTests.cs +434 -0
- package/unitypkg/Tests/Editor/UnityCliRequestBudgetTests.cs +615 -0
- package/unitypkg/Tests/Editor/UnityCliRuntimeBridgeIntegrationTests.cs +520 -0
- package/unitypkg/Tests/Editor/UnityCliToolCatalogTests.cs +562 -0
- package/unitypkg/Tests/Runtime/UnityCli.Runtime.Tests.asmdef +23 -0
- package/unitypkg/Tests/Runtime/UnityCliRuntimeCatalogValidationTests.cs +29 -0
- package/unitypkg/package.json +1 -1
- package/contracts/static-capability-catalog.json +0 -48226
- package/dist/bridge/domains/diagnose.d.ts +0 -2
- package/dist/bridge/domains/diagnose.js +0 -11
- package/dist/bridge/domains/diagnose.js.map +0 -1
- package/dist/bridge/domains/extension.d.ts +0 -8
- package/dist/bridge/domains/extension.js +0 -20
- package/dist/bridge/domains/extension.js.map +0 -1
- package/dist/capabilities.d.ts +0 -5
- package/dist/capabilities.js +0 -84
- package/dist/capabilities.js.map +0 -1
- package/dist/static-capability-catalog.d.ts +0 -13
- package/dist/static-capability-catalog.js +0 -41
- package/dist/static-capability-catalog.js.map +0 -1
- package/dist/tools/diagnose/capabilities.d.ts +0 -13
- package/dist/tools/diagnose/capabilities.js +0 -34
- package/dist/tools/diagnose/capabilities.js.map +0 -1
- package/dist/tools/package/info.d.ts +0 -19
- package/dist/tools/package/info.js +0 -27
- package/dist/tools/package/info.js.map +0 -1
- package/dist/tools/package/list.d.ts +0 -27
- package/dist/tools/package/list.js +0 -21
- package/dist/tools/package/list.js.map +0 -1
- package/dist/tools/package/registry-get.d.ts +0 -10
- package/dist/tools/package/registry-get.js +0 -22
- package/dist/tools/package/registry-get.js.map +0 -1
- package/dist/tools/package/scoped-registry-list.d.ts +0 -14
- package/dist/tools/package/scoped-registry-list.js +0 -22
- package/dist/tools/package/scoped-registry-list.js.map +0 -1
- package/dist/tools/package/search.d.ts +0 -17
- package/dist/tools/package/search.js +0 -39
- package/dist/tools/package/search.js.map +0 -1
- package/dist/tools/package/status.d.ts +0 -21
- package/dist/tools/package/status.js +0 -37
- package/dist/tools/package/status.js.map +0 -1
- package/dist/tools/tools/describe.d.ts +0 -27
- package/dist/tools/tools/describe.js +0 -35
- package/dist/tools/tools/describe.js.map +0 -1
- package/dist/tools/tools/group-list.d.ts +0 -16
- package/dist/tools/tools/group-list.js +0 -38
- package/dist/tools/tools/group-list.js.map +0 -1
- package/dist/tools/tools/group.d.ts +0 -13
- package/dist/tools/tools/group.js +0 -34
- package/dist/tools/tools/group.js.map +0 -1
- package/dist/tools/tools/pagination.d.ts +0 -17
- package/dist/tools/tools/pagination.js +0 -28
- package/dist/tools/tools/pagination.js.map +0 -1
- package/dist/tools/tools/search.d.ts +0 -15
- package/dist/tools/tools/search.js +0 -42
- package/dist/tools/tools/search.js.map +0 -1
- package/unitypkg/Editor/Tools/diagnose/preflight.cs +0 -269
- package/unitypkg/Editor/Tools/editor/console.cs +0 -26
- package/unitypkg/Editor/Tools/extension/status.cs +0 -87
- package/unitypkg/Editor/Tools/go/inspect.cs +0 -49
- package/unitypkg/Editor/Tools/graphics/pipeline-quality.cs +0 -24
- package/unitypkg/Editor/Tools/graphics/probe-positions.cs +0 -58
- package/unitypkg/Editor/Tools/graphics/settings.cs +0 -104
- package/unitypkg/Editor/Tools/graphics/stats-counters.cs +0 -28
- package/unitypkg/Editor/Tools/graphics/stats-memory.cs +0 -21
- package/unitypkg/Editor/Tools/instances/list.cs +0 -71
- package/unitypkg/Editor/Tools/physics/raycast-all.cs +0 -67
- package/unitypkg/Editor/Tools/scene/build-settings.cs +0 -69
- package/unitypkg/Editor/Tools/scene/data.cs +0 -125
- package/unitypkg/Editor/Tools/tests/list.cs +0 -98
|
@@ -20,7 +20,7 @@ namespace UnityCli
|
|
|
20
20
|
UnityCliMainThreadAwaitable<bool> UntilStable(Func<bool> predicate, TimeSpan timeout, int minimumFrames = 2, TimeSpan minimumDuration = default, CancellationToken ct = default);
|
|
21
21
|
UnityCliMainThreadAwaitable<bool> UntilEditorReady(TimeSpan timeout, CancellationToken ct = default);
|
|
22
22
|
UnityCliMainThreadAwaitable<bool> UntilPlayModeState(PlayModeStateChange state, TimeSpan timeout, CancellationToken ct = default);
|
|
23
|
-
UnityCliMainThreadAwaitable<T> ForCallback<T>(Action<
|
|
23
|
+
UnityCliMainThreadAwaitable<T> ForCallback<T>(Action<Func<Func<T>, bool>, Func<Exception, bool>> start, TimeSpan timeout, CancellationToken ct = default, Action onAbandoned = null);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
internal interface IMainThreadAwaitableSource<out T>
|
|
@@ -60,6 +60,78 @@ namespace UnityCli
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
+
/// <summary>callback 结果工厂必须先赢得一次性 terminal ownership;迟到 callback 不能执行 publication。</summary>
|
|
64
|
+
internal sealed class UnityCliCallbackPublication<T>
|
|
65
|
+
{
|
|
66
|
+
private readonly object sync = new object();
|
|
67
|
+
private bool terminal;
|
|
68
|
+
private bool completed;
|
|
69
|
+
private bool failed;
|
|
70
|
+
private T result;
|
|
71
|
+
private Exception exception;
|
|
72
|
+
|
|
73
|
+
internal bool TryComplete(Func<T> createResult, Func<bool> unavailable = null)
|
|
74
|
+
{
|
|
75
|
+
lock (sync)
|
|
76
|
+
{
|
|
77
|
+
if (terminal || unavailable != null && unavailable())
|
|
78
|
+
{
|
|
79
|
+
terminal = true;
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
terminal = true;
|
|
83
|
+
try
|
|
84
|
+
{
|
|
85
|
+
result = createResult == null ? default : createResult();
|
|
86
|
+
completed = true;
|
|
87
|
+
}
|
|
88
|
+
catch (Exception error)
|
|
89
|
+
{
|
|
90
|
+
exception = error;
|
|
91
|
+
failed = true;
|
|
92
|
+
}
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
internal bool TryFail(Exception error, Func<bool> unavailable = null)
|
|
98
|
+
{
|
|
99
|
+
lock (sync)
|
|
100
|
+
{
|
|
101
|
+
if (terminal || unavailable != null && unavailable())
|
|
102
|
+
{
|
|
103
|
+
terminal = true;
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
terminal = true;
|
|
107
|
+
exception = error;
|
|
108
|
+
failed = true;
|
|
109
|
+
return true;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
internal bool TryAbandon()
|
|
114
|
+
{
|
|
115
|
+
lock (sync)
|
|
116
|
+
{
|
|
117
|
+
if (terminal) return false;
|
|
118
|
+
terminal = true;
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
internal void Read(out bool isCompleted, out bool isFailed, out T value, out Exception error)
|
|
124
|
+
{
|
|
125
|
+
lock (sync)
|
|
126
|
+
{
|
|
127
|
+
isCompleted = completed;
|
|
128
|
+
isFailed = failed;
|
|
129
|
+
value = result;
|
|
130
|
+
error = exception;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
63
135
|
internal sealed class UnityCliWaiter : IUnityCliWaiter
|
|
64
136
|
{
|
|
65
137
|
private readonly string requestId;
|
|
@@ -101,9 +173,9 @@ namespace UnityCli
|
|
|
101
173
|
return UnityCliWaitScheduler.UntilPlayModeState(requestId, owner, state, timeout, ct);
|
|
102
174
|
}
|
|
103
175
|
|
|
104
|
-
public UnityCliMainThreadAwaitable<T> ForCallback<T>(Action<
|
|
176
|
+
public UnityCliMainThreadAwaitable<T> ForCallback<T>(Action<Func<Func<T>, bool>, Func<Exception, bool>> start, TimeSpan timeout, CancellationToken ct = default, Action onAbandoned = null)
|
|
105
177
|
{
|
|
106
|
-
return UnityCliWaitScheduler.ForCallback(requestId, owner, start, timeout, ct);
|
|
178
|
+
return UnityCliWaitScheduler.ForCallback(requestId, owner, start, timeout, ct, onAbandoned);
|
|
107
179
|
}
|
|
108
180
|
}
|
|
109
181
|
|
|
@@ -224,7 +296,7 @@ namespace UnityCli
|
|
|
224
296
|
}
|
|
225
297
|
}
|
|
226
298
|
|
|
227
|
-
public void Cancel(Exception exception)
|
|
299
|
+
public virtual void Cancel(Exception exception)
|
|
228
300
|
{
|
|
229
301
|
if (IsCompleted) return;
|
|
230
302
|
Fail(exception);
|
|
@@ -392,35 +464,38 @@ namespace UnityCli
|
|
|
392
464
|
|
|
393
465
|
private sealed class CallbackWait<T> : PendingWaitBase<T>
|
|
394
466
|
{
|
|
395
|
-
private readonly object callbackLock = new object();
|
|
396
467
|
private readonly DateTime deadlineUtc;
|
|
397
|
-
private
|
|
398
|
-
private
|
|
399
|
-
private
|
|
400
|
-
private T callbackResult;
|
|
401
|
-
private Exception callbackException;
|
|
468
|
+
private readonly CancellationToken callbackCancellationToken;
|
|
469
|
+
private readonly UnityCliCallbackPublication<T> publication = new UnityCliCallbackPublication<T>();
|
|
470
|
+
private readonly Action onAbandoned;
|
|
402
471
|
|
|
403
|
-
public CallbackWait(string requestId, string owner, Action<
|
|
472
|
+
public CallbackWait(string requestId, string owner, Action<Func<Func<T>, bool>, Func<Exception, bool>> start, TimeSpan timeout, CancellationToken cancellationToken, Action onAbandoned)
|
|
404
473
|
: base(requestId, owner, cancellationToken)
|
|
405
474
|
{
|
|
475
|
+
this.onAbandoned = onAbandoned;
|
|
476
|
+
callbackCancellationToken = cancellationToken;
|
|
406
477
|
deadlineUtc = DateTime.UtcNow.Add(timeout < TimeSpan.Zero ? TimeSpan.Zero : timeout);
|
|
407
478
|
start?.Invoke(OnComplete, OnFail);
|
|
408
479
|
}
|
|
409
480
|
|
|
410
481
|
protected override bool Advance(DateTime utcNow)
|
|
411
482
|
{
|
|
483
|
+
if (utcNow >= deadlineUtc && publication.TryAbandon())
|
|
484
|
+
{
|
|
485
|
+
NotifyAbandoned();
|
|
486
|
+
return Fail(new UnityCliBridge.BridgeCommandException(
|
|
487
|
+
"E_EXECUTION_TIMEOUT",
|
|
488
|
+
"Callback wait timed out.",
|
|
489
|
+
"Retry or reduce scope.",
|
|
490
|
+
transient: false,
|
|
491
|
+
retryAfterMs: 0));
|
|
492
|
+
}
|
|
493
|
+
|
|
412
494
|
bool completed;
|
|
413
495
|
bool failed;
|
|
414
496
|
T result;
|
|
415
497
|
Exception exception;
|
|
416
|
-
|
|
417
|
-
{
|
|
418
|
-
completed = callbackCompleted;
|
|
419
|
-
failed = callbackFailed;
|
|
420
|
-
result = callbackResult;
|
|
421
|
-
exception = callbackException;
|
|
422
|
-
if (!completed && !failed && utcNow >= deadlineUtc) callbackTerminal = true;
|
|
423
|
-
}
|
|
498
|
+
publication.Read(out completed, out failed, out result, out exception);
|
|
424
499
|
if (failed) return Fail(exception ?? new Exception("Callback wait failed."));
|
|
425
500
|
if (completed) return Succeed(result);
|
|
426
501
|
if (utcNow >= deadlineUtc)
|
|
@@ -435,26 +510,44 @@ namespace UnityCli
|
|
|
435
510
|
return false;
|
|
436
511
|
}
|
|
437
512
|
|
|
438
|
-
|
|
513
|
+
public override void Cancel(Exception exception)
|
|
439
514
|
{
|
|
440
|
-
|
|
515
|
+
if (publication.TryAbandon())
|
|
441
516
|
{
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
callbackCompleted = true;
|
|
517
|
+
NotifyAbandoned();
|
|
518
|
+
base.Cancel(exception);
|
|
519
|
+
return;
|
|
446
520
|
}
|
|
521
|
+
|
|
522
|
+
bool completed;
|
|
523
|
+
bool failed;
|
|
524
|
+
T result;
|
|
525
|
+
Exception callbackError;
|
|
526
|
+
publication.Read(out completed, out failed, out result, out callbackError);
|
|
527
|
+
if (completed) { Succeed(result); return; }
|
|
528
|
+
if (failed) { Fail(callbackError ?? exception); return; }
|
|
529
|
+
base.Cancel(exception);
|
|
447
530
|
}
|
|
448
531
|
|
|
449
|
-
private void
|
|
532
|
+
private void NotifyAbandoned()
|
|
450
533
|
{
|
|
451
|
-
|
|
452
|
-
{
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
534
|
+
try { onAbandoned?.Invoke(); }
|
|
535
|
+
catch { /* abandonment cleanup must not replace the scheduler terminal */ }
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
private bool OnComplete(Func<T> createResult)
|
|
539
|
+
{
|
|
540
|
+
return publication.TryComplete(createResult, CallbackUnavailable);
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
private bool OnFail(Exception exception)
|
|
544
|
+
{
|
|
545
|
+
return publication.TryFail(exception, CallbackUnavailable);
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
private bool CallbackUnavailable()
|
|
549
|
+
{
|
|
550
|
+
return IsCompleted || callbackCancellationToken.IsCancellationRequested || DateTime.UtcNow >= deadlineUtc;
|
|
458
551
|
}
|
|
459
552
|
}
|
|
460
553
|
|
|
@@ -521,9 +614,9 @@ namespace UnityCli
|
|
|
521
614
|
}
|
|
522
615
|
}
|
|
523
616
|
|
|
524
|
-
public static UnityCliMainThreadAwaitable<T> ForCallback<T>(string requestId, string owner, Action<
|
|
617
|
+
public static UnityCliMainThreadAwaitable<T> ForCallback<T>(string requestId, string owner, Action<Func<Func<T>, bool>, Func<Exception, bool>> start, TimeSpan timeout, CancellationToken cancellationToken, Action onAbandoned = null)
|
|
525
618
|
{
|
|
526
|
-
var wait = new CallbackWait<T>(requestId, owner, start, timeout, cancellationToken);
|
|
619
|
+
var wait = new CallbackWait<T>(requestId, owner, start, timeout, cancellationToken, onAbandoned);
|
|
527
620
|
Register(wait);
|
|
528
621
|
return new UnityCliMainThreadAwaitable<T>(wait);
|
|
529
622
|
}
|
|
@@ -6,6 +6,14 @@ using System.Threading.Tasks;
|
|
|
6
6
|
|
|
7
7
|
namespace UnityCli
|
|
8
8
|
{
|
|
9
|
+
/// <summary>Extension asmdef 的编译期 owner claim;runtime 仍需与 generated exact inventory 全集一致。</summary>
|
|
10
|
+
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]
|
|
11
|
+
public sealed class UnityCliExtensionAssemblyAttribute : Attribute
|
|
12
|
+
{
|
|
13
|
+
public UnityCliExtensionAssemblyAttribute(string extensionId) { ExtensionId = extensionId; }
|
|
14
|
+
public string ExtensionId { get; private set; }
|
|
15
|
+
}
|
|
16
|
+
|
|
9
17
|
/// <summary>
|
|
10
18
|
/// 工具统一为语言原生异步接口。实现本接口即声明一个工具。
|
|
11
19
|
/// desc 只声明人写字段;schema 由框架从 TReq/TRes 派生。
|
|
@@ -91,7 +99,6 @@ namespace UnityCli
|
|
|
91
99
|
public string[] Permissions { get; set; }
|
|
92
100
|
public string[] RequiresPackages { get; set; }
|
|
93
101
|
public ToolExample[] Examples { get; set; }
|
|
94
|
-
public string Fingerprint { get; set; }
|
|
95
102
|
public ToolCompletionDescriptor Completion { get; set; }
|
|
96
103
|
}
|
|
97
104
|
|
|
@@ -148,5 +155,6 @@ namespace UnityCli
|
|
|
148
155
|
public UnityCliStringEnumAttribute(params string[] values) { Values = values ?? Array.Empty<string>(); }
|
|
149
156
|
public string[] Values { get; private set; }
|
|
150
157
|
}
|
|
158
|
+
|
|
151
159
|
}
|
|
152
160
|
#endif
|
|
@@ -95,7 +95,7 @@ namespace UnityCli
|
|
|
95
95
|
/// 扫描一个类型声明的官方 attributed static method。所有候选都先写入 pending registry;
|
|
96
96
|
/// 任一签名、schema、ownership 或名称冲突都会阻止本轮目录发布。
|
|
97
97
|
/// </summary>
|
|
98
|
-
private static void TryRegisterOfficialAttributeTools(Assembly assembly, Type type)
|
|
98
|
+
private static void TryRegisterOfficialAttributeTools(UnityCliToolCatalogBuilder builder, RegistryOwnershipResolver ownershipResolver, Assembly assembly, Type type)
|
|
99
99
|
{
|
|
100
100
|
var methods = type.GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance | BindingFlags.DeclaredOnly)
|
|
101
101
|
.Where(method => FindAttribute(method, OfficialCliCommandAttribute) != null)
|
|
@@ -111,9 +111,8 @@ namespace UnityCli
|
|
|
111
111
|
|
|
112
112
|
foreach (var method in methods)
|
|
113
113
|
{
|
|
114
|
-
var definition = CreateOfficialAttributeTool(
|
|
115
|
-
RegisterProjectTool(definition);
|
|
116
|
-
WriteLog("custom_tool_registered name=" + definition.Name + " source=official-attribute type=" + type.FullName + " method=" + method.Name);
|
|
114
|
+
var definition = CreateOfficialAttributeTool(ownershipResolver, type, method);
|
|
115
|
+
RegisterProjectTool(builder, definition, UnityCliToolProviderKind.OfficialAttribute);
|
|
117
116
|
}
|
|
118
117
|
}
|
|
119
118
|
|
|
@@ -139,9 +138,10 @@ namespace UnityCli
|
|
|
139
138
|
return suppressed;
|
|
140
139
|
}
|
|
141
140
|
|
|
142
|
-
/// <summary
|
|
143
|
-
private static
|
|
141
|
+
/// <summary>签名和返回形态只读取编译元数据;任一不支持形态在pending publish前失败。</summary>
|
|
142
|
+
private static void ValidateOfficialMethodSignature(MethodInfo method)
|
|
144
143
|
{
|
|
144
|
+
if (method == null) throw new ArgumentNullException("method");
|
|
145
145
|
if (!method.IsStatic) throw new InvalidOperationException("Official CLI command method must be static: " + MethodIdentity(method) + ".");
|
|
146
146
|
if (method.IsGenericMethodDefinition || method.ContainsGenericParameters)
|
|
147
147
|
throw new InvalidOperationException("Official CLI command method cannot be generic: " + MethodIdentity(method) + ".");
|
|
@@ -149,13 +149,18 @@ namespace UnityCli
|
|
|
149
149
|
throw new InvalidOperationException("Official CLI command return type is unsupported: " + MethodIdentity(method) + ".");
|
|
150
150
|
if (method.ReturnType == typeof(void) && method.IsDefined(typeof(AsyncStateMachineAttribute), false))
|
|
151
151
|
throw new InvalidOperationException("Official CLI command cannot use async void: " + MethodIdentity(method) + ".");
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/// <summary>从 CustomAttributeData 构造保守 descriptor、严格输入 schema 与方法返回完成契约。</summary>
|
|
155
|
+
private static RegisteredTool CreateOfficialAttributeTool(RegistryOwnershipResolver ownershipResolver, Type implementationType, MethodInfo method)
|
|
156
|
+
{
|
|
157
|
+
ValidateOfficialMethodSignature(method);
|
|
152
158
|
|
|
153
159
|
var command = FindAttribute(method, OfficialCliCommandAttribute);
|
|
154
160
|
var name = ConstructorString(command, 0, "name", method);
|
|
155
161
|
var description = ConstructorString(command, 1, "description", method);
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
var toolName = OfficialAttributeToolPrefix + name;
|
|
162
|
+
var toolName = OfficialAttributeToolPrefix + (name ?? string.Empty);
|
|
163
|
+
UnityCliToolName.Validate(toolName, "official-attribute");
|
|
159
164
|
if (string.IsNullOrWhiteSpace(description))
|
|
160
165
|
throw new InvalidOperationException("Official CLI command description is required: " + MethodIdentity(method) + ".");
|
|
161
166
|
|
|
@@ -179,8 +184,8 @@ namespace UnityCli
|
|
|
179
184
|
NormalizeResultWithNewtonsoft = output.NormalizeWithNewtonsoft,
|
|
180
185
|
Parameters = parameters
|
|
181
186
|
};
|
|
182
|
-
var ownership =
|
|
183
|
-
if (!string.Equals(ownership, "project", StringComparison.Ordinal))
|
|
187
|
+
var ownership = ownershipResolver.Resolve(implementationType, toolName);
|
|
188
|
+
if (!string.Equals(ownership.Source, "project", StringComparison.Ordinal))
|
|
184
189
|
throw new InvalidOperationException("Official attribute Tool ownership must resolve to project or third-party code: " + MethodIdentity(method) + ".");
|
|
185
190
|
|
|
186
191
|
var completion = new UnityCliToolCompletionContract(
|
|
@@ -197,16 +202,12 @@ namespace UnityCli
|
|
|
197
202
|
"required",
|
|
198
203
|
true);
|
|
199
204
|
|
|
200
|
-
|
|
205
|
+
var descriptor = new ToolDescriptor
|
|
201
206
|
{
|
|
202
207
|
Name = toolName,
|
|
203
208
|
Summary = OfficialSummary(description),
|
|
204
209
|
Description = description + " Imported from Unity.Pipeline.Commands.CliCommandAttribute. Risk, PlayMode, dry-run and completion semantics use the conservative official-attribute contract. Schema defaults and examples describe valid default behavior, not caller intent; use caller-requested business values on the first execution.",
|
|
205
210
|
Group = OfficialAttributeToolGroup,
|
|
206
|
-
Source = "project",
|
|
207
|
-
Ownership = "project",
|
|
208
|
-
InputSchema = UnityCliSerializer.Serialize(inputSchema),
|
|
209
|
-
OutputSchema = output.Schema,
|
|
210
211
|
DestructiveHint = true,
|
|
211
212
|
SideEffects = new[] { "arbitrary-method-invocation" },
|
|
212
213
|
SupportsDryRun = false,
|
|
@@ -221,22 +222,22 @@ namespace UnityCli
|
|
|
221
222
|
}
|
|
222
223
|
},
|
|
223
224
|
Target = "editor",
|
|
224
|
-
AvailabilityScope = runtimeOnly ? "playModeSession" : "editorSession",
|
|
225
225
|
PlayModeSupport = playModeSupport,
|
|
226
|
-
ContractProfile = "official-attribute",
|
|
227
226
|
DefaultTimeoutMs = 30000,
|
|
228
|
-
MaxTimeoutMs = 600000
|
|
229
|
-
RequiredInput = parameters.Where(parameter => parameter.Required).Select(parameter => parameter.Name).ToArray(),
|
|
230
|
-
RegisteredBy = "official-pipeline-attribute",
|
|
231
|
-
DescriptorSource = OfficialCliCommandAttribute,
|
|
232
|
-
Assembly = assembly.GetName().Name,
|
|
233
|
-
Method = MethodIdentity(method),
|
|
234
|
-
RequestType = typeof(Dictionary<string, object>),
|
|
235
|
-
ResultType = output.ValidationType,
|
|
236
|
-
CompletionContract = completion,
|
|
237
|
-
OfficialAttributeBinding = binding,
|
|
238
|
-
InvokeAsync = (request, context, cancellationToken) => InvokeOfficialAttributeTool(binding, request, context, cancellationToken)
|
|
227
|
+
MaxTimeoutMs = 600000
|
|
239
228
|
};
|
|
229
|
+
return new RegisteredTool(
|
|
230
|
+
descriptor,
|
|
231
|
+
ownership,
|
|
232
|
+
UnityCliSerializer.Serialize(inputSchema),
|
|
233
|
+
output.Schema,
|
|
234
|
+
runtimeOnly ? "playModeSession" : "editorSession",
|
|
235
|
+
"official-attribute",
|
|
236
|
+
typeof(Dictionary<string, object>),
|
|
237
|
+
output.ValidationType,
|
|
238
|
+
completion,
|
|
239
|
+
binding,
|
|
240
|
+
(request, context, cancellationToken) => InvokeOfficialAttributeTool(binding, request, context, cancellationToken));
|
|
240
241
|
}
|
|
241
242
|
|
|
242
243
|
/// <summary>解析参数 attribute,严格验证签名和默认值可转换性。</summary>
|
|
@@ -631,8 +632,8 @@ namespace UnityCli
|
|
|
631
632
|
: Failure(path, "single-character string", ActualType(value));
|
|
632
633
|
}
|
|
633
634
|
if (type == typeof(bool)) return value is bool ? null : Failure(path, "boolean", ActualType(value));
|
|
634
|
-
if (UnityCliSchemaDeriver.IsInteger(type)) return ValidateInteger(value, type, path);
|
|
635
|
-
if (UnityCliSchemaDeriver.IsNumber(type)) return ValidateNumber(value, type, path);
|
|
635
|
+
if (UnityCliSchemaDeriver.IsInteger(type)) return ValidateInteger(value, type, path, null);
|
|
636
|
+
if (UnityCliSchemaDeriver.IsNumber(type)) return ValidateNumber(value, type, path, null);
|
|
636
637
|
if (type.IsEnum)
|
|
637
638
|
{
|
|
638
639
|
var enumName = value as string;
|