@owlmeans/viable-sdk 0.1.18-rc.8 → 0.1.18

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 (498) hide show
  1. package/README.md +29 -11
  2. package/agent-meta/manifest.json +16 -0
  3. package/agent-meta/skills/viable-sdk/SKILL.md +1033 -0
  4. package/build/api/collect/types.d.ts +30 -0
  5. package/build/api/collect/types.d.ts.map +1 -0
  6. package/build/api/collect/types.js +2 -0
  7. package/build/api/collect/types.js.map +1 -0
  8. package/build/api/collect.d.ts +14 -0
  9. package/build/api/collect.d.ts.map +1 -0
  10. package/build/api/collect.js +132 -0
  11. package/build/api/collect.js.map +1 -0
  12. package/build/api/consts.local.d.ts +21 -0
  13. package/build/api/consts.local.d.ts.map +1 -0
  14. package/build/api/consts.local.js +25 -0
  15. package/build/api/consts.local.js.map +1 -0
  16. package/build/api/index.d.ts +5 -0
  17. package/build/api/index.d.ts.map +1 -1
  18. package/build/api/index.js +2 -0
  19. package/build/api/index.js.map +1 -1
  20. package/build/api/remote.d.ts +13 -6
  21. package/build/api/remote.d.ts.map +1 -1
  22. package/build/api/remote.js +302 -35
  23. package/build/api/remote.js.map +1 -1
  24. package/build/api/transport/types.d.ts +14 -0
  25. package/build/api/transport/types.d.ts.map +1 -0
  26. package/build/api/transport/types.js +2 -0
  27. package/build/api/transport/types.js.map +1 -0
  28. package/build/api/transport.d.ts +4 -0
  29. package/build/api/transport.d.ts.map +1 -0
  30. package/build/api/transport.js +32 -0
  31. package/build/api/transport.js.map +1 -0
  32. package/build/api/types.d.ts +9 -0
  33. package/build/api/types.d.ts.map +1 -0
  34. package/build/api/types.js +2 -0
  35. package/build/api/types.js.map +1 -0
  36. package/build/api/types.local.d.ts +3 -0
  37. package/build/api/types.local.d.ts.map +1 -0
  38. package/build/api/types.local.js +2 -0
  39. package/build/api/types.local.js.map +1 -0
  40. package/build/consts.d.ts +29 -14
  41. package/build/consts.d.ts.map +1 -1
  42. package/build/consts.js +30 -14
  43. package/build/consts.js.map +1 -1
  44. package/build/context/consts.local.d.ts +18 -0
  45. package/build/context/consts.local.d.ts.map +1 -0
  46. package/build/context/consts.local.js +18 -0
  47. package/build/context/consts.local.js.map +1 -0
  48. package/build/context/index.d.ts +3 -7
  49. package/build/context/index.d.ts.map +1 -1
  50. package/build/context/index.js +58 -25
  51. package/build/context/index.js.map +1 -1
  52. package/build/context/types.d.ts +26 -0
  53. package/build/context/types.d.ts.map +1 -0
  54. package/build/context/types.js +2 -0
  55. package/build/context/types.js.map +1 -0
  56. package/build/executor/boot-check.d.ts +1 -40
  57. package/build/executor/boot-check.d.ts.map +1 -1
  58. package/build/executor/boot-check.js +22 -19
  59. package/build/executor/boot-check.js.map +1 -1
  60. package/build/executor/consts.d.ts +55 -0
  61. package/build/executor/consts.d.ts.map +1 -0
  62. package/build/executor/consts.js +66 -0
  63. package/build/executor/consts.js.map +1 -0
  64. package/build/executor/consts.local.d.ts +63 -0
  65. package/build/executor/consts.local.d.ts.map +1 -0
  66. package/build/executor/consts.local.js +69 -0
  67. package/build/executor/consts.local.js.map +1 -0
  68. package/build/executor/env/types.d.ts +40 -0
  69. package/build/executor/env/types.d.ts.map +1 -0
  70. package/build/executor/env/types.js +2 -0
  71. package/build/executor/env/types.js.map +1 -0
  72. package/build/executor/env.d.ts +11 -20
  73. package/build/executor/env.d.ts.map +1 -1
  74. package/build/executor/env.js +39 -59
  75. package/build/executor/env.js.map +1 -1
  76. package/build/executor/errors.d.ts +15 -0
  77. package/build/executor/errors.d.ts.map +1 -1
  78. package/build/executor/errors.js +19 -2
  79. package/build/executor/errors.js.map +1 -1
  80. package/build/executor/files/types.d.ts +106 -0
  81. package/build/executor/files/types.d.ts.map +1 -0
  82. package/build/executor/files/types.js +2 -0
  83. package/build/executor/files/types.js.map +1 -0
  84. package/build/executor/files.d.ts +2 -50
  85. package/build/executor/files.d.ts.map +1 -1
  86. package/build/executor/files.js +225 -68
  87. package/build/executor/files.js.map +1 -1
  88. package/build/executor/git/types.d.ts +19 -0
  89. package/build/executor/git/types.d.ts.map +1 -0
  90. package/build/executor/git/types.js +2 -0
  91. package/build/executor/git/types.js.map +1 -0
  92. package/build/executor/git.d.ts +4 -36
  93. package/build/executor/git.d.ts.map +1 -1
  94. package/build/executor/git.js +206 -241
  95. package/build/executor/git.js.map +1 -1
  96. package/build/executor/glob/types.d.ts +12 -0
  97. package/build/executor/glob/types.d.ts.map +1 -0
  98. package/build/executor/glob/types.js +2 -0
  99. package/build/executor/glob/types.js.map +1 -0
  100. package/build/executor/glob.d.ts +4 -0
  101. package/build/executor/glob.d.ts.map +1 -0
  102. package/build/executor/glob.js +11 -0
  103. package/build/executor/glob.js.map +1 -0
  104. package/build/executor/health/types.d.ts +39 -0
  105. package/build/executor/health/types.d.ts.map +1 -0
  106. package/build/executor/health/types.js +2 -0
  107. package/build/executor/health/types.js.map +1 -0
  108. package/build/executor/health.d.ts +3 -83
  109. package/build/executor/health.d.ts.map +1 -1
  110. package/build/executor/health.js +76 -91
  111. package/build/executor/health.js.map +1 -1
  112. package/build/executor/index.d.ts +14 -15
  113. package/build/executor/index.d.ts.map +1 -1
  114. package/build/executor/index.js +36 -18
  115. package/build/executor/index.js.map +1 -1
  116. package/build/executor/integrity/types.d.ts +25 -0
  117. package/build/executor/integrity/types.d.ts.map +1 -0
  118. package/build/executor/integrity/types.js +2 -0
  119. package/build/executor/integrity/types.js.map +1 -0
  120. package/build/executor/integrity.d.ts +5 -15
  121. package/build/executor/integrity.d.ts.map +1 -1
  122. package/build/executor/integrity.js +28 -39
  123. package/build/executor/integrity.js.map +1 -1
  124. package/build/executor/layout/types.d.ts +69 -0
  125. package/build/executor/layout/types.d.ts.map +1 -0
  126. package/build/executor/layout/types.js +2 -0
  127. package/build/executor/layout/types.js.map +1 -0
  128. package/build/executor/layout.d.ts +9 -56
  129. package/build/executor/layout.d.ts.map +1 -1
  130. package/build/executor/layout.js +35 -82
  131. package/build/executor/layout.js.map +1 -1
  132. package/build/executor/shell/types.d.ts +76 -0
  133. package/build/executor/shell/types.d.ts.map +1 -0
  134. package/build/executor/shell/types.js +2 -0
  135. package/build/executor/shell/types.js.map +1 -0
  136. package/build/executor/shell.d.ts +3 -78
  137. package/build/executor/shell.d.ts.map +1 -1
  138. package/build/executor/shell.js +61 -91
  139. package/build/executor/shell.js.map +1 -1
  140. package/build/executor/spawn/types.d.ts +98 -0
  141. package/build/executor/spawn/types.d.ts.map +1 -0
  142. package/build/executor/spawn/types.js +2 -0
  143. package/build/executor/spawn/types.js.map +1 -0
  144. package/build/executor/spawn.d.ts +3 -103
  145. package/build/executor/spawn.d.ts.map +1 -1
  146. package/build/executor/spawn.js +192 -274
  147. package/build/executor/spawn.js.map +1 -1
  148. package/build/executor/types.d.ts +123 -0
  149. package/build/executor/types.d.ts.map +1 -0
  150. package/build/executor/types.js +2 -0
  151. package/build/executor/types.js.map +1 -0
  152. package/build/executor/types.local.d.ts +6 -0
  153. package/build/executor/types.local.d.ts.map +1 -0
  154. package/build/executor/types.local.js +2 -0
  155. package/build/executor/types.local.js.map +1 -0
  156. package/build/index.d.ts +14 -1
  157. package/build/index.d.ts.map +1 -1
  158. package/build/index.js +5 -1
  159. package/build/index.js.map +1 -1
  160. package/build/project/consts.d.ts +17 -0
  161. package/build/project/consts.d.ts.map +1 -0
  162. package/build/project/consts.js +17 -0
  163. package/build/project/consts.js.map +1 -0
  164. package/build/project/consts.local.d.ts +4 -0
  165. package/build/project/consts.local.d.ts.map +1 -0
  166. package/build/project/consts.local.js +4 -0
  167. package/build/project/consts.local.js.map +1 -0
  168. package/build/project/dotenv/types.d.ts +39 -0
  169. package/build/project/dotenv/types.d.ts.map +1 -0
  170. package/build/project/dotenv/types.js +2 -0
  171. package/build/project/dotenv/types.js.map +1 -0
  172. package/build/project/dotenv.d.ts +4 -0
  173. package/build/project/dotenv.d.ts.map +1 -0
  174. package/build/project/dotenv.js +56 -0
  175. package/build/project/dotenv.js.map +1 -0
  176. package/build/project/env/types.d.ts +40 -0
  177. package/build/project/env/types.d.ts.map +1 -0
  178. package/build/project/env/types.js +2 -0
  179. package/build/project/env/types.js.map +1 -0
  180. package/build/project/env.d.ts +2 -98
  181. package/build/project/env.d.ts.map +1 -1
  182. package/build/project/env.js +63 -215
  183. package/build/project/env.js.map +1 -1
  184. package/build/project/marker/types.d.ts +33 -0
  185. package/build/project/marker/types.d.ts.map +1 -0
  186. package/build/project/marker/types.js +2 -0
  187. package/build/project/marker/types.js.map +1 -0
  188. package/build/project/marker.d.ts +4 -25
  189. package/build/project/marker.d.ts.map +1 -1
  190. package/build/project/marker.js +40 -43
  191. package/build/project/marker.js.map +1 -1
  192. package/build/project/probe/types.d.ts +22 -0
  193. package/build/project/probe/types.d.ts.map +1 -0
  194. package/build/project/probe/types.js +2 -0
  195. package/build/project/probe/types.js.map +1 -0
  196. package/build/project/probe.d.ts +4 -0
  197. package/build/project/probe.d.ts.map +1 -0
  198. package/build/project/probe.js +39 -0
  199. package/build/project/probe.js.map +1 -0
  200. package/build/project/report/types.d.ts +18 -0
  201. package/build/project/report/types.d.ts.map +1 -0
  202. package/build/project/report/types.js +2 -0
  203. package/build/project/report/types.js.map +1 -0
  204. package/build/project/report.d.ts +7 -0
  205. package/build/project/report.d.ts.map +1 -0
  206. package/build/project/report.js +68 -0
  207. package/build/project/report.js.map +1 -0
  208. package/build/project/setup/types.d.ts +32 -0
  209. package/build/project/setup/types.d.ts.map +1 -0
  210. package/build/project/setup/types.js +2 -0
  211. package/build/project/setup/types.js.map +1 -0
  212. package/build/project/setup.d.ts +4 -53
  213. package/build/project/setup.d.ts.map +1 -1
  214. package/build/project/setup.js +112 -175
  215. package/build/project/setup.js.map +1 -1
  216. package/build/project/types.d.ts +37 -0
  217. package/build/project/types.d.ts.map +1 -0
  218. package/build/project/types.js +2 -0
  219. package/build/project/types.js.map +1 -0
  220. package/build/run/consts.local.d.ts +3 -0
  221. package/build/run/consts.local.d.ts.map +1 -0
  222. package/build/run/consts.local.js +26 -0
  223. package/build/run/consts.local.js.map +1 -0
  224. package/build/run/index.d.ts +11 -69
  225. package/build/run/index.d.ts.map +1 -1
  226. package/build/run/index.js +9 -147
  227. package/build/run/index.js.map +1 -1
  228. package/build/run/local/types.d.ts +39 -0
  229. package/build/run/local/types.d.ts.map +1 -0
  230. package/build/run/local/types.js +2 -0
  231. package/build/run/local/types.js.map +1 -0
  232. package/build/run/local.d.ts +3 -0
  233. package/build/run/local.d.ts.map +1 -0
  234. package/build/run/local.js +130 -0
  235. package/build/run/local.js.map +1 -0
  236. package/build/run/process/types.d.ts +15 -0
  237. package/build/run/process/types.d.ts.map +1 -0
  238. package/build/run/process/types.js +2 -0
  239. package/build/run/process/types.js.map +1 -0
  240. package/build/run/process.d.ts +4 -0
  241. package/build/run/process.d.ts.map +1 -0
  242. package/build/run/process.js +20 -0
  243. package/build/run/process.js.map +1 -0
  244. package/build/run/serve.d.ts +14 -9
  245. package/build/run/serve.d.ts.map +1 -1
  246. package/build/run/serve.js +1 -25
  247. package/build/run/serve.js.map +1 -1
  248. package/build/run/state/types.d.ts +35 -0
  249. package/build/run/state/types.d.ts.map +1 -0
  250. package/build/run/state/types.js +2 -0
  251. package/build/run/state/types.js.map +1 -0
  252. package/build/run/state.d.ts +3 -62
  253. package/build/run/state.d.ts.map +1 -1
  254. package/build/run/state.js +96 -123
  255. package/build/run/state.js.map +1 -1
  256. package/build/run/types.d.ts +78 -0
  257. package/build/run/types.d.ts.map +1 -0
  258. package/build/run/types.js +2 -0
  259. package/build/run/types.js.map +1 -0
  260. package/build/session/consts.local.d.ts +5 -0
  261. package/build/session/consts.local.d.ts.map +1 -0
  262. package/build/session/consts.local.js +5 -0
  263. package/build/session/consts.local.js.map +1 -0
  264. package/build/session/index.d.ts +5 -10
  265. package/build/session/index.d.ts.map +1 -1
  266. package/build/session/index.js +84 -15
  267. package/build/session/index.js.map +1 -1
  268. package/build/session/questions.d.ts +16 -0
  269. package/build/session/questions.d.ts.map +1 -0
  270. package/build/session/questions.js +17 -0
  271. package/build/session/questions.js.map +1 -0
  272. package/build/session/queue.d.ts +61 -0
  273. package/build/session/queue.d.ts.map +1 -0
  274. package/build/session/queue.js +156 -0
  275. package/build/session/queue.js.map +1 -0
  276. package/build/session/tasks.d.ts +11 -30
  277. package/build/session/tasks.d.ts.map +1 -1
  278. package/build/session/tasks.js +18 -78
  279. package/build/session/tasks.js.map +1 -1
  280. package/build/session/types.d.ts +20 -0
  281. package/build/session/types.d.ts.map +1 -0
  282. package/build/session/types.js +2 -0
  283. package/build/session/types.js.map +1 -0
  284. package/build/task/consts.d.ts +12 -0
  285. package/build/task/consts.d.ts.map +1 -0
  286. package/build/task/consts.js +12 -0
  287. package/build/task/consts.js.map +1 -0
  288. package/build/task/consts.local.d.ts +19 -0
  289. package/build/task/consts.local.d.ts.map +1 -0
  290. package/build/task/consts.local.js +72 -0
  291. package/build/task/consts.local.js.map +1 -0
  292. package/build/task/driver.d.ts +1 -28
  293. package/build/task/driver.d.ts.map +1 -1
  294. package/build/task/driver.js +2 -9
  295. package/build/task/driver.js.map +1 -1
  296. package/build/task/envelope/types.d.ts +29 -0
  297. package/build/task/envelope/types.d.ts.map +1 -0
  298. package/build/task/envelope/types.js +2 -0
  299. package/build/task/envelope/types.js.map +1 -0
  300. package/build/task/envelope.d.ts +4 -34
  301. package/build/task/envelope.d.ts.map +1 -1
  302. package/build/task/envelope.js +103 -165
  303. package/build/task/envelope.js.map +1 -1
  304. package/build/task/index.d.ts +5 -0
  305. package/build/task/index.d.ts.map +1 -1
  306. package/build/task/index.js +2 -0
  307. package/build/task/index.js.map +1 -1
  308. package/build/task/inquiry/types.d.ts +38 -0
  309. package/build/task/inquiry/types.d.ts.map +1 -0
  310. package/build/task/inquiry/types.js +2 -0
  311. package/build/task/inquiry/types.js.map +1 -0
  312. package/build/task/inquiry.d.ts +5 -0
  313. package/build/task/inquiry.d.ts.map +1 -0
  314. package/build/task/inquiry.js +188 -0
  315. package/build/task/inquiry.js.map +1 -0
  316. package/build/task/types.d.ts +48 -0
  317. package/build/task/types.d.ts.map +1 -0
  318. package/build/task/types.js +2 -0
  319. package/build/task/types.js.map +1 -0
  320. package/build/tools/account/types.d.ts +24 -0
  321. package/build/tools/account/types.d.ts.map +1 -0
  322. package/build/tools/account/types.js +2 -0
  323. package/build/tools/account/types.js.map +1 -0
  324. package/build/tools/account.d.ts +4 -0
  325. package/build/tools/account.d.ts.map +1 -0
  326. package/build/tools/account.js +72 -0
  327. package/build/tools/account.js.map +1 -0
  328. package/build/tools/blueprints/types.d.ts +5 -0
  329. package/build/tools/blueprints/types.d.ts.map +1 -0
  330. package/build/tools/blueprints/types.js +2 -0
  331. package/build/tools/blueprints/types.js.map +1 -0
  332. package/build/tools/blueprints.d.ts +4 -0
  333. package/build/tools/blueprints.d.ts.map +1 -0
  334. package/build/tools/blueprints.js +23 -0
  335. package/build/tools/blueprints.js.map +1 -0
  336. package/build/tools/catalogue/types.d.ts +8 -0
  337. package/build/tools/catalogue/types.d.ts.map +1 -0
  338. package/build/tools/catalogue/types.js +2 -0
  339. package/build/tools/catalogue/types.js.map +1 -0
  340. package/build/tools/catalogue.d.ts +8 -6
  341. package/build/tools/catalogue.d.ts.map +1 -1
  342. package/build/tools/catalogue.js +2565 -213
  343. package/build/tools/catalogue.js.map +1 -1
  344. package/build/tools/config/types.d.ts +19 -0
  345. package/build/tools/config/types.d.ts.map +1 -0
  346. package/build/tools/config/types.js +2 -0
  347. package/build/tools/config/types.js.map +1 -0
  348. package/build/tools/config.d.ts +4 -0
  349. package/build/tools/config.d.ts.map +1 -0
  350. package/build/tools/config.js +42 -0
  351. package/build/tools/config.js.map +1 -0
  352. package/build/tools/consts.d.ts +61 -0
  353. package/build/tools/consts.d.ts.map +1 -0
  354. package/build/tools/consts.js +515 -0
  355. package/build/tools/consts.js.map +1 -0
  356. package/build/tools/consts.local.d.ts +131 -0
  357. package/build/tools/consts.local.d.ts.map +1 -0
  358. package/build/tools/consts.local.js +236 -0
  359. package/build/tools/consts.local.js.map +1 -0
  360. package/build/tools/control/types.d.ts +17 -0
  361. package/build/tools/control/types.d.ts.map +1 -0
  362. package/build/tools/control/types.js +2 -0
  363. package/build/tools/control/types.js.map +1 -0
  364. package/build/tools/control.d.ts +4 -0
  365. package/build/tools/control.d.ts.map +1 -0
  366. package/build/tools/control.js +44 -0
  367. package/build/tools/control.js.map +1 -0
  368. package/build/tools/feed/types.d.ts +21 -0
  369. package/build/tools/feed/types.d.ts.map +1 -0
  370. package/build/tools/feed/types.js +2 -0
  371. package/build/tools/feed/types.js.map +1 -0
  372. package/build/tools/feed.d.ts +4 -0
  373. package/build/tools/feed.d.ts.map +1 -0
  374. package/build/tools/feed.js +75 -0
  375. package/build/tools/feed.js.map +1 -0
  376. package/build/tools/git/types.d.ts +25 -0
  377. package/build/tools/git/types.d.ts.map +1 -0
  378. package/build/tools/git/types.js +2 -0
  379. package/build/tools/git/types.js.map +1 -0
  380. package/build/tools/git.d.ts +4 -0
  381. package/build/tools/git.d.ts.map +1 -0
  382. package/build/tools/git.js +83 -0
  383. package/build/tools/git.js.map +1 -0
  384. package/build/tools/handover/types.d.ts +49 -0
  385. package/build/tools/handover/types.d.ts.map +1 -0
  386. package/build/tools/handover/types.js +2 -0
  387. package/build/tools/handover/types.js.map +1 -0
  388. package/build/tools/handover.d.ts +8 -0
  389. package/build/tools/handover.d.ts.map +1 -0
  390. package/build/tools/handover.js +138 -0
  391. package/build/tools/handover.js.map +1 -0
  392. package/build/tools/host/types.d.ts +34 -0
  393. package/build/tools/host/types.d.ts.map +1 -0
  394. package/build/tools/host/types.js +2 -0
  395. package/build/tools/host/types.js.map +1 -0
  396. package/build/tools/host.d.ts +4 -0
  397. package/build/tools/host.d.ts.map +1 -0
  398. package/build/tools/host.js +13 -0
  399. package/build/tools/host.js.map +1 -0
  400. package/build/tools/iam/types.d.ts +44 -0
  401. package/build/tools/iam/types.d.ts.map +1 -0
  402. package/build/tools/iam/types.js +2 -0
  403. package/build/tools/iam/types.js.map +1 -0
  404. package/build/tools/iam.d.ts +4 -0
  405. package/build/tools/iam.d.ts.map +1 -0
  406. package/build/tools/iam.js +229 -0
  407. package/build/tools/iam.js.map +1 -0
  408. package/build/tools/index.d.ts +27 -1
  409. package/build/tools/index.d.ts.map +1 -1
  410. package/build/tools/index.js +14 -1
  411. package/build/tools/index.js.map +1 -1
  412. package/build/tools/inflight/types.d.ts +47 -0
  413. package/build/tools/inflight/types.d.ts.map +1 -0
  414. package/build/tools/inflight/types.js +2 -0
  415. package/build/tools/inflight/types.js.map +1 -0
  416. package/build/tools/inflight.d.ts +3 -0
  417. package/build/tools/inflight.d.ts.map +1 -0
  418. package/build/tools/inflight.js +88 -0
  419. package/build/tools/inflight.js.map +1 -0
  420. package/build/tools/kits/types.d.ts +12 -0
  421. package/build/tools/kits/types.d.ts.map +1 -0
  422. package/build/tools/kits/types.js +2 -0
  423. package/build/tools/kits/types.js.map +1 -0
  424. package/build/tools/kits.d.ts +4 -0
  425. package/build/tools/kits.d.ts.map +1 -0
  426. package/build/tools/kits.js +33 -0
  427. package/build/tools/kits.js.map +1 -0
  428. package/build/tools/mcp.d.ts +13 -19
  429. package/build/tools/mcp.d.ts.map +1 -1
  430. package/build/tools/mcp.js +117 -38
  431. package/build/tools/mcp.js.map +1 -1
  432. package/build/tools/platform.d.ts +14 -0
  433. package/build/tools/platform.d.ts.map +1 -0
  434. package/build/tools/platform.js +90 -0
  435. package/build/tools/platform.js.map +1 -0
  436. package/build/tools/production/types.d.ts +22 -0
  437. package/build/tools/production/types.d.ts.map +1 -0
  438. package/build/tools/production/types.js +2 -0
  439. package/build/tools/production/types.js.map +1 -0
  440. package/build/tools/production.d.ts +4 -0
  441. package/build/tools/production.d.ts.map +1 -0
  442. package/build/tools/production.js +80 -0
  443. package/build/tools/production.js.map +1 -0
  444. package/build/tools/refusal/types.d.ts +95 -0
  445. package/build/tools/refusal/types.d.ts.map +1 -0
  446. package/build/tools/refusal/types.js +2 -0
  447. package/build/tools/refusal/types.js.map +1 -0
  448. package/build/tools/refusal.d.ts +4 -0
  449. package/build/tools/refusal.d.ts.map +1 -0
  450. package/build/tools/refusal.js +663 -0
  451. package/build/tools/refusal.js.map +1 -0
  452. package/build/tools/settings/types.d.ts +42 -0
  453. package/build/tools/settings/types.d.ts.map +1 -0
  454. package/build/tools/settings/types.js +2 -0
  455. package/build/tools/settings/types.js.map +1 -0
  456. package/build/tools/settings.d.ts +4 -0
  457. package/build/tools/settings.d.ts.map +1 -0
  458. package/build/tools/settings.js +71 -0
  459. package/build/tools/settings.js.map +1 -0
  460. package/build/tools/status/types.d.ts +25 -0
  461. package/build/tools/status/types.d.ts.map +1 -0
  462. package/build/tools/status/types.js +2 -0
  463. package/build/tools/status/types.js.map +1 -0
  464. package/build/tools/status.d.ts +4 -0
  465. package/build/tools/status.d.ts.map +1 -0
  466. package/build/tools/status.js +183 -0
  467. package/build/tools/status.js.map +1 -0
  468. package/build/tools/stories/types.d.ts +48 -0
  469. package/build/tools/stories/types.d.ts.map +1 -0
  470. package/build/tools/stories/types.js +2 -0
  471. package/build/tools/stories/types.js.map +1 -0
  472. package/build/tools/stories.d.ts +8 -0
  473. package/build/tools/stories.d.ts.map +1 -0
  474. package/build/tools/stories.js +79 -0
  475. package/build/tools/stories.js.map +1 -0
  476. package/build/tools/types.d.ts +177 -26
  477. package/build/tools/types.d.ts.map +1 -1
  478. package/build/tools/types.js +1 -32
  479. package/build/tools/types.js.map +1 -1
  480. package/build/types.d.ts +391 -26
  481. package/build/types.d.ts.map +1 -1
  482. package/build/utils.d.ts +8 -0
  483. package/build/utils.d.ts.map +1 -0
  484. package/build/utils.js +12 -0
  485. package/build/utils.js.map +1 -0
  486. package/package.json +30 -34
  487. package/build/harness/index.d.ts +0 -28
  488. package/build/harness/index.d.ts.map +0 -1
  489. package/build/harness/index.js +0 -83
  490. package/build/harness/index.js.map +0 -1
  491. package/build/harness/templates.d.ts +0 -30
  492. package/build/harness/templates.d.ts.map +0 -1
  493. package/build/harness/templates.js +0 -154
  494. package/build/harness/templates.js.map +0 -1
  495. package/build/tools/jobs.d.ts +0 -12
  496. package/build/tools/jobs.d.ts.map +0 -1
  497. package/build/tools/jobs.js +0 -47
  498. package/build/tools/jobs.js.map +0 -1
