@endora-commerce/cli 0.100.0

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 (356) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +37 -0
  3. package/dist/bin/endora.d.ts +28 -0
  4. package/dist/bin/endora.d.ts.map +1 -0
  5. package/dist/bin/endora.js +926 -0
  6. package/dist/bin/endora.js.map +1 -0
  7. package/dist/check/estate.d.ts +189 -0
  8. package/dist/check/estate.d.ts.map +1 -0
  9. package/dist/check/estate.js +1037 -0
  10. package/dist/check/estate.js.map +1 -0
  11. package/dist/check/hosts.d.ts +25 -0
  12. package/dist/check/hosts.d.ts.map +1 -0
  13. package/dist/check/hosts.js +1347 -0
  14. package/dist/check/hosts.js.map +1 -0
  15. package/dist/check/index.d.ts +60 -0
  16. package/dist/check/index.d.ts.map +1 -0
  17. package/dist/check/index.js +111 -0
  18. package/dist/check/index.js.map +1 -0
  19. package/dist/check/layout.d.ts +136 -0
  20. package/dist/check/layout.d.ts.map +1 -0
  21. package/dist/check/layout.js +262 -0
  22. package/dist/check/layout.js.map +1 -0
  23. package/dist/check/ledger.d.ts +98 -0
  24. package/dist/check/ledger.d.ts.map +1 -0
  25. package/dist/check/ledger.js +173 -0
  26. package/dist/check/ledger.js.map +1 -0
  27. package/dist/check/peer-owners.d.ts +116 -0
  28. package/dist/check/peer-owners.d.ts.map +1 -0
  29. package/dist/check/peer-owners.js +225 -0
  30. package/dist/check/peer-owners.js.map +1 -0
  31. package/dist/check/report.d.ts +33 -0
  32. package/dist/check/report.d.ts.map +1 -0
  33. package/dist/check/report.js +107 -0
  34. package/dist/check/report.js.map +1 -0
  35. package/dist/check/run.d.ts +147 -0
  36. package/dist/check/run.d.ts.map +1 -0
  37. package/dist/check/run.js +111 -0
  38. package/dist/check/run.js.map +1 -0
  39. package/dist/checks.d.ts +17 -0
  40. package/dist/checks.d.ts.map +1 -0
  41. package/dist/checks.js +17 -0
  42. package/dist/checks.js.map +1 -0
  43. package/dist/dev/index.d.ts +83 -0
  44. package/dist/dev/index.d.ts.map +1 -0
  45. package/dist/dev/index.js +298 -0
  46. package/dist/dev/index.js.map +1 -0
  47. package/dist/generate/divergence.d.ts +38 -0
  48. package/dist/generate/divergence.d.ts.map +1 -0
  49. package/dist/generate/divergence.js +237 -0
  50. package/dist/generate/divergence.js.map +1 -0
  51. package/dist/generate/index.d.ts +90 -0
  52. package/dist/generate/index.d.ts.map +1 -0
  53. package/dist/generate/index.js +369 -0
  54. package/dist/generate/index.js.map +1 -0
  55. package/dist/index.d.ts +23 -0
  56. package/dist/index.d.ts.map +1 -0
  57. package/dist/index.js +35 -0
  58. package/dist/index.js.map +1 -0
  59. package/dist/inputs/declaration.d.ts +18 -0
  60. package/dist/inputs/declaration.d.ts.map +1 -0
  61. package/dist/inputs/declaration.js +64 -0
  62. package/dist/inputs/declaration.js.map +1 -0
  63. package/dist/inputs/env-file.d.ts +73 -0
  64. package/dist/inputs/env-file.d.ts.map +1 -0
  65. package/dist/inputs/env-file.js +134 -0
  66. package/dist/inputs/env-file.js.map +1 -0
  67. package/dist/inputs/prompt.d.ts +21 -0
  68. package/dist/inputs/prompt.d.ts.map +1 -0
  69. package/dist/inputs/prompt.js +59 -0
  70. package/dist/inputs/prompt.js.map +1 -0
  71. package/dist/inputs/resolve.d.ts +163 -0
  72. package/dist/inputs/resolve.d.ts.map +1 -0
  73. package/dist/inputs/resolve.js +290 -0
  74. package/dist/inputs/resolve.js.map +1 -0
  75. package/dist/install/host.d.ts +27 -0
  76. package/dist/install/host.d.ts.map +1 -0
  77. package/dist/install/host.js +90 -0
  78. package/dist/install/host.js.map +1 -0
  79. package/dist/install/index.d.ts +173 -0
  80. package/dist/install/index.d.ts.map +1 -0
  81. package/dist/install/index.js +793 -0
  82. package/dist/install/index.js.map +1 -0
  83. package/dist/install/wizard.d.ts +144 -0
  84. package/dist/install/wizard.d.ts.map +1 -0
  85. package/dist/install/wizard.js +362 -0
  86. package/dist/install/wizard.js.map +1 -0
  87. package/dist/lib/admin-artefacts.d.ts +70 -0
  88. package/dist/lib/admin-artefacts.d.ts.map +1 -0
  89. package/dist/lib/admin-artefacts.js +354 -0
  90. package/dist/lib/admin-artefacts.js.map +1 -0
  91. package/dist/lib/admin-surfaces.d.ts +298 -0
  92. package/dist/lib/admin-surfaces.d.ts.map +1 -0
  93. package/dist/lib/admin-surfaces.js +669 -0
  94. package/dist/lib/admin-surfaces.js.map +1 -0
  95. package/dist/lib/delegated-composer.d.ts +85 -0
  96. package/dist/lib/delegated-composer.d.ts.map +1 -0
  97. package/dist/lib/delegated-composer.js +241 -0
  98. package/dist/lib/delegated-composer.js.map +1 -0
  99. package/dist/lib/divergence-artefacts.d.ts +305 -0
  100. package/dist/lib/divergence-artefacts.d.ts.map +1 -0
  101. package/dist/lib/divergence-artefacts.js +828 -0
  102. package/dist/lib/divergence-artefacts.js.map +1 -0
  103. package/dist/lib/divergence.d.ts +337 -0
  104. package/dist/lib/divergence.d.ts.map +1 -0
  105. package/dist/lib/divergence.js +1005 -0
  106. package/dist/lib/divergence.js.map +1 -0
  107. package/dist/lib/docs-artefacts.d.ts +395 -0
  108. package/dist/lib/docs-artefacts.d.ts.map +1 -0
  109. package/dist/lib/docs-artefacts.js +781 -0
  110. package/dist/lib/docs-artefacts.js.map +1 -0
  111. package/dist/lib/emitted-exports.d.ts +21 -0
  112. package/dist/lib/emitted-exports.d.ts.map +1 -0
  113. package/dist/lib/emitted-exports.js +96 -0
  114. package/dist/lib/emitted-exports.js.map +1 -0
  115. package/dist/lib/emitted-freshness.d.ts +112 -0
  116. package/dist/lib/emitted-freshness.d.ts.map +1 -0
  117. package/dist/lib/emitted-freshness.js +288 -0
  118. package/dist/lib/emitted-freshness.js.map +1 -0
  119. package/dist/lib/entity-index-artefact.d.ts +95 -0
  120. package/dist/lib/entity-index-artefact.d.ts.map +1 -0
  121. package/dist/lib/entity-index-artefact.js +210 -0
  122. package/dist/lib/entity-index-artefact.js.map +1 -0
  123. package/dist/lib/instance-build-inputs.d.ts +108 -0
  124. package/dist/lib/instance-build-inputs.d.ts.map +1 -0
  125. package/dist/lib/instance-build-inputs.js +165 -0
  126. package/dist/lib/instance-build-inputs.js.map +1 -0
  127. package/dist/lib/module-docs.d.ts +473 -0
  128. package/dist/lib/module-docs.d.ts.map +1 -0
  129. package/dist/lib/module-docs.js +711 -0
  130. package/dist/lib/module-docs.js.map +1 -0
  131. package/dist/lib/module-package-subpaths.d.ts +56 -0
  132. package/dist/lib/module-package-subpaths.d.ts.map +1 -0
  133. package/dist/lib/module-package-subpaths.js +223 -0
  134. package/dist/lib/module-package-subpaths.js.map +1 -0
  135. package/dist/lib/module-packages.d.ts +200 -0
  136. package/dist/lib/module-packages.d.ts.map +1 -0
  137. package/dist/lib/module-packages.js +580 -0
  138. package/dist/lib/module-packages.js.map +1 -0
  139. package/dist/lib/module-population.d.ts +129 -0
  140. package/dist/lib/module-population.d.ts.map +1 -0
  141. package/dist/lib/module-population.js +172 -0
  142. package/dist/lib/module-population.js.map +1 -0
  143. package/dist/lib/module-roots.d.ts +337 -0
  144. package/dist/lib/module-roots.d.ts.map +1 -0
  145. package/dist/lib/module-roots.js +586 -0
  146. package/dist/lib/module-roots.js.map +1 -0
  147. package/dist/lib/nested-checkouts.d.ts +33 -0
  148. package/dist/lib/nested-checkouts.d.ts.map +1 -0
  149. package/dist/lib/nested-checkouts.js +160 -0
  150. package/dist/lib/nested-checkouts.js.map +1 -0
  151. package/dist/lib/platform-root.d.ts +43 -0
  152. package/dist/lib/platform-root.d.ts.map +1 -0
  153. package/dist/lib/platform-root.js +134 -0
  154. package/dist/lib/platform-root.js.map +1 -0
  155. package/dist/lib/platform-surface.d.ts +235 -0
  156. package/dist/lib/platform-surface.d.ts.map +1 -0
  157. package/dist/lib/platform-surface.js +393 -0
  158. package/dist/lib/platform-surface.js.map +1 -0
  159. package/dist/lib/port-registrations.d.ts +223 -0
  160. package/dist/lib/port-registrations.d.ts.map +1 -0
  161. package/dist/lib/port-registrations.js +532 -0
  162. package/dist/lib/port-registrations.js.map +1 -0
  163. package/dist/lib/read-size.d.ts +154 -0
  164. package/dist/lib/read-size.d.ts.map +1 -0
  165. package/dist/lib/read-size.js +182 -0
  166. package/dist/lib/read-size.js.map +1 -0
  167. package/dist/lib/registration-owners.d.ts +79 -0
  168. package/dist/lib/registration-owners.d.ts.map +1 -0
  169. package/dist/lib/registration-owners.js +77 -0
  170. package/dist/lib/registration-owners.js.map +1 -0
  171. package/dist/lib/release-index.d.ts +53 -0
  172. package/dist/lib/release-index.d.ts.map +1 -0
  173. package/dist/lib/release-index.js +162 -0
  174. package/dist/lib/release-index.js.map +1 -0
  175. package/dist/lib/repeating-timers.d.ts +79 -0
  176. package/dist/lib/repeating-timers.d.ts.map +1 -0
  177. package/dist/lib/repeating-timers.js +189 -0
  178. package/dist/lib/repeating-timers.js.map +1 -0
  179. package/dist/lib/source-text.d.ts +34 -0
  180. package/dist/lib/source-text.d.ts.map +1 -0
  181. package/dist/lib/source-text.js +80 -0
  182. package/dist/lib/source-text.js.map +1 -0
  183. package/dist/lib/specifiers.d.ts +20 -0
  184. package/dist/lib/specifiers.d.ts.map +1 -0
  185. package/dist/lib/specifiers.js +130 -0
  186. package/dist/lib/specifiers.js.map +1 -0
  187. package/dist/lib/sql-tables.d.ts +166 -0
  188. package/dist/lib/sql-tables.d.ts.map +1 -0
  189. package/dist/lib/sql-tables.js +464 -0
  190. package/dist/lib/sql-tables.js.map +1 -0
  191. package/dist/lib/switchable-modules.d.ts +54 -0
  192. package/dist/lib/switchable-modules.d.ts.map +1 -0
  193. package/dist/lib/switchable-modules.js +104 -0
  194. package/dist/lib/switchable-modules.js.map +1 -0
  195. package/dist/lib/tailwind-sources.d.ts +136 -0
  196. package/dist/lib/tailwind-sources.d.ts.map +1 -0
  197. package/dist/lib/tailwind-sources.js +307 -0
  198. package/dist/lib/tailwind-sources.js.map +1 -0
  199. package/dist/lib/ui-layer.d.ts +54 -0
  200. package/dist/lib/ui-layer.d.ts.map +1 -0
  201. package/dist/lib/ui-layer.js +57 -0
  202. package/dist/lib/ui-layer.js.map +1 -0
  203. package/dist/lib/workspace-packages.d.ts +186 -0
  204. package/dist/lib/workspace-packages.d.ts.map +1 -0
  205. package/dist/lib/workspace-packages.js +351 -0
  206. package/dist/lib/workspace-packages.js.map +1 -0
  207. package/dist/new-instance/deploy.d.ts +211 -0
  208. package/dist/new-instance/deploy.d.ts.map +1 -0
  209. package/dist/new-instance/deploy.js +1381 -0
  210. package/dist/new-instance/deploy.js.map +1 -0
  211. package/dist/new-instance/docs-toolchain.d.ts +66 -0
  212. package/dist/new-instance/docs-toolchain.d.ts.map +1 -0
  213. package/dist/new-instance/docs-toolchain.js +69 -0
  214. package/dist/new-instance/docs-toolchain.js.map +1 -0
  215. package/dist/new-instance/host.d.ts +124 -0
  216. package/dist/new-instance/host.d.ts.map +1 -0
  217. package/dist/new-instance/host.js +276 -0
  218. package/dist/new-instance/host.js.map +1 -0
  219. package/dist/new-instance/index.d.ts +118 -0
  220. package/dist/new-instance/index.d.ts.map +1 -0
  221. package/dist/new-instance/index.js +567 -0
  222. package/dist/new-instance/index.js.map +1 -0
  223. package/dist/new-instance/modules.d.ts +188 -0
  224. package/dist/new-instance/modules.d.ts.map +1 -0
  225. package/dist/new-instance/modules.js +392 -0
  226. package/dist/new-instance/modules.js.map +1 -0
  227. package/dist/new-instance/template.d.ts +505 -0
  228. package/dist/new-instance/template.d.ts.map +1 -0
  229. package/dist/new-instance/template.js +1886 -0
  230. package/dist/new-instance/template.js.map +1 -0
  231. package/dist/new-module/emit.d.ts +67 -0
  232. package/dist/new-module/emit.d.ts.map +1 -0
  233. package/dist/new-module/emit.js +1393 -0
  234. package/dist/new-module/emit.js.map +1 -0
  235. package/dist/new-module/host.d.ts +67 -0
  236. package/dist/new-module/host.d.ts.map +1 -0
  237. package/dist/new-module/host.js +224 -0
  238. package/dist/new-module/host.js.map +1 -0
  239. package/dist/new-module/index.d.ts +32 -0
  240. package/dist/new-module/index.d.ts.map +1 -0
  241. package/dist/new-module/index.js +193 -0
  242. package/dist/new-module/index.js.map +1 -0
  243. package/dist/new-module/spec.d.ts +188 -0
  244. package/dist/new-module/spec.d.ts.map +1 -0
  245. package/dist/new-module/spec.js +404 -0
  246. package/dist/new-module/spec.js.map +1 -0
  247. package/dist/new-module/text.d.ts +15 -0
  248. package/dist/new-module/text.d.ts.map +1 -0
  249. package/dist/new-module/text.js +22 -0
  250. package/dist/new-module/text.js.map +1 -0
  251. package/dist/new-storefront/dockerfile.d.ts +20 -0
  252. package/dist/new-storefront/dockerfile.d.ts.map +1 -0
  253. package/dist/new-storefront/dockerfile.js +131 -0
  254. package/dist/new-storefront/dockerfile.js.map +1 -0
  255. package/dist/new-storefront/gitignore.d.ts +23 -0
  256. package/dist/new-storefront/gitignore.d.ts.map +1 -0
  257. package/dist/new-storefront/gitignore.js +39 -0
  258. package/dist/new-storefront/gitignore.js.map +1 -0
  259. package/dist/new-storefront/index.d.ts +93 -0
  260. package/dist/new-storefront/index.d.ts.map +1 -0
  261. package/dist/new-storefront/index.js +329 -0
  262. package/dist/new-storefront/index.js.map +1 -0
  263. package/dist/new-storefront/npmrc.d.ts +98 -0
  264. package/dist/new-storefront/npmrc.d.ts.map +1 -0
  265. package/dist/new-storefront/npmrc.js +217 -0
  266. package/dist/new-storefront/npmrc.js.map +1 -0
  267. package/dist/new-storefront/reference.d.ts +189 -0
  268. package/dist/new-storefront/reference.d.ts.map +1 -0
  269. package/dist/new-storefront/reference.js +430 -0
  270. package/dist/new-storefront/reference.js.map +1 -0
  271. package/dist/new-storefront/rewrite.d.ts +171 -0
  272. package/dist/new-storefront/rewrite.d.ts.map +1 -0
  273. package/dist/new-storefront/rewrite.js +701 -0
  274. package/dist/new-storefront/rewrite.js.map +1 -0
  275. package/dist/release-index.json +284 -0
  276. package/dist/rules/action-route-permissions.d.ts +141 -0
  277. package/dist/rules/action-route-permissions.d.ts.map +1 -0
  278. package/dist/rules/action-route-permissions.js +556 -0
  279. package/dist/rules/action-route-permissions.js.map +1 -0
  280. package/dist/rules/bundle-pairing.d.ts +74 -0
  281. package/dist/rules/bundle-pairing.d.ts.map +1 -0
  282. package/dist/rules/bundle-pairing.js +281 -0
  283. package/dist/rules/bundle-pairing.js.map +1 -0
  284. package/dist/rules/channel-resolution.d.ts +17 -0
  285. package/dist/rules/channel-resolution.d.ts.map +1 -0
  286. package/dist/rules/channel-resolution.js +382 -0
  287. package/dist/rules/channel-resolution.js.map +1 -0
  288. package/dist/rules/command-coverage.d.ts +210 -0
  289. package/dist/rules/command-coverage.d.ts.map +1 -0
  290. package/dist/rules/command-coverage.js +714 -0
  291. package/dist/rules/command-coverage.js.map +1 -0
  292. package/dist/rules/container-imports.d.ts +60 -0
  293. package/dist/rules/container-imports.d.ts.map +1 -0
  294. package/dist/rules/container-imports.js +158 -0
  295. package/dist/rules/container-imports.js.map +1 -0
  296. package/dist/rules/default-language-prose.d.ts +212 -0
  297. package/dist/rules/default-language-prose.d.ts.map +1 -0
  298. package/dist/rules/default-language-prose.js +710 -0
  299. package/dist/rules/default-language-prose.js.map +1 -0
  300. package/dist/rules/diacritic-folds.d.ts +238 -0
  301. package/dist/rules/diacritic-folds.d.ts.map +1 -0
  302. package/dist/rules/diacritic-folds.js +681 -0
  303. package/dist/rules/diacritic-folds.js.map +1 -0
  304. package/dist/rules/entity-tenant-classification.d.ts +171 -0
  305. package/dist/rules/entity-tenant-classification.d.ts.map +1 -0
  306. package/dist/rules/entity-tenant-classification.js +323 -0
  307. package/dist/rules/entity-tenant-classification.js.map +1 -0
  308. package/dist/rules/entry-presence.d.ts +142 -0
  309. package/dist/rules/entry-presence.d.ts.map +1 -0
  310. package/dist/rules/entry-presence.js +339 -0
  311. package/dist/rules/entry-presence.js.map +1 -0
  312. package/dist/rules/entry-scope.d.ts +91 -0
  313. package/dist/rules/entry-scope.d.ts.map +1 -0
  314. package/dist/rules/entry-scope.js +404 -0
  315. package/dist/rules/entry-scope.js.map +1 -0
  316. package/dist/rules/env-inputs.d.ts +222 -0
  317. package/dist/rules/env-inputs.d.ts.map +1 -0
  318. package/dist/rules/env-inputs.js +951 -0
  319. package/dist/rules/env-inputs.js.map +1 -0
  320. package/dist/rules/kernel-boundary.d.ts +37 -0
  321. package/dist/rules/kernel-boundary.d.ts.map +1 -0
  322. package/dist/rules/kernel-boundary.js +195 -0
  323. package/dist/rules/kernel-boundary.js.map +1 -0
  324. package/dist/rules/nul-bytes.d.ts +233 -0
  325. package/dist/rules/nul-bytes.d.ts.map +1 -0
  326. package/dist/rules/nul-bytes.js +332 -0
  327. package/dist/rules/nul-bytes.js.map +1 -0
  328. package/dist/rules/platform-surface.d.ts +479 -0
  329. package/dist/rules/platform-surface.d.ts.map +1 -0
  330. package/dist/rules/platform-surface.js +749 -0
  331. package/dist/rules/platform-surface.js.map +1 -0
  332. package/dist/rules/port-catches.d.ts +225 -0
  333. package/dist/rules/port-catches.d.ts.map +1 -0
  334. package/dist/rules/port-catches.js +1374 -0
  335. package/dist/rules/port-catches.js.map +1 -0
  336. package/dist/rules/port-shape.d.ts +213 -0
  337. package/dist/rules/port-shape.d.ts.map +1 -0
  338. package/dist/rules/port-shape.js +670 -0
  339. package/dist/rules/port-shape.js.map +1 -0
  340. package/dist/rules/queue-names.d.ts +108 -0
  341. package/dist/rules/queue-names.d.ts.map +1 -0
  342. package/dist/rules/queue-names.js +395 -0
  343. package/dist/rules/queue-names.js.map +1 -0
  344. package/dist/rules/singleton-identity.d.ts +205 -0
  345. package/dist/rules/singleton-identity.d.ts.map +1 -0
  346. package/dist/rules/singleton-identity.js +830 -0
  347. package/dist/rules/singleton-identity.js.map +1 -0
  348. package/dist/rules/subscribe-seam.d.ts +121 -0
  349. package/dist/rules/subscribe-seam.d.ts.map +1 -0
  350. package/dist/rules/subscribe-seam.js +594 -0
  351. package/dist/rules/subscribe-seam.js.map +1 -0
  352. package/dist/rules/transaction-context.d.ts +40 -0
  353. package/dist/rules/transaction-context.d.ts.map +1 -0
  354. package/dist/rules/transaction-context.js +294 -0
  355. package/dist/rules/transaction-context.js.map +1 -0
  356. package/package.json +59 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/check/run.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,8BAA8B;AAC9B,MAAM,WAAW,OAAO;IACtB,+CAA+C;IAC/C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,qCAAqC;IACrC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,0EAA0E;IAC1E,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAED,MAAM,MAAM,OAAO,GAAG,KAAK,GAAG,gBAAgB,GAAG,YAAY,GAAG,SAAS,CAAC;AAE1E,MAAM,WAAW,UAAU;IACzB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,yCAAyC;IACzC,QAAQ,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,CAAC;IACtC;;;OAGG;IACH,QAAQ,CAAC,YAAY,EAAE,SAAS,OAAO,EAAE,CAAC;IAC1C,sDAAsD;IACtD,QAAQ,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAC;IACxC;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,sCAAsC;IACtC,QAAQ,CAAC,kBAAkB,EAAE,SAAS,aAAa,EAAE,CAAC;CACvD;AAED,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,MAAM,EAA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,QAAQ,EAAE,OAAO,GAAG,SAAS,MAAM,EAAE,CAkB1F;AAED;;;;;;;;GAQG;AACH,wBAAgB,MAAM,CACpB,MAAM,EAAE,SAAS,EACjB,QAAQ,EAAE,SAAS,MAAM,EAAE,EAC3B,cAAc,EAAE,SAAS,MAAM,EAAE,GAChC,MAAM,CAIR;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,CAAC;IACxC,mEAAmE;IACnE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,6BAA6B;IAC7B,QAAQ,CAAC,QAAQ,EAAE,SAAS,GAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5C,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,GAAG,SAAS,CAe/D"}
