@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,27 @@
1
+ /**
2
+ * The Bun host's declared test environment options
3
+ * (`test-tooling/test-environment.impl.bun.ts`): the kernel's declared facts
4
+ * (`@vibesdotdev/execution-local/test-environment`) plus the Bun host services a
5
+ * booted declared host registers.
6
+ */
7
+ import type { RuntimeRef } from '@vibesdotdev/kernel';
8
+ import type { DeclaredTestEnvironmentOptions } from '@vibesdotdev/execution-local/test-environment';
9
+ import type { BunEnvironmentOptions } from './environment.ts';
10
+ export interface BunDeclaredTestEnvironmentOptions<TBindings extends object = object> extends DeclaredTestEnvironmentOptions<TBindings> {
11
+ /**
12
+ * Registers LocalDB's SQLite driver kind on the booted runtime; defaults to
13
+ * this host's `bun:sqlite` driver. A test that composes a driver itself
14
+ * hands a no-op.
15
+ */
16
+ sqliteDriver?: (runtime: RuntimeRef) => void;
17
+ /**
18
+ * Registers the host's `filesystem/adapter` kind and its adapter on the
19
+ * booted runtime; defaults to this host's own. A host with no filesystem
20
+ * passes a no-op: features that read host files through the kind refuse
21
+ * `UNAVAILABLE filesystem-adapter-not-registered`.
22
+ */
23
+ hostFileSystem?: (runtime: RuntimeRef) => void;
24
+ /** The host's file logging when booted as the environment plugin, as the Bun environment declares it; `{ files: false }` opts out. */
25
+ logging?: BunEnvironmentOptions['logging'];
26
+ }
27
+ //# sourceMappingURL=test-environment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-environment.d.ts","sourceRoot":"","sources":["../../src/schemas/test-environment.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,+CAA+C,CAAC;AACpG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAE9D,MAAM,WAAW,iCAAiC,CAAC,SAAS,SAAS,MAAM,GAAG,MAAM,CAAE,SAAQ,8BAA8B,CAAC,SAAS,CAAC;IACtI;;;;OAIG;IACH,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,IAAI,CAAC;IAC7C;;;;;OAKG;IACH,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,IAAI,CAAC;IAC/C,sIAAsI;IACtI,OAAO,CAAC,EAAE,qBAAqB,CAAC,SAAS,CAAC,CAAC;CAC3C"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=test-environment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-environment.js","sourceRoot":"","sources":["../../src/schemas/test-environment.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Arms the serve stall watch as its own process. The serve thread cannot
3
+ * notice that it is inside `sqlite3_step`; a child stat of the pid file can.
4
+ */
5
+ import { type RuntimeRef } from '@vibesdotdev/kernel';
6
+ import type { ServeStallWatch, ServeStallWatchOptions } from '@vibesdotdev/kernel/kinds/serve-stall.kind';
7
+ export declare function startServeStallWatch(runtime: RuntimeRef, options: ServeStallWatchOptions): Promise<ServeStallWatch>;
8
+ //# sourceMappingURL=serve-stall-start.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serve-stall-start.d.ts","sourceRoot":"","sources":["../src/serve-stall-start.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAA2C,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAE/F,OAAO,KAAK,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AAqC1G,wBAAsB,oBAAoB,CACzC,OAAO,EAAE,UAAU,EACnB,OAAO,EAAE,sBAAsB,GAC7B,OAAO,CAAC,eAAe,CAAC,CA2C1B"}
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Arms the serve stall watch as its own process. The serve thread cannot
3
+ * notice that it is inside `sqlite3_step`; a child stat of the pid file can.
4
+ */
5
+ import { CapabilityError, getRuntimeHostCommands } from '@vibesdotdev/kernel';
6
+ import { getRuntimeExecution } from '@vibesdotdev/kernel/execution';
7
+ import * as z from 'zod/v4';
8
+ import WATCH_SOURCE from '../resources/serve-stall-watch.impl.bun.mjs' with { type: 'text' };
9
+ import { serveStallBudgetMs } from "./serve-stall.js";
10
+ const HostCwdSchema = z.string().min(1);
11
+ const WatchOptionsSchema = z.object({
12
+ pidFile: z.string().min(1),
13
+ intervalMs: z.number().int().positive().safe(),
14
+ pid: z.number().int().positive().safe()
15
+ });
16
+ const READY = 'serve-stall-ready\n';
17
+ function startupFailed() {
18
+ return new CapabilityError('Serve stall watch did not acknowledge startup.', 'UNAVAILABLE', {
19
+ reason: 'serve-stall-start-failed', retryable: false
20
+ });
21
+ }
22
+ async function acknowledgeStartup(child) {
23
+ if (!child.stdout)
24
+ throw startupFailed();
25
+ const reader = child.stdout.getReader();
26
+ const decoder = new TextDecoder();
27
+ let text = '';
28
+ try {
29
+ while (text !== READY) {
30
+ const next = await reader.read();
31
+ if (next.done)
32
+ throw startupFailed();
33
+ text += decoder.decode(next.value, { stream: true });
34
+ if (!READY.startsWith(text))
35
+ throw startupFailed();
36
+ }
37
+ }
38
+ finally {
39
+ await reader.cancel();
40
+ reader.releaseLock();
41
+ }
42
+ }
43
+ export async function startServeStallWatch(runtime, options) {
44
+ const validated = WatchOptionsSchema.parse(options);
45
+ const cwd = HostCwdSchema.safeParse(runtime.localEnvironment.getCwd?.());
46
+ if (!cwd.success) {
47
+ throw new CapabilityError('Serve stall watch needs the host working directory.', 'UNAVAILABLE', {
48
+ reason: 'cwd-unavailable',
49
+ retryable: false
50
+ });
51
+ }
52
+ const execution = await getRuntimeExecution(runtime);
53
+ const script = (await getRuntimeHostCommands(runtime)).scriptRuntimeArgv();
54
+ const [command, ...prefix] = script.argv;
55
+ const watchOptions = {
56
+ ...validated,
57
+ budgetMs: serveStallBudgetMs(validated.intervalMs),
58
+ pollMs: Math.min(5_000, validated.intervalMs),
59
+ mode: 'kill'
60
+ };
61
+ const child = await execution.spawn({
62
+ command,
63
+ args: [
64
+ ...prefix,
65
+ '--eval', `${WATCH_SOURCE}\nawait runServeStallWatch(${JSON.stringify(watchOptions)});`
66
+ ],
67
+ cwd: cwd.data,
68
+ env: script.env,
69
+ envMode: 'replace',
70
+ stdout: 'pipe',
71
+ stderr: 'ignore',
72
+ stdin: 'ignore'
73
+ });
74
+ try {
75
+ await runtime.lifecycle.wait(() => acknowledgeStartup(child), {
76
+ timeoutMs: validated.intervalMs,
77
+ reason: 'serve-stall-start'
78
+ });
79
+ }
80
+ catch (error) {
81
+ await child.kill();
82
+ await child.exited;
83
+ throw error;
84
+ }
85
+ child.unref?.();
86
+ return { stop: async () => { await child.kill(); await child.exited; } };
87
+ }
88
+ //# sourceMappingURL=serve-stall-start.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serve-stall-start.js","sourceRoot":"","sources":["../src/serve-stall-start.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAmB,MAAM,qBAAqB,CAAC;AAC/F,OAAO,EAAE,mBAAmB,EAAsB,MAAM,+BAA+B,CAAC;AAExF,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,YAAY,MAAM,6CAA6C,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAC7F,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACxC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE;IA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UAAU;YAC/B,MAAM,EAAE,mBAAmB;SAC3B,CAAC,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,MAAM,KAAK,CAAC,IAAI,EAAE,CAAC;QACnB,MAAM,KAAK,CAAC,MAAM,CAAC;QACnB,MAAM,KAAK,CAAC;IACb,CAAC;IACD,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC;IAChB,OAAO,EAAE,IAAI,EAAE,KAAK,IAAI,EAAE,GAAG,MAAM,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;AAC1E,CAAC"}
@@ -0,0 +1,11 @@
1
+ /** Heartbeats a serve thread may miss before it is treated as stuck. */
2
+ export declare const SERVE_STALL_MISSED_HEARTBEATS = 3;
3
+ /** How old a pid-file mtime may be before the serve thread counts as stuck. */
4
+ export declare function serveStallBudgetMs(intervalMs: number): number;
5
+ /**
6
+ * Whether `ageMs` (now minus the pid file's mtime) means the serve thread
7
+ * stopped heartbeating. A non-positive interval or a non-finite age is not a
8
+ * stall: the watch must not kill on a clock or config it cannot read.
9
+ */
10
+ export declare function serveHeartbeatIsStale(ageMs: number, intervalMs: number): boolean;
11
+ //# sourceMappingURL=serve-stall.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serve-stall.d.ts","sourceRoot":"","sources":["../src/serve-stall.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,eAAO,MAAM,6BAA6B,IAAI,CAAC;AAE/C,+EAA+E;AAC/E,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAIhF"}
@@ -0,0 +1,19 @@
1
+ /** Heartbeats a serve thread may miss before it is treated as stuck. */
2
+ export const SERVE_STALL_MISSED_HEARTBEATS = 3;
3
+ /** How old a pid-file mtime may be before the serve thread counts as stuck. */
4
+ export function serveStallBudgetMs(intervalMs) {
5
+ return intervalMs * SERVE_STALL_MISSED_HEARTBEATS;
6
+ }
7
+ /**
8
+ * Whether `ageMs` (now minus the pid file's mtime) means the serve thread
9
+ * stopped heartbeating. A non-positive interval or a non-finite age is not a
10
+ * stall: the watch must not kill on a clock or config it cannot read.
11
+ */
12
+ export function serveHeartbeatIsStale(ageMs, intervalMs) {
13
+ if (!Number.isSafeInteger(intervalMs) || intervalMs <= 0)
14
+ return false;
15
+ if (!Number.isFinite(ageMs) || ageMs < 0)
16
+ return false;
17
+ return ageMs > serveStallBudgetMs(intervalMs);
18
+ }
19
+ //# sourceMappingURL=serve-stall.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serve-stall.js","sourceRoot":"","sources":["../src/serve-stall.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC;AAE/C,+EAA+E;AAC/E,MAAM,UAAU,kBAAkB,CAAC,UAAkB;IACpD,OAAO,UAAU,GAAG,6BAA6B,CAAC;AACnD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,KAAa,EAAE,UAAkB;IACtE,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,UAAU,CAAC,IAAI,UAAU,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IACvE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IACvD,OAAO,KAAK,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC;AAC/C,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Registers the Bun host's serve stall watch under `runtime/serve-stall`.
3
+ * The watch module loads only when the kind is first resolved.
4
+ */
5
+ import { type RuntimeRef } from '@vibesdotdev/kernel';
6
+ /** The Bun watch's descriptor id. */
7
+ export declare const BUN_SERVE_STALL_ID = "bun";
8
+ /** Register the kind (when absent), the Bun watch's descriptor and its lazy loader on `runtime`. */
9
+ export declare function registerBunServeStall(runtime: RuntimeRef): void;
10
+ //# sourceMappingURL=serve-stall.plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serve-stall.plugin.d.ts","sourceRoot":"","sources":["../src/serve-stall.plugin.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAA+B,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAQnF,qCAAqC;AACrC,eAAO,MAAM,kBAAkB,QAAQ,CAAC;AAExC,oGAAoG;AACpG,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI,CAsB/D"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Registers the Bun host's serve stall watch under `runtime/serve-stall`.
3
+ * The watch module loads only when the kind is first resolved.
4
+ */
5
+ import { createRuntimeImplementation } from '@vibesdotdev/kernel';
6
+ import { SERVE_STALL_KIND, serveStallKind, ServeStallDescriptorSchema } from '@vibesdotdev/kernel/kinds/serve-stall.kind';
7
+ /** The Bun watch's descriptor id. */
8
+ export const BUN_SERVE_STALL_ID = 'bun';
9
+ /** Register the kind (when absent), the Bun watch's descriptor and its lazy loader on `runtime`. */
10
+ export function registerBunServeStall(runtime) {
11
+ if (!runtime.hasKind(SERVE_STALL_KIND))
12
+ runtime.registerKind(serveStallKind);
13
+ runtime.registerDescriptor(SERVE_STALL_KIND, ServeStallDescriptorSchema.parse({
14
+ id: BUN_SERVE_STALL_ID,
15
+ kind: SERVE_STALL_KIND,
16
+ name: 'Bun serve stall watch',
17
+ description: 'Child process that SIGKILLs a serve whose pid-file heartbeat goes stale',
18
+ host: 'bun',
19
+ hardware: ['consumer']
20
+ }));
21
+ runtime.registerLoader(SERVE_STALL_KIND, BUN_SERVE_STALL_ID, async () => {
22
+ const { startServeStallWatch } = await import("./serve-stall-start.js");
23
+ const implementation = {
24
+ start: (options) => startServeStallWatch(runtime, options)
25
+ };
26
+ return createRuntimeImplementation({
27
+ kind: SERVE_STALL_KIND,
28
+ id: BUN_SERVE_STALL_ID,
29
+ constraint: { hardware: ['consumer'] },
30
+ implementation
31
+ });
32
+ });
33
+ }
34
+ //# sourceMappingURL=serve-stall.plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serve-stall.plugin.js","sourceRoot":"","sources":["../src/serve-stall.plugin.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,2BAA2B,EAAmB,MAAM,qBAAqB,CAAC;AACnF,OAAO,EACN,gBAAgB,EAChB,cAAc,EACd,0BAA0B,EAE1B,MAAM,4CAA4C,CAAC;AAEpD,qCAAqC;AACrC,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,CAAC;AAExC,oGAAoG;AACpG,MAAM,UAAU,qBAAqB,CAAC,OAAmB;IACxD,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,gBAAgB,CAAC;QAAE,OAAO,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;IAC7E,OAAO,CAAC,kBAAkB,CAAC,gBAAgB,EAAE,0BAA0B,CAAC,KAAK,CAAC;QAC7E,EAAE,EAAE,kBAAkB;QACtB,IAAI,EAAE,gBAAgB;QACtB,IAAI,EAAE,uBAAuB;QAC7B,WAAW,EAAE,yEAAyE;QACtF,IAAI,EAAE,KAAK;QACX,QAAQ,EAAE,CAAC,UAAU,CAAC;KACtB,CAAC,CAAC,CAAC;IACJ,OAAO,CAAC,cAAc,CAAC,gBAAgB,EAAE,kBAAkB,EAAE,KAAK,IAAI,EAAE;QACvE,MAAM,EAAE,oBAAoB,EAAE,GAAG,MAAM,MAAM,CAAC,wBAAwB,CAAC,CAAC;QACxE,MAAM,cAAc,GAAmB;YACtC,KAAK,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,oBAAoB,CAAC,OAAO,EAAE,OAAO,CAAC;SAC1D,CAAC;QACF,OAAO,2BAA2B,CAAC;YAClC,IAAI,EAAE,gBAAgB;YACtB,EAAE,EAAE,kBAAkB;YACtB,UAAU,EAAE,EAAE,QAAQ,EAAE,CAAC,UAAU,CAAC,EAAE;YACtC,cAAc;SACd,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * The OS account's home directory, from the account database (passwd).
3
+ *
4
+ * This is a HOST IDENTITY fact, distinct from both the selected profile home
5
+ * (`paths/roots`) and `HOME`: `os.homedir()` and `os.userInfo().homedir` both
6
+ * follow a replacement `HOME` (measured on Bun 1.4.2, in and out of a Seatbelt
7
+ * profile), while `getpwuid_r` answers the account's own entry. It is read in
8
+ * process through libc (`bun:ffi`): no child, no environment, no setuid tool.
9
+ *
10
+ * `captureAccountHome()` runs once, when the environment is constructed, and
11
+ * returns the answer or its typed failure; the environment's `accountHome()`
12
+ * returns the one or throws the other when a reader asks. Nothing requires it
13
+ * at boot: only a reader that needs the account home fails.
14
+ */
15
+ import { type Pointer } from 'bun:ffi';
16
+ import { CapabilityError } from '@vibesdotdev/kernel';
17
+ export type AccountHomeCapture = {
18
+ readonly home: string;
19
+ } | {
20
+ readonly failure: CapabilityError;
21
+ };
22
+ /** libc's `getpwuid_r`, bound from one opened library. */
23
+ export interface GetpwuidR {
24
+ getpwuid_r(uid: number, entry: Pointer, strings: Pointer, length: number, result: Pointer): number;
25
+ close(): void;
26
+ }
27
+ /** Opens the libc at `path` and binds `getpwuid_r`; throws when it cannot. */
28
+ export type OpenGetpwuidR = (path: string) => GetpwuidR;
29
+ /**
30
+ * Read the account home of `uid` from the account database, once. Never
31
+ * throws: every failure, a foreign-function fault included, is captured as the
32
+ * typed `account-home-unavailable` refusal that `accountHomeOf` throws when a
33
+ * reader asks. The platform and architecture are the host's captured facts
34
+ * (`getPlatform()`, `getArch()`), never a live read here.
35
+ */
36
+ export declare function captureAccountHome(platform: NodeJS.Platform, uid: number | undefined, arch: string, open?: OpenGetpwuidR): AccountHomeCapture;
37
+ /** The captured answer, or its typed failure thrown. */
38
+ export declare function accountHomeOf(capture: AccountHomeCapture): string;
39
+ //# sourceMappingURL=account-home.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account-home.d.ts","sourceRoot":"","sources":["../../src/services/account-home.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAuC,KAAK,OAAO,EAAE,MAAM,SAAS,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAqB,MAAM,qBAAqB,CAAC;AAGzE,MAAM,MAAM,kBAAkB,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAA;CAAE,CAAC;AA6DnG,0DAA0D;AAC1D,MAAM,WAAW,SAAS;IACzB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC;IACnG,KAAK,IAAI,IAAI,CAAC;CACd;AAED,8EAA8E;AAC9E,MAAM,MAAM,aAAa,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,SAAS,CAAC;AAyExD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CACjC,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,GAAG,EAAE,MAAM,GAAG,SAAS,EACvB,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE,aAA2B,GAC/B,kBAAkB,CAepB;AAED,wDAAwD;AACxD,wBAAgB,aAAa,CAAC,OAAO,EAAE,kBAAkB,GAAG,MAAM,CAGjE"}
@@ -0,0 +1,152 @@
1
+ /**
2
+ * The OS account's home directory, from the account database (passwd).
3
+ *
4
+ * This is a HOST IDENTITY fact, distinct from both the selected profile home
5
+ * (`paths/roots`) and `HOME`: `os.homedir()` and `os.userInfo().homedir` both
6
+ * follow a replacement `HOME` (measured on Bun 1.4.2, in and out of a Seatbelt
7
+ * profile), while `getpwuid_r` answers the account's own entry. It is read in
8
+ * process through libc (`bun:ffi`): no child, no environment, no setuid tool.
9
+ *
10
+ * `captureAccountHome()` runs once, when the environment is constructed, and
11
+ * returns the answer or its typed failure; the environment's `accountHome()`
12
+ * returns the one or throws the other when a reader asks. Nothing requires it
13
+ * at boot: only a reader that needs the account home fails.
14
+ */
15
+ import { CString, dlopen, FFIType, ptr, read } from 'bun:ffi';
16
+ import { CapabilityError, isCapabilityError } from '@vibesdotdev/kernel';
17
+ import * as z from 'zod/v4';
18
+ const ACCOUNT_HOME_UNAVAILABLE = 'account-home-unavailable';
19
+ function accountHomeMessage(detail) {
20
+ return `The OS account's home could not be read: ${detail}.`;
21
+ }
22
+ function accountHomeUnavailable(platform, detail, details = {}, cause) {
23
+ return new CapabilityError(accountHomeMessage(detail), 'UNAVAILABLE', {
24
+ reason: ACCOUNT_HOME_UNAVAILABLE,
25
+ retryable: false,
26
+ details: { platform, ...details },
27
+ cause
28
+ });
29
+ }
30
+ /**
31
+ * The class a thrown value names: an `Error`'s own name, else the primitive
32
+ * kind that was thrown (`string`), else `object`.
33
+ */
34
+ const ThrownClassSchema = z.union([
35
+ z.instanceof(Error).transform((error) => error.name),
36
+ z.string().transform(() => 'string'),
37
+ z.number().transform(() => 'number'),
38
+ z.boolean().transform(() => 'boolean'),
39
+ z.bigint().transform(() => 'bigint'),
40
+ z.symbol().transform(() => 'symbol'),
41
+ z.undefined().transform(() => 'undefined')
42
+ ]).catch('object');
43
+ /** The 64-bit ABIs whose `struct passwd` layout the offsets below describe. */
44
+ const SUPPORTED_ARCHES = new Set(['x64', 'arm64']);
45
+ /** libc and the `struct passwd` offset of `pw_dir` for this platform (64-bit ABIs only). */
46
+ function libcFor(platform) {
47
+ if (platform === 'darwin')
48
+ return { paths: ['/usr/lib/libSystem.B.dylib'], pwDirOffset: 48 };
49
+ if (platform === 'linux') {
50
+ // glibc, then musl; both lay out pw_name, pw_passwd, pw_uid, pw_gid, pw_gecos, pw_dir.
51
+ return {
52
+ paths: ['libc.so.6', 'libc.musl-x86_64.so.1', 'libc.musl-aarch64.so.1'],
53
+ pwDirOffset: 32
54
+ };
55
+ }
56
+ return null;
57
+ }
58
+ const openWithFfi = (path) => {
59
+ const lib = dlopen(path, {
60
+ getpwuid_r: { args: [FFIType.u32, FFIType.ptr, FFIType.ptr, FFIType.u64, FFIType.ptr], returns: FFIType.i32 }
61
+ });
62
+ return {
63
+ getpwuid_r: (uid, entry, strings, length, result) => lib.symbols.getpwuid_r(uid, entry, strings, length, result),
64
+ close: () => lib.close()
65
+ };
66
+ };
67
+ function attemptOpen(path, open) {
68
+ try {
69
+ return { lib: open(path) };
70
+ }
71
+ catch (failure) {
72
+ return { failure };
73
+ }
74
+ }
75
+ function openLibc(platform, paths, open) {
76
+ const tried = [];
77
+ const failures = [];
78
+ for (const path of paths) {
79
+ const attempt = attemptOpen(path, open);
80
+ if ('lib' in attempt)
81
+ return attempt.lib;
82
+ // Each candidate that cannot be opened is named in the typed failure below.
83
+ tried.push(path);
84
+ failures.push(attempt.failure);
85
+ }
86
+ throw accountHomeUnavailable(platform, 'libc could not be opened', { cause: 'libc-unavailable', tried }, new AggregateError(failures, 'libc candidates could not be opened'));
87
+ }
88
+ /** One read of the account database; throws on any failure. */
89
+ function readAccountHome(platform, uid, arch, open) {
90
+ // The pw_dir offsets assume 64-bit pointers; any other ABI is refused, never read at a wrong offset.
91
+ if (!SUPPORTED_ARCHES.has(arch)) {
92
+ throw accountHomeUnavailable(platform, `the ${arch} ABI is not supported`, { cause: 'unsupported-abi', arch });
93
+ }
94
+ const libc = libcFor(platform);
95
+ if (!libc || uid === undefined) {
96
+ throw accountHomeUnavailable(platform, 'this platform has no passwd database', { cause: 'no-passwd-database' });
97
+ }
98
+ const lib = openLibc(platform, libc.paths, open);
99
+ try {
100
+ const entry = new Uint8Array(128);
101
+ const strings = new Uint8Array(16 * 1024);
102
+ const result = new BigUint64Array(1);
103
+ const status = lib.getpwuid_r(uid, ptr(entry), ptr(strings), strings.length, ptr(result));
104
+ if (status !== 0)
105
+ throw accountHomeUnavailable(platform, 'getpwuid_r failed', { cause: 'getpwuid-failed', errno: status });
106
+ if (result[0] === 0n) {
107
+ throw accountHomeUnavailable(platform, 'the account database has no entry for this uid', { cause: 'no-entry', uid });
108
+ }
109
+ const dir = read.ptr(ptr(entry), libc.pwDirOffset);
110
+ // SAFETY: getpwuid_r succeeded for this 64-bit ABI; pw_dir is a nonnull C string pointer into the still-live strings buffer.
111
+ const home = dir ? new CString(dir).toString() : '';
112
+ if (!home.startsWith('/')) {
113
+ throw accountHomeUnavailable(platform, 'the account entry names no absolute home', { cause: 'no-absolute-home', uid });
114
+ }
115
+ return home;
116
+ }
117
+ finally {
118
+ lib.close();
119
+ }
120
+ }
121
+ /**
122
+ * Read the account home of `uid` from the account database, once. Never
123
+ * throws: every failure, a foreign-function fault included, is captured as the
124
+ * typed `account-home-unavailable` refusal that `accountHomeOf` throws when a
125
+ * reader asks. The platform and architecture are the host's captured facts
126
+ * (`getPlatform()`, `getArch()`), never a live read here.
127
+ */
128
+ export function captureAccountHome(platform, uid, arch, open = openWithFfi) {
129
+ try {
130
+ return { home: readAccountHome(platform, uid, arch, open) };
131
+ }
132
+ catch (error) {
133
+ if (error instanceof Error && isCapabilityError(error) && error.reason === ACCOUNT_HOME_UNAVAILABLE)
134
+ return { failure: error };
135
+ // The message and stack of a foreign fault stay out of the refusal; its class names it.
136
+ return {
137
+ failure: new CapabilityError(accountHomeMessage('the account database read faulted'), 'UNAVAILABLE', {
138
+ reason: ACCOUNT_HOME_UNAVAILABLE,
139
+ retryable: false,
140
+ details: { platform, cause: 'ffi-fault', errorClass: ThrownClassSchema.parse(error) },
141
+ cause: error
142
+ })
143
+ };
144
+ }
145
+ }
146
+ /** The captured answer, or its typed failure thrown. */
147
+ export function accountHomeOf(capture) {
148
+ if ('failure' in capture)
149
+ throw capture.failure;
150
+ return capture.home;
151
+ }
152
+ //# sourceMappingURL=account-home.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account-home.js","sourceRoot":"","sources":["../../src/services/account-home.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAgB,MAAM,SAAS,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAI5B,MAAM,wBAAwB,GAAG,0BAA0B,CAAC;AAW5D,SAAS,kBAAkB,CAAC,MAAc;IACzC,OAAO,4CAA4C,MAAM,GAAG,CAAC;AAC9D,CAAC;AAED,SAAS,sBAAsB,CAC9B,QAAyB,EACzB,MAAc,EACd,UAAqC,EAAE,EACvC,KAAa;IAEb,OAAO,IAAI,eAAe,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,aAAa,EAAE;QACrE,MAAM,EAAE,wBAAwB;QAChC,SAAS,EAAE,KAAK;QAChB,OAAO,EAAE,EAAE,QAAQ,EAAE,GAAG,OAAO,EAAE;QACjC,KAAK;KACL,CAAC,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC;IACjC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC;IACpD,CAAC,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC;IACpC,CAAC,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC;IACpC,CAAC,CAAC,OAAO,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC;IACtC,CAAC,CAAC,MAAM,EAAE,CAAC,SAAS,CA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AAI,OAAO;QAAE,MAAM,OAAO,CAAC,OAAO,CAAC;IAChD,OAAO,OAAO,CAAC,IAAI,CAAC;AACrB,CAAC"}
@@ -0,0 +1,50 @@
1
+ import { type createBunHostResources, type BunStandardOutput } from './standard-output.ts';
2
+ /** What a CLI host entry reads from, and does to, its process. */
3
+ export interface BunCliProcessHost {
4
+ /** The process argv, captured when the host was made. */
5
+ readonly argv: readonly string[];
6
+ /**
7
+ * Whether the thin shim launched THIS process: its version marker is set and
8
+ * this process is the executable the channel names. The shim runs the host
9
+ * in-process, so its own process is its published self-spawn (`[execPath]`
10
+ * compiled, `[bun, shim script]` from source) or, under its execve escape
11
+ * hatch, the published host entry. A child that merely inherited a parent's
12
+ * channel is a different executable and never takes the parent's root.
13
+ */
14
+ readonly launchedByShim: boolean;
15
+ /**
16
+ * The shim-baked build surface, raw: the channel's `VIBES_CLI_MODE`, read
17
+ * only when the shim launched THIS process (`launchedByShim`). A child that
18
+ * inherited a parent's channel never takes the parent's build surface;
19
+ * absent when none was baked.
20
+ */
21
+ readonly cliMode: string | undefined;
22
+ /**
23
+ * Whether a person's terminal is attached: stdin and stdout are terminals,
24
+ * or `VIBES_FORCE_TTY=1` declares one. Only then can a command attach a TUI.
25
+ */
26
+ readonly attachedTerminal: boolean;
27
+ /** Text output and the output plane's flush. */
28
+ readonly output: BunStandardOutput;
29
+ /** The exit code a command chose so far (`process.exitCode`). */
30
+ exitCode(): number | undefined;
31
+ /** End the process with `code`. */
32
+ exit(code: number): never;
33
+ /** All of stdin as UTF-8 text, or `undefined` when it held nothing. */
34
+ readStdin(): Promise<string | undefined>;
35
+ }
36
+ /**
37
+ * Whether this process is the one that published the shim channel in `env`
38
+ * (see `launchedByShim`). Reads only what every shipped shim already publishes,
39
+ * so an installed shim keeps working without a rebuild.
40
+ */
41
+ export declare function isChannelPublisher(env: Readonly<Record<string, string | undefined>>, execPath: string, argv: readonly string[]): boolean;
42
+ /**
43
+ * The shim custody this process holds over `env`: whether the shim launched it
44
+ * (its version marker is set and it is the channel publisher) and, only then,
45
+ * the build surface the shim baked. Pure over its inputs.
46
+ */
47
+ export declare function captureShimCustody(env: Readonly<Record<string, string | undefined>>, execPath: string, argv: readonly string[]): Pick<BunCliProcessHost, 'launchedByShim' | 'cliMode'>;
48
+ /** Capture this process for a CLI host entry. */
49
+ export declare function captureBunCliProcessHost(hostResources?: ReturnType<typeof createBunHostResources>): BunCliProcessHost;
50
+ //# sourceMappingURL=cli-process-host.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-process-host.d.ts","sourceRoot":"","sources":["../../src/services/cli-process-host.ts"],"names":[],"mappings":"AAcA,OAAO,EAA8C,KAAK,sBAAsB,EAAE,KAAK,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAWvI,kEAAkE;AAClE,MAAM,WAAW,iBAAiB;IACjC,yDAAyD;IACzD,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC;;;;;;;OAOG;IACH,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC;;;OAGG;IACH,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;IACnC,gDAAgD;IAChD,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC,iEAAiE;IACjE,QAAQ,IAAI,MAAM,GAAG,SAAS,CAAC;IAC/B,mCAAmC;IACnC,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;IAC1B,uEAAuE;IACvE,SAAS,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CACzC;AAoBD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAQxI;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC,iBAAiB,EAAE,gBAAgB,GAAG,SAAS,CAAC,CAGtL;AAED,iDAAiD;AACjD,wBAAgB,wBAAwB,CAAC,aAAa,CAAC,EAAE,UAAU,CAAC,OAAO,sBAAsB,CAAC,GAAG,iBAAiB,CAmBrH"}
@@ -0,0 +1,88 @@
1
+ /**
2
+ * The CLI executable's process, as the Bun host owns it
3
+ * (`@vibesdotdev/host-bun/services/cli-process-host`).
4
+ *
5
+ * A CLI host entry (`@vibesdotdev/surface-cli/bun/host`) runs before
6
+ * any runtime exists and ends the process after the last runtime is
7
+ * disposed, so the process facts it decides on — argv, the shim's custody
8
+ * markers, stdin for the hook relay, the exit — come from this host module,
9
+ * captured once, rather than from process globals in a feature package.
10
+ */
11
+ import { existsSync, realpathSync } from 'node:fs';
12
+ import * as z from 'zod/v4';
13
+ import { captureLaunchFacts } from '@vibesdotdev/execution-local';
14
+ import { attemptJson } from '@vibesdotdev/execution-local/host-base';
15
+ import { bunStandardOutput, createBunStandardOutput } from "./standard-output.js";
16
+ /** The shim's launch-custody marker: present (non-blank) when the thin `vibes` shim launched this host. */
17
+ const SHIM_VERSION_KEY = 'VIBES_SHIM_VERSION';
18
+ /** The re-entry argv the shim published for ITS process (JSON array). */
19
+ const SELF_SPAWN_ARGV_KEY = 'VIBES_SELF_SPAWN_ARGV';
20
+ /** The host entry the shim resolved and published. */
21
+ const HOST_ENTRY_KEY = 'VIBES_HOST_ENTRY';
22
+ /** The shim-baked build surface (`public`, `internal`, …), parsed by `parseBuildSurface`. */
23
+ const CLI_MODE_KEY = 'VIBES_CLI_MODE';
24
+ /** An exit code a command set: an integer, else none. */
25
+ const ExitCodeSchema = z.number().int();
26
+ /** The channel's self-spawn argv, or none when it is absent or not a JSON string array. */
27
+ const ArgvSchema = z.array(z.string().min(1)).min(1);
28
+ function channelArgv(raw) {
29
+ if (!raw)
30
+ return undefined;
31
+ const json = attemptJson(raw);
32
+ if ('failure' in json)
33
+ return undefined;
34
+ const parsed = ArgvSchema.safeParse(json.value);
35
+ return parsed.success ? parsed.data : undefined;
36
+ }
37
+ /** A path's realpath; a path that is not there keeps its spelling. */
38
+ function canonical(path) {
39
+ return existsSync(path) ? realpathSync(path) : path;
40
+ }
41
+ /**
42
+ * Whether this process is the one that published the shim channel in `env`
43
+ * (see `launchedByShim`). Reads only what every shipped shim already publishes,
44
+ * so an installed shim keeps working without a rebuild.
45
+ */
46
+ export function isChannelPublisher(env, execPath, argv) {
47
+ const self = channelArgv(env[SELF_SPAWN_ARGV_KEY]);
48
+ if (!self || canonical(self[0]) !== canonical(execPath))
49
+ return false;
50
+ const script = argv[1];
51
+ if (self.length === 1)
52
+ return true;
53
+ if (self.length !== 2 || !script)
54
+ return false;
55
+ const entry = env[HOST_ENTRY_KEY];
56
+ return canonical(script) === canonical(self[1]) || (entry !== undefined && canonical(script) === canonical(entry));
57
+ }
58
+ /**
59
+ * The shim custody this process holds over `env`: whether the shim launched it
60
+ * (its version marker is set and it is the channel publisher) and, only then,
61
+ * the build surface the shim baked. Pure over its inputs.
62
+ */
63
+ export function captureShimCustody(env, execPath, argv) {
64
+ const launchedByShim = Boolean(env[SHIM_VERSION_KEY]?.trim()) && isChannelPublisher(env, execPath, argv);
65
+ return { launchedByShim, cliMode: launchedByShim ? env[CLI_MODE_KEY] : undefined };
66
+ }
67
+ /** Capture this process for a CLI host entry. */
68
+ export function captureBunCliProcessHost(hostResources) {
69
+ const argv = Object.freeze([...process.argv]);
70
+ const { launchedByShim, cliMode } = captureShimCustody(process.env, process.execPath, argv);
71
+ return Object.freeze({
72
+ argv,
73
+ launchedByShim,
74
+ cliMode,
75
+ attachedTerminal: (process.stdin.isTTY === true && process.stdout.isTTY === true) ||
76
+ captureLaunchFacts(process.env).terminal.forceTty,
77
+ output: hostResources ? createBunStandardOutput(hostResources) : bunStandardOutput,
78
+ exitCode: () => ExitCodeSchema.safeParse(process.exitCode).data,
79
+ exit: (code) => process.exit(code),
80
+ readStdin: async () => {
81
+ const chunks = [];
82
+ for await (const chunk of process.stdin)
83
+ chunks.push(Buffer.from(chunk));
84
+ return chunks.length > 0 ? Buffer.concat(chunks).toString('utf8') : undefined;
85
+ }
86
+ });
87
+ }
88
+ //# sourceMappingURL=cli-process-host.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-process-host.js","sourceRoot":"","sources":["../../src/services/cli-process-host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAuD,MAAM,sBAAsB,CAAC;AAEvI,2GAA2G;AAC3G,MAAM,gBAAgB,GAAG,oBAAoB,CAAC;AAC9C,yEAAyE;AACzE,MAAM,mBAAmB,GAAG,uBAAuB,CAAC;AACpD,sDAAsD;AACtD,MAAM,cAAc,GAAG,kBAAkB,CAAC;AAC1C,6FAA6F;AAC7F,MAAM,YAAY,GAAG,gBAAgB,CAAC;AAqCtC,yDAAyD;AACzD,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC;AAExC,2FAA2F;AAC3F,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACrD,SAA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AC;QACjD,SAAS,EAAE,KAAK,IAAI,EAAE;YACrB,MAAM,MAAM,GAAiB,EAAE,CAAC;YAChC,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,OAAO,CAAC,KAAK;gBAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;YACzE,OAAO,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC/E,CAAC;KACD,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { createBunHostResources } from './host-resources.impl.bun.ts';
2
+ /** Before boot and after disposal callers must supply createBunHostResources(). */
3
+ export declare const compatibilityBunHost: ReturnType<typeof createBunHostResources>;
4
+ //# sourceMappingURL=compatibility-host.impl.bun.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compatibility-host.impl.bun.d.ts","sourceRoot":"","sources":["../../src/services/compatibility-host.impl.bun.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAU3E,mFAAmF;AACnF,eAAO,MAAM,oBAAoB,EAAE,UAAU,CAAC,OAAO,sBAAsB,CAUzE,CAAC"}