@@ -1,12 +1,17 @@
1
- export interface LocalServer {
2
- listen: (port?: number, host?: string) => Promise<void>;
3
- close: () => Promise<void>;
4
- port: number;
5
- }
6
- export interface LocalServerOptions {
7
- /** Where the target's api answers. The proxy target, not something the browser ever sees. */
8
- apiPort?: number;
9
- }
1
+ import type { LocalServer, LocalServerOptions } from './types.js';
2
+ /**
3
+ * Serve the target's built browser app, and put its `/api` behind the same origin.
4
+ *
5
+ * The slot does this with an HTTPRoute in front of two processes; a local run has no edge, so the
6
+ * proxy is what replaces it. It is not a convenience: the app and its API sharing one origin is
7
+ * what the generated app's own configuration assumes, and splitting them across two loopback ports
8
+ * would put the target's CORS setup in the path of a developer's first page load.
9
+ *
10
+ * Everything else the publisher's static server does — the crawler policy, the CSP, the preview
11
+ * error reporter, the build-state header — is about a PUBLIC hostname on a domain every customer
12
+ * shares. A loopback address has no reputation to spend and no crawler to answer, so none of it is
13
+ * reproduced here.
14
+ */
10
15
  /**
11
16
  * The static server, reading its directory per request.
12
17
  *
@@ -1 +1 @@
1
- {"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../src/run/serve.ts"],"names":[],"mappings":"AAgDA,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACvD,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IAC1B,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,kBAAkB;IACjC,6FAA6F;IAC7F,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,cACjB,MAAM,MAAM,YAAW,kBAAkB,KACnD,WAiHF,CAAA"}
1
+ {"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../src/run/serve.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAEjE;;;;;;;;;;;;GAYG;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,cACjB,MAAM,MAAM,YAAW,kBAAkB,KACnD,WAiHF,CAAA"}
@@ -3,6 +3,7 @@ import fsp from 'node:fs/promises';
3
3
  import http from 'node:http';
4
4
  import path from 'node:path';
5
5
  import { TARGET_API_BASE, TARGET_API_PORT, TARGET_WEB_PORT } from '@owlmeans/viable-common';
6
+ import { MIME, PLACEHOLDER } from './consts.local.js';
6
7
  /**
7
8
  * Serve the target's built browser app, and put its `/api` behind the same origin.
8
9
  *
@@ -16,31 +17,6 @@ import { TARGET_API_BASE, TARGET_API_PORT, TARGET_WEB_PORT } from '@owlmeans/via
16
17
  * shares. A loopback address has no reputation to spend and no crawler to answer, so none of it is
17
18
  * reproduced here.
18
19
  */
