@alpsckr/unitycli 0.4.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/README.md +389 -0
- package/contracts/command-contract.json +3972 -0
- package/contracts/stable-session/admission-acquire-v1.schema.json +16 -0
- package/contracts/stable-session/admission-response-v1.schema.json +30 -0
- package/contracts/stable-session/admission-revoke-v1.schema.json +15 -0
- package/contracts/stable-session/admission-transport-v1.json +36 -0
- package/contracts/stable-session/bridge-request-v2.schema.json +26 -0
- package/contracts/stable-session/canonical-path-v1-golden.json +23 -0
- package/contracts/stable-session/completion-contract.schema.json +46 -0
- package/contracts/stable-session/direct-call-semantics.json +102 -0
- package/contracts/stable-session/editor-state.schema.json +92 -0
- package/contracts/stable-session/health-v3.schema.json +47 -0
- package/contracts/stable-session/instance-registry-v3.schema.json +152 -0
- package/contracts/stable-session/removal-map.json +27 -0
- package/contracts/stable-session/request-digest-v1-golden.json +7 -0
- package/contracts/stable-session/runtime-config-v2.schema.json +27 -0
- package/contracts/static-capability-catalog.json +48226 -0
- package/contracts/tool-completion-contract.json +11322 -0
- package/dist/args.d.ts +27 -0
- package/dist/args.js +109 -0
- package/dist/args.js.map +1 -0
- package/dist/bridge/admission.d.ts +28 -0
- package/dist/bridge/admission.js +29 -0
- package/dist/bridge/admission.js.map +1 -0
- package/dist/bridge/args.d.ts +16 -0
- package/dist/bridge/args.js +123 -0
- package/dist/bridge/args.js.map +1 -0
- package/dist/bridge/domains/animation.d.ts +2 -0
- package/dist/bridge/domains/animation.js +199 -0
- package/dist/bridge/domains/animation.js.map +1 -0
- package/dist/bridge/domains/asset.d.ts +2 -0
- package/dist/bridge/domains/asset.js +85 -0
- package/dist/bridge/domains/asset.js.map +1 -0
- package/dist/bridge/domains/build.d.ts +2 -0
- package/dist/bridge/domains/build.js +35 -0
- package/dist/bridge/domains/build.js.map +1 -0
- package/dist/bridge/domains/camera.d.ts +2 -0
- package/dist/bridge/domains/camera.js +54 -0
- package/dist/bridge/domains/camera.js.map +1 -0
- package/dist/bridge/domains/code.d.ts +2 -0
- package/dist/bridge/domains/code.js +17 -0
- package/dist/bridge/domains/code.js.map +1 -0
- package/dist/bridge/domains/console.d.ts +2 -0
- package/dist/bridge/domains/console.js +34 -0
- package/dist/bridge/domains/console.js.map +1 -0
- package/dist/bridge/domains/diagnose.d.ts +2 -0
- package/dist/bridge/domains/diagnose.js +11 -0
- package/dist/bridge/domains/diagnose.js.map +1 -0
- package/dist/bridge/domains/editor.d.ts +2 -0
- package/dist/bridge/domains/editor.js +66 -0
- package/dist/bridge/domains/editor.js.map +1 -0
- package/dist/bridge/domains/extension.d.ts +8 -0
- package/dist/bridge/domains/extension.js +20 -0
- package/dist/bridge/domains/extension.js.map +1 -0
- package/dist/bridge/domains/game-object.d.ts +2 -0
- package/dist/bridge/domains/game-object.js +179 -0
- package/dist/bridge/domains/game-object.js.map +1 -0
- package/dist/bridge/domains/graphics.d.ts +2 -0
- package/dist/bridge/domains/graphics.js +185 -0
- package/dist/bridge/domains/graphics.js.map +1 -0
- package/dist/bridge/domains/material.d.ts +2 -0
- package/dist/bridge/domains/material.js +70 -0
- package/dist/bridge/domains/material.js.map +1 -0
- package/dist/bridge/domains/navmesh.d.ts +2 -0
- package/dist/bridge/domains/navmesh.js +34 -0
- package/dist/bridge/domains/navmesh.js.map +1 -0
- package/dist/bridge/domains/object.d.ts +2 -0
- package/dist/bridge/domains/object.js +43 -0
- package/dist/bridge/domains/object.js.map +1 -0
- package/dist/bridge/domains/occlusion.d.ts +2 -0
- package/dist/bridge/domains/occlusion.js +12 -0
- package/dist/bridge/domains/occlusion.js.map +1 -0
- package/dist/bridge/domains/package.d.ts +2 -0
- package/dist/bridge/domains/package.js +2 -0
- package/dist/bridge/domains/package.js.map +1 -0
- package/dist/bridge/domains/physics.d.ts +2 -0
- package/dist/bridge/domains/physics.js +139 -0
- package/dist/bridge/domains/physics.js.map +1 -0
- package/dist/bridge/domains/prefab.d.ts +2 -0
- package/dist/bridge/domains/prefab.js +104 -0
- package/dist/bridge/domains/prefab.js.map +1 -0
- package/dist/bridge/domains/profiler.d.ts +2 -0
- package/dist/bridge/domains/profiler.js +105 -0
- package/dist/bridge/domains/profiler.js.map +1 -0
- package/dist/bridge/domains/project-tool.d.ts +2 -0
- package/dist/bridge/domains/project-tool.js +46 -0
- package/dist/bridge/domains/project-tool.js.map +1 -0
- package/dist/bridge/domains/reflection.d.ts +2 -0
- package/dist/bridge/domains/reflection.js +48 -0
- package/dist/bridge/domains/reflection.js.map +1 -0
- package/dist/bridge/domains/runtime-tool.d.ts +2 -0
- package/dist/bridge/domains/runtime-tool.js +48 -0
- package/dist/bridge/domains/runtime-tool.js.map +1 -0
- package/dist/bridge/domains/scene.d.ts +2 -0
- package/dist/bridge/domains/scene.js +100 -0
- package/dist/bridge/domains/scene.js.map +1 -0
- package/dist/bridge/domains/screenshot.d.ts +2 -0
- package/dist/bridge/domains/screenshot.js +85 -0
- package/dist/bridge/domains/screenshot.js.map +1 -0
- package/dist/bridge/domains/scriptable-object.d.ts +2 -0
- package/dist/bridge/domains/scriptable-object.js +53 -0
- package/dist/bridge/domains/scriptable-object.js.map +1 -0
- package/dist/bridge/domains/shader.d.ts +2 -0
- package/dist/bridge/domains/shader.js +66 -0
- package/dist/bridge/domains/shader.js.map +1 -0
- package/dist/bridge/domains/texture.d.ts +2 -0
- package/dist/bridge/domains/texture.js +78 -0
- package/dist/bridge/domains/texture.js.map +1 -0
- package/dist/bridge/domains/timeline.d.ts +2 -0
- package/dist/bridge/domains/timeline.js +75 -0
- package/dist/bridge/domains/timeline.js.map +1 -0
- package/dist/bridge/domains/ui.d.ts +2 -0
- package/dist/bridge/domains/ui.js +193 -0
- package/dist/bridge/domains/ui.js.map +1 -0
- package/dist/bridge/index.d.ts +9 -0
- package/dist/bridge/index.js +124 -0
- package/dist/bridge/index.js.map +1 -0
- package/dist/bridge/registry.d.ts +19 -0
- package/dist/bridge/registry.js +114 -0
- package/dist/bridge/registry.js.map +1 -0
- package/dist/bridge/session-supervisor.d.ts +138 -0
- package/dist/bridge/session-supervisor.js +873 -0
- package/dist/bridge/session-supervisor.js.map +1 -0
- package/dist/bridge/types.d.ts +61 -0
- package/dist/bridge/types.js +17 -0
- package/dist/bridge/types.js.map +1 -0
- package/dist/capabilities.d.ts +5 -0
- package/dist/capabilities.js +84 -0
- package/dist/capabilities.js.map +1 -0
- package/dist/cli-commands/command.d.ts +7 -0
- package/dist/cli-commands/command.js +513 -0
- package/dist/cli-commands/command.js.map +1 -0
- package/dist/cli-commands/extension-auto-detect.d.ts +62 -0
- package/dist/cli-commands/extension-auto-detect.js +119 -0
- package/dist/cli-commands/extension-auto-detect.js.map +1 -0
- package/dist/cli-commands/extensions.d.ts +24 -0
- package/dist/cli-commands/extensions.js +428 -0
- package/dist/cli-commands/extensions.js.map +1 -0
- package/dist/cli-commands/package.d.ts +4 -0
- package/dist/cli-commands/package.js +151 -0
- package/dist/cli-commands/package.js.map +1 -0
- package/dist/cli-commands/skill-installer.d.ts +83 -0
- package/dist/cli-commands/skill-installer.js +703 -0
- package/dist/cli-commands/skill-installer.js.map +1 -0
- package/dist/cli-commands/types.d.ts +17 -0
- package/dist/cli-commands/types.js +2 -0
- package/dist/cli-commands/types.js.map +1 -0
- package/dist/cli.d.ts +17 -0
- package/dist/cli.js +302 -0
- package/dist/cli.js.map +1 -0
- package/dist/contracts/command-contract.d.ts +21 -0
- package/dist/contracts/command-contract.js +143 -0
- package/dist/contracts/command-contract.js.map +1 -0
- package/dist/contracts/csharp-command-extractor.d.ts +1 -0
- package/dist/contracts/csharp-command-extractor.js +89 -0
- package/dist/contracts/csharp-command-extractor.js.map +1 -0
- package/dist/contracts/validate-command-contract.d.ts +1 -0
- package/dist/contracts/validate-command-contract.js +86 -0
- package/dist/contracts/validate-command-contract.js.map +1 -0
- package/dist/doctor.d.ts +22 -0
- package/dist/doctor.js +498 -0
- package/dist/doctor.js.map +1 -0
- package/dist/editor-blocker-observer.d.ts +45 -0
- package/dist/editor-blocker-observer.js +55 -0
- package/dist/editor-blocker-observer.js.map +1 -0
- package/dist/editor-dialogs.d.ts +53 -0
- package/dist/editor-dialogs.js +79 -0
- package/dist/editor-dialogs.js.map +1 -0
- package/dist/extension-availability.d.ts +30 -0
- package/dist/extension-availability.js +83 -0
- package/dist/extension-availability.js.map +1 -0
- package/dist/extensions/.generated-bridge-domains/cinemachine.d.ts +2 -0
- package/dist/extensions/.generated-bridge-domains/cinemachine.js +104 -0
- package/dist/extensions/.generated-bridge-domains/cinemachine.js.map +1 -0
- package/dist/extensions/.generated-bridge-domains/hdrp.d.ts +2 -0
- package/dist/extensions/.generated-bridge-domains/hdrp.js +35 -0
- package/dist/extensions/.generated-bridge-domains/hdrp.js.map +1 -0
- package/dist/extensions/.generated-bridge-domains/probuilder.d.ts +13 -0
- package/dist/extensions/.generated-bridge-domains/probuilder.js +342 -0
- package/dist/extensions/.generated-bridge-domains/probuilder.js.map +1 -0
- package/dist/extensions/.generated-bridge-domains/urp.d.ts +2 -0
- package/dist/extensions/.generated-bridge-domains/urp.js +52 -0
- package/dist/extensions/.generated-bridge-domains/urp.js.map +1 -0
- package/dist/extensions/.generated-bridge-domains/vfx.d.ts +2 -0
- package/dist/extensions/.generated-bridge-domains/vfx.js +312 -0
- package/dist/extensions/.generated-bridge-domains/vfx.js.map +1 -0
- package/dist/extensions/.generated-registry-data.d.ts +7 -0
- package/dist/extensions/.generated-registry-data.js +895 -0
- package/dist/extensions/.generated-registry-data.js.map +1 -0
- package/dist/extensions/contribution-loader.d.ts +27 -0
- package/dist/extensions/contribution-loader.js +60 -0
- package/dist/extensions/contribution-loader.js.map +1 -0
- package/dist/extensions/descriptor-loader.d.ts +73 -0
- package/dist/extensions/descriptor-loader.js +126 -0
- package/dist/extensions/descriptor-loader.js.map +1 -0
- package/dist/extensions/index.d.ts +19 -0
- package/dist/extensions/index.js +23 -0
- package/dist/extensions/index.js.map +1 -0
- package/dist/extensions/installer.d.ts +80 -0
- package/dist/extensions/installer.js +594 -0
- package/dist/extensions/installer.js.map +1 -0
- package/dist/extensions/metadata/index.d.ts +15 -0
- package/dist/extensions/metadata/index.js +41 -0
- package/dist/extensions/metadata/index.js.map +1 -0
- package/dist/extensions/metadata/types.d.ts +38 -0
- package/dist/extensions/metadata/types.js +11 -0
- package/dist/extensions/metadata/types.js.map +1 -0
- package/dist/extensions/project-resolver.d.ts +35 -0
- package/dist/extensions/project-resolver.js +61 -0
- package/dist/extensions/project-resolver.js.map +1 -0
- package/dist/extensions/registry.d.ts +86 -0
- package/dist/extensions/registry.js +262 -0
- package/dist/extensions/registry.js.map +1 -0
- package/dist/extensions/tool-manifest.d.ts +29 -0
- package/dist/extensions/tool-manifest.js +53 -0
- package/dist/extensions/tool-manifest.js.map +1 -0
- package/dist/extensions/types.d.ts +115 -0
- package/dist/extensions/types.js +12 -0
- package/dist/extensions/types.js.map +1 -0
- package/dist/instances.d.ts +163 -0
- package/dist/instances.js +1137 -0
- package/dist/instances.js.map +1 -0
- package/dist/output.d.ts +119 -0
- package/dist/output.js +204 -0
- package/dist/output.js.map +1 -0
- package/dist/package-manager.d.ts +280 -0
- package/dist/package-manager.js +1832 -0
- package/dist/package-manager.js.map +1 -0
- package/dist/platform.d.ts +3 -0
- package/dist/platform.js +19 -0
- package/dist/platform.js.map +1 -0
- package/dist/project-identity.d.ts +48 -0
- package/dist/project-identity.js +254 -0
- package/dist/project-identity.js.map +1 -0
- package/dist/project-tool-discovery.d.ts +23 -0
- package/dist/project-tool-discovery.js +292 -0
- package/dist/project-tool-discovery.js.map +1 -0
- package/dist/protocol/envelope.d.ts +64 -0
- package/dist/protocol/envelope.js +8 -0
- package/dist/protocol/envelope.js.map +1 -0
- package/dist/protocol/index.d.ts +7 -0
- package/dist/protocol/index.js +2 -0
- package/dist/protocol/index.js.map +1 -0
- package/dist/runtime-code.d.ts +20 -0
- package/dist/runtime-code.js +232 -0
- package/dist/runtime-code.js.map +1 -0
- package/dist/schema/any-json.d.ts +4 -0
- package/dist/schema/any-json.js +2 -0
- package/dist/schema/any-json.js.map +1 -0
- package/dist/schema/validator.d.ts +7 -0
- package/dist/schema/validator.js +135 -0
- package/dist/schema/validator.js.map +1 -0
- package/dist/services/docs-reflect-cache.d.ts +106 -0
- package/dist/services/docs-reflect-cache.js +301 -0
- package/dist/services/docs-reflect-cache.js.map +1 -0
- package/dist/services/docs-service.d.ts +16 -0
- package/dist/services/docs-service.js +208 -0
- package/dist/services/docs-service.js.map +1 -0
- package/dist/services/reflect-service.d.ts +12 -0
- package/dist/services/reflect-service.js +122 -0
- package/dist/services/reflect-service.js.map +1 -0
- package/dist/static-capability-catalog.d.ts +13 -0
- package/dist/static-capability-catalog.js +41 -0
- package/dist/static-capability-catalog.js.map +1 -0
- package/dist/test-results.d.ts +13 -0
- package/dist/test-results.js +44 -0
- package/dist/test-results.js.map +1 -0
- package/dist/tools/.generated-completion-registry.d.ts +17 -0
- package/dist/tools/.generated-completion-registry.js +5862 -0
- package/dist/tools/.generated-completion-registry.js.map +1 -0
- package/dist/tools/.generated-registry.d.ts +53 -0
- package/dist/tools/.generated-registry.js +55 -0
- package/dist/tools/.generated-registry.js.map +1 -0
- package/dist/tools/.generated-schemas.d.ts +1 -0
- package/dist/tools/.generated-schemas.js +56 -0
- package/dist/tools/.generated-schemas.js.map +1 -0
- package/dist/tools/asset/refresh.d.ts +26 -0
- package/dist/tools/asset/refresh.js +97 -0
- package/dist/tools/asset/refresh.js.map +1 -0
- package/dist/tools/build/run.d.ts +45 -0
- package/dist/tools/build/run.js +115 -0
- package/dist/tools/build/run.js.map +1 -0
- package/dist/tools/catalog.d.ts +33 -0
- package/dist/tools/catalog.js +202 -0
- package/dist/tools/catalog.js.map +1 -0
- package/dist/tools/code/exec.d.ts +53 -0
- package/dist/tools/code/exec.js +59 -0
- package/dist/tools/code/exec.js.map +1 -0
- package/dist/tools/commands.d.ts +5 -0
- package/dist/tools/commands.js +45 -0
- package/dist/tools/commands.js.map +1 -0
- package/dist/tools/completion-probe.d.ts +22 -0
- package/dist/tools/completion-probe.js +2 -0
- package/dist/tools/completion-probe.js.map +1 -0
- package/dist/tools/define.d.ts +77 -0
- package/dist/tools/define.js +58 -0
- package/dist/tools/define.js.map +1 -0
- package/dist/tools/diagnose/capabilities.d.ts +13 -0
- package/dist/tools/diagnose/capabilities.js +34 -0
- package/dist/tools/diagnose/capabilities.js.map +1 -0
- package/dist/tools/dispatcher.d.ts +27 -0
- package/dist/tools/dispatcher.js +971 -0
- package/dist/tools/dispatcher.js.map +1 -0
- package/dist/tools/docs/get.d.ts +22 -0
- package/dist/tools/docs/get.js +22 -0
- package/dist/tools/docs/get.js.map +1 -0
- package/dist/tools/docs/search.d.ts +31 -0
- package/dist/tools/docs/search.js +22 -0
- package/dist/tools/docs/search.js.map +1 -0
- package/dist/tools/editor/compile.d.ts +66 -0
- package/dist/tools/editor/compile.js +225 -0
- package/dist/tools/editor/compile.js.map +1 -0
- package/dist/tools/editor/dialog/click.d.ts +12 -0
- package/dist/tools/editor/dialog/click.js +71 -0
- package/dist/tools/editor/dialog/click.js.map +1 -0
- package/dist/tools/editor/dialogs.d.ts +12 -0
- package/dist/tools/editor/dialogs.js +58 -0
- package/dist/tools/editor/dialogs.js.map +1 -0
- package/dist/tools/editor/readiness.d.ts +13 -0
- package/dist/tools/editor/readiness.js +24 -0
- package/dist/tools/editor/readiness.js.map +1 -0
- package/dist/tools/editor/refresh.d.ts +25 -0
- package/dist/tools/editor/refresh.js +154 -0
- package/dist/tools/editor/refresh.js.map +1 -0
- package/dist/tools/editor/state.d.ts +63 -0
- package/dist/tools/editor/state.js +286 -0
- package/dist/tools/editor/state.js.map +1 -0
- package/dist/tools/errors.d.ts +30 -0
- package/dist/tools/errors.js +46 -0
- package/dist/tools/errors.js.map +1 -0
- package/dist/tools/metadata/derived.d.ts +34 -0
- package/dist/tools/metadata/derived.js +136 -0
- package/dist/tools/metadata/derived.js.map +1 -0
- package/dist/tools/metadata/index.d.ts +34 -0
- package/dist/tools/metadata/index.js +130 -0
- package/dist/tools/metadata/index.js.map +1 -0
- package/dist/tools/metadata/schemas.d.ts +3 -0
- package/dist/tools/metadata/schemas.js +19 -0
- package/dist/tools/metadata/schemas.js.map +1 -0
- package/dist/tools/metadata/status.d.ts +4 -0
- package/dist/tools/metadata/status.js +61 -0
- package/dist/tools/metadata/status.js.map +1 -0
- package/dist/tools/metadata/types.d.ts +79 -0
- package/dist/tools/metadata/types.js +2 -0
- package/dist/tools/metadata/types.js.map +1 -0
- package/dist/tools/navmesh/bake-cancel.d.ts +7 -0
- package/dist/tools/navmesh/bake-cancel.js +21 -0
- package/dist/tools/navmesh/bake-cancel.js.map +1 -0
- package/dist/tools/navmesh/bake-status.d.ts +5 -0
- package/dist/tools/navmesh/bake-status.js +18 -0
- package/dist/tools/navmesh/bake-status.js.map +1 -0
- package/dist/tools/navmesh/bake.d.ts +5 -0
- package/dist/tools/navmesh/bake.js +23 -0
- package/dist/tools/navmesh/bake.js.map +1 -0
- package/dist/tools/navmesh/live.d.ts +86 -0
- package/dist/tools/navmesh/live.js +206 -0
- package/dist/tools/navmesh/live.js.map +1 -0
- package/dist/tools/navmesh/surface-bake.d.ts +5 -0
- package/dist/tools/navmesh/surface-bake.js +24 -0
- package/dist/tools/navmesh/surface-bake.js.map +1 -0
- package/dist/tools/occlusion/bake-cancel.d.ts +7 -0
- package/dist/tools/occlusion/bake-cancel.js +21 -0
- package/dist/tools/occlusion/bake-cancel.js.map +1 -0
- package/dist/tools/occlusion/bake-status.d.ts +5 -0
- package/dist/tools/occlusion/bake-status.js +18 -0
- package/dist/tools/occlusion/bake-status.js.map +1 -0
- package/dist/tools/occlusion/bake.d.ts +11 -0
- package/dist/tools/occlusion/bake.js +23 -0
- package/dist/tools/occlusion/bake.js.map +1 -0
- package/dist/tools/occlusion/live.d.ts +74 -0
- package/dist/tools/occlusion/live.js +201 -0
- package/dist/tools/occlusion/live.js.map +1 -0
- package/dist/tools/package/bridge-remove.d.ts +26 -0
- package/dist/tools/package/bridge-remove.js +32 -0
- package/dist/tools/package/bridge-remove.js.map +1 -0
- package/dist/tools/package/deploy.d.ts +49 -0
- package/dist/tools/package/deploy.js +134 -0
- package/dist/tools/package/deploy.js.map +1 -0
- package/dist/tools/package/embed.d.ts +14 -0
- package/dist/tools/package/embed.js +93 -0
- package/dist/tools/package/embed.js.map +1 -0
- package/dist/tools/package/file-mutation-worker.d.ts +6 -0
- package/dist/tools/package/file-mutation-worker.js +154 -0
- package/dist/tools/package/file-mutation-worker.js.map +1 -0
- package/dist/tools/package/info.d.ts +19 -0
- package/dist/tools/package/info.js +27 -0
- package/dist/tools/package/info.js.map +1 -0
- package/dist/tools/package/install.d.ts +24 -0
- package/dist/tools/package/install.js +65 -0
- package/dist/tools/package/install.js.map +1 -0
- package/dist/tools/package/list.d.ts +27 -0
- package/dist/tools/package/list.js +21 -0
- package/dist/tools/package/list.js.map +1 -0
- package/dist/tools/package/live-resolve.d.ts +46 -0
- package/dist/tools/package/live-resolve.js +497 -0
- package/dist/tools/package/live-resolve.js.map +1 -0
- package/dist/tools/package/public-result.d.ts +4 -0
- package/dist/tools/package/public-result.js +25 -0
- package/dist/tools/package/public-result.js.map +1 -0
- package/dist/tools/package/registry-clear.d.ts +15 -0
- package/dist/tools/package/registry-clear.js +27 -0
- package/dist/tools/package/registry-clear.js.map +1 -0
- package/dist/tools/package/registry-get.d.ts +10 -0
- package/dist/tools/package/registry-get.js +22 -0
- package/dist/tools/package/registry-get.js.map +1 -0
- package/dist/tools/package/registry-set.d.ts +17 -0
- package/dist/tools/package/registry-set.js +28 -0
- package/dist/tools/package/registry-set.js.map +1 -0
- package/dist/tools/package/remove.d.ts +47 -0
- package/dist/tools/package/remove.js +67 -0
- package/dist/tools/package/remove.js.map +1 -0
- package/dist/tools/package/resolve.d.ts +6 -0
- package/dist/tools/package/resolve.js +14 -0
- package/dist/tools/package/resolve.js.map +1 -0
- package/dist/tools/package/restore.d.ts +42 -0
- package/dist/tools/package/restore.js +122 -0
- package/dist/tools/package/restore.js.map +1 -0
- package/dist/tools/package/scoped-registry-add.d.ts +25 -0
- package/dist/tools/package/scoped-registry-add.js +30 -0
- package/dist/tools/package/scoped-registry-add.js.map +1 -0
- package/dist/tools/package/scoped-registry-list.d.ts +14 -0
- package/dist/tools/package/scoped-registry-list.js +22 -0
- package/dist/tools/package/scoped-registry-list.js.map +1 -0
- package/dist/tools/package/scoped-registry-remove.d.ts +29 -0
- package/dist/tools/package/scoped-registry-remove.js +31 -0
- package/dist/tools/package/scoped-registry-remove.js.map +1 -0
- package/dist/tools/package/search.d.ts +17 -0
- package/dist/tools/package/search.js +39 -0
- package/dist/tools/package/search.js.map +1 -0
- package/dist/tools/package/status.d.ts +21 -0
- package/dist/tools/package/status.js +37 -0
- package/dist/tools/package/status.js.map +1 -0
- package/dist/tools/reflect/member.d.ts +22 -0
- package/dist/tools/reflect/member.js +22 -0
- package/dist/tools/reflect/member.js.map +1 -0
- package/dist/tools/reflect/search.d.ts +30 -0
- package/dist/tools/reflect/search.js +22 -0
- package/dist/tools/reflect/search.js.map +1 -0
- package/dist/tools/reflect/type.d.ts +21 -0
- package/dist/tools/reflect/type.js +22 -0
- package/dist/tools/reflect/type.js.map +1 -0
- package/dist/tools/runtime/console.d.ts +24 -0
- package/dist/tools/runtime/console.js +17 -0
- package/dist/tools/runtime/console.js.map +1 -0
- package/dist/tools/runtime/input/key.d.ts +23 -0
- package/dist/tools/runtime/input/key.js +18 -0
- package/dist/tools/runtime/input/key.js.map +1 -0
- package/dist/tools/runtime/input/pointer.d.ts +34 -0
- package/dist/tools/runtime/input/pointer.js +18 -0
- package/dist/tools/runtime/input/pointer.js.map +1 -0
- package/dist/tools/runtime/log.d.ts +20 -0
- package/dist/tools/runtime/log.js +17 -0
- package/dist/tools/runtime/log.js.map +1 -0
- package/dist/tools/runtime/state.d.ts +45 -0
- package/dist/tools/runtime/state.js +17 -0
- package/dist/tools/runtime/state.js.map +1 -0
- package/dist/tools/runtime/target-framerate/set.d.ts +16 -0
- package/dist/tools/runtime/target-framerate/set.js +17 -0
- package/dist/tools/runtime/target-framerate/set.js.map +1 -0
- package/dist/tools/runtime/time-scale/set.d.ts +16 -0
- package/dist/tools/runtime/time-scale/set.js +17 -0
- package/dist/tools/runtime/time-scale/set.js.map +1 -0
- package/dist/tools/runtime/ui/capture-element.d.ts +31 -0
- package/dist/tools/runtime/ui/capture-element.js +17 -0
- package/dist/tools/runtime/ui/capture-element.js.map +1 -0
- package/dist/tools/test/cancel.d.ts +19 -0
- package/dist/tools/test/cancel.js +94 -0
- package/dist/tools/test/cancel.js.map +1 -0
- package/dist/tools/test/run.d.ts +39 -0
- package/dist/tools/test/run.js +101 -0
- package/dist/tools/test/run.js.map +1 -0
- package/dist/tools/tools/describe.d.ts +27 -0
- package/dist/tools/tools/describe.js +35 -0
- package/dist/tools/tools/describe.js.map +1 -0
- package/dist/tools/tools/group-list.d.ts +20 -0
- package/dist/tools/tools/group-list.js +39 -0
- package/dist/tools/tools/group-list.js.map +1 -0
- package/dist/tools/tools/group-summaries.d.ts +3 -0
- package/dist/tools/tools/group-summaries.js +52 -0
- package/dist/tools/tools/group-summaries.js.map +1 -0
- package/dist/tools/tools/group.d.ts +13 -0
- package/dist/tools/tools/group.js +34 -0
- package/dist/tools/tools/group.js.map +1 -0
- package/dist/tools/tools/search.d.ts +17 -0
- package/dist/tools/tools/search.js +42 -0
- package/dist/tools/tools/search.js.map +1 -0
- package/dist/types.d.ts +5 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/unity-project-processes.d.ts +12 -0
- package/dist/unity-project-processes.js +59 -0
- package/dist/unity-project-processes.js.map +1 -0
- package/dist/util.d.ts +11 -0
- package/dist/util.js +22 -0
- package/dist/util.js.map +1 -0
- package/dist/windows-editor-state.d.ts +31 -0
- package/dist/windows-editor-state.js +98 -0
- package/dist/windows-editor-state.js.map +1 -0
- package/docs/README.md +43 -0
- package/docs/availability-differences.md +97 -0
- package/docs/command-execution.md +89 -0
- package/docs/error-codes.md +204 -0
- package/docs/extensions.md +132 -0
- package/docs/risk-and-side-effects.md +93 -0
- package/docs/safety-boundaries.md +103 -0
- package/docs/target-and-instance.md +83 -0
- package/docs/tool-discovery.md +104 -0
- package/docs/tool-execution.md +178 -0
- package/extensions/cinemachine/bridge/domains/cinemachine.ts +115 -0
- package/extensions/cinemachine/docs/cinemachine.md +50 -0
- package/extensions/cinemachine/extension.json +129 -0
- package/extensions/cinemachine/unitypkg/Editor/Cinemachine/CinemachineExtensionToolSupport.cs +15 -0
- package/extensions/cinemachine/unitypkg/Editor/Cinemachine/CinemachineToolSupport.cs +854 -0
- package/extensions/cinemachine/unitypkg/Editor/Cinemachine/aim.cs +96 -0
- package/extensions/cinemachine/unitypkg/Editor/Cinemachine/blend.cs +140 -0
- package/extensions/cinemachine/unitypkg/Editor/Cinemachine/body.cs +96 -0
- package/extensions/cinemachine/unitypkg/Editor/Cinemachine/brain-ensure.cs +16 -0
- package/extensions/cinemachine/unitypkg/Editor/Cinemachine/brain-status.cs +12 -0
- package/extensions/cinemachine/unitypkg/Editor/Cinemachine/create.cs +147 -0
- package/extensions/cinemachine/unitypkg/Editor/Cinemachine/extension-add.cs +13 -0
- package/extensions/cinemachine/unitypkg/Editor/Cinemachine/extension-list.cs +13 -0
- package/extensions/cinemachine/unitypkg/Editor/Cinemachine/extension-remove.cs +13 -0
- package/extensions/cinemachine/unitypkg/Editor/Cinemachine/lens.cs +142 -0
- package/extensions/cinemachine/unitypkg/Editor/Cinemachine/noise.cs +126 -0
- package/extensions/cinemachine/unitypkg/Editor/Cinemachine/ping.cs +43 -0
- package/extensions/cinemachine/unitypkg/Editor/Cinemachine/priority.cs +113 -0
- package/extensions/cinemachine/unitypkg/Editor/Cinemachine/target.cs +84 -0
- package/extensions/cinemachine/unitypkg/UnityCli.Extensions.Cinemachine.Editor.asmdef +18 -0
- package/extensions/hdrp/bridge/domains/hdrp.ts +41 -0
- package/extensions/hdrp/docs/hdrp.md +15 -0
- package/extensions/hdrp/extension.json +31 -0
- package/extensions/hdrp/unitypkg/Editor/Hdrp/HdrpToolSupport.cs +607 -0
- package/extensions/hdrp/unitypkg/Editor/Hdrp/settings-get.cs +29 -0
- package/extensions/hdrp/unitypkg/Editor/Hdrp/settings-set.cs +47 -0
- package/extensions/hdrp/unitypkg/Editor/Hdrp/volume-add-effect.cs +28 -0
- package/extensions/hdrp/unitypkg/Editor/Hdrp/volume-create.cs +28 -0
- package/extensions/hdrp/unitypkg/Editor/Hdrp/volume-info.cs +25 -0
- package/extensions/hdrp/unitypkg/Editor/Hdrp/volume-list.cs +25 -0
- package/extensions/hdrp/unitypkg/Editor/Hdrp/volume-set.cs +28 -0
- package/extensions/hdrp/unitypkg/UnityCli.Extensions.Hdrp.Editor.asmdef +19 -0
- package/extensions/probuilder/bridge/domains/probuilder.ts +386 -0
- package/extensions/probuilder/docs/probuilder.md +125 -0
- package/extensions/probuilder/extension.json +291 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/ProBuilderAppendCompletionProof.cs +254 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/ProBuilderAtomicReadback.cs +293 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/ProBuilderBevelCompletionProof.cs +299 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/ProBuilderCanonicalMeshSnapshot.cs +951 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/ProBuilderConnectCompletionProof.cs +407 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/ProBuilderEdgeCompletionProof.cs +318 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/ProBuilderErrors.cs +83 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/ProBuilderFaceCompletionProof.cs +152 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/ProBuilderFaceExtrudeCompletionProof.cs +283 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/ProBuilderFlipCompletionProof.cs +170 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/ProBuilderInput.cs +85 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/ProBuilderInsertCompletionProof.cs +674 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/ProBuilderOperationProof.cs +137 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/ProBuilderReflection.cs +1064 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/ProBuilderRefreshUvProof.cs +53 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/ProBuilderSceneTool.cs +184 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/ProBuilderShapeTopologyRecords.g.cs +82 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/ProBuilderVertexObjectCompletionProof.cs +346 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/append-vertices-to-edge.cs +118 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/auto-smooth.cs +104 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/bevel-edges.cs +119 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/bridge-edges.cs +113 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/center-pivot.cs +43 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/combine-meshes.cs +58 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/connect-elements.cs +128 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/convert-to-probuilder.cs +40 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/create-poly-shape.cs +55 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/create-polygon.cs +28 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/create-shape.cs +168 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/delete-faces.cs +42 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/detach-faces.cs +46 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/duplicate-and-flip.cs +100 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/extrude-edges.cs +118 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/extrude-faces.cs +110 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/flip-normals.cs +102 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/freeze-transform.cs +45 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/insert-vertex.cs +132 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/merge-faces.cs +44 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/merge-objects.cs +130 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/merge-vertices.cs +109 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/mesh-info.cs +117 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/move-vertices.cs +33 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/ping.cs +51 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/repair-mesh.cs +40 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/select-faces.cs +161 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/set-face-color.cs +24 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/set-face-material.cs +23 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/set-face-uvs.cs +28 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/set-pivot.cs +42 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/set-smoothing.cs +23 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/split-vertices.cs +64 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/subdivide.cs +111 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/validate-mesh.cs +75 -0
- package/extensions/probuilder/unitypkg/Editor/ProBuilder/weld-vertices.cs +112 -0
- package/extensions/probuilder/unitypkg/UnityCli.Extensions.ProBuilder.Editor.asmdef +25 -0
- package/extensions/urp/bridge/domains/urp.ts +62 -0
- package/extensions/urp/docs/urp.md +20 -0
- package/extensions/urp/extension.json +41 -0
- package/extensions/urp/unitypkg/Editor/Urp/UrpFeatureToolSupport.cs +336 -0
- package/extensions/urp/unitypkg/Editor/Urp/UrpToolSupport.cs +801 -0
- package/extensions/urp/unitypkg/Editor/Urp/feature-add.cs +12 -0
- package/extensions/urp/unitypkg/Editor/Urp/feature-configure.cs +12 -0
- package/extensions/urp/unitypkg/Editor/Urp/feature-list.cs +12 -0
- package/extensions/urp/unitypkg/Editor/Urp/feature-remove.cs +12 -0
- package/extensions/urp/unitypkg/Editor/Urp/feature-toggle.cs +12 -0
- package/extensions/urp/unitypkg/Editor/Urp/settings-get.cs +27 -0
- package/extensions/urp/unitypkg/Editor/Urp/settings-set.cs +47 -0
- package/extensions/urp/unitypkg/Editor/Urp/volume-add-effect.cs +33 -0
- package/extensions/urp/unitypkg/Editor/Urp/volume-create.cs +33 -0
- package/extensions/urp/unitypkg/Editor/Urp/volume-info.cs +31 -0
- package/extensions/urp/unitypkg/Editor/Urp/volume-list.cs +39 -0
- package/extensions/urp/unitypkg/Editor/Urp/volume-set.cs +33 -0
- package/extensions/urp/unitypkg/UnityCli.Extensions.Urp.Editor.asmdef +19 -0
- package/extensions/vfx-graph/bridge/domains/vfx.ts +337 -0
- package/extensions/vfx-graph/docs/vfx.md +28 -0
- package/extensions/vfx-graph/extension.json +72 -0
- package/extensions/vfx-graph/unitypkg/Editor/Vfx/VfxActionToolSupport.cs +248 -0
- package/extensions/vfx-graph/unitypkg/Editor/Vfx/VfxToolSupport.cs +1325 -0
- package/extensions/vfx-graph/unitypkg/Editor/Vfx/control-pause.cs +37 -0
- package/extensions/vfx-graph/unitypkg/Editor/Vfx/control-play.cs +40 -0
- package/extensions/vfx-graph/unitypkg/Editor/Vfx/control-reinitialize.cs +37 -0
- package/extensions/vfx-graph/unitypkg/Editor/Vfx/control-set-rate.cs +36 -0
- package/extensions/vfx-graph/unitypkg/Editor/Vfx/control-set-seed.cs +42 -0
- package/extensions/vfx-graph/unitypkg/Editor/Vfx/control-stop.cs +37 -0
- package/extensions/vfx-graph/unitypkg/Editor/Vfx/effect-add.cs +55 -0
- package/extensions/vfx-graph/unitypkg/Editor/Vfx/effect-assign.cs +44 -0
- package/extensions/vfx-graph/unitypkg/Editor/Vfx/effect-info.cs +30 -0
- package/extensions/vfx-graph/unitypkg/Editor/Vfx/graph-create.cs +62 -0
- package/extensions/vfx-graph/unitypkg/Editor/Vfx/graph-info.cs +32 -0
- package/extensions/vfx-graph/unitypkg/Editor/Vfx/line-create.cs +75 -0
- package/extensions/vfx-graph/unitypkg/Editor/Vfx/line-positions.cs +100 -0
- package/extensions/vfx-graph/unitypkg/Editor/Vfx/parameter.cs +216 -0
- package/extensions/vfx-graph/unitypkg/Editor/Vfx/particle-clear.cs +39 -0
- package/extensions/vfx-graph/unitypkg/Editor/Vfx/particle-create.cs +80 -0
- package/extensions/vfx-graph/unitypkg/Editor/Vfx/particle-emission.cs +126 -0
- package/extensions/vfx-graph/unitypkg/Editor/Vfx/particle-info.cs +55 -0
- package/extensions/vfx-graph/unitypkg/Editor/Vfx/particle-main.cs +75 -0
- package/extensions/vfx-graph/unitypkg/Editor/Vfx/particle-pause.cs +38 -0
- package/extensions/vfx-graph/unitypkg/Editor/Vfx/particle-play.cs +38 -0
- package/extensions/vfx-graph/unitypkg/Editor/Vfx/particle-shape.cs +148 -0
- package/extensions/vfx-graph/unitypkg/Editor/Vfx/particle-stop.cs +41 -0
- package/extensions/vfx-graph/unitypkg/Editor/Vfx/template-create.cs +58 -0
- package/extensions/vfx-graph/unitypkg/Editor/Vfx/template-list.cs +31 -0
- package/extensions/vfx-graph/unitypkg/Editor/Vfx/trail-create.cs +41 -0
- package/extensions/vfx-graph/unitypkg/Editor/Vfx/trail-set.cs +44 -0
- package/extensions/vfx-graph/unitypkg/UnityCli.Extensions.VfxGraph.Editor.asmdef +18 -0
- package/package.json +46 -0
- package/schemas/error-code.schema.json +70 -0
- package/schemas/extension-descriptor.schema.json +88 -0
- package/schemas/extension-manifest.schema.json +125 -0
- package/schemas/request-envelope.schema.json +34 -0
- package/schemas/response-envelope.schema.json +42 -0
- package/schemas/tool-metadata.schema.json +111 -0
- package/skills/unitycli/SKILL.md +61 -0
- package/skills/unitycli/agents/interface.yaml +30 -0
- package/skills/unitycli/evals/history/2026-08-05-governed-baseline.json +44 -0
- package/skills/unitycli/evals/output/cases.jsonl +5 -0
- package/skills/unitycli/evals/output/fixtures/feedback-scenario.json +27 -0
- package/skills/unitycli/evals/output/schema.json +32 -0
- package/skills/unitycli/evals/semantic_config.json +46 -0
- package/skills/unitycli/evals/trigger_cases.json +39 -0
- package/skills/unitycli/examples/feedback-event.input.json +8 -0
- package/skills/unitycli/examples/feedback-record.output.json +12 -0
- package/skills/unitycli/manifest.json +112 -0
- package/skills/unitycli/references/custom-tools.md +111 -0
- package/skills/unitycli/references/feedback.md +59 -0
- package/skills/unitycli/references/operation-protocol.md +83 -0
- package/skills/unitycli/reports/output_quality_scorecard.md +56 -0
- package/skills/unitycli/reports/trust-report.md +57 -0
- package/skills/unitycli/scripts/record-feedback.ps1 +210 -0
- package/skills/unitycli/security/network_policy.json +18 -0
- package/skills/unitycli/security/permission_policy.json +40 -0
- package/unitypkg/Editor/Bridge/BridgeCommandContext.cs +64 -0
- package/unitypkg/Editor/Bridge/BridgeCommandException.cs +39 -0
- package/unitypkg/Editor/Bridge/BridgeCommandRegistry.cs +172 -0
- package/unitypkg/Editor/Bridge/BridgeHttpServer.cs +534 -0
- package/unitypkg/Editor/Bridge/BridgeResponse.cs +58 -0
- package/unitypkg/Editor/Bridge/BridgeWorkQueue.cs +325 -0
- package/unitypkg/Editor/BridgeStartupStateMachine.cs +81 -0
- package/unitypkg/Editor/Commands/ProjectToolCommands.cs +43 -0
- package/unitypkg/Editor/Commands/RuntimeToolCommands.cs +43 -0
- package/unitypkg/Editor/Generated/UnityCliToolCompletionRegistry.g.cs +428 -0
- package/unitypkg/Editor/Infrastructure/CodeExecSupport.cs +664 -0
- package/unitypkg/Editor/Infrastructure/RegistryOwnershipResolver.cs +148 -0
- package/unitypkg/Editor/Infrastructure/UnityCliActiveOperation.cs +411 -0
- package/unitypkg/Editor/Infrastructure/UnityCliAdmission.cs +485 -0
- package/unitypkg/Editor/Infrastructure/UnityCliArtifacts.cs +110 -0
- package/unitypkg/Editor/Infrastructure/UnityCliAssetRefreshCoordinator.cs +106 -0
- package/unitypkg/Editor/Infrastructure/UnityCliBridgeHelpers.cs +155 -0
- package/unitypkg/Editor/Infrastructure/UnityCliCanonicalProjectPath.cs +325 -0
- package/unitypkg/Editor/Infrastructure/UnityCliCompilationEventBroker.cs +192 -0
- package/unitypkg/Editor/Infrastructure/UnityCliCompileCoordinator.cs +271 -0
- package/unitypkg/Editor/Infrastructure/UnityCliCompletionProbe.cs +515 -0
- package/unitypkg/Editor/Infrastructure/UnityCliEditorStateSnapshot.cs +84 -0
- package/unitypkg/Editor/Infrastructure/UnityCliInstanceRegistry.cs +558 -0
- package/unitypkg/Editor/Infrastructure/UnityCliJson.cs +155 -0
- package/unitypkg/Editor/Infrastructure/UnityCliLargeOutput.cs +128 -0
- package/unitypkg/Editor/Infrastructure/UnityCliLiveBuildCoordinator.cs +230 -0
- package/unitypkg/Editor/Infrastructure/UnityCliLiveRefreshCoordinator.cs +164 -0
- package/unitypkg/Editor/Infrastructure/UnityCliLog.cs +127 -0
- package/unitypkg/Editor/Infrastructure/UnityCliNavMeshBakeCoordinator.cs +2073 -0
- package/unitypkg/Editor/Infrastructure/UnityCliObjectPatch.cs +193 -0
- package/unitypkg/Editor/Infrastructure/UnityCliObjectRef.cs +278 -0
- package/unitypkg/Editor/Infrastructure/UnityCliObjectSerializer.cs +620 -0
- package/unitypkg/Editor/Infrastructure/UnityCliOcclusionBakeCoordinator.cs +1739 -0
- package/unitypkg/Editor/Infrastructure/UnityCliOperationCoordinator.cs +828 -0
- package/unitypkg/Editor/Infrastructure/UnityCliPackageEmbedCoordinator.cs +147 -0
- package/unitypkg/Editor/Infrastructure/UnityCliPackageResolveCoordinator.cs +454 -0
- package/unitypkg/Editor/Infrastructure/UnityCliPackageResolveState.cs +561 -0
- package/unitypkg/Editor/Infrastructure/UnityCliPipelineHandoff.cs +742 -0
- package/unitypkg/Editor/Infrastructure/UnityCliProjectSettings.cs +92 -0
- package/unitypkg/Editor/Infrastructure/UnityCliProtocolRequest.cs +116 -0
- package/unitypkg/Editor/Infrastructure/UnityCliReflection.cs +477 -0
- package/unitypkg/Editor/Infrastructure/UnityCliReloadOperation.cs +664 -0
- package/unitypkg/Editor/Infrastructure/UnityCliRequestDigest.cs +34 -0
- package/unitypkg/Editor/Infrastructure/UnityCliRuntimeBuildInjection.cs +121 -0
- package/unitypkg/Editor/Infrastructure/UnityCliRuntimeExecutor.cs +391 -0
- package/unitypkg/Editor/Infrastructure/UnityCliSceneMutation.cs +84 -0
- package/unitypkg/Editor/Infrastructure/UnityCliScriptableObjectHelpers.cs +235 -0
- package/unitypkg/Editor/Infrastructure/UnityCliSerializer.cs +580 -0
- package/unitypkg/Editor/Infrastructure/UnityCliSessionMutationLease.cs +568 -0
- package/unitypkg/Editor/Infrastructure/UnityCliStateIO.cs +73 -0
- package/unitypkg/Editor/Infrastructure/UnityCliTestRunCoordinator.cs +598 -0
- package/unitypkg/Editor/Infrastructure/UnityCliTransactionLog.cs +112 -0
- package/unitypkg/Editor/Infrastructure/UnityCliValueConverter.cs +146 -0
- package/unitypkg/Editor/Infrastructure/UnityCliWaiter.cs +716 -0
- package/unitypkg/Editor/ProjectTools/IUnityCliTool.cs +152 -0
- package/unitypkg/Editor/ProjectTools/OfficialAttributeToolRegistry.cs +992 -0
- package/unitypkg/Editor/ProjectTools/ProjectToolRegistry.cs +938 -0
- package/unitypkg/Editor/ProjectTools/ProjectToolSchemaValidator.cs +258 -0
- package/unitypkg/Editor/ProjectTools/RegisteredTool.cs +75 -0
- package/unitypkg/Editor/ProjectTools/UnityCliProjectToolContext.cs +68 -0
- package/unitypkg/Editor/ProjectTools/UnityCliSchemaDeriver.cs +297 -0
- package/unitypkg/Editor/Protocol/ProtocolEnvelopeFactory.cs +92 -0
- package/unitypkg/Editor/Protocol/envelope.cs +50 -0
- package/unitypkg/Editor/Roslyn/LICENSE.txt +23 -0
- package/unitypkg/Editor/Roslyn/Microsoft.CodeAnalysis.CSharp.dll +0 -0
- package/unitypkg/Editor/Roslyn/Microsoft.CodeAnalysis.dll +0 -0
- package/unitypkg/Editor/Roslyn/System.Collections.Immutable.dll +0 -0
- package/unitypkg/Editor/Roslyn/System.Reflection.Metadata.dll +0 -0
- package/unitypkg/Editor/Tools/animation/AnimationToolSupport.cs +335 -0
- package/unitypkg/Editor/Tools/animation/AnimatorRuntimeToolSupport.cs +24 -0
- package/unitypkg/Editor/Tools/animation/animator/crossfade.cs +117 -0
- package/unitypkg/Editor/Tools/animation/animator/get-info.cs +24 -0
- package/unitypkg/Editor/Tools/animation/animator/get-parameter.cs +36 -0
- package/unitypkg/Editor/Tools/animation/animator/set-enabled.cs +33 -0
- package/unitypkg/Editor/Tools/animation/animator/set-parameter.cs +71 -0
- package/unitypkg/Editor/Tools/animation/animator/set-speed.cs +33 -0
- package/unitypkg/Editor/Tools/animation/clip/create.cs +48 -0
- package/unitypkg/Editor/Tools/animation/clip/modify.cs +43 -0
- package/unitypkg/Editor/Tools/animation/clip.cs +23 -0
- package/unitypkg/Editor/Tools/animation/play.cs +41 -0
- package/unitypkg/Editor/Tools/animation/state.cs +25 -0
- package/unitypkg/Editor/Tools/animation/stop.cs +45 -0
- package/unitypkg/Editor/Tools/asset/AssetImportSettingsToolSupport.cs +633 -0
- package/unitypkg/Editor/Tools/asset/AssetToolSupport.cs +253 -0
- package/unitypkg/Editor/Tools/asset/create.cs +84 -0
- package/unitypkg/Editor/Tools/asset/delete.cs +88 -0
- package/unitypkg/Editor/Tools/asset/duplicate.cs +68 -0
- package/unitypkg/Editor/Tools/asset/get-components.cs +177 -0
- package/unitypkg/Editor/Tools/asset/get-data.cs +73 -0
- package/unitypkg/Editor/Tools/asset/import-settings/set.cs +127 -0
- package/unitypkg/Editor/Tools/asset/import-settings.cs +54 -0
- package/unitypkg/Editor/Tools/asset/import.cs +132 -0
- package/unitypkg/Editor/Tools/asset/info.cs +48 -0
- package/unitypkg/Editor/Tools/asset/modify.cs +69 -0
- package/unitypkg/Editor/Tools/asset/move.cs +70 -0
- package/unitypkg/Editor/Tools/asset/preview.cs +86 -0
- package/unitypkg/Editor/Tools/asset/rename.cs +84 -0
- package/unitypkg/Editor/Tools/asset/search-built-in.cs +90 -0
- package/unitypkg/Editor/Tools/asset/search.cs +83 -0
- package/unitypkg/Editor/Tools/build/BuildSceneStateTool.cs +37 -0
- package/unitypkg/Editor/Tools/build/BuildSettingsToolSupport.cs +4 -0
- package/unitypkg/Editor/Tools/build/BuildToolDtos.cs +15 -0
- package/unitypkg/Editor/Tools/build/BuildToolSupport.cs +111 -0
- package/unitypkg/Editor/Tools/build/platform/get.cs +12 -0
- package/unitypkg/Editor/Tools/build/platform/set.cs +45 -0
- package/unitypkg/Editor/Tools/build/profile/create.cs +44 -0
- package/unitypkg/Editor/Tools/build/profile/list.cs +12 -0
- package/unitypkg/Editor/Tools/build/profile/modify.cs +42 -0
- package/unitypkg/Editor/Tools/build/profile/switch.cs +30 -0
- package/unitypkg/Editor/Tools/build/scene/add.cs +45 -0
- package/unitypkg/Editor/Tools/build/scene/disable.cs +3 -0
- package/unitypkg/Editor/Tools/build/scene/enable.cs +4 -0
- package/unitypkg/Editor/Tools/build/scene/list.cs +4 -0
- package/unitypkg/Editor/Tools/build/scene/remove.cs +29 -0
- package/unitypkg/Editor/Tools/build/settings/get.cs +3 -0
- package/unitypkg/Editor/Tools/build/settings/set.cs +74 -0
- package/unitypkg/Editor/Tools/camera/CameraToolSupport.cs +292 -0
- package/unitypkg/Editor/Tools/camera/create.cs +114 -0
- package/unitypkg/Editor/Tools/camera/info.cs +49 -0
- package/unitypkg/Editor/Tools/camera/lens.cs +119 -0
- package/unitypkg/Editor/Tools/camera/list.cs +52 -0
- package/unitypkg/Editor/Tools/camera/multiview.cs +96 -0
- package/unitypkg/Editor/Tools/camera/screenshot.cs +65 -0
- package/unitypkg/Editor/Tools/camera/target.cs +94 -0
- package/unitypkg/Editor/Tools/component/add.cs +125 -0
- package/unitypkg/Editor/Tools/component/get.cs +73 -0
- package/unitypkg/Editor/Tools/component/list-types.cs +90 -0
- package/unitypkg/Editor/Tools/component/modify.cs +103 -0
- package/unitypkg/Editor/Tools/component/remove.cs +147 -0
- package/unitypkg/Editor/Tools/component/set.cs +93 -0
- package/unitypkg/Editor/Tools/console/clear.cs +38 -0
- package/unitypkg/Editor/Tools/console/get.cs +28 -0
- package/unitypkg/Editor/Tools/controller/add-blend-tree-child.cs +88 -0
- package/unitypkg/Editor/Tools/controller/add-layer.cs +43 -0
- package/unitypkg/Editor/Tools/controller/add-parameter.cs +51 -0
- package/unitypkg/Editor/Tools/controller/add-state.cs +44 -0
- package/unitypkg/Editor/Tools/controller/add-transition.cs +71 -0
- package/unitypkg/Editor/Tools/controller/assign.cs +38 -0
- package/unitypkg/Editor/Tools/controller/create-blend-tree-1d.cs +40 -0
- package/unitypkg/Editor/Tools/controller/create-blend-tree-2d.cs +42 -0
- package/unitypkg/Editor/Tools/controller/create.cs +31 -0
- package/unitypkg/Editor/Tools/controller/get-info.cs +27 -0
- package/unitypkg/Editor/Tools/controller/remove-layer.cs +57 -0
- package/unitypkg/Editor/Tools/controller/set-layer-weight.cs +42 -0
- package/unitypkg/Editor/Tools/diagnose/preflight.cs +269 -0
- package/unitypkg/Editor/Tools/editor/EditorActionToolSupport.cs +117 -0
- package/unitypkg/Editor/Tools/editor/EditorSearchToolSupport.cs +146 -0
- package/unitypkg/Editor/Tools/editor/EditorToolSupport.cs +132 -0
- package/unitypkg/Editor/Tools/editor/EditorWindowFocusToolSupport.cs +194 -0
- package/unitypkg/Editor/Tools/editor/active-tool/set.cs +33 -0
- package/unitypkg/Editor/Tools/editor/active-tool.cs +100 -0
- package/unitypkg/Editor/Tools/editor/autotick/set.cs +102 -0
- package/unitypkg/Editor/Tools/editor/console.cs +26 -0
- package/unitypkg/Editor/Tools/editor/focus.cs +80 -0
- package/unitypkg/Editor/Tools/editor/menu-items.cs +50 -0
- package/unitypkg/Editor/Tools/editor/menu.cs +53 -0
- package/unitypkg/Editor/Tools/editor/pause.cs +38 -0
- package/unitypkg/Editor/Tools/editor/play.cs +43 -0
- package/unitypkg/Editor/Tools/editor/redo.cs +56 -0
- package/unitypkg/Editor/Tools/editor/resolution.cs +34 -0
- package/unitypkg/Editor/Tools/editor/search.cs +55 -0
- package/unitypkg/Editor/Tools/editor/selection/set.cs +37 -0
- package/unitypkg/Editor/Tools/editor/selection.cs +153 -0
- package/unitypkg/Editor/Tools/editor/stop.cs +43 -0
- package/unitypkg/Editor/Tools/editor/tool-states.cs +140 -0
- package/unitypkg/Editor/Tools/editor/undo.cs +56 -0
- package/unitypkg/Editor/Tools/editor/windows.cs +87 -0
- package/unitypkg/Editor/Tools/extension/status.cs +87 -0
- package/unitypkg/Editor/Tools/go/GameObjectToolSupport.cs +524 -0
- package/unitypkg/Editor/Tools/go/create.cs +333 -0
- package/unitypkg/Editor/Tools/go/delete.cs +87 -0
- package/unitypkg/Editor/Tools/go/duplicate.cs +76 -0
- package/unitypkg/Editor/Tools/go/find.cs +152 -0
- package/unitypkg/Editor/Tools/go/inspect.cs +49 -0
- package/unitypkg/Editor/Tools/go/look-at.cs +76 -0
- package/unitypkg/Editor/Tools/go/modify.cs +156 -0
- package/unitypkg/Editor/Tools/go/move-relative.cs +74 -0
- package/unitypkg/Editor/Tools/go/set-parent.cs +84 -0
- package/unitypkg/Editor/Tools/graphics/GraphicsToolSupport.cs +396 -0
- package/unitypkg/Editor/Tools/graphics/bake-cancel.cs +27 -0
- package/unitypkg/Editor/Tools/graphics/bake-clear.cs +31 -0
- package/unitypkg/Editor/Tools/graphics/bake-reflection-probe.cs +35 -0
- package/unitypkg/Editor/Tools/graphics/bake-settings.cs +131 -0
- package/unitypkg/Editor/Tools/graphics/bake-start.cs +27 -0
- package/unitypkg/Editor/Tools/graphics/bake-status.cs +31 -0
- package/unitypkg/Editor/Tools/graphics/light-probe-group.cs +56 -0
- package/unitypkg/Editor/Tools/graphics/pipeline-info.cs +19 -0
- package/unitypkg/Editor/Tools/graphics/pipeline-quality.cs +24 -0
- package/unitypkg/Editor/Tools/graphics/pipeline-settings.cs +46 -0
- package/unitypkg/Editor/Tools/graphics/probe-positions.cs +58 -0
- package/unitypkg/Editor/Tools/graphics/quality.cs +85 -0
- package/unitypkg/Editor/Tools/graphics/reflection-probe.cs +73 -0
- package/unitypkg/Editor/Tools/graphics/scene-debug.cs +37 -0
- package/unitypkg/Editor/Tools/graphics/settings.cs +104 -0
- package/unitypkg/Editor/Tools/graphics/skybox-get.cs +33 -0
- package/unitypkg/Editor/Tools/graphics/skybox-set-ambient.cs +24 -0
- package/unitypkg/Editor/Tools/graphics/skybox-set-fog.cs +24 -0
- package/unitypkg/Editor/Tools/graphics/skybox-set-material.cs +33 -0
- package/unitypkg/Editor/Tools/graphics/skybox-set-properties.cs +51 -0
- package/unitypkg/Editor/Tools/graphics/skybox-set-reflection.cs +31 -0
- package/unitypkg/Editor/Tools/graphics/skybox-set-sun.cs +35 -0
- package/unitypkg/Editor/Tools/graphics/stats-counters.cs +28 -0
- package/unitypkg/Editor/Tools/graphics/stats-memory.cs +21 -0
- package/unitypkg/Editor/Tools/graphics/stats.cs +17 -0
- package/unitypkg/Editor/Tools/graphics/volume.cs +59 -0
- package/unitypkg/Editor/Tools/instances/list.cs +71 -0
- package/unitypkg/Editor/Tools/material/MaterialToolSupport.cs +401 -0
- package/unitypkg/Editor/Tools/material/assign.cs +124 -0
- package/unitypkg/Editor/Tools/material/create.cs +82 -0
- package/unitypkg/Editor/Tools/material/info.cs +55 -0
- package/unitypkg/Editor/Tools/material/set-renderer-color.cs +108 -0
- package/unitypkg/Editor/Tools/material/set.cs +114 -0
- package/unitypkg/Editor/Tools/navmesh/NavMeshToolSupport.cs +404 -0
- package/unitypkg/Editor/Tools/navmesh/bake-clear.cs +70 -0
- package/unitypkg/Editor/Tools/navmesh/settings/set.cs +73 -0
- package/unitypkg/Editor/Tools/navmesh/settings.cs +37 -0
- package/unitypkg/Editor/Tools/object/ObjectToolSupport.cs +99 -0
- package/unitypkg/Editor/Tools/object/get-data.cs +69 -0
- package/unitypkg/Editor/Tools/object/modify.cs +126 -0
- package/unitypkg/Editor/Tools/occlusion/OcclusionToolSupport.cs +422 -0
- package/unitypkg/Editor/Tools/occlusion/bake-clear.cs +67 -0
- package/unitypkg/Editor/Tools/physics/PhysicsJointToolSupport.cs +13 -0
- package/unitypkg/Editor/Tools/physics/PhysicsToolSupport.cs +389 -0
- package/unitypkg/Editor/Tools/physics/assign-material.cs +88 -0
- package/unitypkg/Editor/Tools/physics/collision-matrix.cs +90 -0
- package/unitypkg/Editor/Tools/physics/force.cs +127 -0
- package/unitypkg/Editor/Tools/physics/joint/add.cs +99 -0
- package/unitypkg/Editor/Tools/physics/joint/remove.cs +4 -0
- package/unitypkg/Editor/Tools/physics/linecast.cs +59 -0
- package/unitypkg/Editor/Tools/physics/material.cs +73 -0
- package/unitypkg/Editor/Tools/physics/overlap.cs +84 -0
- package/unitypkg/Editor/Tools/physics/raycast-all.cs +67 -0
- package/unitypkg/Editor/Tools/physics/raycast.cs +96 -0
- package/unitypkg/Editor/Tools/physics/rigidbody.cs +116 -0
- package/unitypkg/Editor/Tools/physics/settings.cs +116 -0
- package/unitypkg/Editor/Tools/physics/shapecast.cs +127 -0
- package/unitypkg/Editor/Tools/physics/simulation.cs +89 -0
- package/unitypkg/Editor/Tools/physics/validate.cs +67 -0
- package/unitypkg/Editor/Tools/prefab/PrefabOverrideToolSupport.cs +355 -0
- package/unitypkg/Editor/Tools/prefab/PrefabToolSupport.cs +446 -0
- package/unitypkg/Editor/Tools/prefab/create.cs +125 -0
- package/unitypkg/Editor/Tools/prefab/hierarchy.cs +157 -0
- package/unitypkg/Editor/Tools/prefab/info.cs +44 -0
- package/unitypkg/Editor/Tools/prefab/instantiate.cs +106 -0
- package/unitypkg/Editor/Tools/prefab/modify.cs +112 -0
- package/unitypkg/Editor/Tools/prefab/overrides/apply.cs +51 -0
- package/unitypkg/Editor/Tools/prefab/overrides/revert.cs +51 -0
- package/unitypkg/Editor/Tools/prefab/stage-close.cs +67 -0
- package/unitypkg/Editor/Tools/prefab/stage-open.cs +69 -0
- package/unitypkg/Editor/Tools/prefab/stage-save.cs +64 -0
- package/unitypkg/Editor/Tools/prefab/stage.cs +68 -0
- package/unitypkg/Editor/Tools/prefab/unpack.cs +80 -0
- package/unitypkg/Editor/Tools/prefab/variant/create.cs +53 -0
- package/unitypkg/Editor/Tools/profiler/ProfilerFrameDebuggerSupport.cs +68 -0
- package/unitypkg/Editor/Tools/profiler/ProfilerMemorySnapshotSupport.cs +30 -0
- package/unitypkg/Editor/Tools/profiler/ProfilerToolSupport.cs +515 -0
- package/unitypkg/Editor/Tools/profiler/areas.cs +36 -0
- package/unitypkg/Editor/Tools/profiler/capture.cs +188 -0
- package/unitypkg/Editor/Tools/profiler/clear.cs +57 -0
- package/unitypkg/Editor/Tools/profiler/counter.cs +34 -0
- package/unitypkg/Editor/Tools/profiler/deep.cs +48 -0
- package/unitypkg/Editor/Tools/profiler/export.cs +85 -0
- package/unitypkg/Editor/Tools/profiler/frame-debugger/disable.cs +53 -0
- package/unitypkg/Editor/Tools/profiler/frame-debugger/enable.cs +66 -0
- package/unitypkg/Editor/Tools/profiler/frame-debugger/events.cs +140 -0
- package/unitypkg/Editor/Tools/profiler/frame.cs +38 -0
- package/unitypkg/Editor/Tools/profiler/hierarchy.cs +183 -0
- package/unitypkg/Editor/Tools/profiler/load.cs +85 -0
- package/unitypkg/Editor/Tools/profiler/memory-snapshot/compare.cs +78 -0
- package/unitypkg/Editor/Tools/profiler/memory-snapshot/list.cs +73 -0
- package/unitypkg/Editor/Tools/profiler/memory-snapshot/take.cs +147 -0
- package/unitypkg/Editor/Tools/profiler/memory.cs +34 -0
- package/unitypkg/Editor/Tools/profiler/module-enable.cs +52 -0
- package/unitypkg/Editor/Tools/profiler/modules.cs +33 -0
- package/unitypkg/Editor/Tools/profiler/object-memory.cs +49 -0
- package/unitypkg/Editor/Tools/profiler/pause.cs +49 -0
- package/unitypkg/Editor/Tools/profiler/rendering-stats.cs +109 -0
- package/unitypkg/Editor/Tools/profiler/script-stats.cs +35 -0
- package/unitypkg/Editor/Tools/profiler/start.cs +55 -0
- package/unitypkg/Editor/Tools/profiler/status.cs +36 -0
- package/unitypkg/Editor/Tools/profiler/stop.cs +53 -0
- package/unitypkg/Editor/Tools/project/ProjectSettingsReader.cs +31 -0
- package/unitypkg/Editor/Tools/project/ProjectSettingsToolSupport.cs +757 -0
- package/unitypkg/Editor/Tools/project/ProjectTagLayerToolSupport.cs +23 -0
- package/unitypkg/Editor/Tools/project/audio-settings/set.cs +35 -0
- package/unitypkg/Editor/Tools/project/audio-settings.cs +31 -0
- package/unitypkg/Editor/Tools/project/info.cs +52 -0
- package/unitypkg/Editor/Tools/project/input-settings/set.cs +35 -0
- package/unitypkg/Editor/Tools/project/input-settings.cs +35 -0
- package/unitypkg/Editor/Tools/project/layer/add.cs +3 -0
- package/unitypkg/Editor/Tools/project/layer/remove.cs +3 -0
- package/unitypkg/Editor/Tools/project/layers.cs +61 -0
- package/unitypkg/Editor/Tools/project/player-settings/set.cs +35 -0
- package/unitypkg/Editor/Tools/project/player-settings.cs +31 -0
- package/unitypkg/Editor/Tools/project/tag/add.cs +3 -0
- package/unitypkg/Editor/Tools/project/tag/remove.cs +3 -0
- package/unitypkg/Editor/Tools/project/tags.cs +45 -0
- package/unitypkg/Editor/Tools/project/time-settings/set.cs +35 -0
- package/unitypkg/Editor/Tools/project/time-settings.cs +31 -0
- package/unitypkg/Editor/Tools/reflection/method/call.cs +114 -0
- package/unitypkg/Editor/Tools/reflection/method/find.cs +72 -0
- package/unitypkg/Editor/Tools/reflection/type/schema.cs +56 -0
- package/unitypkg/Editor/Tools/scene/SceneToolSupport.cs +181 -0
- package/unitypkg/Editor/Tools/scene/active.cs +62 -0
- package/unitypkg/Editor/Tools/scene/build-settings.cs +69 -0
- package/unitypkg/Editor/Tools/scene/create.cs +78 -0
- package/unitypkg/Editor/Tools/scene/data.cs +125 -0
- package/unitypkg/Editor/Tools/scene/gameobject/component.cs +63 -0
- package/unitypkg/Editor/Tools/scene/gameobject/components.cs +77 -0
- package/unitypkg/Editor/Tools/scene/gameobject-support.cs +101 -0
- package/unitypkg/Editor/Tools/scene/gameobject.cs +83 -0
- package/unitypkg/Editor/Tools/scene/hierarchy.cs +250 -0
- package/unitypkg/Editor/Tools/scene/list-opened.cs +77 -0
- package/unitypkg/Editor/Tools/scene/load.cs +68 -0
- package/unitypkg/Editor/Tools/scene/move-object.cs +122 -0
- package/unitypkg/Editor/Tools/scene/save.cs +231 -0
- package/unitypkg/Editor/Tools/scene/set-active.cs +76 -0
- package/unitypkg/Editor/Tools/scene/unload.cs +109 -0
- package/unitypkg/Editor/Tools/scene/validate.cs +115 -0
- package/unitypkg/Editor/Tools/scene/view-frame.cs +218 -0
- package/unitypkg/Editor/Tools/screenshot/EditorElementCaptureToolSupport.cs +181 -0
- package/unitypkg/Editor/Tools/screenshot/ScreenshotToolSupport.cs +196 -0
- package/unitypkg/Editor/Tools/screenshot/editor-element.cs +87 -0
- package/unitypkg/Editor/Tools/screenshot/game-view.cs +116 -0
- package/unitypkg/Editor/Tools/screenshot/isolated-object.cs +93 -0
- package/unitypkg/Editor/Tools/screenshot/orbit.cs +103 -0
- package/unitypkg/Editor/Tools/screenshot/scene-view.cs +99 -0
- package/unitypkg/Editor/Tools/screenshot/screen.cs +89 -0
- package/unitypkg/Editor/Tools/screenshot/surround.cs +181 -0
- package/unitypkg/Editor/Tools/scriptable-object/ScriptableObjectToolSupport.cs +196 -0
- package/unitypkg/Editor/Tools/scriptable-object/create.cs +79 -0
- package/unitypkg/Editor/Tools/scriptable-object/info.cs +49 -0
- package/unitypkg/Editor/Tools/scriptable-object/list-types.cs +103 -0
- package/unitypkg/Editor/Tools/scriptable-object/modify.cs +208 -0
- package/unitypkg/Editor/Tools/shader/ShaderToolSupport.cs +326 -0
- package/unitypkg/Editor/Tools/shader/create.cs +82 -0
- package/unitypkg/Editor/Tools/shader/delete.cs +90 -0
- package/unitypkg/Editor/Tools/shader/get-data.cs +125 -0
- package/unitypkg/Editor/Tools/shader/info.cs +48 -0
- package/unitypkg/Editor/Tools/shader/list.cs +82 -0
- package/unitypkg/Editor/Tools/shader/read.cs +84 -0
- package/unitypkg/Editor/Tools/shader/update.cs +71 -0
- package/unitypkg/Editor/Tools/tests/list.cs +98 -0
- package/unitypkg/Editor/Tools/texture/TextureToolSupport.cs +327 -0
- package/unitypkg/Editor/Tools/texture/create.cs +182 -0
- package/unitypkg/Editor/Tools/texture/delete.cs +89 -0
- package/unitypkg/Editor/Tools/texture/generate.cs +189 -0
- package/unitypkg/Editor/Tools/texture/import-settings.cs +104 -0
- package/unitypkg/Editor/Tools/texture/info.cs +50 -0
- package/unitypkg/Editor/Tools/texture/modify.cs +154 -0
- package/unitypkg/Editor/Tools/texture/sprite.cs +132 -0
- package/unitypkg/Editor/Tools/timeline/TimelineMutationToolSupport.cs +696 -0
- package/unitypkg/Editor/Tools/timeline/TimelineReadToolSupport.cs +439 -0
- package/unitypkg/Editor/Tools/timeline/TimelineToolSupport.cs +203 -0
- package/unitypkg/Editor/Tools/timeline/clip/add.cs +93 -0
- package/unitypkg/Editor/Tools/timeline/create.cs +88 -0
- package/unitypkg/Editor/Tools/timeline/info.cs +54 -0
- package/unitypkg/Editor/Tools/timeline/track/add.cs +91 -0
- package/unitypkg/Editor/Tools/ui/UiToolSupport.cs +162 -0
- package/unitypkg/Editor/Tools/ui/UiUguiToolSupport.cs +24 -0
- package/unitypkg/Editor/Tools/ui/attach-document.cs +46 -0
- package/unitypkg/Editor/Tools/ui/button/create.cs +58 -0
- package/unitypkg/Editor/Tools/ui/canvas/create.cs +40 -0
- package/unitypkg/Editor/Tools/ui/create-panel-settings.cs +44 -0
- package/unitypkg/Editor/Tools/ui/detach-document.cs +41 -0
- package/unitypkg/Editor/Tools/ui/document/create.cs +49 -0
- package/unitypkg/Editor/Tools/ui/document/delete.cs +33 -0
- package/unitypkg/Editor/Tools/ui/document/info.cs +33 -0
- package/unitypkg/Editor/Tools/ui/document/update.cs +36 -0
- package/unitypkg/Editor/Tools/ui/get-visual-tree.cs +34 -0
- package/unitypkg/Editor/Tools/ui/hierarchy.cs +27 -0
- package/unitypkg/Editor/Tools/ui/image/create.cs +47 -0
- package/unitypkg/Editor/Tools/ui/link-stylesheet.cs +54 -0
- package/unitypkg/Editor/Tools/ui/list-documents.cs +34 -0
- package/unitypkg/Editor/Tools/ui/modify-visual-element.cs +76 -0
- package/unitypkg/Editor/Tools/ui/render-preview.cs +128 -0
- package/unitypkg/Editor/Tools/ui/text/create.cs +45 -0
- package/unitypkg/Editor/Tools/ui/update-panel-settings.cs +49 -0
- package/unitypkg/Editor/UnityCliBridge.cs +431 -0
- package/unitypkg/Editor/UnityCliBridgeBuildInfo.cs +9 -0
- package/unitypkg/Runtime/Infrastructure/UnityCliRuntimeBridge.cs +580 -0
- package/unitypkg/Runtime/Infrastructure/UnityCliRuntimeJson.cs +232 -0
- package/unitypkg/Runtime/Infrastructure/UnityCliRuntimeRegistry.cs +297 -0
- package/unitypkg/Runtime/Tools/UnityCliRuntimeTools.cs +701 -0
- package/unitypkg/Runtime/UnityCli.Runtime.asmdef +14 -0
- package/unitypkg/Shared/UnityCli.Shared.asmdef +14 -0
- package/unitypkg/Shared/UnityCliAdmissionPool.cs +426 -0
- package/unitypkg/Tests/Editor/UnityCli.Editor.Tests.asmdef +15 -0
- package/unitypkg/Tests/Editor/UnityCliAdmissionPoolTests.cs +262 -0
- package/unitypkg/UnityCli.Editor.asmdef +26 -0
- package/unitypkg/package.json +11 -0
|
@@ -0,0 +1,992 @@
|
|
|
1
|
+
#if UNITY_EDITOR
|
|
2
|
+
using System;
|
|
3
|
+
using System.Collections;
|
|
4
|
+
using System.Collections.Generic;
|
|
5
|
+
using System.Globalization;
|
|
6
|
+
using System.Linq;
|
|
7
|
+
using System.Reflection;
|
|
8
|
+
using System.Runtime.CompilerServices;
|
|
9
|
+
using System.Threading;
|
|
10
|
+
using System.Threading.Tasks;
|
|
11
|
+
using UnityEditor.PackageManager;
|
|
12
|
+
|
|
13
|
+
namespace UnityCli
|
|
14
|
+
{
|
|
15
|
+
/// <summary>官方 Pipeline attribute Tool 的运行时绑定;不进入公开 descriptor。</summary>
|
|
16
|
+
internal sealed class OfficialAttributeToolBinding
|
|
17
|
+
{
|
|
18
|
+
public MethodInfo Method { get; set; }
|
|
19
|
+
public bool MainThreadRequired { get; set; }
|
|
20
|
+
public bool RuntimeOnly { get; set; }
|
|
21
|
+
public Type DeclaredResultType { get; set; }
|
|
22
|
+
public bool NormalizeResultWithNewtonsoft { get; set; }
|
|
23
|
+
public List<OfficialAttributeParameterBinding> Parameters { get; set; }
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/// <summary>一个 attributed method 参数的公开名称、必填性和默认值绑定。</summary>
|
|
27
|
+
internal sealed class OfficialAttributeParameterBinding
|
|
28
|
+
{
|
|
29
|
+
public ParameterInfo Parameter { get; set; }
|
|
30
|
+
public string Name { get; set; }
|
|
31
|
+
public string Description { get; set; }
|
|
32
|
+
public bool Required { get; set; }
|
|
33
|
+
public bool HasDefaultValue { get; set; }
|
|
34
|
+
public object DefaultValue { get; set; }
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public static partial class UnityCliBridge
|
|
38
|
+
{
|
|
39
|
+
private const string OfficialCliCommandAttribute = "Unity.Pipeline.Commands.CliCommandAttribute";
|
|
40
|
+
private const string OfficialCliArgAttribute = "Unity.Pipeline.Commands.CliArgAttribute";
|
|
41
|
+
private const string OfficialStructuredInput = "Unity.Pipeline.Commands.IStructuredCommandInput";
|
|
42
|
+
private const string SuppressedOfficialAttributePackage = "com.unity.pipeline";
|
|
43
|
+
private static Type OfficialCliCommandAttributeType;
|
|
44
|
+
private static Type OfficialCliArgAttributeType;
|
|
45
|
+
private static Type OfficialStructuredInputType;
|
|
46
|
+
private static readonly Dictionary<Assembly, bool> SuppressedOfficialAttributeAssemblies = new Dictionary<Assembly, bool>();
|
|
47
|
+
private static readonly HashSet<Assembly> LoggedSuppressedOfficialAttributeAssemblies = new HashSet<Assembly>();
|
|
48
|
+
// 超时后的 observer 只消费后台 fault,不参与业务取消、执行或完成判定。
|
|
49
|
+
private static readonly CancellationToken FaultObservationToken = new CancellationToken();
|
|
50
|
+
private const string NewtonsoftJsonIgnoreAttribute = "Newtonsoft.Json.JsonIgnoreAttribute";
|
|
51
|
+
private const string NewtonsoftJsonPropertyAttribute = "Newtonsoft.Json.JsonPropertyAttribute";
|
|
52
|
+
|
|
53
|
+
/// <summary>
|
|
54
|
+
/// 从exact com.unity.pipeline Package绑定官方authoring Type identity;同名项目类型不得冒充官方API。
|
|
55
|
+
/// Pipeline未安装时返回空root,出现部分或重复定义时fail closed。
|
|
56
|
+
/// </summary>
|
|
57
|
+
private static List<Assembly> ConfigureOfficialAuthoringApi(Assembly[] assemblies)
|
|
58
|
+
{
|
|
59
|
+
OfficialCliCommandAttributeType = null;
|
|
60
|
+
OfficialCliArgAttributeType = null;
|
|
61
|
+
OfficialStructuredInputType = null;
|
|
62
|
+
var roots = new List<Assembly>();
|
|
63
|
+
foreach (var assembly in assemblies)
|
|
64
|
+
{
|
|
65
|
+
var commandType = assembly.GetType(OfficialCliCommandAttribute, false);
|
|
66
|
+
var argumentType = assembly.GetType(OfficialCliArgAttribute, false);
|
|
67
|
+
var structuredType = assembly.GetType(OfficialStructuredInput, false);
|
|
68
|
+
if (commandType == null && argumentType == null && structuredType == null) continue;
|
|
69
|
+
|
|
70
|
+
PackageInfo package;
|
|
71
|
+
try { package = PackageInfo.FindForAssembly(assembly); }
|
|
72
|
+
catch (Exception exception) { throw new InvalidOperationException("Official authoring API package ownership could not be resolved for " + assembly.FullName + ".", exception); }
|
|
73
|
+
if (package == null || !string.Equals(package.name, SuppressedOfficialAttributePackage, StringComparison.Ordinal)) continue;
|
|
74
|
+
if (!roots.Contains(assembly)) roots.Add(assembly);
|
|
75
|
+
BindOfficialType(ref OfficialCliCommandAttributeType, commandType, OfficialCliCommandAttribute);
|
|
76
|
+
BindOfficialType(ref OfficialCliArgAttributeType, argumentType, OfficialCliArgAttribute);
|
|
77
|
+
BindOfficialType(ref OfficialStructuredInputType, structuredType, OfficialStructuredInput);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
var present = (OfficialCliCommandAttributeType == null ? 0 : 1)
|
|
81
|
+
+ (OfficialCliArgAttributeType == null ? 0 : 1)
|
|
82
|
+
+ (OfficialStructuredInputType == null ? 0 : 1);
|
|
83
|
+
if (present != 0 && present != 3) throw new InvalidOperationException("Official Pipeline authoring API is only partially loaded.");
|
|
84
|
+
return roots;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
private static void BindOfficialType(ref Type target, Type candidate, string fullName)
|
|
88
|
+
{
|
|
89
|
+
if (candidate == null) return;
|
|
90
|
+
if (target != null && target != candidate) throw new InvalidOperationException("Official Pipeline authoring API type is ambiguous: " + fullName + ".");
|
|
91
|
+
target = candidate;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/// <summary>
|
|
95
|
+
/// 扫描一个类型声明的官方 attributed static method。所有候选都先写入 pending registry;
|
|
96
|
+
/// 任一签名、schema、ownership 或名称冲突都会阻止本轮目录发布。
|
|
97
|
+
/// </summary>
|
|
98
|
+
private static void TryRegisterOfficialAttributeTools(Assembly assembly, Type type)
|
|
99
|
+
{
|
|
100
|
+
var methods = type.GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance | BindingFlags.DeclaredOnly)
|
|
101
|
+
.Where(method => FindAttribute(method, OfficialCliCommandAttribute) != null)
|
|
102
|
+
.OrderBy(method => method.MetadataToken)
|
|
103
|
+
.ToArray();
|
|
104
|
+
if (methods.Length == 0) return;
|
|
105
|
+
if (IsSuppressedOfficialAttributeProvider(assembly))
|
|
106
|
+
{
|
|
107
|
+
if (LoggedSuppressedOfficialAttributeAssemblies.Add(assembly))
|
|
108
|
+
WriteLog("official_attribute_provider_suppressed package=" + SuppressedOfficialAttributePackage + " assembly=" + assembly.GetName().Name);
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
foreach (var method in methods)
|
|
113
|
+
{
|
|
114
|
+
var definition = CreateOfficialAttributeTool(assembly, type, method);
|
|
115
|
+
RegisterProjectTool(definition);
|
|
116
|
+
WriteLog("custom_tool_registered name=" + definition.Name + " source=official-attribute type=" + type.FullName + " method=" + method.Name);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/// <summary>
|
|
121
|
+
/// 只按method声明assembly的exact Package ID抑制Pipeline自身命令。
|
|
122
|
+
/// attribute定义assembly、命令名与namespace都不能作为owner,避免误伤项目和其他Package。
|
|
123
|
+
/// </summary>
|
|
124
|
+
private static bool IsSuppressedOfficialAttributeProvider(Assembly assembly)
|
|
125
|
+
{
|
|
126
|
+
bool suppressed;
|
|
127
|
+
if (SuppressedOfficialAttributeAssemblies.TryGetValue(assembly, out suppressed)) return suppressed;
|
|
128
|
+
PackageInfo package;
|
|
129
|
+
try
|
|
130
|
+
{
|
|
131
|
+
package = PackageInfo.FindForAssembly(assembly);
|
|
132
|
+
}
|
|
133
|
+
catch (Exception exception)
|
|
134
|
+
{
|
|
135
|
+
throw new InvalidOperationException("Official attribute provider package ownership could not be resolved for " + assembly.FullName + ".", exception);
|
|
136
|
+
}
|
|
137
|
+
suppressed = package != null && string.Equals(package.name, SuppressedOfficialAttributePackage, StringComparison.Ordinal);
|
|
138
|
+
SuppressedOfficialAttributeAssemblies.Add(assembly, suppressed);
|
|
139
|
+
return suppressed;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/// <summary>从 CustomAttributeData 构造保守 descriptor、严格输入 schema 与方法返回完成契约。</summary>
|
|
143
|
+
private static RegisteredTool CreateOfficialAttributeTool(Assembly assembly, Type implementationType, MethodInfo method)
|
|
144
|
+
{
|
|
145
|
+
if (!method.IsStatic) throw new InvalidOperationException("Official CLI command method must be static: " + MethodIdentity(method) + ".");
|
|
146
|
+
if (method.IsGenericMethodDefinition || method.ContainsGenericParameters)
|
|
147
|
+
throw new InvalidOperationException("Official CLI command method cannot be generic: " + MethodIdentity(method) + ".");
|
|
148
|
+
if (method.ReturnType.IsByRef || method.ReturnType.IsPointer)
|
|
149
|
+
throw new InvalidOperationException("Official CLI command return type is unsupported: " + MethodIdentity(method) + ".");
|
|
150
|
+
if (method.ReturnType == typeof(void) && method.IsDefined(typeof(AsyncStateMachineAttribute), false))
|
|
151
|
+
throw new InvalidOperationException("Official CLI command cannot use async void: " + MethodIdentity(method) + ".");
|
|
152
|
+
|
|
153
|
+
var command = FindAttribute(method, OfficialCliCommandAttribute);
|
|
154
|
+
var name = ConstructorString(command, 0, "name", method);
|
|
155
|
+
var description = ConstructorString(command, 1, "description", method);
|
|
156
|
+
if (string.IsNullOrWhiteSpace(name) || !string.Equals(name, name.Trim(), StringComparison.Ordinal) || name.Any(char.IsWhiteSpace))
|
|
157
|
+
throw new InvalidOperationException("Official CLI command name must be one non-empty token without whitespace: " + MethodIdentity(method) + ".");
|
|
158
|
+
var toolName = OfficialAttributeToolPrefix + name;
|
|
159
|
+
if (string.IsNullOrWhiteSpace(description))
|
|
160
|
+
throw new InvalidOperationException("Official CLI command description is required: " + MethodIdentity(method) + ".");
|
|
161
|
+
|
|
162
|
+
var mainThreadRequired = NamedBoolean(command, "MainThreadRequired", true);
|
|
163
|
+
var runtimeOnly = NamedBoolean(command, "RuntimeOnly", false);
|
|
164
|
+
var parameters = method.GetParameters().Select(BuildOfficialParameter).ToList();
|
|
165
|
+
var duplicateParameter = parameters.GroupBy(parameter => parameter.Name, StringComparer.Ordinal).FirstOrDefault(group => group.Count() > 1);
|
|
166
|
+
if (duplicateParameter != null)
|
|
167
|
+
throw new InvalidOperationException("Official CLI command contains duplicate projected parameter name " + duplicateParameter.Key + ": " + MethodIdentity(method) + ".");
|
|
168
|
+
|
|
169
|
+
var inputSchema = BuildOfficialInputSchema(name, description, parameters);
|
|
170
|
+
var output = BuildOfficialOutputContract(method.ReturnType);
|
|
171
|
+
var exampleInput = parameters.ToDictionary(parameter => parameter.Name, OfficialExampleValue, StringComparer.Ordinal);
|
|
172
|
+
var playModeSupport = runtimeOnly ? "runtime-only" : "unknown";
|
|
173
|
+
var binding = new OfficialAttributeToolBinding
|
|
174
|
+
{
|
|
175
|
+
Method = method,
|
|
176
|
+
MainThreadRequired = mainThreadRequired,
|
|
177
|
+
RuntimeOnly = runtimeOnly,
|
|
178
|
+
DeclaredResultType = output.DeclaredType,
|
|
179
|
+
NormalizeResultWithNewtonsoft = output.NormalizeWithNewtonsoft,
|
|
180
|
+
Parameters = parameters
|
|
181
|
+
};
|
|
182
|
+
var ownership = registryOwnership.Resolve(implementationType);
|
|
183
|
+
if (!string.Equals(ownership, "project", StringComparison.Ordinal))
|
|
184
|
+
throw new InvalidOperationException("Official attribute Tool ownership must resolve to project or third-party code: " + MethodIdentity(method) + ".");
|
|
185
|
+
|
|
186
|
+
var completion = new UnityCliToolCompletionContract(
|
|
187
|
+
toolName,
|
|
188
|
+
"project",
|
|
189
|
+
"direct-terminal",
|
|
190
|
+
"external",
|
|
191
|
+
"attributed-method-return-v1",
|
|
192
|
+
"official-attributed-method-return",
|
|
193
|
+
"outcome-unknown-after-dispatch",
|
|
194
|
+
"E_EXECUTION_TIMEOUT",
|
|
195
|
+
"method-may-still-be-running",
|
|
196
|
+
"official-method-return-v1",
|
|
197
|
+
"required",
|
|
198
|
+
true);
|
|
199
|
+
|
|
200
|
+
return new RegisteredTool
|
|
201
|
+
{
|
|
202
|
+
Name = toolName,
|
|
203
|
+
Summary = OfficialSummary(description),
|
|
204
|
+
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
|
+
Group = OfficialAttributeToolGroup,
|
|
206
|
+
Source = "project",
|
|
207
|
+
Ownership = "project",
|
|
208
|
+
InputSchema = UnityCliSerializer.Serialize(inputSchema),
|
|
209
|
+
OutputSchema = output.Schema,
|
|
210
|
+
DestructiveHint = true,
|
|
211
|
+
SideEffects = new[] { "arbitrary-method-invocation" },
|
|
212
|
+
SupportsDryRun = false,
|
|
213
|
+
Permissions = new[] { "execute-user-code" },
|
|
214
|
+
RequiresPackages = new string[0],
|
|
215
|
+
Examples = new[]
|
|
216
|
+
{
|
|
217
|
+
new ToolExample
|
|
218
|
+
{
|
|
219
|
+
Description = "Valid invocation using schema defaults or generated placeholders. Use these values only for default behavior; replace them with caller-requested business values before execution.",
|
|
220
|
+
Input = exampleInput
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
Target = "editor",
|
|
224
|
+
AvailabilityScope = runtimeOnly ? "playModeSession" : "editorSession",
|
|
225
|
+
PlayModeSupport = playModeSupport,
|
|
226
|
+
ContractProfile = "official-attribute",
|
|
227
|
+
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)
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/// <summary>解析参数 attribute,严格验证签名和默认值可转换性。</summary>
|
|
243
|
+
private static OfficialAttributeParameterBinding BuildOfficialParameter(ParameterInfo parameter)
|
|
244
|
+
{
|
|
245
|
+
var parameterType = parameter.ParameterType;
|
|
246
|
+
if (parameter.IsOut || parameterType.IsByRef || parameterType.IsPointer || parameter.GetRequiredCustomModifiers().Length > 0)
|
|
247
|
+
throw new InvalidOperationException("Official CLI command parameter type is unsupported: " + parameter.Member.DeclaringType.FullName + "." + parameter.Member.Name + "(" + parameter.Name + ").");
|
|
248
|
+
|
|
249
|
+
var attribute = FindAttribute(parameter, OfficialCliArgAttribute);
|
|
250
|
+
var name = attribute == null ? parameter.Name : ConstructorString(attribute, 0, "name", parameter.Member as MethodInfo);
|
|
251
|
+
var description = attribute == null ? "Parameter: " + parameter.Name : ConstructorString(attribute, 1, "description", parameter.Member as MethodInfo);
|
|
252
|
+
if (string.IsNullOrWhiteSpace(name) || !string.Equals(name, name.Trim(), StringComparison.Ordinal))
|
|
253
|
+
throw new InvalidOperationException("Official CLI argument name must be non-empty without surrounding whitespace: " + parameter.Name + ".");
|
|
254
|
+
|
|
255
|
+
var required = attribute == null ? !parameter.HasDefaultValue : NamedBoolean(attribute, "Required", false);
|
|
256
|
+
object defaultValue = null;
|
|
257
|
+
var hasDefault = false;
|
|
258
|
+
if (parameter.HasDefaultValue && parameter.DefaultValue != DBNull.Value && parameter.DefaultValue != Missing.Value)
|
|
259
|
+
{
|
|
260
|
+
hasDefault = true;
|
|
261
|
+
defaultValue = parameter.DefaultValue;
|
|
262
|
+
}
|
|
263
|
+
else if (attribute != null && TryNamedValue(attribute, "DefaultValue", out defaultValue))
|
|
264
|
+
{
|
|
265
|
+
hasDefault = true;
|
|
266
|
+
}
|
|
267
|
+
if (hasDefault) defaultValue = ConvertOfficialArgument(defaultValue, parameterType);
|
|
268
|
+
|
|
269
|
+
// 构造 schema 会递归验证 structured member 名称、环和可转换类型。
|
|
270
|
+
BuildOfficialTypeSchema(parameterType, new HashSet<Type>());
|
|
271
|
+
return new OfficialAttributeParameterBinding
|
|
272
|
+
{
|
|
273
|
+
Parameter = parameter,
|
|
274
|
+
Name = name,
|
|
275
|
+
Description = description,
|
|
276
|
+
Required = required,
|
|
277
|
+
HasDefaultValue = hasDefault,
|
|
278
|
+
DefaultValue = defaultValue
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/// <summary>执行 attributed method;effect barrier 位于首次 method dispatch 之前。</summary>
|
|
283
|
+
private static async ValueTask<object> InvokeOfficialAttributeTool(OfficialAttributeToolBinding binding, object request, UnityCliProjectToolContext context, CancellationToken cancellationToken)
|
|
284
|
+
{
|
|
285
|
+
var input = request as IDictionary<string, object>;
|
|
286
|
+
if (input == null) throw new FormatException("Official attribute Tool input must be a JSON object.");
|
|
287
|
+
var arguments = new object[binding.Parameters.Count];
|
|
288
|
+
for (var index = 0; index < binding.Parameters.Count; index++)
|
|
289
|
+
{
|
|
290
|
+
var parameter = binding.Parameters[index];
|
|
291
|
+
try
|
|
292
|
+
{
|
|
293
|
+
object value;
|
|
294
|
+
if (input.TryGetValue(parameter.Name, out value)) arguments[index] = ConvertOfficialArgument(value, parameter.Parameter.ParameterType);
|
|
295
|
+
else if (parameter.HasDefaultValue) arguments[index] = parameter.DefaultValue;
|
|
296
|
+
else arguments[index] = DefaultValue(parameter.Parameter.ParameterType);
|
|
297
|
+
}
|
|
298
|
+
catch (BridgeCommandException)
|
|
299
|
+
{
|
|
300
|
+
throw;
|
|
301
|
+
}
|
|
302
|
+
catch
|
|
303
|
+
{
|
|
304
|
+
throw new BridgeCommandException(
|
|
305
|
+
"E_SCHEMA_INVALID",
|
|
306
|
+
"Attributed command input could not be converted at $." + parameter.Name + ".",
|
|
307
|
+
new Dictionary<string, object>
|
|
308
|
+
{
|
|
309
|
+
{ "path", "$." + parameter.Name },
|
|
310
|
+
{ "expected", OfficialTypeName(parameter.Parameter.ParameterType) },
|
|
311
|
+
{ "actual", "conversion failed" }
|
|
312
|
+
},
|
|
313
|
+
new[] { "Run tools describe again and provide a value accepted by the attributed parameter schema." });
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
context.CommitEffect();
|
|
318
|
+
object rawResult;
|
|
319
|
+
if (binding.MainThreadRequired)
|
|
320
|
+
{
|
|
321
|
+
rawResult = binding.Method.Invoke(null, arguments);
|
|
322
|
+
}
|
|
323
|
+
else
|
|
324
|
+
{
|
|
325
|
+
rawResult = await Task.Run(() => binding.Method.Invoke(null, arguments), cancellationToken).ConfigureAwait(false);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
if (rawResult is Task task)
|
|
329
|
+
{
|
|
330
|
+
await AwaitOfficialTask(task, cancellationToken).ConfigureAwait(false);
|
|
331
|
+
if (binding.DeclaredResultType == typeof(void))
|
|
332
|
+
{
|
|
333
|
+
rawResult = null;
|
|
334
|
+
}
|
|
335
|
+
else
|
|
336
|
+
{
|
|
337
|
+
var resultProperty = task.GetType().GetProperty("Result", BindingFlags.Public | BindingFlags.Instance);
|
|
338
|
+
rawResult = resultProperty == null ? null : resultProperty.GetValue(task, null);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
return NormalizeOfficialResult(rawResult, binding.DeclaredResultType, binding.NormalizeResultWithNewtonsoft);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/// <summary>timeout 后 attributed Task 可能继续运行;只停止等待并观察其后续 fault,绝不宣称取消成功。</summary>
|
|
345
|
+
private static async Task AwaitOfficialTask(Task task, CancellationToken cancellationToken)
|
|
346
|
+
{
|
|
347
|
+
if (task.IsCompleted)
|
|
348
|
+
{
|
|
349
|
+
await task.ConfigureAwait(false);
|
|
350
|
+
return;
|
|
351
|
+
}
|
|
352
|
+
var cancellation = Task.Delay(Timeout.Infinite, cancellationToken);
|
|
353
|
+
if (await Task.WhenAny(task, cancellation).ConfigureAwait(false) != task)
|
|
354
|
+
{
|
|
355
|
+
_ = task.ContinueWith(completed => { var ignored = completed.Exception; }, FaultObservationToken, TaskContinuationOptions.OnlyOnFaulted | TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
|
|
356
|
+
throw new OperationCanceledException(cancellationToken);
|
|
357
|
+
}
|
|
358
|
+
await task.ConfigureAwait(false);
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/// <summary>官方 descriptor 输入 schema 是严格 object;未知字段与缺失 required 在 dispatch 前失败。</summary>
|
|
362
|
+
private static Dictionary<string, object> BuildOfficialInputSchema(string name, string description, List<OfficialAttributeParameterBinding> parameters)
|
|
363
|
+
{
|
|
364
|
+
var properties = new Dictionary<string, object>(StringComparer.Ordinal);
|
|
365
|
+
foreach (var parameter in parameters)
|
|
366
|
+
{
|
|
367
|
+
var valueSchema = BuildOfficialTypeSchema(parameter.Parameter.ParameterType, new HashSet<Type>());
|
|
368
|
+
var acceptsNull = !parameter.Required && OfficialTypeAcceptsNull(parameter.Parameter.ParameterType)
|
|
369
|
+
&& !valueSchema.ContainsKey("x-unityCliAnyJson");
|
|
370
|
+
var schema = acceptsNull
|
|
371
|
+
? new Dictionary<string, object> { { "oneOf", new object[] { valueSchema, TypeSchema("null") } } }
|
|
372
|
+
: valueSchema;
|
|
373
|
+
schema["description"] = parameter.Description;
|
|
374
|
+
if (parameter.HasDefaultValue && !(parameter.Required && OfficialRequiredValueMissing(parameter.DefaultValue)))
|
|
375
|
+
schema["default"] = NormalizeOfficialResult(parameter.DefaultValue, parameter.Parameter.ParameterType);
|
|
376
|
+
properties.Add(parameter.Name, schema);
|
|
377
|
+
}
|
|
378
|
+
return new Dictionary<string, object>
|
|
379
|
+
{
|
|
380
|
+
{ "type", "object" },
|
|
381
|
+
{ "title", name },
|
|
382
|
+
{ "description", description },
|
|
383
|
+
{ "properties", properties },
|
|
384
|
+
{ "required", parameters.Where(parameter => parameter.Required).Select(parameter => parameter.Name).ToArray() },
|
|
385
|
+
{ "additionalProperties", false }
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
/// <summary>递归派生官方 scalar/enum/collection/structured schema;未知类型显式降级为任意 JSON。</summary>
|
|
390
|
+
private static Dictionary<string, object> BuildOfficialTypeSchema(Type rawType, HashSet<Type> visited)
|
|
391
|
+
{
|
|
392
|
+
var type = Nullable.GetUnderlyingType(rawType) ?? rawType;
|
|
393
|
+
if (type == typeof(object)) return AnyJsonSchema();
|
|
394
|
+
if (type == typeof(string)) return TypeSchema("string");
|
|
395
|
+
if (type == typeof(char)) return new Dictionary<string, object> { { "type", "string" }, { "minLength", 1 }, { "maxLength", 1 } };
|
|
396
|
+
if (type == typeof(bool)) return TypeSchema("boolean");
|
|
397
|
+
if (UnityCliSchemaDeriver.IsInteger(type)) return TypeSchema("integer");
|
|
398
|
+
if (UnityCliSchemaDeriver.IsNumber(type)) return TypeSchema("number");
|
|
399
|
+
if (type.IsEnum) return new Dictionary<string, object> { { "type", "string" }, { "enum", Enum.GetNames(type) } };
|
|
400
|
+
if (type == typeof(DateTime) || type == typeof(DateTimeOffset)) return new Dictionary<string, object> { { "type", "string" }, { "format", "date-time" } };
|
|
401
|
+
if (type == typeof(Guid)) return new Dictionary<string, object> { { "type", "string" }, { "format", "uuid" } };
|
|
402
|
+
|
|
403
|
+
Type dictionaryValueType;
|
|
404
|
+
if (TryOfficialDictionaryValueType(type, out dictionaryValueType))
|
|
405
|
+
return new Dictionary<string, object> { { "type", "object" }, { "additionalProperties", BuildOfficialTypeSchema(dictionaryValueType, visited) } };
|
|
406
|
+
|
|
407
|
+
Type elementType;
|
|
408
|
+
if (TryOfficialElementType(type, out elementType))
|
|
409
|
+
return new Dictionary<string, object> { { "type", "array" }, { "items", BuildOfficialTypeSchema(elementType, visited) } };
|
|
410
|
+
|
|
411
|
+
if (IsOfficialStructuredInput(type))
|
|
412
|
+
{
|
|
413
|
+
if (type.IsAbstract || type.IsInterface) throw new InvalidOperationException("Official structured input must be a concrete type: " + type.FullName + ".");
|
|
414
|
+
if (!visited.Add(type)) throw new InvalidOperationException("Official structured input cannot contain a recursive type cycle: " + type.FullName + ".");
|
|
415
|
+
try
|
|
416
|
+
{
|
|
417
|
+
var members = OfficialStructuredMembers(type);
|
|
418
|
+
var duplicate = members.GroupBy(member => member.Name, StringComparer.Ordinal).FirstOrDefault(group => group.Count() > 1);
|
|
419
|
+
if (duplicate != null) throw new InvalidOperationException("Official structured input contains duplicate projected member name " + duplicate.Key + ": " + type.FullName + ".");
|
|
420
|
+
var properties = new Dictionary<string, object>(StringComparer.Ordinal);
|
|
421
|
+
foreach (var member in members)
|
|
422
|
+
{
|
|
423
|
+
var schema = BuildOfficialTypeSchema(member.Type, visited);
|
|
424
|
+
if (!string.IsNullOrWhiteSpace(member.Description)) schema["description"] = member.Description;
|
|
425
|
+
properties.Add(member.Name, schema);
|
|
426
|
+
}
|
|
427
|
+
return new Dictionary<string, object>
|
|
428
|
+
{
|
|
429
|
+
{ "type", "object" },
|
|
430
|
+
{ "properties", properties },
|
|
431
|
+
{ "required", members.Where(member => member.Required).Select(member => member.Name).ToArray() },
|
|
432
|
+
{ "additionalProperties", false }
|
|
433
|
+
};
|
|
434
|
+
}
|
|
435
|
+
finally
|
|
436
|
+
{
|
|
437
|
+
visited.Remove(type);
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
return AnyJsonSchema();
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
/// <summary>输出类型可由原生 deriver证明时保留 concrete schema,否则显式任意 JSON。</summary>
|
|
445
|
+
private static OfficialOutputContract BuildOfficialOutputContract(Type returnType)
|
|
446
|
+
{
|
|
447
|
+
Type declaredType;
|
|
448
|
+
if (returnType == typeof(void) || returnType == typeof(Task))
|
|
449
|
+
declaredType = typeof(void);
|
|
450
|
+
else if (returnType.IsGenericType && returnType.GetGenericTypeDefinition() == typeof(Task<>))
|
|
451
|
+
declaredType = returnType.GetGenericArguments()[0];
|
|
452
|
+
else if (typeof(Task).IsAssignableFrom(returnType) || IsAwaitableType(returnType))
|
|
453
|
+
throw new InvalidOperationException("Official CLI command asynchronous return type must be Task or Task<T>: " + returnType.FullName + ".");
|
|
454
|
+
else
|
|
455
|
+
declaredType = returnType;
|
|
456
|
+
|
|
457
|
+
if (declaredType == typeof(void))
|
|
458
|
+
return new OfficialOutputContract { DeclaredType = declaredType, ValidationType = typeof(void), Schema = "{\"type\":\"null\"}", NormalizeWithNewtonsoft = false };
|
|
459
|
+
if (declaredType == typeof(DateTime) || declaredType == typeof(DateTimeOffset) || declaredType == typeof(Guid) || declaredType == typeof(object))
|
|
460
|
+
return new OfficialOutputContract { DeclaredType = declaredType, ValidationType = typeof(object), Schema = UnityCliSerializer.Serialize(AnyJsonSchema()), NormalizeWithNewtonsoft = true };
|
|
461
|
+
try
|
|
462
|
+
{
|
|
463
|
+
return new OfficialOutputContract
|
|
464
|
+
{
|
|
465
|
+
DeclaredType = declaredType,
|
|
466
|
+
ValidationType = declaredType,
|
|
467
|
+
Schema = UnityCliSchemaDeriver.DeriveSchema(declaredType),
|
|
468
|
+
NormalizeWithNewtonsoft = false
|
|
469
|
+
};
|
|
470
|
+
}
|
|
471
|
+
catch
|
|
472
|
+
{
|
|
473
|
+
return new OfficialOutputContract { DeclaredType = declaredType, ValidationType = typeof(object), Schema = UnityCliSerializer.Serialize(AnyJsonSchema()), NormalizeWithNewtonsoft = true };
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
/// <summary>把公开 JSON value 严格转换为 attributed method 参数;失败不会回退默认值。</summary>
|
|
478
|
+
private static object ConvertOfficialArgument(object value, Type rawType)
|
|
479
|
+
{
|
|
480
|
+
if (value == null)
|
|
481
|
+
{
|
|
482
|
+
if (Nullable.GetUnderlyingType(rawType) != null || !rawType.IsValueType) return null;
|
|
483
|
+
throw new FormatException("JSON null is not valid for " + rawType.FullName + ".");
|
|
484
|
+
}
|
|
485
|
+
var type = Nullable.GetUnderlyingType(rawType) ?? rawType;
|
|
486
|
+
if (type == typeof(object)) return value;
|
|
487
|
+
if (type.IsEnum && !(value is string))
|
|
488
|
+
{
|
|
489
|
+
try { return Enum.ToObject(type, value); }
|
|
490
|
+
catch { throw new FormatException("Default enum value is invalid for " + type.FullName + "."); }
|
|
491
|
+
}
|
|
492
|
+
if (type == typeof(DateTime))
|
|
493
|
+
{
|
|
494
|
+
DateTime parsed;
|
|
495
|
+
if (value is string && DateTime.TryParse((string)value, CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind, out parsed)) return parsed;
|
|
496
|
+
throw new FormatException("Expected an ISO-8601 date-time string.");
|
|
497
|
+
}
|
|
498
|
+
if (type == typeof(DateTimeOffset))
|
|
499
|
+
{
|
|
500
|
+
DateTimeOffset parsed;
|
|
501
|
+
if (value is string && DateTimeOffset.TryParse((string)value, CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind, out parsed)) return parsed;
|
|
502
|
+
throw new FormatException("Expected an ISO-8601 date-time string.");
|
|
503
|
+
}
|
|
504
|
+
if (type == typeof(Guid))
|
|
505
|
+
{
|
|
506
|
+
Guid parsed;
|
|
507
|
+
if (value is string && Guid.TryParse((string)value, out parsed)) return parsed;
|
|
508
|
+
throw new FormatException("Expected a UUID string.");
|
|
509
|
+
}
|
|
510
|
+
if (IsNewtonsoftJsonTokenType(type)) return ConvertNewtonsoftJsonValue(value, type);
|
|
511
|
+
var normalized = NormalizeOfficialInput(value, type);
|
|
512
|
+
return UnityCliSerializer.Deserialize(UnityCliSerializer.Serialize(normalized), rawType);
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
/// <summary>将 structured input 的 CliArg/JsonProperty 名映射回 CLR member 名后交给统一 serializer。</summary>
|
|
516
|
+
private static object NormalizeOfficialInput(object value, Type rawType)
|
|
517
|
+
{
|
|
518
|
+
var type = Nullable.GetUnderlyingType(rawType) ?? rawType;
|
|
519
|
+
if (value == null) return null;
|
|
520
|
+
Type dictionaryValueType;
|
|
521
|
+
if (TryOfficialDictionaryValueType(type, out dictionaryValueType))
|
|
522
|
+
{
|
|
523
|
+
var dictionary = value as IDictionary<string, object>;
|
|
524
|
+
if (dictionary == null) return value;
|
|
525
|
+
return dictionary.ToDictionary(pair => pair.Key, pair => NormalizeOfficialInput(pair.Value, dictionaryValueType), StringComparer.Ordinal);
|
|
526
|
+
}
|
|
527
|
+
Type elementType;
|
|
528
|
+
if (TryOfficialElementType(type, out elementType))
|
|
529
|
+
{
|
|
530
|
+
var list = value as IList;
|
|
531
|
+
if (list == null) return value;
|
|
532
|
+
return list.Cast<object>().Select(item => NormalizeOfficialInput(item, elementType)).ToList();
|
|
533
|
+
}
|
|
534
|
+
if (!IsOfficialStructuredInput(type)) return value;
|
|
535
|
+
var source = value as IDictionary<string, object>;
|
|
536
|
+
if (source == null) return value;
|
|
537
|
+
var normalized = new Dictionary<string, object>(StringComparer.Ordinal);
|
|
538
|
+
foreach (var member in OfficialStructuredMembers(type))
|
|
539
|
+
{
|
|
540
|
+
object child;
|
|
541
|
+
if (source.TryGetValue(member.Name, out child)) normalized[UnityCliSchemaDeriver.ToCamelCase(member.Member.Name)] = NormalizeOfficialInput(child, member.Type);
|
|
542
|
+
}
|
|
543
|
+
return normalized;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
/// <summary>把official method结果递归归一为统一serializer可验证的普通JSON value tree。</summary>
|
|
547
|
+
private static object NormalizeOfficialResult(object value, Type declaredType)
|
|
548
|
+
{
|
|
549
|
+
return NormalizeOfficialResult(value, declaredType, false);
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
private static object NormalizeOfficialResult(object value, Type declaredType, bool preferNewtonsoft)
|
|
553
|
+
{
|
|
554
|
+
if (value == null) return null;
|
|
555
|
+
var type = Nullable.GetUnderlyingType(declaredType) ?? declaredType;
|
|
556
|
+
var valueType = value.GetType();
|
|
557
|
+
if (valueType == typeof(DateTime)) return ((DateTime)value).ToString("o", CultureInfo.InvariantCulture);
|
|
558
|
+
if (valueType == typeof(DateTimeOffset)) return ((DateTimeOffset)value).ToString("o", CultureInfo.InvariantCulture);
|
|
559
|
+
if (valueType == typeof(Guid)) return ((Guid)value).ToString("D");
|
|
560
|
+
if (valueType.IsEnum) return value.ToString();
|
|
561
|
+
if (IsNewtonsoftJsonTokenType(valueType)) return NormalizeNewtonsoftJsonValue(value, valueType);
|
|
562
|
+
if (value is IDictionary dictionary)
|
|
563
|
+
{
|
|
564
|
+
var result = new Dictionary<string, object>(StringComparer.Ordinal);
|
|
565
|
+
foreach (DictionaryEntry item in dictionary)
|
|
566
|
+
{
|
|
567
|
+
var childType = item.Value == null ? typeof(object) : item.Value.GetType();
|
|
568
|
+
result[Convert.ToString(item.Key, CultureInfo.InvariantCulture)] = NormalizeOfficialResult(item.Value, childType, preferNewtonsoft);
|
|
569
|
+
}
|
|
570
|
+
return result;
|
|
571
|
+
}
|
|
572
|
+
if (!(value is string) && value is IEnumerable sequence)
|
|
573
|
+
{
|
|
574
|
+
var result = new List<object>();
|
|
575
|
+
foreach (var item in sequence) result.Add(NormalizeOfficialResult(item, item == null ? typeof(object) : item.GetType(), preferNewtonsoft));
|
|
576
|
+
return result;
|
|
577
|
+
}
|
|
578
|
+
if (type.IsPrimitive || value is string || value is decimal) return value;
|
|
579
|
+
object normalized;
|
|
580
|
+
return preferNewtonsoft && TryNormalizeWithNewtonsoftJson(value, out normalized) ? normalized : value;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
/// <summary>执行前按同一参数 binding 验证 required、unknown field 与严格 CLR 转换。</summary>
|
|
584
|
+
private static SchemaValidationFailure ValidateOfficialAttributeInput(OfficialAttributeToolBinding binding, string inputJson)
|
|
585
|
+
{
|
|
586
|
+
object value;
|
|
587
|
+
try { value = UnityCliSerializer.Parse(inputJson); }
|
|
588
|
+
catch (Exception exception) when (exception is FormatException || exception is OverflowException)
|
|
589
|
+
{
|
|
590
|
+
return Failure("$", "valid JSON object", "malformed JSON", exception.Message);
|
|
591
|
+
}
|
|
592
|
+
var input = value as IDictionary<string, object>;
|
|
593
|
+
if (input == null) return Failure("$", "object", ActualType(value));
|
|
594
|
+
var known = binding.Parameters.ToDictionary(parameter => parameter.Name, parameter => parameter, StringComparer.Ordinal);
|
|
595
|
+
foreach (var key in input.Keys)
|
|
596
|
+
if (!known.ContainsKey(key)) return Failure("$." + key, "known property", "unknown property");
|
|
597
|
+
foreach (var parameter in binding.Parameters)
|
|
598
|
+
{
|
|
599
|
+
object child;
|
|
600
|
+
if (!input.TryGetValue(parameter.Name, out child))
|
|
601
|
+
{
|
|
602
|
+
if (parameter.Required) return Failure("$." + parameter.Name, "required property", "missing");
|
|
603
|
+
continue;
|
|
604
|
+
}
|
|
605
|
+
if (parameter.Required && (child == null || child is string && string.IsNullOrEmpty((string)child)))
|
|
606
|
+
return Failure("$." + parameter.Name, "non-empty required value", child == null ? "null" : "empty string");
|
|
607
|
+
var failure = ValidateOfficialAttributeValue(child, parameter.Parameter.ParameterType, "$." + parameter.Name);
|
|
608
|
+
if (failure != null) return failure;
|
|
609
|
+
}
|
|
610
|
+
return null;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
/// <summary>递归验证官方 structured input;unknown、required 与 CLR 类型必须在 effect barrier 前失败。</summary>
|
|
614
|
+
private static SchemaValidationFailure ValidateOfficialAttributeValue(object value, Type rawType, string path)
|
|
615
|
+
{
|
|
616
|
+
var nullableType = Nullable.GetUnderlyingType(rawType);
|
|
617
|
+
if (value == null)
|
|
618
|
+
{
|
|
619
|
+
return nullableType != null || !rawType.IsValueType
|
|
620
|
+
? null
|
|
621
|
+
: Failure(path, OfficialTypeName(rawType), "null");
|
|
622
|
+
}
|
|
623
|
+
var type = nullableType ?? rawType;
|
|
624
|
+
if (type == typeof(object)) return null;
|
|
625
|
+
if (type == typeof(string)) return value is string ? null : Failure(path, "string", ActualType(value));
|
|
626
|
+
if (type == typeof(char))
|
|
627
|
+
{
|
|
628
|
+
var character = value as string;
|
|
629
|
+
return character != null && character.Length == 1
|
|
630
|
+
? null
|
|
631
|
+
: Failure(path, "single-character string", ActualType(value));
|
|
632
|
+
}
|
|
633
|
+
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);
|
|
636
|
+
if (type.IsEnum)
|
|
637
|
+
{
|
|
638
|
+
var enumName = value as string;
|
|
639
|
+
return enumName != null && Enum.GetNames(type).Contains(enumName, StringComparer.Ordinal)
|
|
640
|
+
? null
|
|
641
|
+
: Failure(path, "enum(" + string.Join("|", Enum.GetNames(type)) + ")", ActualType(value));
|
|
642
|
+
}
|
|
643
|
+
if (type == typeof(DateTime) || type == typeof(DateTimeOffset) || type == typeof(Guid))
|
|
644
|
+
{
|
|
645
|
+
try { ConvertOfficialArgument(value, type); return null; }
|
|
646
|
+
catch (Exception exception) when (exception is FormatException || exception is OverflowException || exception is InvalidCastException)
|
|
647
|
+
{
|
|
648
|
+
return Failure(path, OfficialTypeName(type), ActualType(value));
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
Type dictionaryValueType;
|
|
653
|
+
if (TryOfficialDictionaryValueType(type, out dictionaryValueType))
|
|
654
|
+
{
|
|
655
|
+
var dictionary = value as IDictionary<string, object>;
|
|
656
|
+
if (dictionary == null) return Failure(path, "object", ActualType(value));
|
|
657
|
+
foreach (var pair in dictionary)
|
|
658
|
+
{
|
|
659
|
+
var valueFailure = ValidateOfficialAttributeValue(pair.Value, dictionaryValueType, path + "." + pair.Key);
|
|
660
|
+
if (valueFailure != null) return valueFailure;
|
|
661
|
+
}
|
|
662
|
+
return null;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
Type elementType;
|
|
666
|
+
if (TryOfficialElementType(type, out elementType))
|
|
667
|
+
{
|
|
668
|
+
var items = value as IList;
|
|
669
|
+
if (items == null) return Failure(path, "array", ActualType(value));
|
|
670
|
+
for (var index = 0; index < items.Count; index++)
|
|
671
|
+
{
|
|
672
|
+
var itemFailure = ValidateOfficialAttributeValue(items[index], elementType, path + "[" + index.ToString(CultureInfo.InvariantCulture) + "]");
|
|
673
|
+
if (itemFailure != null) return itemFailure;
|
|
674
|
+
}
|
|
675
|
+
return null;
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
if (!IsOfficialStructuredInput(type)) return null;
|
|
679
|
+
var input = value as IDictionary<string, object>;
|
|
680
|
+
if (input == null) return Failure(path, "object", ActualType(value));
|
|
681
|
+
var members = OfficialStructuredMembers(type);
|
|
682
|
+
var knownMembers = members.ToDictionary(member => member.Name, member => member, StringComparer.Ordinal);
|
|
683
|
+
foreach (var key in input.Keys)
|
|
684
|
+
if (!knownMembers.ContainsKey(key)) return Failure(path + "." + key, "known property", "unknown property");
|
|
685
|
+
foreach (var member in members)
|
|
686
|
+
{
|
|
687
|
+
object child;
|
|
688
|
+
if (!input.TryGetValue(member.Name, out child))
|
|
689
|
+
{
|
|
690
|
+
if (member.Required) return Failure(path + "." + member.Name, "required property", "missing");
|
|
691
|
+
continue;
|
|
692
|
+
}
|
|
693
|
+
if (member.Required && (child == null || child is string && string.IsNullOrEmpty((string)child)))
|
|
694
|
+
return Failure(path + "." + member.Name, "non-empty required value", child == null ? "null" : "empty string");
|
|
695
|
+
var childFailure = ValidateOfficialAttributeValue(child, member.Type, path + "." + member.Name);
|
|
696
|
+
if (childFailure != null) return childFailure;
|
|
697
|
+
}
|
|
698
|
+
return null;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
private sealed class OfficialStructuredMember
|
|
702
|
+
{
|
|
703
|
+
public MemberInfo Member;
|
|
704
|
+
public string Name;
|
|
705
|
+
public string Description;
|
|
706
|
+
public Type Type;
|
|
707
|
+
public bool Required;
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
private sealed class OfficialOutputContract
|
|
711
|
+
{
|
|
712
|
+
public Type DeclaredType;
|
|
713
|
+
public Type ValidationType;
|
|
714
|
+
public string Schema;
|
|
715
|
+
public bool NormalizeWithNewtonsoft;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
/// <summary>枚举 structured DTO 的 public writable member,并读取 CliArg/Json.NET name。</summary>
|
|
719
|
+
private static List<OfficialStructuredMember> OfficialStructuredMembers(Type type)
|
|
720
|
+
{
|
|
721
|
+
var members = new List<OfficialStructuredMember>();
|
|
722
|
+
foreach (var field in type.GetFields(BindingFlags.Public | BindingFlags.Instance).OrderBy(field => field.MetadataToken))
|
|
723
|
+
{
|
|
724
|
+
if (field.IsInitOnly || field.IsLiteral || FindAttribute(field, NewtonsoftJsonIgnoreAttribute) != null) continue;
|
|
725
|
+
members.Add(BuildOfficialStructuredMember(field, field.FieldType));
|
|
726
|
+
}
|
|
727
|
+
foreach (var property in type.GetProperties(BindingFlags.Public | BindingFlags.Instance).OrderBy(property => property.MetadataToken))
|
|
728
|
+
{
|
|
729
|
+
if (!property.CanRead || !property.CanWrite || property.GetIndexParameters().Length > 0 || FindAttribute(property, NewtonsoftJsonIgnoreAttribute) != null) continue;
|
|
730
|
+
members.Add(BuildOfficialStructuredMember(property, property.PropertyType));
|
|
731
|
+
}
|
|
732
|
+
return members;
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
private static OfficialStructuredMember BuildOfficialStructuredMember(MemberInfo member, Type memberType)
|
|
736
|
+
{
|
|
737
|
+
var cliArg = FindAttribute(member, OfficialCliArgAttribute);
|
|
738
|
+
var jsonProperty = FindAttribute(member, NewtonsoftJsonPropertyAttribute);
|
|
739
|
+
var name = cliArg != null
|
|
740
|
+
? ConstructorString(cliArg, 0, "name", null)
|
|
741
|
+
: jsonProperty != null && jsonProperty.ConstructorArguments.Count > 0 && jsonProperty.ConstructorArguments[0].Value is string
|
|
742
|
+
? (string)jsonProperty.ConstructorArguments[0].Value
|
|
743
|
+
: member.Name;
|
|
744
|
+
if (string.IsNullOrWhiteSpace(name) || !string.Equals(name, name.Trim(), StringComparison.Ordinal))
|
|
745
|
+
throw new InvalidOperationException("Official structured member name must be non-empty without surrounding whitespace: " + member.DeclaringType.FullName + "." + member.Name + ".");
|
|
746
|
+
return new OfficialStructuredMember
|
|
747
|
+
{
|
|
748
|
+
Member = member,
|
|
749
|
+
Name = name,
|
|
750
|
+
Description = cliArg == null ? null : ConstructorString(cliArg, 1, "description", null),
|
|
751
|
+
Type = memberType,
|
|
752
|
+
Required = cliArg != null && NamedBoolean(cliArg, "Required", false)
|
|
753
|
+
};
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
private static bool IsOfficialStructuredInput(Type type)
|
|
757
|
+
{
|
|
758
|
+
return OfficialStructuredInputType != null
|
|
759
|
+
&& (type == OfficialStructuredInputType || type.GetInterfaces().Any(candidate => candidate == OfficialStructuredInputType));
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
private static bool IsAwaitableType(Type type)
|
|
763
|
+
{
|
|
764
|
+
return type != null && type.GetMethod("GetAwaiter", BindingFlags.Public | BindingFlags.Instance, null, Type.EmptyTypes, null) != null;
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
/// <summary>通过已加载Json.NET程序集转换JObject/JToken,core保持零编译依赖。</summary>
|
|
768
|
+
private static object ConvertNewtonsoftJsonValue(object value, Type type)
|
|
769
|
+
{
|
|
770
|
+
var jsonConvert = FindNewtonsoftJsonConvert(type);
|
|
771
|
+
var deserialize = jsonConvert.GetMethod("DeserializeObject", BindingFlags.Public | BindingFlags.Static, null, new[] { typeof(string), typeof(Type) }, null);
|
|
772
|
+
if (deserialize == null) throw new FormatException("Json.NET DeserializeObject(string, Type) is unavailable.");
|
|
773
|
+
var converted = deserialize.Invoke(null, new object[] { UnityCliSerializer.Serialize(value), type });
|
|
774
|
+
if (converted == null || !type.IsInstanceOfType(converted)) throw new FormatException("Json.NET value could not be converted to " + type.FullName + ".");
|
|
775
|
+
return converted;
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
/// <summary>把JToken结果归一为统一serializer可验证的普通JSON value tree。</summary>
|
|
779
|
+
private static object NormalizeNewtonsoftJsonValue(object value, Type type)
|
|
780
|
+
{
|
|
781
|
+
var jsonConvert = FindNewtonsoftJsonConvert(type);
|
|
782
|
+
var serialize = jsonConvert.GetMethod("SerializeObject", BindingFlags.Public | BindingFlags.Static, null, new[] { typeof(object) }, null);
|
|
783
|
+
if (serialize == null) throw new FormatException("Json.NET SerializeObject(object) is unavailable.");
|
|
784
|
+
var json = serialize.Invoke(null, new[] { value }) as string;
|
|
785
|
+
if (string.IsNullOrEmpty(json)) throw new FormatException("Json.NET value could not be serialized.");
|
|
786
|
+
return UnityCliSerializer.Parse(json);
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
/// <summary>任意official DTO优先借已加载Json.NET归一,失败保持原始值交给统一serializer决定。</summary>
|
|
790
|
+
private static bool TryNormalizeWithNewtonsoftJson(object value, out object normalized)
|
|
791
|
+
{
|
|
792
|
+
normalized = null;
|
|
793
|
+
Type jsonConvert;
|
|
794
|
+
try { jsonConvert = FindNewtonsoftJsonConvert(value.GetType()); }
|
|
795
|
+
catch { return false; }
|
|
796
|
+
var serialize = jsonConvert.GetMethod("SerializeObject", BindingFlags.Public | BindingFlags.Static, null, new[] { typeof(object) }, null);
|
|
797
|
+
if (serialize == null) return false;
|
|
798
|
+
try
|
|
799
|
+
{
|
|
800
|
+
var json = serialize.Invoke(null, new[] { value }) as string;
|
|
801
|
+
if (string.IsNullOrEmpty(json)) return false;
|
|
802
|
+
normalized = UnityCliSerializer.Parse(json);
|
|
803
|
+
return true;
|
|
804
|
+
}
|
|
805
|
+
catch { return false; }
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
private static Type FindNewtonsoftJsonConvert(Type preferredType)
|
|
809
|
+
{
|
|
810
|
+
var direct = preferredType.Assembly.GetType("Newtonsoft.Json.JsonConvert", false);
|
|
811
|
+
if (direct != null) return direct;
|
|
812
|
+
var loaded = AppDomain.CurrentDomain.GetAssemblies()
|
|
813
|
+
.Select(assembly => assembly.GetType("Newtonsoft.Json.JsonConvert", false))
|
|
814
|
+
.FirstOrDefault(candidate => candidate != null);
|
|
815
|
+
if (loaded == null) throw new FormatException("Json.NET JsonConvert is unavailable.");
|
|
816
|
+
return loaded;
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
private static bool IsNewtonsoftJsonTokenType(Type type)
|
|
820
|
+
{
|
|
821
|
+
for (var current = type; current != null; current = current.BaseType)
|
|
822
|
+
if (string.Equals(current.FullName, "Newtonsoft.Json.Linq.JToken", StringComparison.Ordinal)) return true;
|
|
823
|
+
return false;
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
/// <summary>只识别能由Dictionary<string,T>构造的真实dictionary;JObject等动态JSON类型走AnyJSON fallback。</summary>
|
|
827
|
+
private static bool TryOfficialDictionaryValueType(Type type, out Type valueType)
|
|
828
|
+
{
|
|
829
|
+
valueType = null;
|
|
830
|
+
try { return UnityCliSchemaDeriver.TryDictionaryValueType(type, out valueType); }
|
|
831
|
+
catch (InvalidOperationException) { return false; }
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
private static bool TryOfficialElementType(Type type, out Type elementType)
|
|
835
|
+
{
|
|
836
|
+
elementType = null;
|
|
837
|
+
if (type == typeof(string)) return false;
|
|
838
|
+
if (type.IsArray)
|
|
839
|
+
{
|
|
840
|
+
elementType = type.GetElementType();
|
|
841
|
+
return elementType != null;
|
|
842
|
+
}
|
|
843
|
+
if (!type.IsGenericType) return false;
|
|
844
|
+
var definition = type.GetGenericTypeDefinition();
|
|
845
|
+
if (definition != typeof(List<>) && definition != typeof(IList<>) && definition != typeof(IEnumerable<>)
|
|
846
|
+
&& definition != typeof(ICollection<>) && definition != typeof(IReadOnlyList<>) && definition != typeof(IReadOnlyCollection<>)) return false;
|
|
847
|
+
elementType = type.GetGenericArguments()[0];
|
|
848
|
+
return true;
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
private static object OfficialExampleValue(OfficialAttributeParameterBinding parameter)
|
|
852
|
+
{
|
|
853
|
+
if (parameter.HasDefaultValue && !(parameter.Required && OfficialRequiredValueMissing(parameter.DefaultValue)))
|
|
854
|
+
return NormalizeOfficialResult(parameter.DefaultValue, parameter.Parameter.ParameterType);
|
|
855
|
+
return ExampleValue(parameter.Parameter.ParameterType, new HashSet<Type>());
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
/// <summary>optional reference/nullable参数可显式接收null;required binding仍拒绝null与空字符串。</summary>
|
|
859
|
+
private static bool OfficialTypeAcceptsNull(Type type)
|
|
860
|
+
{
|
|
861
|
+
return Nullable.GetUnderlyingType(type) != null || !type.IsValueType;
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
private static bool OfficialRequiredValueMissing(object value)
|
|
865
|
+
{
|
|
866
|
+
return value == null || value is string && string.IsNullOrEmpty((string)value);
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
private static object ExampleValue(Type rawType, HashSet<Type> visited)
|
|
870
|
+
{
|
|
871
|
+
var type = Nullable.GetUnderlyingType(rawType) ?? rawType;
|
|
872
|
+
if (type == typeof(object)) return new Dictionary<string, object>();
|
|
873
|
+
if (type == typeof(string)) return "value";
|
|
874
|
+
if (type == typeof(char)) return "x";
|
|
875
|
+
if (type == typeof(bool)) return false;
|
|
876
|
+
if (UnityCliSchemaDeriver.IsInteger(type)) return 0;
|
|
877
|
+
if (UnityCliSchemaDeriver.IsNumber(type)) return 0d;
|
|
878
|
+
if (type.IsEnum) return Enum.GetNames(type).FirstOrDefault() ?? string.Empty;
|
|
879
|
+
if (type == typeof(DateTime) || type == typeof(DateTimeOffset)) return "1970-01-01T00:00:00.0000000Z";
|
|
880
|
+
if (type == typeof(Guid)) return Guid.Empty.ToString("D");
|
|
881
|
+
Type dictionaryValueType;
|
|
882
|
+
if (TryOfficialDictionaryValueType(type, out dictionaryValueType)) return new Dictionary<string, object>();
|
|
883
|
+
Type elementType;
|
|
884
|
+
if (TryOfficialElementType(type, out elementType)) return new List<object>();
|
|
885
|
+
if (IsOfficialStructuredInput(type))
|
|
886
|
+
{
|
|
887
|
+
if (!visited.Add(type)) return new Dictionary<string, object>();
|
|
888
|
+
try
|
|
889
|
+
{
|
|
890
|
+
return OfficialStructuredMembers(type).ToDictionary(member => member.Name, member => ExampleValue(member.Type, visited), StringComparer.Ordinal);
|
|
891
|
+
}
|
|
892
|
+
finally { visited.Remove(type); }
|
|
893
|
+
}
|
|
894
|
+
return new Dictionary<string, object>();
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
private static object DefaultValue(Type type)
|
|
898
|
+
{
|
|
899
|
+
return type.IsValueType && Nullable.GetUnderlyingType(type) == null ? Activator.CreateInstance(type) : null;
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
private static string OfficialTypeName(Type type)
|
|
903
|
+
{
|
|
904
|
+
return type == null ? "unknown" : (type.FullName ?? type.Name);
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
private static Dictionary<string, object> TypeSchema(string type)
|
|
908
|
+
{
|
|
909
|
+
return new Dictionary<string, object> { { "type", type } };
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
private static Dictionary<string, object> AnyJsonSchema()
|
|
913
|
+
{
|
|
914
|
+
return new Dictionary<string, object> { { "x-unityCliAnyJson", true } };
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
private static string OfficialSummary(string description)
|
|
918
|
+
{
|
|
919
|
+
var normalized = description.Trim();
|
|
920
|
+
var newline = normalized.IndexOfAny(new[] { '\r', '\n' });
|
|
921
|
+
return newline < 0 ? normalized : normalized.Substring(0, newline).Trim();
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
private static CustomAttributeData FindAttribute(MemberInfo member, string fullName)
|
|
925
|
+
{
|
|
926
|
+
var exactType = OfficialAttributeType(fullName);
|
|
927
|
+
return CustomAttributeData.GetCustomAttributes(member).SingleOrDefault(attribute => exactType != null
|
|
928
|
+
? attribute.AttributeType == exactType
|
|
929
|
+
: !IsOfficialAttributeName(fullName) && string.Equals(attribute.AttributeType.FullName, fullName, StringComparison.Ordinal));
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
private static CustomAttributeData FindAttribute(ParameterInfo parameter, string fullName)
|
|
933
|
+
{
|
|
934
|
+
var exactType = OfficialAttributeType(fullName);
|
|
935
|
+
return CustomAttributeData.GetCustomAttributes(parameter).SingleOrDefault(attribute => exactType != null
|
|
936
|
+
? attribute.AttributeType == exactType
|
|
937
|
+
: !IsOfficialAttributeName(fullName) && string.Equals(attribute.AttributeType.FullName, fullName, StringComparison.Ordinal));
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
private static Type OfficialAttributeType(string fullName)
|
|
941
|
+
{
|
|
942
|
+
if (string.Equals(fullName, OfficialCliCommandAttribute, StringComparison.Ordinal)) return OfficialCliCommandAttributeType;
|
|
943
|
+
if (string.Equals(fullName, OfficialCliArgAttribute, StringComparison.Ordinal)) return OfficialCliArgAttributeType;
|
|
944
|
+
return null;
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
private static bool IsOfficialAttributeName(string fullName)
|
|
948
|
+
{
|
|
949
|
+
return string.Equals(fullName, OfficialCliCommandAttribute, StringComparison.Ordinal)
|
|
950
|
+
|| string.Equals(fullName, OfficialCliArgAttribute, StringComparison.Ordinal);
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
private static string ConstructorString(CustomAttributeData attribute, int index, string field, MethodInfo method)
|
|
954
|
+
{
|
|
955
|
+
if (attribute == null || attribute.ConstructorArguments.Count <= index || !(attribute.ConstructorArguments[index].Value is string))
|
|
956
|
+
throw new InvalidOperationException("Official attribute " + field + " is malformed" + (method == null ? "." : ": " + MethodIdentity(method) + "."));
|
|
957
|
+
return (string)attribute.ConstructorArguments[index].Value;
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
private static bool NamedBoolean(CustomAttributeData attribute, string name, bool fallback)
|
|
961
|
+
{
|
|
962
|
+
object value;
|
|
963
|
+
return TryNamedValue(attribute, name, out value) && value is bool ? (bool)value : fallback;
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
private static bool TryNamedValue(CustomAttributeData attribute, string name, out object value)
|
|
967
|
+
{
|
|
968
|
+
foreach (var argument in attribute.NamedArguments)
|
|
969
|
+
{
|
|
970
|
+
if (!string.Equals(argument.MemberName, name, StringComparison.Ordinal)) continue;
|
|
971
|
+
value = argument.TypedValue.Value;
|
|
972
|
+
return true;
|
|
973
|
+
}
|
|
974
|
+
value = null;
|
|
975
|
+
return false;
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
/// <summary>官方任意用户代码的异常文本不得进入公开 timeout details。</summary>
|
|
979
|
+
private static string ProjectToolFailureReason(RegisteredTool definition, string internalReason)
|
|
980
|
+
{
|
|
981
|
+
return definition != null && definition.OfficialAttributeBinding != null
|
|
982
|
+
? "The attributed method did not return a trustworthy terminal result after dispatch."
|
|
983
|
+
: internalReason;
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
private static string MethodIdentity(MethodInfo method)
|
|
987
|
+
{
|
|
988
|
+
return (method.DeclaringType == null ? "unknown" : method.DeclaringType.FullName) + "." + method.Name;
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
#endif
|