@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 +1 @@
1
- {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/project/env.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAKjG;;;;;;;;GAQG;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,UAAoD,CAAA;AAOlF,MAAM,WAAW,SAAS;IACxB,6DAA6D;IAC7D,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;IAC7C,kFAAkF;IAClF,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC/B;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,YAAa,MAAM,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAkB/D,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,aAAa,SAAS,CAAA;AAEnC;;;;;GAKG;AACH,eAAO,MAAM,UAAU,QAAS,MAAM,KAAG,MACyC,CAAA;AAElF,qFAAqF;AACrF,eAAO,MAAM,YAAY,QAAS,MAAM,KAAG,MAAM,EAAsC,CAAA;AAEvF,gEAAgE;AAChE,eAAO,MAAM,WAAW,QAAe,MAAM,QAAQ,MAAM,KAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAI3F,CAAA;AAED,6CAA6C;AAC7C,eAAO,MAAM,OAAO,QAAe,MAAM,KAAG,OAAO,CAAC,SAAS,CAU5D,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,QAAe,MAAM,WAAW,gBAAgB,KAAG,OAAO,CAAC,eAAe,CAqB9F,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,QACf,MAAM,UAAS,KAAK,CAAC,MAAM,eAAe,CAAC,KAC/C,OAAO,CAAC,eAAe,CAQzB,CAAA;AAED,6FAA6F;AAC7F,eAAO,MAAM,mBAAmB,aAAc,MAAM,KAAG,MAStD,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,WAAW,aAAc,MAAM,WAAW,MAAM,KAAG,MAU/D,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,aAAc,MAAM,WAAW,MAAM,KAAG,MAevE,CAAA;AAoBD;;;;;GAKG;AACH,eAAO,MAAM,eAAe,QAAS,MAAM,GAAG,SAAS,KAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,IAc1F,CAAA;AAED,oGAAoG;AACpG,eAAO,MAAM,QAAQ,QAAe,MAAM,GAAG,SAAS,KAAG,OAAO,CAAC,OAAO,CAIvE,CAAA;AAED,eAAO,MAAM,SAAS,SACd,MAAM,QAAQ,MAAM,yBACzB,OAAO,CAAC,OAAO,CAWhB,CAAA"}
1
+ {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/project/env.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAEtD;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,QAAS,MAAM,KAAG,gBAiFlD,CAAA"}
@@ -1,9 +1,11 @@
1
1
  import fs from 'fs-extra';
2
- import net from 'node:net';
3
2
  import p from 'node:path';
4
- import { CONNECT_ENV_BEGIN, CONNECT_ENV_END, SubProject } from '@owlmeans/viable-common';
3
+ import { SubProject } from '@owlmeans/viable-common';
5
4
  import { confineToProject } from '../executor/files.js';
6
- import { subprojectDir, targetPaths } from '../executor/layout.js';
5
+ import { makeLayoutHelper } from '../executor/layout.js';
6
+ import { REQUIRED_ENV_KEYS, ROOT_ENV_FILE } from './consts.js';
7
+ import { dotenvHelper } from './dotenv.js';
8
+ import { probeHelper } from './probe.js';
7
9
  /**
8
10
  * The target's `.env` files — the one thing about a local project the platform does not own.
9
11
  *
@@ -13,221 +15,67 @@ import { subprojectDir, targetPaths } from '../executor/layout.js';
13
15
  * they added. So a configure push rewrites only what it wrote last time — the block between the
14
16
  * two markers — and every line outside it survives untouched.
15
17
  */
16
- /**
17
- * Keys the target cannot authenticate without.
18
- *
19
- * Reported exactly like the publisher's `ConfigureAck.missing`: a key with an EMPTY value counts
20
- * as MISSING, because a push that ran before a secret existed leaves one behind, and a target
21
- * holding `OIDC_CLIENT=''` is a target whose users can never sign in — with nothing anywhere
22
- * saying so.
23
- */
24
- export const REQUIRED_ENV_KEYS = ['OIDC_ISSUER_URL', 'OIDC_CLIENT', 'OIDC_SECRET'];
25
- /** How long a service probe waits before calling a port unreachable. */
26
- const PROBE_TIMEOUT_MS = 1_500;
27
- const DEFAULT_PORTS = { postgres: 5432, postgresql: 5432, redis: 6379, rediss: 6379, valkey: 6379 };
28
- /**
29
- * Parse a `.env` body.
30
- *
31
- * Deliberately small: `KEY=value`, an optional `export ` prefix, `#` comments, and one level of
32
- * quoting. A dotenv library would add a dependency for a format the platform itself writes, and
33
- * anything it understands that this does not is something the target's own runtime would have to
34
- * understand too.
35
- */
36
- export const parseEnv = (content) => {
37
- const values = {};
38
- for (const raw of content.split('\n')) {
39
- const line = raw.trim();
40
- if (line === '' || line.startsWith('#'))
41
- continue;
42
- const match = /^(?:export\s+)?([A-Za-z_][A-Za-z0-9_]*)\s*=\s*(.*)$/.exec(line);
43
- if (match == null)
44
- continue;
45
- let value = match[2].trim();
46
- if ((value.startsWith('"') && value.endsWith('"') && value.length > 1)
47
- || (value.startsWith("'") && value.endsWith("'") && value.length > 1)) {
48
- value = value.slice(1, -1);
49
- }
50
- values[match[1]] = value;
51
- }
52
- return values;
53
- };
54
- /**
55
- * The api's and the worker's environment — the process side of the target.
56
- *
57
- * Everything a server may hold lives here and nowhere else: the database URL, the queue URL, the
58
- * OIDC secret.
59
- */
60
- export const ROOT_ENV_FILE = '.env';
61
- /**
62
- * The browser bundle's environment.
63
- *
64
- * A SEPARATE file, and the separation is the whole leak boundary: whatever is in it gets compiled
65
- * into a bundle anybody can read, so nothing may reach it by merging in the server's file.
66
- */
67
- export const webEnvFile = (dir) => `${targetPaths(dir).dir}/${subprojectDir(dir, SubProject.Web)}/${ROOT_ENV_FILE}`;
68
- /** The env files a target has, in the order a later one overrides an earlier one. */
69
- export const envFilePaths = (dir) => [ROOT_ENV_FILE, webEnvFile(dir)];
70
- /** One env file's values; `{}` for a file that is not there. */
71
- export const readEnvFile = async (dir, file) => {
72
- const content = await fs.readFile(confineToProject(dir, file), 'utf-8').catch(() => null);
73
- return content == null ? {} : parseEnv(content);
74
- };
75
- /** Every env file the target has, parsed. */
76
- export const readEnv = async (dir) => {
77
- const files = {};
78
- let values = {};
79
- for (const file of envFilePaths(dir)) {
80
- const parsed = await readEnvFile(dir, file);
81
- files[file] = parsed;
82
- values = { ...values, ...parsed };
83
- }
84
- return { files, values };
85
- };
86
- /**
87
- * Write the platform's block into each named file, keeping every line the user wrote.
88
- *
89
- * The block is delimited rather than diffed because the two writers have no other way to agree on
90
- * ownership: the platform composes its half whole (it is the only side that knows the OIDC client
91
- * and its secret) and the user's half is arbitrary. A file with no block yet gets one appended; a
92
- * file that does not exist is created with the block as its whole content.
93
- */
94
- export const writeEnv = async (dir, payload) => {
95
- const written = [];
96
- for (const file of payload.files ?? []) {
97
- const path = confineToProject(dir, file.path);
98
- const existing = await fs.readFile(path, 'utf-8').catch(() => '');
99
- const next = replaceManagedBlock(existing, yieldToUser(existing, file.content ?? ''));
100
- if (next !== existing) {
101
- await fs.ensureDir(p.dirname(path));
102
- await fs.writeFile(path, next);
18
+ export const makeProjectEnvHelper = (dir) => {
19
+ const webEnvFile = () => {
20
+ const layout = makeLayoutHelper(dir);
21
+ return `${layout.targetPaths().dir}/${layout.subprojectDir(SubProject.Web)}/${ROOT_ENV_FILE}`;
22
+ };
23
+ const envFilePaths = () => [ROOT_ENV_FILE, webEnvFile()];
24
+ const readEnvFile = async (file) => {
25
+ const content = await fs.readFile(confineToProject(dir, file), 'utf-8').catch(() => null);
26
+ return content == null ? {} : dotenvHelper.parseEnv(content);
27
+ };
28
+ const readEnv = async () => {
29
+ const files = {};
30
+ let values = {};
31
+ for (const file of envFilePaths()) {
32
+ const parsed = await readEnvFile(file);
33
+ files[file] = parsed;
34
+ values = { ...values, ...parsed };
103
35
  }
104
- written.push(file.path);
105
- }
106
- const { values } = await readEnv(dir);
107
- return {
108
- written,
109
- missing: REQUIRED_ENV_KEYS.filter(key => (values[key] ?? '') === ''),
110
- services: await probeServices(values, payload.probe),
36
+ return { files, values };
111
37
  };
112
- };
113
- /**
114
- * The same verdict a configure push answers with, without writing anything.
115
- *
116
- * A connector needs it before it asks the platform for work — a run that needs a database and a
117
- * target that has none is a job that will block, and saying so up front is cheaper than finding
118
- * out from a boot check.
119
- */
120
- export const envStatus = async (dir, probe = ['db', 'valkey']) => {
121
- const { values } = await readEnv(dir);
122
- return {
123
- written: [],
124
- missing: REQUIRED_ENV_KEYS.filter(key => (values[key] ?? '') === ''),
125
- services: await probeServices(values, probe),
38
+ /**
39
+ * What this machine actually provides.
40
+ *
41
+ * Reported, never assumed — the platform provisions nothing here, so the only honest answer comes
42
+ * from a connect attempt. A service the caller did not ask about stays `false` rather than
43
+ * becoming an unrequested round trip.
44
+ */
45
+ const probeServices = async (values, probe) => {
46
+ const wanted = new Set(probe ?? []);
47
+ return {
48
+ db: wanted.has('db') ? await probeHelper.probeUrl(values.DATABASE_URL) : false,
49
+ valkey: wanted.has('valkey') ? await probeHelper.probeUrl(values.VALKEY_URL) : false,
50
+ };
126
51
  };
127
- };
128
- /** The file with the platform's block cut out — everything the user wrote, and only that. */
129
- export const outsideManagedBlock = (existing) => {
130
- const begin = existing.indexOf(CONNECT_ENV_BEGIN);
131
- if (begin < 0)
132
- return existing;
133
- const end = existing.indexOf(CONNECT_ENV_END, begin);
134
- return end < 0
135
- ? existing.slice(0, begin)
136
- : `${existing.slice(0, begin)}${existing.slice(end + CONNECT_ENV_END.length)}`;
137
- };
138
- /**
139
- * Stand down from every key the user has assigned themselves.
140
- *
141
- * "Everything outside the block is yours" has to be true of the VALUES, not only of the lines. A
142
- * `.env` gives the last assignment of a key, and the block is appended, so a platform line silently
143
- * outranked whatever the user wrote above it — `DATABASE_URL` included, which is the one value the
144
- * platform cannot supply and the setup guide tells people to write themselves. The result was an
145
- * application connecting to the placeholder no matter what its owner put in the file.
146
- *
147
- * A yielded key is replaced by a comment rather than dropped, so the file says why the platform is
148
- * not setting something it normally would.
149
- */
150
- export const yieldToUser = (existing, content) => {
151
- const theirs = parseEnv(outsideManagedBlock(existing));
152
- if (Object.keys(theirs).length < 1)
153
- return content;
154
- return content.split('\n').map(raw => {
155
- const match = /^(?:export\s+)?([A-Za-z_][A-Za-z0-9_]*)\s*=/.exec(raw.trim());
156
- if (match == null || !(match[1] in theirs))
157
- return raw;
158
- return `# ${match[1]} is set in your own lines, so this block leaves it to you.`;
159
- }).join('\n');
160
- };
161
- /**
162
- * Replace what sits between the markers, and nothing else.
163
- *
164
- * A BEGIN with no END — a file truncated mid-write, or hand-edited — is rewritten to the end of
165
- * the file rather than left alone: the alternative is a block that grows a second copy of itself
166
- * on every push, and the text after a lost END was the platform's anyway.
167
- */
168
- export const replaceManagedBlock = (existing, content) => {
169
- const body = content.replace(/^\n+|\n+$/g, '');
170
- const block = `${CONNECT_ENV_BEGIN}\n${body === '' ? '' : `${body}\n`}${CONNECT_ENV_END}\n`;
171
- const begin = existing.indexOf(CONNECT_ENV_BEGIN);
172
- if (begin < 0) {
173
- const prefix = existing === '' || existing.endsWith('\n') ? existing : `${existing}\n`;
174
- return `${prefix}${block}`;
175
- }
176
- const end = existing.indexOf(CONNECT_ENV_END, begin);
177
- const after = end < 0 ? existing.length : end + CONNECT_ENV_END.length;
178
- return `${existing.slice(0, begin)}${block}${existing.slice(after).replace(/^\n/, '')}`;
179
- };
180
- /**
181
- * What this machine actually provides.
182
- *
183
- * Reported, never assumed — the platform provisions nothing here, so the only honest answer comes
184
- * from a connect attempt. A service the caller did not ask about stays `false` rather than
185
- * becoming an unrequested round trip.
186
- */
187
- const probeServices = async (values, probe) => {
188
- const wanted = new Set(probe ?? []);
189
- return {
190
- db: wanted.has('db') ? await probeUrl(values.DATABASE_URL) : false,
191
- valkey: wanted.has('valkey') ? await probeUrl(values.VALKEY_URL) : false,
52
+ const writeEnv = async (payload) => {
53
+ const written = [];
54
+ for (const file of payload.files ?? []) {
55
+ const path = confineToProject(dir, file.path);
56
+ const existing = await fs.readFile(path, 'utf-8').catch(() => '');
57
+ const next = dotenvHelper.replaceManagedBlock(existing, dotenvHelper.yieldToUser(existing, file.content ?? ''));
58
+ if (next !== existing) {
59
+ await fs.ensureDir(p.dirname(path));
60
+ await fs.writeFile(path, next);
61
+ }
62
+ written.push(file.path);
63
+ }
64
+ const { values } = await readEnv();
65
+ return {
66
+ written,
67
+ missing: REQUIRED_ENV_KEYS.filter(key => (values[key] ?? '') === ''),
68
+ services: await probeServices(values, payload.probe),
69
+ };
192
70
  };
193
- };
194
- /**
195
- * The host and port a connection URL names.
196
- *
197
- * `null` for anything unparseable, so a malformed value degrades to "not reachable" rather than
198
- * throwing somewhere a caller has no branch for it.
199
- */
200
- export const serviceEndpoint = (url) => {
201
- if (url == null || url === '')
202
- return null;
203
- try {
204
- const parsed = new URL(url);
205
- const port = parsed.port !== ''
206
- ? parseInt(parsed.port)
207
- : DEFAULT_PORTS[parsed.protocol.replace(':', '')];
208
- if (parsed.hostname === '' || port == null || Number.isNaN(port))
209
- return null;
210
- return { host: parsed.hostname, port };
211
- }
212
- catch {
213
- return null;
214
- }
215
- };
216
- /** Whether something is listening where a connection string points. Exported for the setup flow. */
217
- export const probeUrl = async (url) => {
218
- const endpoint = serviceEndpoint(url);
219
- return endpoint == null ? false : await probePort(endpoint.host, endpoint.port);
220
- };
221
- export const probePort = async (host, port, timeoutMs = PROBE_TIMEOUT_MS) => await new Promise(resolve => {
222
- const socket = net.connect({ host, port });
223
- const done = (value) => {
224
- socket.removeAllListeners();
225
- socket.destroy();
226
- resolve(value);
71
+ const envStatus = async (probe = ['db', 'valkey']) => {
72
+ const { values } = await readEnv();
73
+ return {
74
+ written: [],
75
+ missing: REQUIRED_ENV_KEYS.filter(key => (values[key] ?? '') === ''),
76
+ services: await probeServices(values, probe),
77
+ };
227
78
  };
228
- socket.setTimeout(timeoutMs);
229
- socket.once('connect', () => done(true));
230
- socket.once('timeout', () => done(false));
231
- socket.once('error', () => done(false));
232
- });
79
+ return { webEnvFile, envFilePaths, readEnvFile, readEnv, writeEnv, envStatus };
80
+ };
233
81
  //# sourceMappingURL=env.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"env.js","sourceRoot":"","sources":["../../src/project/env.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,UAAU,CAAA;AACzB,OAAO,GAAG,MAAM,UAAU,CAAA;AAC1B,OAAO,CAAC,MAAM,WAAW,CAAA;AAEzB,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAGxF,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAElE;;;;;;;;GAQG;AAEH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,iBAAiB,EAAE,aAAa,EAAE,aAAa,CAAC,CAAA;AAElF,wEAAwE;AACxE,MAAM,gBAAgB,GAAG,KAAK,CAAA;AAE9B,MAAM,aAAa,GAA2B,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAA;AAS3H;;;;;;;GAOG;AAC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AA"}
@@ -0,0 +1,33 @@
1
+ import type { ConnectMarker } from '@owlmeans/viable-common';
2
+ import type { DiscoveredProject } from '../types.js';
3
+ /**
4
+ * What a local project keeps so a later session knows which platform project it is — read and
5
+ * written for ONE directory.
6
+ *
7
+ * No secrets: an id, a slug and the API it belongs to. A connector attaching to a directory has
8
+ * nothing else to go on — the tree itself is a generated application like any other, and asking
9
+ * the platform "which of my projects is this" needs an id the tree already carries.
10
+ */
11
+ export interface MarkerHelper {
12
+ /** The marker this directory carries, or `null` when it carries none or an unreadable one. */
13
+ readMarker: () => Promise<ConnectMarker | null>;
14
+ writeMarker: (marker: ConnectMarker) => Promise<void>;
15
+ /**
16
+ * Find the project this directory belongs to, by walking up from it.
17
+ *
18
+ * An agent is started wherever its user happened to be — usually several levels inside the tree —
19
+ * and every tool that acts on "this project" has to mean the same one whichever of those
20
+ * directories it was asked from. The walk stops at the filesystem root; a machine with no marker
21
+ * anywhere above answers `null`, which is how a connector knows to offer attaching rather than
22
+ * assuming.
23
+ */
24
+ discoverProject: () => Promise<DiscoveredProject | null>;
25
+ /**
26
+ * Whether this directory holds the generated application.
27
+ *
28
+ * Asked before a connector offers to drive a directory, so a person who pointed it at the wrong
29
+ * folder learns that from a sentence rather than from a build that refuses everything.
30
+ */
31
+ isViableTree: () => Promise<boolean>;
32
+ }
33
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/project/marker/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAEpD;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IAC3B,8FAA8F;IAC9F,UAAU,EAAE,MAAM,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAA;IAC/C,WAAW,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACrD;;;;;;;;OAQG;IACH,eAAe,EAAE,MAAM,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAA;IACxD;;;;;OAKG;IACH,YAAY,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;CACrC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/project/marker/types.ts"],"names":[],"mappings":""}
@@ -1,4 +1,5 @@
1
- import type { ConnectMarker } from '@owlmeans/viable-common';
1
+ import type { DiscoveredProject } from './types.js';
2
+ import type { MarkerHelper } from './marker/types.js';
2
3
  /**
3
4
  * What a local project keeps so a later session knows which platform project it is.
4
5
  *
@@ -6,29 +7,7 @@ import type { ConnectMarker } from '@owlmeans/viable-common';
6
7
  * nothing else to go on — the tree itself is a generated application like any other, and asking
7
8
  * the platform "which of my projects is this" needs an id the tree already carries.
8
9
  */
9
- export interface DiscoveredProject {
10
- /** The directory holding `.viable/connect.json` — the project root, not where the search began. */
11
- dir: string;
12
- marker: ConnectMarker;
13
- }
14
- /** The marker this directory carries, or `null` when it carries none or an unreadable one. */
15
- export declare const readMarker: (dir: string) => Promise<ConnectMarker | null>;
16
- export declare const writeMarker: (dir: string, marker: ConnectMarker) => Promise<void>;
17
- /**
18
- * Find the project a directory belongs to, by walking up.
19
- *
20
- * An agent is started wherever its user happened to be — usually several levels inside the tree —
21
- * and every tool that acts on "this project" has to mean the same one whichever of those
22
- * directories it was asked from. The walk stops at the filesystem root; a machine with no marker
23
- * anywhere above answers `null`, which is how a connector knows to offer attaching rather than
24
- * assuming.
25
- */
10
+ export declare const makeMarkerHelper: (dir: string) => MarkerHelper;
11
+ /** @deprecated compat:factory-refactor — use `makeMarkerHelper(startDir).discoverProject()` */
26
12
  export declare const discoverProject: (startDir: string) => Promise<DiscoveredProject | null>;
27
- /**
28
- * Whether this directory holds the generated application.
29
- *
30
- * Asked before a connector offers to drive a directory, so a person who pointed it at the wrong
31
- * folder learns that from a sentence rather than from a build that refuses everything.
32
- */
33
- export declare const isViableTree: (dir: string) => Promise<boolean>;
34
13
  //# sourceMappingURL=marker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"marker.d.ts","sourceRoot":"","sources":["../../src/project/marker.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAI5D;;;;;;GAMG;AAEH,MAAM,WAAW,iBAAiB;IAChC,mGAAmG;IACnG,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,aAAa,CAAA;CACtB;AAED,8FAA8F;AAC9F,eAAO,MAAM,UAAU,QAAe,MAAM,KAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAa1E,CAAA;AAED,eAAO,MAAM,WAAW,QAAe,MAAM,UAAU,aAAa,KAAG,OAAO,CAAC,IAAI,CAKlF,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,aAAoB,MAAM,KAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAcxF,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,YAAY,QAAe,MAAM,KAAG,OAAO,CAAC,OAAO,CAClC,CAAA"}
1
+ {"version":3,"file":"marker.d.ts","sourceRoot":"","sources":["../../src/project/marker.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,QAAS,MAAM,KAAG,YA6C9C,CAAA;AAED,+FAA+F;AAC/F,eAAO,MAAM,eAAe,aAAoB,MAAM,KAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CACrC,CAAA"}
@@ -1,54 +1,51 @@
1
1
  import fs from 'fs-extra';
2
2
  import p from 'node:path';
3
3
  import { CONNECT_MARKER_DIR, CONNECT_MARKER_FILE } from '@owlmeans/viable-common';
4
- import { verifyTarget } from '../executor/integrity.js';
5
- /** The marker this directory carries, or `null` when it carries none or an unreadable one. */
6
- export const readMarker = async (dir) => {
7
- const content = await fs.readFile(p.join(dir, CONNECT_MARKER_FILE), 'utf-8').catch(() => null);
8
- if (content == null)
9
- return null;
10
- try {
11
- const parsed = JSON.parse(content);
12
- return typeof parsed === 'object' && parsed !== null ? parsed : null;
13
- }
14
- catch {
15
- // A half-written or hand-edited marker is the same as none: the connector re-attaches by
16
- // slug and writes a fresh one, which is strictly better than refusing to open the project.
17
- return null;
18
- }
19
- };
20
- export const writeMarker = async (dir, marker) => {
21
- await fs.ensureDir(p.join(dir, CONNECT_MARKER_DIR));
22
- await fs.writeFile(p.join(dir, CONNECT_MARKER_FILE), `${JSON.stringify(marker, null, 2)}\n`);
23
- };
4
+ import { integrityHelper } from '../executor/integrity.js';
24
5
  /**
25
- * Find the project a directory belongs to, by walking up.
6
+ * What a local project keeps so a later session knows which platform project it is.
26
7
  *
27
- * An agent is started wherever its user happened to be — usually several levels inside the tree —
28
- * and every tool that acts on "this project" has to mean the same one whichever of those
29
- * directories it was asked from. The walk stops at the filesystem root; a machine with no marker
30
- * anywhere above answers `null`, which is how a connector knows to offer attaching rather than
31
- * assuming.
8
+ * No secrets: an id, a slug and the API it belongs to. A connector attaching to a directory has
9
+ * nothing else to go on — the tree itself is a generated application like any other, and asking
10
+ * the platform "which of my projects is this" needs an id the tree already carries.
32
11
  */
33
- export const discoverProject = async (startDir) => {
34
- let dir = p.resolve(startDir);
35
- for (;;) {
36
- const marker = await readMarker(dir);
37
- if (marker != null) {
38
- return { dir, marker };
12
+ export const makeMarkerHelper = (dir) => {
13
+ const markerAt = async (at) => {
14
+ const content = await fs.readFile(p.join(at, CONNECT_MARKER_FILE), 'utf-8').catch(() => null);
15
+ if (content == null)
16
+ return null;
17
+ try {
18
+ const parsed = JSON.parse(content);
19
+ return typeof parsed === 'object' && parsed !== null ? parsed : null;
39
20
  }
40
- const parent = p.dirname(dir);
41
- if (parent === dir) {
21
+ catch {
22
+ // A half-written or hand-edited marker is the same as none: the connector re-attaches by
23
+ // slug and writes a fresh one, which is strictly better than refusing to open the project.
42
24
  return null;
43
25
  }
44
- dir = parent;
45
- }
26
+ };
27
+ const readMarker = async () => await markerAt(dir);
28
+ const writeMarker = async (marker) => {
29
+ await fs.ensureDir(p.join(dir, CONNECT_MARKER_DIR));
30
+ await fs.writeFile(p.join(dir, CONNECT_MARKER_FILE), `${JSON.stringify(marker, null, 2)}\n`);
31
+ };
32
+ const discoverProject = async () => {
33
+ let at = p.resolve(dir);
34
+ for (;;) {
35
+ const marker = await markerAt(at);
36
+ if (marker != null) {
37
+ return { dir: at, marker };
38
+ }
39
+ const parent = p.dirname(at);
40
+ if (parent === at) {
41
+ return null;
42
+ }
43
+ at = parent;
44
+ }
45
+ };
46
+ const isViableTree = async () => (await integrityHelper.verifyTarget(dir)).ok;
47
+ return { readMarker, writeMarker, discoverProject, isViableTree };
46
48
  };
47
- /**
48
- * Whether this directory holds the generated application.
49
- *
50
- * Asked before a connector offers to drive a directory, so a person who pointed it at the wrong
51
- * folder learns that from a sentence rather than from a build that refuses everything.
52
- */
53
- export const isViableTree = async (dir) => (await verifyTarget(dir)).ok;
49
+ /** @deprecated compat:factory-refactor — use `makeMarkerHelper(startDir).discoverProject()` */
50
+ export const discoverProject = async (startDir) => await makeMarkerHelper(startDir).discoverProject();
54
51
  //# sourceMappingURL=marker.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"marker.js","sourceRoot":"","sources":["../../src/project/marker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,UAAU,CAAA;AACzB,OAAO,CAAC,MAAM,WAAW,CAAA;AAEzB,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAGjF,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAgBvD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OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,YAAY,EAAE,CAAA;AACnE,CAAC,CAAA;AAED,+FAA+F;AAC/F,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,EAAE,QAAgB,EAAqC,EAAE,CAC3F,MAAM,gBAAgB,CAAC,QAAQ,CAAC,CAAC,eAAe,EAAE,CAAA"}
@@ -0,0 +1,22 @@
1
+ export interface ServiceEndpoint {
2
+ host: string;
3
+ port: number;
4
+ }
5
+ /**
6
+ * What this machine actually provides, asked by a connect attempt — the platform provisions
7
+ * nothing here, so the only honest answer comes from trying.
8
+ */
9
+ export interface ProbeHelper {
10
+ /**
11
+ * The host and port a connection URL names.
12
+ *
13
+ * `null` for anything unparseable, so a malformed value degrades to "not reachable" rather than
14
+ * throwing somewhere a caller has no branch for it.
15
+ */
16
+ serviceEndpoint: (url: string | undefined) => ServiceEndpoint | null;
17
+ /** Whether something is listening where a connection string points. Exported for the setup flow. */
18
+ probeUrl: (url: string | undefined) => Promise<boolean>;
19
+ /** Whether a TCP connect to `host:port` succeeds within the timeout. */
20
+ probePort: (host: string, port: number, timeoutMs?: number) => Promise<boolean>;
21
+ }
22
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/project/probe/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;;OAKG;IACH,eAAe,EAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,KAAK,eAAe,GAAG,IAAI,CAAA;IACpE,oGAAoG;IACpG,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;IACvD,wEAAwE;IACxE,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;CAChF"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/project/probe/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import type { ProbeHelper } from './probe/types.js';
2
+ export declare const createProbeHelper: () => ProbeHelper;
3
+ export declare const probeHelper: ProbeHelper;
4
+ //# sourceMappingURL=probe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"probe.d.ts","sourceRoot":"","sources":["../../src/project/probe.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAmB,MAAM,kBAAkB,CAAA;AAEpE,eAAO,MAAM,iBAAiB,QAAO,WAuCpC,CAAA;AAED,eAAO,MAAM,WAAW,aAAsB,CAAA"}
@@ -0,0 +1,39 @@
1
+ import net from 'node:net';
2
+ import { DEFAULT_PORTS, PROBE_TIMEOUT_MS } from './consts.local.js';
3
+ export const createProbeHelper = () => {
4
+ const serviceEndpoint = (url) => {
5
+ if (url == null || url === '')
6
+ return null;
7
+ try {
8
+ const parsed = new URL(url);
9
+ const port = parsed.port !== ''
10
+ ? parseInt(parsed.port)
11
+ : DEFAULT_PORTS[parsed.protocol.replace(':', '')];
12
+ if (parsed.hostname === '' || port == null || Number.isNaN(port))
13
+ return null;
14
+ return { host: parsed.hostname, port };
15
+ }
16
+ catch {
17
+ return null;
18
+ }
19
+ };
20
+ const probePort = async (host, port, timeoutMs = PROBE_TIMEOUT_MS) => await new Promise(resolve => {
21
+ const socket = net.connect({ host, port });
22
+ const done = (value) => {
23
+ socket.removeAllListeners();
24
+ socket.destroy();
25
+ resolve(value);
26
+ };
27
+ socket.setTimeout(timeoutMs);
28
+ socket.once('connect', () => done(true));
29
+ socket.once('timeout', () => done(false));
30
+ socket.once('error', () => done(false));
31
+ });
32
+ const probeUrl = async (url) => {
33
+ const endpoint = serviceEndpoint(url);
34
+ return endpoint == null ? false : await probePort(endpoint.host, endpoint.port);
35
+ };
36
+ return { serviceEndpoint, probeUrl, probePort };
37
+ };
38
+ export const probeHelper = createProbeHelper();
39
+ //# sourceMappingURL=probe.js.map