19
- const MIME = {
20
- '.html': 'text/html; charset=utf-8',
21
- '.js': 'application/javascript; charset=utf-8',
22
- '.mjs': 'application/javascript; charset=utf-8',
23
- '.css': 'text/css; charset=utf-8',
24
- '.json': 'application/json; charset=utf-8',
25
- '.map': 'application/json; charset=utf-8',
26
- '.webmanifest': 'application/manifest+json',
27
- '.svg': 'image/svg+xml',
28
- '.png': 'image/png',
29
- '.jpg': 'image/jpeg',
30
- '.jpeg': 'image/jpeg',
31
- '.gif': 'image/gif',
32
- '.webp': 'image/webp',
33
- '.ico': 'image/x-icon',
34
- '.woff': 'font/woff',
35
- '.woff2': 'font/woff2',
36
- '.ttf': 'font/ttf',
37
- '.txt': 'text/plain; charset=utf-8',
38
- };
39
- const PLACEHOLDER = '<!doctype html><html lang="en"><head><meta charset="UTF-8"/>'
40
- + '<meta name="viewport" content="width=device-width, initial-scale=1.0"/>'
41
- + '<title>Not built yet</title></head><body style="font-family:sans-serif">'
42
- + '<p style="padding:2rem">This project has not been built yet. Run a build and reload.</p>'
43
- + '</body></html>';
44
20
  /**
45
21
  * The static server, reading its directory per request.
46
22
  *
@@ -1 +1 @@
1
- {"version":3,"file":"serve.js","sourceRoot":"","sources":["../../src/run/serve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAA;AACxB,OAAO,GAAG,MAAM,kBAAkB,CAAA;AAClC,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,IAAI,MAAM,WAAW,CAAA;AAE5B,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAE3F;;;;;;;;;;;;GAYG;AAEH,MAAM,IAAI,GAA2B;IACnC,OAAO,EAAE,0BAA0B;IACnC,KAAK,EAAE,uCAAuC;IAC9C,MAAM,EAAE,uCAAuC;IAC/C,MAAM,EAAE,yBAAyB;IACjC,OAAO,EAAE,iCAAiC;IAC1C,MAAM,EAAE,iCAAiC;IACzC,cAAc,EAAE,2BAA2B;IAC3C,MAAM,EAAE,eAAe;IACvB,MAAM,EAAE,WAAW;IACnB,MAAM,EAAE,YAAY;IACpB,OAAO,EAAE,YAAY;IACrB,MAAM,EAAE,WAAW;IACnB,OAAO,EAAE,YAAY;IACrB,MAAM,EAAE,cAAc;IACtB,OAAO,EAAE,WAAW;IACpB,QAAQ,EAAE,YAAY;IACtB,MAAM,EAAE,UAAU;IAClB,MAAM,EAAE,2BAA2B;CACpC,CAAA;AAED,MAAM,WAAW,GAAG,8DAA8D;MAC9E,yEAAyE;MACzE,0EAA0E;MAC1E,0FAA0F;MAC1F,gBAAgB,CAAA;AAapB;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,SAAuB,EAAE,OAAO,GAAuB,EAAE,EAC5C,EAAE;IACf,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,eAAe,CAAA;IAClD,MAAM,SAAS,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C,CAAA;gBACxB,CAAC,CAAC,CAAA;YACJ,CAAC,CAAC,CAAA;YAEF,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;gBAC1C,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;gBAC7B,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAAA;YACnD,CAAC,CAAC,CAAA;QACJ,CAAC;QAED,KAAK,EAAE,KAAK,IAAI,EAAE;YAChB,MAAM,OAAO,GAAG,MAAM,CAAA;YACtB,MAAM,GAAG,IAAI,CAAA;YACb,IAAI,OAAO,IAAI,IAAI;gBAAE,OAAM;YAE3B,MAAM,IAAI,OAAO,CAAO,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,CAAA;QACpE,CAAC;QAED,IAAI,IAAI,KAAK,OAAO,IAAI,CAAA,CAAC,CAAC;KAC3B,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,35 @@
1
+ import type { LocalProcessRecord, LocalRunRecord } from '../types.js';
2
+ /** What a local run of ONE project directory is, written down, and the children it starts. */
3
+ export interface RunStateHelper {
4
+ /** The run record of the directory, or `null` when there is none or it cannot be read. */
5
+ readRun: () => Promise<LocalRunRecord | null>;
6
+ writeRun: (record: LocalRunRecord) => Promise<void>;
7
+ clearRun: () => Promise<void>;
8
+ /**
9
+ * Start the target's HTTP server as a detached child.
10
+ *
11
+ * Detached so the whole group can be signalled later — the child is a shell wrapping `bun`, and a
12
+ * signal aimed at the shell alone leaves `bun` holding the port.
13
+ */
14
+ startApi: (env?: Record<string, string>) => Promise<LocalProcessRecord>;
15
+ /**
16
+ * Start the target's queue worker, when this tree has one.
17
+ *
18
+ * The SAME `dist/index.js` as the api, out of the same package tree — the argv marker is the only
19
+ * thing separating the two processes, which is why nothing may reclaim a port without excluding
20
+ * the other's marker. Most generated applications declare no queues, and their absence is not a
21
+ * degraded state.
22
+ */
23
+ startWorker: () => Promise<LocalProcessRecord | null>;
24
+ /**
25
+ * Bounce the api child so it reconciles the target's tables against its code.
26
+ *
27
+ * What `DbSync` means for a target that owns its own structure: every `@owlmeans/postgres`
28
+ * resource creates and updates its table while the context initializes, so there is nothing to
29
+ * generate and no migration file to apply — the sync IS the restart. A tree with no run in front
30
+ * of it answers `null`: there is no process to bounce, and reporting that as a failure would send
31
+ * a caller after a repair that does not apply.
32
+ */
33
+ restartApi: () => Promise<string | null>;
34
+ }
35
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/run/state/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAErE,8FAA8F;AAC9F,MAAM,WAAW,cAAc;IAC7B,0FAA0F;IAC1F,OAAO,EAAE,MAAM,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IAC7C,QAAQ,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACnD,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IAC7B;;;;;OAKG;IACH,QAAQ,EAAE,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAA;IACvE;;;;;;;OAOG;IACH,WAAW,EAAE,MAAM,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAA;IACrD;;;;;;;;OAQG;IACH,UAAU,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;CACzC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/run/state/types.ts"],"names":[],"mappings":""}
@@ -1,4 +1,6 @@
1
1
  import { TARGET_API_PORT, TARGET_WEB_PORT, TARGET_WORKER_PORT } from '@owlmeans/viable-common';
