@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,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Bun host's UDP datagram binding for the `runtime/socket` kind: the
|
|
3
|
+
* kernel's datagram base (`bindDatagram`: option admission, custody of the
|
|
4
|
+
* half-made socket, multicast setup and the typed `socket-udp-*` refusals) over
|
|
5
|
+
* this host's own native socket, `node:dgram`, which Bun implements with the
|
|
6
|
+
* event, membership and option calls the base makes.
|
|
7
|
+
*/
|
|
8
|
+
import { type NativeDatagramSocketFactory } from '@vibesdotdev/execution-local';
|
|
9
|
+
import type { BoundDatagramSocket, DatagramBindOptions, DatagramHandlers } from '@vibesdotdev/kernel/socket';
|
|
10
|
+
/**
|
|
11
|
+
* Bind one UDP socket on this host. Absent `host` the socket binds loopback (`127.0.0.1`, or `::1` for
|
|
12
|
+
* IPv6); a caller who wants every interface passes `0.0.0.0`. `makeSocket` is a test seam.
|
|
13
|
+
*/
|
|
14
|
+
export declare function bindBunDatagram(options: DatagramBindOptions, handlers: DatagramHandlers, makeSocket?: NativeDatagramSocketFactory): Promise<BoundDatagramSocket>;
|
|
15
|
+
//# sourceMappingURL=runtime-socket-datagram.impl.bun.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-socket-datagram.impl.bun.d.ts","sourceRoot":"","sources":["../../src/services/runtime-socket-datagram.impl.bun.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAgB,KAAK,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAC9F,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAK7G;;;GAGG;AACH,wBAAgB,eAAe,CAC9B,OAAO,EAAE,mBAAmB,EAC5B,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,GAAE,2BAA+C,GACzD,OAAO,CAAC,mBAAmB,CAAC,CAE9B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Bun host's UDP datagram binding for the `runtime/socket` kind: the
|
|
3
|
+
* kernel's datagram base (`bindDatagram`: option admission, custody of the
|
|
4
|
+
* half-made socket, multicast setup and the typed `socket-udp-*` refusals) over
|
|
5
|
+
* this host's own native socket, `node:dgram`, which Bun implements with the
|
|
6
|
+
* event, membership and option calls the base makes.
|
|
7
|
+
*/
|
|
8
|
+
import { createSocket } from 'node:dgram';
|
|
9
|
+
import { bindDatagram } from '@vibesdotdev/execution-local';
|
|
10
|
+
/** This host's native socket factory. */
|
|
11
|
+
const bunDatagramSocket = options => createSocket(options);
|
|
12
|
+
/**
|
|
13
|
+
* Bind one UDP socket on this host. Absent `host` the socket binds loopback (`127.0.0.1`, or `::1` for
|
|
14
|
+
* IPv6); a caller who wants every interface passes `0.0.0.0`. `makeSocket` is a test seam.
|
|
15
|
+
*/
|
|
16
|
+
export function bindBunDatagram(options, handlers, makeSocket = bunDatagramSocket) {
|
|
17
|
+
return bindDatagram(options, handlers, makeSocket);
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=runtime-socket-datagram.impl.bun.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-socket-datagram.impl.bun.js","sourceRoot":"","sources":["../../src/services/runtime-socket-datagram.impl.bun.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAoC,MAAM,8BAA8B,CAAC;AAG9F,yCAAyC;AACzC,MAAM,iBAAiB,GAAgC,OAAO,CAAC,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;AAExF;;;GAGG;AACH,MAAM,UAAU,eAAe,CAC9B,OAA4B,EAC5B,QAA0B,EAC1B,aAA0C,iBAAiB;IAE3D,OAAO,YAAY,CAAC,OAAO,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Bun host's `runtime/socket` service: the kernel's
|
|
3
|
+
* `RuntimeSocketServiceBase` (endpoint naming and validation, the stale-socket
|
|
4
|
+
* proof before removal, listener permissions, connection wiring, the bounded
|
|
5
|
+
* connect wait and every typed refusal) over this host's own primitives: its
|
|
6
|
+
* `node:net` stream sockets, `node:fs` socket-file calls, path mechanics
|
|
7
|
+
* (`bunRuntimePath`), SHA-256, process probe (`lsof`) and UDP binding
|
|
8
|
+
* (`bindBunDatagram`).
|
|
9
|
+
*/
|
|
10
|
+
import { RuntimeSocketServiceBase } from '@vibesdotdev/execution-local';
|
|
11
|
+
import type { RuntimeSocketDescriptor } from '@vibesdotdev/kernel/socket';
|
|
12
|
+
import type { BunRuntimeSocketHost } from '../schemas/runtime-socket.ts';
|
|
13
|
+
export type { BunRuntimeSocketHost } from '../schemas/runtime-socket.ts';
|
|
14
|
+
/** Map a local endpoint path onto the host's IPC namespace (a named pipe on Windows). */
|
|
15
|
+
export declare function normalizeLocalSocketPath(rawPath: string, platform: string): string;
|
|
16
|
+
export declare class BunRuntimeSocketService extends RuntimeSocketServiceBase {
|
|
17
|
+
/** `home` is the active Vibes home from the environment's path roots; local sockets live under it. */
|
|
18
|
+
constructor(descriptor: RuntimeSocketDescriptor | undefined, home: string, host: BunRuntimeSocketHost);
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=runtime-socket.impl.bun.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-socket.impl.bun.d.ts","sourceRoot":"","sources":["../../src/services/runtime-socket.impl.bun.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,OAAO,EAAkD,wBAAwB,EAAyH,MAAM,8BAA8B,CAAC;AAC/O,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAE1E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAIzE,YAAY,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAuBzE,yFAAyF;AACzF,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAElF;AAED,qBAAa,uBAAwB,SAAQ,wBAAwB;IACpE,sGAAsG;gBAC1F,UAAU,EAAE,uBAAuB,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAoB;CAGrG"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Bun host's `runtime/socket` service: the kernel's
|
|
3
|
+
* `RuntimeSocketServiceBase` (endpoint naming and validation, the stale-socket
|
|
4
|
+
* proof before removal, listener permissions, connection wiring, the bounded
|
|
5
|
+
* connect wait and every typed refusal) over this host's own primitives: its
|
|
6
|
+
* `node:net` stream sockets, `node:fs` socket-file calls, path mechanics
|
|
7
|
+
* (`bunRuntimePath`), SHA-256, process probe (`lsof`) and UDP binding
|
|
8
|
+
* (`bindBunDatagram`).
|
|
9
|
+
*/
|
|
10
|
+
import { createConnection, createServer } from 'node:net';
|
|
11
|
+
import { existsSync, statSync } from 'node:fs';
|
|
12
|
+
import { chmod, mkdir, unlink } from 'node:fs/promises';
|
|
13
|
+
import { createHash } from 'node:crypto';
|
|
14
|
+
import { createHostSocketDescriptor, localSocketPathFor, RuntimeSocketServiceBase } from '@vibesdotdev/execution-local';
|
|
15
|
+
import { probe } from "../process/process-probe.impl.bun.js";
|
|
16
|
+
import { bindBunDatagram } from "./runtime-socket-datagram.impl.bun.js";
|
|
17
|
+
import { bunRuntimePath } from "./runtime-path.impl.bun.js";
|
|
18
|
+
/** This host's own native calls, lent to the kernel's socket service base. */
|
|
19
|
+
const bunSocketPrimitives = Object.freeze({
|
|
20
|
+
connect: (target) => createConnection(target),
|
|
21
|
+
createServer: (onConnection) => createServer(onConnection),
|
|
22
|
+
files: Object.freeze({
|
|
23
|
+
exists: (path) => existsSync(path),
|
|
24
|
+
stat: (path) => statSync(path),
|
|
25
|
+
unlink: (path) => unlink(path),
|
|
26
|
+
mkdirRecursive: async (path, mode) => {
|
|
27
|
+
await mkdir(path, { recursive: true, mode });
|
|
28
|
+
},
|
|
29
|
+
chmod: (path, mode) => chmod(path, mode)
|
|
30
|
+
}),
|
|
31
|
+
path: bunRuntimePath,
|
|
32
|
+
sha256Hex: (text) => createHash('sha256').update(text).digest('hex'),
|
|
33
|
+
probe,
|
|
34
|
+
datagram: Object.freeze({ bindUdp: bindBunDatagram })
|
|
35
|
+
});
|
|
36
|
+
const BUN_SOCKET_IDENTITY = Object.freeze({ id: 'bun-socket-service', name: 'Bun Runtime Socket Service' });
|
|
37
|
+
/** Map a local endpoint path onto the host's IPC namespace (a named pipe on Windows). */
|
|
38
|
+
export function normalizeLocalSocketPath(rawPath, platform) {
|
|
39
|
+
return localSocketPathFor(bunSocketPrimitives, rawPath, platform);
|
|
40
|
+
}
|
|
41
|
+
export class BunRuntimeSocketService extends RuntimeSocketServiceBase {
|
|
42
|
+
/** `home` is the active Vibes home from the environment's path roots; local sockets live under it. */
|
|
43
|
+
constructor(descriptor, home, host) {
|
|
44
|
+
super(bunSocketPrimitives, home, host, descriptor ?? createHostSocketDescriptor(BUN_SOCKET_IDENTITY, host.platform));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=runtime-socket.impl.bun.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-socket.impl.bun.js","sourceRoot":"","sources":["../../src/services/runtime-socket.impl.bun.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,k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AE,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC;CACrD,CAAC,CAAC;AAEH,MAAM,mBAAmB,GAAiC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,4BAA4B,EAAE,CAAC,CAAC;AAE1I,yFAAyF;AACzF,MAAM,UAAU,wBAAwB,CAAC,OAAe,EAAE,QAAgB;IACzE,OAAO,kBAAkB,CAAC,mBAAmB,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AACnE,CAAC;AAED,MAAM,OAAO,uBAAwB,SAAQ,wBAAwB;IACpE,sGAAsG;IACtG,YAAY,UAA+C,EAAE,IAAY,EAAE,IAA0B;QACpG,KAAK,CAAC,mBAAmB,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,IAAI,0BAA0B,CAAC,mBAAmB,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;IACtH,CAAC;CACD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Runtime-local capture over explicitly composed Bun physical resources. */
|
|
2
|
+
import type { RuntimeRef } from '@vibesdotdev/kernel';
|
|
3
|
+
import { RuntimeStdioBase } from '@vibesdotdev/execution-local';
|
|
4
|
+
import { createBunHostResources } from './host-resources.impl.bun.ts';
|
|
5
|
+
/** Direct providers borrow the activated client; lifecycle-only callers own their resources. */
|
|
6
|
+
export declare class BunRuntimeStdio extends RuntimeStdioBase {
|
|
7
|
+
#private;
|
|
8
|
+
constructor(runtime: Pick<RuntimeRef, 'lifecycle'> & Partial<Pick<RuntimeRef, 'hasKind' | 'query'>>, host?: ReturnType<typeof createBunHostResources>);
|
|
9
|
+
dispose(): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=runtime-stdio.impl.bun.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-stdio.impl.bun.d.ts","sourceRoot":"","sources":["../../src/services/runtime-stdio.impl.bun.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAA2B,MAAM,8BAA8B,CAAC;AAGzF,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAQtE,gGAAgG;AAChG,qBAAa,eAAgB,SAAQ,gBAAgB;;gBAGxC,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,WAAW,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,SAAS,GAAG,OAAO,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,UAAU,CAAC,OAAO,sBAAsB,CAAC;IAmBtI,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAMvC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { RuntimeStdioBase } from '@vibesdotdev/execution-local';
|
|
2
|
+
import { tryGetVibesClient } from '@vibesdotdev/kernel/client';
|
|
3
|
+
import { createBunHostResources } from "./host-resources.impl.bun.js";
|
|
4
|
+
function isTextChunk(chunk) {
|
|
5
|
+
return typeof chunk === 'string';
|
|
6
|
+
}
|
|
7
|
+
const bunNativeBytes = (chunk, encoding) => isTextChunk(chunk) ? Buffer.from(chunk, encoding) : Buffer.from(chunk);
|
|
8
|
+
/** Direct providers borrow the activated client; lifecycle-only callers own their resources. */
|
|
9
|
+
export class BunRuntimeStdio extends RuntimeStdioBase {
|
|
10
|
+
#ownedHost;
|
|
11
|
+
constructor(runtime, host) {
|
|
12
|
+
const client = !host && runtime.hasKind && runtime.query
|
|
13
|
+
? tryGetVibesClient('bun-host', {
|
|
14
|
+
hasKind: runtime.hasKind.bind(runtime), query: runtime.query.bind(runtime), lifecycle: runtime.lifecycle
|
|
15
|
+
})
|
|
16
|
+
: undefined;
|
|
17
|
+
const resources = host ?? client?.resources ?? createBunHostResources();
|
|
18
|
+
super(runtime, {
|
|
19
|
+
stdout: process.stdout,
|
|
20
|
+
stderr: process.stderr,
|
|
21
|
+
console,
|
|
22
|
+
stdin: process.stdin,
|
|
23
|
+
toNativeBytes: bunNativeBytes,
|
|
24
|
+
outputPlane: resources.outputPlane,
|
|
25
|
+
streams: () => resources.streams()
|
|
26
|
+
});
|
|
27
|
+
this.#ownedHost = host || client ? undefined : resources;
|
|
28
|
+
}
|
|
29
|
+
async dispose() {
|
|
30
|
+
const outcomes = await Promise.allSettled([super.dispose()]);
|
|
31
|
+
const cleanup = await Promise.allSettled([Promise.resolve().then(() => this.#ownedHost?.dispose())]);
|
|
32
|
+
const failures = [...outcomes, ...cleanup].flatMap(result => result.status === 'rejected' ? [result.reason] : []);
|
|
33
|
+
if (failures.length)
|
|
34
|
+
throw new AggregateError(failures, 'Bun stdio cleanup failed.');
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=runtime-stdio.impl.bun.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-stdio.impl.bun.js","sourceRoot":"","sources":["../../src/services/runtime-stdio.impl.bun.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAA2B,MAAM,8BAA8B,CAAC;AACzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAEtE,SAAS,WAAW,CAAC,KAA0B;IAC9C,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC;AAClC,CAAC;AACD,MAAM,cAAc,GAAuB,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,CAC9D,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAExE,gGAAgG;AAChG,MAAM,OAAO,eAAgB,SAAQ,gBAAgB;IAC3C,UA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AG,OAAO,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAClH,IAAI,QAAQ,CAAC,MAAM;YAAE,MAAM,IAAI,cAAc,CAAC,QAAQ,EAAE,2BAA2B,CAAC,CAAC;IACtF,CAAC;CACD"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Self-spawn, as the Bun host runs it.
|
|
3
|
+
*
|
|
4
|
+
* "Run the vibes CLI again" (`requireSelfSpawnArgv(consumer)`, the declared
|
|
5
|
+
* re-entry readers, `computeSelfSpawnArgv`, the descriptor import) is the
|
|
6
|
+
* kernel's base (`createSelfSpawn` and its readers) over this process's own
|
|
7
|
+
* executable, argv and module import.
|
|
8
|
+
*
|
|
9
|
+
* "Run Bun itself" is Bun's own: `resolveBunArgv()` (a `.ts` helper script,
|
|
10
|
+
* `bun install`, `bun ast-grep …`). A compiled host has no `bun` on PATH it can
|
|
11
|
+
* trust, so this returns the running executable plus `BUN_BE_BUN=1`, Bun's
|
|
12
|
+
* documented switch that makes a standalone binary behave as plain Bun for
|
|
13
|
+
* that child only. Never spawn `'bun'` or `process.execPath` by hand; the
|
|
14
|
+
* root gate `scripts/check-self-spawn-hygiene.ts` rejects both.
|
|
15
|
+
*/
|
|
16
|
+
import { type HostExecutableIdentity, type HostIdentityRuntime, type SelfSpawnSource } from '@vibesdotdev/execution-local';
|
|
17
|
+
import type { BunArgv } from '../schemas/self-spawn.ts';
|
|
18
|
+
export { readSelfSpawnArgv, readSelfSpawnSource, requireSelfSpawnArgv, selfSpawnArgvFrom, selfSpawnSourceFrom, selfSpawnUndeclared, type HostIdentityRuntime, type SelfSpawnArgv, type SelfSpawnSource } from '@vibesdotdev/execution-local';
|
|
19
|
+
export type { BunArgv } from '../schemas/self-spawn.ts';
|
|
20
|
+
/** This host's re-entry computation and descriptor import. */
|
|
21
|
+
export declare const bunSelfSpawn: {
|
|
22
|
+
computeSelfSpawnArgv: (binImportMetaUrl: string, identity?: HostExecutableIdentity) => import("@vibesdotdev/execution-local").SelfSpawnArgv | null;
|
|
23
|
+
importSerializableDescriptorModule: (path: string) => Promise<import("@vibesdotdev/kernel").RuntimeModuleNamespace>;
|
|
24
|
+
};
|
|
25
|
+
export declare const computeSelfSpawnArgv: (binImportMetaUrl: string, identity?: HostExecutableIdentity) => import("@vibesdotdev/execution-local").SelfSpawnArgv | null, importSerializableDescriptorModule: (path: string) => Promise<import("@vibesdotdev/kernel").RuntimeModuleNamespace>;
|
|
26
|
+
/**
|
|
27
|
+
* Resolve the command line that runs *Bun itself* from the current host.
|
|
28
|
+
*
|
|
29
|
+
* A source host (`bun vibes.ts …`) is already Bun: `process.execPath`. A
|
|
30
|
+
* compiled host (`bun build --compile`) is the vibes executable; Bun's
|
|
31
|
+
* documented `BUN_BE_BUN=1` makes that same file act as the plain Bun CLI for
|
|
32
|
+
* one child, so the caller never depends on a `bun` on PATH that may differ
|
|
33
|
+
* from the runtime the host was built with. The declared self-spawn source
|
|
34
|
+
* wins; an undeclared host falls back to the executable-identity heuristic.
|
|
35
|
+
*/
|
|
36
|
+
export declare function resolveBunArgv(runtime: HostIdentityRuntime): BunArgv;
|
|
37
|
+
/** The Bun argv for one host, from its declared source and its identity. */
|
|
38
|
+
export declare function resolveBunArgvFor(declared: SelfSpawnSource | null, identity: HostExecutableIdentity): BunArgv;
|
|
39
|
+
//# sourceMappingURL=self-spawn.impl.bun.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"self-spawn.impl.bun.d.ts","sourceRoot":"","sources":["../../src/services/self-spawn.impl.bun.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAwC,KAAK,sBAAsB,EAAE,KAAK,mBAAmB,EAAE,KAAK,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACjK,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAGxD,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,KAAK,mBAAmB,EAAE,KAAK,aAAa,EAAE,KAAK,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC7O,YAAY,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAExD,8DAA8D;AAC9D,eAAO,MAAM,YAAY;;;CAIE,CAAC;AAE5B,eAAO,MAAQ,oBAAoB,gIAAE,kCAAkC,iFAAiB,CAAC;AAEzF;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAEpE;AAED,4EAA4E;AAC5E,wBAAgB,iBAAiB,CAChC,QAAQ,EAAE,eAAe,GAAG,IAAI,EAChC,QAAQ,EAAE,sBAAsB,GAC9B,OAAO,CAST"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Self-spawn, as the Bun host runs it.
|
|
3
|
+
*
|
|
4
|
+
* "Run the vibes CLI again" (`requireSelfSpawnArgv(consumer)`, the declared
|
|
5
|
+
* re-entry readers, `computeSelfSpawnArgv`, the descriptor import) is the
|
|
6
|
+
* kernel's base (`createSelfSpawn` and its readers) over this process's own
|
|
7
|
+
* executable, argv and module import.
|
|
8
|
+
*
|
|
9
|
+
* "Run Bun itself" is Bun's own: `resolveBunArgv()` (a `.ts` helper script,
|
|
10
|
+
* `bun install`, `bun ast-grep …`). A compiled host has no `bun` on PATH it can
|
|
11
|
+
* trust, so this returns the running executable plus `BUN_BE_BUN=1`, Bun's
|
|
12
|
+
* documented switch that makes a standalone binary behave as plain Bun for
|
|
13
|
+
* that child only. Never spawn `'bun'` or `process.execPath` by hand; the
|
|
14
|
+
* root gate `scripts/check-self-spawn-hygiene.ts` rejects both.
|
|
15
|
+
*/
|
|
16
|
+
var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
|
|
17
|
+
if (typeof path === "string" && /^\.\.?\//.test(path)) {
|
|
18
|
+
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
|
|
19
|
+
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
return path;
|
|
23
|
+
};
|
|
24
|
+
import { createSelfSpawn, readSelfSpawnSource } from '@vibesdotdev/execution-local';
|
|
25
|
+
import { bunExecutableClassifier, executableIdentity } from "./host-identity.impl.bun.js";
|
|
26
|
+
export { readSelfSpawnArgv, readSelfSpawnSource, requireSelfSpawnArgv, selfSpawnArgvFrom, selfSpawnSourceFrom, selfSpawnUndeclared } from '@vibesdotdev/execution-local';
|
|
27
|
+
/** This host's re-entry computation and descriptor import. */
|
|
28
|
+
export const bunSelfSpawn = createSelfSpawn({
|
|
29
|
+
execPath: () => process.execPath,
|
|
30
|
+
argv: () => process.argv,
|
|
31
|
+
importModule: (path) => import(__rewriteRelativeImportExtension(/* @vite-ignore */ path))
|
|
32
|
+
}, bunExecutableClassifier);
|
|
33
|
+
export const { computeSelfSpawnArgv, importSerializableDescriptorModule } = bunSelfSpawn;
|
|
34
|
+
/**
|
|
35
|
+
* Resolve the command line that runs *Bun itself* from the current host.
|
|
36
|
+
*
|
|
37
|
+
* A source host (`bun vibes.ts …`) is already Bun: `process.execPath`. A
|
|
38
|
+
* compiled host (`bun build --compile`) is the vibes executable; Bun's
|
|
39
|
+
* documented `BUN_BE_BUN=1` makes that same file act as the plain Bun CLI for
|
|
40
|
+
* one child, so the caller never depends on a `bun` on PATH that may differ
|
|
41
|
+
* from the runtime the host was built with. The declared self-spawn source
|
|
42
|
+
* wins; an undeclared host falls back to the executable-identity heuristic.
|
|
43
|
+
*/
|
|
44
|
+
export function resolveBunArgv(runtime) {
|
|
45
|
+
return resolveBunArgvFor(readSelfSpawnSource(runtime), executableIdentity(runtime));
|
|
46
|
+
}
|
|
47
|
+
/** The Bun argv for one host, from its declared source and its identity. */
|
|
48
|
+
export function resolveBunArgvFor(declared, identity) {
|
|
49
|
+
// The on-disk thin-host entry can declare `bun-source` while `execPath` is
|
|
50
|
+
// still the compiled `vibes` file. Trust the executable: `bun add` through
|
|
51
|
+
// that file needs `BUN_BE_BUN=1` or Commander treats `add` as a vibes command.
|
|
52
|
+
const compiled = declared === 'compiled-binary' || identity.kind !== 'source';
|
|
53
|
+
if (compiled) {
|
|
54
|
+
return { argv: [process.execPath], env: { BUN_BE_BUN: '1' }, source: 'compiled-binary' };
|
|
55
|
+
}
|
|
56
|
+
return { argv: [process.execPath], env: {}, source: 'bun-source' };
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=self-spawn.impl.bun.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"self-spawn.impl.bun.js","sourceRoot":"","sources":["../../src/services/self-spawn.impl.bun.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;AAEH,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAA+E,MAAM,8BAA8B,CAAC;AAEjK,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAE1F,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,mBAAmB,EAAsE,MAAM,8BAA8B,CAAC;AAG7O,8DAA8D;AAC9D,MAAM,CAAC,MAAM,YAAY,GAAG,eAAe,CAAC;IAC3C,QAAQ,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ;IAChC,IAAI,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI;IACxB,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,kCAAC,kBAAkB,CAAC,IAAI,EAAC;CACvD,EAAE,uBAAuB,CAAC,CAAC;AAE5B,MAAM,CAAC,MAAM,EAAE,oBAAoB,EAAE,kCAAkC,EAAE,GAAG,YAAY,CAAC;AAEzF;;;;;;;;;GASG;AACH,MAAM,UAAU,cAAc,CAAC,OAA4B;IAC1D,OAAO,iBAAiB,CAAC,mBAAmB,CAAC,OAAO,CAAC,EAAE,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC;AACrF,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,iBAAiB,CAChC,QAAgC,EAChC,QAAgC;IAEhC,2EAA2E;IAC3E,2EAA2E;IAC3E,+EAA+E;IAC/E,MAAM,QAAQ,GAAG,QAAQ,KAAK,iBAAiB,IAAI,QAAQ,CAAC,IAAI,KAAK,QAAQ,CAAC;IAC9E,IAAI,QAAQ,EAAE,CAAC;QACd,OAAO,EAAE,IAAI,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,EAAE,MAAM,EAAE,iBAAiB,EAAE,CAAC;IAC1F,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC;AACpE,CAAC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/** Pre-runtime and post-disposal output for a Bun host composition. */
|
|
2
|
+
import { type RuntimeRef } from '@vibesdotdev/kernel';
|
|
3
|
+
import type { RuntimeOutputPlaneFormatter } from '@vibesdotdev/execution-local';
|
|
4
|
+
import type { BunStandardOutput } from '../schemas/standard-output.ts';
|
|
5
|
+
import type { createBunHostResources } from './host-resources.impl.bun.ts';
|
|
6
|
+
export type { RuntimeOutputPlaneFormatter as OutputPlaneFormatter } from '@vibesdotdev/execution-local';
|
|
7
|
+
export type { BunStandardOutput } from '../schemas/standard-output.ts';
|
|
8
|
+
export { createBunHostResources } from './host-resources.impl.bun.ts';
|
|
9
|
+
/**
|
|
10
|
+
* Legacy names resolve the activated bun-host client on each call.
|
|
11
|
+
* Executables must pass explicit resources before boot and after disposal.
|
|
12
|
+
*/
|
|
13
|
+
export { compatibilityBunHost } from './compatibility-host.impl.bun.ts';
|
|
14
|
+
export declare function createBunStandardOutput(owner: ReturnType<typeof createBunHostResources> | RuntimeRef): BunStandardOutput;
|
|
15
|
+
export declare const bunStandardOutput: BunStandardOutput;
|
|
16
|
+
/** Legacy entrypoints accept an explicit owner as well as the compatibility host. */
|
|
17
|
+
export declare function setOutputPlaneFormatter(next: RuntimeOutputPlaneFormatter, host?: Readonly<{
|
|
18
|
+
classifier: {
|
|
19
|
+
classifyExecutable: (facts: import("@vibesdotdev/execution-local").ExecutableClassificationFacts) => import("@vibesdotdev/execution-local").HostExecutableIdentity;
|
|
20
|
+
executableIdentityFrom: (env: import("@vibesdotdev/execution-local").HostEnvSnapshot) => import("@vibesdotdev/execution-local").HostExecutableIdentity;
|
|
21
|
+
executableIdentity: (runtime: import("@vibesdotdev/execution-local").HostIdentityRuntime) => import("@vibesdotdev/execution-local").HostExecutableIdentity;
|
|
22
|
+
hostModulesOnDisk: (runtime: import("@vibesdotdev/execution-local").HostIdentityRuntime) => boolean;
|
|
23
|
+
isStandaloneExecutable: (runtime: import("@vibesdotdev/execution-local").HostIdentityRuntime) => boolean;
|
|
24
|
+
hostEntryPath: (runtime: import("@vibesdotdev/execution-local").HostIdentityRuntime) => string | null;
|
|
25
|
+
resetForTest: () => void;
|
|
26
|
+
};
|
|
27
|
+
executable: {
|
|
28
|
+
isCompiledExecutable: (runtime: import("@vibesdotdev/execution-local").HostIdentityRuntime) => boolean;
|
|
29
|
+
processStartedAtMs: () => number;
|
|
30
|
+
statExecutable: (path: string) => import("@vibesdotdev/execution-local").ExecutableFileStat | null;
|
|
31
|
+
executableHostFactsOf: (runtime: import("@vibesdotdev/execution-local").HostIdentityRuntime) => import("@vibesdotdev/execution-local").ExecutableHostFacts;
|
|
32
|
+
describeExecutable: (path: string, host: import("@vibesdotdev/execution-local").ExecutableHostFacts) => import("@vibesdotdev/execution-local").ExecutableIdentity | null;
|
|
33
|
+
captureExecutableIdentity: (host: import("@vibesdotdev/execution-local").ExecutableHostFacts) => import("@vibesdotdev/execution-local").ExecutableIdentity | null;
|
|
34
|
+
getCapturedExecutableIdentity: () => import("@vibesdotdev/execution-local").ExecutableIdentity | null;
|
|
35
|
+
judgeExecutableReplaced: (loaded: import("@vibesdotdev/execution-local").ExecutableFileStat, current: import("@vibesdotdev/execution-local").ExecutableFileStat, processStartMs: number) => boolean;
|
|
36
|
+
checkExecutableFreshness: (host: import("@vibesdotdev/execution-local").ExecutableHostFacts) => import("@vibesdotdev/execution-local").ExecutableFreshness;
|
|
37
|
+
executableReplacedSince: (path: string, processStartMs: number) => import("@vibesdotdev/execution-local").ExecutableReplacedSince;
|
|
38
|
+
resetForTest: () => void;
|
|
39
|
+
};
|
|
40
|
+
outputPlane: {
|
|
41
|
+
install: (options: import("@vibesdotdev/kernel").RuntimeStdioTrackOptions) => void;
|
|
42
|
+
isInstalled: () => boolean;
|
|
43
|
+
uninstall: () => void;
|
|
44
|
+
setFormatter: (next: RuntimeOutputPlaneFormatter) => void;
|
|
45
|
+
formatConsoleArgs: (args: readonly unknown[]) => string;
|
|
46
|
+
flush: () => Promise<void>;
|
|
47
|
+
};
|
|
48
|
+
writeOutput(channel: "stdout" | "stderr", text: string): void;
|
|
49
|
+
readonly fatal: {
|
|
50
|
+
subscribe: (listener: import("@vibesdotdev/kernel").RuntimeFatalListener) => () => void;
|
|
51
|
+
subscriberCount: () => number;
|
|
52
|
+
};
|
|
53
|
+
setFormatter(next: RuntimeOutputPlaneFormatter): void;
|
|
54
|
+
retain(): () => Promise<void>;
|
|
55
|
+
streams(): import("@vibesdotdev/kernel").RuntimeStdioStreams;
|
|
56
|
+
dispose(): Promise<void>;
|
|
57
|
+
}>): void;
|
|
58
|
+
export declare function formatConsoleArgs(args: readonly unknown[], host?: Readonly<{
|
|
59
|
+
classifier: {
|
|
60
|
+
classifyExecutable: (facts: import("@vibesdotdev/execution-local").ExecutableClassificationFacts) => import("@vibesdotdev/execution-local").HostExecutableIdentity;
|
|
61
|
+
executableIdentityFrom: (env: import("@vibesdotdev/execution-local").HostEnvSnapshot) => import("@vibesdotdev/execution-local").HostExecutableIdentity;
|
|
62
|
+
executableIdentity: (runtime: import("@vibesdotdev/execution-local").HostIdentityRuntime) => import("@vibesdotdev/execution-local").HostExecutableIdentity;
|
|
63
|
+
hostModulesOnDisk: (runtime: import("@vibesdotdev/execution-local").HostIdentityRuntime) => boolean;
|
|
64
|
+
isStandaloneExecutable: (runtime: import("@vibesdotdev/execution-local").HostIdentityRuntime) => boolean;
|
|
65
|
+
hostEntryPath: (runtime: import("@vibesdotdev/execution-local").HostIdentityRuntime) => string | null;
|
|
66
|
+
resetForTest: () => void;
|
|
67
|
+
};
|
|
68
|
+
executable: {
|
|
69
|
+
isCompiledExecutable: (runtime: import("@vibesdotdev/execution-local").HostIdentityRuntime) => boolean;
|
|
70
|
+
processStartedAtMs: () => number;
|
|
71
|
+
statExecutable: (path: string) => import("@vibesdotdev/execution-local").ExecutableFileStat | null;
|
|
72
|
+
executableHostFactsOf: (runtime: import("@vibesdotdev/execution-local").HostIdentityRuntime) => import("@vibesdotdev/execution-local").ExecutableHostFacts;
|
|
73
|
+
describeExecutable: (path: string, host: import("@vibesdotdev/execution-local").ExecutableHostFacts) => import("@vibesdotdev/execution-local").ExecutableIdentity | null;
|
|
74
|
+
captureExecutableIdentity: (host: import("@vibesdotdev/execution-local").ExecutableHostFacts) => import("@vibesdotdev/execution-local").ExecutableIdentity | null;
|
|
75
|
+
getCapturedExecutableIdentity: () => import("@vibesdotdev/execution-local").ExecutableIdentity | null;
|
|
76
|
+
judgeExecutableReplaced: (loaded: import("@vibesdotdev/execution-local").ExecutableFileStat, current: import("@vibesdotdev/execution-local").ExecutableFileStat, processStartMs: number) => boolean;
|
|
77
|
+
checkExecutableFreshness: (host: import("@vibesdotdev/execution-local").ExecutableHostFacts) => import("@vibesdotdev/execution-local").ExecutableFreshness;
|
|
78
|
+
executableReplacedSince: (path: string, processStartMs: number) => import("@vibesdotdev/execution-local").ExecutableReplacedSince;
|
|
79
|
+
resetForTest: () => void;
|
|
80
|
+
};
|
|
81
|
+
outputPlane: {
|
|
82
|
+
install: (options: import("@vibesdotdev/kernel").RuntimeStdioTrackOptions) => void;
|
|
83
|
+
isInstalled: () => boolean;
|
|
84
|
+
uninstall: () => void;
|
|
85
|
+
setFormatter: (next: RuntimeOutputPlaneFormatter) => void;
|
|
86
|
+
formatConsoleArgs: (args: readonly unknown[]) => string;
|
|
87
|
+
flush: () => Promise<void>;
|
|
88
|
+
};
|
|
89
|
+
writeOutput(channel: "stdout" | "stderr", text: string): void;
|
|
90
|
+
readonly fatal: {
|
|
91
|
+
subscribe: (listener: import("@vibesdotdev/kernel").RuntimeFatalListener) => () => void;
|
|
92
|
+
subscriberCount: () => number;
|
|
93
|
+
};
|
|
94
|
+
setFormatter(next: RuntimeOutputPlaneFormatter): void;
|
|
95
|
+
retain(): () => Promise<void>;
|
|
96
|
+
streams(): import("@vibesdotdev/kernel").RuntimeStdioStreams;
|
|
97
|
+
dispose(): Promise<void>;
|
|
98
|
+
}>): string;
|
|
99
|
+
export declare function bunInspectFormatter(...values: unknown[]): string;
|
|
100
|
+
//# sourceMappingURL=standard-output.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"standard-output.d.ts","sourceRoot":"","sources":["../../src/services/standard-output.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,OAAO,EAAmB,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGvE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAChF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAG3E,YAAY,EAAE,2BAA2B,IAAI,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACxG,YAAY,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAEtE;;;GAGG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAExE,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,sBAAsB,CAAC,GAAG,UAAU,GAAG,iBAAiB,CAWxH;AAED,eAAO,MAAM,iBAAiB,EAAE,iBAAiE,CAAC;AAElG,qFAAqF;AACrF,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,2BAA2B,EAAE,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAuB,GAAG,IAAI,CAE5G;AACD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,SAAS,OAAO,EAAE,EAAE,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAuB,GAAG,MAAM,CAE/F;AACD,wBAAgB,mBAAmB,CAAC,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAEhE"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** Pre-runtime and post-disposal output for a Bun host composition. */
|
|
2
|
+
import { CapabilityError } from '@vibesdotdev/kernel';
|
|
3
|
+
import { tryGetVibesClient } from '@vibesdotdev/kernel/client';
|
|
4
|
+
import { compatibilityBunHost } from "./compatibility-host.impl.bun.js";
|
|
5
|
+
export { createBunHostResources } from "./host-resources.impl.bun.js";
|
|
6
|
+
/**
|
|
7
|
+
* Legacy names resolve the activated bun-host client on each call.
|
|
8
|
+
* Executables must pass explicit resources before boot and after disposal.
|
|
9
|
+
*/
|
|
10
|
+
export { compatibilityBunHost } from "./compatibility-host.impl.bun.js";
|
|
11
|
+
export function createBunStandardOutput(owner) {
|
|
12
|
+
const host = 'writeOutput' in owner ? owner : tryGetVibesClient('bun-host', owner)?.resources;
|
|
13
|
+
if (!host)
|
|
14
|
+
throw new CapabilityError('Bun output requires an activated host client or explicit resources.', 'UNAVAILABLE', {
|
|
15
|
+
reason: 'bun-host-client-unavailable', retryable: false
|
|
16
|
+
});
|
|
17
|
+
return Object.freeze({
|
|
18
|
+
write(channel, text) {
|
|
19
|
+
host.writeOutput(channel, text);
|
|
20
|
+
},
|
|
21
|
+
flush: () => host.outputPlane.flush()
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
export const bunStandardOutput = createBunStandardOutput(compatibilityBunHost);
|
|
25
|
+
/** Legacy entrypoints accept an explicit owner as well as the compatibility host. */
|
|
26
|
+
export function setOutputPlaneFormatter(next, host = compatibilityBunHost) {
|
|
27
|
+
host.setFormatter(next);
|
|
28
|
+
}
|
|
29
|
+
export function formatConsoleArgs(args, host = compatibilityBunHost) {
|
|
30
|
+
return host.outputPlane.formatConsoleArgs(args);
|
|
31
|
+
}
|
|
32
|
+
export function bunInspectFormatter(...values) {
|
|
33
|
+
return values.map(value => Bun.inspect(value, { depth: 2, colors: false })).join(' ');
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=standard-output.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"standard-output.js","sourceRoot":"","sources":["../../src/services/standard-output.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,OAAO,EAAE,eAAe,EAAmB,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAK/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAIxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAEtE;;;GAGG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAExE,MAAM,UAAU,u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* Bun Runtime User Environment Host Service
|
|
3
|
+
*
|
|
4
|
+
* Provides OS-appropriate user-level environment persistence and profile remint hooks.
|
|
5
|
+
* - Windows: updates PowerShell profiles and clears User-store JWT snapshots via powershell.exe.
|
|
6
|
+
* - POSIX: remint script + profile hooks.
|
|
7
|
+
*/
|
|
8
|
+
import { type RuntimeUserEnvironmentHost } from '@vibesdotdev/kernel';
|
|
9
|
+
/** The PowerShell child's environment: the owning runtime's host set, composed when it runs. */
|
|
10
|
+
export type UserEnvironmentChildEnv = () => Record<string, string>;
|
|
11
|
+
/** The PowerShell profiles under the user home the environment captured. */
|
|
12
|
+
export declare function windowsPowerShellProfilePaths(userHome: string): string[];
|
|
13
|
+
export declare function mergePowerShellProfileHook(existing: string): string;
|
|
14
|
+
/** The Windows host for the user home the environment captured once. */
|
|
15
|
+
export declare function createWindowsUserEnvironmentHost(userHome: string, childEnv: UserEnvironmentChildEnv): RuntimeUserEnvironmentHost;
|
|
16
|
+
export declare const posixUserEnvironmentHost: RuntimeUserEnvironmentHost;
|
|
17
|
+
/** The user-environment host for the platform and user home the environment captured. */
|
|
18
|
+
export declare function resolveUserEnvironmentHost(platform: NodeJS.Platform, userHome: string, childEnv: UserEnvironmentChildEnv): RuntimeUserEnvironmentHost;
|
|
19
|
+
//# sourceMappingURL=user-environment.impl.bun.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-environment.impl.bun.d.ts","sourceRoot":"","sources":["../../src/services/user-environment.impl.bun.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,EAAmB,KAAK,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AAGvF,gGAAgG;AAChG,MAAM,MAAM,uBAAuB,GAAG,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAyBnE,4EAA4E;AAC5E,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAKxE;AAED,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAInE;AA2DD,wEAAwE;AACxE,wBAAgB,gCAAgC,CAC/C,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,uBAAuB,GAC/B,0BAA0B,CAW5B;AAED,eAAO,MAAM,wBAAwB,EAAE,0BAMtC,CAAC;AAEF,yFAAyF;AACzF,wBAAgB,0BAA0B,CACzC,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,uBAAuB,GAC/B,0BAA0B,CAE5B"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bun Runtime User Environment Host Service
|
|
3
|
+
*
|
|
4
|
+
* Provides OS-appropriate user-level environment persistence and profile remint hooks.
|
|
5
|
+
* - Windows: updates PowerShell profiles and clears User-store JWT snapshots via powershell.exe.
|
|
6
|
+
* - POSIX: remint script + profile hooks.
|
|
7
|
+
*/
|
|
8
|
+
import { dirname, join } from 'node:path';
|
|
9
|
+
import { mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
10
|
+
import { spawn } from 'node:child_process';
|
|
11
|
+
import { CapabilityError } from '@vibesdotdev/kernel';
|
|
12
|
+
import * as z from 'zod/v4';
|
|
13
|
+
const PROFILE_BEGIN = '# BEGIN managed-by-vibes-auth-setup';
|
|
14
|
+
const NativeFailureSchema = z.object({ code: z.string().max(64).regex(/^[A-Z][A-Z0-9_]+$/) });
|
|
15
|
+
/** A profile read: a profile that does not exist yet answers null (it carries no hook); any other failure propagates. */
|
|
16
|
+
function profileAbsent(cause) {
|
|
17
|
+
const native = NativeFailureSchema.safeParse(cause);
|
|
18
|
+
const code = native.success ? native.data.code : undefined;
|
|
19
|
+
if (code === 'ENOENT')
|
|
20
|
+
return null;
|
|
21
|
+
throw cause;
|
|
22
|
+
}
|
|
23
|
+
const PROFILE_END = '# END managed-by-vibes-auth-setup';
|
|
24
|
+
const PROFILE_HOOK = [
|
|
25
|
+
PROFILE_BEGIN,
|
|
26
|
+
'if (Get-Command vibes -ErrorAction SilentlyContinue) {',
|
|
27
|
+
' foreach ($line in @(& vibes registry env 2>$null)) {',
|
|
28
|
+
" if ($line -match \"^export ([A-Z0-9_]+)='(.*)'$\") {",
|
|
29
|
+
' Set-Item -Path ("Env:" + $Matches[1]) -Value $Matches[2]',
|
|
30
|
+
' }',
|
|
31
|
+
' }',
|
|
32
|
+
'}',
|
|
33
|
+
PROFILE_END,
|
|
34
|
+
''
|
|
35
|
+
].join('\n');
|
|
36
|
+
/** The PowerShell profiles under the user home the environment captured. */
|
|
37
|
+
export function windowsPowerShellProfilePaths(userHome) {
|
|
38
|
+
return [
|
|
39
|
+
join(userHome, 'Documents', 'PowerShell', 'Microsoft.PowerShell_profile.ps1'),
|
|
40
|
+
join(userHome, 'Documents', 'WindowsPowerShell', 'Microsoft.PowerShell_profile.ps1')
|
|
41
|
+
];
|
|
42
|
+
}
|
|
43
|
+
export function mergePowerShellProfileHook(existing) {
|
|
44
|
+
if (existing.includes(PROFILE_BEGIN) && existing.includes(PROFILE_END))
|
|
45
|
+
return existing;
|
|
46
|
+
const trimmed = existing.replace(/\s+$/, '');
|
|
47
|
+
return `${trimmed}${trimmed ? '\n\n' : ''}${PROFILE_HOOK}`;
|
|
48
|
+
}
|
|
49
|
+
function runPowerShell(command, childEnv) {
|
|
50
|
+
return new Promise((resolve, reject) => {
|
|
51
|
+
const child = spawn('powershell.exe', ['-NoProfile', '-NonInteractive', '-ExecutionPolicy', 'Bypass', '-Command', command], { env: childEnv(), stdio: ['ignore', 'pipe', 'pipe'], windowsHide: true });
|
|
52
|
+
let stdout = '';
|
|
53
|
+
child.stdout.on('data', (chunk) => {
|
|
54
|
+
stdout += String(chunk);
|
|
55
|
+
});
|
|
56
|
+
child.on('error', reject);
|
|
57
|
+
child.on('close', (code) => {
|
|
58
|
+
if (code === 0)
|
|
59
|
+
resolve(stdout.trim());
|
|
60
|
+
else
|
|
61
|
+
reject(new CapabilityError('Could not update the Windows user environment.', 'UNAVAILABLE', {
|
|
62
|
+
reason: 'user-environment-update-failed',
|
|
63
|
+
details: { exitCode: code }
|
|
64
|
+
}));
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
const ENV_KEY_PATTERN = /^[A-Z][A-Z0-9_]*$/;
|
|
69
|
+
/** Clear the caller-named User-store snapshots; this layer names no credential. */
|
|
70
|
+
async function clearUserStoreSnapshots(keys, childEnv) {
|
|
71
|
+
const names = keys.filter((key) => ENV_KEY_PATTERN.test(key));
|
|
72
|
+
if (names.length === 0)
|
|
73
|
+
return;
|
|
74
|
+
// A snapshot that could not be cleared would shadow the named token: the failure propagates.
|
|
75
|
+
await runPowerShell(names.map((key) => `[Environment]::SetEnvironmentVariable('${key}', $null, 'User')`).join('; '), childEnv);
|
|
76
|
+
}
|
|
77
|
+
async function persistPowerShellProfiles(userHome) {
|
|
78
|
+
for (const path of windowsPowerShellProfilePaths(userHome)) {
|
|
79
|
+
const existing = (await readFile(path, 'utf8').catch((error) => profileAbsent(error))) ?? '';
|
|
80
|
+
const next = mergePowerShellProfileHook(existing);
|
|
81
|
+
if (next !== existing) {
|
|
82
|
+
await mkdir(dirname(path), { recursive: true });
|
|
83
|
+
await writeFile(path, next, { mode: 0o644 });
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
async function powerShellProfilesReady(userHome) {
|
|
88
|
+
for (const path of windowsPowerShellProfilePaths(userHome)) {
|
|
89
|
+
const text = (await readFile(path, 'utf8').catch((error) => profileAbsent(error))) ?? '';
|
|
90
|
+
if (text.includes(PROFILE_BEGIN) && text.includes(PROFILE_END))
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
/** The Windows host for the user home the environment captured once. */
|
|
96
|
+
export function createWindowsUserEnvironmentHost(userHome, childEnv) {
|
|
97
|
+
return {
|
|
98
|
+
async persistNamedToken(staleUserStoreKeys) {
|
|
99
|
+
await persistPowerShellProfiles(userHome);
|
|
100
|
+
await clearUserStoreSnapshots(staleUserStoreKeys, childEnv);
|
|
101
|
+
},
|
|
102
|
+
async hasNamedToken() {
|
|
103
|
+
return powerShellProfilesReady(userHome);
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
export const posixUserEnvironmentHost = {
|
|
108
|
+
async persistNamedToken() { },
|
|
109
|
+
async hasNamedToken() {
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
/** The user-environment host for the platform and user home the environment captured. */
|
|
114
|
+
export function resolveUserEnvironmentHost(platform, userHome, childEnv) {
|
|
115
|
+
return platform === 'win32' ? createWindowsUserEnvironmentHost(userHome, childEnv) : posixUserEnvironmentHost;
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=user-environment.impl.bun.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-environment.impl.bun.js","sourceRoot":"","sources":["../../src/services/user-environment.impl.bun.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAmC,MAAM,qBAAqB,CAAC;AACvF,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAK5B,MAAM,aAAa,GAAG,qCAAqC,CAAC;AAC5D,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC;AAC9F,yHAAyH;AACzH,SAAS,aAAa,CAAC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