@mysten-incubation/devstack 0.1.0 → 0.2.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 (858) hide show
  1. package/README.md +7 -4
  2. package/dashboard-ui/assets/grpc-a4usE3Nk.js +3 -0
  3. package/dashboard-ui/assets/index-B82Bh84P.css +1 -0
  4. package/dashboard-ui/assets/index-CRYJ4pru.js +1277 -0
  5. package/dashboard-ui/index.html +2 -2
  6. package/dist/api/define-capabilities.d.mts +1 -20
  7. package/dist/api/define-capabilities.mjs +15 -22
  8. package/dist/api/define-capabilities.mjs.map +1 -1
  9. package/dist/api/define-devstack-with.d.mts +7 -1
  10. package/dist/api/define-devstack-with.mjs.map +1 -1
  11. package/dist/api/define-devstack.mjs.map +1 -1
  12. package/dist/api/define-plugin.d.mts +2 -1
  13. package/dist/api/inference-network.d.mts +31 -17
  14. package/dist/api/inference-network.mjs +40 -43
  15. package/dist/api/inference-network.mjs.map +1 -1
  16. package/dist/api/load-config.mjs +88 -0
  17. package/dist/api/load-config.mjs.map +1 -0
  18. package/dist/api/mode-narrowed-factory.d.mts +1 -1
  19. package/dist/api/mode-narrowed-factory.mjs.map +1 -1
  20. package/dist/api/run-stack-internal.mjs +202 -0
  21. package/dist/api/run-stack-internal.mjs.map +1 -0
  22. package/dist/api/run-stack.d.mts +82 -31
  23. package/dist/api/run-stack.mjs +22 -141
  24. package/dist/api/run-stack.mjs.map +1 -1
  25. package/dist/build-integrations/dapp-kit/index.d.mts +61 -0
  26. package/dist/build-integrations/dapp-kit/index.mjs +58 -0
  27. package/dist/build-integrations/dapp-kit/index.mjs.map +1 -0
  28. package/dist/build-integrations/playwright/config.d.mts +1 -30
  29. package/dist/build-integrations/playwright/config.mjs +1 -27
  30. package/dist/build-integrations/playwright/config.mjs.map +1 -1
  31. package/dist/build-integrations/playwright/errors.d.mts +4 -7
  32. package/dist/build-integrations/playwright/errors.mjs.map +1 -1
  33. package/dist/build-integrations/playwright/global-setup.d.mts +42 -71
  34. package/dist/build-integrations/playwright/global-setup.mjs +142 -218
  35. package/dist/build-integrations/playwright/global-setup.mjs.map +1 -1
  36. package/dist/build-integrations/playwright/index.d.mts +2 -2
  37. package/dist/build-integrations/playwright/index.mjs +2 -2
  38. package/dist/build-integrations/playwright/stack-context.d.mts +3 -1
  39. package/dist/build-integrations/playwright/stack-context.mjs +4 -2
  40. package/dist/build-integrations/playwright/stack-context.mjs.map +1 -1
  41. package/dist/build-integrations/playwright/wallet-context.mjs +44 -19
  42. package/dist/build-integrations/playwright/wallet-context.mjs.map +1 -1
  43. package/dist/build-integrations/runtime/cold-start-url.mjs.map +1 -1
  44. package/dist/build-integrations/runtime/conventional-routes.mjs.map +1 -1
  45. package/dist/build-integrations/runtime/dapp-kit-slot.mjs.map +1 -1
  46. package/dist/build-integrations/runtime/discover.d.mts +6 -4
  47. package/dist/build-integrations/runtime/discover.mjs +15 -4
  48. package/dist/build-integrations/runtime/discover.mjs.map +1 -1
  49. package/dist/build-integrations/runtime/endpoint-registry.mjs.map +1 -1
  50. package/dist/build-integrations/runtime/errors.mjs.map +1 -1
  51. package/dist/build-integrations/runtime/read-stack-context.mjs +3 -3
  52. package/dist/build-integrations/runtime/read-stack-context.mjs.map +1 -1
  53. package/dist/build-integrations/runtime/resolve-discovery-env.d.mts +23 -7
  54. package/dist/build-integrations/runtime/resolve-discovery-env.mjs +25 -12
  55. package/dist/build-integrations/runtime/resolve-discovery-env.mjs.map +1 -1
  56. package/dist/build-integrations/runtime/stack-context.d.mts +2 -2
  57. package/dist/build-integrations/vite/index.d.mts +84 -19
  58. package/dist/build-integrations/vite/index.mjs +203 -28
  59. package/dist/build-integrations/vite/index.mjs.map +1 -1
  60. package/dist/build-integrations/vitest/config.d.mts +20 -2
  61. package/dist/build-integrations/vitest/config.mjs +16 -4
  62. package/dist/build-integrations/vitest/config.mjs.map +1 -1
  63. package/dist/build-integrations/vitest/env.d.mts +18 -10
  64. package/dist/build-integrations/vitest/env.mjs +11 -10
  65. package/dist/build-integrations/vitest/env.mjs.map +1 -1
  66. package/dist/build-integrations/vitest/errors.d.mts +7 -11
  67. package/dist/build-integrations/vitest/errors.mjs +3 -4
  68. package/dist/build-integrations/vitest/errors.mjs.map +1 -1
  69. package/dist/build-integrations/vitest/global-setup.d.mts +35 -0
  70. package/dist/build-integrations/vitest/global-setup.mjs +156 -0
  71. package/dist/build-integrations/vitest/global-setup.mjs.map +1 -0
  72. package/dist/build-integrations/vitest/index.d.mts +3 -2
  73. package/dist/build-integrations/vitest/index.mjs +3 -2
  74. package/dist/build-integrations/vitest/setup.mjs +2 -2
  75. package/dist/build-integrations/vitest/setup.mjs.map +1 -1
  76. package/dist/build-integrations/vitest/stack-context.d.mts +5 -3
  77. package/dist/build-integrations/vitest/stack-context.mjs +3 -2
  78. package/dist/build-integrations/vitest/stack-context.mjs.map +1 -1
  79. package/dist/cli/bail.mjs.map +1 -1
  80. package/dist/cli/doctor-probes.mjs +1 -3
  81. package/dist/cli/doctor-probes.mjs.map +1 -1
  82. package/dist/cli/main.d.mts +23 -1
  83. package/dist/cli/main.mjs +63 -8
  84. package/dist/cli/main.mjs.map +1 -1
  85. package/dist/cli/prune-direct.mjs.map +1 -1
  86. package/dist/cli/snapshot-reader.mjs.map +1 -1
  87. package/dist/cli/up-lifecycle.mjs.map +1 -1
  88. package/dist/cli/wirings/apply.mjs +28 -21
  89. package/dist/cli/wirings/apply.mjs.map +1 -1
  90. package/dist/cli/wirings/codegen.mjs +108 -0
  91. package/dist/cli/wirings/codegen.mjs.map +1 -0
  92. package/dist/cli/wirings/config-loader.mjs +12 -62
  93. package/dist/cli/wirings/config-loader.mjs.map +1 -1
  94. package/dist/cli/wirings/dump-ids.mjs +86 -0
  95. package/dist/cli/wirings/dump-ids.mjs.map +1 -0
  96. package/dist/cli/wirings/engine-command.mjs +1 -1
  97. package/dist/cli/wirings/engine-command.mjs.map +1 -1
  98. package/dist/cli/wirings/identity.mjs +2 -2
  99. package/dist/cli/wirings/identity.mjs.map +1 -1
  100. package/dist/cli/wirings/provide-file-system.mjs.map +1 -1
  101. package/dist/cli/wirings/read-devstack-version.mjs +17 -0
  102. package/dist/cli/wirings/read-devstack-version.mjs.map +1 -0
  103. package/dist/cli/wirings/snapshot.mjs +27 -34
  104. package/dist/cli/wirings/snapshot.mjs.map +1 -1
  105. package/dist/cli/wirings/up-ipc.mjs +147 -0
  106. package/dist/cli/wirings/up-ipc.mjs.map +1 -0
  107. package/dist/cli/wirings/up.mjs +218 -198
  108. package/dist/cli/wirings/up.mjs.map +1 -1
  109. package/dist/cli/wirings/wipe.mjs +1 -1
  110. package/dist/cli/wirings/wipe.mjs.map +1 -1
  111. package/dist/contracts/chain-probe.d.mts +1 -1
  112. package/dist/contracts/chain-probe.mjs +1 -1
  113. package/dist/contracts/chain-probe.mjs.map +1 -1
  114. package/dist/contracts/codegenable.d.mts +60 -6
  115. package/dist/contracts/codegenable.mjs +28 -0
  116. package/dist/contracts/codegenable.mjs.map +1 -0
  117. package/dist/contracts/config-bindings.mjs +162 -0
  118. package/dist/contracts/config-bindings.mjs.map +1 -0
  119. package/dist/contracts/container-runtime.d.mts +23 -17
  120. package/dist/contracts/plugin-expander.mjs.map +1 -1
  121. package/dist/contracts/snapshotable.d.mts +5 -7
  122. package/dist/contracts/wallet-protocol.d.mts +2 -5
  123. package/dist/contracts/wallet-protocol.mjs +2 -5
  124. package/dist/contracts/wallet-protocol.mjs.map +1 -1
  125. package/dist/index.d.mts +21 -26
  126. package/dist/index.mjs +8 -9
  127. package/dist/orchestrators/boot.d.mts +28 -0
  128. package/dist/orchestrators/boot.mjs +440 -0
  129. package/dist/orchestrators/boot.mjs.map +1 -0
  130. package/dist/orchestrators/codegen/bindings.d.mts +13 -1
  131. package/dist/orchestrators/codegen/bindings.mjs +23 -9
  132. package/dist/orchestrators/codegen/bindings.mjs.map +1 -1
  133. package/dist/orchestrators/codegen/config-runtime.mjs +208 -0
  134. package/dist/orchestrators/codegen/config-runtime.mjs.map +1 -0
  135. package/dist/orchestrators/codegen/emit.mjs +1 -1
  136. package/dist/orchestrators/codegen/emit.mjs.map +1 -1
  137. package/dist/orchestrators/codegen/errors.mjs +21 -1
  138. package/dist/orchestrators/codegen/errors.mjs.map +1 -1
  139. package/dist/orchestrators/codegen/format.mjs +2 -0
  140. package/dist/orchestrators/codegen/format.mjs.map +1 -1
  141. package/dist/orchestrators/codegen/gitignore.mjs +30 -11
  142. package/dist/orchestrators/codegen/gitignore.mjs.map +1 -1
  143. package/dist/orchestrators/codegen/id-config.mjs +107 -0
  144. package/dist/orchestrators/codegen/id-config.mjs.map +1 -0
  145. package/dist/orchestrators/codegen/output-location.mjs +23 -31
  146. package/dist/orchestrators/codegen/output-location.mjs.map +1 -1
  147. package/dist/orchestrators/codegen/paths.mjs +8 -1
  148. package/dist/orchestrators/codegen/paths.mjs.map +1 -1
  149. package/dist/orchestrators/codegen/permissions.mjs.map +1 -1
  150. package/dist/orchestrators/codegen/service.mjs +286 -58
  151. package/dist/orchestrators/codegen/service.mjs.map +1 -1
  152. package/dist/orchestrators/layers.mjs +31 -0
  153. package/dist/orchestrators/layers.mjs.map +1 -0
  154. package/dist/orchestrators/lifecycle-prune/errors.mjs.map +1 -1
  155. package/dist/orchestrators/lifecycle-prune/index.mjs +8 -10
  156. package/dist/orchestrators/lifecycle-prune/index.mjs.map +1 -1
  157. package/dist/orchestrators/network-options.d.mts +52 -0
  158. package/dist/orchestrators/network-options.mjs +43 -0
  159. package/dist/orchestrators/network-options.mjs.map +1 -0
  160. package/dist/orchestrators/router/cleanup.mjs.map +1 -1
  161. package/dist/orchestrators/router/cors.mjs.map +1 -1
  162. package/dist/orchestrators/router/entrypoints.mjs.map +1 -1
  163. package/dist/orchestrators/router/errors.mjs.map +1 -1
  164. package/dist/orchestrators/router/file-provider.mjs.map +1 -1
  165. package/dist/orchestrators/router/hostname.mjs.map +1 -1
  166. package/dist/orchestrators/router/profile.mjs +1 -1
  167. package/dist/orchestrators/router/profile.mjs.map +1 -1
  168. package/dist/orchestrators/router/service.d.mts +2 -2
  169. package/dist/orchestrators/router/service.mjs +12 -27
  170. package/dist/orchestrators/router/service.mjs.map +1 -1
  171. package/dist/orchestrators/router/traefik-container.mjs +1 -1
  172. package/dist/orchestrators/router/traefik-container.mjs.map +1 -1
  173. package/dist/orchestrators/snapshot/capture.mjs +171 -195
  174. package/dist/orchestrators/snapshot/capture.mjs.map +1 -1
  175. package/dist/orchestrators/snapshot/descriptor.d.mts +1 -1
  176. package/dist/orchestrators/snapshot/descriptor.mjs +53 -11
  177. package/dist/orchestrators/snapshot/descriptor.mjs.map +1 -1
  178. package/dist/orchestrators/snapshot/identity-guard.mjs +3 -5
  179. package/dist/orchestrators/snapshot/identity-guard.mjs.map +1 -1
  180. package/dist/orchestrators/snapshot/image-bundle-tags.mjs +32 -101
  181. package/dist/orchestrators/snapshot/image-bundle-tags.mjs.map +1 -1
  182. package/dist/orchestrators/snapshot/index.mjs +1 -4
  183. package/dist/orchestrators/snapshot/integrity.mjs.map +1 -1
  184. package/dist/orchestrators/snapshot/interrupted-restore.mjs +116 -0
  185. package/dist/orchestrators/snapshot/interrupted-restore.mjs.map +1 -0
  186. package/dist/orchestrators/snapshot/phase-error.mjs.map +1 -1
  187. package/dist/orchestrators/snapshot/prune.mjs +40 -31
  188. package/dist/orchestrators/snapshot/prune.mjs.map +1 -1
  189. package/dist/orchestrators/snapshot/restore.mjs +221 -196
  190. package/dist/orchestrators/snapshot/restore.mjs.map +1 -1
  191. package/dist/orchestrators/snapshot/service.mjs +72 -62
  192. package/dist/orchestrators/snapshot/service.mjs.map +1 -1
  193. package/dist/orchestrators/snapshot/wipe.mjs +67 -56
  194. package/dist/orchestrators/snapshot/wipe.mjs.map +1 -1
  195. package/dist/plugins/account/codegen.mjs +3 -0
  196. package/dist/plugins/account/codegen.mjs.map +1 -1
  197. package/dist/plugins/account/errors.d.mts +2 -2
  198. package/dist/plugins/account/errors.mjs +1 -4
  199. package/dist/plugins/account/errors.mjs.map +1 -1
  200. package/dist/plugins/account/funding.mjs +3 -27
  201. package/dist/plugins/account/funding.mjs.map +1 -1
  202. package/dist/plugins/account/index.d.mts +3 -8
  203. package/dist/plugins/account/index.mjs +71 -35
  204. package/dist/plugins/account/index.mjs.map +1 -1
  205. package/dist/plugins/account/keypair.d.mts +8 -7
  206. package/dist/plugins/account/keypair.mjs +5 -18
  207. package/dist/plugins/account/keypair.mjs.map +1 -1
  208. package/dist/plugins/account/lease.mjs.map +1 -1
  209. package/dist/plugins/account/registry.d.mts +1 -46
  210. package/dist/plugins/account/registry.mjs.map +1 -1
  211. package/dist/plugins/account/service.d.mts +43 -34
  212. package/dist/plugins/account/service.mjs +9 -54
  213. package/dist/plugins/account/service.mjs.map +1 -1
  214. package/dist/plugins/account/snapshot.mjs.map +1 -1
  215. package/dist/plugins/account/variants/ephemeral.mjs.map +1 -1
  216. package/dist/plugins/account/variants/impersonate.mjs.map +1 -1
  217. package/dist/plugins/account/variants/signer.mjs.map +1 -1
  218. package/dist/plugins/action/discriminator.mjs.map +1 -1
  219. package/dist/plugins/action/errors.mjs +1 -4
  220. package/dist/plugins/action/errors.mjs.map +1 -1
  221. package/dist/plugins/action/execute.mjs +3 -4
  222. package/dist/plugins/action/execute.mjs.map +1 -1
  223. package/dist/plugins/action/index.d.mts +2 -2
  224. package/dist/plugins/action/index.mjs +7 -11
  225. package/dist/plugins/action/index.mjs.map +1 -1
  226. package/dist/plugins/action/service.d.mts +5 -7
  227. package/dist/plugins/action/service.mjs +2 -16
  228. package/dist/plugins/action/service.mjs.map +1 -1
  229. package/dist/plugins/coin/address-resolution.mjs.map +1 -1
  230. package/dist/plugins/coin/codegen.mjs +97 -16
  231. package/dist/plugins/coin/codegen.mjs.map +1 -1
  232. package/dist/plugins/coin/discovery.mjs.map +1 -1
  233. package/dist/plugins/coin/errors.mjs +1 -4
  234. package/dist/plugins/coin/errors.mjs.map +1 -1
  235. package/dist/plugins/coin/index.d.mts +4 -34
  236. package/dist/plugins/coin/index.mjs +47 -28
  237. package/dist/plugins/coin/index.mjs.map +1 -1
  238. package/dist/plugins/coin/metadata.d.mts +1 -0
  239. package/dist/plugins/coin/metadata.mjs +8 -9
  240. package/dist/plugins/coin/metadata.mjs.map +1 -1
  241. package/dist/plugins/coin/mint.mjs +7 -21
  242. package/dist/plugins/coin/mint.mjs.map +1 -1
  243. package/dist/plugins/coin/registry.mjs +33 -20
  244. package/dist/plugins/coin/registry.mjs.map +1 -1
  245. package/dist/plugins/coin/service.d.mts +1 -1
  246. package/dist/plugins/coin/service.mjs +1 -8
  247. package/dist/plugins/coin/service.mjs.map +1 -1
  248. package/dist/plugins/coin/snapshot.mjs.map +1 -1
  249. package/dist/plugins/coin/type-strings.mjs.map +1 -1
  250. package/dist/plugins/dashboard/domain.mjs +106 -167
  251. package/dist/plugins/dashboard/domain.mjs.map +1 -1
  252. package/dist/plugins/dashboard/index.mjs +13 -13
  253. package/dist/plugins/dashboard/index.mjs.map +1 -1
  254. package/dist/plugins/dashboard/origin-policy.mjs +3 -3
  255. package/dist/plugins/dashboard/origin-policy.mjs.map +1 -1
  256. package/dist/plugins/dashboard/routable.mjs.map +1 -1
  257. package/dist/plugins/dashboard/schema/builder.mjs.map +1 -1
  258. package/dist/plugins/dashboard/schema/enums.mjs.map +1 -1
  259. package/dist/plugins/dashboard/schema/root.mjs +23 -44
  260. package/dist/plugins/dashboard/schema/root.mjs.map +1 -1
  261. package/dist/plugins/dashboard/schema/types.mjs +37 -91
  262. package/dist/plugins/dashboard/schema/types.mjs.map +1 -1
  263. package/dist/plugins/dashboard/schema.mjs.map +1 -1
  264. package/dist/plugins/dashboard/server.mjs.map +1 -1
  265. package/dist/plugins/deepbook/codegen.d.mts +12 -11
  266. package/dist/plugins/deepbook/codegen.mjs +108 -11
  267. package/dist/plugins/deepbook/codegen.mjs.map +1 -1
  268. package/dist/plugins/deepbook/deploy.mjs +7 -14
  269. package/dist/plugins/deepbook/deploy.mjs.map +1 -1
  270. package/dist/plugins/deepbook/errors.mjs +4 -2
  271. package/dist/plugins/deepbook/errors.mjs.map +1 -1
  272. package/dist/plugins/deepbook/faucet-strategy.mjs +4 -10
  273. package/dist/plugins/deepbook/faucet-strategy.mjs.map +1 -1
  274. package/dist/plugins/deepbook/hash.mjs.map +1 -1
  275. package/dist/plugins/deepbook/index.d.mts +38 -34
  276. package/dist/plugins/deepbook/index.mjs +133 -64
  277. package/dist/plugins/deepbook/index.mjs.map +1 -1
  278. package/dist/plugins/deepbook/plugin-key.mjs.map +1 -1
  279. package/dist/plugins/deepbook/pyth/index.mjs +4 -8
  280. package/dist/plugins/deepbook/pyth/index.mjs.map +1 -1
  281. package/dist/plugins/deepbook/snapshot.mjs +0 -1
  282. package/dist/plugins/deepbook/snapshot.mjs.map +1 -1
  283. package/dist/plugins/deepbook/type-strings.mjs.map +1 -1
  284. package/dist/plugins/deepbook/types.d.mts +2 -1
  285. package/dist/plugins/deepbook/types.mjs.map +1 -1
  286. package/dist/plugins/faucet/dispatcher.d.mts +3 -3
  287. package/dist/plugins/faucet/dispatcher.mjs.map +1 -1
  288. package/dist/plugins/faucet/errors.mjs.map +1 -1
  289. package/dist/plugins/faucet/http.mjs +2 -10
  290. package/dist/plugins/faucet/http.mjs.map +1 -1
  291. package/dist/plugins/faucet/index.mjs +0 -1
  292. package/dist/plugins/faucet/index.mjs.map +1 -1
  293. package/dist/plugins/host-service/errors.d.mts +1 -3
  294. package/dist/plugins/host-service/errors.mjs +1 -2
  295. package/dist/plugins/host-service/errors.mjs.map +1 -1
  296. package/dist/plugins/host-service/index.d.mts +1 -2
  297. package/dist/plugins/host-service/index.mjs +11 -11
  298. package/dist/plugins/host-service/index.mjs.map +1 -1
  299. package/dist/plugins/host-service/routable.mjs.map +1 -1
  300. package/dist/plugins/host-service/service.mjs +13 -13
  301. package/dist/plugins/host-service/service.mjs.map +1 -1
  302. package/dist/plugins/internal/acquire-on-chain-artifact.mjs.map +1 -1
  303. package/dist/plugins/internal/codegen-helpers.mjs +2 -0
  304. package/dist/plugins/internal/codegen-helpers.mjs.map +1 -1
  305. package/dist/plugins/internal/funding-failure-error.mjs.map +1 -1
  306. package/dist/plugins/{postgres → internal/postgres-sidecar}/connection.mjs +1 -1
  307. package/dist/plugins/internal/postgres-sidecar/connection.mjs.map +1 -0
  308. package/dist/plugins/{postgres → internal/postgres-sidecar}/db-ensure.mjs +30 -16
  309. package/dist/plugins/internal/postgres-sidecar/db-ensure.mjs.map +1 -0
  310. package/dist/plugins/internal/postgres-sidecar/errors.mjs +21 -0
  311. package/dist/plugins/internal/postgres-sidecar/errors.mjs.map +1 -0
  312. package/dist/{substrate/runtime/scoped-multimap → plugins/internal/postgres-sidecar}/index.mjs +1 -0
  313. package/dist/plugins/internal/postgres-sidecar/service.mjs +121 -0
  314. package/dist/plugins/internal/postgres-sidecar/service.mjs.map +1 -0
  315. package/dist/plugins/package/build.mjs +2 -2
  316. package/dist/plugins/package/build.mjs.map +1 -1
  317. package/dist/plugins/package/codegen.d.mts +7 -14
  318. package/dist/plugins/package/codegen.mjs +187 -59
  319. package/dist/plugins/package/codegen.mjs.map +1 -1
  320. package/dist/plugins/package/dep-resolution.mjs +51 -3
  321. package/dist/plugins/package/dep-resolution.mjs.map +1 -1
  322. package/dist/plugins/package/errors.mjs +1 -4
  323. package/dist/plugins/package/errors.mjs.map +1 -1
  324. package/dist/plugins/package/git-source.d.mts +18 -0
  325. package/dist/plugins/package/git-source.mjs +119 -0
  326. package/dist/plugins/package/git-source.mjs.map +1 -0
  327. package/dist/plugins/package/index.d.mts +28 -19
  328. package/dist/plugins/package/index.mjs +107 -32
  329. package/dist/plugins/package/index.mjs.map +1 -1
  330. package/dist/plugins/package/mode-known.mjs +2 -2
  331. package/dist/plugins/package/mode-known.mjs.map +1 -1
  332. package/dist/plugins/package/mode-local.mjs +18 -35
  333. package/dist/plugins/package/mode-local.mjs.map +1 -1
  334. package/dist/plugins/package/publish-executor.mjs +13 -8
  335. package/dist/plugins/package/publish-executor.mjs.map +1 -1
  336. package/dist/plugins/package/publish-output.d.mts +1 -11
  337. package/dist/plugins/package/publish-output.mjs +1 -9
  338. package/dist/plugins/package/publish-output.mjs.map +1 -1
  339. package/dist/plugins/package/registry.d.mts +1 -1
  340. package/dist/plugins/package/registry.mjs +26 -14
  341. package/dist/plugins/package/registry.mjs.map +1 -1
  342. package/dist/plugins/package/service.mjs.map +1 -1
  343. package/dist/plugins/package/snapshot.mjs.map +1 -1
  344. package/dist/plugins/router-entrypoints.mjs +1 -3
  345. package/dist/plugins/router-entrypoints.mjs.map +1 -1
  346. package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs +1 -2
  347. package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs.map +1 -1
  348. package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs +1 -6
  349. package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs.map +1 -1
  350. package/dist/plugins/seal/codegen.d.mts +1 -5
  351. package/dist/plugins/seal/codegen.mjs +83 -12
  352. package/dist/plugins/seal/codegen.mjs.map +1 -1
  353. package/dist/plugins/seal/config-render.mjs +2 -6
  354. package/dist/plugins/seal/config-render.mjs.map +1 -1
  355. package/dist/plugins/seal/deploy.mjs +18 -29
  356. package/dist/plugins/seal/deploy.mjs.map +1 -1
  357. package/dist/plugins/seal/errors.d.mts +4 -5
  358. package/dist/plugins/seal/errors.mjs +1 -8
  359. package/dist/plugins/seal/errors.mjs.map +1 -1
  360. package/dist/plugins/seal/index.d.mts +7 -28
  361. package/dist/plugins/seal/index.mjs +69 -47
  362. package/dist/plugins/seal/index.mjs.map +1 -1
  363. package/dist/plugins/seal/key-manager.mjs.map +1 -1
  364. package/dist/plugins/seal/key-server.mjs +1 -6
  365. package/dist/plugins/seal/key-server.mjs.map +1 -1
  366. package/dist/plugins/seal/keygen.mjs +2 -3
  367. package/dist/plugins/seal/keygen.mjs.map +1 -1
  368. package/dist/plugins/seal/mode/fork-known.mjs.map +1 -1
  369. package/dist/plugins/seal/mode/live.mjs +1 -1
  370. package/dist/plugins/seal/mode/live.mjs.map +1 -1
  371. package/dist/plugins/seal/mode/local-keygen.mjs +4 -10
  372. package/dist/plugins/seal/mode/local-keygen.mjs.map +1 -1
  373. package/dist/plugins/seal/plugin-key.mjs.map +1 -1
  374. package/dist/plugins/seal/registry-publish.mjs.map +1 -1
  375. package/dist/plugins/seal/routable.mjs.map +1 -1
  376. package/dist/plugins/seal/service.mjs.map +1 -1
  377. package/dist/plugins/seal/snapshot.mjs +1 -2
  378. package/dist/plugins/seal/snapshot.mjs.map +1 -1
  379. package/dist/plugins/sui/auto-tick.mjs +5 -5
  380. package/dist/plugins/sui/auto-tick.mjs.map +1 -1
  381. package/dist/plugins/sui/chain-build-container.mjs +2 -2
  382. package/dist/plugins/sui/chain-build-container.mjs.map +1 -1
  383. package/dist/plugins/sui/chain-probe.mjs +4 -4
  384. package/dist/plugins/sui/chain-probe.mjs.map +1 -1
  385. package/dist/plugins/sui/codegen.d.mts +9 -7
  386. package/dist/plugins/sui/codegen.mjs +49 -46
  387. package/dist/plugins/sui/codegen.mjs.map +1 -1
  388. package/dist/plugins/sui/errors.d.mts +1 -1
  389. package/dist/plugins/sui/errors.mjs +1 -9
  390. package/dist/plugins/sui/errors.mjs.map +1 -1
  391. package/dist/{substrate/runtime/sui-execute → plugins/sui/exec}/index.d.mts +1 -1
  392. package/dist/{substrate/runtime/sui-execute → plugins/sui/exec}/index.mjs +3 -7
  393. package/dist/plugins/sui/exec/index.mjs.map +1 -0
  394. package/dist/{substrate/runtime/sui-execute → plugins/sui/exec}/sign-and-dispatch.mjs +1 -1
  395. package/dist/plugins/sui/exec/sign-and-dispatch.mjs.map +1 -0
  396. package/dist/plugins/sui/fork-faucet-strategy.mjs +2 -6
  397. package/dist/plugins/sui/fork-faucet-strategy.mjs.map +1 -1
  398. package/dist/plugins/sui/fork-orchestration.mjs +13 -23
  399. package/dist/plugins/sui/fork-orchestration.mjs.map +1 -1
  400. package/dist/plugins/sui/fork-transaction.mjs.map +1 -1
  401. package/dist/plugins/sui/index.d.mts +34 -83
  402. package/dist/plugins/sui/index.mjs +200 -68
  403. package/dist/plugins/sui/index.mjs.map +1 -1
  404. package/dist/{substrate/runtime/sui-ledger → plugins/sui/ledger}/object-ref.mjs +1 -1
  405. package/dist/plugins/sui/ledger/object-ref.mjs.map +1 -0
  406. package/dist/plugins/sui/local-faucet-strategy.mjs +1 -5
  407. package/dist/plugins/sui/local-faucet-strategy.mjs.map +1 -1
  408. package/dist/plugins/sui/log-attrs.mjs +11 -0
  409. package/dist/plugins/sui/log-attrs.mjs.map +1 -0
  410. package/dist/plugins/sui/mode/external.mjs +4 -12
  411. package/dist/plugins/sui/mode/external.mjs.map +1 -1
  412. package/dist/plugins/sui/mode/fork.mjs +19 -16
  413. package/dist/plugins/sui/mode/fork.mjs.map +1 -1
  414. package/dist/plugins/sui/mode/live.mjs +4 -17
  415. package/dist/plugins/sui/mode/live.mjs.map +1 -1
  416. package/dist/plugins/sui/mode/local.d.mts +1 -0
  417. package/dist/plugins/sui/mode/local.mjs +203 -61
  418. package/dist/plugins/sui/mode/local.mjs.map +1 -1
  419. package/dist/plugins/sui/mode/shared-boot.mjs +18 -23
  420. package/dist/plugins/sui/mode/shared-boot.mjs.map +1 -1
  421. package/dist/plugins/sui/mode/shared.d.mts +6 -7
  422. package/dist/plugins/sui/mode/shared.mjs.map +1 -1
  423. package/dist/plugins/sui/mode/spec.d.mts +23 -6
  424. package/dist/{substrate/runtime/sui-move-build → plugins/sui/move}/index.mjs +28 -30
  425. package/dist/plugins/sui/move/index.mjs.map +1 -0
  426. package/dist/plugins/sui/move-summary-runner.mjs +8 -4
  427. package/dist/plugins/sui/move-summary-runner.mjs.map +1 -1
  428. package/dist/{substrate/network.d.mts → plugins/sui/network-config.d.mts} +11 -10
  429. package/dist/plugins/sui/network-resolver.d.mts +6 -6
  430. package/dist/plugins/sui/routable.mjs.map +1 -1
  431. package/dist/plugins/sui/service.mjs +10 -6
  432. package/dist/plugins/sui/service.mjs.map +1 -1
  433. package/dist/plugins/sui/snapshot.mjs +10 -5
  434. package/dist/plugins/sui/snapshot.mjs.map +1 -1
  435. package/dist/plugins/wallet/codegen.d.mts +8 -6
  436. package/dist/plugins/wallet/codegen.mjs +4 -10
  437. package/dist/plugins/wallet/codegen.mjs.map +1 -1
  438. package/dist/plugins/wallet/errors.mjs +1 -4
  439. package/dist/plugins/wallet/errors.mjs.map +1 -1
  440. package/dist/plugins/wallet/index.d.mts +3 -6
  441. package/dist/plugins/wallet/index.mjs +16 -21
  442. package/dist/plugins/wallet/index.mjs.map +1 -1
  443. package/dist/plugins/wallet/origin-policy.mjs +3 -3
  444. package/dist/plugins/wallet/origin-policy.mjs.map +1 -1
  445. package/dist/plugins/wallet/pairing.mjs +6 -24
  446. package/dist/plugins/wallet/pairing.mjs.map +1 -1
  447. package/dist/plugins/wallet/protocol.mjs.map +1 -1
  448. package/dist/plugins/wallet/routable.mjs.map +1 -1
  449. package/dist/plugins/wallet/server.mjs +17 -24
  450. package/dist/plugins/wallet/server.mjs.map +1 -1
  451. package/dist/plugins/wallet/service.d.mts +2 -2
  452. package/dist/plugins/wallet/service.mjs +4 -15
  453. package/dist/plugins/wallet/service.mjs.map +1 -1
  454. package/dist/plugins/wallet/snapshot.mjs.map +1 -1
  455. package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs +1 -5
  456. package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs.map +1 -1
  457. package/dist/plugins/walrus/codegen.d.mts +2 -13
  458. package/dist/plugins/walrus/codegen.mjs +93 -28
  459. package/dist/plugins/walrus/codegen.mjs.map +1 -1
  460. package/dist/plugins/walrus/deploy-paths.mjs +2 -3
  461. package/dist/plugins/walrus/deploy-paths.mjs.map +1 -1
  462. package/dist/plugins/walrus/deploy.mjs +26 -19
  463. package/dist/plugins/walrus/deploy.mjs.map +1 -1
  464. package/dist/plugins/walrus/errors.mjs +1 -8
  465. package/dist/plugins/walrus/errors.mjs.map +1 -1
  466. package/dist/plugins/walrus/faucet-strategy.mjs +15 -1
  467. package/dist/plugins/walrus/faucet-strategy.mjs.map +1 -1
  468. package/dist/plugins/walrus/index.d.mts +13 -44
  469. package/dist/plugins/walrus/index.mjs +119 -122
  470. package/dist/plugins/walrus/index.mjs.map +1 -1
  471. package/dist/plugins/walrus/mode/known-deploy.mjs +6 -6
  472. package/dist/plugins/walrus/mode/known-deploy.mjs.map +1 -1
  473. package/dist/plugins/walrus/mode/local-cluster.d.mts +2 -2
  474. package/dist/plugins/walrus/mode/local-cluster.mjs +2 -10
  475. package/dist/plugins/walrus/mode/local-cluster.mjs.map +1 -1
  476. package/dist/plugins/walrus/plugin-key.mjs.map +1 -1
  477. package/dist/plugins/walrus/registry-publish.mjs.map +1 -1
  478. package/dist/plugins/walrus/routable.mjs.map +1 -1
  479. package/dist/plugins/walrus/service.mjs.map +1 -1
  480. package/dist/plugins/walrus/snapshot.mjs +3 -3
  481. package/dist/plugins/walrus/snapshot.mjs.map +1 -1
  482. package/dist/plugins/walrus/storage-nodes.mjs +53 -14
  483. package/dist/plugins/walrus/storage-nodes.mjs.map +1 -1
  484. package/dist/plugins/walrus/wal-swap.mjs +4 -8
  485. package/dist/plugins/walrus/wal-swap.mjs.map +1 -1
  486. package/dist/primitives/artifact-publisher.mjs.map +1 -1
  487. package/dist/primitives/cache.d.mts +1 -1
  488. package/dist/runtime/docker/client.mjs +47 -3
  489. package/dist/runtime/docker/client.mjs.map +1 -1
  490. package/dist/runtime/docker/container.mjs +37 -57
  491. package/dist/runtime/docker/container.mjs.map +1 -1
  492. package/dist/runtime/docker/errors.mjs.map +1 -1
  493. package/dist/runtime/docker/exec.mjs +2 -2
  494. package/dist/runtime/docker/exec.mjs.map +1 -1
  495. package/dist/runtime/docker/image.mjs +10 -11
  496. package/dist/runtime/docker/image.mjs.map +1 -1
  497. package/dist/runtime/docker/index.mjs +0 -1
  498. package/dist/runtime/docker/inspect-and-decode.mjs.map +1 -1
  499. package/dist/runtime/docker/inventory.mjs +9 -9
  500. package/dist/runtime/docker/inventory.mjs.map +1 -1
  501. package/dist/runtime/docker/labels.mjs +12 -1
  502. package/dist/runtime/docker/labels.mjs.map +1 -1
  503. package/dist/runtime/docker/network.mjs +6 -6
  504. package/dist/runtime/docker/network.mjs.map +1 -1
  505. package/dist/runtime/docker/render-run-args.mjs.map +1 -1
  506. package/dist/runtime/docker/service.mjs +31 -45
  507. package/dist/runtime/docker/service.mjs.map +1 -1
  508. package/dist/runtime/docker/sweep.mjs +14 -64
  509. package/dist/runtime/docker/sweep.mjs.map +1 -1
  510. package/dist/runtime/docker/volume.mjs +1 -1
  511. package/dist/runtime/docker/volume.mjs.map +1 -1
  512. package/dist/runtime/docker/wrap.mjs +14 -2
  513. package/dist/runtime/docker/wrap.mjs.map +1 -1
  514. package/dist/substrate/brand.d.mts +2 -5
  515. package/dist/substrate/brand.mjs +3 -2
  516. package/dist/substrate/brand.mjs.map +1 -1
  517. package/dist/substrate/cross-process.mjs +2 -16
  518. package/dist/substrate/cross-process.mjs.map +1 -1
  519. package/dist/substrate/event-time.mjs +0 -2
  520. package/dist/substrate/event-time.mjs.map +1 -1
  521. package/dist/substrate/events.d.mts +46 -16
  522. package/dist/substrate/identity.d.mts +11 -5
  523. package/dist/substrate/manifest.d.mts +33 -26
  524. package/dist/substrate/manifest.mjs +8 -3
  525. package/dist/substrate/manifest.mjs.map +1 -1
  526. package/dist/substrate/options.d.mts +33 -4
  527. package/dist/substrate/plugin-ctx.d.mts +70 -0
  528. package/dist/substrate/plugin-ctx.mjs +66 -0
  529. package/dist/substrate/plugin-ctx.mjs.map +1 -0
  530. package/dist/substrate/plugin.d.mts +46 -38
  531. package/dist/substrate/plugin.mjs +13 -9
  532. package/dist/substrate/plugin.mjs.map +1 -1
  533. package/dist/substrate/projection.d.mts +1 -1
  534. package/dist/substrate/runtime/atomic-write.mjs +3 -4
  535. package/dist/substrate/runtime/atomic-write.mjs.map +1 -1
  536. package/dist/substrate/runtime/cache/schema.mjs.map +1 -1
  537. package/dist/substrate/runtime/cache/service.mjs +50 -20
  538. package/dist/substrate/runtime/cache/service.mjs.map +1 -1
  539. package/dist/substrate/runtime/config-validation.mjs.map +1 -1
  540. package/dist/substrate/runtime/control-plane/domain.mjs +34 -12
  541. package/dist/substrate/runtime/control-plane/domain.mjs.map +1 -1
  542. package/dist/substrate/runtime/control-plane/service.mjs.map +1 -1
  543. package/dist/substrate/runtime/cross-process/command-channel/channel.mjs +14 -17
  544. package/dist/substrate/runtime/cross-process/command-channel/channel.mjs.map +1 -1
  545. package/dist/substrate/runtime/cross-process/command-channel/file-channel.mjs.map +1 -1
  546. package/dist/substrate/runtime/cross-process/command-channel/protocol.mjs.map +1 -1
  547. package/dist/substrate/runtime/cross-process/command-channel/runtime-control-lock.mjs.map +1 -1
  548. package/dist/substrate/runtime/cross-process/index.mjs +0 -2
  549. package/dist/substrate/runtime/cross-process/live-clock.mjs +1 -1
  550. package/dist/substrate/runtime/cross-process/live-clock.mjs.map +1 -1
  551. package/dist/substrate/runtime/cross-process/liveness.mjs +11 -18
  552. package/dist/substrate/runtime/cross-process/liveness.mjs.map +1 -1
  553. package/dist/substrate/runtime/cross-process/reclaim-stale-file.mjs +2 -2
  554. package/dist/substrate/runtime/cross-process/reclaim-stale-file.mjs.map +1 -1
  555. package/dist/substrate/runtime/cross-process/roster.mjs +17 -127
  556. package/dist/substrate/runtime/cross-process/roster.mjs.map +1 -1
  557. package/dist/substrate/runtime/cross-process/self-pid.mjs.map +1 -1
  558. package/dist/substrate/runtime/cross-process/stack-lock.mjs +29 -28
  559. package/dist/substrate/runtime/cross-process/stack-lock.mjs.map +1 -1
  560. package/dist/substrate/runtime/current-plugin.mjs.map +1 -1
  561. package/dist/substrate/runtime/errors.mjs +1 -13
  562. package/dist/substrate/runtime/errors.mjs.map +1 -1
  563. package/dist/substrate/runtime/format-unknown-error.mjs.map +1 -1
  564. package/dist/substrate/runtime/host-bind-mount-owner.mjs.map +1 -1
  565. package/dist/substrate/runtime/host-gateway.mjs.map +1 -1
  566. package/dist/substrate/runtime/host-tree-tar/index.mjs +15 -163
  567. package/dist/substrate/runtime/host-tree-tar/index.mjs.map +1 -1
  568. package/dist/substrate/runtime/http-probe.d.mts +1 -3
  569. package/dist/substrate/runtime/http-probe.mjs.map +1 -1
  570. package/dist/substrate/runtime/index.mjs +1 -6
  571. package/dist/substrate/runtime/lease-broker/service.mjs +5 -23
  572. package/dist/substrate/runtime/lease-broker/service.mjs.map +1 -1
  573. package/dist/substrate/runtime/lifecycle/dep-graph.mjs +3 -3
  574. package/dist/substrate/runtime/lifecycle/dep-graph.mjs.map +1 -1
  575. package/dist/substrate/runtime/lifecycle/graph-input-id.d.mts +1 -0
  576. package/dist/substrate/runtime/lifecycle/graph-input-id.mjs +133 -0
  577. package/dist/substrate/runtime/lifecycle/graph-input-id.mjs.map +1 -0
  578. package/dist/substrate/runtime/lifecycle/index.mjs +2 -2
  579. package/dist/substrate/runtime/lifecycle/plugin-registry.d.mts +1 -1
  580. package/dist/substrate/runtime/lifecycle/plugin-registry.mjs +22 -1
  581. package/dist/substrate/runtime/lifecycle/plugin-registry.mjs.map +1 -1
  582. package/dist/substrate/runtime/lifecycle/ready-gate.mjs +2 -15
  583. package/dist/substrate/runtime/lifecycle/ready-gate.mjs.map +1 -1
  584. package/dist/substrate/runtime/lifecycle/selective-restart.mjs +29 -25
  585. package/dist/substrate/runtime/lifecycle/selective-restart.mjs.map +1 -1
  586. package/dist/substrate/runtime/lifecycle/signals.mjs +1 -1
  587. package/dist/substrate/runtime/lifecycle/signals.mjs.map +1 -1
  588. package/dist/substrate/runtime/lifecycle/state-machine.mjs.map +1 -1
  589. package/dist/substrate/runtime/lifecycle/watch-attribution.d.mts +1 -1
  590. package/dist/substrate/runtime/lifecycle/watch-attribution.mjs +0 -1
  591. package/dist/substrate/runtime/lifecycle/watch-attribution.mjs.map +1 -1
  592. package/dist/substrate/runtime/managed-container.d.mts +5 -1
  593. package/dist/substrate/runtime/managed-container.mjs +8 -10
  594. package/dist/substrate/runtime/managed-container.mjs.map +1 -1
  595. package/dist/substrate/runtime/manifest/manifest.mjs +8 -30
  596. package/dist/substrate/runtime/manifest/manifest.mjs.map +1 -1
  597. package/dist/substrate/runtime/mode-errors.d.mts +1 -2
  598. package/dist/substrate/runtime/mode-errors.mjs.map +1 -1
  599. package/dist/substrate/runtime/observability/cascade-formatter.mjs +1 -11
  600. package/dist/substrate/runtime/observability/cascade-formatter.mjs.map +1 -1
  601. package/dist/substrate/runtime/observability/ignore-with-log.mjs.map +1 -1
  602. package/dist/substrate/runtime/observability/index.d.mts +1 -1
  603. package/dist/substrate/runtime/observability/index.mjs +4 -6
  604. package/dist/substrate/runtime/observability/log-attrs.mjs +46 -0
  605. package/dist/substrate/runtime/observability/log-attrs.mjs.map +1 -0
  606. package/dist/substrate/runtime/observability/log-store.mjs.map +1 -1
  607. package/dist/substrate/runtime/observability/logger.mjs +3 -3
  608. package/dist/substrate/runtime/observability/logger.mjs.map +1 -1
  609. package/dist/substrate/runtime/observability/output-truncate.mjs.map +1 -1
  610. package/dist/substrate/runtime/observability/pretty-error.mjs.map +1 -1
  611. package/dist/substrate/runtime/observability/process-lines.mjs.map +1 -1
  612. package/dist/substrate/runtime/observability/redaction.mjs.map +1 -1
  613. package/dist/substrate/runtime/observability/subprocess-capture.mjs +2 -2
  614. package/dist/substrate/runtime/observability/subprocess-capture.mjs.map +1 -1
  615. package/dist/substrate/runtime/passthrough-or-wrap.mjs.map +1 -1
  616. package/dist/substrate/runtime/paths.mjs +27 -9
  617. package/dist/substrate/runtime/paths.mjs.map +1 -1
  618. package/dist/substrate/runtime/phase-preserving-produce.mjs.map +1 -1
  619. package/dist/substrate/runtime/port-broker/service.mjs +10 -27
  620. package/dist/substrate/runtime/port-broker/service.mjs.map +1 -1
  621. package/dist/substrate/runtime/post-acquire-tasks.mjs.map +1 -1
  622. package/dist/substrate/runtime/probes.d.mts +2 -3
  623. package/dist/substrate/runtime/probes.mjs.map +1 -1
  624. package/dist/substrate/runtime/process-supervisor.mjs.map +1 -1
  625. package/dist/substrate/runtime/projection/operational-endpoints.mjs.map +1 -1
  626. package/dist/substrate/runtime/projection/state-ref.mjs.map +1 -1
  627. package/dist/substrate/runtime/projection/update.mjs +87 -11
  628. package/dist/substrate/runtime/projection/update.mjs.map +1 -1
  629. package/dist/substrate/runtime/random-suffix.mjs.map +1 -1
  630. package/dist/substrate/runtime/reconcile/fs-plan.mjs +146 -0
  631. package/dist/substrate/runtime/reconcile/fs-plan.mjs.map +1 -0
  632. package/dist/substrate/runtime/reconcile/graph.mjs +19 -0
  633. package/dist/substrate/runtime/reconcile/graph.mjs.map +1 -0
  634. package/dist/substrate/runtime/reconcile/index.mjs +5 -0
  635. package/dist/substrate/runtime/reconcile/label.mjs +41 -0
  636. package/dist/substrate/runtime/reconcile/label.mjs.map +1 -0
  637. package/dist/substrate/runtime/reconcile/spec.mjs +15 -0
  638. package/dist/substrate/runtime/reconcile/spec.mjs.map +1 -0
  639. package/dist/substrate/runtime/retry-policy.d.mts +2 -3
  640. package/dist/substrate/runtime/retry-policy.mjs.map +1 -1
  641. package/dist/substrate/runtime/routed-url.mjs.map +1 -1
  642. package/dist/substrate/runtime/runtime-decode.mjs.map +1 -1
  643. package/dist/substrate/runtime/scoped-http-server.mjs.map +1 -1
  644. package/dist/substrate/runtime/stage-and-swap/index.mjs +49 -12
  645. package/dist/substrate/runtime/stage-and-swap/index.mjs.map +1 -1
  646. package/dist/substrate/runtime/strategy-registry/chain-keyed-strategy-for.mjs.map +1 -1
  647. package/dist/substrate/runtime/strategy-registry/chain-probe-for.mjs.map +1 -1
  648. package/dist/substrate/runtime/strategy-registry/service.mjs +29 -17
  649. package/dist/substrate/runtime/strategy-registry/service.mjs.map +1 -1
  650. package/dist/substrate/runtime/subnet-broker.mjs.map +1 -1
  651. package/dist/substrate/runtime/supervisor/acquire-node.mjs +188 -56
  652. package/dist/substrate/runtime/supervisor/acquire-node.mjs.map +1 -1
  653. package/dist/substrate/runtime/supervisor/background-tasks.mjs +79 -65
  654. package/dist/substrate/runtime/supervisor/background-tasks.mjs.map +1 -1
  655. package/dist/substrate/runtime/supervisor/command-loop.mjs +82 -23
  656. package/dist/substrate/runtime/supervisor/command-loop.mjs.map +1 -1
  657. package/dist/substrate/runtime/supervisor/contribution-dispatcher.mjs +16 -0
  658. package/dist/substrate/runtime/supervisor/contribution-dispatcher.mjs.map +1 -0
  659. package/dist/substrate/runtime/supervisor/errors.mjs +11 -2
  660. package/dist/substrate/runtime/supervisor/errors.mjs.map +1 -1
  661. package/dist/substrate/runtime/supervisor/index.mjs +2 -0
  662. package/dist/substrate/runtime/supervisor/shutdown.mjs +6 -6
  663. package/dist/substrate/runtime/supervisor/shutdown.mjs.map +1 -1
  664. package/dist/substrate/runtime/supervisor/start-supervisor.mjs +60 -70
  665. package/dist/substrate/runtime/supervisor/start-supervisor.mjs.map +1 -1
  666. package/dist/substrate/runtime/supervisor/state.d.mts +1 -1
  667. package/dist/substrate/runtime/supervisor/state.mjs +1 -1
  668. package/dist/substrate/runtime/supervisor/state.mjs.map +1 -1
  669. package/dist/substrate/runtime/supervisor/teardown.mjs +10 -9
  670. package/dist/substrate/runtime/supervisor/teardown.mjs.map +1 -1
  671. package/dist/substrate/runtime/supervisor/wiring.mjs +6 -20
  672. package/dist/substrate/runtime/supervisor/wiring.mjs.map +1 -1
  673. package/dist/substrate/runtime/tar/reader.mjs +216 -0
  674. package/dist/substrate/runtime/tar/reader.mjs.map +1 -0
  675. package/dist/substrate/runtime/typed-env.mjs.map +1 -1
  676. package/dist/substrate/versioned-doc-schema.mjs.map +1 -1
  677. package/dist/substrate/versioned-doc-sync.mjs +5 -5
  678. package/dist/substrate/versioned-doc-sync.mjs.map +1 -1
  679. package/dist/surfaces/cli/command-tree.mjs +49 -7
  680. package/dist/surfaces/cli/command-tree.mjs.map +1 -1
  681. package/dist/surfaces/cli/commands/config.mjs +1 -1
  682. package/dist/surfaces/cli/commands/config.mjs.map +1 -1
  683. package/dist/surfaces/cli/commands/confirm-node.mjs.map +1 -1
  684. package/dist/surfaces/cli/commands/confirm.mjs.map +1 -1
  685. package/dist/surfaces/cli/commands/doctor.mjs +1 -1
  686. package/dist/surfaces/cli/commands/doctor.mjs.map +1 -1
  687. package/dist/surfaces/cli/commands/prune-picker-entry.mjs.map +1 -1
  688. package/dist/surfaces/cli/commands/prune-picker.mjs.map +1 -1
  689. package/dist/surfaces/cli/commands/prune.mjs +1 -1
  690. package/dist/surfaces/cli/commands/prune.mjs.map +1 -1
  691. package/dist/surfaces/cli/commands/snapshot.mjs +1 -1
  692. package/dist/surfaces/cli/commands/snapshot.mjs.map +1 -1
  693. package/dist/surfaces/cli/commands/status.mjs +1 -1
  694. package/dist/surfaces/cli/commands/status.mjs.map +1 -1
  695. package/dist/surfaces/cli/commands/supervisor-presence.mjs.map +1 -1
  696. package/dist/surfaces/cli/commands/wipe.mjs +3 -4
  697. package/dist/surfaces/cli/commands/wipe.mjs.map +1 -1
  698. package/dist/surfaces/cli/envelope.mjs.map +1 -1
  699. package/dist/surfaces/cli/errors.mjs.map +1 -1
  700. package/dist/surfaces/cli/flags.mjs.map +1 -1
  701. package/dist/surfaces/cli/index.mjs +45 -14
  702. package/dist/surfaces/cli/index.mjs.map +1 -1
  703. package/dist/surfaces/cli/output.mjs.map +1 -1
  704. package/dist/surfaces/cli/sysexits.mjs.map +1 -1
  705. package/dist/surfaces/tui/app.mjs +0 -21
  706. package/dist/surfaces/tui/app.mjs.map +1 -1
  707. package/dist/surfaces/tui/dashboard.mjs +0 -48
  708. package/dist/surfaces/tui/dashboard.mjs.map +1 -1
  709. package/dist/surfaces/tui/display-derivation.mjs +80 -16
  710. package/dist/surfaces/tui/display-derivation.mjs.map +1 -1
  711. package/dist/surfaces/tui/errors.mjs.map +1 -1
  712. package/dist/surfaces/tui/event-log.mjs +0 -9
  713. package/dist/surfaces/tui/event-log.mjs.map +1 -1
  714. package/dist/surfaces/tui/heartbeat.mjs.map +1 -1
  715. package/dist/surfaces/tui/index.mjs +2 -2
  716. package/dist/surfaces/tui/index.mjs.map +1 -1
  717. package/dist/surfaces/tui/input.mjs.map +1 -1
  718. package/dist/surfaces/tui/mode-detect.mjs.map +1 -1
  719. package/dist/surfaces/tui/mount-ink.mjs.map +1 -1
  720. package/dist/surfaces/tui/plain-renderer.mjs +26 -19
  721. package/dist/surfaces/tui/plain-renderer.mjs.map +1 -1
  722. package/dist/surfaces/tui/resource-table.mjs +8 -10
  723. package/dist/surfaces/tui/resource-table.mjs.map +1 -1
  724. package/images/postgres/Dockerfile +0 -1
  725. package/images/sui/Dockerfile +27 -54
  726. package/images/sui/entrypoint.sh +17 -179
  727. package/package.json +23 -15
  728. package/dashboard-ui/assets/index-Bmi1UtAg.js +0 -1356
  729. package/dashboard-ui/assets/index-D5EShVt4.js +0 -3
  730. package/dashboard-ui/assets/index-Deml9drg.css +0 -1
  731. package/dist/api/plugin-errors.d.mts +0 -7
  732. package/dist/api/plugin-errors.mjs +0 -10
  733. package/dist/api/plugin-errors.mjs.map +0 -1
  734. package/dist/cli/wirings/build-verb-layers.mjs +0 -42
  735. package/dist/cli/wirings/build-verb-layers.mjs.map +0 -1
  736. package/dist/contracts/capability-decl.d.mts +0 -40
  737. package/dist/orchestrators/built-in-plugin-layers.mjs +0 -54
  738. package/dist/orchestrators/built-in-plugin-layers.mjs.map +0 -1
  739. package/dist/orchestrators/run.mjs +0 -91
  740. package/dist/orchestrators/run.mjs.map +0 -1
  741. package/dist/orchestrators/runtime-composition.d.mts +0 -10
  742. package/dist/orchestrators/runtime-composition.mjs +0 -252
  743. package/dist/orchestrators/runtime-composition.mjs.map +0 -1
  744. package/dist/orchestrators/snapshot/capture-command.d.mts +0 -1
  745. package/dist/orchestrators/snapshot/capture-command.mjs +0 -25
  746. package/dist/orchestrators/snapshot/capture-command.mjs.map +0 -1
  747. package/dist/orchestrators/snapshot/pending-marker.mjs +0 -99
  748. package/dist/orchestrators/snapshot/pending-marker.mjs.map +0 -1
  749. package/dist/orchestrators/snapshot/recover-pending.mjs +0 -223
  750. package/dist/orchestrators/snapshot/recover-pending.mjs.map +0 -1
  751. package/dist/orchestrators/snapshot/state-document.d.mts +0 -1
  752. package/dist/orchestrators/snapshot/state-document.mjs +0 -58
  753. package/dist/orchestrators/snapshot/state-document.mjs.map +0 -1
  754. package/dist/plugins/account/spans.mjs +0 -16
  755. package/dist/plugins/account/spans.mjs.map +0 -1
  756. package/dist/plugins/account/variants/env.mjs +0 -24
  757. package/dist/plugins/account/variants/env.mjs.map +0 -1
  758. package/dist/plugins/account/variants/inline.mjs +0 -13
  759. package/dist/plugins/account/variants/inline.mjs.map +0 -1
  760. package/dist/plugins/account/variants/keystore.mjs +0 -91
  761. package/dist/plugins/account/variants/keystore.mjs.map +0 -1
  762. package/dist/plugins/action/spans.mjs +0 -11
  763. package/dist/plugins/action/spans.mjs.map +0 -1
  764. package/dist/plugins/coin/spans.mjs +0 -20
  765. package/dist/plugins/coin/spans.mjs.map +0 -1
  766. package/dist/plugins/deepbook/spans.mjs +0 -18
  767. package/dist/plugins/deepbook/spans.mjs.map +0 -1
  768. package/dist/plugins/faucet/spans.mjs +0 -12
  769. package/dist/plugins/faucet/spans.mjs.map +0 -1
  770. package/dist/plugins/package/spans.mjs +0 -14
  771. package/dist/plugins/package/spans.mjs.map +0 -1
  772. package/dist/plugins/postgres/codegen.mjs +0 -42
  773. package/dist/plugins/postgres/codegen.mjs.map +0 -1
  774. package/dist/plugins/postgres/connection.d.mts +0 -33
  775. package/dist/plugins/postgres/connection.mjs.map +0 -1
  776. package/dist/plugins/postgres/db-ensure.mjs.map +0 -1
  777. package/dist/plugins/postgres/errors.d.mts +0 -60
  778. package/dist/plugins/postgres/errors.mjs +0 -29
  779. package/dist/plugins/postgres/errors.mjs.map +0 -1
  780. package/dist/plugins/postgres/index.d.mts +0 -37
  781. package/dist/plugins/postgres/index.mjs +0 -68
  782. package/dist/plugins/postgres/index.mjs.map +0 -1
  783. package/dist/plugins/postgres/routable.mjs +0 -33
  784. package/dist/plugins/postgres/routable.mjs.map +0 -1
  785. package/dist/plugins/postgres/service.d.mts +0 -50
  786. package/dist/plugins/postgres/service.mjs +0 -179
  787. package/dist/plugins/postgres/service.mjs.map +0 -1
  788. package/dist/plugins/postgres/snapshot.mjs +0 -32
  789. package/dist/plugins/postgres/snapshot.mjs.map +0 -1
  790. package/dist/plugins/postgres/spans.mjs +0 -11
  791. package/dist/plugins/postgres/spans.mjs.map +0 -1
  792. package/dist/plugins/seal/spans.mjs +0 -18
  793. package/dist/plugins/seal/spans.mjs.map +0 -1
  794. package/dist/plugins/sui/spans.mjs +0 -17
  795. package/dist/plugins/sui/spans.mjs.map +0 -1
  796. package/dist/plugins/wallet/spans.mjs +0 -22
  797. package/dist/plugins/wallet/spans.mjs.map +0 -1
  798. package/dist/plugins/walrus/registry-publish.d.mts +0 -24
  799. package/dist/plugins/walrus/spans.mjs +0 -18
  800. package/dist/plugins/walrus/spans.mjs.map +0 -1
  801. package/dist/runtime/docker/logs.d.mts +0 -1
  802. package/dist/runtime/docker/logs.mjs +0 -34
  803. package/dist/runtime/docker/logs.mjs.map +0 -1
  804. package/dist/substrate/runtime/artifact-publisher/index.mjs +0 -86
  805. package/dist/substrate/runtime/artifact-publisher/index.mjs.map +0 -1
  806. package/dist/substrate/runtime/capability-sinks/index.d.mts +0 -1
  807. package/dist/substrate/runtime/capability-sinks/index.mjs +0 -3
  808. package/dist/substrate/runtime/capability-sinks/layer.d.mts +0 -1
  809. package/dist/substrate/runtime/capability-sinks/layer.mjs +0 -31
  810. package/dist/substrate/runtime/capability-sinks/layer.mjs.map +0 -1
  811. package/dist/substrate/runtime/capability-sinks/service.d.mts +0 -95
  812. package/dist/substrate/runtime/capability-sinks/service.mjs +0 -69
  813. package/dist/substrate/runtime/capability-sinks/service.mjs.map +0 -1
  814. package/dist/substrate/runtime/cross-process/lock.d.mts +0 -1
  815. package/dist/substrate/runtime/cross-process/lock.mjs +0 -23
  816. package/dist/substrate/runtime/cross-process/lock.mjs.map +0 -1
  817. package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs +0 -113
  818. package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs.map +0 -1
  819. package/dist/substrate/runtime/lifecycle/lifecycle-fact.mjs +0 -31
  820. package/dist/substrate/runtime/lifecycle/lifecycle-fact.mjs.map +0 -1
  821. package/dist/substrate/runtime/observability/formatter-registry.d.mts +0 -1
  822. package/dist/substrate/runtime/observability/formatter-registry.mjs +0 -48
  823. package/dist/substrate/runtime/observability/formatter-registry.mjs.map +0 -1
  824. package/dist/substrate/runtime/observability/span-store.d.mts +0 -1
  825. package/dist/substrate/runtime/observability/span-store.mjs +0 -110
  826. package/dist/substrate/runtime/observability/span-store.mjs.map +0 -1
  827. package/dist/substrate/runtime/observability/spans.d.mts +0 -1
  828. package/dist/substrate/runtime/observability/spans.mjs +0 -87
  829. package/dist/substrate/runtime/observability/spans.mjs.map +0 -1
  830. package/dist/substrate/runtime/projection/index.mjs +0 -4
  831. package/dist/substrate/runtime/projection/persisted.mjs +0 -213
  832. package/dist/substrate/runtime/projection/persisted.mjs.map +0 -1
  833. package/dist/substrate/runtime/scoped-multimap/service.mjs +0 -52
  834. package/dist/substrate/runtime/scoped-multimap/service.mjs.map +0 -1
  835. package/dist/substrate/runtime/scoped-ref-map/index.mjs +0 -2
  836. package/dist/substrate/runtime/scoped-ref-map/service.mjs +0 -83
  837. package/dist/substrate/runtime/scoped-ref-map/service.mjs.map +0 -1
  838. package/dist/substrate/runtime/state-store/index.mjs +0 -3
  839. package/dist/substrate/runtime/state-store/schema.d.mts +0 -1
  840. package/dist/substrate/runtime/state-store/schema.mjs +0 -41
  841. package/dist/substrate/runtime/state-store/schema.mjs.map +0 -1
  842. package/dist/substrate/runtime/state-store/service.d.mts +0 -1
  843. package/dist/substrate/runtime/state-store/service.mjs +0 -145
  844. package/dist/substrate/runtime/state-store/service.mjs.map +0 -1
  845. package/dist/substrate/runtime/sui-execute/index.mjs.map +0 -1
  846. package/dist/substrate/runtime/sui-execute/sign-and-dispatch.mjs.map +0 -1
  847. package/dist/substrate/runtime/sui-ledger/object-ref.mjs.map +0 -1
  848. package/dist/substrate/runtime/sui-move-build/index.mjs.map +0 -1
  849. package/dist/substrate/runtime/supervisor/dispatch-contributions.mjs +0 -151
  850. package/dist/substrate/runtime/supervisor/dispatch-contributions.mjs.map +0 -1
  851. package/dist/substrate/state-store.d.mts +0 -1
  852. /package/dist/orchestrators/{snapshot/pending-marker.d.mts → codegen/id-config.d.mts} +0 -0
  853. /package/dist/orchestrators/snapshot/{recover-pending.d.mts → interrupted-restore.d.mts} +0 -0
  854. /package/dist/{substrate/runtime/sui-execute → plugins/sui/exec}/sign-and-dispatch.d.mts +0 -0
  855. /package/dist/plugins/{postgres/snapshot.d.mts → sui/ledger/object-ref.d.mts} +0 -0
  856. /package/dist/{substrate/runtime/sui-move-build → plugins/sui/move}/index.d.mts +0 -0
  857. /package/dist/substrate/runtime/{state-store/index.d.mts → reconcile/graph.d.mts} +0 -0
  858. /package/dist/substrate/runtime/{cross-process/snapshot-reservation.d.mts → supervisor/contribution-dispatcher.d.mts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"apply.mjs","names":["resolvePath"],"sources":["../../../src/cli/wirings/apply.ts"],"sourcesContent":["// `devstack apply` verb wiring.\n//\n// Live-aware: if a supervisor owns the selected stack, publish an\n// `apply.requested` command and await its ack. Otherwise run a\n// one-shot supervise that exits when all plugins are ready.\n//\n// Logger layer: `Logger.consolePretty()`. `apply` is the documented\n// one-shot mode (no TUI) — its consumers are CI logs and ad-hoc\n// operator runs that read raw stderr. Structured `Effect.log*` records\n// are the only operator-visible diagnostic for non-TUI surfaces, so we\n// route them through the pretty console layer. The sibling `up` verb\n// silences this layer (see `wirings/up.ts` header) because it owns the\n// TUI and would render duplicate / scrambled output otherwise.\n\nimport { dirname, resolve as resolvePath } from 'node:path';\n\nimport { Cause, Effect, Exit, Logger, SubscriptionRef } from 'effect';\n\nimport type { Identity } from '../../substrate/identity.ts';\nimport { StackPathsService } from '../../substrate/runtime/paths.ts';\nimport {\n\tcommandChannelPaths,\n\tmakeCommandChannelPublisher,\n\tmakeProjectionRef,\n\ttype SupervisedStack,\n\twriteProjectionSnapshot,\n} from '../../substrate/runtime/index.ts';\nimport { superviseStackEffect } from '../../orchestrators/run.ts';\nimport {\n\tbuildProductionOrchestratorSinks,\n\tbuildProductionPostAcquireHook,\n} from '../../orchestrators/runtime-composition.ts';\nimport {\n\textendBuiltInPluginContext,\n\tlayerBuiltInPluginRuntime,\n} from '../../orchestrators/built-in-plugin-layers.ts';\nimport { SnapshotOrchestratorService } from '../../orchestrators/snapshot/index.ts';\nimport { type CliError, CliInternalError } from '../../surfaces/cli/errors.ts';\nimport { type CommandResult, probeSupervisorPresence } from '../../surfaces/cli/commands/index.ts';\nimport { ExitCode } from '../../surfaces/cli/sysexits.ts';\nimport type { LoadedConfig } from '../../surfaces/cli/commands/config-loader.ts';\n\nimport { cliErrorFromConfigExit } from '../bail.ts';\nimport { makeConfigLoader } from './config-loader.ts';\nimport {\n\tidentityValueFor,\n\tresolvedIdentityForStack,\n\tstackRootFor,\n\ttype ResolvedIdentity,\n} from './identity.ts';\nimport { buildVerbLayers } from './build-verb-layers.ts';\n\nconst LIVE_APPLY_ACK_TIMEOUT_MILLIS = 10 * 60 * 1000;\n\n/** Outcome of the live-supervisor probe + dispatch:\n * - `kind: 'direct'` — no supervisor; caller runs the direct path.\n * - `kind: 'live-ok'` — live supervisor acked; verb is done.\n * - `kind: 'live-failed'` — live supervisor refused/timed-out; caller\n * surfaces the typed `CliError` via the dispatcher envelope. */\ntype ApplyDispatch =\n\t| { readonly kind: 'direct' }\n\t| { readonly kind: 'live-ok' }\n\t| { readonly kind: 'live-failed'; readonly error: CliError };\n\n/** Probe the roster file; if a supervisor is live, publish\n * `apply.requested` and await its ack. */\nconst runApplyAgainstLiveSupervisor = (\n\tidentity: ResolvedIdentity,\n\tidentityValue: Identity,\n): Effect.Effect<ApplyDispatch> =>\n\tEffect.gen(function* () {\n\t\tconst stackRoot = stackRootFor(identity.runtimeRoot, String(identityValue.stack));\n\t\tconst presence = yield* probeSupervisorPresence(resolvePath(stackRoot, 'roster.json')).pipe(\n\t\t\tEffect.catch(() => Effect.succeed({ live: false, pid: null, hostname: null })),\n\t\t);\n\t\tif (!presence.live) return { kind: 'direct' as const };\n\n\t\tconst exit = yield* Effect.exit(\n\t\t\tEffect.gen(function* () {\n\t\t\t\tconst publisher = yield* makeCommandChannelPublisher(commandChannelPaths(stackRoot));\n\t\t\t\tconst published = yield* publisher.publish({ tag: 'apply.requested' });\n\t\t\t\tconst reply = yield* publisher.awaitCompletion(published, {\n\t\t\t\t\ttimeoutMillis: LIVE_APPLY_ACK_TIMEOUT_MILLIS,\n\t\t\t\t});\n\t\t\t\tif (!reply.ok) {\n\t\t\t\t\treturn yield* Effect.fail(reply.message);\n\t\t\t\t}\n\t\t\t}),\n\t\t);\n\n\t\tif (Exit.isFailure(exit)) {\n\t\t\treturn {\n\t\t\t\tkind: 'live-failed' as const,\n\t\t\t\terror: new CliInternalError({\n\t\t\t\t\tmessage: 'live stack apply failed',\n\t\t\t\t\tcause: Cause.pretty(exit.cause as Cause.Cause<unknown>),\n\t\t\t\t}),\n\t\t\t};\n\t\t}\n\n\t\treturn { kind: 'live-ok' as const };\n\t});\n\nexport const runApplyLive = (\n\tconfigPath: string | undefined,\n\tidentity: ResolvedIdentity,\n): Effect.Effect<CommandResult, CliError> => {\n\tconst loader = makeConfigLoader();\n\treturn Effect.gen(function* () {\n\t\t// Config-load failures surface as typed `CliError`s; the\n\t\t// dispatcher's outer `emitFailure` renders the envelope.\n\t\tconst loadExit = yield* Effect.exit(loader.load(configPath));\n\t\tif (Exit.isFailure(loadExit)) {\n\t\t\treturn yield* Effect.fail(cliErrorFromConfigExit(loadExit));\n\t\t}\n\t\tconst loaded = loadExit.value;\n\t\tconst stack = (loaded as LoadedConfig & { readonly stack: SupervisedStack }).stack;\n\t\t// Re-derive the identity against the EFFECTIVE stack (explicit\n\t\t// `--stack`/`$DEVSTACK_STACK` > `config.stackName` > inferred) so\n\t\t// the live-supervisor probe + roster paths target the same stack\n\t\t// the operator selected — matching `snapshot.ts`. An explicit\n\t\t// `--stack` must NOT be overridden by `config.stackName`, otherwise\n\t\t// `apply` would probe/boot the wrong stack's supervisor.\n\t\tconst effectiveIdentity = resolvedIdentityForStack(identity, stack);\n\t\tconst identityValue: Identity = identityValueFor(effectiveIdentity);\n\t\tconst dispatch = yield* runApplyAgainstLiveSupervisor(effectiveIdentity, identityValue);\n\t\tif (dispatch.kind === 'live-failed') {\n\t\t\treturn yield* Effect.fail(dispatch.error);\n\t\t}\n\t\tif (dispatch.kind === 'live-ok') {\n\t\t\treturn { exitCode: ExitCode.OK };\n\t\t}\n\t\tconst appRoot = dirname(loaded.resolvedConfigPath);\n\t\tconst substrateLayers = buildVerbLayers({\n\t\t\tidentity: identityValue,\n\t\t\tstack,\n\t\t\tappRoot,\n\t\t\truntimeRoot: effectiveIdentity.runtimeRoot,\n\t\t});\n\n\t\tconst program = Effect.gen(function* () {\n\t\t\tconst state = yield* makeProjectionRef();\n\t\t\tconst orchestratorSinks = yield* buildProductionOrchestratorSinks();\n\t\t\tconst postAcquireHook = yield* buildProductionPostAcquireHook({\n\t\t\t\textras: stack.options.extras,\n\t\t\t});\n\t\t\t// Mirror the up-path recovery: reconcile any half-promoted\n\t\t\t// snapshot restore from a prior supervise BEFORE the one-shot\n\t\t\t// apply starts the stack. Idempotent + no-op when no marker.\n\t\t\tconst snapshot = yield* SnapshotOrchestratorService;\n\t\t\tyield* snapshot.recoverPendingRestore.pipe(\n\t\t\t\tEffect.tapCause((cause) =>\n\t\t\t\t\tEffect.sync(() => {\n\t\t\t\t\t\tprocess.stderr.write(\n\t\t\t\t\t\t\t`snapshot recovery scan failed: ${Cause.pretty(cause as Cause.Cause<unknown>)}\\n`,\n\t\t\t\t\t\t);\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t\tEffect.catch(() => Effect.succeed(null)),\n\t\t\t);\n\t\t\tyield* superviseStackEffect(\n\t\t\t\t{ _tag: 'Stack', members: stack.members, options: stack.options },\n\t\t\t\tidentityValue,\n\t\t\t\tstate,\n\t\t\t\t{\n\t\t\t\t\torchestratorSinks,\n\t\t\t\t\tpostAcquireHook,\n\t\t\t\t\tlifetime: 'one-shot',\n\t\t\t\t\textendContext: extendBuiltInPluginContext,\n\t\t\t\t},\n\t\t\t).pipe(Effect.provide(layerBuiltInPluginRuntime(orchestratorSinks)));\n\t\t\tconst stackPaths = yield* StackPathsService;\n\t\t\tyield* writeProjectionSnapshot(stackPaths.stackRoot, yield* SubscriptionRef.get(state));\n\t\t});\n\n\t\treturn yield* program.pipe(\n\t\t\tEffect.provide(substrateLayers),\n\t\t\tEffect.provide(Logger.layer([Logger.consolePretty()])),\n\t\t\tEffect.matchCauseEffect({\n\t\t\t\tonFailure: (cause): Effect.Effect<CommandResult, CliError> =>\n\t\t\t\t\tEffect.fail(\n\t\t\t\t\t\tnew CliInternalError({\n\t\t\t\t\t\t\tmessage: 'stack apply failed',\n\t\t\t\t\t\t\tcause: Cause.pretty(cause as Cause.Cause<unknown>),\n\t\t\t\t\t\t}),\n\t\t\t\t\t),\n\t\t\t\tonSuccess: (): Effect.Effect<CommandResult, CliError> =>\n\t\t\t\t\tEffect.succeed({ exitCode: ExitCode.OK }),\n\t\t\t}),\n\t\t);\n\t});\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAoDA,MAAM,gCAAgC,MAAU;;;AAchD,MAAM,iCACL,UACA,kBAEA,OAAO,IAAI,aAAa;CACvB,MAAM,YAAY,aAAa,SAAS,aAAa,OAAO,cAAc,MAAM,CAAC;AAIjF,KAAI,EAAC,OAHmB,wBAAwBA,QAAY,WAAW,cAAc,CAAC,CAAC,KACtF,OAAO,YAAY,OAAO,QAAQ;EAAE,MAAM;EAAO,KAAK;EAAM,UAAU;EAAM,CAAC,CAAC,CAC9E,EACa,KAAM,QAAO,EAAE,MAAM,UAAmB;CAEtD,MAAM,OAAO,OAAO,OAAO,KAC1B,OAAO,IAAI,aAAa;EACvB,MAAM,YAAY,OAAO,4BAA4B,oBAAoB,UAAU,CAAC;EACpF,MAAM,YAAY,OAAO,UAAU,QAAQ,EAAE,KAAK,mBAAmB,CAAC;EACtE,MAAM,QAAQ,OAAO,UAAU,gBAAgB,WAAW,EACzD,eAAe,+BACf,CAAC;AACF,MAAI,CAAC,MAAM,GACV,QAAO,OAAO,OAAO,KAAK,MAAM,QAAQ;GAExC,CACF;AAED,KAAI,KAAK,UAAU,KAAK,CACvB,QAAO;EACN,MAAM;EACN,OAAO,IAAI,iBAAiB;GAC3B,SAAS;GACT,OAAO,MAAM,OAAO,KAAK,MAA8B;GACvD,CAAC;EACF;AAGF,QAAO,EAAE,MAAM,WAAoB;EAClC;AAEH,MAAa,gBACZ,YACA,aAC4C;CAC5C,MAAM,SAAS,kBAAkB;AACjC,QAAO,OAAO,IAAI,aAAa;EAG9B,MAAM,WAAW,OAAO,OAAO,KAAK,OAAO,KAAK,WAAW,CAAC;AAC5D,MAAI,KAAK,UAAU,SAAS,CAC3B,QAAO,OAAO,OAAO,KAAK,uBAAuB,SAAS,CAAC;EAE5D,MAAM,SAAS,SAAS;EACxB,MAAM,QAAS,OAA8D;EAO7E,MAAM,oBAAoB,yBAAyB,UAAU,MAAM;EACnE,MAAM,gBAA0B,iBAAiB,kBAAkB;EACnE,MAAM,WAAW,OAAO,8BAA8B,mBAAmB,cAAc;AACvF,MAAI,SAAS,SAAS,cACrB,QAAO,OAAO,OAAO,KAAK,SAAS,MAAM;AAE1C,MAAI,SAAS,SAAS,UACrB,QAAO,EAAE,UAAU,SAAS,IAAI;EAGjC,MAAM,kBAAkB,gBAAgB;GACvC,UAAU;GACV;GACA,SAJe,QAAQ,OAAO,mBAIvB;GACP,aAAa,kBAAkB;GAC/B,CAAC;AAqCF,SAAO,OAnCS,OAAO,IAAI,aAAa;GACvC,MAAM,QAAQ,OAAO,mBAAmB;GACxC,MAAM,oBAAoB,OAAO,kCAAkC;GACnE,MAAM,kBAAkB,OAAO,+BAA+B,EAC7D,QAAQ,MAAM,QAAQ,QACtB,CAAC;AAKF,WAAO,OADiB,6BACR,sBAAsB,KACrC,OAAO,UAAU,UAChB,OAAO,WAAW;AACjB,YAAQ,OAAO,MACd,kCAAkC,MAAM,OAAO,MAA8B,CAAC,IAC9E;KACA,CACF,EACD,OAAO,YAAY,OAAO,QAAQ,KAAK,CAAC,CACxC;AACD,UAAO,qBACN;IAAE,MAAM;IAAS,SAAS,MAAM;IAAS,SAAS,MAAM;IAAS,EACjE,eACA,OACA;IACC;IACA;IACA,UAAU;IACV,eAAe;IACf,CACD,CAAC,KAAK,OAAO,QAAQ,0BAA0B,kBAAkB,CAAC,CAAC;AAEpE,UAAO,yBAAwB,OADL,mBACgB,WAAW,OAAO,gBAAgB,IAAI,MAAM,CAAC;IAGnE,CAAC,KACrB,OAAO,QAAQ,gBAAgB,EAC/B,OAAO,QAAQ,OAAO,MAAM,CAAC,OAAO,eAAe,CAAC,CAAC,CAAC,EACtD,OAAO,iBAAiB;GACvB,YAAY,UACX,OAAO,KACN,IAAI,iBAAiB;IACpB,SAAS;IACT,OAAO,MAAM,OAAO,MAA8B;IAClD,CAAC,CACF;GACF,iBACC,OAAO,QAAQ,EAAE,UAAU,SAAS,IAAI,CAAC;GAC1C,CAAC,CACF;GACA"}
1
+ {"version":3,"file":"apply.mjs","names":["resolvePath"],"sources":["../../../src/cli/wirings/apply.ts"],"sourcesContent":["// `devstack apply` verb wiring.\n//\n// Live-aware: if a supervisor owns the selected stack, publish an\n// `apply.requested` command and await its ack. Otherwise run a\n// one-shot supervise that exits when all plugins are ready.\n//\n// Logger layer: `Logger.consolePretty()`. `apply` is the documented\n// one-shot mode (no TUI) — its consumers are CI logs and ad-hoc\n// operator runs that read raw stderr. Structured `Effect.log*` records\n// are the only operator-visible diagnostic for non-TUI surfaces, so we\n// route them through the pretty console layer. The sibling `up` verb\n// silences this layer (see `wirings/up.ts` header) because it owns the\n// TUI and would render duplicate / scrambled output otherwise.\n\nimport { dirname, resolve as resolvePath } from 'node:path';\n\nimport { Cause, Effect, Exit, Logger } from 'effect';\n\nimport type { Identity } from '../../substrate/identity.ts';\nimport { StackPathsService } from '../../substrate/runtime/paths.ts';\nimport {\n\tcommandChannelPaths,\n\tmakeCommandChannelPublisher,\n\tmakeProjectionRef,\n\ttype SupervisedStack,\n} from '../../substrate/runtime/index.ts';\nimport { superviseStackWithProductionBoot } from '../../orchestrators/boot.ts';\nimport {\n\tcomputeSnapshotGraphInputFromStack,\n\trecoverInterruptedRestore,\n\tSnapshotOrchestratorService,\n} from '../../orchestrators/snapshot/index.ts';\nimport { type CliError, CliInternalError } from '../../surfaces/cli/errors.ts';\nimport { type CommandResult, probeSupervisorPresence } from '../../surfaces/cli/commands/index.ts';\nimport { ExitCode } from '../../surfaces/cli/sysexits.ts';\nimport type { LoadedConfig } from '../../surfaces/cli/commands/config-loader.ts';\n\nimport { cliErrorFromConfigExit } from '../bail.ts';\nimport { makeConfigLoader } from './config-loader.ts';\nimport {\n\tidentityValueFor,\n\tresolvedIdentityForStack,\n\tstackRootFor,\n\ttype ResolvedIdentity,\n} from './identity.ts';\nimport { buildVerbLayers } from '../../orchestrators/layers.ts';\nimport { readDevstackVersion } from './read-devstack-version.ts';\n\nconst LIVE_APPLY_ACK_TIMEOUT_MILLIS = 10 * 60 * 1000;\n\n/** Outcome of the live-supervisor probe + dispatch:\n * - `kind: 'direct'` — no supervisor; caller runs the direct path.\n * - `kind: 'live-ok'` — live supervisor acked; verb is done.\n * - `kind: 'live-failed'` — live supervisor refused/timed-out; caller\n * surfaces the typed `CliError` via the dispatcher envelope. */\ntype ApplyDispatch =\n\t| { readonly kind: 'direct' }\n\t| { readonly kind: 'live-ok' }\n\t| { readonly kind: 'live-failed'; readonly error: CliError };\n\n/** Probe the roster file; if a supervisor is live, publish\n * `apply.requested` and await its ack. */\nconst runApplyAgainstLiveSupervisor = (\n\tidentity: ResolvedIdentity,\n\tidentityValue: Identity,\n): Effect.Effect<ApplyDispatch> =>\n\tEffect.gen(function* () {\n\t\tconst stackRoot = stackRootFor(identity.runtimeRoot, String(identityValue.stack));\n\t\tconst presence = yield* probeSupervisorPresence(resolvePath(stackRoot, 'roster.json')).pipe(\n\t\t\tEffect.catch(() => Effect.succeed({ live: false, pid: null, hostname: null })),\n\t\t);\n\t\tif (!presence.live) return { kind: 'direct' as const };\n\n\t\tconst exit = yield* Effect.exit(\n\t\t\tEffect.gen(function* () {\n\t\t\t\tconst publisher = yield* makeCommandChannelPublisher(commandChannelPaths(stackRoot));\n\t\t\t\tconst published = yield* publisher.publish({ tag: 'apply.requested' });\n\t\t\t\tconst reply = yield* publisher.awaitCompletion(published, {\n\t\t\t\t\ttimeoutMillis: LIVE_APPLY_ACK_TIMEOUT_MILLIS,\n\t\t\t\t});\n\t\t\t\tif (!reply.ok) {\n\t\t\t\t\treturn yield* Effect.fail(reply.message);\n\t\t\t\t}\n\t\t\t}),\n\t\t);\n\n\t\tif (Exit.isFailure(exit)) {\n\t\t\treturn {\n\t\t\t\tkind: 'live-failed' as const,\n\t\t\t\terror: new CliInternalError({\n\t\t\t\t\tmessage: 'live stack apply failed',\n\t\t\t\t\tcause: Cause.pretty(exit.cause as Cause.Cause<unknown>),\n\t\t\t\t}),\n\t\t\t};\n\t\t}\n\n\t\treturn { kind: 'live-ok' as const };\n\t});\n\nexport const runApplyLive = (\n\tconfigPath: string | undefined,\n\tidentity: ResolvedIdentity,\n): Effect.Effect<CommandResult, CliError> => {\n\tconst loader = makeConfigLoader();\n\treturn Effect.gen(function* () {\n\t\t// Config-load failures surface as typed `CliError`s; the\n\t\t// dispatcher's outer `emitFailure` renders the envelope.\n\t\tconst loadExit = yield* Effect.exit(loader.load(configPath));\n\t\tif (Exit.isFailure(loadExit)) {\n\t\t\treturn yield* Effect.fail(cliErrorFromConfigExit(loadExit));\n\t\t}\n\t\tconst loaded = loadExit.value;\n\t\tconst stack = (loaded as LoadedConfig & { readonly engine: SupervisedStack }).engine;\n\t\t// Re-derive the identity against the EFFECTIVE stack (explicit\n\t\t// `--stack`/`$DEVSTACK_STACK` > `config.stackName` > inferred) so\n\t\t// the live-supervisor probe + roster paths target the same stack\n\t\t// the operator selected — matching `snapshot.ts`. An explicit\n\t\t// `--stack` must NOT be overridden by `config.stackName`, otherwise\n\t\t// `apply` would probe/boot the wrong stack's supervisor.\n\t\tconst effectiveIdentity = resolvedIdentityForStack(identity, stack);\n\t\tconst identityValue: Identity = identityValueFor(effectiveIdentity);\n\t\tconst dispatch = yield* runApplyAgainstLiveSupervisor(effectiveIdentity, identityValue);\n\t\tif (dispatch.kind === 'live-failed') {\n\t\t\treturn yield* Effect.fail(dispatch.error);\n\t\t}\n\t\tif (dispatch.kind === 'live-ok') {\n\t\t\treturn { exitCode: ExitCode.OK };\n\t\t}\n\t\tconst appRoot = dirname(loaded.resolvedConfigPath);\n\t\tconst substrateLayers = buildVerbLayers({\n\t\t\tidentity: identityValue,\n\t\t\tstack,\n\t\t\tappRoot,\n\t\t\truntimeRoot: effectiveIdentity.runtimeRoot,\n\t\t});\n\n\t\tconst program = Effect.gen(function* () {\n\t\t\tconst state = yield* makeProjectionRef();\n\t\t\tconst stackPaths = yield* StackPathsService;\n\t\t\tconst computeGraphInput = computeSnapshotGraphInputFromStack({\n\t\t\t\tstack,\n\t\t\t\tdevstackVersion: readDevstackVersion({ fallback: '0.0.0' }),\n\t\t\t});\n\t\t\t// Mirror the up-path recovery: resume any restore interrupted by a\n\t\t\t// hard kill between the atomic swap and the image-promotion handoff\n\t\t\t// completing (the interrupted-restore sentinel rode the swap into the\n\t\t\t// live root and was never cleared) BEFORE the one-shot apply starts\n\t\t\t// the stack. Idempotent + no-op when no sentinel is present.\n\t\t\tconst snapshot = yield* SnapshotOrchestratorService;\n\t\t\tyield* recoverInterruptedRestore({\n\t\t\t\tliveRoot: stackPaths.stackRoot,\n\t\t\t\trestoreSnapshot: (id) =>\n\t\t\t\t\tcomputeGraphInput.pipe(\n\t\t\t\t\t\tEffect.flatMap((currentGraphInput) =>\n\t\t\t\t\t\t\tsnapshot.restore({\n\t\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\t\tcurrentGraphInput,\n\t\t\t\t\t\t\t\tgraphInputMismatchPolicy: 'warn',\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t});\n\t\t\t// The contribution dispatcher + post-acquire hook + built-in\n\t\t\t// plugin-context extension are assembled in ONE place\n\t\t\t// (`orchestrators/boot.ts superviseStackWithProductionBoot`); this\n\t\t\t// one-shot verb supplies only the per-caller inputs (`extras`,\n\t\t\t// `lifetime: 'one-shot'`). Run-to-completion + result semantics are\n\t\t\t// unchanged: the surrounding `matchCauseEffect` below still maps the\n\t\t\t// supervised cause/success onto the `CommandResult`.\n\t\t\tyield* superviseStackWithProductionBoot(\n\t\t\t\t{ _tag: 'Stack', members: stack.members, options: stack.options },\n\t\t\t\tidentityValue,\n\t\t\t\tstate,\n\t\t\t\t{\n\t\t\t\t\textras: stack.options.extras,\n\t\t\t\t\tnetworkOptions: stack.options.networkOptions,\n\t\t\t\t\tlifetime: 'one-shot',\n\t\t\t\t},\n\t\t\t);\n\t\t});\n\n\t\treturn yield* program.pipe(\n\t\t\tEffect.provide(substrateLayers),\n\t\t\tEffect.provide(Logger.layer([Logger.consolePretty()])),\n\t\t\tEffect.matchCauseEffect({\n\t\t\t\tonFailure: (cause): Effect.Effect<CommandResult, CliError> =>\n\t\t\t\t\tEffect.fail(\n\t\t\t\t\t\tnew CliInternalError({\n\t\t\t\t\t\t\tmessage: 'stack apply failed',\n\t\t\t\t\t\t\tcause: Cause.pretty(cause as Cause.Cause<unknown>),\n\t\t\t\t\t\t}),\n\t\t\t\t\t),\n\t\t\t\tonSuccess: (): Effect.Effect<CommandResult, CliError> =>\n\t\t\t\t\tEffect.succeed({ exitCode: ExitCode.OK }),\n\t\t\t}),\n\t\t);\n\t});\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAgDA,MAAM,gCAAgC,MAAU;;;AAchD,MAAM,iCACL,UACA,kBAEA,OAAO,IAAI,aAAa;CACvB,MAAM,YAAY,aAAa,SAAS,aAAa,OAAO,cAAc,KAAK,CAAC;CAIhF,IAAI,EAAC,OAHmB,wBAAwBA,QAAY,WAAW,aAAa,CAAC,CAAC,CAAC,KACtF,OAAO,YAAY,OAAO,QAAQ;EAAE,MAAM;EAAO,KAAK;EAAM,UAAU;CAAK,CAAC,CAAC,CAC9E,EAAA,CACc,MAAM,OAAO,EAAE,MAAM,SAAkB;CAErD,MAAM,OAAO,OAAO,OAAO,KAC1B,OAAO,IAAI,aAAa;EACvB,MAAM,YAAY,OAAO,4BAA4B,oBAAoB,SAAS,CAAC;EACnF,MAAM,YAAY,OAAO,UAAU,QAAQ,EAAE,KAAK,kBAAkB,CAAC;EACrE,MAAM,QAAQ,OAAO,UAAU,gBAAgB,WAAW,EACzD,eAAe,8BAChB,CAAC;EACD,IAAI,CAAC,MAAM,IACV,OAAO,OAAO,OAAO,KAAK,MAAM,OAAO;CAEzC,CAAC,CACF;CAEA,IAAI,KAAK,UAAU,IAAI,GACtB,OAAO;EACN,MAAM;EACN,OAAO,IAAI,iBAAiB;GAC3B,SAAS;GACT,OAAO,MAAM,OAAO,KAAK,KAA6B;EACvD,CAAC;CACF;CAGD,OAAO,EAAE,MAAM,UAAmB;AACnC,CAAC;AAEF,MAAa,gBACZ,YACA,aAC4C;CAC5C,MAAM,SAAS,iBAAiB;CAChC,OAAO,OAAO,IAAI,aAAa;EAG9B,MAAM,WAAW,OAAO,OAAO,KAAK,OAAO,KAAK,UAAU,CAAC;EAC3D,IAAI,KAAK,UAAU,QAAQ,GAC1B,OAAO,OAAO,OAAO,KAAK,uBAAuB,QAAQ,CAAC;EAE3D,MAAM,SAAS,SAAS;EACxB,MAAM,QAAS,OAA+D;EAO9E,MAAM,oBAAoB,yBAAyB,UAAU,KAAK;EAClE,MAAM,gBAA0B,iBAAiB,iBAAiB;EAClE,MAAM,WAAW,OAAO,8BAA8B,mBAAmB,aAAa;EACtF,IAAI,SAAS,SAAS,eACrB,OAAO,OAAO,OAAO,KAAK,SAAS,KAAK;EAEzC,IAAI,SAAS,SAAS,WACrB,OAAO,EAAE,UAAU,SAAS,GAAG;EAGhC,MAAM,kBAAkB,gBAAgB;GACvC,UAAU;GACV;GACA,SAJe,QAAQ,OAAO,kBAIxB;GACN,aAAa,kBAAkB;EAChC,CAAC;EA+CD,OAAO,OA7CS,OAAO,IAAI,aAAa;GACvC,MAAM,QAAQ,OAAO,kBAAkB;GACvC,MAAM,aAAa,OAAO;GAC1B,MAAM,oBAAoB,mCAAmC;IAC5D;IACA,iBAAiB,oBAAoB,EAAE,UAAU,QAAQ,CAAC;GAC3D,CAAC;GAMD,MAAM,WAAW,OAAO;GACxB,OAAO,0BAA0B;IAChC,UAAU,WAAW;IACrB,kBAAkB,OACjB,kBAAkB,KACjB,OAAO,SAAS,sBACf,SAAS,QAAQ;KAChB;KACA;KACA,0BAA0B;IAC3B,CAAC,CACF,CACD;GACF,CAAC;GAQD,OAAO,iCACN;IAAE,MAAM;IAAS,SAAS,MAAM;IAAS,SAAS,MAAM;GAAQ,GAChE,eACA,OACA;IACC,QAAQ,MAAM,QAAQ;IACtB,gBAAgB,MAAM,QAAQ;IAC9B,UAAU;GACX,CACD;EACD,CAEoB,CAAC,CAAC,KACrB,OAAO,QAAQ,eAAe,GAC9B,OAAO,QAAQ,OAAO,MAAM,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,GACrD,OAAO,iBAAiB;GACvB,YAAY,UACX,OAAO,KACN,IAAI,iBAAiB;IACpB,SAAS;IACT,OAAO,MAAM,OAAO,KAA6B;GAClD,CAAC,CACF;GACD,iBACC,OAAO,QAAQ,EAAE,UAAU,SAAS,GAAG,CAAC;EAC1C,CAAC,CACF;CACD,CAAC;AACF"}
@@ -0,0 +1,108 @@
1
+ import { layerMystenMoveCodegen } from "../../orchestrators/codegen/bindings.mjs";
2
+ import { layerSuiMoveSummaryRunnerDocker, layerSuiMoveSummaryRunnerHost } from "../../plugins/sui/move-summary-runner.mjs";
3
+ import { layerCodegenPaths, layerCodegenRoot } from "../../orchestrators/codegen/paths.mjs";
4
+ import { runEmitCycle } from "../../orchestrators/codegen/service.mjs";
5
+ import { buildSubstrateLayers } from "../../orchestrators/boot.mjs";
6
+ import { ExitCode } from "../../surfaces/cli/sysexits.mjs";
7
+ import { CliInternalError } from "../../surfaces/cli/errors.mjs";
8
+ import "../../surfaces/cli/commands/index.mjs";
9
+ import { cliErrorFromConfigExit } from "../bail.mjs";
10
+ import { makeConfigLoader } from "./config-loader.mjs";
11
+ import { identityValueFor } from "./identity.mjs";
12
+ import { Cause, Effect, Exit, Layer, Logger } from "effect";
13
+ import { dirname, resolve } from "node:path";
14
+ import { spawnSync } from "node:child_process";
15
+ import * as NodeFileSystem from "@effect/platform-node/NodeFileSystem";
16
+ import * as NodePath from "@effect/platform-node/NodePath";
17
+ import * as NodeChildProcessSpawner from "@effect/platform-node/NodeChildProcessSpawner";
18
+ //#region src/cli/wirings/codegen.ts
19
+ /** Walk the stack members, calling each plugin spec's `staticCodegen`
20
+ * hook (skipping plugins that lack one) to derive the committed-tree
21
+ * contributions from config alone. KNOWN package ids come from the
22
+ * declared `networks` literals; LOCAL ids stay the all-zero sentinel
23
+ * (resolved at app build/dev time through `__DEVSTACK_IDS__`). */
24
+ const deriveContributions = (members) => {
25
+ const decls = [];
26
+ for (const member of members) {
27
+ if (member.staticCodegen === void 0) continue;
28
+ decls.push(...member.staticCodegen());
29
+ }
30
+ return decls;
31
+ };
32
+ /** True if a `sui` binary is resolvable on PATH (cheap `--version` probe). */
33
+ const hostSuiAvailable = () => {
34
+ try {
35
+ return spawnSync("sui", ["--version"], {
36
+ timeout: 5e3,
37
+ stdio: [
38
+ "ignore",
39
+ "ignore",
40
+ "ignore"
41
+ ]
42
+ }).status === 0;
43
+ } catch {
44
+ return false;
45
+ }
46
+ };
47
+ const selectCodegenRunner = () => {
48
+ const requested = process.env["DEVSTACK_CODEGEN_RUNNER"]?.trim().toLowerCase();
49
+ if (requested === "docker" || requested === "host") return requested;
50
+ return hostSuiAvailable() ? "host" : "docker";
51
+ };
52
+ /**
53
+ * Build the codegen service layer: `CodegenPathsService` +
54
+ * `MoveSummaryRunnerService` + `MoveCodegenService`, with the Node
55
+ * FileSystem / Path / child-process spawner provided UNDER them. Mirrors
56
+ * `apply`'s substrate-layer provision shape — one merged layer providing
57
+ * the services, with `Logger` supplied as a separate outer layer over the
58
+ * program (`consolePretty` needs no FileSystem).
59
+ *
60
+ * The Move-summary runner is selected per `selectCodegenRunner`. The
61
+ * `host` runner only needs a child-process spawner; the `docker` runner
62
+ * needs the full Docker `ContainerRuntimeService`, so it provides the
63
+ * substrate layer stack (`buildSubstrateLayers`) UNDER it. The Docker
64
+ * runner produces byte-identical bindings to the host runner — it runs the
65
+ * SAME `sui move summary` argv, just inside the pinned CLI image — so the
66
+ * committed `src/generated` tree is independent of which runner emitted it.
67
+ */
68
+ const buildCodegenLayer = (appRoot, runner, identity) => {
69
+ const generatedDir = resolve(appRoot, "src", "generated");
70
+ const platform = Layer.mergeAll(NodeFileSystem.layer, NodePath.layer);
71
+ const codegenPaths = layerCodegenPaths.pipe(Layer.provideMerge(layerCodegenRoot({
72
+ outputDir: generatedDir,
73
+ stackSubdir: null,
74
+ extrasDir: resolve(appRoot, "src", "generated-extras")
75
+ })));
76
+ const moveRunner = runner === "docker" ? layerSuiMoveSummaryRunnerDocker.pipe(Layer.provideMerge(buildSubstrateLayers(identityValueFor(identity), identity.runtimeRoot))) : layerSuiMoveSummaryRunnerHost.pipe(Layer.provideMerge(NodeChildProcessSpawner.layer));
77
+ return Layer.mergeAll(codegenPaths, moveRunner, layerMystenMoveCodegen()).pipe(Layer.provideMerge(platform));
78
+ };
79
+ /**
80
+ * Run the stack-free codegen verb. `configPath` is the devstack config
81
+ * path. No stack boots; the committed `src/generated` tree is rewritten
82
+ * deterministically from Move source.
83
+ */
84
+ const runCodegen = (configPath, identity) => {
85
+ const loader = makeConfigLoader();
86
+ return Effect.gen(function* () {
87
+ const loadExit = yield* Effect.exit(loader.load(configPath));
88
+ if (Exit.isFailure(loadExit)) return yield* Effect.fail(cliErrorFromConfigExit(loadExit));
89
+ const loaded = loadExit.value;
90
+ const stack = loaded.engine;
91
+ const appRoot = dirname(loaded.resolvedConfigPath);
92
+ const contributions = deriveContributions(stack.members);
93
+ const runner = selectCodegenRunner();
94
+ const exit = yield* Effect.exit(runEmitCycle({
95
+ contributions,
96
+ trackTree: true
97
+ }).pipe(Effect.provide(buildCodegenLayer(appRoot, runner, identity)), Effect.provide(Logger.layer([Logger.consolePretty()]))));
98
+ if (Exit.isFailure(exit)) return yield* Effect.fail(new CliInternalError({
99
+ message: "codegen failed",
100
+ cause: Cause.pretty(exit.cause)
101
+ }));
102
+ return { exitCode: ExitCode.OK };
103
+ });
104
+ };
105
+ //#endregion
106
+ export { runCodegen };
107
+
108
+ //# sourceMappingURL=codegen.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codegen.mjs","names":["resolvePath"],"sources":["../../../src/cli/wirings/codegen.ts"],"sourcesContent":["// `devstack codegen` verb wiring.\n//\n// Deterministic, STACK-FREE codegen: `(Move source) → generated`. It\n// boots NO stack — no supervisor, no acquire, no Docker. It loads the\n// config, derives each plugin's codegen contributions from config ALONE\n// (via the plugin spec's `staticCodegen` hook), and runs ONE\n// `runEmitCycle` that writes the committed `src/generated` tree.\n//\n// On-chain ids are LOADED CONFIG DATA, not generated output. The\n// committed tree carries the all-zero sentinel for every LOCAL id (and\n// declared literals for KNOWN packages); the committed `config.ts`\n// resolver throws loudly at runtime if a sentinel id is used. The Vite\n// plugin injects the real ids in dev (live `devstack-ids.json`) and prod\n// (a committed id-config file via the `ids` option / `DEVSTACK_IDS_FILE`).\n// So `git status` shows NO churn under\n// `src/generated` after a `devstack up` — ids land only in the\n// gitignored `.devstack/`.\n//\n// Logger layer: `Logger.consolePretty()` — mirrors `apply.ts` exactly.\n// `consolePretty` needs no FileSystem, so it is provided as a separate\n// OUTER layer over the codegen service layer (which provides the Node\n// FileSystem / Path / child-process spawner UNDER the codegen services).\n// This is the same provision shape `apply` uses and compiles cleanly\n// under the strict tsconfig.\n\nimport { spawnSync } from 'node:child_process';\nimport { dirname, resolve as resolvePath } from 'node:path';\n\nimport { Cause, Effect, Exit, Layer, Logger } from 'effect';\nimport * as NodeChildProcessSpawner from '@effect/platform-node/NodeChildProcessSpawner';\nimport * as NodeFileSystem from '@effect/platform-node/NodeFileSystem';\nimport * as NodePath from '@effect/platform-node/NodePath';\n\nimport type { CodegenableDecl } from '../../contracts/codegenable.ts';\nimport type { AnyPlugin } from '../../substrate/plugin.ts';\nimport type { SupervisedStack } from '../../substrate/runtime/index.ts';\nimport { layerMystenMoveCodegen } from '../../orchestrators/codegen/bindings.ts';\nimport {\n\tlayerSuiMoveSummaryRunnerDocker,\n\tlayerSuiMoveSummaryRunnerHost,\n} from '../../plugins/sui/move-summary-runner.ts';\nimport { buildSubstrateLayers } from '../../orchestrators/boot.ts';\nimport { layerCodegenPaths, layerCodegenRoot } from '../../orchestrators/codegen/paths.ts';\nimport { runEmitCycle } from '../../orchestrators/codegen/service.ts';\nimport { type CliError, CliInternalError } from '../../surfaces/cli/errors.ts';\nimport { type CommandResult } from '../../surfaces/cli/commands/index.ts';\nimport { ExitCode } from '../../surfaces/cli/sysexits.ts';\nimport type { LoadedConfig } from '../../surfaces/cli/commands/config-loader.ts';\n\nimport { cliErrorFromConfigExit } from '../bail.ts';\nimport { makeConfigLoader } from './config-loader.ts';\nimport { identityValueFor, type ResolvedIdentity } from './identity.ts';\n\n/** Walk the stack members, calling each plugin spec's `staticCodegen`\n * hook (skipping plugins that lack one) to derive the committed-tree\n * contributions from config alone. KNOWN package ids come from the\n * declared `networks` literals; LOCAL ids stay the all-zero sentinel\n * (resolved at app build/dev time through `__DEVSTACK_IDS__`). */\nconst deriveContributions = (members: ReadonlyArray<AnyPlugin>): ReadonlyArray<CodegenableDecl> => {\n\tconst decls: Array<CodegenableDecl> = [];\n\tfor (const member of members) {\n\t\tif (member.staticCodegen === undefined) continue;\n\t\tdecls.push(...member.staticCodegen());\n\t}\n\treturn decls;\n};\n\n/** Which Move-summary runner the stack-free codegen verb uses.\n *\n * - `host` — invoke a local `sui` CLI on PATH directly (fast, no Docker).\n * - `docker` — run `sui move summary` inside the pinned Sui CLI image\n * (the same runner `boot.ts` wires for `up`/`apply`). Needs Docker but\n * NO host `sui`, which is what CI has.\n *\n * Selection follows `DEVSTACK_CODEGEN_RUNNER` (`docker`/`host`); when unset,\n * auto-detect: use `host` if a `sui` binary is on PATH, else fall back to\n * `docker`. CI never installs `sui`, so it lands on `docker` automatically;\n * a workflow can still force it with `DEVSTACK_CODEGEN_RUNNER=docker`. */\ntype CodegenRunner = 'host' | 'docker';\n\n/** True if a `sui` binary is resolvable on PATH (cheap `--version` probe). */\nconst hostSuiAvailable = (): boolean => {\n\ttry {\n\t\tconst probe = spawnSync('sui', ['--version'], {\n\t\t\ttimeout: 5_000,\n\t\t\tstdio: ['ignore', 'ignore', 'ignore'],\n\t\t});\n\t\treturn probe.status === 0;\n\t} catch {\n\t\treturn false;\n\t}\n};\n\nconst selectCodegenRunner = (): CodegenRunner => {\n\tconst requested = process.env['DEVSTACK_CODEGEN_RUNNER']?.trim().toLowerCase();\n\tif (requested === 'docker' || requested === 'host') return requested;\n\treturn hostSuiAvailable() ? 'host' : 'docker';\n};\n\n/**\n * Build the codegen service layer: `CodegenPathsService` +\n * `MoveSummaryRunnerService` + `MoveCodegenService`, with the Node\n * FileSystem / Path / child-process spawner provided UNDER them. Mirrors\n * `apply`'s substrate-layer provision shape — one merged layer providing\n * the services, with `Logger` supplied as a separate outer layer over the\n * program (`consolePretty` needs no FileSystem).\n *\n * The Move-summary runner is selected per `selectCodegenRunner`. The\n * `host` runner only needs a child-process spawner; the `docker` runner\n * needs the full Docker `ContainerRuntimeService`, so it provides the\n * substrate layer stack (`buildSubstrateLayers`) UNDER it. The Docker\n * runner produces byte-identical bindings to the host runner — it runs the\n * SAME `sui move summary` argv, just inside the pinned CLI image — so the\n * committed `src/generated` tree is independent of which runner emitted it.\n */\nconst buildCodegenLayer = (appRoot: string, runner: CodegenRunner, identity: ResolvedIdentity) => {\n\tconst generatedDir = resolvePath(appRoot, 'src', 'generated');\n\tconst platform = Layer.mergeAll(NodeFileSystem.layer, NodePath.layer);\n\tconst codegenPaths = layerCodegenPaths.pipe(\n\t\tLayer.provideMerge(\n\t\t\tlayerCodegenRoot({\n\t\t\t\toutputDir: generatedDir,\n\t\t\t\tstackSubdir: null,\n\t\t\t\t// Static contributions never target `generated-extras` (those\n\t\t\t\t// decls are dev-only and carry no `staticCodegen`), so this\n\t\t\t\t// path is declared but never written.\n\t\t\t\textrasDir: resolvePath(appRoot, 'src', 'generated-extras'),\n\t\t\t}),\n\t\t),\n\t);\n\tconst moveRunner =\n\t\trunner === 'docker'\n\t\t\t? layerSuiMoveSummaryRunnerDocker.pipe(\n\t\t\t\t\t// The Docker runner only needs `ContainerRuntimeService`; the\n\t\t\t\t\t// substrate layer stack provides it (along with the rest of L0).\n\t\t\t\t\t// No stack containers are created — only one-shot `sui move\n\t\t\t\t\t// summary` runs against the pinned CLI image.\n\t\t\t\t\tLayer.provideMerge(\n\t\t\t\t\t\tbuildSubstrateLayers(identityValueFor(identity), identity.runtimeRoot),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t: layerSuiMoveSummaryRunnerHost.pipe(Layer.provideMerge(NodeChildProcessSpawner.layer));\n\treturn Layer.mergeAll(codegenPaths, moveRunner, layerMystenMoveCodegen()).pipe(\n\t\tLayer.provideMerge(platform),\n\t);\n};\n\n/**\n * Run the stack-free codegen verb. `configPath` is the devstack config\n * path. No stack boots; the committed `src/generated` tree is rewritten\n * deterministically from Move source.\n */\nexport const runCodegen = (\n\tconfigPath: string | undefined,\n\tidentity: ResolvedIdentity,\n): Effect.Effect<CommandResult, CliError> => {\n\tconst loader = makeConfigLoader();\n\treturn Effect.gen(function* () {\n\t\tconst loadExit = yield* Effect.exit(loader.load(configPath));\n\t\tif (Exit.isFailure(loadExit)) {\n\t\t\treturn yield* Effect.fail(cliErrorFromConfigExit(loadExit));\n\t\t}\n\t\tconst loaded = loadExit.value;\n\t\tconst stack = (loaded as LoadedConfig & { readonly engine: SupervisedStack }).engine;\n\t\tconst appRoot = dirname(loaded.resolvedConfigPath);\n\n\t\tconst contributions = deriveContributions(stack.members);\n\t\tconst runner = selectCodegenRunner();\n\n\t\tconst exit = yield* Effect.exit(\n\t\t\trunEmitCycle({ contributions, trackTree: true }).pipe(\n\t\t\t\tEffect.provide(buildCodegenLayer(appRoot, runner, identity)),\n\t\t\t\tEffect.provide(Logger.layer([Logger.consolePretty()])),\n\t\t\t),\n\t\t);\n\t\tif (Exit.isFailure(exit)) {\n\t\t\treturn yield* Effect.fail(\n\t\t\t\tnew CliInternalError({\n\t\t\t\t\tmessage: 'codegen failed',\n\t\t\t\t\tcause: Cause.pretty(exit.cause as Cause.Cause<unknown>),\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\t\treturn { exitCode: ExitCode.OK };\n\t});\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA0DA,MAAM,uBAAuB,YAAsE;CAClG,MAAM,QAAgC,CAAC;CACvC,KAAK,MAAM,UAAU,SAAS;EAC7B,IAAI,OAAO,kBAAkB,KAAA,GAAW;EACxC,MAAM,KAAK,GAAG,OAAO,cAAc,CAAC;CACrC;CACA,OAAO;AACR;;AAgBA,MAAM,yBAAkC;CACvC,IAAI;EAKH,OAJc,UAAU,OAAO,CAAC,WAAW,GAAG;GAC7C,SAAS;GACT,OAAO;IAAC;IAAU;IAAU;GAAQ;EACrC,CACW,CAAC,CAAC,WAAW;CACzB,QAAQ;EACP,OAAO;CACR;AACD;AAEA,MAAM,4BAA2C;CAChD,MAAM,YAAY,QAAQ,IAAI,0BAA0B,EAAE,KAAK,CAAC,CAAC,YAAY;CAC7E,IAAI,cAAc,YAAY,cAAc,QAAQ,OAAO;CAC3D,OAAO,iBAAiB,IAAI,SAAS;AACtC;;;;;;;;;;;;;;;;;AAkBA,MAAM,qBAAqB,SAAiB,QAAuB,aAA+B;CACjG,MAAM,eAAeA,QAAY,SAAS,OAAO,WAAW;CAC5D,MAAM,WAAW,MAAM,SAAS,eAAe,OAAO,SAAS,KAAK;CACpE,MAAM,eAAe,kBAAkB,KACtC,MAAM,aACL,iBAAiB;EAChB,WAAW;EACX,aAAa;EAIb,WAAWA,QAAY,SAAS,OAAO,kBAAkB;CAC1D,CAAC,CACF,CACD;CACA,MAAM,aACL,WAAW,WACR,gCAAgC,KAKhC,MAAM,aACL,qBAAqB,iBAAiB,QAAQ,GAAG,SAAS,WAAW,CACtE,CACD,IACC,8BAA8B,KAAK,MAAM,aAAa,wBAAwB,KAAK,CAAC;CACxF,OAAO,MAAM,SAAS,cAAc,YAAY,uBAAuB,CAAC,CAAC,CAAC,KACzE,MAAM,aAAa,QAAQ,CAC5B;AACD;;;;;;AAOA,MAAa,cACZ,YACA,aAC4C;CAC5C,MAAM,SAAS,iBAAiB;CAChC,OAAO,OAAO,IAAI,aAAa;EAC9B,MAAM,WAAW,OAAO,OAAO,KAAK,OAAO,KAAK,UAAU,CAAC;EAC3D,IAAI,KAAK,UAAU,QAAQ,GAC1B,OAAO,OAAO,OAAO,KAAK,uBAAuB,QAAQ,CAAC;EAE3D,MAAM,SAAS,SAAS;EACxB,MAAM,QAAS,OAA+D;EAC9E,MAAM,UAAU,QAAQ,OAAO,kBAAkB;EAEjD,MAAM,gBAAgB,oBAAoB,MAAM,OAAO;EACvD,MAAM,SAAS,oBAAoB;EAEnC,MAAM,OAAO,OAAO,OAAO,KAC1B,aAAa;GAAE;GAAe,WAAW;EAAK,CAAC,CAAC,CAAC,KAChD,OAAO,QAAQ,kBAAkB,SAAS,QAAQ,QAAQ,CAAC,GAC3D,OAAO,QAAQ,OAAO,MAAM,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CACtD,CACD;EACA,IAAI,KAAK,UAAU,IAAI,GACtB,OAAO,OAAO,OAAO,KACpB,IAAI,iBAAiB;GACpB,SAAS;GACT,OAAO,MAAM,OAAO,KAAK,KAA6B;EACvD,CAAC,CACF;EAED,OAAO,EAAE,UAAU,SAAS,GAAG;CAChC,CAAC;AACF"}
@@ -1,69 +1,19 @@
1
- import { readStackEngine } from "../../api/define-devstack.mjs";
1
+ import { loadDevstackConfig } from "../../api/load-config.mjs";
2
2
  import { CliConfigInvalidError, CliConfigNotFoundError } from "../../surfaces/cli/errors.mjs";
3
3
  import "../../surfaces/cli/index.mjs";
4
4
  import { Effect } from "effect";
5
- import { existsSync } from "node:fs";
6
- import { isAbsolute, resolve } from "node:path";
7
- import { pathToFileURL } from "node:url";
8
5
  //#region src/cli/wirings/config-loader.ts
9
- const DEFAULT_CONFIG_PATH = "./devstack.config.ts";
10
- /** Resolve a `--config <path>` argument to an absolute path, falling
11
- * through to a parent-directory search when the default value is
12
- * used. Returns `null` when no candidate exists. */
13
- const resolveConfigPath = (configPath) => {
14
- const target = configPath ?? "./devstack.config.ts";
15
- const explicit = isAbsolute(target) ? target : resolve(process.cwd(), target);
16
- if (existsSync(explicit)) return explicit;
17
- if (configPath !== void 0 && configPath !== "./devstack.config.ts") return null;
18
- let dir = process.cwd();
19
- for (;;) {
20
- const candidate = resolve(dir, "devstack.config.ts");
21
- if (existsSync(candidate)) return candidate;
22
- const parent = resolve(dir, "..");
23
- if (parent === dir) return null;
24
- dir = parent;
25
- }
26
- };
27
- const validateStackModule = (resolvedConfigPath, mod) => {
28
- const def = mod.default;
29
- if (def === null || typeof def !== "object" || def._tag !== "Stack") throw new CliConfigInvalidError({ message: `config at ${resolvedConfigPath} does not default-export a Stack value (got _tag=${String(def?._tag)})` });
30
- let stack;
31
- try {
32
- stack = readStackEngine(def);
33
- } catch (cause) {
34
- throw new CliConfigInvalidError({ message: `config at ${resolvedConfigPath} default-exported an invalid Stack handle: ${cause instanceof Error ? cause.message : String(cause)}` });
35
- }
36
- return {
37
- stack,
38
- resolvedConfigPath
39
- };
40
- };
41
- const makeConfigLoader = () => ({ load: (configPath) => Effect.gen(function* () {
42
- const abs = resolveConfigPath(configPath);
43
- if (abs === null) {
44
- const attempted = configPath !== void 0 ? resolve(process.cwd(), configPath) : resolve(process.cwd(), DEFAULT_CONFIG_PATH);
45
- return yield* Effect.fail(new CliConfigNotFoundError({
46
- message: `devstack config not found at ${attempted}`,
47
- searchedPaths: [attempted]
48
- }));
49
- }
50
- const url = pathToFileURL(abs).href;
51
- const mod = yield* Effect.tryPromise({
52
- try: () => import(url),
53
- catch: (cause) => new CliConfigInvalidError({
54
- message: `failed to import ${abs}: ${cause instanceof Error ? cause.message : String(cause)}`,
55
- cause
56
- })
57
- });
58
- return yield* Effect.try({
59
- try: () => validateStackModule(abs, mod),
60
- catch: (cause) => cause instanceof CliConfigInvalidError ? cause : new CliConfigInvalidError({
61
- message: `invalid config at ${abs}`,
62
- cause
63
- })
64
- });
65
- }) });
6
+ /** Translate the CLI-free loader's failure into the CLI-flavored error
7
+ * union so command exit codes stay stable. */
8
+ const toCliError = (err) => err.kind === "not-found" ? new CliConfigNotFoundError({
9
+ message: err.message,
10
+ searchedPaths: err.searchedPaths ?? []
11
+ }) : new CliConfigInvalidError({
12
+ message: err.message,
13
+ cause: err.cause
14
+ });
15
+ const makeConfigLoader = () => ({ load: (configPath) => loadDevstackConfig(configPath).pipe(Effect.mapError(toCliError)) });
66
16
  //#endregion
67
- export { makeConfigLoader, resolveConfigPath };
17
+ export { makeConfigLoader };
68
18
 
69
19
  //# sourceMappingURL=config-loader.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"config-loader.mjs","names":["resolvePath","m"],"sources":["../../../src/cli/wirings/config-loader.ts"],"sourcesContent":["// Shared config loader consumed by every verb wiring that imports a\n// `devstack.config.ts`. Returns a `LoadedConfig` whose `stack` field\n// is the validated `SupervisedStack` value.\n\nimport { existsSync } from 'node:fs';\nimport { isAbsolute, resolve as resolvePath } from 'node:path';\nimport { pathToFileURL } from 'node:url';\n\nimport { Effect } from 'effect';\n\nimport { readStackEngine, type Stack } from '../../api/define-devstack.ts';\nimport type { LoadedConfig } from '../../surfaces/cli/commands/config-loader.ts';\nimport { CliConfigInvalidError, CliConfigNotFoundError } from '../../surfaces/cli/index.ts';\nimport type { SupervisedStack } from '../../substrate/runtime/index.ts';\n\nexport const DEFAULT_CONFIG_PATH = './devstack.config.ts';\n\n/** Resolve a `--config <path>` argument to an absolute path, falling\n * through to a parent-directory search when the default value is\n * used. Returns `null` when no candidate exists. */\nexport const resolveConfigPath = (configPath: string | undefined): string | null => {\n\tconst target = configPath ?? DEFAULT_CONFIG_PATH;\n\tconst explicit = isAbsolute(target) ? target : resolvePath(process.cwd(), target);\n\tif (existsSync(explicit)) return explicit;\n\tif (configPath !== undefined && configPath !== DEFAULT_CONFIG_PATH) return null;\n\tlet dir = process.cwd();\n\tfor (;;) {\n\t\tconst candidate = resolvePath(dir, 'devstack.config.ts');\n\t\tif (existsSync(candidate)) return candidate;\n\t\tconst parent = resolvePath(dir, '..');\n\t\tif (parent === dir) return null;\n\t\tdir = parent;\n\t}\n};\n\ninterface RawConfigModule {\n\treadonly default?: unknown;\n}\n\nconst validateStackModule = (\n\tresolvedConfigPath: string,\n\tmod: unknown,\n): LoadedConfig & { readonly stack: SupervisedStack } => {\n\tconst m = mod as RawConfigModule;\n\tconst def = m.default;\n\tif (def === null || typeof def !== 'object' || (def as { _tag?: unknown })._tag !== 'Stack') {\n\t\tthrow new CliConfigInvalidError({\n\t\t\tmessage: `config at ${resolvedConfigPath} does not default-export a Stack value (got _tag=${String((def as { _tag?: unknown })?._tag)})`,\n\t\t});\n\t}\n\tlet stack: SupervisedStack;\n\ttry {\n\t\tstack = readStackEngine(def as Stack<SupervisedStack['members']>);\n\t} catch (cause) {\n\t\tthrow new CliConfigInvalidError({\n\t\t\tmessage: `config at ${resolvedConfigPath} default-exported an invalid Stack handle: ${cause instanceof Error ? cause.message : String(cause)}`,\n\t\t});\n\t}\n\treturn {\n\t\tstack,\n\t\tresolvedConfigPath,\n\t};\n};\n\nexport interface ConfigLoader {\n\treadonly load: (\n\t\tconfigPath: string | undefined,\n\t) => Effect.Effect<LoadedConfig, CliConfigNotFoundError | CliConfigInvalidError>;\n}\n\nexport const makeConfigLoader = (): ConfigLoader => ({\n\tload: (configPath) =>\n\t\tEffect.gen(function* () {\n\t\t\tconst abs = resolveConfigPath(configPath);\n\t\t\tif (abs === null) {\n\t\t\t\tconst attempted =\n\t\t\t\t\tconfigPath !== undefined\n\t\t\t\t\t\t? resolvePath(process.cwd(), configPath)\n\t\t\t\t\t\t: resolvePath(process.cwd(), DEFAULT_CONFIG_PATH);\n\t\t\t\treturn yield* Effect.fail(\n\t\t\t\t\tnew CliConfigNotFoundError({\n\t\t\t\t\t\tmessage: `devstack config not found at ${attempted}`,\n\t\t\t\t\t\tsearchedPaths: [attempted],\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst url = pathToFileURL(abs).href;\n\t\t\tconst mod = yield* Effect.tryPromise({\n\t\t\t\ttry: () => import(url) as Promise<unknown>,\n\t\t\t\tcatch: (cause) =>\n\t\t\t\t\tnew CliConfigInvalidError({\n\t\t\t\t\t\tmessage: `failed to import ${abs}: ${cause instanceof Error ? cause.message : String(cause)}`,\n\t\t\t\t\t\tcause,\n\t\t\t\t\t}),\n\t\t\t});\n\t\t\treturn yield* Effect.try({\n\t\t\t\ttry: () => validateStackModule(abs, mod),\n\t\t\t\tcatch: (cause) =>\n\t\t\t\t\tcause instanceof CliConfigInvalidError\n\t\t\t\t\t\t? cause\n\t\t\t\t\t\t: new CliConfigInvalidError({\n\t\t\t\t\t\t\t\tmessage: `invalid config at ${abs}`,\n\t\t\t\t\t\t\t\tcause,\n\t\t\t\t\t\t\t}),\n\t\t\t});\n\t\t}) as Effect.Effect<LoadedConfig, CliConfigNotFoundError | CliConfigInvalidError>,\n});\n"],"mappings":";;;;;;;;AAeA,MAAa,sBAAsB;;;;AAKnC,MAAa,qBAAqB,eAAkD;CACnF,MAAM,SAAS,cAAA;CACf,MAAM,WAAW,WAAW,OAAO,GAAG,SAASA,QAAY,QAAQ,KAAK,EAAE,OAAO;AACjF,KAAI,WAAW,SAAS,CAAE,QAAO;AACjC,KAAI,eAAe,KAAA,KAAa,eAAA,uBAAoC,QAAO;CAC3E,IAAI,MAAM,QAAQ,KAAK;AACvB,UAAS;EACR,MAAM,YAAYA,QAAY,KAAK,qBAAqB;AACxD,MAAI,WAAW,UAAU,CAAE,QAAO;EAClC,MAAM,SAASA,QAAY,KAAK,KAAK;AACrC,MAAI,WAAW,IAAK,QAAO;AAC3B,QAAM;;;AAQR,MAAM,uBACL,oBACA,QACwD;CAExD,MAAM,MAAMC,IAAE;AACd,KAAI,QAAQ,QAAQ,OAAO,QAAQ,YAAa,IAA2B,SAAS,QACnF,OAAM,IAAI,sBAAsB,EAC/B,SAAS,aAAa,mBAAmB,mDAAmD,OAAQ,KAA4B,KAAK,CAAC,IACtI,CAAC;CAEH,IAAI;AACJ,KAAI;AACH,UAAQ,gBAAgB,IAAyC;UACzD,OAAO;AACf,QAAM,IAAI,sBAAsB,EAC/B,SAAS,aAAa,mBAAmB,6CAA6C,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM,IAC5I,CAAC;;AAEH,QAAO;EACN;EACA;EACA;;AASF,MAAa,0BAAwC,EACpD,OAAO,eACN,OAAO,IAAI,aAAa;CACvB,MAAM,MAAM,kBAAkB,WAAW;AACzC,KAAI,QAAQ,MAAM;EACjB,MAAM,YACL,eAAe,KAAA,IACZD,QAAY,QAAQ,KAAK,EAAE,WAAW,GACtCA,QAAY,QAAQ,KAAK,EAAE,oBAAoB;AACnD,SAAO,OAAO,OAAO,KACpB,IAAI,uBAAuB;GAC1B,SAAS,gCAAgC;GACzC,eAAe,CAAC,UAAU;GAC1B,CAAC,CACF;;CAEF,MAAM,MAAM,cAAc,IAAI,CAAC;CAC/B,MAAM,MAAM,OAAO,OAAO,WAAW;EACpC,WAAW,OAAO;EAClB,QAAQ,UACP,IAAI,sBAAsB;GACzB,SAAS,oBAAoB,IAAI,IAAI,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM;GAC3F;GACA,CAAC;EACH,CAAC;AACF,QAAO,OAAO,OAAO,IAAI;EACxB,WAAW,oBAAoB,KAAK,IAAI;EACxC,QAAQ,UACP,iBAAiB,wBACd,QACA,IAAI,sBAAsB;GAC1B,SAAS,qBAAqB;GAC9B;GACA,CAAC;EACL,CAAC;EACD,EACH"}
1
+ {"version":3,"file":"config-loader.mjs","names":[],"sources":["../../../src/cli/wirings/config-loader.ts"],"sourcesContent":["// Shared config loader consumed by every verb wiring that imports a\n// `devstack.config.ts`. Returns the public stack handle exactly as the\n// config exported it, plus the validated internal engine stack for CLI\n// paths that need the erased runtime boundary shape.\n\nimport { Effect } from 'effect';\n\nimport {\n\tDEFAULT_CONFIG_PATH,\n\tloadDevstackConfig,\n\tresolveConfigPath,\n\ttype DevstackConfigError,\n} from '../../api/load-config.ts';\nimport type { LoadedConfig } from '../../surfaces/cli/commands/config-loader.ts';\nimport { CliConfigInvalidError, CliConfigNotFoundError } from '../../surfaces/cli/index.ts';\n\n// Re-exported so existing CLI importers (`main.ts`, `snapshot.ts`) keep\n// their `./config-loader` import site. The implementation lives in the\n// CLI-free `api/load-config.ts` facade.\nexport { DEFAULT_CONFIG_PATH, resolveConfigPath };\n\n/** Translate the CLI-free loader's failure into the CLI-flavored error\n * union so command exit codes stay stable. */\nconst toCliError = (err: DevstackConfigError): CliConfigNotFoundError | CliConfigInvalidError =>\n\terr.kind === 'not-found'\n\t\t? new CliConfigNotFoundError({\n\t\t\t\tmessage: err.message,\n\t\t\t\tsearchedPaths: err.searchedPaths ?? [],\n\t\t\t})\n\t\t: new CliConfigInvalidError({ message: err.message, cause: err.cause });\n\nexport interface ConfigLoader {\n\treadonly load: (\n\t\tconfigPath: string | undefined,\n\t) => Effect.Effect<LoadedConfig, CliConfigNotFoundError | CliConfigInvalidError>;\n}\n\nexport const makeConfigLoader = (): ConfigLoader => ({\n\tload: (configPath) =>\n\t\tloadDevstackConfig(configPath).pipe(Effect.mapError(toCliError)) as Effect.Effect<\n\t\t\tLoadedConfig,\n\t\t\tCliConfigNotFoundError | CliConfigInvalidError\n\t\t>,\n});\n"],"mappings":";;;;;;;AAuBA,MAAM,cAAc,QACnB,IAAI,SAAS,cACV,IAAI,uBAAuB;CAC3B,SAAS,IAAI;CACb,eAAe,IAAI,iBAAiB,CAAC;AACtC,CAAC,IACA,IAAI,sBAAsB;CAAE,SAAS,IAAI;CAAS,OAAO,IAAI;AAAM,CAAC;AAQxE,MAAa,0BAAwC,EACpD,OAAO,eACN,mBAAmB,UAAU,CAAC,CAAC,KAAK,OAAO,SAAS,UAAU,CAAC,EAIjE"}
@@ -0,0 +1,86 @@
1
+ import { ID_CONFIG_FILENAME, decodeIdConfig } from "../../orchestrators/codegen/id-config.mjs";
2
+ import { ExitCode } from "../../surfaces/cli/sysexits.mjs";
3
+ import { CliInternalError } from "../../surfaces/cli/errors.mjs";
4
+ import { emitSuccess } from "../../surfaces/cli/output.mjs";
5
+ import { probeSupervisorPresence } from "../../surfaces/cli/commands/supervisor-presence.mjs";
6
+ import "../../surfaces/cli/commands/index.mjs";
7
+ import { cliErrorFromConfigExit } from "../bail.mjs";
8
+ import { makeConfigLoader } from "./config-loader.mjs";
9
+ import { resolvedIdentityForStack } from "./identity.mjs";
10
+ import { runApplyLive } from "./apply.mjs";
11
+ import { Effect, Exit } from "effect";
12
+ import { readFileSync, writeFileSync } from "node:fs";
13
+ import { resolve } from "node:path";
14
+ //#region src/cli/wirings/dump-ids.ts
15
+ /** Read the on-disk id-config as raw text. The file is written by boot's
16
+ * post-acquire hook (`writeIdConfig`) at `<stackRoot>/devstack-ids.json`;
17
+ * a miss here means the boot never produced it (or a hand-removal), which
18
+ * is an internal inconsistency the operator can't act on directly. */
19
+ const readIdConfigText = (idsFile) => Effect.try({
20
+ try: () => readFileSync(idsFile, "utf8"),
21
+ catch: (cause) => new CliInternalError({
22
+ message: `failed to read id-config at ${idsFile}`,
23
+ cause
24
+ })
25
+ });
26
+ const writeOutFile = (out, text) => Effect.try({
27
+ try: () => writeFileSync(out, text, "utf8"),
28
+ catch: (cause) => new CliInternalError({
29
+ message: `failed to write id-config to ${out}`,
30
+ cause
31
+ })
32
+ });
33
+ /** Decode the id-config text for the JSON envelope `data`, routed through
34
+ * the shared {@link decodeIdConfig} so the parse-and-validate decision is
35
+ * centralized (same seam the Vite plugin and codegen verb use). A failure
36
+ * here means the on-disk file is corrupt — bad JSON OR a shape that
37
+ * violates `IdConfigSchema` — so surface it rather than emit a bad
38
+ * envelope. (The file is written by `writeIdConfig` from the same schema,
39
+ * so a conforming boot-written file always decodes; only a corrupt or
40
+ * hand-edited file trips the stricter validation.) */
41
+ const parseIdConfig = (text, idsFile) => Effect.try({
42
+ try: () => decodeIdConfig(text),
43
+ catch: (cause) => new CliInternalError({
44
+ message: `id-config at ${idsFile} is not valid JSON`,
45
+ cause
46
+ })
47
+ });
48
+ const runDumpIds = (identity, opts) => {
49
+ const loader = makeConfigLoader();
50
+ return Effect.gen(function* () {
51
+ const started = Date.now();
52
+ const loadExit = yield* Effect.exit(loader.load(opts.configPath));
53
+ if (Exit.isFailure(loadExit)) return yield* Effect.fail(cliErrorFromConfigExit(loadExit));
54
+ const stack = loadExit.value.engine;
55
+ const effectiveIdentity = resolvedIdentityForStack(identity, stack);
56
+ const idsFile = resolve(effectiveIdentity.stackRoot, ID_CONFIG_FILENAME);
57
+ if (!(yield* probeSupervisorPresence(effectiveIdentity.rosterFile).pipe(Effect.catch(() => Effect.succeed({
58
+ live: false,
59
+ pid: null,
60
+ hostname: null
61
+ })))).live) yield* runApplyLive(opts.configPath, identity);
62
+ const text = yield* readIdConfigText(idsFile);
63
+ const data = yield* parseIdConfig(text, idsFile);
64
+ if (opts.out !== void 0) {
65
+ yield* writeOutFile(opts.out, text);
66
+ yield* emitSuccess(opts.io, opts.outputMode, {
67
+ command: "dump-ids",
68
+ elapsedMs: Date.now() - started,
69
+ data,
70
+ humanLines: [`wrote id-config to ${opts.out}`]
71
+ });
72
+ return { exitCode: ExitCode.OK };
73
+ }
74
+ yield* emitSuccess(opts.io, opts.outputMode, {
75
+ command: "dump-ids",
76
+ elapsedMs: Date.now() - started,
77
+ data,
78
+ humanLines: [text.endsWith("\n") ? text.slice(0, -1) : text]
79
+ });
80
+ return { exitCode: ExitCode.OK };
81
+ });
82
+ };
83
+ //#endregion
84
+ export { runDumpIds };
85
+
86
+ //# sourceMappingURL=dump-ids.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dump-ids.mjs","names":["resolvePath"],"sources":["../../../src/cli/wirings/dump-ids.ts"],"sourcesContent":["// `devstack dump-ids` verb wiring.\n//\n// Emits the stack's `devstack-ids.json` id-config — the single source of\n// on-chain ids (see `orchestrators/codegen/id-config.ts`). This is the\n// supported way to obtain a committed id-config file for a real-network\n// deploy (docs' \"Deploy to a real network / Option A\"), replacing the\n// manual `cp .devstack/stacks/<stack>/devstack-ids.json …`.\n//\n// Live-aware, mirroring `apply.ts` / `snapshot.ts`:\n// - If a supervisor owns the selected stack (roster probe), the\n// id-config already exists on disk — boot's post-acquire hook wrote\n// it (`boot.ts buildProductionPostAcquireHook`). Read + emit it; NO\n// re-boot.\n// - Otherwise, run the SAME one-shot boot `apply` runs when no\n// supervisor is live (`runApplyLive` → `superviseStackWithProductionBoot`\n// with `lifetime: 'one-shot'`). That boots, writes the id-config to\n// `<stackRoot>/devstack-ids.json`, and tears down. We then read the\n// freshly-written file and emit it.\n//\n// The on-disk file is already pretty-printed by `writeIdConfig`\n// (`JSON.stringify(config, null, 2)\\n`), so `--out` copies its bytes\n// verbatim and stdout prints them verbatim — the format matches the\n// boot-written file exactly.\n\nimport { readFileSync, writeFileSync } from 'node:fs';\nimport { resolve as resolvePath } from 'node:path';\n\nimport { Effect, Exit } from 'effect';\n\nimport type { SupervisedStack } from '../../substrate/runtime/index.ts';\nimport { decodeIdConfig, ID_CONFIG_FILENAME } from '../../orchestrators/codegen/id-config.ts';\nimport { type CliError, CliInternalError } from '../../surfaces/cli/errors.ts';\nimport { type CommandResult } from '../../surfaces/cli/commands/index.ts';\nimport { probeSupervisorPresence } from '../../surfaces/cli/commands/index.ts';\nimport { ExitCode } from '../../surfaces/cli/sysexits.ts';\nimport { type CliIO, emitSuccess } from '../../surfaces/cli/output.ts';\nimport type { OutputMode } from '../../surfaces/cli/flags.ts';\nimport type { LoadedConfig } from '../../surfaces/cli/commands/config-loader.ts';\n\nimport { cliErrorFromConfigExit } from '../bail.ts';\nimport { makeConfigLoader } from './config-loader.ts';\nimport { resolvedIdentityForStack, type ResolvedIdentity } from './identity.ts';\nimport { runApplyLive } from './apply.ts';\n\nexport interface DumpIdsOptions {\n\treadonly configPath: string | undefined;\n\t/** Destination for the pretty id-config JSON. When omitted, the JSON\n\t * is printed to stdout. */\n\treadonly out: string | undefined;\n\treadonly io: CliIO;\n\treadonly outputMode: OutputMode;\n}\n\n/** Read the on-disk id-config as raw text. The file is written by boot's\n * post-acquire hook (`writeIdConfig`) at `<stackRoot>/devstack-ids.json`;\n * a miss here means the boot never produced it (or a hand-removal), which\n * is an internal inconsistency the operator can't act on directly. */\nconst readIdConfigText = (idsFile: string): Effect.Effect<string, CliError> =>\n\tEffect.try({\n\t\ttry: () => readFileSync(idsFile, 'utf8'),\n\t\tcatch: (cause) =>\n\t\t\tnew CliInternalError({\n\t\t\t\tmessage: `failed to read id-config at ${idsFile}`,\n\t\t\t\tcause,\n\t\t\t}),\n\t});\n\nconst writeOutFile = (out: string, text: string): Effect.Effect<void, CliError> =>\n\tEffect.try({\n\t\ttry: () => writeFileSync(out, text, 'utf8'),\n\t\tcatch: (cause) =>\n\t\t\tnew CliInternalError({ message: `failed to write id-config to ${out}`, cause }),\n\t});\n\n/** Decode the id-config text for the JSON envelope `data`, routed through\n * the shared {@link decodeIdConfig} so the parse-and-validate decision is\n * centralized (same seam the Vite plugin and codegen verb use). A failure\n * here means the on-disk file is corrupt — bad JSON OR a shape that\n * violates `IdConfigSchema` — so surface it rather than emit a bad\n * envelope. (The file is written by `writeIdConfig` from the same schema,\n * so a conforming boot-written file always decodes; only a corrupt or\n * hand-edited file trips the stricter validation.) */\nconst parseIdConfig = (text: string, idsFile: string): Effect.Effect<unknown, CliError> =>\n\tEffect.try({\n\t\ttry: () => decodeIdConfig(text),\n\t\tcatch: (cause) =>\n\t\t\tnew CliInternalError({ message: `id-config at ${idsFile} is not valid JSON`, cause }),\n\t});\n\nexport const runDumpIds = (\n\tidentity: ResolvedIdentity,\n\topts: DumpIdsOptions,\n): Effect.Effect<CommandResult, CliError> => {\n\tconst loader = makeConfigLoader();\n\treturn Effect.gen(function* () {\n\t\tconst started = Date.now();\n\n\t\t// Resolve identity against the EFFECTIVE stack (explicit\n\t\t// `--stack`/env > `config.stackName` > inferred), matching `apply` /\n\t\t// `snapshot`, so the roster probe + id-config path target the same\n\t\t// stack the operator selected.\n\t\tconst loadExit = yield* Effect.exit(loader.load(opts.configPath));\n\t\tif (Exit.isFailure(loadExit)) {\n\t\t\treturn yield* Effect.fail(cliErrorFromConfigExit(loadExit));\n\t\t}\n\t\tconst stack = (loadExit.value as LoadedConfig & { readonly engine: SupervisedStack }).engine;\n\t\tconst effectiveIdentity = resolvedIdentityForStack(identity, stack);\n\t\tconst idsFile = resolvePath(effectiveIdentity.stackRoot, ID_CONFIG_FILENAME);\n\n\t\t// Live supervisor? The id-config already exists on disk (boot wrote\n\t\t// it). Otherwise run the one-shot boot `apply` runs when nothing is\n\t\t// live — it writes the id-config to `idsFile` and tears down — then\n\t\t// read the file it produced.\n\t\tconst presence = yield* probeSupervisorPresence(effectiveIdentity.rosterFile).pipe(\n\t\t\tEffect.catch(() => Effect.succeed({ live: false, pid: null, hostname: null })),\n\t\t);\n\t\tif (!presence.live) {\n\t\t\t// `runApplyLive` re-probes (sees no live supervisor) and runs the\n\t\t\t// one-shot boot; its config-load / boot failures already surface as\n\t\t\t// typed `CliError`s. We pass the ORIGINAL identity — `runApplyLive`\n\t\t\t// re-derives the effective stack from the same config internally.\n\t\t\tyield* runApplyLive(opts.configPath, identity);\n\t\t}\n\n\t\tconst text = yield* readIdConfigText(idsFile);\n\t\tconst data = yield* parseIdConfig(text, idsFile);\n\n\t\tif (opts.out !== undefined) {\n\t\t\tyield* writeOutFile(opts.out, text);\n\t\t\tyield* emitSuccess(opts.io, opts.outputMode, {\n\t\t\t\tcommand: 'dump-ids',\n\t\t\t\telapsedMs: Date.now() - started,\n\t\t\t\tdata,\n\t\t\t\thumanLines: [`wrote id-config to ${opts.out}`],\n\t\t\t});\n\t\t\treturn { exitCode: ExitCode.OK };\n\t\t}\n\n\t\t// No `--out`: print the id-config JSON to stdout. In human mode the\n\t\t// raw pretty JSON IS the output (trailing newline trimmed by the IO\n\t\t// layer); in JSON mode the same object rides the success envelope's\n\t\t// `data`.\n\t\tyield* emitSuccess(opts.io, opts.outputMode, {\n\t\t\tcommand: 'dump-ids',\n\t\t\telapsedMs: Date.now() - started,\n\t\t\tdata,\n\t\t\thumanLines: [text.endsWith('\\n') ? text.slice(0, -1) : text],\n\t\t});\n\t\treturn { exitCode: ExitCode.OK };\n\t});\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAyDA,MAAM,oBAAoB,YACzB,OAAO,IAAI;CACV,WAAW,aAAa,SAAS,MAAM;CACvC,QAAQ,UACP,IAAI,iBAAiB;EACpB,SAAS,+BAA+B;EACxC;CACD,CAAC;AACH,CAAC;AAEF,MAAM,gBAAgB,KAAa,SAClC,OAAO,IAAI;CACV,WAAW,cAAc,KAAK,MAAM,MAAM;CAC1C,QAAQ,UACP,IAAI,iBAAiB;EAAE,SAAS,gCAAgC;EAAO;CAAM,CAAC;AAChF,CAAC;;;;;;;;;AAUF,MAAM,iBAAiB,MAAc,YACpC,OAAO,IAAI;CACV,WAAW,eAAe,IAAI;CAC9B,QAAQ,UACP,IAAI,iBAAiB;EAAE,SAAS,gBAAgB,QAAQ;EAAqB;CAAM,CAAC;AACtF,CAAC;AAEF,MAAa,cACZ,UACA,SAC4C;CAC5C,MAAM,SAAS,iBAAiB;CAChC,OAAO,OAAO,IAAI,aAAa;EAC9B,MAAM,UAAU,KAAK,IAAI;EAMzB,MAAM,WAAW,OAAO,OAAO,KAAK,OAAO,KAAK,KAAK,UAAU,CAAC;EAChE,IAAI,KAAK,UAAU,QAAQ,GAC1B,OAAO,OAAO,OAAO,KAAK,uBAAuB,QAAQ,CAAC;EAE3D,MAAM,QAAS,SAAS,MAA8D;EACtF,MAAM,oBAAoB,yBAAyB,UAAU,KAAK;EAClE,MAAM,UAAUA,QAAY,kBAAkB,WAAW,kBAAkB;EAS3E,IAAI,EAAC,OAHmB,wBAAwB,kBAAkB,UAAU,CAAC,CAAC,KAC7E,OAAO,YAAY,OAAO,QAAQ;GAAE,MAAM;GAAO,KAAK;GAAM,UAAU;EAAK,CAAC,CAAC,CAC9E,EAAA,CACc,MAKb,OAAO,aAAa,KAAK,YAAY,QAAQ;EAG9C,MAAM,OAAO,OAAO,iBAAiB,OAAO;EAC5C,MAAM,OAAO,OAAO,cAAc,MAAM,OAAO;EAE/C,IAAI,KAAK,QAAQ,KAAA,GAAW;GAC3B,OAAO,aAAa,KAAK,KAAK,IAAI;GAClC,OAAO,YAAY,KAAK,IAAI,KAAK,YAAY;IAC5C,SAAS;IACT,WAAW,KAAK,IAAI,IAAI;IACxB;IACA,YAAY,CAAC,sBAAsB,KAAK,KAAK;GAC9C,CAAC;GACD,OAAO,EAAE,UAAU,SAAS,GAAG;EAChC;EAMA,OAAO,YAAY,KAAK,IAAI,KAAK,YAAY;GAC5C,SAAS;GACT,WAAW,KAAK,IAAI,IAAI;GACxB;GACA,YAAY,CAAC,KAAK,SAAS,IAAI,IAAI,KAAK,MAAM,GAAG,EAAE,IAAI,IAAI;EAC5D,CAAC;EACD,OAAO,EAAE,UAAU,SAAS,GAAG;CAChC,CAAC;AACF"}
@@ -20,7 +20,7 @@ const isEngineCommand = (value) => {
20
20
  case "shutdown.hardKillRequested": return (record.signal === "SIGINT" || record.signal === "SIGTERM") && typeof record.exitCode === "number" && typeof record.at === "number";
21
21
  case "selective-restart.requested": return hasString(record, "pluginKey");
22
22
  case "apply.requested": return record.pluginKey === void 0 || typeof record.pluginKey === "string";
23
- case "snapshot.capture": return (record.snapshotId === void 0 || typeof record.snapshotId === "string") && (record.name === void 0 || typeof record.name === "string");
23
+ case "snapshot.capture": return (record.snapshotId === void 0 || typeof record.snapshotId === "string") && (record.name === void 0 || typeof record.name === "string") && (record.replaceExisting === void 0 || typeof record.replaceExisting === "boolean");
24
24
  default: return false;
25
25
  }
26
26
  };
@@ -1 +1 @@
1
- {"version":3,"file":"engine-command.mjs","names":["knownTag"],"sources":["../../../src/cli/wirings/engine-command.ts"],"sourcesContent":["// Type guard for `EngineCommand` records arriving over the\n// cross-process command channel. Exhaustive switch over the union's\n// tag — a new variant added without a corresponding case here fails\n// typecheck on the `_exhaustive: never` proof so we never drift.\n\nimport type { EngineCommand } from '../../substrate/events.ts';\n\nconst hasString = (value: Record<string, unknown>, key: string): boolean =>\n\ttypeof value[key] === 'string';\n\nexport const isEngineCommand = (value: unknown): value is EngineCommand => {\n\tif (typeof value !== 'object' || value === null) return false;\n\tconst record = value as Record<string, unknown>;\n\tconst tag = record.tag;\n\tif (typeof tag !== 'string') return false;\n\tconst knownTag = tag as EngineCommand['tag'];\n\tswitch (knownTag) {\n\t\tcase 'stack.start':\n\t\tcase 'stack.stop':\n\t\tcase 'stack.restart':\n\t\tcase 'codegen.requested':\n\t\tcase 'snapshot.list':\n\t\tcase 'wipe.requested':\n\t\tcase 'prune.requested':\n\t\tcase 'shutdown.requested':\n\t\t\treturn true;\n\t\tcase 'snapshot.restore':\n\t\tcase 'snapshot.delete':\n\t\t\treturn hasString(record, 'snapshotId');\n\t\tcase 'advance-clock.requested':\n\t\t\treturn typeof record.toMillis === 'number';\n\t\tcase 'shutdown.hardKillRequested':\n\t\t\treturn (\n\t\t\t\t(record.signal === 'SIGINT' || record.signal === 'SIGTERM') &&\n\t\t\t\ttypeof record.exitCode === 'number' &&\n\t\t\t\ttypeof record.at === 'number'\n\t\t\t);\n\t\tcase 'selective-restart.requested':\n\t\t\treturn hasString(record, 'pluginKey');\n\t\tcase 'apply.requested':\n\t\t\treturn record.pluginKey === undefined || typeof record.pluginKey === 'string';\n\t\tcase 'snapshot.capture':\n\t\t\treturn (\n\t\t\t\t(record.snapshotId === undefined || typeof record.snapshotId === 'string') &&\n\t\t\t\t(record.name === undefined || typeof record.name === 'string')\n\t\t\t);\n\t\tdefault: {\n\t\t\tconst _exhaustive: never = knownTag;\n\t\t\tvoid _exhaustive;\n\t\t\treturn false;\n\t\t}\n\t}\n};\n"],"mappings":";AAOA,MAAM,aAAa,OAAgC,QAClD,OAAO,MAAM,SAAS;AAEvB,MAAa,mBAAmB,UAA2C;AAC1E,KAAI,OAAO,UAAU,YAAY,UAAU,KAAM,QAAO;CACxD,MAAM,SAAS;CACf,MAAM,MAAM,OAAO;AACnB,KAAI,OAAO,QAAQ,SAAU,QAAO;AAEpC,SAAQA,KAAR;EACC,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK,qBACJ,QAAO;EACR,KAAK;EACL,KAAK,kBACJ,QAAO,UAAU,QAAQ,aAAa;EACvC,KAAK,0BACJ,QAAO,OAAO,OAAO,aAAa;EACnC,KAAK,6BACJ,SACE,OAAO,WAAW,YAAY,OAAO,WAAW,cACjD,OAAO,OAAO,aAAa,YAC3B,OAAO,OAAO,OAAO;EAEvB,KAAK,8BACJ,QAAO,UAAU,QAAQ,YAAY;EACtC,KAAK,kBACJ,QAAO,OAAO,cAAc,KAAA,KAAa,OAAO,OAAO,cAAc;EACtE,KAAK,mBACJ,SACE,OAAO,eAAe,KAAA,KAAa,OAAO,OAAO,eAAe,cAChE,OAAO,SAAS,KAAA,KAAa,OAAO,OAAO,SAAS;EAEvD,QAGC,QAAO"}
1
+ {"version":3,"file":"engine-command.mjs","names":["knownTag"],"sources":["../../../src/cli/wirings/engine-command.ts"],"sourcesContent":["// Type guard for `EngineCommand` records arriving over the\n// cross-process command channel. Exhaustive switch over the union's\n// tag — a new variant added without a corresponding case here fails\n// typecheck on the `_exhaustive: never` proof so we never drift.\n\nimport type { EngineCommand } from '../../substrate/events.ts';\n\nconst hasString = (value: Record<string, unknown>, key: string): boolean =>\n\ttypeof value[key] === 'string';\n\nexport const isEngineCommand = (value: unknown): value is EngineCommand => {\n\tif (typeof value !== 'object' || value === null) return false;\n\tconst record = value as Record<string, unknown>;\n\tconst tag = record.tag;\n\tif (typeof tag !== 'string') return false;\n\tconst knownTag = tag as EngineCommand['tag'];\n\tswitch (knownTag) {\n\t\tcase 'stack.start':\n\t\tcase 'stack.stop':\n\t\tcase 'stack.restart':\n\t\tcase 'codegen.requested':\n\t\tcase 'snapshot.list':\n\t\tcase 'wipe.requested':\n\t\tcase 'prune.requested':\n\t\tcase 'shutdown.requested':\n\t\t\treturn true;\n\t\tcase 'snapshot.restore':\n\t\tcase 'snapshot.delete':\n\t\t\treturn hasString(record, 'snapshotId');\n\t\tcase 'advance-clock.requested':\n\t\t\treturn typeof record.toMillis === 'number';\n\t\tcase 'shutdown.hardKillRequested':\n\t\t\treturn (\n\t\t\t\t(record.signal === 'SIGINT' || record.signal === 'SIGTERM') &&\n\t\t\t\ttypeof record.exitCode === 'number' &&\n\t\t\t\ttypeof record.at === 'number'\n\t\t\t);\n\t\tcase 'selective-restart.requested':\n\t\t\treturn hasString(record, 'pluginKey');\n\t\tcase 'apply.requested':\n\t\t\treturn record.pluginKey === undefined || typeof record.pluginKey === 'string';\n\t\tcase 'snapshot.capture':\n\t\t\treturn (\n\t\t\t\t(record.snapshotId === undefined || typeof record.snapshotId === 'string') &&\n\t\t\t\t(record.name === undefined || typeof record.name === 'string') &&\n\t\t\t\t(record.replaceExisting === undefined || typeof record.replaceExisting === 'boolean')\n\t\t\t);\n\t\tdefault: {\n\t\t\tconst _exhaustive: never = knownTag;\n\t\t\tvoid _exhaustive;\n\t\t\treturn false;\n\t\t}\n\t}\n};\n"],"mappings":";AAOA,MAAM,aAAa,OAAgC,QAClD,OAAO,MAAM,SAAS;AAEvB,MAAa,mBAAmB,UAA2C;CAC1E,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO;CACxD,MAAM,SAAS;CACf,MAAM,MAAM,OAAO;CACnB,IAAI,OAAO,QAAQ,UAAU,OAAO;CAEpC,QAAQA,KAAR;EACC,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK,sBACJ,OAAO;EACR,KAAK;EACL,KAAK,mBACJ,OAAO,UAAU,QAAQ,YAAY;EACtC,KAAK,2BACJ,OAAO,OAAO,OAAO,aAAa;EACnC,KAAK,8BACJ,QACE,OAAO,WAAW,YAAY,OAAO,WAAW,cACjD,OAAO,OAAO,aAAa,YAC3B,OAAO,OAAO,OAAO;EAEvB,KAAK,+BACJ,OAAO,UAAU,QAAQ,WAAW;EACrC,KAAK,mBACJ,OAAO,OAAO,cAAc,KAAA,KAAa,OAAO,OAAO,cAAc;EACtE,KAAK,oBACJ,QACE,OAAO,eAAe,KAAA,KAAa,OAAO,OAAO,eAAe,cAChE,OAAO,SAAS,KAAA,KAAa,OAAO,OAAO,SAAS,cACpD,OAAO,oBAAoB,KAAA,KAAa,OAAO,OAAO,oBAAoB;EAE7E,SAGC,OAAO;CAET;AACD"}
@@ -1,4 +1,4 @@
1
- import { appName, chainId, stackName } from "../../substrate/brand.mjs";
1
+ import { appName, stackName } from "../../substrate/brand.mjs";
2
2
  import { CliSupervisorLiveError } from "../../surfaces/cli/errors.mjs";
3
3
  import { probeSupervisorPresence } from "../../surfaces/cli/commands/supervisor-presence.mjs";
4
4
  import "../../surfaces/cli/commands/index.mjs";
@@ -26,7 +26,7 @@ const effectiveStackName = (identity, stack) => identity.explicitStack ?? stack?
26
26
  const identityValueFor = (identity, stack) => ({
27
27
  app: appName(identity.app),
28
28
  stack: stackName(effectiveStackName(identity, stack)),
29
- chain: chainId(identity.network)
29
+ network: identity.network
30
30
  });
31
31
  /** When a verb loads a config whose `stackName` may differ from the
32
32
  * effective stack, re-derive the `ResolvedIdentity` against the
@@ -1 +1 @@
1
- {"version":3,"file":"identity.mjs","names":["resolvePath"],"sources":["../../../src/cli/wirings/identity.ts"],"sourcesContent":["// Shared identity types + helpers consumed by every verb wiring.\n//\n// `ResolvedIdentity` is the flat CLI-internal identity bundle (app /\n// stack / network / runtimeRoot / stackRoot) that the `main.ts` argv\n// pre-parser produces. Wirings consume it directly; they do NOT\n// re-derive identity from process.env.\n\nimport { resolve as resolvePath } from 'node:path';\n\nimport { Cause, Effect } from 'effect';\n\nimport { appName, chainId, stackName } from '../../substrate/brand.ts';\nimport type { Identity } from '../../substrate/identity.ts';\nimport type { SupervisedStack } from '../../substrate/runtime/index.ts';\nimport { CliSupervisorLiveError } from '../../surfaces/cli/index.ts';\nimport { probeSupervisorPresence } from '../../surfaces/cli/commands/index.ts';\n\nexport interface ResolvedIdentity {\n\treadonly app: string;\n\treadonly stack: string;\n\treadonly network: string;\n\treadonly runtimeRoot: string;\n\treadonly stacksRoot: string;\n\treadonly stackRoot: string;\n\treadonly rosterFile: string;\n\t/** The stack name the operator supplied EXPLICITLY via the `--stack`\n\t * flag or `$DEVSTACK_STACK` env var — `undefined` when neither was\n\t * given (i.e. `stack` above was cwd/package-inferred). Threaded from\n\t * `main.ts`'s argv pre-parser so the stack-precedence ladder below\n\t * can let an explicit flag/env beat a config-declared `stackName`. */\n\treadonly explicitStack?: string | undefined;\n}\n\nexport const stackRootFor = (runtimeRoot: string, stack: string): string =>\n\tresolvePath(runtimeRoot, 'stacks', stack);\n\n/** Stack-name precedence ladder, mirrored from the state-dir ladder in\n * `main.ts` (`--state-dir` flag > `config.stateDir` > env > default):\n *\n * explicit `--stack` / `$DEVSTACK_STACK` (`identity.explicitStack`)\n * > config's `defineDevstack({ stackName })` (`stack.options.stackName`)\n * > cwd/package inference (already folded into `identity.stack`,\n * default `'main'`).\n *\n * The explicit rung MUST win over a config `stackName` so an operator\n * can run `pnpm dev` (default stack) and `pnpm test:e2e` (a `test`/`e2e`\n * stack via `--stack`/env) against the SAME config concurrently — the\n * two supervisors then claim distinct stack roots instead of colliding\n * on `error: supervisor live for <app>/<stack>` (exit 40). `runStack`\n * (`api/run-stack.ts`) already prefers its explicit option over\n * `stack.options.stackName`; this keeps the CLI consistent with it. */\nconst effectiveStackName = (identity: ResolvedIdentity, stack?: SupervisedStack): string =>\n\tidentity.explicitStack ?? stack?.options.stackName ?? identity.stack;\n\nexport const identityValueFor = (\n\tidentity: ResolvedIdentity,\n\tstack?: SupervisedStack,\n): Identity => ({\n\tapp: appName(identity.app),\n\tstack: stackName(effectiveStackName(identity, stack)),\n\tchain: chainId(identity.network),\n});\n\n/** When a verb loads a config whose `stackName` may differ from the\n * effective stack, re-derive the `ResolvedIdentity` against the\n * effective stack so the stack-root, roster file, and command channel\n * paths all target the same stack the supervisor uses. The effective\n * stack follows the precedence ladder documented on `effectiveStackName`\n * (explicit flag/env > config `stackName` > inferred), so an explicit\n * `--stack`/`$DEVSTACK_STACK` is NOT overridden by `config.stackName`. */\nexport const resolvedIdentityForStack = (\n\tidentity: ResolvedIdentity,\n\tstack: SupervisedStack,\n): ResolvedIdentity => {\n\tconst stackValue = effectiveStackName(identity, stack);\n\tconst stackRoot = stackRootFor(identity.runtimeRoot, stackValue);\n\treturn {\n\t\t...identity,\n\t\tstack: stackValue,\n\t\tstackRoot,\n\t\trosterFile: resolvePath(stackRoot, 'roster.json'),\n\t};\n};\n\n/** Probe the roster file; if a supervisor is live, refuse the verb\n * with a `CliSupervisorLiveError` carrying the operator hint. */\nexport const ensureNoLiveSupervisor = (\n\tidentity: ResolvedIdentity,\n\thint: string,\n): Effect.Effect<void, CliSupervisorLiveError> =>\n\tEffect.gen(function* () {\n\t\tconst presence = yield* probeSupervisorPresence(identity.rosterFile).pipe(\n\t\t\tEffect.catch(() => Effect.succeed({ live: false, pid: null, hostname: null })),\n\t\t);\n\t\tif (presence.live) {\n\t\t\treturn yield* Effect.fail(\n\t\t\t\tnew CliSupervisorLiveError({\n\t\t\t\t\tapp: identity.app,\n\t\t\t\t\tstack: identity.stack,\n\t\t\t\t\thint,\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\t});\n\nexport const findCliSupervisorLiveError = (\n\tcause: Cause.Cause<unknown>,\n): CliSupervisorLiveError | null => {\n\tfor (const reason of cause.reasons) {\n\t\tif (!Cause.isFailReason(reason)) continue;\n\t\tconst error = reason.error;\n\t\tif (\n\t\t\ttypeof error === 'object' &&\n\t\t\terror !== null &&\n\t\t\t(error as { readonly _tag?: unknown })._tag === 'CliSupervisorLiveError'\n\t\t) {\n\t\t\treturn error as CliSupervisorLiveError;\n\t\t}\n\t}\n\treturn null;\n};\n"],"mappings":";;;;;;;;AAiCA,MAAa,gBAAgB,aAAqB,UACjDA,QAAY,aAAa,UAAU,MAAM;;;;;;;;;;;;;;;;AAiB1C,MAAM,sBAAsB,UAA4B,UACvD,SAAS,iBAAiB,OAAO,QAAQ,aAAa,SAAS;AAEhE,MAAa,oBACZ,UACA,WACe;CACf,KAAK,QAAQ,SAAS,IAAI;CAC1B,OAAO,UAAU,mBAAmB,UAAU,MAAM,CAAC;CACrD,OAAO,QAAQ,SAAS,QAAQ;CAChC;;;;;;;;AASD,MAAa,4BACZ,UACA,UACsB;CACtB,MAAM,aAAa,mBAAmB,UAAU,MAAM;CACtD,MAAM,YAAY,aAAa,SAAS,aAAa,WAAW;AAChE,QAAO;EACN,GAAG;EACH,OAAO;EACP;EACA,YAAYA,QAAY,WAAW,cAAc;EACjD;;;;AAKF,MAAa,0BACZ,UACA,SAEA,OAAO,IAAI,aAAa;AAIvB,MAAI,OAHoB,wBAAwB,SAAS,WAAW,CAAC,KACpE,OAAO,YAAY,OAAO,QAAQ;EAAE,MAAM;EAAO,KAAK;EAAM,UAAU;EAAM,CAAC,CAAC,CAC9E,EACY,KACZ,QAAO,OAAO,OAAO,KACpB,IAAI,uBAAuB;EAC1B,KAAK,SAAS;EACd,OAAO,SAAS;EAChB;EACA,CAAC,CACF;EAED;AAEH,MAAa,8BACZ,UACmC;AACnC,MAAK,MAAM,UAAU,MAAM,SAAS;AACnC,MAAI,CAAC,MAAM,aAAa,OAAO,CAAE;EACjC,MAAM,QAAQ,OAAO;AACrB,MACC,OAAO,UAAU,YACjB,UAAU,QACT,MAAsC,SAAS,yBAEhD,QAAO;;AAGT,QAAO"}
1
+ {"version":3,"file":"identity.mjs","names":["resolvePath"],"sources":["../../../src/cli/wirings/identity.ts"],"sourcesContent":["// Shared identity types + helpers consumed by every verb wiring.\n//\n// `ResolvedIdentity` is the flat CLI-internal identity bundle (app /\n// stack / network / runtimeRoot / stackRoot) that the `main.ts` argv\n// pre-parser produces. Wirings consume it directly; they do NOT\n// re-derive identity from process.env.\n\nimport { resolve as resolvePath } from 'node:path';\n\nimport { Cause, Effect } from 'effect';\n\nimport { appName, stackName } from '../../substrate/brand.ts';\nimport type { Identity } from '../../substrate/identity.ts';\nimport type { SupervisedStack } from '../../substrate/runtime/index.ts';\nimport { CliSupervisorLiveError } from '../../surfaces/cli/index.ts';\nimport { probeSupervisorPresence } from '../../surfaces/cli/commands/index.ts';\n\nexport interface ResolvedIdentity {\n\treadonly app: string;\n\treadonly stack: string;\n\treadonly network: string;\n\treadonly runtimeRoot: string;\n\treadonly stacksRoot: string;\n\treadonly stackRoot: string;\n\treadonly rosterFile: string;\n\t/** The stack name the operator supplied EXPLICITLY via the `--stack`\n\t * flag or `$DEVSTACK_STACK` env var — `undefined` when neither was\n\t * given (i.e. `stack` above was cwd/package-inferred). Threaded from\n\t * `main.ts`'s argv pre-parser so the stack-precedence ladder below\n\t * can let an explicit flag/env beat a config-declared `stackName`. */\n\treadonly explicitStack?: string | undefined;\n}\n\nexport const stackRootFor = (runtimeRoot: string, stack: string): string =>\n\tresolvePath(runtimeRoot, 'stacks', stack);\n\n/** Stack-name precedence ladder, mirrored from the state-dir ladder in\n * `main.ts` (`--state-dir` flag > `config.stateDir` > env > default):\n *\n * explicit `--stack` / `$DEVSTACK_STACK` (`identity.explicitStack`)\n * > config's `defineDevstack({ stackName })` (`stack.options.stackName`)\n * > cwd/package inference (already folded into `identity.stack`,\n * default `'main'`).\n *\n * The explicit rung MUST win over a config `stackName` so an operator\n * can run `pnpm dev` (default stack) and `pnpm test:e2e` (a `test`/`e2e`\n * stack via `--stack`/env) against the SAME config concurrently — the\n * two supervisors then claim distinct stack roots instead of colliding\n * on `error: supervisor live for <app>/<stack>` (exit 40). `runStack`\n * (`api/run-stack.ts`) already prefers its explicit option over\n * `stack.options.stackName`; this keeps the CLI consistent with it. */\nconst effectiveStackName = (identity: ResolvedIdentity, stack?: SupervisedStack): string =>\n\tidentity.explicitStack ?? stack?.options.stackName ?? identity.stack;\n\nexport const identityValueFor = (\n\tidentity: ResolvedIdentity,\n\tstack?: SupervisedStack,\n): Identity => ({\n\tapp: appName(identity.app),\n\tstack: stackName(effectiveStackName(identity, stack)),\n\tnetwork: identity.network,\n});\n\n/** When a verb loads a config whose `stackName` may differ from the\n * effective stack, re-derive the `ResolvedIdentity` against the\n * effective stack so the stack-root, roster file, and command channel\n * paths all target the same stack the supervisor uses. The effective\n * stack follows the precedence ladder documented on `effectiveStackName`\n * (explicit flag/env > config `stackName` > inferred), so an explicit\n * `--stack`/`$DEVSTACK_STACK` is NOT overridden by `config.stackName`. */\nexport const resolvedIdentityForStack = (\n\tidentity: ResolvedIdentity,\n\tstack: SupervisedStack,\n): ResolvedIdentity => {\n\tconst stackValue = effectiveStackName(identity, stack);\n\tconst stackRoot = stackRootFor(identity.runtimeRoot, stackValue);\n\treturn {\n\t\t...identity,\n\t\tstack: stackValue,\n\t\tstackRoot,\n\t\trosterFile: resolvePath(stackRoot, 'roster.json'),\n\t};\n};\n\n/** Probe the roster file; if a supervisor is live, refuse the verb\n * with a `CliSupervisorLiveError` carrying the operator hint. */\nexport const ensureNoLiveSupervisor = (\n\tidentity: ResolvedIdentity,\n\thint: string,\n): Effect.Effect<void, CliSupervisorLiveError> =>\n\tEffect.gen(function* () {\n\t\tconst presence = yield* probeSupervisorPresence(identity.rosterFile).pipe(\n\t\t\tEffect.catch(() => Effect.succeed({ live: false, pid: null, hostname: null })),\n\t\t);\n\t\tif (presence.live) {\n\t\t\treturn yield* Effect.fail(\n\t\t\t\tnew CliSupervisorLiveError({\n\t\t\t\t\tapp: identity.app,\n\t\t\t\t\tstack: identity.stack,\n\t\t\t\t\thint,\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\t});\n\nexport const findCliSupervisorLiveError = (\n\tcause: Cause.Cause<unknown>,\n): CliSupervisorLiveError | null => {\n\tfor (const reason of cause.reasons) {\n\t\tif (!Cause.isFailReason(reason)) continue;\n\t\tconst error = reason.error;\n\t\tif (\n\t\t\ttypeof error === 'object' &&\n\t\t\terror !== null &&\n\t\t\t(error as { readonly _tag?: unknown })._tag === 'CliSupervisorLiveError'\n\t\t) {\n\t\t\treturn error as CliSupervisorLiveError;\n\t\t}\n\t}\n\treturn null;\n};\n"],"mappings":";;;;;;;;AAiCA,MAAa,gBAAgB,aAAqB,UACjDA,QAAY,aAAa,UAAU,KAAK;;;;;;;;;;;;;;;;AAiBzC,MAAM,sBAAsB,UAA4B,UACvD,SAAS,iBAAiB,OAAO,QAAQ,aAAa,SAAS;AAEhE,MAAa,oBACZ,UACA,WACe;CACf,KAAK,QAAQ,SAAS,GAAG;CACzB,OAAO,UAAU,mBAAmB,UAAU,KAAK,CAAC;CACpD,SAAS,SAAS;AACnB;;;;;;;;AASA,MAAa,4BACZ,UACA,UACsB;CACtB,MAAM,aAAa,mBAAmB,UAAU,KAAK;CACrD,MAAM,YAAY,aAAa,SAAS,aAAa,UAAU;CAC/D,OAAO;EACN,GAAG;EACH,OAAO;EACP;EACA,YAAYA,QAAY,WAAW,aAAa;CACjD;AACD;;;AAIA,MAAa,0BACZ,UACA,SAEA,OAAO,IAAI,aAAa;CAIvB,KAAI,OAHoB,wBAAwB,SAAS,UAAU,CAAC,CAAC,KACpE,OAAO,YAAY,OAAO,QAAQ;EAAE,MAAM;EAAO,KAAK;EAAM,UAAU;CAAK,CAAC,CAAC,CAC9E,EAAA,CACa,MACZ,OAAO,OAAO,OAAO,KACpB,IAAI,uBAAuB;EAC1B,KAAK,SAAS;EACd,OAAO,SAAS;EAChB;CACD,CAAC,CACF;AAEF,CAAC;AAEF,MAAa,8BACZ,UACmC;CACnC,KAAK,MAAM,UAAU,MAAM,SAAS;EACnC,IAAI,CAAC,MAAM,aAAa,MAAM,GAAG;EACjC,MAAM,QAAQ,OAAO;EACrB,IACC,OAAO,UAAU,YACjB,UAAU,QACT,MAAsC,SAAS,0BAEhD,OAAO;CAET;CACA,OAAO;AACR"}
@@ -1 +1 @@
1
- {"version":3,"file":"provide-file-system.mjs","names":[],"sources":["../../../src/cli/wirings/provide-file-system.ts"],"sourcesContent":["// Shared `provideFileSystem` helper for verb wirings.\n//\n// Several wirings (`up`, `snapshot`, `wipe`) hoist a `FileSystem.FileSystem`\n// out of an enclosing Effect and re-thread it into sub-Effects that depend\n// on it. Factor the one-liner so we don't drift on signature/import (and so\n// later changes — e.g. tagging the call site with a span — happen in one\n// place).\n\nimport { Effect, FileSystem } from 'effect';\n\nexport const provideFileSystem = <A, E, R>(\n\tfs: FileSystem.FileSystem,\n\teffect: Effect.Effect<A, E, R | FileSystem.FileSystem>,\n): Effect.Effect<A, E, Exclude<R, FileSystem.FileSystem>> =>\n\teffect.pipe(Effect.provideService(FileSystem.FileSystem, fs)) as Effect.Effect<\n\t\tA,\n\t\tE,\n\t\tExclude<R, FileSystem.FileSystem>\n\t>;\n"],"mappings":";;AAUA,MAAa,qBACZ,IACA,WAEA,OAAO,KAAK,OAAO,eAAe,WAAW,YAAY,GAAG,CAAC"}
1
+ {"version":3,"file":"provide-file-system.mjs","names":[],"sources":["../../../src/cli/wirings/provide-file-system.ts"],"sourcesContent":["// Shared `provideFileSystem` helper for verb wirings.\n//\n// Several wirings (`up`, `snapshot`, `wipe`) hoist a `FileSystem.FileSystem`\n// out of an enclosing Effect and re-thread it into sub-Effects that depend\n// on it. Factor the one-liner so we don't drift on signature/import (and so\n// later changes — e.g. tagging the call site with a span — happen in one\n// place).\n\nimport { Effect, FileSystem } from 'effect';\n\nexport const provideFileSystem = <A, E, R>(\n\tfs: FileSystem.FileSystem,\n\teffect: Effect.Effect<A, E, R | FileSystem.FileSystem>,\n): Effect.Effect<A, E, Exclude<R, FileSystem.FileSystem>> =>\n\teffect.pipe(Effect.provideService(FileSystem.FileSystem, fs)) as Effect.Effect<\n\t\tA,\n\t\tE,\n\t\tExclude<R, FileSystem.FileSystem>\n\t>;\n"],"mappings":";;AAUA,MAAa,qBACZ,IACA,WAEA,OAAO,KAAK,OAAO,eAAe,WAAW,YAAY,EAAE,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { readFileSync } from "node:fs";
2
+ //#region src/cli/wirings/read-devstack-version.ts
3
+ const readDevstackVersion = (opts) => {
4
+ try {
5
+ const raw = readFileSync(new URL("../../../package.json", import.meta.url), "utf8");
6
+ const pkg = JSON.parse(raw);
7
+ if (typeof pkg.version !== "string") throw new Error("devstack package.json is missing a string version");
8
+ return pkg.version;
9
+ } catch (cause) {
10
+ if (opts?.fallback !== void 0) return opts.fallback;
11
+ throw cause;
12
+ }
13
+ };
14
+ //#endregion
15
+ export { readDevstackVersion };
16
+
17
+ //# sourceMappingURL=read-devstack-version.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-devstack-version.mjs","names":[],"sources":["../../../src/cli/wirings/read-devstack-version.ts"],"sourcesContent":["import { readFileSync } from 'node:fs';\n\nexport const readDevstackVersion = (opts?: { readonly fallback?: string }): string => {\n\ttry {\n\t\tconst raw = readFileSync(new URL('../../../package.json', import.meta.url), 'utf8');\n\t\tconst pkg = JSON.parse(raw) as { readonly version?: unknown };\n\t\tif (typeof pkg.version !== 'string') {\n\t\t\tthrow new Error('devstack package.json is missing a string version');\n\t\t}\n\t\treturn pkg.version;\n\t} catch (cause) {\n\t\tif (opts?.fallback !== undefined) return opts.fallback;\n\t\tthrow cause;\n\t}\n};\n"],"mappings":";;AAEA,MAAa,uBAAuB,SAAkD;CACrF,IAAI;EACH,MAAM,MAAM,aAAa,IAAI,IAAI,yBAAyB,OAAO,KAAK,GAAG,GAAG,MAAM;EAClF,MAAM,MAAM,KAAK,MAAM,GAAG;EAC1B,IAAI,OAAO,IAAI,YAAY,UAC1B,MAAM,IAAI,MAAM,mDAAmD;EAEpE,OAAO,IAAI;CACZ,SAAS,OAAO;EACf,IAAI,MAAM,aAAa,KAAA,GAAW,OAAO,KAAK;EAC9C,MAAM;CACP;AACD"}