@vibesdotdev/host-bun 0.0.0-stage → 1.0.0-rc.3
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 +222 -2
- package/dist/applet-serve-host/applet-serve-host.impl.bun.d.ts +6 -0
- package/dist/applet-serve-host/applet-serve-host.impl.bun.d.ts.map +1 -0
- package/dist/applet-serve-host/applet-serve-host.impl.bun.js +80 -0
- package/dist/applet-serve-host/applet-serve-host.impl.bun.js.map +1 -0
- package/dist/applet-serve-host/applet-serve-host.plugin.d.ts +22 -0
- package/dist/applet-serve-host/applet-serve-host.plugin.d.ts.map +1 -0
- package/dist/applet-serve-host/applet-serve-host.plugin.js +42 -0
- package/dist/applet-serve-host/applet-serve-host.plugin.js.map +1 -0
- package/dist/applet-serve-host/index.d.ts +7 -0
- package/dist/applet-serve-host/index.d.ts.map +1 -0
- package/dist/applet-serve-host/index.js +7 -0
- package/dist/applet-serve-host/index.js.map +1 -0
- package/dist/applet-serve-host/stylesheet.compiler.d.ts +7 -0
- package/dist/applet-serve-host/stylesheet.compiler.d.ts.map +1 -0
- package/dist/applet-serve-host/stylesheet.compiler.js +63 -0
- package/dist/applet-serve-host/stylesheet.compiler.js.map +1 -0
- package/dist/atlas-migrations/register-atlas-host-migrations.d.ts +21 -0
- package/dist/atlas-migrations/register-atlas-host-migrations.d.ts.map +1 -0
- package/dist/atlas-migrations/register-atlas-host-migrations.js +148 -0
- package/dist/atlas-migrations/register-atlas-host-migrations.js.map +1 -0
- package/dist/buffered-capture.d.ts +4 -0
- package/dist/buffered-capture.d.ts.map +1 -0
- package/dist/buffered-capture.impl.bun.d.ts +18 -0
- package/dist/buffered-capture.impl.bun.d.ts.map +1 -0
- package/dist/buffered-capture.impl.bun.js +148 -0
- package/dist/buffered-capture.impl.bun.js.map +1 -0
- package/dist/buffered-capture.js +5 -0
- package/dist/buffered-capture.js.map +1 -0
- package/dist/bun-environment.impl.bun.d.ts +231 -0
- package/dist/bun-environment.impl.bun.d.ts.map +1 -0
- package/dist/bun-environment.impl.bun.js +352 -0
- package/dist/bun-environment.impl.bun.js.map +1 -0
- package/dist/cache-redis/cache-redis-connector.impl.bun.d.ts +20 -0
- package/dist/cache-redis/cache-redis-connector.impl.bun.d.ts.map +1 -0
- package/dist/cache-redis/cache-redis-connector.impl.bun.js +30 -0
- package/dist/cache-redis/cache-redis-connector.impl.bun.js.map +1 -0
- package/dist/cache-redis/cache-redis-connector.plugin.d.ts +21 -0
- package/dist/cache-redis/cache-redis-connector.plugin.d.ts.map +1 -0
- package/dist/cache-redis/cache-redis-connector.plugin.js +32 -0
- package/dist/cache-redis/cache-redis-connector.plugin.js.map +1 -0
- package/dist/cli-checkout.impl.bun.d.ts +13 -0
- package/dist/cli-checkout.impl.bun.d.ts.map +1 -0
- package/dist/cli-checkout.impl.bun.js +26 -0
- package/dist/cli-checkout.impl.bun.js.map +1 -0
- package/dist/docs/runtime-environment-bun.docs.descriptor.d.ts +19 -0
- package/dist/docs/runtime-environment-bun.docs.descriptor.d.ts.map +1 -0
- package/dist/docs/runtime-environment-bun.docs.descriptor.js +116 -0
- package/dist/docs/runtime-environment-bun.docs.descriptor.js.map +1 -0
- package/dist/filesystem/adapter.impl.bun.d.ts +15 -0
- package/dist/filesystem/adapter.impl.bun.d.ts.map +1 -0
- package/dist/filesystem/adapter.impl.bun.js +11 -0
- package/dist/filesystem/adapter.impl.bun.js.map +1 -0
- package/dist/filesystem/host-primitives.impl.bun.d.ts +12 -0
- package/dist/filesystem/host-primitives.impl.bun.d.ts.map +1 -0
- package/dist/filesystem/host-primitives.impl.bun.js +96 -0
- package/dist/filesystem/host-primitives.impl.bun.js.map +1 -0
- package/dist/filesystem/register.d.ts +12 -0
- package/dist/filesystem/register.d.ts.map +1 -0
- package/dist/filesystem/register.js +6 -0
- package/dist/filesystem/register.js.map +1 -0
- package/dist/filesystem/rooted-exclusive.impl.bun.d.ts +4 -0
- package/dist/filesystem/rooted-exclusive.impl.bun.d.ts.map +1 -0
- package/dist/filesystem/rooted-exclusive.impl.bun.js +135 -0
- package/dist/filesystem/rooted-exclusive.impl.bun.js.map +1 -0
- package/dist/held-launch/abi.impl.bun.d.ts +175 -0
- package/dist/held-launch/abi.impl.bun.d.ts.map +1 -0
- package/dist/held-launch/abi.impl.bun.js +476 -0
- package/dist/held-launch/abi.impl.bun.js.map +1 -0
- package/dist/held-launch/execution.impl.bun.d.ts +48 -0
- package/dist/held-launch/execution.impl.bun.d.ts.map +1 -0
- package/dist/held-launch/execution.impl.bun.js +375 -0
- package/dist/held-launch/execution.impl.bun.js.map +1 -0
- package/dist/held-launch/library.impl.bun.d.ts +23 -0
- package/dist/held-launch/library.impl.bun.d.ts.map +1 -0
- package/dist/held-launch/library.impl.bun.js +178 -0
- package/dist/held-launch/library.impl.bun.js.map +1 -0
- package/dist/held-launch/schemas.d.ts +10 -0
- package/dist/held-launch/schemas.d.ts.map +1 -0
- package/dist/held-launch/schemas.js +3 -0
- package/dist/held-launch/schemas.js.map +1 -0
- package/dist/held-launch/streams.impl.bun.d.ts +38 -0
- package/dist/held-launch/streams.impl.bun.d.ts.map +1 -0
- package/dist/held-launch/streams.impl.bun.js +183 -0
- package/dist/held-launch/streams.impl.bun.js.map +1 -0
- package/dist/host-channel.impl.bun.d.ts +25 -0
- package/dist/host-channel.impl.bun.d.ts.map +1 -0
- package/dist/host-channel.impl.bun.js +40 -0
- package/dist/host-channel.impl.bun.js.map +1 -0
- package/dist/host-client.impl.bun.d.ts +31 -0
- package/dist/host-client.impl.bun.d.ts.map +1 -0
- package/dist/host-client.impl.bun.js +39 -0
- package/dist/host-client.impl.bun.js.map +1 -0
- package/dist/host-credentials.d.ts +38 -0
- package/dist/host-credentials.d.ts.map +1 -0
- package/dist/host-credentials.js +44 -0
- package/dist/host-credentials.js.map +1 -0
- package/dist/host-loader.impl.bun.d.ts +12 -0
- package/dist/host-loader.impl.bun.d.ts.map +1 -0
- package/dist/host-loader.impl.bun.js +83 -0
- package/dist/host-loader.impl.bun.js.map +1 -0
- package/dist/host-signal.impl.bun.d.ts +11 -0
- package/dist/host-signal.impl.bun.d.ts.map +1 -0
- package/dist/host-signal.impl.bun.js +28 -0
- package/dist/host-signal.impl.bun.js.map +1 -0
- package/dist/http-listener.impl.bun.d.ts +8 -0
- package/dist/http-listener.impl.bun.d.ts.map +1 -0
- package/dist/http-listener.impl.bun.js +44 -0
- package/dist/http-listener.impl.bun.js.map +1 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +314 -0
- package/dist/index.js.map +1 -0
- package/dist/local-execution.impl.bun.d.ts +47 -0
- package/dist/local-execution.impl.bun.d.ts.map +1 -0
- package/dist/local-execution.impl.bun.js +150 -0
- package/dist/local-execution.impl.bun.js.map +1 -0
- package/dist/logging/file-host.impl.bun.d.ts +4 -0
- package/dist/logging/file-host.impl.bun.d.ts.map +1 -0
- package/dist/logging/file-host.impl.bun.js +36 -0
- package/dist/logging/file-host.impl.bun.js.map +1 -0
- package/dist/logging/logging.plugin.d.ts +12 -0
- package/dist/logging/logging.plugin.d.ts.map +1 -0
- package/dist/logging/logging.plugin.js +20 -0
- package/dist/logging/logging.plugin.js.map +1 -0
- package/dist/native/held-launch/aarch64-apple-darwin/libvibes_held_launch.dylib +0 -0
- package/dist/native/held-launch/aarch64-apple-darwin/manifest.json +237 -0
- package/dist/native/held-launch/aarch64-apple-darwin/vibes-held-launch +0 -0
- package/dist/native/held-launch/aarch64-unknown-linux-gnu/libvibes_held_launch.so +0 -0
- package/dist/native/held-launch/aarch64-unknown-linux-gnu/manifest.json +237 -0
- package/dist/native/held-launch/aarch64-unknown-linux-gnu/vibes-held-launch +0 -0
- package/dist/native/held-launch/x86_64-apple-darwin/libvibes_held_launch.dylib +0 -0
- package/dist/native/held-launch/x86_64-apple-darwin/manifest.json +237 -0
- package/dist/native/held-launch/x86_64-apple-darwin/vibes-held-launch +0 -0
- package/dist/native/held-launch/x86_64-unknown-linux-gnu/libvibes_held_launch.so +0 -0
- package/dist/native/held-launch/x86_64-unknown-linux-gnu/manifest.json +237 -0
- package/dist/native/held-launch/x86_64-unknown-linux-gnu/vibes-held-launch +0 -0
- package/dist/native-image.consumer.plugin.d.ts +4 -0
- package/dist/native-image.consumer.plugin.d.ts.map +1 -0
- package/dist/native-image.consumer.plugin.js +14 -0
- package/dist/native-image.consumer.plugin.js.map +1 -0
- package/dist/native-image.d.ts +79 -0
- package/dist/native-image.d.ts.map +1 -0
- package/dist/native-image.impl.consumer.d.ts +15 -0
- package/dist/native-image.impl.consumer.d.ts.map +1 -0
- package/dist/native-image.impl.consumer.js +86 -0
- package/dist/native-image.impl.consumer.js.map +1 -0
- package/dist/native-image.js +19 -0
- package/dist/native-image.js.map +1 -0
- package/dist/native-library.consumer.plugin.d.ts +6 -0
- package/dist/native-library.consumer.plugin.d.ts.map +1 -0
- package/dist/native-library.consumer.plugin.js +33 -0
- package/dist/native-library.consumer.plugin.js.map +1 -0
- package/dist/native-library.impl.consumer.d.ts +14 -0
- package/dist/native-library.impl.consumer.d.ts.map +1 -0
- package/dist/native-library.impl.consumer.js +46 -0
- package/dist/native-library.impl.consumer.js.map +1 -0
- package/dist/native-network/index.d.ts +3 -0
- package/dist/native-network/index.d.ts.map +1 -0
- package/dist/native-network/index.js +3 -0
- package/dist/native-network/index.js.map +1 -0
- package/dist/native-network/native-host.d.ts +4 -0
- package/dist/native-network/native-host.d.ts.map +1 -0
- package/dist/native-network/native-host.js +14 -0
- package/dist/native-network/native-host.js.map +1 -0
- package/dist/native-network/native-network.descriptor.d.ts +4 -0
- package/dist/native-network/native-network.descriptor.d.ts.map +1 -0
- package/dist/native-network/native-network.descriptor.js +11 -0
- package/dist/native-network/native-network.descriptor.js.map +1 -0
- package/dist/native-network/native-network.impl.bun.d.ts +19 -0
- package/dist/native-network/native-network.impl.bun.d.ts.map +1 -0
- package/dist/native-network/native-network.impl.bun.js +190 -0
- package/dist/native-network/native-network.impl.bun.js.map +1 -0
- package/dist/native-network/native-network.plugin.d.ts +6 -0
- package/dist/native-network/native-network.plugin.d.ts.map +1 -0
- package/dist/native-network/native-network.plugin.js +27 -0
- package/dist/native-network/native-network.plugin.js.map +1 -0
- package/dist/package-plugins/index.d.ts +11 -0
- package/dist/package-plugins/index.d.ts.map +1 -0
- package/dist/package-plugins/index.js +11 -0
- package/dist/package-plugins/index.js.map +1 -0
- package/dist/package-plugins/package-plugins.capability.bun.d.ts +11 -0
- package/dist/package-plugins/package-plugins.capability.bun.d.ts.map +1 -0
- package/dist/package-plugins/package-plugins.capability.bun.js +14 -0
- package/dist/package-plugins/package-plugins.capability.bun.js.map +1 -0
- package/dist/package-plugins/primitives.impl.bun.d.ts +11 -0
- package/dist/package-plugins/primitives.impl.bun.d.ts.map +1 -0
- package/dist/package-plugins/primitives.impl.bun.js +32 -0
- package/dist/package-plugins/primitives.impl.bun.js.map +1 -0
- package/dist/package-plugins/read-admission.impl.bun.d.ts +11 -0
- package/dist/package-plugins/read-admission.impl.bun.d.ts.map +1 -0
- package/dist/package-plugins/read-admission.impl.bun.js +224 -0
- package/dist/package-plugins/read-admission.impl.bun.js.map +1 -0
- package/dist/package-plugins/schemas.d.ts +28 -0
- package/dist/package-plugins/schemas.d.ts.map +1 -0
- package/dist/package-plugins/schemas.js +3 -0
- package/dist/package-plugins/schemas.js.map +1 -0
- package/dist/process/launch-artifacts.impl.bun.d.ts +11 -0
- package/dist/process/launch-artifacts.impl.bun.d.ts.map +1 -0
- package/dist/process/launch-artifacts.impl.bun.js +25 -0
- package/dist/process/launch-artifacts.impl.bun.js.map +1 -0
- package/dist/process/process-probe.impl.bun.d.ts +15 -0
- package/dist/process/process-probe.impl.bun.d.ts.map +1 -0
- package/dist/process/process-probe.impl.bun.js +35 -0
- package/dist/process/process-probe.impl.bun.js.map +1 -0
- package/dist/process/runtime-process.impl.bun.d.ts +20 -0
- package/dist/process/runtime-process.impl.bun.d.ts.map +1 -0
- package/dist/process/runtime-process.impl.bun.js +42 -0
- package/dist/process/runtime-process.impl.bun.js.map +1 -0
- package/dist/process/schemas.d.ts +9 -0
- package/dist/process/schemas.d.ts.map +1 -0
- package/dist/process/schemas.js +3 -0
- package/dist/process/schemas.js.map +1 -0
- package/dist/process/spawn.impl.bun.d.ts +31 -0
- package/dist/process/spawn.impl.bun.d.ts.map +1 -0
- package/dist/process/spawn.impl.bun.js +66 -0
- package/dist/process/spawn.impl.bun.js.map +1 -0
- package/dist/process/which.impl.bun.d.ts +16 -0
- package/dist/process/which.impl.bun.d.ts.map +1 -0
- package/dist/process/which.impl.bun.js +25 -0
- package/dist/process/which.impl.bun.js.map +1 -0
- package/dist/pty.adapter.impl.bun.d.ts +17 -0
- package/dist/pty.adapter.impl.bun.d.ts.map +1 -0
- package/dist/pty.adapter.impl.bun.js +102 -0
- package/dist/pty.adapter.impl.bun.js.map +1 -0
- package/dist/pty.darwin.impl.bun.d.ts +11 -0
- package/dist/pty.darwin.impl.bun.d.ts.map +1 -0
- package/dist/pty.darwin.impl.bun.js +200 -0
- package/dist/pty.darwin.impl.bun.js.map +1 -0
- package/dist/pty.node-host.impl.bun.d.ts +10 -0
- package/dist/pty.node-host.impl.bun.d.ts.map +1 -0
- package/dist/pty.node-host.impl.bun.js +42 -0
- package/dist/pty.node-host.impl.bun.js.map +1 -0
- package/dist/resolution-root.impl.bun.d.ts +170 -0
- package/dist/resolution-root.impl.bun.d.ts.map +1 -0
- package/dist/resolution-root.impl.bun.js +373 -0
- package/dist/resolution-root.impl.bun.js.map +1 -0
- package/dist/restricted-execute.darwin.impl.bun.d.ts +19 -0
- package/dist/restricted-execute.darwin.impl.bun.d.ts.map +1 -0
- package/dist/restricted-execute.darwin.impl.bun.js +459 -0
- package/dist/restricted-execute.darwin.impl.bun.js.map +1 -0
- package/dist/runtime-plugin-host/daemon-execution.worker-shim.bun.d.ts +2 -0
- package/dist/runtime-plugin-host/daemon-execution.worker-shim.bun.d.ts.map +1 -0
- package/dist/runtime-plugin-host/daemon-execution.worker-shim.bun.js +31 -0
- package/dist/runtime-plugin-host/daemon-execution.worker-shim.bun.js.map +1 -0
- package/dist/runtime-plugin-host/host-hot-reload.consumer.d.ts +20 -0
- package/dist/runtime-plugin-host/host-hot-reload.consumer.d.ts.map +1 -0
- package/dist/runtime-plugin-host/host-hot-reload.consumer.js +236 -0
- package/dist/runtime-plugin-host/host-hot-reload.consumer.js.map +1 -0
- package/dist/runtime-plugin-host/hot-plugin-build.worker.consumer.d.ts +2 -0
- package/dist/runtime-plugin-host/hot-plugin-build.worker.consumer.d.ts.map +1 -0
- package/dist/runtime-plugin-host/hot-plugin-build.worker.consumer.js +66 -0
- package/dist/runtime-plugin-host/hot-plugin-build.worker.consumer.js.map +1 -0
- package/dist/runtime-plugin-host/hot-plugin-module.consumer.d.ts +45 -0
- package/dist/runtime-plugin-host/hot-plugin-module.consumer.d.ts.map +1 -0
- package/dist/runtime-plugin-host/hot-plugin-module.consumer.js +490 -0
- package/dist/runtime-plugin-host/hot-plugin-module.consumer.js.map +1 -0
- package/dist/runtime-plugin-host/hot-reload.consumer.d.ts +83 -0
- package/dist/runtime-plugin-host/hot-reload.consumer.d.ts.map +1 -0
- package/dist/runtime-plugin-host/hot-reload.consumer.js +168 -0
- package/dist/runtime-plugin-host/hot-reload.consumer.js.map +1 -0
- package/dist/runtime-plugin-host/reclaim.impl.bun.d.ts +37 -0
- package/dist/runtime-plugin-host/reclaim.impl.bun.d.ts.map +1 -0
- package/dist/runtime-plugin-host/reclaim.impl.bun.js +159 -0
- package/dist/runtime-plugin-host/reclaim.impl.bun.js.map +1 -0
- package/dist/runtime-plugin-host/runtime-plugin-host.impl.bun.d.ts +4 -0
- package/dist/runtime-plugin-host/runtime-plugin-host.impl.bun.d.ts.map +1 -0
- package/dist/runtime-plugin-host/runtime-plugin-host.impl.bun.js +181 -0
- package/dist/runtime-plugin-host/runtime-plugin-host.impl.bun.js.map +1 -0
- package/dist/runtime-plugin-host/runtime-plugin-host.plugin.d.ts +17 -0
- package/dist/runtime-plugin-host/runtime-plugin-host.plugin.d.ts.map +1 -0
- package/dist/runtime-plugin-host/runtime-plugin-host.plugin.js +36 -0
- package/dist/runtime-plugin-host/runtime-plugin-host.plugin.js.map +1 -0
- package/dist/runtime-plugin-host/runtime-thread.impl.bun.d.ts +53 -0
- package/dist/runtime-plugin-host/runtime-thread.impl.bun.d.ts.map +1 -0
- package/dist/runtime-plugin-host/runtime-thread.impl.bun.js +249 -0
- package/dist/runtime-plugin-host/runtime-thread.impl.bun.js.map +1 -0
- package/dist/runtime-plugin-host/runtime-thread.shim.bun.d.ts +2 -0
- package/dist/runtime-plugin-host/runtime-thread.shim.bun.d.ts.map +1 -0
- package/dist/runtime-plugin-host/runtime-thread.shim.bun.js +56 -0
- package/dist/runtime-plugin-host/runtime-thread.shim.bun.js.map +1 -0
- package/dist/runtime-plugin-host/schemas.d.ts +437 -0
- package/dist/runtime-plugin-host/schemas.d.ts.map +1 -0
- package/dist/runtime-plugin-host/schemas.js +54 -0
- package/dist/runtime-plugin-host/schemas.js.map +1 -0
- package/dist/runtime-plugin-host/source-watcher.consumer.d.ts +109 -0
- package/dist/runtime-plugin-host/source-watcher.consumer.d.ts.map +1 -0
- package/dist/runtime-plugin-host/source-watcher.consumer.js +383 -0
- package/dist/runtime-plugin-host/source-watcher.consumer.js.map +1 -0
- package/dist/schemas/environment.d.ts +197 -0
- package/dist/schemas/environment.d.ts.map +1 -0
- package/dist/schemas/environment.js +7 -0
- package/dist/schemas/environment.js.map +1 -0
- package/dist/schemas/host-resources.d.ts +85 -0
- package/dist/schemas/host-resources.d.ts.map +1 -0
- package/dist/schemas/host-resources.js +22 -0
- package/dist/schemas/host-resources.js.map +1 -0
- package/dist/schemas/native-image.d.ts +128 -0
- package/dist/schemas/native-image.d.ts.map +1 -0
- package/dist/schemas/native-image.js +45 -0
- package/dist/schemas/native-image.js.map +1 -0
- package/dist/schemas/native-network.d.ts +56 -0
- package/dist/schemas/native-network.d.ts.map +1 -0
- package/dist/schemas/native-network.js +55 -0
- package/dist/schemas/native-network.js.map +1 -0
- package/dist/schemas/restricted-execute.d.ts +40 -0
- package/dist/schemas/restricted-execute.d.ts.map +1 -0
- package/dist/schemas/restricted-execute.js +14 -0
- package/dist/schemas/restricted-execute.js.map +1 -0
- package/dist/schemas/runtime-socket.d.ts +8 -0
- package/dist/schemas/runtime-socket.d.ts.map +1 -0
- package/dist/schemas/runtime-socket.js +7 -0
- package/dist/schemas/runtime-socket.js.map +1 -0
- package/dist/schemas/self-spawn.d.ts +11 -0
- package/dist/schemas/self-spawn.d.ts.map +1 -0
- package/dist/schemas/self-spawn.js +3 -0
- package/dist/schemas/self-spawn.js.map +1 -0
- package/dist/schemas/standard-output.d.ts +6 -0
- package/dist/schemas/standard-output.d.ts.map +1 -0
- package/dist/schemas/standard-output.js +2 -0
- package/dist/schemas/standard-output.js.map +1 -0
- package/dist/schemas/telemetry.d.ts +25 -0
- package/dist/schemas/telemetry.d.ts.map +1 -0
- package/dist/schemas/telemetry.js +10 -0
- package/dist/schemas/telemetry.js.map +1 -0
- package/dist/schemas/test-environment.d.ts +27 -0
- package/dist/schemas/test-environment.d.ts.map +1 -0
- package/dist/schemas/test-environment.js +2 -0
- package/dist/schemas/test-environment.js.map +1 -0
- package/dist/serve-stall-start.d.ts +8 -0
- package/dist/serve-stall-start.d.ts.map +1 -0
- package/dist/serve-stall-start.js +88 -0
- package/dist/serve-stall-start.js.map +1 -0
- package/dist/serve-stall.d.ts +11 -0
- package/dist/serve-stall.d.ts.map +1 -0
- package/dist/serve-stall.js +19 -0
- package/dist/serve-stall.js.map +1 -0
- package/dist/serve-stall.plugin.d.ts +10 -0
- package/dist/serve-stall.plugin.d.ts.map +1 -0
- package/dist/serve-stall.plugin.js +34 -0
- package/dist/serve-stall.plugin.js.map +1 -0
- package/dist/services/account-home.d.ts +39 -0
- package/dist/services/account-home.d.ts.map +1 -0
- package/dist/services/account-home.js +152 -0
- package/dist/services/account-home.js.map +1 -0
- package/dist/services/cli-process-host.d.ts +50 -0
- package/dist/services/cli-process-host.d.ts.map +1 -0
- package/dist/services/cli-process-host.js +88 -0
- package/dist/services/cli-process-host.js.map +1 -0
- package/dist/services/compatibility-host.impl.bun.d.ts +4 -0
- package/dist/services/compatibility-host.impl.bun.d.ts.map +1 -0
- package/dist/services/compatibility-host.impl.bun.js +24 -0
- package/dist/services/compatibility-host.impl.bun.js.map +1 -0
- package/dist/services/executable-identity.impl.bun.d.ts +164 -0
- package/dist/services/executable-identity.impl.bun.d.ts.map +1 -0
- package/dist/services/executable-identity.impl.bun.js +73 -0
- package/dist/services/executable-identity.impl.bun.js.map +1 -0
- package/dist/services/fatal-signals.impl.bun.d.ts +15 -0
- package/dist/services/fatal-signals.impl.bun.d.ts.map +1 -0
- package/dist/services/fatal-signals.impl.bun.js +61 -0
- package/dist/services/fatal-signals.impl.bun.js.map +1 -0
- package/dist/services/graph-freshness.impl.bun.d.ts +108 -0
- package/dist/services/graph-freshness.impl.bun.d.ts.map +1 -0
- package/dist/services/graph-freshness.impl.bun.js +49 -0
- package/dist/services/graph-freshness.impl.bun.js.map +1 -0
- package/dist/services/host-identity.capability.bun.d.ts +10 -0
- package/dist/services/host-identity.capability.bun.d.ts.map +1 -0
- package/dist/services/host-identity.capability.bun.js +27 -0
- package/dist/services/host-identity.capability.bun.js.map +1 -0
- package/dist/services/host-identity.impl.bun.d.ts +53 -0
- package/dist/services/host-identity.impl.bun.d.ts.map +1 -0
- package/dist/services/host-identity.impl.bun.js +76 -0
- package/dist/services/host-identity.impl.bun.js.map +1 -0
- package/dist/services/host-resources.impl.bun.d.ts +49 -0
- package/dist/services/host-resources.impl.bun.d.ts.map +1 -0
- package/dist/services/host-resources.impl.bun.js +144 -0
- package/dist/services/host-resources.impl.bun.js.map +1 -0
- package/dist/services/http-fetch.impl.bun.d.ts +10 -0
- package/dist/services/http-fetch.impl.bun.d.ts.map +1 -0
- package/dist/services/http-fetch.impl.bun.js +38 -0
- package/dist/services/http-fetch.impl.bun.js.map +1 -0
- package/dist/services/output-plane.impl.bun.d.ts +6 -0
- package/dist/services/output-plane.impl.bun.d.ts.map +1 -0
- package/dist/services/output-plane.impl.bun.js +26 -0
- package/dist/services/output-plane.impl.bun.js.map +1 -0
- package/dist/services/process-action-lifetime.consumer.d.ts +47 -0
- package/dist/services/process-action-lifetime.consumer.d.ts.map +1 -0
- package/dist/services/process-action-lifetime.consumer.js +68 -0
- package/dist/services/process-action-lifetime.consumer.js.map +1 -0
- package/dist/services/process-view.impl.bun.d.ts +18 -0
- package/dist/services/process-view.impl.bun.d.ts.map +1 -0
- package/dist/services/process-view.impl.bun.js +17 -0
- package/dist/services/process-view.impl.bun.js.map +1 -0
- package/dist/services/runtime-host-signals.impl.bun.d.ts +8 -0
- package/dist/services/runtime-host-signals.impl.bun.d.ts.map +1 -0
- package/dist/services/runtime-host-signals.impl.bun.js +29 -0
- package/dist/services/runtime-host-signals.impl.bun.js.map +1 -0
- package/dist/services/runtime-http-listener.impl.bun.d.ts +14 -0
- package/dist/services/runtime-http-listener.impl.bun.d.ts.map +1 -0
- package/dist/services/runtime-http-listener.impl.bun.js +463 -0
- package/dist/services/runtime-http-listener.impl.bun.js.map +1 -0
- package/dist/services/runtime-path.impl.bun.d.ts +16 -0
- package/dist/services/runtime-path.impl.bun.d.ts.map +1 -0
- package/dist/services/runtime-path.impl.bun.js +34 -0
- package/dist/services/runtime-path.impl.bun.js.map +1 -0
- package/dist/services/runtime-scoped-values.impl.bun.d.ts +4 -0
- package/dist/services/runtime-scoped-values.impl.bun.d.ts.map +1 -0
- package/dist/services/runtime-scoped-values.impl.bun.js +7 -0
- package/dist/services/runtime-scoped-values.impl.bun.js.map +1 -0
- package/dist/services/runtime-socket-datagram.impl.bun.d.ts +15 -0
- package/dist/services/runtime-socket-datagram.impl.bun.d.ts.map +1 -0
- package/dist/services/runtime-socket-datagram.impl.bun.js +19 -0
- package/dist/services/runtime-socket-datagram.impl.bun.js.map +1 -0
- package/dist/services/runtime-socket.impl.bun.d.ts +20 -0
- package/dist/services/runtime-socket.impl.bun.d.ts.map +1 -0
- package/dist/services/runtime-socket.impl.bun.js +47 -0
- package/dist/services/runtime-socket.impl.bun.js.map +1 -0
- package/dist/services/runtime-stdio.impl.bun.d.ts +11 -0
- package/dist/services/runtime-stdio.impl.bun.d.ts.map +1 -0
- package/dist/services/runtime-stdio.impl.bun.js +37 -0
- package/dist/services/runtime-stdio.impl.bun.js.map +1 -0
- package/dist/services/self-spawn.impl.bun.d.ts +39 -0
- package/dist/services/self-spawn.impl.bun.d.ts.map +1 -0
- package/dist/services/self-spawn.impl.bun.js +58 -0
- package/dist/services/self-spawn.impl.bun.js.map +1 -0
- package/dist/services/standard-output.d.ts +100 -0
- package/dist/services/standard-output.d.ts.map +1 -0
- package/dist/services/standard-output.js +35 -0
- package/dist/services/standard-output.js.map +1 -0
- package/dist/services/user-environment.impl.bun.d.ts +19 -0
- package/dist/services/user-environment.impl.bun.d.ts.map +1 -0
- package/dist/services/user-environment.impl.bun.js +117 -0
- package/dist/services/user-environment.impl.bun.js.map +1 -0
- package/dist/services/workspace-env.d.ts +30 -0
- package/dist/services/workspace-env.d.ts.map +1 -0
- package/dist/services/workspace-env.js +45 -0
- package/dist/services/workspace-env.js.map +1 -0
- package/dist/services/workspace-root-probe.impl.bun.d.ts +14 -0
- package/dist/services/workspace-root-probe.impl.bun.d.ts.map +1 -0
- package/dist/services/workspace-root-probe.impl.bun.js +27 -0
- package/dist/services/workspace-root-probe.impl.bun.js.map +1 -0
- package/dist/session-members.impl.bun.d.ts +22 -0
- package/dist/session-members.impl.bun.d.ts.map +1 -0
- package/dist/session-members.impl.bun.js +74 -0
- package/dist/session-members.impl.bun.js.map +1 -0
- package/dist/sqlite-driver/index.d.ts +7 -0
- package/dist/sqlite-driver/index.d.ts.map +1 -0
- package/dist/sqlite-driver/index.js +7 -0
- package/dist/sqlite-driver/index.js.map +1 -0
- package/dist/sqlite-driver/sqlite-driver.impl.bun.d.ts +6 -0
- package/dist/sqlite-driver/sqlite-driver.impl.bun.d.ts.map +1 -0
- package/dist/sqlite-driver/sqlite-driver.impl.bun.js +269 -0
- package/dist/sqlite-driver/sqlite-driver.impl.bun.js.map +1 -0
- package/dist/sqlite-driver/sqlite-driver.plugin.d.ts +22 -0
- package/dist/sqlite-driver/sqlite-driver.plugin.d.ts.map +1 -0
- package/dist/sqlite-driver/sqlite-driver.plugin.js +44 -0
- package/dist/sqlite-driver/sqlite-driver.plugin.js.map +1 -0
- package/dist/telemetry/telemetry.d.ts +34 -0
- package/dist/telemetry/telemetry.d.ts.map +1 -0
- package/dist/telemetry/telemetry.js +2 -0
- package/dist/telemetry/telemetry.js.map +1 -0
- package/dist/telemetry/telemetry.plugin.d.ts +4 -0
- package/dist/telemetry/telemetry.plugin.d.ts.map +1 -0
- package/dist/telemetry/telemetry.plugin.js +78 -0
- package/dist/telemetry/telemetry.plugin.js.map +1 -0
- package/dist/terminal-pty-bridge.impl.bun.d.ts +31 -0
- package/dist/terminal-pty-bridge.impl.bun.d.ts.map +1 -0
- package/dist/terminal-pty-bridge.impl.bun.js +333 -0
- package/dist/terminal-pty-bridge.impl.bun.js.map +1 -0
- package/dist/test-tooling/lazy-environment.impl.bun.d.ts +16 -0
- package/dist/test-tooling/lazy-environment.impl.bun.d.ts.map +1 -0
- package/dist/test-tooling/lazy-environment.impl.bun.js +36 -0
- package/dist/test-tooling/lazy-environment.impl.bun.js.map +1 -0
- package/dist/test-tooling/starttls-refusal.d.ts +7 -0
- package/dist/test-tooling/starttls-refusal.d.ts.map +1 -0
- package/dist/test-tooling/starttls-refusal.js +50 -0
- package/dist/test-tooling/starttls-refusal.js.map +1 -0
- package/dist/test-tooling/svelte-client-preload.impl.bun.d.ts +2 -0
- package/dist/test-tooling/svelte-client-preload.impl.bun.d.ts.map +1 -0
- package/dist/test-tooling/svelte-client-preload.impl.bun.js +4 -0
- package/dist/test-tooling/svelte-client-preload.impl.bun.js.map +1 -0
- package/dist/test-tooling/svelte-compiler.impl.bun.d.ts +10 -0
- package/dist/test-tooling/svelte-compiler.impl.bun.d.ts.map +1 -0
- package/dist/test-tooling/svelte-compiler.impl.bun.js +33 -0
- package/dist/test-tooling/svelte-compiler.impl.bun.js.map +1 -0
- package/dist/test-tooling/svelte-server-preload.impl.bun.d.ts +2 -0
- package/dist/test-tooling/svelte-server-preload.impl.bun.d.ts.map +1 -0
- package/dist/test-tooling/svelte-server-preload.impl.bun.js +4 -0
- package/dist/test-tooling/svelte-server-preload.impl.bun.js.map +1 -0
- package/dist/test-tooling/test-environment.impl.bun.d.ts +45 -0
- package/dist/test-tooling/test-environment.impl.bun.d.ts.map +1 -0
- package/dist/test-tooling/test-environment.impl.bun.js +163 -0
- package/dist/test-tooling/test-environment.impl.bun.js.map +1 -0
- package/dist/test-tooling/test-process-root.impl.bun.d.ts +4 -0
- package/dist/test-tooling/test-process-root.impl.bun.d.ts.map +1 -0
- package/dist/test-tooling/test-process-root.impl.bun.js +65 -0
- package/dist/test-tooling/test-process-root.impl.bun.js.map +1 -0
- package/dist/test-tooling/unix-http.impl.bun.d.ts +28 -0
- package/dist/test-tooling/unix-http.impl.bun.d.ts.map +1 -0
- package/dist/test-tooling/unix-http.impl.bun.js +181 -0
- package/dist/test-tooling/unix-http.impl.bun.js.map +1 -0
- package/dist/transpiler/transpiler.plugin.d.ts +10 -0
- package/dist/transpiler/transpiler.plugin.d.ts.map +1 -0
- package/dist/transpiler/transpiler.plugin.js +18 -0
- package/dist/transpiler/transpiler.plugin.js.map +1 -0
- package/native/held-launch/Cargo.toml +23 -0
- package/native/held-launch/abi-manifest.json +234 -0
- package/native/held-launch/src/bin/vibes-held-launch.rs +35 -0
- package/native/held-launch/src/events.rs +99 -0
- package/native/held-launch/src/lib.rs +528 -0
- package/native/held-launch/symbols.golden +21 -0
- package/package.json +313 -4
- package/resources/restricted-supervisor.impl.bun.d.mts +3 -0
- package/resources/restricted-supervisor.impl.bun.mjs +49 -0
- package/resources/serve-stall-watch.impl.bun.d.mts +3 -0
- package/resources/serve-stall-watch.impl.bun.mjs +51 -0
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The resolution root R: the ONE module-graph root a process (or, per
|
|
3
|
+
* ADR-0020, a worker-thread graph) loads every first-party name from.
|
|
4
|
+
*
|
|
5
|
+
* One resolver answers R for the thin shim (`vibes --version`'s `[scope]`) and
|
|
6
|
+
* for the runtime host that authorizes a workspace thread's module root, so the
|
|
7
|
+
* two can never disagree about which graph a workspace runs on.
|
|
8
|
+
*
|
|
9
|
+
* Hard constraint: this module is compiled into the thin shim, whose artifact
|
|
10
|
+
* must contain no framework module (module identity is realpath; a framework
|
|
11
|
+
* copy baked into `/$bunfs` forks the graph). It imports `node:fs`,
|
|
12
|
+
* `node:path` and Bun globals only, and it names no framework package other
|
|
13
|
+
* than the host package it probes for.
|
|
14
|
+
*
|
|
15
|
+
* R is the MODULE-GRAPH root only. This module never computes, reads or
|
|
16
|
+
* publishes workspace identity.
|
|
17
|
+
*/
|
|
18
|
+
import * as z from 'zod/v4';
|
|
19
|
+
/** Package whose presence under a directory makes it a host root. */
|
|
20
|
+
export declare const HOST_PACKAGE_NAME = "@vibesdotdev/plugins";
|
|
21
|
+
/**
|
|
22
|
+
* The shim's probe target: a plain file it can `stat` with no package
|
|
23
|
+
* resolver. `@vibesdotdev/plugins` ships it in `files`, and it trampolines to
|
|
24
|
+
* `src/bun/host.ts` (linked checkout) or `dist/bun/host.js` (registry tarball).
|
|
25
|
+
*/
|
|
26
|
+
export declare const HOST_ENTRY_FILE = "host.mjs";
|
|
27
|
+
/** How R was chosen. `[scope]` in the `--version` line. */
|
|
28
|
+
export type HostScope = 'workspace' | 'bundle' | 'global→hostWorkspace' | 'global';
|
|
29
|
+
export interface RootResolution {
|
|
30
|
+
/** Absolute resolution root R. */
|
|
31
|
+
root: string;
|
|
32
|
+
scope: HostScope;
|
|
33
|
+
source: 'env' | 'walk' | 'bundle' | 'hostWorkspace' | 'home';
|
|
34
|
+
/** Absolute path of the host entry under R, or null when R has no host. */
|
|
35
|
+
hostEntry: string | null;
|
|
36
|
+
/** Directory of the `@vibesdotdev/plugins` package that supplied the entry. */
|
|
37
|
+
hostPackageDir: string | null;
|
|
38
|
+
/** Every workspace candidate seen on the walk, innermost first. */
|
|
39
|
+
candidates: string[];
|
|
40
|
+
}
|
|
41
|
+
export interface ResolveRootInput {
|
|
42
|
+
/** `VIBES_WORKSPACE_PATH ?? cwd` — where the ancestor walk starts. */
|
|
43
|
+
start: string;
|
|
44
|
+
/** `VIBES_HOST_ROOT`: execution custody. A process tree never changes root. */
|
|
45
|
+
hostRootEnv?: string | undefined;
|
|
46
|
+
/** `$VIBES_HOME`. */
|
|
47
|
+
vibesHome: string;
|
|
48
|
+
/** `process.execPath`, for the bundle-adjacent candidate. */
|
|
49
|
+
execPath?: string | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* `compose` forces workspace discovery for this resolution even inside a
|
|
52
|
+
* `$VIBES_HOME` `vibes.ignoreWorkspaceDiscovery` root (`bun vibes-dev`).
|
|
53
|
+
* Absent applies the home's list.
|
|
54
|
+
*/
|
|
55
|
+
workspaceDiscovery?: 'compose' | undefined;
|
|
56
|
+
}
|
|
57
|
+
/** The refusal code and reason a malformed `vibes.ignoreWorkspaceDiscovery` carries. */
|
|
58
|
+
export declare const WORKSPACE_DISCOVERY_IGNORE_INVALID: {
|
|
59
|
+
readonly code: "INVALID_INPUT";
|
|
60
|
+
readonly reason: "workspace-discovery-ignore-invalid";
|
|
61
|
+
};
|
|
62
|
+
export declare const WorkspaceDiscoveryIgnoreListSchema: z.ZodArray<z.ZodString>;
|
|
63
|
+
/**
|
|
64
|
+
* `$VIBES_HOME/package.json#vibes.ignoreWorkspaceDiscovery`, or `[]` when the
|
|
65
|
+
* home declares none. Malformed refuses `WorkspaceDiscoveryIgnoreInvalidError`.
|
|
66
|
+
*/
|
|
67
|
+
export declare function readWorkspaceDiscoveryIgnore(vibesHome: string): string[];
|
|
68
|
+
/** The listed root (real path) that contains `path`, or null. A listed root that does not exist contains nothing. */
|
|
69
|
+
export declare function ignoredDiscoveryRootFor(path: string, roots: readonly string[]): string | null;
|
|
70
|
+
/**
|
|
71
|
+
* The `package.json` fields the resolver reads, parsed at the I/O boundary.
|
|
72
|
+
*
|
|
73
|
+
* Deliberately four fields and nothing else: the resolver must not develop
|
|
74
|
+
* opinions about a manifest it does not own. Sibling `vibes.*` keys (`cli-bin`'s
|
|
75
|
+
* `{visibility}`, `plugins`' `{registry}`, the developer root's `{budgets}`)
|
|
76
|
+
* pass through untouched — a strict schema over the whole `vibes` block would
|
|
77
|
+
* reject every real repository.
|
|
78
|
+
*/
|
|
79
|
+
export interface ShimManifest {
|
|
80
|
+
readonly name: string | null;
|
|
81
|
+
readonly version: string | null;
|
|
82
|
+
readonly workspaces: readonly string[];
|
|
83
|
+
readonly hostWorkspace: string | null;
|
|
84
|
+
}
|
|
85
|
+
/** The four manifest fields at `path`, or null when the file is absent or JSON `null`; a malformed file throws. */
|
|
86
|
+
export declare function readManifest(path: string): ShimManifest | null;
|
|
87
|
+
/**
|
|
88
|
+
* Static parent + scanned pattern of a bun `workspaces` glob. Mirrors the
|
|
89
|
+
* kernel bootstrap's `splitWorkspaceGlob` — this module cannot import it (it is
|
|
90
|
+
* compiled into the thin shim), and R must be the SAME directory both
|
|
91
|
+
* resolvers pick or the process would publish a `VIBES_HOST_ROOT` the
|
|
92
|
+
* framework then disagrees with.
|
|
93
|
+
*/
|
|
94
|
+
export interface WorkspaceGlobParts {
|
|
95
|
+
/** The directory that must exist for the glob to match anything. */
|
|
96
|
+
readonly parent: string;
|
|
97
|
+
/** The pattern scanned beneath `parent`; empty for a literal path. */
|
|
98
|
+
readonly pattern: string;
|
|
99
|
+
}
|
|
100
|
+
export declare function splitWorkspaceGlob(glob: string): WorkspaceGlobParts;
|
|
101
|
+
/**
|
|
102
|
+
* Directory of the member named `HOST_PACKAGE_NAME` among `root`'s `workspaces`
|
|
103
|
+
* globs, or null. Scans manifests directly instead of expanding every member:
|
|
104
|
+
* the developer root's 25 brace globs expand to ~232 manifests and this runs on
|
|
105
|
+
* the `--version` path, which is gated at 50 ms.
|
|
106
|
+
*/
|
|
107
|
+
export declare function findHostMember(root: string, globs: readonly string[]): string | null;
|
|
108
|
+
/**
|
|
109
|
+
* The `@vibesdotdev/plugins` directory `dir` materializes, or null.
|
|
110
|
+
*
|
|
111
|
+
* Two ways, in cost order: installed under `node_modules` (one `existsSync`),
|
|
112
|
+
* or expanded from `package.json#workspaces`. The installed check must come
|
|
113
|
+
* first — it is what keeps the ancestor walk cheap on a machine whose root
|
|
114
|
+
* carries 25 globs.
|
|
115
|
+
*/
|
|
116
|
+
export declare function hostPackageDirAt(dir: string): string | null;
|
|
117
|
+
/**
|
|
118
|
+
* Identify the root of a host that the executable's own module resolver has
|
|
119
|
+
* already selected. This is for installed JS executables, which must declare
|
|
120
|
+
* the graph they actually imported rather than adopting an unrelated cwd or
|
|
121
|
+
* an inherited shim channel. The entry comparison also handles linked source.
|
|
122
|
+
*/
|
|
123
|
+
/**
|
|
124
|
+
* The recovery a refused loaded-host root names. Ownership is refused, never
|
|
125
|
+
* guessed: more than one candidate graph linking the same entry (the linked
|
|
126
|
+
* developer layout) or none containing it. This leaf imports no framework
|
|
127
|
+
* module (the compiled shim carries it), so the refusal is a plain Error whose
|
|
128
|
+
* message names the cause and this hint, as `./cli-checkout` refuses.
|
|
129
|
+
*/
|
|
130
|
+
export declare const LOADED_HOST_ROOT_RECOVERY = "Run it through the vibes shim, or start the host with an explicit host.root (the directory whose node_modules supplies the framework).";
|
|
131
|
+
export declare function resolveLoadedHostRoot(input: {
|
|
132
|
+
start: string;
|
|
133
|
+
hostEntry: string;
|
|
134
|
+
}): string;
|
|
135
|
+
/** Declare the actual loaded graph and re-entry command for a Bun JS executable. */
|
|
136
|
+
export declare function loadedCliHostDeclaration(input: {
|
|
137
|
+
scriptUrl: string;
|
|
138
|
+
hostEntryUrl: string;
|
|
139
|
+
}): {
|
|
140
|
+
root: string;
|
|
141
|
+
selfSpawn: {
|
|
142
|
+
argv: string[];
|
|
143
|
+
source: "bun-source";
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
/**
|
|
147
|
+
* The Desktop bundle's root (plan §2.2 step 2c, critic HIGH).
|
|
148
|
+
* `bridge-native/scripts/bundle-macos.ts` copies the binary to
|
|
149
|
+
* `Contents/Resources/bin/vibes` and `verify-packaged-runtime-macos.ts` runs it
|
|
150
|
+
* against a fresh temp `VIBES_HOME` and a `plugins: []` workspace, requiring PM
|
|
151
|
+
* self-spawn to re-enter the bundled binary. Without this candidate that is an
|
|
152
|
+
* exit 78 — or, worse, a network install inside a packaged app.
|
|
153
|
+
*/
|
|
154
|
+
export declare function bundleAdjacentRoot(execPath: string | undefined): string | null;
|
|
155
|
+
/**
|
|
156
|
+
* Resolve R for this module graph — ONE resolution root per graph, plan §2.2
|
|
157
|
+
* step 2 as amended by ADR-0020 decision 3.
|
|
158
|
+
*
|
|
159
|
+
* (a) `VIBES_HOST_ROOT` (execution custody: a process tree never changes root
|
|
160
|
+
* mid-life); (b) the OUTERMOST ancestor of `start` that materializes the host
|
|
161
|
+
* package — outermost, so a nested provider checkout (`repos/platform/framework`
|
|
162
|
+
* has its own `.git` and `workspaces: ['*']`) resolves to the developer root
|
|
163
|
+
* that links it instead of forking a second graph; (c) the bundle-adjacent
|
|
164
|
+
* home; (d) `$VIBES_HOME/package.json#vibes.hostWorkspace`, same lookup there;
|
|
165
|
+
* (e) `$VIBES_HOME` itself. Step (b) skips every candidate inside a
|
|
166
|
+
* `$VIBES_HOME` `vibes.ignoreWorkspaceDiscovery` root unless the caller
|
|
167
|
+
* declares `workspaceDiscovery: 'compose'`.
|
|
168
|
+
*/
|
|
169
|
+
export declare function resolveResolutionRoot(input: ResolveRootInput): RootResolution;
|
|
170
|
+
//# sourceMappingURL=resolution-root.impl.bun.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolution-root.impl.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;;;;EAM1F;AAQD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAQ9E;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,gBAAgB,GAAG,cAAc,CAyE7E"}
|
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The resolution root R: the ONE module-graph root a process (or, per
|
|
3
|
+
* ADR-0020, a worker-thread graph) loads every first-party name from.
|
|
4
|
+
*
|
|
5
|
+
* One resolver answers R for the thin shim (`vibes --version`'s `[scope]`) and
|
|
6
|
+
* for the runtime host that authorizes a workspace thread's module root, so the
|
|
7
|
+
* two can never disagree about which graph a workspace runs on.
|
|
8
|
+
*
|
|
9
|
+
* Hard constraint: this module is compiled into the thin shim, whose artifact
|
|
10
|
+
* must contain no framework module (module identity is realpath; a framework
|
|
11
|
+
* copy baked into `/$bunfs` forks the graph). It imports `node:fs`,
|
|
12
|
+
* `node:path` and Bun globals only, and it names no framework package other
|
|
13
|
+
* than the host package it probes for.
|
|
14
|
+
*
|
|
15
|
+
* R is the MODULE-GRAPH root only. This module never computes, reads or
|
|
16
|
+
* publishes workspace identity.
|
|
17
|
+
*/
|
|
18
|
+
import { existsSync, readFileSync, realpathSync, statSync } from 'node:fs';
|
|
19
|
+
import { dirname, isAbsolute, join, relative, resolve } from 'node:path';
|
|
20
|
+
import { fileURLToPath } from 'node:url';
|
|
21
|
+
import * as z from 'zod/v4';
|
|
22
|
+
/** Package whose presence under a directory makes it a host root. */
|
|
23
|
+
export const HOST_PACKAGE_NAME = '@vibesdotdev/plugins';
|
|
24
|
+
/**
|
|
25
|
+
* The shim's probe target: a plain file it can `stat` with no package
|
|
26
|
+
* resolver. `@vibesdotdev/plugins` ships it in `files`, and it trampolines to
|
|
27
|
+
* `src/bun/host.ts` (linked checkout) or `dist/bun/host.js` (registry tarball).
|
|
28
|
+
*/
|
|
29
|
+
export const HOST_ENTRY_FILE = 'host.mjs';
|
|
30
|
+
/** The refusal code and reason a malformed `vibes.ignoreWorkspaceDiscovery` carries. */
|
|
31
|
+
export const WORKSPACE_DISCOVERY_IGNORE_INVALID = { code: 'INVALID_INPUT', reason: 'workspace-discovery-ignore-invalid' };
|
|
32
|
+
/**
|
|
33
|
+
* A malformed `$VIBES_HOME/package.json#vibes.ignoreWorkspaceDiscovery`
|
|
34
|
+
* refuses with {@link WORKSPACE_DISCOVERY_IGNORE_INVALID} and the file path
|
|
35
|
+
* (this module compiles into the framework-free shim, so the kernel's
|
|
36
|
+
* CapabilityError is projected by shape). A malformed entry is never dropped.
|
|
37
|
+
*/
|
|
38
|
+
function workspaceDiscoveryIgnoreInvalid(path, issues) {
|
|
39
|
+
return Object.assign(new Error(`[vibes] ${path} vibes.ignoreWorkspaceDiscovery is invalid: ${issues}. Fix or remove the entry (internal org setup writes it).`), { ...WORKSPACE_DISCOVERY_IGNORE_INVALID, details: { path } });
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Mirror of the kernel's `WorkspaceDiscoveryIgnoreListSchema`
|
|
43
|
+
* (`@vibesdotdev/kernel/schemas/package-plugins`): this module compiles into
|
|
44
|
+
* the framework-free shim and cannot import it. `resolution-root.test.ts`
|
|
45
|
+
* holds both to one table of cases.
|
|
46
|
+
*/
|
|
47
|
+
const AbsoluteDirectoryPathSchema = z
|
|
48
|
+
.string()
|
|
49
|
+
.min(1)
|
|
50
|
+
.max(4096)
|
|
51
|
+
.refine((value) => value.trim() === value, { message: 'must not carry leading or trailing whitespace' })
|
|
52
|
+
.refine((value) => Array.from(value).every((character) => character.charCodeAt(0) >= 32 && character.charCodeAt(0) !== 127), {
|
|
53
|
+
message: 'must not contain control characters'
|
|
54
|
+
})
|
|
55
|
+
.refine((value) => value.startsWith('/') || /^[A-Za-z]:[\\/]/.test(value) || value.startsWith('\\\\'), {
|
|
56
|
+
message: 'must be an absolute directory path'
|
|
57
|
+
});
|
|
58
|
+
export const WorkspaceDiscoveryIgnoreListSchema = z.array(AbsoluteDirectoryPathSchema).max(256).superRefine((entries, ctx) => {
|
|
59
|
+
const seen = new Set();
|
|
60
|
+
for (const [index, entry] of entries.entries()) {
|
|
61
|
+
if (seen.has(entry))
|
|
62
|
+
ctx.addIssue({ code: 'custom', path: [index], message: `duplicate root ${entry}` });
|
|
63
|
+
seen.add(entry);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
/**
|
|
67
|
+
* `$VIBES_HOME/package.json#vibes.ignoreWorkspaceDiscovery`, or `[]` when the
|
|
68
|
+
* home declares none. Malformed refuses `WorkspaceDiscoveryIgnoreInvalidError`.
|
|
69
|
+
*/
|
|
70
|
+
export function readWorkspaceDiscoveryIgnore(vibesHome) {
|
|
71
|
+
const path = join(resolve(vibesHome), 'package.json');
|
|
72
|
+
const raw = readJson(path);
|
|
73
|
+
const block = z.object({ vibes: z.object({ ignoreWorkspaceDiscovery: z.unknown() }).loose() }).loose().safeParse(raw);
|
|
74
|
+
const declared = block.success ? block.data.vibes.ignoreWorkspaceDiscovery : undefined;
|
|
75
|
+
if (declared === undefined)
|
|
76
|
+
return [];
|
|
77
|
+
const parsed = WorkspaceDiscoveryIgnoreListSchema.safeParse(declared);
|
|
78
|
+
if (!parsed.success) {
|
|
79
|
+
throw workspaceDiscoveryIgnoreInvalid(path, parsed.error.issues.map((issue) => `[${issue.path.join('.')}] ${issue.message}`).join('; '));
|
|
80
|
+
}
|
|
81
|
+
return parsed.data;
|
|
82
|
+
}
|
|
83
|
+
/** Real path of an existing directory, or null; the filesystem decides case folding and symlinks. */
|
|
84
|
+
function canonicalDirectory(path) {
|
|
85
|
+
return existsSync(path) ? realpathSync(path) : null;
|
|
86
|
+
}
|
|
87
|
+
/** `child` is `parent` or under it; both canonical. */
|
|
88
|
+
function isInside(parent, child) {
|
|
89
|
+
const offset = relative(parent, child);
|
|
90
|
+
return offset === '' || (!isAbsolute(offset) && offset.split(/[\\/]+/)[0] !== '..');
|
|
91
|
+
}
|
|
92
|
+
/** The listed root (real path) that contains `path`, or null. A listed root that does not exist contains nothing. */
|
|
93
|
+
export function ignoredDiscoveryRootFor(path, roots) {
|
|
94
|
+
const target = canonicalDirectory(resolve(path));
|
|
95
|
+
if (target === null)
|
|
96
|
+
return null;
|
|
97
|
+
for (const entry of roots) {
|
|
98
|
+
const root = canonicalDirectory(entry);
|
|
99
|
+
if (root !== null && isInside(root, target))
|
|
100
|
+
return root;
|
|
101
|
+
}
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
/** Any JSON value; `readManifest` narrows it. A missing file reads as null; malformed JSON throws, naming the file. */
|
|
105
|
+
function readJson(path) {
|
|
106
|
+
// Absence is confirmed by the probe; any read failure past it propagates.
|
|
107
|
+
if (!existsSync(path))
|
|
108
|
+
return null;
|
|
109
|
+
const text = readFileSync(path, 'utf8');
|
|
110
|
+
// A malformed manifest on the resolution path is a defect to fix, never a
|
|
111
|
+
// silent non-member: the parse failure propagates, naming the file.
|
|
112
|
+
let value;
|
|
113
|
+
try {
|
|
114
|
+
value = JSON.parse(text);
|
|
115
|
+
}
|
|
116
|
+
catch (error) {
|
|
117
|
+
throw new Error(`Malformed package.json at ${path}`, { cause: error });
|
|
118
|
+
}
|
|
119
|
+
return z.json().parse(value);
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* The four fields, each read on its own: a field of the wrong type reads as
|
|
123
|
+
* null (or `[]`), and a non-object manifest reads as all-empty, exactly as
|
|
124
|
+
* the shim always has. Sibling keys pass through untouched.
|
|
125
|
+
*/
|
|
126
|
+
const ManifestSchema = z.object({
|
|
127
|
+
name: z.string().nullable().catch(null),
|
|
128
|
+
version: z.string().nullable().catch(null),
|
|
129
|
+
workspaces: z.array(z.json()).catch([]).transform((entries) => entries.flatMap((entry) => {
|
|
130
|
+
const value = z.string().safeParse(entry);
|
|
131
|
+
return value.success ? [value.data] : [];
|
|
132
|
+
})),
|
|
133
|
+
vibes: z.object({ hostWorkspace: z.string().nullable().catch(null) }).catch({ hostWorkspace: null })
|
|
134
|
+
}).catch({ name: null, version: null, workspaces: [], vibes: { hostWorkspace: null } });
|
|
135
|
+
/** The four manifest fields at `path`, or null when the file is absent or JSON `null`; a malformed file throws. */
|
|
136
|
+
export function readManifest(path) {
|
|
137
|
+
const raw = readJson(path);
|
|
138
|
+
if (raw === null)
|
|
139
|
+
return null;
|
|
140
|
+
const manifest = ManifestSchema.parse(raw);
|
|
141
|
+
return {
|
|
142
|
+
name: manifest.name ?? null,
|
|
143
|
+
version: manifest.version ?? null,
|
|
144
|
+
workspaces: manifest.workspaces,
|
|
145
|
+
hostWorkspace: manifest.vibes.hostWorkspace ?? null
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
/** `existsSync` confirms absence (including a path through a non-directory); any stat failure past it propagates. */
|
|
149
|
+
function isDirectory(path) {
|
|
150
|
+
return existsSync(path) && statSync(path).isDirectory();
|
|
151
|
+
}
|
|
152
|
+
const GLOB_CHARS = /[*?[\]{}]/;
|
|
153
|
+
export function splitWorkspaceGlob(glob) {
|
|
154
|
+
const segments = glob.split('/');
|
|
155
|
+
const firstGlob = segments.findIndex((segment) => GLOB_CHARS.test(segment));
|
|
156
|
+
if (firstGlob === -1)
|
|
157
|
+
return { parent: glob, pattern: '' };
|
|
158
|
+
return {
|
|
159
|
+
parent: segments.slice(0, firstGlob).join('/') || (isAbsolute(glob) ? '/' : '.'),
|
|
160
|
+
pattern: segments.slice(firstGlob).join('/')
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Directory of the member named `HOST_PACKAGE_NAME` among `root`'s `workspaces`
|
|
165
|
+
* globs, or null. Scans manifests directly instead of expanding every member:
|
|
166
|
+
* the developer root's 25 brace globs expand to ~232 manifests and this runs on
|
|
167
|
+
* the `--version` path, which is gated at 50 ms.
|
|
168
|
+
*/
|
|
169
|
+
export function findHostMember(root, globs) {
|
|
170
|
+
for (const glob of globs) {
|
|
171
|
+
const { parent, pattern } = splitWorkspaceGlob(glob);
|
|
172
|
+
const parentDir = isAbsolute(parent) ? parent : resolve(root, parent);
|
|
173
|
+
if (!isDirectory(parentDir))
|
|
174
|
+
continue;
|
|
175
|
+
const manifestGlob = pattern ? `${pattern}/package.json` : 'package.json';
|
|
176
|
+
// parentDir is a confirmed directory, so a scan failure is a real failure.
|
|
177
|
+
const matches = [...new Bun.Glob(manifestGlob).scanSync({ cwd: parentDir, onlyFiles: true })];
|
|
178
|
+
for (const relative of matches.sort()) {
|
|
179
|
+
const manifestPath = join(parentDir, relative);
|
|
180
|
+
if (readManifest(manifestPath)?.name !== HOST_PACKAGE_NAME)
|
|
181
|
+
continue;
|
|
182
|
+
return dirname(manifestPath);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
return null;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* The `@vibesdotdev/plugins` directory `dir` materializes, or null.
|
|
189
|
+
*
|
|
190
|
+
* Two ways, in cost order: installed under `node_modules` (one `existsSync`),
|
|
191
|
+
* or expanded from `package.json#workspaces`. The installed check must come
|
|
192
|
+
* first — it is what keeps the ancestor walk cheap on a machine whose root
|
|
193
|
+
* carries 25 globs.
|
|
194
|
+
*/
|
|
195
|
+
export function hostPackageDirAt(dir) {
|
|
196
|
+
const manifestPath = join(dir, 'package.json');
|
|
197
|
+
if (!existsSync(manifestPath))
|
|
198
|
+
return null;
|
|
199
|
+
const installed = join(dir, 'node_modules', ...HOST_PACKAGE_NAME.split('/'));
|
|
200
|
+
if (existsSync(join(installed, HOST_ENTRY_FILE)))
|
|
201
|
+
return installed;
|
|
202
|
+
const globs = readManifest(manifestPath)?.workspaces ?? [];
|
|
203
|
+
if (globs.length === 0)
|
|
204
|
+
return null;
|
|
205
|
+
return findHostMember(dir, globs);
|
|
206
|
+
}
|
|
207
|
+
function walkCandidates(start) {
|
|
208
|
+
const found = [];
|
|
209
|
+
let dir = resolve(start);
|
|
210
|
+
for (let depth = 0; depth < 64; depth++) {
|
|
211
|
+
const hostPackageDir = hostPackageDirAt(dir);
|
|
212
|
+
if (hostPackageDir)
|
|
213
|
+
found.push({ dir, hostPackageDir });
|
|
214
|
+
const parent = dirname(dir);
|
|
215
|
+
if (parent === dir)
|
|
216
|
+
break;
|
|
217
|
+
dir = parent;
|
|
218
|
+
}
|
|
219
|
+
return found;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Identify the root of a host that the executable's own module resolver has
|
|
223
|
+
* already selected. This is for installed JS executables, which must declare
|
|
224
|
+
* the graph they actually imported rather than adopting an unrelated cwd or
|
|
225
|
+
* an inherited shim channel. The entry comparison also handles linked source.
|
|
226
|
+
*/
|
|
227
|
+
/**
|
|
228
|
+
* The recovery a refused loaded-host root names. Ownership is refused, never
|
|
229
|
+
* guessed: more than one candidate graph linking the same entry (the linked
|
|
230
|
+
* developer layout) or none containing it. This leaf imports no framework
|
|
231
|
+
* module (the compiled shim carries it), so the refusal is a plain Error whose
|
|
232
|
+
* message names the cause and this hint, as `./cli-checkout` refuses.
|
|
233
|
+
*/
|
|
234
|
+
export const LOADED_HOST_ROOT_RECOVERY = 'Run it through the vibes shim, or start the host with an explicit host.root (the directory whose node_modules supplies the framework).';
|
|
235
|
+
export function resolveLoadedHostRoot(input) {
|
|
236
|
+
const selected = realpathSync(input.hostEntry);
|
|
237
|
+
let match;
|
|
238
|
+
let dir = resolve(input.start);
|
|
239
|
+
for (let depth = 0; depth < 64; depth++) {
|
|
240
|
+
const installed = join(dir, 'node_modules', ...HOST_PACKAGE_NAME.split('/'));
|
|
241
|
+
const packageDir = existsSync(join(installed, 'host-start.mjs')) ? installed : hostPackageDirAt(dir);
|
|
242
|
+
const entry = packageDir && join(packageDir, 'host-start.mjs');
|
|
243
|
+
if (entry && existsSync(entry) && realpathSync(entry) === selected) {
|
|
244
|
+
if (match)
|
|
245
|
+
throw new Error(`The loaded CLI host belongs to multiple candidate graphs (${match} and ${dir}).\n${LOADED_HOST_ROOT_RECOVERY}`);
|
|
246
|
+
match = dir;
|
|
247
|
+
}
|
|
248
|
+
const parent = dirname(dir);
|
|
249
|
+
if (parent === dir)
|
|
250
|
+
break;
|
|
251
|
+
dir = parent;
|
|
252
|
+
}
|
|
253
|
+
if (!match)
|
|
254
|
+
throw new Error(`The loaded CLI host is not present in the executable package graph.\n${LOADED_HOST_ROOT_RECOVERY}`);
|
|
255
|
+
return match;
|
|
256
|
+
}
|
|
257
|
+
/** Declare the actual loaded graph and re-entry command for a Bun JS executable. */
|
|
258
|
+
export function loadedCliHostDeclaration(input) {
|
|
259
|
+
const script = fileURLToPath(input.scriptUrl);
|
|
260
|
+
return {
|
|
261
|
+
root: resolveLoadedHostRoot({ start: dirname(script), hostEntry: fileURLToPath(input.hostEntryUrl) }),
|
|
262
|
+
selfSpawn: { argv: [process.execPath, script], source: 'bun-source' }
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
function entryOf(hostPackageDir) {
|
|
266
|
+
if (!hostPackageDir)
|
|
267
|
+
return null;
|
|
268
|
+
const entry = join(hostPackageDir, HOST_ENTRY_FILE);
|
|
269
|
+
return existsSync(entry) ? entry : null;
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* The Desktop bundle's root (plan §2.2 step 2c, critic HIGH).
|
|
273
|
+
* `bridge-native/scripts/bundle-macos.ts` copies the binary to
|
|
274
|
+
* `Contents/Resources/bin/vibes` and `verify-packaged-runtime-macos.ts` runs it
|
|
275
|
+
* against a fresh temp `VIBES_HOME` and a `plugins: []` workspace, requiring PM
|
|
276
|
+
* self-spawn to re-enter the bundled binary. Without this candidate that is an
|
|
277
|
+
* exit 78 — or, worse, a network install inside a packaged app.
|
|
278
|
+
*/
|
|
279
|
+
export function bundleAdjacentRoot(execPath) {
|
|
280
|
+
if (!execPath)
|
|
281
|
+
return null;
|
|
282
|
+
// A missing executable path keeps its spelling; any realpath failure past the probe propagates.
|
|
283
|
+
const real = existsSync(execPath) ? realpathSync(execPath) : execPath;
|
|
284
|
+
const candidate = resolve(dirname(real), '..', 'vibes-home');
|
|
285
|
+
return existsSync(join(candidate, 'node_modules', ...HOST_PACKAGE_NAME.split('/'), HOST_ENTRY_FILE))
|
|
286
|
+
? candidate
|
|
287
|
+
: null;
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Resolve R for this module graph — ONE resolution root per graph, plan §2.2
|
|
291
|
+
* step 2 as amended by ADR-0020 decision 3.
|
|
292
|
+
*
|
|
293
|
+
* (a) `VIBES_HOST_ROOT` (execution custody: a process tree never changes root
|
|
294
|
+
* mid-life); (b) the OUTERMOST ancestor of `start` that materializes the host
|
|
295
|
+
* package — outermost, so a nested provider checkout (`repos/platform/framework`
|
|
296
|
+
* has its own `.git` and `workspaces: ['*']`) resolves to the developer root
|
|
297
|
+
* that links it instead of forking a second graph; (c) the bundle-adjacent
|
|
298
|
+
* home; (d) `$VIBES_HOME/package.json#vibes.hostWorkspace`, same lookup there;
|
|
299
|
+
* (e) `$VIBES_HOME` itself. Step (b) skips every candidate inside a
|
|
300
|
+
* `$VIBES_HOME` `vibes.ignoreWorkspaceDiscovery` root unless the caller
|
|
301
|
+
* declares `workspaceDiscovery: 'compose'`.
|
|
302
|
+
*/
|
|
303
|
+
export function resolveResolutionRoot(input) {
|
|
304
|
+
const custody = input.hostRootEnv?.trim();
|
|
305
|
+
if (custody) {
|
|
306
|
+
const root = resolve(custody);
|
|
307
|
+
const hostPackageDir = hostPackageDirAt(root);
|
|
308
|
+
return {
|
|
309
|
+
root,
|
|
310
|
+
scope: 'workspace',
|
|
311
|
+
source: 'env',
|
|
312
|
+
hostEntry: entryOf(hostPackageDir),
|
|
313
|
+
hostPackageDir,
|
|
314
|
+
candidates: []
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
// Inside a `vibes.ignoreWorkspaceDiscovery` root the walk does not offer
|
|
318
|
+
// that root's linked graph: R falls through to the bundle or the home, so
|
|
319
|
+
// the installed host runs (the kernel composer skips the workspace's own
|
|
320
|
+
// composition by the same rule). `workspaceDiscovery: 'compose'` keeps it.
|
|
321
|
+
const walked = walkCandidates(input.start);
|
|
322
|
+
const ignore = walked.length > 0 && input.workspaceDiscovery !== 'compose' ? readWorkspaceDiscoveryIgnore(input.vibesHome) : [];
|
|
323
|
+
const candidates = ignore.length === 0 ? walked : walked.filter((candidate) => ignoredDiscoveryRootFor(candidate.dir, ignore) === null);
|
|
324
|
+
if (candidates.length > 0) {
|
|
325
|
+
const outermost = candidates[candidates.length - 1];
|
|
326
|
+
return {
|
|
327
|
+
root: outermost.dir,
|
|
328
|
+
scope: 'workspace',
|
|
329
|
+
source: 'walk',
|
|
330
|
+
hostEntry: entryOf(outermost.hostPackageDir),
|
|
331
|
+
hostPackageDir: outermost.hostPackageDir,
|
|
332
|
+
candidates: candidates.map((c) => c.dir)
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
const bundle = bundleAdjacentRoot(input.execPath);
|
|
336
|
+
if (bundle) {
|
|
337
|
+
const hostPackageDir = hostPackageDirAt(bundle);
|
|
338
|
+
return {
|
|
339
|
+
root: bundle,
|
|
340
|
+
scope: 'bundle',
|
|
341
|
+
source: 'bundle',
|
|
342
|
+
hostEntry: entryOf(hostPackageDir),
|
|
343
|
+
hostPackageDir,
|
|
344
|
+
candidates: []
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
const home = resolve(input.vibesHome);
|
|
348
|
+
const hostWorkspace = readManifest(join(home, 'package.json'))?.hostWorkspace?.trim() ?? '';
|
|
349
|
+
if (hostWorkspace) {
|
|
350
|
+
const delegated = walkCandidates(hostWorkspace);
|
|
351
|
+
const chosen = delegated[delegated.length - 1];
|
|
352
|
+
const root = chosen?.dir ?? resolve(hostWorkspace);
|
|
353
|
+
const hostPackageDir = chosen?.hostPackageDir ?? hostPackageDirAt(root);
|
|
354
|
+
return {
|
|
355
|
+
root,
|
|
356
|
+
scope: 'global→hostWorkspace',
|
|
357
|
+
source: 'hostWorkspace',
|
|
358
|
+
hostEntry: entryOf(hostPackageDir),
|
|
359
|
+
hostPackageDir,
|
|
360
|
+
candidates: delegated.map((c) => c.dir)
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
const hostPackageDir = hostPackageDirAt(home);
|
|
364
|
+
return {
|
|
365
|
+
root: home,
|
|
366
|
+
scope: 'global',
|
|
367
|
+
source: 'home',
|
|
368
|
+
hostEntry: entryOf(hostPackageDir),
|
|
369
|
+
hostPackageDir,
|
|
370
|
+
candidates: []
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
//# sourceMappingURL=resolution-root.impl.bun.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolution-root.impl.bun.js","sourceRoot":"","sources":["../src/resolution-root.impl.bun.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,qEAAqE;AACrE,MAAM,CAAC,MAAM,iBAAiB,GAAG,sBAAsB,CAAC;AAExD;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,UAAU,CAAC;AAmC1C,wFAAwF;AACxF,MAAM,CAAC,MAAM,kCAAkC,GAAG,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,EAAE,oCAAoC,EAAW,CAAC;AAEnI;;;;;GAKG;AACH,SAAS,+BAA+B,CAAC,IAAY,EAAE,MAAc;IACpE,OAAO,MAAM,CAAC,MAAM,CACnB,IAAI,KAAK,CAAC,WAAW,IAAI,+CAA+C,MAAM,2DAA2D,CAAC,EAC1I,EAAE,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,EAAE;KACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type RestrictedHost } from '@vibesdotdev/execution-local';
|
|
2
|
+
import { type RestrictedExecutorOptions, type RestrictedSupervisorResource } from './schemas/restricted-execute.ts';
|
|
3
|
+
import { type RuntimeHostCommandInvocation } from '@vibesdotdev/kernel';
|
|
4
|
+
import { type RestrictedExecuteOptions, type RestrictedExecuteResult } from '@vibesdotdev/kernel/execution';
|
|
5
|
+
/** Capture the selected host command once; absent capability never guesses a runtime. */
|
|
6
|
+
export declare function captureRestrictedSupervisor(invocation: RuntimeHostCommandInvocation | undefined): RuntimeHostCommandInvocation;
|
|
7
|
+
export type { RestrictedEnforcerSpawn, RestrictedExecutorOptions, RestrictedGroupSignal, RestrictedSupervisorResource } from './schemas/restricted-execute.ts';
|
|
8
|
+
/** The one resource the host composes: the packaged supervisor, its bytes embedded, and its pinned hash. */
|
|
9
|
+
export declare const PINNED_SUPERVISOR: RestrictedSupervisorResource;
|
|
10
|
+
/**
|
|
11
|
+
* The executor over one supervisor resource. The host composes only
|
|
12
|
+
* {@link PINNED_SUPERVISOR} with the real group signal; a probe supplies another
|
|
13
|
+
* file or hash to prove the refusals that guard it (tampered bytes, a supervisor
|
|
14
|
+
* inside the writable root), or a group signal that fails to prove the cleanup
|
|
15
|
+
* refusal.
|
|
16
|
+
*/
|
|
17
|
+
export declare function createRestrictedDarwinExecutor(resource: RestrictedSupervisorResource, options?: RestrictedExecutorOptions): (input: RestrictedExecuteOptions, host: RestrictedHost) => Promise<RestrictedExecuteResult>;
|
|
18
|
+
export declare const executeRestrictedDarwin: (input: RestrictedExecuteOptions, host: RestrictedHost) => Promise<RestrictedExecuteResult>;
|
|
19
|
+
//# sourceMappingURL=restricted-execute.darwin.impl.bun.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"restricted-execute.darwin.impl.bun.d.ts","sourceRoot":"","sources":["../src/restricted-execute.darwin.impl.bun.ts"],"names":[],"mappings":"AAYA,OAAO,EAEN,KAAK,cAAc,EACnB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAA+F,KAAK,yBAAyB,EAA8B,KAAK,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AAO7O,OAAO,EAA0D,KAAK,4BAA4B,EAAyB,MAAM,qBAAqB,CAAC;AAEvJ,OAAO,EAEN,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,MAAM,+BAA+B,CAAC;AAiBvC,yFAAyF;AACzF,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,4BAA4B,GAAG,SAAS,GAAG,4BAA4B,CAM9H;AAwKD,YAAY,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AAE/J,4GAA4G;AAC5G,eAAO,MAAM,iBAAiB,EAAE,4BAA2H,CAAC;AAa5J;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAAC,QAAQ,EAAE,4BAA4B,EAAE,OAAO,GAAE,yBAA8B,IAMrH,OAAO,wBAAwB,EAAE,MAAM,cAAc,KAAG,OAAO,CAAC,uBAAuB,CAAC,CAEhG;AAED,eAAO,MAAM,uBAAuB,UAJpB,wBAAwB,QAAQ,cAAc,KAAG,OAAO,CAAC,uBAAuB,CAIR,CAAC"}
|