@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,490 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bun implementation of PluginModuleImporter. A compiler worker bundles the
|
|
3
|
+
* replacement set into one dependency graph. Runtime kernel packages remain
|
|
4
|
+
* external and retain host identity; first-party implementation dependencies
|
|
5
|
+
* are included so their changed code cannot come from an old module cache.
|
|
6
|
+
*
|
|
7
|
+
* Verified CJS factories are evaluated outside the native ESM module cache.
|
|
8
|
+
* Their closures and artifact files live until generation custody releases
|
|
9
|
+
* them. Files reside outside package-manager-owned node_modules directories.
|
|
10
|
+
*/
|
|
11
|
+
import { mkdir, writeFile, rm, readdir, symlink } from 'node:fs/promises';
|
|
12
|
+
import { createHash } from 'node:crypto';
|
|
13
|
+
import { basename, dirname, join, resolve as resolvePath } from 'node:path';
|
|
14
|
+
import { existsSync, realpathSync, lstatSync } from 'node:fs';
|
|
15
|
+
import { builtinModules, createRequire } from 'node:module';
|
|
16
|
+
import { CapabilityError, CaughtFailureSchema, settle, settleNow, valueFreeFailure, ValueFreeFailureSchema } from '@vibesdotdev/kernel';
|
|
17
|
+
import { PluginModuleSchema } from '@vibesdotdev/kernel/bootstrap';
|
|
18
|
+
import z from 'zod/v4';
|
|
19
|
+
/**
|
|
20
|
+
* Legacy in-package location, kept for {@link cleanHotModuleDir} so a body that
|
|
21
|
+
* ran an older build can still sweep what it left behind (Rule 7: the sweep is
|
|
22
|
+
* the only consumer, and it must keep working during the transition).
|
|
23
|
+
*/
|
|
24
|
+
const HOT_DIR_SEGMENTS = ['node_modules', '.vibes-hot'];
|
|
25
|
+
/** In-package fallback when the activeHome anchor cannot resolve the graph. */
|
|
26
|
+
const PACKAGE_HOT_DIRNAME = '.vibes-hot';
|
|
27
|
+
/** The one first-party name whose identity across generations is load-bearing. */
|
|
28
|
+
const ONE_GRAPH_PROBE = '@vibesdotdev/kernel';
|
|
29
|
+
function failureCode(cause) {
|
|
30
|
+
return valueFreeFailure(cause).code;
|
|
31
|
+
}
|
|
32
|
+
/** ENOENT and ENOTDIR mean the path is not there. Any other code is a failure to look. */
|
|
33
|
+
function isAbsentCode(code) {
|
|
34
|
+
return code === 'ENOENT' || code === 'ENOTDIR';
|
|
35
|
+
}
|
|
36
|
+
/** A kernel or graph change that retires the running generation: explicit maintenance, never a retry into mixed code. */
|
|
37
|
+
function generationConflict(message, reason, details) {
|
|
38
|
+
const options = {
|
|
39
|
+
reason,
|
|
40
|
+
retryable: false
|
|
41
|
+
};
|
|
42
|
+
if (details !== undefined)
|
|
43
|
+
options.details = details;
|
|
44
|
+
return new CapabilityError(message, 'CONFLICT', options);
|
|
45
|
+
}
|
|
46
|
+
/** Nearest real `node_modules` at or above `from`, or null. */
|
|
47
|
+
function nearestNodeModules(from) {
|
|
48
|
+
let dir = resolvePath(from);
|
|
49
|
+
for (;;) {
|
|
50
|
+
const candidate = join(dir, 'node_modules');
|
|
51
|
+
const looked = settleNow(() => lstatSync(candidate).isDirectory());
|
|
52
|
+
if (looked.ok) {
|
|
53
|
+
if (looked.value)
|
|
54
|
+
return candidate;
|
|
55
|
+
}
|
|
56
|
+
else if (!isAbsentCode(failureCode(looked.cause))) {
|
|
57
|
+
throw looked.cause;
|
|
58
|
+
}
|
|
59
|
+
const parent = dirname(dir);
|
|
60
|
+
if (parent === dir)
|
|
61
|
+
return null;
|
|
62
|
+
dir = parent;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Resolve `specifier` from `dir` and canonicalize. Null when it does not
|
|
67
|
+
* resolve — which for the probe below means "this anchor is not usable".
|
|
68
|
+
*/
|
|
69
|
+
function resolveFrom(specifier, dir) {
|
|
70
|
+
const resolved = settleNow(() => Bun.resolveSync(specifier, dir));
|
|
71
|
+
if (!resolved.ok) {
|
|
72
|
+
if (failureCode(resolved.cause) === 'ERR_MODULE_NOT_FOUND')
|
|
73
|
+
return null;
|
|
74
|
+
throw resolved.cause;
|
|
75
|
+
}
|
|
76
|
+
return canonical(resolved.value);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Build (and verify) the activeHome-anchored generation directory for a
|
|
80
|
+
* package. Returns null when the anchor cannot reproduce the package's own
|
|
81
|
+
* resolution of `@vibesdotdev/kernel` — the caller then keeps the generation
|
|
82
|
+
* beside the package.
|
|
83
|
+
*/
|
|
84
|
+
async function prepareAnchoredHotDir(activeHome, packageRoot) {
|
|
85
|
+
const anchor = nearestNodeModules(packageRoot);
|
|
86
|
+
if (!anchor)
|
|
87
|
+
return null;
|
|
88
|
+
const key = `${basename(packageRoot)}-${createHash('sha256').update(packageRoot).digest('hex').slice(0, 12)}`;
|
|
89
|
+
const dir = join(activeHome, 'hot', key);
|
|
90
|
+
await mkdir(dir, { recursive: true });
|
|
91
|
+
const link = join(dir, 'node_modules');
|
|
92
|
+
if (!existsSync(link)) {
|
|
93
|
+
const linked = await settle(() => symlink(anchor, link, 'dir'));
|
|
94
|
+
if (!linked.ok && failureCode(linked.cause) !== 'EEXIST')
|
|
95
|
+
throw linked.cause;
|
|
96
|
+
}
|
|
97
|
+
// VERIFY, do not assume. Equal realpaths is the ONE-GRAPH contract (P1/P2:
|
|
98
|
+
// module identity is realpath), and a mismatch here would silently register
|
|
99
|
+
// the reloaded plugin against a second VibesRuntime class.
|
|
100
|
+
const fromPackage = resolveFrom(ONE_GRAPH_PROBE, packageRoot);
|
|
101
|
+
const fromGeneration = resolveFrom(ONE_GRAPH_PROBE, dir);
|
|
102
|
+
if (!fromPackage || fromPackage !== fromGeneration)
|
|
103
|
+
return null;
|
|
104
|
+
return { dir, anchor };
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Canonicalize a path the way the host module resolver does.
|
|
108
|
+
*
|
|
109
|
+
* Load-bearing on macOS, where `/var` is a symlink to `/private/var`: the
|
|
110
|
+
* bundler reports canonical paths while a caller-supplied entry may be the
|
|
111
|
+
* symlinked spelling. Two spellings of one file would register two watch
|
|
112
|
+
* identities and one of them would never match an event.
|
|
113
|
+
*/
|
|
114
|
+
function canonical(path) {
|
|
115
|
+
const settled = settleNow(() => realpathSync(path));
|
|
116
|
+
if (settled.ok)
|
|
117
|
+
return settled.value;
|
|
118
|
+
if (isAbsentCode(failureCode(settled.cause)))
|
|
119
|
+
return path;
|
|
120
|
+
throw settled.cause;
|
|
121
|
+
}
|
|
122
|
+
const PackageNameSchema = z.object({ name: z.string().optional() });
|
|
123
|
+
function packageNameOf(value) {
|
|
124
|
+
const parsed = PackageNameSchema.safeParse(value);
|
|
125
|
+
if (!parsed.success)
|
|
126
|
+
return undefined;
|
|
127
|
+
return parsed.data.name;
|
|
128
|
+
}
|
|
129
|
+
function isGenerationFactory(value) {
|
|
130
|
+
return value instanceof Function;
|
|
131
|
+
}
|
|
132
|
+
const SourceMapSchema = z.object({
|
|
133
|
+
sources: z.array(z.unknown()).optional()
|
|
134
|
+
});
|
|
135
|
+
function sourcemapSources(value) {
|
|
136
|
+
const parsed = SourceMapSchema.safeParse(value);
|
|
137
|
+
if (!parsed.success || parsed.data.sources === undefined)
|
|
138
|
+
return [];
|
|
139
|
+
return parsed.data.sources;
|
|
140
|
+
}
|
|
141
|
+
/** Same selection rule the package-plugin resolver uses: default, else one named `*plugin*`. */
|
|
142
|
+
export function pluginFromModule(module) {
|
|
143
|
+
return PluginModuleSchema.parse(module);
|
|
144
|
+
}
|
|
145
|
+
/** Walk up from a file to the nearest directory holding a package.json. */
|
|
146
|
+
export function findPackageRoot(fromFile) {
|
|
147
|
+
let dir = dirname(resolvePath(fromFile));
|
|
148
|
+
for (;;) {
|
|
149
|
+
if (existsSync(join(dir, 'package.json')))
|
|
150
|
+
return dir;
|
|
151
|
+
const parent = dirname(dir);
|
|
152
|
+
if (parent === dir)
|
|
153
|
+
return dirname(resolvePath(fromFile));
|
|
154
|
+
dir = parent;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
export class BunPluginModuleImporter {
|
|
158
|
+
options;
|
|
159
|
+
sequence = 0;
|
|
160
|
+
kernelFingerprint = null;
|
|
161
|
+
stableDependencies = new Map();
|
|
162
|
+
written = [];
|
|
163
|
+
constructor(options) {
|
|
164
|
+
this.options = options;
|
|
165
|
+
}
|
|
166
|
+
/** Memoized per package root so the anchor probe runs once, not per generation. */
|
|
167
|
+
hotDirs = new Map();
|
|
168
|
+
async resolveHotDir(packageRoot) {
|
|
169
|
+
const placement = this.options;
|
|
170
|
+
if (placement.hotDir !== undefined)
|
|
171
|
+
return placement.hotDir;
|
|
172
|
+
const cached = this.hotDirs.get(packageRoot);
|
|
173
|
+
if (cached)
|
|
174
|
+
return cached;
|
|
175
|
+
const activeHome = placement.activeHome;
|
|
176
|
+
let chosen = null;
|
|
177
|
+
const anchored = await prepareAnchoredHotDir(activeHome, packageRoot);
|
|
178
|
+
if (anchored) {
|
|
179
|
+
chosen = anchored.dir;
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
this.options.onNotice?.('hot reload generations kept beside the package: the vibes-home anchor could not reproduce the package graph', { packageRoot, activeHome, probe: ONE_GRAPH_PROBE });
|
|
183
|
+
}
|
|
184
|
+
const dir = chosen ?? join(packageRoot, PACKAGE_HOT_DIRNAME);
|
|
185
|
+
this.hotDirs.set(packageRoot, dir);
|
|
186
|
+
return dir;
|
|
187
|
+
}
|
|
188
|
+
/** Capture the external graph at host startup without evaluating plugin code. */
|
|
189
|
+
async initialize(entries) {
|
|
190
|
+
const kernelRoot = findPackageRoot(Bun.resolveSync('@vibesdotdev/kernel', import.meta.dir));
|
|
191
|
+
this.kernelFingerprint = await fingerprintKernel(kernelRoot);
|
|
192
|
+
if (!entries.length)
|
|
193
|
+
return;
|
|
194
|
+
const hotDir = await this.resolveHotDir(findPackageRoot(entries[0]));
|
|
195
|
+
await mkdir(hotDir, { recursive: true });
|
|
196
|
+
const sourcePath = join(hotDir, `baseline-${process.pid}-${crypto.randomUUID()}.ts`);
|
|
197
|
+
try {
|
|
198
|
+
await writeFile(sourcePath, entries.map((entry) => `import ${JSON.stringify(canonical(resolvePath(entry)))};`).join('\n'));
|
|
199
|
+
const built = await buildGeneration(sourcePath, kernelRoot);
|
|
200
|
+
for (const root of new Set(built.externals.map(findPackageRoot))) {
|
|
201
|
+
this.stableDependencies.set(root, await fingerprintKernel(root));
|
|
202
|
+
}
|
|
203
|
+
if (await fingerprintKernel(kernelRoot) !== this.kernelFingerprint) {
|
|
204
|
+
throw generationConflict('Kernel changed during host initialization; maintenance required', 'kernel-changed');
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
finally {
|
|
208
|
+
await rm(sourcePath, { force: true });
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
async load(entry) {
|
|
212
|
+
return (await this.loadMany([entry]))[0];
|
|
213
|
+
}
|
|
214
|
+
/** Compile a replacement set together so each dependency has one identity. */
|
|
215
|
+
async loadMany(entries) {
|
|
216
|
+
if (!entries.length)
|
|
217
|
+
return [];
|
|
218
|
+
const entryPaths = entries.map((entry) => canonical(resolvePath(entry)));
|
|
219
|
+
const graphIdentity = this.options.artifactIdentity?.();
|
|
220
|
+
const validate = () => {
|
|
221
|
+
if (this.options.artifactIdentity && this.options.artifactIdentity() !== graphIdentity) {
|
|
222
|
+
throw new CapabilityError('Package graph changed during artifact preparation; retry publication', 'CONFLICT', {
|
|
223
|
+
reason: 'package-graph-changed',
|
|
224
|
+
retryable: true
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
const kernelRoot = findPackageRoot(Bun.resolveSync('@vibesdotdev/kernel', import.meta.dir));
|
|
229
|
+
const fingerprint = await fingerprintKernel(kernelRoot);
|
|
230
|
+
if (this.kernelFingerprint !== null && fingerprint !== this.kernelFingerprint) {
|
|
231
|
+
throw generationConflict('Runtime kernel changed; explicit maintenance required. Implementation generation retained.', 'kernel-changed');
|
|
232
|
+
}
|
|
233
|
+
this.kernelFingerprint = fingerprint;
|
|
234
|
+
const hotDir = await this.resolveHotDir(findPackageRoot(entryPaths[0]));
|
|
235
|
+
await mkdir(hotDir, { recursive: true });
|
|
236
|
+
const key = `${process.pid}-${++this.sequence}-${crypto.randomUUID()}`;
|
|
237
|
+
const sourcePath = join(hotDir, `entry-${key}.ts`);
|
|
238
|
+
const generatedPath = join(hotDir, `plugin-${key}.cjs`);
|
|
239
|
+
await writeFile(sourcePath, entryPaths.map((entry, index) => `import * as p${index} from ${JSON.stringify(entry)};`).join('\n') +
|
|
240
|
+
`\nexport const modules = [${entryPaths.map((_entry, index) => `p${index}`).join(',')}];\n`);
|
|
241
|
+
try {
|
|
242
|
+
const built = await buildGeneration(sourcePath, kernelRoot);
|
|
243
|
+
for (const root of new Set(built.externals.map(findPackageRoot))) {
|
|
244
|
+
const digest = await fingerprintKernel(root);
|
|
245
|
+
const name = packageNameOf(await Bun.file(join(root, 'package.json')).json());
|
|
246
|
+
for (const [previousRoot, previousDigest] of this.stableDependencies) {
|
|
247
|
+
const previousName = (await Bun.file(join(previousRoot, 'package.json')).json()).name;
|
|
248
|
+
if ((previousRoot === root || (name && name === previousName)) && (previousRoot !== root || previousDigest !== digest)) {
|
|
249
|
+
throw generationConflict(`Stable dependency '${name ?? basename(root)}' changed; maintenance required`, 'stable-dependency-changed', { dependency: name ?? basename(root) });
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
this.stableDependencies.set(root, digest);
|
|
253
|
+
}
|
|
254
|
+
const code = built.code;
|
|
255
|
+
const digest = createHash('sha256').update(code).digest('hex');
|
|
256
|
+
await writeFile(generatedPath, code);
|
|
257
|
+
if (createHash('sha256').update(await Bun.file(generatedPath).text()).digest('hex') !== digest) {
|
|
258
|
+
throw new CapabilityError('Generation artifact integrity check failed', 'INTERNAL', { reason: 'generation-integrity-failed' });
|
|
259
|
+
}
|
|
260
|
+
if (await fingerprintKernel(kernelRoot) !== fingerprint) {
|
|
261
|
+
throw generationConflict('Runtime kernel changed during preparation; maintenance required', 'kernel-changed');
|
|
262
|
+
}
|
|
263
|
+
validate();
|
|
264
|
+
this.written.push(generatedPath);
|
|
265
|
+
// Bun's CJS output is a factory. Evaluating it directly avoids placing
|
|
266
|
+
// every update in the permanent native ESM module cache. Its closures
|
|
267
|
+
// become collectible when the last generation borrower releases them.
|
|
268
|
+
const factory = new Function(`return (\n${code}\n);`)();
|
|
269
|
+
if (!isGenerationFactory(factory)) {
|
|
270
|
+
throw new CapabilityError('Unsupported Bun generation factory format', 'INVALID_INPUT', {
|
|
271
|
+
reason: 'generation-format-unsupported'
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
const module = { exports: {} };
|
|
275
|
+
const nativeRequire = createRequire(generatedPath);
|
|
276
|
+
// The externals this build recorded and the stable-dependency check above
|
|
277
|
+
// fingerprinted. The graph plugin resolves an external to its real path,
|
|
278
|
+
// and Bun's CJS output requires that path, so a require arrives either as
|
|
279
|
+
// the bare specifier or as the recorded path itself; nothing else is admitted.
|
|
280
|
+
//
|
|
281
|
+
// This is a GRAPH-INTEGRITY check, not a trust boundary: it keeps one
|
|
282
|
+
// module graph (no stale or unrecorded copy of a dependency), it does not
|
|
283
|
+
// confine the code. The list is self-declared by what the module imports,
|
|
284
|
+
// every builtin (`child_process` included) is admitted, and a native
|
|
285
|
+
// `import()` inside the evaluated factory never reaches `require` at all
|
|
286
|
+
// (hot-generation-dir.test.ts pins that). Reloaded plugin code runs with
|
|
287
|
+
// the daemon's authority, as its first load did.
|
|
288
|
+
const verifiedExternals = new Set(built.externals);
|
|
289
|
+
const resolveExternal = (specifier) => {
|
|
290
|
+
const admitted = built.resolutions[specifier];
|
|
291
|
+
if (admitted)
|
|
292
|
+
return admitted;
|
|
293
|
+
if (verifiedExternals.has(specifier))
|
|
294
|
+
return specifier;
|
|
295
|
+
if (specifier.startsWith('node:') || specifier.startsWith('bun:') || specifier === 'bun' || builtinModules.includes(specifier))
|
|
296
|
+
return specifier;
|
|
297
|
+
throw new CapabilityError(`Generation requested an unverified external module '${specifier}'`, 'PERMISSION_DENIED', {
|
|
298
|
+
reason: 'unverified-external',
|
|
299
|
+
details: { specifier }
|
|
300
|
+
});
|
|
301
|
+
};
|
|
302
|
+
const require = Object.assign((specifier) => nativeRequire(resolveExternal(specifier)), nativeRequire, { resolve: (specifier) => nativeRequire.resolve(resolveExternal(specifier)) });
|
|
303
|
+
await factory(module.exports, require, module, generatedPath, dirname(generatedPath));
|
|
304
|
+
const modules = module.exports.modules;
|
|
305
|
+
if (!Array.isArray(modules) || modules.length !== entries.length) {
|
|
306
|
+
throw new CapabilityError('Generation artifact has an invalid module set', 'INVALID_INPUT', {
|
|
307
|
+
reason: 'generation-module-set-invalid'
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
const plugins = modules.map((value, index) => {
|
|
311
|
+
const plugin = pluginFromModule(value);
|
|
312
|
+
if (!plugin) {
|
|
313
|
+
throw new CapabilityError(`${entryPaths[index]} does not export a RuntimePlugin`, 'INVALID_INPUT', {
|
|
314
|
+
reason: 'plugin-export-missing',
|
|
315
|
+
details: { entry: entryPaths[index] }
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
return plugin;
|
|
319
|
+
});
|
|
320
|
+
const sources = (await collectSources({ outputs: built.map ? [{ kind: 'sourcemap', text: async () => built.map }] : [] }, entryPaths[0], kernelRoot, this.options.cwd)).filter((source) => source !== sourcePath);
|
|
321
|
+
let borrowers = plugins.length;
|
|
322
|
+
return plugins.map((plugin) => {
|
|
323
|
+
let released = false;
|
|
324
|
+
return { pluginId: plugin.id, plugin, sources, validate, dispose: async () => {
|
|
325
|
+
if (released)
|
|
326
|
+
return;
|
|
327
|
+
released = true;
|
|
328
|
+
if (--borrowers)
|
|
329
|
+
return;
|
|
330
|
+
await rm(generatedPath, { force: true });
|
|
331
|
+
const index = this.written.indexOf(generatedPath);
|
|
332
|
+
if (index >= 0)
|
|
333
|
+
this.written.splice(index, 1);
|
|
334
|
+
} };
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
catch (error) {
|
|
338
|
+
await rm(generatedPath, { force: true });
|
|
339
|
+
const index = this.written.indexOf(generatedPath);
|
|
340
|
+
if (index >= 0)
|
|
341
|
+
this.written.splice(index, 1);
|
|
342
|
+
throw error;
|
|
343
|
+
}
|
|
344
|
+
finally {
|
|
345
|
+
await rm(sourcePath, { force: true });
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
/** Delete every module this importer generated. */
|
|
349
|
+
async dispose() {
|
|
350
|
+
while (this.written.length > 0) {
|
|
351
|
+
const stale = this.written.pop();
|
|
352
|
+
if (stale)
|
|
353
|
+
await rm(stale, { force: true });
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* The local source files that were compiled into this generation.
|
|
359
|
+
*
|
|
360
|
+
* Read from the build's sourcemap `sources`, which is exactly the set the
|
|
361
|
+
* bundler inlined — no separate import scanner to drift from the bundler.
|
|
362
|
+
* Falls back to the entry alone if a sourcemap is unavailable.
|
|
363
|
+
*/
|
|
364
|
+
async function collectSources(built, entryPath, _packageRoot, cwd) {
|
|
365
|
+
const mapOutput = built.outputs.find((output) => output.kind === 'sourcemap');
|
|
366
|
+
if (!mapOutput)
|
|
367
|
+
return [entryPath];
|
|
368
|
+
if (cwd === undefined) {
|
|
369
|
+
// Bun emits sourcemap `sources` relative to the host's captured cwd, so
|
|
370
|
+
// without one there is no base to resolve helper sources against; only
|
|
371
|
+
// the entry itself is knowable. Same fallback as a missing sourcemap.
|
|
372
|
+
return [entryPath];
|
|
373
|
+
}
|
|
374
|
+
let parsed;
|
|
375
|
+
try {
|
|
376
|
+
parsed = JSON.parse(await mapOutput.text());
|
|
377
|
+
}
|
|
378
|
+
catch (error) {
|
|
379
|
+
// Watching only the entry would silently stop reloads for every helper file.
|
|
380
|
+
throw new CapabilityError('The generation sourcemap is unreadable, so its watched sources are unknown.', 'INTERNAL', {
|
|
381
|
+
reason: 'generation-sourcemap-invalid',
|
|
382
|
+
cause: error
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
const raw = sourcemapSources(parsed);
|
|
386
|
+
const files = raw
|
|
387
|
+
.filter((value) => typeof value === 'string')
|
|
388
|
+
.map((value) => (value.startsWith('file://') ? new URL(value).pathname : value))
|
|
389
|
+
// Bun emits sourcemap `sources` relative to the host's cwd, NOT to the
|
|
390
|
+
// package root. Resolving against `packageRoot` produced paths like
|
|
391
|
+
// `<packageRoot>/../../Users/…/src/helper.ts` — 130 of 141 watched paths
|
|
392
|
+
// did not exist, so editing any file but a plugin's own entry never fired
|
|
393
|
+
// a reload while `hot-reload-status` still reported `armedWithNothing:
|
|
394
|
+
// false`. A daemon's cwd is never the package root, so this was always
|
|
395
|
+
// wrong in production; fixture suites missed it by building with cwd
|
|
396
|
+
// inside the fixture. Measured on Bun 1.4.0.
|
|
397
|
+
.map((value) => canonical(resolvePath(cwd, value)))
|
|
398
|
+
.filter((value) => !value.includes(`/${HOT_DIR_SEGMENTS.join('/')}/`) &&
|
|
399
|
+
!value.includes(`/${PACKAGE_HOT_DIRNAME}/`));
|
|
400
|
+
const unique = [...new Set([entryPath, ...files])].sort();
|
|
401
|
+
return unique;
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* Remove any generated modules left behind by a previous process.
|
|
405
|
+
*
|
|
406
|
+
* Sweeps BOTH the legacy in-`node_modules` location and the in-package
|
|
407
|
+
* fallback, so a body that ran an older build does not leave orphans a
|
|
408
|
+
* package manager will later carry around.
|
|
409
|
+
*/
|
|
410
|
+
export async function cleanHotModuleDir(packageRoot) {
|
|
411
|
+
let removed = 0;
|
|
412
|
+
for (const hotDir of [
|
|
413
|
+
join(packageRoot, ...HOT_DIR_SEGMENTS),
|
|
414
|
+
join(packageRoot, PACKAGE_HOT_DIRNAME)
|
|
415
|
+
]) {
|
|
416
|
+
if (!existsSync(hotDir))
|
|
417
|
+
continue;
|
|
418
|
+
const entries = await readdir(hotDir);
|
|
419
|
+
for (const entry of entries) {
|
|
420
|
+
await rm(join(hotDir, entry), { force: true });
|
|
421
|
+
removed += 1;
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
return removed;
|
|
425
|
+
}
|
|
426
|
+
/** The stable kernel cannot be replaced by an implementation publication. */
|
|
427
|
+
async function fingerprintKernel(root) {
|
|
428
|
+
const hash = createHash('sha256');
|
|
429
|
+
const visit = async (dir) => {
|
|
430
|
+
for (const entry of (await readdir(dir, { withFileTypes: true })).sort((a, b) => a.name.localeCompare(b.name))) {
|
|
431
|
+
if (entry.name === 'node_modules' || entry.name.startsWith('.') || entry.name === '__tests__')
|
|
432
|
+
continue;
|
|
433
|
+
const path = join(dir, entry.name);
|
|
434
|
+
if (entry.isDirectory())
|
|
435
|
+
await visit(path);
|
|
436
|
+
else if (entry.isFile() && /\.(?:ts|js|json)$/.test(entry.name) && !entry.name.includes('.test.')) {
|
|
437
|
+
hash.update(path.slice(root.length));
|
|
438
|
+
hash.update(new Uint8Array(await Bun.file(path).arrayBuffer()));
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
};
|
|
442
|
+
await visit(root);
|
|
443
|
+
return hash.digest('hex');
|
|
444
|
+
}
|
|
445
|
+
const BuiltGenerationSchema = z.object({
|
|
446
|
+
code: z.string(),
|
|
447
|
+
map: z.string().nullable(),
|
|
448
|
+
externals: z.array(z.string()),
|
|
449
|
+
resolutions: z.record(z.string(), z.string())
|
|
450
|
+
});
|
|
451
|
+
const CompileRefusalSchema = z.object({
|
|
452
|
+
reason: z.literal('generation-compile-failed'),
|
|
453
|
+
failure: ValueFreeFailureSchema
|
|
454
|
+
});
|
|
455
|
+
async function buildGeneration(sourcePath, kernelRoot) {
|
|
456
|
+
// Source and distributed JS are both supported without a workspace path.
|
|
457
|
+
const suffix = import.meta.url.endsWith('.ts') ? 'ts' : 'js';
|
|
458
|
+
const worker = new Worker(new URL(`./hot-plugin-build.worker.consumer.${suffix}`, import.meta.url).href);
|
|
459
|
+
try {
|
|
460
|
+
return await new Promise((resolve, reject) => {
|
|
461
|
+
worker.onmessage = ({ data }) => {
|
|
462
|
+
const refusal = CompileRefusalSchema.safeParse(data);
|
|
463
|
+
if (refusal.success) {
|
|
464
|
+
reject(new CapabilityError('Generation compile failed.', 'INVALID_INPUT', {
|
|
465
|
+
reason: 'generation-compile-failed',
|
|
466
|
+
cause: refusal.data.failure
|
|
467
|
+
}));
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
const built = BuiltGenerationSchema.safeParse(data);
|
|
471
|
+
if (!built.success) {
|
|
472
|
+
reject(new CapabilityError('Generation compile failed.', 'INVALID_INPUT', { reason: 'generation-compile-failed' }));
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
resolve(built.data);
|
|
476
|
+
};
|
|
477
|
+
worker.onerror = (event) => {
|
|
478
|
+
reject(new CapabilityError('Generation compiler worker failed.', 'INTERNAL', {
|
|
479
|
+
reason: 'generation-compiler-failed',
|
|
480
|
+
cause: valueFreeFailure(CaughtFailureSchema.parse(event.error))
|
|
481
|
+
}));
|
|
482
|
+
};
|
|
483
|
+
worker.postMessage({ sourcePath, kernelRoot });
|
|
484
|
+
});
|
|
485
|
+
}
|
|
486
|
+
finally {
|
|
487
|
+
worker.terminate();
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
//# sourceMappingURL=hot-plugin-module.consumer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hot-plugin-module.consumer.js","sourceRoot":"","sources":["../../src/runtime-plugin-host/hot-plugin-module.consumer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,WAAW,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,E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CAAC;YACrB,CAAC,CAAC;YACF,MAAM,CAAC,OAAO,GAAG,CAAC,KAAK,EAAE,EAAE;gBAC1B,MAAM,CAAC,IAAI,eAAe,CAAC,oCAAoC,EAAE,UAAU,EAAE;oBAC5E,MAAM,EAAE,4BAA4B;oBACpC,KAAK,EAAE,gBAAgB,CAAC,mBAAmB,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;iBAC/D,CAAC,CAAC,CAAC;YACL,CAAC,CAAC;YACF,MAAM,CAAC,WAAW,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;IACJ,CAAC;YAAS,CAAC;QAAC,MAAM,CAAC,SAAS,EAAE,CAAC;IAAC,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Daemon hot reload wiring.
|
|
3
|
+
*
|
|
4
|
+
* `vibes pm` runs one `vibes-runtime-daemon` for many clients, and that daemon
|
|
5
|
+
* is expected to stay up for days. Without reload it drifts: its own MCP
|
|
6
|
+
* `initialize` handshake reports SOURCE/WORKSPACE DIVERGENCE about itself, and
|
|
7
|
+
* a drifted body answers plausibly with stale behaviour. Uptime must not cost
|
|
8
|
+
* currency.
|
|
9
|
+
*
|
|
10
|
+
* Opt-in, never on by default. Cloud hardware is refused outright: a cloud
|
|
11
|
+
* runtime's code comes from its deployed artifact, and a process that rebuilds
|
|
12
|
+
* plugins from a mutable source tree there would be an integrity hole, not a
|
|
13
|
+
* convenience.
|
|
14
|
+
*/
|
|
15
|
+
import { type VibesRuntime } from '@vibesdotdev/kernel';
|
|
16
|
+
import { PluginRuntimeGenerations, type PluginReloadOutcome, type TrackedPlugin } from '@vibesdotdev/kernel/reload';
|
|
17
|
+
import type { LoggerInterface } from '@vibesdotdev/kernel/schemas/logger';
|
|
18
|
+
import { type HotReloadTarget } from '@vibesdotdev/kernel/kinds/runtime-plugin-host.kind';
|
|
19
|
+
export { HMR_ENV_KEY, decideHotReload, type HotReloadConfig, type HotReloadDecision, type HotReloadTarget } from '@vibesdotdev/kernel/kinds/runtime-plugin-host.kind';
|
|
20
|
+
/**
|
|
21
|
+
* Owns the controller, the Bun importer, and the source watcher for one
|
|
22
|
+
* daemon. Nothing here decides *when* an identity leaves the registry beyond
|
|
23
|
+
* "its source changed"; exact retraction is the runtime's job by contract.
|
|
24
|
+
*/
|
|
25
|
+
/** The failure record and log facts for one failed reload. Neither repeats thrown text. */
|
|
26
|
+
export declare function pluginReloadFailureReport(outcome: Extract<PluginReloadOutcome, {
|
|
27
|
+
status: 'failed';
|
|
28
|
+
}>): {
|
|
29
|
+
error: string;
|
|
30
|
+
logged: Readonly<{
|
|
31
|
+
name: string;
|
|
32
|
+
code?: string | undefined;
|
|
33
|
+
reason?: string | undefined;
|
|
34
|
+
}>;
|
|
35
|
+
};
|
|
36
|
+
export interface DaemonHotReloadFailure {
|
|
37
|
+
pluginId: string;
|
|
38
|
+
phase: string;
|
|
39
|
+
error: string;
|
|
40
|
+
servingGeneration: number | null;
|
|
41
|
+
at: string;
|
|
42
|
+
}
|
|
43
|
+
export declare class DaemonHotReload {
|
|
44
|
+
readonly generations: PluginRuntimeGenerations;
|
|
45
|
+
readonly runtime: VibesRuntime;
|
|
46
|
+
private readonly importer;
|
|
47
|
+
private readonly watcher;
|
|
48
|
+
private readonly controller;
|
|
49
|
+
private readonly log;
|
|
50
|
+
private started;
|
|
51
|
+
private failure;
|
|
52
|
+
constructor(runtime: VibesRuntime, options: {
|
|
53
|
+
logger: LoggerInterface;
|
|
54
|
+
debounceMs?: number;
|
|
55
|
+
hotDir?: string;
|
|
56
|
+
artifactIdentity?: () => string | null;
|
|
57
|
+
validateCandidate?: (candidate: VibesRuntime, previous: VibesRuntime) => void | Promise<void>;
|
|
58
|
+
/** False for hosts that publish installed artifacts only and never resolve watched sources. */
|
|
59
|
+
requireCwd?: boolean;
|
|
60
|
+
});
|
|
61
|
+
/**
|
|
62
|
+
* The most recent failed reload, or null.
|
|
63
|
+
*
|
|
64
|
+
* Load-bearing, not decorative: a failed reload keeps the PREVIOUS
|
|
65
|
+
* generation serving, which is indistinguishable from "everything is fine"
|
|
66
|
+
* unless the body says so. `hot-reload-status` reports it and the
|
|
67
|
+
* stale-body banner appends `hmr: <id> failed`.
|
|
68
|
+
*/
|
|
69
|
+
lastFailure(): DaemonHotReloadFailure | null;
|
|
70
|
+
initialize(targets: readonly HotReloadTarget[]): Promise<void>;
|
|
71
|
+
/** Track a plugin and (re)arm the watcher over the union of tracked sources. */
|
|
72
|
+
track(target: HotReloadTarget, watchSources?: boolean): Promise<readonly string[]>;
|
|
73
|
+
untrack(pluginId: string): void;
|
|
74
|
+
/** Reload one tracked plugin now, regardless of filesystem events. */
|
|
75
|
+
reload(pluginId: string): Promise<PluginReloadOutcome>;
|
|
76
|
+
reloadMany(pluginIds: readonly string[]): Promise<PluginReloadOutcome>;
|
|
77
|
+
status(): TrackedPlugin[];
|
|
78
|
+
watchedSources(): string[];
|
|
79
|
+
stop(): Promise<void>;
|
|
80
|
+
private arm;
|
|
81
|
+
private report;
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=hot-reload.consumer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hot-reload.consumer.d.ts","sourceRoot":"","sources":["../../src/runtime-plugin-host/hot-reload.consumer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAA0D,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEhH,OAAO,EAEN,wBAAwB,EACxB,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAClB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EACN,KAAK,eAAe,EACpB,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EACN,WAAW,EACX,eAAe,EACf,KAAK,eAAe,EACpB,KAA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