@@ -0,0 +1,111 @@
1
+ /**
2
+ * The verdicts, the arithmetic and the reduction
3
+ * (`specs/101-endora-check/contracts/exit-reduction.md` §1, §3, §4).
4
+ *
5
+ * ## The reduction is `max`, and that is not a new decision
6
+ *
7
+ * `0` and `1` are statements about the **tree**; `2` is a statement about the
8
+ * **run**. So the aggregate's job is to make each code a *complete* statement:
9
+ *
10
+ * * **2** — the picture is incomplete. There may or may not be findings under
11
+ * it; repair the picture.
12
+ * * **1** — the picture is complete and there are findings.
13
+ * * **0** — the picture is complete and there are none.
14
+ *
15
+ * Every member of this estate already reduces this way internally, over many
16
+ * signals and many files: `check:module-boundary` exits 2 on an owner map that
17
+ * resolved zero tables even when its walk found real unledgered reaches. An
18
+ * aggregate reducing differently would be a second derivation of one convention.
19
+ *
20
+ * The masking objection — *"one unreadable input hides every real finding"* — is
21
+ * answered where it lives: it masks them **in the exit code and nowhere else**.
22
+ * Every rule prints its own line regardless, and {@link countsOf}'s `findings`
23
+ * is printed on the arithmetic line **even when the code is 2**. That is
24
+ * normative (FR-014), not cosmetic.
25
+ *
26
+ * ## The identities have to be able to fail
27
+ *
28
+ * {@link countsOf} takes the estate's size as an argument rather than deriving it
29
+ * from the results it was handed. A count computed by summing the results a run
30
+ * happens to hold can never detect a lost rule — it is a tautology, and the
31
+ * whole point of §3's first identity is that losing a rule is the failure this
32
+ * command exists to make impossible. The second identity fails on a malformed
33
+ * host: a result that is not `ran` and still carries a finding.
34
+ */
35
+ /** Which findings count against the exit code, for this reader. */
36
+ export function effectiveFindings(result, asPlatform) {
37
+ return asPlatform ? [...result.findings, ...result.acknowledged] : result.findings;
38
+ }
39
+ /**
40
+ * The counts, over the results and an **independently supplied** estate size.
41
+ *
42
+ * `estateSize` is a parameter rather than `results.length` on purpose — see the
43
+ * header. `clean` and `findings` are each counted directly rather than one being
44
+ * derived from the other, so §3's second identity is a real comparison.
45
+ */
46
+ export function countsOf(results, estateSize, asPlatform = false) {
47
+ const withFindings = results.filter((result) => effectiveFindings(result, asPlatform).length > 0);
48
+ return {
49
+ estate: estateSize,
50
+ ran: results.filter((result) => result.verdict === 'ran').length,
51
+ clean: results.filter((result) => result.verdict === 'ran' && effectiveFindings(result, asPlatform).length === 0).length,
52
+ findings: withFindings.length,
53
+ notApplicable: results.filter((result) => result.verdict === 'not-applicable').length,
54
+ unreadable: results.filter((result) => result.verdict === 'unreadable').length,
55
+ pending: results.filter((result) => result.verdict === 'pending').length,
56
+ };
57
+ }
58
+ /**
59
+ * Why §3's identities do not hold, or an empty list.
60
+ *
61
+ * A narrowed run suppresses the first — it is meaningless over a subset — and
62
+ * keeps the second, which is about the results themselves.
63
+ */
64
+ export function arithmeticFailures(counts, narrowed) {
65
+ const failures = [];
66
+ const verdicts = counts.ran + counts.notApplicable + counts.unreadable + counts.pending;
67
+ if (!narrowed && verdicts !== counts.estate) {
68
+ failures.push(`the run reported ${verdicts} verdict(s) over an estate of ${counts.estate}: ` +
69
+ `ran + not-applicable + unreadable + pending != estate. The command has lost a ` +
70
+ `rule, which is the failure this arithmetic exists to make impossible.`);
71
+ }
72
+ if (counts.clean + counts.findings !== counts.ran) {
73
+ failures.push(`clean=${counts.clean} + findings=${counts.findings} != ran=${counts.ran}: a rule ` +
74
+ `reported a finding under a verdict that cannot carry one, so the estate's ` +
75
+ `finding count is not a statement about the rules that ran.`);
76
+ }
77
+ return failures;
78
+ }
79
+ /**
80
+ * The exit code. `max` over the members' own codes, with `pending` folded into 2.
81
+ *
82
+ * ```
83
+ * exit 2 if unreadable > 0 or pending > 0 or either identity fails
84
+ * exit 1 else if findings > 0 or a ledger entry is stale
85
+ * exit 0 else
86
+ * ```
87
+ */
88
+ export function reduce(counts, failures, ledgerFindings) {
89
+ if (counts.unreadable > 0 || counts.pending > 0 || failures.length > 0)
90
+ return 2;
91
+ if (counts.findings > 0 || ledgerFindings.length > 0)
92
+ return 1;
93
+ return 0;
94
+ }
95
+ export function buildRunReport(input) {
96
+ const asPlatform = input.asPlatform ?? false;
97
+ const ledgerFindings = input.ledgerFindings ?? [];
98
+ const counts = countsOf(input.results, input.estateSize, asPlatform);
99
+ const failures = arithmeticFailures(counts, input.selected !== null);
100
+ return {
101
+ packageName: input.packageName,
102
+ packageVersion: input.packageVersion,
103
+ results: input.results,
104
+ selected: input.selected,
105
+ counts,
106
+ ledgerFindings,
107
+ arithmeticFailures: failures,
108
+ exitCode: reduce(counts, failures, ledgerFindings),
109
+ };
110
+ }
111
+ //# sourceMappingURL=run.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.js","sourceRoot":"","sources":["../../src/check/run.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAmFH,mEAAmE;AACnE,MAAM,UAAU,iBAAiB,CAAC,MAAkB,EAAE,UAAmB;IACvE,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC,GAA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AAU,CAAC,CAAC;IACrE,MAAM,QAAQ,GAAG,kBAAkB,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC;IACrE,OAAO;QACL,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,cAAc,EAAE,KAAK,CAAC,cAAc;QACpC,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,MAAM;QACN,cAAc;QACd,kBAAkB,EAAE,QAAQ;QAC5B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,cAAc,CAAC;KACnD,CAAC;AACJ,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * `@endora-commerce/cli/checks` — the estate manifest and the run report, as a
3
+ * subpath a stranger can import.
4
+ *
5
+ * It is a subpath of its own because **a stranger's run cannot read a `vitest`
6
+ * file** (`data-model.md` preamble). The estate, its verdicts and the shapes
7
+ * `endora check` reports in are tooling contracts, not an HTTP API, so
8
+ * `packages/contracts/` is not their home — this is the same placement
9
+ * `module-roots` and `read-size` already have.
10
+ *
11
+ * This repository's own reconciliation
12
+ * (`backend/test/unit/scripts/check-inventory.test.ts`) imports it here too, and
13
+ * that is the point: one manifest, read by the tool and by the test that holds
14
+ * the tool to the inventory.
15
+ */
16
+ export * from './check/index.js';
17
+ //# sourceMappingURL=checks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checks.d.ts","sourceRoot":"","sources":["../src/checks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,cAAc,kBAAkB,CAAC"}
package/dist/checks.js ADDED
@@ -0,0 +1,17 @@
1
+ /**
2
+ * `@endora-commerce/cli/checks` — the estate manifest and the run report, as a
3
+ * subpath a stranger can import.
4
+ *
5
+ * It is a subpath of its own because **a stranger's run cannot read a `vitest`
6
+ * file** (`data-model.md` preamble). The estate, its verdicts and the shapes
7
+ * `endora check` reports in are tooling contracts, not an HTTP API, so
8
+ * `packages/contracts/` is not their home — this is the same placement
9
+ * `module-roots` and `read-size` already have.
10
+ *
11
+ * This repository's own reconciliation
12
+ * (`backend/test/unit/scripts/check-inventory.test.ts`) imports it here too, and
13
+ * that is the point: one manifest, read by the tool and by the test that holds
14
+ * the tool to the inventory.
15
+ */
16
+ export * from './check/index.js';
17
+ //# sourceMappingURL=checks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checks.js","sourceRoot":"","sources":["../src/checks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,83 @@
1
+ /** The root script a scaffolded instance declares for this command. */
2
+ export declare const DEV_ALL_SCRIPT = "dev:all";
3
+ /** A refusal the operator can act on — exit 1. */
4
+ export declare class DevInputError extends Error {
5
+ readonly name = "DevInputError";
6
+ }
7
+ /** An input this run could not read — exit 2. */
8
+ export declare class DevHostError extends Error {
9
+ readonly name = "DevHostError";
10
+ }
11
+ /** One layer, as the plan decides it: which script, run where. */
12
+ export interface DevLayer {
13
+ readonly label: 'api' | 'admin' | 'storefront';
14
+ readonly cwd: string;
15
+ /** The package script it runs, by name — never its contents. */
16
+ readonly script: string;
17
+ }
18
+ export interface DevPlan {
19
+ readonly instanceDir: string;
20
+ readonly storefrontDir: string | null;
21
+ readonly processes: readonly DevLayer[];
22
+ /** What was left out and why, printed before anything starts. */
23
+ readonly notes: readonly string[];
24
+ }
25
+ export interface DevOptions {
26
+ /** The directory it was typed in; the instance is its root manifest. */
27
+ readonly cwd: string;
28
+ /**
29
+ * Where the storefront is. `undefined` looks for the default sibling,
30
+ * a string names one (relative to {@link cwd}), `false` starts none.
31
+ */
32
+ readonly storefront?: string | false | undefined;
33
+ }
34
+ /**
35
+ * The layers this tree has, decided from its manifests and from nothing else.
36
+ *
37
+ * Validates completely before anything is started, in `runNewInstance`'s
38
+ * discipline: a run that started the API and then refused over the storefront
39
+ * would leave a process behind for a refusal.
40
+ */
41
+ export declare function planDev(options: DevOptions): DevPlan;
42
+ /** One process the supervisor runs, as a command line. */
43
+ export interface SupervisedProcess {
44
+ readonly label: string;
45
+ readonly cwd: string;
46
+ readonly bin: string;
47
+ readonly argv: readonly string[];
48
+ }
49
+ /**
50
+ * How a package script is run from here.
51
+ *
52
+ * `pnpm run dev:all` sets `npm_execpath` to the package manager that is running
53
+ * it, so the layers are started by the same one — which matters when the
54
+ * operator reached pnpm through `corepack pnpm@…` and there is no `pnpm` on
55
+ * `PATH` at all. Absent, `pnpm` is what an instance declares in its own
56
+ * `packageManager`.
57
+ */
58
+ export declare function commandFor(layer: DevLayer, env?: NodeJS.ProcessEnv): SupervisedProcess;
59
+ export interface SuperviseOptions {
60
+ /** Where a line goes. The argv layer passes stdout. */
61
+ readonly write: (line: string) => void;
62
+ /** An interrupt: every layer is stopped and the run ends `0`. */
63
+ readonly signal?: AbortSignal | undefined;
64
+ /** How long a layer gets between the polite stop and the forced one. */
65
+ readonly graceMs?: number | undefined;
66
+ }
67
+ /**
68
+ * Run the layers until one ends or the operator interrupts, then stop them all.
69
+ *
70
+ * Resolves with the exit code the command reports: `0` for an interrupt (the
71
+ * operator asked for the stop and got it), the ending layer's own code when it
72
+ * failed, and `1` when a layer ended with `0` — a server that returned is not
73
+ * running, and the other layers are no use without it.
74
+ */
75
+ export declare function superviseDev(processes: readonly SupervisedProcess[], options: SuperviseOptions): Promise<number>;
76
+ /**
77
+ * The whole command: plan, print what starts and what does not, supervise.
78
+ */
79
+ export declare function runDev(options: DevOptions & {
80
+ readonly write: (line: string) => void;
81
+ readonly signal?: AbortSignal | undefined;
82
+ }): Promise<number>;
83
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dev/index.ts"],"names":[],"mappings":"AAwDA,uEAAuE;AACvE,eAAO,MAAM,cAAc,YAAY,CAAC;AAExC,kDAAkD;AAClD,qBAAa,aAAc,SAAQ,KAAK;IACt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vD,QAAQ,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,iEAAiE;IACjE,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IAC1C,wEAAwE;IACxE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACvC;AAqBD;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAC1B,SAAS,EAAE,SAAS,iBAAiB,EAAE,EACvC,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,MAAM,CAAC,CAgGjB;AAED;;GAEG;AACH,wBAAsB,MAAM,CAC1B,OAAO,EAAE,UAAU,GAAG;IACpB,QAAQ,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;CAC3C,GACA,OAAO,CAAC,MAAM,CAAC,CAWjB"}
@@ -0,0 +1,298 @@
1
+ /**
2
+ * `endora dev` — the supervisor behind an instance's `pnpm run dev:all`
3
+ * (`specs/136-open-source-publication/spec.md` GAP-7, FR-060, FR-061;
4
+ * research R-10).
5
+ *
6
+ * ## What it is, in one sentence
7
+ *
8
+ * One foreground process over the development commands an instance already
9
+ * has — the API, the admin preview and, when present, the storefront — that
10
+ * prefixes their output, stops all of them on an interrupt, and stops all of
11
+ * them when any one of them ends, naming which.
12
+ *
13
+ * ## What it is not
14
+ *
15
+ * A fusion of the layers. D-230 deploys the backend, the admin and the
16
+ * storefront to hosts of their own and builds each with a command of its own;
17
+ * this changes none of those commands and none of the artefacts (FR-061). It
18
+ * runs the **root scripts** the instance declares — `start` and
19
+ * `preview:admin` — and the storefront's own `dev`, by name, so a change to
20
+ * what a layer runs reaches the composite with nothing here edited. That is
21
+ * `setup`'s derivation one level over.
22
+ *
23
+ * **Why the storefront runs `dev` and the other two do not.** The instance's
24
+ * `start` and `preview:admin` serve what `setup` built, and `endora install`
25
+ * runs `setup`. It does not build the storefront — it installs it — so the one
26
+ * storefront command that works on a tree the install left is `next dev`. The
27
+ * admin is the admin *preview* because FR-060 says so: the built bundle is
28
+ * what an operator signs in to.
29
+ *
30
+ * ## Where the storefront is
31
+ *
32
+ * Its own repository (D-195), so nothing in the instance names it. The default
33
+ * is the sibling `endora install` writes by default — `<dir>-storefront`
34
+ * (125 FR-160) — and `--storefront-dir` names another. Absent, it is not a
35
+ * refusal: FR-060 says *"when present"*. Named and absent, it is: the operator
36
+ * asked for a layer that is not there.
37
+ *
38
+ * ## Why process groups
39
+ *
40
+ * The instance's own `dev` script is `tsc --watch & node --watch …`, and
41
+ * `pnpm run` puts a shell between this process and the one doing the work.
42
+ * Signalling the pid this process spawned reaches the shell and nothing it
43
+ * backgrounded. Each layer is therefore spawned as the leader of a group of its
44
+ * own and the whole group is signalled — which is also why an interrupt from
45
+ * the terminal is received here and forwarded, rather than delivered to every
46
+ * process at once by the terminal's own group.
47
+ *
48
+ * No dependency: `node:child_process` only (research R-10 rejected
49
+ * `concurrently` and `npm-run-all` for ~60 lines the CLI already has the
50
+ * primitives for).
51
+ */
52
+ import { spawn } from 'node:child_process';
53
+ import { existsSync, readFileSync } from 'node:fs';
54
+ import { basename, dirname, isAbsolute, join, resolve } from 'node:path';
55
+ import { constants } from 'node:os';
56
+ /** The root script a scaffolded instance declares for this command. */
57
+ export const DEV_ALL_SCRIPT = 'dev:all';
58
+ /** A refusal the operator can act on — exit 1. */
59
+ export class DevInputError extends Error {
60
+ name = 'DevInputError';
61
+ }
62
+ /** An input this run could not read — exit 2. */
63
+ export class DevHostError extends Error {
64
+ name = 'DevHostError';
65
+ }
66
+ function scriptsOf(manifestPath) {
67
+ try {
68
+ const manifest = JSON.parse(readFileSync(manifestPath, 'utf8'));
69
+ const scripts = manifest.scripts;
70
+ return typeof scripts === 'object' && scripts !== null && !Array.isArray(scripts)
71
+ ? scripts
72
+ : {};
73
+ }
74
+ catch {
75
+ return null;
76
+ }
77
+ }
78
+ /**
79
+ * The layers this tree has, decided from its manifests and from nothing else.
80
+ *
81
+ * Validates completely before anything is started, in `runNewInstance`'s
82
+ * discipline: a run that started the API and then refused over the storefront
83
+ * would leave a process behind for a refusal.
84
+ */
85
+ export function planDev(options) {
86
+ const instanceDir = resolve(options.cwd);
87
+ const manifestPath = join(instanceDir, 'package.json');
88
+ if (!existsSync(manifestPath)) {
89
+ throw new DevHostError(`there is no package.json in ${instanceDir}. \`endora dev\` is run from the root of an ` +
90
+ 'instance — the directory `endora install` or `endora new instance` wrote — as ' +
91
+ '`pnpm run dev:all`.');
92
+ }
93
+ const scripts = scriptsOf(manifestPath);
94
+ if (scripts === null) {
95
+ throw new DevHostError(`${manifestPath} could not be read as JSON.`);
96
+ }
97
+ if (typeof scripts['start'] !== 'string') {
98
+ throw new DevInputError(`${manifestPath} declares no \`start\` script, so there is no API to start. An instance ` +
99
+ "declares one; this is not an instance's root, or its manifest has lost the script.");
100
+ }
101
+ const notes = [];
102
+ const processes = [{ label: 'api', cwd: instanceDir, script: 'start' }];
103
+ if (typeof scripts['preview:admin'] === 'string') {
104
+ processes.push({ label: 'admin', cwd: instanceDir, script: 'preview:admin' });
105
+ }
106
+ else {
107
+ notes.push('no admin preview: this instance declares no `preview:admin`, because it was written ' +
108
+ 'without the admin member.');
109
+ }
110
+ let storefrontDir = null;
111
+ if (options.storefront !== false) {
112
+ const named = typeof options.storefront === 'string';
113
+ const candidate = named
114
+ ? isAbsolute(options.storefront)
115
+ ? options.storefront
116
+ : resolve(instanceDir, options.storefront)
117
+ : join(dirname(instanceDir), `${basename(instanceDir)}-storefront`);
118
+ const storefrontManifest = join(candidate, 'package.json');
119
+ if (!existsSync(storefrontManifest)) {
120
+ if (named) {
121
+ throw new DevInputError(`--storefront-dir ${candidate} holds no storefront (no package.json there). Name the ` +
122
+ 'directory `endora new storefront` wrote, or pass `--no-storefront`.');
123
+ }
124
+ notes.push(`no storefront: none at ${candidate}, where \`endora install\` writes it by default. ` +
125
+ 'Pass `--storefront-dir <path>` if yours is elsewhere.');
126
+ }
127
+ else {
128
+ const storefrontScripts = scriptsOf(storefrontManifest);
129
+ if (storefrontScripts === null || typeof storefrontScripts['dev'] !== 'string') {
130
+ throw new DevInputError(`${storefrontManifest} declares no \`dev\` script, so there is no storefront to start ` +
131
+ 'from it. Pass `--no-storefront` to start the other layers alone.');
132
+ }
133
+ storefrontDir = candidate;
134
+ processes.push({ label: 'storefront', cwd: candidate, script: 'dev' });
135
+ }
136
+ }
137
+ return { instanceDir, storefrontDir, processes, notes };
138
+ }
139
+ /**
140
+ * How a package script is run from here.
141
+ *
142
+ * `pnpm run dev:all` sets `npm_execpath` to the package manager that is running
143
+ * it, so the layers are started by the same one — which matters when the
144
+ * operator reached pnpm through `corepack pnpm@…` and there is no `pnpm` on
145
+ * `PATH` at all. Absent, `pnpm` is what an instance declares in its own
146
+ * `packageManager`.
147
+ */
148
+ export function commandFor(layer, env = process.env) {
149
+ const execPath = env['npm_execpath'];
150
+ if (execPath !== undefined && /pnpm/.test(basename(execPath)) && /\.[cm]?js$/.test(execPath)) {
151
+ return {
152
+ label: layer.label,
153
+ cwd: layer.cwd,
154
+ bin: process.execPath,
155
+ argv: [execPath, 'run', layer.script],
156
+ };
157
+ }
158
+ return { label: layer.label, cwd: layer.cwd, bin: 'pnpm', argv: ['run', layer.script] };
159
+ }
160
+ /** `128 + n`, the shell's own convention for a process ended by a signal. */
161
+ function codeForSignal(signal) {
162
+ const number = constants.signals[signal];
163
+ return number === undefined ? 1 : 128 + number;
164
+ }
165
+ /** Signal a layer and everything it started. */
166
+ function signalGroup(pid, signal) {
167
+ try {
168
+ if (process.platform === 'win32') {
169
+ process.kill(pid, signal);
170
+ }
171
+ else {
172
+ process.kill(-pid, signal);
173
+ }
174
+ }
175
+ catch {
176
+ // Already gone, which is the state being asked for.
177
+ }
178
+ }
179
+ /**
180
+ * Run the layers until one ends or the operator interrupts, then stop them all.
181
+ *
182
+ * Resolves with the exit code the command reports: `0` for an interrupt (the
183
+ * operator asked for the stop and got it), the ending layer's own code when it
184
+ * failed, and `1` when a layer ended with `0` — a server that returned is not
185
+ * running, and the other layers are no use without it.
186
+ */
187
+ export function superviseDev(processes, options) {
188
+ const graceMs = options.graceMs ?? 10_000;
189
+ const { write } = options;
190
+ return new Promise((resolveCode) => {
191
+ const running = new Map();
192
+ const exits = [];
193
+ let stopping = false;
194
+ let result = null;
195
+ let forceTimer = null;
196
+ const finishWhenAllStopped = () => {
197
+ void Promise.all(exits).then(() => {
198
+ if (forceTimer !== null)
199
+ clearTimeout(forceTimer);
200
+ options.signal?.removeEventListener('abort', onAbort);
201
+ resolveCode(result ?? 0);
202
+ });
203
+ };
204
+ const stopAll = () => {
205
+ if (stopping)
206
+ return;
207
+ stopping = true;
208
+ const left = [...running.keys()];
209
+ if (left.length > 0)
210
+ write(`[endora dev] stopping ${left.join(', ')}`);
211
+ for (const pid of running.values())
212
+ signalGroup(pid, 'SIGTERM');
213
+ forceTimer = setTimeout(() => {
214
+ for (const pid of running.values())
215
+ signalGroup(pid, 'SIGKILL');
216
+ }, graceMs);
217
+ forceTimer.unref();
218
+ finishWhenAllStopped();
219
+ };
220
+ function onAbort() {
221
+ if (result === null)
222
+ result = 0;
223
+ stopAll();
224
+ }
225
+ for (const entry of processes) {
226
+ const child = spawn(entry.bin, [...entry.argv], {
227
+ cwd: entry.cwd,
228
+ env: process.env,
229
+ stdio: ['ignore', 'pipe', 'pipe'],
230
+ detached: process.platform !== 'win32',
231
+ });
232
+ const prefix = (chunk, carry) => {
233
+ const text = carry.rest + chunk;
234
+ const lines = text.split(/\r?\n/);
235
+ carry.rest = lines.pop() ?? '';
236
+ for (const line of lines)
237
+ write(`[${entry.label}] ${line}`);
238
+ };
239
+ const out = { rest: '' };
240
+ const err = { rest: '' };
241
+ child.stdout.setEncoding('utf8').on('data', (chunk) => prefix(chunk, out));
242
+ child.stderr.setEncoding('utf8').on('data', (chunk) => prefix(chunk, err));
243
+ if (child.pid !== undefined)
244
+ running.set(entry.label, child.pid);
245
+ exits.push(new Promise((done) => {
246
+ let settled = false;
247
+ const settle = (code, signal) => {
248
+ if (settled)
249
+ return;
250
+ settled = true;
251
+ for (const carry of [out, err]) {
252
+ if (carry.rest.length > 0)
253
+ write(`[${entry.label}] ${carry.rest}`);
254
+ carry.rest = '';
255
+ }
256
+ running.delete(entry.label);
257
+ // Anything it left behind in its group goes with it.
258
+ if (child.pid !== undefined)
259
+ signalGroup(child.pid, 'SIGKILL');
260
+ if (!stopping) {
261
+ const described = signal !== null ? `was ended by ${signal}` : `exited with code ${String(code)}`;
262
+ write(`[endora dev] ${entry.label} ${described}`);
263
+ result = signal !== null ? codeForSignal(signal) : code === 0 ? 1 : (code ?? 1);
264
+ stopAll();
265
+ }
266
+ done();
267
+ };
268
+ child.on('error', (error) => {
269
+ write(`[endora dev] ${entry.label} could not be started: ${error.message}`);
270
+ if (!stopping) {
271
+ result = 127;
272
+ stopAll();
273
+ }
274
+ settle(127, null);
275
+ });
276
+ child.on('close', settle);
277
+ }));
278
+ }
279
+ if (options.signal?.aborted === true) {
280
+ onAbort();
281
+ }
282
+ else {
283
+ options.signal?.addEventListener('abort', onAbort);
284
+ }
285
+ });
286
+ }
287
+ /**
288
+ * The whole command: plan, print what starts and what does not, supervise.
289
+ */
290
+ export async function runDev(options) {
291
+ const plan = planDev(options);
292
+ options.write(`endora dev — ${plan.processes.map((layer) => `${layer.label} (pnpm run ${layer.script})`).join(', ')}`);
293
+ for (const note of plan.notes)
294
+ options.write(` ${note}`);
295
+ options.write(' Ctrl-C stops all of them; any one ending stops the rest.');
296
+ return superviseDev(plan.processes.map((layer) => commandFor(layer)), { write: options.write, signal: options.signal });
297
+ }
298
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dev/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAI,EAAE,CAAC,CAAC;IAC1D,OAAO,CAAC,KAAK,CAAC,4DAA4D,CAAC,CAAC;IAC5E,OAAO,YAAY,CACjB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAChD,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CACjD,CAAC;AACJ,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { type DivergenceRendering } from '../lib/divergence-artefacts.js';
2
+ import { type ModulePackage } from '../lib/module-packages.js';
3
+ /** Raised when this half has an input it could not read — the caller's exit 2. */
4
+ export declare class DivergenceHostError extends Error {
5
+ readonly name = "DivergenceHostError";
6
+ }
7
+ /** The "do not edit" header an instance's rendered report carries. */
8
+ export declare const INSTANCE_DIVERGENCE_MARKDOWN_HEADER: string[];
9
+ /** Every deployment in an instance — one directory under `<root>/apps/`. */
10
+ export declare function instanceDeployments(root: string): readonly string[];
11
+ /** One deployment's rendered pair, and what the run could not read producing it. */
12
+ export interface InstanceDivergence {
13
+ readonly deployment: string;
14
+ readonly renderings: readonly DivergenceRendering[];
15
+ readonly overlayModules: readonly string[];
16
+ readonly entries: number;
17
+ /** Findings the derivation raised — `check:divergence`'s subject, printed here. */
18
+ readonly findings: ReadonlyArray<{
19
+ readonly kind: string;
20
+ readonly where: string;
21
+ readonly detail: string;
22
+ }>;
23
+ /** Declaration fields this run could not resolve to literals, each named. */
24
+ readonly unresolvedDeclaration: readonly string[];
25
+ }
26
+ /**
27
+ * Render one report per deployment this instance holds.
28
+ *
29
+ * A tree with no `apps/` directory at all is the empty list rather than a
30
+ * refusal: an instance scaffolded and not yet customised is a supported state,
31
+ * and the caller names it as an omission the way it names an absent admin
32
+ * member.
33
+ */
34
+ export declare function renderInstanceDivergence(input: {
35
+ readonly root: string;
36
+ readonly packages: readonly ModulePackage[];
37
+ }): readonly InstanceDivergence[];
38
+ //# sourceMappingURL=divergence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"divergence.d.ts","sourceRoot":"","sources":["../../src/generate/divergence.ts"],"names":[],"mappings":"AAgEA,OAAO,EAUL,KAAK,mBAAmB,EACzB,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAEL,KAAK,aAAa,EACnB,MAAM,2BAA2B,CAAC;AAEnC,kFAAkF;AAClF,qBAAa,mBAAoB,SAAQ,KAAK;IAC5C,SAAkB,IAAI,yBAAyB;CAChD;AAED,sEAAsE;AACtE,eAAO,MAAM,mCAAmC,UAI/C,CAAC;AAeF,4EAA4E;AAC5E,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAEnE;AAsBD,oFAAoF;AACpF,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,SAAS,mBAAmB,EAAE,CAAC;IACpD,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,mFAAmF;IACnF,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC7G,6EAA6E;IAC7E,QAAQ,CAAC,qBAAqB,EAAE,SAAS,MAAM,EAAE,CAAC;CACnD;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE;IAC9C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,SAAS,aAAa,EAAE,CAAC;CAC7C,GAAG,SAAS,kBAAkB,EAAE,CAmIhC"}