@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,168 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Daemon hot reload wiring.
|
|
3
|
+
*
|
|
4
|
+
* `vibes pm` runs one `vibes-runtime-daemon` for many clients, and that daemon
|
|
5
|
+
* is expected to stay up for days. Without reload it drifts: its own MCP
|
|
6
|
+
* `initialize` handshake reports SOURCE/WORKSPACE DIVERGENCE about itself, and
|
|
7
|
+
* a drifted body answers plausibly with stale behaviour. Uptime must not cost
|
|
8
|
+
* currency.
|
|
9
|
+
*
|
|
10
|
+
* Opt-in, never on by default. Cloud hardware is refused outright: a cloud
|
|
11
|
+
* runtime's code comes from its deployed artifact, and a process that rebuilds
|
|
12
|
+
* plugins from a mutable source tree there would be an integrity hole, not a
|
|
13
|
+
* convenience.
|
|
14
|
+
*/
|
|
15
|
+
import { CapabilityError, CaughtFailureSchema, valueFreeFailure } from '@vibesdotdev/kernel';
|
|
16
|
+
import { getPathRoots, getRuntimePath } from '@vibesdotdev/paths';
|
|
17
|
+
import { PluginReloadController, PluginRuntimeGenerations } from '@vibesdotdev/kernel/reload';
|
|
18
|
+
import {} from '@vibesdotdev/kernel/kinds/runtime-plugin-host.kind';
|
|
19
|
+
export { HMR_ENV_KEY, decideHotReload } from '@vibesdotdev/kernel/kinds/runtime-plugin-host.kind';
|
|
20
|
+
import { BunPluginModuleImporter } from "./hot-plugin-module.consumer.js";
|
|
21
|
+
import { SourceWatcher } from "./source-watcher.consumer.js";
|
|
22
|
+
/**
|
|
23
|
+
* Owns the controller, the Bun importer, and the source watcher for one
|
|
24
|
+
* daemon. Nothing here decides *when* an identity leaves the registry beyond
|
|
25
|
+
* "its source changed"; exact retraction is the runtime's job by contract.
|
|
26
|
+
*/
|
|
27
|
+
/** The failure record and log facts for one failed reload. Neither repeats thrown text. */
|
|
28
|
+
export function pluginReloadFailureReport(outcome) {
|
|
29
|
+
return {
|
|
30
|
+
error: 'plugin-reload-failed',
|
|
31
|
+
logged: valueFreeFailure(CaughtFailureSchema.parse(outcome.error))
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export class DaemonHotReload {
|
|
35
|
+
generations;
|
|
36
|
+
runtime;
|
|
37
|
+
importer;
|
|
38
|
+
watcher;
|
|
39
|
+
controller;
|
|
40
|
+
log;
|
|
41
|
+
started = false;
|
|
42
|
+
failure = null;
|
|
43
|
+
constructor(runtime, options) {
|
|
44
|
+
this.log = options.logger;
|
|
45
|
+
this.generations = new PluginRuntimeGenerations(runtime, ({ error }) => {
|
|
46
|
+
this.log.error('runtime generation lifecycle failed', { error: String(error) });
|
|
47
|
+
}, options.validateCandidate);
|
|
48
|
+
this.runtime = this.generations.runtime;
|
|
49
|
+
/**
|
|
50
|
+
* Generations go where the host declared (`hotDir`), else under this
|
|
51
|
+
* runtime's own vibes home; a runtime without path roots fails typed (the
|
|
52
|
+
* `getPathRoots` call below). Source watching additionally needs the host's
|
|
53
|
+
* captured cwd to resolve Bun's cwd-relative sourcemap paths; an
|
|
54
|
+
* installed-only host (`requireCwd: false`) publishes generations without one.
|
|
55
|
+
*/
|
|
56
|
+
const cwd = runtime.localEnvironment.getCwd?.() ?? undefined;
|
|
57
|
+
if (!cwd && options.requireCwd !== false) {
|
|
58
|
+
throw new CapabilityError('Hot reload needs the host cwd, and this runtime captured none.', 'UNAVAILABLE', {
|
|
59
|
+
recoveryHint: 'Start the daemon through a host that captures its working directory.'
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
this.importer = new BunPluginModuleImporter({
|
|
63
|
+
cwd,
|
|
64
|
+
...(options.hotDir ? { hotDir: options.hotDir } : { activeHome: getPathRoots(runtime).activeHome }),
|
|
65
|
+
artifactIdentity: options.artifactIdentity
|
|
66
|
+
});
|
|
67
|
+
this.watcher = new SourceWatcher({ runtime, logger: this.log.child('watch') });
|
|
68
|
+
this.controller = new PluginReloadController(this.runtime, this.importer, {
|
|
69
|
+
generations: this.generations,
|
|
70
|
+
debounceMs: options.debounceMs,
|
|
71
|
+
onOutcome: (outcome) => this.report(outcome)
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* The most recent failed reload, or null.
|
|
76
|
+
*
|
|
77
|
+
* Load-bearing, not decorative: a failed reload keeps the PREVIOUS
|
|
78
|
+
* generation serving, which is indistinguishable from "everything is fine"
|
|
79
|
+
* unless the body says so. `hot-reload-status` reports it and the
|
|
80
|
+
* stale-body banner appends `hmr: <id> failed`.
|
|
81
|
+
*/
|
|
82
|
+
lastFailure() {
|
|
83
|
+
return this.failure;
|
|
84
|
+
}
|
|
85
|
+
initialize(targets) {
|
|
86
|
+
return this.importer.initialize(targets.map((target) => target.entry));
|
|
87
|
+
}
|
|
88
|
+
/** Track a plugin and (re)arm the watcher over the union of tracked sources. */
|
|
89
|
+
async track(target, watchSources = true) {
|
|
90
|
+
const paths = await getRuntimePath(this.runtime);
|
|
91
|
+
const sources = await this.controller.track(target.pluginId, paths.resolve(target.entry), watchSources);
|
|
92
|
+
this.arm();
|
|
93
|
+
return sources;
|
|
94
|
+
}
|
|
95
|
+
untrack(pluginId) {
|
|
96
|
+
this.controller.untrack(pluginId);
|
|
97
|
+
this.arm();
|
|
98
|
+
}
|
|
99
|
+
/** Reload one tracked plugin now, regardless of filesystem events. */
|
|
100
|
+
async reload(pluginId) {
|
|
101
|
+
const outcome = await this.controller.reload(pluginId);
|
|
102
|
+
this.arm();
|
|
103
|
+
return outcome;
|
|
104
|
+
}
|
|
105
|
+
reloadMany(pluginIds) {
|
|
106
|
+
return this.controller.reloadMany(pluginIds);
|
|
107
|
+
}
|
|
108
|
+
status() {
|
|
109
|
+
return this.controller.status();
|
|
110
|
+
}
|
|
111
|
+
watchedSources() {
|
|
112
|
+
return this.controller.watchedSources();
|
|
113
|
+
}
|
|
114
|
+
async stop() {
|
|
115
|
+
this.watcher.unwatchAll();
|
|
116
|
+
this.started = false;
|
|
117
|
+
this.controller.stop();
|
|
118
|
+
await this.generations.close();
|
|
119
|
+
await this.importer.dispose();
|
|
120
|
+
}
|
|
121
|
+
arm() {
|
|
122
|
+
const sources = this.controller.watchedSources();
|
|
123
|
+
this.watcher.watch(sources, (file) => this.controller.notifyChanged(file));
|
|
124
|
+
if (!this.started && sources.length > 0) {
|
|
125
|
+
this.started = true;
|
|
126
|
+
this.log.info('hot reload armed', { files: sources.length });
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
report(outcome) {
|
|
130
|
+
if (outcome.status === 'reloaded') {
|
|
131
|
+
this.arm();
|
|
132
|
+
this.failure = null;
|
|
133
|
+
this.log.info('plugin reloaded', {
|
|
134
|
+
pluginId: outcome.pluginId,
|
|
135
|
+
generation: outcome.generation,
|
|
136
|
+
durationMs: outcome.durationMs,
|
|
137
|
+
generations: this.generations.status()
|
|
138
|
+
});
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
if (outcome.status === 'failed') {
|
|
142
|
+
// Loud, but not fatal. The previous generation is still installed and
|
|
143
|
+
// still answering; a daemon that dies on a syntax error is worse than
|
|
144
|
+
// one that drifts. Retained so `hot-reload-status` and the stale-body
|
|
145
|
+
// banner can say WHICH plugin is frozen at an older generation.
|
|
146
|
+
const reported = pluginReloadFailureReport(outcome);
|
|
147
|
+
this.failure = {
|
|
148
|
+
pluginId: outcome.pluginId,
|
|
149
|
+
phase: outcome.phase,
|
|
150
|
+
error: reported.error,
|
|
151
|
+
servingGeneration: outcome.servingGeneration ?? null,
|
|
152
|
+
at: new Date().toISOString()
|
|
153
|
+
};
|
|
154
|
+
this.log.error('plugin reload failed — still serving previous generation', {
|
|
155
|
+
pluginId: outcome.pluginId,
|
|
156
|
+
phase: outcome.phase,
|
|
157
|
+
servingGeneration: outcome.servingGeneration,
|
|
158
|
+
error: reported.logged
|
|
159
|
+
});
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
this.log.warn('plugin reload skipped', {
|
|
163
|
+
pluginId: outcome.pluginId,
|
|
164
|
+
reason: outcome.reason
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
//# sourceMappingURL=hot-reload.consumer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hot-reload.consumer.js","sourceRoot":"","sources":["../../src/runtime-plugin-host/hot-reload.consumer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,gBAAgB,EAAqB,MAAM,qBAAqB,CAAC;AAChH,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EACN,sBAAsB,EACtB,wBAAwB,EAGxB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAEN,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EACN,WAAW,EACX,eAAe,EAIf,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D;;;;GAIG;AACH,2FAA2F;AAC3F,MAAM,UAAU,yBAAyB,CAAC,OAA2D;IACpG,OAAO;QACN,KAAK,EAAE,sBAAsB;QAC7B,MAAM,EAAE,gBAAgB,CAAC,mBAAmB,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;KAClE,CAAC;AACH,CAAC;AAUD,MAAM,OAAO,eAAe;IAClB,WAAW,CAA2B;IACtC,OAAO,CAAe;IACd,QAAQ,CAA0B;IAClC,OAAO,CAAgB;IACvB,UAAU,CAAyB;IACnC,GAAG,CAAkB;IAC9B,OAAO,GAAG,KAAK,CAAC;IAChB,OAAO,GAAkC,IAAI,CAAC;IAEtD,YACC,OAAqB,EACrB,OAGuB;QAEvB,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC;QAC1B,IAAI,CAAC,WAAW,GAAG,IAAI,wBAAwB,CAAC,OAAO,EAAE,CAAC,EA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C;YACH,OAAO;QACR,CAAC;QACD,IAAI,OAAO,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;YACjC,sEAAsE;YACtE,sEAAsE;YACtE,sEAAsE;YACtE,gEAAgE;YAChE,MAAM,QAAQ,GAAG,yBAAyB,CAAC,OAAO,CAAC,CAAC;YACpD,IAAI,CAAC,OAAO,GAAG;gBACd,QAAQ,EAAE,OAAO,CAAC,QAAQ;gBAC1B,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,KAAK,EAAE,QAAQ,CAAC,KAAK;gBACrB,iBAAiB,EAAE,OAAO,CAAC,iBAAiB,IAAI,IAAI;gBACpD,EAAE,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;aAC5B,CAAC;YACF,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,0DAA0D,EAAE;gBAC1E,QAAQ,EAAE,OAAO,CAAC,QAAQ;gBAC1B,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,iBAAiB,EAAE,OAAO,CAAC,iBAAiB;gBAC5C,KAAK,EAAE,QAAQ,CAAC,MAAM;aACtB,CAAC,CAAC;YACH,OAAO;QACR,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,uBAAuB,EAAE;YACtC,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,MAAM,EAAE,OAAO,CAAC,MAAM;SACtB,CAAC,CAAC;IACJ,CAAC;CACD"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reclaim leftover runtime unix sockets and dead PID files.
|
|
3
|
+
*
|
|
4
|
+
* A socket file whose process is gone answers connect() with ECONNREFUSED.
|
|
5
|
+
* That is not a live policy refusal — it is a corpse. Start / auto-start /
|
|
6
|
+
* doctor --fix unlink those files so bind and connect can proceed.
|
|
7
|
+
*/
|
|
8
|
+
import { type RuntimeLifecycle } from '@vibesdotdev/kernel';
|
|
9
|
+
import type { ReclaimPaths, ReclaimResult } from '@vibesdotdev/kernel/kinds/runtime-plugin-host.kind';
|
|
10
|
+
export declare const RUNTIME_SOCKET_PREFIX = "vibes-runtime-ws-";
|
|
11
|
+
export declare const RUNTIME_SOCKET_SUFFIX = ".sock";
|
|
12
|
+
export declare const RUNTIME_PID_PREFIX = "runtime-daemon-";
|
|
13
|
+
export type { ReclaimPaths, ReclaimResult };
|
|
14
|
+
/**
|
|
15
|
+
* Raw connect only — do not wait for an RPC handshake — bounded by the
|
|
16
|
+
* runtime lifecycle (RC07). Answers false only for a proven corpse (the
|
|
17
|
+
* socket refuses or is gone). A connect that does not finish in `timeoutMs`
|
|
18
|
+
* is unproven, so it answers true: a busy live daemon's socket is never
|
|
19
|
+
* reclaimed. Any other failure (EACCES: not ours) propagates.
|
|
20
|
+
*/
|
|
21
|
+
export declare function isUnixSocketConnectable(lifecycle: Pick<RuntimeLifecycle, 'wait'>, socketPath: string, timeoutMs?: number): Promise<boolean>;
|
|
22
|
+
export declare function isStaleSocketError(err: unknown): boolean;
|
|
23
|
+
export declare function reclaimStaleRuntimeSocket(lifecycle: Pick<RuntimeLifecycle, 'wait'>, socketPath: string): Promise<boolean>;
|
|
24
|
+
export declare function pidAlive(pidPath: string): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* A PID file is leftover when its socket is gone or not connectable.
|
|
27
|
+
* `kill(pid, 0)` is not enough — PIDs get reused (we have seen a dead
|
|
28
|
+
* runtime pid file still "alive" because FindMyDevice recycled the number).
|
|
29
|
+
*/
|
|
30
|
+
export declare function reclaimStaleRuntimePid(pidPath: string, socketConnectable?: boolean): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Unlink leftover runtime sockets (not connectable) and their dead PID files.
|
|
33
|
+
* Live listeners are left alone. Other sock kinds (pm, worker, projection) are
|
|
34
|
+
* not touched.
|
|
35
|
+
*/
|
|
36
|
+
export declare function reclaimStaleRuntimeArtifacts(paths: ReclaimPaths): Promise<ReclaimResult>;
|
|
37
|
+
//# sourceMappingURL=reclaim.impl.bun.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reclaim.impl.bun.d.ts","sourceRoot":"","sources":["../../src/runtime-plugin-host/reclaim.impl.bun.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAA8E,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACxI,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oDAAoD,CAAC;AAGtG,eAAO,MAAM,qBAAqB,sBAAsB,CAAC;AACzD,eAAO,MAAM,qBAAqB,UAAU,CAAC;AAC7C,eAAO,MAAM,kBAAkB,oBAAoB,CAAC;AAEpD,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,CAAC;AA2B5C;;;;;;GAMG;AACH,wBAAsB,uBAAuB,CAC5C,SAAS,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,EACzC,UAAU,EAAE,MAAM,EAClB,SAAS,SAAM,GACb,OAAO,CAAC,OAAO,CAAC,CAmBlB;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAQxD;AAED,wBAAsB,yBAAyB,CAC9C,SAAS,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,EACzC,UAAU,EAAE,MAAM,GAChB,OAAO,CAAC,OAAO,CAAC,CAIlB;AAED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAUjD;AAUD;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,iBAAiB,UAAQ,GAAG,OAAO,CAI1F;AAOD;;;;GAIG;AACH,wBAAsB,4BAA4B,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC,CAoC9F"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reclaim leftover runtime unix sockets and dead PID files.
|
|
3
|
+
*
|
|
4
|
+
* A socket file whose process is gone answers connect() with ECONNREFUSED.
|
|
5
|
+
* That is not a live policy refusal — it is a corpse. Start / auto-start /
|
|
6
|
+
* doctor --fix unlink those files so bind and connect can proceed.
|
|
7
|
+
*/
|
|
8
|
+
import { existsSync, readdirSync, readFileSync, unlinkSync } from 'node:fs';
|
|
9
|
+
import { join } from 'node:path';
|
|
10
|
+
import { isCapabilityError, settle, settleNow, valueFreeFailure } from '@vibesdotdev/kernel';
|
|
11
|
+
import z from 'zod/v4';
|
|
12
|
+
export const RUNTIME_SOCKET_PREFIX = 'vibes-runtime-ws-';
|
|
13
|
+
export const RUNTIME_SOCKET_SUFFIX = '.sock';
|
|
14
|
+
export const RUNTIME_PID_PREFIX = 'runtime-daemon-';
|
|
15
|
+
const STALE_SOCKET = /ECONNREFUSED|connection refused|Unable to connect|ENOENT/i;
|
|
16
|
+
/** A connect failure, or the text of a thrown string. Both carry the same stale-socket facts. */
|
|
17
|
+
const SocketFailureSchema = z.union([
|
|
18
|
+
z.object({
|
|
19
|
+
code: z.string().optional(),
|
|
20
|
+
message: z.string().optional()
|
|
21
|
+
}),
|
|
22
|
+
z.string().transform((message) => ({ code: undefined, message }))
|
|
23
|
+
]);
|
|
24
|
+
function failureCode(cause) {
|
|
25
|
+
return valueFreeFailure(cause).code;
|
|
26
|
+
}
|
|
27
|
+
/** A file that is already gone is the only unlink failure that means "nothing to reclaim". */
|
|
28
|
+
function unlinkIfPresent(path) {
|
|
29
|
+
const removed = settleNow(() => {
|
|
30
|
+
unlinkSync(path);
|
|
31
|
+
});
|
|
32
|
+
if (removed.ok)
|
|
33
|
+
return true;
|
|
34
|
+
if (failureCode(removed.cause) === 'ENOENT')
|
|
35
|
+
return false;
|
|
36
|
+
throw removed.cause;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Raw connect only — do not wait for an RPC handshake — bounded by the
|
|
40
|
+
* runtime lifecycle (RC07). Answers false only for a proven corpse (the
|
|
41
|
+
* socket refuses or is gone). A connect that does not finish in `timeoutMs`
|
|
42
|
+
* is unproven, so it answers true: a busy live daemon's socket is never
|
|
43
|
+
* reclaimed. Any other failure (EACCES: not ours) propagates.
|
|
44
|
+
*/
|
|
45
|
+
export async function isUnixSocketConnectable(lifecycle, socketPath, timeoutMs = 250) {
|
|
46
|
+
if (!existsSync(socketPath))
|
|
47
|
+
return false;
|
|
48
|
+
const connected = await settle(() => lifecycle.wait(() => Bun.connect({
|
|
49
|
+
unix: socketPath,
|
|
50
|
+
socket: { data() { }, open() { }, close() { }, error() { } }
|
|
51
|
+
}), { timeoutMs, reason: 'runtime-socket-probe' }));
|
|
52
|
+
if (connected.ok) {
|
|
53
|
+
connected.value.end();
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
if (isStaleSocketError(connected.cause))
|
|
57
|
+
return false;
|
|
58
|
+
if (isCapabilityError(connected.cause) && connected.cause.code === 'TIMEOUT' && connected.cause.reason === 'wait-timeout')
|
|
59
|
+
return true;
|
|
60
|
+
throw connected.cause;
|
|
61
|
+
}
|
|
62
|
+
export function isStaleSocketError(err) {
|
|
63
|
+
const parsed = SocketFailureSchema.safeParse(err);
|
|
64
|
+
if (!parsed.success)
|
|
65
|
+
return false;
|
|
66
|
+
const code = parsed.data.code;
|
|
67
|
+
if (code === 'ECONNREFUSED' || code === 'ENOENT')
|
|
68
|
+
return true;
|
|
69
|
+
const message = parsed.data.message;
|
|
70
|
+
if (message === undefined)
|
|
71
|
+
return false;
|
|
72
|
+
return STALE_SOCKET.test(message);
|
|
73
|
+
}
|
|
74
|
+
export async function reclaimStaleRuntimeSocket(lifecycle, socketPath) {
|
|
75
|
+
if (!existsSync(socketPath))
|
|
76
|
+
return false;
|
|
77
|
+
if (await isUnixSocketConnectable(lifecycle, socketPath))
|
|
78
|
+
return false;
|
|
79
|
+
return unlinkIfPresent(socketPath);
|
|
80
|
+
}
|
|
81
|
+
export function pidAlive(pidPath) {
|
|
82
|
+
const read = settleNow(() => readFileSync(pidPath, 'utf8').trim());
|
|
83
|
+
if (!read.ok)
|
|
84
|
+
return pidFailure(read.cause);
|
|
85
|
+
const pid = Number.parseInt(read.value, 10);
|
|
86
|
+
if (!Number.isFinite(pid) || pid <= 0)
|
|
87
|
+
return false;
|
|
88
|
+
const signal = settleNow(() => {
|
|
89
|
+
process.kill(pid, 0);
|
|
90
|
+
});
|
|
91
|
+
if (signal.ok)
|
|
92
|
+
return true;
|
|
93
|
+
return pidFailure(signal.cause);
|
|
94
|
+
}
|
|
95
|
+
/** EPERM means the process is there and not ours to signal. ENOENT and ESRCH mean it is gone. */
|
|
96
|
+
function pidFailure(cause) {
|
|
97
|
+
const code = failureCode(cause);
|
|
98
|
+
if (code === 'EPERM')
|
|
99
|
+
return true;
|
|
100
|
+
if (code === 'ENOENT' || code === 'ESRCH')
|
|
101
|
+
return false;
|
|
102
|
+
throw cause;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* A PID file is leftover when its socket is gone or not connectable.
|
|
106
|
+
* `kill(pid, 0)` is not enough — PIDs get reused (we have seen a dead
|
|
107
|
+
* runtime pid file still "alive" because FindMyDevice recycled the number).
|
|
108
|
+
*/
|
|
109
|
+
export function reclaimStaleRuntimePid(pidPath, socketConnectable = false) {
|
|
110
|
+
if (!existsSync(pidPath))
|
|
111
|
+
return false;
|
|
112
|
+
if (socketConnectable)
|
|
113
|
+
return false;
|
|
114
|
+
return unlinkIfPresent(pidPath);
|
|
115
|
+
}
|
|
116
|
+
function pidPathForSocketName(name, pidDir) {
|
|
117
|
+
const id = name.replace(/^vibes-runtime-/, '').replace(/\.sock$/, '');
|
|
118
|
+
return join(pidDir, `${RUNTIME_PID_PREFIX}${id}.pid`);
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Unlink leftover runtime sockets (not connectable) and their dead PID files.
|
|
122
|
+
* Live listeners are left alone. Other sock kinds (pm, worker, projection) are
|
|
123
|
+
* not touched.
|
|
124
|
+
*/
|
|
125
|
+
export async function reclaimStaleRuntimeArtifacts(paths) {
|
|
126
|
+
const { sockDir, pidDir, lifecycle } = paths;
|
|
127
|
+
const result = { sockets: [], pids: [] };
|
|
128
|
+
if (existsSync(sockDir)) {
|
|
129
|
+
const names = readdirSync(sockDir).filter((name) => name.startsWith(RUNTIME_SOCKET_PREFIX) && name.endsWith(RUNTIME_SOCKET_SUFFIX));
|
|
130
|
+
for (const name of names) {
|
|
131
|
+
const socketPath = join(sockDir, name);
|
|
132
|
+
const connectable = await isUnixSocketConnectable(lifecycle, socketPath);
|
|
133
|
+
if (!connectable && (await reclaimStaleRuntimeSocket(lifecycle, socketPath))) {
|
|
134
|
+
result.sockets.push(socketPath);
|
|
135
|
+
}
|
|
136
|
+
const pidPath = pidPathForSocketName(name, pidDir);
|
|
137
|
+
if (reclaimStaleRuntimePid(pidPath, connectable)) {
|
|
138
|
+
result.pids.push(pidPath);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
if (existsSync(pidDir)) {
|
|
143
|
+
for (const name of readdirSync(pidDir)) {
|
|
144
|
+
if (!name.startsWith(RUNTIME_PID_PREFIX) || !name.endsWith('.pid'))
|
|
145
|
+
continue;
|
|
146
|
+
const pidPath = join(pidDir, name);
|
|
147
|
+
if (result.pids.includes(pidPath))
|
|
148
|
+
continue;
|
|
149
|
+
const id = name.replace(new RegExp(`^${RUNTIME_PID_PREFIX}`), '').replace(/\.pid$/, '');
|
|
150
|
+
const socketPath = join(sockDir, `vibes-runtime-${id}.sock`);
|
|
151
|
+
const connectable = await isUnixSocketConnectable(lifecycle, socketPath);
|
|
152
|
+
if (reclaimStaleRuntimePid(pidPath, connectable)) {
|
|
153
|
+
result.pids.push(pidPath);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return result;
|
|
158
|
+
}
|
|
159
|
+
//# sourceMappingURL=reclaim.impl.bun.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reclaim.impl.bun.js","sourceRoot":"","sources":["../../src/runtime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,OAAO,CAAC,CAAC;YAC7D,MAAM,WAAW,GAAG,MAAM,uBAAuB,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;YACzE,IAAI,sBAAsB,CAAC,OAAO,EAAE,WAAW,CAAC,EAAE,CAAC;gBAClD,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC3B,CAAC;QACF,CAAC;IACF,CAAC;IAED,OAAO,MAAM,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { RuntimePluginHost } from '@vibesdotdev/kernel/kinds/runtime-plugin-host.kind';
|
|
2
|
+
/** Bun implementation of the runtime plugin host kind. */
|
|
3
|
+
export declare function createBunRuntimePluginHost(owned?: Pick<RuntimePluginHost, 'createOwnedWorkspaceEnvironment'>): RuntimePluginHost;
|
|
4
|
+
//# sourceMappingURL=runtime-plugin-host.impl.bun.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-plugin-host.impl.bun.d.ts","sourceRoot":"","sources":["../../src/runtime-plugin-host/runtime-plugin-host.impl.bun.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAGX,iBAAiB,EAKjB,MAAM,oDAAoD,CAAC;AAqI5D,0DAA0D;AAC1D,wBAAgB,0BAA0B,CAAC,KAAK,GAAE,IAAI,CAAC,iBAAiB,EAAE,iCAAiC,CAAM,GAAG,iBAAiB,CAuDpI"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { MessageChannel, MessagePort, Worker } from 'node:worker_threads';
|
|
2
|
+
import { CapabilityError } from '@vibesdotdev/kernel';
|
|
3
|
+
import z from 'zod/v4';
|
|
4
|
+
import { startHostHotReload } from "./host-hot-reload.consumer.js";
|
|
5
|
+
import { captureRuntimeThreadBoot, resolveOwnedDaemonExecutionShimHref, resolveOwnedWorkspaceBinding } from "./runtime-thread.impl.bun.js";
|
|
6
|
+
import { isStaleSocketError, isUnixSocketConnectable, reclaimStaleRuntimeArtifacts, reclaimStaleRuntimePid, reclaimStaleRuntimeSocket } from "./reclaim.impl.bun.js";
|
|
7
|
+
/** Native ports behind the wrappers the feature holds. Transfer lists need the native identity. */
|
|
8
|
+
const nativePorts = new WeakMap();
|
|
9
|
+
function eventData(event) {
|
|
10
|
+
if ('data' in event)
|
|
11
|
+
return event.data;
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
14
|
+
function hostPort(port) {
|
|
15
|
+
const listeners = new Map();
|
|
16
|
+
const wrapped = {
|
|
17
|
+
postMessage(message) {
|
|
18
|
+
port.postMessage(message);
|
|
19
|
+
},
|
|
20
|
+
close() {
|
|
21
|
+
port.close();
|
|
22
|
+
},
|
|
23
|
+
addEventListener(type, listener) {
|
|
24
|
+
const native = (event) => listener({ data: eventData(event) });
|
|
25
|
+
listeners.set(listener, native);
|
|
26
|
+
port.addEventListener(type, native);
|
|
27
|
+
},
|
|
28
|
+
removeEventListener(type, listener) {
|
|
29
|
+
const native = listeners.get(listener);
|
|
30
|
+
if (!native)
|
|
31
|
+
return;
|
|
32
|
+
listeners.delete(listener);
|
|
33
|
+
port.removeEventListener(type, native);
|
|
34
|
+
},
|
|
35
|
+
start() {
|
|
36
|
+
port.start();
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
nativePorts.set(wrapped, port);
|
|
40
|
+
return wrapped;
|
|
41
|
+
}
|
|
42
|
+
function nativePort(port) {
|
|
43
|
+
const native = nativePorts.get(port);
|
|
44
|
+
if (!native)
|
|
45
|
+
throw new Error('Daemon execution transfer requires a host message port');
|
|
46
|
+
return native;
|
|
47
|
+
}
|
|
48
|
+
const PlainRecordSchema = z.custom((value) => {
|
|
49
|
+
if (!(value instanceof Object) || Array.isArray(value))
|
|
50
|
+
return false;
|
|
51
|
+
return Object.getPrototypeOf(value) === Object.prototype;
|
|
52
|
+
});
|
|
53
|
+
/** Replace host-port wrappers with the native ports Node can transfer. The payload stays opaque. */
|
|
54
|
+
function replacePorts(value) {
|
|
55
|
+
return walkTransfer(value);
|
|
56
|
+
}
|
|
57
|
+
function walkTransfer(value) {
|
|
58
|
+
if (!(value instanceof Object))
|
|
59
|
+
return value;
|
|
60
|
+
const port = nativePorts.get(value);
|
|
61
|
+
if (port !== undefined)
|
|
62
|
+
return port;
|
|
63
|
+
if (Array.isArray(value)) {
|
|
64
|
+
let changed = false;
|
|
65
|
+
const next = [];
|
|
66
|
+
for (const item of value) {
|
|
67
|
+
const replaced = walkTransfer(item);
|
|
68
|
+
if (replaced !== item)
|
|
69
|
+
changed = true;
|
|
70
|
+
next.push(replaced);
|
|
71
|
+
}
|
|
72
|
+
return changed ? next : value;
|
|
73
|
+
}
|
|
74
|
+
const record = PlainRecordSchema.safeParse(value);
|
|
75
|
+
if (!record.success || !(record.data instanceof Object) || Array.isArray(record.data))
|
|
76
|
+
return value;
|
|
77
|
+
let changed = false;
|
|
78
|
+
const fields = [];
|
|
79
|
+
for (const [key, child] of Object.entries(record.data)) {
|
|
80
|
+
const replaced = walkTransfer(child);
|
|
81
|
+
if (replaced !== child)
|
|
82
|
+
changed = true;
|
|
83
|
+
fields.push([key, replaced]);
|
|
84
|
+
}
|
|
85
|
+
return changed ? Object.fromEntries(fields) : value;
|
|
86
|
+
}
|
|
87
|
+
function hostWorker(worker) {
|
|
88
|
+
return {
|
|
89
|
+
threadId: worker.threadId,
|
|
90
|
+
postMessage(message, transfer) {
|
|
91
|
+
const payload = replacePorts(message);
|
|
92
|
+
if (transfer !== undefined && transfer.length > 0) {
|
|
93
|
+
worker.postMessage(payload, transfer.map(nativePort));
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
worker.postMessage(payload);
|
|
97
|
+
},
|
|
98
|
+
on(event, listener) {
|
|
99
|
+
if (event === 'exit') {
|
|
100
|
+
worker.on('exit', (code) => listener(code));
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
worker.on('message', (message) => listener(message));
|
|
104
|
+
},
|
|
105
|
+
once(event, listener) {
|
|
106
|
+
worker.once(event, listener);
|
|
107
|
+
},
|
|
108
|
+
terminate() {
|
|
109
|
+
return worker.terminate();
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
function resolveRuntimeThreadShimUrl(host) {
|
|
114
|
+
if (host.rootCustody !== true) {
|
|
115
|
+
return new URL('./runtime-thread.shim.bun.ts', import.meta.url);
|
|
116
|
+
}
|
|
117
|
+
if (host.shimHref) {
|
|
118
|
+
return new URL(host.shimHref);
|
|
119
|
+
}
|
|
120
|
+
throw new CapabilityError('The owned workspace module graph does not contain a matching @vibesdotdev/host-bun runtime thread shim.', 'UNAVAILABLE', {
|
|
121
|
+
reason: 'runtime-thread-shim-unavailable'
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
/** Bun implementation of the runtime plugin host kind. */
|
|
125
|
+
export function createBunRuntimePluginHost(owned = {}) {
|
|
126
|
+
return {
|
|
127
|
+
...owned,
|
|
128
|
+
createMessageChannel() {
|
|
129
|
+
const channel = new MessageChannel();
|
|
130
|
+
return { port1: hostPort(channel.port1), port2: hostPort(channel.port2) };
|
|
131
|
+
},
|
|
132
|
+
resolveOwnedWorkspaceBinding(runtime, workspaceRoot) {
|
|
133
|
+
return resolveOwnedWorkspaceBinding(runtime, workspaceRoot);
|
|
134
|
+
},
|
|
135
|
+
resolveOwnedDaemonExecutionShimHref(runtime, moduleRoot) {
|
|
136
|
+
return resolveOwnedDaemonExecutionShimHref(runtime, moduleRoot);
|
|
137
|
+
},
|
|
138
|
+
spawnDaemonExecutionWorker(options) {
|
|
139
|
+
const payload = replacePorts(options.workerData);
|
|
140
|
+
// An owned workspace's worker starts its own graph's shim, so nothing
|
|
141
|
+
// in that worker loads from this host's graph.
|
|
142
|
+
const shimUrl = options.shimHref !== undefined
|
|
143
|
+
? new URL(options.shimHref)
|
|
144
|
+
: new URL('./daemon-execution.worker-shim.bun.ts', import.meta.url);
|
|
145
|
+
return hostWorker(new Worker(shimUrl, {
|
|
146
|
+
env: {},
|
|
147
|
+
workerData: { entryHref: options.entryHref, payload },
|
|
148
|
+
transferList: options.transferList.map(nativePort)
|
|
149
|
+
}));
|
|
150
|
+
},
|
|
151
|
+
captureRuntimeThreadBoot(runtime, declaration) {
|
|
152
|
+
return captureRuntimeThreadBoot(runtime, declaration);
|
|
153
|
+
},
|
|
154
|
+
spawnRuntimeThread(options) {
|
|
155
|
+
const payload = replacePorts(options.payload);
|
|
156
|
+
const shimUrl = resolveRuntimeThreadShimUrl(options.boot.host);
|
|
157
|
+
return hostWorker(new Worker(shimUrl, {
|
|
158
|
+
env: {},
|
|
159
|
+
workerData: { boot: options.boot, programHref: options.programHref, payload },
|
|
160
|
+
transferList: options.transferList.map(nativePort)
|
|
161
|
+
}));
|
|
162
|
+
},
|
|
163
|
+
startHostHotReload(runtime, options) {
|
|
164
|
+
return startHostHotReload(runtime, options);
|
|
165
|
+
},
|
|
166
|
+
reclaimStaleRuntimeArtifacts(paths) {
|
|
167
|
+
return reclaimStaleRuntimeArtifacts(paths);
|
|
168
|
+
},
|
|
169
|
+
reclaimStaleRuntimeSocket(lifecycle, socketPath) {
|
|
170
|
+
return reclaimStaleRuntimeSocket(lifecycle, socketPath);
|
|
171
|
+
},
|
|
172
|
+
reclaimStaleRuntimePid(pidPath, socketConnectable = false) {
|
|
173
|
+
return reclaimStaleRuntimePid(pidPath, socketConnectable);
|
|
174
|
+
},
|
|
175
|
+
isUnixSocketConnectable(lifecycle, socketPath, timeoutMs) {
|
|
176
|
+
return isUnixSocketConnectable(lifecycle, socketPath, timeoutMs);
|
|
177
|
+
},
|
|
178
|
+
isStaleSocketError
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
//# sourceMappingURL=runtime-plugin-host.impl.bun.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-plugin-host.impl.bun.js","sourceRoot":"","sources":["../../src/runtime-plugin-host/runtime-plugin-host.impl.bun.ts"],"names":[],"mappings":"AAAA,OAAO,EAA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,CAAC;QACvD,CAAC;QACD,kBAAkB,CAAC,OAAO;YACzB,MAAM,OAAO,GAAG,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YAC9C,MAAM,OAAO,GAAG,2BAA2B,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC/D,OAAO,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,EAAE;gBACrC,GAAG,EAAE,EAAE;gBACP,UAAU,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,OAAO,EAAE;gBAC7E,YAAY,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC;aAClD,CAAC,CAAC,CAAC;QACL,CAAC;QACD,kBAAkB,CAAC,OAAqB,EAAE,OAAkC;YAC3E,OAAO,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC7C,CAAC;QACD,4BAA4B,CAAC,KAAmB;YAC/C,OAAO,4BAA4B,CAAC,KAAK,CAAC,CAAC;QAC5C,CAAC;QACD,yBAAyB,CAAC,SAAyC,EAAE,UAAkB;YACtF,OAAO,yBAAyB,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;QACzD,CAAC;QACD,sBAAsB,CAAC,OAAe,EAAE,iBAAiB,GAAG,KAAK;YAChE,OAAO,sBAAsB,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;QAC3D,CAAC;QACD,uBAAuB,CAAC,SAAyC,EAAE,UAAkB,EAAE,SAAkB;YACxG,OAAO,uBAAuB,CAAC,SAAS,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;QAClE,CAAC;QACD,kBAAkB;KAClB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registers the Bun host's runtime-plugin doors under `runtime/plugin-host`.
|
|
3
|
+
* The bindings module loads only when the kind is first resolved.
|
|
4
|
+
*/
|
|
5
|
+
import { type RuntimePlugin, type RuntimeRef } from '@vibesdotdev/kernel';
|
|
6
|
+
import { type RuntimePluginHost } from '@vibesdotdev/kernel/kinds/runtime-plugin-host.kind';
|
|
7
|
+
export declare const bunRuntimePluginHostDescriptor: {
|
|
8
|
+
id: string;
|
|
9
|
+
kind: "runtime/plugin-host";
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
host: string;
|
|
13
|
+
hardware: string[];
|
|
14
|
+
};
|
|
15
|
+
export declare function registerBunRuntimePluginHost(runtime: RuntimeRef, owned?: Pick<RuntimePluginHost, 'createOwnedWorkspaceEnvironment'>): void;
|
|
16
|
+
export declare const bunRuntimePluginHostPlugin: RuntimePlugin;
|
|
17
|
+
//# sourceMappingURL=runtime-plugin-host.plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-plugin-host.plugin.d.ts","sourceRoot":"","sources":["../../src/runtime-plugin-host/runtime-plugin-host.plugin.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAoD,KAAK,aAAa,EAAE,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC5H,OAAO,EAAmD,KAAK,iBAAiB,EAAE,MAAM,oDAAoD,CAAC;AAE7I,eAAO,MAAM,8BAA8B;;;;;;;CAO1C,CAAC;AAEF,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,GAAE,IAAI,CAAC,iBAAiB,EAAE,iCAAiC,CAAM,GAAG,IAAI,CAY9I;AAED,eAAO,MAAM,0BAA0B,EAAE,aAMvC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registers the Bun host's runtime-plugin doors under `runtime/plugin-host`.
|
|
3
|
+
* The bindings module loads only when the kind is first resolved.
|
|
4
|
+
*/
|
|
5
|
+
import { createRuntimeImplementation, createRuntimePlugin } from '@vibesdotdev/kernel';
|
|
6
|
+
import { RUNTIME_PLUGIN_HOST_KIND, runtimePluginHostKind } from '@vibesdotdev/kernel/kinds/runtime-plugin-host.kind';
|
|
7
|
+
export const bunRuntimePluginHostDescriptor = {
|
|
8
|
+
id: 'runtime-plugin-host-bun',
|
|
9
|
+
kind: RUNTIME_PLUGIN_HOST_KIND,
|
|
10
|
+
name: 'Bun runtime plugin host',
|
|
11
|
+
description: 'Daemon execution worker, hot reload, and socket reclaim over Bun',
|
|
12
|
+
host: 'bun',
|
|
13
|
+
hardware: ['consumer']
|
|
14
|
+
};
|
|
15
|
+
export function registerBunRuntimePluginHost(runtime, owned = {}) {
|
|
16
|
+
if (!runtime.hasKind(RUNTIME_PLUGIN_HOST_KIND))
|
|
17
|
+
runtime.registerKind(runtimePluginHostKind);
|
|
18
|
+
runtime.registerDescriptor(RUNTIME_PLUGIN_HOST_KIND, bunRuntimePluginHostDescriptor);
|
|
19
|
+
runtime.registerLoader(RUNTIME_PLUGIN_HOST_KIND, bunRuntimePluginHostDescriptor.id, async () => {
|
|
20
|
+
const { createBunRuntimePluginHost } = await import("./runtime-plugin-host.impl.bun.js");
|
|
21
|
+
return createRuntimeImplementation({
|
|
22
|
+
kind: RUNTIME_PLUGIN_HOST_KIND,
|
|
23
|
+
id: bunRuntimePluginHostDescriptor.id,
|
|
24
|
+
constraint: { hardware: ['consumer'] },
|
|
25
|
+
implementation: createBunRuntimePluginHost(owned)
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
export const bunRuntimePluginHostPlugin = createRuntimePlugin({
|
|
30
|
+
id: 'runtime-plugin-host-bun',
|
|
31
|
+
name: 'Bun runtime plugin host',
|
|
32
|
+
onRegister(runtime) {
|
|
33
|
+
registerBunRuntimePluginHost(runtime);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
//# sourceMappingURL=runtime-plugin-host.plugin.js.map
|