@vibesdotdev/host-bun 0.0.0-stage → 1.0.0-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (517) hide show
  1. package/LICENSE +18 -0
  2. package/README.md +222 -2
  3. package/dist/applet-serve-host/applet-serve-host.impl.bun.d.ts +6 -0
  4. package/dist/applet-serve-host/applet-serve-host.impl.bun.d.ts.map +1 -0
  5. package/dist/applet-serve-host/applet-serve-host.impl.bun.js +80 -0
  6. package/dist/applet-serve-host/applet-serve-host.impl.bun.js.map +1 -0
  7. package/dist/applet-serve-host/applet-serve-host.plugin.d.ts +22 -0
  8. package/dist/applet-serve-host/applet-serve-host.plugin.d.ts.map +1 -0
  9. package/dist/applet-serve-host/applet-serve-host.plugin.js +42 -0
  10. package/dist/applet-serve-host/applet-serve-host.plugin.js.map +1 -0
  11. package/dist/applet-serve-host/index.d.ts +7 -0
  12. package/dist/applet-serve-host/index.d.ts.map +1 -0
  13. package/dist/applet-serve-host/index.js +7 -0
  14. package/dist/applet-serve-host/index.js.map +1 -0
  15. package/dist/applet-serve-host/stylesheet.compiler.d.ts +7 -0
  16. package/dist/applet-serve-host/stylesheet.compiler.d.ts.map +1 -0
  17. package/dist/applet-serve-host/stylesheet.compiler.js +63 -0
  18. package/dist/applet-serve-host/stylesheet.compiler.js.map +1 -0
  19. package/dist/atlas-migrations/register-atlas-host-migrations.d.ts +21 -0
  20. package/dist/atlas-migrations/register-atlas-host-migrations.d.ts.map +1 -0
  21. package/dist/atlas-migrations/register-atlas-host-migrations.js +148 -0
  22. package/dist/atlas-migrations/register-atlas-host-migrations.js.map +1 -0
  23. package/dist/buffered-capture.d.ts +4 -0
  24. package/dist/buffered-capture.d.ts.map +1 -0
  25. package/dist/buffered-capture.impl.bun.d.ts +18 -0
  26. package/dist/buffered-capture.impl.bun.d.ts.map +1 -0
  27. package/dist/buffered-capture.impl.bun.js +148 -0
  28. package/dist/buffered-capture.impl.bun.js.map +1 -0
  29. package/dist/buffered-capture.js +5 -0
  30. package/dist/buffered-capture.js.map +1 -0
  31. package/dist/bun-environment.impl.bun.d.ts +231 -0
  32. package/dist/bun-environment.impl.bun.d.ts.map +1 -0
  33. package/dist/bun-environment.impl.bun.js +352 -0
  34. package/dist/bun-environment.impl.bun.js.map +1 -0
  35. package/dist/cache-redis/cache-redis-connector.impl.bun.d.ts +20 -0
  36. package/dist/cache-redis/cache-redis-connector.impl.bun.d.ts.map +1 -0
  37. package/dist/cache-redis/cache-redis-connector.impl.bun.js +30 -0
  38. package/dist/cache-redis/cache-redis-connector.impl.bun.js.map +1 -0
  39. package/dist/cache-redis/cache-redis-connector.plugin.d.ts +21 -0
  40. package/dist/cache-redis/cache-redis-connector.plugin.d.ts.map +1 -0
  41. package/dist/cache-redis/cache-redis-connector.plugin.js +32 -0
  42. package/dist/cache-redis/cache-redis-connector.plugin.js.map +1 -0
  43. package/dist/cli-checkout.impl.bun.d.ts +13 -0
  44. package/dist/cli-checkout.impl.bun.d.ts.map +1 -0
  45. package/dist/cli-checkout.impl.bun.js +26 -0
  46. package/dist/cli-checkout.impl.bun.js.map +1 -0
  47. package/dist/docs/runtime-environment-bun.docs.descriptor.d.ts +19 -0
  48. package/dist/docs/runtime-environment-bun.docs.descriptor.d.ts.map +1 -0
  49. package/dist/docs/runtime-environment-bun.docs.descriptor.js +116 -0
  50. package/dist/docs/runtime-environment-bun.docs.descriptor.js.map +1 -0
  51. package/dist/filesystem/adapter.impl.bun.d.ts +15 -0
  52. package/dist/filesystem/adapter.impl.bun.d.ts.map +1 -0
  53. package/dist/filesystem/adapter.impl.bun.js +11 -0
  54. package/dist/filesystem/adapter.impl.bun.js.map +1 -0
  55. package/dist/filesystem/host-primitives.impl.bun.d.ts +12 -0
  56. package/dist/filesystem/host-primitives.impl.bun.d.ts.map +1 -0
  57. package/dist/filesystem/host-primitives.impl.bun.js +96 -0
  58. package/dist/filesystem/host-primitives.impl.bun.js.map +1 -0
  59. package/dist/filesystem/register.d.ts +12 -0
  60. package/dist/filesystem/register.d.ts.map +1 -0
  61. package/dist/filesystem/register.js +6 -0
  62. package/dist/filesystem/register.js.map +1 -0
  63. package/dist/filesystem/rooted-exclusive.impl.bun.d.ts +4 -0
  64. package/dist/filesystem/rooted-exclusive.impl.bun.d.ts.map +1 -0
  65. package/dist/filesystem/rooted-exclusive.impl.bun.js +135 -0
  66. package/dist/filesystem/rooted-exclusive.impl.bun.js.map +1 -0
  67. package/dist/held-launch/abi.impl.bun.d.ts +175 -0
  68. package/dist/held-launch/abi.impl.bun.d.ts.map +1 -0
  69. package/dist/held-launch/abi.impl.bun.js +476 -0
  70. package/dist/held-launch/abi.impl.bun.js.map +1 -0
  71. package/dist/held-launch/execution.impl.bun.d.ts +48 -0
  72. package/dist/held-launch/execution.impl.bun.d.ts.map +1 -0
  73. package/dist/held-launch/execution.impl.bun.js +375 -0
  74. package/dist/held-launch/execution.impl.bun.js.map +1 -0
  75. package/dist/held-launch/library.impl.bun.d.ts +23 -0
  76. package/dist/held-launch/library.impl.bun.d.ts.map +1 -0
  77. package/dist/held-launch/library.impl.bun.js +178 -0
  78. package/dist/held-launch/library.impl.bun.js.map +1 -0
  79. package/dist/held-launch/schemas.d.ts +10 -0
  80. package/dist/held-launch/schemas.d.ts.map +1 -0
  81. package/dist/held-launch/schemas.js +3 -0
  82. package/dist/held-launch/schemas.js.map +1 -0
  83. package/dist/held-launch/streams.impl.bun.d.ts +38 -0
  84. package/dist/held-launch/streams.impl.bun.d.ts.map +1 -0
  85. package/dist/held-launch/streams.impl.bun.js +183 -0
  86. package/dist/held-launch/streams.impl.bun.js.map +1 -0
  87. package/dist/host-channel.impl.bun.d.ts +25 -0
  88. package/dist/host-channel.impl.bun.d.ts.map +1 -0
  89. package/dist/host-channel.impl.bun.js +40 -0
  90. package/dist/host-channel.impl.bun.js.map +1 -0
  91. package/dist/host-client.impl.bun.d.ts +31 -0
  92. package/dist/host-client.impl.bun.d.ts.map +1 -0
  93. package/dist/host-client.impl.bun.js +39 -0
  94. package/dist/host-client.impl.bun.js.map +1 -0
  95. package/dist/host-credentials.d.ts +38 -0
  96. package/dist/host-credentials.d.ts.map +1 -0
  97. package/dist/host-credentials.js +44 -0
  98. package/dist/host-credentials.js.map +1 -0
  99. package/dist/host-loader.impl.bun.d.ts +12 -0
  100. package/dist/host-loader.impl.bun.d.ts.map +1 -0
  101. package/dist/host-loader.impl.bun.js +83 -0
  102. package/dist/host-loader.impl.bun.js.map +1 -0
  103. package/dist/host-signal.impl.bun.d.ts +11 -0
  104. package/dist/host-signal.impl.bun.d.ts.map +1 -0
  105. package/dist/host-signal.impl.bun.js +28 -0
  106. package/dist/host-signal.impl.bun.js.map +1 -0
  107. package/dist/http-listener.impl.bun.d.ts +8 -0
  108. package/dist/http-listener.impl.bun.d.ts.map +1 -0
  109. package/dist/http-listener.impl.bun.js +44 -0
  110. package/dist/http-listener.impl.bun.js.map +1 -0
  111. package/dist/index.d.ts +38 -0
  112. package/dist/index.d.ts.map +1 -0
  113. package/dist/index.js +314 -0
  114. package/dist/index.js.map +1 -0
  115. package/dist/local-execution.impl.bun.d.ts +47 -0
  116. package/dist/local-execution.impl.bun.d.ts.map +1 -0
  117. package/dist/local-execution.impl.bun.js +150 -0
  118. package/dist/local-execution.impl.bun.js.map +1 -0
  119. package/dist/logging/file-host.impl.bun.d.ts +4 -0
  120. package/dist/logging/file-host.impl.bun.d.ts.map +1 -0
  121. package/dist/logging/file-host.impl.bun.js +36 -0
  122. package/dist/logging/file-host.impl.bun.js.map +1 -0
  123. package/dist/logging/logging.plugin.d.ts +12 -0
  124. package/dist/logging/logging.plugin.d.ts.map +1 -0
  125. package/dist/logging/logging.plugin.js +20 -0
  126. package/dist/logging/logging.plugin.js.map +1 -0
  127. package/dist/native/held-launch/aarch64-apple-darwin/libvibes_held_launch.dylib +0 -0
  128. package/dist/native/held-launch/aarch64-apple-darwin/manifest.json +237 -0
  129. package/dist/native/held-launch/aarch64-apple-darwin/vibes-held-launch +0 -0
  130. package/dist/native/held-launch/aarch64-unknown-linux-gnu/libvibes_held_launch.so +0 -0
  131. package/dist/native/held-launch/aarch64-unknown-linux-gnu/manifest.json +237 -0
  132. package/dist/native/held-launch/aarch64-unknown-linux-gnu/vibes-held-launch +0 -0
  133. package/dist/native/held-launch/x86_64-apple-darwin/libvibes_held_launch.dylib +0 -0
  134. package/dist/native/held-launch/x86_64-apple-darwin/manifest.json +237 -0
  135. package/dist/native/held-launch/x86_64-apple-darwin/vibes-held-launch +0 -0
  136. package/dist/native/held-launch/x86_64-unknown-linux-gnu/libvibes_held_launch.so +0 -0
  137. package/dist/native/held-launch/x86_64-unknown-linux-gnu/manifest.json +237 -0
  138. package/dist/native/held-launch/x86_64-unknown-linux-gnu/vibes-held-launch +0 -0
  139. package/dist/native-image.consumer.plugin.d.ts +4 -0
  140. package/dist/native-image.consumer.plugin.d.ts.map +1 -0
  141. package/dist/native-image.consumer.plugin.js +14 -0
  142. package/dist/native-image.consumer.plugin.js.map +1 -0
  143. package/dist/native-image.d.ts +79 -0
  144. package/dist/native-image.d.ts.map +1 -0
  145. package/dist/native-image.impl.consumer.d.ts +15 -0
  146. package/dist/native-image.impl.consumer.d.ts.map +1 -0
  147. package/dist/native-image.impl.consumer.js +86 -0
  148. package/dist/native-image.impl.consumer.js.map +1 -0
  149. package/dist/native-image.js +19 -0
  150. package/dist/native-image.js.map +1 -0
  151. package/dist/native-library.consumer.plugin.d.ts +6 -0
  152. package/dist/native-library.consumer.plugin.d.ts.map +1 -0
  153. package/dist/native-library.consumer.plugin.js +33 -0
  154. package/dist/native-library.consumer.plugin.js.map +1 -0
  155. package/dist/native-library.impl.consumer.d.ts +14 -0
  156. package/dist/native-library.impl.consumer.d.ts.map +1 -0
  157. package/dist/native-library.impl.consumer.js +46 -0
  158. package/dist/native-library.impl.consumer.js.map +1 -0
  159. package/dist/native-network/index.d.ts +3 -0
  160. package/dist/native-network/index.d.ts.map +1 -0
  161. package/dist/native-network/index.js +3 -0
  162. package/dist/native-network/index.js.map +1 -0
  163. package/dist/native-network/native-host.d.ts +4 -0
  164. package/dist/native-network/native-host.d.ts.map +1 -0
  165. package/dist/native-network/native-host.js +14 -0
  166. package/dist/native-network/native-host.js.map +1 -0
  167. package/dist/native-network/native-network.descriptor.d.ts +4 -0
  168. package/dist/native-network/native-network.descriptor.d.ts.map +1 -0
  169. package/dist/native-network/native-network.descriptor.js +11 -0
  170. package/dist/native-network/native-network.descriptor.js.map +1 -0
  171. package/dist/native-network/native-network.impl.bun.d.ts +19 -0
  172. package/dist/native-network/native-network.impl.bun.d.ts.map +1 -0
  173. package/dist/native-network/native-network.impl.bun.js +190 -0
  174. package/dist/native-network/native-network.impl.bun.js.map +1 -0
  175. package/dist/native-network/native-network.plugin.d.ts +6 -0
  176. package/dist/native-network/native-network.plugin.d.ts.map +1 -0
  177. package/dist/native-network/native-network.plugin.js +27 -0
  178. package/dist/native-network/native-network.plugin.js.map +1 -0
  179. package/dist/package-plugins/index.d.ts +11 -0
  180. package/dist/package-plugins/index.d.ts.map +1 -0
  181. package/dist/package-plugins/index.js +11 -0
  182. package/dist/package-plugins/index.js.map +1 -0
  183. package/dist/package-plugins/package-plugins.capability.bun.d.ts +11 -0
  184. package/dist/package-plugins/package-plugins.capability.bun.d.ts.map +1 -0
  185. package/dist/package-plugins/package-plugins.capability.bun.js +14 -0
  186. package/dist/package-plugins/package-plugins.capability.bun.js.map +1 -0
  187. package/dist/package-plugins/primitives.impl.bun.d.ts +11 -0
  188. package/dist/package-plugins/primitives.impl.bun.d.ts.map +1 -0
  189. package/dist/package-plugins/primitives.impl.bun.js +32 -0
  190. package/dist/package-plugins/primitives.impl.bun.js.map +1 -0
  191. package/dist/package-plugins/read-admission.impl.bun.d.ts +11 -0
  192. package/dist/package-plugins/read-admission.impl.bun.d.ts.map +1 -0
  193. package/dist/package-plugins/read-admission.impl.bun.js +224 -0
  194. package/dist/package-plugins/read-admission.impl.bun.js.map +1 -0
  195. package/dist/package-plugins/schemas.d.ts +28 -0
  196. package/dist/package-plugins/schemas.d.ts.map +1 -0
  197. package/dist/package-plugins/schemas.js +3 -0
  198. package/dist/package-plugins/schemas.js.map +1 -0
  199. package/dist/process/launch-artifacts.impl.bun.d.ts +11 -0
  200. package/dist/process/launch-artifacts.impl.bun.d.ts.map +1 -0
  201. package/dist/process/launch-artifacts.impl.bun.js +25 -0
  202. package/dist/process/launch-artifacts.impl.bun.js.map +1 -0
  203. package/dist/process/process-probe.impl.bun.d.ts +15 -0
  204. package/dist/process/process-probe.impl.bun.d.ts.map +1 -0
  205. package/dist/process/process-probe.impl.bun.js +35 -0
  206. package/dist/process/process-probe.impl.bun.js.map +1 -0
  207. package/dist/process/runtime-process.impl.bun.d.ts +20 -0
  208. package/dist/process/runtime-process.impl.bun.d.ts.map +1 -0
  209. package/dist/process/runtime-process.impl.bun.js +42 -0
  210. package/dist/process/runtime-process.impl.bun.js.map +1 -0
  211. package/dist/process/schemas.d.ts +9 -0
  212. package/dist/process/schemas.d.ts.map +1 -0
  213. package/dist/process/schemas.js +3 -0
  214. package/dist/process/schemas.js.map +1 -0
  215. package/dist/process/spawn.impl.bun.d.ts +31 -0
  216. package/dist/process/spawn.impl.bun.d.ts.map +1 -0
  217. package/dist/process/spawn.impl.bun.js +66 -0
  218. package/dist/process/spawn.impl.bun.js.map +1 -0
  219. package/dist/process/which.impl.bun.d.ts +16 -0
  220. package/dist/process/which.impl.bun.d.ts.map +1 -0
  221. package/dist/process/which.impl.bun.js +25 -0
  222. package/dist/process/which.impl.bun.js.map +1 -0
  223. package/dist/pty.adapter.impl.bun.d.ts +17 -0
  224. package/dist/pty.adapter.impl.bun.d.ts.map +1 -0
  225. package/dist/pty.adapter.impl.bun.js +102 -0
  226. package/dist/pty.adapter.impl.bun.js.map +1 -0
  227. package/dist/pty.darwin.impl.bun.d.ts +11 -0
  228. package/dist/pty.darwin.impl.bun.d.ts.map +1 -0
  229. package/dist/pty.darwin.impl.bun.js +200 -0
  230. package/dist/pty.darwin.impl.bun.js.map +1 -0
  231. package/dist/pty.node-host.impl.bun.d.ts +10 -0
  232. package/dist/pty.node-host.impl.bun.d.ts.map +1 -0
  233. package/dist/pty.node-host.impl.bun.js +42 -0
  234. package/dist/pty.node-host.impl.bun.js.map +1 -0
  235. package/dist/resolution-root.impl.bun.d.ts +170 -0
  236. package/dist/resolution-root.impl.bun.d.ts.map +1 -0
  237. package/dist/resolution-root.impl.bun.js +373 -0
  238. package/dist/resolution-root.impl.bun.js.map +1 -0
  239. package/dist/restricted-execute.darwin.impl.bun.d.ts +19 -0
  240. package/dist/restricted-execute.darwin.impl.bun.d.ts.map +1 -0
  241. package/dist/restricted-execute.darwin.impl.bun.js +459 -0
  242. package/dist/restricted-execute.darwin.impl.bun.js.map +1 -0
  243. package/dist/runtime-plugin-host/daemon-execution.worker-shim.bun.d.ts +2 -0
  244. package/dist/runtime-plugin-host/daemon-execution.worker-shim.bun.d.ts.map +1 -0
  245. package/dist/runtime-plugin-host/daemon-execution.worker-shim.bun.js +31 -0
  246. package/dist/runtime-plugin-host/daemon-execution.worker-shim.bun.js.map +1 -0
  247. package/dist/runtime-plugin-host/host-hot-reload.consumer.d.ts +20 -0
  248. package/dist/runtime-plugin-host/host-hot-reload.consumer.d.ts.map +1 -0
  249. package/dist/runtime-plugin-host/host-hot-reload.consumer.js +236 -0
  250. package/dist/runtime-plugin-host/host-hot-reload.consumer.js.map +1 -0
  251. package/dist/runtime-plugin-host/hot-plugin-build.worker.consumer.d.ts +2 -0
  252. package/dist/runtime-plugin-host/hot-plugin-build.worker.consumer.d.ts.map +1 -0
  253. package/dist/runtime-plugin-host/hot-plugin-build.worker.consumer.js +66 -0
  254. package/dist/runtime-plugin-host/hot-plugin-build.worker.consumer.js.map +1 -0
  255. package/dist/runtime-plugin-host/hot-plugin-module.consumer.d.ts +45 -0
  256. package/dist/runtime-plugin-host/hot-plugin-module.consumer.d.ts.map +1 -0
  257. package/dist/runtime-plugin-host/hot-plugin-module.consumer.js +490 -0
  258. package/dist/runtime-plugin-host/hot-plugin-module.consumer.js.map +1 -0
  259. package/dist/runtime-plugin-host/hot-reload.consumer.d.ts +83 -0
  260. package/dist/runtime-plugin-host/hot-reload.consumer.d.ts.map +1 -0
  261. package/dist/runtime-plugin-host/hot-reload.consumer.js +168 -0
  262. package/dist/runtime-plugin-host/hot-reload.consumer.js.map +1 -0
  263. package/dist/runtime-plugin-host/reclaim.impl.bun.d.ts +37 -0
  264. package/dist/runtime-plugin-host/reclaim.impl.bun.d.ts.map +1 -0
  265. package/dist/runtime-plugin-host/reclaim.impl.bun.js +159 -0
  266. package/dist/runtime-plugin-host/reclaim.impl.bun.js.map +1 -0
  267. package/dist/runtime-plugin-host/runtime-plugin-host.impl.bun.d.ts +4 -0
  268. package/dist/runtime-plugin-host/runtime-plugin-host.impl.bun.d.ts.map +1 -0
  269. package/dist/runtime-plugin-host/runtime-plugin-host.impl.bun.js +181 -0
  270. package/dist/runtime-plugin-host/runtime-plugin-host.impl.bun.js.map +1 -0
  271. package/dist/runtime-plugin-host/runtime-plugin-host.plugin.d.ts +17 -0
  272. package/dist/runtime-plugin-host/runtime-plugin-host.plugin.d.ts.map +1 -0
  273. package/dist/runtime-plugin-host/runtime-plugin-host.plugin.js +36 -0
  274. package/dist/runtime-plugin-host/runtime-plugin-host.plugin.js.map +1 -0
  275. package/dist/runtime-plugin-host/runtime-thread.impl.bun.d.ts +53 -0
  276. package/dist/runtime-plugin-host/runtime-thread.impl.bun.d.ts.map +1 -0
  277. package/dist/runtime-plugin-host/runtime-thread.impl.bun.js +249 -0
  278. package/dist/runtime-plugin-host/runtime-thread.impl.bun.js.map +1 -0
  279. package/dist/runtime-plugin-host/runtime-thread.shim.bun.d.ts +2 -0
  280. package/dist/runtime-plugin-host/runtime-thread.shim.bun.d.ts.map +1 -0
  281. package/dist/runtime-plugin-host/runtime-thread.shim.bun.js +56 -0
  282. package/dist/runtime-plugin-host/runtime-thread.shim.bun.js.map +1 -0
  283. package/dist/runtime-plugin-host/schemas.d.ts +437 -0
  284. package/dist/runtime-plugin-host/schemas.d.ts.map +1 -0
  285. package/dist/runtime-plugin-host/schemas.js +54 -0
  286. package/dist/runtime-plugin-host/schemas.js.map +1 -0
  287. package/dist/runtime-plugin-host/source-watcher.consumer.d.ts +109 -0
  288. package/dist/runtime-plugin-host/source-watcher.consumer.d.ts.map +1 -0
  289. package/dist/runtime-plugin-host/source-watcher.consumer.js +383 -0
  290. package/dist/runtime-plugin-host/source-watcher.consumer.js.map +1 -0
  291. package/dist/schemas/environment.d.ts +197 -0
  292. package/dist/schemas/environment.d.ts.map +1 -0
  293. package/dist/schemas/environment.js +7 -0
  294. package/dist/schemas/environment.js.map +1 -0
  295. package/dist/schemas/host-resources.d.ts +85 -0
  296. package/dist/schemas/host-resources.d.ts.map +1 -0
  297. package/dist/schemas/host-resources.js +22 -0
  298. package/dist/schemas/host-resources.js.map +1 -0
  299. package/dist/schemas/native-image.d.ts +128 -0
  300. package/dist/schemas/native-image.d.ts.map +1 -0
  301. package/dist/schemas/native-image.js +45 -0
  302. package/dist/schemas/native-image.js.map +1 -0
  303. package/dist/schemas/native-network.d.ts +56 -0
  304. package/dist/schemas/native-network.d.ts.map +1 -0
  305. package/dist/schemas/native-network.js +55 -0
  306. package/dist/schemas/native-network.js.map +1 -0
  307. package/dist/schemas/restricted-execute.d.ts +40 -0
  308. package/dist/schemas/restricted-execute.d.ts.map +1 -0
  309. package/dist/schemas/restricted-execute.js +14 -0
  310. package/dist/schemas/restricted-execute.js.map +1 -0
  311. package/dist/schemas/runtime-socket.d.ts +8 -0
  312. package/dist/schemas/runtime-socket.d.ts.map +1 -0
  313. package/dist/schemas/runtime-socket.js +7 -0
  314. package/dist/schemas/runtime-socket.js.map +1 -0
  315. package/dist/schemas/self-spawn.d.ts +11 -0
  316. package/dist/schemas/self-spawn.d.ts.map +1 -0
  317. package/dist/schemas/self-spawn.js +3 -0
  318. package/dist/schemas/self-spawn.js.map +1 -0
  319. package/dist/schemas/standard-output.d.ts +6 -0
  320. package/dist/schemas/standard-output.d.ts.map +1 -0
  321. package/dist/schemas/standard-output.js +2 -0
  322. package/dist/schemas/standard-output.js.map +1 -0
  323. package/dist/schemas/telemetry.d.ts +25 -0
  324. package/dist/schemas/telemetry.d.ts.map +1 -0
  325. package/dist/schemas/telemetry.js +10 -0
  326. package/dist/schemas/telemetry.js.map +1 -0
  327. package/dist/schemas/test-environment.d.ts +27 -0
  328. package/dist/schemas/test-environment.d.ts.map +1 -0
  329. package/dist/schemas/test-environment.js +2 -0
  330. package/dist/schemas/test-environment.js.map +1 -0
  331. package/dist/serve-stall-start.d.ts +8 -0
  332. package/dist/serve-stall-start.d.ts.map +1 -0
  333. package/dist/serve-stall-start.js +88 -0
  334. package/dist/serve-stall-start.js.map +1 -0
  335. package/dist/serve-stall.d.ts +11 -0
  336. package/dist/serve-stall.d.ts.map +1 -0
  337. package/dist/serve-stall.js +19 -0
  338. package/dist/serve-stall.js.map +1 -0
  339. package/dist/serve-stall.plugin.d.ts +10 -0
  340. package/dist/serve-stall.plugin.d.ts.map +1 -0
  341. package/dist/serve-stall.plugin.js +34 -0
  342. package/dist/serve-stall.plugin.js.map +1 -0
  343. package/dist/services/account-home.d.ts +39 -0
  344. package/dist/services/account-home.d.ts.map +1 -0
  345. package/dist/services/account-home.js +152 -0
  346. package/dist/services/account-home.js.map +1 -0
  347. package/dist/services/cli-process-host.d.ts +50 -0
  348. package/dist/services/cli-process-host.d.ts.map +1 -0
  349. package/dist/services/cli-process-host.js +88 -0
  350. package/dist/services/cli-process-host.js.map +1 -0
  351. package/dist/services/compatibility-host.impl.bun.d.ts +4 -0
  352. package/dist/services/compatibility-host.impl.bun.d.ts.map +1 -0
  353. package/dist/services/compatibility-host.impl.bun.js +24 -0
  354. package/dist/services/compatibility-host.impl.bun.js.map +1 -0
  355. package/dist/services/executable-identity.impl.bun.d.ts +164 -0
  356. package/dist/services/executable-identity.impl.bun.d.ts.map +1 -0
  357. package/dist/services/executable-identity.impl.bun.js +73 -0
  358. package/dist/services/executable-identity.impl.bun.js.map +1 -0
  359. package/dist/services/fatal-signals.impl.bun.d.ts +15 -0
  360. package/dist/services/fatal-signals.impl.bun.d.ts.map +1 -0
  361. package/dist/services/fatal-signals.impl.bun.js +61 -0
  362. package/dist/services/fatal-signals.impl.bun.js.map +1 -0
  363. package/dist/services/graph-freshness.impl.bun.d.ts +108 -0
  364. package/dist/services/graph-freshness.impl.bun.d.ts.map +1 -0
  365. package/dist/services/graph-freshness.impl.bun.js +49 -0
  366. package/dist/services/graph-freshness.impl.bun.js.map +1 -0
  367. package/dist/services/host-identity.capability.bun.d.ts +10 -0
  368. package/dist/services/host-identity.capability.bun.d.ts.map +1 -0
  369. package/dist/services/host-identity.capability.bun.js +27 -0
  370. package/dist/services/host-identity.capability.bun.js.map +1 -0
  371. package/dist/services/host-identity.impl.bun.d.ts +53 -0
  372. package/dist/services/host-identity.impl.bun.d.ts.map +1 -0
  373. package/dist/services/host-identity.impl.bun.js +76 -0
  374. package/dist/services/host-identity.impl.bun.js.map +1 -0
  375. package/dist/services/host-resources.impl.bun.d.ts +49 -0
  376. package/dist/services/host-resources.impl.bun.d.ts.map +1 -0
  377. package/dist/services/host-resources.impl.bun.js +144 -0
  378. package/dist/services/host-resources.impl.bun.js.map +1 -0
  379. package/dist/services/http-fetch.impl.bun.d.ts +10 -0
  380. package/dist/services/http-fetch.impl.bun.d.ts.map +1 -0
  381. package/dist/services/http-fetch.impl.bun.js +38 -0
  382. package/dist/services/http-fetch.impl.bun.js.map +1 -0
  383. package/dist/services/output-plane.impl.bun.d.ts +6 -0
  384. package/dist/services/output-plane.impl.bun.d.ts.map +1 -0
  385. package/dist/services/output-plane.impl.bun.js +26 -0
  386. package/dist/services/output-plane.impl.bun.js.map +1 -0
  387. package/dist/services/process-action-lifetime.consumer.d.ts +47 -0
  388. package/dist/services/process-action-lifetime.consumer.d.ts.map +1 -0
  389. package/dist/services/process-action-lifetime.consumer.js +68 -0
  390. package/dist/services/process-action-lifetime.consumer.js.map +1 -0
  391. package/dist/services/process-view.impl.bun.d.ts +18 -0
  392. package/dist/services/process-view.impl.bun.d.ts.map +1 -0
  393. package/dist/services/process-view.impl.bun.js +17 -0
  394. package/dist/services/process-view.impl.bun.js.map +1 -0
  395. package/dist/services/runtime-host-signals.impl.bun.d.ts +8 -0
  396. package/dist/services/runtime-host-signals.impl.bun.d.ts.map +1 -0
  397. package/dist/services/runtime-host-signals.impl.bun.js +29 -0
  398. package/dist/services/runtime-host-signals.impl.bun.js.map +1 -0
  399. package/dist/services/runtime-http-listener.impl.bun.d.ts +14 -0
  400. package/dist/services/runtime-http-listener.impl.bun.d.ts.map +1 -0
  401. package/dist/services/runtime-http-listener.impl.bun.js +463 -0
  402. package/dist/services/runtime-http-listener.impl.bun.js.map +1 -0
  403. package/dist/services/runtime-path.impl.bun.d.ts +16 -0
  404. package/dist/services/runtime-path.impl.bun.d.ts.map +1 -0
  405. package/dist/services/runtime-path.impl.bun.js +34 -0
  406. package/dist/services/runtime-path.impl.bun.js.map +1 -0
  407. package/dist/services/runtime-scoped-values.impl.bun.d.ts +4 -0
  408. package/dist/services/runtime-scoped-values.impl.bun.d.ts.map +1 -0
  409. package/dist/services/runtime-scoped-values.impl.bun.js +7 -0
  410. package/dist/services/runtime-scoped-values.impl.bun.js.map +1 -0
  411. package/dist/services/runtime-socket-datagram.impl.bun.d.ts +15 -0
  412. package/dist/services/runtime-socket-datagram.impl.bun.d.ts.map +1 -0
  413. package/dist/services/runtime-socket-datagram.impl.bun.js +19 -0
  414. package/dist/services/runtime-socket-datagram.impl.bun.js.map +1 -0
  415. package/dist/services/runtime-socket.impl.bun.d.ts +20 -0
  416. package/dist/services/runtime-socket.impl.bun.d.ts.map +1 -0
  417. package/dist/services/runtime-socket.impl.bun.js +47 -0
  418. package/dist/services/runtime-socket.impl.bun.js.map +1 -0
  419. package/dist/services/runtime-stdio.impl.bun.d.ts +11 -0
  420. package/dist/services/runtime-stdio.impl.bun.d.ts.map +1 -0
  421. package/dist/services/runtime-stdio.impl.bun.js +37 -0
  422. package/dist/services/runtime-stdio.impl.bun.js.map +1 -0
  423. package/dist/services/self-spawn.impl.bun.d.ts +39 -0
  424. package/dist/services/self-spawn.impl.bun.d.ts.map +1 -0
  425. package/dist/services/self-spawn.impl.bun.js +58 -0
  426. package/dist/services/self-spawn.impl.bun.js.map +1 -0
  427. package/dist/services/standard-output.d.ts +100 -0
  428. package/dist/services/standard-output.d.ts.map +1 -0
  429. package/dist/services/standard-output.js +35 -0
  430. package/dist/services/standard-output.js.map +1 -0
  431. package/dist/services/user-environment.impl.bun.d.ts +19 -0
  432. package/dist/services/user-environment.impl.bun.d.ts.map +1 -0
  433. package/dist/services/user-environment.impl.bun.js +117 -0
  434. package/dist/services/user-environment.impl.bun.js.map +1 -0
  435. package/dist/services/workspace-env.d.ts +30 -0
  436. package/dist/services/workspace-env.d.ts.map +1 -0
  437. package/dist/services/workspace-env.js +45 -0
  438. package/dist/services/workspace-env.js.map +1 -0
  439. package/dist/services/workspace-root-probe.impl.bun.d.ts +14 -0
  440. package/dist/services/workspace-root-probe.impl.bun.d.ts.map +1 -0
  441. package/dist/services/workspace-root-probe.impl.bun.js +27 -0
  442. package/dist/services/workspace-root-probe.impl.bun.js.map +1 -0
  443. package/dist/session-members.impl.bun.d.ts +22 -0
  444. package/dist/session-members.impl.bun.d.ts.map +1 -0
  445. package/dist/session-members.impl.bun.js +74 -0
  446. package/dist/session-members.impl.bun.js.map +1 -0
  447. package/dist/sqlite-driver/index.d.ts +7 -0
  448. package/dist/sqlite-driver/index.d.ts.map +1 -0
  449. package/dist/sqlite-driver/index.js +7 -0
  450. package/dist/sqlite-driver/index.js.map +1 -0
  451. package/dist/sqlite-driver/sqlite-driver.impl.bun.d.ts +6 -0
  452. package/dist/sqlite-driver/sqlite-driver.impl.bun.d.ts.map +1 -0
  453. package/dist/sqlite-driver/sqlite-driver.impl.bun.js +269 -0
  454. package/dist/sqlite-driver/sqlite-driver.impl.bun.js.map +1 -0
  455. package/dist/sqlite-driver/sqlite-driver.plugin.d.ts +22 -0
  456. package/dist/sqlite-driver/sqlite-driver.plugin.d.ts.map +1 -0
  457. package/dist/sqlite-driver/sqlite-driver.plugin.js +44 -0
  458. package/dist/sqlite-driver/sqlite-driver.plugin.js.map +1 -0
  459. package/dist/telemetry/telemetry.d.ts +34 -0
  460. package/dist/telemetry/telemetry.d.ts.map +1 -0
  461. package/dist/telemetry/telemetry.js +2 -0
  462. package/dist/telemetry/telemetry.js.map +1 -0
  463. package/dist/telemetry/telemetry.plugin.d.ts +4 -0
  464. package/dist/telemetry/telemetry.plugin.d.ts.map +1 -0
  465. package/dist/telemetry/telemetry.plugin.js +78 -0
  466. package/dist/telemetry/telemetry.plugin.js.map +1 -0
  467. package/dist/terminal-pty-bridge.impl.bun.d.ts +31 -0
  468. package/dist/terminal-pty-bridge.impl.bun.d.ts.map +1 -0
  469. package/dist/terminal-pty-bridge.impl.bun.js +333 -0
  470. package/dist/terminal-pty-bridge.impl.bun.js.map +1 -0
  471. package/dist/test-tooling/lazy-environment.impl.bun.d.ts +16 -0
  472. package/dist/test-tooling/lazy-environment.impl.bun.d.ts.map +1 -0
  473. package/dist/test-tooling/lazy-environment.impl.bun.js +36 -0
  474. package/dist/test-tooling/lazy-environment.impl.bun.js.map +1 -0
  475. package/dist/test-tooling/starttls-refusal.d.ts +7 -0
  476. package/dist/test-tooling/starttls-refusal.d.ts.map +1 -0
  477. package/dist/test-tooling/starttls-refusal.js +50 -0
  478. package/dist/test-tooling/starttls-refusal.js.map +1 -0
  479. package/dist/test-tooling/svelte-client-preload.impl.bun.d.ts +2 -0
  480. package/dist/test-tooling/svelte-client-preload.impl.bun.d.ts.map +1 -0
  481. package/dist/test-tooling/svelte-client-preload.impl.bun.js +4 -0
  482. package/dist/test-tooling/svelte-client-preload.impl.bun.js.map +1 -0
  483. package/dist/test-tooling/svelte-compiler.impl.bun.d.ts +10 -0
  484. package/dist/test-tooling/svelte-compiler.impl.bun.d.ts.map +1 -0
  485. package/dist/test-tooling/svelte-compiler.impl.bun.js +33 -0
  486. package/dist/test-tooling/svelte-compiler.impl.bun.js.map +1 -0
  487. package/dist/test-tooling/svelte-server-preload.impl.bun.d.ts +2 -0
  488. package/dist/test-tooling/svelte-server-preload.impl.bun.d.ts.map +1 -0
  489. package/dist/test-tooling/svelte-server-preload.impl.bun.js +4 -0
  490. package/dist/test-tooling/svelte-server-preload.impl.bun.js.map +1 -0
  491. package/dist/test-tooling/test-environment.impl.bun.d.ts +45 -0
  492. package/dist/test-tooling/test-environment.impl.bun.d.ts.map +1 -0
  493. package/dist/test-tooling/test-environment.impl.bun.js +163 -0
  494. package/dist/test-tooling/test-environment.impl.bun.js.map +1 -0
  495. package/dist/test-tooling/test-process-root.impl.bun.d.ts +4 -0
  496. package/dist/test-tooling/test-process-root.impl.bun.d.ts.map +1 -0
  497. package/dist/test-tooling/test-process-root.impl.bun.js +65 -0
  498. package/dist/test-tooling/test-process-root.impl.bun.js.map +1 -0
  499. package/dist/test-tooling/unix-http.impl.bun.d.ts +28 -0
  500. package/dist/test-tooling/unix-http.impl.bun.d.ts.map +1 -0
  501. package/dist/test-tooling/unix-http.impl.bun.js +181 -0
  502. package/dist/test-tooling/unix-http.impl.bun.js.map +1 -0
  503. package/dist/transpiler/transpiler.plugin.d.ts +10 -0
  504. package/dist/transpiler/transpiler.plugin.d.ts.map +1 -0
  505. package/dist/transpiler/transpiler.plugin.js +18 -0
  506. package/dist/transpiler/transpiler.plugin.js.map +1 -0
  507. package/native/held-launch/Cargo.toml +23 -0
  508. package/native/held-launch/abi-manifest.json +234 -0
  509. package/native/held-launch/src/bin/vibes-held-launch.rs +35 -0
  510. package/native/held-launch/src/events.rs +99 -0
  511. package/native/held-launch/src/lib.rs +528 -0
  512. package/native/held-launch/symbols.golden +21 -0
  513. package/package.json +313 -4
  514. package/resources/restricted-supervisor.impl.bun.d.mts +3 -0
  515. package/resources/restricted-supervisor.impl.bun.mjs +49 -0
  516. package/resources/serve-stall-watch.impl.bun.d.mts +3 -0
  517. package/resources/serve-stall-watch.impl.bun.mjs +51 -0