2
+ import type { RunStateHelper } from './state/types.js';
3
+ export { TARGET_API_PORT, TARGET_WEB_PORT, TARGET_WORKER_PORT };
2
4
  /**
3
5
  * What a local run is, written down.
4
6
  *
@@ -10,66 +12,5 @@ import { TARGET_API_PORT, TARGET_WEB_PORT, TARGET_WORKER_PORT } from '@owlmeans/
10
12
  * The record is a file rather than memory because the processes outlive the call that started
11
13
  * them and, on a restarted connector, outlive the process that started them too.
12
14
  */
13
- export interface LocalProcessRecord {
14
- pid: number;
15
- port: number;
16
- /**
17
- * The id this instance answers `/api/healtz` with.
18
- *
19
- * Port ownership is a restart's only proof: the child is a shell wrapping `bun`, so a signal
20
- * the shell dies from and `bun` survives leaves an orphan holding the port while the exit
21
- * handler says "gone". A replacement then loses the bind and exits — and since a failed
22
- * `listen` announces nothing on its own, everything keeps reporting healthy while the older
23
- * build is what is being served.
24
- */
25
- bootId?: string;
26
- }
27
- export interface LocalRunRecord {
28
- dir: string;
29
- startedAt: string;
30
- api?: LocalProcessRecord;
31
- worker?: LocalProcessRecord;
32
- /** The process serving the built browser app — this connector itself, not a child. */
33
- web?: LocalProcessRecord;
34
- }
35
- export declare const readRun: (dir: string) => Promise<LocalRunRecord | null>;
36
- export declare const writeRun: (dir: string, record: LocalRunRecord) => Promise<void>;
37
- export declare const clearRun: (dir: string) => Promise<void>;
38
- /** Whether the api recorded here is still a live process. */
39
- export declare const apiRunning: (record: LocalRunRecord | null) => boolean;
40
- /**
41
- * Start the target's HTTP server as a detached child.
42
- *
43
- * Detached so the whole group can be signalled later — the child is a shell wrapping `bun`, and a
44
- * signal aimed at the shell alone leaves `bun` holding the port.
45
- */
46
- export declare const startApi: (dir: string, env?: Record<string, string>) => Promise<LocalProcessRecord>;
47
- /**
48
- * Start the target's queue worker, when this tree has one.
49
- *
50
- * The SAME `dist/index.js` as the api, out of the same package tree — the argv marker is the only
51
- * thing separating the two processes, which is why nothing may reclaim a port without excluding
52
- * the other's marker. Most generated applications declare no queues, and their absence is not a
53
- * degraded state.
54
- */
55
- export declare const startWorker: (dir: string) => Promise<LocalProcessRecord | null>;
56
- /**
57
- * Stop a recorded process and wait for its port to actually free.
58
- *
59
- * The port and not the pid is what a replacement needs, so that is what is waited on.
60
- */
61
- export declare const stopProcess: (record: LocalProcessRecord | undefined) => Promise<void>;
62
- /**
63
- * Bounce the api child so it reconciles the target's tables against its code.
64
- *
65
- * What `DbSync` means for a target that owns its own structure: every `@owlmeans/postgres`
66
- * resource creates and updates its table while the context initializes, so there is nothing to
67
- * generate and no migration file to apply — the sync IS the restart. A tree with no run in front
68
- * of it answers `null`: there is no process to bounce, and reporting that as a failure would send
69
- * a caller after a repair that does not apply.
70
- */
71
- export declare const restartApi: (dir: string) => Promise<string | null>;
72
- /** Whether anything is answering on the api's port right now. */
73
- export declare const apiListening: (port?: number) => Promise<boolean>;
74
- export { TARGET_API_PORT, TARGET_WEB_PORT, TARGET_WORKER_PORT };
15
+ export declare const makeRunStateHelper: (dir: string) => RunStateHelper;
75
16
  //# sourceMappingURL=state.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/run/state.ts"],"names":[],"mappings":"AAKA,OAAO,EACoD,eAAe,EAAE,eAAe,EAEzF,kBAAkB,EACnB,MAAM,yBAAyB,CAAA;AAOhC;;;;;;;;;;GAUG;AAEH,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAA;IACX,SAAS,EAAE,MAAM,CAAA;IACjB,GAAG,CAAC,EAAE,kBAAkB,CAAA;IACxB,MA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E,eAAe,EAAE,eAAe,EAAE,kBAAkB,EAAE,CAAA;AAE/D;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,QAAS,MAAM,KAAG,cAkGhD,CAAA"}
