@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,459 @@
1
+ /**
2
+ * Cooperative test-process protection, not a hostile-code sandbox.
3
+ * Default-deny Seatbelt policy; descendants inherit filesystem/network rules.
4
+ * Process-group supervision does not reap a descendant that deliberately
5
+ * creates a new session, nor survive abrupt death of this supervising host.
6
+ */
7
+ import { spawn } from 'node:child_process';
8
+ import { access, lstat, readFile, realpath, stat } from 'node:fs/promises';
9
+ import { createHash } from 'node:crypto';
10
+ import { fileURLToPath } from 'node:url';
11
+ import { Writable } from 'node:stream';
12
+ import { DEFAULT_VIBES_HOME_DIRNAME } from '@vibesdotdev/paths';
13
+ import { attempt, attemptAsync, hasErrno, requireExecutionPlatform } from '@vibesdotdev/execution-local';
14
+ import { bunWhichCommand } from "./process/which.impl.bun.js";
15
+ import { RestrictedExecutorBoundsSchema } from "./schemas/restricted-execute.js";
16
+ import { constants } from 'node:fs';
17
+ import { isAbsolute, dirname, basename, join, relative, sep } from 'node:path';
18
+ import { StringDecoder } from 'node:string_decoder';
19
+ // The supervisor's own bytes, embedded: `bun build --compile` carries a text import into the executable, and the
20
+ // packed `dist` loads it from the packed file. This relative path is identical from src and dist.
21
+ import SUPERVISOR_TEXT from '../resources/restricted-supervisor.impl.bun.mjs' with { type: 'text' };
22
+ import { CapabilityError, CaughtFailureSchema, valueFreeFailure } from '@vibesdotdev/kernel';
23
+ import * as z from 'zod/v4';
24
+ import { RestrictedExecuteOptionsSchema } from '@vibesdotdev/kernel/execution';
25
+ const ENFORCER = '/usr/bin/sandbox-exec';
26
+ const READY = 'restricted-execution-ready\n';
27
+ /** A launch failure marker: which phase failed and the errno category only; the supervisor never reports a message. */
28
+ const LaunchFailureSchema = z.string().regex(/^(?:restricted-target-spawn-failed|restricted-supervisor-failed):[A-Z][A-Z0-9_]{0,63}\n$/)
29
+ .transform(marker => ({ phase: marker.startsWith('restricted-target') ? 'target' : 'supervisor', errno: marker.slice(marker.indexOf(':') + 1, -1) }));
30
+ const SUPERVISOR_SHA256 = 'abe2c8f7c3c501ca71939a19d5eb399c468c307d483dd645e956918b84e16d38';
31
+ // resources is part of the published package. This relative path is identical from
32
+ // src and dist; no runtime source-vs-build guessing.
33
+ const SUPERVISOR_FILE = fileURLToPath(new URL('../resources/restricted-supervisor.impl.bun.mjs', import.meta.url));
34
+ const AbsoluteAccountHomeSchema = z.string().refine(home => home.trim() !== '' && isAbsolute(home));
35
+ const SupervisorInvocationSchema = z.object({
36
+ argv: z.tuple([z.string().min(1)]).rest(z.string()),
37
+ env: z.record(z.string(), z.string())
38
+ });
39
+ /** Capture the selected host command once; absent capability never guesses a runtime. */
40
+ export function captureRestrictedSupervisor(invocation) {
41
+ const parsed = SupervisorInvocationSchema.safeParse(invocation);
42
+ if (!parsed.success)
43
+ throw new CapabilityError('Restricted execution requires a declared script runtime command.', 'UNAVAILABLE', {
44
+ reason: 'host-command-unavailable', retryable: false
45
+ });
46
+ return parsed.data;
47
+ }
48
+ const BROAD_ROOTS = new Set([
49
+ '/', '/Users', '/Volumes', '/System', '/Library', '/Applications', '/usr',
50
+ '/bin', '/sbin', '/dev', '/opt', '/private', '/private/tmp', '/private/var',
51
+ '/tmp', '/var'
52
+ ]);
53
+ function invalid() {
54
+ return new CapabilityError('Invalid restricted execution request.', 'INVALID_INPUT', {
55
+ reason: 'restricted-execution-invalid-input', retryable: false
56
+ });
57
+ }
58
+ const UNAVAILABLE_MESSAGE = 'Native restricted execution could not enforce this request.';
59
+ const UNAVAILABLE_OPTIONS = { reason: 'restricted-execution-unavailable', retryable: false };
60
+ function unavailable(details) {
61
+ return new CapabilityError(UNAVAILABLE_MESSAGE, 'UNAVAILABLE', { ...UNAVAILABLE_OPTIONS, details });
62
+ }
63
+ function cleanupFailed() {
64
+ return new CapabilityError('Restricted execution cleanup could not be confirmed.', 'UNAVAILABLE', {
65
+ reason: 'restricted-cleanup-failed', retryable: false
66
+ });
67
+ }
68
+ function inside(root, path) {
69
+ const part = relative(root, path);
70
+ return part === '' || (!isAbsolute(part) && part !== '..' && !part.startsWith(`..${sep}`));
71
+ }
72
+ function literal(path) {
73
+ // Keep SBPL strings unambiguous. No caller text becomes policy syntax.
74
+ const unsafe = Array.from(path).some(character => {
75
+ const code = character.charCodeAt(0);
76
+ return code <= 0x1f || code === 0x7f || character === '"' || character === '\\';
77
+ });
78
+ if (unsafe)
79
+ throw invalid();
80
+ return `"${path}"`;
81
+ }
82
+ async function canonical(path) {
83
+ if (!isAbsolute(path))
84
+ throw invalid();
85
+ // Any failure to resolve is the same redacted refusal; the path stays out of it.
86
+ const [resolved] = await Promise.allSettled([realpath(path)]);
87
+ if (resolved.status === 'rejected')
88
+ throw invalid();
89
+ return resolved.value;
90
+ }
91
+ /** Canonical protection of a root that may not yet have been created. */
92
+ async function protectedPath(path) {
93
+ if (!isAbsolute(path))
94
+ throw invalid();
95
+ const suffix = [];
96
+ let current = path;
97
+ for (;;) {
98
+ const resolved = await attemptAsync(() => realpath(current));
99
+ if ('value' in resolved)
100
+ return join(resolved.value, ...suffix);
101
+ if (!hasErrno(resolved.failure, 'ENOENT'))
102
+ throw unavailable();
103
+ // An existing dangling link is not a missing ordinary directory.
104
+ const entry = await attemptAsync(() => lstat(current));
105
+ if ('value' in entry)
106
+ throw invalid();
107
+ if (!hasErrno(entry.failure, 'ENOENT'))
108
+ throw entry.failure.thrown;
109
+ const parent = dirname(current);
110
+ if (parent === current)
111
+ throw unavailable();
112
+ suffix.unshift(basename(current));
113
+ current = parent;
114
+ }
115
+ }
116
+ async function admit(input, host) {
117
+ if (!AbsoluteAccountHomeSchema.safeParse(host.accountHome).success) {
118
+ throw new CapabilityError('Restricted execution requires an absolute captured account home.', 'UNAVAILABLE', {
119
+ reason: 'restricted-account-home-unavailable', retryable: false
120
+ });
121
+ }
122
+ const { signal, ...wire } = input;
123
+ const parsed = RestrictedExecuteOptionsSchema.safeParse(wire);
124
+ if (!parsed.success)
125
+ throw invalid();
126
+ if (signal !== undefined && !(signal instanceof AbortSignal))
127
+ throw invalid();
128
+ const options = parsed.data;
129
+ const [command, cwd, writableRoot, ...readOnlyRoots] = await Promise.all([options.command, options.cwd, options.writableRoot, ...options.readOnlyRoots].map(canonical));
130
+ const enumerationDirectories = await Promise.all((options.enumerationDirectories ?? []).map(canonical));
131
+ const unixSockets = await Promise.all((options.unixSockets ?? []).map(protectedPath));
132
+ if (new Set(unixSockets).size !== unixSockets.length)
133
+ throw invalid();
134
+ for (const socket of unixSockets) {
135
+ if (socket === writableRoot || !inside(writableRoot, socket))
136
+ throw invalid();
137
+ const [parent] = await Promise.allSettled([stat(dirname(socket))]);
138
+ if (parent.status === 'rejected' || !parent.value.isDirectory())
139
+ throw invalid();
140
+ // A socket path that does not exist yet is admitted; an existing one must be a socket.
141
+ const entry = await attemptAsync(() => stat(socket));
142
+ if ('value' in entry ? !entry.value.isSocket() : !hasErrno(entry.failure, 'ENOENT'))
143
+ throw invalid();
144
+ }
145
+ if (!host.environmentId.trim())
146
+ throw unavailable();
147
+ const base = await canonical(host.writableBase);
148
+ const userHome = await canonical(host.roots.userHome);
149
+ const accountHome = await canonical(host.accountHome);
150
+ const identity = host.hostIdentity;
151
+ if (!identity || !identity.execPath || (identity.kind !== 'monolith' && !identity.hostRoot))
152
+ throw unavailable();
153
+ const hostFiles = await Promise.all([identity.execPath, identity.hostEntry, identity.hostRoot]
154
+ .filter((path) => path !== null).map(protectedPath));
155
+ const protectedRoots = await Promise.all([
156
+ join(accountHome, DEFAULT_VIBES_HOME_DIRNAME),
157
+ host.roots.vibesHome, host.roots.profilesDir, host.roots.activeHome, host.roots.configDir,
158
+ host.roots.dataDir, host.roots.cacheDir, host.roots.logDir, host.roots.storageDir
159
+ ].map(protectedPath));
160
+ // Admission comes from composition, not the workload's HOME or an env key.
161
+ if (BROAD_ROOTS.has(base) || inside(base, userHome) || inside(base, accountHome) || inside(accountHome, base) ||
162
+ hostFiles.some((root) => inside(base, root) || inside(root, base)) ||
163
+ protectedRoots.some((root) => inside(base, root) || inside(root, base)))
164
+ throw invalid();
165
+ if (writableRoot === base || !inside(base, writableRoot))
166
+ throw invalid();
167
+ if ([writableRoot, ...readOnlyRoots, ...enumerationDirectories].some((root) => BROAD_ROOTS.has(root) || inside(root, userHome) || inside(root, accountHome) ||
168
+ protectedRoots.some((protectedRoot) => inside(root, protectedRoot) || inside(protectedRoot, root))))
169
+ throw invalid();
170
+ // Conflicting grants are refused, rather than relying on SBPL rule ordering.
171
+ if ([...readOnlyRoots, ...enumerationDirectories].some((root) => inside(root, writableRoot) || inside(writableRoot, root)))
172
+ throw invalid();
173
+ const admitFiles = async () => {
174
+ if (!(await stat(writableRoot)).isDirectory() || !(await stat(cwd)).isDirectory() || !(await stat(command)).isFile())
175
+ throw invalid();
176
+ await access(command, constants.X_OK);
177
+ for (const directory of enumerationDirectories)
178
+ if (!(await stat(directory)).isDirectory())
179
+ throw invalid();
180
+ };
181
+ const [filesAdmitted] = await Promise.allSettled([admitFiles()]);
182
+ if (filesAdmitted.status === 'rejected')
183
+ throw invalid();
184
+ if (![writableRoot, ...readOnlyRoots].some((root) => inside(root, cwd)) ||
185
+ ![writableRoot, ...readOnlyRoots].some((root) => inside(root, command)))
186
+ throw invalid();
187
+ for (const key of ['HOME', 'TMPDIR']) {
188
+ const value = options.env[key];
189
+ if (value !== undefined && !inside(writableRoot, await canonical(value)))
190
+ throw invalid();
191
+ }
192
+ return { ...options, command, cwd, writableRoot, readOnlyRoots, enumerationDirectories, unixSockets, signal };
193
+ }
194
+ async function profileFor(options, supervisorCommand) {
195
+ // OS-owned loader/framework/locale files only; no user home, caches, /etc,
196
+ // registry, keychain, global writable temp, or ambient workspace grant.
197
+ const support = ['/System/Library', '/usr/lib', '/usr/share/locale', supervisorCommand, '/dev/null', '/dev/urandom'];
198
+ const roots = [...options.readOnlyRoots, options.writableRoot, ...support];
199
+ const rules = ['(version 1)', '(deny default)', '(deny network*)',
200
+ '(allow process-exec)', '(allow process-fork)', '(allow signal (target same-sandbox))',
201
+ '(allow sysctl-read)',
202
+ // libc startup requests root-directory data; literal listing grants no
203
+ // descendant content (native toolchain startup fails without this rule).
204
+ '(allow file-read-data (literal "/"))'];
205
+ const ancestors = new Set();
206
+ for (const root of roots) {
207
+ const [probed] = await Promise.allSettled([stat(root)]);
208
+ if (probed.status === 'rejected')
209
+ throw unavailable();
210
+ const directory = probed.value.isDirectory();
211
+ rules.push(`(allow file-read* (${directory ? 'subpath' : 'literal'} ${literal(root)}))`);
212
+ for (let parent = dirname(root);; parent = dirname(parent)) {
213
+ ancestors.add(parent);
214
+ if (parent === dirname(parent))
215
+ break;
216
+ }
217
+ }
218
+ for (const directory of options.enumerationDirectories) {
219
+ rules.push(`(allow file-read-data (literal ${literal(directory)}))`);
220
+ for (let parent = directory;; parent = dirname(parent)) {
221
+ ancestors.add(parent);
222
+ if (parent === dirname(parent))
223
+ break;
224
+ }
225
+ }
226
+ for (const parent of ancestors)
227
+ rules.push(`(allow file-read-metadata (literal ${literal(parent)}))`);
228
+ rules.push(`(allow file-write* (subpath ${literal(options.writableRoot)}) (literal "/dev/null"))`);
229
+ // Path-scoped AF_UNIX permissions do not match IP endpoints. These exact
230
+ // grants are independent of read/write contents and never cover a subtree.
231
+ for (const socket of options.unixSockets) {
232
+ rules.push(`(allow network-bind network-outbound (literal ${literal(socket)}))`);
233
+ }
234
+ return rules.join('\n');
235
+ }
236
+ /** The one resource the host composes: the packaged supervisor, its bytes embedded, and its pinned hash. */
237
+ export const PINNED_SUPERVISOR = Object.freeze({ file: SUPERVISOR_FILE, sha256: SUPERVISOR_SHA256, source: SUPERVISOR_TEXT });
238
+ /** SIGKILL to a whole process group (a negative `pid` names the group); throws the native failure. */
239
+ const signalProcessGroup = (pid, signal) => { process.kill(pid, signal); };
240
+ /**
241
+ * The executor over one supervisor resource. The host composes only
242
+ * {@link PINNED_SUPERVISOR} with the real group signal; a probe supplies another
243
+ * file or hash to prove the refusals that guard it (tampered bytes, a supervisor
244
+ * inside the writable root), or a group signal that fails to prove the cleanup
245
+ * refusal.
246
+ */
247
+ export function createRestrictedDarwinExecutor(resource, options = {}) {
248
+ const supervision = {
249
+ signalGroup: options.signalGroup ?? signalProcessGroup,
250
+ spawnEnforcer: options.spawnEnforcer ?? spawn,
251
+ bounds: RestrictedExecutorBoundsSchema.parse(options.bounds ?? {})
252
+ };
253
+ return (input, host) => executeRestricted(resource, supervision, input, host);
254
+ }
255
+ export const executeRestrictedDarwin = createRestrictedDarwinExecutor(PINNED_SUPERVISOR);
256
+ /** The caller owns the writable fixture; preseeded fixtures are valid. */
257
+ async function executeRestricted(resource, supervision, input, host) {
258
+ // Parsing copies mutable inputs before the first asynchronous admission step.
259
+ const platform = host.platform;
260
+ requireExecutionPlatform(platform);
261
+ if (platform !== 'darwin')
262
+ throw unavailable();
263
+ const supervisorInvocation = captureRestrictedSupervisor(host.supervisor);
264
+ const options = await admit(input, host);
265
+ const empty = { exitCode: null, stdout: '', stderr: '', durationMs: 0, terminationReason: 'aborted' };
266
+ if (options.signal?.aborted)
267
+ return empty;
268
+ const [enforcer] = await Promise.allSettled([access(ENFORCER, constants.X_OK)]);
269
+ if (enforcer.status === 'rejected')
270
+ throw unavailable();
271
+ const [declaredCommand, ...prefix] = supervisorInvocation.argv;
272
+ const commandPath = await bunWhichCommand(declaredCommand, { platform, cwd: host.cwd, env: { ...host.env, ...supervisorInvocation.env } });
273
+ if (!commandPath)
274
+ throw unavailable();
275
+ const supervisorCommand = await canonical(commandPath);
276
+ if (inside(options.writableRoot, supervisorCommand))
277
+ throw invalid();
278
+ let supervisorSource;
279
+ if (resource.source === undefined) {
280
+ const supervisor = await canonical(resource.file);
281
+ if (inside(options.writableRoot, supervisor))
282
+ throw invalid();
283
+ supervisorSource = await readFile(supervisor);
284
+ }
285
+ else {
286
+ // Embedded bytes are delivered by `--eval`; no path is read, so nothing in the writable root can replace them.
287
+ supervisorSource = Buffer.from(resource.source, 'utf8');
288
+ }
289
+ if (createHash('sha256').update(supervisorSource).digest('hex') !== resource.sha256)
290
+ throw unavailable();
291
+ const profile = await profileFor(options, supervisorCommand);
292
+ if (options.signal?.aborted)
293
+ return empty;
294
+ return run(options, supervision, host.lifecycle, profile, { argv: [supervisorCommand, ...prefix], env: supervisorInvocation.env }, supervisorSource);
295
+ }
296
+ async function run(options, { signalGroup, spawnEnforcer, bounds }, lifecycle, profile, supervisor, supervisorSource) {
297
+ const started = lifecycle.now();
298
+ const [supervisorCommand, ...prefix] = supervisor.argv;
299
+ // Evaluating the verified fixed owner resource avoids filesystem module
300
+ // and stdin-device discovery. Caller program/env remain exclusively fd4.
301
+ const child = spawnEnforcer(ENFORCER, ['-p', profile, supervisorCommand, ...prefix, '--input-type=module', '--eval', supervisorSource.toString('utf8')], {
302
+ // The trusted supervisor has no workspace. Its child receives only the
303
+ // admitted workload cwd through fd4; startup cannot probe fixture ancestors.
304
+ cwd: '/', env: supervisor.env, detached: true, shell: false,
305
+ stdio: ['ignore', 'pipe', 'pipe', 'pipe', 'pipe']
306
+ });
307
+ const state = { reason: 'exited' };
308
+ // Only a cleanup failure is retained here; supervision faults reject the exit.
309
+ let failure;
310
+ let finish;
311
+ let ready = '';
312
+ let retained = 0;
313
+ const output = { stdout: '', stderr: '' };
314
+ const decoders = { stdout: new StringDecoder('utf8'), stderr: new StringDecoder('utf8') };
315
+ let groupSignalled = false;
316
+ const killGroup = () => {
317
+ const pid = child.pid;
318
+ if (!pid)
319
+ return;
320
+ const killed = attempt(() => signalGroup(-pid, 'SIGKILL'));
321
+ if ('value' in killed) {
322
+ groupSignalled = true;
323
+ return;
324
+ }
325
+ // ESRCH: the group is gone. EPERM after our own SIGKILL reached its members: macOS
326
+ // refuses a group whose only members are killed zombies awaiting their reap, and no
327
+ // signal can still affect those; before any delivery, EPERM is a real refusal.
328
+ if (hasErrno(killed.failure, 'ESRCH') || (groupSignalled && hasErrno(killed.failure, 'EPERM')))
329
+ return;
330
+ failure = cleanupFailed();
331
+ // A failed kill cannot make awaiting child close unbounded. The
332
+ // retained failure explicitly forbids claiming successful cleanup.
333
+ finish?.(null);
334
+ };
335
+ /**
336
+ * Drain the group: signal it again until the kernel answers it gone (ESRCH)
337
+ * or only killed zombies are left (EPERM after delivery), so a run settles
338
+ * only once no member is still alive. A group still answering after the
339
+ * bound is an unconfirmed cleanup.
340
+ */
341
+ const drainGroup = async () => {
342
+ const deadline = lifecycle.now() + bounds.groupDrainTimeoutMs;
343
+ while (failure === undefined) {
344
+ const pid = child.pid;
345
+ if (!pid)
346
+ return;
347
+ const killed = attempt(() => signalGroup(-pid, 'SIGKILL'));
348
+ if (!('value' in killed)) {
349
+ if (hasErrno(killed.failure, 'ESRCH') || (groupSignalled && hasErrno(killed.failure, 'EPERM')))
350
+ return;
351
+ failure = cleanupFailed();
352
+ return;
353
+ }
354
+ groupSignalled = true;
355
+ if (lifecycle.now() >= deadline) {
356
+ failure = cleanupFailed();
357
+ return;
358
+ }
359
+ await new Promise((resolve) => { lifecycle.timeout(resolve, bounds.groupDrainPollMs); });
360
+ }
361
+ };
362
+ const terminate = (next) => {
363
+ if (state.reason === 'exited')
364
+ state.reason = next;
365
+ killGroup();
366
+ // Do not let inherited pipes keep an aborted invocation pending forever.
367
+ child.stdout?.destroy();
368
+ child.stderr?.destroy();
369
+ child.stdio[3]?.destroy();
370
+ child.stdio[4]?.destroy();
371
+ };
372
+ const append = (name, text) => {
373
+ for (const character of text) {
374
+ const bytes = Buffer.byteLength(character);
375
+ if (retained + bytes > options.maxOutputBytes) {
376
+ terminate('output-limit');
377
+ return;
378
+ }
379
+ output[name] += character;
380
+ retained += bytes;
381
+ }
382
+ };
383
+ child.stdout?.on('data', (chunk) => append('stdout', decoders.stdout.write(chunk)));
384
+ child.stderr?.on('data', (chunk) => append('stderr', decoders.stderr.write(chunk)));
385
+ child.stdout?.on('end', () => append('stdout', decoders.stdout.end()));
386
+ child.stderr?.on('end', () => append('stderr', decoders.stderr.end()));
387
+ const statusPipe = child.stdio[3];
388
+ const payload = child.stdio[4];
389
+ // The exit promise owns every listener that can fault the supervision: a
390
+ // stream, status or spawn fault terminates the group and refuses with a
391
+ // redacted typed failure (native causes may carry argv or paths).
392
+ const exit = new Promise((resolve, reject) => {
393
+ finish = resolve;
394
+ for (const stream of [child.stdout, child.stderr, statusPipe, payload]) {
395
+ // A supervision fault carries the fault as its `cause`, reduced to its name and code: a native cause's
396
+ // message may carry argv or paths.
397
+ stream?.on('error', cause => {
398
+ terminate('aborted');
399
+ reject(new CapabilityError(UNAVAILABLE_MESSAGE, 'UNAVAILABLE', { ...UNAVAILABLE_OPTIONS, cause: valueFreeFailure(CaughtFailureSchema.parse(cause)) }));
400
+ });
401
+ }
402
+ statusPipe?.on('data', (chunk) => {
403
+ ready += chunk.toString('utf8');
404
+ if (ready.length > 128) {
405
+ terminate('aborted');
406
+ reject(unavailable());
407
+ }
408
+ });
409
+ child.once('error', cause => {
410
+ reject(new CapabilityError(UNAVAILABLE_MESSAGE, 'UNAVAILABLE', { ...UNAVAILABLE_OPTIONS, cause: valueFreeFailure(CaughtFailureSchema.parse(cause)) }));
411
+ });
412
+ // 'exit', unlike 'close', fires while a surviving grandchild still
413
+ // holds pipes. Kill that group before waiting for stream drainage.
414
+ child.once('exit', () => killGroup());
415
+ child.once('close', (code) => resolve(code));
416
+ });
417
+ // Observed from creation, so a fault before the wait below is never unhandled.
418
+ const settledExit = Promise.allSettled([exit]);
419
+ if (!(payload instanceof Writable)) {
420
+ killGroup();
421
+ throw unavailable();
422
+ }
423
+ payload.end(JSON.stringify({ command: options.command, args: options.args, cwd: options.cwd, env: options.env }));
424
+ const abort = () => terminate('aborted');
425
+ const disposeTimer = lifecycle.timeout(() => terminate('timeout'), options.timeoutMs);
426
+ options.signal?.addEventListener('abort', abort, { once: true });
427
+ if (options.signal?.aborted)
428
+ abort();
429
+ const [settled] = await settledExit;
430
+ const durationMs = Math.round(lifecycle.now() - started);
431
+ disposeTimer();
432
+ options.signal?.removeEventListener('abort', abort);
433
+ await drainGroup();
434
+ child.stdout?.destroy();
435
+ child.stderr?.destroy();
436
+ statusPipe?.destroy();
437
+ payload.destroy();
438
+ // A cleanup failure outranks both a prepared result and a supervision fault.
439
+ if (failure)
440
+ throw failure;
441
+ if (settled.status === 'rejected')
442
+ throw settled.reason;
443
+ const exitCode = settled.value;
444
+ const launchFailure = LaunchFailureSchema.safeParse(ready).data;
445
+ if (launchFailure?.phase === 'target')
446
+ throw new CapabilityError('The restricted workload could not be launched.', 'UNAVAILABLE', {
447
+ reason: 'restricted-target-launch-failed', retryable: false, details: { errno: launchFailure.errno }
448
+ });
449
+ if (ready !== READY && state.reason !== 'aborted' && state.reason !== 'timeout') {
450
+ // A missing status marker cannot prove stderr preceded target launch.
451
+ // Never reflect possibly sensitive workload output in an error; only the errno category crosses.
452
+ const startup = { phase: 'enforcer-startup', exitCode, enforcerPid: child.pid };
453
+ if (launchFailure)
454
+ startup.errno = launchFailure.errno;
455
+ throw unavailable(startup);
456
+ }
457
+ return { exitCode, ...output, durationMs, terminationReason: state.reason };
458
+ }
459
+ //# sourceMappingURL=restricted-execute.darwin.impl.bun.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"restricted-execute.darwin.impl.bun.js","sourceRoot":"","sources":["../src/restricted-execute.darwin.impl.bun.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EACN,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,wBAAwB,EAEzD,MAAM,8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EAAE,CAAC;IAC3F,6EAA6E;IAC7E,IAAI,OAAO;QAAE,MAAM,OAAO,CAAC;IAC3B,IAAI,OAAO,CAAC,MAAM,KAAK,UAAU;QAAE,MAAM,OAAO,CAAC,MAAM,CAAC;IACxD,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC;IAC/B,MAAM,aAAa,GAAG,mBAAmB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;IAChE,IAAI,aAAa,EAAE,KAAK,KAAK,QAAQ;QAAE,MAAM,IAAI,eAAe,CAAC,gDAAgD,EAAE,aAAa,EAAE;YACjI,MAAM,EAAE,iCAAiC,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,aAAa,CAAC,KAAK,EAAE;SACpG,CAAC,CAAC;IACH,IAAI,KAAK,KAAK,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QACjF,sEAAsE;QACtE,iGAAiG;QACjG,MAAM,OAAO,GAA2B,EAAE,KAAK,EAAE,kBAAkB,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC;QACxG,IAAI,aAAa;YAAE,OAAO,CAAC,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC;QACvD,MAAM,WAAW,CAAC,OAAO,CAAC,CAAC;IAC5B,CAAC;IACD,OAAO,EAAE,QAAQ,EAAE,GAAG,MAAM,EAAE,UAAU,EAAE,iBAAiB,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;AAC7E,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=daemon-execution.worker-shim.bun.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"daemon-execution.worker-shim.bun.d.ts","sourceRoot":"","sources":["../../src/runtime-plugin-host/daemon-execution.worker-shim.bun.ts"],"names":[],"mappings":""}
@@ -0,0 +1,31 @@
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
+ /** Bridges node:worker_threads to the feature entry named in workerData.entryHref, handing it this host's runtime-thread boot. */
10
+ import { parentPort, workerData } from 'node:worker_threads';
11
+ import * as z from 'zod/v4';
12
+ import { bootRuntimeThread } from "./runtime-thread.impl.bun.js";
13
+ const ShimInputSchema = z.object({
14
+ entryHref: z.string().min(1),
15
+ payload: z.unknown()
16
+ }).strict();
17
+ /** The host capabilities the feature entry runs on: it imports no host module itself. */
18
+ const host = { bootRuntimeThread };
19
+ const WorkerEntrySchema = z.object({
20
+ runDaemonExecutionWorker: z.custom((value) => value instanceof Function)
21
+ });
22
+ const input = ShimInputSchema.parse(workerData);
23
+ const owner = parentPort;
24
+ if (!owner)
25
+ throw new Error('Daemon execution worker requires parentPort');
26
+ const loaded = WorkerEntrySchema.safeParse(await import(__rewriteRelativeImportExtension(input.entryHref)));
27
+ if (!loaded.success) {
28
+ throw new Error('Daemon execution entry does not export runDaemonExecutionWorker');
29
+ }
30
+ await loaded.data.runDaemonExecutionWorker(owner, input.payload, host);
31
+ //# sourceMappingURL=daemon-execution.worker-shim.bun.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"daemon-execution.worker-shim.bun.js","sourceRoot":"","sources":["../../src/runtime-plugin-host/daemon-execution.worker-shim.bun.ts"],"names":[],"mappings":";;;;;;;;AAAA,kIAAkI;AAClI,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5B,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;CACpB,CAAC,CAAC,MAAM,EAAE,CAAC;AAEZ,yFAAyF;AACzF,MAAM,IAAI,GAAG,EAAE,iBAAiB,EAAE,CAAC;AAQnC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,wBAAwB,EAAE,CAAC,CAAC,MAAM,CAAoB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,YAAY,QAAQ,CAAC;CAC3F,CAAC,CAAC;AAEH,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;AAChD,MAAM,KAAK,GAAG,UAAU,CAAC;AACzB,IAAI,CAAC,KAAK;IAAE,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;AAC3E,MAAM,MAAM,GAAG,iBAAiB,CAAC,SAAS,CAAC,MAAM,MAAM,kCAAC,KAAK,CAAC,SAAS,EAAC,CAAC,CAAC;AAC1E,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;IACrB,MAAM,IAAI,KAAK,CAAC,iEAAiE,CAAC,CAAC;AACpF,CAAC;AACD,MAAM,MAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Bun host integration for runtime generations. Source watching is opt-in;
3
+ * installedUpdates admits compatible package publications independently.
4
+ * Targets come from the host's retained composition report. Host state and
5
+ * transports remain owned by the process while implementation views drain.
6
+ */
7
+ import { type VibesRuntime } from '@vibesdotdev/kernel';
8
+ import { type HostHotReloadResult, type StartHostHotReloadOptions } from '@vibesdotdev/kernel/kinds/runtime-plugin-host.kind';
9
+ export { hotReloadTargetsFromResolutions, type HostHotReload, type HostHotReloadFailure, type HostHotReloadResult, type StartHostHotReloadOptions } from '@vibesdotdev/kernel/kinds/runtime-plugin-host.kind';
10
+ /**
11
+ * Arm hot reload for a host. Returns a disabled result — never throws — when
12
+ * HMR was not requested, when the hardware refuses it, or when there is
13
+ * nothing linked to track.
14
+ *
15
+ * Lazy import discipline preserved from the daemon: hot reload rebuilds source
16
+ * with `Bun.build`, and a host that never enables it must not carry that
17
+ * closure. Everything Bun-only is behind the `await import` below.
18
+ */
19
+ export declare function startHostHotReload(runtime: VibesRuntime, options: StartHostHotReloadOptions): Promise<HostHotReloadResult>;
20
+ //# sourceMappingURL=host-hot-reload.consumer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host-hot-reload.consumer.d.ts","sourceRoot":"","sources":["../../src/runtime-plugin-host/host-hot-reload.consumer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAmE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAMzH,OAAO,EAGN,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,EAC9B,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EACN,+BAA+B,EAC/B,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,EAC9B,MAAM,oDAAoD,CAAC;AAa5D;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CACvC,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,yBAAyB,GAChC,OAAO,CAAC,mBAAmB,CAAC,CAoM9B"}