@mysten-incubation/devstack 0.0.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 (833) hide show
  1. package/LICENSE +189 -0
  2. package/README.md +94 -0
  3. package/dist/_virtual/_rolldown/runtime.mjs +13 -0
  4. package/dist/api/define-capabilities.d.mts +25 -0
  5. package/dist/api/define-capabilities.mjs +19 -0
  6. package/dist/api/define-capabilities.mjs.map +1 -0
  7. package/dist/api/define-devstack-with.d.mts +41 -0
  8. package/dist/api/define-devstack-with.mjs +24 -0
  9. package/dist/api/define-devstack-with.mjs.map +1 -0
  10. package/dist/api/define-devstack.d.mts +62 -0
  11. package/dist/api/define-devstack.mjs +108 -0
  12. package/dist/api/define-devstack.mjs.map +1 -0
  13. package/dist/api/define-plugin.d.mts +1 -0
  14. package/dist/api/inference-network.mjs +122 -0
  15. package/dist/api/inference-network.mjs.map +1 -0
  16. package/dist/api/mode-narrowed-factory.d.mts +26 -0
  17. package/dist/api/mode-narrowed-factory.mjs +8 -0
  18. package/dist/api/mode-narrowed-factory.mjs.map +1 -0
  19. package/dist/api/plugin-errors.mjs +10 -0
  20. package/dist/api/plugin-errors.mjs.map +1 -0
  21. package/dist/api/run-stack.d.mts +82 -0
  22. package/dist/api/run-stack.mjs +127 -0
  23. package/dist/api/run-stack.mjs.map +1 -0
  24. package/dist/build-integrations/playwright/config.d.mts +92 -0
  25. package/dist/build-integrations/playwright/config.mjs +71 -0
  26. package/dist/build-integrations/playwright/config.mjs.map +1 -0
  27. package/dist/build-integrations/playwright/errors.d.mts +82 -0
  28. package/dist/build-integrations/playwright/errors.mjs +43 -0
  29. package/dist/build-integrations/playwright/errors.mjs.map +1 -0
  30. package/dist/build-integrations/playwright/global-setup.d.mts +64 -0
  31. package/dist/build-integrations/playwright/global-setup.mjs +44 -0
  32. package/dist/build-integrations/playwright/global-setup.mjs.map +1 -0
  33. package/dist/build-integrations/playwright/index.d.mts +6 -0
  34. package/dist/build-integrations/playwright/index.mjs +6 -0
  35. package/dist/build-integrations/playwright/stack-context.d.mts +95 -0
  36. package/dist/build-integrations/playwright/stack-context.mjs +277 -0
  37. package/dist/build-integrations/playwright/stack-context.mjs.map +1 -0
  38. package/dist/build-integrations/playwright/wallet-context.d.mts +87 -0
  39. package/dist/build-integrations/playwright/wallet-context.mjs +148 -0
  40. package/dist/build-integrations/playwright/wallet-context.mjs.map +1 -0
  41. package/dist/build-integrations/runtime/cold-start-url.d.mts +67 -0
  42. package/dist/build-integrations/runtime/cold-start-url.mjs +56 -0
  43. package/dist/build-integrations/runtime/cold-start-url.mjs.map +1 -0
  44. package/dist/build-integrations/runtime/dapp-kit-slot.mjs +10 -0
  45. package/dist/build-integrations/runtime/dapp-kit-slot.mjs.map +1 -0
  46. package/dist/build-integrations/runtime/discover.d.mts +78 -0
  47. package/dist/build-integrations/runtime/discover.mjs +124 -0
  48. package/dist/build-integrations/runtime/discover.mjs.map +1 -0
  49. package/dist/build-integrations/runtime/endpoint-registry.d.mts +26 -0
  50. package/dist/build-integrations/runtime/endpoint-registry.mjs +41 -0
  51. package/dist/build-integrations/runtime/endpoint-registry.mjs.map +1 -0
  52. package/dist/build-integrations/runtime/errors.d.mts +64 -0
  53. package/dist/build-integrations/runtime/errors.mjs +51 -0
  54. package/dist/build-integrations/runtime/errors.mjs.map +1 -0
  55. package/dist/build-integrations/runtime/index.d.mts +7 -0
  56. package/dist/build-integrations/runtime/index.mjs +6 -0
  57. package/dist/build-integrations/runtime/read-stack-context.d.mts +38 -0
  58. package/dist/build-integrations/runtime/read-stack-context.mjs +130 -0
  59. package/dist/build-integrations/runtime/read-stack-context.mjs.map +1 -0
  60. package/dist/build-integrations/runtime/stack-context.d.mts +53 -0
  61. package/dist/build-integrations/vitest/config.d.mts +62 -0
  62. package/dist/build-integrations/vitest/config.mjs +80 -0
  63. package/dist/build-integrations/vitest/config.mjs.map +1 -0
  64. package/dist/build-integrations/vitest/env.d.mts +48 -0
  65. package/dist/build-integrations/vitest/env.mjs +50 -0
  66. package/dist/build-integrations/vitest/env.mjs.map +1 -0
  67. package/dist/build-integrations/vitest/errors.d.mts +44 -0
  68. package/dist/build-integrations/vitest/errors.mjs +18 -0
  69. package/dist/build-integrations/vitest/errors.mjs.map +1 -0
  70. package/dist/build-integrations/vitest/index.d.mts +6 -0
  71. package/dist/build-integrations/vitest/index.mjs +6 -0
  72. package/dist/build-integrations/vitest/setup.d.mts +53 -0
  73. package/dist/build-integrations/vitest/setup.mjs +56 -0
  74. package/dist/build-integrations/vitest/setup.mjs.map +1 -0
  75. package/dist/build-integrations/vitest/stack-context.d.mts +58 -0
  76. package/dist/build-integrations/vitest/stack-context.mjs +67 -0
  77. package/dist/build-integrations/vitest/stack-context.mjs.map +1 -0
  78. package/dist/cli/main.d.mts +5 -0
  79. package/dist/cli/main.mjs +586 -0
  80. package/dist/cli/main.mjs.map +1 -0
  81. package/dist/cli/prune-direct.mjs +216 -0
  82. package/dist/cli/prune-direct.mjs.map +1 -0
  83. package/dist/cli/snapshot-reader.mjs +73 -0
  84. package/dist/cli/snapshot-reader.mjs.map +1 -0
  85. package/dist/cli/up-lifecycle.mjs +28 -0
  86. package/dist/cli/up-lifecycle.mjs.map +1 -0
  87. package/dist/contracts/capability-decl.d.mts +42 -0
  88. package/dist/contracts/chain-probe.d.mts +26 -0
  89. package/dist/contracts/chain-probe.mjs +8 -0
  90. package/dist/contracts/chain-probe.mjs.map +1 -0
  91. package/dist/contracts/codegenable.d.mts +43 -0
  92. package/dist/contracts/container-runtime.d.mts +245 -0
  93. package/dist/contracts/liveness-classifier.d.mts +19 -0
  94. package/dist/contracts/network-resolver.d.mts +15 -0
  95. package/dist/contracts/network-resolver.mjs +7 -0
  96. package/dist/contracts/network-resolver.mjs.map +1 -0
  97. package/dist/contracts/projection.d.mts +15 -0
  98. package/dist/contracts/routable.d.mts +53 -0
  99. package/dist/contracts/snapshotable.d.mts +39 -0
  100. package/dist/contracts/strategy-contributor.d.mts +26 -0
  101. package/dist/index.d.mts +89 -0
  102. package/dist/index.mjs +37 -0
  103. package/dist/orchestrators/codegen/bindings.d.mts +2 -0
  104. package/dist/orchestrators/codegen/bindings.mjs +340 -0
  105. package/dist/orchestrators/codegen/bindings.mjs.map +1 -0
  106. package/dist/orchestrators/codegen/emit.mjs +56 -0
  107. package/dist/orchestrators/codegen/emit.mjs.map +1 -0
  108. package/dist/orchestrators/codegen/errors.d.mts +1 -0
  109. package/dist/orchestrators/codegen/errors.mjs +66 -0
  110. package/dist/orchestrators/codegen/errors.mjs.map +1 -0
  111. package/dist/orchestrators/codegen/extras.mjs +16 -0
  112. package/dist/orchestrators/codegen/extras.mjs.map +1 -0
  113. package/dist/orchestrators/codegen/format.mjs +109 -0
  114. package/dist/orchestrators/codegen/format.mjs.map +1 -0
  115. package/dist/orchestrators/codegen/gitignore.mjs +67 -0
  116. package/dist/orchestrators/codegen/gitignore.mjs.map +1 -0
  117. package/dist/orchestrators/codegen/paths.d.mts +1 -0
  118. package/dist/orchestrators/codegen/paths.mjs +33 -0
  119. package/dist/orchestrators/codegen/paths.mjs.map +1 -0
  120. package/dist/orchestrators/codegen/permissions.mjs +6 -0
  121. package/dist/orchestrators/codegen/permissions.mjs.map +1 -0
  122. package/dist/orchestrators/codegen/service.d.mts +1 -0
  123. package/dist/orchestrators/codegen/service.mjs +276 -0
  124. package/dist/orchestrators/codegen/service.mjs.map +1 -0
  125. package/dist/orchestrators/router/cleanup.mjs +58 -0
  126. package/dist/orchestrators/router/cleanup.mjs.map +1 -0
  127. package/dist/orchestrators/router/cors.mjs +31 -0
  128. package/dist/orchestrators/router/cors.mjs.map +1 -0
  129. package/dist/orchestrators/router/entrypoints.d.mts +1 -0
  130. package/dist/orchestrators/router/entrypoints.mjs +80 -0
  131. package/dist/orchestrators/router/entrypoints.mjs.map +1 -0
  132. package/dist/orchestrators/router/errors.d.mts +1 -0
  133. package/dist/orchestrators/router/errors.mjs +103 -0
  134. package/dist/orchestrators/router/errors.mjs.map +1 -0
  135. package/dist/orchestrators/router/file-provider.d.mts +1 -0
  136. package/dist/orchestrators/router/file-provider.mjs +320 -0
  137. package/dist/orchestrators/router/file-provider.mjs.map +1 -0
  138. package/dist/orchestrators/router/hostname.d.mts +1 -0
  139. package/dist/orchestrators/router/hostname.mjs +107 -0
  140. package/dist/orchestrators/router/hostname.mjs.map +1 -0
  141. package/dist/orchestrators/router/index.d.mts +1 -0
  142. package/dist/orchestrators/router/profile.d.mts +1 -0
  143. package/dist/orchestrators/router/profile.mjs +109 -0
  144. package/dist/orchestrators/router/profile.mjs.map +1 -0
  145. package/dist/orchestrators/router/service.d.mts +3 -0
  146. package/dist/orchestrators/router/service.mjs +421 -0
  147. package/dist/orchestrators/router/service.mjs.map +1 -0
  148. package/dist/orchestrators/router/traefik-container.d.mts +1 -0
  149. package/dist/orchestrators/router/traefik-container.mjs +229 -0
  150. package/dist/orchestrators/router/traefik-container.mjs.map +1 -0
  151. package/dist/orchestrators/runtime-composition.d.mts +10 -0
  152. package/dist/orchestrators/runtime-composition.mjs +168 -0
  153. package/dist/orchestrators/runtime-composition.mjs.map +1 -0
  154. package/dist/orchestrators/snapshot/capture.d.mts +1 -0
  155. package/dist/orchestrators/snapshot/capture.mjs +350 -0
  156. package/dist/orchestrators/snapshot/capture.mjs.map +1 -0
  157. package/dist/orchestrators/snapshot/descriptor.d.mts +1 -0
  158. package/dist/orchestrators/snapshot/descriptor.mjs +109 -0
  159. package/dist/orchestrators/snapshot/descriptor.mjs.map +1 -0
  160. package/dist/orchestrators/snapshot/identity-guard.d.mts +1 -0
  161. package/dist/orchestrators/snapshot/identity-guard.mjs +132 -0
  162. package/dist/orchestrators/snapshot/identity-guard.mjs.map +1 -0
  163. package/dist/orchestrators/snapshot/image-bundle-tags.mjs +207 -0
  164. package/dist/orchestrators/snapshot/image-bundle-tags.mjs.map +1 -0
  165. package/dist/orchestrators/snapshot/index.d.mts +1 -0
  166. package/dist/orchestrators/snapshot/integrity.d.mts +1 -0
  167. package/dist/orchestrators/snapshot/integrity.mjs +74 -0
  168. package/dist/orchestrators/snapshot/integrity.mjs.map +1 -0
  169. package/dist/orchestrators/snapshot/prune.d.mts +1 -0
  170. package/dist/orchestrators/snapshot/prune.mjs +110 -0
  171. package/dist/orchestrators/snapshot/prune.mjs.map +1 -0
  172. package/dist/orchestrators/snapshot/restore.d.mts +1 -0
  173. package/dist/orchestrators/snapshot/restore.mjs +404 -0
  174. package/dist/orchestrators/snapshot/restore.mjs.map +1 -0
  175. package/dist/orchestrators/snapshot/service.d.mts +1 -0
  176. package/dist/orchestrators/snapshot/service.mjs +296 -0
  177. package/dist/orchestrators/snapshot/service.mjs.map +1 -0
  178. package/dist/orchestrators/snapshot/state-document.mjs +18 -0
  179. package/dist/orchestrators/snapshot/state-document.mjs.map +1 -0
  180. package/dist/orchestrators/snapshot/wipe.d.mts +1 -0
  181. package/dist/orchestrators/snapshot/wipe.mjs +59 -0
  182. package/dist/orchestrators/snapshot/wipe.mjs.map +1 -0
  183. package/dist/plugins/account/codegen.d.mts +12 -0
  184. package/dist/plugins/account/codegen.mjs +22 -0
  185. package/dist/plugins/account/codegen.mjs.map +1 -0
  186. package/dist/plugins/account/errors.d.mts +44 -0
  187. package/dist/plugins/account/errors.mjs +16 -0
  188. package/dist/plugins/account/errors.mjs.map +1 -0
  189. package/dist/plugins/account/funding.d.mts +94 -0
  190. package/dist/plugins/account/funding.mjs +199 -0
  191. package/dist/plugins/account/funding.mjs.map +1 -0
  192. package/dist/plugins/account/index.d.mts +54 -0
  193. package/dist/plugins/account/index.mjs +151 -0
  194. package/dist/plugins/account/index.mjs.map +1 -0
  195. package/dist/plugins/account/keypair.d.mts +32 -0
  196. package/dist/plugins/account/keypair.mjs +99 -0
  197. package/dist/plugins/account/keypair.mjs.map +1 -0
  198. package/dist/plugins/account/lease.mjs +21 -0
  199. package/dist/plugins/account/lease.mjs.map +1 -0
  200. package/dist/plugins/account/registry.d.mts +33 -0
  201. package/dist/plugins/account/registry.mjs +36 -0
  202. package/dist/plugins/account/registry.mjs.map +1 -0
  203. package/dist/plugins/account/service.d.mts +104 -0
  204. package/dist/plugins/account/service.mjs +405 -0
  205. package/dist/plugins/account/service.mjs.map +1 -0
  206. package/dist/plugins/account/snapshot.mjs +33 -0
  207. package/dist/plugins/account/snapshot.mjs.map +1 -0
  208. package/dist/plugins/account/variants/env.mjs +24 -0
  209. package/dist/plugins/account/variants/env.mjs.map +1 -0
  210. package/dist/plugins/account/variants/ephemeral.mjs +72 -0
  211. package/dist/plugins/account/variants/ephemeral.mjs.map +1 -0
  212. package/dist/plugins/account/variants/impersonate.d.mts +16 -0
  213. package/dist/plugins/account/variants/impersonate.mjs +48 -0
  214. package/dist/plugins/account/variants/impersonate.mjs.map +1 -0
  215. package/dist/plugins/account/variants/inline.mjs +13 -0
  216. package/dist/plugins/account/variants/inline.mjs.map +1 -0
  217. package/dist/plugins/account/variants/keystore.mjs +93 -0
  218. package/dist/plugins/account/variants/keystore.mjs.map +1 -0
  219. package/dist/plugins/account/variants/signer.mjs +31 -0
  220. package/dist/plugins/account/variants/signer.mjs.map +1 -0
  221. package/dist/plugins/action/build-context.d.mts +41 -0
  222. package/dist/plugins/action/discriminator.d.mts +20 -0
  223. package/dist/plugins/action/discriminator.mjs +13 -0
  224. package/dist/plugins/action/discriminator.mjs.map +1 -0
  225. package/dist/plugins/action/errors.d.mts +31 -0
  226. package/dist/plugins/action/errors.mjs +13 -0
  227. package/dist/plugins/action/errors.mjs.map +1 -0
  228. package/dist/plugins/action/execute.d.mts +2 -0
  229. package/dist/plugins/action/execute.mjs +145 -0
  230. package/dist/plugins/action/execute.mjs.map +1 -0
  231. package/dist/plugins/action/index.d.mts +56 -0
  232. package/dist/plugins/action/index.mjs +82 -0
  233. package/dist/plugins/action/index.mjs.map +1 -0
  234. package/dist/plugins/action/service.d.mts +26 -0
  235. package/dist/plugins/action/service.mjs +84 -0
  236. package/dist/plugins/action/service.mjs.map +1 -0
  237. package/dist/plugins/coin/address-resolution.d.mts +34 -0
  238. package/dist/plugins/coin/address-resolution.mjs +80 -0
  239. package/dist/plugins/coin/address-resolution.mjs.map +1 -0
  240. package/dist/plugins/coin/codegen.d.mts +16 -0
  241. package/dist/plugins/coin/codegen.mjs +21 -0
  242. package/dist/plugins/coin/codegen.mjs.map +1 -0
  243. package/dist/plugins/coin/discovery.d.mts +26 -0
  244. package/dist/plugins/coin/discovery.mjs +112 -0
  245. package/dist/plugins/coin/discovery.mjs.map +1 -0
  246. package/dist/plugins/coin/errors.d.mts +48 -0
  247. package/dist/plugins/coin/errors.mjs +13 -0
  248. package/dist/plugins/coin/errors.mjs.map +1 -0
  249. package/dist/plugins/coin/index.d.mts +95 -0
  250. package/dist/plugins/coin/index.mjs +172 -0
  251. package/dist/plugins/coin/index.mjs.map +1 -0
  252. package/dist/plugins/coin/metadata.d.mts +15 -0
  253. package/dist/plugins/coin/metadata.mjs +99 -0
  254. package/dist/plugins/coin/metadata.mjs.map +1 -0
  255. package/dist/plugins/coin/mint.d.mts +34 -0
  256. package/dist/plugins/coin/mint.mjs +164 -0
  257. package/dist/plugins/coin/mint.mjs.map +1 -0
  258. package/dist/plugins/coin/registry.d.mts +1 -0
  259. package/dist/plugins/coin/registry.mjs +37 -0
  260. package/dist/plugins/coin/registry.mjs.map +1 -0
  261. package/dist/plugins/coin/service.d.mts +47 -0
  262. package/dist/plugins/coin/service.mjs +51 -0
  263. package/dist/plugins/coin/service.mjs.map +1 -0
  264. package/dist/plugins/coin/snapshot.mjs +19 -0
  265. package/dist/plugins/coin/snapshot.mjs.map +1 -0
  266. package/dist/plugins/coin/type-strings.mjs +49 -0
  267. package/dist/plugins/coin/type-strings.mjs.map +1 -0
  268. package/dist/plugins/deepbook/codegen.d.mts +39 -0
  269. package/dist/plugins/deepbook/codegen.mjs +15 -0
  270. package/dist/plugins/deepbook/codegen.mjs.map +1 -0
  271. package/dist/plugins/deepbook/deploy.mjs +437 -0
  272. package/dist/plugins/deepbook/deploy.mjs.map +1 -0
  273. package/dist/plugins/deepbook/errors.d.mts +29 -0
  274. package/dist/plugins/deepbook/errors.mjs +26 -0
  275. package/dist/plugins/deepbook/errors.mjs.map +1 -0
  276. package/dist/plugins/deepbook/faucet-strategy.d.mts +8 -0
  277. package/dist/plugins/deepbook/faucet-strategy.mjs +81 -0
  278. package/dist/plugins/deepbook/faucet-strategy.mjs.map +1 -0
  279. package/dist/plugins/deepbook/index.d.mts +171 -0
  280. package/dist/plugins/deepbook/index.mjs +359 -0
  281. package/dist/plugins/deepbook/index.mjs.map +1 -0
  282. package/dist/plugins/deepbook/plugin-key.mjs +7 -0
  283. package/dist/plugins/deepbook/plugin-key.mjs.map +1 -0
  284. package/dist/plugins/deepbook/pyth/index.mjs +226 -0
  285. package/dist/plugins/deepbook/pyth/index.mjs.map +1 -0
  286. package/dist/plugins/deepbook/routable.mjs +21 -0
  287. package/dist/plugins/deepbook/routable.mjs.map +1 -0
  288. package/dist/plugins/deepbook/snapshot.mjs +49 -0
  289. package/dist/plugins/deepbook/snapshot.mjs.map +1 -0
  290. package/dist/plugins/deepbook/types.d.mts +125 -0
  291. package/dist/plugins/deepbook/types.mjs +12 -0
  292. package/dist/plugins/deepbook/types.mjs.map +1 -0
  293. package/dist/plugins/faucet/dispatcher.d.mts +9 -0
  294. package/dist/plugins/faucet/dispatcher.mjs +13 -0
  295. package/dist/plugins/faucet/dispatcher.mjs.map +1 -0
  296. package/dist/plugins/faucet/errors.d.mts +86 -0
  297. package/dist/plugins/faucet/errors.mjs +19 -0
  298. package/dist/plugins/faucet/errors.mjs.map +1 -0
  299. package/dist/plugins/faucet/http.mjs +127 -0
  300. package/dist/plugins/faucet/http.mjs.map +1 -0
  301. package/dist/plugins/faucet/index.d.mts +43 -0
  302. package/dist/plugins/faucet/index.mjs +42 -0
  303. package/dist/plugins/faucet/index.mjs.map +1 -0
  304. package/dist/plugins/faucet/service.d.mts +20 -0
  305. package/dist/plugins/faucet/strategies/sui-local.d.mts +23 -0
  306. package/dist/plugins/faucet/strategies/sui-local.mjs +29 -0
  307. package/dist/plugins/faucet/strategies/sui-local.mjs.map +1 -0
  308. package/dist/plugins/host-service/errors.d.mts +27 -0
  309. package/dist/plugins/host-service/errors.mjs +14 -0
  310. package/dist/plugins/host-service/errors.mjs.map +1 -0
  311. package/dist/plugins/host-service/index.d.mts +10 -0
  312. package/dist/plugins/host-service/index.mjs +48 -0
  313. package/dist/plugins/host-service/index.mjs.map +1 -0
  314. package/dist/plugins/host-service/routable.mjs +24 -0
  315. package/dist/plugins/host-service/routable.mjs.map +1 -0
  316. package/dist/plugins/host-service/service.d.mts +49 -0
  317. package/dist/plugins/host-service/service.mjs +375 -0
  318. package/dist/plugins/host-service/service.mjs.map +1 -0
  319. package/dist/plugins/package/build.d.mts +1 -0
  320. package/dist/plugins/package/build.mjs +24 -0
  321. package/dist/plugins/package/build.mjs.map +1 -0
  322. package/dist/plugins/package/codegen.d.mts +19 -0
  323. package/dist/plugins/package/codegen.mjs +41 -0
  324. package/dist/plugins/package/codegen.mjs.map +1 -0
  325. package/dist/plugins/package/dep-resolution.mjs +10 -0
  326. package/dist/plugins/package/dep-resolution.mjs.map +1 -0
  327. package/dist/plugins/package/errors.d.mts +34 -0
  328. package/dist/plugins/package/errors.mjs +13 -0
  329. package/dist/plugins/package/errors.mjs.map +1 -0
  330. package/dist/plugins/package/index.d.mts +109 -0
  331. package/dist/plugins/package/index.mjs +207 -0
  332. package/dist/plugins/package/index.mjs.map +1 -0
  333. package/dist/plugins/package/mode-known.mjs +41 -0
  334. package/dist/plugins/package/mode-known.mjs.map +1 -0
  335. package/dist/plugins/package/mode-local.d.mts +1 -0
  336. package/dist/plugins/package/mode-local.mjs +183 -0
  337. package/dist/plugins/package/mode-local.mjs.map +1 -0
  338. package/dist/plugins/package/publish-executor.mjs +202 -0
  339. package/dist/plugins/package/publish-executor.mjs.map +1 -0
  340. package/dist/plugins/package/publish-output.d.mts +28 -0
  341. package/dist/plugins/package/publish-output.mjs +45 -0
  342. package/dist/plugins/package/publish-output.mjs.map +1 -0
  343. package/dist/plugins/package/registry.d.mts +25 -0
  344. package/dist/plugins/package/registry.mjs +30 -0
  345. package/dist/plugins/package/registry.mjs.map +1 -0
  346. package/dist/plugins/package/service.mjs +20 -0
  347. package/dist/plugins/package/service.mjs.map +1 -0
  348. package/dist/plugins/package/snapshot.mjs +25 -0
  349. package/dist/plugins/package/snapshot.mjs.map +1 -0
  350. package/dist/plugins/postgres/codegen.mjs +42 -0
  351. package/dist/plugins/postgres/codegen.mjs.map +1 -0
  352. package/dist/plugins/postgres/connection.d.mts +33 -0
  353. package/dist/plugins/postgres/connection.mjs +19 -0
  354. package/dist/plugins/postgres/connection.mjs.map +1 -0
  355. package/dist/plugins/postgres/db-ensure.mjs +100 -0
  356. package/dist/plugins/postgres/db-ensure.mjs.map +1 -0
  357. package/dist/plugins/postgres/errors.d.mts +55 -0
  358. package/dist/plugins/postgres/errors.mjs +29 -0
  359. package/dist/plugins/postgres/errors.mjs.map +1 -0
  360. package/dist/plugins/postgres/index.d.mts +37 -0
  361. package/dist/plugins/postgres/index.mjs +75 -0
  362. package/dist/plugins/postgres/index.mjs.map +1 -0
  363. package/dist/plugins/postgres/routable.mjs +33 -0
  364. package/dist/plugins/postgres/routable.mjs.map +1 -0
  365. package/dist/plugins/postgres/service.d.mts +50 -0
  366. package/dist/plugins/postgres/service.mjs +145 -0
  367. package/dist/plugins/postgres/service.mjs.map +1 -0
  368. package/dist/plugins/postgres/snapshot.d.mts +1 -0
  369. package/dist/plugins/postgres/snapshot.mjs +32 -0
  370. package/dist/plugins/postgres/snapshot.mjs.map +1 -0
  371. package/dist/plugins/router-entrypoints.mjs +21 -0
  372. package/dist/plugins/router-entrypoints.mjs.map +1 -0
  373. package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs +59 -0
  374. package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs.map +1 -0
  375. package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs +132 -0
  376. package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs.map +1 -0
  377. package/dist/plugins/seal/codegen.d.mts +19 -0
  378. package/dist/plugins/seal/codegen.mjs +16 -0
  379. package/dist/plugins/seal/codegen.mjs.map +1 -0
  380. package/dist/plugins/seal/config-render.mjs +82 -0
  381. package/dist/plugins/seal/config-render.mjs.map +1 -0
  382. package/dist/plugins/seal/deploy.mjs +198 -0
  383. package/dist/plugins/seal/deploy.mjs.map +1 -0
  384. package/dist/plugins/seal/errors.d.mts +52 -0
  385. package/dist/plugins/seal/errors.mjs +19 -0
  386. package/dist/plugins/seal/errors.mjs.map +1 -0
  387. package/dist/plugins/seal/index.d.mts +161 -0
  388. package/dist/plugins/seal/index.mjs +235 -0
  389. package/dist/plugins/seal/index.mjs.map +1 -0
  390. package/dist/plugins/seal/key-manager.d.mts +22 -0
  391. package/dist/plugins/seal/key-manager.mjs +22 -0
  392. package/dist/plugins/seal/key-manager.mjs.map +1 -0
  393. package/dist/plugins/seal/key-server.mjs +175 -0
  394. package/dist/plugins/seal/key-server.mjs.map +1 -0
  395. package/dist/plugins/seal/keygen.mjs +96 -0
  396. package/dist/plugins/seal/keygen.mjs.map +1 -0
  397. package/dist/plugins/seal/mode/fork-known.d.mts +8 -0
  398. package/dist/plugins/seal/mode/fork-known.mjs +23 -0
  399. package/dist/plugins/seal/mode/fork-known.mjs.map +1 -0
  400. package/dist/plugins/seal/mode/live.d.mts +18 -0
  401. package/dist/plugins/seal/mode/live.mjs +64 -0
  402. package/dist/plugins/seal/mode/live.mjs.map +1 -0
  403. package/dist/plugins/seal/mode/local-keygen.mjs +180 -0
  404. package/dist/plugins/seal/mode/local-keygen.mjs.map +1 -0
  405. package/dist/plugins/seal/plugin-key.mjs +7 -0
  406. package/dist/plugins/seal/plugin-key.mjs.map +1 -0
  407. package/dist/plugins/seal/registry-publish.d.mts +43 -0
  408. package/dist/plugins/seal/registry-publish.mjs +9 -0
  409. package/dist/plugins/seal/registry-publish.mjs.map +1 -0
  410. package/dist/plugins/seal/routable.mjs +57 -0
  411. package/dist/plugins/seal/routable.mjs.map +1 -0
  412. package/dist/plugins/seal/service.mjs +17 -0
  413. package/dist/plugins/seal/service.mjs.map +1 -0
  414. package/dist/plugins/seal/snapshot.mjs +51 -0
  415. package/dist/plugins/seal/snapshot.mjs.map +1 -0
  416. package/dist/plugins/sui/auto-tick.mjs +45 -0
  417. package/dist/plugins/sui/auto-tick.mjs.map +1 -0
  418. package/dist/plugins/sui/chain-build-container.d.mts +1 -0
  419. package/dist/plugins/sui/chain-probe.d.mts +85 -0
  420. package/dist/plugins/sui/chain-probe.mjs +104 -0
  421. package/dist/plugins/sui/chain-probe.mjs.map +1 -0
  422. package/dist/plugins/sui/codegen.d.mts +14 -0
  423. package/dist/plugins/sui/codegen.mjs +26 -0
  424. package/dist/plugins/sui/codegen.mjs.map +1 -0
  425. package/dist/plugins/sui/errors.d.mts +74 -0
  426. package/dist/plugins/sui/errors.mjs +28 -0
  427. package/dist/plugins/sui/errors.mjs.map +1 -0
  428. package/dist/plugins/sui/fork-orchestration.mjs +24 -0
  429. package/dist/plugins/sui/fork-orchestration.mjs.map +1 -0
  430. package/dist/plugins/sui/fork-transaction.mjs +96 -0
  431. package/dist/plugins/sui/fork-transaction.mjs.map +1 -0
  432. package/dist/plugins/sui/index.d.mts +318 -0
  433. package/dist/plugins/sui/index.mjs +182 -0
  434. package/dist/plugins/sui/index.mjs.map +1 -0
  435. package/dist/plugins/sui/mode/external.mjs +60 -0
  436. package/dist/plugins/sui/mode/external.mjs.map +1 -0
  437. package/dist/plugins/sui/mode/fork.mjs +283 -0
  438. package/dist/plugins/sui/mode/fork.mjs.map +1 -0
  439. package/dist/plugins/sui/mode/live.mjs +103 -0
  440. package/dist/plugins/sui/mode/live.mjs.map +1 -0
  441. package/dist/plugins/sui/mode/local.mjs +293 -0
  442. package/dist/plugins/sui/mode/local.mjs.map +1 -0
  443. package/dist/plugins/sui/mode/shared-boot.mjs +254 -0
  444. package/dist/plugins/sui/mode/shared-boot.mjs.map +1 -0
  445. package/dist/plugins/sui/mode/shared.d.mts +103 -0
  446. package/dist/plugins/sui/mode/shared.mjs +12 -0
  447. package/dist/plugins/sui/mode/shared.mjs.map +1 -0
  448. package/dist/plugins/sui/mode/spec.d.mts +94 -0
  449. package/dist/plugins/sui/network-resolver.d.mts +23 -0
  450. package/dist/plugins/sui/routable.mjs +88 -0
  451. package/dist/plugins/sui/routable.mjs.map +1 -0
  452. package/dist/plugins/sui/seed-objects.d.mts +18 -0
  453. package/dist/plugins/sui/seed-objects.mjs +25 -0
  454. package/dist/plugins/sui/seed-objects.mjs.map +1 -0
  455. package/dist/plugins/sui/service.mjs +38 -0
  456. package/dist/plugins/sui/service.mjs.map +1 -0
  457. package/dist/plugins/sui/snapshot.mjs +53 -0
  458. package/dist/plugins/sui/snapshot.mjs.map +1 -0
  459. package/dist/plugins/wallet/codegen.d.mts +33 -0
  460. package/dist/plugins/wallet/codegen.mjs +34 -0
  461. package/dist/plugins/wallet/codegen.mjs.map +1 -0
  462. package/dist/plugins/wallet/errors.d.mts +66 -0
  463. package/dist/plugins/wallet/errors.mjs +16 -0
  464. package/dist/plugins/wallet/errors.mjs.map +1 -0
  465. package/dist/plugins/wallet/index.d.mts +63 -0
  466. package/dist/plugins/wallet/index.mjs +126 -0
  467. package/dist/plugins/wallet/index.mjs.map +1 -0
  468. package/dist/plugins/wallet/origin-policy.d.mts +1 -0
  469. package/dist/plugins/wallet/origin-policy.mjs +65 -0
  470. package/dist/plugins/wallet/origin-policy.mjs.map +1 -0
  471. package/dist/plugins/wallet/pairing.d.mts +11 -0
  472. package/dist/plugins/wallet/pairing.mjs +125 -0
  473. package/dist/plugins/wallet/pairing.mjs.map +1 -0
  474. package/dist/plugins/wallet/protocol.d.mts +1 -0
  475. package/dist/plugins/wallet/protocol.mjs +96 -0
  476. package/dist/plugins/wallet/protocol.mjs.map +1 -0
  477. package/dist/plugins/wallet/routable.mjs +32 -0
  478. package/dist/plugins/wallet/routable.mjs.map +1 -0
  479. package/dist/plugins/wallet/server.d.mts +12 -0
  480. package/dist/plugins/wallet/server.mjs +317 -0
  481. package/dist/plugins/wallet/server.mjs.map +1 -0
  482. package/dist/plugins/wallet/service.d.mts +68 -0
  483. package/dist/plugins/wallet/service.mjs +97 -0
  484. package/dist/plugins/wallet/service.mjs.map +1 -0
  485. package/dist/plugins/wallet/snapshot.d.mts +1 -0
  486. package/dist/plugins/wallet/snapshot.mjs +14 -0
  487. package/dist/plugins/wallet/snapshot.mjs.map +1 -0
  488. package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs +42 -0
  489. package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs.map +1 -0
  490. package/dist/plugins/walrus/codegen.d.mts +38 -0
  491. package/dist/plugins/walrus/codegen.mjs +34 -0
  492. package/dist/plugins/walrus/codegen.mjs.map +1 -0
  493. package/dist/plugins/walrus/deploy-paths.mjs +14 -0
  494. package/dist/plugins/walrus/deploy-paths.mjs.map +1 -0
  495. package/dist/plugins/walrus/deploy.d.mts +1 -0
  496. package/dist/plugins/walrus/deploy.mjs +224 -0
  497. package/dist/plugins/walrus/deploy.mjs.map +1 -0
  498. package/dist/plugins/walrus/errors.d.mts +38 -0
  499. package/dist/plugins/walrus/errors.mjs +26 -0
  500. package/dist/plugins/walrus/errors.mjs.map +1 -0
  501. package/dist/plugins/walrus/faucet-strategy.d.mts +12 -0
  502. package/dist/plugins/walrus/faucet-strategy.mjs +62 -0
  503. package/dist/plugins/walrus/faucet-strategy.mjs.map +1 -0
  504. package/dist/plugins/walrus/index.d.mts +177 -0
  505. package/dist/plugins/walrus/index.mjs +284 -0
  506. package/dist/plugins/walrus/index.mjs.map +1 -0
  507. package/dist/plugins/walrus/mode/known-deploy.d.mts +25 -0
  508. package/dist/plugins/walrus/mode/known-deploy.mjs +71 -0
  509. package/dist/plugins/walrus/mode/known-deploy.mjs.map +1 -0
  510. package/dist/plugins/walrus/mode/local-cluster.d.mts +34 -0
  511. package/dist/plugins/walrus/mode/local-cluster.mjs +153 -0
  512. package/dist/plugins/walrus/mode/local-cluster.mjs.map +1 -0
  513. package/dist/plugins/walrus/plugin-key.mjs +7 -0
  514. package/dist/plugins/walrus/plugin-key.mjs.map +1 -0
  515. package/dist/plugins/walrus/registry-publish.d.mts +24 -0
  516. package/dist/plugins/walrus/registry-publish.mjs +7 -0
  517. package/dist/plugins/walrus/registry-publish.mjs.map +1 -0
  518. package/dist/plugins/walrus/routable.mjs +99 -0
  519. package/dist/plugins/walrus/routable.mjs.map +1 -0
  520. package/dist/plugins/walrus/service.mjs +20 -0
  521. package/dist/plugins/walrus/service.mjs.map +1 -0
  522. package/dist/plugins/walrus/snapshot.mjs +53 -0
  523. package/dist/plugins/walrus/snapshot.mjs.map +1 -0
  524. package/dist/plugins/walrus/storage-nodes.d.mts +15 -0
  525. package/dist/plugins/walrus/storage-nodes.mjs +154 -0
  526. package/dist/plugins/walrus/storage-nodes.mjs.map +1 -0
  527. package/dist/plugins/walrus/wal-swap.d.mts +2 -0
  528. package/dist/plugins/walrus/wal-swap.mjs +58 -0
  529. package/dist/plugins/walrus/wal-swap.mjs.map +1 -0
  530. package/dist/primitives/artifact-publisher.d.mts +12 -0
  531. package/dist/primitives/cache.d.mts +1 -0
  532. package/dist/runtime/built-in-plugin-layers.mjs +49 -0
  533. package/dist/runtime/built-in-plugin-layers.mjs.map +1 -0
  534. package/dist/runtime/docker/client.d.mts +2 -0
  535. package/dist/runtime/docker/client.mjs +54 -0
  536. package/dist/runtime/docker/client.mjs.map +1 -0
  537. package/dist/runtime/docker/container.d.mts +1 -0
  538. package/dist/runtime/docker/container.mjs +562 -0
  539. package/dist/runtime/docker/container.mjs.map +1 -0
  540. package/dist/runtime/docker/errors.d.mts +1 -0
  541. package/dist/runtime/docker/errors.mjs +187 -0
  542. package/dist/runtime/docker/errors.mjs.map +1 -0
  543. package/dist/runtime/docker/exec.d.mts +1 -0
  544. package/dist/runtime/docker/exec.mjs +63 -0
  545. package/dist/runtime/docker/exec.mjs.map +1 -0
  546. package/dist/runtime/docker/image.d.mts +1 -0
  547. package/dist/runtime/docker/image.mjs +278 -0
  548. package/dist/runtime/docker/image.mjs.map +1 -0
  549. package/dist/runtime/docker/index.d.mts +1 -0
  550. package/dist/runtime/docker/inventory.d.mts +1 -0
  551. package/dist/runtime/docker/inventory.mjs +167 -0
  552. package/dist/runtime/docker/inventory.mjs.map +1 -0
  553. package/dist/runtime/docker/labels.d.mts +1 -0
  554. package/dist/runtime/docker/labels.mjs +97 -0
  555. package/dist/runtime/docker/labels.mjs.map +1 -0
  556. package/dist/runtime/docker/logs.d.mts +1 -0
  557. package/dist/runtime/docker/logs.mjs +34 -0
  558. package/dist/runtime/docker/logs.mjs.map +1 -0
  559. package/dist/runtime/docker/network.d.mts +1 -0
  560. package/dist/runtime/docker/network.mjs +168 -0
  561. package/dist/runtime/docker/network.mjs.map +1 -0
  562. package/dist/runtime/docker/service.d.mts +9 -0
  563. package/dist/runtime/docker/service.mjs +266 -0
  564. package/dist/runtime/docker/service.mjs.map +1 -0
  565. package/dist/runtime/docker/sweep.d.mts +1 -0
  566. package/dist/runtime/docker/sweep.mjs +220 -0
  567. package/dist/runtime/docker/sweep.mjs.map +1 -0
  568. package/dist/runtime/docker/volume.d.mts +1 -0
  569. package/dist/runtime/docker/volume.mjs +24 -0
  570. package/dist/runtime/docker/volume.mjs.map +1 -0
  571. package/dist/runtime/docker/wrap.d.mts +1 -0
  572. package/dist/runtime/docker/wrap.mjs +131 -0
  573. package/dist/runtime/docker/wrap.mjs.map +1 -0
  574. package/dist/substrate/brand.d.mts +24 -0
  575. package/dist/substrate/brand.mjs +14 -0
  576. package/dist/substrate/brand.mjs.map +1 -0
  577. package/dist/substrate/cross-process.d.mts +1 -0
  578. package/dist/substrate/cross-process.mjs +28 -0
  579. package/dist/substrate/cross-process.mjs.map +1 -0
  580. package/dist/substrate/events.d.mts +117 -0
  581. package/dist/substrate/identity.d.mts +13 -0
  582. package/dist/substrate/lifecycle.d.mts +12 -0
  583. package/dist/substrate/manifest.d.mts +39 -0
  584. package/dist/substrate/manifest.mjs +33 -0
  585. package/dist/substrate/manifest.mjs.map +1 -0
  586. package/dist/substrate/network.d.mts +34 -0
  587. package/dist/substrate/options.d.mts +23 -0
  588. package/dist/substrate/plugin.d.mts +101 -0
  589. package/dist/substrate/plugin.mjs +61 -0
  590. package/dist/substrate/plugin.mjs.map +1 -0
  591. package/dist/substrate/projection.d.mts +100 -0
  592. package/dist/substrate/runtime/artifact-publisher/index.mjs +76 -0
  593. package/dist/substrate/runtime/artifact-publisher/index.mjs.map +1 -0
  594. package/dist/substrate/runtime/atomic-write.mjs +106 -0
  595. package/dist/substrate/runtime/atomic-write.mjs.map +1 -0
  596. package/dist/substrate/runtime/cache/index.d.mts +1 -0
  597. package/dist/substrate/runtime/cache/schema.d.mts +1 -0
  598. package/dist/substrate/runtime/cache/schema.mjs +22 -0
  599. package/dist/substrate/runtime/cache/schema.mjs.map +1 -0
  600. package/dist/substrate/runtime/cache/service.d.mts +1 -0
  601. package/dist/substrate/runtime/cache/service.mjs +89 -0
  602. package/dist/substrate/runtime/cache/service.mjs.map +1 -0
  603. package/dist/substrate/runtime/capability-sinks/index.d.mts +1 -0
  604. package/dist/substrate/runtime/capability-sinks/layer.d.mts +1 -0
  605. package/dist/substrate/runtime/capability-sinks/layer.mjs +31 -0
  606. package/dist/substrate/runtime/capability-sinks/layer.mjs.map +1 -0
  607. package/dist/substrate/runtime/capability-sinks/service.d.mts +36 -0
  608. package/dist/substrate/runtime/capability-sinks/service.mjs +74 -0
  609. package/dist/substrate/runtime/capability-sinks/service.mjs.map +1 -0
  610. package/dist/substrate/runtime/config-validation.d.mts +38 -0
  611. package/dist/substrate/runtime/config-validation.mjs +137 -0
  612. package/dist/substrate/runtime/config-validation.mjs.map +1 -0
  613. package/dist/substrate/runtime/context-helpers.mjs +32 -0
  614. package/dist/substrate/runtime/context-helpers.mjs.map +1 -0
  615. package/dist/substrate/runtime/cross-process/command-channel/channel.mjs +128 -0
  616. package/dist/substrate/runtime/cross-process/command-channel/channel.mjs.map +1 -0
  617. package/dist/substrate/runtime/cross-process/command-channel/file-channel.mjs +136 -0
  618. package/dist/substrate/runtime/cross-process/command-channel/file-channel.mjs.map +1 -0
  619. package/dist/substrate/runtime/cross-process/command-channel/protocol.mjs +49 -0
  620. package/dist/substrate/runtime/cross-process/command-channel/protocol.mjs.map +1 -0
  621. package/dist/substrate/runtime/cross-process/command-channel/runtime-control-lock.mjs +9 -0
  622. package/dist/substrate/runtime/cross-process/command-channel/runtime-control-lock.mjs.map +1 -0
  623. package/dist/substrate/runtime/cross-process/liveness.mjs +119 -0
  624. package/dist/substrate/runtime/cross-process/liveness.mjs.map +1 -0
  625. package/dist/substrate/runtime/cross-process/roster.mjs +275 -0
  626. package/dist/substrate/runtime/cross-process/roster.mjs.map +1 -0
  627. package/dist/substrate/runtime/cross-process/snapshot-reservation.d.mts +1 -0
  628. package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs +117 -0
  629. package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs.map +1 -0
  630. package/dist/substrate/runtime/cross-process/stack-lock.d.mts +1 -0
  631. package/dist/substrate/runtime/cross-process/stack-lock.mjs +142 -0
  632. package/dist/substrate/runtime/cross-process/stack-lock.mjs.map +1 -0
  633. package/dist/substrate/runtime/current-plugin.mjs +15 -0
  634. package/dist/substrate/runtime/current-plugin.mjs.map +1 -0
  635. package/dist/substrate/runtime/errors.d.mts +1 -0
  636. package/dist/substrate/runtime/errors.mjs +76 -0
  637. package/dist/substrate/runtime/errors.mjs.map +1 -0
  638. package/dist/substrate/runtime/host-tree-tar/index.mjs +364 -0
  639. package/dist/substrate/runtime/host-tree-tar/index.mjs.map +1 -0
  640. package/dist/substrate/runtime/http-probe.d.mts +35 -0
  641. package/dist/substrate/runtime/http-probe.mjs +65 -0
  642. package/dist/substrate/runtime/http-probe.mjs.map +1 -0
  643. package/dist/substrate/runtime/lease-broker/index.d.mts +1 -0
  644. package/dist/substrate/runtime/lease-broker/service.d.mts +64 -0
  645. package/dist/substrate/runtime/lease-broker/service.mjs +155 -0
  646. package/dist/substrate/runtime/lease-broker/service.mjs.map +1 -0
  647. package/dist/substrate/runtime/lifecycle/dep-graph.d.mts +1 -0
  648. package/dist/substrate/runtime/lifecycle/dep-graph.mjs +138 -0
  649. package/dist/substrate/runtime/lifecycle/dep-graph.mjs.map +1 -0
  650. package/dist/substrate/runtime/lifecycle/index.d.mts +1 -0
  651. package/dist/substrate/runtime/lifecycle/lifecycle-fact.mjs +31 -0
  652. package/dist/substrate/runtime/lifecycle/lifecycle-fact.mjs.map +1 -0
  653. package/dist/substrate/runtime/lifecycle/plugin-registry.d.mts +1 -0
  654. package/dist/substrate/runtime/lifecycle/plugin-registry.mjs +133 -0
  655. package/dist/substrate/runtime/lifecycle/plugin-registry.mjs.map +1 -0
  656. package/dist/substrate/runtime/lifecycle/ready-gate.d.mts +1 -0
  657. package/dist/substrate/runtime/lifecycle/ready-gate.mjs +34 -0
  658. package/dist/substrate/runtime/lifecycle/ready-gate.mjs.map +1 -0
  659. package/dist/substrate/runtime/lifecycle/selective-restart.d.mts +1 -0
  660. package/dist/substrate/runtime/lifecycle/selective-restart.mjs +43 -0
  661. package/dist/substrate/runtime/lifecycle/selective-restart.mjs.map +1 -0
  662. package/dist/substrate/runtime/lifecycle/signals.d.mts +1 -0
  663. package/dist/substrate/runtime/lifecycle/signals.mjs +64 -0
  664. package/dist/substrate/runtime/lifecycle/signals.mjs.map +1 -0
  665. package/dist/substrate/runtime/lifecycle/state-machine.d.mts +1 -0
  666. package/dist/substrate/runtime/lifecycle/state-machine.mjs +38 -0
  667. package/dist/substrate/runtime/lifecycle/state-machine.mjs.map +1 -0
  668. package/dist/substrate/runtime/lifecycle/watch-attribution.d.mts +1 -0
  669. package/dist/substrate/runtime/lifecycle/watch-attribution.mjs +27 -0
  670. package/dist/substrate/runtime/lifecycle/watch-attribution.mjs.map +1 -0
  671. package/dist/substrate/runtime/managed-container.d.mts +30 -0
  672. package/dist/substrate/runtime/managed-container.mjs +32 -0
  673. package/dist/substrate/runtime/managed-container.mjs.map +1 -0
  674. package/dist/substrate/runtime/manifest/manifest.mjs +73 -0
  675. package/dist/substrate/runtime/manifest/manifest.mjs.map +1 -0
  676. package/dist/substrate/runtime/mode-errors.d.mts +36 -0
  677. package/dist/substrate/runtime/observability/cascade-formatter.d.mts +1 -0
  678. package/dist/substrate/runtime/observability/cascade-formatter.mjs +135 -0
  679. package/dist/substrate/runtime/observability/cascade-formatter.mjs.map +1 -0
  680. package/dist/substrate/runtime/observability/formatter-registry.d.mts +1 -0
  681. package/dist/substrate/runtime/observability/formatter-registry.mjs +65 -0
  682. package/dist/substrate/runtime/observability/formatter-registry.mjs.map +1 -0
  683. package/dist/substrate/runtime/observability/index.d.mts +3 -0
  684. package/dist/substrate/runtime/observability/logger.d.mts +58 -0
  685. package/dist/substrate/runtime/observability/logger.mjs +89 -0
  686. package/dist/substrate/runtime/observability/logger.mjs.map +1 -0
  687. package/dist/substrate/runtime/observability/pretty-error.d.mts +1 -0
  688. package/dist/substrate/runtime/observability/pretty-error.mjs +119 -0
  689. package/dist/substrate/runtime/observability/pretty-error.mjs.map +1 -0
  690. package/dist/substrate/runtime/observability/process-lines.d.mts +31 -0
  691. package/dist/substrate/runtime/observability/process-lines.mjs +40 -0
  692. package/dist/substrate/runtime/observability/process-lines.mjs.map +1 -0
  693. package/dist/substrate/runtime/observability/redaction.d.mts +28 -0
  694. package/dist/substrate/runtime/observability/redaction.mjs +45 -0
  695. package/dist/substrate/runtime/observability/redaction.mjs.map +1 -0
  696. package/dist/substrate/runtime/observability/spans.d.mts +1 -0
  697. package/dist/substrate/runtime/observability/spans.mjs +87 -0
  698. package/dist/substrate/runtime/observability/spans.mjs.map +1 -0
  699. package/dist/substrate/runtime/observability/subprocess-capture.d.mts +2 -0
  700. package/dist/substrate/runtime/observability/subprocess-capture.mjs +82 -0
  701. package/dist/substrate/runtime/observability/subprocess-capture.mjs.map +1 -0
  702. package/dist/substrate/runtime/paths.d.mts +17 -0
  703. package/dist/substrate/runtime/paths.mjs +61 -0
  704. package/dist/substrate/runtime/paths.mjs.map +1 -0
  705. package/dist/substrate/runtime/port-broker/index.d.mts +1 -0
  706. package/dist/substrate/runtime/port-broker/service.d.mts +1 -0
  707. package/dist/substrate/runtime/port-broker/service.mjs +319 -0
  708. package/dist/substrate/runtime/port-broker/service.mjs.map +1 -0
  709. package/dist/substrate/runtime/post-acquire-tasks.d.mts +1 -0
  710. package/dist/substrate/runtime/post-acquire-tasks.mjs +34 -0
  711. package/dist/substrate/runtime/post-acquire-tasks.mjs.map +1 -0
  712. package/dist/substrate/runtime/probes.d.mts +51 -0
  713. package/dist/substrate/runtime/probes.mjs +84 -0
  714. package/dist/substrate/runtime/probes.mjs.map +1 -0
  715. package/dist/substrate/runtime/process-supervisor.d.mts +57 -0
  716. package/dist/substrate/runtime/process-supervisor.mjs +73 -0
  717. package/dist/substrate/runtime/process-supervisor.mjs.map +1 -0
  718. package/dist/substrate/runtime/projection/operational-endpoints.mjs +44 -0
  719. package/dist/substrate/runtime/projection/operational-endpoints.mjs.map +1 -0
  720. package/dist/substrate/runtime/projection/persisted.mjs +195 -0
  721. package/dist/substrate/runtime/projection/persisted.mjs.map +1 -0
  722. package/dist/substrate/runtime/projection/state-ref.mjs +48 -0
  723. package/dist/substrate/runtime/projection/state-ref.mjs.map +1 -0
  724. package/dist/substrate/runtime/projection/update.mjs +200 -0
  725. package/dist/substrate/runtime/projection/update.mjs.map +1 -0
  726. package/dist/substrate/runtime/retry-policy.d.mts +18 -0
  727. package/dist/substrate/runtime/retry-policy.mjs +16 -0
  728. package/dist/substrate/runtime/retry-policy.mjs.map +1 -0
  729. package/dist/substrate/runtime/run.mjs +86 -0
  730. package/dist/substrate/runtime/run.mjs.map +1 -0
  731. package/dist/substrate/runtime/runtime-decode.d.mts +32 -0
  732. package/dist/substrate/runtime/runtime-decode.mjs +53 -0
  733. package/dist/substrate/runtime/runtime-decode.mjs.map +1 -0
  734. package/dist/substrate/runtime/scoped-http-server.mjs +36 -0
  735. package/dist/substrate/runtime/scoped-http-server.mjs.map +1 -0
  736. package/dist/substrate/runtime/scoped-ref-map/service.mjs +83 -0
  737. package/dist/substrate/runtime/scoped-ref-map/service.mjs.map +1 -0
  738. package/dist/substrate/runtime/stage-and-swap/index.d.mts +1 -0
  739. package/dist/substrate/runtime/stage-and-swap/index.mjs +131 -0
  740. package/dist/substrate/runtime/stage-and-swap/index.mjs.map +1 -0
  741. package/dist/substrate/runtime/state-store/schema.mjs +36 -0
  742. package/dist/substrate/runtime/state-store/schema.mjs.map +1 -0
  743. package/dist/substrate/runtime/strategy-registry/chain-probe-for.d.mts +1 -0
  744. package/dist/substrate/runtime/strategy-registry/chain-probe-for.mjs +22 -0
  745. package/dist/substrate/runtime/strategy-registry/chain-probe-for.mjs.map +1 -0
  746. package/dist/substrate/runtime/strategy-registry/faucet-capability-for.d.mts +1 -0
  747. package/dist/substrate/runtime/strategy-registry/faucet-capability-for.mjs +30 -0
  748. package/dist/substrate/runtime/strategy-registry/faucet-capability-for.mjs.map +1 -0
  749. package/dist/substrate/runtime/strategy-registry/index.d.mts +1 -0
  750. package/dist/substrate/runtime/strategy-registry/service.d.mts +1 -0
  751. package/dist/substrate/runtime/strategy-registry/service.mjs +67 -0
  752. package/dist/substrate/runtime/strategy-registry/service.mjs.map +1 -0
  753. package/dist/substrate/runtime/sui-execute/index.d.mts +11 -0
  754. package/dist/substrate/runtime/sui-execute/index.mjs +144 -0
  755. package/dist/substrate/runtime/sui-execute/index.mjs.map +1 -0
  756. package/dist/substrate/runtime/sui-move-build/index.d.mts +1 -0
  757. package/dist/substrate/runtime/sui-move-build/index.mjs +283 -0
  758. package/dist/substrate/runtime/sui-move-build/index.mjs.map +1 -0
  759. package/dist/substrate/runtime/supervisor.d.mts +1 -0
  760. package/dist/substrate/runtime/supervisor.mjs +831 -0
  761. package/dist/substrate/runtime/supervisor.mjs.map +1 -0
  762. package/dist/surfaces/cli/command-tree.mjs +276 -0
  763. package/dist/surfaces/cli/command-tree.mjs.map +1 -0
  764. package/dist/surfaces/cli/commands/config.mjs +31 -0
  765. package/dist/surfaces/cli/commands/config.mjs.map +1 -0
  766. package/dist/surfaces/cli/commands/confirm-node.mjs +26 -0
  767. package/dist/surfaces/cli/commands/confirm-node.mjs.map +1 -0
  768. package/dist/surfaces/cli/commands/confirm.mjs +26 -0
  769. package/dist/surfaces/cli/commands/confirm.mjs.map +1 -0
  770. package/dist/surfaces/cli/commands/doctor-probes.mjs +452 -0
  771. package/dist/surfaces/cli/commands/doctor-probes.mjs.map +1 -0
  772. package/dist/surfaces/cli/commands/doctor.mjs +38 -0
  773. package/dist/surfaces/cli/commands/doctor.mjs.map +1 -0
  774. package/dist/surfaces/cli/commands/prune-picker.mjs +347 -0
  775. package/dist/surfaces/cli/commands/prune-picker.mjs.map +1 -0
  776. package/dist/surfaces/cli/commands/prune.mjs +178 -0
  777. package/dist/surfaces/cli/commands/prune.mjs.map +1 -0
  778. package/dist/surfaces/cli/commands/snapshot.mjs +141 -0
  779. package/dist/surfaces/cli/commands/snapshot.mjs.map +1 -0
  780. package/dist/surfaces/cli/commands/status.mjs +95 -0
  781. package/dist/surfaces/cli/commands/status.mjs.map +1 -0
  782. package/dist/surfaces/cli/commands/supervisor-presence.mjs +33 -0
  783. package/dist/surfaces/cli/commands/supervisor-presence.mjs.map +1 -0
  784. package/dist/surfaces/cli/commands/wipe.mjs +28 -0
  785. package/dist/surfaces/cli/commands/wipe.mjs.map +1 -0
  786. package/dist/surfaces/cli/envelope.mjs +43 -0
  787. package/dist/surfaces/cli/envelope.mjs.map +1 -0
  788. package/dist/surfaces/cli/errors.mjs +110 -0
  789. package/dist/surfaces/cli/errors.mjs.map +1 -0
  790. package/dist/surfaces/cli/flags.mjs +56 -0
  791. package/dist/surfaces/cli/flags.mjs.map +1 -0
  792. package/dist/surfaces/cli/index.mjs +418 -0
  793. package/dist/surfaces/cli/index.mjs.map +1 -0
  794. package/dist/surfaces/cli/output.mjs +115 -0
  795. package/dist/surfaces/cli/output.mjs.map +1 -0
  796. package/dist/surfaces/cli/sysexits.mjs +139 -0
  797. package/dist/surfaces/cli/sysexits.mjs.map +1 -0
  798. package/dist/surfaces/tui/app.mjs +104 -0
  799. package/dist/surfaces/tui/app.mjs.map +1 -0
  800. package/dist/surfaces/tui/dashboard.mjs +261 -0
  801. package/dist/surfaces/tui/dashboard.mjs.map +1 -0
  802. package/dist/surfaces/tui/display-derivation.mjs +395 -0
  803. package/dist/surfaces/tui/display-derivation.mjs.map +1 -0
  804. package/dist/surfaces/tui/errors.mjs +11 -0
  805. package/dist/surfaces/tui/errors.mjs.map +1 -0
  806. package/dist/surfaces/tui/event-log.mjs +155 -0
  807. package/dist/surfaces/tui/event-log.mjs.map +1 -0
  808. package/dist/surfaces/tui/heartbeat.mjs +33 -0
  809. package/dist/surfaces/tui/heartbeat.mjs.map +1 -0
  810. package/dist/surfaces/tui/index.mjs +50 -0
  811. package/dist/surfaces/tui/index.mjs.map +1 -0
  812. package/dist/surfaces/tui/input.mjs +104 -0
  813. package/dist/surfaces/tui/input.mjs.map +1 -0
  814. package/dist/surfaces/tui/mode-detect.mjs +32 -0
  815. package/dist/surfaces/tui/mode-detect.mjs.map +1 -0
  816. package/dist/surfaces/tui/mount-ink.mjs +31 -0
  817. package/dist/surfaces/tui/mount-ink.mjs.map +1 -0
  818. package/dist/surfaces/tui/plain-renderer.mjs +170 -0
  819. package/dist/surfaces/tui/plain-renderer.mjs.map +1 -0
  820. package/dist/surfaces/tui/resource-table.mjs +507 -0
  821. package/dist/surfaces/tui/resource-table.mjs.map +1 -0
  822. package/images/_shared/signal-forward.sh +77 -0
  823. package/images/postgres/Dockerfile +32 -0
  824. package/images/seal/Dockerfile +68 -0
  825. package/images/seal/entrypoint.sh +65 -0
  826. package/images/sui/Dockerfile +73 -0
  827. package/images/sui/entrypoint.sh +244 -0
  828. package/images/sui-fork/Dockerfile +53 -0
  829. package/images/sui-fork/entrypoint.sh +51 -0
  830. package/images/walrus/Dockerfile +122 -0
  831. package/images/walrus/deploy-walrus.sh +305 -0
  832. package/images/walrus/run-walrus.sh +53 -0
  833. package/package.json +94 -0
