@vibesdotdev/host-bun 0.0.0-stage → 1.0.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +18 -0
- package/README.md +222 -2
- package/dist/applet-serve-host/applet-serve-host.impl.bun.d.ts +6 -0
- package/dist/applet-serve-host/applet-serve-host.impl.bun.d.ts.map +1 -0
- package/dist/applet-serve-host/applet-serve-host.impl.bun.js +80 -0
- package/dist/applet-serve-host/applet-serve-host.impl.bun.js.map +1 -0
- package/dist/applet-serve-host/applet-serve-host.plugin.d.ts +22 -0
- package/dist/applet-serve-host/applet-serve-host.plugin.d.ts.map +1 -0
- package/dist/applet-serve-host/applet-serve-host.plugin.js +42 -0
- package/dist/applet-serve-host/applet-serve-host.plugin.js.map +1 -0
- package/dist/applet-serve-host/index.d.ts +7 -0
- package/dist/applet-serve-host/index.d.ts.map +1 -0
- package/dist/applet-serve-host/index.js +7 -0
- package/dist/applet-serve-host/index.js.map +1 -0
- package/dist/applet-serve-host/stylesheet.compiler.d.ts +7 -0
- package/dist/applet-serve-host/stylesheet.compiler.d.ts.map +1 -0
- package/dist/applet-serve-host/stylesheet.compiler.js +63 -0
- package/dist/applet-serve-host/stylesheet.compiler.js.map +1 -0
- package/dist/atlas-migrations/register-atlas-host-migrations.d.ts +21 -0
- package/dist/atlas-migrations/register-atlas-host-migrations.d.ts.map +1 -0
- package/dist/atlas-migrations/register-atlas-host-migrations.js +148 -0
- package/dist/atlas-migrations/register-atlas-host-migrations.js.map +1 -0
- package/dist/buffered-capture.d.ts +4 -0
- package/dist/buffered-capture.d.ts.map +1 -0
- package/dist/buffered-capture.impl.bun.d.ts +18 -0
- package/dist/buffered-capture.impl.bun.d.ts.map +1 -0
- package/dist/buffered-capture.impl.bun.js +148 -0
- package/dist/buffered-capture.impl.bun.js.map +1 -0
- package/dist/buffered-capture.js +5 -0
- package/dist/buffered-capture.js.map +1 -0
- package/dist/bun-environment.impl.bun.d.ts +231 -0
- package/dist/bun-environment.impl.bun.d.ts.map +1 -0
- package/dist/bun-environment.impl.bun.js +352 -0
- package/dist/bun-environment.impl.bun.js.map +1 -0
- package/dist/cache-redis/cache-redis-connector.impl.bun.d.ts +20 -0
- package/dist/cache-redis/cache-redis-connector.impl.bun.d.ts.map +1 -0
- package/dist/cache-redis/cache-redis-connector.impl.bun.js +30 -0
- package/dist/cache-redis/cache-redis-connector.impl.bun.js.map +1 -0
- package/dist/cache-redis/cache-redis-connector.plugin.d.ts +21 -0
- package/dist/cache-redis/cache-redis-connector.plugin.d.ts.map +1 -0
- package/dist/cache-redis/cache-redis-connector.plugin.js +32 -0
- package/dist/cache-redis/cache-redis-connector.plugin.js.map +1 -0
- package/dist/cli-checkout.impl.bun.d.ts +13 -0
- package/dist/cli-checkout.impl.bun.d.ts.map +1 -0
- package/dist/cli-checkout.impl.bun.js +26 -0
- package/dist/cli-checkout.impl.bun.js.map +1 -0
- package/dist/docs/runtime-environment-bun.docs.descriptor.d.ts +19 -0
- package/dist/docs/runtime-environment-bun.docs.descriptor.d.ts.map +1 -0
- package/dist/docs/runtime-environment-bun.docs.descriptor.js +116 -0
- package/dist/docs/runtime-environment-bun.docs.descriptor.js.map +1 -0
- package/dist/filesystem/adapter.impl.bun.d.ts +15 -0
- package/dist/filesystem/adapter.impl.bun.d.ts.map +1 -0
- package/dist/filesystem/adapter.impl.bun.js +11 -0
- package/dist/filesystem/adapter.impl.bun.js.map +1 -0
- package/dist/filesystem/host-primitives.impl.bun.d.ts +12 -0
- package/dist/filesystem/host-primitives.impl.bun.d.ts.map +1 -0
- package/dist/filesystem/host-primitives.impl.bun.js +96 -0
- package/dist/filesystem/host-primitives.impl.bun.js.map +1 -0
- package/dist/filesystem/register.d.ts +12 -0
- package/dist/filesystem/register.d.ts.map +1 -0
- package/dist/filesystem/register.js +6 -0
- package/dist/filesystem/register.js.map +1 -0
- package/dist/filesystem/rooted-exclusive.impl.bun.d.ts +4 -0
- package/dist/filesystem/rooted-exclusive.impl.bun.d.ts.map +1 -0
- package/dist/filesystem/rooted-exclusive.impl.bun.js +135 -0
- package/dist/filesystem/rooted-exclusive.impl.bun.js.map +1 -0
- package/dist/held-launch/abi.impl.bun.d.ts +175 -0
- package/dist/held-launch/abi.impl.bun.d.ts.map +1 -0
- package/dist/held-launch/abi.impl.bun.js +476 -0
- package/dist/held-launch/abi.impl.bun.js.map +1 -0
- package/dist/held-launch/execution.impl.bun.d.ts +48 -0
- package/dist/held-launch/execution.impl.bun.d.ts.map +1 -0
- package/dist/held-launch/execution.impl.bun.js +375 -0
- package/dist/held-launch/execution.impl.bun.js.map +1 -0
- package/dist/held-launch/library.impl.bun.d.ts +23 -0
- package/dist/held-launch/library.impl.bun.d.ts.map +1 -0
- package/dist/held-launch/library.impl.bun.js +178 -0
- package/dist/held-launch/library.impl.bun.js.map +1 -0
- package/dist/held-launch/schemas.d.ts +10 -0
- package/dist/held-launch/schemas.d.ts.map +1 -0
- package/dist/held-launch/schemas.js +3 -0
- package/dist/held-launch/schemas.js.map +1 -0
- package/dist/held-launch/streams.impl.bun.d.ts +38 -0
- package/dist/held-launch/streams.impl.bun.d.ts.map +1 -0
- package/dist/held-launch/streams.impl.bun.js +183 -0
- package/dist/held-launch/streams.impl.bun.js.map +1 -0
- package/dist/host-channel.impl.bun.d.ts +25 -0
- package/dist/host-channel.impl.bun.d.ts.map +1 -0
- package/dist/host-channel.impl.bun.js +40 -0
- package/dist/host-channel.impl.bun.js.map +1 -0
- package/dist/host-client.impl.bun.d.ts +31 -0
- package/dist/host-client.impl.bun.d.ts.map +1 -0
- package/dist/host-client.impl.bun.js +39 -0
- package/dist/host-client.impl.bun.js.map +1 -0
- package/dist/host-credentials.d.ts +38 -0
- package/dist/host-credentials.d.ts.map +1 -0
- package/dist/host-credentials.js +44 -0
- package/dist/host-credentials.js.map +1 -0
- package/dist/host-loader.impl.bun.d.ts +12 -0
- package/dist/host-loader.impl.bun.d.ts.map +1 -0
- package/dist/host-loader.impl.bun.js +83 -0
- package/dist/host-loader.impl.bun.js.map +1 -0
- package/dist/host-signal.impl.bun.d.ts +11 -0
- package/dist/host-signal.impl.bun.d.ts.map +1 -0
- package/dist/host-signal.impl.bun.js +28 -0
- package/dist/host-signal.impl.bun.js.map +1 -0
- package/dist/http-listener.impl.bun.d.ts +8 -0
- package/dist/http-listener.impl.bun.d.ts.map +1 -0
- package/dist/http-listener.impl.bun.js +44 -0
- package/dist/http-listener.impl.bun.js.map +1 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +314 -0
- package/dist/index.js.map +1 -0
- package/dist/local-execution.impl.bun.d.ts +47 -0
- package/dist/local-execution.impl.bun.d.ts.map +1 -0
- package/dist/local-execution.impl.bun.js +150 -0
- package/dist/local-execution.impl.bun.js.map +1 -0
- package/dist/logging/file-host.impl.bun.d.ts +4 -0
- package/dist/logging/file-host.impl.bun.d.ts.map +1 -0
- package/dist/logging/file-host.impl.bun.js +36 -0
- package/dist/logging/file-host.impl.bun.js.map +1 -0
- package/dist/logging/logging.plugin.d.ts +12 -0
- package/dist/logging/logging.plugin.d.ts.map +1 -0
- package/dist/logging/logging.plugin.js +20 -0
- package/dist/logging/logging.plugin.js.map +1 -0
- package/dist/native/held-launch/aarch64-apple-darwin/libvibes_held_launch.dylib +0 -0
- package/dist/native/held-launch/aarch64-apple-darwin/manifest.json +237 -0
- package/dist/native/held-launch/aarch64-apple-darwin/vibes-held-launch +0 -0
- package/dist/native/held-launch/aarch64-unknown-linux-gnu/libvibes_held_launch.so +0 -0
- package/dist/native/held-launch/aarch64-unknown-linux-gnu/manifest.json +237 -0
- package/dist/native/held-launch/aarch64-unknown-linux-gnu/vibes-held-launch +0 -0
- package/dist/native/held-launch/x86_64-apple-darwin/libvibes_held_launch.dylib +0 -0
- package/dist/native/held-launch/x86_64-apple-darwin/manifest.json +237 -0
- package/dist/native/held-launch/x86_64-apple-darwin/vibes-held-launch +0 -0
- package/dist/native/held-launch/x86_64-unknown-linux-gnu/libvibes_held_launch.so +0 -0
- package/dist/native/held-launch/x86_64-unknown-linux-gnu/manifest.json +237 -0
- package/dist/native/held-launch/x86_64-unknown-linux-gnu/vibes-held-launch +0 -0
- package/dist/native-image.consumer.plugin.d.ts +4 -0
- package/dist/native-image.consumer.plugin.d.ts.map +1 -0
- package/dist/native-image.consumer.plugin.js +14 -0
- package/dist/native-image.consumer.plugin.js.map +1 -0
- package/dist/native-image.d.ts +79 -0
- package/dist/native-image.d.ts.map +1 -0
- package/dist/native-image.impl.consumer.d.ts +15 -0
- package/dist/native-image.impl.consumer.d.ts.map +1 -0
- package/dist/native-image.impl.consumer.js +86 -0
- package/dist/native-image.impl.consumer.js.map +1 -0
- package/dist/native-image.js +19 -0
- package/dist/native-image.js.map +1 -0
- package/dist/native-library.consumer.plugin.d.ts +6 -0
- package/dist/native-library.consumer.plugin.d.ts.map +1 -0
- package/dist/native-library.consumer.plugin.js +33 -0
- package/dist/native-library.consumer.plugin.js.map +1 -0
- package/dist/native-library.impl.consumer.d.ts +14 -0
- package/dist/native-library.impl.consumer.d.ts.map +1 -0
- package/dist/native-library.impl.consumer.js +46 -0
- package/dist/native-library.impl.consumer.js.map +1 -0
- package/dist/native-network/index.d.ts +3 -0
- package/dist/native-network/index.d.ts.map +1 -0
- package/dist/native-network/index.js +3 -0
- package/dist/native-network/index.js.map +1 -0
- package/dist/native-network/native-host.d.ts +4 -0
- package/dist/native-network/native-host.d.ts.map +1 -0
- package/dist/native-network/native-host.js +14 -0
- package/dist/native-network/native-host.js.map +1 -0
- package/dist/native-network/native-network.descriptor.d.ts +4 -0
- package/dist/native-network/native-network.descriptor.d.ts.map +1 -0
- package/dist/native-network/native-network.descriptor.js +11 -0
- package/dist/native-network/native-network.descriptor.js.map +1 -0
- package/dist/native-network/native-network.impl.bun.d.ts +19 -0
- package/dist/native-network/native-network.impl.bun.d.ts.map +1 -0
- package/dist/native-network/native-network.impl.bun.js +190 -0
- package/dist/native-network/native-network.impl.bun.js.map +1 -0
- package/dist/native-network/native-network.plugin.d.ts +6 -0
- package/dist/native-network/native-network.plugin.d.ts.map +1 -0
- package/dist/native-network/native-network.plugin.js +27 -0
- package/dist/native-network/native-network.plugin.js.map +1 -0
- package/dist/package-plugins/index.d.ts +11 -0
- package/dist/package-plugins/index.d.ts.map +1 -0
- package/dist/package-plugins/index.js +11 -0
- package/dist/package-plugins/index.js.map +1 -0
- package/dist/package-plugins/package-plugins.capability.bun.d.ts +11 -0
- package/dist/package-plugins/package-plugins.capability.bun.d.ts.map +1 -0
- package/dist/package-plugins/package-plugins.capability.bun.js +14 -0
- package/dist/package-plugins/package-plugins.capability.bun.js.map +1 -0
- package/dist/package-plugins/primitives.impl.bun.d.ts +11 -0
- package/dist/package-plugins/primitives.impl.bun.d.ts.map +1 -0
- package/dist/package-plugins/primitives.impl.bun.js +32 -0
- package/dist/package-plugins/primitives.impl.bun.js.map +1 -0
- package/dist/package-plugins/read-admission.impl.bun.d.ts +11 -0
- package/dist/package-plugins/read-admission.impl.bun.d.ts.map +1 -0
- package/dist/package-plugins/read-admission.impl.bun.js +224 -0
- package/dist/package-plugins/read-admission.impl.bun.js.map +1 -0
- package/dist/package-plugins/schemas.d.ts +28 -0
- package/dist/package-plugins/schemas.d.ts.map +1 -0
- package/dist/package-plugins/schemas.js +3 -0
- package/dist/package-plugins/schemas.js.map +1 -0
- package/dist/process/launch-artifacts.impl.bun.d.ts +11 -0
- package/dist/process/launch-artifacts.impl.bun.d.ts.map +1 -0
- package/dist/process/launch-artifacts.impl.bun.js +25 -0
- package/dist/process/launch-artifacts.impl.bun.js.map +1 -0
- package/dist/process/process-probe.impl.bun.d.ts +15 -0
- package/dist/process/process-probe.impl.bun.d.ts.map +1 -0
- package/dist/process/process-probe.impl.bun.js +35 -0
- package/dist/process/process-probe.impl.bun.js.map +1 -0
- package/dist/process/runtime-process.impl.bun.d.ts +20 -0
- package/dist/process/runtime-process.impl.bun.d.ts.map +1 -0
- package/dist/process/runtime-process.impl.bun.js +42 -0
- package/dist/process/runtime-process.impl.bun.js.map +1 -0
- package/dist/process/schemas.d.ts +9 -0
- package/dist/process/schemas.d.ts.map +1 -0
- package/dist/process/schemas.js +3 -0
- package/dist/process/schemas.js.map +1 -0
- package/dist/process/spawn.impl.bun.d.ts +31 -0
- package/dist/process/spawn.impl.bun.d.ts.map +1 -0
- package/dist/process/spawn.impl.bun.js +66 -0
- package/dist/process/spawn.impl.bun.js.map +1 -0
- package/dist/process/which.impl.bun.d.ts +16 -0
- package/dist/process/which.impl.bun.d.ts.map +1 -0
- package/dist/process/which.impl.bun.js +25 -0
- package/dist/process/which.impl.bun.js.map +1 -0
- package/dist/pty.adapter.impl.bun.d.ts +17 -0
- package/dist/pty.adapter.impl.bun.d.ts.map +1 -0
- package/dist/pty.adapter.impl.bun.js +102 -0
- package/dist/pty.adapter.impl.bun.js.map +1 -0
- package/dist/pty.darwin.impl.bun.d.ts +11 -0
- package/dist/pty.darwin.impl.bun.d.ts.map +1 -0
- package/dist/pty.darwin.impl.bun.js +200 -0
- package/dist/pty.darwin.impl.bun.js.map +1 -0
- package/dist/pty.node-host.impl.bun.d.ts +10 -0
- package/dist/pty.node-host.impl.bun.d.ts.map +1 -0
- package/dist/pty.node-host.impl.bun.js +42 -0
- package/dist/pty.node-host.impl.bun.js.map +1 -0
- package/dist/resolution-root.impl.bun.d.ts +170 -0
- package/dist/resolution-root.impl.bun.d.ts.map +1 -0
- package/dist/resolution-root.impl.bun.js +373 -0
- package/dist/resolution-root.impl.bun.js.map +1 -0
- package/dist/restricted-execute.darwin.impl.bun.d.ts +19 -0
- package/dist/restricted-execute.darwin.impl.bun.d.ts.map +1 -0
- package/dist/restricted-execute.darwin.impl.bun.js +459 -0
- package/dist/restricted-execute.darwin.impl.bun.js.map +1 -0
- package/dist/runtime-plugin-host/daemon-execution.worker-shim.bun.d.ts +2 -0
- package/dist/runtime-plugin-host/daemon-execution.worker-shim.bun.d.ts.map +1 -0
- package/dist/runtime-plugin-host/daemon-execution.worker-shim.bun.js +31 -0
- package/dist/runtime-plugin-host/daemon-execution.worker-shim.bun.js.map +1 -0
- package/dist/runtime-plugin-host/host-hot-reload.consumer.d.ts +20 -0
- package/dist/runtime-plugin-host/host-hot-reload.consumer.d.ts.map +1 -0
- package/dist/runtime-plugin-host/host-hot-reload.consumer.js +236 -0
- package/dist/runtime-plugin-host/host-hot-reload.consumer.js.map +1 -0
- package/dist/runtime-plugin-host/hot-plugin-build.worker.consumer.d.ts +2 -0
- package/dist/runtime-plugin-host/hot-plugin-build.worker.consumer.d.ts.map +1 -0
- package/dist/runtime-plugin-host/hot-plugin-build.worker.consumer.js +66 -0
- package/dist/runtime-plugin-host/hot-plugin-build.worker.consumer.js.map +1 -0
- package/dist/runtime-plugin-host/hot-plugin-module.consumer.d.ts +45 -0
- package/dist/runtime-plugin-host/hot-plugin-module.consumer.d.ts.map +1 -0
- package/dist/runtime-plugin-host/hot-plugin-module.consumer.js +490 -0
- package/dist/runtime-plugin-host/hot-plugin-module.consumer.js.map +1 -0
- package/dist/runtime-plugin-host/hot-reload.consumer.d.ts +83 -0
- package/dist/runtime-plugin-host/hot-reload.consumer.d.ts.map +1 -0
- package/dist/runtime-plugin-host/hot-reload.consumer.js +168 -0
- package/dist/runtime-plugin-host/hot-reload.consumer.js.map +1 -0
- package/dist/runtime-plugin-host/reclaim.impl.bun.d.ts +37 -0
- package/dist/runtime-plugin-host/reclaim.impl.bun.d.ts.map +1 -0
- package/dist/runtime-plugin-host/reclaim.impl.bun.js +159 -0
- package/dist/runtime-plugin-host/reclaim.impl.bun.js.map +1 -0
- package/dist/runtime-plugin-host/runtime-plugin-host.impl.bun.d.ts +4 -0
- package/dist/runtime-plugin-host/runtime-plugin-host.impl.bun.d.ts.map +1 -0
- package/dist/runtime-plugin-host/runtime-plugin-host.impl.bun.js +181 -0
- package/dist/runtime-plugin-host/runtime-plugin-host.impl.bun.js.map +1 -0
- package/dist/runtime-plugin-host/runtime-plugin-host.plugin.d.ts +17 -0
- package/dist/runtime-plugin-host/runtime-plugin-host.plugin.d.ts.map +1 -0
- package/dist/runtime-plugin-host/runtime-plugin-host.plugin.js +36 -0
- package/dist/runtime-plugin-host/runtime-plugin-host.plugin.js.map +1 -0
- package/dist/runtime-plugin-host/runtime-thread.impl.bun.d.ts +53 -0
- package/dist/runtime-plugin-host/runtime-thread.impl.bun.d.ts.map +1 -0
- package/dist/runtime-plugin-host/runtime-thread.impl.bun.js +249 -0
- package/dist/runtime-plugin-host/runtime-thread.impl.bun.js.map +1 -0
- package/dist/runtime-plugin-host/runtime-thread.shim.bun.d.ts +2 -0
- package/dist/runtime-plugin-host/runtime-thread.shim.bun.d.ts.map +1 -0
- package/dist/runtime-plugin-host/runtime-thread.shim.bun.js +56 -0
- package/dist/runtime-plugin-host/runtime-thread.shim.bun.js.map +1 -0
- package/dist/runtime-plugin-host/schemas.d.ts +437 -0
- package/dist/runtime-plugin-host/schemas.d.ts.map +1 -0
- package/dist/runtime-plugin-host/schemas.js +54 -0
- package/dist/runtime-plugin-host/schemas.js.map +1 -0
- package/dist/runtime-plugin-host/source-watcher.consumer.d.ts +109 -0
- package/dist/runtime-plugin-host/source-watcher.consumer.d.ts.map +1 -0
- package/dist/runtime-plugin-host/source-watcher.consumer.js +383 -0
- package/dist/runtime-plugin-host/source-watcher.consumer.js.map +1 -0
- package/dist/schemas/environment.d.ts +197 -0
- package/dist/schemas/environment.d.ts.map +1 -0
- package/dist/schemas/environment.js +7 -0
- package/dist/schemas/environment.js.map +1 -0
- package/dist/schemas/host-resources.d.ts +85 -0
- package/dist/schemas/host-resources.d.ts.map +1 -0
- package/dist/schemas/host-resources.js +22 -0
- package/dist/schemas/host-resources.js.map +1 -0
- package/dist/schemas/native-image.d.ts +128 -0
- package/dist/schemas/native-image.d.ts.map +1 -0
- package/dist/schemas/native-image.js +45 -0
- package/dist/schemas/native-image.js.map +1 -0
- package/dist/schemas/native-network.d.ts +56 -0
- package/dist/schemas/native-network.d.ts.map +1 -0
- package/dist/schemas/native-network.js +55 -0
- package/dist/schemas/native-network.js.map +1 -0
- package/dist/schemas/restricted-execute.d.ts +40 -0
- package/dist/schemas/restricted-execute.d.ts.map +1 -0
- package/dist/schemas/restricted-execute.js +14 -0
- package/dist/schemas/restricted-execute.js.map +1 -0
- package/dist/schemas/runtime-socket.d.ts +8 -0
- package/dist/schemas/runtime-socket.d.ts.map +1 -0
- package/dist/schemas/runtime-socket.js +7 -0
- package/dist/schemas/runtime-socket.js.map +1 -0
- package/dist/schemas/self-spawn.d.ts +11 -0
- package/dist/schemas/self-spawn.d.ts.map +1 -0
- package/dist/schemas/self-spawn.js +3 -0
- package/dist/schemas/self-spawn.js.map +1 -0
- package/dist/schemas/standard-output.d.ts +6 -0
- package/dist/schemas/standard-output.d.ts.map +1 -0
- package/dist/schemas/standard-output.js +2 -0
- package/dist/schemas/standard-output.js.map +1 -0
- package/dist/schemas/telemetry.d.ts +25 -0
- package/dist/schemas/telemetry.d.ts.map +1 -0
- package/dist/schemas/telemetry.js +10 -0
- package/dist/schemas/telemetry.js.map +1 -0
- package/dist/schemas/test-environment.d.ts +27 -0
- package/dist/schemas/test-environment.d.ts.map +1 -0
- package/dist/schemas/test-environment.js +2 -0
- package/dist/schemas/test-environment.js.map +1 -0
- package/dist/serve-stall-start.d.ts +8 -0
- package/dist/serve-stall-start.d.ts.map +1 -0
- package/dist/serve-stall-start.js +88 -0
- package/dist/serve-stall-start.js.map +1 -0
- package/dist/serve-stall.d.ts +11 -0
- package/dist/serve-stall.d.ts.map +1 -0
- package/dist/serve-stall.js +19 -0
- package/dist/serve-stall.js.map +1 -0
- package/dist/serve-stall.plugin.d.ts +10 -0
- package/dist/serve-stall.plugin.d.ts.map +1 -0
- package/dist/serve-stall.plugin.js +34 -0
- package/dist/serve-stall.plugin.js.map +1 -0
- package/dist/services/account-home.d.ts +39 -0
- package/dist/services/account-home.d.ts.map +1 -0
- package/dist/services/account-home.js +152 -0
- package/dist/services/account-home.js.map +1 -0
- package/dist/services/cli-process-host.d.ts +50 -0
- package/dist/services/cli-process-host.d.ts.map +1 -0
- package/dist/services/cli-process-host.js +88 -0
- package/dist/services/cli-process-host.js.map +1 -0
- package/dist/services/compatibility-host.impl.bun.d.ts +4 -0
- package/dist/services/compatibility-host.impl.bun.d.ts.map +1 -0
- package/dist/services/compatibility-host.impl.bun.js +24 -0
- package/dist/services/compatibility-host.impl.bun.js.map +1 -0
- package/dist/services/executable-identity.impl.bun.d.ts +164 -0
- package/dist/services/executable-identity.impl.bun.d.ts.map +1 -0
- package/dist/services/executable-identity.impl.bun.js +73 -0
- package/dist/services/executable-identity.impl.bun.js.map +1 -0
- package/dist/services/fatal-signals.impl.bun.d.ts +15 -0
- package/dist/services/fatal-signals.impl.bun.d.ts.map +1 -0
- package/dist/services/fatal-signals.impl.bun.js +61 -0
- package/dist/services/fatal-signals.impl.bun.js.map +1 -0
- package/dist/services/graph-freshness.impl.bun.d.ts +108 -0
- package/dist/services/graph-freshness.impl.bun.d.ts.map +1 -0
- package/dist/services/graph-freshness.impl.bun.js +49 -0
- package/dist/services/graph-freshness.impl.bun.js.map +1 -0
- package/dist/services/host-identity.capability.bun.d.ts +10 -0
- package/dist/services/host-identity.capability.bun.d.ts.map +1 -0
- package/dist/services/host-identity.capability.bun.js +27 -0
- package/dist/services/host-identity.capability.bun.js.map +1 -0
- package/dist/services/host-identity.impl.bun.d.ts +53 -0
- package/dist/services/host-identity.impl.bun.d.ts.map +1 -0
- package/dist/services/host-identity.impl.bun.js +76 -0
- package/dist/services/host-identity.impl.bun.js.map +1 -0
- package/dist/services/host-resources.impl.bun.d.ts +49 -0
- package/dist/services/host-resources.impl.bun.d.ts.map +1 -0
- package/dist/services/host-resources.impl.bun.js +144 -0
- package/dist/services/host-resources.impl.bun.js.map +1 -0
- package/dist/services/http-fetch.impl.bun.d.ts +10 -0
- package/dist/services/http-fetch.impl.bun.d.ts.map +1 -0
- package/dist/services/http-fetch.impl.bun.js +38 -0
- package/dist/services/http-fetch.impl.bun.js.map +1 -0
- package/dist/services/output-plane.impl.bun.d.ts +6 -0
- package/dist/services/output-plane.impl.bun.d.ts.map +1 -0
- package/dist/services/output-plane.impl.bun.js +26 -0
- package/dist/services/output-plane.impl.bun.js.map +1 -0
- package/dist/services/process-action-lifetime.consumer.d.ts +47 -0
- package/dist/services/process-action-lifetime.consumer.d.ts.map +1 -0
- package/dist/services/process-action-lifetime.consumer.js +68 -0
- package/dist/services/process-action-lifetime.consumer.js.map +1 -0
- package/dist/services/process-view.impl.bun.d.ts +18 -0
- package/dist/services/process-view.impl.bun.d.ts.map +1 -0
- package/dist/services/process-view.impl.bun.js +17 -0
- package/dist/services/process-view.impl.bun.js.map +1 -0
- package/dist/services/runtime-host-signals.impl.bun.d.ts +8 -0
- package/dist/services/runtime-host-signals.impl.bun.d.ts.map +1 -0
- package/dist/services/runtime-host-signals.impl.bun.js +29 -0
- package/dist/services/runtime-host-signals.impl.bun.js.map +1 -0
- package/dist/services/runtime-http-listener.impl.bun.d.ts +14 -0
- package/dist/services/runtime-http-listener.impl.bun.d.ts.map +1 -0
- package/dist/services/runtime-http-listener.impl.bun.js +463 -0
- package/dist/services/runtime-http-listener.impl.bun.js.map +1 -0
- package/dist/services/runtime-path.impl.bun.d.ts +16 -0
- package/dist/services/runtime-path.impl.bun.d.ts.map +1 -0
- package/dist/services/runtime-path.impl.bun.js +34 -0
- package/dist/services/runtime-path.impl.bun.js.map +1 -0
- package/dist/services/runtime-scoped-values.impl.bun.d.ts +4 -0
- package/dist/services/runtime-scoped-values.impl.bun.d.ts.map +1 -0
- package/dist/services/runtime-scoped-values.impl.bun.js +7 -0
- package/dist/services/runtime-scoped-values.impl.bun.js.map +1 -0
- package/dist/services/runtime-socket-datagram.impl.bun.d.ts +15 -0
- package/dist/services/runtime-socket-datagram.impl.bun.d.ts.map +1 -0
- package/dist/services/runtime-socket-datagram.impl.bun.js +19 -0
- package/dist/services/runtime-socket-datagram.impl.bun.js.map +1 -0
- package/dist/services/runtime-socket.impl.bun.d.ts +20 -0
- package/dist/services/runtime-socket.impl.bun.d.ts.map +1 -0
- package/dist/services/runtime-socket.impl.bun.js +47 -0
- package/dist/services/runtime-socket.impl.bun.js.map +1 -0
- package/dist/services/runtime-stdio.impl.bun.d.ts +11 -0
- package/dist/services/runtime-stdio.impl.bun.d.ts.map +1 -0
- package/dist/services/runtime-stdio.impl.bun.js +37 -0
- package/dist/services/runtime-stdio.impl.bun.js.map +1 -0
- package/dist/services/self-spawn.impl.bun.d.ts +39 -0
- package/dist/services/self-spawn.impl.bun.d.ts.map +1 -0
- package/dist/services/self-spawn.impl.bun.js +58 -0
- package/dist/services/self-spawn.impl.bun.js.map +1 -0
- package/dist/services/standard-output.d.ts +100 -0
- package/dist/services/standard-output.d.ts.map +1 -0
- package/dist/services/standard-output.js +35 -0
- package/dist/services/standard-output.js.map +1 -0
- package/dist/services/user-environment.impl.bun.d.ts +19 -0
- package/dist/services/user-environment.impl.bun.d.ts.map +1 -0
- package/dist/services/user-environment.impl.bun.js +117 -0
- package/dist/services/user-environment.impl.bun.js.map +1 -0
- package/dist/services/workspace-env.d.ts +30 -0
- package/dist/services/workspace-env.d.ts.map +1 -0
- package/dist/services/workspace-env.js +45 -0
- package/dist/services/workspace-env.js.map +1 -0
- package/dist/services/workspace-root-probe.impl.bun.d.ts +14 -0
- package/dist/services/workspace-root-probe.impl.bun.d.ts.map +1 -0
- package/dist/services/workspace-root-probe.impl.bun.js +27 -0
- package/dist/services/workspace-root-probe.impl.bun.js.map +1 -0
- package/dist/session-members.impl.bun.d.ts +22 -0
- package/dist/session-members.impl.bun.d.ts.map +1 -0
- package/dist/session-members.impl.bun.js +74 -0
- package/dist/session-members.impl.bun.js.map +1 -0
- package/dist/sqlite-driver/index.d.ts +7 -0
- package/dist/sqlite-driver/index.d.ts.map +1 -0
- package/dist/sqlite-driver/index.js +7 -0
- package/dist/sqlite-driver/index.js.map +1 -0
- package/dist/sqlite-driver/sqlite-driver.impl.bun.d.ts +6 -0
- package/dist/sqlite-driver/sqlite-driver.impl.bun.d.ts.map +1 -0
- package/dist/sqlite-driver/sqlite-driver.impl.bun.js +269 -0
- package/dist/sqlite-driver/sqlite-driver.impl.bun.js.map +1 -0
- package/dist/sqlite-driver/sqlite-driver.plugin.d.ts +22 -0
- package/dist/sqlite-driver/sqlite-driver.plugin.d.ts.map +1 -0
- package/dist/sqlite-driver/sqlite-driver.plugin.js +44 -0
- package/dist/sqlite-driver/sqlite-driver.plugin.js.map +1 -0
- package/dist/telemetry/telemetry.d.ts +34 -0
- package/dist/telemetry/telemetry.d.ts.map +1 -0
- package/dist/telemetry/telemetry.js +2 -0
- package/dist/telemetry/telemetry.js.map +1 -0
- package/dist/telemetry/telemetry.plugin.d.ts +4 -0
- package/dist/telemetry/telemetry.plugin.d.ts.map +1 -0
- package/dist/telemetry/telemetry.plugin.js +78 -0
- package/dist/telemetry/telemetry.plugin.js.map +1 -0
- package/dist/terminal-pty-bridge.impl.bun.d.ts +31 -0
- package/dist/terminal-pty-bridge.impl.bun.d.ts.map +1 -0
- package/dist/terminal-pty-bridge.impl.bun.js +333 -0
- package/dist/terminal-pty-bridge.impl.bun.js.map +1 -0
- package/dist/test-tooling/lazy-environment.impl.bun.d.ts +16 -0
- package/dist/test-tooling/lazy-environment.impl.bun.d.ts.map +1 -0
- package/dist/test-tooling/lazy-environment.impl.bun.js +36 -0
- package/dist/test-tooling/lazy-environment.impl.bun.js.map +1 -0
- package/dist/test-tooling/starttls-refusal.d.ts +7 -0
- package/dist/test-tooling/starttls-refusal.d.ts.map +1 -0
- package/dist/test-tooling/starttls-refusal.js +50 -0
- package/dist/test-tooling/starttls-refusal.js.map +1 -0
- package/dist/test-tooling/svelte-client-preload.impl.bun.d.ts +2 -0
- package/dist/test-tooling/svelte-client-preload.impl.bun.d.ts.map +1 -0
- package/dist/test-tooling/svelte-client-preload.impl.bun.js +4 -0
- package/dist/test-tooling/svelte-client-preload.impl.bun.js.map +1 -0
- package/dist/test-tooling/svelte-compiler.impl.bun.d.ts +10 -0
- package/dist/test-tooling/svelte-compiler.impl.bun.d.ts.map +1 -0
- package/dist/test-tooling/svelte-compiler.impl.bun.js +33 -0
- package/dist/test-tooling/svelte-compiler.impl.bun.js.map +1 -0
- package/dist/test-tooling/svelte-server-preload.impl.bun.d.ts +2 -0
- package/dist/test-tooling/svelte-server-preload.impl.bun.d.ts.map +1 -0
- package/dist/test-tooling/svelte-server-preload.impl.bun.js +4 -0
- package/dist/test-tooling/svelte-server-preload.impl.bun.js.map +1 -0
- package/dist/test-tooling/test-environment.impl.bun.d.ts +45 -0
- package/dist/test-tooling/test-environment.impl.bun.d.ts.map +1 -0
- package/dist/test-tooling/test-environment.impl.bun.js +163 -0
- package/dist/test-tooling/test-environment.impl.bun.js.map +1 -0
- package/dist/test-tooling/test-process-root.impl.bun.d.ts +4 -0
- package/dist/test-tooling/test-process-root.impl.bun.d.ts.map +1 -0
- package/dist/test-tooling/test-process-root.impl.bun.js +65 -0
- package/dist/test-tooling/test-process-root.impl.bun.js.map +1 -0
- package/dist/test-tooling/unix-http.impl.bun.d.ts +28 -0
- package/dist/test-tooling/unix-http.impl.bun.d.ts.map +1 -0
- package/dist/test-tooling/unix-http.impl.bun.js +181 -0
- package/dist/test-tooling/unix-http.impl.bun.js.map +1 -0
- package/dist/transpiler/transpiler.plugin.d.ts +10 -0
- package/dist/transpiler/transpiler.plugin.d.ts.map +1 -0
- package/dist/transpiler/transpiler.plugin.js +18 -0
- package/dist/transpiler/transpiler.plugin.js.map +1 -0
- package/native/held-launch/Cargo.toml +23 -0
- package/native/held-launch/abi-manifest.json +234 -0
- package/native/held-launch/src/bin/vibes-held-launch.rs +35 -0
- package/native/held-launch/src/events.rs +99 -0
- package/native/held-launch/src/lib.rs +528 -0
- package/native/held-launch/symbols.golden +21 -0
- package/package.json +313 -4
- package/resources/restricted-supervisor.impl.bun.d.mts +3 -0
- package/resources/restricted-supervisor.impl.bun.mjs +49 -0
- package/resources/serve-stall-watch.impl.bun.d.mts +3 -0
- package/resources/serve-stall-watch.impl.bun.mjs +51 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registers the Bun host's SQLite driver under LocalDB's `localdb/sqlite-driver`
|
|
3
|
+
* kind. The host owns the kind's registration on the runtimes it builds (as it
|
|
4
|
+
* owns the paths kinds): the kind is LocalDB's frozen definition, so a second
|
|
5
|
+
* registration of it by the LocalDB plugin is a no-op. The driver module loads
|
|
6
|
+
* only when the kind is first resolved.
|
|
7
|
+
*/
|
|
8
|
+
import { createRuntimeImplementation, createRuntimePlugin } from '@vibesdotdev/kernel';
|
|
9
|
+
import { LOCALDB_SQLITE_DRIVER_KIND, sqliteDriverKind } from '@vibesdotdev/localdb/sqlite-driver';
|
|
10
|
+
import { assertNativeBunHost } from "../native-network/native-host.js";
|
|
11
|
+
/** The Bun driver's descriptor. */
|
|
12
|
+
export const bunSqliteDriverDescriptor = {
|
|
13
|
+
id: 'sqlite-driver-bun',
|
|
14
|
+
kind: LOCALDB_SQLITE_DRIVER_KIND,
|
|
15
|
+
name: 'Bun SQLite driver',
|
|
16
|
+
description: 'LocalDB SQLite driver over bun:sqlite',
|
|
17
|
+
host: 'bun',
|
|
18
|
+
hardware: ['consumer', 'cloud']
|
|
19
|
+
};
|
|
20
|
+
/** Register the kind (when absent), the Bun driver's descriptor and its lazy loader on `runtime`. */
|
|
21
|
+
export function registerBunSqliteDriver(runtime) {
|
|
22
|
+
if (!runtime.hasKind(LOCALDB_SQLITE_DRIVER_KIND))
|
|
23
|
+
runtime.registerKind(sqliteDriverKind);
|
|
24
|
+
runtime.registerDescriptor(LOCALDB_SQLITE_DRIVER_KIND, bunSqliteDriverDescriptor);
|
|
25
|
+
runtime.registerLoader(LOCALDB_SQLITE_DRIVER_KIND, bunSqliteDriverDescriptor.id, async () => {
|
|
26
|
+
assertNativeBunHost(runtime);
|
|
27
|
+
const { createBunSqliteDriver } = await import("./sqlite-driver.impl.bun.js");
|
|
28
|
+
return createRuntimeImplementation({
|
|
29
|
+
kind: LOCALDB_SQLITE_DRIVER_KIND,
|
|
30
|
+
id: bunSqliteDriverDescriptor.id,
|
|
31
|
+
constraint: { hardware: ['consumer', 'cloud'] },
|
|
32
|
+
implementation: createBunSqliteDriver()
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
/** The same registration as a plugin, for a host composed from plugins. */
|
|
37
|
+
export const bunSqliteDriverPlugin = createRuntimePlugin({
|
|
38
|
+
id: 'sqlite-driver-bun',
|
|
39
|
+
name: 'Bun SQLite driver',
|
|
40
|
+
onRegister(runtime) {
|
|
41
|
+
registerBunSqliteDriver(runtime);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
//# sourceMappingURL=sqlite-driver.plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sqlite-driver.plugin.js","sourceRoot":"","sources":["../../src/sqlite-driver/sqlite-driver.plugin.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,2BAA2B,EAAE,mBAAmB,EAAuC,MAAM,qBAAqB,CAAC;AAC5H,OAAO,EAAE,0BAA0B,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAClG,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAEvE,mCAAmC;AACnC,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACxC,EAAE,EAAE,mBAAmB;IACvB,IAAI,EAAE,0BAA0B;IAChC,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,uCAAuC;IACpD,IAAI,EAAE,KAAK;IACX,QAAQ,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC;CAC/B,CAAC;AAEF,qGAAqG;AACrG,MAAM,UAAU,uBAAuB,CAAC,OAAmB;IAC1D,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,0BAA0B,CAAC;QAAE,OAAO,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC;IACzF,OAAO,CAAC,kBAAkB,CAAC,0BAA0B,EAAE,yBAAyB,CAAC,CAAC;IAClF,OAAO,CAAC,cAAc,CAAC,0BAA0B,EAAE,yBAAyB,CAAC,EAAE,EAAE,KAAK,IAAI,EAAE;QAC3F,mBAAmB,CAAC,OAAO,CAAC,CAAC;QAC7B,MAAM,EAAE,qBAAqB,EAAE,GAAG,MAAM,MAAM,CAAC,6BAA6B,CAAC,CAAC;QAC9E,OAAO,2BAA2B,CAAC;YAClC,IAAI,EAAE,0BAA0B;YAChC,EAAE,EAAE,yBAAyB,CAAC,EAAE;YAChC,UAAU,EAAE,EAAE,QAAQ,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC,EAAE;YAC/C,cAAc,EAAE,qBAAqB,EAAE;SACvC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,2EAA2E;AAC3E,MAAM,CAAC,MAAM,qBAAqB,GAAkB,mBAAmB,CAAC;IACvE,EAAE,EAAE,mBAAmB;IACvB,IAAI,EAAE,mBAAmB;IACzB,UAAU,CAAC,OAAO;QACjB,uBAAuB,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC;CACD,CAAC,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** Structural contract of the runtime/client host-telemetry capability. */
|
|
2
|
+
import type { RuntimeClient } from '@vibesdotdev/kernel/client';
|
|
3
|
+
import type { HostTelemetry } from '../schemas/telemetry.ts';
|
|
4
|
+
export { HostTelemetrySchema, type HostTelemetry } from '../schemas/telemetry.ts';
|
|
5
|
+
export interface HostTelemetryClient extends RuntimeClient {
|
|
6
|
+
read(): HostTelemetry;
|
|
7
|
+
capabilities(): {
|
|
8
|
+
os: string;
|
|
9
|
+
kernel: string;
|
|
10
|
+
cpu: {
|
|
11
|
+
model: string | undefined;
|
|
12
|
+
cores: number;
|
|
13
|
+
};
|
|
14
|
+
ramMb: number;
|
|
15
|
+
network: {
|
|
16
|
+
publicIp: string | undefined;
|
|
17
|
+
privateIp: string | undefined;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
publicIpv4(): string | undefined;
|
|
21
|
+
heartbeat(activeJobs: number): {
|
|
22
|
+
timestamp: string;
|
|
23
|
+
uptimeSeconds: number;
|
|
24
|
+
capacity: {
|
|
25
|
+
cpuCores: number;
|
|
26
|
+
ramMb: number;
|
|
27
|
+
};
|
|
28
|
+
usage: {
|
|
29
|
+
ramPercent: number | undefined;
|
|
30
|
+
};
|
|
31
|
+
activeJobs: number;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=telemetry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../src/telemetry/telemetry.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,KAAK,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAElF,MAAM,WAAW,mBAAoB,SAAQ,aAAa;IACzD,IAAI,IAAI,aAAa,CAAC;IACtB,YAAY,IAAI;QACf,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE;YAAE,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAC;QAC9E,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE;YAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;YAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAA;SAAE,CAAC;KACxF,CAAC;IACF,UAAU,IAAI,MAAM,GAAG,SAAS,CAAC;IACjC,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG;QAC9B,SAAS,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAC;QACzC,QAAQ,EAAE;YAAE,QAAQ,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAC;QAC9C,KAAK,EAAE;YAAE,UAAU,EAAE,MAAM,GAAG,SAAS,CAAA;SAAE,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;KAC9D,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry.js","sourceRoot":"","sources":["../../src/telemetry/telemetry.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAsB,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type HostTelemetry } from '../schemas/telemetry.ts';
|
|
2
|
+
/** Tests may substitute only this native boundary; validation and client ownership stay real. */
|
|
3
|
+
export declare function hostTelemetryPlugin(readNative?: () => HostTelemetry): import("@vibesdotdev/kernel").RuntimePlugin;
|
|
4
|
+
//# sourceMappingURL=telemetry.plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry.plugin.d.ts","sourceRoot":"","sources":["../../src/telemetry/telemetry.plugin.ts"],"names":[],"mappings":"AAKA,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAsBlF,iGAAiG;AACjG,wBAAgB,mBAAmB,CAAC,UAAU,GAAE,MAAM,aAAmC,+CAiDxF"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/** Bun-owned native binding of the structural host-telemetry client contract. */
|
|
2
|
+
import { cpus, totalmem, freemem, type, release, version, uptime, networkInterfaces } from 'node:os';
|
|
3
|
+
import { CapabilityError, createRuntimePlugin, settleNow, valueFreeFailure } from '@vibesdotdev/kernel';
|
|
4
|
+
import { BaseRuntimeClient, getVibesClient } from '@vibesdotdev/kernel/client';
|
|
5
|
+
import runtimeClientPlugin from '@vibesdotdev/kernel/client/plugin';
|
|
6
|
+
import { HostTelemetrySchema } from "../schemas/telemetry.js";
|
|
7
|
+
function readNativeTelemetry() {
|
|
8
|
+
return {
|
|
9
|
+
cpus: cpus(), totalMemoryBytes: totalmem(), freeMemoryBytes: freemem(),
|
|
10
|
+
os: { type: type(), release: release(), version: version(), uptimeSeconds: uptime() },
|
|
11
|
+
interfaces: Object.values(networkInterfaces()).flat().filter(entry => entry !== undefined)
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function isReservedIpv4(address) {
|
|
15
|
+
const octets = address.split('.').map(Number);
|
|
16
|
+
if (octets.length !== 4 || octets.some(octet => !Number.isInteger(octet)))
|
|
17
|
+
return true;
|
|
18
|
+
const a = octets[0];
|
|
19
|
+
const b = octets[1];
|
|
20
|
+
return a === 0 || a === 10 || a === 127
|
|
21
|
+
|| (a === 100 && b >= 64 && b <= 127)
|
|
22
|
+
|| (a === 169 && b === 254)
|
|
23
|
+
|| (a === 172 && b >= 16 && b <= 31)
|
|
24
|
+
|| (a === 192 && b === 168);
|
|
25
|
+
}
|
|
26
|
+
/** Tests may substitute only this native boundary; validation and client ownership stay real. */
|
|
27
|
+
export function hostTelemetryPlugin(readNative = readNativeTelemetry) {
|
|
28
|
+
return createRuntimePlugin({
|
|
29
|
+
id: 'host-telemetry', name: 'Live host telemetry',
|
|
30
|
+
async onRegister(runtime) {
|
|
31
|
+
await runtime.registerPlugin(runtimeClientPlugin);
|
|
32
|
+
runtime.registerDescriptor('runtime/client', { kind: 'runtime/client', id: 'host-telemetry', name: 'Live host telemetry' });
|
|
33
|
+
runtime.registerLoader('runtime/client', 'host-telemetry', async () => ({
|
|
34
|
+
impl: class extends BaseRuntimeClient {
|
|
35
|
+
capabilities() {
|
|
36
|
+
const reading = this.read();
|
|
37
|
+
const addresses = reading.interfaces
|
|
38
|
+
.flatMap(entry => entry.family === 'IPv4' && !entry.internal ? [entry.address] : []);
|
|
39
|
+
return {
|
|
40
|
+
os: `${reading.os.type} ${reading.os.release}`,
|
|
41
|
+
kernel: reading.os.version,
|
|
42
|
+
cpu: { model: reading.cpus[0]?.model, cores: reading.cpus.length },
|
|
43
|
+
ramMb: Math.round(reading.totalMemoryBytes / 1024 / 1024),
|
|
44
|
+
network: {
|
|
45
|
+
publicIp: addresses.find(address => !isReservedIpv4(address)),
|
|
46
|
+
privateIp: addresses.find(isReservedIpv4)
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
publicIpv4() {
|
|
51
|
+
return this.capabilities().network.publicIp;
|
|
52
|
+
}
|
|
53
|
+
heartbeat(activeJobs) {
|
|
54
|
+
const reading = this.read();
|
|
55
|
+
const usedMemory = Math.max(reading.totalMemoryBytes - reading.freeMemoryBytes, 0);
|
|
56
|
+
return {
|
|
57
|
+
timestamp: new Date().toISOString(),
|
|
58
|
+
uptimeSeconds: Math.floor(reading.os.uptimeSeconds),
|
|
59
|
+
capacity: { cpuCores: reading.cpus.length, ramMb: Math.round(reading.totalMemoryBytes / 1024 / 1024) },
|
|
60
|
+
usage: { ramPercent: reading.totalMemoryBytes > 0 ? Math.min(usedMemory / reading.totalMemoryBytes * 100, 100) : undefined },
|
|
61
|
+
activeJobs
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
read() {
|
|
65
|
+
const reading = settleNow(() => HostTelemetrySchema.parse(readNative()));
|
|
66
|
+
if (reading.ok)
|
|
67
|
+
return reading.value;
|
|
68
|
+
throw new CapabilityError('The host could not read live telemetry.', 'UNAVAILABLE', {
|
|
69
|
+
reason: 'host-telemetry-read-failed', cause: valueFreeFailure(reading.cause)
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}));
|
|
74
|
+
await getVibesClient('host-telemetry', runtime);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=telemetry.plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry.plugin.js","sourceRoot":"","sources":["../../src/telemetry/telemetry.plugin.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,EAAE,UAAU,EAAE,OAAO,CAAC,gBAAgB,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,GAAG,OAAO,CAAC,gBAAgB,GAAG,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE;4BAC5H,UAAU;yBACV,CAAC;oBACH,CAAC;oBACD,IAAI;wBACH,MAAM,OAAO,GAAG,SAAS,CAAC,GAAG,EAAE,CAAC,mBAAmB,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;wBACzE,IAAI,OAAO,CAAC,EAAE;4BAAE,OAAO,OAAO,CAAC,KAAK,CAAC;wBACrC,MAAM,IAAI,eAAe,CAAC,yCAAyC,EAAE,aAAa,EAAE;4BACnF,MAAM,EAAE,4BAA4B,EAAE,KAAK,EAAE,gBAAgB,CAAC,OAAO,CAAC,KAAK,CAAC;yBAC5E,CAAC,CAAC;oBACJ,CAAC;iBACD;aACD,CAAC,CAAC,CAAC;YACJ,MAAM,cAAc,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;QACjD,CAAC;KACD,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type RuntimeRef } from '@vibesdotdev/kernel';
|
|
2
|
+
import { type ExecutionSession, type SessionOptions } from '@vibesdotdev/kernel/execution';
|
|
3
|
+
export interface PtyServerConfig extends Omit<SessionOptions, 'cols' | 'rows'> {
|
|
4
|
+
port: number;
|
|
5
|
+
cols?: number;
|
|
6
|
+
rows?: number;
|
|
7
|
+
hostname?: string;
|
|
8
|
+
/** Host admission for input queued while session opening is pending; default 64 KiB. */
|
|
9
|
+
maxOpeningInputBytes?: number;
|
|
10
|
+
}
|
|
11
|
+
interface PtyConnection {
|
|
12
|
+
closed: boolean;
|
|
13
|
+
pending: Array<string | Uint8Array>;
|
|
14
|
+
pendingBytes: number;
|
|
15
|
+
session?: ExecutionSession;
|
|
16
|
+
opening?: Promise<ExecutionSession>;
|
|
17
|
+
completion?: Promise<void>;
|
|
18
|
+
cleanup?: Promise<void>;
|
|
19
|
+
unsubscribe?: () => void;
|
|
20
|
+
}
|
|
21
|
+
/** Caller owns close(), followed by disposal of its runtime. */
|
|
22
|
+
export declare function startPtyWsServer(runtime: RuntimeRef, input: PtyServerConfig): Promise<{
|
|
23
|
+
server: Bun.Server<PtyConnection>;
|
|
24
|
+
close(): Promise<void>;
|
|
25
|
+
}>;
|
|
26
|
+
/** Parse only captured host input; environment selection remains execution-owned. */
|
|
27
|
+
export declare function ptyServerConfigFromEnv(runtime: RuntimeRef, argv?: string[]): PtyServerConfig;
|
|
28
|
+
/** Executable boundary: caller supplies the installed module-graph root. */
|
|
29
|
+
export declare function runPtyWsServerFromCli(hostRoot?: string): Promise<void>;
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=terminal-pty-bridge.impl.bun.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal-pty-bridge.impl.bun.d.ts","sourceRoot":"","sources":["../src/terminal-pty-bridge.impl.bun.ts"],"names":[],"mappings":"AAEA,OAAO,EAON,KAAK,UAAU,EACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAQN,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,MAAM,+BAA+B,CAAC;AAcvC,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7E,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wFAAwF;IACxF,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,UAAU,aAAa;IACtB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,KAAK,CAAC,MAAM,GAAG,UAAU,CAAC,CAAC;IACpC,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACpC,UAAU,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAeD,gEAAgE;AAChE,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,eAAe;;aA4MvE,OAAO,CAAC,IAAI,CAAC;GAgBvB;AAED,qFAAqF;AACrF,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,UAAU,EAAE,IAAI,GAAE,MAAM,EAAO,GAAG,eAAe,CA8ChG;AAED,4EAA4E;AAC5E,wBAAsB,qBAAqB,CAAC,QAAQ,GAAE,MAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CA8C1F"}
|
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
/** Bun websocket host for the runtime-owned terminal PTY bridge contract. */
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { bootstrapVibesRuntime, CapabilityError, CaughtFailureSchema, getRuntimeStdio, readEnv } from '@vibesdotdev/kernel';
|
|
4
|
+
import { decodeTerminalPtyClientFrame, encodeTerminalPtyExitFrame, requireExecutionEnvironmentMode, SessionOptionsSchema, terminalPtyBase64ToBytes } from '@vibesdotdev/kernel/execution';
|
|
5
|
+
import { createRuntimeEnvironmentBunPlugin } from "./index.js";
|
|
6
|
+
import * as z from 'zod/v4';
|
|
7
|
+
const CONTROL_KEYS = [
|
|
8
|
+
'PTY_WS_PORT',
|
|
9
|
+
'PTY_WS_COMMAND',
|
|
10
|
+
'PTY_WS_ARGS',
|
|
11
|
+
'PTY_WS_CWD',
|
|
12
|
+
'PTY_WS_COLS',
|
|
13
|
+
'PTY_WS_ROWS',
|
|
14
|
+
'PTY_WS_ENV_POLICY'
|
|
15
|
+
];
|
|
16
|
+
const PtySocketMessageSchema = z.union([
|
|
17
|
+
z.string().transform((data) => ({
|
|
18
|
+
kind: 'text',
|
|
19
|
+
data,
|
|
20
|
+
byteLength: new TextEncoder().encode(data).byteLength
|
|
21
|
+
})),
|
|
22
|
+
z.instanceof(Uint8Array).transform((data) => ({
|
|
23
|
+
kind: 'bytes',
|
|
24
|
+
data: new Uint8Array(data),
|
|
25
|
+
byteLength: data.byteLength
|
|
26
|
+
}))
|
|
27
|
+
]);
|
|
28
|
+
/** Caller owns close(), followed by disposal of its runtime. */
|
|
29
|
+
export async function startPtyWsServer(runtime, input) {
|
|
30
|
+
requireExecutionEnvironmentMode(input);
|
|
31
|
+
if (CONTROL_KEYS.some((key) => Object.hasOwn(input.env ?? {}, key))) {
|
|
32
|
+
throw new CapabilityError('PTY workload environment collides with a reserved bridge control key.', 'INVALID_INPUT', { reason: 'pty-environment-control-collision', retryable: false });
|
|
33
|
+
}
|
|
34
|
+
const maxOpeningInputBytes = input.maxOpeningInputBytes ?? 65_536;
|
|
35
|
+
if (!Number.isSafeInteger(maxOpeningInputBytes) || maxOpeningInputBytes < 0) {
|
|
36
|
+
throw new CapabilityError('Invalid PTY opening input budget.', 'INVALID_INPUT', {
|
|
37
|
+
reason: 'pty-opening-input-budget-invalid',
|
|
38
|
+
retryable: false
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
const parsed = SessionOptionsSchema.safeParse({
|
|
42
|
+
...input,
|
|
43
|
+
cols: input.cols ?? 80,
|
|
44
|
+
rows: input.rows ?? 24
|
|
45
|
+
});
|
|
46
|
+
if (!parsed.success) {
|
|
47
|
+
throw new CapabilityError('Invalid PTY session request.', 'INVALID_INPUT', {
|
|
48
|
+
reason: 'pty-session-request-invalid',
|
|
49
|
+
retryable: false
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
const config = {
|
|
53
|
+
...parsed.data,
|
|
54
|
+
unsetEnv: [...(parsed.data.unsetEnv ?? []), ...CONTROL_KEYS],
|
|
55
|
+
port: input.port,
|
|
56
|
+
hostname: input.hostname
|
|
57
|
+
};
|
|
58
|
+
const execution = await runtime
|
|
59
|
+
.query('runtime/execution')
|
|
60
|
+
.resolve();
|
|
61
|
+
const connections = new Set();
|
|
62
|
+
const failures = [];
|
|
63
|
+
let closing;
|
|
64
|
+
const captureFailure = (operation) => {
|
|
65
|
+
try {
|
|
66
|
+
operation();
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
catch (cause) {
|
|
70
|
+
return CaughtFailureSchema.parse(cause);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
function deliver(session, message) {
|
|
74
|
+
if (message instanceof Uint8Array) {
|
|
75
|
+
session.write(new Uint8Array(message));
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const frame = decodeTerminalPtyClientFrame(message);
|
|
79
|
+
if (frame.t === 'stdin')
|
|
80
|
+
session.write(terminalPtyBase64ToBytes(frame.d));
|
|
81
|
+
else if (frame.t === 'resize')
|
|
82
|
+
session.resize(frame.cols, frame.rows);
|
|
83
|
+
else
|
|
84
|
+
session.signal(frame.name);
|
|
85
|
+
}
|
|
86
|
+
function cleanup(connection) {
|
|
87
|
+
connection.closed = true;
|
|
88
|
+
connection.pending = [];
|
|
89
|
+
connection.pendingBytes = 0;
|
|
90
|
+
connection.cleanup ??= (async () => {
|
|
91
|
+
const session = connection.session ?? (await connection.opening);
|
|
92
|
+
if (session) {
|
|
93
|
+
session.kill();
|
|
94
|
+
await session.exited();
|
|
95
|
+
}
|
|
96
|
+
await connection.completion;
|
|
97
|
+
connection.unsubscribe?.();
|
|
98
|
+
connections.delete(connection);
|
|
99
|
+
})();
|
|
100
|
+
return connection.cleanup;
|
|
101
|
+
}
|
|
102
|
+
function observeCleanup(connection) {
|
|
103
|
+
void cleanup(connection)
|
|
104
|
+
.then(() => ({ kind: 'success' }), (cause) => ({
|
|
105
|
+
kind: 'failure',
|
|
106
|
+
failure: CaughtFailureSchema.parse(cause)
|
|
107
|
+
}))
|
|
108
|
+
.then((outcome) => {
|
|
109
|
+
if (outcome.kind === 'failure')
|
|
110
|
+
failures.push(outcome.failure);
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
const server = Bun.serve({
|
|
114
|
+
port: config.port,
|
|
115
|
+
hostname: config.hostname ?? '0.0.0.0',
|
|
116
|
+
fetch(request, nativeServer) {
|
|
117
|
+
if (closing)
|
|
118
|
+
return new Response('closing', { status: 503 });
|
|
119
|
+
if (nativeServer.upgrade(request, {
|
|
120
|
+
data: { closed: false, pending: [], pendingBytes: 0 }
|
|
121
|
+
})) {
|
|
122
|
+
return undefined;
|
|
123
|
+
}
|
|
124
|
+
return new Response('terminal-pty-bridge: websocket upgrade required', { status: 426 });
|
|
125
|
+
},
|
|
126
|
+
websocket: {
|
|
127
|
+
perMessageDeflate: false,
|
|
128
|
+
open(socket) {
|
|
129
|
+
const connection = socket.data;
|
|
130
|
+
connections.add(connection);
|
|
131
|
+
connection.opening = Promise.resolve().then(() => execution.session({
|
|
132
|
+
command: config.command,
|
|
133
|
+
args: config.args,
|
|
134
|
+
cwd: config.cwd,
|
|
135
|
+
env: config.env,
|
|
136
|
+
envMode: config.envMode,
|
|
137
|
+
inheritReason: config.inheritReason,
|
|
138
|
+
unsetEnv: config.unsetEnv,
|
|
139
|
+
cols: config.cols ?? 80,
|
|
140
|
+
rows: config.rows ?? 24
|
|
141
|
+
}));
|
|
142
|
+
connection.completion = connection.opening
|
|
143
|
+
.then(async (session) => {
|
|
144
|
+
connection.session = session;
|
|
145
|
+
if (connection.closed)
|
|
146
|
+
return;
|
|
147
|
+
connection.unsubscribe = session.onOutput((bytes) => {
|
|
148
|
+
if (!connection.closed)
|
|
149
|
+
socket.sendBinary(bytes);
|
|
150
|
+
});
|
|
151
|
+
for (const message of connection.pending)
|
|
152
|
+
deliver(session, message);
|
|
153
|
+
connection.pending = [];
|
|
154
|
+
connection.pendingBytes = 0;
|
|
155
|
+
const { exitCode } = await session.exited();
|
|
156
|
+
if (!connection.closed) {
|
|
157
|
+
socket.send(encodeTerminalPtyExitFrame(exitCode));
|
|
158
|
+
socket.close(1000, 'pty-exit');
|
|
159
|
+
}
|
|
160
|
+
})
|
|
161
|
+
.then(() => ({ kind: 'success' }), (cause) => ({
|
|
162
|
+
kind: 'failure',
|
|
163
|
+
failure: CaughtFailureSchema.parse(cause)
|
|
164
|
+
}))
|
|
165
|
+
.then((outcome) => {
|
|
166
|
+
if (outcome.kind !== 'failure')
|
|
167
|
+
return;
|
|
168
|
+
failures.push(outcome.failure);
|
|
169
|
+
const closeFailure = captureFailure(() => socket.close(1011, 'pty-session-failed'));
|
|
170
|
+
if (closeFailure)
|
|
171
|
+
failures.push(closeFailure);
|
|
172
|
+
observeCleanup(connection);
|
|
173
|
+
});
|
|
174
|
+
},
|
|
175
|
+
message(socket, message) {
|
|
176
|
+
const connection = socket.data;
|
|
177
|
+
if (connection.closed)
|
|
178
|
+
return;
|
|
179
|
+
const parsed = PtySocketMessageSchema.safeParse(message);
|
|
180
|
+
if (!parsed.success) {
|
|
181
|
+
failures.push(new CapabilityError('Invalid PTY websocket message.', 'INVALID_INPUT', {
|
|
182
|
+
reason: 'pty-websocket-message-invalid',
|
|
183
|
+
retryable: false,
|
|
184
|
+
cause: parsed.error
|
|
185
|
+
}));
|
|
186
|
+
const closeFailure = captureFailure(() => socket.close(1011, 'pty-session-failed'));
|
|
187
|
+
if (closeFailure)
|
|
188
|
+
failures.push(closeFailure);
|
|
189
|
+
observeCleanup(connection);
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
const admitted = parsed.data;
|
|
193
|
+
const session = connection.session;
|
|
194
|
+
if (!session) {
|
|
195
|
+
connection.pendingBytes += admitted.byteLength;
|
|
196
|
+
if (connection.pendingBytes > maxOpeningInputBytes) {
|
|
197
|
+
socket.close(1009, 'pty-opening-input-limit');
|
|
198
|
+
observeCleanup(connection);
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
connection.pending.push(admitted.data);
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
const deliveryFailure = captureFailure(() => deliver(session, admitted.data));
|
|
205
|
+
if (deliveryFailure) {
|
|
206
|
+
failures.push(deliveryFailure);
|
|
207
|
+
const closeFailure = captureFailure(() => socket.close(1011, 'pty-session-failed'));
|
|
208
|
+
if (closeFailure)
|
|
209
|
+
failures.push(closeFailure);
|
|
210
|
+
observeCleanup(connection);
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
close(socket) {
|
|
214
|
+
observeCleanup(socket.data);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
return {
|
|
219
|
+
server,
|
|
220
|
+
close() {
|
|
221
|
+
closing ??= (async () => {
|
|
222
|
+
server.stop(true);
|
|
223
|
+
await runtime.lifecycle.wait(async () => {
|
|
224
|
+
await Promise.all([...connections].map(cleanup));
|
|
225
|
+
}, { timeoutMs: 10_000, reason: 'pty-bridge-session-cleanup' });
|
|
226
|
+
if (failures.length > 0) {
|
|
227
|
+
throw new AggregateError(failures, 'PTY bridge session cleanup failed');
|
|
228
|
+
}
|
|
229
|
+
})();
|
|
230
|
+
return closing;
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
/** Parse only captured host input; environment selection remains execution-owned. */
|
|
235
|
+
export function ptyServerConfigFromEnv(runtime, argv = []) {
|
|
236
|
+
const host = {
|
|
237
|
+
platform: runtime.localEnvironment.getPlatform?.(),
|
|
238
|
+
snapshot: runtime.getEnvSnapshot()
|
|
239
|
+
};
|
|
240
|
+
const read = (key) => readEnv(host, key);
|
|
241
|
+
const port = Number(read('PTY_WS_PORT') ?? argv[0] ?? '7681');
|
|
242
|
+
if (!Number.isInteger(port) || port <= 0 || port > 65_535) {
|
|
243
|
+
throw new CapabilityError('Invalid PTY bridge port.', 'INVALID_INPUT', {
|
|
244
|
+
reason: 'pty-port-invalid',
|
|
245
|
+
retryable: false
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
let policy;
|
|
249
|
+
try {
|
|
250
|
+
policy = JSON.parse(read('PTY_WS_ENV_POLICY') ?? 'null');
|
|
251
|
+
}
|
|
252
|
+
catch (cause) {
|
|
253
|
+
throw new CapabilityError('Invalid PTY environment policy.', 'INVALID_INPUT', {
|
|
254
|
+
reason: 'pty-environment-policy-invalid',
|
|
255
|
+
retryable: false,
|
|
256
|
+
cause
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
requireExecutionEnvironmentMode(policy);
|
|
260
|
+
let args = argv.slice(2);
|
|
261
|
+
const argsJson = read('PTY_WS_ARGS');
|
|
262
|
+
if (argsJson !== undefined) {
|
|
263
|
+
try {
|
|
264
|
+
args = JSON.parse(argsJson);
|
|
265
|
+
}
|
|
266
|
+
catch (cause) {
|
|
267
|
+
throw new CapabilityError('Invalid PTY argument list.', 'INVALID_INPUT', {
|
|
268
|
+
reason: 'pty-arguments-invalid',
|
|
269
|
+
retryable: false,
|
|
270
|
+
cause
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
return {
|
|
275
|
+
...policy,
|
|
276
|
+
port,
|
|
277
|
+
command: read('PTY_WS_COMMAND') ?? argv[1] ?? 'bash',
|
|
278
|
+
args,
|
|
279
|
+
cwd: read('PTY_WS_CWD'),
|
|
280
|
+
cols: read('PTY_WS_COLS') ? Number(read('PTY_WS_COLS')) : undefined,
|
|
281
|
+
rows: read('PTY_WS_ROWS') ? Number(read('PTY_WS_ROWS')) : undefined
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
/** Executable boundary: caller supplies the installed module-graph root. */
|
|
285
|
+
export async function runPtyWsServerFromCli(hostRoot = Bun.argv[2]) {
|
|
286
|
+
if (!hostRoot) {
|
|
287
|
+
throw new CapabilityError('PTY bridge requires its host module root.', 'INVALID_INPUT', {
|
|
288
|
+
reason: 'pty-host-root-missing',
|
|
289
|
+
retryable: false
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
const runtime = await bootstrapVibesRuntime({
|
|
293
|
+
binding: 'owned',
|
|
294
|
+
environment: createRuntimeEnvironmentBunPlugin({
|
|
295
|
+
host: { root: hostRoot },
|
|
296
|
+
heldLaunch: { manifestPath: join(hostRoot, 'native/held-launch/manifest.json') },
|
|
297
|
+
scope: {
|
|
298
|
+
surface: 'cli',
|
|
299
|
+
hardware: 'consumer',
|
|
300
|
+
purpose: 'direct',
|
|
301
|
+
lifecycle: 'persistent',
|
|
302
|
+
hosting: { mode: 'local', owner: 'consumer', venue: 'user-device' }
|
|
303
|
+
}
|
|
304
|
+
}),
|
|
305
|
+
composition: { kind: 'literal', plugins: [] }
|
|
306
|
+
});
|
|
307
|
+
let bridge;
|
|
308
|
+
try {
|
|
309
|
+
bridge = await startPtyWsServer(runtime, ptyServerConfigFromEnv(runtime, Bun.argv.slice(3)));
|
|
310
|
+
const stdio = await getRuntimeStdio(runtime);
|
|
311
|
+
stdio.write('stdout', `[terminal-pty-bridge] listening on ${bridge.server.hostname}:${bridge.server.port}\n`);
|
|
312
|
+
await new Promise((resolve) => {
|
|
313
|
+
const stop = () => {
|
|
314
|
+
process.off('SIGTERM', stop);
|
|
315
|
+
process.off('SIGINT', stop);
|
|
316
|
+
resolve();
|
|
317
|
+
};
|
|
318
|
+
process.once('SIGTERM', stop);
|
|
319
|
+
process.once('SIGINT', stop);
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
finally {
|
|
323
|
+
try {
|
|
324
|
+
await bridge?.close();
|
|
325
|
+
}
|
|
326
|
+
finally {
|
|
327
|
+
await runtime.dispose();
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
if (import.meta.main)
|
|
332
|
+
await runPtyWsServerFromCli();
|
|
333
|
+
//# sourceMappingURL=terminal-pty-bridge.impl.bun.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal-pty-bridge.impl.bun.js","s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3
|
+
import type { bunHttpListenerPlugin as HttpListenerFactory } from '../http-listener.impl.bun.ts';
|
|
4
|
+
import type { bunLocalExecutionPlugin as LocalExecutionFactory } from '../local-execution.impl.bun.ts';
|
|
5
|
+
/** The environment plugin factory of the package root, loaded on first call. */
|
|
6
|
+
export declare const createRuntimeEnvironmentBunPlugin: typeof EnvironmentFactory;
|
|
7
|
+
/** The local-execution plugin factory of `./local-execution`, loaded on first call. */
|
|
8
|
+
export declare const bunLocalExecutionPlugin: typeof LocalExecutionFactory;
|
|
9
|
+
/** The HTTP-listener plugin factory of `./http-listener`, loaded on first call. */
|
|
10
|
+
export declare const bunHttpListenerPlugin: typeof HttpListenerFactory;
|
|
11
|
+
/** The environment a test execution runtime composes when the test supplies none: the Bun host over one fixture home. */
|
|
12
|
+
export declare function createBunTestExecutionEnvironment(options: {
|
|
13
|
+
scope: RuntimeScope;
|
|
14
|
+
home: string;
|
|
15
|
+
}): RuntimePlugin;
|
|
16
|
+
//# sourceMappingURL=lazy-environment.impl.bun.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lazy-environment.impl.bun.d.ts","sourceRoot":"","sources":["../../src/test-tooling/lazy-environment.impl.bun.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,KAAK,EAAE,iCAAiC,IAAI,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC3F,OAAO,KAAK,EAAE,qBAAqB,IAAI,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACjG,OAAO,KAAK,EAAE,uBAAuB,IAAI,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAsBvG,gFAAgF;AAChF,eAAO,MAAM,iCAAiC,EAAE,OAAO,kBACQ,CAAC;AAEhE,uFAAuF;AACvF,eAAO,MAAM,uBAAuB,EAAE,OAAO,qBACW,CAAC;AAEzD,mFAAmF;AACnF,eAAO,MAAM,qBAAqB,EAAE,OAAO,mBACS,CAAC;AAErD,yHAAyH;AACzH,wBAAgB,iCAAiC,CAAC,OAAO,EAAE;IAAE,KAAK,EAAE,YAAY,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,aAAa,CAE/G"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Bun host's plugin factories for test composition roots, loaded on first call.
|
|
3
|
+
*
|
|
4
|
+
* `@vibesdotdev/testing/test-environment` offers these under the Bun host's own names. They must not be
|
|
5
|
+
* reachable from that root's import graph: the host's restricted-execution supervisor is a Bun-only
|
|
6
|
+
* `with { type: 'text' }` import, and a Vite-evaluated graph (a Vitest file) executes that supervisor as
|
|
7
|
+
* a module and blocks on its descriptor read. This module's graph holds types and `node:module` only; each
|
|
8
|
+
* factory loads the real host through the host's own module loader when it is first called, where Bun's
|
|
9
|
+
* native loader resolves the text import.
|
|
10
|
+
*/
|
|
11
|
+
import { createRequire } from 'node:module';
|
|
12
|
+
const loadHost = createRequire(import.meta.url);
|
|
13
|
+
// The specifiers are the package's own subpaths, resolved from this file's package, so source and dist agree.
|
|
14
|
+
function environmentModule() {
|
|
15
|
+
// SAFETY: the specifier names this package's `.` export, whose shape `EnvironmentModule` states.
|
|
16
|
+
return loadHost('@vibesdotdev/host-bun');
|
|
17
|
+
}
|
|
18
|
+
function localExecutionModule() {
|
|
19
|
+
// SAFETY: the specifier names this package's `./local-execution` export, whose shape `LocalExecutionModule` states.
|
|
20
|
+
return loadHost('@vibesdotdev/host-bun/local-execution');
|
|
21
|
+
}
|
|
22
|
+
function httpListenerModule() {
|
|
23
|
+
// SAFETY: the specifier names this package's `./http-listener` export, whose shape `HttpListenerModule` states.
|
|
24
|
+
return loadHost('@vibesdotdev/host-bun/http-listener');
|
|
25
|
+
}
|
|
26
|
+
/** The environment plugin factory of the package root, loaded on first call. */
|
|
27
|
+
export const createRuntimeEnvironmentBunPlugin = (...args) => environmentModule().createRuntimeEnvironmentBunPlugin(...args);
|
|
28
|
+
/** The local-execution plugin factory of `./local-execution`, loaded on first call. */
|
|
29
|
+
export const bunLocalExecutionPlugin = (...args) => localExecutionModule().bunLocalExecutionPlugin(...args);
|
|
30
|
+
/** The HTTP-listener plugin factory of `./http-listener`, loaded on first call. */
|
|
31
|
+
export const bunHttpListenerPlugin = (...args) => httpListenerModule().bunHttpListenerPlugin(...args);
|
|
32
|
+
/** The environment a test execution runtime composes when the test supplies none: the Bun host over one fixture home. */
|
|
33
|
+
export function createBunTestExecutionEnvironment(options) {
|
|
34
|
+
return createRuntimeEnvironmentBunPlugin({ scope: options.scope, paths: { vibesHome: options.home } });
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=lazy-environment.impl.bun.js.map
|