@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 @@
1
+ {"version":3,"file":"runtime-plugin-host.plugin.js","sourceRoot":"","sources":["../../src/runtime-plugin-host/runtime-plugin-host.plugin.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,2BAA2B,EAAE,mBAAmB,EAAuC,MAAM,qBAAqB,CAAC;AAC5H,OAAO,EAAE,wBAAwB,EAAE,qBAAqB,EAA0B,MAAM,oDAAoD,CAAC;AAE7I,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC7C,EAAE,EAAE,yBAAyB;IAC7B,IAAI,EAAE,wBAAwB;IAC9B,IAAI,EAAE,yBAAyB;IAC/B,WAAW,EAAE,kEAAkE;IAC/E,IAAI,EAAE,KAAK;IACX,QAAQ,EAAE,CAAC,UAAU,CAAC;CACtB,CAAC;AAEF,MAAM,UAAU,4BAA4B,CAAC,OAAmB,EAAE,QAAoE,EAAE;IACvI,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,wBAAwB,CAAC;QAAE,OAAO,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC;IAC5F,OAAO,CAAC,kBAAkB,CAAC,wBAAwB,EAAE,8BAA8B,CAAC,CAAC;IACrF,OAAO,CAAC,cAAc,CAAC,wBAAwB,EAAE,8BAA8B,CAAC,EAAE,EAAE,KAAK,IAAI,EAAE;QAC9F,MAAM,EAAE,0BAA0B,EAAE,GAAG,MAAM,MAAM,CAAC,mCAAmC,CAAC,CAAC;QACzF,OAAO,2BAA2B,CAAC;YAClC,IAAI,EAAE,wBAAwB;YAC9B,EAAE,EAAE,8BAA8B,CAAC,EAAE;YACrC,UAAU,EAAE,EAAE,QAAQ,EAAE,CAAC,UAAU,CAAC,EAAE;YACtC,cAAc,EAAE,0BAA0B,CAAC,KAAK,CAAC;SACjD,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,0BAA0B,GAAkB,mBAAmB,CAAC;IAC5E,EAAE,EAAE,yBAAyB;IAC7B,IAAI,EAAE,yBAAyB;IAC/B,UAAU,CAAC,OAAO;QACjB,4BAA4B,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;CACD,CAAC,CAAC"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * The Bun host's runtime threads (`runtime/plugin-host`): a portable boot
3
+ * captured from the running host (`captureRuntimeThreadBoot`), booted again in
4
+ * a native thread through the kernel's one entry (`bootRuntimeThread`), for
5
+ * the thread shim and for a feature's own thread entry alike.
6
+ */
7
+ import { type OwnedWorkspaceBinding, type RuntimePluginLoader, type VibesRuntime, type WorkspaceComposition } from '@vibesdotdev/kernel';
8
+ import { type PluginSelectionPolicy } from '@vibesdotdev/kernel/bootstrap';
9
+ import type { RuntimeThreadBoot, RuntimeThreadDeclaration } from '@vibesdotdev/kernel/kinds/runtime-plugin-host.kind';
10
+ import type * as z from 'zod/v4';
11
+ import { RuntimeThreadBootSchema } from './schemas.ts';
12
+ /**
13
+ * The owned binding a host thread for `workspaceRoot` boots on:
14
+ * `{ root, cwd: root, moduleRoot: R(root) }`, canonical, with R the resolution
15
+ * root this host authorizes for the workspace. Refuses
16
+ * `runtime-owned-workspace-invalid` when the root is not an existing absolute
17
+ * directory or R cannot be resolved to one.
18
+ */
19
+ export declare function resolveOwnedWorkspaceBinding(runtime: VibesRuntime, workspaceRoot: string): Promise<OwnedWorkspaceBinding>;
20
+ /** The daemon execution worker shim inside the owned module graph rooted at `moduleRoot`, as a file URL. */
21
+ export declare function resolveOwnedDaemonExecutionShimHref(runtime: VibesRuntime, moduleRoot: string): Promise<string>;
22
+ /**
23
+ * Capture `runtime`'s portable thread boot: the caller's declaration (role,
24
+ * the thread's own scope, its composition) plus the host facts this runtime
25
+ * captured (build surface, host root and the role's self-spawn argv, path
26
+ * roots). A declaration or capture that is not portable refuses before any
27
+ * thread exists.
28
+ */
29
+ export declare function captureRuntimeThreadBoot(runtime: VibesRuntime, declaration: RuntimeThreadDeclaration): Promise<RuntimeThreadBoot>;
30
+ /** The boot facts a thread entry hands `bootRuntimeThread`, already validated by its own schema. */
31
+ export type RuntimeThreadBootFacts = Pick<z.output<typeof RuntimeThreadBootSchema>, 'scope' | 'buildSurface' | 'host' | 'paths' | 'composition'>;
32
+ /**
33
+ * Boot a thread's runtime through the kernel's one entry: this host's
34
+ * environment from the boot's captured facts, and a workspace composition of
35
+ * the boot's floor ahead of `options.floor` (built in the thread), the boot's
36
+ * global and failure policy, the caller's `options.selectionPolicy` and
37
+ * `options.omitSurfaces` (absent composes every selection and omits no
38
+ * package-declared surface), and its `select` when it declares one. Surface
39
+ * omission is generic package metadata; the host names no package. It binds
40
+ * the thread's default runtime.
41
+ *
42
+ * The thread answers the boot's build surface. First registration wins: a
43
+ * floor that registers its own surface host keeps it (the daemon's CLI host
44
+ * plugin registers the same `boot.buildSurface`); otherwise the thread
45
+ * registers the boot's. The caller owns the returned runtime and disposes it
46
+ * when its work ends.
47
+ */
48
+ export declare function bootRuntimeThread(boot: RuntimeThreadBootFacts, options?: {
49
+ readonly floor?: readonly RuntimePluginLoader[];
50
+ readonly selectionPolicy?: PluginSelectionPolicy;
51
+ readonly omitSurfaces?: WorkspaceComposition['omitSurfaces'];
52
+ }): Promise<VibesRuntime>;
53
+ //# sourceMappingURL=runtime-thread.impl.bun.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-thread.impl.bun.d.ts","sourceRoot":"","sources":["../../src/runtime-plugin-host/runtime-thread.impl.bun.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EASN,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAoB,KAAK,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC7F,OAAO,KAAK,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,oDAAoD,CAAC;AAGtH,OAAO,KAAK,KAAK,CAAC,MAAM,QAAQ,CAAC;AAGjC,OAAO,EAAE,uBAAuB,EAAkC,MAAM,cAAc,CAAC;AAuEvF;;;;;;GAMG;AACH,wBAAsB,4BAA4B,CAAC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAU/H;AAOD,4GAA4G;AAC5G,wBAAgB,mCAAmC,CAAC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAE9G;AAwBD;;;;;;GAMG;AACH,wBAAsB,wBAAwB,CAAC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,wBAAwB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAqDvI;AAED,oGAAoG;AACpG,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,uBAAuB,CAAC,EAAE,OAAO,GAAG,cAAc,GAAG,MAAM,GAAG,OAAO,GAAG,aAAa,CAAC,CAAC;AAEjJ;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,iBAAiB,CACtC,IAAI,EAAE,sBAAsB,EAC5B,OAAO,GAAE;IACR,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAChD,QAAQ,CAAC,eAAe,CAAC,EAAE,qBAAqB,CAAC;IACjD,QAAQ,CAAC,YAAY,CAAC,EAAE,oBAAoB,CAAC,cAAc,CAAC,CAAC;CACxD,GACJ,OAAO,CAAC,YAAY,CAAC,CA4CvB"}
@@ -0,0 +1,249 @@
1
+ /**
2
+ * The Bun host's runtime threads (`runtime/plugin-host`): a portable boot
3
+ * captured from the running host (`captureRuntimeThreadBoot`), booted again in
4
+ * a native thread through the kernel's one entry (`bootRuntimeThread`), for
5
+ * the thread shim and for a feature's own thread entry alike.
6
+ */
7
+ import { BUILD_SURFACE_CONTEXT_ID, bootstrapVibesRuntime, CapabilityError, composeBaseEnv, createRuntimePlugin, getRuntimeHostIdentity, getRuntimePackagePlugins, registerBuildSurface } from '@vibesdotdev/kernel';
8
+ import { resolveSelection } from '@vibesdotdev/kernel/bootstrap';
9
+ import { OwnedWorkspaceBindingSchema } from '@vibesdotdev/kernel/schemas/bootstrap';
10
+ import { getPathRoots, getRuntimePath } from '@vibesdotdev/paths';
11
+ import { createRuntimeEnvironmentBunPlugin } from "../index.js";
12
+ import { resolveResolutionRoot } from "../resolution-root.impl.bun.js";
13
+ import { RuntimeThreadBootSchema, RuntimeThreadDeclarationSchema } from "./schemas.js";
14
+ async function canonicalOwnedWorkspaceBinding(runtime, input) {
15
+ const parsed = OwnedWorkspaceBindingSchema.safeParse(input);
16
+ if (!parsed.success) {
17
+ throw new CapabilityError('Owned workspace binding is malformed.', 'INVALID_INPUT', {
18
+ reason: 'runtime-owned-workspace-invalid'
19
+ });
20
+ }
21
+ const paths = await getRuntimePath(runtime);
22
+ const loader = runtime.environment.loader;
23
+ const canonical = (directory) => {
24
+ if (!paths.isAbsolute(directory) || loader.stat?.(directory) !== 'directory') {
25
+ throw new CapabilityError('Owned workspace roots must be existing absolute directories.', 'INVALID_INPUT', {
26
+ reason: 'runtime-owned-workspace-invalid'
27
+ });
28
+ }
29
+ const resolved = loader.realPath?.(directory);
30
+ if (!resolved) {
31
+ throw new CapabilityError('This host cannot admit canonical workspace roots.', 'UNAVAILABLE', {
32
+ reason: 'runtime-owned-workspace-unavailable'
33
+ });
34
+ }
35
+ return resolved;
36
+ };
37
+ const binding = {
38
+ root: canonical(parsed.data.root),
39
+ cwd: canonical(parsed.data.cwd),
40
+ moduleRoot: canonical(parsed.data.moduleRoot)
41
+ };
42
+ const outside = (directory) => {
43
+ const relative = paths.relative(binding.root, directory);
44
+ return paths.isAbsolute(relative) || relative === '..' || relative.startsWith('../') || relative.startsWith('..\\');
45
+ };
46
+ // Boundary, after canonicalization (realpaths):
47
+ // - cwd must be the workspace root or inside it;
48
+ // - moduleRoot may be the workspace root or any directory inside it (a
49
+ // retained graph such as infra-deploy's `root/<moduleRelative>`), OR
50
+ // exactly the ONE resolution root this host authorizes for the workspace
51
+ // (its own install, or `global→hostWorkspace`; ADR-0020 decision 3);
52
+ // - any other external directory refuses `runtime-owned-workspace-invalid`.
53
+ if (outside(binding.cwd) || (outside(binding.moduleRoot) && binding.moduleRoot !== await authorizedModuleRoot(runtime, binding.root))) {
54
+ throw new CapabilityError('Owned cwd and module root must remain inside the retained workspace.', 'INVALID_INPUT', {
55
+ reason: 'runtime-owned-workspace-invalid'
56
+ });
57
+ }
58
+ return binding;
59
+ }
60
+ /**
61
+ * The canonical resolution root R this host authorizes for `workspaceRoot`:
62
+ * the same resolver `vibes --version` reports, started at the workspace with
63
+ * this host's vibes home and executable, never this process's own custody
64
+ * (`VIBES_HOST_ROOT`), so a daemon does not authorize its own R for every
65
+ * workspace. Null when R is not an existing directory.
66
+ */
67
+ async function authorizedModuleRoot(runtime, workspaceRoot) {
68
+ const paths = await getRuntimePath(runtime);
69
+ const loader = runtime.environment.loader;
70
+ const { root } = resolveResolutionRoot({
71
+ start: workspaceRoot,
72
+ vibesHome: getPathRoots(runtime).vibesHome,
73
+ execPath: process.execPath
74
+ });
75
+ if (!paths.isAbsolute(root) || loader.stat?.(root) !== 'directory')
76
+ return null;
77
+ return loader.realPath?.(root) ?? null;
78
+ }
79
+ /**
80
+ * The owned binding a host thread for `workspaceRoot` boots on:
81
+ * `{ root, cwd: root, moduleRoot: R(root) }`, canonical, with R the resolution
82
+ * root this host authorizes for the workspace. Refuses
83
+ * `runtime-owned-workspace-invalid` when the root is not an existing absolute
84
+ * directory or R cannot be resolved to one.
85
+ */
86
+ export async function resolveOwnedWorkspaceBinding(runtime, workspaceRoot) {
87
+ // Canonicalize the root first, so R is resolved from the same path the containment check uses.
88
+ const own = await canonicalOwnedWorkspaceBinding(runtime, { root: workspaceRoot, cwd: workspaceRoot, moduleRoot: workspaceRoot });
89
+ const moduleRoot = await authorizedModuleRoot(runtime, own.root);
90
+ if (moduleRoot === null) {
91
+ throw new CapabilityError('The workspace has no resolution root this host can boot.', 'INVALID_INPUT', {
92
+ reason: 'runtime-owned-workspace-invalid'
93
+ });
94
+ }
95
+ return canonicalOwnedWorkspaceBinding(runtime, { ...own, moduleRoot });
96
+ }
97
+ /** The owned module graph's copy of this host's runtime-thread shim. */
98
+ const RUNTIME_THREAD_SHIM_SPECIFIER = '@vibesdotdev/host-bun/runtime-plugin-host/runtime-thread.shim.bun';
99
+ /** The owned module graph's copy of this host's daemon execution worker shim. */
100
+ const DAEMON_EXECUTION_SHIM_SPECIFIER = '@vibesdotdev/host-bun/runtime-plugin-host/daemon-execution.worker-shim.bun';
101
+ /** The daemon execution worker shim inside the owned module graph rooted at `moduleRoot`, as a file URL. */
102
+ export function resolveOwnedDaemonExecutionShimHref(runtime, moduleRoot) {
103
+ return resolveOwnedShimHref(runtime, moduleRoot, DAEMON_EXECUTION_SHIM_SPECIFIER);
104
+ }
105
+ async function resolveOwnedShimHref(runtime, moduleRoot, specifier) {
106
+ const members = (await getRuntimePackagePlugins(runtime)).expandWorkspaceMembers(moduleRoot);
107
+ const selected = await resolveSelection(runtime, specifier, {
108
+ root: moduleRoot,
109
+ members,
110
+ contained: true
111
+ });
112
+ if ('missing' in selected) {
113
+ throw new CapabilityError('The owned workspace module graph does not contain a matching @vibesdotdev/host-bun runtime thread shim.', 'UNAVAILABLE', {
114
+ reason: 'runtime-thread-shim-unavailable',
115
+ cause: selected.cause
116
+ });
117
+ }
118
+ const paths = await getRuntimePath(runtime);
119
+ if (!paths.pathToFileURL) {
120
+ throw new CapabilityError('The runtime cannot convert the admitted thread shim path to a file URL.', 'UNAVAILABLE', {
121
+ reason: 'runtime-thread-shim-url-unavailable'
122
+ });
123
+ }
124
+ return paths.pathToFileURL(selected.realpath).href;
125
+ }
126
+ /**
127
+ * Capture `runtime`'s portable thread boot: the caller's declaration (role,
128
+ * the thread's own scope, its composition) plus the host facts this runtime
129
+ * captured (build surface, host root and the role's self-spawn argv, path
130
+ * roots). A declaration or capture that is not portable refuses before any
131
+ * thread exists.
132
+ */
133
+ export async function captureRuntimeThreadBoot(runtime, declaration) {
134
+ if (declaration.workspace !== undefined) {
135
+ await canonicalOwnedWorkspaceBinding(runtime, declaration.workspace);
136
+ }
137
+ const declared = RuntimeThreadDeclarationSchema.safeParse(declaration);
138
+ if (!declared.success) {
139
+ throw new CapabilityError('The runtime thread declaration is not portable.', 'INVALID_INPUT', {
140
+ reason: 'runtime-thread-declaration-invalid', cause: declared.error
141
+ });
142
+ }
143
+ const ownedWorkspace = declared.data.workspace
144
+ ? await canonicalOwnedWorkspaceBinding(runtime, declared.data.workspace)
145
+ : undefined;
146
+ const identity = await getRuntimeHostIdentity(runtime);
147
+ const roots = getPathRoots(runtime);
148
+ const scope = ownedWorkspace
149
+ ? { ...declared.data.scope, workspace: { ...declared.data.scope.workspace, root: ownedWorkspace.root } }
150
+ : declared.data.scope;
151
+ const parentSelfSpawnSource = runtime.localEnvironment.selfSpawnSource?.() ?? null;
152
+ const host = ownedWorkspace
153
+ ? {
154
+ root: ownedWorkspace.moduleRoot,
155
+ cwd: ownedWorkspace.cwd,
156
+ rootCustody: true,
157
+ shimHref: await resolveOwnedShimHref(runtime, ownedWorkspace.moduleRoot, RUNTIME_THREAD_SHIM_SPECIFIER),
158
+ baseEnv: composeBaseEnv(runtime.getEnvSnapshot(), runtime.localEnvironment.getPlatform?.()),
159
+ selfSpawn: parentSelfSpawnSource !== null ? identity.selfSpawnArgv(declared.data.role) : [],
160
+ selfSpawnSource: parentSelfSpawnSource
161
+ }
162
+ : {
163
+ root: identity.hostRoot(),
164
+ selfSpawn: identity.selfSpawnArgv(declared.data.role),
165
+ selfSpawnSource: runtime.localEnvironment.selfSpawnSource?.()
166
+ };
167
+ const boot = RuntimeThreadBootSchema.safeParse({
168
+ version: 1,
169
+ role: declared.data.role,
170
+ scope,
171
+ buildSurface: await runtime.context(BUILD_SURFACE_CONTEXT_ID),
172
+ host,
173
+ paths: {
174
+ vibesHome: roots.vibesHome, profileName: roots.profileName,
175
+ configDir: roots.configDir, logDir: roots.logDir,
176
+ tempDir: roots.tempDir, origin: roots.origin
177
+ },
178
+ composition: declared.data.composition
179
+ });
180
+ if (!boot.success) {
181
+ throw new CapabilityError('The runtime thread host declaration is incomplete.', 'UNAVAILABLE', {
182
+ reason: 'runtime-thread-host-invalid'
183
+ });
184
+ }
185
+ return boot.data;
186
+ }
187
+ /**
188
+ * Boot a thread's runtime through the kernel's one entry: this host's
189
+ * environment from the boot's captured facts, and a workspace composition of
190
+ * the boot's floor ahead of `options.floor` (built in the thread), the boot's
191
+ * global and failure policy, the caller's `options.selectionPolicy` and
192
+ * `options.omitSurfaces` (absent composes every selection and omits no
193
+ * package-declared surface), and its `select` when it declares one. Surface
194
+ * omission is generic package metadata; the host names no package. It binds
195
+ * the thread's default runtime.
196
+ *
197
+ * The thread answers the boot's build surface. First registration wins: a
198
+ * floor that registers its own surface host keeps it (the daemon's CLI host
199
+ * plugin registers the same `boot.buildSurface`); otherwise the thread
200
+ * registers the boot's. The caller owns the returned runtime and disposes it
201
+ * when its work ends.
202
+ */
203
+ export async function bootRuntimeThread(boot, options = {}) {
204
+ const source = boot.host.selfSpawnSource;
205
+ if (source === null && !boot.host.rootCustody) {
206
+ throw new CapabilityError('The runtime thread host has no declared self-spawn source.', 'UNAVAILABLE', {
207
+ reason: 'runtime-thread-self-spawn-source-unavailable'
208
+ });
209
+ }
210
+ const buildSurface = createRuntimePlugin({
211
+ id: 'runtime-thread.build-surface',
212
+ name: 'Runtime thread build surface',
213
+ dependencies: ['context'],
214
+ onRegister(runtime) {
215
+ if (!runtime.hasContext(BUILD_SURFACE_CONTEXT_ID))
216
+ registerBuildSurface(runtime, boot.buildSurface);
217
+ }
218
+ });
219
+ const composition = {
220
+ kind: 'workspace',
221
+ floor: {
222
+ ...boot.composition.floor,
223
+ plugins: [...boot.composition.floor.plugins, ...(options.floor ?? []), async () => buildSurface]
224
+ },
225
+ global: boot.composition.global,
226
+ globalPlugins: boot.composition.globalPlugins,
227
+ failurePolicy: boot.composition.failurePolicy,
228
+ select: boot.composition.select,
229
+ selectionPolicy: options.selectionPolicy,
230
+ omitSurfaces: options.omitSurfaces ?? boot.composition.omitSurfaces
231
+ };
232
+ const capture = boot.host.cwd !== undefined
233
+ ? { env: boot.host.baseEnv ?? {}, cwd: boot.host.cwd }
234
+ : undefined;
235
+ return bootstrapVibesRuntime({
236
+ environment: createRuntimeEnvironmentBunPlugin({
237
+ scope: boot.scope, paths: boot.paths,
238
+ host: {
239
+ root: boot.host.root,
240
+ rootCustody: boot.host.rootCustody,
241
+ selfSpawn: source !== null ? { argv: [...boot.host.selfSpawn], source } : undefined,
242
+ spawnEnv: { ...boot.host.baseEnv, HOME: boot.paths.vibesHome, TMPDIR: boot.paths.tempDir }
243
+ }
244
+ }, capture),
245
+ composition,
246
+ binding: 'default'
247
+ });
248
+ }
249
+ //# sourceMappingURL=runtime-thread.impl.bun.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-thread.impl.bun.js","sourceRoot":"","sources":["../../src/runtime-plugin-host/runtime-thread.impl.bun.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACN,wBAAwB,EACxB,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,sBAAsB,EACtB,wBAAwB,EACxB,oBAAoB,EAKpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAA8B,MAAM,+BAA+B,CAAC;AAE7F,OAAO,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AACpF,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAElE,OAAO,EAAE,iCAAiC,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,8BAA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gBAClC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,SAAS;gBACnF,QAAQ,EAAE,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE;aAC1F;SACD,EAAE,OAAO,CAAC;QACX,WAAW;QACX,OAAO,EAAE,SAAS;KAClB,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=runtime-thread.shim.bun.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-thread.shim.bun.d.ts","sourceRoot":"","sources":["../../src/runtime-plugin-host/runtime-thread.shim.bun.ts"],"names":[],"mappings":""}
@@ -0,0 +1,56 @@
1
+ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
2
+ if (typeof path === "string" && /^\.\.?\//.test(path)) {
3
+ return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
4
+ return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
5
+ });
6
+ }
7
+ return path;
8
+ };
9
+ /**
10
+ * A runtime thread (`runtime/plugin-host` `spawnRuntimeThread`): bridges
11
+ * node:worker_threads to the program named in workerData, after booting the
12
+ * thread's runtime from its portable boot through the kernel's one entry. A
13
+ * boot or program failure is the thread's own error and exit, as for the
14
+ * daemon execution worker; no failure is reduced to a message. The program
15
+ * owns the runtime it is handed and disposes it when its work ends; a `run`
16
+ * that rejects leaves the runtime to the shim, which disposes it before the
17
+ * failure surfaces.
18
+ */
19
+ import { parentPort, workerData } from 'node:worker_threads';
20
+ import * as z from 'zod/v4';
21
+ import { settle } from '@vibesdotdev/kernel';
22
+ import { RuntimeSurfaceSchema } from '@vibesdotdev/kernel/schemas/scope';
23
+ import { bootRuntimeThread } from "./runtime-thread.impl.bun.js";
24
+ import { RuntimeThreadBootSchema } from "./schemas.js";
25
+ const ShimInputSchema = z.object({
26
+ boot: RuntimeThreadBootSchema,
27
+ programHref: z.string().min(1),
28
+ // The program parses its own payload; the shim only refuses an absent one.
29
+ payload: z.custom((value) => value !== undefined)
30
+ }).strict();
31
+ const ProgramModuleSchema = z.object({
32
+ run: z.custom((value) => value instanceof Function),
33
+ floor: z.custom((value) => value instanceof Function).optional(),
34
+ selectionPolicy: z.custom((value) => value instanceof Function).optional(),
35
+ omitSurfaces: z.array(RuntimeSurfaceSchema).optional()
36
+ });
37
+ const input = ShimInputSchema.parse(workerData);
38
+ const owner = parentPort;
39
+ if (!owner)
40
+ throw new Error('A runtime thread requires parentPort');
41
+ const program = ProgramModuleSchema.safeParse(await import(__rewriteRelativeImportExtension(input.programHref)));
42
+ if (!program.success)
43
+ throw new Error('The runtime thread program does not export run');
44
+ const runtime = await bootRuntimeThread(input.boot, {
45
+ floor: program.data.floor?.(input.boot) ?? [],
46
+ selectionPolicy: program.data.selectionPolicy,
47
+ omitSurfaces: program.data.omitSurfaces
48
+ });
49
+ const ran = await settle(() => program.data.run(runtime, owner, input.payload));
50
+ if (!ran.ok) {
51
+ const disposed = await settle(() => runtime.dispose());
52
+ if (!disposed.ok)
53
+ throw new AggregateError([ran.cause, disposed.cause], 'The runtime thread program and its disposal failed.', { cause: ran.cause });
54
+ throw ran.cause;
55
+ }
56
+ //# sourceMappingURL=runtime-thread.shim.bun.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-thread.shim.bun.js","sourceRoot":"","sources":["../../src/runtime-plugin-host/runtime-thread.shim.bun.ts"],"names":[],"mappings":";;;;;;;;AAAA;;;;;;;;;GASG;AACH,O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