@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,44 @@
1
+ /**
2
+ * Registers the Bun host's SQLite driver under LocalDB's `localdb/sqlite-driver`
3
+ * kind. The host owns the kind's registration on the runtimes it builds (as it
4
+ * owns the paths kinds): the kind is LocalDB's frozen definition, so a second
5
+ * registration of it by the LocalDB plugin is a no-op. The driver module loads
6
+ * only when the kind is first resolved.
7
+ */
8
+ import { createRuntimeImplementation, createRuntimePlugin } from '@vibesdotdev/kernel';
9
+ import { LOCALDB_SQLITE_DRIVER_KIND, sqliteDriverKind } from '@vibesdotdev/localdb/sqlite-driver';
10
+ import { assertNativeBunHost } from "../native-network/native-host.js";
11
+ /** The Bun driver's descriptor. */
12
+ export const bunSqliteDriverDescriptor = {
13
+ id: 'sqlite-driver-bun',
14
+ kind: LOCALDB_SQLITE_DRIVER_KIND,
15
+ name: 'Bun SQLite driver',
16
+ description: 'LocalDB SQLite driver over bun:sqlite',
17
+ host: 'bun',
18
+ hardware: ['consumer', 'cloud']
19
+ };
20
+ /** Register the kind (when absent), the Bun driver's descriptor and its lazy loader on `runtime`. */
21
+ export function registerBunSqliteDriver(runtime) {
22
+ if (!runtime.hasKind(LOCALDB_SQLITE_DRIVER_KIND))
23
+ runtime.registerKind(sqliteDriverKind);
24
+ runtime.registerDescriptor(LOCALDB_SQLITE_DRIVER_KIND, bunSqliteDriverDescriptor);
25
+ runtime.registerLoader(LOCALDB_SQLITE_DRIVER_KIND, bunSqliteDriverDescriptor.id, async () => {
26
+ assertNativeBunHost(runtime);
27
+ const { createBunSqliteDriver } = await import("./sqlite-driver.impl.bun.js");
28
+ return createRuntimeImplementation({
29
+ kind: LOCALDB_SQLITE_DRIVER_KIND,
30
+ id: bunSqliteDriverDescriptor.id,
31
+ constraint: { hardware: ['consumer', 'cloud'] },
32
+ implementation: createBunSqliteDriver()
33
+ });
34
+ });
35
+ }
36
+ /** The same registration as a plugin, for a host composed from plugins. */
37
+ export const bunSqliteDriverPlugin = createRuntimePlugin({
38
+ id: 'sqlite-driver-bun',
39
+ name: 'Bun SQLite driver',
40
+ onRegister(runtime) {
41
+ registerBunSqliteDriver(runtime);
42
+ }
43
+ });
44
+ //# sourceMappingURL=sqlite-driver.plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sqlite-driver.plugin.js","sourceRoot":"","sources":["../../src/sqlite-driver/sqlite-driver.plugin.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,2BAA2B,EAAE,mBAAmB,EAAuC,MAAM,qBAAqB,CAAC;AAC5H,OAAO,EAAE,0BAA0B,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAClG,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAEvE,mCAAmC;AACnC,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACxC,EAAE,EAAE,mBAAmB;IACvB,IAAI,EAAE,0BAA0B;IAChC,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,uCAAuC;IACpD,IAAI,EAAE,KAAK;IACX,QAAQ,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC;CAC/B,CAAC;AAEF,qGAAqG;AACrG,MAAM,UAAU,uBAAuB,CAAC,OAAmB;IAC1D,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,0BAA0B,CAAC;QAAE,OAAO,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC;IACzF,OAAO,CAAC,kBAAkB,CAAC,0BAA0B,EAAE,yBAAyB,CAAC,CAAC;IAClF,OAAO,CAAC,cAAc,CAAC,0BAA0B,EAAE,yBAAyB,CAAC,EAAE,EAAE,KAAK,IAAI,EAAE;QAC3F,mBAAmB,CAAC,OAAO,CAAC,CAAC;QAC7B,MAAM,EAAE,qBAAqB,EAAE,GAAG,MAAM,MAAM,CAAC,6BAA6B,CAAC,CAAC;QAC9E,OAAO,2BAA2B,CAAC;YAClC,IAAI,EAAE,0BAA0B;YAChC,EAAE,EAAE,yBAAyB,CAAC,EAAE;YAChC,UAAU,EAAE,EAAE,QAAQ,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC,EAAE;YAC/C,cAAc,EAAE,qBAAqB,EAAE;SACvC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,2EAA2E;AAC3E,MAAM,CAAC,MAAM,qBAAqB,GAAkB,mBAAmB,CAAC;IACvE,EAAE,EAAE,mBAAmB;IACvB,IAAI,EAAE,mBAAmB;IACzB,UAAU,CAAC,OAAO;QACjB,uBAAuB,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC;CACD,CAAC,CAAC"}
@@ -0,0 +1,34 @@
1
+ /** Structural contract of the runtime/client host-telemetry capability. */
2
+ import type { RuntimeClient } from '@vibesdotdev/kernel/client';
3
+ import type { HostTelemetry } from '../schemas/telemetry.ts';
4
+ export { HostTelemetrySchema, type HostTelemetry } from '../schemas/telemetry.ts';
5
+ export interface HostTelemetryClient extends RuntimeClient {
6
+ read(): HostTelemetry;
7
+ capabilities(): {
8
+ os: string;
9
+ kernel: string;
10
+ cpu: {
11
+ model: string | undefined;
12
+ cores: number;
13
+ };
14
+ ramMb: number;
15
+ network: {
16
+ publicIp: string | undefined;
17
+ privateIp: string | undefined;
18
+ };
19
+ };
20
+ publicIpv4(): string | undefined;
21
+ heartbeat(activeJobs: number): {
22
+ timestamp: string;
23
+ uptimeSeconds: number;
24
+ capacity: {
25
+ cpuCores: number;
26
+ ramMb: number;
27
+ };
28
+ usage: {
29
+ ramPercent: number | undefined;
30
+ };
31
+ activeJobs: number;
32
+ };
33
+ }
34
+ //# sourceMappingURL=telemetry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../src/telemetry/telemetry.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,KAAK,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAElF,MAAM,WAAW,mBAAoB,SAAQ,aAAa;IACzD,IAAI,IAAI,aAAa,CAAC;IACtB,YAAY,IAAI;QACf,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE;YAAE,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAC;QAC9E,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE;YAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;YAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAA;SAAE,CAAC;KACxF,CAAC;IACF,UAAU,IAAI,MAAM,GAAG,SAAS,CAAC;IACjC,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG;QAC9B,SAAS,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAC;QACzC,QAAQ,EAAE;YAAE,QAAQ,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAC;QAC9C,KAAK,EAAE;YAAE,UAAU,EAAE,MAAM,GAAG,SAAS,CAAA;SAAE,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;KAC9D,CAAC;CACF"}
@@ -0,0 +1,2 @@
1
+ export { HostTelemetrySchema } from "../schemas/telemetry.js";
2
+ //# sourceMappingURL=telemetry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry.js","sourceRoot":"","sources":["../../src/telemetry/telemetry.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAsB,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { type HostTelemetry } from '../schemas/telemetry.ts';
2
+ /** Tests may substitute only this native boundary; validation and client ownership stay real. */
3
+ export declare function hostTelemetryPlugin(readNative?: () => HostTelemetry): import("@vibesdotdev/kernel").RuntimePlugin;
4
+ //# sourceMappingURL=telemetry.plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry.plugin.d.ts","sourceRoot":"","sources":["../../src/telemetry/telemetry.plugin.ts"],"names":[],"mappings":"AAKA,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAsBlF,iGAAiG;AACjG,wBAAgB,mBAAmB,CAAC,UAAU,GAAE,MAAM,aAAmC,+CAiDxF"}
@@ -0,0 +1,78 @@
1
+ /** Bun-owned native binding of the structural host-telemetry client contract. */
2
+ import { cpus, totalmem, freemem, type, release, version, uptime, networkInterfaces } from 'node:os';
3
+ import { CapabilityError, createRuntimePlugin, settleNow, valueFreeFailure } from '@vibesdotdev/kernel';
4
+ import { BaseRuntimeClient, getVibesClient } from '@vibesdotdev/kernel/client';
5
+ import runtimeClientPlugin from '@vibesdotdev/kernel/client/plugin';
6
+ import { HostTelemetrySchema } from "../schemas/telemetry.js";
7
+ function readNativeTelemetry() {
8
+ return {
9
+ cpus: cpus(), totalMemoryBytes: totalmem(), freeMemoryBytes: freemem(),
10
+ os: { type: type(), release: release(), version: version(), uptimeSeconds: uptime() },
11
+ interfaces: Object.values(networkInterfaces()).flat().filter(entry => entry !== undefined)
12
+ };
13
+ }
14
+ function isReservedIpv4(address) {
15
+ const octets = address.split('.').map(Number);
16
+ if (octets.length !== 4 || octets.some(octet => !Number.isInteger(octet)))
17
+ return true;
18
+ const a = octets[0];
19
+ const b = octets[1];
20
+ return a === 0 || a === 10 || a === 127
21
+ || (a === 100 && b >= 64 && b <= 127)
22
+ || (a === 169 && b === 254)
23
+ || (a === 172 && b >= 16 && b <= 31)
24
+ || (a === 192 && b === 168);
25
+ }
26
+ /** Tests may substitute only this native boundary; validation and client ownership stay real. */
27
+ export function hostTelemetryPlugin(readNative = readNativeTelemetry) {
28
+ return createRuntimePlugin({
29
+ id: 'host-telemetry', name: 'Live host telemetry',
30
+ async onRegister(runtime) {
31
+ await runtime.registerPlugin(runtimeClientPlugin);
32
+ runtime.registerDescriptor('runtime/client', { kind: 'runtime/client', id: 'host-telemetry', name: 'Live host telemetry' });
33
+ runtime.registerLoader('runtime/client', 'host-telemetry', async () => ({
34
+ impl: class extends BaseRuntimeClient {
35
+ capabilities() {
36
+ const reading = this.read();
37
+ const addresses = reading.interfaces
38
+ .flatMap(entry => entry.family === 'IPv4' && !entry.internal ? [entry.address] : []);
39
+ return {
40
+ os: `${reading.os.type} ${reading.os.release}`,
41
+ kernel: reading.os.version,
42
+ cpu: { model: reading.cpus[0]?.model, cores: reading.cpus.length },
43
+ ramMb: Math.round(reading.totalMemoryBytes / 1024 / 1024),
44
+ network: {
45
+ publicIp: addresses.find(address => !isReservedIpv4(address)),
46
+ privateIp: addresses.find(isReservedIpv4)
47
+ }
48
+ };
49
+ }
50
+ publicIpv4() {
51
+ return this.capabilities().network.publicIp;
52
+ }
53
+ heartbeat(activeJobs) {
54
+ const reading = this.read();
55
+ const usedMemory = Math.max(reading.totalMemoryBytes - reading.freeMemoryBytes, 0);
56
+ return {
57
+ timestamp: new Date().toISOString(),
58
+ uptimeSeconds: Math.floor(reading.os.uptimeSeconds),
59
+ capacity: { cpuCores: reading.cpus.length, ramMb: Math.round(reading.totalMemoryBytes / 1024 / 1024) },
60
+ usage: { ramPercent: reading.totalMemoryBytes > 0 ? Math.min(usedMemory / reading.totalMemoryBytes * 100, 100) : undefined },
61
+ activeJobs
62
+ };
63
+ }
64
+ read() {
65
+ const reading = settleNow(() => HostTelemetrySchema.parse(readNative()));
66
+ if (reading.ok)
67
+ return reading.value;
68
+ throw new CapabilityError('The host could not read live telemetry.', 'UNAVAILABLE', {
69
+ reason: 'host-telemetry-read-failed', cause: valueFreeFailure(reading.cause)
70
+ });
71
+ }
72
+ }
73
+ }));
74
+ await getVibesClient('host-telemetry', runtime);
75
+ }
76
+ });
77
+ }
78
+ //# sourceMappingURL=telemetry.plugin.js.map
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AK,CAAC,OAAO,CAAC,gBAAgB,GAAG,IAAI,GAAG,IAAI,CAAC,EAAE;4BACtG,KAAK,EAAE,EAAE,UAAU,EAAE,OAAO,CAAC,gBAAgB,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,GAAG,OAAO,CAAC,gBAAgB,GAAG,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE;4BAC5H,UAAU;yBACV,CAAC;oBACH,CAAC;oBACD,IAAI;wBACH,MAAM,OAAO,GAAG,SAAS,CAAC,GAAG,EAAE,CAAC,mBAAmB,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;wBACzE,IAAI,OAAO,CAAC,EAAE;4BAAE,OAAO,OAAO,CAAC,KAAK,CAAC;wBACrC,MAAM,IAAI,eAAe,CAAC,yCAAyC,EAAE,aAAa,EAAE;4BACnF,MAAM,EAAE,4BAA4B,EAAE,KAAK,EAAE,gBAAgB,CAAC,OAAO,CAAC,KAAK,CAAC;yBAC5E,CAAC,CAAC;oBACJ,CAAC;iBACD;aACD,CAAC,CAAC,CAAC;YACJ,MAAM,cAAc,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;QACjD,CAAC;KACD,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { type RuntimeRef } from '@vibesdotdev/kernel';
2
+ import { type ExecutionSession, type SessionOptions } from '@vibesdotdev/kernel/execution';
3
+ export interface PtyServerConfig extends Omit<SessionOptions, 'cols' | 'rows'> {
4
+ port: number;
5
+ cols?: number;
6
+ rows?: number;
7
+ hostname?: string;
8
+ /** Host admission for input queued while session opening is pending; default 64 KiB. */
9
+ maxOpeningInputBytes?: number;
10
+ }
11
+ interface PtyConnection {
12
+ closed: boolean;
13
+ pending: Array<string | Uint8Array>;
14
+ pendingBytes: number;
15
+ session?: ExecutionSession;
16
+ opening?: Promise<ExecutionSession>;
17
+ completion?: Promise<void>;
18
+ cleanup?: Promise<void>;
19
+ unsubscribe?: () => void;
20
+ }
21
+ /** Caller owns close(), followed by disposal of its runtime. */
22
+ export declare function startPtyWsServer(runtime: RuntimeRef, input: PtyServerConfig): Promise<{
23
+ server: Bun.Server<PtyConnection>;
24
+ close(): Promise<void>;
25
+ }>;
26
+ /** Parse only captured host input; environment selection remains execution-owned. */
27
+ export declare function ptyServerConfigFromEnv(runtime: RuntimeRef, argv?: string[]): PtyServerConfig;
28
+ /** Executable boundary: caller supplies the installed module-graph root. */
29
+ export declare function runPtyWsServerFromCli(hostRoot?: string): Promise<void>;
30
+ export {};
31
+ //# sourceMappingURL=terminal-pty-bridge.impl.bun.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"terminal-pty-bridge.impl.bun.d.ts","sourceRoot":"","sources":["../src/terminal-pty-bridge.impl.bun.ts"],"names":[],"mappings":"AAEA,OAAO,EAON,KAAK,UAAU,EACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAQN,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,MAAM,+BAA+B,CAAC;AAcvC,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7E,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wFAAwF;IACxF,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,UAAU,aAAa;IACtB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,KAAK,CAAC,MAAM,GAAG,UAAU,CAAC,CAAC;IACpC,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACpC,UAAU,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAeD,gEAAgE;AAChE,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,eAAe;;aA4MvE,OAAO,CAAC,IAAI,CAAC;GAgBvB;AAED,qFAAqF;AACrF,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,UAAU,EAAE,IAAI,GAAE,MAAM,EAAO,GAAG,eAAe,CA8ChG;AAED,4EAA4E;AAC5E,wBAAsB,qBAAqB,CAAC,QAAQ,GAAE,MAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CA8C1F"}
@@ -0,0 +1,333 @@
1
+ /** Bun websocket host for the runtime-owned terminal PTY bridge contract. */
2
+ import { join } from 'node:path';
3
+ import { bootstrapVibesRuntime, CapabilityError, CaughtFailureSchema, getRuntimeStdio, readEnv } from '@vibesdotdev/kernel';
4
+ import { decodeTerminalPtyClientFrame, encodeTerminalPtyExitFrame, requireExecutionEnvironmentMode, SessionOptionsSchema, terminalPtyBase64ToBytes } from '@vibesdotdev/kernel/execution';
5
+ import { createRuntimeEnvironmentBunPlugin } from "./index.js";
6
+ import * as z from 'zod/v4';
7
+ const CONTROL_KEYS = [
8
+ 'PTY_WS_PORT',
9
+ 'PTY_WS_COMMAND',
10
+ 'PTY_WS_ARGS',
11
+ 'PTY_WS_CWD',
12
+ 'PTY_WS_COLS',
13
+ 'PTY_WS_ROWS',
14
+ 'PTY_WS_ENV_POLICY'
15
+ ];
16
+ const PtySocketMessageSchema = z.union([
17
+ z.string().transform((data) => ({
18
+ kind: 'text',
19
+ data,
20
+ byteLength: new TextEncoder().encode(data).byteLength
21
+ })),
22
+ z.instanceof(Uint8Array).transform((data) => ({
23
+ kind: 'bytes',
24
+ data: new Uint8Array(data),
25
+ byteLength: data.byteLength
26
+ }))
27
+ ]);
28
+ /** Caller owns close(), followed by disposal of its runtime. */
29
+ export async function startPtyWsServer(runtime, input) {
30
+ requireExecutionEnvironmentMode(input);
31
+ if (CONTROL_KEYS.some((key) => Object.hasOwn(input.env ?? {}, key))) {
32
+ throw new CapabilityError('PTY workload environment collides with a reserved bridge control key.', 'INVALID_INPUT', { reason: 'pty-environment-control-collision', retryable: false });
33
+ }
34
+ const maxOpeningInputBytes = input.maxOpeningInputBytes ?? 65_536;
35
+ if (!Number.isSafeInteger(maxOpeningInputBytes) || maxOpeningInputBytes < 0) {
36
+ throw new CapabilityError('Invalid PTY opening input budget.', 'INVALID_INPUT', {
37
+ reason: 'pty-opening-input-budget-invalid',
38
+ retryable: false
39
+ });
40
+ }
41
+ const parsed = SessionOptionsSchema.safeParse({
42
+ ...input,
43
+ cols: input.cols ?? 80,
44
+ rows: input.rows ?? 24
45
+ });
46
+ if (!parsed.success) {
47
+ throw new CapabilityError('Invalid PTY session request.', 'INVALID_INPUT', {
48
+ reason: 'pty-session-request-invalid',
49
+ retryable: false
50
+ });
51
+ }
52
+ const config = {
53
+ ...parsed.data,
54
+ unsetEnv: [...(parsed.data.unsetEnv ?? []), ...CONTROL_KEYS],
55
+ port: input.port,
56
+ hostname: input.hostname
57
+ };
58
+ const execution = await runtime
59
+ .query('runtime/execution')
60
+ .resolve();
61
+ const connections = new Set();
62
+ const failures = [];
63
+ let closing;
64
+ const captureFailure = (operation) => {
65
+ try {
66
+ operation();
67
+ return null;
68
+ }
69
+ catch (cause) {
70
+ return CaughtFailureSchema.parse(cause);
71
+ }
72
+ };
73
+ function deliver(session, message) {
74
+ if (message instanceof Uint8Array) {
75
+ session.write(new Uint8Array(message));
76
+ return;
77
+ }
78
+ const frame = decodeTerminalPtyClientFrame(message);
79
+ if (frame.t === 'stdin')
80
+ session.write(terminalPtyBase64ToBytes(frame.d));
81
+ else if (frame.t === 'resize')
82
+ session.resize(frame.cols, frame.rows);
83
+ else
84
+ session.signal(frame.name);
85
+ }
86
+ function cleanup(connection) {
87
+ connection.closed = true;
88
+ connection.pending = [];
89
+ connection.pendingBytes = 0;
90
+ connection.cleanup ??= (async () => {
91
+ const session = connection.session ?? (await connection.opening);
92
+ if (session) {
93
+ session.kill();
94
+ await session.exited();
95
+ }
96
+ await connection.completion;
97
+ connection.unsubscribe?.();
98
+ connections.delete(connection);
99
+ })();
100
+ return connection.cleanup;
101
+ }
102
+ function observeCleanup(connection) {
103
+ void cleanup(connection)
104
+ .then(() => ({ kind: 'success' }), (cause) => ({
105
+ kind: 'failure',
106
+ failure: CaughtFailureSchema.parse(cause)
107
+ }))
108
+ .then((outcome) => {
109
+ if (outcome.kind === 'failure')
110
+ failures.push(outcome.failure);
111
+ });
112
+ }
113
+ const server = Bun.serve({
114
+ port: config.port,
115
+ hostname: config.hostname ?? '0.0.0.0',
116
+ fetch(request, nativeServer) {
117
+ if (closing)
118
+ return new Response('closing', { status: 503 });
119
+ if (nativeServer.upgrade(request, {
120
+ data: { closed: false, pending: [], pendingBytes: 0 }
121
+ })) {
122
+ return undefined;
123
+ }
124
+ return new Response('terminal-pty-bridge: websocket upgrade required', { status: 426 });
125
+ },
126
+ websocket: {
127
+ perMessageDeflate: false,
128
+ open(socket) {
129
+ const connection = socket.data;
130
+ connections.add(connection);
131
+ connection.opening = Promise.resolve().then(() => execution.session({
132
+ command: config.command,
133
+ args: config.args,
134
+ cwd: config.cwd,
135
+ env: config.env,
136
+ envMode: config.envMode,
137
+ inheritReason: config.inheritReason,
138
+ unsetEnv: config.unsetEnv,
139
+ cols: config.cols ?? 80,
140
+ rows: config.rows ?? 24
141
+ }));
142
+ connection.completion = connection.opening
143
+ .then(async (session) => {
144
+ connection.session = session;
145
+ if (connection.closed)
146
+ return;
147
+ connection.unsubscribe = session.onOutput((bytes) => {
148
+ if (!connection.closed)
149
+ socket.sendBinary(bytes);
150
+ });
151
+ for (const message of connection.pending)
152
+ deliver(session, message);
153
+ connection.pending = [];
154
+ connection.pendingBytes = 0;
155
+ const { exitCode } = await session.exited();
156
+ if (!connection.closed) {
157
+ socket.send(encodeTerminalPtyExitFrame(exitCode));
158
+ socket.close(1000, 'pty-exit');
159
+ }
160
+ })
161
+ .then(() => ({ kind: 'success' }), (cause) => ({
162
+ kind: 'failure',
163
+ failure: CaughtFailureSchema.parse(cause)
164
+ }))
165
+ .then((outcome) => {
166
+ if (outcome.kind !== 'failure')
167
+ return;
168
+ failures.push(outcome.failure);
169
+ const closeFailure = captureFailure(() => socket.close(1011, 'pty-session-failed'));
170
+ if (closeFailure)
171
+ failures.push(closeFailure);
172
+ observeCleanup(connection);
173
+ });
174
+ },
175
+ message(socket, message) {
176
+ const connection = socket.data;
177
+ if (connection.closed)
178
+ return;
179
+ const parsed = PtySocketMessageSchema.safeParse(message);
180
+ if (!parsed.success) {
181
+ failures.push(new CapabilityError('Invalid PTY websocket message.', 'INVALID_INPUT', {
182
+ reason: 'pty-websocket-message-invalid',
183
+ retryable: false,
184
+ cause: parsed.error
185
+ }));
186
+ const closeFailure = captureFailure(() => socket.close(1011, 'pty-session-failed'));
187
+ if (closeFailure)
188
+ failures.push(closeFailure);
189
+ observeCleanup(connection);
190
+ return;
191
+ }
192
+ const admitted = parsed.data;
193
+ const session = connection.session;
194
+ if (!session) {
195
+ connection.pendingBytes += admitted.byteLength;
196
+ if (connection.pendingBytes > maxOpeningInputBytes) {
197
+ socket.close(1009, 'pty-opening-input-limit');
198
+ observeCleanup(connection);
199
+ return;
200
+ }
201
+ connection.pending.push(admitted.data);
202
+ return;
203
+ }
204
+ const deliveryFailure = captureFailure(() => deliver(session, admitted.data));
205
+ if (deliveryFailure) {
206
+ failures.push(deliveryFailure);
207
+ const closeFailure = captureFailure(() => socket.close(1011, 'pty-session-failed'));
208
+ if (closeFailure)
209
+ failures.push(closeFailure);
210
+ observeCleanup(connection);
211
+ }
212
+ },
213
+ close(socket) {
214
+ observeCleanup(socket.data);
215
+ }
216
+ }
217
+ });
218
+ return {
219
+ server,
220
+ close() {
221
+ closing ??= (async () => {
222
+ server.stop(true);
223
+ await runtime.lifecycle.wait(async () => {
224
+ await Promise.all([...connections].map(cleanup));
225
+ }, { timeoutMs: 10_000, reason: 'pty-bridge-session-cleanup' });
226
+ if (failures.length > 0) {
227
+ throw new AggregateError(failures, 'PTY bridge session cleanup failed');
228
+ }
229
+ })();
230
+ return closing;
231
+ }
232
+ };
233
+ }
234
+ /** Parse only captured host input; environment selection remains execution-owned. */
235
+ export function ptyServerConfigFromEnv(runtime, argv = []) {
236
+ const host = {
237
+ platform: runtime.localEnvironment.getPlatform?.(),
238
+ snapshot: runtime.getEnvSnapshot()
239
+ };
240
+ const read = (key) => readEnv(host, key);
241
+ const port = Number(read('PTY_WS_PORT') ?? argv[0] ?? '7681');
242
+ if (!Number.isInteger(port) || port <= 0 || port > 65_535) {
243
+ throw new CapabilityError('Invalid PTY bridge port.', 'INVALID_INPUT', {
244
+ reason: 'pty-port-invalid',
245
+ retryable: false
246
+ });
247
+ }
248
+ let policy;
249
+ try {
250
+ policy = JSON.parse(read('PTY_WS_ENV_POLICY') ?? 'null');
251
+ }
252
+ catch (cause) {
253
+ throw new CapabilityError('Invalid PTY environment policy.', 'INVALID_INPUT', {
254
+ reason: 'pty-environment-policy-invalid',
255
+ retryable: false,
256
+ cause
257
+ });
258
+ }
259
+ requireExecutionEnvironmentMode(policy);
260
+ let args = argv.slice(2);
261
+ const argsJson = read('PTY_WS_ARGS');
262
+ if (argsJson !== undefined) {
263
+ try {
264
+ args = JSON.parse(argsJson);
265
+ }
266
+ catch (cause) {
267
+ throw new CapabilityError('Invalid PTY argument list.', 'INVALID_INPUT', {
268
+ reason: 'pty-arguments-invalid',
269
+ retryable: false,
270
+ cause
271
+ });
272
+ }
273
+ }
274
+ return {
275
+ ...policy,
276
+ port,
277
+ command: read('PTY_WS_COMMAND') ?? argv[1] ?? 'bash',
278
+ args,
279
+ cwd: read('PTY_WS_CWD'),
280
+ cols: read('PTY_WS_COLS') ? Number(read('PTY_WS_COLS')) : undefined,
281
+ rows: read('PTY_WS_ROWS') ? Number(read('PTY_WS_ROWS')) : undefined
282
+ };
283
+ }
284
+ /** Executable boundary: caller supplies the installed module-graph root. */
285
+ export async function runPtyWsServerFromCli(hostRoot = Bun.argv[2]) {
286
+ if (!hostRoot) {
287
+ throw new CapabilityError('PTY bridge requires its host module root.', 'INVALID_INPUT', {
288
+ reason: 'pty-host-root-missing',
289
+ retryable: false
290
+ });
291
+ }
292
+ const runtime = await bootstrapVibesRuntime({
293
+ binding: 'owned',
294
+ environment: createRuntimeEnvironmentBunPlugin({
295
+ host: { root: hostRoot },
296
+ heldLaunch: { manifestPath: join(hostRoot, 'native/held-launch/manifest.json') },
297
+ scope: {
298
+ surface: 'cli',
299
+ hardware: 'consumer',
300
+ purpose: 'direct',
301
+ lifecycle: 'persistent',
302
+ hosting: { mode: 'local', owner: 'consumer', venue: 'user-device' }
303
+ }
304
+ }),
305
+ composition: { kind: 'literal', plugins: [] }
306
+ });
307
+ let bridge;
308
+ try {
309
+ bridge = await startPtyWsServer(runtime, ptyServerConfigFromEnv(runtime, Bun.argv.slice(3)));
310
+ const stdio = await getRuntimeStdio(runtime);
311
+ stdio.write('stdout', `[terminal-pty-bridge] listening on ${bridge.server.hostname}:${bridge.server.port}\n`);
312
+ await new Promise((resolve) => {
313
+ const stop = () => {
314
+ process.off('SIGTERM', stop);
315
+ process.off('SIGINT', stop);
316
+ resolve();
317
+ };
318
+ process.once('SIGTERM', stop);
319
+ process.once('SIGINT', stop);
320
+ });
321
+ }
322
+ finally {
323
+ try {
324
+ await bridge?.close();
325
+ }
326
+ finally {
327
+ await runtime.dispose();
328
+ }
329
+ }
330
+ }
331
+ if (import.meta.main)
332
+ await runPtyWsServerFromCli();
333
+ //# sourceMappingURL=terminal-pty-bridge.impl.bun.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"terminal-pty-bridge.impl.bun.js","sourceRoot":"","sources":["../src/terminal-pty-bridge.impl.bun.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,OAAO,EAAE,IAAI,EAAE,MAAM,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AgB,CAAC,OAAO,EAAE,sBAAsB,CAAC,OAAO,EAAE,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7F,MAAM,KAAK,GAAG,MAAM,eAAe,CAAC,OAAO,CAAC,CAAC;QAC7C,KAAK,CAAC,KAAK,CACV,QAAQ,EACR,sCAAsC,MAAM,CAAC,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,IAAI,CACtF,CAAC;QACF,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;YACnC,MAAM,IAAI,GAAG,GAAG,EAAE;gBACjB,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;gBAC7B,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;gBAC5B,OAAO,EAAE,CAAC;YACX,CAAC,CAAC;YACF,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;YAC9B,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QAC9B,CAAC,CAAC,CAAC;IACJ,CAAC;YAAS,CAAC;QACV,IAAI,CAAC;YACJ,MAAM,MAAM,EAAE,KAAK,EAAE,CAAC;QACvB,CAAC;gBAAS,CAAC;YACV,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;QACzB,CAAC;IACF,CAAC;AACF,CAAC;AAED,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI;IAAE,MAAM,qBAAqB,EAAE,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { RuntimePlugin, RuntimeScope } from '@vibesdotdev/kernel';
2
+ import type { createRuntimeEnvironmentBunPlugin as EnvironmentFactory } from '../index.ts';
3
+ import type { bunHttpListenerPlugin as HttpListenerFactory } from '../http-listener.impl.bun.ts';
4
+ import type { bunLocalExecutionPlugin as LocalExecutionFactory } from '../local-execution.impl.bun.ts';
5
+ /** The environment plugin factory of the package root, loaded on first call. */
6
+ export declare const createRuntimeEnvironmentBunPlugin: typeof EnvironmentFactory;
7
+ /** The local-execution plugin factory of `./local-execution`, loaded on first call. */
8
+ export declare const bunLocalExecutionPlugin: typeof LocalExecutionFactory;
9
+ /** The HTTP-listener plugin factory of `./http-listener`, loaded on first call. */
10
+ export declare const bunHttpListenerPlugin: typeof HttpListenerFactory;
11
+ /** The environment a test execution runtime composes when the test supplies none: the Bun host over one fixture home. */
12
+ export declare function createBunTestExecutionEnvironment(options: {
13
+ scope: RuntimeScope;
14
+ home: string;
15
+ }): RuntimePlugin;
16
+ //# sourceMappingURL=lazy-environment.impl.bun.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lazy-environment.impl.bun.d.ts","sourceRoot":"","sources":["../../src/test-tooling/lazy-environment.impl.bun.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,KAAK,EAAE,iCAAiC,IAAI,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC3F,OAAO,KAAK,EAAE,qBAAqB,IAAI,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACjG,OAAO,KAAK,EAAE,uBAAuB,IAAI,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAsBvG,gFAAgF;AAChF,eAAO,MAAM,iCAAiC,EAAE,OAAO,kBACQ,CAAC;AAEhE,uFAAuF;AACvF,eAAO,MAAM,uBAAuB,EAAE,OAAO,qBACW,CAAC;AAEzD,mFAAmF;AACnF,eAAO,MAAM,qBAAqB,EAAE,OAAO,mBACS,CAAC;AAErD,yHAAyH;AACzH,wBAAgB,iCAAiC,CAAC,OAAO,EAAE;IAAE,KAAK,EAAE,YAAY,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,aAAa,CAE/G"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * The Bun host's plugin factories for test composition roots, loaded on first call.
3
+ *
4
+ * `@vibesdotdev/testing/test-environment` offers these under the Bun host's own names. They must not be
5
+ * reachable from that root's import graph: the host's restricted-execution supervisor is a Bun-only
6
+ * `with { type: 'text' }` import, and a Vite-evaluated graph (a Vitest file) executes that supervisor as
7
+ * a module and blocks on its descriptor read. This module's graph holds types and `node:module` only; each
8
+ * factory loads the real host through the host's own module loader when it is first called, where Bun's
9
+ * native loader resolves the text import.
10
+ */
11
+ import { createRequire } from 'node:module';
12
+ const loadHost = createRequire(import.meta.url);
13
+ // The specifiers are the package's own subpaths, resolved from this file's package, so source and dist agree.
14
+ function environmentModule() {
15
+ // SAFETY: the specifier names this package's `.` export, whose shape `EnvironmentModule` states.
16
+ return loadHost('@vibesdotdev/host-bun');
17
+ }
18
+ function localExecutionModule() {
19
+ // SAFETY: the specifier names this package's `./local-execution` export, whose shape `LocalExecutionModule` states.
20
+ return loadHost('@vibesdotdev/host-bun/local-execution');
21
+ }
22
+ function httpListenerModule() {
23
+ // SAFETY: the specifier names this package's `./http-listener` export, whose shape `HttpListenerModule` states.
24
+ return loadHost('@vibesdotdev/host-bun/http-listener');
25
+ }
26
+ /** The environment plugin factory of the package root, loaded on first call. */
27
+ export const createRuntimeEnvironmentBunPlugin = (...args) => environmentModule().createRuntimeEnvironmentBunPlugin(...args);
28
+ /** The local-execution plugin factory of `./local-execution`, loaded on first call. */
29
+ export const bunLocalExecutionPlugin = (...args) => localExecutionModule().bunLocalExecutionPlugin(...args);
30
+ /** The HTTP-listener plugin factory of `./http-listener`, loaded on first call. */
31
+ export const bunHttpListenerPlugin = (...args) => httpListenerModule().bunHttpListenerPlugin(...args);
32
+ /** The environment a test execution runtime composes when the test supplies none: the Bun host over one fixture home. */
33
+ export function createBunTestExecutionEnvironment(options) {
34
+ return createRuntimeEnvironmentBunPlugin({ scope: options.scope, paths: { vibesHome: options.home } });
35
+ }
36
+ //# sourceMappingURL=lazy-environment.impl.bun.js.map