@vibesdotdev/external 0.0.0-stage → 1.0.0-rc.1
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 +18 -0
- package/README.md +68 -2
- package/REFERENCE.md +217 -0
- package/dist/acp/index.d.ts +28 -0
- package/dist/acp/index.d.ts.map +1 -0
- package/dist/acp/index.js +31 -0
- package/dist/acp/index.js.map +1 -0
- package/dist/ambient/agent-roster-heartbeat.d.ts +67 -0
- package/dist/ambient/agent-roster-heartbeat.d.ts.map +1 -0
- package/dist/ambient/agent-roster-heartbeat.js +257 -0
- package/dist/ambient/agent-roster-heartbeat.js.map +1 -0
- package/dist/ambient/attempt.d.ts +19 -0
- package/dist/ambient/attempt.d.ts.map +1 -0
- package/dist/ambient/attempt.js +39 -0
- package/dist/ambient/attempt.js.map +1 -0
- package/dist/ambient/cloud-agent-roster-provider.impl.d.ts +13 -0
- package/dist/ambient/cloud-agent-roster-provider.impl.d.ts.map +1 -0
- package/dist/ambient/cloud-agent-roster-provider.impl.js +73 -0
- package/dist/ambient/cloud-agent-roster-provider.impl.js.map +1 -0
- package/dist/ambient/cloud-authenticated-json.d.ts +69 -0
- package/dist/ambient/cloud-authenticated-json.d.ts.map +1 -0
- package/dist/ambient/cloud-authenticated-json.js +108 -0
- package/dist/ambient/cloud-authenticated-json.js.map +1 -0
- package/dist/ambient/cloud-touch-projection.impl.d.ts +74 -0
- package/dist/ambient/cloud-touch-projection.impl.d.ts.map +1 -0
- package/dist/ambient/cloud-touch-projection.impl.js +225 -0
- package/dist/ambient/cloud-touch-projection.impl.js.map +1 -0
- package/dist/ambient/collaboration-settings.d.ts +50 -0
- package/dist/ambient/collaboration-settings.d.ts.map +1 -0
- package/dist/ambient/collaboration-settings.js +57 -0
- package/dist/ambient/collaboration-settings.js.map +1 -0
- package/dist/ambient/collision-notice.d.ts +41 -0
- package/dist/ambient/collision-notice.d.ts.map +1 -0
- package/dist/ambient/collision-notice.js +104 -0
- package/dist/ambient/collision-notice.js.map +1 -0
- package/dist/ambient/default-collision-filter.impl.d.ts +19 -0
- package/dist/ambient/default-collision-filter.impl.d.ts.map +1 -0
- package/dist/ambient/default-collision-filter.impl.js +53 -0
- package/dist/ambient/default-collision-filter.impl.js.map +1 -0
- package/dist/ambient/default-notice-formatter.impl.d.ts +4 -0
- package/dist/ambient/default-notice-formatter.impl.d.ts.map +1 -0
- package/dist/ambient/default-notice-formatter.impl.js +38 -0
- package/dist/ambient/default-notice-formatter.impl.js.map +1 -0
- package/dist/ambient/file-access-ambient-drain.impl.d.ts +21 -0
- package/dist/ambient/file-access-ambient-drain.impl.d.ts.map +1 -0
- package/dist/ambient/file-access-ambient-drain.impl.js +53 -0
- package/dist/ambient/file-access-ambient-drain.impl.js.map +1 -0
- package/dist/ambient/file-access-ambient-drain.subscription.descriptor.d.ts +27 -0
- package/dist/ambient/file-access-ambient-drain.subscription.descriptor.d.ts.map +1 -0
- package/dist/ambient/file-access-ambient-drain.subscription.descriptor.js +27 -0
- package/dist/ambient/file-access-ambient-drain.subscription.descriptor.js.map +1 -0
- package/dist/ambient/file-access-ambient-fs.impl.d.ts +45 -0
- package/dist/ambient/file-access-ambient-fs.impl.d.ts.map +1 -0
- package/dist/ambient/file-access-ambient-fs.impl.js +243 -0
- package/dist/ambient/file-access-ambient-fs.impl.js.map +1 -0
- package/dist/ambient/file-access-ambient-fs.subscription.descriptor.d.ts +32 -0
- package/dist/ambient/file-access-ambient-fs.subscription.descriptor.d.ts.map +1 -0
- package/dist/ambient/file-access-ambient-fs.subscription.descriptor.js +39 -0
- package/dist/ambient/file-access-ambient-fs.subscription.descriptor.js.map +1 -0
- package/dist/ambient/file-access-ambient.impl.d.ts +32 -0
- package/dist/ambient/file-access-ambient.impl.d.ts.map +1 -0
- package/dist/ambient/file-access-ambient.impl.js +231 -0
- package/dist/ambient/file-access-ambient.impl.js.map +1 -0
- package/dist/ambient/file-access-ambient.subscription.descriptor.d.ts +31 -0
- package/dist/ambient/file-access-ambient.subscription.descriptor.d.ts.map +1 -0
- package/dist/ambient/file-access-ambient.subscription.descriptor.js +31 -0
- package/dist/ambient/file-access-ambient.subscription.descriptor.js.map +1 -0
- package/dist/ambient/file-access-shared.d.ts +48 -0
- package/dist/ambient/file-access-shared.d.ts.map +1 -0
- package/dist/ambient/file-access-shared.js +59 -0
- package/dist/ambient/file-access-shared.js.map +1 -0
- package/dist/ambient/message-transport.impl.d.ts +47 -0
- package/dist/ambient/message-transport.impl.d.ts.map +1 -0
- package/dist/ambient/message-transport.impl.js +300 -0
- package/dist/ambient/message-transport.impl.js.map +1 -0
- package/dist/ambient/pending-notices.d.ts +11 -0
- package/dist/ambient/pending-notices.d.ts.map +1 -0
- package/dist/ambient/pending-notices.js +24 -0
- package/dist/ambient/pending-notices.js.map +1 -0
- package/dist/ambient/subsystem-overlap.impl.d.ts +60 -0
- package/dist/ambient/subsystem-overlap.impl.d.ts.map +1 -0
- package/dist/ambient/subsystem-overlap.impl.js +127 -0
- package/dist/ambient/subsystem-overlap.impl.js.map +1 -0
- package/dist/cli/dev.external.hooks-install.descriptor.d.ts +7 -0
- package/dist/cli/dev.external.hooks-install.descriptor.d.ts.map +1 -0
- package/dist/cli/dev.external.hooks-install.descriptor.js +27 -0
- package/dist/cli/dev.external.hooks-install.descriptor.js.map +1 -0
- package/dist/cli/dev.external.hooks-install.impl.d.ts +9 -0
- package/dist/cli/dev.external.hooks-install.impl.d.ts.map +1 -0
- package/dist/cli/dev.external.hooks-install.impl.js +57 -0
- package/dist/cli/dev.external.hooks-install.impl.js.map +1 -0
- package/dist/cli/dev.external.hooks-list.descriptor.d.ts +7 -0
- package/dist/cli/dev.external.hooks-list.descriptor.d.ts.map +1 -0
- package/dist/cli/dev.external.hooks-list.descriptor.js +16 -0
- package/dist/cli/dev.external.hooks-list.descriptor.js.map +1 -0
- package/dist/cli/dev.external.hooks-list.impl.d.ts +3 -0
- package/dist/cli/dev.external.hooks-list.impl.d.ts.map +1 -0
- package/dist/cli/dev.external.hooks-list.impl.js +68 -0
- package/dist/cli/dev.external.hooks-list.impl.js.map +1 -0
- package/dist/cli/dev.external.hooks-uninstall.descriptor.d.ts +7 -0
- package/dist/cli/dev.external.hooks-uninstall.descriptor.d.ts.map +1 -0
- package/dist/cli/dev.external.hooks-uninstall.descriptor.js +30 -0
- package/dist/cli/dev.external.hooks-uninstall.descriptor.js.map +1 -0
- package/dist/cli/dev.external.hooks-uninstall.impl.d.ts +9 -0
- package/dist/cli/dev.external.hooks-uninstall.impl.d.ts.map +1 -0
- package/dist/cli/dev.external.hooks-uninstall.impl.js +59 -0
- package/dist/cli/dev.external.hooks-uninstall.impl.js.map +1 -0
- package/dist/cli/dev.external.hooks.call.descriptor.d.ts +12 -0
- package/dist/cli/dev.external.hooks.call.descriptor.d.ts.map +1 -0
- package/dist/cli/dev.external.hooks.call.descriptor.js +51 -0
- package/dist/cli/dev.external.hooks.call.descriptor.js.map +1 -0
- package/dist/cli/dev.external.hooks.call.impl.d.ts +6 -0
- package/dist/cli/dev.external.hooks.call.impl.d.ts.map +1 -0
- package/dist/cli/dev.external.hooks.call.impl.js +162 -0
- package/dist/cli/dev.external.hooks.call.impl.js.map +1 -0
- package/dist/cli/dev.external.hooks.descriptor.d.ts +9 -0
- package/dist/cli/dev.external.hooks.descriptor.d.ts.map +1 -0
- package/dist/cli/dev.external.hooks.descriptor.js +17 -0
- package/dist/cli/dev.external.hooks.descriptor.js.map +1 -0
- package/dist/cli/dev.external.launch.descriptor.d.ts +7 -0
- package/dist/cli/dev.external.launch.descriptor.d.ts.map +1 -0
- package/dist/cli/dev.external.launch.descriptor.js +31 -0
- package/dist/cli/dev.external.launch.descriptor.js.map +1 -0
- package/dist/cli/dev.external.launch.impl.d.ts +17 -0
- package/dist/cli/dev.external.launch.impl.d.ts.map +1 -0
- package/dist/cli/dev.external.launch.impl.js +137 -0
- package/dist/cli/dev.external.launch.impl.js.map +1 -0
- package/dist/cli/dev.external.presets-apply.descriptor.d.ts +7 -0
- package/dist/cli/dev.external.presets-apply.descriptor.d.ts.map +1 -0
- package/dist/cli/dev.external.presets-apply.descriptor.js +36 -0
- package/dist/cli/dev.external.presets-apply.descriptor.js.map +1 -0
- package/dist/cli/dev.external.presets-apply.impl.d.ts +3 -0
- package/dist/cli/dev.external.presets-apply.impl.d.ts.map +1 -0
- package/dist/cli/dev.external.presets-apply.impl.js +119 -0
- package/dist/cli/dev.external.presets-apply.impl.js.map +1 -0
- package/dist/cli/dev.external.presets-list.descriptor.d.ts +7 -0
- package/dist/cli/dev.external.presets-list.descriptor.d.ts.map +1 -0
- package/dist/cli/dev.external.presets-list.descriptor.js +21 -0
- package/dist/cli/dev.external.presets-list.descriptor.js.map +1 -0
- package/dist/cli/dev.external.presets-list.impl.d.ts +3 -0
- package/dist/cli/dev.external.presets-list.impl.d.ts.map +1 -0
- package/dist/cli/dev.external.presets-list.impl.js +33 -0
- package/dist/cli/dev.external.presets-list.impl.js.map +1 -0
- package/dist/cli/dev.external.presets-show.descriptor.d.ts +7 -0
- package/dist/cli/dev.external.presets-show.descriptor.d.ts.map +1 -0
- package/dist/cli/dev.external.presets-show.descriptor.js +29 -0
- package/dist/cli/dev.external.presets-show.descriptor.js.map +1 -0
- package/dist/cli/dev.external.presets-show.impl.d.ts +7 -0
- package/dist/cli/dev.external.presets-show.impl.d.ts.map +1 -0
- package/dist/cli/dev.external.presets-show.impl.js +39 -0
- package/dist/cli/dev.external.presets-show.impl.js.map +1 -0
- package/dist/cli/dev.external.presets.descriptor.d.ts +7 -0
- package/dist/cli/dev.external.presets.descriptor.d.ts.map +1 -0
- package/dist/cli/dev.external.presets.descriptor.js +15 -0
- package/dist/cli/dev.external.presets.descriptor.js.map +1 -0
- package/dist/cli/dev.external.setup.descriptor.d.ts +7 -0
- package/dist/cli/dev.external.setup.descriptor.d.ts.map +1 -0
- package/dist/cli/dev.external.setup.descriptor.js +29 -0
- package/dist/cli/dev.external.setup.descriptor.js.map +1 -0
- package/dist/cli/dev.external.setup.impl.d.ts +3 -0
- package/dist/cli/dev.external.setup.impl.d.ts.map +1 -0
- package/dist/cli/dev.external.setup.impl.js +129 -0
- package/dist/cli/dev.external.setup.impl.js.map +1 -0
- package/dist/cli/dev.external.skills-generate.descriptor.d.ts +7 -0
- package/dist/cli/dev.external.skills-generate.descriptor.d.ts.map +1 -0
- package/dist/cli/dev.external.skills-generate.descriptor.js +43 -0
- package/dist/cli/dev.external.skills-generate.descriptor.js.map +1 -0
- package/dist/cli/dev.external.skills-generate.impl.consumer.d.ts +3 -0
- package/dist/cli/dev.external.skills-generate.impl.consumer.d.ts.map +1 -0
- package/dist/cli/dev.external.skills-generate.impl.consumer.js +140 -0
- package/dist/cli/dev.external.skills-generate.impl.consumer.js.map +1 -0
- package/dist/cli/dev.external.skills.descriptor.d.ts +7 -0
- package/dist/cli/dev.external.skills.descriptor.d.ts.map +1 -0
- package/dist/cli/dev.external.skills.descriptor.js +15 -0
- package/dist/cli/dev.external.skills.descriptor.js.map +1 -0
- package/dist/cli/dev.external.status.descriptor.d.ts +7 -0
- package/dist/cli/dev.external.status.descriptor.d.ts.map +1 -0
- package/dist/cli/dev.external.status.descriptor.js +16 -0
- package/dist/cli/dev.external.status.descriptor.js.map +1 -0
- package/dist/cli/dev.external.status.impl.d.ts +24 -0
- package/dist/cli/dev.external.status.impl.d.ts.map +1 -0
- package/dist/cli/dev.external.status.impl.js +165 -0
- package/dist/cli/dev.external.status.impl.js.map +1 -0
- package/dist/cli/launch/launch.cli-group.descriptor.d.ts +4 -0
- package/dist/cli/launch/launch.cli-group.descriptor.d.ts.map +1 -0
- package/dist/cli/launch/launch.cli-group.descriptor.js +12 -0
- package/dist/cli/launch/launch.cli-group.descriptor.js.map +1 -0
- package/dist/cli/launch/launch.harness.impl.consumer.d.ts +6 -0
- package/dist/cli/launch/launch.harness.impl.consumer.d.ts.map +1 -0
- package/dist/cli/launch/launch.harness.impl.consumer.js +55 -0
- package/dist/cli/launch/launch.harness.impl.consumer.js.map +1 -0
- package/dist/cli/launch/launch.list.descriptor.d.ts +4 -0
- package/dist/cli/launch/launch.list.descriptor.d.ts.map +1 -0
- package/dist/cli/launch/launch.list.descriptor.js +13 -0
- package/dist/cli/launch/launch.list.descriptor.js.map +1 -0
- package/dist/cli/launch/launch.list.impl.consumer.d.ts +7 -0
- package/dist/cli/launch/launch.list.impl.consumer.d.ts.map +1 -0
- package/dist/cli/launch/launch.list.impl.consumer.js +26 -0
- package/dist/cli/launch/launch.list.impl.consumer.js.map +1 -0
- package/dist/cli/launch/launch.logs.descriptor.d.ts +4 -0
- package/dist/cli/launch/launch.logs.descriptor.d.ts.map +1 -0
- package/dist/cli/launch/launch.logs.descriptor.js +30 -0
- package/dist/cli/launch/launch.logs.descriptor.js.map +1 -0
- package/dist/cli/launch/launch.logs.impl.consumer.d.ts +7 -0
- package/dist/cli/launch/launch.logs.impl.consumer.d.ts.map +1 -0
- package/dist/cli/launch/launch.logs.impl.consumer.js +78 -0
- package/dist/cli/launch/launch.logs.impl.consumer.js.map +1 -0
- package/dist/cli/launch/launch.status.descriptor.d.ts +4 -0
- package/dist/cli/launch/launch.status.descriptor.d.ts.map +1 -0
- package/dist/cli/launch/launch.status.descriptor.js +21 -0
- package/dist/cli/launch/launch.status.descriptor.js.map +1 -0
- package/dist/cli/launch/launch.status.impl.consumer.d.ts +7 -0
- package/dist/cli/launch/launch.status.impl.consumer.d.ts.map +1 -0
- package/dist/cli/launch/launch.status.impl.consumer.js +69 -0
- package/dist/cli/launch/launch.status.impl.consumer.js.map +1 -0
- package/dist/cli/plugin.d.ts +4 -0
- package/dist/cli/plugin.d.ts.map +1 -0
- package/dist/cli/plugin.js +76 -0
- package/dist/cli/plugin.js.map +1 -0
- package/dist/cli/runtime-projection.d.ts +34 -0
- package/dist/cli/runtime-projection.d.ts.map +1 -0
- package/dist/cli/runtime-projection.js +272 -0
- package/dist/cli/runtime-projection.js.map +1 -0
- package/dist/cli/stdio.d.ts +15 -0
- package/dist/cli/stdio.d.ts.map +1 -0
- package/dist/cli/stdio.js +15 -0
- package/dist/cli/stdio.js.map +1 -0
- package/dist/cli/who.descriptor.d.ts +16 -0
- package/dist/cli/who.descriptor.d.ts.map +1 -0
- package/dist/cli/who.descriptor.js +38 -0
- package/dist/cli/who.descriptor.js.map +1 -0
- package/dist/cli/who.impl.d.ts +16 -0
- package/dist/cli/who.impl.d.ts.map +1 -0
- package/dist/cli/who.impl.js +127 -0
- package/dist/cli/who.impl.js.map +1 -0
- package/dist/client/external-client.d.ts +423 -0
- package/dist/client/external-client.d.ts.map +1 -0
- package/dist/client/external-client.js +988 -0
- package/dist/client/external-client.js.map +1 -0
- package/dist/client/index.d.ts +9 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +8 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/lifecycle.d.ts +25 -0
- package/dist/client/lifecycle.d.ts.map +1 -0
- package/dist/client/lifecycle.js +134 -0
- package/dist/client/lifecycle.js.map +1 -0
- package/dist/config/binary-detection.d.ts +26 -0
- package/dist/config/binary-detection.d.ts.map +1 -0
- package/dist/config/binary-detection.js +105 -0
- package/dist/config/binary-detection.js.map +1 -0
- package/dist/config/external.config.descriptor.d.ts +11 -0
- package/dist/config/external.config.descriptor.d.ts.map +1 -0
- package/dist/config/external.config.descriptor.js +41 -0
- package/dist/config/external.config.descriptor.js.map +1 -0
- package/dist/config/index.d.ts +10 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +10 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/manifest.d.ts +4696 -0
- package/dist/config/manifest.d.ts.map +1 -0
- package/dist/config/manifest.js +210 -0
- package/dist/config/manifest.js.map +1 -0
- package/dist/config/read.d.ts +13 -0
- package/dist/config/read.d.ts.map +1 -0
- package/dist/config/read.js +20 -0
- package/dist/config/read.js.map +1 -0
- package/dist/consumer.d.ts +15 -0
- package/dist/consumer.d.ts.map +1 -0
- package/dist/consumer.js +15 -0
- package/dist/consumer.js.map +1 -0
- package/dist/detection/base.d.ts +71 -0
- package/dist/detection/base.d.ts.map +1 -0
- package/dist/detection/base.js +115 -0
- package/dist/detection/base.js.map +1 -0
- package/dist/detection/command-probe.d.ts +43 -0
- package/dist/detection/command-probe.d.ts.map +1 -0
- package/dist/detection/command-probe.js +75 -0
- package/dist/detection/command-probe.js.map +1 -0
- package/dist/detection/config-document.d.ts +31 -0
- package/dist/detection/config-document.d.ts.map +1 -0
- package/dist/detection/config-document.js +138 -0
- package/dist/detection/config-document.js.map +1 -0
- package/dist/detection/index.d.ts +11 -0
- package/dist/detection/index.d.ts.map +1 -0
- package/dist/detection/index.js +13 -0
- package/dist/detection/index.js.map +1 -0
- package/dist/detection/manifest-detector-helpers.d.ts +45 -0
- package/dist/detection/manifest-detector-helpers.d.ts.map +1 -0
- package/dist/detection/manifest-detector-helpers.js +198 -0
- package/dist/detection/manifest-detector-helpers.js.map +1 -0
- package/dist/detection/manifest-detector.d.ts +34 -0
- package/dist/detection/manifest-detector.d.ts.map +1 -0
- package/dist/detection/manifest-detector.js +123 -0
- package/dist/detection/manifest-detector.js.map +1 -0
- package/dist/detection/service.d.ts +99 -0
- package/dist/detection/service.d.ts.map +1 -0
- package/dist/detection/service.js +124 -0
- package/dist/detection/service.js.map +1 -0
- package/dist/detection/types.d.ts +113 -0
- package/dist/detection/types.d.ts.map +1 -0
- package/dist/detection/types.js +30 -0
- package/dist/detection/types.js.map +1 -0
- package/dist/dev.external.descriptor.d.ts +9 -0
- package/dist/dev.external.descriptor.d.ts.map +1 -0
- package/dist/dev.external.descriptor.js +17 -0
- package/dist/dev.external.descriptor.js.map +1 -0
- package/dist/docs/external.ambient.docs.descriptor.d.ts +4 -0
- package/dist/docs/external.ambient.docs.descriptor.d.ts.map +1 -0
- package/dist/docs/external.ambient.docs.descriptor.js +109 -0
- package/dist/docs/external.ambient.docs.descriptor.js.map +1 -0
- package/dist/external-adapter/descriptors.d.ts +133 -0
- package/dist/external-adapter/descriptors.d.ts.map +1 -0
- package/dist/external-adapter/descriptors.js +70 -0
- package/dist/external-adapter/descriptors.js.map +1 -0
- package/dist/external-adapter/implementations.d.ts +13 -0
- package/dist/external-adapter/implementations.d.ts.map +1 -0
- package/dist/external-adapter/implementations.js +97 -0
- package/dist/external-adapter/implementations.js.map +1 -0
- package/dist/external-adapter/schemas/adapter.d.ts +66 -0
- package/dist/external-adapter/schemas/adapter.d.ts.map +1 -0
- package/dist/external-adapter/schemas/adapter.js +55 -0
- package/dist/external-adapter/schemas/adapter.js.map +1 -0
- package/dist/external-tool/impl/default-tool.d.ts +201 -0
- package/dist/external-tool/impl/default-tool.d.ts.map +1 -0
- package/dist/external-tool/impl/default-tool.js +243 -0
- package/dist/external-tool/impl/default-tool.js.map +1 -0
- package/dist/external-tool/interfaces/tool.d.ts +102 -0
- package/dist/external-tool/interfaces/tool.d.ts.map +1 -0
- package/dist/external-tool/interfaces/tool.js +2 -0
- package/dist/external-tool/interfaces/tool.js.map +1 -0
- package/dist/external-tool/loader.d.ts +5 -0
- package/dist/external-tool/loader.d.ts.map +1 -0
- package/dist/external-tool/loader.js +8 -0
- package/dist/external-tool/loader.js.map +1 -0
- package/dist/external-tool/path-template.d.ts +54 -0
- package/dist/external-tool/path-template.d.ts.map +1 -0
- package/dist/external-tool/path-template.js +65 -0
- package/dist/external-tool/path-template.js.map +1 -0
- package/dist/external-tool/runtime.d.ts +38 -0
- package/dist/external-tool/runtime.d.ts.map +1 -0
- package/dist/external-tool/runtime.js +89 -0
- package/dist/external-tool/runtime.js.map +1 -0
- package/dist/external-tool/schemas/tool.d.ts +269 -0
- package/dist/external-tool/schemas/tool.d.ts.map +1 -0
- package/dist/external-tool/schemas/tool.js +77 -0
- package/dist/external-tool/schemas/tool.js.map +1 -0
- package/dist/external.plugin.d.ts +4 -0
- package/dist/external.plugin.d.ts.map +1 -0
- package/dist/external.plugin.js +184 -0
- package/dist/external.plugin.js.map +1 -0
- package/dist/harness/agent-host-scope.d.ts +18 -0
- package/dist/harness/agent-host-scope.d.ts.map +1 -0
- package/dist/harness/agent-host-scope.js +30 -0
- package/dist/harness/agent-host-scope.js.map +1 -0
- package/dist/harness/agent-host-settings.d.ts +6 -0
- package/dist/harness/agent-host-settings.d.ts.map +1 -0
- package/dist/harness/agent-host-settings.js +18 -0
- package/dist/harness/agent-host-settings.js.map +1 -0
- package/dist/harness/agent-host.config.descriptor.d.ts +6 -0
- package/dist/harness/agent-host.config.descriptor.d.ts.map +1 -0
- package/dist/harness/agent-host.config.descriptor.js +22 -0
- package/dist/harness/agent-host.config.descriptor.js.map +1 -0
- package/dist/harness/agent-host.d.ts +98 -0
- package/dist/harness/agent-host.d.ts.map +1 -0
- package/dist/harness/agent-host.js +203 -0
- package/dist/harness/agent-host.js.map +1 -0
- package/dist/harness/command-arguments.d.ts +54 -0
- package/dist/harness/command-arguments.d.ts.map +1 -0
- package/dist/harness/command-arguments.js +113 -0
- package/dist/harness/command-arguments.js.map +1 -0
- package/dist/harness/command-execution.d.ts +20 -0
- package/dist/harness/command-execution.d.ts.map +1 -0
- package/dist/harness/command-execution.js +78 -0
- package/dist/harness/command-execution.js.map +1 -0
- package/dist/harness/command-output.d.ts +59 -0
- package/dist/harness/command-output.d.ts.map +1 -0
- package/dist/harness/command-output.js +173 -0
- package/dist/harness/command-output.js.map +1 -0
- package/dist/harness/execution-queue.d.ts +14 -0
- package/dist/harness/execution-queue.d.ts.map +1 -0
- package/dist/harness/execution-queue.js +23 -0
- package/dist/harness/execution-queue.js.map +1 -0
- package/dist/harness/index.d.ts +15 -0
- package/dist/harness/index.d.ts.map +1 -0
- package/dist/harness/index.js +12 -0
- package/dist/harness/index.js.map +1 -0
- package/dist/harness/live-tools.d.ts +130 -0
- package/dist/harness/live-tools.d.ts.map +1 -0
- package/dist/harness/live-tools.js +257 -0
- package/dist/harness/live-tools.js.map +1 -0
- package/dist/harness/managed-block.d.ts +34 -0
- package/dist/harness/managed-block.d.ts.map +1 -0
- package/dist/harness/managed-block.js +66 -0
- package/dist/harness/managed-block.js.map +1 -0
- package/dist/harness/markers.d.ts +22 -0
- package/dist/harness/markers.d.ts.map +1 -0
- package/dist/harness/markers.js +28 -0
- package/dist/harness/markers.js.map +1 -0
- package/dist/harness/node.d.ts +6 -0
- package/dist/harness/node.d.ts.map +1 -0
- package/dist/harness/node.js +6 -0
- package/dist/harness/node.js.map +1 -0
- package/dist/harness/prompt.d.ts +54 -0
- package/dist/harness/prompt.d.ts.map +1 -0
- package/dist/harness/prompt.js +78 -0
- package/dist/harness/prompt.js.map +1 -0
- package/dist/harness/prompts/index.d.ts +113 -0
- package/dist/harness/prompts/index.d.ts.map +1 -0
- package/dist/harness/prompts/index.js +5 -0
- package/dist/harness/prompts/index.js.map +1 -0
- package/dist/harness/prompts/static-briefing-note.prompt.descriptor.d.ts +114 -0
- package/dist/harness/prompts/static-briefing-note.prompt.descriptor.d.ts.map +1 -0
- package/dist/harness/prompts/static-briefing-note.prompt.descriptor.js +17 -0
- package/dist/harness/prompts/static-briefing-note.prompt.descriptor.js.map +1 -0
- package/dist/harness/prompts/system-prompt.prompt.descriptor.d.ts +114 -0
- package/dist/harness/prompts/system-prompt.prompt.descriptor.d.ts.map +1 -0
- package/dist/harness/prompts/system-prompt.prompt.descriptor.js +35 -0
- package/dist/harness/prompts/system-prompt.prompt.descriptor.js.map +1 -0
- package/dist/harness/role-prompt.d.ts +12 -0
- package/dist/harness/role-prompt.d.ts.map +1 -0
- package/dist/harness/role-prompt.js +24 -0
- package/dist/harness/role-prompt.js.map +1 -0
- package/dist/harness/runtime-transport.d.ts +89 -0
- package/dist/harness/runtime-transport.d.ts.map +1 -0
- package/dist/harness/runtime-transport.js +356 -0
- package/dist/harness/runtime-transport.js.map +1 -0
- package/dist/harness/schemas/agent-host.d.ts +146 -0
- package/dist/harness/schemas/agent-host.d.ts.map +1 -0
- package/dist/harness/schemas/agent-host.js +26 -0
- package/dist/harness/schemas/agent-host.js.map +1 -0
- package/dist/harness/stdio-sink.d.ts +35 -0
- package/dist/harness/stdio-sink.d.ts.map +1 -0
- package/dist/harness/stdio-sink.js +34 -0
- package/dist/harness/stdio-sink.js.map +1 -0
- package/dist/harness/strip-undefined.d.ts +9 -0
- package/dist/harness/strip-undefined.d.ts.map +1 -0
- package/dist/harness/strip-undefined.js +11 -0
- package/dist/harness/strip-undefined.js.map +1 -0
- package/dist/harness/tool-projection.d.ts +130 -0
- package/dist/harness/tool-projection.d.ts.map +1 -0
- package/dist/harness/tool-projection.js +195 -0
- package/dist/harness/tool-projection.js.map +1 -0
- package/dist/harness/validation-errors.d.ts +11 -0
- package/dist/harness/validation-errors.d.ts.map +1 -0
- package/dist/harness/validation-errors.js +32 -0
- package/dist/harness/validation-errors.js.map +1 -0
- package/dist/hooks/bounded-payload.d.ts +39 -0
- package/dist/hooks/bounded-payload.d.ts.map +1 -0
- package/dist/hooks/bounded-payload.js +70 -0
- package/dist/hooks/bounded-payload.js.map +1 -0
- package/dist/hooks/bridge.d.ts +34 -0
- package/dist/hooks/bridge.d.ts.map +1 -0
- package/dist/hooks/bridge.js +86 -0
- package/dist/hooks/bridge.js.map +1 -0
- package/dist/hooks/call.d.ts +298 -0
- package/dist/hooks/call.d.ts.map +1 -0
- package/dist/hooks/call.js +1550 -0
- package/dist/hooks/call.js.map +1 -0
- package/dist/hooks/consumer.d.ts +7 -0
- package/dist/hooks/consumer.d.ts.map +1 -0
- package/dist/hooks/consumer.js +5 -0
- package/dist/hooks/consumer.js.map +1 -0
- package/dist/hooks/continuity.d.ts +155 -0
- package/dist/hooks/continuity.d.ts.map +1 -0
- package/dist/hooks/continuity.js +187 -0
- package/dist/hooks/continuity.js.map +1 -0
- package/dist/hooks/dispatch-script.d.ts +27 -0
- package/dist/hooks/dispatch-script.d.ts.map +1 -0
- package/dist/hooks/dispatch-script.js +77 -0
- package/dist/hooks/dispatch-script.js.map +1 -0
- package/dist/hooks/edit-targets.d.ts +23 -0
- package/dist/hooks/edit-targets.d.ts.map +1 -0
- package/dist/hooks/edit-targets.js +74 -0
- package/dist/hooks/edit-targets.js.map +1 -0
- package/dist/hooks/hook-delivery.d.ts +21 -0
- package/dist/hooks/hook-delivery.d.ts.map +1 -0
- package/dist/hooks/hook-delivery.js +87 -0
- package/dist/hooks/hook-delivery.js.map +1 -0
- package/dist/hooks/hook-seat.d.ts +37 -0
- package/dist/hooks/hook-seat.d.ts.map +1 -0
- package/dist/hooks/hook-seat.js +59 -0
- package/dist/hooks/hook-seat.js.map +1 -0
- package/dist/hooks/index.d.ts +9 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +8 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/native-edit-guard.d.ts +25 -0
- package/dist/hooks/native-edit-guard.d.ts.map +1 -0
- package/dist/hooks/native-edit-guard.js +33 -0
- package/dist/hooks/native-edit-guard.js.map +1 -0
- package/dist/hooks/native-edit-locks.d.ts +54 -0
- package/dist/hooks/native-edit-locks.d.ts.map +1 -0
- package/dist/hooks/native-edit-locks.js +98 -0
- package/dist/hooks/native-edit-locks.js.map +1 -0
- package/dist/hooks/resolve-event.d.ts +13 -0
- package/dist/hooks/resolve-event.d.ts.map +1 -0
- package/dist/hooks/resolve-event.js +32 -0
- package/dist/hooks/resolve-event.js.map +1 -0
- package/dist/hooks/review-state.d.ts +22 -0
- package/dist/hooks/review-state.d.ts.map +1 -0
- package/dist/hooks/review-state.js +57 -0
- package/dist/hooks/review-state.js.map +1 -0
- package/dist/hooks/runtime.d.ts +146 -0
- package/dist/hooks/runtime.d.ts.map +1 -0
- package/dist/hooks/runtime.js +83 -0
- package/dist/hooks/runtime.js.map +1 -0
- package/dist/hooks/self-review.d.ts +14 -0
- package/dist/hooks/self-review.d.ts.map +1 -0
- package/dist/hooks/self-review.js +28 -0
- package/dist/hooks/self-review.js.map +1 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +33 -0
- package/dist/index.js.map +1 -0
- package/dist/ingest/logging/subagent-completions.output.descriptor.d.ts +4 -0
- package/dist/ingest/logging/subagent-completions.output.descriptor.d.ts.map +1 -0
- package/dist/ingest/logging/subagent-completions.output.descriptor.js +22 -0
- package/dist/ingest/logging/subagent-completions.output.descriptor.js.map +1 -0
- package/dist/ingest/logging/success-patterns.output.descriptor.d.ts +4 -0
- package/dist/ingest/logging/success-patterns.output.descriptor.d.ts.map +1 -0
- package/dist/ingest/logging/success-patterns.output.descriptor.js +22 -0
- package/dist/ingest/logging/success-patterns.output.descriptor.js.map +1 -0
- package/dist/ingest/logging/tool-use.output.descriptor.d.ts +4 -0
- package/dist/ingest/logging/tool-use.output.descriptor.d.ts.map +1 -0
- package/dist/ingest/logging/tool-use.output.descriptor.js +22 -0
- package/dist/ingest/logging/tool-use.output.descriptor.js.map +1 -0
- package/dist/ingest/resolve-log-paths.d.ts +16 -0
- package/dist/ingest/resolve-log-paths.d.ts.map +1 -0
- package/dist/ingest/resolve-log-paths.js +43 -0
- package/dist/ingest/resolve-log-paths.js.map +1 -0
- package/dist/ingest/schemas.d.ts +43 -0
- package/dist/ingest/schemas.d.ts.map +1 -0
- package/dist/ingest/schemas.js +46 -0
- package/dist/ingest/schemas.js.map +1 -0
- package/dist/jsonrpc/client.d.ts +129 -0
- package/dist/jsonrpc/client.d.ts.map +1 -0
- package/dist/jsonrpc/client.js +553 -0
- package/dist/jsonrpc/client.js.map +1 -0
- package/dist/jsonrpc/envelope.d.ts +37 -0
- package/dist/jsonrpc/envelope.d.ts.map +1 -0
- package/dist/jsonrpc/envelope.js +46 -0
- package/dist/jsonrpc/envelope.js.map +1 -0
- package/dist/jsonrpc/errors.d.ts +28 -0
- package/dist/jsonrpc/errors.d.ts.map +1 -0
- package/dist/jsonrpc/errors.js +110 -0
- package/dist/jsonrpc/errors.js.map +1 -0
- package/dist/jsonrpc/framing.d.ts +35 -0
- package/dist/jsonrpc/framing.d.ts.map +1 -0
- package/dist/jsonrpc/framing.js +134 -0
- package/dist/jsonrpc/framing.js.map +1 -0
- package/dist/jsonrpc/index.d.ts +11 -0
- package/dist/jsonrpc/index.d.ts.map +1 -0
- package/dist/jsonrpc/index.js +11 -0
- package/dist/jsonrpc/index.js.map +1 -0
- package/dist/jsonrpc/outcome.d.ts +25 -0
- package/dist/jsonrpc/outcome.d.ts.map +1 -0
- package/dist/jsonrpc/outcome.js +32 -0
- package/dist/jsonrpc/outcome.js.map +1 -0
- package/dist/jsonrpc/queue.d.ts +30 -0
- package/dist/jsonrpc/queue.d.ts.map +1 -0
- package/dist/jsonrpc/queue.js +113 -0
- package/dist/jsonrpc/queue.js.map +1 -0
- package/dist/jsonrpc/schemas.d.ts +74 -0
- package/dist/jsonrpc/schemas.d.ts.map +1 -0
- package/dist/jsonrpc/schemas.js +65 -0
- package/dist/jsonrpc/schemas.js.map +1 -0
- package/dist/launch/consumer/execute.d.ts +5 -0
- package/dist/launch/consumer/execute.d.ts.map +1 -0
- package/dist/launch/consumer/execute.js +358 -0
- package/dist/launch/consumer/execute.js.map +1 -0
- package/dist/launch/consumer/paths.d.ts +15 -0
- package/dist/launch/consumer/paths.d.ts.map +1 -0
- package/dist/launch/consumer/paths.js +18 -0
- package/dist/launch/consumer/paths.js.map +1 -0
- package/dist/launch/consumer/prepare.d.ts +25 -0
- package/dist/launch/consumer/prepare.d.ts.map +1 -0
- package/dist/launch/consumer/prepare.js +158 -0
- package/dist/launch/consumer/prepare.js.map +1 -0
- package/dist/launch/consumer/prompt.d.ts +18 -0
- package/dist/launch/consumer/prompt.d.ts.map +1 -0
- package/dist/launch/consumer/prompt.js +45 -0
- package/dist/launch/consumer/prompt.js.map +1 -0
- package/dist/launch/consumer/rotate-logs.d.ts +23 -0
- package/dist/launch/consumer/rotate-logs.d.ts.map +1 -0
- package/dist/launch/consumer/rotate-logs.js +43 -0
- package/dist/launch/consumer/rotate-logs.js.map +1 -0
- package/dist/launch/consumer/spawn.d.ts +38 -0
- package/dist/launch/consumer/spawn.d.ts.map +1 -0
- package/dist/launch/consumer/spawn.js +82 -0
- package/dist/launch/consumer/spawn.js.map +1 -0
- package/dist/launch/consumer/state-rows.d.ts +41 -0
- package/dist/launch/consumer/state-rows.d.ts.map +1 -0
- package/dist/launch/consumer/state-rows.js +78 -0
- package/dist/launch/consumer/state-rows.js.map +1 -0
- package/dist/launch/consumer/store.d.ts +139 -0
- package/dist/launch/consumer/store.d.ts.map +1 -0
- package/dist/launch/consumer/store.js +495 -0
- package/dist/launch/consumer/store.js.map +1 -0
- package/dist/launch/index.d.ts +5 -0
- package/dist/launch/index.d.ts.map +1 -0
- package/dist/launch/index.js +3 -0
- package/dist/launch/index.js.map +1 -0
- package/dist/launch/resolve.d.ts +9 -0
- package/dist/launch/resolve.d.ts.map +1 -0
- package/dist/launch/resolve.js +139 -0
- package/dist/launch/resolve.js.map +1 -0
- package/dist/launch/schemas.d.ts +289 -0
- package/dist/launch/schemas.d.ts.map +1 -0
- package/dist/launch/schemas.js +154 -0
- package/dist/launch/schemas.js.map +1 -0
- package/dist/launch/task-executor/external-harness.descriptor.d.ts +6 -0
- package/dist/launch/task-executor/external-harness.descriptor.d.ts.map +1 -0
- package/dist/launch/task-executor/external-harness.descriptor.js +13 -0
- package/dist/launch/task-executor/external-harness.descriptor.js.map +1 -0
- package/dist/launch/task-executor/external-harness.impl.consumer.d.ts +17 -0
- package/dist/launch/task-executor/external-harness.impl.consumer.d.ts.map +1 -0
- package/dist/launch/task-executor/external-harness.impl.consumer.js +151 -0
- package/dist/launch/task-executor/external-harness.impl.consumer.js.map +1 -0
- package/dist/launch/task-executor/isolated-workspace.d.ts +3 -0
- package/dist/launch/task-executor/isolated-workspace.d.ts.map +1 -0
- package/dist/launch/task-executor/isolated-workspace.js +3 -0
- package/dist/launch/task-executor/isolated-workspace.js.map +1 -0
- package/dist/launch/task-executor/session-locks.d.ts +28 -0
- package/dist/launch/task-executor/session-locks.d.ts.map +1 -0
- package/dist/launch/task-executor/session-locks.js +50 -0
- package/dist/launch/task-executor/session-locks.js.map +1 -0
- package/dist/pack/adapter-codegen.d.ts +38 -0
- package/dist/pack/adapter-codegen.d.ts.map +1 -0
- package/dist/pack/adapter-codegen.js +70 -0
- package/dist/pack/adapter-codegen.js.map +1 -0
- package/dist/pack/build.d.ts +48 -0
- package/dist/pack/build.d.ts.map +1 -0
- package/dist/pack/build.js +171 -0
- package/dist/pack/build.js.map +1 -0
- package/dist/pack/emitters/hooks.d.ts +14 -0
- package/dist/pack/emitters/hooks.d.ts.map +1 -0
- package/dist/pack/emitters/hooks.js +15 -0
- package/dist/pack/emitters/hooks.js.map +1 -0
- package/dist/pack/emitters/json.d.ts +10 -0
- package/dist/pack/emitters/json.d.ts.map +1 -0
- package/dist/pack/emitters/json.js +17 -0
- package/dist/pack/emitters/json.js.map +1 -0
- package/dist/pack/emitters/registry.d.ts +22 -0
- package/dist/pack/emitters/registry.d.ts.map +1 -0
- package/dist/pack/emitters/registry.js +38 -0
- package/dist/pack/emitters/registry.js.map +1 -0
- package/dist/pack/emitters/toml.d.ts +8 -0
- package/dist/pack/emitters/toml.d.ts.map +1 -0
- package/dist/pack/emitters/toml.js +28 -0
- package/dist/pack/emitters/toml.js.map +1 -0
- package/dist/pack/emitters/yaml.d.ts +8 -0
- package/dist/pack/emitters/yaml.d.ts.map +1 -0
- package/dist/pack/emitters/yaml.js +27 -0
- package/dist/pack/emitters/yaml.js.map +1 -0
- package/dist/pack/index.d.ts +11 -0
- package/dist/pack/index.d.ts.map +1 -0
- package/dist/pack/index.js +11 -0
- package/dist/pack/index.js.map +1 -0
- package/dist/pack/mcp.d.ts +28 -0
- package/dist/pack/mcp.d.ts.map +1 -0
- package/dist/pack/mcp.js +70 -0
- package/dist/pack/mcp.js.map +1 -0
- package/dist/pack/persist.d.ts +28 -0
- package/dist/pack/persist.d.ts.map +1 -0
- package/dist/pack/persist.js +35 -0
- package/dist/pack/persist.js.map +1 -0
- package/dist/pack/schema.d.ts +126 -0
- package/dist/pack/schema.d.ts.map +1 -0
- package/dist/pack/schema.js +56 -0
- package/dist/pack/schema.js.map +1 -0
- package/dist/plugins/index.d.ts +512 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +25 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/installers/config-file.d.ts +21 -0
- package/dist/plugins/installers/config-file.d.ts.map +1 -0
- package/dist/plugins/installers/config-file.js +48 -0
- package/dist/plugins/installers/config-file.js.map +1 -0
- package/dist/plugins/installers/config-value.d.ts +35 -0
- package/dist/plugins/installers/config-value.d.ts.map +1 -0
- package/dist/plugins/installers/config-value.js +52 -0
- package/dist/plugins/installers/config-value.js.map +1 -0
- package/dist/plugins/installers/hooks/index.d.ts +9 -0
- package/dist/plugins/installers/hooks/index.d.ts.map +1 -0
- package/dist/plugins/installers/hooks/index.js +12 -0
- package/dist/plugins/installers/hooks/index.js.map +1 -0
- package/dist/plugins/installers/hooks/scoped-paths.d.ts +24 -0
- package/dist/plugins/installers/hooks/scoped-paths.d.ts.map +1 -0
- package/dist/plugins/installers/hooks/scoped-paths.js +80 -0
- package/dist/plugins/installers/hooks/scoped-paths.js.map +1 -0
- package/dist/plugins/installers/hooks/settings-registration.d.ts +79 -0
- package/dist/plugins/installers/hooks/settings-registration.d.ts.map +1 -0
- package/dist/plugins/installers/hooks/settings-registration.js +125 -0
- package/dist/plugins/installers/hooks/settings-registration.js.map +1 -0
- package/dist/plugins/installers/hooks/shell-installer.d.ts +21 -0
- package/dist/plugins/installers/hooks/shell-installer.d.ts.map +1 -0
- package/dist/plugins/installers/hooks/shell-installer.js +298 -0
- package/dist/plugins/installers/hooks/shell-installer.js.map +1 -0
- package/dist/plugins/installers/hooks/uninstall-backup.d.ts +19 -0
- package/dist/plugins/installers/hooks/uninstall-backup.d.ts.map +1 -0
- package/dist/plugins/installers/hooks/uninstall-backup.js +20 -0
- package/dist/plugins/installers/hooks/uninstall-backup.js.map +1 -0
- package/dist/plugins/installers/index.d.ts +58 -0
- package/dist/plugins/installers/index.d.ts.map +1 -0
- package/dist/plugins/installers/index.js +303 -0
- package/dist/plugins/installers/index.js.map +1 -0
- package/dist/plugins/installers/mcp/environment.d.ts +180 -0
- package/dist/plugins/installers/mcp/environment.d.ts.map +1 -0
- package/dist/plugins/installers/mcp/environment.js +314 -0
- package/dist/plugins/installers/mcp/environment.js.map +1 -0
- package/dist/plugins/installers/mcp/index.d.ts +9 -0
- package/dist/plugins/installers/mcp/index.d.ts.map +1 -0
- package/dist/plugins/installers/mcp/index.js +11 -0
- package/dist/plugins/installers/mcp/index.js.map +1 -0
- package/dist/plugins/installers/mcp/json-installer.d.ts +18 -0
- package/dist/plugins/installers/mcp/json-installer.d.ts.map +1 -0
- package/dist/plugins/installers/mcp/json-installer.js +155 -0
- package/dist/plugins/installers/mcp/json-installer.js.map +1 -0
- package/dist/plugins/installers/mcp/json-paths.d.ts +13 -0
- package/dist/plugins/installers/mcp/json-paths.d.ts.map +1 -0
- package/dist/plugins/installers/mcp/json-paths.js +130 -0
- package/dist/plugins/installers/mcp/json-paths.js.map +1 -0
- package/dist/plugins/installers/mcp/serve-identity.d.ts +19 -0
- package/dist/plugins/installers/mcp/serve-identity.d.ts.map +1 -0
- package/dist/plugins/installers/mcp/serve-identity.js +31 -0
- package/dist/plugins/installers/mcp/serve-identity.js.map +1 -0
- package/dist/plugins/installers/mcp/server-config.d.ts +20 -0
- package/dist/plugins/installers/mcp/server-config.d.ts.map +1 -0
- package/dist/plugins/installers/mcp/server-config.js +64 -0
- package/dist/plugins/installers/mcp/server-config.js.map +1 -0
- package/dist/plugins/installers/mcp/toml-installer.d.ts +41 -0
- package/dist/plugins/installers/mcp/toml-installer.d.ts.map +1 -0
- package/dist/plugins/installers/mcp/toml-installer.js +407 -0
- package/dist/plugins/installers/mcp/toml-installer.js.map +1 -0
- package/dist/plugins/installers/mcp/yaml-installer.d.ts +22 -0
- package/dist/plugins/installers/mcp/yaml-installer.d.ts.map +1 -0
- package/dist/plugins/installers/mcp/yaml-installer.js +156 -0
- package/dist/plugins/installers/mcp/yaml-installer.js.map +1 -0
- package/dist/plugins/installers/runtime.d.ts +42 -0
- package/dist/plugins/installers/runtime.d.ts.map +1 -0
- package/dist/plugins/installers/runtime.js +56 -0
- package/dist/plugins/installers/runtime.js.map +1 -0
- package/dist/plugins/installers/types.d.ts +306 -0
- package/dist/plugins/installers/types.d.ts.map +1 -0
- package/dist/plugins/installers/types.js +40 -0
- package/dist/plugins/installers/types.js.map +1 -0
- package/dist/plugins/schemas/index.d.ts +6 -0
- package/dist/plugins/schemas/index.d.ts.map +1 -0
- package/dist/plugins/schemas/index.js +5 -0
- package/dist/plugins/schemas/index.js.map +1 -0
- package/dist/plugins/schemas/manifest.d.ts +527 -0
- package/dist/plugins/schemas/manifest.d.ts.map +1 -0
- package/dist/plugins/schemas/manifest.js +355 -0
- package/dist/plugins/schemas/manifest.js.map +1 -0
- package/dist/plugins/tools/index.d.ts +12 -0
- package/dist/plugins/tools/index.d.ts.map +1 -0
- package/dist/plugins/tools/index.js +19 -0
- package/dist/plugins/tools/index.js.map +1 -0
- package/dist/presets/executor.d.ts +20 -0
- package/dist/presets/executor.d.ts.map +1 -0
- package/dist/presets/executor.js +629 -0
- package/dist/presets/executor.js.map +1 -0
- package/dist/presets/file-backup.d.ts +66 -0
- package/dist/presets/file-backup.d.ts.map +1 -0
- package/dist/presets/file-backup.js +108 -0
- package/dist/presets/file-backup.js.map +1 -0
- package/dist/presets/index.d.ts +11 -0
- package/dist/presets/index.d.ts.map +1 -0
- package/dist/presets/index.js +10 -0
- package/dist/presets/index.js.map +1 -0
- package/dist/presets/resolve.d.ts +32 -0
- package/dist/presets/resolve.d.ts.map +1 -0
- package/dist/presets/resolve.js +49 -0
- package/dist/presets/resolve.js.map +1 -0
- package/dist/presets/runtime.d.ts +21 -0
- package/dist/presets/runtime.d.ts.map +1 -0
- package/dist/presets/runtime.js +115 -0
- package/dist/presets/runtime.js.map +1 -0
- package/dist/projection/attestation.d.ts +43 -0
- package/dist/projection/attestation.d.ts.map +1 -0
- package/dist/projection/attestation.js +59 -0
- package/dist/projection/attestation.js.map +1 -0
- package/dist/runtime/agent-roster-provider.d.ts +75 -0
- package/dist/runtime/agent-roster-provider.d.ts.map +1 -0
- package/dist/runtime/agent-roster-provider.js +30 -0
- package/dist/runtime/agent-roster-provider.js.map +1 -0
- package/dist/runtime/external-surface-projector.d.ts +37 -0
- package/dist/runtime/external-surface-projector.d.ts.map +1 -0
- package/dist/runtime/external-surface-projector.js +21 -0
- package/dist/runtime/external-surface-projector.js.map +1 -0
- package/dist/runtime/lifecycle-task.d.ts +54 -0
- package/dist/runtime/lifecycle-task.d.ts.map +1 -0
- package/dist/runtime/lifecycle-task.js +111 -0
- package/dist/runtime/lifecycle-task.js.map +1 -0
- package/dist/runtime.d.ts +496 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +168 -0
- package/dist/runtime.js.map +1 -0
- package/dist/schemas/agent-message.d.ts +136 -0
- package/dist/schemas/agent-message.d.ts.map +1 -0
- package/dist/schemas/agent-message.js +131 -0
- package/dist/schemas/agent-message.js.map +1 -0
- package/dist/schemas/agent-roster.d.ts +50 -0
- package/dist/schemas/agent-roster.d.ts.map +1 -0
- package/dist/schemas/agent-roster.js +52 -0
- package/dist/schemas/agent-roster.js.map +1 -0
- package/dist/schemas/collision.d.ts +109 -0
- package/dist/schemas/collision.d.ts.map +1 -0
- package/dist/schemas/collision.js +71 -0
- package/dist/schemas/collision.js.map +1 -0
- package/dist/schemas/context-summary.d.ts +225 -0
- package/dist/schemas/context-summary.d.ts.map +1 -0
- package/dist/schemas/context-summary.js +117 -0
- package/dist/schemas/context-summary.js.map +1 -0
- package/dist/schemas/file-access.d.ts +176 -0
- package/dist/schemas/file-access.d.ts.map +1 -0
- package/dist/schemas/file-access.js +139 -0
- package/dist/schemas/file-access.js.map +1 -0
- package/dist/schemas/hooks.d.ts +170 -0
- package/dist/schemas/hooks.d.ts.map +1 -0
- package/dist/schemas/hooks.js +171 -0
- package/dist/schemas/hooks.js.map +1 -0
- package/dist/schemas/index.d.ts +19 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +17 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/path-identity.d.ts +44 -0
- package/dist/schemas/path-identity.d.ts.map +1 -0
- package/dist/schemas/path-identity.js +93 -0
- package/dist/schemas/path-identity.js.map +1 -0
- package/dist/schemas/pending-notice.d.ts +13 -0
- package/dist/schemas/pending-notice.d.ts.map +1 -0
- package/dist/schemas/pending-notice.js +5 -0
- package/dist/schemas/pending-notice.js.map +1 -0
- package/dist/schemas/presets.d.ts +1239 -0
- package/dist/schemas/presets.d.ts.map +1 -0
- package/dist/schemas/presets.js +270 -0
- package/dist/schemas/presets.js.map +1 -0
- package/dist/schemas/roster.d.ts +96 -0
- package/dist/schemas/roster.d.ts.map +1 -0
- package/dist/schemas/roster.js +310 -0
- package/dist/schemas/roster.js.map +1 -0
- package/dist/schemas/tiers.d.ts +95 -0
- package/dist/schemas/tiers.d.ts.map +1 -0
- package/dist/schemas/tiers.js +143 -0
- package/dist/schemas/tiers.js.map +1 -0
- package/dist/schemas/touch-identity.d.ts +25 -0
- package/dist/schemas/touch-identity.d.ts.map +1 -0
- package/dist/schemas/touch-identity.js +16 -0
- package/dist/schemas/touch-identity.js.map +1 -0
- package/dist/schemas/touch-projection.d.ts +157 -0
- package/dist/schemas/touch-projection.d.ts.map +1 -0
- package/dist/schemas/touch-projection.js +100 -0
- package/dist/schemas/touch-projection.js.map +1 -0
- package/dist/session-capability.d.ts +88 -0
- package/dist/session-capability.d.ts.map +1 -0
- package/dist/session-capability.js +28 -0
- package/dist/session-capability.js.map +1 -0
- package/dist/setup/index.d.ts +9 -0
- package/dist/setup/index.d.ts.map +1 -0
- package/dist/setup/index.js +8 -0
- package/dist/setup/index.js.map +1 -0
- package/dist/setup/steps/detect-tools.d.ts +9 -0
- package/dist/setup/steps/detect-tools.d.ts.map +1 -0
- package/dist/setup/steps/detect-tools.js +120 -0
- package/dist/setup/steps/detect-tools.js.map +1 -0
- package/dist/setup/steps/index.d.ts +11 -0
- package/dist/setup/steps/index.d.ts.map +1 -0
- package/dist/setup/steps/index.js +11 -0
- package/dist/setup/steps/index.js.map +1 -0
- package/dist/setup/steps/install-helpers.d.ts +9 -0
- package/dist/setup/steps/install-helpers.d.ts.map +1 -0
- package/dist/setup/steps/install-helpers.js +29 -0
- package/dist/setup/steps/install-helpers.js.map +1 -0
- package/dist/setup/steps/install.d.ts +11 -0
- package/dist/setup/steps/install.d.ts.map +1 -0
- package/dist/setup/steps/install.js +143 -0
- package/dist/setup/steps/install.js.map +1 -0
- package/dist/setup/steps/select-location.d.ts +8 -0
- package/dist/setup/steps/select-location.d.ts.map +1 -0
- package/dist/setup/steps/select-location.js +55 -0
- package/dist/setup/steps/select-location.js.map +1 -0
- package/dist/setup/steps/select-targets.d.ts +8 -0
- package/dist/setup/steps/select-targets.d.ts.map +1 -0
- package/dist/setup/steps/select-targets.js +53 -0
- package/dist/setup/steps/select-targets.js.map +1 -0
- package/dist/setup/steps/select-tiers.d.ts +8 -0
- package/dist/setup/steps/select-tiers.d.ts.map +1 -0
- package/dist/setup/steps/select-tiers.js +124 -0
- package/dist/setup/steps/select-tiers.js.map +1 -0
- package/dist/setup/types.d.ts +128 -0
- package/dist/setup/types.d.ts.map +1 -0
- package/dist/setup/types.js +28 -0
- package/dist/setup/types.js.map +1 -0
- package/dist/setup/wizard.d.ts +25 -0
- package/dist/setup/wizard.d.ts.map +1 -0
- package/dist/setup/wizard.js +182 -0
- package/dist/setup/wizard.js.map +1 -0
- package/dist/storage/agent-message.record.descriptor.d.ts +43 -0
- package/dist/storage/agent-message.record.descriptor.d.ts.map +1 -0
- package/dist/storage/agent-message.record.descriptor.js +72 -0
- package/dist/storage/agent-message.record.descriptor.js.map +1 -0
- package/dist/storage/file-access.record.descriptor.d.ts +104 -0
- package/dist/storage/file-access.record.descriptor.d.ts.map +1 -0
- package/dist/storage/file-access.record.descriptor.js +370 -0
- package/dist/storage/file-access.record.descriptor.js.map +1 -0
- package/dist/storage/touch-identity.d.ts +43 -0
- package/dist/storage/touch-identity.d.ts.map +1 -0
- package/dist/storage/touch-identity.js +155 -0
- package/dist/storage/touch-identity.js.map +1 -0
- package/dist/svelte/external-svelte.plugin.d.ts +39 -0
- package/dist/svelte/external-svelte.plugin.d.ts.map +1 -0
- package/dist/svelte/external-svelte.plugin.js +25 -0
- package/dist/svelte/index.d.ts +11 -0
- package/dist/svelte/index.d.ts.map +1 -0
- package/dist/svelte/index.js +10 -0
- package/dist/svelte/styles.css +8 -0
- package/dist/svelte/tool-widgets/ExternalToolCard.svelte +71 -0
- package/dist/svelte/tool-widgets/ExternalToolCard.svelte.d.ts +5 -0
- package/dist/svelte/tool-widgets/ExternalToolCard.svelte.d.ts.map +1 -0
- package/dist/svelte/tool-widgets/index.d.ts +3 -0
- package/dist/svelte/tool-widgets/index.d.ts.map +1 -0
- package/dist/svelte/tool-widgets/index.js +2 -0
- package/dist/svelte/tool-widgets/summary.d.ts +27 -0
- package/dist/svelte/tool-widgets/summary.d.ts.map +1 -0
- package/dist/svelte/tool-widgets/summary.js +198 -0
- package/dist/tools/index.d.ts +3 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +2 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/unified/action-descriptors.d.ts +185 -0
- package/dist/tools/unified/action-descriptors.d.ts.map +1 -0
- package/dist/tools/unified/action-descriptors.js +10 -0
- package/dist/tools/unified/action-descriptors.js.map +1 -0
- package/dist/tools/unified/action-input.d.ts +7 -0
- package/dist/tools/unified/action-input.d.ts.map +1 -0
- package/dist/tools/unified/action-input.js +13 -0
- package/dist/tools/unified/action-input.js.map +1 -0
- package/dist/tools/unified/actions.d.ts +10 -0
- package/dist/tools/unified/actions.d.ts.map +1 -0
- package/dist/tools/unified/actions.js +26 -0
- package/dist/tools/unified/actions.js.map +1 -0
- package/dist/tools/unified/external.descriptor.d.ts +30 -0
- package/dist/tools/unified/external.descriptor.d.ts.map +1 -0
- package/dist/tools/unified/external.descriptor.js +27 -0
- package/dist/tools/unified/external.descriptor.js.map +1 -0
- package/dist/tools/unified/external.impl.consumer.d.ts +8 -0
- package/dist/tools/unified/external.impl.consumer.d.ts.map +1 -0
- package/dist/tools/unified/external.impl.consumer.js +38 -0
- package/dist/tools/unified/external.impl.consumer.js.map +1 -0
- package/dist/tools/unified/handlers/context-summary.d.ts +4 -0
- package/dist/tools/unified/handlers/context-summary.d.ts.map +1 -0
- package/dist/tools/unified/handlers/context-summary.js +271 -0
- package/dist/tools/unified/handlers/context-summary.js.map +1 -0
- package/dist/tools/unified/handlers/file-access-list.d.ts +4 -0
- package/dist/tools/unified/handlers/file-access-list.d.ts.map +1 -0
- package/dist/tools/unified/handlers/file-access-list.js +39 -0
- package/dist/tools/unified/handlers/file-access-list.js.map +1 -0
- package/dist/tools/unified/handlers/file-access-track.d.ts +4 -0
- package/dist/tools/unified/handlers/file-access-track.d.ts.map +1 -0
- package/dist/tools/unified/handlers/file-access-track.js +34 -0
- package/dist/tools/unified/handlers/file-access-track.js.map +1 -0
- package/dist/tools/unified/handlers/hook-call.d.ts +23 -0
- package/dist/tools/unified/handlers/hook-call.d.ts.map +1 -0
- package/dist/tools/unified/handlers/hook-call.js +86 -0
- package/dist/tools/unified/handlers/hook-call.js.map +1 -0
- package/dist/tools/unified/handlers/hook-generator.d.ts +4 -0
- package/dist/tools/unified/handlers/hook-generator.d.ts.map +1 -0
- package/dist/tools/unified/handlers/hook-generator.js +37 -0
- package/dist/tools/unified/handlers/hook-generator.js.map +1 -0
- package/dist/tools/unified/handlers/signal.d.ts +22 -0
- package/dist/tools/unified/handlers/signal.d.ts.map +1 -0
- package/dist/tools/unified/handlers/signal.js +114 -0
- package/dist/tools/unified/handlers/signal.js.map +1 -0
- package/dist/tools/unified/index.d.ts +6 -0
- package/dist/tools/unified/index.d.ts.map +1 -0
- package/dist/tools/unified/index.js +6 -0
- package/dist/tools/unified/index.js.map +1 -0
- package/dist/tools/unified/install/handler.d.ts +4 -0
- package/dist/tools/unified/install/handler.d.ts.map +1 -0
- package/dist/tools/unified/install/handler.js +17 -0
- package/dist/tools/unified/install/handler.js.map +1 -0
- package/dist/tools/unified/runtime.d.ts +35 -0
- package/dist/tools/unified/runtime.d.ts.map +1 -0
- package/dist/tools/unified/runtime.js +23 -0
- package/dist/tools/unified/runtime.js.map +1 -0
- package/dist/tools/unified/schemas.d.ts +160 -0
- package/dist/tools/unified/schemas.d.ts.map +1 -0
- package/dist/tools/unified/schemas.js +139 -0
- package/dist/tools/unified/schemas.js.map +1 -0
- package/dist/utils/fs-absence.d.ts +22 -0
- package/dist/utils/fs-absence.d.ts.map +1 -0
- package/dist/utils/fs-absence.js +37 -0
- package/dist/utils/fs-absence.js.map +1 -0
- package/dist/utils/runtime-fs.d.ts +37 -0
- package/dist/utils/runtime-fs.d.ts.map +1 -0
- package/dist/utils/runtime-fs.js +100 -0
- package/dist/utils/runtime-fs.js.map +1 -0
- package/dist/utils/toml.d.ts +26 -0
- package/dist/utils/toml.d.ts.map +1 -0
- package/dist/utils/toml.js +415 -0
- package/dist/utils/toml.js.map +1 -0
- package/package.json +263 -4
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Launch state: one record and an attempt log per launched session, and
|
|
3
|
+
* exclusive claims that keep one writer per idempotency key and per canonical
|
|
4
|
+
* workspace. All of it is rows of the declared `external.launch_state` storage
|
|
5
|
+
* record (see `state-rows.ts`); the handed runtime's filesystem is used only to
|
|
6
|
+
* canonicalize workspace paths. The owner pid and pid liveness come from its
|
|
7
|
+
* `runtime/process` service; logging is the runtime's own logger. Malformed
|
|
8
|
+
* present state refuses with a fixed typed error and native cause; only
|
|
9
|
+
* genuinely absent state is absent.
|
|
10
|
+
*/
|
|
11
|
+
import { type LoggerImplementation } from '@vibesdotdev/logging';
|
|
12
|
+
import { CapabilityError, type RuntimeRef } from '@vibesdotdev/kernel';
|
|
13
|
+
import { type LaunchAttempt, type LaunchIndexEntry, type LaunchRecord } from '../schemas.ts';
|
|
14
|
+
import { type ExternalFileSystem } from '../../utils/runtime-fs.ts';
|
|
15
|
+
import { type LaunchRows } from './state-rows.ts';
|
|
16
|
+
/** Launch state under one home, bound to the runtime that owns it. */
|
|
17
|
+
export interface LaunchStore {
|
|
18
|
+
/** The launch state home (the runtime's `paths/roots` activeHome by default). */
|
|
19
|
+
readonly home: string;
|
|
20
|
+
readonly fs: ExternalFileSystem;
|
|
21
|
+
/** The declared launch state record. */
|
|
22
|
+
readonly rows: LaunchRows;
|
|
23
|
+
readonly log: LoggerImplementation;
|
|
24
|
+
/** The pid this host runs as: the owner a claim names. */
|
|
25
|
+
ownerPid(): number;
|
|
26
|
+
/** Whether a pid is running, as the runtime's process service sees it. */
|
|
27
|
+
isAlive(pid: number): Promise<boolean>;
|
|
28
|
+
}
|
|
29
|
+
/** Bind launch state under `home` to `runtime`'s storage, filesystem, process service and logger. */
|
|
30
|
+
export declare function openLaunchStore(runtime: RuntimeRef, home: string): Promise<LaunchStore>;
|
|
31
|
+
export declare function writeLaunchRecord(store: LaunchStore, record: LaunchRecord): Promise<LaunchRecord>;
|
|
32
|
+
export declare function readLaunchRecord(store: LaunchStore, sessionId: string): Promise<LaunchRecord | null>;
|
|
33
|
+
/** The launch index: every record's session, harness and start time, newest first. */
|
|
34
|
+
export declare function readLaunchIndex(store: LaunchStore): Promise<LaunchIndexEntry[]>;
|
|
35
|
+
/** Every launch record, newest first. */
|
|
36
|
+
export declare function listLaunchRecords(store: LaunchStore): Promise<LaunchRecord[]>;
|
|
37
|
+
export declare function findLaunchRecord(store: LaunchStore, ref: string): Promise<LaunchRecord | null>;
|
|
38
|
+
export declare function redactLaunchArgv(argv: readonly string[], secretTexts: readonly string[]): string[];
|
|
39
|
+
export declare function appendLaunchAttempt(store: LaunchStore, attempt: Omit<LaunchAttempt, 'attemptId'> & {
|
|
40
|
+
attemptId?: string;
|
|
41
|
+
}): Promise<LaunchAttempt>;
|
|
42
|
+
export declare function listLaunchAttempts(store: LaunchStore, sessionId: string): Promise<LaunchAttempt[]>;
|
|
43
|
+
export declare function attemptStillOpen(attempt: LaunchAttempt): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* The canonical spelling of a workspace path: absolute, with every symlink
|
|
46
|
+
* resolved through the filesystem's `stat`. A part that does not exist yet
|
|
47
|
+
* keeps its spelling. More than {@link MAX_SYMLINK_HOPS} links is refused
|
|
48
|
+
* `INVALID_INPUT` `launch-workspace-symlink-loop`.
|
|
49
|
+
*/
|
|
50
|
+
export declare function canonicalWorkspacePath(store: LaunchStore, cwd: string): Promise<string>;
|
|
51
|
+
export type LaunchClaim = {
|
|
52
|
+
kind: 'started';
|
|
53
|
+
attempt: LaunchAttempt;
|
|
54
|
+
} | {
|
|
55
|
+
kind: 'replay';
|
|
56
|
+
attemptId: string;
|
|
57
|
+
sessionId: string;
|
|
58
|
+
disposition: 'open' | 'completed';
|
|
59
|
+
} | {
|
|
60
|
+
kind: 'conflict';
|
|
61
|
+
attemptId: null;
|
|
62
|
+
reason: string;
|
|
63
|
+
};
|
|
64
|
+
export type LaunchReplay = {
|
|
65
|
+
kind: 'absent';
|
|
66
|
+
} | {
|
|
67
|
+
kind: 'record';
|
|
68
|
+
record: LaunchRecord;
|
|
69
|
+
} | {
|
|
70
|
+
kind: 'pending';
|
|
71
|
+
sessionId: string;
|
|
72
|
+
attemptId: string;
|
|
73
|
+
} | {
|
|
74
|
+
kind: 'conflict';
|
|
75
|
+
sessionId: string | null;
|
|
76
|
+
attemptId: string | null;
|
|
77
|
+
reason: string;
|
|
78
|
+
};
|
|
79
|
+
/** The workspace already has a writer: refused `CONFLICT` `launch-workspace-claimed`, naming the holder's attempt. */
|
|
80
|
+
export declare function workspaceClaimedRefusal(attemptId: string | null): CapabilityError;
|
|
81
|
+
/** One exclusive file per key and one per canonical workspace. The second caller loses. */
|
|
82
|
+
export declare function claimLaunchWriter(store: LaunchStore, input: Omit<LaunchAttempt, 'attemptId' | 'phase' | 'exitObserved' | 'createdAt' | 'cwd'> & {
|
|
83
|
+
cwd: string;
|
|
84
|
+
readOnly?: boolean | undefined;
|
|
85
|
+
}): Promise<LaunchClaim>;
|
|
86
|
+
export interface LaunchReplaySelection {
|
|
87
|
+
cwd: string;
|
|
88
|
+
harness: string;
|
|
89
|
+
toolId?: string;
|
|
90
|
+
sessionId?: string;
|
|
91
|
+
}
|
|
92
|
+
/** Read a prior key before any session is created. A mismatched authority is a conflict. */
|
|
93
|
+
export declare function lookupLaunchReplay(store: LaunchStore, idempotencyKey: string, selection: LaunchReplaySelection): Promise<LaunchReplay>;
|
|
94
|
+
/** A reservation never reports `absent`: an absent key is what gets reserved. */
|
|
95
|
+
export type LaunchReservation = Exclude<LaunchReplay, {
|
|
96
|
+
kind: 'absent';
|
|
97
|
+
}> | {
|
|
98
|
+
kind: 'reserved';
|
|
99
|
+
attemptId: string;
|
|
100
|
+
};
|
|
101
|
+
/** Reserve the key and workspace before any session exists. The loser does not prepare. */
|
|
102
|
+
export declare function reserveLaunchKey(store: LaunchStore, input: Omit<LaunchAttempt, 'attemptId' | 'phase' | 'exitObserved' | 'createdAt' | 'cwd' | 'sessionId'> & {
|
|
103
|
+
cwd: string;
|
|
104
|
+
readOnly?: boolean | undefined;
|
|
105
|
+
}): Promise<LaunchReservation>;
|
|
106
|
+
export declare function bindLaunchSession(store: LaunchStore, idempotencyKey: string, sessionId: string): Promise<void>;
|
|
107
|
+
/** Records an exit the owner observed. A live pid probe is not this record. */
|
|
108
|
+
export declare function recordObservedLaunchExit(store: LaunchStore, input: {
|
|
109
|
+
sessionId: string;
|
|
110
|
+
idempotencyKey: string;
|
|
111
|
+
cwd: string;
|
|
112
|
+
harness: string;
|
|
113
|
+
toolId: string;
|
|
114
|
+
mode: string;
|
|
115
|
+
command: string;
|
|
116
|
+
pid: number;
|
|
117
|
+
}): Promise<LaunchAttempt>;
|
|
118
|
+
/**
|
|
119
|
+
* Records the exit of a supervised launch: PM ran the harness and its exit was
|
|
120
|
+
* observed by awaiting it, so there is no pid to probe. The attempt is marked
|
|
121
|
+
* exited, the key claim completed, and the workspace claim released.
|
|
122
|
+
*/
|
|
123
|
+
export declare function completeSupervisedLaunch(store: LaunchStore, input: {
|
|
124
|
+
attemptId: string;
|
|
125
|
+
sessionId: string;
|
|
126
|
+
idempotencyKey: string;
|
|
127
|
+
cwd: string;
|
|
128
|
+
harness: string;
|
|
129
|
+
toolId: string;
|
|
130
|
+
mode: string;
|
|
131
|
+
command: string;
|
|
132
|
+
pid?: number;
|
|
133
|
+
}): Promise<LaunchAttempt>;
|
|
134
|
+
/** An open attempt for this key or workspace must not gain a second writer. */
|
|
135
|
+
export declare function findBlockingLaunchAttempt(store: LaunchStore, input: {
|
|
136
|
+
idempotencyKey: string;
|
|
137
|
+
cwd: string;
|
|
138
|
+
}): Promise<LaunchAttempt | null>;
|
|
139
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/launch/consumer/store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EAAa,KAAK,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,eAAe,EAA4D,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGjI,OAAO,EAIN,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAA+C,KAAK,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACjH,OAAO,EAAqB,KAAK,UAAU,EAAwB,MAAM,iBAAiB,CAAC;AAK3F,sEAAsE;AACtE,MAAM,WAAW,WAAW;IAC3B,iFAAiF;IACjF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,kBAAkB,CAAC;IAChC,wCAAwC;IACxC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,GAAG,EAAE,oBAAoB,CAAC;IACnC,0DAA0D;IAC1D,QAAQ,IAAI,MAAM,CAAC;IACnB,0EAA0E;IAC1E,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACvC;AAED,qGAAqG;AACrG,wBAAsB,eAAe,CAAC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAqB7F;AA4CD,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,CAIvG;AAED,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAE1G;AAED,sFAAsF;AACtF,wBAAsB,eAAe,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAGrF;AAMD,yCAAyC;AACzC,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAGnF;AAED,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CASpG;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,WAAW,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAGlG;AAED,wBAAsB,mBAAmB,CACxC,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAChE,OAAO,CAAC,aAAa,CAAC,CAWxB;AAMD,wBAAsB,kBAAkB,CAAC,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAGxG;AAeD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAEhE;AAED;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA6C7F;AAqCD,MAAM,MAAM,WAAW,GACpB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,aAAa,CAAA;CAAE,GAC3C;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,GAAG,WAAW,CAAA;CAAE,GAC3F;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,SAAS,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzD,MAAM,MAAM,YAAY,GACrB;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAClB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,YAAY,CAAA;CAAE,GACxC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GACzD;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5F,sHAAsH;AACtH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,eAAe,CASjF;AAED,2FAA2F;AAC3F,wBAAsB,iBAAiB,CACtC,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE,IAAI,CAAC,aAAa,EAAE,WAAW,GAAG,OAAO,GAAG,cAAc,GAAG,WAAW,GAAG,KAAK,CAAC,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAAE,GACxI,OAAO,CAAC,WAAW,CAAC,CA+CtB;AAED,MAAM,WAAW,qBAAqB;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAaD,4FAA4F;AAC5F,wBAAsB,kBAAkB,CACvC,KAAK,EAAE,WAAW,EAClB,cAAc,EAAE,MAAM,EACtB,SAAS,EAAE,qBAAqB,GAC9B,OAAO,CAAC,YAAY,CAAC,CAsBvB;AAED,iFAAiF;AACjF,MAAM,MAAM,iBAAiB,GAC1B,OAAO,CAAC,YAAY,EAAE;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC,GACzC;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3C,2FAA2F;AAC3F,wBAAsB,gBAAgB,CACrC,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE,IAAI,CAAC,aAAa,EAAE,WAAW,GAAG,OAAO,GAAG,cAAc,GAAG,WAAW,GAAG,KAAK,GAAG,WAAW,CAAC,GAAG;IACxG,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC/B,GACC,OAAO,CAAC,iBAAiB,CAAC,CAyC5B;AAED,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAUpH;AAED,+EAA+E;AAC/E,wBAAsB,wBAAwB,CAC7C,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE;IACN,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;CACZ,GACC,OAAO,CAAC,aAAa,CAAC,CAiCxB;AAED;;;;GAIG;AACH,wBAAsB,wBAAwB,CAC7C,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE;IACN,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;CACb,GACC,OAAO,CAAC,aAAa,CAAC,CAgBxB;AA2CD,+EAA+E;AAC/E,wBAAsB,yBAAyB,CAC9C,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE;IAAE,cAAc,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAC5C,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAQ/B"}
|
|
@@ -0,0 +1,495 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Launch state: one record and an attempt log per launched session, and
|
|
3
|
+
* exclusive claims that keep one writer per idempotency key and per canonical
|
|
4
|
+
* workspace. All of it is rows of the declared `external.launch_state` storage
|
|
5
|
+
* record (see `state-rows.ts`); the handed runtime's filesystem is used only to
|
|
6
|
+
* canonicalize workspace paths. The owner pid and pid liveness come from its
|
|
7
|
+
* `runtime/process` service; logging is the runtime's own logger. Malformed
|
|
8
|
+
* present state refuses with a fixed typed error and native cause; only
|
|
9
|
+
* genuinely absent state is absent.
|
|
10
|
+
*/
|
|
11
|
+
import * as z from 'zod/v4';
|
|
12
|
+
import { dirname, isAbsolute, join, resolve } from '@vibesdotdev/filesystem';
|
|
13
|
+
import { getLogger } from '@vibesdotdev/logging';
|
|
14
|
+
import { CapabilityError, CaughtFailureSchema, isCapabilityError, valueFreeFailure } from '@vibesdotdev/kernel';
|
|
15
|
+
import { JsonValueSchema } from '@vibesdotdev/kernel/schemas/json';
|
|
16
|
+
import { getRuntimeProcessService } from '@vibesdotdev/kernel/process';
|
|
17
|
+
import { launchAttemptSchema, launchIndexEntrySchema, launchRecordSchema } from "../schemas.js";
|
|
18
|
+
import { externalFileSystem, externalPathStatRefusal } from "../../utils/runtime-fs.js";
|
|
19
|
+
import { resolveLaunchRows } from "./state-rows.js";
|
|
20
|
+
/** The most symlinks one canonical workspace path may follow. */
|
|
21
|
+
const MAX_SYMLINK_HOPS = 40;
|
|
22
|
+
/** Bind launch state under `home` to `runtime`'s storage, filesystem, process service and logger. */
|
|
23
|
+
export async function openLaunchStore(runtime, home) {
|
|
24
|
+
const fs = await externalFileSystem(runtime);
|
|
25
|
+
const rows = await resolveLaunchRows(runtime);
|
|
26
|
+
const processes = await getRuntimeProcessService(runtime);
|
|
27
|
+
return {
|
|
28
|
+
home,
|
|
29
|
+
fs,
|
|
30
|
+
rows,
|
|
31
|
+
log: getLogger('external.launch.store', runtime),
|
|
32
|
+
ownerPid() {
|
|
33
|
+
const pid = processes.currentPid?.();
|
|
34
|
+
if (pid === undefined) {
|
|
35
|
+
throw new CapabilityError('The runtime process service declares no current pid.', 'UNAVAILABLE', {
|
|
36
|
+
reason: 'launch-owner-pid-undeclared',
|
|
37
|
+
retryable: false
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
return pid;
|
|
41
|
+
},
|
|
42
|
+
isAlive: (pid) => processes.isRunning(pid)
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/** Any JSON value, as a state file holds it. */
|
|
46
|
+
const StoredJsonSchema = JsonValueSchema;
|
|
47
|
+
/** Admit present persisted state; corrupt text or shape must never become absence. */
|
|
48
|
+
function parseStored(schema, text) {
|
|
49
|
+
try {
|
|
50
|
+
return schema.parse(JSON.parse(text));
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
throw new CapabilityError('The stored launch state is invalid.', 'INTERNAL', {
|
|
54
|
+
reason: 'launch-state-invalid', cause: CaughtFailureSchema.parse(error), retryable: false
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
async function readStored(store, schema, id) {
|
|
59
|
+
const row = await store.rows.get(id);
|
|
60
|
+
return row === null ? undefined : parseStored(schema, row.body);
|
|
61
|
+
}
|
|
62
|
+
function rowOf(id, kind, sessionId, value) {
|
|
63
|
+
return { id, kind, sessionId, body: JSON.stringify(value) };
|
|
64
|
+
}
|
|
65
|
+
/** Write a row, replacing any earlier value. */
|
|
66
|
+
async function writeRow(store, id, kind, sessionId, value) {
|
|
67
|
+
await store.rows.put(rowOf(id, kind, sessionId, value));
|
|
68
|
+
}
|
|
69
|
+
/** Create the row only when nothing holds `id`; `false` when another writer already published it. */
|
|
70
|
+
function createExclusiveRow(store, id, kind, sessionId, value) {
|
|
71
|
+
return store.rows.createExclusive(rowOf(id, kind, sessionId, value));
|
|
72
|
+
}
|
|
73
|
+
/** Remove the row; a row already gone is already removed. */
|
|
74
|
+
async function removeIfPresent(store, id) {
|
|
75
|
+
await store.rows.remove(id);
|
|
76
|
+
}
|
|
77
|
+
const LaunchIndexSchema = z.array(launchIndexEntrySchema);
|
|
78
|
+
const recordRowId = (sessionId) => `record:${sessionId}`;
|
|
79
|
+
export async function writeLaunchRecord(store, record) {
|
|
80
|
+
const parsed = launchRecordSchema.parse(record);
|
|
81
|
+
await writeRow(store, recordRowId(parsed.sessionId), 'record', parsed.sessionId, parsed);
|
|
82
|
+
return parsed;
|
|
83
|
+
}
|
|
84
|
+
export async function readLaunchRecord(store, sessionId) {
|
|
85
|
+
return (await readStored(store, launchRecordSchema, recordRowId(sessionId))) ?? null;
|
|
86
|
+
}
|
|
87
|
+
/** The launch index: every record's session, harness and start time, newest first. */
|
|
88
|
+
export async function readLaunchIndex(store) {
|
|
89
|
+
const records = await listLaunchRecords(store);
|
|
90
|
+
return LaunchIndexSchema.parse(records.map((r) => ({ sessionId: r.sessionId, harness: r.harness, startedAt: r.startedAt })));
|
|
91
|
+
}
|
|
92
|
+
function newestFirst(left, right) {
|
|
93
|
+
return left.startedAt < right.startedAt ? 1 : left.startedAt > right.startedAt ? -1 : 0;
|
|
94
|
+
}
|
|
95
|
+
/** Every launch record, newest first. */
|
|
96
|
+
export async function listLaunchRecords(store) {
|
|
97
|
+
const rows = await store.rows.list('record');
|
|
98
|
+
return rows.map((row) => parseStored(launchRecordSchema, row.body)).sort(newestFirst);
|
|
99
|
+
}
|
|
100
|
+
export async function findLaunchRecord(store, ref) {
|
|
101
|
+
const records = await listLaunchRecords(store);
|
|
102
|
+
const exact = records.find((record) => record.sessionId === ref);
|
|
103
|
+
if (exact)
|
|
104
|
+
return exact;
|
|
105
|
+
const prefix = records.filter((record) => record.sessionId.startsWith(ref));
|
|
106
|
+
if (prefix.length === 1)
|
|
107
|
+
return prefix[0] ?? null;
|
|
108
|
+
const pid = Number(ref);
|
|
109
|
+
if (Number.isInteger(pid) && pid > 0)
|
|
110
|
+
return records.find((record) => record.pid === pid) ?? null;
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
export function redactLaunchArgv(argv, secretTexts) {
|
|
114
|
+
const secrets = secretTexts.map((value) => value.trim()).filter((value) => value.length > 0);
|
|
115
|
+
return argv.map((arg) => (secrets.some((secret) => arg.includes(secret)) ? '[redacted]' : arg));
|
|
116
|
+
}
|
|
117
|
+
export async function appendLaunchAttempt(store, attempt) {
|
|
118
|
+
const parsed = launchAttemptSchema.parse({ ...attempt, attemptId: attempt.attemptId ?? crypto.randomUUID() });
|
|
119
|
+
const stamp = parsed.createdAt.replace(/[:.]/g, '-');
|
|
120
|
+
const id = `attempt:${parsed.attemptId}.${parsed.phase}.${stamp}`;
|
|
121
|
+
if (!(await createExclusiveRow(store, id, 'attempt', parsed.sessionId, parsed))) {
|
|
122
|
+
throw new CapabilityError('A launch attempt with this identity already exists.', 'CONFLICT', {
|
|
123
|
+
reason: 'launch-attempt-exists',
|
|
124
|
+
retryable: false
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
return parsed;
|
|
128
|
+
}
|
|
129
|
+
function oldestFirst(left, right) {
|
|
130
|
+
return left.createdAt < right.createdAt ? -1 : left.createdAt > right.createdAt ? 1 : 0;
|
|
131
|
+
}
|
|
132
|
+
export async function listLaunchAttempts(store, sessionId) {
|
|
133
|
+
const rows = await store.rows.list('attempt', sessionId);
|
|
134
|
+
return rows.map((row) => parseStored(launchAttemptSchema, row.body)).sort(oldestFirst);
|
|
135
|
+
}
|
|
136
|
+
async function listAllLaunchAttempts(store) {
|
|
137
|
+
return (await store.rows.list('attempt')).map((row) => parseStored(launchAttemptSchema, row.body));
|
|
138
|
+
}
|
|
139
|
+
function latestByKey(attempts) {
|
|
140
|
+
const latest = new Map();
|
|
141
|
+
for (const attempt of attempts) {
|
|
142
|
+
const current = latest.get(attempt.idempotencyKey);
|
|
143
|
+
if (!current || current.createdAt <= attempt.createdAt)
|
|
144
|
+
latest.set(attempt.idempotencyKey, attempt);
|
|
145
|
+
}
|
|
146
|
+
return [...latest.values()];
|
|
147
|
+
}
|
|
148
|
+
export function attemptStillOpen(attempt) {
|
|
149
|
+
return !attempt.exitObserved || attempt.phase !== 'exited';
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* The canonical spelling of a workspace path: absolute, with every symlink
|
|
153
|
+
* resolved through the filesystem's `stat`. A part that does not exist yet
|
|
154
|
+
* keeps its spelling. More than {@link MAX_SYMLINK_HOPS} links is refused
|
|
155
|
+
* `INVALID_INPUT` `launch-workspace-symlink-loop`.
|
|
156
|
+
*/
|
|
157
|
+
export async function canonicalWorkspacePath(store, cwd) {
|
|
158
|
+
const pending = resolve('/', cwd).split('/').filter(Boolean);
|
|
159
|
+
let current = '/';
|
|
160
|
+
let hops = 0;
|
|
161
|
+
while (pending.length > 0) {
|
|
162
|
+
const part = pending.shift() ?? '';
|
|
163
|
+
if (part === '.')
|
|
164
|
+
continue;
|
|
165
|
+
if (part === '..') {
|
|
166
|
+
current = dirname(current);
|
|
167
|
+
continue;
|
|
168
|
+
}
|
|
169
|
+
const candidate = join(current, part);
|
|
170
|
+
let stat;
|
|
171
|
+
try {
|
|
172
|
+
stat = await store.fs.stat(candidate);
|
|
173
|
+
}
|
|
174
|
+
catch (error) {
|
|
175
|
+
const cause = CaughtFailureSchema.parse(error);
|
|
176
|
+
const failure = valueFreeFailure(cause);
|
|
177
|
+
if (failure.code === 'ENOENT')
|
|
178
|
+
return join(candidate, ...pending);
|
|
179
|
+
if (failure.code === 'ELOOP') {
|
|
180
|
+
throw new CapabilityError('The workspace path has too many symbolic links to resolve.', 'INVALID_INPUT', {
|
|
181
|
+
reason: 'launch-workspace-symlink-loop',
|
|
182
|
+
retryable: false,
|
|
183
|
+
cause
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
if (isCapabilityError(cause))
|
|
187
|
+
throw cause;
|
|
188
|
+
const refusal = externalPathStatRefusal(cause);
|
|
189
|
+
throw new CapabilityError(refusal.message, refusal.code, { reason: refusal.reason, cause });
|
|
190
|
+
}
|
|
191
|
+
if (stat.kind !== 'symlink' || stat.symlinkTarget === undefined) {
|
|
192
|
+
current = candidate;
|
|
193
|
+
continue;
|
|
194
|
+
}
|
|
195
|
+
hops += 1;
|
|
196
|
+
if (hops > MAX_SYMLINK_HOPS) {
|
|
197
|
+
throw new CapabilityError('The workspace path has too many symbolic links to resolve.', 'INVALID_INPUT', {
|
|
198
|
+
reason: 'launch-workspace-symlink-loop',
|
|
199
|
+
retryable: false
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
pending.unshift(...stat.symlinkTarget.split('/').filter(Boolean));
|
|
203
|
+
if (isAbsolute(stat.symlinkTarget))
|
|
204
|
+
current = '/';
|
|
205
|
+
}
|
|
206
|
+
return current;
|
|
207
|
+
}
|
|
208
|
+
function claimDigest(value) {
|
|
209
|
+
let high = 0x811c9dc5;
|
|
210
|
+
let low = 0x01000193;
|
|
211
|
+
for (let index = 0; index < value.length; index++) {
|
|
212
|
+
const code = value.charCodeAt(index);
|
|
213
|
+
high ^= code;
|
|
214
|
+
high = Math.imul(high, 0x01000193);
|
|
215
|
+
low ^= code + index;
|
|
216
|
+
low = Math.imul(low, 0x01000193);
|
|
217
|
+
}
|
|
218
|
+
return `${(high >>> 0).toString(16)}-${(low >>> 0).toString(16)}-${value.length.toString(16)}`;
|
|
219
|
+
}
|
|
220
|
+
/** The row id of the claim for an idempotency key or a canonical workspace. */
|
|
221
|
+
function claimPath(_home, kind, value) {
|
|
222
|
+
return `claim:${kind}-${claimDigest(value)}`;
|
|
223
|
+
}
|
|
224
|
+
const LaunchClaimFileSchema = z.object({
|
|
225
|
+
attemptId: z.string(),
|
|
226
|
+
sessionId: z.string(),
|
|
227
|
+
idempotencyKey: z.string(),
|
|
228
|
+
cwd: z.string(),
|
|
229
|
+
harness: z.string(),
|
|
230
|
+
toolId: z.string(),
|
|
231
|
+
principalId: z.string(),
|
|
232
|
+
disposition: z.enum(['open', 'completed']).catch('open'),
|
|
233
|
+
ownerPid: z.number()
|
|
234
|
+
});
|
|
235
|
+
async function readClaim(store, path) {
|
|
236
|
+
return (await readStored(store, LaunchClaimFileSchema, path)) ?? null;
|
|
237
|
+
}
|
|
238
|
+
/** The workspace already has a writer: refused `CONFLICT` `launch-workspace-claimed`, naming the holder's attempt. */
|
|
239
|
+
export function workspaceClaimedRefusal(attemptId) {
|
|
240
|
+
return new CapabilityError('This workspace already has a writer.', 'CONFLICT', {
|
|
241
|
+
reason: 'launch-workspace-claimed',
|
|
242
|
+
retryable: false,
|
|
243
|
+
details: { attemptId },
|
|
244
|
+
recoveryHint: attemptId
|
|
245
|
+
? `Open attempt ${attemptId} already owns this workspace. Not returning another session's state.`
|
|
246
|
+
: 'Wait until that attempt records an observed exit.'
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
/** One exclusive file per key and one per canonical workspace. The second caller loses. */
|
|
250
|
+
export async function claimLaunchWriter(store, input) {
|
|
251
|
+
const cwd = await canonicalWorkspacePath(store, input.cwd);
|
|
252
|
+
const keyPath = claimPath(store.home, 'key', input.idempotencyKey);
|
|
253
|
+
const replay = (claim) => claim && claim.idempotencyKey === input.idempotencyKey
|
|
254
|
+
? { kind: 'replay', attemptId: claim.attemptId, sessionId: claim.sessionId, disposition: claim.disposition }
|
|
255
|
+
: { kind: 'conflict', attemptId: null, reason: 'Launch key claim is unreadable.' };
|
|
256
|
+
const existing = await readClaim(store, keyPath);
|
|
257
|
+
if (existing) {
|
|
258
|
+
if (existing.idempotencyKey !== input.idempotencyKey) {
|
|
259
|
+
return { kind: 'conflict', attemptId: null, reason: 'Launch key claim does not match its path.' };
|
|
260
|
+
}
|
|
261
|
+
return replay(existing);
|
|
262
|
+
}
|
|
263
|
+
const attemptId = crypto.randomUUID();
|
|
264
|
+
const claim = {
|
|
265
|
+
attemptId,
|
|
266
|
+
sessionId: input.sessionId,
|
|
267
|
+
idempotencyKey: input.idempotencyKey,
|
|
268
|
+
cwd,
|
|
269
|
+
harness: input.harness,
|
|
270
|
+
toolId: input.toolId,
|
|
271
|
+
principalId: `participant-launch-${input.harness}`,
|
|
272
|
+
disposition: 'open',
|
|
273
|
+
ownerPid: store.ownerPid()
|
|
274
|
+
};
|
|
275
|
+
if (!(await createExclusiveRow(store, keyPath, 'claim', input.sessionId, claim)))
|
|
276
|
+
return replay(await readClaim(store, keyPath));
|
|
277
|
+
const workspacePath = claimPath(store.home, 'workspace', cwd);
|
|
278
|
+
const publish = () => createExclusiveRow(store, workspacePath, 'claim', input.sessionId, claim);
|
|
279
|
+
// A read-only participant writes nothing, so it takes no workspace writer claim.
|
|
280
|
+
const claimed = input.readOnly === true || (await publish()) || ((await releaseStaleWorkspaceClaim(store, workspacePath)) && (await publish()));
|
|
281
|
+
if (!claimed) {
|
|
282
|
+
// Roll back the key this call just created; the workspace's holder keeps it.
|
|
283
|
+
await removeIfPresent(store, keyPath);
|
|
284
|
+
throw workspaceClaimedRefusal((await readClaim(store, workspacePath))?.attemptId ?? null);
|
|
285
|
+
}
|
|
286
|
+
return {
|
|
287
|
+
kind: 'started',
|
|
288
|
+
attempt: await appendLaunchAttempt(store, {
|
|
289
|
+
...input,
|
|
290
|
+
attemptId,
|
|
291
|
+
cwd,
|
|
292
|
+
phase: 'intent',
|
|
293
|
+
exitObserved: false,
|
|
294
|
+
createdAt: new Date().toISOString()
|
|
295
|
+
})
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
function selectionConflict(claim, selection, cwd) {
|
|
299
|
+
if (cwd !== claim.cwd)
|
|
300
|
+
return 'Launch workspace does not match the original attempt.';
|
|
301
|
+
if (selection.harness !== claim.harness)
|
|
302
|
+
return 'Launch harness does not match the original attempt.';
|
|
303
|
+
// principalId on the claim is only a launch-participant label. It is not a human or team principal.
|
|
304
|
+
if (!selection.toolId || selection.toolId !== claim.toolId)
|
|
305
|
+
return 'Launch host does not match the original attempt.';
|
|
306
|
+
if (selection.sessionId && selection.sessionId !== claim.sessionId) {
|
|
307
|
+
return 'Launch session does not match the original attempt.';
|
|
308
|
+
}
|
|
309
|
+
return undefined;
|
|
310
|
+
}
|
|
311
|
+
/** Read a prior key before any session is created. A mismatched authority is a conflict. */
|
|
312
|
+
export async function lookupLaunchReplay(store, idempotencyKey, selection) {
|
|
313
|
+
const path = claimPath(store.home, 'key', idempotencyKey);
|
|
314
|
+
const claim = await readClaim(store, path);
|
|
315
|
+
if (claim === null)
|
|
316
|
+
return { kind: 'absent' };
|
|
317
|
+
if (claim.idempotencyKey !== idempotencyKey) {
|
|
318
|
+
return { kind: 'conflict', sessionId: null, attemptId: null, reason: 'Launch key claim is unreadable.' };
|
|
319
|
+
}
|
|
320
|
+
const conflict = selectionConflict(claim, selection, await canonicalWorkspacePath(store, selection.cwd));
|
|
321
|
+
if (conflict)
|
|
322
|
+
return { kind: 'conflict', sessionId: claim.sessionId, attemptId: claim.attemptId, reason: conflict };
|
|
323
|
+
if (!claim.sessionId) {
|
|
324
|
+
return {
|
|
325
|
+
kind: 'conflict',
|
|
326
|
+
sessionId: null,
|
|
327
|
+
attemptId: claim.attemptId,
|
|
328
|
+
reason: (await store.isAlive(claim.ownerPid))
|
|
329
|
+
? 'Launch reservation is in progress.'
|
|
330
|
+
: 'Launch reservation has no bound session; recovery is required before retry.'
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
const record = await readLaunchRecord(store, claim.sessionId);
|
|
334
|
+
if (record?.attemptId === claim.attemptId)
|
|
335
|
+
return { kind: 'record', record };
|
|
336
|
+
return { kind: 'pending', sessionId: claim.sessionId, attemptId: claim.attemptId };
|
|
337
|
+
}
|
|
338
|
+
/** Reserve the key and workspace before any session exists. The loser does not prepare. */
|
|
339
|
+
export async function reserveLaunchKey(store, input) {
|
|
340
|
+
const selection = { cwd: input.cwd, harness: input.harness, toolId: input.toolId };
|
|
341
|
+
const existing = await lookupLaunchReplay(store, input.idempotencyKey, selection);
|
|
342
|
+
const keyPath = claimPath(store.home, 'key', input.idempotencyKey);
|
|
343
|
+
if (existing.kind === 'absent') {
|
|
344
|
+
const cwd = await canonicalWorkspacePath(store, input.cwd);
|
|
345
|
+
const attemptId = crypto.randomUUID();
|
|
346
|
+
const claim = {
|
|
347
|
+
attemptId,
|
|
348
|
+
sessionId: '',
|
|
349
|
+
idempotencyKey: input.idempotencyKey,
|
|
350
|
+
cwd,
|
|
351
|
+
harness: input.harness,
|
|
352
|
+
toolId: input.toolId,
|
|
353
|
+
principalId: `participant-launch-${input.harness}`,
|
|
354
|
+
disposition: 'open',
|
|
355
|
+
ownerPid: store.ownerPid()
|
|
356
|
+
};
|
|
357
|
+
if (await createExclusiveRow(store, keyPath, 'claim', '', claim)) {
|
|
358
|
+
if (input.readOnly === true || (await createExclusiveRow(store, claimPath(store.home, 'workspace', cwd), 'claim', '', claim))) {
|
|
359
|
+
return { kind: 'reserved', attemptId };
|
|
360
|
+
}
|
|
361
|
+
// The workspace has another writer: roll back the key this call created.
|
|
362
|
+
await removeIfPresent(store, keyPath);
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
const claim = await readClaim(store, keyPath);
|
|
366
|
+
// A dead owner is not proof that createSession did not commit before the
|
|
367
|
+
// reservation could be bound. Keep both claims until recovery can reconcile
|
|
368
|
+
// the Session; retrying here could create a second, orphaned Session.
|
|
369
|
+
if (claim && !claim.sessionId && !(await store.isAlive(claim.ownerPid))) {
|
|
370
|
+
return {
|
|
371
|
+
kind: 'conflict',
|
|
372
|
+
sessionId: null,
|
|
373
|
+
attemptId: claim.attemptId,
|
|
374
|
+
reason: 'Launch reservation has no bound session; recovery is required before retry.'
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
return existing.kind === 'absent'
|
|
378
|
+
? { kind: 'conflict', sessionId: null, attemptId: claim?.attemptId ?? null, reason: 'Launch reservation is in progress.' }
|
|
379
|
+
: existing;
|
|
380
|
+
}
|
|
381
|
+
export async function bindLaunchSession(store, idempotencyKey, sessionId) {
|
|
382
|
+
const path = claimPath(store.home, 'key', idempotencyKey);
|
|
383
|
+
const claim = await readClaim(store, path);
|
|
384
|
+
if (!claim || claim.idempotencyKey !== idempotencyKey)
|
|
385
|
+
return;
|
|
386
|
+
await writeRow(store, path, 'claim', sessionId, { ...claim, sessionId });
|
|
387
|
+
// A read-only reservation took no workspace claim; only bind one this key holds.
|
|
388
|
+
const workspacePath = claimPath(store.home, 'workspace', claim.cwd);
|
|
389
|
+
if ((await readClaim(store, workspacePath))?.idempotencyKey === idempotencyKey) {
|
|
390
|
+
await writeRow(store, workspacePath, 'claim', sessionId, { ...claim, sessionId });
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
/** Records an exit the owner observed. A live pid probe is not this record. */
|
|
394
|
+
export async function recordObservedLaunchExit(store, input) {
|
|
395
|
+
const cwd = await canonicalWorkspacePath(store, input.cwd);
|
|
396
|
+
const dispatched = (await listLaunchAttempts(store, input.sessionId)).find((attempt) => attempt.idempotencyKey === input.idempotencyKey && attempt.phase === 'dispatched' && attempt.pid === input.pid);
|
|
397
|
+
if (!dispatched) {
|
|
398
|
+
throw new CapabilityError('No dispatched launch attempt matches that pid.', 'NOT_FOUND', {
|
|
399
|
+
reason: 'launch-attempt-not-dispatched',
|
|
400
|
+
retryable: false
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
if (await store.isAlive(input.pid)) {
|
|
404
|
+
throw new CapabilityError('The launched process is still alive.', 'CONFLICT', {
|
|
405
|
+
reason: 'launch-process-alive',
|
|
406
|
+
retryable: true
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
const keyPath = claimPath(store.home, 'key', input.idempotencyKey);
|
|
410
|
+
const claim = await readClaim(store, keyPath);
|
|
411
|
+
const recorded = await appendLaunchAttempt(store, {
|
|
412
|
+
...input,
|
|
413
|
+
attemptId: claim?.attemptId ?? dispatched.attemptId,
|
|
414
|
+
cwd,
|
|
415
|
+
phase: 'exited',
|
|
416
|
+
exitObserved: true,
|
|
417
|
+
createdAt: new Date().toISOString()
|
|
418
|
+
});
|
|
419
|
+
if (claim && claim.idempotencyKey === input.idempotencyKey) {
|
|
420
|
+
await writeRow(store, keyPath, 'claim', claim.sessionId, { ...claim, disposition: 'completed', cwd });
|
|
421
|
+
}
|
|
422
|
+
await releaseWorkspaceClaim(store, claimPath(store.home, 'workspace', cwd), input.idempotencyKey);
|
|
423
|
+
return recorded;
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* Records the exit of a supervised launch: PM ran the harness and its exit was
|
|
427
|
+
* observed by awaiting it, so there is no pid to probe. The attempt is marked
|
|
428
|
+
* exited, the key claim completed, and the workspace claim released.
|
|
429
|
+
*/
|
|
430
|
+
export async function completeSupervisedLaunch(store, input) {
|
|
431
|
+
const cwd = await canonicalWorkspacePath(store, input.cwd);
|
|
432
|
+
const recorded = await appendLaunchAttempt(store, {
|
|
433
|
+
...input,
|
|
434
|
+
cwd,
|
|
435
|
+
phase: 'exited',
|
|
436
|
+
exitObserved: true,
|
|
437
|
+
createdAt: new Date().toISOString()
|
|
438
|
+
});
|
|
439
|
+
const keyPath = claimPath(store.home, 'key', input.idempotencyKey);
|
|
440
|
+
const claim = await readClaim(store, keyPath);
|
|
441
|
+
if (claim && claim.idempotencyKey === input.idempotencyKey) {
|
|
442
|
+
await writeRow(store, keyPath, 'claim', claim.sessionId, { ...claim, disposition: 'completed', cwd });
|
|
443
|
+
}
|
|
444
|
+
await releaseWorkspaceClaim(store, claimPath(store.home, 'workspace', cwd), input.idempotencyKey);
|
|
445
|
+
return recorded;
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* A workspace claim whose holder no longer writes is released so the next
|
|
449
|
+
* launch can claim the workspace: its latest attempt observed its exit; or it
|
|
450
|
+
* was dispatched and its pid is no longer running (that exit is recorded); or
|
|
451
|
+
* it never dispatched and the process that claimed it is gone. A live holder
|
|
452
|
+
* keeps its claim. Answers whether the claim was released.
|
|
453
|
+
*/
|
|
454
|
+
async function releaseStaleWorkspaceClaim(store, workspacePath) {
|
|
455
|
+
const holder = await readClaim(store, workspacePath);
|
|
456
|
+
if (!holder)
|
|
457
|
+
return true;
|
|
458
|
+
const latest = latestByKey(await listLaunchAttempts(store, holder.sessionId)).find((attempt) => attempt.idempotencyKey === holder.idempotencyKey);
|
|
459
|
+
if (latest && !attemptStillOpen(latest)) {
|
|
460
|
+
await releaseWorkspaceClaim(store, workspacePath, holder.idempotencyKey);
|
|
461
|
+
return true;
|
|
462
|
+
}
|
|
463
|
+
if (latest?.phase === 'dispatched' && latest.pid !== undefined) {
|
|
464
|
+
if (await store.isAlive(latest.pid))
|
|
465
|
+
return false;
|
|
466
|
+
await recordObservedLaunchExit(store, {
|
|
467
|
+
sessionId: latest.sessionId,
|
|
468
|
+
idempotencyKey: latest.idempotencyKey,
|
|
469
|
+
cwd: latest.cwd,
|
|
470
|
+
harness: latest.harness,
|
|
471
|
+
toolId: latest.toolId,
|
|
472
|
+
mode: latest.mode,
|
|
473
|
+
command: latest.command,
|
|
474
|
+
pid: latest.pid
|
|
475
|
+
});
|
|
476
|
+
return true;
|
|
477
|
+
}
|
|
478
|
+
if (await store.isAlive(holder.ownerPid))
|
|
479
|
+
return false;
|
|
480
|
+
await releaseWorkspaceClaim(store, workspacePath, holder.idempotencyKey);
|
|
481
|
+
return true;
|
|
482
|
+
}
|
|
483
|
+
/** Release the workspace claim this key holds; another key's claim, or none, is left alone. */
|
|
484
|
+
async function releaseWorkspaceClaim(store, path, idempotencyKey) {
|
|
485
|
+
const claim = await readClaim(store, path);
|
|
486
|
+
if (claim?.idempotencyKey !== idempotencyKey)
|
|
487
|
+
return;
|
|
488
|
+
await removeIfPresent(store, path);
|
|
489
|
+
}
|
|
490
|
+
/** An open attempt for this key or workspace must not gain a second writer. */
|
|
491
|
+
export async function findBlockingLaunchAttempt(store, input) {
|
|
492
|
+
const latest = latestByKey(await listAllLaunchAttempts(store));
|
|
493
|
+
return (latest.find((attempt) => attemptStillOpen(attempt) && (attempt.idempotencyKey === input.idempotencyKey || attempt.cwd === input.cwd)) ?? null);
|
|
494
|
+
}
|
|
495
|
+
//# sourceMappingURL=store.js.map
|