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,533 @@
|
|
|
1
|
+
// M13 T4.5 — Unity launch-errors / Safe Mode dialog auto-dismissal.
|
|
2
|
+
//
|
|
3
|
+
// When Unity starts (or the bridge is not yet ready), the Editor can block
|
|
4
|
+
// behind a native modal dialog — chiefly the "compile errors at launch" /
|
|
5
|
+
// "Enter Safe Mode?" prompt. The MCP server then stalls on `/ping` /
|
|
6
|
+
// compile-wait loops with no way to recover. This module probes the OS
|
|
7
|
+
// desktop for that dialog and clicks **Ignore** while the LiveClient's
|
|
8
|
+
// compile/bridge readiness wait is ticking — the same stall point agents hit
|
|
9
|
+
// today (UCP bridge-wait pattern).
|
|
10
|
+
//
|
|
11
|
+
// Design (porting Unity-MCP's `launch-error-dismiss` approach):
|
|
12
|
+
// - Default: ENABLED (Unity-MCP parity — auto-dismiss unless turned off).
|
|
13
|
+
// - Opt out via UNITY_OPEN_MCP_NO_AUTO_DISMISS_LAUNCH_ERRORS=1.
|
|
14
|
+
// - Tunable timeout (30s) / interval (1.5s) — Unity-MCP defaults.
|
|
15
|
+
// - Each successful dismissal is logged once to stderr (title + button +
|
|
16
|
+
// platform) for auditability.
|
|
17
|
+
// - Cross-platform: Windows (Win32/PowerShell), macOS (AppleScript),
|
|
18
|
+
// Linux/X11 (xdotool).
|
|
19
|
+
//
|
|
20
|
+
// No runtime deps beyond node builtins (mcp-server/AGENTS.md "no runtime
|
|
21
|
+
// deps beyond MCP SDK"): only child_process and os.
|
|
22
|
+
import { execFile, execFileSync } from "node:child_process";
|
|
23
|
+
import { platform as nodePlatform } from "node:os";
|
|
24
|
+
/**
|
|
25
|
+
* Window-title fragments matched against the Unity launch-errors dialog.
|
|
26
|
+
* Both legacy and current strings are listed so the matcher stays resilient
|
|
27
|
+
* across Unity versions. The match is case-insensitive and substring-based
|
|
28
|
+
* — Unity's actual title varies by version but always contains one of these.
|
|
29
|
+
*
|
|
30
|
+
* Exposed so tests can assert the matcher knows about both spellings without
|
|
31
|
+
* grepping the implementation.
|
|
32
|
+
*/
|
|
33
|
+
export const LAUNCH_ERROR_DIALOG_TITLE_FRAGMENTS = [
|
|
34
|
+
"Safe Mode", // Unity 2020.2+ ("Enter Safe Mode?") — the launch-errors dialog on every modern Unity (2022 LTS, 6000.x)
|
|
35
|
+
"Compiler Errors", // Unity 2020+ ("Hold On" + "Compiler Errors on Launch")
|
|
36
|
+
"Hold On", // Generic Unity progress dialog wrapping the launch-errors variant
|
|
37
|
+
"Compile Errors", // Older Unity dialog spelling
|
|
38
|
+
"Scripts have compiler errors", // Unity 2022+ on Linux (window manager surfacing)
|
|
39
|
+
];
|
|
40
|
+
/** The button label this helper presses to dismiss the dialog. */
|
|
41
|
+
export const DISMISS_BUTTON_LABEL = "Ignore";
|
|
42
|
+
/**
|
|
43
|
+
* Producer-side prefixes for error messages that callers treat as permanent
|
|
44
|
+
* (the polling loop bails out instead of ticking again). Exported so the
|
|
45
|
+
* bailout matcher references the SAME literal as the producers.
|
|
46
|
+
*/
|
|
47
|
+
export const LINUX_XDOTOOL_MISSING_PREFIX = "xdotool not found on PATH";
|
|
48
|
+
export const UNSUPPORTED_PLATFORM_PREFIX = "Unsupported platform for launch-errors auto-dismiss";
|
|
49
|
+
/**
|
|
50
|
+
* Try once to find and dismiss the Unity launch-errors dialog on the current
|
|
51
|
+
* OS desktop. Pure-ish — performs a single OS call and returns; never blocks
|
|
52
|
+
* past the underlying syscall's own timeout.
|
|
53
|
+
*
|
|
54
|
+
* Library-safe: never throws (errors are returned in the `DismissOutcome`
|
|
55
|
+
* union), never writes to stdout/stderr, never mutates global state.
|
|
56
|
+
*
|
|
57
|
+
* The helper is platform-dispatched:
|
|
58
|
+
* - **Windows**: Win32 (`EnumWindows` / `EnumChildWindows` /
|
|
59
|
+
* `GetWindowTextW` / `SendMessageW(BM_CLICK)`) driven from PowerShell so
|
|
60
|
+
* we do not pull in a native node-gyp dependency.
|
|
61
|
+
* - **macOS**: AppleScript via `osascript`. Requires Accessibility
|
|
62
|
+
* permission for the terminal / `node` binary once.
|
|
63
|
+
* - **Linux/X11**: `xdotool`. Wayland is deferred — the error message calls
|
|
64
|
+
* this out so the user does not waste time debugging.
|
|
65
|
+
*/
|
|
66
|
+
export async function tryDismissLaunchErrorsDialog(platform = nodePlatform()) {
|
|
67
|
+
switch (platform) {
|
|
68
|
+
case "win32":
|
|
69
|
+
return tryDismissWindows();
|
|
70
|
+
case "darwin":
|
|
71
|
+
return tryDismissMacOS();
|
|
72
|
+
case "linux":
|
|
73
|
+
return tryDismissLinuxX11();
|
|
74
|
+
default:
|
|
75
|
+
return {
|
|
76
|
+
kind: "error",
|
|
77
|
+
message: `${UNSUPPORTED_PLATFORM_PREFIX}: ${platform}`,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
// ---------------------------------------------------------------------------
|
|
82
|
+
// Windows — Win32 via PowerShell
|
|
83
|
+
// ---------------------------------------------------------------------------
|
|
84
|
+
/**
|
|
85
|
+
* The PowerShell payload that probes for the Unity launch-errors dialog and
|
|
86
|
+
* clicks `Ignore` if found. Exported as a string (not a function) so tests
|
|
87
|
+
* can assert the script shape without launching PowerShell.
|
|
88
|
+
*
|
|
89
|
+
* Strategy:
|
|
90
|
+
* 1. P/Invoke `EnumWindows` to enumerate every visible top-level window
|
|
91
|
+
* owned by `Unity.exe`.
|
|
92
|
+
* 2. Filter by title fragment (case-insensitive substring).
|
|
93
|
+
* 3. Walk child windows with `EnumChildWindows`, looking for a Button
|
|
94
|
+
* whose text equals `Ignore`.
|
|
95
|
+
* 4. Send `BM_CLICK` (0x00F5) to the matched button. Preferred over a
|
|
96
|
+
* synthesised mouse event — it works even if the user is mid-click in
|
|
97
|
+
* another app and does not steal focus.
|
|
98
|
+
*
|
|
99
|
+
* The script writes a single-token result to stdout:
|
|
100
|
+
* - `dismissed:<button>` on success
|
|
101
|
+
* - `not-found` when no dialog was matched
|
|
102
|
+
* - `error:<message>` on an unexpected exception
|
|
103
|
+
*/
|
|
104
|
+
export const WINDOWS_DISMISS_PS_SCRIPT = `
|
|
105
|
+
$ErrorActionPreference = 'Stop'
|
|
106
|
+
try {
|
|
107
|
+
if (-not ([System.Management.Automation.PSTypeName]'UnityOpenMcp.LaunchErrors.Dismisser').Type) {
|
|
108
|
+
Add-Type -TypeDefinition @"
|
|
109
|
+
using System;
|
|
110
|
+
using System.Collections.Generic;
|
|
111
|
+
using System.Runtime.InteropServices;
|
|
112
|
+
using System.Text;
|
|
113
|
+
namespace UnityOpenMcp.LaunchErrors {
|
|
114
|
+
public static class Dismisser {
|
|
115
|
+
public delegate bool EnumWindowsProc(IntPtr hWnd, IntPtr lParam);
|
|
116
|
+
[DllImport("user32.dll")] static extern bool EnumWindows(EnumWindowsProc lpEnumFunc, IntPtr lParam);
|
|
117
|
+
[DllImport("user32.dll", CharSet=CharSet.Unicode)] static extern int GetWindowTextW(IntPtr hWnd, StringBuilder lpString, int nMaxCount);
|
|
118
|
+
[DllImport("user32.dll", CharSet=CharSet.Unicode)] static extern int GetClassNameW(IntPtr hWnd, StringBuilder lpClassName, int nMaxCount);
|
|
119
|
+
[DllImport("user32.dll")] static extern bool IsWindowVisible(IntPtr hWnd);
|
|
120
|
+
[DllImport("user32.dll")] static extern bool EnumChildWindows(IntPtr hWndParent, EnumWindowsProc lpEnumFunc, IntPtr lParam);
|
|
121
|
+
[DllImport("user32.dll")] static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);
|
|
122
|
+
[DllImport("user32.dll", CharSet=CharSet.Unicode)] static extern IntPtr SendMessageW(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
|
|
123
|
+
const uint BM_CLICK = 0x00F5;
|
|
124
|
+
static readonly string[] TitleFragments = new[] { ${LAUNCH_ERROR_DIALOG_TITLE_FRAGMENTS.map((f) => JSON.stringify(f)).join(", ")} };
|
|
125
|
+
static readonly string[] ButtonLabels = new[] { "${DISMISS_BUTTON_LABEL}", "&${DISMISS_BUTTON_LABEL}" };
|
|
126
|
+
public static string TryDismiss(int[] unityPids) {
|
|
127
|
+
var unityPidSet = new HashSet<uint>();
|
|
128
|
+
for (int i = 0; i < unityPids.Length; i++) unityPidSet.Add((uint)unityPids[i]);
|
|
129
|
+
IntPtr matchedDialog = IntPtr.Zero;
|
|
130
|
+
var sb = new StringBuilder(512);
|
|
131
|
+
EnumWindows((hWnd, lParam) => {
|
|
132
|
+
if (!IsWindowVisible(hWnd)) return true;
|
|
133
|
+
uint procId; GetWindowThreadProcessId(hWnd, out procId);
|
|
134
|
+
if (!unityPidSet.Contains(procId)) return true;
|
|
135
|
+
sb.Length = 0;
|
|
136
|
+
GetWindowTextW(hWnd, sb, sb.Capacity);
|
|
137
|
+
var text = sb.ToString();
|
|
138
|
+
foreach (var frag in TitleFragments) {
|
|
139
|
+
if (text.IndexOf(frag, StringComparison.OrdinalIgnoreCase) >= 0) {
|
|
140
|
+
matchedDialog = hWnd;
|
|
141
|
+
return false;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return true;
|
|
145
|
+
}, IntPtr.Zero);
|
|
146
|
+
if (matchedDialog == IntPtr.Zero) return "not-found";
|
|
147
|
+
IntPtr matchedButton = IntPtr.Zero;
|
|
148
|
+
EnumChildWindows(matchedDialog, (hWnd, lParam) => {
|
|
149
|
+
sb.Length = 0;
|
|
150
|
+
GetClassNameW(hWnd, sb, sb.Capacity);
|
|
151
|
+
if (sb.ToString() != "Button") return true;
|
|
152
|
+
sb.Length = 0;
|
|
153
|
+
GetWindowTextW(hWnd, sb, sb.Capacity);
|
|
154
|
+
var text = sb.ToString();
|
|
155
|
+
foreach (var label in ButtonLabels) {
|
|
156
|
+
if (string.Equals(text, label, StringComparison.OrdinalIgnoreCase)) {
|
|
157
|
+
matchedButton = hWnd;
|
|
158
|
+
return false;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return true;
|
|
162
|
+
}, IntPtr.Zero);
|
|
163
|
+
if (matchedButton == IntPtr.Zero) return "not-found";
|
|
164
|
+
SendMessageW(matchedButton, BM_CLICK, IntPtr.Zero, IntPtr.Zero);
|
|
165
|
+
return "dismissed:${DISMISS_BUTTON_LABEL}";
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
"@
|
|
170
|
+
}
|
|
171
|
+
$unityPids = @(Get-Process -Name 'Unity' -ErrorAction SilentlyContinue | ForEach-Object { [int]$_.Id })
|
|
172
|
+
if ($unityPids.Count -eq 0) { Write-Output 'not-found'; return }
|
|
173
|
+
Write-Output ([UnityOpenMcp.LaunchErrors.Dismisser]::TryDismiss([int[]]$unityPids))
|
|
174
|
+
} catch {
|
|
175
|
+
Write-Output ('error:' + $_.Exception.Message)
|
|
176
|
+
}
|
|
177
|
+
`;
|
|
178
|
+
async function tryDismissWindows() {
|
|
179
|
+
return new Promise((resolve) => {
|
|
180
|
+
execFile("powershell", ["-NoProfile", "-NonInteractive", "-Command", WINDOWS_DISMISS_PS_SCRIPT], { timeout: 5000, windowsHide: true }, (err, stdout) => {
|
|
181
|
+
if (err) {
|
|
182
|
+
// ETIMEDOUT, ENOENT (powershell missing), etc. Treat as transient.
|
|
183
|
+
resolve({ kind: "error", message: err.message });
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
resolve(parseDismissOutput(stdout));
|
|
187
|
+
});
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
// ---------------------------------------------------------------------------
|
|
191
|
+
// macOS — AppleScript via osascript
|
|
192
|
+
// ---------------------------------------------------------------------------
|
|
193
|
+
/**
|
|
194
|
+
* The AppleScript snippet used for the macOS dismiss path. Exposed as a
|
|
195
|
+
* string for testability.
|
|
196
|
+
*
|
|
197
|
+
* Strategy: iterate every window of the Unity application process and click
|
|
198
|
+
* the first button titled `Ignore`. If Unity is not running OR no matching
|
|
199
|
+
* button exists, the script reports `not-found`. Any AppleScript exception
|
|
200
|
+
* (e.g. Accessibility permission not granted) is reported as `error:<msg>`.
|
|
201
|
+
*
|
|
202
|
+
* Requires the Terminal / `node` binary to have been granted Accessibility
|
|
203
|
+
* permission in System Settings → Privacy & Security → Accessibility.
|
|
204
|
+
*/
|
|
205
|
+
export const MACOS_DISMISS_APPLESCRIPT = `
|
|
206
|
+
on run
|
|
207
|
+
try
|
|
208
|
+
tell application "System Events"
|
|
209
|
+
if not (exists process "Unity") then
|
|
210
|
+
return "not-found"
|
|
211
|
+
end if
|
|
212
|
+
tell process "Unity"
|
|
213
|
+
repeat with w in windows
|
|
214
|
+
try
|
|
215
|
+
if exists (button "${DISMISS_BUTTON_LABEL}" of w) then
|
|
216
|
+
click button "${DISMISS_BUTTON_LABEL}" of w
|
|
217
|
+
return "dismissed:${DISMISS_BUTTON_LABEL}"
|
|
218
|
+
end if
|
|
219
|
+
end try
|
|
220
|
+
end repeat
|
|
221
|
+
end tell
|
|
222
|
+
end tell
|
|
223
|
+
return "not-found"
|
|
224
|
+
on error errMsg
|
|
225
|
+
return "error:" & errMsg
|
|
226
|
+
end try
|
|
227
|
+
end run
|
|
228
|
+
`;
|
|
229
|
+
async function tryDismissMacOS() {
|
|
230
|
+
return new Promise((resolve) => {
|
|
231
|
+
execFile("osascript", ["-e", MACOS_DISMISS_APPLESCRIPT], { timeout: 5000 }, (err, stdout) => {
|
|
232
|
+
if (err) {
|
|
233
|
+
resolve({ kind: "error", message: err.message });
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
resolve(parseDismissOutput(stdout));
|
|
237
|
+
});
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
// ---------------------------------------------------------------------------
|
|
241
|
+
// Linux/X11 — xdotool
|
|
242
|
+
// ---------------------------------------------------------------------------
|
|
243
|
+
/**
|
|
244
|
+
* Whether `xdotool` is on PATH. Cached per process so the polling loop pays
|
|
245
|
+
* the lookup cost at most once.
|
|
246
|
+
*/
|
|
247
|
+
let xdotoolPresence;
|
|
248
|
+
function isXdotoolAvailable() {
|
|
249
|
+
if (xdotoolPresence !== undefined)
|
|
250
|
+
return xdotoolPresence;
|
|
251
|
+
try {
|
|
252
|
+
execFileSync("xdotool", ["--version"], {
|
|
253
|
+
stdio: "ignore",
|
|
254
|
+
timeout: 2000,
|
|
255
|
+
});
|
|
256
|
+
xdotoolPresence = true;
|
|
257
|
+
}
|
|
258
|
+
catch {
|
|
259
|
+
xdotoolPresence = false;
|
|
260
|
+
}
|
|
261
|
+
return xdotoolPresence;
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Reset the cached `xdotool` presence flag. Test-only — production code
|
|
265
|
+
* never needs to call this.
|
|
266
|
+
*/
|
|
267
|
+
export function _resetXdotoolPresenceForTests() {
|
|
268
|
+
xdotoolPresence = undefined;
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Escape a literal string for safe use in `xdotool search --name`. The
|
|
272
|
+
* argument is interpreted as a regex; without escaping, a future fragment
|
|
273
|
+
* containing metacharacters would silently change the match semantics.
|
|
274
|
+
*/
|
|
275
|
+
export function regexEscapeForXdotool(s) {
|
|
276
|
+
return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Look up currently-running Unity Editor PIDs on the local box. Used by the
|
|
280
|
+
* Linux/X11 path to scope the title-fragment match to Unity processes only.
|
|
281
|
+
* Returns an empty array on any failure. Pure / idempotent / never throws.
|
|
282
|
+
*/
|
|
283
|
+
function getUnityPidsLinux() {
|
|
284
|
+
try {
|
|
285
|
+
const stdout = execFileSync("pgrep", ["-x", "Unity"], {
|
|
286
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
287
|
+
timeout: 1000,
|
|
288
|
+
encoding: "utf8",
|
|
289
|
+
});
|
|
290
|
+
return stdout
|
|
291
|
+
.split(/\r?\n/)
|
|
292
|
+
.map((s) => parseInt(s.trim(), 10))
|
|
293
|
+
.filter((n) => Number.isFinite(n) && n > 0);
|
|
294
|
+
}
|
|
295
|
+
catch {
|
|
296
|
+
return [];
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
async function tryDismissLinuxX11() {
|
|
300
|
+
if (!isXdotoolAvailable()) {
|
|
301
|
+
return {
|
|
302
|
+
kind: "error",
|
|
303
|
+
message: `${LINUX_XDOTOOL_MISSING_PREFIX}. Install it (e.g. \`sudo apt-get install xdotool\`) to enable Unity launch-errors auto-dismiss on Linux/X11. Wayland is not yet supported.`,
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
const unityPids = new Set(getUnityPidsLinux());
|
|
307
|
+
if (unityPids.size === 0) {
|
|
308
|
+
return { kind: "not-found" };
|
|
309
|
+
}
|
|
310
|
+
// Strategy:
|
|
311
|
+
// 1. `xdotool search --name '<regex-escaped fragment>'` once per fragment.
|
|
312
|
+
// 2. Filter candidate windows to those owned by a Unity PID via
|
|
313
|
+
// `xdotool getwindowpid <winId>` so we never act on an unrelated
|
|
314
|
+
// top-level window with a colliding title.
|
|
315
|
+
// 3. Activate the window and send Return to click the focused button.
|
|
316
|
+
// The Unity launch-errors dialog defaults focus to the leftmost
|
|
317
|
+
// button, which IS `Ignore`.
|
|
318
|
+
return new Promise((resolve) => {
|
|
319
|
+
const fragments = LAUNCH_ERROR_DIALOG_TITLE_FRAGMENTS;
|
|
320
|
+
let idx = 0;
|
|
321
|
+
const tryNext = () => {
|
|
322
|
+
if (idx >= fragments.length) {
|
|
323
|
+
resolve({ kind: "not-found" });
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
const fragment = fragments[idx++];
|
|
327
|
+
execFile("xdotool", ["search", "--name", regexEscapeForXdotool(fragment)], { timeout: 2000 }, (err, stdout) => {
|
|
328
|
+
if (err || !stdout.trim()) {
|
|
329
|
+
tryNext();
|
|
330
|
+
return;
|
|
331
|
+
}
|
|
332
|
+
const candidateIds = stdout.trim().split(/\s+/).filter(Boolean);
|
|
333
|
+
findUnityOwnedWindow(candidateIds, unityPids, (winId) => {
|
|
334
|
+
if (!winId) {
|
|
335
|
+
tryNext();
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
execFile("xdotool", [
|
|
339
|
+
"windowactivate",
|
|
340
|
+
"--sync",
|
|
341
|
+
winId,
|
|
342
|
+
"key",
|
|
343
|
+
"--clearmodifiers",
|
|
344
|
+
"Return",
|
|
345
|
+
], { timeout: 2000 }, (activateErr) => {
|
|
346
|
+
if (activateErr) {
|
|
347
|
+
resolve({
|
|
348
|
+
kind: "error",
|
|
349
|
+
message: `xdotool failed to dismiss window ${winId}: ${activateErr.message}`,
|
|
350
|
+
});
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
resolve({ kind: "dismissed", button: DISMISS_BUTTON_LABEL });
|
|
354
|
+
});
|
|
355
|
+
});
|
|
356
|
+
});
|
|
357
|
+
};
|
|
358
|
+
tryNext();
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* Walk `candidateIds` and call `done(winId)` with the first window owned by
|
|
363
|
+
* a Unity PID, or `done(undefined)` if none match. Sequential — the list is
|
|
364
|
+
* small and parallelism buys nothing meaningful here.
|
|
365
|
+
*/
|
|
366
|
+
function findUnityOwnedWindow(candidateIds, unityPids, done) {
|
|
367
|
+
let idx = 0;
|
|
368
|
+
const next = () => {
|
|
369
|
+
if (idx >= candidateIds.length) {
|
|
370
|
+
done(undefined);
|
|
371
|
+
return;
|
|
372
|
+
}
|
|
373
|
+
const winId = candidateIds[idx++];
|
|
374
|
+
execFile("xdotool", ["getwindowpid", winId], { timeout: 1000 }, (err, stdout) => {
|
|
375
|
+
if (err) {
|
|
376
|
+
next();
|
|
377
|
+
return;
|
|
378
|
+
}
|
|
379
|
+
const pid = parseInt(stdout.trim(), 10);
|
|
380
|
+
if (Number.isFinite(pid) && unityPids.has(pid)) {
|
|
381
|
+
done(winId);
|
|
382
|
+
return;
|
|
383
|
+
}
|
|
384
|
+
next();
|
|
385
|
+
});
|
|
386
|
+
};
|
|
387
|
+
next();
|
|
388
|
+
}
|
|
389
|
+
// ---------------------------------------------------------------------------
|
|
390
|
+
// Shared parser
|
|
391
|
+
// ---------------------------------------------------------------------------
|
|
392
|
+
/**
|
|
393
|
+
* Parse the single-token contract every platform-specific dispatcher writes
|
|
394
|
+
* to stdout. Inspects the LAST non-empty line of stdout, not the whole
|
|
395
|
+
* buffer: a stray PowerShell warning, `osascript` deprecation notice, or
|
|
396
|
+
* `xdotool` chatter printed before the contract token must not misclassify
|
|
397
|
+
* the result as `not-found`.
|
|
398
|
+
*
|
|
399
|
+
* Contract:
|
|
400
|
+
* - `dismissed:<button>` → `{ kind: "dismissed", button }`
|
|
401
|
+
* - `not-found` → `{ kind: "not-found" }`
|
|
402
|
+
* - `error:<message>` → `{ kind: "error", message }`
|
|
403
|
+
* - any other / empty → `{ kind: "not-found" }` (defensive — a transient
|
|
404
|
+
* parse miss is treated as "not yet visible" rather than aborting)
|
|
405
|
+
*/
|
|
406
|
+
export function parseDismissOutput(stdout) {
|
|
407
|
+
const lines = stdout
|
|
408
|
+
.split(/\r?\n/)
|
|
409
|
+
.map((l) => l.trim())
|
|
410
|
+
.filter((l) => l.length > 0);
|
|
411
|
+
if (lines.length === 0)
|
|
412
|
+
return { kind: "not-found" };
|
|
413
|
+
const last = lines[lines.length - 1];
|
|
414
|
+
if (last === "not-found")
|
|
415
|
+
return { kind: "not-found" };
|
|
416
|
+
if (last.startsWith("dismissed:")) {
|
|
417
|
+
const button = last.substring("dismissed:".length);
|
|
418
|
+
return { kind: "dismissed", button: button || DISMISS_BUTTON_LABEL };
|
|
419
|
+
}
|
|
420
|
+
if (last.startsWith("error:")) {
|
|
421
|
+
return { kind: "error", message: last.substring("error:".length) };
|
|
422
|
+
}
|
|
423
|
+
return { kind: "not-found" };
|
|
424
|
+
}
|
|
425
|
+
// ===========================================================================
|
|
426
|
+
// Polling loop + config
|
|
427
|
+
// ===========================================================================
|
|
428
|
+
/** Default dismiss probe timeout — Unity-MCP parity (30s overall budget). */
|
|
429
|
+
export const DEFAULT_DISMISS_TIMEOUT_MS = 30_000;
|
|
430
|
+
/** Default dismiss probe poll interval — Unity-MCP parity (1.5s tick). */
|
|
431
|
+
export const DEFAULT_DISMISS_INTERVAL_MS = 1_500;
|
|
432
|
+
/**
|
|
433
|
+
* Substring markers that identify a `kind: "error"` outcome as permanent for
|
|
434
|
+
* this run. When seen, the polling loop bails out after recording the error
|
|
435
|
+
* once; ticking again would just respawn the same doomed tool. Keep this list
|
|
436
|
+
* narrow — only conditions that cannot self-heal mid-launch belong here.
|
|
437
|
+
*/
|
|
438
|
+
const PERMANENT_DISMISS_ERROR_MARKERS = [
|
|
439
|
+
LINUX_XDOTOOL_MISSING_PREFIX,
|
|
440
|
+
UNSUPPORTED_PLATFORM_PREFIX,
|
|
441
|
+
];
|
|
442
|
+
function isPermanentDismissError(message) {
|
|
443
|
+
return PERMANENT_DISMISS_ERROR_MARKERS.some((m) => message.includes(m));
|
|
444
|
+
}
|
|
445
|
+
export function readDismissConfig(env = process.env) {
|
|
446
|
+
const enabled = env.UNITY_OPEN_MCP_NO_AUTO_DISMISS_LAUNCH_ERRORS !== "1";
|
|
447
|
+
return {
|
|
448
|
+
enabled,
|
|
449
|
+
timeoutMs: parsePositiveInt(env.UNITY_OPEN_MCP_DISMISS_TIMEOUT_MS, DEFAULT_DISMISS_TIMEOUT_MS),
|
|
450
|
+
intervalMs: parsePositiveInt(env.UNITY_OPEN_MCP_DISMISS_INTERVAL_MS, DEFAULT_DISMISS_INTERVAL_MS),
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
function parsePositiveInt(raw, fallback) {
|
|
454
|
+
if (raw === undefined || raw === "")
|
|
455
|
+
return fallback;
|
|
456
|
+
const n = parseInt(raw, 10);
|
|
457
|
+
if (!Number.isFinite(n) || n <= 0)
|
|
458
|
+
return fallback;
|
|
459
|
+
return n;
|
|
460
|
+
}
|
|
461
|
+
function defaultDismissLog(line) {
|
|
462
|
+
console.error(line);
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
* Poll the OS desktop for the Unity launch-errors dialog and click `Ignore`
|
|
466
|
+
* every time the probe reports it as found. Returns once the abort signal
|
|
467
|
+
* has fired (authoritative readiness), the overall timeout has elapsed, or
|
|
468
|
+
* a permanent platform error has been observed.
|
|
469
|
+
*
|
|
470
|
+
* Re-entrant dismissals are supported: when the dialog re-appears after a
|
|
471
|
+
* successful click (resolver-fix → dialog-reappears cycle), each subsequent
|
|
472
|
+
* dismissal emits its own log line so the recurrence shows in the audit log.
|
|
473
|
+
*
|
|
474
|
+
* Never throws. Transient platform errors (a momentary syscall failure) are
|
|
475
|
+
* logged once and then suppressed; permanent errors bail out after the first
|
|
476
|
+
* occurrence so the helper does not spawn doomed tool invocations on a fixed
|
|
477
|
+
* budget.
|
|
478
|
+
*
|
|
479
|
+
* The loop keeps polling until aborted even when no dialog appears — unlike
|
|
480
|
+
* Unity-MCP's standalone `open` CLI, this loop runs CONCURRENTLY with the
|
|
481
|
+
* LiveClient compile wait. The compile wait's resolution (compiling → idle)
|
|
482
|
+
* is the authoritative "no more launch dialog" signal and aborts this loop.
|
|
483
|
+
*/
|
|
484
|
+
export async function pollAndDismissLaunchErrors(opts) {
|
|
485
|
+
const platform = opts.platform ?? nodePlatform();
|
|
486
|
+
const probe = opts.probe ?? tryDismissLaunchErrorsDialog;
|
|
487
|
+
const log = opts.log ?? defaultDismissLog;
|
|
488
|
+
const deadline = Date.now() + Math.max(0, opts.timeoutMs);
|
|
489
|
+
const interval = Math.max(50, opts.intervalMs);
|
|
490
|
+
const seenErrorMessages = new Set();
|
|
491
|
+
let aborted = opts.abortSignal?.aborted ?? false;
|
|
492
|
+
const onAbort = () => {
|
|
493
|
+
aborted = true;
|
|
494
|
+
};
|
|
495
|
+
opts.abortSignal?.addEventListener("abort", onAbort, { once: true });
|
|
496
|
+
try {
|
|
497
|
+
while (Date.now() < deadline && !aborted) {
|
|
498
|
+
const outcome = await probe(platform);
|
|
499
|
+
// Re-check exit conditions BEFORE applying the outcome: if abort fired
|
|
500
|
+
// (or the deadline lapsed) while `probe` was in flight, the in-flight
|
|
501
|
+
// result is stale and applying it would emit a misleading log.
|
|
502
|
+
if (aborted || Date.now() >= deadline)
|
|
503
|
+
break;
|
|
504
|
+
if (outcome.kind === "dismissed") {
|
|
505
|
+
log(`[unity-open-mcp] dismissed Unity launch-errors dialog ` +
|
|
506
|
+
`(button=${outcome.button}, platform=${platform})`);
|
|
507
|
+
// Keep polling — the dialog may re-appear after the resolver fixes
|
|
508
|
+
// one error and surfaces the next.
|
|
509
|
+
}
|
|
510
|
+
else if (outcome.kind === "error") {
|
|
511
|
+
if (!seenErrorMessages.has(outcome.message)) {
|
|
512
|
+
seenErrorMessages.add(outcome.message);
|
|
513
|
+
log(`[unity-open-mcp] launch-errors auto-dismiss: ${outcome.message}`);
|
|
514
|
+
}
|
|
515
|
+
if (isPermanentDismissError(outcome.message)) {
|
|
516
|
+
// No point ticking again — bail out.
|
|
517
|
+
return;
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
const remaining = deadline - Date.now();
|
|
521
|
+
if (remaining <= 0 || aborted)
|
|
522
|
+
break;
|
|
523
|
+
await sleepMs(Math.min(interval, remaining));
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
finally {
|
|
527
|
+
opts.abortSignal?.removeEventListener("abort", onAbort);
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
function sleepMs(ms) {
|
|
531
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
532
|
+
}
|
|
533
|
+
//# sourceMappingURL=dialog-dismiss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog-dismiss.js","sourceRoot":"","sources":["../src/dialog-dismiss.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,EAAE;AACF,2EAA2E;AAC3E,0EAA0E;AAC1E,qEAAqE;AACrE,uEAAuE;AACvE,uEAAuE;AACvE,6EAA6E;AAC7E,mCAAmC;AACnC,EAAE;AACF,gEAAgE;AAChE,4EAA4E;AAC5E,kEAAkE;AAClE,oEAAoE;AACpE,2EAA2E;AAC3E,kCAAkC;AAClC,uEAAuE;AACvE,2BAA2B;AAC3B,EAAE;AACF,yEAAyE;AACzE,oDAAoD;AAEpD,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC5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eEvent {
|
|
2
|
+
seq: number;
|
|
3
|
+
ts: string;
|
|
4
|
+
type: "log" | "editor_state" | "ready" | "missed" | "close";
|
|
5
|
+
logType?: string;
|
|
6
|
+
message?: string;
|
|
7
|
+
stack?: string;
|
|
8
|
+
state?: string;
|
|
9
|
+
isCompiling?: boolean;
|
|
10
|
+
isPlaying?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface PullResult {
|
|
13
|
+
subscriberId: string;
|
|
14
|
+
events: BridgeEvent[];
|
|
15
|
+
/** Count of events dropped from the queue before this pull (overflow). */
|
|
16
|
+
dropped: number;
|
|
17
|
+
/** Whether the SSE reader is currently connected. */
|
|
18
|
+
connected: boolean;
|
|
19
|
+
/** Whether this pull started the subscription (first call). */
|
|
20
|
+
started: boolean;
|
|
21
|
+
/** Last reconnect failure reason, when `connected` is false. */
|
|
22
|
+
lastError: string | null;
|
|
23
|
+
}
|
|
24
|
+
export declare class BridgeEventStream {
|
|
25
|
+
private readonly baseUrl;
|
|
26
|
+
private readonly authToken?;
|
|
27
|
+
private subscriberId;
|
|
28
|
+
private queue;
|
|
29
|
+
private dropped;
|
|
30
|
+
private connected;
|
|
31
|
+
private lastError;
|
|
32
|
+
private abortController;
|
|
33
|
+
private reconnectTimer;
|
|
34
|
+
private started;
|
|
35
|
+
constructor(baseUrl: string, subscriberId?: string, authToken?: string | undefined);
|
|
36
|
+
/**
|
|
37
|
+
* Start the SSE reader if it isn't running. Safe to call repeatedly; returns
|
|
38
|
+
* true when a fresh subscription was started this call.
|
|
39
|
+
*/
|
|
40
|
+
ensureSubscription(): boolean;
|
|
41
|
+
private connect;
|
|
42
|
+
private pump;
|
|
43
|
+
private handleBlock;
|
|
44
|
+
/**
|
|
45
|
+
* Parse one SSE block (the text between two blank-line separators) into a
|
|
46
|
+
* BridgeEvent, or null when the block carries no data. Exposed for unit
|
|
47
|
+
* testing — the SSE reader loop calls it via handleBlock.
|
|
48
|
+
*/
|
|
49
|
+
static parseSseBlock(block: string): BridgeEvent | null;
|
|
50
|
+
private enqueue;
|
|
51
|
+
private scheduleReconnect;
|
|
52
|
+
/** Drain all queued events. The subscription keeps running. */
|
|
53
|
+
drain(maxEvents: number): BridgeEvent[];
|
|
54
|
+
/** One-shot pull: start the subscription if needed and drain. */
|
|
55
|
+
pull(maxEvents: number): PullResult;
|
|
56
|
+
/** Stop the reader and clear state. Idempotent; used in tests. */
|
|
57
|
+
stop(): void;
|
|
58
|
+
get isConnected(): boolean;
|
|
59
|
+
get id(): string;
|
|
60
|
+
}
|