@vibesdotdev/external 0.0.0-stage → 1.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +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 +71 -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 +979 -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 +201 -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 +142 -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 +106 -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,979 @@
|
|
|
1
|
+
import { CloudTouchProjection } from "../ambient/cloud-touch-projection.impl.js";
|
|
2
|
+
import { TouchIdentityCache } from "../storage/touch-identity.js";
|
|
3
|
+
import { ExternalLifecycle } from "./lifecycle.js";
|
|
4
|
+
import * as z from 'zod/v4';
|
|
5
|
+
import { listRuntimePresets } from "../presets/runtime.js";
|
|
6
|
+
import { ConfigManifest } from '@vibesdotdev/config/manifest/config-manifest';
|
|
7
|
+
import { ExecutionResultSchema } from "../schemas/presets.js";
|
|
8
|
+
import { getLogger } from '@vibesdotdev/logging';
|
|
9
|
+
/**
|
|
10
|
+
* ExternalClient - Runtime Client for External Tooling
|
|
11
|
+
*
|
|
12
|
+
* The canonical client for the external/host domain. Provides typed access to:
|
|
13
|
+
* - Tool detection and management (tools.*)
|
|
14
|
+
* - MCP configuration (mcp.*)
|
|
15
|
+
* - Hook installation (hooks.*)
|
|
16
|
+
* - Skill generation (skills.*)
|
|
17
|
+
* - File access tracking (fileAccess.*)
|
|
18
|
+
* - Context summary generation (contextSummary.*)
|
|
19
|
+
* - Preset management (presets.*)
|
|
20
|
+
* - Setup wizard (setup.runWizard)
|
|
21
|
+
* - Config management (config.*)
|
|
22
|
+
*
|
|
23
|
+
* Cross-module access goes through getVibesExternalClient(runtime) - never through
|
|
24
|
+
* deep imports of storage/, mcp-config/, or detection/.
|
|
25
|
+
*/
|
|
26
|
+
import { CapabilityError, CaughtFailureSchema, valueFreeFailure } from '@vibesdotdev/kernel';
|
|
27
|
+
import { BaseRuntimeClient, getVibesClient } from '@vibesdotdev/kernel/client';
|
|
28
|
+
import { DEFAULT_RECENCY_WINDOW_MS, WhoElseTouchedInputSchema } from "../schemas/collision.js";
|
|
29
|
+
import { RECENT_WINDOW_MS, mergeRosterEntries, rosterFromAnnouncements, rosterFromTouches } from "../schemas/roster.js";
|
|
30
|
+
import { announceCurrentAgentSession, resolveAgentRosterProvider } from "../ambient/agent-roster-heartbeat.js";
|
|
31
|
+
import { listExternalHostDescriptors, resolveExternalHostImplementation } from "../external-tool/runtime.js";
|
|
32
|
+
import { externalFileSystem, listNamesIfPresent } from "../utils/runtime-fs.js";
|
|
33
|
+
/** What a unified-tool action answers: a message, plus any data. */
|
|
34
|
+
const ToolReceiptSchema = z.object({ message: z.string() }).passthrough();
|
|
35
|
+
const ExternalToolImplementationSchema = z.custom((value) => value instanceof Object && 'execute' in value && Object(value).execute instanceof Function);
|
|
36
|
+
/** Value-free failure facts as JSON details. */
|
|
37
|
+
function failureDetails(failure) {
|
|
38
|
+
return { name: failure.name, code: failure.code ?? null, reason: failure.reason ?? null };
|
|
39
|
+
}
|
|
40
|
+
async function attemptWrite(write) {
|
|
41
|
+
try {
|
|
42
|
+
return { value: await write() };
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
return { failed: valueFreeFailure(CaughtFailureSchema.parse(error)) };
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
// =============================================================================
|
|
49
|
+
// FILE ACCESS STORAGE HELPER
|
|
50
|
+
// =============================================================================
|
|
51
|
+
class FileAccessStorage {
|
|
52
|
+
runtime;
|
|
53
|
+
recordPromise = null;
|
|
54
|
+
constructor(runtime) {
|
|
55
|
+
this.runtime = runtime;
|
|
56
|
+
}
|
|
57
|
+
async getRecord() {
|
|
58
|
+
if (!this.recordPromise) {
|
|
59
|
+
this.recordPromise = this.runtime
|
|
60
|
+
.query('storage/record')
|
|
61
|
+
.withId('external.file_accesses')
|
|
62
|
+
.resolve();
|
|
63
|
+
}
|
|
64
|
+
return this.recordPromise;
|
|
65
|
+
}
|
|
66
|
+
toDate(value) {
|
|
67
|
+
if (value instanceof Date)
|
|
68
|
+
return value;
|
|
69
|
+
return value === undefined ? new Date(0) : new Date(value);
|
|
70
|
+
}
|
|
71
|
+
normalizeFileAccess(access) {
|
|
72
|
+
return {
|
|
73
|
+
...access,
|
|
74
|
+
timestamp: this.toDate(access.timestamp),
|
|
75
|
+
createdAt: this.toDate(access.createdAt)
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
filterAccesses(accesses, filters) {
|
|
79
|
+
if (!filters)
|
|
80
|
+
return accesses;
|
|
81
|
+
return accesses.filter((access) => {
|
|
82
|
+
if (filters.operation && access.operation !== filters.operation)
|
|
83
|
+
return false;
|
|
84
|
+
if (filters.filePath && !access.filePath.includes(filters.filePath))
|
|
85
|
+
return false;
|
|
86
|
+
if (filters.since && this.toDate(access.timestamp) < filters.since)
|
|
87
|
+
return false;
|
|
88
|
+
if (filters.until && this.toDate(access.timestamp) > filters.until)
|
|
89
|
+
return false;
|
|
90
|
+
return true;
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
buildStats(entries) {
|
|
94
|
+
const byPath = new Map();
|
|
95
|
+
for (const entry of entries) {
|
|
96
|
+
const list = byPath.get(entry.filePath) ?? [];
|
|
97
|
+
list.push(entry);
|
|
98
|
+
byPath.set(entry.filePath, list);
|
|
99
|
+
}
|
|
100
|
+
const now = Date.now();
|
|
101
|
+
const stats = [];
|
|
102
|
+
for (const [filePath, list] of byPath) {
|
|
103
|
+
const sorted = [...list].sort((a, b) => this.toDate(a.timestamp).getTime() - this.toDate(b.timestamp).getTime());
|
|
104
|
+
// A row is a bucket carrying `accessCount` touches, so sum it rather
|
|
105
|
+
// than counting rows — otherwise rollup would silently deflate every
|
|
106
|
+
// number a caller reads.
|
|
107
|
+
const weight = (e) => e.accessCount ?? 1;
|
|
108
|
+
const totalAccesses = list.reduce((sum, e) => sum + weight(e), 0);
|
|
109
|
+
const firstAccess = this.toDate(sorted[0]?.timestamp);
|
|
110
|
+
const lastAccess = this.toDate(sorted[sorted.length - 1]?.timestamp);
|
|
111
|
+
const ageDays = Math.max(0, (now - lastAccess.getTime()) / (1000 * 60 * 60 * 24));
|
|
112
|
+
const recencyScore = Math.max(0, 1 - Math.min(1, ageDays / 7));
|
|
113
|
+
const frequencyScore = Math.min(1, totalAccesses / 20);
|
|
114
|
+
const relevanceScore = recencyScore * 0.6 + frequencyScore * 0.4;
|
|
115
|
+
stats.push({
|
|
116
|
+
filePath,
|
|
117
|
+
readCount: list.reduce((n, e) => n + (e.operation === 'read' ? weight(e) : 0), 0),
|
|
118
|
+
editCount: list.reduce((n, e) => n + (e.operation === 'edit' ? weight(e) : 0), 0),
|
|
119
|
+
writeCount: list.reduce((n, e) => n + (e.operation === 'write' ? weight(e) : 0), 0),
|
|
120
|
+
deleteCount: list.reduce((n, e) => n + (e.operation === 'delete' ? weight(e) : 0), 0),
|
|
121
|
+
totalAccesses,
|
|
122
|
+
firstAccess: firstAccess.toISOString(),
|
|
123
|
+
lastAccess: lastAccess.toISOString(),
|
|
124
|
+
recencyScore,
|
|
125
|
+
frequencyScore,
|
|
126
|
+
relevanceScore
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
return stats.sort((a, b) => b.relevanceScore - a.relevanceScore);
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* The rollup bucket a touch belongs to: one per
|
|
133
|
+
* (session, path, operation, tool, UTC day). Derived, not random, so a
|
|
134
|
+
* repeat touch finds its bucket with a get instead of a query. Shaped as a
|
|
135
|
+
* v8 UUID because the record id is schema-constrained to a UUID.
|
|
136
|
+
*/
|
|
137
|
+
async bucketId(options, day) {
|
|
138
|
+
// JSON rather than a delimiter: a file path may contain any byte, so a
|
|
139
|
+
// delimiter that can appear in the input can merge two distinct touches.
|
|
140
|
+
const key = JSON.stringify([
|
|
141
|
+
options.sessionId,
|
|
142
|
+
options.filePath,
|
|
143
|
+
options.operation,
|
|
144
|
+
options.toolName ?? '',
|
|
145
|
+
day
|
|
146
|
+
]);
|
|
147
|
+
if (!globalThis.crypto?.subtle) {
|
|
148
|
+
throw new CapabilityError('File-access rollup requires Web Crypto (crypto.subtle).', 'UNAVAILABLE', {
|
|
149
|
+
reason: 'web-crypto-unavailable',
|
|
150
|
+
retryable: false
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
const digest = new Uint8Array(await globalThis.crypto.subtle.digest('SHA-256', new TextEncoder().encode(key)));
|
|
154
|
+
const h = Array.from(digest, (byte) => byte.toString(16).padStart(2, '0')).join('');
|
|
155
|
+
return [
|
|
156
|
+
h.slice(0, 8),
|
|
157
|
+
h.slice(8, 12),
|
|
158
|
+
`8${h.slice(13, 16)}`,
|
|
159
|
+
`${((parseInt(h[16], 16) & 0x3) | 0x8).toString(16)}${h.slice(17, 20)}`,
|
|
160
|
+
h.slice(20, 32)
|
|
161
|
+
].join('-');
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Record a touch.
|
|
165
|
+
*
|
|
166
|
+
* Touches ROLL UP: a bucket row is created once and then counted, never
|
|
167
|
+
* appended to. The ambient watcher fires on every OS change, so
|
|
168
|
+
* append-per-event grew `external.db` to 2.15 million rows and 3.4 GB in
|
|
169
|
+
* eight days while carrying nine rows of real tool activity. What callers
|
|
170
|
+
* read — who touched what, when, how often — is unchanged.
|
|
171
|
+
*/
|
|
172
|
+
async track(options) {
|
|
173
|
+
const record = await this.getRecord();
|
|
174
|
+
const now = new Date();
|
|
175
|
+
const at = options.timestamp ?? now;
|
|
176
|
+
const day = this.toDate(at).toISOString().slice(0, 10);
|
|
177
|
+
const id = await this.bucketId(options, day);
|
|
178
|
+
const create = {
|
|
179
|
+
id,
|
|
180
|
+
accessCount: 1,
|
|
181
|
+
sessionId: options.sessionId,
|
|
182
|
+
filePath: options.filePath,
|
|
183
|
+
operation: options.operation,
|
|
184
|
+
lineRange: options.lineRange,
|
|
185
|
+
symbolsAccessed: options.symbolsAccessed ?? [],
|
|
186
|
+
bytesRead: options.bytesRead,
|
|
187
|
+
bytesWritten: options.bytesWritten,
|
|
188
|
+
diagnosticsCount: options.diagnosticsCount,
|
|
189
|
+
activeTodoId: options.activeTodoId,
|
|
190
|
+
toolName: options.toolName,
|
|
191
|
+
toolCallId: options.toolCallId,
|
|
192
|
+
// Ambient identity (v2). Undefined stays undefined: a touch that
|
|
193
|
+
// cannot resolve its machine or workspace still records.
|
|
194
|
+
machineId: options.machineId,
|
|
195
|
+
machineName: options.machineName,
|
|
196
|
+
participantId: options.participantId,
|
|
197
|
+
participantSlug: options.participantSlug,
|
|
198
|
+
workspaceRoot: options.workspaceRoot,
|
|
199
|
+
gitBranch: options.gitBranch,
|
|
200
|
+
headSha: options.headSha,
|
|
201
|
+
workItemId: options.workItemId,
|
|
202
|
+
workItemTitle: options.workItemTitle,
|
|
203
|
+
metadata: options.metadata ?? {},
|
|
204
|
+
timestamp: at,
|
|
205
|
+
createdAt: now
|
|
206
|
+
};
|
|
207
|
+
// This path is shared by watcher callbacks and can be entered
|
|
208
|
+
// concurrently. A plain get/update loses increments. Compare-and-set the
|
|
209
|
+
// observed count; a create collision means another caller created the
|
|
210
|
+
// bucket first, so retry against that row. Retention is deliberately not
|
|
211
|
+
// duplicated here: the descriptor-owned policy is enforced by the
|
|
212
|
+
// External plugin on activation and on its bounded interval.
|
|
213
|
+
for (let attempt = 0; attempt < 64; attempt++) {
|
|
214
|
+
const existing = await record.get(id);
|
|
215
|
+
if (!existing) {
|
|
216
|
+
const created = await attemptWrite(async () => this.normalizeFileAccess(await record.create(create)));
|
|
217
|
+
if ('value' in created)
|
|
218
|
+
return created.value;
|
|
219
|
+
// Another caller created the bucket first: retry against that row.
|
|
220
|
+
if (await record.get(id))
|
|
221
|
+
continue;
|
|
222
|
+
throw new CapabilityError('The file-access bucket could not be created.', 'UNAVAILABLE', {
|
|
223
|
+
reason: 'file-access-create-failed',
|
|
224
|
+
details: { failure: failureDetails(created.failed) }
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
const accessCount = existing.accessCount ?? 1;
|
|
228
|
+
const updated = await attemptWrite(async () => this.normalizeFileAccess(await record.update(id, {
|
|
229
|
+
accessCount: accessCount + 1,
|
|
230
|
+
timestamp: at,
|
|
231
|
+
// Fill identity omitted by an earlier lower-context tracker; keep the newest branch and task.
|
|
232
|
+
machineId: options.machineId ?? existing.machineId,
|
|
233
|
+
machineName: options.machineName ?? existing.machineName,
|
|
234
|
+
participantId: options.participantId ?? existing.participantId,
|
|
235
|
+
participantSlug: options.participantSlug ?? existing.participantSlug,
|
|
236
|
+
workspaceRoot: options.workspaceRoot ?? existing.workspaceRoot,
|
|
237
|
+
gitBranch: options.gitBranch ?? existing.gitBranch,
|
|
238
|
+
headSha: options.headSha ?? existing.headSha,
|
|
239
|
+
workItemId: options.workItemId ?? existing.workItemId,
|
|
240
|
+
workItemTitle: options.workItemTitle ?? existing.workItemTitle
|
|
241
|
+
}, { where: { accessCount } })));
|
|
242
|
+
if ('value' in updated)
|
|
243
|
+
return updated.value;
|
|
244
|
+
// A concurrent increment won: compare-and-set again against the new count.
|
|
245
|
+
if (updated.failed.name === 'OptimisticLockError')
|
|
246
|
+
continue;
|
|
247
|
+
throw new CapabilityError('The file-access bucket could not be updated.', 'UNAVAILABLE', {
|
|
248
|
+
reason: 'file-access-update-failed',
|
|
249
|
+
details: { failure: failureDetails(updated.failed) }
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
throw new CapabilityError('A file-access bucket stayed contended after 64 compare-and-set attempts.', 'CONFLICT', {
|
|
253
|
+
reason: 'file-access-contended',
|
|
254
|
+
details: { id }
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Cross-session collision read: who ELSE recently touched this path.
|
|
259
|
+
*
|
|
260
|
+
* This is a new query rather than a widening of `list()`, which stays
|
|
261
|
+
* `sessionId`-scoped so no existing caller changes behaviour.
|
|
262
|
+
*
|
|
263
|
+
* Noise budget enforced here (see schemas/collision.ts):
|
|
264
|
+
* - other sessions only,
|
|
265
|
+
* - same workspace only when the caller knows its own workspace,
|
|
266
|
+
* - inside the recency window,
|
|
267
|
+
* - one entry per peer session (its most recent touch), capped.
|
|
268
|
+
*/
|
|
269
|
+
async whoElseTouched(input) {
|
|
270
|
+
const parsed = WhoElseTouchedInputSchema.parse(input);
|
|
271
|
+
const now = new Date();
|
|
272
|
+
const since = parsed.since ?? new Date(now.getTime() - DEFAULT_RECENCY_WINDOW_MS);
|
|
273
|
+
const record = await this.getRecord();
|
|
274
|
+
// Indexed by idx_file_accesses_path_recent (filePath, timestamp).
|
|
275
|
+
const filters = {
|
|
276
|
+
filePath: parsed.filePath,
|
|
277
|
+
timestamp: { gte: since },
|
|
278
|
+
sessionId: { ne: parsed.excludeSessionId }
|
|
279
|
+
};
|
|
280
|
+
// Preserve legacy rows without workspace identity without fetching foreign
|
|
281
|
+
// workspaces ahead of the cap. Both reads use the same indexed path/window.
|
|
282
|
+
const pages = parsed.workspaceRoot
|
|
283
|
+
? await Promise.all([
|
|
284
|
+
record.list({ where: { ...filters, workspaceRoot: parsed.workspaceRoot }, orderBy: { timestamp: 'desc' }, limit: 200, offset: 0 }),
|
|
285
|
+
record.list({ where: { ...filters, workspaceRoot: { isNull: true } }, orderBy: { timestamp: 'desc' }, limit: 200, offset: 0 })
|
|
286
|
+
])
|
|
287
|
+
: [await record.list({ where: filters, orderBy: { timestamp: 'desc' }, limit: 200, offset: 0 })];
|
|
288
|
+
const items = pages.flatMap(page => page.items)
|
|
289
|
+
.sort((left, right) => this.toDate(right.timestamp).getTime() - this.toDate(left.timestamp).getTime());
|
|
290
|
+
const bySession = new Map();
|
|
291
|
+
for (const raw of items) {
|
|
292
|
+
const access = this.normalizeFileAccess(raw);
|
|
293
|
+
// Never report the caller to itself.
|
|
294
|
+
if (access.sessionId === parsed.excludeSessionId)
|
|
295
|
+
continue;
|
|
296
|
+
// Read-side expiry — no sweep job is involved.
|
|
297
|
+
const timestamp = this.toDate(access.timestamp);
|
|
298
|
+
if (timestamp < since)
|
|
299
|
+
continue;
|
|
300
|
+
// A different worktree is NOT a collision. Only excludes when the
|
|
301
|
+
// caller knows its own workspace AND the peer declared one.
|
|
302
|
+
if (parsed.workspaceRoot &&
|
|
303
|
+
access.workspaceRoot &&
|
|
304
|
+
access.workspaceRoot !== parsed.workspaceRoot) {
|
|
305
|
+
continue;
|
|
306
|
+
}
|
|
307
|
+
// Rows are timestamp-desc, so the first hit per session is newest.
|
|
308
|
+
if (bySession.has(access.sessionId))
|
|
309
|
+
continue;
|
|
310
|
+
bySession.set(access.sessionId, {
|
|
311
|
+
sessionId: access.sessionId,
|
|
312
|
+
machineId: access.machineId,
|
|
313
|
+
machineName: access.machineName,
|
|
314
|
+
participantId: access.participantId,
|
|
315
|
+
participantSlug: access.participantSlug,
|
|
316
|
+
workspaceRoot: access.workspaceRoot,
|
|
317
|
+
gitBranch: access.gitBranch,
|
|
318
|
+
workItemId: access.workItemId,
|
|
319
|
+
workItemTitle: access.workItemTitle,
|
|
320
|
+
operation: access.operation,
|
|
321
|
+
filePath: access.filePath,
|
|
322
|
+
timestamp,
|
|
323
|
+
ageMs: Math.max(0, now.getTime() - timestamp.getTime()),
|
|
324
|
+
origin: 'local'
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
return Array.from(bySession.values())
|
|
328
|
+
.sort((a, b) => a.ageMs - b.ageMs)
|
|
329
|
+
.slice(0, parsed.limit);
|
|
330
|
+
}
|
|
331
|
+
async get(id) {
|
|
332
|
+
const record = await this.getRecord();
|
|
333
|
+
const result = await record.get(id);
|
|
334
|
+
return result ? this.normalizeFileAccess(result) : null;
|
|
335
|
+
}
|
|
336
|
+
async list(options) {
|
|
337
|
+
const record = await this.getRecord();
|
|
338
|
+
const result = await record.list({
|
|
339
|
+
where: { sessionId: options.sessionId },
|
|
340
|
+
orderBy: { timestamp: 'desc' },
|
|
341
|
+
limit: options.limit ?? 100,
|
|
342
|
+
offset: options.offset ?? 0
|
|
343
|
+
});
|
|
344
|
+
const normalized = result.items.map((item) => this.normalizeFileAccess(item));
|
|
345
|
+
return this.filterAccesses(normalized, {
|
|
346
|
+
operation: options.operation,
|
|
347
|
+
filePath: options.filePath,
|
|
348
|
+
since: options.since,
|
|
349
|
+
until: options.until,
|
|
350
|
+
limit: options.limit ?? 100,
|
|
351
|
+
offset: options.offset ?? 0
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Every session's recent touches, for the roster.
|
|
356
|
+
*
|
|
357
|
+
* Unlike `list()` this is NOT sessionId-scoped — presence is inherently a
|
|
358
|
+
* question about other people. Bounded by the window and a row cap so a
|
|
359
|
+
* busy machine cannot turn `vibes who` into a table scan.
|
|
360
|
+
*/
|
|
361
|
+
async recentTouches(input) {
|
|
362
|
+
const record = await this.getRecord();
|
|
363
|
+
const now = new Date();
|
|
364
|
+
const result = await record.list({
|
|
365
|
+
where: { timestamp: { gte: input.since } },
|
|
366
|
+
orderBy: { timestamp: 'desc' },
|
|
367
|
+
limit: input.limit ?? 500,
|
|
368
|
+
offset: 0
|
|
369
|
+
});
|
|
370
|
+
const peers = [];
|
|
371
|
+
for (const raw of result.items) {
|
|
372
|
+
const access = this.normalizeFileAccess(raw);
|
|
373
|
+
const timestamp = this.toDate(access.timestamp);
|
|
374
|
+
// Read-side expiry: the window is the only thing that decides
|
|
375
|
+
// presence, so no sweep job is ever required.
|
|
376
|
+
if (timestamp < input.since)
|
|
377
|
+
continue;
|
|
378
|
+
peers.push({
|
|
379
|
+
sessionId: access.sessionId,
|
|
380
|
+
machineId: access.machineId,
|
|
381
|
+
machineName: access.machineName,
|
|
382
|
+
participantId: access.participantId,
|
|
383
|
+
participantSlug: access.participantSlug,
|
|
384
|
+
workspaceRoot: access.workspaceRoot,
|
|
385
|
+
gitBranch: access.gitBranch,
|
|
386
|
+
workItemId: access.workItemId,
|
|
387
|
+
workItemTitle: access.workItemTitle,
|
|
388
|
+
operation: access.operation,
|
|
389
|
+
filePath: access.filePath,
|
|
390
|
+
timestamp,
|
|
391
|
+
ageMs: Math.max(0, now.getTime() - timestamp.getTime()),
|
|
392
|
+
origin: 'local'
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
return peers;
|
|
396
|
+
}
|
|
397
|
+
async stats(sessionId, limit = 50) {
|
|
398
|
+
const accesses = await this.list({ sessionId, limit: 5000, offset: 0 });
|
|
399
|
+
return this.buildStats(accesses).slice(0, limit);
|
|
400
|
+
}
|
|
401
|
+
async summary(sessionId) {
|
|
402
|
+
const stats = await this.stats(sessionId, 5000);
|
|
403
|
+
const recentlyEdited = stats.filter((s) => s.editCount > 0 || s.writeCount > 0).slice(0, 20);
|
|
404
|
+
const recentlyRead = stats.filter((s) => s.readCount > 0).slice(0, 20);
|
|
405
|
+
const totalAccesses = stats.reduce((sum, s) => sum + s.totalAccesses, 0);
|
|
406
|
+
return {
|
|
407
|
+
sessionId,
|
|
408
|
+
generatedAt: new Date().toISOString(),
|
|
409
|
+
totalFiles: stats.length,
|
|
410
|
+
totalAccesses,
|
|
411
|
+
recentlyEdited,
|
|
412
|
+
recentlyRead,
|
|
413
|
+
hotspots: stats.slice(0, 10).map((s) => ({
|
|
414
|
+
filePath: s.filePath,
|
|
415
|
+
score: s.relevanceScore,
|
|
416
|
+
reason: `${s.totalAccesses} accesses`
|
|
417
|
+
}))
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
async delete(id) {
|
|
421
|
+
const record = await this.getRecord();
|
|
422
|
+
await record.delete(id);
|
|
423
|
+
}
|
|
424
|
+
async deleteSession(sessionId) {
|
|
425
|
+
const all = await this.list({ sessionId, limit: 5000, offset: 0 });
|
|
426
|
+
await Promise.all(all.map((entry) => this.delete(entry.id)));
|
|
427
|
+
return all.length;
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* Drop touch records older than `retentionDays`.
|
|
431
|
+
*
|
|
432
|
+
* THIS USED TO BE UNABLE TO DO ITS JOB. The previous implementation listed
|
|
433
|
+
* `{ limit: 10000, offset: 0 }` with NO ordering, filtered in JS, and deleted
|
|
434
|
+
* row by row. Three problems compounded:
|
|
435
|
+
*
|
|
436
|
+
* 1. No ordering means the 10k window is whatever the backend returns. If
|
|
437
|
+
* that is newest-first, every row in the window is fresh, the filter
|
|
438
|
+
* matches nothing, and cleanup reports success having deleted zero —
|
|
439
|
+
* forever, no matter how large the table grows.
|
|
440
|
+
* 2. The 10k cap silently bounded a table that reached 3,182,962 rows.
|
|
441
|
+
* 3. Row-by-row deletes make the cost proportional to the backlog, which is
|
|
442
|
+
* exactly backwards: the worse the problem, the less likely it finishes.
|
|
443
|
+
*
|
|
444
|
+
* The record layer already has `deleteMany(where)`, so this is one predicate
|
|
445
|
+
* evaluated by the store. Ordering stops mattering because nothing is being
|
|
446
|
+
* sampled — every stale row matches, regardless of what a listing would have
|
|
447
|
+
* returned first.
|
|
448
|
+
*
|
|
449
|
+
* None of that mattered while nothing CALLED this, which was the case until
|
|
450
|
+
* 2026-08-21. A cleanup routine with zero call sites is invisible: the code
|
|
451
|
+
* exists, so everyone assumes the behaviour does.
|
|
452
|
+
*/
|
|
453
|
+
async cleanup(retentionDays) {
|
|
454
|
+
const cutoff = new Date(Date.now() - retentionDays * 24 * 60 * 60 * 1000);
|
|
455
|
+
const record = await this.getRecord();
|
|
456
|
+
const result = await record.deleteMany({ timestamp: { lt: cutoff } });
|
|
457
|
+
return result.count;
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
// =============================================================================
|
|
461
|
+
// EXTERNAL CLIENT
|
|
462
|
+
// =============================================================================
|
|
463
|
+
/**
|
|
464
|
+
* Runtime port `VibesRuntime` (Runtime SPEC `./client`): hook calls run
|
|
465
|
+
* through the Tools invocation pipeline (`invokeTool`: `acquireInvocation`,
|
|
466
|
+
* `runInvocation`, `assets`, `resolve`), which `RuntimeRef` does not carry.
|
|
467
|
+
*/
|
|
468
|
+
export class ExternalClient extends BaseRuntimeClient {
|
|
469
|
+
fileAccessStorage = null;
|
|
470
|
+
backgroundWork = new ExternalLifecycle();
|
|
471
|
+
fallbackSessionId;
|
|
472
|
+
deferredAmbientDelivery = new Map();
|
|
473
|
+
deliveryPaths = new Map();
|
|
474
|
+
pendingNotices = new Map();
|
|
475
|
+
collisionDedupe = new Set();
|
|
476
|
+
touchIdentity = new TouchIdentityCache();
|
|
477
|
+
cloudProjection;
|
|
478
|
+
getCloudTouchProjection() {
|
|
479
|
+
return this.cloudProjection ??= new CloudTouchProjection(this.runtime);
|
|
480
|
+
}
|
|
481
|
+
async activateBackgroundWork() {
|
|
482
|
+
await this.backgroundWork.activate(this.runtime);
|
|
483
|
+
}
|
|
484
|
+
ambientSessionId(bound) {
|
|
485
|
+
if (bound)
|
|
486
|
+
return bound;
|
|
487
|
+
return this.fallbackSessionId ??= crypto.randomUUID();
|
|
488
|
+
}
|
|
489
|
+
queueNotice(sessionId, entry) {
|
|
490
|
+
const batches = this.pendingNotices.get(sessionId) ?? [];
|
|
491
|
+
batches.push(entry);
|
|
492
|
+
this.pendingNotices.set(sessionId, batches);
|
|
493
|
+
}
|
|
494
|
+
drainNotice(sessionId) {
|
|
495
|
+
const batches = this.drainNoticeBatches(sessionId);
|
|
496
|
+
if (!batches.length)
|
|
497
|
+
return null;
|
|
498
|
+
const notice = batches.flatMap((entry) => entry.notice ? [entry.notice] : []).join('\n');
|
|
499
|
+
const messages = batches.flatMap((entry) => entry.messages ? [entry.messages] : []).join('\n');
|
|
500
|
+
const combined = {};
|
|
501
|
+
if (notice)
|
|
502
|
+
combined.notice = notice;
|
|
503
|
+
if (messages)
|
|
504
|
+
combined.messages = messages;
|
|
505
|
+
return combined;
|
|
506
|
+
}
|
|
507
|
+
drainNoticeBatches(sessionId) {
|
|
508
|
+
const batches = this.pendingNotices.get(sessionId) ?? [];
|
|
509
|
+
this.pendingNotices.delete(sessionId);
|
|
510
|
+
return batches;
|
|
511
|
+
}
|
|
512
|
+
rememberDeliveryPaths(sessionId, paths) {
|
|
513
|
+
const pending = this.deliveryPaths.get(sessionId) ?? new Set();
|
|
514
|
+
for (const path of paths)
|
|
515
|
+
pending.add(path);
|
|
516
|
+
this.deliveryPaths.set(sessionId, pending);
|
|
517
|
+
}
|
|
518
|
+
deliveryPathsFor(sessionId) {
|
|
519
|
+
return [...(this.deliveryPaths.get(sessionId) ?? [])];
|
|
520
|
+
}
|
|
521
|
+
clearDeliveryPaths(sessionId) {
|
|
522
|
+
this.deliveryPaths.delete(sessionId);
|
|
523
|
+
}
|
|
524
|
+
/** Hook-internal tools have no independent participant-visible result. */
|
|
525
|
+
async withDeferredAmbientDelivery(sessionId, run) {
|
|
526
|
+
this.deferredAmbientDelivery.set(sessionId, (this.deferredAmbientDelivery.get(sessionId) ?? 0) + 1);
|
|
527
|
+
try {
|
|
528
|
+
return await run();
|
|
529
|
+
}
|
|
530
|
+
finally {
|
|
531
|
+
const remaining = (this.deferredAmbientDelivery.get(sessionId) ?? 1) - 1;
|
|
532
|
+
if (remaining > 0)
|
|
533
|
+
this.deferredAmbientDelivery.set(sessionId, remaining);
|
|
534
|
+
else
|
|
535
|
+
this.deferredAmbientDelivery.delete(sessionId);
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
ambientDeliveryDeferred(sessionId) {
|
|
539
|
+
return this.deferredAmbientDelivery.has(sessionId);
|
|
540
|
+
}
|
|
541
|
+
onDispose() {
|
|
542
|
+
this.backgroundWork.dispose();
|
|
543
|
+
this.cloudProjection?.dispose();
|
|
544
|
+
this.cloudProjection = undefined;
|
|
545
|
+
this.collisionDedupe.clear();
|
|
546
|
+
this.touchIdentity.reset();
|
|
547
|
+
this.pendingNotices.clear();
|
|
548
|
+
this.deliveryPaths.clear();
|
|
549
|
+
this.deferredAmbientDelivery.clear();
|
|
550
|
+
this.fallbackSessionId = undefined;
|
|
551
|
+
this.fileAccessStorage = null;
|
|
552
|
+
}
|
|
553
|
+
constructor(descriptor = { id: 'external', kind: 'runtime/client', name: 'External Client' }, context, runtime) {
|
|
554
|
+
super(descriptor, context, runtime);
|
|
555
|
+
}
|
|
556
|
+
// Lazy-init file access storage
|
|
557
|
+
getFileAccessStorage() {
|
|
558
|
+
if (!this.fileAccessStorage) {
|
|
559
|
+
this.fileAccessStorage = new FileAccessStorage(this.runtime);
|
|
560
|
+
}
|
|
561
|
+
return this.fileAccessStorage;
|
|
562
|
+
}
|
|
563
|
+
// =========================================================================
|
|
564
|
+
// TOOLS
|
|
565
|
+
// =========================================================================
|
|
566
|
+
/** The host registered under `toolId`, admitted against the host contract. */
|
|
567
|
+
host(toolId) {
|
|
568
|
+
return resolveExternalHostImplementation(this.runtime, toolId);
|
|
569
|
+
}
|
|
570
|
+
/** The host registered under `toolId`, or `null` when none is (confirmed absence); any other failure propagates. */
|
|
571
|
+
async hostIfRegistered(toolId) {
|
|
572
|
+
try {
|
|
573
|
+
return await this.host(toolId);
|
|
574
|
+
}
|
|
575
|
+
catch (error) {
|
|
576
|
+
if (CapabilityError.isAbsenceOf(CaughtFailureSchema.parse(error), 'external/host', toolId))
|
|
577
|
+
return null;
|
|
578
|
+
throw error;
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
/**
|
|
582
|
+
* Detect a single tool; `null` when no host is registered under `toolId`.
|
|
583
|
+
*/
|
|
584
|
+
async detectTool(toolId, options) {
|
|
585
|
+
const externalTool = await this.hostIfRegistered(toolId);
|
|
586
|
+
if (!externalTool)
|
|
587
|
+
return null;
|
|
588
|
+
const result = await externalTool.detect(options?.projectDir);
|
|
589
|
+
return {
|
|
590
|
+
id: toolId,
|
|
591
|
+
name: externalTool.manifest.name,
|
|
592
|
+
installed: result.installation.installed,
|
|
593
|
+
version: result.installation.version,
|
|
594
|
+
installPath: result.installation.installPath,
|
|
595
|
+
configPath: result.installation.configPath,
|
|
596
|
+
mcpConfigured: result.mcpState.configured,
|
|
597
|
+
hasAuthToken: result.mcpState.hasAuthToken,
|
|
598
|
+
manifest: externalTool.manifest
|
|
599
|
+
};
|
|
600
|
+
}
|
|
601
|
+
/**
|
|
602
|
+
* Detect all available tools. One host's failed detection is that host's
|
|
603
|
+
* refusal: it propagates, never silently dropped from the list.
|
|
604
|
+
*/
|
|
605
|
+
async detectAll(options) {
|
|
606
|
+
const descriptors = this.runtime.query('external/host').enabled().descriptors();
|
|
607
|
+
const results = await Promise.all(descriptors.map((d) => this.detectTool(d.id, options)));
|
|
608
|
+
return results.filter((r) => r !== null);
|
|
609
|
+
}
|
|
610
|
+
/**
|
|
611
|
+
* Get a tool manifest; `null` when no host is registered under `toolId`.
|
|
612
|
+
*/
|
|
613
|
+
async getTool(toolId) {
|
|
614
|
+
return (await this.hostIfRegistered(toolId))?.manifest ?? null;
|
|
615
|
+
}
|
|
616
|
+
/**
|
|
617
|
+
* List all available tools
|
|
618
|
+
*/
|
|
619
|
+
async listTools() {
|
|
620
|
+
return listExternalHostDescriptors(this.runtime).map((d) => ({ id: d.id, name: d.manifest.name, manifest: d.manifest }));
|
|
621
|
+
}
|
|
622
|
+
// =========================================================================
|
|
623
|
+
// MCP
|
|
624
|
+
// =========================================================================
|
|
625
|
+
/**
|
|
626
|
+
* Install MCP configuration for a tool
|
|
627
|
+
*/
|
|
628
|
+
async installMcp(options) {
|
|
629
|
+
return (await this.host(options.tool)).installMcp({
|
|
630
|
+
global: options.global ?? true,
|
|
631
|
+
projectDir: options.projectDir,
|
|
632
|
+
vibesPath: options.vibesPath,
|
|
633
|
+
authToken: options.authToken,
|
|
634
|
+
tier: options.tier,
|
|
635
|
+
mcpClientId: options.mcpClientId,
|
|
636
|
+
dryRun: options.dryRun ?? false,
|
|
637
|
+
force: options.force ?? false
|
|
638
|
+
});
|
|
639
|
+
}
|
|
640
|
+
/**
|
|
641
|
+
* Uninstall MCP configuration for a tool
|
|
642
|
+
*/
|
|
643
|
+
async uninstallMcp(tool, global, projectDir) {
|
|
644
|
+
return (await this.host(tool)).uninstallMcp(global ?? true, projectDir);
|
|
645
|
+
}
|
|
646
|
+
/**
|
|
647
|
+
* Check MCP configuration status for a tool
|
|
648
|
+
*/
|
|
649
|
+
async checkMcp(tool, global, projectDir) {
|
|
650
|
+
return (await this.host(tool)).checkMcp({ global: global ?? true, projectDir });
|
|
651
|
+
}
|
|
652
|
+
/**
|
|
653
|
+
* Get MCP config path for a tool
|
|
654
|
+
*/
|
|
655
|
+
async configPath(tool, global, projectDir) {
|
|
656
|
+
return (await this.host(tool)).getMcpConfigPath(global ?? true, projectDir) ?? null;
|
|
657
|
+
}
|
|
658
|
+
/**
|
|
659
|
+
* Check if MCP is configured for a tool
|
|
660
|
+
*/
|
|
661
|
+
async isConfigured(tool, global, projectDir) {
|
|
662
|
+
return (await this.host(tool)).isMcpConfigured(global ?? true, projectDir);
|
|
663
|
+
}
|
|
664
|
+
/**
|
|
665
|
+
* Fix MCP configuration for a tool (reinstall)
|
|
666
|
+
*/
|
|
667
|
+
async fixMcp(tool, options) {
|
|
668
|
+
return (await this.host(tool)).fixMcp({
|
|
669
|
+
global: options?.global ?? true,
|
|
670
|
+
projectDir: options?.projectDir,
|
|
671
|
+
authToken: options?.authToken,
|
|
672
|
+
dryRun: options?.dryRun ?? false
|
|
673
|
+
});
|
|
674
|
+
}
|
|
675
|
+
// =========================================================================
|
|
676
|
+
// HOOKS
|
|
677
|
+
// =========================================================================
|
|
678
|
+
/**
|
|
679
|
+
* Install hooks for a tool
|
|
680
|
+
*/
|
|
681
|
+
async installHooks(options) {
|
|
682
|
+
return (await this.host(options.tool)).installHooks({
|
|
683
|
+
global: options.global ?? true,
|
|
684
|
+
projectDir: options.projectDir,
|
|
685
|
+
dryRun: options.dryRun ?? false,
|
|
686
|
+
force: options.force ?? false,
|
|
687
|
+
hooks: options.hooks,
|
|
688
|
+
vibesPath: options.vibesPath
|
|
689
|
+
});
|
|
690
|
+
}
|
|
691
|
+
/**
|
|
692
|
+
* Uninstall hooks for a tool
|
|
693
|
+
*/
|
|
694
|
+
async uninstallHooks(tool, global, projectDir) {
|
|
695
|
+
return (await this.host(tool)).uninstallHooks(global ?? true, projectDir);
|
|
696
|
+
}
|
|
697
|
+
/**
|
|
698
|
+
* List installed hooks for a tool: the entries of its hooks directory, read
|
|
699
|
+
* through the runtime filesystem (`[]` when the host has none or it is absent).
|
|
700
|
+
*/
|
|
701
|
+
async listHooks(tool, global, projectDir) {
|
|
702
|
+
const dir = (await this.host(tool)).getHooksDir(global ?? true, projectDir);
|
|
703
|
+
if (!dir)
|
|
704
|
+
return [];
|
|
705
|
+
return listNamesIfPresent(await externalFileSystem(this.runtime), dir);
|
|
706
|
+
}
|
|
707
|
+
/**
|
|
708
|
+
* Get hooks directory for a tool
|
|
709
|
+
*/
|
|
710
|
+
async hooksDir(tool, global, projectDir) {
|
|
711
|
+
return (await this.host(tool)).getHooksDir(global ?? true, projectDir) ?? null;
|
|
712
|
+
}
|
|
713
|
+
/**
|
|
714
|
+
* Call a hook event (unified handler)
|
|
715
|
+
*/
|
|
716
|
+
async callHook(event, target, caller) {
|
|
717
|
+
// Through invokeTool like every surface: validated input (`target`, not the
|
|
718
|
+
// old `toolId` the schema rejected), hook-bus events, and the caller as the
|
|
719
|
+
// invocation actor.
|
|
720
|
+
const { invokeTool } = await import('@vibesdotdev/tools/execution/invoke');
|
|
721
|
+
const input = { action: 'hook-call', event };
|
|
722
|
+
if (target)
|
|
723
|
+
input.target = target;
|
|
724
|
+
const ctx = {
|
|
725
|
+
callId: `external-hook-${crypto.randomUUID()}`,
|
|
726
|
+
logger: getLogger('external.hooks', this.runtime)
|
|
727
|
+
};
|
|
728
|
+
if (caller)
|
|
729
|
+
ctx.caller = caller;
|
|
730
|
+
const result = await invokeTool({
|
|
731
|
+
runtime: this.runtime,
|
|
732
|
+
toolId: 'external',
|
|
733
|
+
input,
|
|
734
|
+
ctx
|
|
735
|
+
});
|
|
736
|
+
return { success: true, message: ToolReceiptSchema.parse(result).message };
|
|
737
|
+
}
|
|
738
|
+
// =========================================================================
|
|
739
|
+
// SKILLS
|
|
740
|
+
// =========================================================================
|
|
741
|
+
/**
|
|
742
|
+
* Generate skills for a tool
|
|
743
|
+
*/
|
|
744
|
+
async generateSkills(options) {
|
|
745
|
+
return (await this.host(options.tool)).generateSkills({
|
|
746
|
+
global: options.global ?? true,
|
|
747
|
+
projectDir: options.projectDir,
|
|
748
|
+
outputDir: options.outputDir,
|
|
749
|
+
filter: options.filter,
|
|
750
|
+
dryRun: options.dryRun ?? false,
|
|
751
|
+
includeTools: options.includeTools ?? false
|
|
752
|
+
});
|
|
753
|
+
}
|
|
754
|
+
/**
|
|
755
|
+
* Preview skill names for a tool
|
|
756
|
+
*/
|
|
757
|
+
async previewSkills(_tool, filter,
|
|
758
|
+
/** See {@link GenerateSkillsOptions.includeTools} — empty preview without it. */
|
|
759
|
+
includeTools = false) {
|
|
760
|
+
const { previewSkillNames } = await import('@vibesdotdev/tools/adapters/skill/consumer/node/generator');
|
|
761
|
+
const ids = filter?.length ? filter : undefined;
|
|
762
|
+
return previewSkillNames(this.runtime, ids ? { ids } : undefined, {
|
|
763
|
+
includeTools,
|
|
764
|
+
targetId: _tool
|
|
765
|
+
});
|
|
766
|
+
}
|
|
767
|
+
/**
|
|
768
|
+
* Get skills directory for a tool
|
|
769
|
+
*/
|
|
770
|
+
async skillsDir(tool, global, projectDir) {
|
|
771
|
+
return (await this.host(tool)).getSkillsDir(global ?? true, projectDir) ?? null;
|
|
772
|
+
}
|
|
773
|
+
// =========================================================================
|
|
774
|
+
// FILE ACCESS
|
|
775
|
+
// =========================================================================
|
|
776
|
+
/**
|
|
777
|
+
* Track a file access
|
|
778
|
+
*/
|
|
779
|
+
async trackFileAccess(options) {
|
|
780
|
+
return this.getFileAccessStorage().track(options);
|
|
781
|
+
}
|
|
782
|
+
/**
|
|
783
|
+
* Get file access by ID
|
|
784
|
+
*/
|
|
785
|
+
async getFileAccess(id) {
|
|
786
|
+
return this.getFileAccessStorage().get(id);
|
|
787
|
+
}
|
|
788
|
+
/**
|
|
789
|
+
* Who ELSE recently touched this path — the ambient collision read.
|
|
790
|
+
*
|
|
791
|
+
* Returns at most one entry per peer session (its most recent touch),
|
|
792
|
+
* newest first, already filtered to the recency window and (when the
|
|
793
|
+
* caller supplies its own `workspaceRoot`) to the same workspace.
|
|
794
|
+
*
|
|
795
|
+
* Callers should treat this as best-effort: it exists to inform an edit,
|
|
796
|
+
* never to gate one.
|
|
797
|
+
*/
|
|
798
|
+
async whoElseTouched(input) {
|
|
799
|
+
return this.getFileAccessStorage().whoElseTouched(input);
|
|
800
|
+
}
|
|
801
|
+
/**
|
|
802
|
+
* The roster — every live agent session visible to this linked account.
|
|
803
|
+
*
|
|
804
|
+
* Account provider rows are authoritative across environments. The local
|
|
805
|
+
* touch stream remains an offline/backward-compatible liveness source, but
|
|
806
|
+
* it no longer defines the product boundary by itself. Rows merge by caller
|
|
807
|
+
* seat `(session, participant-or-agent)` and expire at read time, so shared
|
|
808
|
+
* rooms remain distinct and a crashed agent becomes a ghost without a sweep.
|
|
809
|
+
*/
|
|
810
|
+
async roster(input = {}) {
|
|
811
|
+
const now = input.now ?? new Date();
|
|
812
|
+
const since = new Date(now.getTime() - RECENT_WINDOW_MS);
|
|
813
|
+
const current = await announceCurrentAgentSession(this.runtime, now);
|
|
814
|
+
const provider = await resolveAgentRosterProvider(this.runtime);
|
|
815
|
+
const [touches, accountAnnouncements] = await Promise.all([
|
|
816
|
+
this.getFileAccessStorage().recentTouches({ since }),
|
|
817
|
+
provider ? provider.list() : Promise.resolve([])
|
|
818
|
+
]);
|
|
819
|
+
return mergeRosterEntries([
|
|
820
|
+
...rosterFromTouches(touches, {
|
|
821
|
+
now,
|
|
822
|
+
exclude: input.exclude,
|
|
823
|
+
excludeSessionId: input.excludeSessionId
|
|
824
|
+
}),
|
|
825
|
+
...rosterFromAnnouncements(accountAnnouncements, {
|
|
826
|
+
now,
|
|
827
|
+
exclude: input.exclude,
|
|
828
|
+
excludeSessionId: input.excludeSessionId
|
|
829
|
+
}),
|
|
830
|
+
...(current
|
|
831
|
+
? rosterFromAnnouncements([current], {
|
|
832
|
+
now,
|
|
833
|
+
exclude: input.exclude,
|
|
834
|
+
excludeSessionId: input.excludeSessionId
|
|
835
|
+
})
|
|
836
|
+
: [])
|
|
837
|
+
], now);
|
|
838
|
+
}
|
|
839
|
+
/**
|
|
840
|
+
* List file accesses for a session
|
|
841
|
+
*/
|
|
842
|
+
async listFileAccesses(options) {
|
|
843
|
+
return this.getFileAccessStorage().list(options);
|
|
844
|
+
}
|
|
845
|
+
/**
|
|
846
|
+
* Get file access statistics for a session
|
|
847
|
+
*/
|
|
848
|
+
async fileAccessStats(sessionId, limit) {
|
|
849
|
+
return this.getFileAccessStorage().stats(sessionId, limit);
|
|
850
|
+
}
|
|
851
|
+
/**
|
|
852
|
+
* Get file access summary for a session
|
|
853
|
+
*/
|
|
854
|
+
async fileAccessSummary(sessionId) {
|
|
855
|
+
return this.getFileAccessStorage().summary(sessionId);
|
|
856
|
+
}
|
|
857
|
+
/**
|
|
858
|
+
* Delete a file access record
|
|
859
|
+
*/
|
|
860
|
+
async deleteFileAccess(id) {
|
|
861
|
+
return this.getFileAccessStorage().delete(id);
|
|
862
|
+
}
|
|
863
|
+
/**
|
|
864
|
+
* Delete all file accesses for a session
|
|
865
|
+
*/
|
|
866
|
+
async deleteSessionFileAccesses(sessionId) {
|
|
867
|
+
return this.getFileAccessStorage().deleteSession(sessionId);
|
|
868
|
+
}
|
|
869
|
+
/**
|
|
870
|
+
* Cleanup old file accesses
|
|
871
|
+
*/
|
|
872
|
+
async cleanupOldFileAccesses(retentionDays) {
|
|
873
|
+
return this.getFileAccessStorage().cleanup(retentionDays);
|
|
874
|
+
}
|
|
875
|
+
// =========================================================================
|
|
876
|
+
// CONTEXT SUMMARY
|
|
877
|
+
// =========================================================================
|
|
878
|
+
/**
|
|
879
|
+
* Generate a context summary for a session
|
|
880
|
+
*/
|
|
881
|
+
async generateContextSummary(options) {
|
|
882
|
+
const result = await (await this.externalTool()).execute({
|
|
883
|
+
action: 'context-summary',
|
|
884
|
+
sessionId: options.sessionId,
|
|
885
|
+
format: options.format ?? 'markdown',
|
|
886
|
+
maxFiles: options.maxFiles ?? 15,
|
|
887
|
+
includeTodos: options.includeTodos ?? true,
|
|
888
|
+
includeScratchpad: options.includeScratchpad ?? true,
|
|
889
|
+
includeCodeContext: options.includeCodeContext ?? false,
|
|
890
|
+
timeWindowHours: options.timeWindowHours ?? 24,
|
|
891
|
+
customInstructions: options.customInstructions
|
|
892
|
+
});
|
|
893
|
+
return ToolReceiptSchema.parse(result);
|
|
894
|
+
}
|
|
895
|
+
/** The unified `external` tool, admitted against the shape this client calls. */
|
|
896
|
+
async externalTool() {
|
|
897
|
+
const parsed = ExternalToolImplementationSchema.safeParse(await this.runtime.query('tools/tool').withId('external').resolve());
|
|
898
|
+
if (!parsed.success) {
|
|
899
|
+
throw new CapabilityError('The external tool implementation has no execute().', 'INVALID_INPUT', {
|
|
900
|
+
reason: 'external-tool-invalid',
|
|
901
|
+
retryable: false
|
|
902
|
+
});
|
|
903
|
+
}
|
|
904
|
+
return parsed.data;
|
|
905
|
+
}
|
|
906
|
+
// =========================================================================
|
|
907
|
+
// PRESETS
|
|
908
|
+
// =========================================================================
|
|
909
|
+
/**
|
|
910
|
+
* List available presets
|
|
911
|
+
*/
|
|
912
|
+
async listPresets() {
|
|
913
|
+
return listRuntimePresets(this.runtime).map(({ id, name, description }) => ({
|
|
914
|
+
id,
|
|
915
|
+
name,
|
|
916
|
+
description
|
|
917
|
+
}));
|
|
918
|
+
}
|
|
919
|
+
/**
|
|
920
|
+
* Get a preset by ID
|
|
921
|
+
*/
|
|
922
|
+
async getPreset(id) {
|
|
923
|
+
return listRuntimePresets(this.runtime).find((preset) => preset.id === id) ?? null;
|
|
924
|
+
}
|
|
925
|
+
/**
|
|
926
|
+
* Apply a preset
|
|
927
|
+
*/
|
|
928
|
+
async applyPreset(options) {
|
|
929
|
+
const result = await (await this.externalTool()).execute({
|
|
930
|
+
action: 'install',
|
|
931
|
+
preset: options.presetId,
|
|
932
|
+
global: options.global ?? true,
|
|
933
|
+
projectDir: options.projectDir,
|
|
934
|
+
dryRun: options.dryRun ?? false
|
|
935
|
+
});
|
|
936
|
+
return ExecutionResultSchema.parse(result);
|
|
937
|
+
}
|
|
938
|
+
/**
|
|
939
|
+
* Export a preset
|
|
940
|
+
*/
|
|
941
|
+
async exportPreset(id) {
|
|
942
|
+
const preset = await this.getPreset(id);
|
|
943
|
+
if (!preset) {
|
|
944
|
+
throw new CapabilityError(`Preset not found: ${id}`, 'NOT_FOUND', { reason: 'preset-not-found', retryable: false });
|
|
945
|
+
}
|
|
946
|
+
return JSON.stringify(preset, null, 2);
|
|
947
|
+
}
|
|
948
|
+
// =========================================================================
|
|
949
|
+
// CONFIG
|
|
950
|
+
// =========================================================================
|
|
951
|
+
/**
|
|
952
|
+
* Read external config through its config manifest; schema defaults apply
|
|
953
|
+
* when nothing is stored. A runtime composing no External config manifest
|
|
954
|
+
* is refused `NOT_FOUND` `config-manifest-unregistered`.
|
|
955
|
+
*/
|
|
956
|
+
async readConfig() {
|
|
957
|
+
return ConfigManifest.forRuntime(this.runtime, 'external').load();
|
|
958
|
+
}
|
|
959
|
+
/**
|
|
960
|
+
* Write external config through its config manifest.
|
|
961
|
+
*/
|
|
962
|
+
async writeConfig(data) {
|
|
963
|
+
await ConfigManifest.forRuntime(this.runtime, 'external').save(data);
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
// =============================================================================
|
|
967
|
+
// SINGLETON ACCESSOR
|
|
968
|
+
// =============================================================================
|
|
969
|
+
/** Resolve through the kernel on every call; the kernel owns identity and lifetime. */
|
|
970
|
+
export function getVibesExternalClient(runtime) {
|
|
971
|
+
return getVibesClient('external', runtime);
|
|
972
|
+
}
|
|
973
|
+
/**
|
|
974
|
+
* Compatibility entrypoint. The former wrapper-cache reset never reset the
|
|
975
|
+
* kernel client, its lifecycle resources, or stored data. With no wrapper cache,
|
|
976
|
+
* there is nothing to invalidate. Dispose the owning runtime to end its lifetime.
|
|
977
|
+
*/
|
|
978
|
+
export function resetExternalClient(_runtime) { }
|
|
979
|
+
//# sourceMappingURL=external-client.js.map
|