@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,629 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recipe Executor
|
|
3
|
+
*
|
|
4
|
+
* Executes preset recipes step-by-step, handling file operations,
|
|
5
|
+
* command execution, hook installation, and MCP configuration.
|
|
6
|
+
*
|
|
7
|
+
* Files are read and written through the handed runtime's filesystem and
|
|
8
|
+
* commands run through its execution kind as argv (no shell). A step that
|
|
9
|
+
* fails reports it once: `success: false`, a value-free `error` line (a
|
|
10
|
+
* CapabilityError's own message, else the failure's class name and code)
|
|
11
|
+
* and the `failure` facts; a raw error message never reaches the result.
|
|
12
|
+
*/
|
|
13
|
+
import * as z from 'zod/v4';
|
|
14
|
+
import { dirname, isAbsolute, join } from '@vibesdotdev/filesystem';
|
|
15
|
+
import { CapabilityError, CaughtFailureSchema, isCapabilityError, valueFreeFailure } from '@vibesdotdev/kernel';
|
|
16
|
+
import { runCapture } from '@vibesdotdev/kernel/execution';
|
|
17
|
+
import { JsonValueSchema } from '@vibesdotdev/kernel/schemas/json';
|
|
18
|
+
import { getPathRoots } from '@vibesdotdev/paths';
|
|
19
|
+
import { redactCredentials } from '@vibesdotdev/shared/utils';
|
|
20
|
+
import { getVibesClient } from '@vibesdotdev/kernel/client';
|
|
21
|
+
import { resolveExternalCommand } from "../detection/command-probe.js";
|
|
22
|
+
import { parseHostConfig } from "../detection/config-document.js";
|
|
23
|
+
import { runAdapterCodegen } from "../pack/adapter-codegen.js";
|
|
24
|
+
import { parseTomlDocument } from "../utils/toml.js";
|
|
25
|
+
import { externalFileSystem, readTextIfPresent, setFileMode } from "../utils/runtime-fs.js";
|
|
26
|
+
import { backupFiles, describeRestoreError, restoreFiles } from "./file-backup.js";
|
|
27
|
+
import { resolveExternalHostImplementation } from "../external-tool/runtime.js";
|
|
28
|
+
import { resolveExternalSessionId } from "../session-capability.js";
|
|
29
|
+
import { isConfigObject, ownValue, setOwn } from "../plugins/installers/config-value.js";
|
|
30
|
+
import { ExternalOperationDescriptorSchema, resolveExternalRuntimeServices } from "../runtime.js";
|
|
31
|
+
/** Why a command step inherits the user's environment. */
|
|
32
|
+
const COMMAND_INHERIT_REASON = 'A preset command step runs a host tool in the user environment it configures.';
|
|
33
|
+
/** The most command output a step's message carries. */
|
|
34
|
+
const COMMAND_OUTPUT_EXCERPT = 2048;
|
|
35
|
+
// Failure reporting
|
|
36
|
+
/** One line naming a failure without its value: a CapabilityError's message, else class name and code. */
|
|
37
|
+
function failureText(failure) {
|
|
38
|
+
if (failure instanceof Error && isCapabilityError(failure))
|
|
39
|
+
return failure.message;
|
|
40
|
+
const facts = valueFreeFailure(failure);
|
|
41
|
+
return facts.code ? `${facts.name} (${facts.code})` : facts.name;
|
|
42
|
+
}
|
|
43
|
+
function refusal(message, reason, details) {
|
|
44
|
+
const options = { reason, retryable: false };
|
|
45
|
+
if (details !== undefined)
|
|
46
|
+
options.details = details;
|
|
47
|
+
return new CapabilityError(message, 'INVALID_INPUT', options);
|
|
48
|
+
}
|
|
49
|
+
// Variable Interpolation
|
|
50
|
+
function interpolate(template, variables) {
|
|
51
|
+
return template.replace(/\{\{(\w+)\}\}/g, (match, key) => Object.hasOwn(variables, key) ? (variables[key] ?? match) : match);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* A recipe path: `~` is the runtime's `paths/roots` user home, and a relative
|
|
55
|
+
* path is the recipe's project directory, never the executable's cwd.
|
|
56
|
+
*/
|
|
57
|
+
function expandPath(path, ctx) {
|
|
58
|
+
if (path.startsWith('~')) {
|
|
59
|
+
return join(getPathRoots(ctx.runtime).userHome, path.slice(1));
|
|
60
|
+
}
|
|
61
|
+
return isAbsolute(path) ? path : join(ctx.projectDir, path);
|
|
62
|
+
}
|
|
63
|
+
// Step Executors
|
|
64
|
+
async function executeFileWrite(step, ctx) {
|
|
65
|
+
const path = expandPath(interpolate(step.path, ctx.variables), ctx);
|
|
66
|
+
const content = interpolate(step.content, ctx.variables);
|
|
67
|
+
if (ctx.dryRun) {
|
|
68
|
+
return { step: 0, type: 'file-write', success: true, message: `Would write ${path}`, filesCreated: [path], skipped: false };
|
|
69
|
+
}
|
|
70
|
+
try {
|
|
71
|
+
const fs = await externalFileSystem(ctx.runtime);
|
|
72
|
+
if (!step.overwrite && (await fs.exists(path))) {
|
|
73
|
+
return { step: 0, type: 'file-write', success: true, message: `File exists, skipping: ${path}`, skipped: true };
|
|
74
|
+
}
|
|
75
|
+
if (step.createDirs)
|
|
76
|
+
await fs.mkdir(dirname(path), { recursive: true });
|
|
77
|
+
await fs.writeFile(path, content, 'utf-8');
|
|
78
|
+
if (step.mode !== undefined)
|
|
79
|
+
await setFileMode(ctx.runtime, path, step.mode);
|
|
80
|
+
return { step: 0, type: 'file-write', success: true, message: `Created ${path}`, filesCreated: [path] };
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
const failure = CaughtFailureSchema.parse(error);
|
|
84
|
+
return { step: 0, type: 'file-write', success: false, error: failureText(failure), failure: valueFreeFailure(failure) };
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
async function readEditTarget(fs, path, format) {
|
|
88
|
+
if (format === 'yaml') {
|
|
89
|
+
throw new CapabilityError('A yaml file-edit step cannot run: External declares no YAML parser.', 'UNAVAILABLE', {
|
|
90
|
+
reason: 'host-config-format-unsupported',
|
|
91
|
+
retryable: false,
|
|
92
|
+
details: { path, format }
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
const content = (await readTextIfPresent(fs, path)) ?? '';
|
|
96
|
+
return { content, document: content ? parseHostConfig(content, path, format) : {} };
|
|
97
|
+
}
|
|
98
|
+
async function executeFileEdit(step, ctx) {
|
|
99
|
+
const path = expandPath(interpolate(step.path, ctx.variables), ctx);
|
|
100
|
+
if (ctx.dryRun) {
|
|
101
|
+
return { step: 0, type: 'file-edit', success: true, message: `Would edit ${path}`, filesModified: [path], skipped: false };
|
|
102
|
+
}
|
|
103
|
+
try {
|
|
104
|
+
const fs = await externalFileSystem(ctx.runtime);
|
|
105
|
+
// Every input is parsed before anything is written.
|
|
106
|
+
const existing = await readEditTarget(fs, path, step.format);
|
|
107
|
+
const updated = step.format === 'json'
|
|
108
|
+
? JSON.stringify(deepMerge(existing.document, step.merge, step.arrayStrategy), null, 2)
|
|
109
|
+
: mergeTomlDocument(existing.content, materializeTomlPatch(existing.document, step.merge, step.arrayStrategy));
|
|
110
|
+
if (step.format === 'toml')
|
|
111
|
+
parseTomlDocument(updated);
|
|
112
|
+
await fs.mkdir(dirname(path), { recursive: true });
|
|
113
|
+
await fs.writeFile(path, updated, 'utf-8');
|
|
114
|
+
return { step: 0, type: 'file-edit', success: true, message: `Updated ${path}`, filesModified: [path] };
|
|
115
|
+
}
|
|
116
|
+
catch (error) {
|
|
117
|
+
const failure = CaughtFailureSchema.parse(error);
|
|
118
|
+
return { step: 0, type: 'file-edit', success: false, error: failureText(failure), failure: valueFreeFailure(failure) };
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
async function executeCommand(step, ctx) {
|
|
122
|
+
const command = interpolate(step.command, ctx.variables);
|
|
123
|
+
const args = step.args.map((a) => interpolate(a, ctx.variables));
|
|
124
|
+
if (ctx.dryRun) {
|
|
125
|
+
return { step: 0, type: 'command', success: true, message: `Would run: ${command} ${args.join(' ')}` };
|
|
126
|
+
}
|
|
127
|
+
let exitCode;
|
|
128
|
+
let output;
|
|
129
|
+
try {
|
|
130
|
+
const captureOptions = {
|
|
131
|
+
envMode: 'inherit',
|
|
132
|
+
inheritReason: COMMAND_INHERIT_REASON,
|
|
133
|
+
cwd: step.cwd ? expandPath(step.cwd, ctx) : ctx.projectDir
|
|
134
|
+
};
|
|
135
|
+
if (step.env)
|
|
136
|
+
captureOptions.env = step.env;
|
|
137
|
+
const result = await runCapture(ctx.runtime, command, args, captureOptions);
|
|
138
|
+
exitCode = result.exitCode;
|
|
139
|
+
output = step.silent ? '' : redactCredentials(`${result.stdout}${result.stderr}`).slice(-COMMAND_OUTPUT_EXCERPT);
|
|
140
|
+
}
|
|
141
|
+
catch (error) {
|
|
142
|
+
const failure = CaughtFailureSchema.parse(error);
|
|
143
|
+
if (step.allowFailure) {
|
|
144
|
+
return {
|
|
145
|
+
step: 0,
|
|
146
|
+
type: 'command',
|
|
147
|
+
success: true,
|
|
148
|
+
message: `Command failed (allowed): ${failureText(failure)}`,
|
|
149
|
+
failure: valueFreeFailure(failure)
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
return { step: 0, type: 'command', success: false, error: failureText(failure), failure: valueFreeFailure(failure) };
|
|
153
|
+
}
|
|
154
|
+
if (exitCode === 0 || step.allowFailure) {
|
|
155
|
+
return { step: 0, type: 'command', success: true, message: output ? `Executed: ${command}\n${output}` : `Executed: ${command}` };
|
|
156
|
+
}
|
|
157
|
+
return { step: 0, type: 'command', success: false, error: `Command failed with code ${exitCode}` };
|
|
158
|
+
}
|
|
159
|
+
async function executeHookInstall(step, ctx) {
|
|
160
|
+
if (ctx.dryRun) {
|
|
161
|
+
return { step: 0, type: 'hook-install', success: true, message: `Would install hooks: ${step.hooks.join(', ')}` };
|
|
162
|
+
}
|
|
163
|
+
try {
|
|
164
|
+
const externalHost = await resolveExternalHostImplementation(ctx.runtime, step.target);
|
|
165
|
+
const result = await externalHost.installHooks({
|
|
166
|
+
projectDir: ctx.projectDir,
|
|
167
|
+
global: step.global ?? ctx.global,
|
|
168
|
+
vibesPath: interpolate(step.vibesPath, ctx.variables),
|
|
169
|
+
dryRun: false,
|
|
170
|
+
hooks: step.hooks
|
|
171
|
+
});
|
|
172
|
+
return {
|
|
173
|
+
step: 0,
|
|
174
|
+
type: 'hook-install',
|
|
175
|
+
success: result.success,
|
|
176
|
+
message: result.message,
|
|
177
|
+
error: result.error,
|
|
178
|
+
failure: result.failure,
|
|
179
|
+
filesModified: result.registeredSettings ? [result.registeredSettings] : undefined
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
catch (error) {
|
|
183
|
+
const failure = CaughtFailureSchema.parse(error);
|
|
184
|
+
return { step: 0, type: 'hook-install', success: false, error: failureText(failure), failure: valueFreeFailure(failure) };
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
/** The answer of a provider operation, read field by field: one malformed field never hides the others. */
|
|
188
|
+
const OperationOptionsSchema = z.record(z.string(), JsonValueSchema);
|
|
189
|
+
const OperationAnswerSchema = z.object({
|
|
190
|
+
status: z.string().optional().catch(undefined),
|
|
191
|
+
ok: z.boolean().optional().catch(undefined),
|
|
192
|
+
message: z.string().optional().catch(undefined),
|
|
193
|
+
changes: z
|
|
194
|
+
.array(z.object({ path: z.string().optional().catch(undefined) }).catch({}))
|
|
195
|
+
.optional()
|
|
196
|
+
.catch(undefined)
|
|
197
|
+
});
|
|
198
|
+
const ExternalOperationImplementationSchema = z.custom((value) => value instanceof Object && 'execute' in value && Object(value).execute instanceof Function);
|
|
199
|
+
async function executeOperation(step, ctx) {
|
|
200
|
+
try {
|
|
201
|
+
const candidate = ctx.runtime.query('external/operation').withId(step.operationId).descriptors()[0];
|
|
202
|
+
if (candidate === undefined) {
|
|
203
|
+
throw new CapabilityError('The external operation is not registered.', 'NOT_FOUND', {
|
|
204
|
+
reason: 'external-operation-unregistered',
|
|
205
|
+
retryable: false,
|
|
206
|
+
details: { operationId: step.operationId }
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
const descriptor = ExternalOperationDescriptorSchema.parse(candidate);
|
|
210
|
+
if (descriptor.hostId !== ctx.target) {
|
|
211
|
+
throw refusal('The external operation belongs to another host.', 'external-operation-host-mismatch', {
|
|
212
|
+
operationId: step.operationId,
|
|
213
|
+
hostId: descriptor.hostId,
|
|
214
|
+
target: ctx.target
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
const implementation = ExternalOperationImplementationSchema.safeParse(await ctx.runtime.query('external/operation').withId(step.operationId).resolve());
|
|
218
|
+
if (!implementation.success) {
|
|
219
|
+
throw refusal('The external operation implementation has no execute().', 'external-operation-invalid', {
|
|
220
|
+
operationId: step.operationId
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
const rawOptions = { ...step.options, global: ctx.global, dryRun: ctx.dryRun };
|
|
224
|
+
const definedOptions = Object.fromEntries(Object.entries(rawOptions).filter(([, value]) => value !== undefined));
|
|
225
|
+
const parsedOptions = OperationOptionsSchema.safeParse(definedOptions);
|
|
226
|
+
if (!parsedOptions.success) {
|
|
227
|
+
throw refusal('The external operation options are not JSON values.', 'external-operation-options-invalid', {
|
|
228
|
+
operationId: step.operationId
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
const answer = OperationAnswerSchema.safeParse(await implementation.data.execute({ arguments: {}, options: parsedOptions.data }, ctx, await resolveExternalRuntimeServices(ctx.runtime)));
|
|
232
|
+
if (!answer.success) {
|
|
233
|
+
throw refusal('The external operation answered with no result object.', 'external-operation-answer-invalid', {
|
|
234
|
+
operationId: step.operationId
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
const value = answer.data;
|
|
238
|
+
return {
|
|
239
|
+
step: 0,
|
|
240
|
+
type: 'operation',
|
|
241
|
+
success: value.status !== 'error' && value.ok !== false,
|
|
242
|
+
message: value.message ?? `Executed ${step.operationId}`,
|
|
243
|
+
filesModified: (value.changes ?? []).flatMap((change) => (change.path === undefined ? [] : [change.path]))
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
catch (error) {
|
|
247
|
+
const failure = CaughtFailureSchema.parse(error);
|
|
248
|
+
return { step: 0, type: 'operation', success: false, error: failureText(failure), failure: valueFreeFailure(failure) };
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
async function executeFileBackup(step, ctx) {
|
|
252
|
+
const baseDir = expandPath(interpolate(step.baseDir, ctx.variables), ctx);
|
|
253
|
+
const files = step.files.map((f) => interpolate(f, ctx.variables));
|
|
254
|
+
if (ctx.dryRun) {
|
|
255
|
+
return { step: 0, type: 'file-backup', success: true, message: `Would backup ${files.join(', ')} under ${baseDir}`, skipped: false };
|
|
256
|
+
}
|
|
257
|
+
try {
|
|
258
|
+
const result = await backupFiles({
|
|
259
|
+
fs: await externalFileSystem(ctx.runtime),
|
|
260
|
+
baseDir,
|
|
261
|
+
files,
|
|
262
|
+
backupDirName: step.backupDirName,
|
|
263
|
+
dryRun: false
|
|
264
|
+
});
|
|
265
|
+
if (!result) {
|
|
266
|
+
return { step: 0, type: 'file-backup', success: true, message: `No existing files to backup under ${baseDir}`, skipped: true };
|
|
267
|
+
}
|
|
268
|
+
if (step.variable)
|
|
269
|
+
ctx.variables[step.variable] = result.backupDir;
|
|
270
|
+
return {
|
|
271
|
+
step: 0,
|
|
272
|
+
type: 'file-backup',
|
|
273
|
+
success: true,
|
|
274
|
+
message: `Backed up ${result.backedUpFiles.length} file(s) to ${result.backupDir}`,
|
|
275
|
+
filesCreated: [result.backupDir]
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
catch (error) {
|
|
279
|
+
const failure = CaughtFailureSchema.parse(error);
|
|
280
|
+
return { step: 0, type: 'file-backup', success: false, error: failureText(failure), failure: valueFreeFailure(failure) };
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
async function executeFileRestore(step, ctx) {
|
|
284
|
+
const baseDir = expandPath(interpolate(step.baseDir, ctx.variables), ctx);
|
|
285
|
+
const backupDir = step.backupDir ? expandPath(interpolate(step.backupDir, ctx.variables), ctx) : undefined;
|
|
286
|
+
const backupTimestamp = step.backupTimestamp ? interpolate(step.backupTimestamp, ctx.variables) : undefined;
|
|
287
|
+
if (ctx.dryRun) {
|
|
288
|
+
return {
|
|
289
|
+
step: 0,
|
|
290
|
+
type: 'file-restore',
|
|
291
|
+
success: true,
|
|
292
|
+
message: `Would restore into ${baseDir} from ${backupDir ?? backupTimestamp ?? 'latest'}`,
|
|
293
|
+
skipped: false
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
try {
|
|
297
|
+
const result = await restoreFiles({
|
|
298
|
+
fs: await externalFileSystem(ctx.runtime),
|
|
299
|
+
baseDir,
|
|
300
|
+
backupDir,
|
|
301
|
+
backupTimestamp,
|
|
302
|
+
backupDirName: step.backupDirName,
|
|
303
|
+
files: step.files,
|
|
304
|
+
dryRun: false
|
|
305
|
+
});
|
|
306
|
+
const errors = result.errors.map(describeRestoreError).join('; ');
|
|
307
|
+
if (result.errors.length > 0 && result.restored.length === 0) {
|
|
308
|
+
return { step: 0, type: 'file-restore', success: false, error: errors };
|
|
309
|
+
}
|
|
310
|
+
return {
|
|
311
|
+
step: 0,
|
|
312
|
+
type: 'file-restore',
|
|
313
|
+
success: true,
|
|
314
|
+
message: `Restored ${result.restored.length} file(s) from ${result.backupDir}`,
|
|
315
|
+
filesModified: result.restored.map((f) => join(baseDir, f)),
|
|
316
|
+
error: result.errors.length > 0 ? errors : undefined
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
catch (error) {
|
|
320
|
+
const failure = CaughtFailureSchema.parse(error);
|
|
321
|
+
return { step: 0, type: 'file-restore', success: false, error: failureText(failure), failure: valueFreeFailure(failure) };
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
async function executeAdapterCodegen(step, ctx) {
|
|
325
|
+
try {
|
|
326
|
+
const externalHost = await resolveExternalHostImplementation(ctx.runtime, ctx.target);
|
|
327
|
+
const result = await runAdapterCodegen(ctx.runtime, {
|
|
328
|
+
adapterId: step.adapterId,
|
|
329
|
+
projectDir: ctx.projectDir,
|
|
330
|
+
outputDir: step.outputDir,
|
|
331
|
+
tier: step.tier,
|
|
332
|
+
global: step.global,
|
|
333
|
+
dryRun: ctx.dryRun,
|
|
334
|
+
manifest: externalHost.manifest,
|
|
335
|
+
hostId: ctx.target,
|
|
336
|
+
// Comes from the execution context, never from the recipe step:
|
|
337
|
+
// tool→skill projection is retired and only an explicit
|
|
338
|
+
// `--include-tools` request may re-enable it.
|
|
339
|
+
includeTools: ctx.includeTools
|
|
340
|
+
});
|
|
341
|
+
return {
|
|
342
|
+
step: 0,
|
|
343
|
+
type: 'adapter-codegen',
|
|
344
|
+
success: result.success,
|
|
345
|
+
message: result.message,
|
|
346
|
+
filesCreated: result.outputPath ? [result.outputPath] : undefined
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
catch (error) {
|
|
350
|
+
const failure = CaughtFailureSchema.parse(error);
|
|
351
|
+
return { step: 0, type: 'adapter-codegen', success: false, error: failureText(failure), failure: valueFreeFailure(failure) };
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
async function executeMcpConfigure(step, ctx) {
|
|
355
|
+
if (ctx.dryRun) {
|
|
356
|
+
return { step: 0, type: 'mcp-configure', success: true, message: `Would configure MCP server: ${step.serverName}` };
|
|
357
|
+
}
|
|
358
|
+
try {
|
|
359
|
+
const externalHost = await resolveExternalHostImplementation(ctx.runtime, step.target);
|
|
360
|
+
const argumentValue = (flag) => {
|
|
361
|
+
const exactIndex = step.args.indexOf(flag);
|
|
362
|
+
if (exactIndex >= 0 && exactIndex + 1 < step.args.length)
|
|
363
|
+
return step.args[exactIndex + 1];
|
|
364
|
+
return step.args.find((argument) => argument.startsWith(`${flag}=`))?.slice(flag.length + 1);
|
|
365
|
+
};
|
|
366
|
+
// The provider-owned recipe declares the MCP catalog explicitly. `--client`
|
|
367
|
+
// is a legacy host selector, not a catalog declaration; host identity comes
|
|
368
|
+
// from the resolved external/host descriptor instead of an alias table.
|
|
369
|
+
const result = await externalHost.installMcp({
|
|
370
|
+
projectDir: ctx.projectDir,
|
|
371
|
+
global: step.global ?? ctx.global,
|
|
372
|
+
vibesPath: ctx.vibesPath,
|
|
373
|
+
dryRun: ctx.dryRun,
|
|
374
|
+
tier: step.tier,
|
|
375
|
+
mcpClientId: argumentValue('--preset')
|
|
376
|
+
});
|
|
377
|
+
return {
|
|
378
|
+
step: 0,
|
|
379
|
+
type: 'mcp-configure',
|
|
380
|
+
success: result.success,
|
|
381
|
+
message: result.message,
|
|
382
|
+
error: result.error,
|
|
383
|
+
filesCreated: result.filesCreated,
|
|
384
|
+
filesModified: result.filesModified
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
catch (error) {
|
|
388
|
+
const failure = CaughtFailureSchema.parse(error);
|
|
389
|
+
return { step: 0, type: 'mcp-configure', success: false, error: failureText(failure), failure: valueFreeFailure(failure) };
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
async function executePrompt(step, ctx) {
|
|
393
|
+
// In non-interactive mode or dry run, use defaults
|
|
394
|
+
if (ctx.dryRun || step.default) {
|
|
395
|
+
if (step.variable && step.default)
|
|
396
|
+
ctx.variables[step.variable] = step.default;
|
|
397
|
+
return { step: 0, type: 'prompt', success: true, message: `Using default: ${step.default || 'yes'}`, skipped: ctx.dryRun };
|
|
398
|
+
}
|
|
399
|
+
// Automated execution skips prompts; an interactive UI would ask here.
|
|
400
|
+
return { step: 0, type: 'prompt', success: true, message: 'Prompt skipped (non-interactive)', skipped: true };
|
|
401
|
+
}
|
|
402
|
+
/** Whether a validate check holds. A check that cannot be answered throws, and the step reports that failure. */
|
|
403
|
+
async function checkHolds(check, target, ctx) {
|
|
404
|
+
switch (check) {
|
|
405
|
+
case 'tool-installed':
|
|
406
|
+
case 'command-available':
|
|
407
|
+
if (!target)
|
|
408
|
+
throw refusal('This validate check needs a target.', 'validate-target-required', { check });
|
|
409
|
+
return (await resolveExternalCommand(ctx.runtime, target)) !== null;
|
|
410
|
+
case 'file-exists':
|
|
411
|
+
if (!target)
|
|
412
|
+
throw refusal('This validate check needs a target.', 'validate-target-required', { check });
|
|
413
|
+
return (await externalFileSystem(ctx.runtime)).exists(expandPath(target, ctx));
|
|
414
|
+
case 'session-active':
|
|
415
|
+
return (await resolveExternalSessionId(ctx.runtime)) !== undefined;
|
|
416
|
+
case 'vibes-authenticated': {
|
|
417
|
+
const account = await getVibesClient('account', ctx.runtime);
|
|
418
|
+
await account.ensureLoaded();
|
|
419
|
+
return account.isAuthenticated();
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
async function executeValidate(step, ctx) {
|
|
424
|
+
const target = step.target ? interpolate(step.target, ctx.variables) : undefined;
|
|
425
|
+
if (ctx.dryRun) {
|
|
426
|
+
return { step: 0, type: 'validate', success: true, message: `Would validate: ${step.check}${target ? ` (${target})` : ''}` };
|
|
427
|
+
}
|
|
428
|
+
let holds;
|
|
429
|
+
try {
|
|
430
|
+
holds = await checkHolds(step.check, target, ctx);
|
|
431
|
+
}
|
|
432
|
+
catch (error) {
|
|
433
|
+
const failure = CaughtFailureSchema.parse(error);
|
|
434
|
+
return { step: 0, type: 'validate', success: false, error: failureText(failure), failure: valueFreeFailure(failure) };
|
|
435
|
+
}
|
|
436
|
+
if (holds)
|
|
437
|
+
return { step: 0, type: 'validate', success: true, message: `Validated: ${step.check}${target ? ` (${target})` : ''}` };
|
|
438
|
+
const message = step.message || `Validation failed: ${step.check}`;
|
|
439
|
+
if (step.fatal)
|
|
440
|
+
return { step: 0, type: 'validate', success: false, error: message };
|
|
441
|
+
return { step: 0, type: 'validate', success: true, message: `${message} (non-fatal)`, skipped: true };
|
|
442
|
+
}
|
|
443
|
+
// Main Executor
|
|
444
|
+
async function executeStep(step, ctx) {
|
|
445
|
+
switch (step.type) {
|
|
446
|
+
case 'file-write':
|
|
447
|
+
return executeFileWrite(step, ctx);
|
|
448
|
+
case 'file-edit':
|
|
449
|
+
return executeFileEdit(step, ctx);
|
|
450
|
+
case 'file-copy':
|
|
451
|
+
return { step: 0, type: 'file-copy', success: true, skipped: true };
|
|
452
|
+
case 'file-backup':
|
|
453
|
+
return executeFileBackup(step, ctx);
|
|
454
|
+
case 'file-restore':
|
|
455
|
+
return executeFileRestore(step, ctx);
|
|
456
|
+
case 'command':
|
|
457
|
+
return executeCommand(step, ctx);
|
|
458
|
+
case 'hook-install':
|
|
459
|
+
return executeHookInstall(step, ctx);
|
|
460
|
+
case 'mcp-configure':
|
|
461
|
+
return executeMcpConfigure(step, ctx);
|
|
462
|
+
case 'adapter-codegen':
|
|
463
|
+
return executeAdapterCodegen(step, ctx);
|
|
464
|
+
case 'operation':
|
|
465
|
+
return executeOperation(step, ctx);
|
|
466
|
+
case 'prompt':
|
|
467
|
+
return executePrompt(step, ctx);
|
|
468
|
+
case 'validate':
|
|
469
|
+
return executeValidate(step, ctx);
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
export async function executeRecipe(recipe, ctx) {
|
|
473
|
+
const results = [];
|
|
474
|
+
const filesCreated = [];
|
|
475
|
+
const filesModified = [];
|
|
476
|
+
// The caller resolves the immutable Vibes command for this invocation.
|
|
477
|
+
// It must override recipe defaults such as `vibesPath: "vibes"` so every
|
|
478
|
+
// projected edge (MCP, hooks, generated assets) executes the same build.
|
|
479
|
+
const variables = { ...recipe.variables, vibesPath: ctx.vibesPath, ...ctx.variables };
|
|
480
|
+
const execCtx = { ...ctx, variables };
|
|
481
|
+
for (const [index, step] of recipe.steps.entries()) {
|
|
482
|
+
const result = await executeStep(step, execCtx);
|
|
483
|
+
result.step = index;
|
|
484
|
+
results.push(result);
|
|
485
|
+
if (result.filesCreated)
|
|
486
|
+
filesCreated.push(...result.filesCreated);
|
|
487
|
+
if (result.filesModified)
|
|
488
|
+
filesModified.push(...result.filesModified);
|
|
489
|
+
// Stop on failure
|
|
490
|
+
if (!result.success) {
|
|
491
|
+
return {
|
|
492
|
+
preset: recipe.id,
|
|
493
|
+
target: ctx.target,
|
|
494
|
+
success: false,
|
|
495
|
+
dryRun: ctx.dryRun,
|
|
496
|
+
steps: results,
|
|
497
|
+
filesCreated,
|
|
498
|
+
filesModified,
|
|
499
|
+
aliasesCreated: [],
|
|
500
|
+
nextSteps: [],
|
|
501
|
+
error: result.error
|
|
502
|
+
};
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
return {
|
|
506
|
+
preset: recipe.id,
|
|
507
|
+
target: ctx.target,
|
|
508
|
+
success: true,
|
|
509
|
+
dryRun: ctx.dryRun,
|
|
510
|
+
steps: results,
|
|
511
|
+
filesCreated,
|
|
512
|
+
filesModified,
|
|
513
|
+
aliasesCreated: [],
|
|
514
|
+
nextSteps: generateNextSteps(ctx.target)
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
// Helpers
|
|
518
|
+
function generateNextSteps(target) {
|
|
519
|
+
return [`Launch: vibes dev external launch ${target}`, 'Start a vibes session: vibes dev session init'];
|
|
520
|
+
}
|
|
521
|
+
function mergeArrays(existing, incoming, strategy) {
|
|
522
|
+
if (strategy === 'append')
|
|
523
|
+
return [...existing, ...incoming];
|
|
524
|
+
if (strategy === 'replace')
|
|
525
|
+
return [...incoming];
|
|
526
|
+
return [...new Set([...existing, ...incoming])];
|
|
527
|
+
}
|
|
528
|
+
/** Deep-merge `source` into a copy of `target`; own keys only, so `__proto__` is an ordinary key. */
|
|
529
|
+
function deepMerge(target, source, strategy = 'merge') {
|
|
530
|
+
const result = {};
|
|
531
|
+
for (const [key, value] of Object.entries(target))
|
|
532
|
+
setOwn(result, key, value);
|
|
533
|
+
for (const [key, incoming] of Object.entries(source)) {
|
|
534
|
+
const current = ownValue(result, key);
|
|
535
|
+
if (Array.isArray(incoming) && Array.isArray(current))
|
|
536
|
+
setOwn(result, key, mergeArrays(current, incoming, strategy));
|
|
537
|
+
else if (isConfigObject(incoming) && isConfigObject(current))
|
|
538
|
+
setOwn(result, key, deepMerge(current, incoming, strategy));
|
|
539
|
+
else
|
|
540
|
+
setOwn(result, key, incoming);
|
|
541
|
+
}
|
|
542
|
+
return result;
|
|
543
|
+
}
|
|
544
|
+
/** The TOML patch a merge writes: arrays combined with the existing value per strategy, tables recursed. */
|
|
545
|
+
function materializeTomlPatch(existing, source, strategy = 'merge') {
|
|
546
|
+
const patch = {};
|
|
547
|
+
for (const [key, incoming] of Object.entries(source)) {
|
|
548
|
+
const current = ownValue(existing, key);
|
|
549
|
+
if (Array.isArray(incoming) && Array.isArray(current))
|
|
550
|
+
setOwn(patch, key, mergeArrays(current, incoming, strategy));
|
|
551
|
+
else if (isConfigObject(incoming))
|
|
552
|
+
setOwn(patch, key, materializeTomlPatch(isConfigObject(current) ? current : {}, incoming, strategy));
|
|
553
|
+
else
|
|
554
|
+
setOwn(patch, key, incoming);
|
|
555
|
+
}
|
|
556
|
+
return patch;
|
|
557
|
+
}
|
|
558
|
+
function mergeTomlDocument(content, patch) {
|
|
559
|
+
const lines = content ? content.split('\n') : [];
|
|
560
|
+
applyTomlPatch(lines, [], patch);
|
|
561
|
+
return lines.join('\n').replace(/\n*$/, '\n');
|
|
562
|
+
}
|
|
563
|
+
function applyTomlPatch(lines, tablePath, patch) {
|
|
564
|
+
for (const [key, value] of Object.entries(patch)) {
|
|
565
|
+
if (isConfigObject(value))
|
|
566
|
+
applyTomlPatch(lines, [...tablePath, key], value);
|
|
567
|
+
else
|
|
568
|
+
upsertTomlValue(lines, tablePath, key, value);
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
function upsertTomlValue(lines, tablePath, key, value) {
|
|
572
|
+
const renderedKey = formatTomlKey(key);
|
|
573
|
+
const renderedLine = `${renderedKey} = ${serializeTomlValue(value)}`;
|
|
574
|
+
const keyPattern = new RegExp(`^\\s*${escapeRegExp(renderedKey)}\\s*=`);
|
|
575
|
+
const tableName = tablePath.map(formatTomlKey).join('.');
|
|
576
|
+
if (tablePath.length === 0) {
|
|
577
|
+
const tableStart = lines.findIndex((line) => parseTomlTableHeader(line) !== undefined);
|
|
578
|
+
const end = tableStart === -1 ? lines.length : tableStart;
|
|
579
|
+
const existingIndex = lines.slice(0, end).findIndex((line) => keyPattern.test(line));
|
|
580
|
+
if (existingIndex !== -1) {
|
|
581
|
+
lines[existingIndex] = renderedLine;
|
|
582
|
+
return;
|
|
583
|
+
}
|
|
584
|
+
lines.splice(end, 0, renderedLine);
|
|
585
|
+
if (tableStart !== -1)
|
|
586
|
+
lines.splice(end + 1, 0, '');
|
|
587
|
+
return;
|
|
588
|
+
}
|
|
589
|
+
const headerIndex = lines.findIndex((line) => parseTomlTableHeader(line) === tableName);
|
|
590
|
+
if (headerIndex === -1) {
|
|
591
|
+
while (lines.at(-1) === '')
|
|
592
|
+
lines.pop();
|
|
593
|
+
if (lines.length > 0)
|
|
594
|
+
lines.push('');
|
|
595
|
+
lines.push(`[${tableName}]`, renderedLine);
|
|
596
|
+
return;
|
|
597
|
+
}
|
|
598
|
+
let end = headerIndex + 1;
|
|
599
|
+
while (end < lines.length && parseTomlTableHeader(lines[end] ?? '') === undefined)
|
|
600
|
+
end++;
|
|
601
|
+
const existingOffset = lines.slice(headerIndex + 1, end).findIndex((line) => keyPattern.test(line));
|
|
602
|
+
if (existingOffset !== -1) {
|
|
603
|
+
lines[headerIndex + 1 + existingOffset] = renderedLine;
|
|
604
|
+
return;
|
|
605
|
+
}
|
|
606
|
+
while (end > headerIndex + 1 && lines[end - 1] === '')
|
|
607
|
+
end--;
|
|
608
|
+
lines.splice(end, 0, renderedLine);
|
|
609
|
+
}
|
|
610
|
+
function parseTomlTableHeader(line) {
|
|
611
|
+
const match = line.trim().match(/^\[\[?([^\]]+)\]\]?(?:\s*#.*)?$/);
|
|
612
|
+
return match?.[1];
|
|
613
|
+
}
|
|
614
|
+
function formatTomlKey(key) {
|
|
615
|
+
return /^[A-Za-z0-9_-]+$/.test(key) ? key : JSON.stringify(key);
|
|
616
|
+
}
|
|
617
|
+
function escapeRegExp(value) {
|
|
618
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
619
|
+
}
|
|
620
|
+
/** A TOML scalar or array; `null` (no TOML spelling) is refused `INVALID_INPUT` `toml-value-unsupported`. */
|
|
621
|
+
function serializeTomlValue(value) {
|
|
622
|
+
if (value === null || isConfigObject(value)) {
|
|
623
|
+
throw refusal('A TOML file-edit value has no TOML spelling (null or a nested table in an array).', 'toml-value-unsupported');
|
|
624
|
+
}
|
|
625
|
+
if (Array.isArray(value))
|
|
626
|
+
return `[${value.map(serializeTomlValue).join(', ')}]`;
|
|
627
|
+
return JSON.stringify(value);
|
|
628
|
+
}
|
|
629
|
+
//# sourceMappingURL=executor.js.map
|