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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,3 @@
1
+ /** The contracts of the Bun host's process primitives (`spawn.impl.bun.ts`). */
2
+ export {};
3
+ //# sourceMappingURL=schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../src/process/schemas.ts"],"names":[],"mappings":"AAAA,gFAAgF"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * The Bun host's `ProcessHost` `spawn` member: `runtime-execution-local`'s
3
+ * child-process spawn base (`spawnChildProcess`: child environment, stdio,
4
+ * native-floor and daemon launch protocol, kill and timeout semantics) over
5
+ * this host's own primitives: `cross-spawn` over Bun's `node:child_process`
6
+ * (Windows `.cmd`/`.bat` escaping and shebangs; a pass-through elsewhere), `node:fs`
7
+ * descriptors, `node:stream` completion, `node:path`, `process.kill`, and this
8
+ * host's command discovery, artifact reader and signal table.
9
+ *
10
+ * Bun raises some launch failures synchronously (EBADF when a pipe cannot be
11
+ * created); the base captures them as the launch's typed refusal, and the
12
+ * buffered-capture backend recovers the EBADF case.
13
+ */
14
+ import type { RuntimeLifecycle } from '@vibesdotdev/kernel';
15
+ import type { ProcessHandle, SpawnOptions } from '@vibesdotdev/kernel/execution';
16
+ import { type NativeLaunchOptions } from '@vibesdotdev/execution-local';
17
+ import type { BunNativeSpawn } from './schemas.ts';
18
+ export type { BunNativeChild, BunNativeSpawn } from './schemas.ts';
19
+ /**
20
+ * Spawn a child process on this host and return the streaming `ProcessHandle`.
21
+ * `inherited` is the owning runtime's captured environment snapshot, the base
22
+ * of an `inherit`-mode child environment.
23
+ */
24
+ export declare function bunSpawnProcess(options: SpawnOptions & {
25
+ cwd: string;
26
+ }, inherited: Readonly<Record<string, string>>, hostPlatform: string, hostCwd: string,
27
+ /** The owning runtime's lifecycle: the spawn `timeout` deadline is its timer (RC07). */
28
+ lifecycle: Pick<RuntimeLifecycle, 'timeout' | 'wait'>, nativeLaunch?: NativeLaunchOptions, hostArch?: string,
29
+ /** A test seam for the native launch function; the port's `spawn` member never carries it. */
30
+ nativeSpawn?: BunNativeSpawn): Promise<ProcessHandle>;
31
+ //# sourceMappingURL=spawn.impl.bun.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spawn.impl.bun.d.ts","sourceRoot":"","sources":["../../src/process/spawn.impl.bun.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAQH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,EAA0C,KAAK,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAIhH,OAAO,KAAK,EAAkB,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAiCnE;;;;GAIG;AACH,wBAAgB,eAAe,CAC9B,OAAO,EAAE,YAAY,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,EACvC,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAC3C,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,MAAM;AACf,wFAAwF;AACxF,SAAS,EAAE,IAAI,CAAC,gBAAgB,EAAE,SAAS,GAAG,MAAM,CAAC,EACrD,YAAY,CAAC,EAAE,mBAAmB,EAClC,QAAQ,CAAC,EAAE,MAAM;AACjB,8FAA8F;AAC9F,WAAW,CAAC,EAAE,cAAc,GAC1B,OAAO,CAAC,aAAa,CAAC,CAGxB"}
@@ -0,0 +1,66 @@
1
+ /**
2
+ * The Bun host's `ProcessHost` `spawn` member: `runtime-execution-local`'s
3
+ * child-process spawn base (`spawnChildProcess`: child environment, stdio,
4
+ * native-floor and daemon launch protocol, kill and timeout semantics) over
5
+ * this host's own primitives: `cross-spawn` over Bun's `node:child_process`
6
+ * (Windows `.cmd`/`.bat` escaping and shebangs; a pass-through elsewhere), `node:fs`
7
+ * descriptors, `node:stream` completion, `node:path`, `process.kill`, and this
8
+ * host's command discovery, artifact reader and signal table.
9
+ *
10
+ * Bun raises some launch failures synchronously (EBADF when a pipe cannot be
11
+ * created); the base captures them as the launch's typed refusal, and the
12
+ * buffered-capture backend recovers the EBADF case.
13
+ */
14
+ import { spawnSync } from 'node:child_process';
15
+ import { closeSync, openSync } from 'node:fs';
16
+ import { resolve } from 'node:path';
17
+ import { Duplex } from 'node:stream';
18
+ import { finished } from 'node:stream/promises';
19
+ import crossSpawn from 'cross-spawn';
20
+ import { spawnChildProcess } from '@vibesdotdev/execution-local';
21
+ import { readLaunchArtifacts } from "./launch-artifacts.impl.bun.js";
22
+ import { signalNumber } from "../host-signal.impl.bun.js";
23
+ import { bunWhichCommand } from "./which.impl.bun.js";
24
+ /** This host's native launch. */
25
+ const bunLaunch = (command, args, options) => crossSpawn(command, [...args], options);
26
+ /** This host's spawn primitives over `launch`. */
27
+ function bunSpawnHost(launch) {
28
+ return {
29
+ launch,
30
+ runSync: (command, args, options) => spawnSync(command, [...args], options),
31
+ openAppend: path => openSync(path, 'a'),
32
+ closeFile: fd => closeSync(fd),
33
+ controlChannel: child => {
34
+ const control = child.stdio[3];
35
+ return control instanceof Duplex ? control : undefined;
36
+ },
37
+ inputFinished: child => {
38
+ const sink = child.stdin;
39
+ if (sink === null)
40
+ return Promise.resolve();
41
+ // `cleanup` removes the completion listeners on either settlement.
42
+ return finished(sink, { readable: false, cleanup: true });
43
+ },
44
+ resolvePath: (...parts) => resolve(...parts),
45
+ which: bunWhichCommand,
46
+ readLaunchArtifacts,
47
+ signalNumber,
48
+ kill: (pid, signal) => { process.kill(pid, signal); }
49
+ };
50
+ }
51
+ /** The production primitives; a test that replaces the launch builds its own. */
52
+ const bunSpawnPrimitives = bunSpawnHost(bunLaunch);
53
+ /**
54
+ * Spawn a child process on this host and return the streaming `ProcessHandle`.
55
+ * `inherited` is the owning runtime's captured environment snapshot, the base
56
+ * of an `inherit`-mode child environment.
57
+ */
58
+ export function bunSpawnProcess(options, inherited, hostPlatform, hostCwd,
59
+ /** The owning runtime's lifecycle: the spawn `timeout` deadline is its timer (RC07). */
60
+ lifecycle, nativeLaunch, hostArch,
61
+ /** A test seam for the native launch function; the port's `spawn` member never carries it. */
62
+ nativeSpawn) {
63
+ const host = nativeSpawn === undefined ? bunSpawnPrimitives : bunSpawnHost(nativeSpawn);
64
+ return spawnChildProcess(host, options, inherited, hostPlatform, hostCwd, lifecycle, nativeLaunch, hostArch);
65
+ }
66
+ //# sourceMappingURL=spawn.impl.bun.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spawn.impl.bun.js","sourceRoot":"","sources":["../../src/process/spawn.impl.bun.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,UAAU,MAAM,aAAa,CAAC;AAGrC,OAAO,EAAE,iBAAiB,EAAiD,MAAM,8BAA8B,CAAC;AAChH,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAKtD,iCAAiC;AACjC,MAAM,SAAS,GAAmB,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC;AAEtG,kDA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9B,OAAuC,EACvC,SAA2C,EAC3C,YAAoB,EACpB,OAAe;AACf,wFAAwF;AACxF,SAAqD,EACrD,YAAkC,EAClC,QAAiB;AACjB,8FAA8F;AAC9F,WAA4B;IAE5B,MAAM,IAAI,GAAG,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;IACxF,OAAO,iBAAiB,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAC;AAC9G,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Command discovery for the Bun host's `ProcessHost` (`which` member): the
3
+ * PATH search policy of `runtime-execution-local`'s base (`discoverCommand`)
4
+ * over this host's own path mechanics (`node:path`) and filesystem probes
5
+ * (`node:fs/promises`), both of which Bun implements. It reads `PATH`,
6
+ * `PATHEXT`, `SCOOP` and `USERPROFILE` only from the env the caller passes.
7
+ */
8
+ import { type WhichCommand } from '@vibesdotdev/execution-local';
9
+ /**
10
+ * Resolve a command to its absolute path on `PATH`, or null when it is not
11
+ * resolvable: a regular file with the executable bit (on unix); a command with
12
+ * a path separator is checked directly; relative commands and search
13
+ * directories are anchored at the caller's absolute cwd.
14
+ */
15
+ export declare const bunWhichCommand: WhichCommand;
16
+ //# sourceMappingURL=which.impl.bun.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"which.impl.bun.d.ts","sourceRoot":"","sources":["../../src/process/which.impl.bun.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAqD,KAAK,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAUpH;;;;;GAKG;AACH,eAAO,MAAM,eAAe,EAAE,YAA8D,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Command discovery for the Bun host's `ProcessHost` (`which` member): the
3
+ * PATH search policy of `runtime-execution-local`'s base (`discoverCommand`)
4
+ * over this host's own path mechanics (`node:path`) and filesystem probes
5
+ * (`node:fs/promises`), both of which Bun implements. It reads `PATH`,
6
+ * `PATHEXT`, `SCOOP` and `USERPROFILE` only from the env the caller passes.
7
+ */
8
+ import { access, constants, stat } from 'node:fs/promises';
9
+ import { posix, win32 } from 'node:path';
10
+ import { createCommandDiscovery } from '@vibesdotdev/execution-local';
11
+ /** This host's command-discovery primitives. */
12
+ const bunCommandDiscoveryHost = Object.freeze({
13
+ posix,
14
+ win32,
15
+ stat: (path) => stat(path),
16
+ accessExecutable: (path) => access(path, constants.X_OK)
17
+ });
18
+ /**
19
+ * Resolve a command to its absolute path on `PATH`, or null when it is not
20
+ * resolvable: a regular file with the executable bit (on unix); a command with
21
+ * a path separator is checked directly; relative commands and search
22
+ * directories are anchored at the caller's absolute cwd.
23
+ */
24
+ export const bunWhichCommand = createCommandDiscovery(bunCommandDiscoveryHost);
25
+ //# sourceMappingURL=which.impl.bun.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"which.impl.bun.js","sourceRoot":"","sources":["../../src/process/which.impl.bun.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAAgD,MAAM,8BAA8B,CAAC;AAEpH,gDAAgD;AAChD,MAAM,uBAAuB,GAAyB,MAAM,CAAC,MAAM,CAAC;IACnE,KAAK;IACL,KAAK;IACL,IAAI,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC;IAClC,gBAAgB,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC;CAChE,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAiB,sBAAsB,CAAC,uBAAuB,CAAC,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * PTY adapter backed by Bun.Terminal.
3
+ *
4
+ * Genuine Bun-host code (there is no universal PTY primitive), so it lives in
5
+ * the Bun host package and is the `openPtySession` member of the `ProcessHost`
6
+ * this host hands `LocalExecution` (D7 Stage 2), loaded lazily by `session()`.
7
+ * The host owns the native terminal and process primitives; consumers receive
8
+ * only the runtime/execution session contract.
9
+ */
10
+ import type { RuntimeLifecycle } from '@vibesdotdev/kernel';
11
+ import type { ExecutionSession, SessionOptions } from '@vibesdotdev/kernel/execution';
12
+ export declare function openPtySession(options: SessionOptions & {
13
+ cwd: string;
14
+ }, environmentId: string, inherited: Readonly<Record<string, string>>, hostCwd: string, hostPlatform: string,
15
+ /** The owning runtime's lifecycle, for the darwin supervisor's deadlines (RC07). */
16
+ lifecycle: Pick<RuntimeLifecycle, 'timeout' | 'wait'>): Promise<ExecutionSession>;
17
+ //# sourceMappingURL=pty.adapter.impl.bun.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pty.adapter.impl.bun.d.ts","sourceRoot":"","sources":["../src/pty.adapter.impl.bun.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAQtF,wBAAsB,cAAc,CACnC,OAAO,EAAE,cAAc,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,EACzC,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAC3C,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM;AACpB,oFAAoF;AACpF,SAAS,EAAE,IAAI,CAAC,gBAAgB,EAAE,SAAS,GAAG,MAAM,CAAC,GACnD,OAAO,CAAC,gBAAgB,CAAC,CA6E3B"}
@@ -0,0 +1,102 @@
1
+ /**
2
+ * PTY adapter backed by Bun.Terminal.
3
+ *
4
+ * Genuine Bun-host code (there is no universal PTY primitive), so it lives in
5
+ * the Bun host package and is the `openPtySession` member of the `ProcessHost`
6
+ * this host hands `LocalExecution` (D7 Stage 2), loaded lazily by `session()`.
7
+ * The host owns the native terminal and process primitives; consumers receive
8
+ * only the runtime/execution session contract.
9
+ */
10
+ import { attempt, composeChildEnvironment, executionError, hasErrno, requireChildEnvironmentMode, requireExecutionPlatform } from '@vibesdotdev/execution-local';
11
+ import { bunWhichCommand } from "./process/which.impl.bun.js";
12
+ import { requireSignalNumber } from "./host-signal.impl.bun.js";
13
+ export async function openPtySession(options, environmentId, inherited, hostCwd, hostPlatform,
14
+ /** The owning runtime's lifecycle, for the darwin supervisor's deadlines (RC07). */
15
+ lifecycle) {
16
+ requireChildEnvironmentMode(options);
17
+ requireExecutionPlatform(hostPlatform);
18
+ // Bun's Darwin PTY has no controlling process group and macOS ships no
19
+ // setsid(1): Ctrl+C cannot interrupt foreground jobs. Use forkpty there.
20
+ if (hostPlatform === 'darwin') {
21
+ const { openDarwinPtySession } = await import("./pty.darwin.impl.bun.js");
22
+ return openDarwinPtySession(options, environmentId, inherited, hostCwd, lifecycle);
23
+ }
24
+ if (hostPlatform !== 'linux')
25
+ throw executionError('pty-host-unavailable');
26
+ // setsid is a host tool. Refuse before allocating a terminal when absent.
27
+ const setsid = await bunWhichCommand('setsid', { platform: hostPlatform, cwd: hostCwd, env: inherited });
28
+ if (!setsid)
29
+ throw executionError('pty-host-unavailable');
30
+ const env = composeChildEnvironment(options, inherited, hostPlatform, { TERM: 'xterm-256color' });
31
+ const id = crypto.randomUUID();
32
+ const outputHandlers = new Set();
33
+ const terminal = new Bun.Terminal({
34
+ cols: options.cols,
35
+ rows: options.rows,
36
+ data: (_terminal, data) => {
37
+ for (const handler of outputHandlers) {
38
+ handler(data);
39
+ }
40
+ }
41
+ });
42
+ const argv = [options.command, ...(options.args ?? [])];
43
+ const spawned = attempt(() => Bun.spawn([setsid, '-c', ...argv], {
44
+ cwd: options.cwd,
45
+ env,
46
+ terminal
47
+ }));
48
+ if ('failure' in spawned) {
49
+ terminal.close();
50
+ throw executionError('execution-launch-failed', spawned.failure);
51
+ }
52
+ const proc = spawned.value;
53
+ const closeTerminal = () => {
54
+ const closed = attempt(() => { if (!terminal.closed)
55
+ terminal.close(); });
56
+ if ('failure' in closed)
57
+ throw executionError('execution-cleanup-failed', closed.failure);
58
+ };
59
+ const signalProcess = (signal) => {
60
+ const number = requireSignalNumber(signal);
61
+ const sent = attempt(() => proc.kill(number));
62
+ if ('failure' in sent && !hasErrno(sent.failure, 'ESRCH'))
63
+ throw executionError('execution-supervision-failed', sent.failure);
64
+ };
65
+ const exitedPromise = proc.exited
66
+ .then((code) => ({ exitCode: code }))
67
+ .finally(closeTerminal);
68
+ return {
69
+ id,
70
+ environmentId,
71
+ write(data) {
72
+ if (terminal.closed)
73
+ throw executionError('pty-closed');
74
+ const written = attempt(() => terminal.write(data));
75
+ if ('failure' in written)
76
+ throw executionError('execution-supervision-failed', written.failure);
77
+ },
78
+ onOutput(handler) {
79
+ outputHandlers.add(handler);
80
+ return () => {
81
+ outputHandlers.delete(handler);
82
+ };
83
+ },
84
+ resize(cols, rows) {
85
+ if (terminal.closed)
86
+ throw executionError('pty-closed');
87
+ const resized = attempt(() => terminal.resize(cols, rows));
88
+ if ('failure' in resized)
89
+ throw executionError('execution-supervision-failed', resized.failure);
90
+ },
91
+ signal(sig) { signalProcess(sig); },
92
+ exited() {
93
+ return exitedPromise;
94
+ },
95
+ kill() {
96
+ if (proc.exitCode === null)
97
+ signalProcess('SIGTERM');
98
+ closeTerminal();
99
+ }
100
+ };
101
+ }
102
+ //# sourceMappingURL=pty.adapter.impl.bun.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pty.adapter.impl.bun.js","sourceRoot":"","sources":["../src/pty.adapter.impl.bun.ts"],"names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C,CAAC,CAAC;YAC3D,IAAI,SAAS,IAAI,OAAO;gBAAE,MAAM,cAAc,CAAC,8BAA8B,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QACjG,CAAC;QACD,MAAM,CAAC,GAAW,IAAU,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACjD,MAAM;YACL,OAAO,aAAa,CAAC;QACtB,CAAC;QACD,IAAI;YACH,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI;gBAAE,aAAa,CAAC,SAAS,CAAC,CAAC;YACrD,aAAa,EAAE,CAAC;QACjB,CAAC;KACD,CAAC;AACH,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { type RuntimeLifecycle } from '@vibesdotdev/kernel';
2
+ import type { ExecutionSession, SessionOptions } from '@vibesdotdev/kernel/execution';
3
+ /** How long a hangup may take to end the shell before `kill()` escalates to SIGKILL. */
4
+ export declare const KILL_GRACE_MS = 1000;
5
+ /** Native forkpty supplies controlling-terminal signals and window sizing. */
6
+ export declare function openDarwinPtySession(options: SessionOptions & {
7
+ cwd: string;
8
+ }, environmentId: string, inherited: Readonly<Record<string, string>>, hostCwd: string,
9
+ /** The owning runtime's lifecycle: the startup deadline and stop grace are its timers (RC07). */
10
+ lifecycle: Pick<RuntimeLifecycle, 'timeout' | 'wait'>): Promise<ExecutionSession>;
11
+ //# sourceMappingURL=pty.darwin.impl.bun.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pty.darwin.impl.bun.d.ts","sourceRoot":"","sources":["../src/pty.darwin.impl.bun.ts"],"names":[],"mappings":"AAGA,OAAO,EAAqB,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AActF,wFAAwF;AACxF,eAAO,MAAM,aAAa,OAAO,CAAC;AAsBlC,8EAA8E;AAC9E,wBAAsB,oBAAoB,CACzC,OAAO,EAAE,cAAc,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,EACzC,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAC3C,OAAO,EAAE,MAAM;AACf,iGAAiG;AACjG,SAAS,EAAE,IAAI,CAAC,gBAAgB,EAAE,SAAS,GAAG,MAAM,CAAC,GACnD,OAAO,CAAC,gBAAgB,CAAC,CA0I3B"}
@@ -0,0 +1,200 @@
1
+ import { realpath } from 'node:fs/promises';
2
+ import { dirname } from 'node:path';
3
+ import { pathToFileURL } from 'node:url';
4
+ import { isCapabilityError } from '@vibesdotdev/kernel';
5
+ import { attempt, attemptAsync, composeChildEnvironment, executionError, hasErrno } from '@vibesdotdev/execution-local';
6
+ import { bunWhichCommand } from "./process/which.impl.bun.js";
7
+ import { ptyNodeHostSource } from "./pty.node-host.impl.bun.js";
8
+ import { requireSignalName } from "./host-signal.impl.bun.js";
9
+ /** How long a hangup may take to end the shell before `kill()` escalates to SIGKILL. */
10
+ export const KILL_GRACE_MS = 1000;
11
+ /**
12
+ * The first `node` on PATH that is not this Bun executable. `bun --bun` (and `bun run` without a
13
+ * Node install) prepends a directory whose `node` links to Bun itself; Bun is not the Node host
14
+ * the supervisor source needs, so that directory is passed over and the search continues.
15
+ */
16
+ async function findNodeSupervisor(inherited, hostCwd) {
17
+ const bun = await realpath(process.execPath);
18
+ const searched = (inherited.PATH ?? '').split(':');
19
+ for (;;) {
20
+ const found = await bunWhichCommand('node', { platform: 'darwin', cwd: hostCwd, env: { ...inherited, PATH: searched.join(':') } });
21
+ if (!found)
22
+ return null;
23
+ const resolved = await attemptAsync(() => realpath(found));
24
+ if (!('value' in resolved) || resolved.value !== bun)
25
+ return found;
26
+ const skipped = dirname(found);
27
+ const remaining = searched.filter(entry => entry !== skipped);
28
+ if (remaining.length === searched.length)
29
+ return null;
30
+ searched.splice(0, searched.length, ...remaining);
31
+ }
32
+ }
33
+ /** Native forkpty supplies controlling-terminal signals and window sizing. */
34
+ export async function openDarwinPtySession(options, environmentId, inherited, hostCwd,
35
+ /** The owning runtime's lifecycle: the startup deadline and stop grace are its timers (RC07). */
36
+ lifecycle) {
37
+ const env = composeChildEnvironment(options, inherited, 'darwin', { TERM: 'xterm-256color' });
38
+ // Node is this adapter's supervisor tool, not a workload env dependency.
39
+ const node = await findNodeSupervisor(inherited, hostCwd);
40
+ if (!node)
41
+ throw executionError('pty-host-unavailable');
42
+ // Bun's own resolver: a Vite SSR module runner hosted on Bun cannot answer `import.meta.resolve`
43
+ // (its resolve hook needs `module.register`, which Bun does not implement).
44
+ const moduleUrl = pathToFileURL(Bun.resolveSync('@lydell/node-pty', import.meta.dirname)).href;
45
+ const spawned = attempt(() => Bun.spawn([node, '--input-type=module', '-e', ptyNodeHostSource, moduleUrl], {
46
+ cwd: options.cwd,
47
+ stdin: 'pipe', stdout: 'pipe', stderr: 'ignore',
48
+ env
49
+ }));
50
+ if ('failure' in spawned)
51
+ throw executionError('execution-launch-failed', spawned.failure);
52
+ const proc = spawned.value;
53
+ let closed = false;
54
+ let killing = false;
55
+ let failure;
56
+ const stopSupervisor = () => {
57
+ const stopped = attempt(() => proc.kill());
58
+ if ('failure' in stopped && !hasErrno(stopped.failure, 'ESRCH'))
59
+ failure = executionError('execution-cleanup-failed', stopped.failure);
60
+ };
61
+ let exitCode = null;
62
+ let resolveReady;
63
+ let rejectReady;
64
+ const ready = new Promise((resolve, reject) => { resolveReady = resolve; rejectReady = reject; });
65
+ // Observe rejection even if writing the initialization message fails first.
66
+ const readiness = ready.then(() => undefined, (error) => error);
67
+ const handlers = new Set();
68
+ let pendingOutput = new Uint8Array();
69
+ const send = (request) => {
70
+ if (closed)
71
+ throw executionError('pty-closed');
72
+ const written = attempt(() => {
73
+ proc.stdin.write(JSON.stringify(request) + '\n');
74
+ return proc.stdin.flush();
75
+ });
76
+ if ('failure' in written) {
77
+ failure = executionError('execution-supervision-failed', written.failure);
78
+ stopSupervisor();
79
+ throw failure;
80
+ }
81
+ void attemptAsync(() => written.value).then(flushed => {
82
+ if ('value' in flushed)
83
+ return;
84
+ failure = executionError('execution-supervision-failed', flushed.failure);
85
+ rejectReady(failure);
86
+ stopSupervisor();
87
+ });
88
+ };
89
+ const pumpOutput = async () => {
90
+ let buffer = '';
91
+ const decoder = new TextDecoder();
92
+ for await (const bytes of proc.stdout) {
93
+ buffer += decoder.decode(bytes, { stream: true });
94
+ let end;
95
+ while ((end = buffer.indexOf('\n')) >= 0) {
96
+ const event = JSON.parse(buffer.slice(0, end));
97
+ buffer = buffer.slice(end + 1);
98
+ if (event.type === 'ready')
99
+ resolveReady();
100
+ else if (event.type === 'exit')
101
+ exitCode = event.exitCode;
102
+ else if (event.type === 'error')
103
+ throw executionError('execution-supervision-failed');
104
+ else if (event.type === 'data') {
105
+ const data = Buffer.from(event.data, 'base64');
106
+ if (handlers.size)
107
+ for (const handler of handlers)
108
+ handler(data);
109
+ else
110
+ pendingOutput = Buffer.concat([pendingOutput, data]).subarray(-65536);
111
+ }
112
+ }
113
+ }
114
+ };
115
+ const readOutput = attemptAsync(pumpOutput).then(pumped => {
116
+ if ('value' in pumped)
117
+ return;
118
+ failure = executionError('execution-supervision-failed', pumped.failure);
119
+ rejectReady(failure);
120
+ stopSupervisor();
121
+ });
122
+ // Internal completion always settles as data; the public exited() exposes
123
+ // retained failures, including when startup never returned a session handle.
124
+ const exited = attemptAsync(() => proc.exited).then(async (exit) => {
125
+ if ('failure' in exit) {
126
+ failure = executionError('execution-supervision-failed', exit.failure);
127
+ rejectReady(failure);
128
+ closed = true;
129
+ return { exitCode: null };
130
+ }
131
+ await readOutput;
132
+ closed = true;
133
+ rejectReady(executionError('execution-launch-failed'));
134
+ return { exitCode };
135
+ });
136
+ const disarmStartup = lifecycle.timeout(() => { rejectReady(executionError('pty-startup-timeout')); stopSupervisor(); }, 5000);
137
+ const started = await attemptAsync(async () => {
138
+ send({ command: options.command, args: options.args, cwd: options.cwd, cols: options.cols, rows: options.rows });
139
+ const readyFailure = await readiness;
140
+ if (readyFailure)
141
+ throw readyFailure;
142
+ });
143
+ disarmStartup();
144
+ if ('failure' in started) {
145
+ stopSupervisor();
146
+ // The supervisor's own exit is the owner event; the lifecycle wait bounds it.
147
+ const stop = await attemptAsync(() => lifecycle.wait(() => exited.then(() => true), { timeoutMs: 1000, reason: 'pty-supervisor-stop' }));
148
+ if ('failure' in stop && !(stop.failure.thrown instanceof Error && isCapabilityError(stop.failure.thrown) && stop.failure.thrown.reason === 'wait-timeout'))
149
+ throw stop.failure.thrown;
150
+ if ('failure' in stop) {
151
+ // Force-stopping the supervisor does not prove its PTY tree ended.
152
+ failure = executionError('execution-cleanup-failed');
153
+ const killed = attempt(() => proc.kill('SIGKILL'));
154
+ if ('failure' in killed && !hasErrno(killed.failure, 'ESRCH'))
155
+ failure = executionError('execution-cleanup-failed', killed.failure);
156
+ }
157
+ // A supervisor silent past its deadline is the one startup failure that keeps its own reason.
158
+ const startup = started.failure.thrown;
159
+ if (startup instanceof Error && isCapabilityError(startup) && startup.reason === 'pty-startup-timeout')
160
+ throw failure ?? startup;
161
+ throw failure ?? executionError('execution-launch-failed', started.failure);
162
+ }
163
+ return {
164
+ id: crypto.randomUUID(), environmentId,
165
+ write(data) { send({ type: 'write', data: Buffer.from(data).toString('base64') }); },
166
+ onOutput(handler) {
167
+ handlers.add(handler);
168
+ if (pendingOutput.length) {
169
+ handler(pendingOutput);
170
+ pendingOutput = new Uint8Array();
171
+ }
172
+ return () => { handlers.delete(handler); };
173
+ },
174
+ resize(cols, rows) { send({ type: 'resize', cols, rows }); },
175
+ signal(signal) { send({ type: 'signal', signal: requireSignalName(signal) }); },
176
+ exited() { return exited.then(result => { if (failure)
177
+ throw failure; return result; }); },
178
+ kill() {
179
+ if (closed || killing)
180
+ return;
181
+ killing = true;
182
+ send({ type: 'kill' });
183
+ // The shell is asked to hang up, and an interactive shell can miss that signal (an idle
184
+ // `sh` that had just printed its prompt survived both the explicit hangup and the closed
185
+ // terminal in about 2 runs in 100, while a later hangup ended it at once). It is then
186
+ // killed outright after a grace, so a kill always ends the session. The grace is the
187
+ // runtime lifecycle's timer and is disarmed by the supervisor's own exit.
188
+ const escalate = () => {
189
+ if (closed)
190
+ return;
191
+ const escalated = attempt(() => { send({ type: 'signal', signal: 'SIGKILL' }); proc.stdin.end(); });
192
+ if ('failure' in escalated && !closed)
193
+ failure = executionError('execution-cleanup-failed', escalated.failure);
194
+ };
195
+ const disarm = lifecycle.timeout(escalate, KILL_GRACE_MS);
196
+ void exited.then(disarm);
197
+ }
198
+ };
199
+ }
200
+ //# sourceMappingURL=pty.darwin.impl.bun.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pty.darwin.impl.bun.js","sourceRoot":"","sources":["../src/pty.darwin.impl.bun.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAyB,MAAM,qBAAqB,CAAC;AAE/E,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxH,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAU9D,wFAAwF;AACxF,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC;AAElC;;;;GAIG;AACH,KAAK,UAAU,kBAAkB,CAAC,SAA2C,EAAE,OAAe;IAC7F,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC7C,MAAM,QAAQ,GAAG,CAAC,SAAS,CAAC,IAAI,IAAI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AC,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1F,IAAI;YACH,IAAI,MAAM,IAAI,OAAO;gBAAE,OAAO;YAC9B,OAAO,GAAG,IAAI,CAAC;YACf,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;YACvB,wFAAwF;YACxF,yFAAyF;YACzF,sFAAsF;YACtF,qFAAqF;YACrF,0EAA0E;YAC1E,MAAM,QAAQ,GAAG,GAAG,EAAE;gBACrB,IAAI,MAAM;oBAAE,OAAO;gBACnB,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;gBACpG,IAAI,SAAS,IAAI,SAAS,IAAI,CAAC,MAAM;oBAAE,OAAO,GAAG,cAAc,CAAC,0BAA0B,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;YAChH,CAAC,CAAC;YACF,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;YAC1D,KAAK,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1B,CAAC;KACD,CAAC;AACH,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Native-addon host. Configuration and terminal bytes travel only over pipes.
3
+ * This source runs as a Node child of the Darwin PTY adapter (`pty.darwin.impl.bun.ts`)
4
+ * because Bun's Darwin PTY gives the foreground job no controlling terminal. It is
5
+ * Node-side code that belongs to this Bun host: the Node host (`runtime-environment-node`,
6
+ * C089) carries no PTY and refuses `execution-pty-unavailable`, so this script stays with
7
+ * its only consumer, the Bun host's PTY member of the `ProcessHost`.
8
+ */
9
+ export declare const ptyNodeHostSource: string;
10
+ //# sourceMappingURL=pty.node-host.impl.bun.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pty.node-host.impl.bun.d.ts","sourceRoot":"","sources":["../src/pty.node-host.impl.bun.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,QAgC7B,CAAC"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Native-addon host. Configuration and terminal bytes travel only over pipes.
3
+ * This source runs as a Node child of the Darwin PTY adapter (`pty.darwin.impl.bun.ts`)
4
+ * because Bun's Darwin PTY gives the foreground job no controlling terminal. It is
5
+ * Node-side code that belongs to this Bun host: the Node host (`runtime-environment-node`,
6
+ * C089) carries no PTY and refuses `execution-pty-unavailable`, so this script stays with
7
+ * its only consumer, the Bun host's PTY member of the `ProcessHost`.
8
+ */
9
+ export const ptyNodeHostSource = String.raw `
10
+ import { createInterface } from 'node:readline';
11
+ const { spawn } = await import(process.argv[1]);
12
+ const lines = createInterface({ input: process.stdin });
13
+ const send = value => process.stdout.write(JSON.stringify(value) + '\n');
14
+ let terminal;
15
+ lines.on('line', line => {
16
+ try {
17
+ const request = JSON.parse(line);
18
+ if (!terminal) {
19
+ terminal = spawn(request.command, request.args ?? [], {
20
+ name: 'xterm-256color', cols: request.cols, rows: request.rows,
21
+ cwd: request.cwd, env: process.env, encoding: null
22
+ });
23
+ terminal.onData(data => send({ type: 'data', data: Buffer.from(data).toString('base64') }));
24
+ terminal.onExit(event => {
25
+ process.stdout.write(JSON.stringify({ type: 'exit', exitCode: event.exitCode }) + '\n', () => process.exit(0));
26
+ });
27
+ send({ type: 'ready' });
28
+ } else if (request.type === 'write') terminal.write(Buffer.from(request.data, 'base64'));
29
+ else if (request.type === 'resize') terminal.resize(request.cols, request.rows);
30
+ else if (request.type === 'signal') terminal.kill(request.signal);
31
+ else if (request.type === 'kill') terminal.kill();
32
+ } catch {
33
+ send({ type: 'error' });
34
+ if (terminal) terminal.kill();
35
+ else process.exitCode = 1;
36
+ }
37
+ });
38
+ const close = () => { if (terminal) terminal.kill(); else process.exit(0); };
39
+ lines.on('close', close);
40
+ process.on('SIGTERM', close);
41
+ `;
42
+ //# sourceMappingURL=pty.node-host.impl.bun.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pty.node-host.impl.bun.js","sourceRoot":"","sources":["../src/pty.node-host.impl.bun.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgC1C,CAAC"}