@@ -0,0 +1,178 @@
1
+ /**
2
+ * The Bun binding of the native held-launch ABI.
3
+ *
4
+ * The host declares the exact installed artifact manifest
5
+ * (`<hostRoot>/native/held-launch/manifest.json` in a bundle, as the native
6
+ * stager writes it); nothing here resolves a package tree, walks directories
7
+ * or reads the environment. Before `dlopen`, the manifest's ABI id and
8
+ * signature table must equal the ones this binding speaks, and both artifacts
9
+ * (library and helper) must match their recorded sha256: a mismatched or
10
+ * altered artifact is a hard failure, never a best effort.
11
+ *
12
+ * Bun only (`bun:ffi`). A Node host has no binding and refuses held launch.
13
+ */
14
+ import { dlopen, FFIType, JSCallback, ptr } from 'bun:ffi';
15
+ import { CapabilityError } from '@vibesdotdev/kernel';
16
+ import { HELD_LAUNCH_ABI } from '@vibesdotdev/execution-local';
17
+ import { readLaunchArtifacts } from "../process/launch-artifacts.impl.bun.js";
18
+ import { nativeEventsHandle, nativeLaunchHandle } from "./abi.impl.bun.js";
19
+ /** The bun:ffi type each ABI type name is spoken as. */
20
+ const FFI_TYPES = {
21
+ ptr: FFIType.ptr,
22
+ cstring: FFIType.cstring,
23
+ usize: FFIType.u64,
24
+ isize: FFIType.i64,
25
+ u8: FFIType.u8,
26
+ u16: FFIType.u16,
27
+ u32: FFIType.u32,
28
+ u64: FFIType.u64,
29
+ i32: FFIType.i32,
30
+ i64: FFIType.i64
31
+ };
32
+ const t = FFI_TYPES;
33
+ /**
34
+ * The symbol table handed to `dlopen`, written in the ABI's own vocabulary. The
35
+ * `satisfies` clause is the compile-time proof that it is exactly
36
+ * {@link HELD_LAUNCH_ABI} (the table the manifest is verified against), so the
37
+ * typed `symbols` bun:ffi returns are the real signatures.
38
+ */
39
+ const HELD_LAUNCH_SYMBOLS = {
40
+ vhl_spawn: { args: [t.cstring, t.cstring, t.ptr, t.usize, t.usize, t.u8, t.u8, t.u8, t.u16, t.u16], returns: t.ptr },
41
+ vhl_pid: { args: [t.ptr], returns: t.i64 },
42
+ vhl_identity: { args: [t.ptr, t.ptr, t.ptr, t.usize], returns: t.isize },
43
+ vhl_control_fd: { args: [t.ptr], returns: t.i32 },
44
+ vhl_control_interest: { args: [t.ptr], returns: t.i32 },
45
+ vhl_advance_ready: { args: [t.ptr], returns: t.i32 },
46
+ vhl_ready: { args: [t.ptr, t.u32, t.u32, t.ptr, t.usize], returns: t.i32 },
47
+ vhl_release: { args: [t.ptr, t.u32, t.u32, t.ptr, t.usize], returns: t.i32 },
48
+ vhl_take_fd: { args: [t.ptr, t.u8], returns: t.i32 },
49
+ vhl_resize: { args: [t.ptr, t.u16, t.u16], returns: t.i32 },
50
+ vhl_terminate: { args: [t.ptr], returns: t.i32 },
51
+ vhl_reap: { args: [t.ptr, t.ptr], returns: t.i32 },
52
+ vhl_exec_status: { args: [t.ptr, t.ptr], returns: t.i32 },
53
+ vhl_dispose: { args: [t.ptr], returns: t.i32 },
54
+ vhl_last_error: { args: [], returns: t.cstring },
55
+ vhl_events_create: { args: [t.ptr, t.ptr, t.usize, t.usize], returns: t.ptr },
56
+ vhl_events_watch_fd: { args: [t.ptr, t.i32, t.u8, t.u64], returns: t.i32 },
57
+ vhl_events_watch_child: { args: [t.ptr, t.ptr, t.u64], returns: t.i32 },
58
+ vhl_events_cancel: { args: [t.ptr, t.u64], returns: t.i32 },
59
+ vhl_events_dispose: { args: [t.ptr], returns: t.i32 },
60
+ vhl_events_finish: { args: [t.ptr], returns: t.i32 }
61
+ };
62
+ /** Room for the native start token (a short opaque string); larger is refused natively, never truncated. */
63
+ const IDENTITY_TOKEN_CAPACITY = 512;
64
+ /** A NUL-terminated copy of `value`, kept alive by the caller for the call. */
65
+ function cString(value) {
66
+ return Buffer.from(`${value}\0`, 'utf8');
67
+ }
68
+ /**
69
+ * The address a native pointer return holds, or null for the null pointer.
70
+ * bun:ffi answers a pointer as a JS number; an address a number cannot hold
71
+ * exactly is refused rather than rounded into some other address.
72
+ */
73
+ function addressOf(pointer) {
74
+ if (pointer === null)
75
+ return null;
76
+ const address = Number(pointer);
77
+ if (address === 0)
78
+ return null;
79
+ if (!Number.isSafeInteger(address)) {
80
+ throw new CapabilityError('A native held-launch pointer cannot be held exactly by this binding.', 'UNAVAILABLE', {
81
+ reason: 'held-launch-pointer-unrepresentable',
82
+ retryable: false
83
+ });
84
+ }
85
+ return address;
86
+ }
87
+ /** The launch handle a native `ptr` return names, or null for the null pointer. */
88
+ function launchHandleOf(pointer) {
89
+ const address = addressOf(pointer);
90
+ return address === null ? null : nativeLaunchHandle(address);
91
+ }
92
+ /** The reactor handle a native `ptr` return names, or null for the null pointer. */
93
+ function eventsHandleOf(pointer) {
94
+ const address = addressOf(pointer);
95
+ return address === null ? null : nativeEventsHandle(address);
96
+ }
97
+ /** The bun:ffi pointer for a handle this binding minted from one. */
98
+ function pointerOf(handle) {
99
+ const address = handle;
100
+ // SAFETY: every handle was minted from a native address by `launchHandleOf`/`eventsHandleOf` (or is a scripted stand-in never given to bun:ffi); `Pointer` is bun:ffi's nominal brand over that same number.
101
+ return address;
102
+ }
103
+ /** Load the declared library with the symbol table above; a library that will not load is a typed refusal. */
104
+ function loadSymbols(manifestPath, libraryPath) {
105
+ try {
106
+ return dlopen(libraryPath, HELD_LAUNCH_SYMBOLS).symbols;
107
+ }
108
+ catch (error) {
109
+ throw new CapabilityError('The held-launch library could not be loaded.', 'UNAVAILABLE', {
110
+ reason: 'held-launch-library-unavailable',
111
+ retryable: false,
112
+ details: { manifestPath, library: libraryPath },
113
+ cause: error
114
+ });
115
+ }
116
+ }
117
+ /**
118
+ * Open the host-declared held-launch artifacts. `manifestPath` is the exact
119
+ * installed manifest; the library and helper sit beside it, as it names them.
120
+ */
121
+ export function openHeldLaunchArtifacts(options) {
122
+ const { manifestPath } = options;
123
+ const { libraryPath, helperPath } = readLaunchArtifacts(manifestPath);
124
+ const call = loadSymbols(manifestPath, libraryPath);
125
+ const library = {
126
+ spawn(helper, helperCwd, payload, maxPayloadBytes, stdin, stdout, stderr, cols, rows) {
127
+ const helperC = cString(helper);
128
+ const cwd = cString(helperCwd);
129
+ return launchHandleOf(call.vhl_spawn(ptr(helperC), ptr(cwd), ptr(payload), payload.length, maxPayloadBytes, stdin, stdout, stderr, cols, rows));
130
+ },
131
+ pid: (h) => Number(call.vhl_pid(pointerOf(h))),
132
+ identity(h) {
133
+ const out = new Uint32Array(2);
134
+ const token = new Uint8Array(IDENTITY_TOKEN_CAPACITY);
135
+ const length = Number(call.vhl_identity(pointerOf(h), ptr(out), ptr(token), token.length));
136
+ if (length <= 0)
137
+ return null;
138
+ return { pid: out[0], sessionId: out[1], startToken: new TextDecoder().decode(token.subarray(0, length)) };
139
+ },
140
+ controlFd: (h) => call.vhl_control_fd(pointerOf(h)),
141
+ controlInterest: (h) => call.vhl_control_interest(pointerOf(h)),
142
+ advanceReady: (h) => call.vhl_advance_ready(pointerOf(h)),
143
+ ready: (h, pid, sessionId, token) => call.vhl_ready(pointerOf(h), pid, sessionId, ptr(token), token.length),
144
+ release: (h, pid, sessionId, token) => call.vhl_release(pointerOf(h), pid, sessionId, ptr(token), token.length),
145
+ takeFd: (h, stream) => call.vhl_take_fd(pointerOf(h), stream),
146
+ resize: (h, cols, rows) => call.vhl_resize(pointerOf(h), cols, rows),
147
+ terminate: (h) => call.vhl_terminate(pointerOf(h)),
148
+ reap(h) {
149
+ const out = new Int32Array([-1, 0]);
150
+ const status = call.vhl_reap(pointerOf(h), ptr(out));
151
+ return { status, code: out[0], signal: out[1] };
152
+ },
153
+ execStatus(h) {
154
+ const out = new Int32Array([0]);
155
+ const status = call.vhl_exec_status(pointerOf(h), ptr(out));
156
+ return { status, errno: out[0] };
157
+ },
158
+ dispose: (h) => call.vhl_dispose(pointerOf(h)),
159
+ eventsCreate(onEvent, maxWatches, maxPendingCommands) {
160
+ // Thread-safe: the reactor thread calls it; Bun delivers it on the JS thread.
161
+ const callback = new JSCallback((id, event, detail) => onEvent(Number(id), event, detail), { args: [FFIType.u64, FFIType.u8, FFIType.i32], returns: FFIType.void, threadsafe: true });
162
+ const owner = eventsHandleOf(call.vhl_events_create(callback.ptr, null, maxWatches, maxPendingCommands));
163
+ if (owner === null) {
164
+ callback.close();
165
+ return null;
166
+ }
167
+ return { owner, releaseCallback: () => callback.close() };
168
+ },
169
+ eventsWatchFd: (owner, fd, interest, id) => call.vhl_events_watch_fd(pointerOf(owner), fd, interest, BigInt(id)),
170
+ eventsWatchChild: (owner, h, id) => call.vhl_events_watch_child(pointerOf(owner), pointerOf(h), BigInt(id)),
171
+ eventsCancel: (owner, id) => call.vhl_events_cancel(pointerOf(owner), BigInt(id)),
172
+ eventsDispose: (owner) => call.vhl_events_dispose(pointerOf(owner)),
173
+ eventsFinish: (owner) => call.vhl_events_finish(pointerOf(owner)),
174
+ lastError: () => call.vhl_last_error()
175
+ };
176
+ return { library, helperPath };
177
+ }
178
+ //# sourceMappingURL=library.impl.bun.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"library.impl.bun.js","sourceRoot":"","sources":["../../src/held-launch/library.impl.bun.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,EAAgB,MAAM,SAAS,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAE9E,OAAO,EACN,kBAAkB,EAClB,kBAAkB,EAIlB,MAAM,mBAAmB,CAAC;AAE3B,wDAAwD;AACxD,MAAM,SAAS,GAAG;IACjB,GAAG,EAAE,OAAO,CAAC,GAAG;IAChB,OAAO,EAAE,OAAO,CAAC,OAAO;IACxB,KAAK,EAAE,OAAO,CAAC,GAAG;IAClB,KAAK,EAAE,OAAO,CAAC,GAAG;IAClB,EAAE,EAAE,OAAO,CAAC,EAAE;IACd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,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACjE,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,cAAc,EAAE;KACtC,CAAC;IACF,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;AAChC,CAAC"}
@@ -0,0 +1,10 @@
1
+ /** The contracts of the Bun held-launch binding (`library.impl.bun.ts`). */
2
+ import type { HeldLaunchLibrary } from './abi.impl.bun.ts';
3
+ /** The installed artifacts a host declares. */
4
+ export interface HeldLaunchArtifacts {
5
+ /** The loaded library, speaking exactly the held-launch ABI (`HELD_LAUNCH_ABI`). */
6
+ readonly library: HeldLaunchLibrary;
7
+ /** The installed trusted helper, beside the manifest. */
8
+ readonly helperPath: string;
9
+ }
10
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/held-launch/schemas.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAE5E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,+CAA+C;AAC/C,MAAM,WAAW,mBAAmB;IACnC,oFAAoF;IACpF,QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAAC;IACpC,yDAAyD;IACzD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC5B"}
@@ -0,0 +1,3 @@
1
+ /** The contracts of the Bun held-launch binding (`library.impl.bun.ts`). */
2
+ export {};
3
+ //# sourceMappingURL=schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../src/held-launch/schemas.ts"],"names":[],"mappings":"AAAA,4EAA4E"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Streams over file descriptors a held launch transferred (`vhl_take_fd`),
3
+ * driven by the runtime's held-launch reactor, with one owner and one close
4
+ * per descriptor.
5
+ *
6
+ * No read or write ever waits on the threadpool or blocks the JS thread:
7
+ *
8
+ * - **Reads** wait for the reactor's level-triggered `readable` event, then do
9
+ * one synchronous read. With a single owner per fd, readiness means bytes (or
10
+ * EOF) are there, so the read returns at once; 0 bytes is EOF, and a PTY
11
+ * master's EIO (slave side gone) is its EOF.
12
+ * - **Writes** wait for `writable`, then write at most `PIPE_BUF` bytes, the
13
+ * amount POSIX guarantees a writable pipe accepts without blocking; larger
14
+ * chunks take several readiness turns. A descriptor the native side marked
15
+ * O_NONBLOCK answers EAGAIN instead, which re-arms the watch the same way.
16
+ * - **Close ordering.** Cancelling or ending a stream first aborts its pending
17
+ * watch and waits for the reactor to settle it (cancel ACK), then closes the
18
+ * fd once. A PTY master's readable and writable halves share the fd and close
19
+ * it after both are done.
20
+ */
21
+ import type { HeldLaunchEvents } from './abi.impl.bun.ts';
22
+ /** POSIX `PIPE_BUF` floor (512): a writable pipe accepts this much without blocking. */
23
+ export declare const WRITE_TURN_BYTES = 512;
24
+ /** The stream owners a held launch hands its transferred descriptors to. */
25
+ export interface HeldLaunchFdStreams {
26
+ /** A pipe the workload writes (stdout/stderr); the stream owns and closes `fd`. */
27
+ reader(fd: number): ReadableStream<Uint8Array>;
28
+ /** A pipe the workload reads (stdin); the stream owns and closes `fd`. */
29
+ writer(fd: number): WritableStream<Uint8Array>;
30
+ /** One fd read and written (a PTY master), closed once after both sides are done. */
31
+ duplex(fd: number): {
32
+ readable: ReadableStream<Uint8Array>;
33
+ writable: WritableStream<Uint8Array>;
34
+ };
35
+ }
36
+ /** Streams driven by `events` (the runtime's held-launch reactor). */
37
+ export declare function createReactorFdStreams(events: HeldLaunchEvents): HeldLaunchFdStreams;
38
+ //# sourceMappingURL=streams.impl.bun.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"streams.impl.bun.d.ts","sourceRoot":"","sources":["../../src/held-launch/streams.impl.bun.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAKH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,wFAAwF;AACxF,eAAO,MAAM,gBAAgB,MAAM,CAAC;AA4JpC,4EAA4E;AAC5E,MAAM,WAAW,mBAAmB;IACnC,mFAAmF;IACnF,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,cAAc,CAAC,UAAU,CAAC,CAAC;IAC/C,0EAA0E;IAC1E,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,cAAc,CAAC,UAAU,CAAC,CAAC;IAC/C,qFAAqF;IACrF,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG;QAAE,QAAQ,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;QAAC,QAAQ,EAAE,cAAc,CAAC,UAAU,CAAC,CAAA;KAAE,CAAC;CACnG;AAED,sEAAsE;AACtE,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,gBAAgB,GAAG,mBAAmB,CAgBpF"}
@@ -0,0 +1,183 @@
1
+ /**
2
+ * Streams over file descriptors a held launch transferred (`vhl_take_fd`),
3
+ * driven by the runtime's held-launch reactor, with one owner and one close
4
+ * per descriptor.
5
+ *
6
+ * No read or write ever waits on the threadpool or blocks the JS thread:
7
+ *
8
+ * - **Reads** wait for the reactor's level-triggered `readable` event, then do
9
+ * one synchronous read. With a single owner per fd, readiness means bytes (or
10
+ * EOF) are there, so the read returns at once; 0 bytes is EOF, and a PTY
11
+ * master's EIO (slave side gone) is its EOF.
12
+ * - **Writes** wait for `writable`, then write at most `PIPE_BUF` bytes, the
13
+ * amount POSIX guarantees a writable pipe accepts without blocking; larger
14
+ * chunks take several readiness turns. A descriptor the native side marked
15
+ * O_NONBLOCK answers EAGAIN instead, which re-arms the watch the same way.
16
+ * - **Close ordering.** Cancelling or ending a stream first aborts its pending
17
+ * watch and waits for the reactor to settle it (cancel ACK), then closes the
18
+ * fd once. A PTY master's readable and writable halves share the fd and close
19
+ * it after both are done.
20
+ */
21
+ import { closeSync, readSync, writeSync } from 'node:fs';
22
+ import { CapabilityError } from '@vibesdotdev/kernel';
23
+ import * as z from 'zod/v4';
24
+ /** POSIX `PIPE_BUF` floor (512): a writable pipe accepts this much without blocking. */
25
+ export const WRITE_TURN_BYTES = 512;
26
+ const READ_CHUNK_BYTES = 64 * 1024;
27
+ /** The errno name (`EAGAIN`) Node attaches to a failed fd call. */
28
+ const FdFailureSchema = z.object({ code: z.string().max(64).regex(/^[A-Z][A-Z0-9_]+$/) });
29
+ /** Run one synchronous fd call; a failure is returned, errno parsed, for the caller to retry or rethrow. */
30
+ function fdCall(operation) {
31
+ try {
32
+ return { ok: true, value: operation() };
33
+ }
34
+ catch (error) {
35
+ const failure = FdFailureSchema.safeParse(error);
36
+ return { ok: false, errno: failure.success ? failure.data.code : undefined, cause: error };
37
+ }
38
+ }
39
+ /** An fd that is not ready right now (or was interrupted): wait for the next readiness turn. */
40
+ function isRetryable(errno) {
41
+ return errno === 'EAGAIN' || errno === 'EWOULDBLOCK' || errno === 'EINTR';
42
+ }
43
+ /** Close `fd` once, when every holder has released it. */
44
+ function sharedClose(fd, holders) {
45
+ let remaining = holders;
46
+ let closed = false;
47
+ return () => {
48
+ remaining = Math.max(0, remaining - 1);
49
+ if (remaining > 0 || closed)
50
+ return;
51
+ closed = true;
52
+ closeSync(fd);
53
+ };
54
+ }
55
+ /** Each stream's own watch scope: aborting it cancels the pending watch; `close` confirms settlement. */
56
+ class WatchScope {
57
+ events;
58
+ fd;
59
+ #controller = new AbortController();
60
+ #pending = Promise.resolve();
61
+ constructor(events, fd) {
62
+ this.events = events;
63
+ this.fd = fd;
64
+ }
65
+ /** Wait for readiness. Rejects when the scope is closed. */
66
+ ready(interest) {
67
+ const watch = this.events.controlReady(this.fd, interest, this.#controller.signal);
68
+ this.#pending = watch;
69
+ return watch;
70
+ }
71
+ /** Cancel any pending watch and wait until the reactor has settled it. */
72
+ async close() {
73
+ this.#controller.abort(new DOMException('stream closed', 'AbortError'));
74
+ try {
75
+ await this.#pending;
76
+ }
77
+ catch (error) {
78
+ // The close's own abort, or the reactor's cancel ACK, is the expected settlement.
79
+ if (error instanceof DOMException && error.name === 'AbortError')
80
+ return;
81
+ if (error instanceof CapabilityError && error.code === 'CANCELLED')
82
+ return;
83
+ throw new CapabilityError('The held-launch stream watch settlement was uncertain during close.', 'UNAVAILABLE', {
84
+ reason: 'watch-close-uncertain',
85
+ retryable: false,
86
+ cause: error,
87
+ details: { fd: this.fd }
88
+ });
89
+ }
90
+ }
91
+ }
92
+ function readableOver(events, fd, release, halves = {}) {
93
+ const scope = new WatchScope(events, fd);
94
+ let done = false;
95
+ const finish = async () => {
96
+ if (done)
97
+ return;
98
+ done = true;
99
+ await scope.close();
100
+ // The operation is over for this fd: the unused sibling half must not keep it open.
101
+ await halves.sibling?.finish?.();
102
+ release();
103
+ };
104
+ if (halves.own)
105
+ halves.own.finish = finish;
106
+ return new ReadableStream({
107
+ async pull(controller) {
108
+ for (;;) {
109
+ await scope.ready('readable');
110
+ const buffer = new Uint8Array(READ_CHUNK_BYTES);
111
+ let bytes;
112
+ const read = fdCall(() => readSync(fd, buffer, 0, buffer.length, null));
113
+ if (read.ok)
114
+ bytes = read.value;
115
+ else if (isRetryable(read.errno))
116
+ continue;
117
+ else if (read.errno === 'EIO')
118
+ bytes = 0; // A PTY master whose slave side closed: EOF.
119
+ else {
120
+ await finish();
121
+ throw read.cause;
122
+ }
123
+ if (bytes === 0) {
124
+ // Release the fd before the reader observes EOF.
125
+ await finish();
126
+ controller.close();
127
+ return;
128
+ }
129
+ controller.enqueue(buffer.slice(0, bytes));
130
+ return;
131
+ }
132
+ },
133
+ cancel: finish
134
+ });
135
+ }
136
+ function writableOver(events, fd, release, halves = {}) {
137
+ const scope = new WatchScope(events, fd);
138
+ let done = false;
139
+ const finish = async () => {
140
+ if (done)
141
+ return;
142
+ done = true;
143
+ await scope.close();
144
+ release();
145
+ };
146
+ if (halves.own)
147
+ halves.own.finish = finish;
148
+ return new WritableStream({
149
+ async write(chunk) {
150
+ let offset = 0;
151
+ while (offset < chunk.length) {
152
+ await scope.ready('writable');
153
+ const length = Math.min(WRITE_TURN_BYTES, chunk.length - offset);
154
+ const written = fdCall(() => writeSync(fd, chunk, offset, length));
155
+ if (written.ok)
156
+ offset += written.value;
157
+ else if (!isRetryable(written.errno))
158
+ throw written.cause;
159
+ }
160
+ },
161
+ close: finish,
162
+ abort: finish
163
+ });
164
+ }
165
+ /** Streams driven by `events` (the runtime's held-launch reactor). */
166
+ export function createReactorFdStreams(events) {
167
+ return {
168
+ reader: (fd) => readableOver(events, fd, sharedClose(fd, 1)),
169
+ writer: (fd) => writableOver(events, fd, sharedClose(fd, 1)),
170
+ duplex(fd) {
171
+ const release = sharedClose(fd, 2);
172
+ // When the readable half ends (EOF, cancel or error) the operation is over:
173
+ // it also finishes the writable half, so the fd closes exactly once even
174
+ // if the writer is never closed. Each half still releases exactly once.
175
+ const writable = {};
176
+ return {
177
+ readable: readableOver(events, fd, release, { sibling: writable }),
178
+ writable: writableOver(events, fd, release, { own: writable })
179
+ };
180
+ }
181
+ };
182
+ }
183
+ //# sourceMappingURL=streams.impl.bun.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"streams.impl.bun.js","sourceRoot":"","sources":["../../src/held-launch/streams.impl.bun.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,wFAAwF;AACxF,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AACpC,MAAM,gBAAgB,GAAG,EAAE,GAAG,IAAI,CAAC;AAEnC,mEAAmE;AACnE,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,KAAK,C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UAAU,sBAAsB,CAAC,MAAwB;IAC9D,OAAO;QACN,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,EAAE,EAAE,WAAW,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QAC5D,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,EAAE,EAAE,WAAW,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QAC5D,MAAM,CAAC,EAAE;YACR,MAAM,OAAO,GAAG,WAAW,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;YACnC,4EAA4E;YAC5E,yEAAyE;YACzE,wEAAwE;YACxE,MAAM,QAAQ,GAAiB,EAAE,CAAC;YAClC,OAAO;gBACN,QAAQ,EAAE,YAAY,CAAC,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;gBAClE,QAAQ,EAAE,YAAY,CAAC,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;aAC9D,CAAC;QACH,CAAC;KACD,CAAC;AACH,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * The shim-to-host channel (rc01 §2.3, M13) and the host facts a Bun host
3
+ * declares: the kernel's channel base (`createHostChannel`, the launch facts,
4
+ * the capture's home and temp precedence) over this host's own filesystem and
5
+ * path calls.
6
+ *
7
+ * The thin `vibes` shim is the one publisher of these keys. It overwrites them
8
+ * before it imports the host, and the Bun environment captures each once. Only
9
+ * a host that declares `shimChannel: true` reads them; a non-shim Bun host
10
+ * declares no R unless its host passes `host.root` (D1), and its self-spawn
11
+ * command only as data (`host.selfSpawn`). Validation happens at capture
12
+ * (`host-root-invalid`, `host-entry-invalid`).
13
+ */
14
+ export { SHIM_CHANNEL_KEYS } from '@vibesdotdev/kernel';
15
+ export { captureLaunchFacts, captureTempDir, captureUserHome, SHIM_HOST_PROTOCOL_ENV } from '@vibesdotdev/execution-local';
16
+ export type { RuntimeHostDeclaration as BunHostDeclaration } from '@vibesdotdev/kernel';
17
+ export type { CapturedHostFacts, HostFacts as BunHostFacts, HostLaunchFacts as BunLaunchFacts } from '@vibesdotdev/execution-local';
18
+ /** This host's channel validation. */
19
+ export declare const bunHostChannel: {
20
+ requireHostRoot: (root: string | null, key: string) => string;
21
+ requireSelfSpawn: (argv: readonly string[] | null, source: string | null | undefined, key: string) => import("@vibesdotdev/execution-local").HostSelfSpawn;
22
+ captureHostFacts: (captured: import("@vibesdotdev/execution-local").HostChannelCapture, host: import("@vibesdotdev/kernel").RuntimeHostDeclaration | undefined, userHome: string) => import("@vibesdotdev/execution-local").CapturedHostFacts;
23
+ };
24
+ export declare const captureHostFacts: (captured: import("@vibesdotdev/execution-local").HostChannelCapture, host: import("@vibesdotdev/kernel").RuntimeHostDeclaration | undefined, userHome: string) => import("@vibesdotdev/execution-local").CapturedHostFacts, requireHostRoot: (root: string | null, key: string) => string, requireSelfSpawn: (argv: readonly string[] | null, source: string | null | undefined, key: string) => import("@vibesdotdev/execution-local").HostSelfSpawn;
25
+ //# sourceMappingURL=host-channel.impl.bun.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host-channel.impl.bun.d.ts","sourceRoot":"","sources":["../src/host-channel.impl.bun.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAMH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAC3H,YAAY,EAAE,sBAAsB,IAAI,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACxF,YAAY,EAAE,iBAAiB,EAAE,SAAS,IAAI,YAAY,EAAE,eAAe,IAAI,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAWpI,sCAAsC;AACtC,eAAO,MAAM,cAAc;;;;CASzB,CAAC;AAEH,eAAO,MAAQ,gBAAgB,+NAAE,eAAe,gDAAE,gBAAgB,0IAAmB,CAAC"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * The shim-to-host channel (rc01 §2.3, M13) and the host facts a Bun host
3
+ * declares: the kernel's channel base (`createHostChannel`, the launch facts,
4
+ * the capture's home and temp precedence) over this host's own filesystem and
5
+ * path calls.
6
+ *
7
+ * The thin `vibes` shim is the one publisher of these keys. It overwrites them
8
+ * before it imports the host, and the Bun environment captures each once. Only
9
+ * a host that declares `shimChannel: true` reads them; a non-shim Bun host
10
+ * declares no R unless its host passes `host.root` (D1), and its self-spawn
11
+ * command only as data (`host.selfSpawn`). Validation happens at capture
12
+ * (`host-root-invalid`, `host-entry-invalid`).
13
+ */
14
+ import { accessSync, constants, statSync } from 'node:fs';
15
+ import { extname, isAbsolute } from 'node:path';
16
+ import { ABSENT_PATH_CODES, createHostChannel, readOrAbsent } from '@vibesdotdev/execution-local';
17
+ export { SHIM_CHANNEL_KEYS } from '@vibesdotdev/kernel';
18
+ export { captureLaunchFacts, captureTempDir, captureUserHome, SHIM_HOST_PROTOCOL_ENV } from '@vibesdotdev/execution-local';
19
+ /** Absent, or not executable by this user, is the answer; any other fs failure is real and propagates. */
20
+ function isExecutableFile(path) {
21
+ return readOrAbsent(() => {
22
+ if (!statSync(path).isFile())
23
+ return false;
24
+ accessSync(path, constants.X_OK);
25
+ return true;
26
+ }, [...ABSENT_PATH_CODES, 'EACCES'], false);
27
+ }
28
+ /** This host's channel validation. */
29
+ export const bunHostChannel = createHostChannel({
30
+ // Neither a directory nor a regular file is no host root and no module entry.
31
+ entryKind: (path) => readOrAbsent(() => {
32
+ const st = statSync(path);
33
+ return st.isDirectory() ? 'directory' : st.isFile() ? 'file' : 'missing';
34
+ }, ABSENT_PATH_CODES, 'missing'),
35
+ isExecutableFile,
36
+ isAbsolute,
37
+ extname
38
+ });
39
+ export const { captureHostFacts, requireHostRoot, requireSelfSpawn } = bunHostChannel;
40
+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AC1E,CAAC,EAAE,iBAAiB,EAAE,SAAS,CAAC;IAChC,gBAAgB;IAChB,UAAU;IACV,OAAO;CACP,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,EAAE,gBAAgB,EAAE,eAAe,EAAE,gBAAgB,EAAE,GAAG,cAAc,CAAC"}
@@ -0,0 +1,31 @@
1
+ /** Runtime-owned native transports for the selected Bun host. */
2
+ import { BaseRuntimeClient, type RuntimeClientDescriptor } from '@vibesdotdev/kernel/client';
3
+ import type { KindContext, RuntimeRef } from '@vibesdotdev/kernel';
4
+ import { createBunHostResources } from './services/host-resources.impl.bun.ts';
5
+ import { BunRuntimeHttpListener } from './services/runtime-http-listener.impl.bun.ts';
6
+ import { BunRuntimeHostSignals } from './services/runtime-host-signals.impl.bun.ts';
7
+ import { BunRuntimeStdio } from './services/runtime-stdio.impl.bun.ts';
8
+ export declare const bunHostClientDescriptor: RuntimeClientDescriptor;
9
+ /** The kernel owns this client, including registration failures before activation. */
10
+ export declare class BunHostClient extends BaseRuntimeClient {
11
+ #private;
12
+ readonly graph: {
13
+ describeGraph: (root: string) => import("@vibesdotdev/execution-local").GraphIdentity;
14
+ graphDigest: (root: string) => string | null;
15
+ currentHostRoot: (runtime: import("@vibesdotdev/execution-local").GraphFreshnessRuntime) => string | null;
16
+ captureGraphIdentity: (runtime: import("@vibesdotdev/execution-local").GraphFreshnessRuntime, root: string | null) => import("@vibesdotdev/execution-local").GraphIdentity | null;
17
+ getCapturedGraphIdentity: (runtime: import("@vibesdotdev/execution-local").GraphFreshnessRuntime) => import("@vibesdotdev/execution-local").GraphIdentity | null;
18
+ judgeGraphReplaced: (loaded: Pick<import("@vibesdotdev/execution-local").GraphIdentity, "digest" | "mtimeMs">, current: Pick<import("@vibesdotdev/execution-local").GraphIdentity, "digest" | "mtimeMs">, processStartMs: number) => boolean | null;
19
+ graphFreshness: (runtime: import("@vibesdotdev/execution-local").GraphFreshnessRuntime, root: string | null) => import("@vibesdotdev/execution-local").GraphFreshness;
20
+ judgeGraphFreshness: (root: string | null, loaded: import("@vibesdotdev/execution-local").GraphIdentity | null) => import("@vibesdotdev/execution-local").GraphFreshness;
21
+ environmentGraphFreshness: (root: string | null, loaded: import("@vibesdotdev/execution-local").GraphIdentity | null) => import("@vibesdotdev/kernel/schemas").RuntimeGraphFreshness;
22
+ graphReplacedSince: (root: string, processStartMs: number, expectedDigest?: string | null) => import("@vibesdotdev/execution-local").GraphReplacedSince;
23
+ };
24
+ readonly resources: ReturnType<typeof createBunHostResources>;
25
+ readonly httpListener: BunRuntimeHttpListener;
26
+ readonly signals: BunRuntimeHostSignals;
27
+ readonly stdio: BunRuntimeStdio;
28
+ constructor(descriptor: RuntimeClientDescriptor, context?: KindContext<RuntimeRef>, host?: ReturnType<typeof createBunHostResources>);
29
+ protected onDispose(): Promise<void>;
30
+ }
31
+ //# sourceMappingURL=host-client.impl.bun.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host-client.impl.bun.d.ts","sourceRoot":"","sources":["../src/host-client.impl.bun.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,OAAO,EAAE,iBAAiB,EAAE,KAAK,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAC7F,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,8CAA8C,CAAC;AACtF,OAAO,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAEvE,eAAO,MAAM,uBAAuB,EAAE,uBAErC,CAAC;AAEF,sFAAsF;AACtF,qBAAa,aAAc,SAAQ,iBAAiB;;IACnD,QAAQ,CAAC,KAAK;;;;;;;;;;;MAA6B;IAC3C,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC;IAC9D,QAAQ,CAAC,YAAY,EAAE,sBAAsB,CAAC;IAC9C,QAAQ,CAAC,OAAO,EAAE,qBAAqB,CAAC;IACxC,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAC;gBAIpB,UAAU,EAAE,uBAAuB,EAAE,OAAO,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,EAAE,IAAI,GAAE,UAAU,CAAC,OAAO,sBAAsB,CAA4B;cASrI,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;CAUnD"}
@@ -0,0 +1,39 @@
1
+ /** Runtime-owned native transports for the selected Bun host. */
2
+ import { BaseRuntimeClient } from '@vibesdotdev/kernel/client';
3
+ import { createBunGraphFreshness } from "./services/graph-freshness.impl.bun.js";
4
+ import { createBunHostResources } from "./services/host-resources.impl.bun.js";
5
+ import { BunRuntimeHttpListener } from "./services/runtime-http-listener.impl.bun.js";
6
+ import { BunRuntimeHostSignals } from "./services/runtime-host-signals.impl.bun.js";
7
+ import { BunRuntimeStdio } from "./services/runtime-stdio.impl.bun.js";
8
+ export const bunHostClientDescriptor = {
9
+ id: 'bun-host', kind: 'runtime/client', name: 'Bun host lifecycle', hardware: ['consumer']
10
+ };
11
+ /** The kernel owns this client, including registration failures before activation. */
12
+ export class BunHostClient extends BaseRuntimeClient {
13
+ graph = createBunGraphFreshness();
14
+ resources;
15
+ httpListener;
16
+ signals;
17
+ stdio;
18
+ #releaseHost;
19
+ constructor(descriptor, context, host = createBunHostResources()) {
20
+ super(descriptor, context);
21
+ this.#releaseHost = host.retain();
22
+ this.resources = host;
23
+ this.httpListener = new BunRuntimeHttpListener(this.runtime);
24
+ this.signals = new BunRuntimeHostSignals(host.fatal);
25
+ this.stdio = new BunRuntimeStdio(this.runtime, host);
26
+ }
27
+ async onDispose() {
28
+ const results = await Promise.allSettled([
29
+ Promise.resolve().then(() => this.signals.dispose()),
30
+ Promise.resolve().then(() => this.stdio.dispose()),
31
+ Promise.resolve().then(() => this.httpListener.dispose())
32
+ ]);
33
+ const released = await Promise.allSettled([this.#releaseHost()]);
34
+ const failures = [...results, ...released].filter(result => result.status === 'rejected').map(result => result.reason);
35
+ if (failures.length)
36
+ throw new AggregateError(failures, 'The selected Bun host could not finalize all native transports.');
37
+ }
38
+ }
39
+ //# sourceMappingURL=host-client.impl.bun.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host-client.impl.bun.js","sourceRoot":"","sources":["../src/host-client.impl.bun.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,OAAO,EAAE,iBAAiB,EAAgC,MAAM,4BAA4B,CAAC;AAE7F,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,8CAA8C,CAAC;AACtF,OAAO,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAEvE,MAAM,CAAC,MAAM,uBAAuB,GAA4B;IAC/D,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,oBAAoB,EAAE,QAAQ,EAAE,CAAC,UAAU,CAAC;CAC1F,CAAC;AAEF,sFAAsF;AACtF,MAAM,OAAO,aAAc,SAAQ,iBAAiB;IAC1C,KAAK,GAAG,uBAAuB,EAAE,CAAC;IAClC,SAAS,CAA4C;IACrD,YAAY,CAAyB;IACrC,OAAO,CAAwB;IAC/B,KAAK,CAAkB;IAEvB,YAAY,CAAsB;IAE3C,YAAY,UAAmC,EAAE,OAAiC,EAAE,OAAkD,sBAAsB,EAAE;QAC7J,KAAK,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QAC3B,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;QAClC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,YAAY,GAAG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