unity-open-mcp 0.1.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/LICENSE +21 -0
- package/README.md +145 -0
- package/dist/batch-spawn.d.ts +33 -0
- package/dist/batch-spawn.js +329 -0
- package/dist/batch-spawn.js.map +1 -0
- package/dist/capabilities/build-capabilities.d.ts +155 -0
- package/dist/capabilities/build-capabilities.js +475 -0
- package/dist/capabilities/build-capabilities.js.map +1 -0
- package/dist/capabilities/list-rules.d.ts +45 -0
- package/dist/capabilities/list-rules.js +121 -0
- package/dist/capabilities/list-rules.js.map +1 -0
- package/dist/capabilities/rule-catalog.d.ts +44 -0
- package/dist/capabilities/rule-catalog.js +330 -0
- package/dist/capabilities/rule-catalog.js.map +1 -0
- package/dist/capabilities/tool-groups.d.ts +53 -0
- package/dist/capabilities/tool-groups.js +396 -0
- package/dist/capabilities/tool-groups.js.map +1 -0
- package/dist/cli/args.d.ts +36 -0
- package/dist/cli/args.js +239 -0
- package/dist/cli/args.js.map +1 -0
- package/dist/cli/cli.d.ts +23 -0
- package/dist/cli/cli.js +125 -0
- package/dist/cli/cli.js.map +1 -0
- package/dist/cli/commands.d.ts +37 -0
- package/dist/cli/commands.js +277 -0
- package/dist/cli/commands.js.map +1 -0
- package/dist/cli/ping-poller.d.ts +81 -0
- package/dist/cli/ping-poller.js +161 -0
- package/dist/cli/ping-poller.js.map +1 -0
- package/dist/compat.d.ts +32 -0
- package/dist/compat.js +121 -0
- package/dist/compat.js.map +1 -0
- package/dist/compiler-errors.d.ts +31 -0
- package/dist/compiler-errors.js +91 -0
- package/dist/compiler-errors.js.map +1 -0
- package/dist/compressible-router.d.ts +18 -0
- package/dist/compressible-router.js +191 -0
- package/dist/compressible-router.js.map +1 -0
- package/dist/compression/asset-model.d.ts +86 -0
- package/dist/compression/asset-model.js +15 -0
- package/dist/compression/asset-model.js.map +1 -0
- package/dist/compression/compact.d.ts +153 -0
- package/dist/compression/compact.js +501 -0
- package/dist/compression/compact.js.map +1 -0
- package/dist/dialog-dismiss.d.ts +197 -0
- package/dist/dialog-dismiss.js +533 -0
- package/dist/dialog-dismiss.js.map +1 -0
- package/dist/event-stream.d.ts +60 -0
- package/dist/event-stream.js +228 -0
- package/dist/event-stream.js.map +1 -0
- package/dist/gate-error.d.ts +18 -0
- package/dist/gate-error.js +11 -0
- package/dist/gate-error.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +146 -0
- package/dist/index.js.map +1 -0
- package/dist/instance-discovery.d.ts +117 -0
- package/dist/instance-discovery.js +202 -0
- package/dist/instance-discovery.js.map +1 -0
- package/dist/live-client.d.ts +68 -0
- package/dist/live-client.js +583 -0
- package/dist/live-client.js.map +1 -0
- package/dist/offline.d.ts +75 -0
- package/dist/offline.js +1495 -0
- package/dist/offline.js.map +1 -0
- package/dist/package-version.d.ts +8 -0
- package/dist/package-version.js +41 -0
- package/dist/package-version.js.map +1 -0
- package/dist/ping-cache.d.ts +15 -0
- package/dist/ping-cache.js +10 -0
- package/dist/ping-cache.js.map +1 -0
- package/dist/project-health.d.ts +52 -0
- package/dist/project-health.js +177 -0
- package/dist/project-health.js.map +1 -0
- package/dist/resource-router.d.ts +26 -0
- package/dist/resource-router.js +143 -0
- package/dist/resource-router.js.map +1 -0
- package/dist/resources/index.d.ts +6 -0
- package/dist/resources/index.js +40 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/results.d.ts +14 -0
- package/dist/results.js +22 -0
- package/dist/results.js.map +1 -0
- package/dist/router.d.ts +5 -0
- package/dist/router.js +2 -0
- package/dist/router.js.map +1 -0
- package/dist/routers.d.ts +44 -0
- package/dist/routers.js +73 -0
- package/dist/routers.js.map +1 -0
- package/dist/schema-defaults.d.ts +10 -0
- package/dist/schema-defaults.js +43 -0
- package/dist/schema-defaults.js.map +1 -0
- package/dist/skill/client-paths.d.ts +33 -0
- package/dist/skill/client-paths.js +131 -0
- package/dist/skill/client-paths.js.map +1 -0
- package/dist/skill/generate-skill.d.ts +38 -0
- package/dist/skill/generate-skill.js +389 -0
- package/dist/skill/generate-skill.js.map +1 -0
- package/dist/tool-router.d.ts +40 -0
- package/dist/tool-router.js +778 -0
- package/dist/tool-router.js.map +1 -0
- package/dist/tool-session-state.d.ts +55 -0
- package/dist/tool-session-state.js +116 -0
- package/dist/tool-session-state.js.map +1 -0
- package/dist/tools/agent-capabilities.d.ts +2 -0
- package/dist/tools/agent-capabilities.js +24 -0
- package/dist/tools/agent-capabilities.js.map +1 -0
- package/dist/tools/animation-create.d.ts +2 -0
- package/dist/tools/animation-create.js +31 -0
- package/dist/tools/animation-create.js.map +1 -0
- package/dist/tools/animation-get-data.d.ts +2 -0
- package/dist/tools/animation-get-data.js +23 -0
- package/dist/tools/animation-get-data.js.map +1 -0
- package/dist/tools/animation-modify.d.ts +2 -0
- package/dist/tools/animation-modify.js +45 -0
- package/dist/tools/animation-modify.js.map +1 -0
- package/dist/tools/animator-create.d.ts +2 -0
- package/dist/tools/animator-create.js +31 -0
- package/dist/tools/animator-create.js.map +1 -0
- package/dist/tools/animator-get-data.d.ts +2 -0
- package/dist/tools/animator-get-data.js +23 -0
- package/dist/tools/animator-get-data.js.map +1 -0
- package/dist/tools/animator-modify.d.ts +2 -0
- package/dist/tools/animator-modify.js +51 -0
- package/dist/tools/animator-modify.js.map +1 -0
- package/dist/tools/apply-fix.d.ts +2 -0
- package/dist/tools/apply-fix.js +39 -0
- package/dist/tools/apply-fix.js.map +1 -0
- package/dist/tools/assets-copy.d.ts +2 -0
- package/dist/tools/assets-copy.js +50 -0
- package/dist/tools/assets-copy.js.map +1 -0
- package/dist/tools/assets-create-folder.d.ts +2 -0
- package/dist/tools/assets-create-folder.js +53 -0
- package/dist/tools/assets-create-folder.js.map +1 -0
- package/dist/tools/assets-delete.d.ts +2 -0
- package/dist/tools/assets-delete.js +34 -0
- package/dist/tools/assets-delete.js.map +1 -0
- package/dist/tools/assets-move.d.ts +2 -0
- package/dist/tools/assets-move.js +50 -0
- package/dist/tools/assets-move.js.map +1 -0
- package/dist/tools/assets-refresh.d.ts +2 -0
- package/dist/tools/assets-refresh.js +37 -0
- package/dist/tools/assets-refresh.js.map +1 -0
- package/dist/tools/baseline-create.d.ts +2 -0
- package/dist/tools/baseline-create.js +20 -0
- package/dist/tools/baseline-create.js.map +1 -0
- package/dist/tools/bridge-status.d.ts +2 -0
- package/dist/tools/bridge-status.js +44 -0
- package/dist/tools/bridge-status.js.map +1 -0
- package/dist/tools/build-get-active-target.d.ts +2 -0
- package/dist/tools/build-get-active-target.js +16 -0
- package/dist/tools/build-get-active-target.js.map +1 -0
- package/dist/tools/build-get-defines.d.ts +2 -0
- package/dist/tools/build-get-defines.js +16 -0
- package/dist/tools/build-get-defines.js.map +1 -0
- package/dist/tools/build-get-scenes.d.ts +2 -0
- package/dist/tools/build-get-scenes.js +16 -0
- package/dist/tools/build-get-scenes.js.map +1 -0
- package/dist/tools/build-get-targets.d.ts +2 -0
- package/dist/tools/build-get-targets.js +18 -0
- package/dist/tools/build-get-targets.js.map +1 -0
- package/dist/tools/build-set-defines.d.ts +2 -0
- package/dist/tools/build-set-defines.js +50 -0
- package/dist/tools/build-set-defines.js.map +1 -0
- package/dist/tools/build-set-scenes.d.ts +2 -0
- package/dist/tools/build-set-scenes.js +60 -0
- package/dist/tools/build-set-scenes.js.map +1 -0
- package/dist/tools/build-set-target.d.ts +2 -0
- package/dist/tools/build-set-target.js +49 -0
- package/dist/tools/build-set-target.js.map +1 -0
- package/dist/tools/build-start.d.ts +2 -0
- package/dist/tools/build-start.js +64 -0
- package/dist/tools/build-start.js.map +1 -0
- package/dist/tools/capture-inline.d.ts +2 -0
- package/dist/tools/capture-inline.js +57 -0
- package/dist/tools/capture-inline.js.map +1 -0
- package/dist/tools/checkpoint-create.d.ts +2 -0
- package/dist/tools/checkpoint-create.js +16 -0
- package/dist/tools/checkpoint-create.js.map +1 -0
- package/dist/tools/compile-check.d.ts +2 -0
- package/dist/tools/compile-check.js +26 -0
- package/dist/tools/compile-check.js.map +1 -0
- package/dist/tools/component-add.d.ts +2 -0
- package/dist/tools/component-add.js +47 -0
- package/dist/tools/component-add.js.map +1 -0
- package/dist/tools/component-destroy.d.ts +2 -0
- package/dist/tools/component-destroy.js +46 -0
- package/dist/tools/component-destroy.js.map +1 -0
- package/dist/tools/component-get.d.ts +2 -0
- package/dist/tools/component-get.js +54 -0
- package/dist/tools/component-get.js.map +1 -0
- package/dist/tools/component-list-all.d.ts +2 -0
- package/dist/tools/component-list-all.js +38 -0
- package/dist/tools/component-list-all.js.map +1 -0
- package/dist/tools/component-modify.d.ts +2 -0
- package/dist/tools/component-modify.js +80 -0
- package/dist/tools/component-modify.js.map +1 -0
- package/dist/tools/console-clear.d.ts +2 -0
- package/dist/tools/console-clear.js +19 -0
- package/dist/tools/console-clear.js.map +1 -0
- package/dist/tools/console-log.d.ts +2 -0
- package/dist/tools/console-log.js +47 -0
- package/dist/tools/console-log.js.map +1 -0
- package/dist/tools/delta.d.ts +2 -0
- package/dist/tools/delta.js +17 -0
- package/dist/tools/delta.js.map +1 -0
- package/dist/tools/editor-add-layer.d.ts +2 -0
- package/dist/tools/editor-add-layer.js +51 -0
- package/dist/tools/editor-add-layer.js.map +1 -0
- package/dist/tools/editor-add-tag.d.ts +2 -0
- package/dist/tools/editor-add-tag.js +41 -0
- package/dist/tools/editor-add-tag.js.map +1 -0
- package/dist/tools/editor-get-layers.d.ts +2 -0
- package/dist/tools/editor-get-layers.js +22 -0
- package/dist/tools/editor-get-layers.js.map +1 -0
- package/dist/tools/editor-get-tags.d.ts +2 -0
- package/dist/tools/editor-get-tags.js +19 -0
- package/dist/tools/editor-get-tags.js.map +1 -0
- package/dist/tools/editor-redo.d.ts +2 -0
- package/dist/tools/editor-redo.js +27 -0
- package/dist/tools/editor-redo.js.map +1 -0
- package/dist/tools/editor-set-state.d.ts +2 -0
- package/dist/tools/editor-set-state.js +57 -0
- package/dist/tools/editor-set-state.js.map +1 -0
- package/dist/tools/editor-status.d.ts +2 -0
- package/dist/tools/editor-status.js +17 -0
- package/dist/tools/editor-status.js.map +1 -0
- package/dist/tools/editor-undo.d.ts +2 -0
- package/dist/tools/editor-undo.js +29 -0
- package/dist/tools/editor-undo.js.map +1 -0
- package/dist/tools/execute-csharp.d.ts +2 -0
- package/dist/tools/execute-csharp.js +74 -0
- package/dist/tools/execute-csharp.js.map +1 -0
- package/dist/tools/execute-menu.d.ts +2 -0
- package/dist/tools/execute-menu.js +40 -0
- package/dist/tools/execute-menu.js.map +1 -0
- package/dist/tools/find-members.d.ts +2 -0
- package/dist/tools/find-members.js +56 -0
- package/dist/tools/find-members.js.map +1 -0
- package/dist/tools/find-references.d.ts +2 -0
- package/dist/tools/find-references.js +29 -0
- package/dist/tools/find-references.js.map +1 -0
- package/dist/tools/gameobject-create.d.ts +2 -0
- package/dist/tools/gameobject-create.js +61 -0
- package/dist/tools/gameobject-create.js.map +1 -0
- package/dist/tools/gameobject-destroy.d.ts +2 -0
- package/dist/tools/gameobject-destroy.js +38 -0
- package/dist/tools/gameobject-destroy.js.map +1 -0
- package/dist/tools/gameobject-duplicate.d.ts +2 -0
- package/dist/tools/gameobject-duplicate.js +40 -0
- package/dist/tools/gameobject-duplicate.js.map +1 -0
- package/dist/tools/gameobject-find.d.ts +2 -0
- package/dist/tools/gameobject-find.js +59 -0
- package/dist/tools/gameobject-find.js.map +1 -0
- package/dist/tools/gameobject-modify.d.ts +2 -0
- package/dist/tools/gameobject-modify.js +76 -0
- package/dist/tools/gameobject-modify.js.map +1 -0
- package/dist/tools/gameobject-set-parent.d.ts +2 -0
- package/dist/tools/gameobject-set-parent.js +55 -0
- package/dist/tools/gameobject-set-parent.js.map +1 -0
- package/dist/tools/gate-budget-estimate.d.ts +2 -0
- package/dist/tools/gate-budget-estimate.js +59 -0
- package/dist/tools/gate-budget-estimate.js.map +1 -0
- package/dist/tools/generate-skill.d.ts +2 -0
- package/dist/tools/generate-skill.js +37 -0
- package/dist/tools/generate-skill.js.map +1 -0
- package/dist/tools/impact-preview.d.ts +2 -0
- package/dist/tools/impact-preview.js +50 -0
- package/dist/tools/impact-preview.js.map +1 -0
- package/dist/tools/index.d.ts +30 -0
- package/dist/tools/index.js +576 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/inputsystem-action-add.d.ts +2 -0
- package/dist/tools/inputsystem-action-add.js +61 -0
- package/dist/tools/inputsystem-action-add.js.map +1 -0
- package/dist/tools/inputsystem-actionmap-add.d.ts +2 -0
- package/dist/tools/inputsystem-actionmap-add.js +31 -0
- package/dist/tools/inputsystem-actionmap-add.js.map +1 -0
- package/dist/tools/inputsystem-asset-create.d.ts +2 -0
- package/dist/tools/inputsystem-asset-create.js +35 -0
- package/dist/tools/inputsystem-asset-create.js.map +1 -0
- package/dist/tools/inputsystem-binding-add.d.ts +2 -0
- package/dist/tools/inputsystem-binding-add.js +48 -0
- package/dist/tools/inputsystem-binding-add.js.map +1 -0
- package/dist/tools/inputsystem-binding-composite-add.d.ts +2 -0
- package/dist/tools/inputsystem-binding-composite-add.js +51 -0
- package/dist/tools/inputsystem-binding-composite-add.js.map +1 -0
- package/dist/tools/inputsystem-controlscheme-add.d.ts +2 -0
- package/dist/tools/inputsystem-controlscheme-add.js +43 -0
- package/dist/tools/inputsystem-controlscheme-add.js.map +1 -0
- package/dist/tools/inputsystem-get.d.ts +2 -0
- package/dist/tools/inputsystem-get.js +22 -0
- package/dist/tools/inputsystem-get.js.map +1 -0
- package/dist/tools/invoke-method.d.ts +2 -0
- package/dist/tools/invoke-method.js +104 -0
- package/dist/tools/invoke-method.js.map +1 -0
- package/dist/tools/list-assets.d.ts +2 -0
- package/dist/tools/list-assets.js +30 -0
- package/dist/tools/list-assets.js.map +1 -0
- package/dist/tools/list-rules.d.ts +2 -0
- package/dist/tools/list-rules.js +27 -0
- package/dist/tools/list-rules.js.map +1 -0
- package/dist/tools/manage-tools.d.ts +2 -0
- package/dist/tools/manage-tools.js +47 -0
- package/dist/tools/manage-tools.js.map +1 -0
- package/dist/tools/material-create.d.ts +2 -0
- package/dist/tools/material-create.js +37 -0
- package/dist/tools/material-create.js.map +1 -0
- package/dist/tools/material-get-keywords.d.ts +2 -0
- package/dist/tools/material-get-keywords.js +23 -0
- package/dist/tools/material-get-keywords.js.map +1 -0
- package/dist/tools/material-get-properties.d.ts +2 -0
- package/dist/tools/material-get-properties.js +32 -0
- package/dist/tools/material-get-properties.js.map +1 -0
- package/dist/tools/material-set-keyword.d.ts +2 -0
- package/dist/tools/material-set-keyword.js +42 -0
- package/dist/tools/material-set-keyword.js.map +1 -0
- package/dist/tools/material-set-property.d.ts +2 -0
- package/dist/tools/material-set-property.js +49 -0
- package/dist/tools/material-set-property.js.map +1 -0
- package/dist/tools/material-set-shader.d.ts +2 -0
- package/dist/tools/material-set-shader.js +39 -0
- package/dist/tools/material-set-shader.js.map +1 -0
- package/dist/tools/mutation-explain.d.ts +2 -0
- package/dist/tools/mutation-explain.js +44 -0
- package/dist/tools/mutation-explain.js.map +1 -0
- package/dist/tools/navigation-agent-add.d.ts +2 -0
- package/dist/tools/navigation-agent-add.js +38 -0
- package/dist/tools/navigation-agent-add.js.map +1 -0
- package/dist/tools/navigation-agent-set-destination.d.ts +2 -0
- package/dist/tools/navigation-agent-set-destination.js +33 -0
- package/dist/tools/navigation-agent-set-destination.js.map +1 -0
- package/dist/tools/navigation-get.d.ts +2 -0
- package/dist/tools/navigation-get.js +20 -0
- package/dist/tools/navigation-get.js.map +1 -0
- package/dist/tools/navigation-link-add.d.ts +2 -0
- package/dist/tools/navigation-link-add.js +57 -0
- package/dist/tools/navigation-link-add.js.map +1 -0
- package/dist/tools/navigation-list.d.ts +2 -0
- package/dist/tools/navigation-list.js +16 -0
- package/dist/tools/navigation-list.js.map +1 -0
- package/dist/tools/navigation-modifier-add.d.ts +2 -0
- package/dist/tools/navigation-modifier-add.js +42 -0
- package/dist/tools/navigation-modifier-add.js.map +1 -0
- package/dist/tools/navigation-modifier-volume-add.d.ts +2 -0
- package/dist/tools/navigation-modifier-volume-add.js +41 -0
- package/dist/tools/navigation-modifier-volume-add.js.map +1 -0
- package/dist/tools/navigation-modify.d.ts +2 -0
- package/dist/tools/navigation-modify.js +47 -0
- package/dist/tools/navigation-modify.js.map +1 -0
- package/dist/tools/navigation-set-bake-settings.d.ts +2 -0
- package/dist/tools/navigation-set-bake-settings.js +42 -0
- package/dist/tools/navigation-set-bake-settings.js.map +1 -0
- package/dist/tools/navigation-surface-add.d.ts +2 -0
- package/dist/tools/navigation-surface-add.js +62 -0
- package/dist/tools/navigation-surface-add.js.map +1 -0
- package/dist/tools/navigation-surface-bake.d.ts +2 -0
- package/dist/tools/navigation-surface-bake.js +30 -0
- package/dist/tools/navigation-surface-bake.js.map +1 -0
- package/dist/tools/object-get-data.d.ts +2 -0
- package/dist/tools/object-get-data.js +59 -0
- package/dist/tools/object-get-data.js.map +1 -0
- package/dist/tools/object-modify.d.ts +2 -0
- package/dist/tools/object-modify.js +73 -0
- package/dist/tools/object-modify.js.map +1 -0
- package/dist/tools/package-add.d.ts +2 -0
- package/dist/tools/package-add.js +42 -0
- package/dist/tools/package-add.js.map +1 -0
- package/dist/tools/package-check.d.ts +2 -0
- package/dist/tools/package-check.js +27 -0
- package/dist/tools/package-check.js.map +1 -0
- package/dist/tools/package-get-dependencies.d.ts +2 -0
- package/dist/tools/package-get-dependencies.js +17 -0
- package/dist/tools/package-get-dependencies.js.map +1 -0
- package/dist/tools/package-get-info.d.ts +2 -0
- package/dist/tools/package-get-info.js +33 -0
- package/dist/tools/package-get-info.js.map +1 -0
- package/dist/tools/package-list.d.ts +2 -0
- package/dist/tools/package-list.js +57 -0
- package/dist/tools/package-list.js.map +1 -0
- package/dist/tools/package-remove.d.ts +2 -0
- package/dist/tools/package-remove.js +40 -0
- package/dist/tools/package-remove.js.map +1 -0
- package/dist/tools/package-search.d.ts +2 -0
- package/dist/tools/package-search.js +42 -0
- package/dist/tools/package-search.js.map +1 -0
- package/dist/tools/particle-system-get.d.ts +2 -0
- package/dist/tools/particle-system-get.js +42 -0
- package/dist/tools/particle-system-get.js.map +1 -0
- package/dist/tools/particle-system-modify.d.ts +2 -0
- package/dist/tools/particle-system-modify.js +73 -0
- package/dist/tools/particle-system-modify.js.map +1 -0
- package/dist/tools/ping.d.ts +2 -0
- package/dist/tools/ping.js +10 -0
- package/dist/tools/ping.js.map +1 -0
- package/dist/tools/prefab-apply.d.ts +2 -0
- package/dist/tools/prefab-apply.js +39 -0
- package/dist/tools/prefab-apply.js.map +1 -0
- package/dist/tools/prefab-close.d.ts +2 -0
- package/dist/tools/prefab-close.js +29 -0
- package/dist/tools/prefab-close.js.map +1 -0
- package/dist/tools/prefab-create.d.ts +2 -0
- package/dist/tools/prefab-create.js +52 -0
- package/dist/tools/prefab-create.js.map +1 -0
- package/dist/tools/prefab-get-overrides.d.ts +2 -0
- package/dist/tools/prefab-get-overrides.js +27 -0
- package/dist/tools/prefab-get-overrides.js.map +1 -0
- package/dist/tools/prefab-instantiate.d.ts +2 -0
- package/dist/tools/prefab-instantiate.js +52 -0
- package/dist/tools/prefab-instantiate.js.map +1 -0
- package/dist/tools/prefab-open.d.ts +2 -0
- package/dist/tools/prefab-open.js +30 -0
- package/dist/tools/prefab-open.js.map +1 -0
- package/dist/tools/prefab-revert.d.ts +2 -0
- package/dist/tools/prefab-revert.js +37 -0
- package/dist/tools/prefab-revert.js.map +1 -0
- package/dist/tools/prefab-save.d.ts +2 -0
- package/dist/tools/prefab-save.js +24 -0
- package/dist/tools/prefab-save.js.map +1 -0
- package/dist/tools/prefab-status.d.ts +2 -0
- package/dist/tools/prefab-status.js +29 -0
- package/dist/tools/prefab-status.js.map +1 -0
- package/dist/tools/prefab-unpack.d.ts +2 -0
- package/dist/tools/prefab-unpack.js +43 -0
- package/dist/tools/prefab-unpack.js.map +1 -0
- package/dist/tools/probuilder-create-shape.d.ts +2 -0
- package/dist/tools/probuilder-create-shape.js +40 -0
- package/dist/tools/probuilder-create-shape.js.map +1 -0
- package/dist/tools/probuilder-delete-faces.d.ts +2 -0
- package/dist/tools/probuilder-delete-faces.js +47 -0
- package/dist/tools/probuilder-delete-faces.js.map +1 -0
- package/dist/tools/probuilder-extrude.d.ts +2 -0
- package/dist/tools/probuilder-extrude.js +58 -0
- package/dist/tools/probuilder-extrude.js.map +1 -0
- package/dist/tools/probuilder-get-mesh-info.d.ts +2 -0
- package/dist/tools/probuilder-get-mesh-info.js +21 -0
- package/dist/tools/probuilder-get-mesh-info.js.map +1 -0
- package/dist/tools/probuilder-set-face-material.d.ts +2 -0
- package/dist/tools/probuilder-set-face-material.js +53 -0
- package/dist/tools/probuilder-set-face-material.js.map +1 -0
- package/dist/tools/profiler-capture.d.ts +2 -0
- package/dist/tools/profiler-capture.js +84 -0
- package/dist/tools/profiler-capture.js.map +1 -0
- package/dist/tools/profiler-clear-data.d.ts +2 -0
- package/dist/tools/profiler-clear-data.js +20 -0
- package/dist/tools/profiler-clear-data.js.map +1 -0
- package/dist/tools/profiler-enable-module.d.ts +2 -0
- package/dist/tools/profiler-enable-module.js +32 -0
- package/dist/tools/profiler-enable-module.js.map +1 -0
- package/dist/tools/profiler-get-config.d.ts +2 -0
- package/dist/tools/profiler-get-config.js +21 -0
- package/dist/tools/profiler-get-config.js.map +1 -0
- package/dist/tools/profiler-get-script-stats.d.ts +2 -0
- package/dist/tools/profiler-get-script-stats.js +20 -0
- package/dist/tools/profiler-get-script-stats.js.map +1 -0
- package/dist/tools/profiler-get-status.d.ts +2 -0
- package/dist/tools/profiler-get-status.js +22 -0
- package/dist/tools/profiler-get-status.js.map +1 -0
- package/dist/tools/profiler-list-modules.d.ts +2 -0
- package/dist/tools/profiler-list-modules.js +20 -0
- package/dist/tools/profiler-list-modules.js.map +1 -0
- package/dist/tools/profiler-load-data.d.ts +2 -0
- package/dist/tools/profiler-load-data.js +38 -0
- package/dist/tools/profiler-load-data.js.map +1 -0
- package/dist/tools/profiler-memory.d.ts +2 -0
- package/dist/tools/profiler-memory.js +21 -0
- package/dist/tools/profiler-memory.js.map +1 -0
- package/dist/tools/profiler-rendering.d.ts +2 -0
- package/dist/tools/profiler-rendering.js +14 -0
- package/dist/tools/profiler-rendering.js.map +1 -0
- package/dist/tools/profiler-save-data.d.ts +2 -0
- package/dist/tools/profiler-save-data.js +38 -0
- package/dist/tools/profiler-save-data.js.map +1 -0
- package/dist/tools/profiler-set-config.d.ts +2 -0
- package/dist/tools/profiler-set-config.js +72 -0
- package/dist/tools/profiler-set-config.js.map +1 -0
- package/dist/tools/profiler-start.d.ts +2 -0
- package/dist/tools/profiler-start.js +31 -0
- package/dist/tools/profiler-start.js.map +1 -0
- package/dist/tools/profiler-stop.d.ts +2 -0
- package/dist/tools/profiler-stop.js +20 -0
- package/dist/tools/profiler-stop.js.map +1 -0
- package/dist/tools/pull-events.d.ts +2 -0
- package/dist/tools/pull-events.js +43 -0
- package/dist/tools/pull-events.js.map +1 -0
- package/dist/tools/read-asset.d.ts +2 -0
- package/dist/tools/read-asset.js +62 -0
- package/dist/tools/read-asset.js.map +1 -0
- package/dist/tools/read-compile-errors.d.ts +2 -0
- package/dist/tools/read-compile-errors.js +59 -0
- package/dist/tools/read-compile-errors.js.map +1 -0
- package/dist/tools/read-console.d.ts +2 -0
- package/dist/tools/read-console.js +57 -0
- package/dist/tools/read-console.js.map +1 -0
- package/dist/tools/regression-check.d.ts +2 -0
- package/dist/tools/regression-check.js +36 -0
- package/dist/tools/regression-check.js.map +1 -0
- package/dist/tools/reserialize.d.ts +2 -0
- package/dist/tools/reserialize.js +31 -0
- package/dist/tools/reserialize.js.map +1 -0
- package/dist/tools/run-tests.d.ts +2 -0
- package/dist/tools/run-tests.js +49 -0
- package/dist/tools/run-tests.js.map +1 -0
- package/dist/tools/scan-all.d.ts +2 -0
- package/dist/tools/scan-all.js +25 -0
- package/dist/tools/scan-all.js.map +1 -0
- package/dist/tools/scan-paths.d.ts +2 -0
- package/dist/tools/scan-paths.js +40 -0
- package/dist/tools/scan-paths.js.map +1 -0
- package/dist/tools/scene-create.d.ts +2 -0
- package/dist/tools/scene-create.js +47 -0
- package/dist/tools/scene-create.js.map +1 -0
- package/dist/tools/scene-focus.d.ts +2 -0
- package/dist/tools/scene-focus.js +55 -0
- package/dist/tools/scene-focus.js.map +1 -0
- package/dist/tools/scene-get-data.d.ts +2 -0
- package/dist/tools/scene-get-data.js +52 -0
- package/dist/tools/scene-get-data.js.map +1 -0
- package/dist/tools/scene-get-dirty-summary.d.ts +2 -0
- package/dist/tools/scene-get-dirty-summary.js +17 -0
- package/dist/tools/scene-get-dirty-summary.js.map +1 -0
- package/dist/tools/scene-list-opened.d.ts +2 -0
- package/dist/tools/scene-list-opened.js +16 -0
- package/dist/tools/scene-list-opened.js.map +1 -0
- package/dist/tools/scene-open.d.ts +2 -0
- package/dist/tools/scene-open.js +48 -0
- package/dist/tools/scene-open.js.map +1 -0
- package/dist/tools/scene-save.d.ts +2 -0
- package/dist/tools/scene-save.js +38 -0
- package/dist/tools/scene-save.js.map +1 -0
- package/dist/tools/scene-set-active.d.ts +2 -0
- package/dist/tools/scene-set-active.js +33 -0
- package/dist/tools/scene-set-active.js.map +1 -0
- package/dist/tools/scene-unload.d.ts +2 -0
- package/dist/tools/scene-unload.js +33 -0
- package/dist/tools/scene-unload.js.map +1 -0
- package/dist/tools/screenshot-camera.d.ts +2 -0
- package/dist/tools/screenshot-camera.js +59 -0
- package/dist/tools/screenshot-camera.js.map +1 -0
- package/dist/tools/screenshot-window.d.ts +2 -0
- package/dist/tools/screenshot-window.js +54 -0
- package/dist/tools/screenshot-window.js.map +1 -0
- package/dist/tools/screenshot.d.ts +2 -0
- package/dist/tools/screenshot.js +47 -0
- package/dist/tools/screenshot.js.map +1 -0
- package/dist/tools/script-delete.d.ts +2 -0
- package/dist/tools/script-delete.js +37 -0
- package/dist/tools/script-delete.js.map +1 -0
- package/dist/tools/script-read.d.ts +2 -0
- package/dist/tools/script-read.js +46 -0
- package/dist/tools/script-read.js.map +1 -0
- package/dist/tools/script-write.d.ts +2 -0
- package/dist/tools/script-write.js +56 -0
- package/dist/tools/script-write.js.map +1 -0
- package/dist/tools/search-assets.d.ts +2 -0
- package/dist/tools/search-assets.js +49 -0
- package/dist/tools/search-assets.js.map +1 -0
- package/dist/tools/selection-get.d.ts +2 -0
- package/dist/tools/selection-get.js +28 -0
- package/dist/tools/selection-get.js.map +1 -0
- package/dist/tools/selection-set.d.ts +2 -0
- package/dist/tools/selection-set.js +72 -0
- package/dist/tools/selection-set.js.map +1 -0
- package/dist/tools/settings-get-lighting.d.ts +2 -0
- package/dist/tools/settings-get-lighting.js +21 -0
- package/dist/tools/settings-get-lighting.js.map +1 -0
- package/dist/tools/settings-get-physics.d.ts +2 -0
- package/dist/tools/settings-get-physics.js +17 -0
- package/dist/tools/settings-get-physics.js.map +1 -0
- package/dist/tools/settings-get-player.d.ts +2 -0
- package/dist/tools/settings-get-player.js +16 -0
- package/dist/tools/settings-get-player.js.map +1 -0
- package/dist/tools/settings-get-quality.d.ts +2 -0
- package/dist/tools/settings-get-quality.js +16 -0
- package/dist/tools/settings-get-quality.js.map +1 -0
- package/dist/tools/settings-set-lighting.d.ts +2 -0
- package/dist/tools/settings-set-lighting.js +58 -0
- package/dist/tools/settings-set-lighting.js.map +1 -0
- package/dist/tools/settings-set-physics.d.ts +2 -0
- package/dist/tools/settings-set-physics.js +52 -0
- package/dist/tools/settings-set-physics.js.map +1 -0
- package/dist/tools/settings-set-player.d.ts +2 -0
- package/dist/tools/settings-set-player.js +62 -0
- package/dist/tools/settings-set-player.js.map +1 -0
- package/dist/tools/settings-set-quality.d.ts +2 -0
- package/dist/tools/settings-set-quality.js +51 -0
- package/dist/tools/settings-set-quality.js.map +1 -0
- package/dist/tools/shader-get-data.d.ts +2 -0
- package/dist/tools/shader-get-data.js +31 -0
- package/dist/tools/shader-get-data.js.map +1 -0
- package/dist/tools/shader-list-all.d.ts +2 -0
- package/dist/tools/shader-list-all.js +24 -0
- package/dist/tools/shader-list-all.js.map +1 -0
- package/dist/tools/spatial-query.d.ts +2 -0
- package/dist/tools/spatial-query.js +117 -0
- package/dist/tools/spatial-query.js.map +1 -0
- package/dist/tools/splines-add-knot.d.ts +2 -0
- package/dist/tools/splines-add-knot.js +44 -0
- package/dist/tools/splines-add-knot.js.map +1 -0
- package/dist/tools/splines-container-create.d.ts +2 -0
- package/dist/tools/splines-container-create.js +39 -0
- package/dist/tools/splines-container-create.js.map +1 -0
- package/dist/tools/splines-evaluate.d.ts +2 -0
- package/dist/tools/splines-evaluate.js +31 -0
- package/dist/tools/splines-evaluate.js.map +1 -0
- package/dist/tools/splines-get-knots.d.ts +2 -0
- package/dist/tools/splines-get-knots.js +25 -0
- package/dist/tools/splines-get-knots.js.map +1 -0
- package/dist/tools/splines-modify.d.ts +2 -0
- package/dist/tools/splines-modify.js +35 -0
- package/dist/tools/splines-modify.js.map +1 -0
- package/dist/tools/splines-set-knot.d.ts +2 -0
- package/dist/tools/splines-set-knot.js +41 -0
- package/dist/tools/splines-set-knot.js.map +1 -0
- package/dist/tools/splines-set-tangent-mode.d.ts +2 -0
- package/dist/tools/splines-set-tangent-mode.js +43 -0
- package/dist/tools/splines-set-tangent-mode.js.map +1 -0
- package/dist/tools/type-schema.d.ts +2 -0
- package/dist/tools/type-schema.js +62 -0
- package/dist/tools/type-schema.js.map +1 -0
- package/dist/tools/validate-edit.d.ts +2 -0
- package/dist/tools/validate-edit.js +43 -0
- package/dist/tools/validate-edit.js.map +1 -0
- package/dist/unity-install-discovery.d.ts +79 -0
- package/dist/unity-install-discovery.js +206 -0
- package/dist/unity-install-discovery.js.map +1 -0
- package/dist/unity-log.d.ts +35 -0
- package/dist/unity-log.js +110 -0
- package/dist/unity-log.js.map +1 -0
- package/package.json +54 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/** A discovered Unity install: the editor executable path + its version folder name. */
|
|
2
|
+
export interface UnityInstall {
|
|
3
|
+
/** Absolute path to the Unity executable (the thing you spawn). */
|
|
4
|
+
path: string;
|
|
5
|
+
/** Version string as named by the install folder (e.g. "6000.4.0f1", "2022.3.62f2"). */
|
|
6
|
+
version: string;
|
|
7
|
+
}
|
|
8
|
+
export type UnityPathSource = "env" | "discovered";
|
|
9
|
+
export interface ResolvedUnityPath {
|
|
10
|
+
path: string;
|
|
11
|
+
version: string;
|
|
12
|
+
source: UnityPathSource;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* OS-default Unity Hub install roots, matching the Hub's
|
|
16
|
+
* `get_os_default_hub_paths()`. Each holds version-named subfolders
|
|
17
|
+
* (`<root>/<version>/Unity.app|Editor/...`).
|
|
18
|
+
*/
|
|
19
|
+
export declare function defaultHubRoots(): string[];
|
|
20
|
+
/**
|
|
21
|
+
* Roots actually scanned for installs: the OS defaults plus an optional
|
|
22
|
+
* `UNITY_HUB` env override (the Hub honors the same env var to point at a
|
|
23
|
+
* non-default install root). Deduped, existing-only.
|
|
24
|
+
*/
|
|
25
|
+
export declare function scannedHubRoots(): string[];
|
|
26
|
+
/**
|
|
27
|
+
* Resolve the Unity executable path for a version-named install folder,
|
|
28
|
+
* per-OS. Returns null when the expected binary is absent (folder exists
|
|
29
|
+
* but is not a valid editor layout). Mirrors the Hub's `is_unity_editor_dir`
|
|
30
|
+
* + path-to-executable logic.
|
|
31
|
+
*/
|
|
32
|
+
export declare function executableForInstall(installDir: string): string | null;
|
|
33
|
+
/**
|
|
34
|
+
* Scan the OS-default Hub roots (+ `UNITY_HUB` env override) for version-named
|
|
35
|
+
* install folders and return the validated executables, sorted newest-first.
|
|
36
|
+
* Never throws — unreadable/missing dirs are silently skipped (best-effort
|
|
37
|
+
* discovery). De-duplicates by executable path so an env override pointing at
|
|
38
|
+
* the same place as an OS default does not double-list.
|
|
39
|
+
*
|
|
40
|
+
* `roots` is an optional override (test hook) — when omitted the real
|
|
41
|
+
* `scannedHubRoots()` is used. Passing an explicit list keeps unit tests
|
|
42
|
+
* deterministic across machines without monkey-patching env vars.
|
|
43
|
+
*/
|
|
44
|
+
export declare function discoverUnityInstalls(roots?: string[]): UnityInstall[];
|
|
45
|
+
/**
|
|
46
|
+
* Compare two Unity version strings for sort ordering. Unity versions look
|
|
47
|
+
* like `YYYY.N.PxX` or `6000.N.PxX` with an optional suffix (`a1`, `b2`,
|
|
48
|
+
* `f3`, `p4`, `c5`). We split on non-digit runs, compare numeric parts
|
|
49
|
+
* left-to-right, and fall back to lexicographic for the trailing suffix so
|
|
50
|
+
* `6000.4.0f1` > `6000.4.0b1` (final > beta, matching the Hub's intent of
|
|
51
|
+
* surfacing newer/more-stable releases first). Returns >0 / 0 / <0.
|
|
52
|
+
*/
|
|
53
|
+
export declare function compareUnityVersions(a: string, b: string): number;
|
|
54
|
+
/**
|
|
55
|
+
* True when `candidateVersion` should be preferred for a project whose
|
|
56
|
+
* running bridge reports `projectVersion`. Matches the full string first,
|
|
57
|
+
* then the leading dotted prefix (`6000.4` matches `6000.4.0f1`), so a
|
|
58
|
+
* patch-level difference still pins the right minor line. Null/empty
|
|
59
|
+
* `projectVersion` matches nothing (caller falls back to newest).
|
|
60
|
+
*/
|
|
61
|
+
export declare function versionMatches(candidateVersion: string, projectVersion?: string | null): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Resolve the Unity executable to use for batch operations. Precedence:
|
|
64
|
+
* 1. `UNITY_PATH` env var — validated to exist; source "env". Not run
|
|
65
|
+
* through discovery so an explicit pin always wins even if the path
|
|
66
|
+
* points outside the Hub layout.
|
|
67
|
+
* 2. discovered installs — pick by `preferredVersion` match when given,
|
|
68
|
+
* else the newest (first, since discoverUnityInstalls sorts desc).
|
|
69
|
+
* 3. null — caller surfaces `unity_not_discovered`.
|
|
70
|
+
*
|
|
71
|
+
* `preferredVersion` is typically the running bridge's `unityVersion` read
|
|
72
|
+
* from the instance lock, so on multi-version machines batch picks the same
|
|
73
|
+
* editor the live project uses.
|
|
74
|
+
*
|
|
75
|
+
* `roots` is an optional override (test hook) forwarded to
|
|
76
|
+
* `discoverUnityInstalls` so tests can point at a temp fixture instead of the
|
|
77
|
+
* real machine state.
|
|
78
|
+
*/
|
|
79
|
+
export declare function resolveUnityPath(preferredVersion?: string | null, roots?: string[]): ResolvedUnityPath | null;
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
// Unity-install auto-discovery for the MCP server.
|
|
2
|
+
//
|
|
3
|
+
// Ports the *behavior* of the Hub's Rust discovery
|
|
4
|
+
// (`hub/src-tauri/src/config/discovery.rs::discover_unity_installations`)
|
|
5
|
+
// to TypeScript so `batch-spawn.ts` can find a Unity editor without a hard
|
|
6
|
+
// `UNITY_PATH` env requirement. The two processes do not share code today;
|
|
7
|
+
// this is an independent, TS-idiomatic port kept in sync with the Hub's
|
|
8
|
+
// OS-default paths and `UNITY_HUB` env override.
|
|
9
|
+
//
|
|
10
|
+
// Resolution precedence (see `resolveUnityPath`):
|
|
11
|
+
// 1. `UNITY_PATH` env var (explicit, validated to exist — wins)
|
|
12
|
+
// 2. auto-discovered installs, picking by `preferredVersion` prefix match
|
|
13
|
+
// against the running bridge's `unityVersion` when available, else newest
|
|
14
|
+
// 3. null (caller surfaces `unity_not_discovered`)
|
|
15
|
+
import { existsSync, readdirSync, statSync } from "node:fs";
|
|
16
|
+
import { join } from "node:path";
|
|
17
|
+
import { homedir } from "node:os";
|
|
18
|
+
/**
|
|
19
|
+
* OS-default Unity Hub install roots, matching the Hub's
|
|
20
|
+
* `get_os_default_hub_paths()`. Each holds version-named subfolders
|
|
21
|
+
* (`<root>/<version>/Unity.app|Editor/...`).
|
|
22
|
+
*/
|
|
23
|
+
export function defaultHubRoots() {
|
|
24
|
+
if (process.platform === "win32") {
|
|
25
|
+
return [join("C:", "Program Files", "Unity", "Hub", "Editor")];
|
|
26
|
+
}
|
|
27
|
+
if (process.platform === "darwin") {
|
|
28
|
+
return ["/Applications/Unity/Hub/Editor"];
|
|
29
|
+
}
|
|
30
|
+
// Linux + fallback.
|
|
31
|
+
return [join(homedir(), "Unity", "Hub", "Editor")];
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Roots actually scanned for installs: the OS defaults plus an optional
|
|
35
|
+
* `UNITY_HUB` env override (the Hub honors the same env var to point at a
|
|
36
|
+
* non-default install root). Deduped, existing-only.
|
|
37
|
+
*/
|
|
38
|
+
export function scannedHubRoots() {
|
|
39
|
+
const roots = new Set();
|
|
40
|
+
for (const r of defaultHubRoots())
|
|
41
|
+
roots.add(r);
|
|
42
|
+
const envHub = process.env.UNITY_HUB;
|
|
43
|
+
if (envHub)
|
|
44
|
+
roots.add(envHub);
|
|
45
|
+
const out = [];
|
|
46
|
+
for (const r of roots) {
|
|
47
|
+
try {
|
|
48
|
+
if (existsSync(r) && statSync(r).isDirectory())
|
|
49
|
+
out.push(r);
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
// unreadable / missing — skip
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return out;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Resolve the Unity executable path for a version-named install folder,
|
|
59
|
+
* per-OS. Returns null when the expected binary is absent (folder exists
|
|
60
|
+
* but is not a valid editor layout). Mirrors the Hub's `is_unity_editor_dir`
|
|
61
|
+
* + path-to-executable logic.
|
|
62
|
+
*/
|
|
63
|
+
export function executableForInstall(installDir) {
|
|
64
|
+
if (process.platform === "darwin") {
|
|
65
|
+
const exe = join(installDir, "Unity.app", "Contents", "MacOS", "Unity");
|
|
66
|
+
return existsSync(exe) ? exe : null;
|
|
67
|
+
}
|
|
68
|
+
if (process.platform === "win32") {
|
|
69
|
+
const exe = join(installDir, "Editor", "Unity.exe");
|
|
70
|
+
return existsSync(exe) ? exe : null;
|
|
71
|
+
}
|
|
72
|
+
// Linux.
|
|
73
|
+
const exe = join(installDir, "Editor", "Unity");
|
|
74
|
+
return existsSync(exe) ? exe : null;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Scan the OS-default Hub roots (+ `UNITY_HUB` env override) for version-named
|
|
78
|
+
* install folders and return the validated executables, sorted newest-first.
|
|
79
|
+
* Never throws — unreadable/missing dirs are silently skipped (best-effort
|
|
80
|
+
* discovery). De-duplicates by executable path so an env override pointing at
|
|
81
|
+
* the same place as an OS default does not double-list.
|
|
82
|
+
*
|
|
83
|
+
* `roots` is an optional override (test hook) — when omitted the real
|
|
84
|
+
* `scannedHubRoots()` is used. Passing an explicit list keeps unit tests
|
|
85
|
+
* deterministic across machines without monkey-patching env vars.
|
|
86
|
+
*/
|
|
87
|
+
export function discoverUnityInstalls(roots) {
|
|
88
|
+
const scanRoots = roots ?? scannedHubRoots();
|
|
89
|
+
const seen = new Map();
|
|
90
|
+
for (const root of scanRoots) {
|
|
91
|
+
let entries;
|
|
92
|
+
try {
|
|
93
|
+
entries = readdirSync(root);
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
for (const name of entries) {
|
|
99
|
+
const installDir = join(root, name);
|
|
100
|
+
try {
|
|
101
|
+
if (!statSync(installDir).isDirectory())
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
const exe = executableForInstall(installDir);
|
|
108
|
+
if (!exe)
|
|
109
|
+
continue;
|
|
110
|
+
if (!seen.has(exe)) {
|
|
111
|
+
seen.set(exe, { path: exe, version: name });
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
const installs = Array.from(seen.values());
|
|
116
|
+
installs.sort((a, b) => compareUnityVersions(b.version, a.version)); // newest first
|
|
117
|
+
return installs;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Compare two Unity version strings for sort ordering. Unity versions look
|
|
121
|
+
* like `YYYY.N.PxX` or `6000.N.PxX` with an optional suffix (`a1`, `b2`,
|
|
122
|
+
* `f3`, `p4`, `c5`). We split on non-digit runs, compare numeric parts
|
|
123
|
+
* left-to-right, and fall back to lexicographic for the trailing suffix so
|
|
124
|
+
* `6000.4.0f1` > `6000.4.0b1` (final > beta, matching the Hub's intent of
|
|
125
|
+
* surfacing newer/more-stable releases first). Returns >0 / 0 / <0.
|
|
126
|
+
*/
|
|
127
|
+
export function compareUnityVersions(a, b) {
|
|
128
|
+
if (a === b)
|
|
129
|
+
return 0;
|
|
130
|
+
const partsA = a.split(/[^0-9]+/).filter(Boolean).map((n) => parseInt(n, 10));
|
|
131
|
+
const partsB = b.split(/[^0-9]+/).filter(Boolean).map((n) => parseInt(n, 10));
|
|
132
|
+
const len = Math.max(partsA.length, partsB.length);
|
|
133
|
+
for (let i = 0; i < len; i++) {
|
|
134
|
+
const av = partsA[i] ?? -1;
|
|
135
|
+
const bv = partsB[i] ?? -1;
|
|
136
|
+
if (av !== bv)
|
|
137
|
+
return av - bv;
|
|
138
|
+
}
|
|
139
|
+
// Numeric parts equal — compare the trailing suffix lexically (f > b > a).
|
|
140
|
+
return a.localeCompare(b);
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* True when `candidateVersion` should be preferred for a project whose
|
|
144
|
+
* running bridge reports `projectVersion`. Matches the full string first,
|
|
145
|
+
* then the leading dotted prefix (`6000.4` matches `6000.4.0f1`), so a
|
|
146
|
+
* patch-level difference still pins the right minor line. Null/empty
|
|
147
|
+
* `projectVersion` matches nothing (caller falls back to newest).
|
|
148
|
+
*/
|
|
149
|
+
export function versionMatches(candidateVersion, projectVersion) {
|
|
150
|
+
if (!projectVersion)
|
|
151
|
+
return false;
|
|
152
|
+
if (candidateVersion === projectVersion)
|
|
153
|
+
return true;
|
|
154
|
+
// Strip any trailing patch/suffix from the project version and prefix-match.
|
|
155
|
+
// "6000.4.0f1" -> prefix "6000.4" (first two numeric groups).
|
|
156
|
+
const groups = projectVersion.split(/[^0-9]+/).filter(Boolean);
|
|
157
|
+
if (groups.length >= 2) {
|
|
158
|
+
const prefix = groups.slice(0, 2).join(".");
|
|
159
|
+
if (candidateVersion.startsWith(prefix + ".") || candidateVersion.startsWith(prefix)) {
|
|
160
|
+
return true;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
return false;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Resolve the Unity executable to use for batch operations. Precedence:
|
|
167
|
+
* 1. `UNITY_PATH` env var — validated to exist; source "env". Not run
|
|
168
|
+
* through discovery so an explicit pin always wins even if the path
|
|
169
|
+
* points outside the Hub layout.
|
|
170
|
+
* 2. discovered installs — pick by `preferredVersion` match when given,
|
|
171
|
+
* else the newest (first, since discoverUnityInstalls sorts desc).
|
|
172
|
+
* 3. null — caller surfaces `unity_not_discovered`.
|
|
173
|
+
*
|
|
174
|
+
* `preferredVersion` is typically the running bridge's `unityVersion` read
|
|
175
|
+
* from the instance lock, so on multi-version machines batch picks the same
|
|
176
|
+
* editor the live project uses.
|
|
177
|
+
*
|
|
178
|
+
* `roots` is an optional override (test hook) forwarded to
|
|
179
|
+
* `discoverUnityInstalls` so tests can point at a temp fixture instead of the
|
|
180
|
+
* real machine state.
|
|
181
|
+
*/
|
|
182
|
+
export function resolveUnityPath(preferredVersion, roots) {
|
|
183
|
+
const envPath = process.env.UNITY_PATH;
|
|
184
|
+
if (envPath) {
|
|
185
|
+
try {
|
|
186
|
+
if (existsSync(envPath) && statSync(envPath).isFile()) {
|
|
187
|
+
return { path: envPath, version: "(env override)", source: "env" };
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
catch {
|
|
191
|
+
// fall through to discovery
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
const installs = discoverUnityInstalls(roots);
|
|
195
|
+
if (installs.length === 0)
|
|
196
|
+
return null;
|
|
197
|
+
if (preferredVersion) {
|
|
198
|
+
const match = installs.find((i) => versionMatches(i.version, preferredVersion));
|
|
199
|
+
if (match)
|
|
200
|
+
return { path: match.path, version: match.version, source: "discovered" };
|
|
201
|
+
}
|
|
202
|
+
// Newest first already.
|
|
203
|
+
const newest = installs[0];
|
|
204
|
+
return { path: newest.path, version: newest.version, source: "discovered" };
|
|
205
|
+
}
|
|
206
|
+
//# sourceMappingURL=unity-install-discovery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unity-install-discovery.js","sourceRoot":"","sources":["../src/unity-install-discovery.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,EAAE;AACF,mDAAmD;AACnD,0EAA0E;AAC1E,2EAA2E;AAC3E,2EAA2E;AAC3E,wEAAwE;AACxE,iDAAiD;AACjD,EAAE;AACF,kDAAkD;AAClD,kEAAkE;AAClE,4EAA4E;AAC5E,+EAA+E;AAC/E,qDAAqD;AAErD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAkBlC;;;;GAIG;AACH,MAAM,UAAU,eAAe;IAC7B,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;QACjC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;IACjE,CAAC;IACD,IAAI,OAAO,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAClC,OAAO,CAAC,gCAAgC,CAAC,CAAC;IAC5C,CAAC;IACD,oBAAoB;IACpB,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;AACrD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe;IAC7B,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAChC,KAAK,MAAM,CAAC,IAAI,eAAe,EAAE;QAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAChD,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC;IACrC,IAAI,MAAM;QAAE,KAAK,C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MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC3B,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC;AAC9E,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export type UnityLogPlatform = "win32" | "darwin" | "linux";
|
|
2
|
+
/** Resolve the live Editor.log directory for the current platform. Mirrors
|
|
3
|
+
* hub/src-tauri/src/config/logs.rs (editor_logs_dir_*).
|
|
4
|
+
* - macOS: ~/Library/Logs/Unity
|
|
5
|
+
* - Windows: %LOCALAPPDATA%\Unity\Editor
|
|
6
|
+
* - Linux: $XDG_CONFIG_HOME/unity3d or ~/.config/unity3d
|
|
7
|
+
*/
|
|
8
|
+
export declare function editorLogsDir(platform?: UnityLogPlatform): string;
|
|
9
|
+
/** Resolve the live Editor.log file path for the current platform. */
|
|
10
|
+
export declare function editorLogPath(platform?: UnityLogPlatform): string;
|
|
11
|
+
/** Default tail size. Bounded so a multi-MB log can't blow up the tool
|
|
12
|
+
* response; 256KB is ample for a compile-error burst (Unity writes the
|
|
13
|
+
* diagnostics in a contiguous block near the end of the log). */
|
|
14
|
+
export declare const DEFAULT_LOG_TAIL_BYTES: number;
|
|
15
|
+
export interface ReadLogTailResult {
|
|
16
|
+
/** Absolute path that was read. */
|
|
17
|
+
path: string;
|
|
18
|
+
/** Whether the file existed and was read. */
|
|
19
|
+
exists: boolean;
|
|
20
|
+
/** The tail content. Empty when the file is missing or unreadable. */
|
|
21
|
+
content: string;
|
|
22
|
+
/** Bytes read (content.length in UTF-8 bytes). 0 when missing. */
|
|
23
|
+
bytes: number;
|
|
24
|
+
/** Error message when the file existed but could not be read. */
|
|
25
|
+
error?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Read up to `maxBytes` from the END of a file, as a UTF-8 string. Returns
|
|
29
|
+
* { exists: false } when the file is absent. Never throws — read failures
|
|
30
|
+
* (permissions, vanished mid-read) surface as { exists, error }.
|
|
31
|
+
*
|
|
32
|
+
* The tail is read by seeking to (size - maxBytes) and reading forward, so a
|
|
33
|
+
* multi-MB log is not loaded in full.
|
|
34
|
+
*/
|
|
35
|
+
export declare function readLogTail(path: string, maxBytes?: number): ReadLogTailResult;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
// Unity Editor.log path resolution + tail, for the read_compile_errors tool.
|
|
2
|
+
//
|
|
3
|
+
// When the bridge assembly itself fails to compile, every in-bridge channel
|
|
4
|
+
// (read_console, editor_status, an in-bridge CompilationPipeline listener) is
|
|
5
|
+
// dead with it, and batch compile_check can't run either (the batch entry
|
|
6
|
+
// point lives in the same broken assembly, and Unity's per-project lock blocks
|
|
7
|
+
// a second instance). The ONE channel that survives is the live Editor's
|
|
8
|
+
// platform Editor.log — Unity writes CSxxxx diagnostics there regardless of
|
|
9
|
+
// bridge health. This module resolves that path per-OS (porting the logic from
|
|
10
|
+
// hub/src-tauri/src/config/logs.rs) and reads a bounded tail.
|
|
11
|
+
//
|
|
12
|
+
// No runtime deps beyond node built-ins (mcp-server/AGENTS.md).
|
|
13
|
+
import { existsSync, openSync, readSync, fstatSync, closeSync } from "node:fs";
|
|
14
|
+
import { homedir } from "node:os";
|
|
15
|
+
import { join } from "node:path";
|
|
16
|
+
/** Resolve the live Editor.log directory for the current platform. Mirrors
|
|
17
|
+
* hub/src-tauri/src/config/logs.rs (editor_logs_dir_*).
|
|
18
|
+
* - macOS: ~/Library/Logs/Unity
|
|
19
|
+
* - Windows: %LOCALAPPDATA%\Unity\Editor
|
|
20
|
+
* - Linux: $XDG_CONFIG_HOME/unity3d or ~/.config/unity3d
|
|
21
|
+
*/
|
|
22
|
+
export function editorLogsDir(platform = process.platform) {
|
|
23
|
+
switch (platform) {
|
|
24
|
+
case "darwin":
|
|
25
|
+
return join(homedir(), "Library", "Logs", "Unity");
|
|
26
|
+
case "win32": {
|
|
27
|
+
const local = process.env.LOCALAPPDATA;
|
|
28
|
+
if (local)
|
|
29
|
+
return join(local, "Unity", "Editor");
|
|
30
|
+
// LOCALAPPDATA is effectively always set on Windows; fall back to the
|
|
31
|
+
// Public user profile if it is somehow missing.
|
|
32
|
+
return join("C:\\Users\\Public\\AppData\\Local", "Unity", "Editor");
|
|
33
|
+
}
|
|
34
|
+
case "linux": {
|
|
35
|
+
const xdg = process.env.XDG_CONFIG_HOME;
|
|
36
|
+
if (xdg)
|
|
37
|
+
return join(xdg, "unity3d");
|
|
38
|
+
return join(homedir(), ".config", "unity3d");
|
|
39
|
+
}
|
|
40
|
+
default:
|
|
41
|
+
return join(homedir(), "Library", "Logs", "Unity");
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/** Resolve the live Editor.log file path for the current platform. */
|
|
45
|
+
export function editorLogPath(platform = process.platform) {
|
|
46
|
+
return join(editorLogsDir(platform), "Editor.log");
|
|
47
|
+
}
|
|
48
|
+
/** Default tail size. Bounded so a multi-MB log can't blow up the tool
|
|
49
|
+
* response; 256KB is ample for a compile-error burst (Unity writes the
|
|
50
|
+
* diagnostics in a contiguous block near the end of the log). */
|
|
51
|
+
export const DEFAULT_LOG_TAIL_BYTES = 256 * 1024;
|
|
52
|
+
/**
|
|
53
|
+
* Read up to `maxBytes` from the END of a file, as a UTF-8 string. Returns
|
|
54
|
+
* { exists: false } when the file is absent. Never throws — read failures
|
|
55
|
+
* (permissions, vanished mid-read) surface as { exists, error }.
|
|
56
|
+
*
|
|
57
|
+
* The tail is read by seeking to (size - maxBytes) and reading forward, so a
|
|
58
|
+
* multi-MB log is not loaded in full.
|
|
59
|
+
*/
|
|
60
|
+
export function readLogTail(path, maxBytes = DEFAULT_LOG_TAIL_BYTES) {
|
|
61
|
+
if (!existsSync(path)) {
|
|
62
|
+
return { path, exists: false, content: "", bytes: 0 };
|
|
63
|
+
}
|
|
64
|
+
let fd;
|
|
65
|
+
try {
|
|
66
|
+
fd = openSync(path, "r");
|
|
67
|
+
const stat = fstatSync(fd);
|
|
68
|
+
const size = stat.size;
|
|
69
|
+
const readLen = Math.min(size, Math.max(0, maxBytes));
|
|
70
|
+
const start = size - readLen;
|
|
71
|
+
const buf = Buffer.alloc(readLen);
|
|
72
|
+
// readSync may return fewer bytes than requested if the file is being
|
|
73
|
+
// written concurrently; loop until the buffer is filled or we hit EOF.
|
|
74
|
+
let read = 0;
|
|
75
|
+
while (read < readLen) {
|
|
76
|
+
// openSync's positional read overload (offset) is used so we don't rely
|
|
77
|
+
// on the file pointer's current position.
|
|
78
|
+
const n = readSync(fd, buf, read, readLen - read, start + read);
|
|
79
|
+
if (n === 0)
|
|
80
|
+
break;
|
|
81
|
+
read += n;
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
path,
|
|
85
|
+
exists: true,
|
|
86
|
+
content: buf.subarray(0, read).toString("utf8"),
|
|
87
|
+
bytes: read,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
catch (err) {
|
|
91
|
+
return {
|
|
92
|
+
path,
|
|
93
|
+
exists: true,
|
|
94
|
+
content: "",
|
|
95
|
+
bytes: 0,
|
|
96
|
+
error: err instanceof Error ? err.message : String(err),
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
finally {
|
|
100
|
+
if (fd !== undefined) {
|
|
101
|
+
try {
|
|
102
|
+
closeSync(fd);
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
// best-effort
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=unity-log.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unity-log.js","sourceRoot":"","sources":["../src/unity-log.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,0EAA0E;AAC1E,+EAA+E;AAC/E,yEAAyE;AACzE,4EAA4E;AAC5E,+EAA+E;AAC/E,8DAA8D;A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AI,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC;YAC/C,KAAK,EAAE,IAAI;SACZ,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO;YACL,IAAI;YACJ,MAAM,EAAE,IAAI;YACZ,OAAO,EAAE,EAAE;YACX,KAAK,EAAE,CAAC;YACR,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;SACxD,CAAC;IACJ,CAAC;YAAS,CAAC;QACT,IAAI,EAAE,KAAK,SAAS,EAAE,CAAC;YACrB,IAAI,CAAC;gBACH,SAAS,CAAC,EAAE,CAAC,CAAC;YAChB,CAAC;YAAC,MAAM,CAAC;gBACP,cAAc;YAChB,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "unity-open-mcp",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "MCP server (stdio) routing tool calls to the live Unity Open MCP Bridge or batch Unity processes.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"unity-open-mcp": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist/",
|
|
12
|
+
"README.md",
|
|
13
|
+
"LICENSE"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "tsc",
|
|
17
|
+
"build:test": "tsc -p tsconfig.test.json",
|
|
18
|
+
"typecheck": "tsc --noEmit",
|
|
19
|
+
"test": "npm run build:test && node --test 'dist-test/**/*.test.js'",
|
|
20
|
+
"prepublishOnly": "npm run build"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [
|
|
23
|
+
"mcp",
|
|
24
|
+
"model-context-protocol",
|
|
25
|
+
"unity",
|
|
26
|
+
"unity3d",
|
|
27
|
+
"ai",
|
|
28
|
+
"agent",
|
|
29
|
+
"claude",
|
|
30
|
+
"cursor",
|
|
31
|
+
"opencode",
|
|
32
|
+
"stdio"
|
|
33
|
+
],
|
|
34
|
+
"engines": {
|
|
35
|
+
"node": ">=18.0.0"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@modelcontextprotocol/sdk": "^1.12.1"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@types/node": "^22",
|
|
42
|
+
"typescript": "~5.6.2"
|
|
43
|
+
},
|
|
44
|
+
"license": "MIT",
|
|
45
|
+
"author": "Alexey Perov",
|
|
46
|
+
"homepage": "https://github.com/AlexeyPerov/Unity-Open-MCP",
|
|
47
|
+
"repository": {
|
|
48
|
+
"type": "git",
|
|
49
|
+
"url": "git+https://github.com/AlexeyPerov/Unity-Open-MCP.git"
|
|
50
|
+
},
|
|
51
|
+
"bugs": {
|
|
52
|
+
"url": "https://github.com/AlexeyPerov/Unity-Open-MCP/issues"
|
|
53
|
+
}
|
|
54
|
+
}
|