@@ -3,134 +3,107 @@ import { spawn } from 'node:child_process';
3
3
  import { randomUUID } from 'node:crypto';
4
4
  import p from 'node:path';
5
5
  import { CONNECT_MARKER_DIR, CONNECT_RUN_FILE, TARGET_API_MARKER, TARGET_API_PORT, TARGET_WEB_PORT, TARGET_WORKER_MARKER, TARGET_WORKER_PORT } from '@owlmeans/viable-common';
6
- import { backendEnv } from '../executor/env.js';
7
- import { apiPath, hasWorker, workerPath } from '../executor/layout.js';
8
- import { integrityRefusal } from '../executor/integrity.js';
9
- import { isAlive, probeListening, reclaimPort, signalGroup, waitForPortFree } from '../executor/spawn.js';
10
- const runFile = (dir) => p.join(dir, CONNECT_RUN_FILE);
11
- export const readRun = async (dir) => {
12
- const content = await fs.readFile(runFile(dir), 'utf-8').catch(() => null);
13
- if (content == null)
14
- return null;
15
- try {
16
- const parsed = JSON.parse(content);
17
- return typeof parsed === 'object' && parsed !== null ? parsed : null;
18
- }
19
- catch {
20
- return null;
21
- }
22
- };
23
- export const writeRun = async (dir, record) => {
24
- await fs.ensureDir(p.join(dir, CONNECT_MARKER_DIR));
25
- await fs.writeFile(runFile(dir), `${JSON.stringify(record, null, 2)}\n`);
26
- };
27
- export const clearRun = async (dir) => {
28
- await fs.rm(runFile(dir), { force: true }).catch(() => undefined);
29
- };
30
- /** Whether the api recorded here is still a live process. */
31
- export const apiRunning = (record) => record != null && isAlive(record.api?.pid);
32
- /**
33
- * Start the target's HTTP server as a detached child.
34
- *
35
- * Detached so the whole group can be signalled later — the child is a shell wrapping `bun`, and a
36
- * signal aimed at the shell alone leaves `bun` holding the port.
37
- */
38
- export const startApi = async (dir, env = {}) => {
39
- const bootId = randomUUID();
40
- const cwd = apiPath(dir);
41
- // A run killed without a stop leaves this child alive — detaching it is what keeps it
42
- // running after the tool that started it exits. What survives holds the port, and the
43
- // replacement then loses the bind and exits without announcing it.
44
- if (!await waitForPortFree(TARGET_API_PORT, 2_000)) {
45
- await reclaimPort(TARGET_API_PORT, TARGET_API_MARKER);
46
- }
47
- const child = spawn('bun', ['dist/index.js', TARGET_API_MARKER], {
48
- cwd,
49
- detached: true,
50
- shell: true,
51
- stdio: 'ignore',
52
- env: {
53
- ...process.env,
54
- ...await backendEnv(dir),
55
- BACKEND_PORT: `${TARGET_API_PORT}`,
56
- BACKEND_BOOT_ID: bootId,
57
- ...env,
58
- },
59
- });
60
- child.unref();
61
- return { pid: child.pid ?? -1, port: TARGET_API_PORT, bootId };
62
- };
6
+ import { makeTargetEnvHelper } from '../executor/env.js';
7
+ import { makeLayoutHelper } from '../executor/layout.js';
8
+ import { integrityHelper } from '../executor/integrity.js';
9
+ import { spawnHelper } from '../executor/spawn.js';
10
+ import { runProcessHelper } from './process.js';
11
+ export { TARGET_API_PORT, TARGET_WEB_PORT, TARGET_WORKER_PORT };
63
12
  /**
64
- * Start the target's queue worker, when this tree has one.
13
+ * What a local run is, written down.
65
14
  *
66
- * The SAME `dist/index.js` as the api, out of the same package tree — the argv marker is the only
67
- * thing separating the two processes, which is why nothing may reclaim a port without excluding
68
- * the other's marker. Most generated applications declare no queues, and their absence is not a
69
- * degraded state.
70
- */
71
- export const startWorker = async (dir) => {
72
- if (!hasWorker(dir))
73
- return null;
74
- const cwd = workerPath(dir);
75
- if (cwd == null)
76
- return null;
77
- const bootId = randomUUID();
78
- const child = spawn('bun', ['dist/index.js', TARGET_WORKER_MARKER], {
79
- cwd,
80
- detached: true,
81
- shell: true,
82
- stdio: 'ignore',
83
- env: {
84
- ...process.env,
85
- ...await backendEnv(dir),
86
- // The target reads one "port I bind" variable and the worker binds its health port with it;
87
- // `WORKER_PORT` travels beside it so a worker that grew its own variable finds it.
88
- BACKEND_PORT: `${TARGET_WORKER_PORT}`,
89
- WORKER_PORT: `${TARGET_WORKER_PORT}`,
90
- BACKEND_BOOT_ID: bootId,
91
- },
92
- });
93
- child.unref();
94
- return { pid: child.pid ?? -1, port: TARGET_WORKER_PORT, bootId };
95
- };
96
- /**
97
- * Stop a recorded process and wait for its port to actually free.
15
+ * A separate module from the run itself, and the separation is load-bearing: `DbSync` has to
16
+ * bounce the api child, `DbSync` lives in the shell commands, and the shell commands are reached
17
+ * through the executor the run is built on. Everything that touches a child process therefore
18
+ * lives here, below both of them, instead of making the three import each other in a circle.
98
19
  *
99
- * The port and not the pid is what a replacement needs, so that is what is waited on.
20
+ * The record is a file rather than memory because the processes outlive the call that started
21
+ * them and, on a restarted connector, outlive the process that started them too.
100
22
  */