@@ -0,0 +1,141 @@
1
+ import { CliInternalError, CliSnapshotAmbiguousError, CliSnapshotNotFoundError, CliUsageError, isCliError } from "../errors.mjs";
2
+ import { takePositional, takeValueFlag } from "../flags.mjs";
3
+ import { emitSuccess } from "../output.mjs";
4
+ import { confirmDestructive } from "./confirm.mjs";
5
+ import { Effect } from "effect";
6
+ //#region src/surfaces/cli/commands/snapshot.ts
7
+ /** Snapshot subcommand dispatcher. `ctx.flags.rest` holds the
8
+ * sub-verb + verb-local arguments. */
9
+ const runSnapshot = (deps, ctx) => Effect.gen(function* () {
10
+ const [sub, ...rest] = ctx.flags.rest;
11
+ switch (sub) {
12
+ case "save": return yield* runSnapshotSave(deps, ctx, rest);
13
+ case "restore": return yield* runSnapshotRestore(deps, ctx, rest);
14
+ case "list": return yield* runSnapshotList(deps, ctx);
15
+ case "delete": return yield* runSnapshotDelete(deps, ctx, rest);
16
+ default: return yield* Effect.fail(new CliUsageError({
17
+ message: `unknown snapshot subcommand: ${sub ?? "(missing)"}`,
18
+ hint: "try: snapshot save [name] | restore <name-or-id> | list | delete <name-or-id>"
19
+ }));
20
+ }
21
+ }).pipe(Effect.withSpan("cli.snapshot"));
22
+ const runSnapshotSave = (deps, ctx, rest) => Effect.gen(function* () {
23
+ const started = Date.now();
24
+ const { value: flagName, tail: afterName } = takeValueFlag(rest, "name");
25
+ const { head: positionalName, tail: afterSnapshotName } = takePositional(afterName);
26
+ const extra = afterSnapshotName.find((tok) => !tok.startsWith("-"));
27
+ if (extra !== void 0) return yield* Effect.fail(new CliUsageError({
28
+ message: `unexpected snapshot save argument: ${extra}`,
29
+ hint: "try: snapshot save [name]"
30
+ }));
31
+ if (flagName !== void 0 && positionalName !== void 0) return yield* Effect.fail(new CliUsageError({
32
+ message: "snapshot save accepts a name either positionally or with --name, not both",
33
+ hint: "try: snapshot save [name]"
34
+ }));
35
+ const name = flagName ?? positionalName;
36
+ const captured = yield* deps.capture({
37
+ ...name === void 0 ? {} : { name },
38
+ ...ctx.flags.configPath === void 0 ? {} : { configPath: ctx.flags.configPath }
39
+ }).pipe(Effect.catch((cause) => isCliError(cause) ? Effect.fail(cause) : isSnapshotInputError(cause) ? Effect.fail(snapshotInputCliError(cause)) : Effect.fail(new CliInternalError({
40
+ message: "snapshot capture failed",
41
+ cause
42
+ }))));
43
+ yield* emitSuccess(ctx.io, ctx.flags.outputMode, {
44
+ command: "snapshot save",
45
+ elapsedMs: Date.now() - started,
46
+ data: {
47
+ snapshotId: captured.snapshotId,
48
+ name: captured.name
49
+ },
50
+ humanLines: [`snapshot saved ${captured.name} (${captured.snapshotId})`]
51
+ });
52
+ return { exitCode: 0 };
53
+ });
54
+ const runSnapshotRestore = (deps, ctx, rest) => Effect.gen(function* () {
55
+ const started = Date.now();
56
+ const snapshotRef = rest.find((tok) => !tok.startsWith("-"));
57
+ if (snapshotRef === void 0) return yield* Effect.fail(new CliUsageError({
58
+ message: "snapshot restore requires a snapshot name or id",
59
+ hint: "snapshot list to enumerate available names and ids"
60
+ }));
61
+ const resolved = yield* deps.reader.resolve(snapshotRef);
62
+ if (resolved.tag === "not-found") return yield* Effect.fail(new CliSnapshotNotFoundError({ snapshotRef }));
63
+ if (resolved.tag === "ambiguous") return yield* Effect.fail(new CliSnapshotAmbiguousError({
64
+ snapshotRef,
65
+ matches: resolved.matches.map((entry) => entry.snapshotId)
66
+ }));
67
+ const entry = resolved.entry;
68
+ const snapshotId = entry.snapshotId;
69
+ yield* confirmDestructive(deps.confirm, ctx, {
70
+ verb: "snapshot restore",
71
+ prompt: entry.name === null ? `Restore snapshot ${snapshotId} and replace current stack state?` : `Restore snapshot ${entry.name} (${snapshotId}) and replace current stack state?`,
72
+ skipWhenDryRun: false
73
+ });
74
+ yield* deps.restore(snapshotId).pipe(Effect.catch((cause) => isCliError(cause) ? Effect.fail(cause) : Effect.fail(new CliInternalError({
75
+ message: "snapshot restore failed",
76
+ cause
77
+ }))));
78
+ yield* emitSuccess(ctx.io, ctx.flags.outputMode, {
79
+ command: "snapshot restore",
80
+ elapsedMs: Date.now() - started,
81
+ data: {
82
+ snapshotId,
83
+ name: entry.name
84
+ },
85
+ humanLines: [entry.name === null ? `snapshot restored ${snapshotId}` : `snapshot restored ${entry.name} (${snapshotId})`]
86
+ });
87
+ return { exitCode: 0 };
88
+ });
89
+ const runSnapshotList = (deps, ctx) => Effect.gen(function* () {
90
+ const started = Date.now();
91
+ const entries = yield* deps.reader.list();
92
+ const humanLines = entries.length === 0 ? ["(no snapshots)"] : entries.map((e) => `${e.name ?? "(unnamed)"} ${e.snapshotId} ${new Date(e.createdAt).toISOString()}`);
93
+ yield* emitSuccess(ctx.io, ctx.flags.outputMode, {
94
+ command: "snapshot list",
95
+ elapsedMs: Date.now() - started,
96
+ data: { entries },
97
+ humanLines
98
+ });
99
+ return { exitCode: 0 };
100
+ });
101
+ const runSnapshotDelete = (deps, ctx, rest) => Effect.gen(function* () {
102
+ const started = Date.now();
103
+ const snapshotRef = rest.find((tok) => !tok.startsWith("-"));
104
+ if (snapshotRef === void 0) return yield* Effect.fail(new CliUsageError({ message: "snapshot delete requires a snapshot name or id" }));
105
+ const resolved = yield* deps.reader.resolve(snapshotRef);
106
+ if (resolved.tag === "not-found") return yield* Effect.fail(new CliSnapshotNotFoundError({ snapshotRef }));
107
+ if (resolved.tag === "ambiguous") return yield* Effect.fail(new CliSnapshotAmbiguousError({
108
+ snapshotRef,
109
+ matches: resolved.matches.map((entry) => entry.snapshotId)
110
+ }));
111
+ const entry = resolved.entry;
112
+ const snapshotId = entry.snapshotId;
113
+ yield* confirmDestructive(deps.confirm, ctx, {
114
+ verb: "snapshot delete",
115
+ prompt: entry.name === null ? `Delete snapshot ${snapshotId}?` : `Delete snapshot ${entry.name} (${snapshotId})?`,
116
+ skipWhenDryRun: false
117
+ });
118
+ yield* deps.delete(snapshotId).pipe(Effect.catch((cause) => isCliError(cause) ? Effect.fail(cause) : Effect.fail(new CliInternalError({
119
+ message: "snapshot delete failed",
120
+ cause
121
+ }))));
122
+ yield* emitSuccess(ctx.io, ctx.flags.outputMode, {
123
+ command: "snapshot delete",
124
+ elapsedMs: Date.now() - started,
125
+ data: {
126
+ snapshotId,
127
+ name: entry.name
128
+ },
129
+ humanLines: [entry.name === null ? `snapshot deleted ${snapshotId}` : `snapshot deleted ${entry.name} (${snapshotId})`]
130
+ });
131
+ return { exitCode: 0 };
132
+ });
133
+ const isSnapshotInputError = (value) => typeof value === "object" && value !== null && value._tag === "SnapshotIdError";
134
+ const snapshotInputCliError = (error) => new CliUsageError({
135
+ message: `invalid snapshot ${error.field} for ${error.operation}: ${error.value}`,
136
+ hint: error.detail
137
+ });
138
+ //#endregion
139
+ export { runSnapshot };
140
+
141
+ //# sourceMappingURL=snapshot.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snapshot.mjs","names":[],"sources":["../../../../src/surfaces/cli/commands/snapshot.ts"],"sourcesContent":["// CLI verb: `devstack snapshot {save|restore|list|delete}`.\n//\n// Architecture (distilled/20-cli.md § Subcommands § Persistence):\n// \"snapshot save / restore / list / delete — capture, rehydrate,\n// enumerate, remove point-in-time captures of a stack.\"\n//\n// Surface-equality: snapshot is a peer command on the typed command\n// channel (`snapshot.capture` / `restore` / `list` / `delete`). The\n// CLI publishes; the L3 snapshot orchestrator (architecture § L3)\n// consumes — same code path for TUI / programmable API.\n\nimport { Effect } from 'effect';\n\nimport {\n\ttype CliError,\n\tCliSnapshotAmbiguousError,\n\tCliInternalError,\n\tCliSnapshotNotFoundError,\n\tCliUsageError,\n\tisCliError,\n} from '../errors.ts';\nimport { takePositional, takeValueFlag } from '../flags.ts';\nimport { emitSuccess } from '../output.ts';\nimport { confirmDestructive, type ConfirmPrompt } from './confirm.ts';\nimport type { CommandContext, CommandResult } from './index.ts';\n\n/** Snapshot read seam. The list verb reads the catalog without going\n * through the command channel — same observation discipline as\n * `status`: read-only views are equal across surfaces. */\nexport interface SnapshotReader {\n\treadonly list: () => Effect.Effect<ReadonlyArray<SnapshotEntry>>;\n\treadonly resolve: (snapshotRef: string) => Effect.Effect<SnapshotResolveResult>;\n}\n\nexport interface SnapshotEntry {\n\treadonly snapshotId: string;\n\treadonly name: string | null;\n\treadonly createdAt: number;\n\treadonly size: number | null;\n}\n\nexport type SnapshotResolveResult =\n\t| { readonly tag: 'found'; readonly entry: SnapshotEntry }\n\t| { readonly tag: 'not-found' }\n\t| {\n\t\t\treadonly tag: 'ambiguous';\n\t\t\treadonly snapshotRef: string;\n\t\t\treadonly matches: ReadonlyArray<SnapshotEntry>;\n\t };\n\nexport interface SnapshotCaptureResult {\n\treadonly snapshotId: string;\n\treadonly name: string;\n}\n\nexport interface SnapshotDeps {\n\treadonly reader: SnapshotReader;\n\treadonly capture: (args: {\n\t\treadonly snapshotId?: string;\n\t\treadonly name?: string;\n\t\treadonly configPath?: string;\n\t}) => Effect.Effect<SnapshotCaptureResult, unknown>;\n\treadonly restore: (snapshotId: string) => Effect.Effect<void, unknown>;\n\treadonly delete: (snapshotId: string) => Effect.Effect<void, unknown>;\n\treadonly confirm: ConfirmPrompt;\n}\n\n/** Snapshot subcommand dispatcher. `ctx.flags.rest` holds the\n * sub-verb + verb-local arguments. */\nexport const runSnapshot = (\n\tdeps: SnapshotDeps,\n\tctx: CommandContext,\n): Effect.Effect<CommandResult, CliError> =>\n\tEffect.gen(function* () {\n\t\tconst [sub, ...rest] = ctx.flags.rest;\n\t\tswitch (sub) {\n\t\t\tcase 'save':\n\t\t\t\treturn yield* runSnapshotSave(deps, ctx, rest);\n\t\t\tcase 'restore':\n\t\t\t\treturn yield* runSnapshotRestore(deps, ctx, rest);\n\t\t\tcase 'list':\n\t\t\t\treturn yield* runSnapshotList(deps, ctx);\n\t\t\tcase 'delete':\n\t\t\t\treturn yield* runSnapshotDelete(deps, ctx, rest);\n\t\t\tdefault:\n\t\t\t\treturn yield* Effect.fail(\n\t\t\t\t\tnew CliUsageError({\n\t\t\t\t\t\tmessage: `unknown snapshot subcommand: ${sub ?? '(missing)'}`,\n\t\t\t\t\t\thint: 'try: snapshot save [name] | restore <name-or-id> | list | delete <name-or-id>',\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t}\n\t}).pipe(Effect.withSpan('cli.snapshot'));\n\nconst runSnapshotSave = (\n\tdeps: SnapshotDeps,\n\tctx: CommandContext,\n\trest: ReadonlyArray<string>,\n): Effect.Effect<CommandResult, CliError> =>\n\tEffect.gen(function* () {\n\t\tconst started = Date.now();\n\t\tconst { value: flagName, tail: afterName } = takeValueFlag(rest, 'name');\n\t\tconst { head: positionalName, tail: afterSnapshotName } = takePositional(afterName);\n\t\tconst extra = afterSnapshotName.find((tok) => !tok.startsWith('-'));\n\t\tif (extra !== undefined) {\n\t\t\treturn yield* Effect.fail(\n\t\t\t\tnew CliUsageError({\n\t\t\t\t\tmessage: `unexpected snapshot save argument: ${extra}`,\n\t\t\t\t\thint: 'try: snapshot save [name]',\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\t\tif (flagName !== undefined && positionalName !== undefined) {\n\t\t\treturn yield* Effect.fail(\n\t\t\t\tnew CliUsageError({\n\t\t\t\t\tmessage: 'snapshot save accepts a name either positionally or with --name, not both',\n\t\t\t\t\thint: 'try: snapshot save [name]',\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\t\tconst name = flagName ?? positionalName;\n\t\tconst captured = yield* deps\n\t\t\t.capture({\n\t\t\t\t...(name === undefined ? {} : { name }),\n\t\t\t\t...(ctx.flags.configPath === undefined ? {} : { configPath: ctx.flags.configPath }),\n\t\t\t})\n\t\t\t.pipe(\n\t\t\t\tEffect.catch((cause: unknown) =>\n\t\t\t\t\tisCliError(cause)\n\t\t\t\t\t\t? Effect.fail(cause)\n\t\t\t\t\t\t: isSnapshotInputError(cause)\n\t\t\t\t\t\t\t? Effect.fail(snapshotInputCliError(cause))\n\t\t\t\t\t\t\t: Effect.fail(new CliInternalError({ message: 'snapshot capture failed', cause })),\n\t\t\t\t),\n\t\t\t);\n\t\tyield* emitSuccess(ctx.io, ctx.flags.outputMode, {\n\t\t\tcommand: 'snapshot save',\n\t\t\telapsedMs: Date.now() - started,\n\t\t\tdata: {\n\t\t\t\tsnapshotId: captured.snapshotId,\n\t\t\t\tname: captured.name,\n\t\t\t},\n\t\t\thumanLines: [`snapshot saved ${captured.name} (${captured.snapshotId})`],\n\t\t});\n\t\treturn { exitCode: 0 } as CommandResult;\n\t});\n\nconst runSnapshotRestore = (\n\tdeps: SnapshotDeps,\n\tctx: CommandContext,\n\trest: ReadonlyArray<string>,\n): Effect.Effect<CommandResult, CliError> =>\n\tEffect.gen(function* () {\n\t\tconst started = Date.now();\n\t\tconst snapshotRef = rest.find((tok) => !tok.startsWith('-'));\n\t\tif (snapshotRef === undefined) {\n\t\t\treturn yield* Effect.fail(\n\t\t\t\tnew CliUsageError({\n\t\t\t\t\tmessage: 'snapshot restore requires a snapshot name or id',\n\t\t\t\t\thint: 'snapshot list to enumerate available names and ids',\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\t\tconst resolved = yield* deps.reader.resolve(snapshotRef);\n\t\tif (resolved.tag === 'not-found') {\n\t\t\treturn yield* Effect.fail(new CliSnapshotNotFoundError({ snapshotRef }));\n\t\t}\n\t\tif (resolved.tag === 'ambiguous') {\n\t\t\treturn yield* Effect.fail(\n\t\t\t\tnew CliSnapshotAmbiguousError({\n\t\t\t\t\tsnapshotRef,\n\t\t\t\t\tmatches: resolved.matches.map((entry) => entry.snapshotId),\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\t\tconst entry = resolved.entry;\n\t\tconst snapshotId = entry.snapshotId;\n\t\tyield* confirmDestructive(deps.confirm, ctx, {\n\t\t\tverb: 'snapshot restore',\n\t\t\tprompt:\n\t\t\t\tentry.name === null\n\t\t\t\t\t? `Restore snapshot ${snapshotId} and replace current stack state?`\n\t\t\t\t\t: `Restore snapshot ${entry.name} (${snapshotId}) and replace current stack state?`,\n\t\t\tskipWhenDryRun: false,\n\t\t});\n\t\tyield* deps\n\t\t\t.restore(snapshotId)\n\t\t\t.pipe(\n\t\t\t\tEffect.catch((cause: unknown) =>\n\t\t\t\t\tisCliError(cause)\n\t\t\t\t\t\t? Effect.fail(cause)\n\t\t\t\t\t\t: Effect.fail(new CliInternalError({ message: 'snapshot restore failed', cause })),\n\t\t\t\t),\n\t\t\t);\n\t\tyield* emitSuccess(ctx.io, ctx.flags.outputMode, {\n\t\t\tcommand: 'snapshot restore',\n\t\t\telapsedMs: Date.now() - started,\n\t\t\tdata: { snapshotId, name: entry.name },\n\t\t\thumanLines: [\n\t\t\t\tentry.name === null\n\t\t\t\t\t? `snapshot restored ${snapshotId}`\n\t\t\t\t\t: `snapshot restored ${entry.name} (${snapshotId})`,\n\t\t\t],\n\t\t});\n\t\treturn { exitCode: 0 } as CommandResult;\n\t});\n\nconst runSnapshotList = (\n\tdeps: SnapshotDeps,\n\tctx: CommandContext,\n): Effect.Effect<CommandResult, CliError> =>\n\tEffect.gen(function* () {\n\t\tconst started = Date.now();\n\t\tconst entries = yield* deps.reader.list();\n\t\tconst humanLines =\n\t\t\tentries.length === 0\n\t\t\t\t? ['(no snapshots)']\n\t\t\t\t: entries.map(\n\t\t\t\t\t\t(e) =>\n\t\t\t\t\t\t\t`${e.name ?? '(unnamed)'} ${e.snapshotId} ${new Date(e.createdAt).toISOString()}`,\n\t\t\t\t\t);\n\t\tyield* emitSuccess(ctx.io, ctx.flags.outputMode, {\n\t\t\tcommand: 'snapshot list',\n\t\t\telapsedMs: Date.now() - started,\n\t\t\tdata: { entries },\n\t\t\thumanLines,\n\t\t});\n\t\treturn { exitCode: 0 } as CommandResult;\n\t});\n\nconst runSnapshotDelete = (\n\tdeps: SnapshotDeps,\n\tctx: CommandContext,\n\trest: ReadonlyArray<string>,\n): Effect.Effect<CommandResult, CliError> =>\n\tEffect.gen(function* () {\n\t\tconst started = Date.now();\n\t\tconst snapshotRef = rest.find((tok) => !tok.startsWith('-'));\n\t\tif (snapshotRef === undefined) {\n\t\t\treturn yield* Effect.fail(\n\t\t\t\tnew CliUsageError({ message: 'snapshot delete requires a snapshot name or id' }),\n\t\t\t);\n\t\t}\n\t\tconst resolved = yield* deps.reader.resolve(snapshotRef);\n\t\tif (resolved.tag === 'not-found') {\n\t\t\treturn yield* Effect.fail(new CliSnapshotNotFoundError({ snapshotRef }));\n\t\t}\n\t\tif (resolved.tag === 'ambiguous') {\n\t\t\treturn yield* Effect.fail(\n\t\t\t\tnew CliSnapshotAmbiguousError({\n\t\t\t\t\tsnapshotRef,\n\t\t\t\t\tmatches: resolved.matches.map((entry) => entry.snapshotId),\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\t\tconst entry = resolved.entry;\n\t\tconst snapshotId = entry.snapshotId;\n\t\tyield* confirmDestructive(deps.confirm, ctx, {\n\t\t\tverb: 'snapshot delete',\n\t\t\tprompt:\n\t\t\t\tentry.name === null\n\t\t\t\t\t? `Delete snapshot ${snapshotId}?`\n\t\t\t\t\t: `Delete snapshot ${entry.name} (${snapshotId})?`,\n\t\t\tskipWhenDryRun: false,\n\t\t});\n\t\tyield* deps\n\t\t\t.delete(snapshotId)\n\t\t\t.pipe(\n\t\t\t\tEffect.catch((cause: unknown) =>\n\t\t\t\t\tisCliError(cause)\n\t\t\t\t\t\t? Effect.fail(cause)\n\t\t\t\t\t\t: Effect.fail(new CliInternalError({ message: 'snapshot delete failed', cause })),\n\t\t\t\t),\n\t\t\t);\n\t\tyield* emitSuccess(ctx.io, ctx.flags.outputMode, {\n\t\t\tcommand: 'snapshot delete',\n\t\t\telapsedMs: Date.now() - started,\n\t\t\tdata: { snapshotId, name: entry.name },\n\t\t\thumanLines: [\n\t\t\t\tentry.name === null\n\t\t\t\t\t? `snapshot deleted ${snapshotId}`\n\t\t\t\t\t: `snapshot deleted ${entry.name} (${snapshotId})`,\n\t\t\t],\n\t\t});\n\t\treturn { exitCode: 0 } as CommandResult;\n\t});\n\ninterface SnapshotInputErrorShape {\n\treadonly _tag: 'SnapshotIdError';\n\treadonly operation: string;\n\treadonly field: string;\n\treadonly value: string;\n\treadonly detail: string;\n}\n\nconst isSnapshotInputError = (value: unknown): value is SnapshotInputErrorShape =>\n\ttypeof value === 'object' &&\n\tvalue !== null &&\n\t(value as { readonly _tag?: unknown })._tag === 'SnapshotIdError';\n\nconst snapshotInputCliError = (error: SnapshotInputErrorShape): CliUsageError =>\n\tnew CliUsageError({\n\t\tmessage: `invalid snapshot ${error.field} for ${error.operation}: ${error.value}`,\n\t\thint: error.detail,\n\t});\n"],"mappings":";;;;;;;;AAqEA,MAAa,eACZ,MACA,QAEA,OAAO,IAAI,aAAa;CACvB,MAAM,CAAC,KAAK,GAAG,QAAQ,IAAI,MAAM;AACjC,SAAQ,KAAR;EACC,KAAK,OACJ,QAAO,OAAO,gBAAgB,MAAM,KAAK,KAAK;EAC/C,KAAK,UACJ,QAAO,OAAO,mBAAmB,MAAM,KAAK,KAAK;EAClD,KAAK,OACJ,QAAO,OAAO,gBAAgB,MAAM,IAAI;EACzC,KAAK,SACJ,QAAO,OAAO,kBAAkB,MAAM,KAAK,KAAK;EACjD,QACC,QAAO,OAAO,OAAO,KACpB,IAAI,cAAc;GACjB,SAAS,gCAAgC,OAAO;GAChD,MAAM;GACN,CAAC,CACF;;EAEF,CAAC,KAAK,OAAO,SAAS,eAAe,CAAC;AAEzC,MAAM,mBACL,MACA,KACA,SAEA,OAAO,IAAI,aAAa;CACvB,MAAM,UAAU,KAAK,KAAK;CAC1B,MAAM,EAAE,OAAO,UAAU,MAAM,cAAc,cAAc,MAAM,OAAO;CACxE,MAAM,EAAE,MAAM,gBAAgB,MAAM,sBAAsB,eAAe,UAAU;CACnF,MAAM,QAAQ,kBAAkB,MAAM,QAAQ,CAAC,IAAI,WAAW,IAAI,CAAC;AACnE,KAAI,UAAU,KAAA,EACb,QAAO,OAAO,OAAO,KACpB,IAAI,cAAc;EACjB,SAAS,sCAAsC;EAC/C,MAAM;EACN,CAAC,CACF;AAEF,KAAI,aAAa,KAAA,KAAa,mBAAmB,KAAA,EAChD,QAAO,OAAO,OAAO,KACpB,IAAI,cAAc;EACjB,SAAS;EACT,MAAM;EACN,CAAC,CACF;CAEF,MAAM,OAAO,YAAY;CACzB,MAAM,WAAW,OAAO,KACtB,QAAQ;EACR,GAAI,SAAS,KAAA,IAAY,EAAE,GAAG,EAAE,MAAM;EACtC,GAAI,IAAI,MAAM,eAAe,KAAA,IAAY,EAAE,GAAG,EAAE,YAAY,IAAI,MAAM,YAAY;EAClF,CAAC,CACD,KACA,OAAO,OAAO,UACb,WAAW,MAAM,GACd,OAAO,KAAK,MAAM,GAClB,qBAAqB,MAAM,GAC1B,OAAO,KAAK,sBAAsB,MAAM,CAAC,GACzC,OAAO,KAAK,IAAI,iBAAiB;EAAE,SAAS;EAA2B;EAAO,CAAC,CAAC,CACpF,CACD;AACF,QAAO,YAAY,IAAI,IAAI,IAAI,MAAM,YAAY;EAChD,SAAS;EACT,WAAW,KAAK,KAAK,GAAG;EACxB,MAAM;GACL,YAAY,SAAS;GACrB,MAAM,SAAS;GACf;EACD,YAAY,CAAC,kBAAkB,SAAS,KAAK,IAAI,SAAS,WAAW,GAAG;EACxE,CAAC;AACF,QAAO,EAAE,UAAU,GAAG;EACrB;AAEH,MAAM,sBACL,MACA,KACA,SAEA,OAAO,IAAI,aAAa;CACvB,MAAM,UAAU,KAAK,KAAK;CAC1B,MAAM,cAAc,KAAK,MAAM,QAAQ,CAAC,IAAI,WAAW,IAAI,CAAC;AAC5D,KAAI,gBAAgB,KAAA,EACnB,QAAO,OAAO,OAAO,KACpB,IAAI,cAAc;EACjB,SAAS;EACT,MAAM;EACN,CAAC,CACF;CAEF,MAAM,WAAW,OAAO,KAAK,OAAO,QAAQ,YAAY;AACxD,KAAI,SAAS,QAAQ,YACpB,QAAO,OAAO,OAAO,KAAK,IAAI,yBAAyB,EAAE,aAAa,CAAC,CAAC;AAEzE,KAAI,SAAS,QAAQ,YACpB,QAAO,OAAO,OAAO,KACpB,IAAI,0BAA0B;EAC7B;EACA,SAAS,SAAS,QAAQ,KAAK,UAAU,MAAM,WAAW;EAC1D,CAAC,CACF;CAEF,MAAM,QAAQ,SAAS;CACvB,MAAM,aAAa,MAAM;AACzB,QAAO,mBAAmB,KAAK,SAAS,KAAK;EAC5C,MAAM;EACN,QACC,MAAM,SAAS,OACZ,oBAAoB,WAAW,qCAC/B,oBAAoB,MAAM,KAAK,IAAI,WAAW;EAClD,gBAAgB;EAChB,CAAC;AACF,QAAO,KACL,QAAQ,WAAW,CACnB,KACA,OAAO,OAAO,UACb,WAAW,MAAM,GACd,OAAO,KAAK,MAAM,GAClB,OAAO,KAAK,IAAI,iBAAiB;EAAE,SAAS;EAA2B;EAAO,CAAC,CAAC,CACnF,CACD;AACF,QAAO,YAAY,IAAI,IAAI,IAAI,MAAM,YAAY;EAChD,SAAS;EACT,WAAW,KAAK,KAAK,GAAG;EACxB,MAAM;GAAE;GAAY,MAAM,MAAM;GAAM;EACtC,YAAY,CACX,MAAM,SAAS,OACZ,qBAAqB,eACrB,qBAAqB,MAAM,KAAK,IAAI,WAAW,GAClD;EACD,CAAC;AACF,QAAO,EAAE,UAAU,GAAG;EACrB;AAEH,MAAM,mBACL,MACA,QAEA,OAAO,IAAI,aAAa;CACvB,MAAM,UAAU,KAAK,KAAK;CAC1B,MAAM,UAAU,OAAO,KAAK,OAAO,MAAM;CACzC,MAAM,aACL,QAAQ,WAAW,IAChB,CAAC,iBAAiB,GAClB,QAAQ,KACP,MACA,GAAG,EAAE,QAAQ,YAAY,IAAI,EAAE,WAAW,IAAI,IAAI,KAAK,EAAE,UAAU,CAAC,aAAa,GAClF;AACJ,QAAO,YAAY,IAAI,IAAI,IAAI,MAAM,YAAY;EAChD,SAAS;EACT,WAAW,KAAK,KAAK,GAAG;EACxB,MAAM,EAAE,SAAS;EACjB;EACA,CAAC;AACF,QAAO,EAAE,UAAU,GAAG;EACrB;AAEH,MAAM,qBACL,MACA,KACA,SAEA,OAAO,IAAI,aAAa;CACvB,MAAM,UAAU,KAAK,KAAK;CAC1B,MAAM,cAAc,KAAK,MAAM,QAAQ,CAAC,IAAI,WAAW,IAAI,CAAC;AAC5D,KAAI,gBAAgB,KAAA,EACnB,QAAO,OAAO,OAAO,KACpB,IAAI,cAAc,EAAE,SAAS,kDAAkD,CAAC,CAChF;CAEF,MAAM,WAAW,OAAO,KAAK,OAAO,QAAQ,YAAY;AACxD,KAAI,SAAS,QAAQ,YACpB,QAAO,OAAO,OAAO,KAAK,IAAI,yBAAyB,EAAE,aAAa,CAAC,CAAC;AAEzE,KAAI,SAAS,QAAQ,YACpB,QAAO,OAAO,OAAO,KACpB,IAAI,0BAA0B;EAC7B;EACA,SAAS,SAAS,QAAQ,KAAK,UAAU,MAAM,WAAW;EAC1D,CAAC,CACF;CAEF,MAAM,QAAQ,SAAS;CACvB,MAAM,aAAa,MAAM;AACzB,QAAO,mBAAmB,KAAK,SAAS,KAAK;EAC5C,MAAM;EACN,QACC,MAAM,SAAS,OACZ,mBAAmB,WAAW,KAC9B,mBAAmB,MAAM,KAAK,IAAI,WAAW;EACjD,gBAAgB;EAChB,CAAC;AACF,QAAO,KACL,OAAO,WAAW,CAClB,KACA,OAAO,OAAO,UACb,WAAW,MAAM,GACd,OAAO,KAAK,MAAM,GAClB,OAAO,KAAK,IAAI,iBAAiB;EAAE,SAAS;EAA0B;EAAO,CAAC,CAAC,CAClF,CACD;AACF,QAAO,YAAY,IAAI,IAAI,IAAI,MAAM,YAAY;EAChD,SAAS;EACT,WAAW,KAAK,KAAK,GAAG;EACxB,MAAM;GAAE;GAAY,MAAM,MAAM;GAAM;EACtC,YAAY,CACX,MAAM,SAAS,OACZ,oBAAoB,eACpB,oBAAoB,MAAM,KAAK,IAAI,WAAW,GACjD;EACD,CAAC;AACF,QAAO,EAAE,UAAU,GAAG;EACrB;AAUH,MAAM,wBAAwB,UAC7B,OAAO,UAAU,YACjB,UAAU,QACT,MAAsC,SAAS;AAEjD,MAAM,yBAAyB,UAC9B,IAAI,cAAc;CACjB,SAAS,oBAAoB,MAAM,MAAM,OAAO,MAAM,UAAU,IAAI,MAAM;CAC1E,MAAM,MAAM;CACZ,CAAC"}
@@ -0,0 +1,95 @@
1
+ import { emitSuccess } from "../output.mjs";
2
+ import { Effect } from "effect";
3
+ //#region src/surfaces/cli/commands/status.ts
4
+ /** Pure projection: `SubscribableState` → JSON-safe status blob.
5
+ * Never leaks substrate types. */
6
+ const buildStatusPayload = (state) => {
7
+ if (state === null) return {
8
+ present: false,
9
+ identity: null,
10
+ cycle: null,
11
+ rowCount: 0,
12
+ endpointCount: 0,
13
+ accountCount: 0,
14
+ packageCount: 0,
15
+ errorCount: 0
16
+ };
17
+ return {
18
+ present: true,
19
+ identity: { ...state.identity },
20
+ cycle: { ...state.cycle },
21
+ rowCount: state.rows.length,
22
+ endpointCount: state.endpoints.length,
23
+ accountCount: state.accounts.length,
24
+ packageCount: state.packages.length,
25
+ errorCount: state.errors.length,
26
+ rows: state.rows.map((r) => ({
27
+ key: r.key,
28
+ role: r.role,
29
+ status: r.status,
30
+ phase: r.phase,
31
+ lastErrorTag: r.lastError?.tag ?? null
32
+ })),
33
+ endpoints: state.endpoints.map((e) => ({
34
+ endpointKey: e.endpointKey,
35
+ name: e.name,
36
+ url: e.displayUrl ?? e.url
37
+ })),
38
+ accounts: state.accounts.map((account) => ({
39
+ key: account.key,
40
+ rowKey: account.rowKey,
41
+ name: account.name,
42
+ address: account.address,
43
+ scheme: account.scheme,
44
+ source: account.source,
45
+ funding: { ...account.funding },
46
+ walletVisible: account.walletVisible
47
+ })),
48
+ packages: state.packages.map((pkg) => ({
49
+ key: pkg.key,
50
+ rowKey: pkg.rowKey,
51
+ name: pkg.name,
52
+ kind: pkg.kind,
53
+ packageId: pkg.packageId,
54
+ upgradeCapId: pkg.upgradeCapId,
55
+ mvrPlaceholder: pkg.mvrPlaceholder,
56
+ sourcePath: pkg.sourcePath
57
+ }))
58
+ };
59
+ };
60
+ /**
61
+ * Run `devstack status`. Tolerant of missing state. Always succeeds
62
+ * (returns ok=true) unless the projection read itself raises (which
63
+ * the reader contractually swallows for missing files).
64
+ */
65
+ const runStatus = (deps, ctx) => Effect.gen(function* () {
66
+ const started = Date.now();
67
+ const app = ctx.flags.app ?? "";
68
+ const stack = ctx.flags.stack ?? "";
69
+ const data = buildStatusPayload(yield* deps.reader.readState(app, stack));
70
+ const elapsedMs = Date.now() - started;
71
+ const humanLines = [];
72
+ if (!data.present) humanLines.push(`status: no state present for ${app || "(no app)"} / ${stack || "(no stack)"}`);
73
+ else {
74
+ humanLines.push(`app: ${data.identity.app}`);
75
+ humanLines.push(`stack: ${data.identity.stack}`);
76
+ humanLines.push(`network: ${data.identity.network}`);
77
+ humanLines.push(`cycle: #${data.cycle.id} ${data.cycle.phase}`);
78
+ humanLines.push(`rows: ${data.rowCount}`);
79
+ humanLines.push(`endpoints: ${data.endpointCount}`);
80
+ humanLines.push(`accounts: ${data.accountCount}`);
81
+ humanLines.push(`packages: ${data.packageCount}`);
82
+ humanLines.push(`errors: ${data.errorCount}`);
83
+ }
84
+ yield* emitSuccess(ctx.io, ctx.flags.outputMode, {
85
+ command: "status",
86
+ elapsedMs,
87
+ data,
88
+ humanLines
89
+ });
90
+ return { exitCode: 0 };
91
+ }).pipe(Effect.withSpan("cli.status"));
92
+ //#endregion
93
+ export { runStatus };
94
+
95
+ //# sourceMappingURL=status.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.mjs","names":[],"sources":["../../../../src/surfaces/cli/commands/status.ts"],"sourcesContent":["// CLI verb: `devstack status` — observational read of stack state.\n//\n// Architecture (distilled/20-cli.md § Subcommands § Lifecycle):\n// \"status — observational read of stack state, manifest, and (if\n// present) fork meta.\"\n//\n// Surface invariant: status MUST tolerate missing/malformed state\n// files. It describes what IS, not what should be. The architecture\n// explicitly calls this out — throwing on a stack that hasn't been\n// brought up would be a regression.\n\nimport { Effect } from 'effect';\n\nimport type { SubscribableState } from '../../../substrate/projection.ts';\nimport type { CliError } from '../errors.ts';\nimport { emitSuccess } from '../output.ts';\nimport type { CommandContext, CommandResult } from './index.ts';\n\n/** Pure projection: `SubscribableState` → JSON-safe status blob.\n * Never leaks substrate types. */\nexport const buildStatusPayload = (state: SubscribableState | null) => {\n\tif (state === null) {\n\t\treturn {\n\t\t\tpresent: false as const,\n\t\t\tidentity: null,\n\t\t\tcycle: null,\n\t\t\trowCount: 0,\n\t\t\tendpointCount: 0,\n\t\t\taccountCount: 0,\n\t\t\tpackageCount: 0,\n\t\t\terrorCount: 0,\n\t\t};\n\t}\n\treturn {\n\t\tpresent: true as const,\n\t\tidentity: { ...state.identity },\n\t\tcycle: { ...state.cycle },\n\t\trowCount: state.rows.length,\n\t\tendpointCount: state.endpoints.length,\n\t\taccountCount: state.accounts.length,\n\t\tpackageCount: state.packages.length,\n\t\terrorCount: state.errors.length,\n\t\trows: state.rows.map((r) => ({\n\t\t\tkey: r.key as string,\n\t\t\trole: r.role,\n\t\t\tstatus: r.status,\n\t\t\tphase: r.phase,\n\t\t\tlastErrorTag: r.lastError?.tag ?? null,\n\t\t})),\n\t\tendpoints: state.endpoints.map((e) => ({\n\t\t\tendpointKey: e.endpointKey as string,\n\t\t\tname: e.name,\n\t\t\turl: e.displayUrl ?? e.url,\n\t\t})),\n\t\taccounts: state.accounts.map((account) => ({\n\t\t\tkey: account.key,\n\t\t\trowKey: account.rowKey,\n\t\t\tname: account.name,\n\t\t\taddress: account.address,\n\t\t\tscheme: account.scheme,\n\t\t\tsource: account.source,\n\t\t\tfunding: { ...account.funding },\n\t\t\twalletVisible: account.walletVisible,\n\t\t})),\n\t\tpackages: state.packages.map((pkg) => ({\n\t\t\tkey: pkg.key,\n\t\t\trowKey: pkg.rowKey,\n\t\t\tname: pkg.name,\n\t\t\tkind: pkg.kind,\n\t\t\tpackageId: pkg.packageId,\n\t\t\tupgradeCapId: pkg.upgradeCapId,\n\t\t\tmvrPlaceholder: pkg.mvrPlaceholder,\n\t\t\tsourcePath: pkg.sourcePath,\n\t\t})),\n\t};\n};\n\n/**\n * Status reader interface. The dispatcher wires this to the\n * substrate's projection ref via a thin reader; tests pass a stub.\n * The CLI never calls engine methods directly — it reads the same\n * projection any peer surface (TUI, programmable API) sees.\n */\nexport interface StatusReader {\n\t/** Resolve current projection for `(app, stack)`. Returns `null`\n\t * if no state has been written yet — that is a normal, tolerated\n\t * state for a freshly-defined stack. */\n\treadonly readState: (app: string, stack: string) => Effect.Effect<SubscribableState | null>;\n}\n\nexport interface StatusDeps {\n\treadonly reader: StatusReader;\n}\n\n/**\n * Run `devstack status`. Tolerant of missing state. Always succeeds\n * (returns ok=true) unless the projection read itself raises (which\n * the reader contractually swallows for missing files).\n */\nexport const runStatus = (\n\tdeps: StatusDeps,\n\tctx: CommandContext,\n): Effect.Effect<CommandResult, CliError> =>\n\tEffect.gen(function* () {\n\t\tconst started = Date.now();\n\t\t// Resolve `(app, stack)` from flags. The dispatcher seeds these\n\t\t// from the precedence chain; if both are absent we still render\n\t\t// (the projection reader returns `null`).\n\t\tconst app = ctx.flags.app ?? '';\n\t\tconst stack = ctx.flags.stack ?? '';\n\t\tconst state = yield* deps.reader.readState(app, stack);\n\t\tconst data = buildStatusPayload(state);\n\t\tconst elapsedMs = Date.now() - started;\n\n\t\tconst humanLines: Array<string> = [];\n\t\tif (!data.present) {\n\t\t\thumanLines.push(\n\t\t\t\t`status: no state present for ${app || '(no app)'} / ${stack || '(no stack)'}`,\n\t\t\t);\n\t\t} else {\n\t\t\thumanLines.push(`app: ${data.identity!.app}`);\n\t\t\thumanLines.push(`stack: ${data.identity!.stack}`);\n\t\t\thumanLines.push(`network: ${data.identity!.network}`);\n\t\t\thumanLines.push(`cycle: #${data.cycle!.id} ${data.cycle!.phase}`);\n\t\t\thumanLines.push(`rows: ${data.rowCount}`);\n\t\t\thumanLines.push(`endpoints: ${data.endpointCount}`);\n\t\t\thumanLines.push(`accounts: ${data.accountCount}`);\n\t\t\thumanLines.push(`packages: ${data.packageCount}`);\n\t\t\thumanLines.push(`errors: ${data.errorCount}`);\n\t\t}\n\n\t\tyield* emitSuccess(ctx.io, ctx.flags.outputMode, {\n\t\t\tcommand: 'status',\n\t\t\telapsedMs,\n\t\t\tdata,\n\t\t\thumanLines,\n\t\t});\n\t\treturn { exitCode: 0 } as CommandResult;\n\t}).pipe(Effect.withSpan('cli.status'));\n"],"mappings":";;;;;AAoBA,MAAa,sBAAsB,UAAoC;AACtE,KAAI,UAAU,KACb,QAAO;EACN,SAAS;EACT,UAAU;EACV,OAAO;EACP,UAAU;EACV,eAAe;EACf,cAAc;EACd,cAAc;EACd,YAAY;EACZ;AAEF,QAAO;EACN,SAAS;EACT,UAAU,EAAE,GAAG,MAAM,UAAU;EAC/B,OAAO,EAAE,GAAG,MAAM,OAAO;EACzB,UAAU,MAAM,KAAK;EACrB,eAAe,MAAM,UAAU;EAC/B,cAAc,MAAM,SAAS;EAC7B,cAAc,MAAM,SAAS;EAC7B,YAAY,MAAM,OAAO;EACzB,MAAM,MAAM,KAAK,KAAK,OAAO;GAC5B,KAAK,EAAE;GACP,MAAM,EAAE;GACR,QAAQ,EAAE;GACV,OAAO,EAAE;GACT,cAAc,EAAE,WAAW,OAAO;GAClC,EAAE;EACH,WAAW,MAAM,UAAU,KAAK,OAAO;GACtC,aAAa,EAAE;GACf,MAAM,EAAE;GACR,KAAK,EAAE,cAAc,EAAE;GACvB,EAAE;EACH,UAAU,MAAM,SAAS,KAAK,aAAa;GAC1C,KAAK,QAAQ;GACb,QAAQ,QAAQ;GAChB,MAAM,QAAQ;GACd,SAAS,QAAQ;GACjB,QAAQ,QAAQ;GAChB,QAAQ,QAAQ;GAChB,SAAS,EAAE,GAAG,QAAQ,SAAS;GAC/B,eAAe,QAAQ;GACvB,EAAE;EACH,UAAU,MAAM,SAAS,KAAK,SAAS;GACtC,KAAK,IAAI;GACT,QAAQ,IAAI;GACZ,MAAM,IAAI;GACV,MAAM,IAAI;GACV,WAAW,IAAI;GACf,cAAc,IAAI;GAClB,gBAAgB,IAAI;GACpB,YAAY,IAAI;GAChB,EAAE;EACH;;;;;;;AAyBF,MAAa,aACZ,MACA,QAEA,OAAO,IAAI,aAAa;CACvB,MAAM,UAAU,KAAK,KAAK;CAI1B,MAAM,MAAM,IAAI,MAAM,OAAO;CAC7B,MAAM,QAAQ,IAAI,MAAM,SAAS;CAEjC,MAAM,OAAO,mBAAmB,OADX,KAAK,OAAO,UAAU,KAAK,MAAM,CAChB;CACtC,MAAM,YAAY,KAAK,KAAK,GAAG;CAE/B,MAAM,aAA4B,EAAE;AACpC,KAAI,CAAC,KAAK,QACT,YAAW,KACV,gCAAgC,OAAO,WAAW,KAAK,SAAS,eAChE;MACK;AACN,aAAW,KAAK,YAAY,KAAK,SAAU,MAAM;AACjD,aAAW,KAAK,YAAY,KAAK,SAAU,QAAQ;AACnD,aAAW,KAAK,YAAY,KAAK,SAAU,UAAU;AACrD,aAAW,KAAK,aAAa,KAAK,MAAO,GAAG,GAAG,KAAK,MAAO,QAAQ;AACnE,aAAW,KAAK,YAAY,KAAK,WAAW;AAC5C,aAAW,KAAK,cAAc,KAAK,gBAAgB;AACnD,aAAW,KAAK,aAAa,KAAK,eAAe;AACjD,aAAW,KAAK,aAAa,KAAK,eAAe;AACjD,aAAW,KAAK,YAAY,KAAK,aAAa;;AAG/C,QAAO,YAAY,IAAI,IAAI,IAAI,MAAM,YAAY;EAChD,SAAS;EACT;EACA;EACA;EACA,CAAC;AACF,QAAO,EAAE,UAAU,GAAG;EACrB,CAAC,KAAK,OAAO,SAAS,aAAa,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { checkHolderLiveness } from "../../../substrate/runtime/cross-process/liveness.mjs";
2
+ import { readRoster } from "../../../substrate/runtime/cross-process/roster.mjs";
3
+ import { Effect } from "effect";
4
+ //#region src/surfaces/cli/commands/supervisor-presence.ts
5
+ /**
6
+ * Read `rosterFile` and report whether at least one live holder
7
+ * remains. Returns `{ live: false, pid: null }` when the roster is
8
+ * missing OR all holders are dead-by-liveness-check.
9
+ *
10
+ * Tolerates corrupt rosters: a malformed file is treated as "no
11
+ * live supervisor" — the worst case is the CLI refusing a publish
12
+ * the user could have buffered.
13
+ */
14
+ const probeSupervisorPresence = (rosterFile) => Effect.gen(function* () {
15
+ const doc = yield* readRoster(rosterFile).pipe(Effect.catchTag("RosterCorruptError", () => Effect.succeed({
16
+ version: 1,
17
+ holders: []
18
+ })));
19
+ for (const holder of doc.holders) if ((yield* checkHolderLiveness(holder).pipe(Effect.catch(() => Effect.succeed("alive")))) === "alive") return {
20
+ live: true,
21
+ pid: holder.pid,
22
+ hostname: holder.hostname
23
+ };
24
+ return {
25
+ live: false,
26
+ pid: null,
27
+ hostname: null
28
+ };
29
+ });
30
+ //#endregion
31
+ export { probeSupervisorPresence };
32
+
33
+ //# sourceMappingURL=supervisor-presence.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"supervisor-presence.mjs","names":[],"sources":["../../../../src/surfaces/cli/commands/supervisor-presence.ts"],"sourcesContent":["// Detect whether a supervisor is currently live for a given stack.\n//\n// The CLI uses this to decide whether a verb should publish via the\n// cross-process command channel (live supervisor: publish + await ack)\n// or use its direct/offline fallback.\n//\n// Detection reads the existing `roster.json` (architecture § Cross-\n// process safety protocol § Roster) and walks holders. A same-host\n// holder with a live PID + matching start-time → supervisor live.\n// Foreign-host holders are conservatively treated as live (NFS-safe\n// default; matches `liveness.ts` discipline).\n\nimport { Effect } from 'effect';\n\nimport {\n\tcheckHolderLiveness,\n\treadRoster,\n\ttype RosterError,\n} from '../../../substrate/runtime/cross-process/index.ts';\n\nexport interface SupervisorPresence {\n\treadonly live: boolean;\n\treadonly pid: number | null;\n\treadonly hostname: string | null;\n}\n\n/**\n * Read `rosterFile` and report whether at least one live holder\n * remains. Returns `{ live: false, pid: null }` when the roster is\n * missing OR all holders are dead-by-liveness-check.\n *\n * Tolerates corrupt rosters: a malformed file is treated as \"no\n * live supervisor\" — the worst case is the CLI refusing a publish\n * the user could have buffered.\n */\nexport const probeSupervisorPresence = (\n\trosterFile: string,\n): Effect.Effect<SupervisorPresence, RosterError> =>\n\tEffect.gen(function* () {\n\t\tconst doc = yield* readRoster(rosterFile).pipe(\n\t\t\tEffect.catchTag('RosterCorruptError', () =>\n\t\t\t\tEffect.succeed({ version: 1 as const, holders: [] }),\n\t\t\t),\n\t\t);\n\t\tfor (const holder of doc.holders) {\n\t\t\tconst liveness = yield* checkHolderLiveness(holder).pipe(\n\t\t\t\tEffect.catch(() => Effect.succeed('alive' as const)),\n\t\t\t);\n\t\t\tif (liveness === 'alive') {\n\t\t\t\treturn { live: true, pid: holder.pid, hostname: holder.hostname };\n\t\t\t}\n\t\t}\n\t\treturn { live: false, pid: null, hostname: null };\n\t});\n"],"mappings":";;;;;;;;;;;;;AAmCA,MAAa,2BACZ,eAEA,OAAO,IAAI,aAAa;CACvB,MAAM,MAAM,OAAO,WAAW,WAAW,CAAC,KACzC,OAAO,SAAS,4BACf,OAAO,QAAQ;EAAE,SAAS;EAAY,SAAS,EAAE;EAAE,CAAC,CACpD,CACD;AACD,MAAK,MAAM,UAAU,IAAI,QAIxB,MAAI,OAHoB,oBAAoB,OAAO,CAAC,KACnD,OAAO,YAAY,OAAO,QAAQ,QAAiB,CAAC,CACpD,MACgB,QAChB,QAAO;EAAE,MAAM;EAAM,KAAK,OAAO;EAAK,UAAU,OAAO;EAAU;AAGnE,QAAO;EAAE,MAAM;EAAO,KAAK;EAAM,UAAU;EAAM;EAChD"}
@@ -0,0 +1,28 @@
1
+ import { CliInternalError, isCliError } from "../errors.mjs";
2
+ import { emitSuccess } from "../output.mjs";
3
+ import { confirmDestructive } from "./confirm.mjs";
4
+ import { Effect } from "effect";
5
+ //#region src/surfaces/cli/commands/wipe.ts
6
+ const runWipe = (deps, ctx) => Effect.gen(function* () {
7
+ const started = Date.now();
8
+ yield* confirmDestructive(deps.confirm, ctx, {
9
+ verb: "wipe",
10
+ prompt: "Wipe all devstack state for the selected stack?"
11
+ });
12
+ if (!ctx.flags.dryRun) yield* deps.wipe().pipe(Effect.catch((cause) => isCliError(cause) ? Effect.fail(cause) : Effect.fail(new CliInternalError({
13
+ message: "wipe failed",
14
+ cause
15
+ }))));
16
+ yield* emitSuccess(ctx.io, ctx.flags.outputMode, {
17
+ command: "wipe",
18
+ elapsedMs: Date.now() - started,
19
+ dryRun: ctx.flags.dryRun,
20
+ data: { dryRun: ctx.flags.dryRun },
21
+ humanLines: ctx.flags.dryRun ? ["[dry-run] would wipe selected stack state"] : ["stack state wiped"]
22
+ });
23
+ return { exitCode: 0 };
24
+ }).pipe(Effect.withSpan("cli.wipe"));
25
+ //#endregion
26
+ export { runWipe };
27
+
28
+ //# sourceMappingURL=wipe.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wipe.mjs","names":[],"sources":["../../../../src/surfaces/cli/commands/wipe.ts"],"sourcesContent":["// CLI verb: `devstack wipe` — destroy all state for a stack.\n//\n// Architecture (distilled/20-cli.md § Subcommands § Teardown):\n// \"wipe — destroy all state for a stack.\"\n//\n// `wipe` is the recovery flow `apply` points users at on\n// `SeedManifestMismatchError`. It is tier-2 destructive (requires\n// `--yes` or an interactive TTY confirmation) and refuses to run while\n// a supervisor is live for the target stack (writes to disk while\n// a peer is acquiring a container would race).\n//\n// Surface-equality: `wipe` publishes `wipe.requested`; the L3 snapshot\n// orchestrator consumes (it owns the `wipe.ts` body that rmdir's the\n// stack root + container labels).\n\nimport { Effect } from 'effect';\n\nimport { type CliError, CliInternalError, isCliError } from '../errors.ts';\nimport { emitSuccess } from '../output.ts';\nimport { confirmDestructive, type ConfirmPrompt } from './confirm.ts';\nimport type { CommandContext, CommandResult } from './index.ts';\n\nexport interface WipeDeps {\n\treadonly wipe: () => Effect.Effect<void, unknown>;\n\treadonly confirm: ConfirmPrompt;\n}\n\nexport const runWipe = (\n\tdeps: WipeDeps,\n\tctx: CommandContext,\n): Effect.Effect<CommandResult, CliError> =>\n\tEffect.gen(function* () {\n\t\tconst started = Date.now();\n\t\tyield* confirmDestructive(deps.confirm, ctx, {\n\t\t\tverb: 'wipe',\n\t\t\tprompt: 'Wipe all devstack state for the selected stack?',\n\t\t});\n\t\tif (!ctx.flags.dryRun) {\n\t\t\tyield* deps.wipe().pipe(\n\t\t\t\tEffect.catch((cause: unknown) =>\n\t\t\t\t\tisCliError(cause)\n\t\t\t\t\t\t? Effect.fail(cause)\n\t\t\t\t\t\t: Effect.fail(\n\t\t\t\t\t\t\t\tnew CliInternalError({\n\t\t\t\t\t\t\t\t\tmessage: 'wipe failed',\n\t\t\t\t\t\t\t\t\tcause,\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\t\tyield* emitSuccess(ctx.io, ctx.flags.outputMode, {\n\t\t\tcommand: 'wipe',\n\t\t\telapsedMs: Date.now() - started,\n\t\t\tdryRun: ctx.flags.dryRun,\n\t\t\tdata: {\n\t\t\t\tdryRun: ctx.flags.dryRun,\n\t\t\t},\n\t\t\thumanLines: ctx.flags.dryRun\n\t\t\t\t? ['[dry-run] would wipe selected stack state']\n\t\t\t\t: ['stack state wiped'],\n\t\t});\n\t\treturn { exitCode: 0 } as CommandResult;\n\t}).pipe(Effect.withSpan('cli.wipe'));\n"],"mappings":";;;;;AA2BA,MAAa,WACZ,MACA,QAEA,OAAO,IAAI,aAAa;CACvB,MAAM,UAAU,KAAK,KAAK;AAC1B,QAAO,mBAAmB,KAAK,SAAS,KAAK;EAC5C,MAAM;EACN,QAAQ;EACR,CAAC;AACF,KAAI,CAAC,IAAI,MAAM,OACd,QAAO,KAAK,MAAM,CAAC,KAClB,OAAO,OAAO,UACb,WAAW,MAAM,GACd,OAAO,KAAK,MAAM,GAClB,OAAO,KACP,IAAI,iBAAiB;EACpB,SAAS;EACT;EACA,CAAC,CACF,CACH,CACD;AAEF,QAAO,YAAY,IAAI,IAAI,IAAI,MAAM,YAAY;EAChD,SAAS;EACT,WAAW,KAAK,KAAK,GAAG;EACxB,QAAQ,IAAI,MAAM;EAClB,MAAM,EACL,QAAQ,IAAI,MAAM,QAClB;EACD,YAAY,IAAI,MAAM,SACnB,CAAC,4CAA4C,GAC7C,CAAC,oBAAoB;EACxB,CAAC;AACF,QAAO,EAAE,UAAU,GAAG;EACrB,CAAC,KAAK,OAAO,SAAS,WAAW,CAAC"}
@@ -0,0 +1,43 @@
1
+ import { exitCodeName } from "./sysexits.mjs";
2
+ /** Build a success envelope. Optional fields collapse cleanly when
3
+ * absent — the JSON serializer in `output.ts` strips them. */
4
+ const successEnvelope = (params) => {
5
+ const env = {
6
+ schemaVersion: 1,
7
+ ok: true,
8
+ command: params.command,
9
+ elapsedMs: params.elapsedMs
10
+ };
11
+ if (params.data !== void 0) env.data = params.data;
12
+ if (params.hints !== void 0 && params.hints.length > 0) env.hints = params.hints;
13
+ if (params.dryRun === true) env.dryRun = true;
14
+ return env;
15
+ };
16
+ /** Build a failure envelope. The numeric `exitCode` is BOTH the
17
+ * envelope's `error.exitCode` AND the OS exit code the CLI propagates
18
+ * via `process.exitCode`. */
19
+ const failureEnvelope = (params) => {
20
+ const error = {
21
+ code: exitCodeName(params.exitCode),
22
+ exitCode: params.exitCode,
23
+ summary: params.summary
24
+ };
25
+ if (params.hint !== void 0) error.hint = params.hint;
26
+ if (params.recipe !== void 0) error.recipe = params.recipe;
27
+ if (params.chain !== void 0 && params.chain.length > 0) error.chain = params.chain;
28
+ if (params.context !== void 0) error.context = params.context;
29
+ const env = {
30
+ schemaVersion: 1,
31
+ ok: false,
32
+ command: params.command,
33
+ elapsedMs: params.elapsedMs,
34
+ error
35
+ };
36
+ if (params.hints !== void 0 && params.hints.length > 0) env.hints = params.hints;
37
+ if (params.dryRun === true) env.dryRun = true;
38
+ return env;
39
+ };
40
+ //#endregion
41
+ export { failureEnvelope, successEnvelope };
42
+
43
+ //# sourceMappingURL=envelope.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"envelope.mjs","names":[],"sources":["../../../src/surfaces/cli/envelope.ts"],"sourcesContent":["// CLI surface — stable JSON envelope.\n//\n// Architecture (distilled/20-cli.md § Output formats / Invariants):\n// - Exactly one envelope per command on stdout in `--json` mode.\n// - Schema version pinned; bumped intentionally on breaking changes.\n// - Absent fields are OMITTED from serialized output (no\n// `undefined`).\n// - Envelope must never carry devstack-internal types — no engine\n// class instances, no raw Effect Causes, no plugin error objects.\n// The cascade formatter projects causes into the flat error block;\n// `data` is a JSON-safe blob.\n//\n// The envelope is the CLI's contract with downstream automation\n// (CI, agents, examples). Treat it as a public schema: ANY field-name\n// change is a major version bump.\n\nimport { ExitCode, exitCodeName } from './sysexits.ts';\n\n/**\n * Current envelope schema version. Bump on any incompatible field\n * rename / shape change. Additive fields (omitted-when-absent) do NOT\n * require a bump.\n *\n * Semantic: integer, monotonically increasing. Consumers MAY refuse to\n * parse an envelope whose `schemaVersion` exceeds their pinned\n * maximum.\n */\nexport const ENVELOPE_SCHEMA_VERSION = 1 as const;\n\n/** Flat error block carried inside the envelope. NEVER a raw Effect\n * Cause — the cascade formatter projects causes into `chain[]`. */\nexport interface EnvelopeError {\n\t/** Sysexits name, e.g. `'CONFIG'`. */\n\treadonly code: string;\n\t/** Sysexits numeric, e.g. 78. Mirrors the OS exit code. */\n\treadonly exitCode: number;\n\t/** Single-line summary fit for a TTY one-liner. */\n\treadonly summary: string;\n\t/** Optional remediation hint (\"run `devstack doctor` to verify\n\t * Docker is reachable\"). */\n\treadonly hint?: string;\n\t/** Optional copy-pasteable recipe block (multi-line). */\n\treadonly recipe?: string;\n\t/** Cascade lines, deepest-first. Each entry is a rendered line\n\t * from the cause walker; consumers never see Effect internals. */\n\treadonly chain?: ReadonlyArray<string>;\n\t/** Optional structured context (string-keyed primitives only). */\n\treadonly context?: Readonly<Record<string, string | number | boolean | null>>;\n}\n\n/** The envelope shape itself. Required fields surface always. Optional\n * fields are omitted when not relevant (the builder enforces this).\n *\n * Streaming verbs (`logs`) use `StreamingEvent` for each tick; the\n * closing envelope is one final `Envelope`. The `kind` discriminator\n * on the streaming shape lets `jq` distinguish per-event records\n * from the closing summary (surfaces review §1). */\nexport interface Envelope<Data = unknown> {\n\treadonly schemaVersion: typeof ENVELOPE_SCHEMA_VERSION;\n\treadonly ok: boolean;\n\treadonly command: string;\n\treadonly elapsedMs: number;\n\treadonly data?: Data;\n\treadonly hints?: ReadonlyArray<string>;\n\treadonly error?: EnvelopeError;\n\treadonly dryRun?: true;\n}\n\n/** Per-event streaming record. Carries `kind: 'event'` so a consumer\n * piping through `jq` can filter event records from the closing\n * `Envelope` by `.kind`. Streaming verbs emit zero-or-more\n * `StreamingEvent` records followed by exactly one closing `Envelope`. */\nexport interface StreamingEvent<Data = unknown> {\n\treadonly schemaVersion: typeof ENVELOPE_SCHEMA_VERSION;\n\treadonly kind: 'event';\n\treadonly command: string;\n\treadonly at: string;\n\treadonly data: Data;\n}\n\n/** Build a streaming-event record. The closing envelope is produced via\n * `successEnvelope` as usual. */\nexport const streamingEvent = <Data>(params: {\n\treadonly command: string;\n\treadonly at: number;\n\treadonly data: Data;\n}): StreamingEvent<Data> => ({\n\tschemaVersion: ENVELOPE_SCHEMA_VERSION,\n\tkind: 'event',\n\tcommand: params.command,\n\tat: new Date(params.at).toISOString(),\n\tdata: params.data,\n});\n\n// -----------------------------------------------------------------------------\n// Builders\n// -----------------------------------------------------------------------------\n\nexport interface SuccessParams<Data = unknown> {\n\treadonly command: string;\n\treadonly elapsedMs: number;\n\treadonly data?: Data;\n\treadonly hints?: ReadonlyArray<string>;\n\treadonly dryRun?: boolean;\n}\n\n/** Build a success envelope. Optional fields collapse cleanly when\n * absent — the JSON serializer in `output.ts` strips them. */\nexport const successEnvelope = <Data>(params: SuccessParams<Data>): Envelope<Data> => {\n\tconst env: Mutable<Envelope<Data>> = {\n\t\tschemaVersion: ENVELOPE_SCHEMA_VERSION,\n\t\tok: true,\n\t\tcommand: params.command,\n\t\telapsedMs: params.elapsedMs,\n\t};\n\tif (params.data !== undefined) env.data = params.data;\n\tif (params.hints !== undefined && params.hints.length > 0) env.hints = params.hints;\n\tif (params.dryRun === true) env.dryRun = true;\n\treturn env as Envelope<Data>;\n};\n\nexport interface FailureParams {\n\treadonly command: string;\n\treadonly elapsedMs: number;\n\treadonly exitCode: ExitCode;\n\treadonly summary: string;\n\treadonly hint?: string;\n\treadonly recipe?: string;\n\treadonly chain?: ReadonlyArray<string>;\n\treadonly context?: EnvelopeError['context'];\n\treadonly hints?: ReadonlyArray<string>;\n\treadonly dryRun?: boolean;\n}\n\n/** Build a failure envelope. The numeric `exitCode` is BOTH the\n * envelope's `error.exitCode` AND the OS exit code the CLI propagates\n * via `process.exitCode`. */\nexport const failureEnvelope = (params: FailureParams): Envelope<never> => {\n\tconst error: Mutable<EnvelopeError> = {\n\t\tcode: exitCodeName(params.exitCode),\n\t\texitCode: params.exitCode,\n\t\tsummary: params.summary,\n\t};\n\tif (params.hint !== undefined) error.hint = params.hint;\n\tif (params.recipe !== undefined) error.recipe = params.recipe;\n\tif (params.chain !== undefined && params.chain.length > 0) error.chain = params.chain;\n\tif (params.context !== undefined) error.context = params.context;\n\n\tconst env: Mutable<Envelope<never>> = {\n\t\tschemaVersion: ENVELOPE_SCHEMA_VERSION,\n\t\tok: false,\n\t\tcommand: params.command,\n\t\telapsedMs: params.elapsedMs,\n\t\terror: error as EnvelopeError,\n\t};\n\tif (params.hints !== undefined && params.hints.length > 0) env.hints = params.hints;\n\tif (params.dryRun === true) env.dryRun = true;\n\treturn env as Envelope<never>;\n};\n\n// -----------------------------------------------------------------------------\n// Internal helpers\n// -----------------------------------------------------------------------------\n\n/** Local `Mutable<T>` — the envelope is built mutably, then frozen by\n * the caller via `as`. We don't mutate after publish. */\ntype Mutable<T> = { -readonly [K in keyof T]: T[K] };\n"],"mappings":";;;AA4GA,MAAa,mBAAyB,WAAgD;CACrF,MAAM,MAA+B;EACpC,eAAA;EACA,IAAI;EACJ,SAAS,OAAO;EAChB,WAAW,OAAO;EAClB;AACD,KAAI,OAAO,SAAS,KAAA,EAAW,KAAI,OAAO,OAAO;AACjD,KAAI,OAAO,UAAU,KAAA,KAAa,OAAO,MAAM,SAAS,EAAG,KAAI,QAAQ,OAAO;AAC9E,KAAI,OAAO,WAAW,KAAM,KAAI,SAAS;AACzC,QAAO;;;;;AAmBR,MAAa,mBAAmB,WAA2C;CAC1E,MAAM,QAAgC;EACrC,MAAM,aAAa,OAAO,SAAS;EACnC,UAAU,OAAO;EACjB,SAAS,OAAO;EAChB;AACD,KAAI,OAAO,SAAS,KAAA,EAAW,OAAM,OAAO,OAAO;AACnD,KAAI,OAAO,WAAW,KAAA,EAAW,OAAM,SAAS,OAAO;AACvD,KAAI,OAAO,UAAU,KAAA,KAAa,OAAO,MAAM,SAAS,EAAG,OAAM,QAAQ,OAAO;AAChF,KAAI,OAAO,YAAY,KAAA,EAAW,OAAM,UAAU,OAAO;CAEzD,MAAM,MAAgC;EACrC,eAAA;EACA,IAAI;EACJ,SAAS,OAAO;EAChB,WAAW,OAAO;EACX;EACP;AACD,KAAI,OAAO,UAAU,KAAA,KAAa,OAAO,MAAM,SAAS,EAAG,KAAI,QAAQ,OAAO;AAC9E,KAAI,OAAO,WAAW,KAAM,KAAI,SAAS;AACzC,QAAO"}
@@ -0,0 +1,110 @@
1
+ import { ExitCode } from "./sysexits.mjs";
2
+ import { Data } from "effect";
3
+ //#region src/surfaces/cli/errors.ts
4
+ /** Argv parsing produced an error — unknown subcommand, malformed
5
+ * flag value, missing required positional. */
6
+ var CliUsageError = class extends Data.TaggedError("CliUsageError") {};
7
+ /** The user's `devstack.config.ts` could not be located (path probe
8
+ * exhausted) or could not be imported. */
9
+ var CliConfigNotFoundError = class extends Data.TaggedError("CliConfigNotFoundError") {};
10
+ /** The config imported successfully but its default export is not a
11
+ * `Stack` value (failed brand check, missing required field). */
12
+ var CliConfigInvalidError = class extends Data.TaggedError("CliConfigInvalidError") {};
13
+ /** A required service (Docker daemon, network) is unavailable. */
14
+ var CliUnavailableError = class extends Data.TaggedError("CliUnavailableError") {};
15
+ /** Snapshot name/id not found. Carries the reference the caller
16
+ * used so the failure renderer can echo it back. */
17
+ var CliSnapshotNotFoundError = class extends Data.TaggedError("CliSnapshotNotFoundError") {};
18
+ var CliSnapshotAmbiguousError = class extends Data.TaggedError("CliSnapshotAmbiguousError") {};
19
+ /** Destructive verb refused because `--yes` was absent and prompting
20
+ * was forbidden (non-TTY stdin or `--no-input`). */
21
+ var CliConfirmRequiredError = class extends Data.TaggedError("CliConfirmRequiredError") {};
22
+ /** Destructive verb was prompted interactively and the user declined. */
23
+ var CliConfirmDeclinedError = class extends Data.TaggedError("CliConfirmDeclinedError") {};
24
+ /** Engine reports a live supervisor for the target stack; the verb
25
+ * refused to mutate shared state. */
26
+ var CliSupervisorLiveError = class extends Data.TaggedError("CliSupervisorLiveError") {};
27
+ Data.TaggedError("CliNoSupervisorError");
28
+ /** Internal/unexpected failure. Wraps an arbitrary cause; the cascade
29
+ * formatter renders the inner. */
30
+ var CliInternalError = class extends Data.TaggedError("CliInternalError") {};
31
+ Data.TaggedError("CliAlreadyReportedError");
32
+ const isCliError = (value) => {
33
+ if (typeof value !== "object" || value === null) return false;
34
+ switch (value._tag) {
35
+ case "CliUsageError":
36
+ case "CliConfigNotFoundError":
37
+ case "CliConfigInvalidError":
38
+ case "CliUnavailableError":
39
+ case "CliSnapshotNotFoundError":
40
+ case "CliSnapshotAmbiguousError":
41
+ case "CliConfirmRequiredError":
42
+ case "CliConfirmDeclinedError":
43
+ case "CliSupervisorLiveError":
44
+ case "CliNoSupervisorError":
45
+ case "CliInternalError":
46
+ case "CliAlreadyReportedError": return true;
47
+ default: return false;
48
+ }
49
+ };
50
+ /** Project a tagged error to its sysexit code. The dispatcher reads
51
+ * this to set `process.exitCode` — there is exactly one place in the
52
+ * surface where tag → numeric mapping happens. */
53
+ const exitCodeFor = (error) => {
54
+ switch (error._tag) {
55
+ case "CliUsageError": return ExitCode.USAGE;
56
+ case "CliConfigNotFoundError": return ExitCode.NO_INPUT;
57
+ case "CliConfigInvalidError": return ExitCode.CONFIG;
58
+ case "CliUnavailableError": return ExitCode.UNAVAILABLE;
59
+ case "CliSnapshotNotFoundError": return ExitCode.SNAPSHOT_NOT_FOUND;
60
+ case "CliSnapshotAmbiguousError": return ExitCode.USAGE;
61
+ case "CliConfirmRequiredError":
62
+ case "CliConfirmDeclinedError": return ExitCode.CONFIRM_REQUIRED;
63
+ case "CliSupervisorLiveError": return ExitCode.SUPERVISOR_LIVE;
64
+ case "CliNoSupervisorError": return ExitCode.UNAVAILABLE;
65
+ case "CliInternalError": return ExitCode.SOFTWARE;
66
+ case "CliAlreadyReportedError": return error.exitCode;
67
+ default: return ExitCode.SOFTWARE;
68
+ }
69
+ };
70
+ /** Short single-line summary for the envelope's `error.summary`
71
+ * field. Cascade detail lives in `error.chain[]`. */
72
+ const summaryFor = (error) => {
73
+ switch (error._tag) {
74
+ case "CliUsageError": return error.message;
75
+ case "CliConfigNotFoundError": return error.message;
76
+ case "CliConfigInvalidError": return error.message;
77
+ case "CliUnavailableError": return `${error.service} unavailable: ${error.message}`;
78
+ case "CliSnapshotNotFoundError": return `snapshot not found: ${error.snapshotRef}`;
79
+ case "CliSnapshotAmbiguousError": return `snapshot reference is ambiguous: ${error.snapshotRef}`;
80
+ case "CliConfirmRequiredError": return `${error.verb} requires confirmation`;
81
+ case "CliConfirmDeclinedError": return `${error.verb} confirmation declined`;
82
+ case "CliSupervisorLiveError": return `supervisor live for ${error.app}/${error.stack}`;
83
+ case "CliNoSupervisorError": return `no supervisor running for ${error.app}/${error.stack}`;
84
+ case "CliInternalError": return error.message;
85
+ case "CliAlreadyReportedError": return "(already reported)";
86
+ default: return "(unknown error)";
87
+ }
88
+ };
89
+ /** Optional hint for the envelope's `error.hint` field. */
90
+ const hintFor = (error) => {
91
+ switch (error._tag) {
92
+ case "CliUsageError": return error.hint;
93
+ case "CliSnapshotAmbiguousError": return `use one of these ids instead: ${error.matches.join(", ")}`;
94
+ case "CliUnavailableError":
95
+ case "CliConfirmRequiredError":
96
+ case "CliConfirmDeclinedError":
97
+ case "CliSupervisorLiveError":
98
+ case "CliNoSupervisorError": return error.hint;
99
+ case "CliConfigNotFoundError":
100
+ case "CliConfigInvalidError":
101
+ case "CliSnapshotNotFoundError":
102
+ case "CliInternalError":
103
+ case "CliAlreadyReportedError": return;
104
+ default: return;
105
+ }
106
+ };
107
+ //#endregion
108
+ export { CliConfigInvalidError, CliConfigNotFoundError, CliConfirmDeclinedError, CliConfirmRequiredError, CliInternalError, CliSnapshotAmbiguousError, CliSnapshotNotFoundError, CliSupervisorLiveError, CliUnavailableError, CliUsageError, exitCodeFor, hintFor, isCliError, summaryFor };
109
+
110
+ //# sourceMappingURL=errors.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.mjs","names":["XC"],"sources":["../../../src/surfaces/cli/errors.ts"],"sourcesContent":["// CLI surface — typed errors carried up to the top-level renderer.\n//\n// Architecture (distilled/20-cli.md § Edge cases) enumerates the\n// surface's failure modes. Each one MUST resolve to a stable sysexit\n// code; the error tag here carries that mapping so the dispatcher\n// doesn't sprinkle exit codes through every command.\n//\n// Why tagged errors and not plain `Effect.fail(string)`?\n// - `catchTag` in commands can pick out the precise tag without\n// stringly matching.\n// - The cascade formatter (substrate/runtime/observability/\n// cascade-formatter.ts) renders these natively via their `_tag`.\n// - The `schema --json` command enumerates the tag table.\n\nimport { Data } from 'effect';\n\nimport { type ExitCode, ExitCode as XC } from './sysexits.ts';\n\n// -----------------------------------------------------------------------------\n// Tagged errors\n// -----------------------------------------------------------------------------\n\n/** Argv parsing produced an error — unknown subcommand, malformed\n * flag value, missing required positional. */\nexport class CliUsageError extends Data.TaggedError('CliUsageError')<{\n\treadonly message: string;\n\treadonly hint?: string;\n}> {}\n\n/** The user's `devstack.config.ts` could not be located (path probe\n * exhausted) or could not be imported. */\nexport class CliConfigNotFoundError extends Data.TaggedError('CliConfigNotFoundError')<{\n\treadonly message: string;\n\treadonly searchedPaths?: ReadonlyArray<string>;\n}> {}\n\n/** The config imported successfully but its default export is not a\n * `Stack` value (failed brand check, missing required field). */\nexport class CliConfigInvalidError extends Data.TaggedError('CliConfigInvalidError')<{\n\treadonly message: string;\n\treadonly cause?: unknown;\n}> {}\n\n/** A required service (Docker daemon, network) is unavailable. */\nexport class CliUnavailableError extends Data.TaggedError('CliUnavailableError')<{\n\treadonly message: string;\n\treadonly service: string;\n\treadonly hint?: string;\n}> {}\n\n/** Snapshot name/id not found. Carries the reference the caller\n * used so the failure renderer can echo it back. */\nexport class CliSnapshotNotFoundError extends Data.TaggedError('CliSnapshotNotFoundError')<{\n\treadonly snapshotRef: string;\n}> {}\n\nexport class CliSnapshotAmbiguousError extends Data.TaggedError('CliSnapshotAmbiguousError')<{\n\treadonly snapshotRef: string;\n\treadonly matches: ReadonlyArray<string>;\n}> {}\n\n/** Destructive verb refused because `--yes` was absent and prompting\n * was forbidden (non-TTY stdin or `--no-input`). */\nexport class CliConfirmRequiredError extends Data.TaggedError('CliConfirmRequiredError')<{\n\treadonly verb: string;\n\treadonly hint?: string;\n}> {}\n\n/** Destructive verb was prompted interactively and the user declined. */\nexport class CliConfirmDeclinedError extends Data.TaggedError('CliConfirmDeclinedError')<{\n\treadonly verb: string;\n\treadonly hint?: string;\n}> {}\n\n/** Engine reports a live supervisor for the target stack; the verb\n * refused to mutate shared state. */\nexport class CliSupervisorLiveError extends Data.TaggedError('CliSupervisorLiveError')<{\n\treadonly app: string;\n\treadonly stack: string;\n\treadonly hint?: string;\n}> {}\n\n/** The verb requires a live supervisor (a stack must be `up`) but\n * none is running for `(app, stack)`. Distinguished from\n * `CliSupervisorLiveError` (the inverse case where the verb refused\n * because one IS live). */\nexport class CliNoSupervisorError extends Data.TaggedError('CliNoSupervisorError')<{\n\treadonly app: string;\n\treadonly stack: string;\n\treadonly hint?: string;\n}> {}\n\n/** Internal/unexpected failure. Wraps an arbitrary cause; the cascade\n * formatter renders the inner. */\nexport class CliInternalError extends Data.TaggedError('CliInternalError')<{\n\treadonly message: string;\n\treadonly cause?: unknown;\n}> {}\n\n/** Sentinel: subcommand already pretty-rendered its failure. The\n * top-level renderer recognizes this tag and skips re-rendering, but\n * still propagates `exitCode` to the OS exit code.\n *\n * Architecture § Learnings: \"Already-reported sentinel pattern\" — the\n * marker traverses the cause structure used by the Effect runtime, so\n * the top-level `Effect.catchAll` sees it. */\nexport class CliAlreadyReportedError extends Data.TaggedError('CliAlreadyReportedError')<{\n\treadonly exitCode: ExitCode;\n}> {}\n\n// -----------------------------------------------------------------------------\n// Union + sysexit projection\n// -----------------------------------------------------------------------------\n\nexport type CliError =\n\t| CliUsageError\n\t| CliConfigNotFoundError\n\t| CliConfigInvalidError\n\t| CliUnavailableError\n\t| CliSnapshotNotFoundError\n\t| CliSnapshotAmbiguousError\n\t| CliConfirmRequiredError\n\t| CliConfirmDeclinedError\n\t| CliSupervisorLiveError\n\t| CliNoSupervisorError\n\t| CliInternalError\n\t| CliAlreadyReportedError;\n\nexport const isCliError = (value: unknown): value is CliError => {\n\tif (typeof value !== 'object' || value === null) return false;\n\tconst tag = (value as { readonly _tag?: unknown })._tag;\n\tswitch (tag) {\n\t\tcase 'CliUsageError':\n\t\tcase 'CliConfigNotFoundError':\n\t\tcase 'CliConfigInvalidError':\n\t\tcase 'CliUnavailableError':\n\t\tcase 'CliSnapshotNotFoundError':\n\t\tcase 'CliSnapshotAmbiguousError':\n\t\tcase 'CliConfirmRequiredError':\n\t\tcase 'CliConfirmDeclinedError':\n\t\tcase 'CliSupervisorLiveError':\n\t\tcase 'CliNoSupervisorError':\n\t\tcase 'CliInternalError':\n\t\tcase 'CliAlreadyReportedError':\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn false;\n\t}\n};\n\n/** Project a tagged error to its sysexit code. The dispatcher reads\n * this to set `process.exitCode` — there is exactly one place in the\n * surface where tag → numeric mapping happens. */\nexport const exitCodeFor = (error: CliError): ExitCode => {\n\tswitch (error._tag) {\n\t\tcase 'CliUsageError':\n\t\t\treturn XC.USAGE;\n\t\tcase 'CliConfigNotFoundError':\n\t\t\treturn XC.NO_INPUT;\n\t\tcase 'CliConfigInvalidError':\n\t\t\treturn XC.CONFIG;\n\t\tcase 'CliUnavailableError':\n\t\t\treturn XC.UNAVAILABLE;\n\t\tcase 'CliSnapshotNotFoundError':\n\t\t\treturn XC.SNAPSHOT_NOT_FOUND;\n\t\tcase 'CliSnapshotAmbiguousError':\n\t\t\treturn XC.USAGE;\n\t\tcase 'CliConfirmRequiredError':\n\t\tcase 'CliConfirmDeclinedError':\n\t\t\treturn XC.CONFIRM_REQUIRED;\n\t\tcase 'CliSupervisorLiveError':\n\t\t\treturn XC.SUPERVISOR_LIVE;\n\t\tcase 'CliNoSupervisorError':\n\t\t\treturn XC.UNAVAILABLE;\n\t\tcase 'CliInternalError':\n\t\t\treturn XC.SOFTWARE;\n\t\tcase 'CliAlreadyReportedError':\n\t\t\treturn error.exitCode;\n\t\tdefault: {\n\t\t\tconst _exhaustive: never = error;\n\t\t\tvoid _exhaustive;\n\t\t\treturn XC.SOFTWARE;\n\t\t}\n\t}\n};\n\n/** Short single-line summary for the envelope's `error.summary`\n * field. Cascade detail lives in `error.chain[]`. */\nexport const summaryFor = (error: CliError): string => {\n\tswitch (error._tag) {\n\t\tcase 'CliUsageError':\n\t\t\treturn error.message;\n\t\tcase 'CliConfigNotFoundError':\n\t\t\treturn error.message;\n\t\tcase 'CliConfigInvalidError':\n\t\t\treturn error.message;\n\t\tcase 'CliUnavailableError':\n\t\t\treturn `${error.service} unavailable: ${error.message}`;\n\t\tcase 'CliSnapshotNotFoundError':\n\t\t\treturn `snapshot not found: ${error.snapshotRef}`;\n\t\tcase 'CliSnapshotAmbiguousError':\n\t\t\treturn `snapshot reference is ambiguous: ${error.snapshotRef}`;\n\t\tcase 'CliConfirmRequiredError':\n\t\t\treturn `${error.verb} requires confirmation`;\n\t\tcase 'CliConfirmDeclinedError':\n\t\t\treturn `${error.verb} confirmation declined`;\n\t\tcase 'CliSupervisorLiveError':\n\t\t\treturn `supervisor live for ${error.app}/${error.stack}`;\n\t\tcase 'CliNoSupervisorError':\n\t\t\treturn `no supervisor running for ${error.app}/${error.stack}`;\n\t\tcase 'CliInternalError':\n\t\t\treturn error.message;\n\t\tcase 'CliAlreadyReportedError':\n\t\t\treturn '(already reported)';\n\t\tdefault: {\n\t\t\tconst _exhaustive: never = error;\n\t\t\tvoid _exhaustive;\n\t\t\treturn '(unknown error)';\n\t\t}\n\t}\n};\n\n/** Optional hint for the envelope's `error.hint` field. */\nexport const hintFor = (error: CliError): string | undefined => {\n\tswitch (error._tag) {\n\t\tcase 'CliUsageError':\n\t\t\treturn error.hint;\n\t\tcase 'CliSnapshotAmbiguousError':\n\t\t\treturn `use one of these ids instead: ${error.matches.join(', ')}`;\n\t\tcase 'CliUnavailableError':\n\t\tcase 'CliConfirmRequiredError':\n\t\tcase 'CliConfirmDeclinedError':\n\t\tcase 'CliSupervisorLiveError':\n\t\tcase 'CliNoSupervisorError':\n\t\t\treturn error.hint;\n\t\tcase 'CliConfigNotFoundError':\n\t\tcase 'CliConfigInvalidError':\n\t\tcase 'CliSnapshotNotFoundError':\n\t\tcase 'CliInternalError':\n\t\tcase 'CliAlreadyReportedError':\n\t\t\treturn undefined;\n\t\tdefault: {\n\t\t\tconst _exhaustive: never = error;\n\t\t\tvoid _exhaustive;\n\t\t\treturn undefined;\n\t\t}\n\t}\n};\n"],"mappings":";;;;;AAwBA,IAAa,gBAAb,cAAmC,KAAK,YAAY,gBAAgB,CAGjE;;;AAIH,IAAa,yBAAb,cAA4C,KAAK,YAAY,yBAAyB,CAGnF;;;AAIH,IAAa,wBAAb,cAA2C,KAAK,YAAY,wBAAwB,CAGjF;;AAGH,IAAa,sBAAb,cAAyC,KAAK,YAAY,sBAAsB,CAI7E;;;AAIH,IAAa,2BAAb,cAA8C,KAAK,YAAY,2BAA2B,CAEvF;AAEH,IAAa,4BAAb,cAA+C,KAAK,YAAY,4BAA4B,CAGzF;;;AAIH,IAAa,0BAAb,cAA6C,KAAK,YAAY,0BAA0B,CAGrF;;AAGH,IAAa,0BAAb,cAA6C,KAAK,YAAY,0BAA0B,CAGrF;;;AAIH,IAAa,yBAAb,cAA4C,KAAK,YAAY,yBAAyB,CAInF;AAMuC,KAAK,YAAY,uBAAuB;;;AAQlF,IAAa,mBAAb,cAAsC,KAAK,YAAY,mBAAmB,CAGvE;AAS0C,KAAK,YAAY,0BAA0B;AAsBxF,MAAa,cAAc,UAAsC;AAChE,KAAI,OAAO,UAAU,YAAY,UAAU,KAAM,QAAO;AAExD,SADa,MAAsC,MACnD;EACC,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK,0BACJ,QAAO;EACR,QACC,QAAO;;;;;;AAOV,MAAa,eAAe,UAA8B;AACzD,SAAQ,MAAM,MAAd;EACC,KAAK,gBACJ,QAAOA,SAAG;EACX,KAAK,yBACJ,QAAOA,SAAG;EACX,KAAK,wBACJ,QAAOA,SAAG;EACX,KAAK,sBACJ,QAAOA,SAAG;EACX,KAAK,2BACJ,QAAOA,SAAG;EACX,KAAK,4BACJ,QAAOA,SAAG;EACX,KAAK;EACL,KAAK,0BACJ,QAAOA,SAAG;EACX,KAAK,yBACJ,QAAOA,SAAG;EACX,KAAK,uBACJ,QAAOA,SAAG;EACX,KAAK,mBACJ,QAAOA,SAAG;EACX,KAAK,0BACJ,QAAO,MAAM;EACd,QAGC,QAAOA,SAAG;;;;;AAOb,MAAa,cAAc,UAA4B;AACtD,SAAQ,MAAM,MAAd;EACC,KAAK,gBACJ,QAAO,MAAM;EACd,KAAK,yBACJ,QAAO,MAAM;EACd,KAAK,wBACJ,QAAO,MAAM;EACd,KAAK,sBACJ,QAAO,GAAG,MAAM,QAAQ,gBAAgB,MAAM;EAC/C,KAAK,2BACJ,QAAO,uBAAuB,MAAM;EACrC,KAAK,4BACJ,QAAO,oCAAoC,MAAM;EAClD,KAAK,0BACJ,QAAO,GAAG,MAAM,KAAK;EACtB,KAAK,0BACJ,QAAO,GAAG,MAAM,KAAK;EACtB,KAAK,yBACJ,QAAO,uBAAuB,MAAM,IAAI,GAAG,MAAM;EAClD,KAAK,uBACJ,QAAO,6BAA6B,MAAM,IAAI,GAAG,MAAM;EACxD,KAAK,mBACJ,QAAO,MAAM;EACd,KAAK,0BACJ,QAAO;EACR,QAGC,QAAO;;;;AAMV,MAAa,WAAW,UAAwC;AAC/D,SAAQ,MAAM,MAAd;EACC,KAAK,gBACJ,QAAO,MAAM;EACd,KAAK,4BACJ,QAAO,iCAAiC,MAAM,QAAQ,KAAK,KAAK;EACjE,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK,uBACJ,QAAO,MAAM;EACd,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK,0BACJ;EACD,QAGC"}
@@ -0,0 +1,56 @@
1
+ import { CliUsageError } from "./errors.mjs";
2
+ //#region src/surfaces/cli/flags.ts
3
+ /** Environment-variable names the CLI consults. Centralized so the
4
+ * `schema --json` command can enumerate them. */
5
+ const ENV_VARS = {
6
+ JSON: "DEVSTACK_JSON",
7
+ NO_INPUT: "DEVSTACK_NO_INPUT",
8
+ APP: "DEVSTACK_APP",
9
+ STACK: "DEVSTACK_STACK",
10
+ STATE_DIR: "DEVSTACK_STATE_DIR",
11
+ CONFIG_PATH: "DEVSTACK_CONFIG",
12
+ NETWORK: "DEVSTACK_NETWORK",
13
+ RENDERER: "DEVSTACK_RENDERER",
14
+ NO_COLOR: "NO_COLOR"
15
+ };
16
+ /** Pop the next positional argument from `rest`. Returns undefined if
17
+ * none remain. */
18
+ const takePositional = (rest) => {
19
+ const idx = rest.findIndex((tok) => !tok.startsWith("-"));
20
+ if (idx === -1) return {
21
+ head: void 0,
22
+ tail: rest
23
+ };
24
+ const tail = [...rest.slice(0, idx), ...rest.slice(idx + 1)];
25
+ return {
26
+ head: rest[idx],
27
+ tail
28
+ };
29
+ };
30
+ /** Look up a value flag (`--name=val` or `--name val`). */
31
+ const takeValueFlag = (rest, name) => {
32
+ const prefix = `--${name}=`;
33
+ for (let i = 0; i < rest.length; i++) {
34
+ const tok = rest[i];
35
+ if (tok.startsWith(prefix)) return {
36
+ value: tok.slice(prefix.length),
37
+ tail: [...rest.slice(0, i), ...rest.slice(i + 1)]
38
+ };
39
+ if (tok === `--${name}`) {
40
+ const next = rest[i + 1];
41
+ if (next === void 0 || next.startsWith("-")) throw new CliUsageError({ message: `flag --${name} requires a value` });
42
+ return {
43
+ value: next,
44
+ tail: [...rest.slice(0, i), ...rest.slice(i + 2)]
45
+ };
46
+ }
47
+ }
48
+ return {
49
+ value: void 0,
50
+ tail: rest
51
+ };
52
+ };
53
+ //#endregion
54
+ export { ENV_VARS, takePositional, takeValueFlag };
55
+
56
+ //# sourceMappingURL=flags.mjs.map