@vibesdotdev/host-bun 0.0.0-stage → 1.0.0-rc.2
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 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-plugin-host.plugin.js","sourceRoot":"","sources":["../../src/runtime-plugin-host/runtime-plugin-host.plugin.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,2BAA2B,EAAE,mBAAmB,EAAuC,MAAM,qBAAqB,CAAC;AAC5H,OAAO,EAAE,wBAAwB,EAAE,qBAAqB,EAA0B,MAAM,oDAAoD,CAAC;AAE7I,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC7C,EAAE,EAAE,yBAAyB;IAC7B,IAAI,EAAE,wBAAwB;IAC9B,IAAI,EAAE,yBAAyB;IAC/B,WAAW,EAAE,kEAAkE;IAC/E,IAAI,EAAE,KAAK;IACX,QAAQ,EAAE,CAAC,UAAU,CAAC;CACtB,CAAC;AAEF,MAAM,UAAU,4BAA4B,CAAC,OAAmB,EAAE,QAAoE,EAAE;IACvI,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,wBAAwB,CAAC;QAAE,OAAO,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC;IAC5F,OAAO,CAAC,kBAAkB,CAAC,wBAAwB,EAAE,8BAA8B,CAAC,CAAC;IACrF,OAAO,CAAC,cAAc,CAAC,wBAAwB,EAAE,8BAA8B,CAAC,EAAE,EAAE,KAAK,IAAI,EAAE;QAC9F,MAAM,EAAE,0BAA0B,EAAE,GAAG,MAAM,MAAM,CAAC,mCAAmC,CAAC,CAAC;QACzF,OAAO,2BAA2B,CAAC;YAClC,IAAI,EAAE,wBAAwB;YAC9B,EAAE,EAAE,8BAA8B,CAAC,EAAE;YACrC,UAAU,EAAE,EAAE,QAAQ,EAAE,CAAC,UAAU,CAAC,EAAE;YACtC,cAAc,EAAE,0BAA0B,CAAC,KAAK,CAAC;SACjD,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,0BAA0B,GAAkB,mBAAmB,CAAC;IAC5E,EAAE,EAAE,yBAAyB;IAC7B,IAAI,EAAE,yBAAyB;IAC/B,UAAU,CAAC,OAAO;QACjB,4BAA4B,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;CACD,CAAC,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Bun host's runtime threads (`runtime/plugin-host`): a portable boot
|
|
3
|
+
* captured from the running host (`captureRuntimeThreadBoot`), booted again in
|
|
4
|
+
* a native thread through the kernel's one entry (`bootRuntimeThread`), for
|
|
5
|
+
* the thread shim and for a feature's own thread entry alike.
|
|
6
|
+
*/
|
|
7
|
+
import { type OwnedWorkspaceBinding, type RuntimePluginLoader, type VibesRuntime, type WorkspaceComposition } from '@vibesdotdev/kernel';
|
|
8
|
+
import { type PluginSelectionPolicy } from '@vibesdotdev/kernel/bootstrap';
|
|
9
|
+
import type { RuntimeThreadBoot, RuntimeThreadDeclaration } from '@vibesdotdev/kernel/kinds/runtime-plugin-host.kind';
|
|
10
|
+
import type * as z from 'zod/v4';
|
|
11
|
+
import { RuntimeThreadBootSchema } from './schemas.ts';
|
|
12
|
+
/**
|
|
13
|
+
* The owned binding a host thread for `workspaceRoot` boots on:
|
|
14
|
+
* `{ root, cwd: root, moduleRoot: R(root) }`, canonical, with R the resolution
|
|
15
|
+
* root this host authorizes for the workspace. Refuses
|
|
16
|
+
* `runtime-owned-workspace-invalid` when the root is not an existing absolute
|
|
17
|
+
* directory or R cannot be resolved to one.
|
|
18
|
+
*/
|
|
19
|
+
export declare function resolveOwnedWorkspaceBinding(runtime: VibesRuntime, workspaceRoot: string): Promise<OwnedWorkspaceBinding>;
|
|
20
|
+
/** The daemon execution worker shim inside the owned module graph rooted at `moduleRoot`, as a file URL. */
|
|
21
|
+
export declare function resolveOwnedDaemonExecutionShimHref(runtime: VibesRuntime, moduleRoot: string): Promise<string>;
|
|
22
|
+
/**
|
|
23
|
+
* Capture `runtime`'s portable thread boot: the caller's declaration (role,
|
|
24
|
+
* the thread's own scope, its composition) plus the host facts this runtime
|
|
25
|
+
* captured (build surface, host root and the role's self-spawn argv, path
|
|
26
|
+
* roots). A declaration or capture that is not portable refuses before any
|
|
27
|
+
* thread exists.
|
|
28
|
+
*/
|
|
29
|
+
export declare function captureRuntimeThreadBoot(runtime: VibesRuntime, declaration: RuntimeThreadDeclaration): Promise<RuntimeThreadBoot>;
|
|
30
|
+
/** The boot facts a thread entry hands `bootRuntimeThread`, already validated by its own schema. */
|
|
31
|
+
export type RuntimeThreadBootFacts = Pick<z.output<typeof RuntimeThreadBootSchema>, 'scope' | 'buildSurface' | 'host' | 'paths' | 'composition'>;
|
|
32
|
+
/**
|
|
33
|
+
* Boot a thread's runtime through the kernel's one entry: this host's
|
|
34
|
+
* environment from the boot's captured facts, and a workspace composition of
|
|
35
|
+
* the boot's floor ahead of `options.floor` (built in the thread), the boot's
|
|
36
|
+
* global and failure policy, the caller's `options.selectionPolicy` and
|
|
37
|
+
* `options.omitSurfaces` (absent composes every selection and omits no
|
|
38
|
+
* package-declared surface), and its `select` when it declares one. Surface
|
|
39
|
+
* omission is generic package metadata; the host names no package. It binds
|
|
40
|
+
* the thread's default runtime.
|
|
41
|
+
*
|
|
42
|
+
* The thread answers the boot's build surface. First registration wins: a
|
|
43
|
+
* floor that registers its own surface host keeps it (the daemon's CLI host
|
|
44
|
+
* plugin registers the same `boot.buildSurface`); otherwise the thread
|
|
45
|
+
* registers the boot's. The caller owns the returned runtime and disposes it
|
|
46
|
+
* when its work ends.
|
|
47
|
+
*/
|
|
48
|
+
export declare function bootRuntimeThread(boot: RuntimeThreadBootFacts, options?: {
|
|
49
|
+
readonly floor?: readonly RuntimePluginLoader[];
|
|
50
|
+
readonly selectionPolicy?: PluginSelectionPolicy;
|
|
51
|
+
readonly omitSurfaces?: WorkspaceComposition['omitSurfaces'];
|
|
52
|
+
}): Promise<VibesRuntime>;
|
|
53
|
+
//# sourceMappingURL=runtime-thread.impl.bun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E,CAAC;IAChD,QAAQ,CAAC,eAAe,CAAC,EAAE,qBAAqB,CAAC;IACjD,QAAQ,CAAC,YAAY,CAAC,EAAE,oBAAoB,CAAC,cAAc,CAAC,CAAC;CACxD,GACJ,OAAO,CAAC,YAAY,CAAC,CA4CvB"}
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Bun host's runtime threads (`runtime/plugin-host`): a portable boot
|
|
3
|
+
* captured from the running host (`captureRuntimeThreadBoot`), booted again in
|
|
4
|
+
* a native thread through the kernel's one entry (`bootRuntimeThread`), for
|
|
5
|
+
* the thread shim and for a feature's own thread entry alike.
|
|
6
|
+
*/
|
|
7
|
+
import { BUILD_SURFACE_CONTEXT_ID, bootstrapVibesRuntime, CapabilityError, composeBaseEnv, createRuntimePlugin, getRuntimeHostIdentity, getRuntimePackagePlugins, registerBuildSurface } from '@vibesdotdev/kernel';
|
|
8
|
+
import { resolveSelection } from '@vibesdotdev/kernel/bootstrap';
|
|
9
|
+
import { OwnedWorkspaceBindingSchema } from '@vibesdotdev/kernel/schemas/bootstrap';
|
|
10
|
+
import { getPathRoots, getRuntimePath } from '@vibesdotdev/paths';
|
|
11
|
+
import { createRuntimeEnvironmentBunPlugin } from "../index.js";
|
|
12
|
+
import { resolveResolutionRoot } from "../resolution-root.impl.bun.js";
|
|
13
|
+
import { RuntimeThreadBootSchema, RuntimeThreadDeclarationSchema } from "./schemas.js";
|
|
14
|
+
async function canonicalOwnedWorkspaceBinding(runtime, input) {
|
|
15
|
+
const parsed = OwnedWorkspaceBindingSchema.safeParse(input);
|
|
16
|
+
if (!parsed.success) {
|
|
17
|
+
throw new CapabilityError('Owned workspace binding is malformed.', 'INVALID_INPUT', {
|
|
18
|
+
reason: 'runtime-owned-workspace-invalid'
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
const paths = await getRuntimePath(runtime);
|
|
22
|
+
const loader = runtime.environment.loader;
|
|
23
|
+
const canonical = (directory) => {
|
|
24
|
+
if (!paths.isAbsolute(directory) || loader.stat?.(directory) !== 'directory') {
|
|
25
|
+
throw new CapabilityError('Owned workspace roots must be existing absolute directories.', 'INVALID_INPUT', {
|
|
26
|
+
reason: 'runtime-owned-workspace-invalid'
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
const resolved = loader.realPath?.(directory);
|
|
30
|
+
if (!resolved) {
|
|
31
|
+
throw new CapabilityError('This host cannot admit canonical workspace roots.', 'UNAVAILABLE', {
|
|
32
|
+
reason: 'runtime-owned-workspace-unavailable'
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
return resolved;
|
|
36
|
+
};
|
|
37
|
+
const binding = {
|
|
38
|
+
root: canonical(parsed.data.root),
|
|
39
|
+
cwd: canonical(parsed.data.cwd),
|
|
40
|
+
moduleRoot: canonical(parsed.data.moduleRoot)
|
|
41
|
+
};
|
|
42
|
+
const outside = (directory) => {
|
|
43
|
+
const relative = paths.relative(binding.root, directory);
|
|
44
|
+
return paths.isAbsolute(relative) || relative === '..' || relative.startsWith('../') || relative.startsWith('..\\');
|
|
45
|
+
};
|
|
46
|
+
// Boundary, after canonicalization (realpaths):
|
|
47
|
+
// - cwd must be the workspace root or inside it;
|
|
48
|
+
// - moduleRoot may be the workspace root or any directory inside it (a
|
|
49
|
+
// retained graph such as infra-deploy's `root/<moduleRelative>`), OR
|
|
50
|
+
// exactly the ONE resolution root this host authorizes for the workspace
|
|
51
|
+
// (its own install, or `global→hostWorkspace`; ADR-0020 decision 3);
|
|
52
|
+
// - any other external directory refuses `runtime-owned-workspace-invalid`.
|
|
53
|
+
if (outside(binding.cwd) || (outside(binding.moduleRoot) && binding.moduleRoot !== await authorizedModuleRoot(runtime, binding.root))) {
|
|
54
|
+
throw new CapabilityError('Owned cwd and module root must remain inside the retained workspace.', 'INVALID_INPUT', {
|
|
55
|
+
reason: 'runtime-owned-workspace-invalid'
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
return binding;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* The canonical resolution root R this host authorizes for `workspaceRoot`:
|
|
62
|
+
* the same resolver `vibes --version` reports, started at the workspace with
|
|
63
|
+
* this host's vibes home and executable, never this process's own custody
|
|
64
|
+
* (`VIBES_HOST_ROOT`), so a daemon does not authorize its own R for every
|
|
65
|
+
* workspace. Null when R is not an existing directory.
|
|
66
|
+
*/
|
|
67
|
+
async function authorizedModuleRoot(runtime, workspaceRoot) {
|
|
68
|
+
const paths = await getRuntimePath(runtime);
|
|
69
|
+
const loader = runtime.environment.loader;
|
|
70
|
+
const { root } = resolveResolutionRoot({
|
|
71
|
+
start: workspaceRoot,
|
|
72
|
+
vibesHome: getPathRoots(runtime).vibesHome,
|
|
73
|
+
execPath: process.execPath
|
|
74
|
+
});
|
|
75
|
+
if (!paths.isAbsolute(root) || loader.stat?.(root) !== 'directory')
|
|
76
|
+
return null;
|
|
77
|
+
return loader.realPath?.(root) ?? null;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* The owned binding a host thread for `workspaceRoot` boots on:
|
|
81
|
+
* `{ root, cwd: root, moduleRoot: R(root) }`, canonical, with R the resolution
|
|
82
|
+
* root this host authorizes for the workspace. Refuses
|
|
83
|
+
* `runtime-owned-workspace-invalid` when the root is not an existing absolute
|
|
84
|
+
* directory or R cannot be resolved to one.
|
|
85
|
+
*/
|
|
86
|
+
export async function resolveOwnedWorkspaceBinding(runtime, workspaceRoot) {
|
|
87
|
+
// Canonicalize the root first, so R is resolved from the same path the containment check uses.
|
|
88
|
+
const own = await canonicalOwnedWorkspaceBinding(runtime, { root: workspaceRoot, cwd: workspaceRoot, moduleRoot: workspaceRoot });
|
|
89
|
+
const moduleRoot = await authorizedModuleRoot(runtime, own.root);
|
|
90
|
+
if (moduleRoot === null) {
|
|
91
|
+
throw new CapabilityError('The workspace has no resolution root this host can boot.', 'INVALID_INPUT', {
|
|
92
|
+
reason: 'runtime-owned-workspace-invalid'
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
return canonicalOwnedWorkspaceBinding(runtime, { ...own, moduleRoot });
|
|
96
|
+
}
|
|
97
|
+
/** The owned module graph's copy of this host's runtime-thread shim. */
|
|
98
|
+
const RUNTIME_THREAD_SHIM_SPECIFIER = '@vibesdotdev/host-bun/runtime-plugin-host/runtime-thread.shim.bun';
|
|
99
|
+
/** The owned module graph's copy of this host's daemon execution worker shim. */
|
|
100
|
+
const DAEMON_EXECUTION_SHIM_SPECIFIER = '@vibesdotdev/host-bun/runtime-plugin-host/daemon-execution.worker-shim.bun';
|
|
101
|
+
/** The daemon execution worker shim inside the owned module graph rooted at `moduleRoot`, as a file URL. */
|
|
102
|
+
export function resolveOwnedDaemonExecutionShimHref(runtime, moduleRoot) {
|
|
103
|
+
return resolveOwnedShimHref(runtime, moduleRoot, DAEMON_EXECUTION_SHIM_SPECIFIER);
|
|
104
|
+
}
|
|
105
|
+
async function resolveOwnedShimHref(runtime, moduleRoot, specifier) {
|
|
106
|
+
const members = (await getRuntimePackagePlugins(runtime)).expandWorkspaceMembers(moduleRoot);
|
|
107
|
+
const selected = await resolveSelection(runtime, specifier, {
|
|
108
|
+
root: moduleRoot,
|
|
109
|
+
members,
|
|
110
|
+
contained: true
|
|
111
|
+
});
|
|
112
|
+
if ('missing' in selected) {
|
|
113
|
+
throw new CapabilityError('The owned workspace module graph does not contain a matching @vibesdotdev/host-bun runtime thread shim.', 'UNAVAILABLE', {
|
|
114
|
+
reason: 'runtime-thread-shim-unavailable',
|
|
115
|
+
cause: selected.cause
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
const paths = await getRuntimePath(runtime);
|
|
119
|
+
if (!paths.pathToFileURL) {
|
|
120
|
+
throw new CapabilityError('The runtime cannot convert the admitted thread shim path to a file URL.', 'UNAVAILABLE', {
|
|
121
|
+
reason: 'runtime-thread-shim-url-unavailable'
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
return paths.pathToFileURL(selected.realpath).href;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Capture `runtime`'s portable thread boot: the caller's declaration (role,
|
|
128
|
+
* the thread's own scope, its composition) plus the host facts this runtime
|
|
129
|
+
* captured (build surface, host root and the role's self-spawn argv, path
|
|
130
|
+
* roots). A declaration or capture that is not portable refuses before any
|
|
131
|
+
* thread exists.
|
|
132
|
+
*/
|
|
133
|
+
export async function captureRuntimeThreadBoot(runtime, declaration) {
|
|
134
|
+
if (declaration.workspace !== undefined) {
|
|
135
|
+
await canonicalOwnedWorkspaceBinding(runtime, declaration.workspace);
|
|
136
|
+
}
|
|
137
|
+
const declared = RuntimeThreadDeclarationSchema.safeParse(declaration);
|
|
138
|
+
if (!declared.success) {
|
|
139
|
+
throw new CapabilityError('The runtime thread declaration is not portable.', 'INVALID_INPUT', {
|
|
140
|
+
reason: 'runtime-thread-declaration-invalid', cause: declared.error
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
const ownedWorkspace = declared.data.workspace
|
|
144
|
+
? await canonicalOwnedWorkspaceBinding(runtime, declared.data.workspace)
|
|
145
|
+
: undefined;
|
|
146
|
+
const identity = await getRuntimeHostIdentity(runtime);
|
|
147
|
+
const roots = getPathRoots(runtime);
|
|
148
|
+
const scope = ownedWorkspace
|
|
149
|
+
? { ...declared.data.scope, workspace: { ...declared.data.scope.workspace, root: ownedWorkspace.root } }
|
|
150
|
+
: declared.data.scope;
|
|
151
|
+
const parentSelfSpawnSource = runtime.localEnvironment.selfSpawnSource?.() ?? null;
|
|
152
|
+
const host = ownedWorkspace
|
|
153
|
+
? {
|
|
154
|
+
root: ownedWorkspace.moduleRoot,
|
|
155
|
+
cwd: ownedWorkspace.cwd,
|
|
156
|
+
rootCustody: true,
|
|
157
|
+
shimHref: await resolveOwnedShimHref(runtime, ownedWorkspace.moduleRoot, RUNTIME_THREAD_SHIM_SPECIFIER),
|
|
158
|
+
baseEnv: composeBaseEnv(runtime.getEnvSnapshot(), runtime.localEnvironment.getPlatform?.()),
|
|
159
|
+
selfSpawn: parentSelfSpawnSource !== null ? identity.selfSpawnArgv(declared.data.role) : [],
|
|
160
|
+
selfSpawnSource: parentSelfSpawnSource
|
|
161
|
+
}
|
|
162
|
+
: {
|
|
163
|
+
root: identity.hostRoot(),
|
|
164
|
+
selfSpawn: identity.selfSpawnArgv(declared.data.role),
|
|
165
|
+
selfSpawnSource: runtime.localEnvironment.selfSpawnSource?.()
|
|
166
|
+
};
|
|
167
|
+
const boot = RuntimeThreadBootSchema.safeParse({
|
|
168
|
+
version: 1,
|
|
169
|
+
role: declared.data.role,
|
|
170
|
+
scope,
|
|
171
|
+
buildSurface: await runtime.context(BUILD_SURFACE_CONTEXT_ID),
|
|
172
|
+
host,
|
|
173
|
+
paths: {
|
|
174
|
+
vibesHome: roots.vibesHome, profileName: roots.profileName,
|
|
175
|
+
configDir: roots.configDir, logDir: roots.logDir,
|
|
176
|
+
tempDir: roots.tempDir, origin: roots.origin
|
|
177
|
+
},
|
|
178
|
+
composition: declared.data.composition
|
|
179
|
+
});
|
|
180
|
+
if (!boot.success) {
|
|
181
|
+
throw new CapabilityError('The runtime thread host declaration is incomplete.', 'UNAVAILABLE', {
|
|
182
|
+
reason: 'runtime-thread-host-invalid'
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
return boot.data;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Boot a thread's runtime through the kernel's one entry: this host's
|
|
189
|
+
* environment from the boot's captured facts, and a workspace composition of
|
|
190
|
+
* the boot's floor ahead of `options.floor` (built in the thread), the boot's
|
|
191
|
+
* global and failure policy, the caller's `options.selectionPolicy` and
|
|
192
|
+
* `options.omitSurfaces` (absent composes every selection and omits no
|
|
193
|
+
* package-declared surface), and its `select` when it declares one. Surface
|
|
194
|
+
* omission is generic package metadata; the host names no package. It binds
|
|
195
|
+
* the thread's default runtime.
|
|
196
|
+
*
|
|
197
|
+
* The thread answers the boot's build surface. First registration wins: a
|
|
198
|
+
* floor that registers its own surface host keeps it (the daemon's CLI host
|
|
199
|
+
* plugin registers the same `boot.buildSurface`); otherwise the thread
|
|
200
|
+
* registers the boot's. The caller owns the returned runtime and disposes it
|
|
201
|
+
* when its work ends.
|
|
202
|
+
*/
|
|
203
|
+
export async function bootRuntimeThread(boot, options = {}) {
|
|
204
|
+
const source = boot.host.selfSpawnSource;
|
|
205
|
+
if (source === null && !boot.host.rootCustody) {
|
|
206
|
+
throw new CapabilityError('The runtime thread host has no declared self-spawn source.', 'UNAVAILABLE', {
|
|
207
|
+
reason: 'runtime-thread-self-spawn-source-unavailable'
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
const buildSurface = createRuntimePlugin({
|
|
211
|
+
id: 'runtime-thread.build-surface',
|
|
212
|
+
name: 'Runtime thread build surface',
|
|
213
|
+
dependencies: ['context'],
|
|
214
|
+
onRegister(runtime) {
|
|
215
|
+
if (!runtime.hasContext(BUILD_SURFACE_CONTEXT_ID))
|
|
216
|
+
registerBuildSurface(runtime, boot.buildSurface);
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
const composition = {
|
|
220
|
+
kind: 'workspace',
|
|
221
|
+
floor: {
|
|
222
|
+
...boot.composition.floor,
|
|
223
|
+
plugins: [...boot.composition.floor.plugins, ...(options.floor ?? []), async () => buildSurface]
|
|
224
|
+
},
|
|
225
|
+
global: boot.composition.global,
|
|
226
|
+
globalPlugins: boot.composition.globalPlugins,
|
|
227
|
+
failurePolicy: boot.composition.failurePolicy,
|
|
228
|
+
select: boot.composition.select,
|
|
229
|
+
selectionPolicy: options.selectionPolicy,
|
|
230
|
+
omitSurfaces: options.omitSurfaces ?? boot.composition.omitSurfaces
|
|
231
|
+
};
|
|
232
|
+
const capture = boot.host.cwd !== undefined
|
|
233
|
+
? { env: boot.host.baseEnv ?? {}, cwd: boot.host.cwd }
|
|
234
|
+
: undefined;
|
|
235
|
+
return bootstrapVibesRuntime({
|
|
236
|
+
environment: createRuntimeEnvironmentBunPlugin({
|
|
237
|
+
scope: boot.scope, paths: boot.paths,
|
|
238
|
+
host: {
|
|
239
|
+
root: boot.host.root,
|
|
240
|
+
rootCustody: boot.host.rootCustody,
|
|
241
|
+
selfSpawn: source !== null ? { argv: [...boot.host.selfSpawn], source } : undefined,
|
|
242
|
+
spawnEnv: { ...boot.host.baseEnv, HOME: boot.paths.vibesHome, TMPDIR: boot.paths.tempDir }
|
|
243
|
+
}
|
|
244
|
+
}, capture),
|
|
245
|
+
composition,
|
|
246
|
+
binding: 'default'
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
//# sourceMappingURL=runtime-thread.impl.bun.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-thread.impl.bun.js","sourceRoot":"","sources":["../../src/runtime-plugin-host/runtime-thread.impl.bun.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACN,wBAAwB,EACxB,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,sBAAsB,EACtB,wBAAwB,EACxB,oBAAoB,EAKpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAA8B,MAAM,+BAA+B,CAAC;AAE7F,OAAO,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AACpF,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAElE,OAAO,EAAE,iCAAiC,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,8BAA8B,EAAE,MAAM,cAAc,CAAC;AAEvF,KAAK,UAAU,8BAA8B,CAC5C,OAAqB,EACrB,KAA4B;IAE5B,MAAM,MAAM,GAAG,2BAA2B,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC5D,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACrB,MAAM,IAAI,eAAe,CAAC,uCAAuC,EAAE,eA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,CAAC,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE;aAC1F;SACD,EAAE,OAAO,CAAC;QACX,WAAW;QACX,OAAO,EAAE,SAAS;KAClB,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-thread.shim.bun.d.ts","sourceRoot":"","sources":["../../src/runtime-plugin-host/runtime-thread.shim.bun.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
|
|
2
|
+
if (typeof path === "string" && /^\.\.?\//.test(path)) {
|
|
3
|
+
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
|
|
4
|
+
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
|
|
5
|
+
});
|
|
6
|
+
}
|
|
7
|
+
return path;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* A runtime thread (`runtime/plugin-host` `spawnRuntimeThread`): bridges
|
|
11
|
+
* node:worker_threads to the program named in workerData, after booting the
|
|
12
|
+
* thread's runtime from its portable boot through the kernel's one entry. A
|
|
13
|
+
* boot or program failure is the thread's own error and exit, as for the
|
|
14
|
+
* daemon execution worker; no failure is reduced to a message. The program
|
|
15
|
+
* owns the runtime it is handed and disposes it when its work ends; a `run`
|
|
16
|
+
* that rejects leaves the runtime to the shim, which disposes it before the
|
|
17
|
+
* failure surfaces.
|
|
18
|
+
*/
|
|
19
|
+
import { parentPort, workerData } from 'node:worker_threads';
|
|
20
|
+
import * as z from 'zod/v4';
|
|
21
|
+
import { settle } from '@vibesdotdev/kernel';
|
|
22
|
+
import { RuntimeSurfaceSchema } from '@vibesdotdev/kernel/schemas/scope';
|
|
23
|
+
import { bootRuntimeThread } from "./runtime-thread.impl.bun.js";
|
|
24
|
+
import { RuntimeThreadBootSchema } from "./schemas.js";
|
|
25
|
+
const ShimInputSchema = z.object({
|
|
26
|
+
boot: RuntimeThreadBootSchema,
|
|
27
|
+
programHref: z.string().min(1),
|
|
28
|
+
// The program parses its own payload; the shim only refuses an absent one.
|
|
29
|
+
payload: z.custom((value) => value !== undefined)
|
|
30
|
+
}).strict();
|
|
31
|
+
const ProgramModuleSchema = z.object({
|
|
32
|
+
run: z.custom((value) => value instanceof Function),
|
|
33
|
+
floor: z.custom((value) => value instanceof Function).optional(),
|
|
34
|
+
selectionPolicy: z.custom((value) => value instanceof Function).optional(),
|
|
35
|
+
omitSurfaces: z.array(RuntimeSurfaceSchema).optional()
|
|
36
|
+
});
|
|
37
|
+
const input = ShimInputSchema.parse(workerData);
|
|
38
|
+
const owner = parentPort;
|
|
39
|
+
if (!owner)
|
|
40
|
+
throw new Error('A runtime thread requires parentPort');
|
|
41
|
+
const program = ProgramModuleSchema.safeParse(await import(__rewriteRelativeImportExtension(input.programHref)));
|
|
42
|
+
if (!program.success)
|
|
43
|
+
throw new Error('The runtime thread program does not export run');
|
|
44
|
+
const runtime = await bootRuntimeThread(input.boot, {
|
|
45
|
+
floor: program.data.floor?.(input.boot) ?? [],
|
|
46
|
+
selectionPolicy: program.data.selectionPolicy,
|
|
47
|
+
omitSurfaces: program.data.omitSurfaces
|
|
48
|
+
});
|
|
49
|
+
const ran = await settle(() => program.data.run(runtime, owner, input.payload));
|
|
50
|
+
if (!ran.ok) {
|
|
51
|
+
const disposed = await settle(() => runtime.dispose());
|
|
52
|
+
if (!disposed.ok)
|
|
53
|
+
throw new AggregateError([ran.cause, disposed.cause], 'The runtime thread program and its disposal failed.', { cause: ran.cause });
|
|
54
|
+
throw ran.cause;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=runtime-thread.shim.bun.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file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