101
- export const stopProcess = async (record) => {
102
- if (record == null)
103
- return;
104
- if (isAlive(record.pid)) {
105
- signalGroup(record.pid, 'SIGTERM');
106
- if (!await waitForPortFree(record.port, 5_000)) {
107
- signalGroup(record.pid, 'SIGKILL');
23
+ export const makeRunStateHelper = (dir) => {
24
+ const runFile = () => p.join(dir, CONNECT_RUN_FILE);
25
+ const readRun = async () => {
26
+ const content = await fs.readFile(runFile(), 'utf-8').catch(() => null);
27
+ if (content == null)
28
+ return null;
29
+ try {
30
+ const parsed = JSON.parse(content);
31
+ return typeof parsed === 'object' && parsed !== null ? parsed : null;
108
32
  }
109
- }
110
- await waitForPortFree(record.port, 5_000);
111
- };
112
- /**
113
- * Bounce the api child so it reconciles the target's tables against its code.
114
- *
115
- * What `DbSync` means for a target that owns its own structure: every `@owlmeans/postgres`
116
- * resource creates and updates its table while the context initializes, so there is nothing to
117
- * generate and no migration file to apply — the sync IS the restart. A tree with no run in front
118
- * of it answers `null`: there is no process to bounce, and reporting that as a failure would send
119
- * a caller after a repair that does not apply.
120
- */
121
- export const restartApi = async (dir) => {
122
- const record = await readRun(dir);
123
- if (record == null || record.api == null)
33
+ catch {
34
+ return null;
35
+ }
36
+ };
37
+ const writeRun = async (record) => {
38
+ await fs.ensureDir(p.join(dir, CONNECT_MARKER_DIR));
39
+ await fs.writeFile(runFile(), `${JSON.stringify(record, null, 2)}\n`);
40
+ };
41
+ const clearRun = async () => {
42
+ await fs.rm(runFile(), { force: true }).catch(() => undefined);
43
+ };
44
+ const startApi = async (env = {}) => {
45
+ const bootId = randomUUID();
46
+ const cwd = makeLayoutHelper(dir).apiPath();
47
+ // A run killed without a stop leaves this child alive — detaching it is what keeps it
48
+ // running after the tool that started it exits. What survives holds the port, and the
49
+ // replacement then loses the bind and exits without announcing it.
50
+ if (!await spawnHelper.waitForPortFree(TARGET_API_PORT, 2_000)) {
51
+ await spawnHelper.reclaimPort(TARGET_API_PORT, TARGET_API_MARKER);
52
+ }
53
+ const child = spawn('bun', ['dist/index.js', TARGET_API_MARKER], {
54
+ cwd,
55
+ detached: true,
56
+ shell: true,
57
+ stdio: 'ignore',
58
+ env: {
59
+ ...process.env,
60
+ ...await makeTargetEnvHelper(dir).backendEnv(),
61
+ BACKEND_PORT: `${TARGET_API_PORT}`,
62
+ BACKEND_BOOT_ID: bootId,
63
+ ...env,
64
+ },
65
+ });
66
+ child.unref();
67
+ return { pid: child.pid ?? -1, port: TARGET_API_PORT, bootId };
68
+ };
69
+ const startWorker = async () => {
70
+ const layout = makeLayoutHelper(dir);
71
+ if (!layout.hasWorker())
72
+ return null;
73
+ const cwd = layout.workerPath();
74
+ if (cwd == null)
75
+ return null;
76
+ const bootId = randomUUID();
77
+ const child = spawn('bun', ['dist/index.js', TARGET_WORKER_MARKER], {
78
+ cwd,
79
+ detached: true,
80
+ shell: true,
81
+ stdio: 'ignore',
82
+ env: {
83
+ ...process.env,
84
+ ...await makeTargetEnvHelper(dir).backendEnv(),
85
+ // The target reads one "port I bind" variable and the worker binds its health port with it;
86
+ // `WORKER_PORT` travels beside it so a worker that grew its own variable finds it.
87
+ BACKEND_PORT: `${TARGET_WORKER_PORT}`,
88
+ WORKER_PORT: `${TARGET_WORKER_PORT}`,
89
+ BACKEND_BOOT_ID: bootId,
90
+ },
91
+ });
92
+ child.unref();
93
+ return { pid: child.pid ?? -1, port: TARGET_WORKER_PORT, bootId };
94
+ };
95
+ const restartApi = async () => {
96
+ const record = await readRun();
97
+ if (record == null || record.api == null)
98
+ return null;
99
+ const refused = await integrityHelper.integrityRefusal(dir, 'Refused to restart');
100
+ if (refused != null)
101
+ return refused;
102
+ await runProcessHelper.stopProcess(record.api);
103
+ const api = await startApi();
104
+ await writeRun({ ...record, api });
124
105
  return null;
125
- const refused = await integrityRefusal(dir, 'Refused to restart');
126
- if (refused != null)
127
- return refused;
128
- await stopProcess(record.api);
129
- const api = await startApi(dir);
130
- await writeRun(dir, { ...record, api });
131
- return null;
106
+ };
107
+ return { readRun, writeRun, clearRun, startApi, startWorker, restartApi };
132
108
  };
133
- /** Whether anything is answering on the api's port right now. */
134
- export const apiListening = async (port = TARGET_API_PORT) => await probeListening(port);
135
- export { TARGET_API_PORT, TARGET_WEB_PORT, TARGET_WORKER_PORT };
136
109
  //# sourceMappingURL=state.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"state.js","sourceRoot":"","sources":["../../src/run/state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,UAAU,CAAA;AACzB,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,CAAC,MAAM,WAAW,CAAA;AAEzB,OAAO,EACL,kBAAkB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,eAAe,EAAE,eAAe,EACzF,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,yBAAyB,CAAA;AAEhC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,sBAAsB,CA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AAO,IAAI,IAAI;YAAE,OAAO,OAAO,CAAA;QAEnC,MAAM,gBAAgB,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QAC9C,MAAM,GAAG,GAAG,MAAM,QAAQ,EAAE,CAAA;QAC5B,MAAM,QAAQ,CAAC,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,CAAC,CAAA;QAElC,OAAO,IAAI,CAAA;IACb,CAAC,CAAA;IAED,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,CAAA;AAC3E,CAAC,CAAA"}
@@ -0,0 +1,78 @@
1
+ export interface RunLocalOptions {
2
+ /** Build before starting. On by default — starting a stale `dist/` is the confusing failure. */
3
+ build?: boolean;
4
+ log?: (line: string) => void;
5
+ }
6
+ export interface LocalProcessRecord {
7
+ pid: number;
8
+ port: number;
9
+ /**
10
+ * The id this instance answers `/api/healtz` with.
11
+ *
12
+ * Port ownership is a restart's only proof: the child is a shell wrapping `bun`, so a signal
13
+ * the shell dies from and `bun` survives leaves an orphan holding the port while the exit
14
+ * handler says "gone". A replacement then loses the bind and exits — and since a failed
15
+ * `listen` announces nothing on its own, everything keeps reporting healthy while the older
16
+ * build is what is being served.
17
+ */
18
+ bootId?: string;
19
+ }
20
+ export interface LocalRunRecord {
21
+ dir: string;
22
+ startedAt: string;
23
+ api?: LocalProcessRecord;
24
+ worker?: LocalProcessRecord;
25
+ /** The process serving the built browser app — this connector itself, not a child. */
26
+ web?: LocalProcessRecord;
27
+ }
28
+ export interface RunLocalResult {
29
+ record: LocalRunRecord | null;
30
+ /**
31
+ * The ports the run uses, so a caller can print an address without composing one.
32
+ *
33
+ * Stated even when a process did not come up: they are where the app WILL answer, and whether
34
+ * it does yet is what `error`, `buildError` and `localStatus` are for.
35
+ */
36
+ api: number;
37
+ web: number;
38
+ worker?: number;
39
+ /** The reason nothing was started, or the tree was refused. */
40
+ error?: string;
41
+ /** A build ran and failed. The web server still comes up so the state is visible. */
42
+ buildError?: string;
43
+ }
44
+ /** One supervised process, as a status read finds it. */
45
+ export interface LocalProcessStatus {
46
+ pid: number;
47
+ port: number;
48
+ alive: boolean;
49
+ }
50
+ export interface LocalRunStatus {
51
+ running: boolean;
52
+ startedAt?: string;
53
+ /** Ports, flat, for a caller composing an address or a one-line report. */
54
+ api?: number;
55
+ worker?: number;
56
+ web?: number;
57
+ /** The target's own boot phase, when it got far enough to report one. */
58
+ phase?: string;
59
+ /** Whether the target says it is serving — never the same question as "the pid is alive". */
60
+ ready?: boolean;
61
+ /** Why it is not ready. Absent when it is. */
62
+ reason?: string;
63
+ processes: {
64
+ api?: LocalProcessStatus;
65
+ worker?: LocalProcessStatus;
66
+ web?: LocalProcessStatus;
67
+ };
68
+ }
69
+ export interface LocalServer {
70
+ listen: (port?: number, host?: string) => Promise<void>;
71
+ close: () => Promise<void>;
72
+ port: number;
73
+ }
74
+ export interface LocalServerOptions {
75
+ /** Where the target's api answers. The proxy target, not something the browser ever sees. */
76
+ apiPort?: number;
77
+ }
78
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/run/types.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,eAAe;IAC9B,gGAAgG;IAChG,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CAC7B;AAED,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAA;IACX,SAAS,EAAE,MAAM,CAAA;IACjB,GAAG,CAAC,EAAE,kBAAkB,CAAA;IACxB,MAAM,CAAC,EAAE,kBAAkB,CAAA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AAW,kBAAkB;IACjC,6FAA6F;IAC7F,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/run/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ /** A pull that came back empty faster than this held nothing open. */
2
+ export declare const FAST_PULL_MS = 1000;
3
+ /** How long the pull loop rests after such a pull before asking again. */
4
+ export declare const EMPTY_PULL_PAUSE_MS = 1500;
5
+ //# sourceMappingURL=consts.local.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.local.d.ts","sourceRoot":"","sources":["../../src/session/consts.local.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,eAAO,MAAM,YAAY,OAAQ,CAAA;AAEjC,0EAA0E;AAC1E,eAAO,MAAM,mBAAmB,OAAQ,CAAA"}
@@ -0,0 +1,5 @@
1
+ /** A pull that came back empty faster than this held nothing open. */
2
+ export const FAST_PULL_MS = 1_000;
3
+ /** How long the pull loop rests after such a pull before asking again. */
4
+ export const EMPTY_PULL_PAUSE_MS = 1_500;
5
+ //# sourceMappingURL=consts.local.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.local.js","sourceRoot":"","sources":["../../src/session/consts.local.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,CAAA;AAEjC,0EAA0E;AAC1E,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,CAAA"}
@@ -1,15 +1,10 @@
1
1
  import { ConnectSessionStatus } from '@owlmeans/viable-common';
2
- import type { ConnectorApi, LocalExecutor, OpenSessionArgs, SessionRuntime } from '../types.js';
3
- export interface SessionOptions {
4
- api: ConnectorApi;
5
- open: OpenSessionArgs;
6
- /** Absent for a cloud target: the platform's own pod executes its commands. */
7
- executor?: LocalExecutor;
8
- /** Which deployment this is, recorded in the project's marker so a later connector finds it. */
9
- apiUrl?: string;
10
- log?: (line: string) => void;
11
- }
2
+ import type { SessionRuntime } from '../types.js';
3
+ import type { SessionOptions } from './types.js';
12
4
  export declare const openSession: (opts: SessionOptions) => Promise<SessionRuntime>;
13
5
  export { ConnectSessionStatus };
6
+ export * from './queue.js';
14
7
  export * from './tasks.js';
8
+ export * from './questions.js';
9
+ export type { SessionOptions } from './types.js';
15
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/session/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAC8B,oBAAoB,EACxD,MAAM,yBAAyB,CAAA;AAKhC,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,cAAc,EAAgB,MAAM,aAAa,CAAA;AAK7G,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,YAAY,CAAA;IACjB,IAAI,EAAE,eAAe,CAAA;IACrB,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,aAAa,CAAA;IACxB,gGAAgG;IAChG,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CAC7B;AAgDD,eAAO,MAAM,WAAW,SAAgB,cAAc,KAAG,OAAO,CAAC,cAAc,CAkJ9E,CAAA;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAA;AAC/B,cAAc,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/session/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,oBAAoB,EAAsJ,MAAM,yBAAyB,CAAA;AAErP,OAAO,KAAK,EAAiB,cAAc,EAAgB,MAAM,aAAa,CAAA;AAK9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAoDhD,eAAO,MAAM,WAAW,SAAgB,cAAc,KAAG,OAAO,CAAC,cAAc,CAuN9E,CAAA;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA;AAE9B,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA"}