@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,7 +1,4 @@
1
- import { ChainId } from "../../substrate/brand.mjs";
2
-
3
1
  //#region src/plugins/package/publish-output.d.ts
4
- declare const LOCAL_PACKAGE_PUBLISHED_KIND: "package.local-published";
5
2
  interface PackagePublishObjectChange {
6
3
  readonly type: 'created' | 'published' | 'mutated' | 'wrapped' | 'transferred';
7
4
  readonly objectId?: string;
@@ -16,13 +13,6 @@ interface LocalPackagePublishOutput {
16
13
  readonly publisher: string;
17
14
  readonly objectChanges: ReadonlyArray<PackagePublishObjectChange>;
18
15
  }
19
- interface LocalPackagePublishedDecl {
20
- readonly kind: typeof LOCAL_PACKAGE_PUBLISHED_KIND;
21
- readonly packageName: string;
22
- readonly packageId: string;
23
- readonly chain: ChainId;
24
- readonly output: LocalPackagePublishOutput;
25
- }
26
16
  //#endregion
27
- export { LocalPackagePublishOutput, LocalPackagePublishedDecl, PackagePublishObjectChange };
17
+ export { LocalPackagePublishOutput, PackagePublishObjectChange };
28
18
  //# sourceMappingURL=publish-output.d.mts.map
@@ -1,12 +1,4 @@
1
1
  //#region src/plugins/package/publish-output.ts
2
- const LOCAL_PACKAGE_PUBLISHED_KIND = "package.local-published";
3
- const makeLocalPackagePublishedDecl = (inputs) => ({
4
- kind: LOCAL_PACKAGE_PUBLISHED_KIND,
5
- packageName: inputs.packageName,
6
- packageId: inputs.packageId,
7
- chain: inputs.chain,
8
- output: inputs.output
9
- });
10
2
  const pickPublishedChange = (changes) => changes.find((c) => c.type === "published");
11
3
  const pickUpgradeCapChange = (changes) => changes.find((c) => c.type === "created" && (c.objectType?.endsWith("::package::UpgradeCap") ?? false));
12
4
  const createdKind = (change) => {
@@ -40,6 +32,6 @@ const pickCreatedByType = (changes, opts) => {
40
32
  }));
41
33
  };
42
34
  //#endregion
43
- export { LOCAL_PACKAGE_PUBLISHED_KIND, makeLocalPackagePublishedDecl, pickCreatedByType, pickPublishedChange, pickUpgradeCapChange };
35
+ export { pickCreatedByType, pickPublishedChange, pickUpgradeCapChange };
44
36
 
45
37
  //# sourceMappingURL=publish-output.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"publish-output.mjs","names":[],"sources":["../../../src/plugins/package/publish-output.ts"],"sourcesContent":["// Local package publish output.\n//\n// This is package-domain data: the transaction digest plus object-change\n// projection produced by a successful `localPackage(...)` publish.\n\nimport type { ChainId } from '../../substrate/brand.ts';\n\nexport const LOCAL_PACKAGE_PUBLISHED_KIND = 'package.local-published' as const;\n\nexport interface PackagePublishObjectChange {\n\treadonly type: 'created' | 'published' | 'mutated' | 'wrapped' | 'transferred';\n\treadonly objectId?: string;\n\treadonly objectType?: string;\n\treadonly owner?: unknown;\n\treadonly json?: unknown;\n}\n\nexport interface PickCreatedByTypeOptions {\n\treadonly type?: string;\n\treadonly suffix?: string;\n\treadonly contains?: string;\n}\n\nexport interface LocalPackagePublishOutput {\n\treadonly digest: string;\n\treadonly packageId: string;\n\treadonly upgradeCapId?: string;\n\treadonly publisher: string;\n\treadonly objectChanges: ReadonlyArray<PackagePublishObjectChange>;\n}\n\nexport interface LocalPackagePublishedDecl {\n\treadonly kind: typeof LOCAL_PACKAGE_PUBLISHED_KIND;\n\treadonly packageName: string;\n\treadonly packageId: string;\n\treadonly chain: ChainId;\n\treadonly output: LocalPackagePublishOutput;\n}\n\nexport const makeLocalPackagePublishedDecl = (inputs: {\n\treadonly packageName: string;\n\treadonly packageId: string;\n\treadonly chain: ChainId;\n\treadonly output: LocalPackagePublishOutput;\n}): LocalPackagePublishedDecl => ({\n\tkind: LOCAL_PACKAGE_PUBLISHED_KIND,\n\tpackageName: inputs.packageName,\n\tpackageId: inputs.packageId,\n\tchain: inputs.chain,\n\toutput: inputs.output,\n});\n\nexport const pickPublishedChange = (\n\tchanges: ReadonlyArray<PackagePublishObjectChange>,\n): PackagePublishObjectChange | undefined => changes.find((c) => c.type === 'published');\n\nexport const pickUpgradeCapChange = (\n\tchanges: ReadonlyArray<PackagePublishObjectChange>,\n): PackagePublishObjectChange | undefined =>\n\tchanges.find(\n\t\t(c) => c.type === 'created' && (c.objectType?.endsWith('::package::UpgradeCap') ?? false),\n\t);\n\nconst createdKind = (change: unknown): boolean => {\n\tif (change === undefined || change === null) return false;\n\tconst tag = (change as { readonly type?: unknown; readonly kind?: unknown }).type;\n\tconst kind = (change as { readonly kind?: unknown }).kind;\n\treturn tag === 'created' || kind === 'created';\n};\n\nconst objectIdOf = (change: unknown): string | undefined => {\n\tif (change === undefined || change === null) return undefined;\n\tconst objectId = (change as { readonly objectId?: unknown }).objectId;\n\treturn typeof objectId === 'string' ? objectId : undefined;\n};\n\nconst objectTypeOf = (change: unknown): string | undefined => {\n\tif (change === undefined || change === null) return undefined;\n\tconst objectType = (change as { readonly objectType?: unknown }).objectType;\n\treturn typeof objectType === 'string' ? objectType : undefined;\n};\n\nconst matchesType = (objectType: string, opts: PickCreatedByTypeOptions): boolean => {\n\tif (opts.type !== undefined && objectType === opts.type) return true;\n\tif (opts.suffix !== undefined && objectType.endsWith(opts.suffix)) return true;\n\tif (opts.contains !== undefined && objectType.includes(opts.contains)) return true;\n\treturn opts.type === undefined && opts.suffix === undefined && opts.contains === undefined;\n};\n\nexport const pickCreatedByType = (\n\tchanges: ReadonlyArray<unknown> | undefined,\n\topts: PickCreatedByTypeOptions,\n): string | undefined => {\n\tconst found = (changes ?? []).find((change) => {\n\t\tif (!createdKind(change)) return false;\n\t\tif (objectIdOf(change) === undefined) return false;\n\t\tconst objectType = objectTypeOf(change);\n\t\treturn objectType !== undefined && matchesType(objectType, opts);\n\t});\n\treturn objectIdOf(found);\n};\n"],"mappings":";AAOA,MAAa,+BAA+B;AAgC5C,MAAa,iCAAiC,YAKZ;CACjC,MAAM;CACN,aAAa,OAAO;CACpB,WAAW,OAAO;CAClB,OAAO,OAAO;CACd,QAAQ,OAAO;CACf;AAED,MAAa,uBACZ,YAC4C,QAAQ,MAAM,MAAM,EAAE,SAAS,YAAY;AAExF,MAAa,wBACZ,YAEA,QAAQ,MACN,MAAM,EAAE,SAAS,cAAc,EAAE,YAAY,SAAS,wBAAwB,IAAI,OACnF;AAEF,MAAM,eAAe,WAA6B;AACjD,KAAI,WAAW,KAAA,KAAa,WAAW,KAAM,QAAO;CACpD,MAAM,MAAO,OAAgE;CAC7E,MAAM,OAAQ,OAAuC;AACrD,QAAO,QAAQ,aAAa,SAAS;;AAGtC,MAAM,cAAc,WAAwC;AAC3D,KAAI,WAAW,KAAA,KAAa,WAAW,KAAM,QAAO,KAAA;CACpD,MAAM,WAAY,OAA2C;AAC7D,QAAO,OAAO,aAAa,WAAW,WAAW,KAAA;;AAGlD,MAAM,gBAAgB,WAAwC;AAC7D,KAAI,WAAW,KAAA,KAAa,WAAW,KAAM,QAAO,KAAA;CACpD,MAAM,aAAc,OAA6C;AACjE,QAAO,OAAO,eAAe,WAAW,aAAa,KAAA;;AAGtD,MAAM,eAAe,YAAoB,SAA4C;AACpF,KAAI,KAAK,SAAS,KAAA,KAAa,eAAe,KAAK,KAAM,QAAO;AAChE,KAAI,KAAK,WAAW,KAAA,KAAa,WAAW,SAAS,KAAK,OAAO,CAAE,QAAO;AAC1E,KAAI,KAAK,aAAa,KAAA,KAAa,WAAW,SAAS,KAAK,SAAS,CAAE,QAAO;AAC9E,QAAO,KAAK,SAAS,KAAA,KAAa,KAAK,WAAW,KAAA,KAAa,KAAK,aAAa,KAAA;;AAGlF,MAAa,qBACZ,SACA,SACwB;AAOxB,QAAO,YANQ,WAAW,EAAE,EAAE,MAAM,WAAW;AAC9C,MAAI,CAAC,YAAY,OAAO,CAAE,QAAO;AACjC,MAAI,WAAW,OAAO,KAAK,KAAA,EAAW,QAAO;EAC7C,MAAM,aAAa,aAAa,OAAO;AACvC,SAAO,eAAe,KAAA,KAAa,YAAY,YAAY,KAAK;GAE1C,CAAC"}
1
+ {"version":3,"file":"publish-output.mjs","names":[],"sources":["../../../src/plugins/package/publish-output.ts"],"sourcesContent":["// Local package publish output.\n//\n// This is package-domain data: the transaction digest plus object-change\n// projection produced by a successful `localPackage(...)` publish. The\n// package plugin's `start` folds this output's coins into the per-stack\n// CoinRegistry directly (see `discoverPublishedCoins`); there is no\n// custom contribution-decl kind for it.\n\nexport interface PackagePublishObjectChange {\n\treadonly type: 'created' | 'published' | 'mutated' | 'wrapped' | 'transferred';\n\treadonly objectId?: string;\n\treadonly objectType?: string;\n\treadonly owner?: unknown;\n\treadonly json?: unknown;\n}\n\nexport interface PickCreatedByTypeOptions {\n\treadonly type?: string;\n\treadonly suffix?: string;\n\treadonly contains?: string;\n}\n\nexport interface LocalPackagePublishOutput {\n\treadonly digest: string;\n\treadonly packageId: string;\n\treadonly upgradeCapId?: string;\n\treadonly publisher: string;\n\treadonly objectChanges: ReadonlyArray<PackagePublishObjectChange>;\n}\n\nexport const pickPublishedChange = (\n\tchanges: ReadonlyArray<PackagePublishObjectChange>,\n): PackagePublishObjectChange | undefined => changes.find((c) => c.type === 'published');\n\nexport const pickUpgradeCapChange = (\n\tchanges: ReadonlyArray<PackagePublishObjectChange>,\n): PackagePublishObjectChange | undefined =>\n\tchanges.find(\n\t\t(c) => c.type === 'created' && (c.objectType?.endsWith('::package::UpgradeCap') ?? false),\n\t);\n\nconst createdKind = (change: unknown): boolean => {\n\tif (change === undefined || change === null) return false;\n\tconst tag = (change as { readonly type?: unknown; readonly kind?: unknown }).type;\n\tconst kind = (change as { readonly kind?: unknown }).kind;\n\treturn tag === 'created' || kind === 'created';\n};\n\nconst objectIdOf = (change: unknown): string | undefined => {\n\tif (change === undefined || change === null) return undefined;\n\tconst objectId = (change as { readonly objectId?: unknown }).objectId;\n\treturn typeof objectId === 'string' ? objectId : undefined;\n};\n\nconst objectTypeOf = (change: unknown): string | undefined => {\n\tif (change === undefined || change === null) return undefined;\n\tconst objectType = (change as { readonly objectType?: unknown }).objectType;\n\treturn typeof objectType === 'string' ? objectType : undefined;\n};\n\nconst matchesType = (objectType: string, opts: PickCreatedByTypeOptions): boolean => {\n\tif (opts.type !== undefined && objectType === opts.type) return true;\n\tif (opts.suffix !== undefined && objectType.endsWith(opts.suffix)) return true;\n\tif (opts.contains !== undefined && objectType.includes(opts.contains)) return true;\n\treturn opts.type === undefined && opts.suffix === undefined && opts.contains === undefined;\n};\n\nexport const pickCreatedByType = (\n\tchanges: ReadonlyArray<unknown> | undefined,\n\topts: PickCreatedByTypeOptions,\n): string | undefined => {\n\tconst found = (changes ?? []).find((change) => {\n\t\tif (!createdKind(change)) return false;\n\t\tif (objectIdOf(change) === undefined) return false;\n\t\tconst objectType = objectTypeOf(change);\n\t\treturn objectType !== undefined && matchesType(objectType, opts);\n\t});\n\treturn objectIdOf(found);\n};\n"],"mappings":";AA8BA,MAAa,uBACZ,YAC4C,QAAQ,MAAM,MAAM,EAAE,SAAS,WAAW;AAEvF,MAAa,wBACZ,YAEA,QAAQ,MACN,MAAM,EAAE,SAAS,cAAc,EAAE,YAAY,SAAS,uBAAuB,KAAK,MACpF;AAED,MAAM,eAAe,WAA6B;CACjD,IAAI,WAAW,KAAA,KAAa,WAAW,MAAM,OAAO;CACpD,MAAM,MAAO,OAAgE;CAC7E,MAAM,OAAQ,OAAuC;CACrD,OAAO,QAAQ,aAAa,SAAS;AACtC;AAEA,MAAM,cAAc,WAAwC;CAC3D,IAAI,WAAW,KAAA,KAAa,WAAW,MAAM,OAAO,KAAA;CACpD,MAAM,WAAY,OAA2C;CAC7D,OAAO,OAAO,aAAa,WAAW,WAAW,KAAA;AAClD;AAEA,MAAM,gBAAgB,WAAwC;CAC7D,IAAI,WAAW,KAAA,KAAa,WAAW,MAAM,OAAO,KAAA;CACpD,MAAM,aAAc,OAA6C;CACjE,OAAO,OAAO,eAAe,WAAW,aAAa,KAAA;AACtD;AAEA,MAAM,eAAe,YAAoB,SAA4C;CACpF,IAAI,KAAK,SAAS,KAAA,KAAa,eAAe,KAAK,MAAM,OAAO;CAChE,IAAI,KAAK,WAAW,KAAA,KAAa,WAAW,SAAS,KAAK,MAAM,GAAG,OAAO;CAC1E,IAAI,KAAK,aAAa,KAAA,KAAa,WAAW,SAAS,KAAK,QAAQ,GAAG,OAAO;CAC9E,OAAO,KAAK,SAAS,KAAA,KAAa,KAAK,WAAW,KAAA,KAAa,KAAK,aAAa,KAAA;AAClF;AAEA,MAAa,qBACZ,SACA,SACwB;CAOxB,OAAO,YANQ,WAAW,CAAC,EAAA,CAAG,MAAM,WAAW;EAC9C,IAAI,CAAC,YAAY,MAAM,GAAG,OAAO;EACjC,IAAI,WAAW,MAAM,MAAM,KAAA,GAAW,OAAO;EAC7C,MAAM,aAAa,aAAa,MAAM;EACtC,OAAO,eAAe,KAAA,KAAa,YAAY,YAAY,IAAI;CAChE,CACsB,CAAC;AACxB"}
@@ -1,4 +1,4 @@
1
- import { Context, Effect, Layer, Stream } from "effect";
1
+ import { Context, Effect, Layer } from "effect";
2
2
 
3
3
  //#region src/plugins/package/registry.d.ts
4
4
  /** Resolved package handle for a local (built + published) package. */
@@ -1,14 +1,29 @@
1
- import { defineScopedRefMap } from "../../substrate/runtime/scoped-ref-map/service.mjs";
2
- import "../../substrate/runtime/scoped-ref-map/index.mjs";
3
- import { Context, Effect, Layer } from "effect";
1
+ import { Context, Effect, Layer, Ref } from "effect";
4
2
  //#region src/plugins/package/registry.ts
5
- const PackageRefMap = defineScopedRefMap("PackageRegistry");
6
- const wrapRefMap = (refMap) => ({
7
- set: refMap.set,
8
- find: refMap.find,
9
- has: refMap.has,
10
- entries: refMap.entries,
11
- changes: refMap.changes
3
+ /** Build a self-contained last-write-wins `PackageKey ->
4
+ * ResolvedPackage` registry over a plain `Ref<Map>`. One entry per
5
+ * key (each `set` replaces the key's lone entry under a fresh seq),
6
+ * and `entries` returns pairs ordered by their entry's seq — a
7
+ * re-set of an existing key advances its seq and re-sorts it to the
8
+ * end. */
9
+ const makePackageRegistry = () => Effect.gen(function* () {
10
+ const store = yield* Ref.make(/* @__PURE__ */ new Map());
11
+ const seqRef = yield* Ref.make(0);
12
+ return {
13
+ set: (key, value) => Effect.gen(function* () {
14
+ const seq = yield* Ref.updateAndGet(seqRef, (n) => n + 1);
15
+ yield* Ref.update(store, (current) => {
16
+ const next = new Map(current);
17
+ next.set(key, {
18
+ value,
19
+ seq
20
+ });
21
+ return next;
22
+ });
23
+ }),
24
+ find: (key) => Ref.get(store).pipe(Effect.map((state) => state.get(key)?.value ?? null)),
25
+ entries: () => Ref.get(store).pipe(Effect.map((state) => [...state.entries()].sort(([, a], [, b]) => a.seq - b.seq).map(([key, e]) => [key, e.value])))
26
+ };
12
27
  });
13
28
  /** Context.Service tag for the per-stack `PackageRegistry`. Plugins
14
29
  * yield this in their acquire body. */
@@ -17,10 +32,7 @@ var PackageRegistryService = class extends Context.Service()("@devstack/plugins/
17
32
  * scope. Boot wiring (CLI / e2e) provides this once per stack;
18
33
  * every package/coin/wallet/faucet plugin in the stack yields the
19
34
  * SAME instance via Context. */
20
- const layerPackageRegistry = Layer.effect(PackageRegistryService, Effect.gen(function* () {
21
- const refMap = yield* PackageRefMap.Service;
22
- return PackageRegistryService.of(wrapRefMap(refMap));
23
- })).pipe(Layer.provide(PackageRefMap.layer));
35
+ const layerPackageRegistry = Layer.effect(PackageRegistryService, makePackageRegistry().pipe(Effect.map(PackageRegistryService.of)));
24
36
  /** Capability-key constant for the per-stack registry — siblings
25
37
  * (Coin, Action, manifest emitter, faucet strategies) look it up
26
38
  * through the StrategyContributor registry. */
@@ -1 +1 @@
1
- {"version":3,"file":"registry.mjs","names":[],"sources":["../../../src/plugins/package/registry.ts"],"sourcesContent":["// Per-stack PackageRegistry — owned by the L2 Package plugin.\n//\n// Architecture (ARCHITECTURE.md § Substrate name-blindness): the\n// substrate exposes ONLY the generic `defineScopedRefMap<K, V>` factory;\n// the package-domain shape (`ResolvedLocalPackage` / `ResolvedKnownPackage`)\n// lives here at L2 where it belongs. Two `localPackage(...)` calls in\n// the same stack see the same Service instance (one per stack scope),\n// so cross-plugin lookups stay consistent and warm-restart verify can\n// use the previously-resolved `packageId` as a hint.\n//\n// Wrapper-service pattern (STYLE_GUIDE §6 / \"L2 wrapper-service around\n// defineScopedRefMap\"): the module-private inner `PackageRefMap` is the\n// raw substrate primitive; the publicly-exported `PackageRegistryService`\n// is the L2 wrapper that the rest of the plugin (and external siblings)\n// yield. Today the wrapper only re-exposes the four substrate ops\n// (`set` / `find` / `has` / `entries` + `changes`), but the shape\n// matches Coin's wrapper so future plugin-specific lookups (e.g.\n// `byPublisher`, `byPackageId`) land in one place instead of every\n// consumer reaching into the raw map.\n\nimport { Context, Effect, Layer, type Stream } from 'effect';\n\nimport {\n\tdefineScopedRefMap,\n\ttype ScopedRefMap,\n} from '../../substrate/runtime/scoped-ref-map/index.ts';\n\n/** Resolved package handle for a local (built + published) package. */\nexport interface ResolvedLocalPackage {\n\treadonly kind: 'local';\n\treadonly name: string;\n\treadonly packageId: string;\n\treadonly upgradeCapId?: string;\n\treadonly sourcePath: string;\n\treadonly mvrPlaceholder: string;\n\t/** Captured object ids — keyed by user-declared name. */\n\treadonly captured: Readonly<Record<string, string>>;\n}\n\n/** Resolved package handle for a known (verify-only) package. */\nexport interface ResolvedKnownPackage {\n\treadonly kind: 'known';\n\treadonly name: string;\n\treadonly packageId: string;\n\treadonly upgradeCapId?: string;\n\treadonly mvrPlaceholder: string;\n}\n\nexport type ResolvedPackage = ResolvedLocalPackage | ResolvedKnownPackage;\n\n/** Registry key — the user-declared symbolic package name. Kept as a\n * type alias (not a brand) because the same string flows verbatim\n * through `localPackage(name, ...)` / `knownPackage(name, ...)` and\n * out via `entries()` to consumers (codegen, snapshot identity). */\nexport type PackageKey = string;\n\n/** L2 wrapper shape — the operations exposed on `PackageRegistryService`.\n * Today these are a 1:1 re-projection of the substrate primitive's\n * generic `ScopedRefMap<K, V>`; future plugin-specific lookups land\n * here without forcing every consumer to learn a new shape. */\nexport interface PackageRegistry {\n\treadonly set: (key: PackageKey, value: ResolvedPackage) => Effect.Effect<void>;\n\treadonly find: (key: PackageKey) => Effect.Effect<ResolvedPackage | null>;\n\treadonly has: (key: PackageKey) => Effect.Effect<boolean>;\n\treadonly entries: () => Effect.Effect<ReadonlyArray<readonly [PackageKey, ResolvedPackage]>>;\n\treadonly changes: Stream.Stream<ReadonlyArray<readonly [PackageKey, ResolvedPackage]>>;\n}\n\n// Module-private inner substrate primitive instantiated once per\n// logical registry. The service identity is namespaced by the `name`\n// argument; substrate stays name-blind (it sees only `K` and `V`).\nconst PackageRefMap = defineScopedRefMap<PackageKey, ResolvedPackage>('PackageRegistry');\n\nconst wrapRefMap = (refMap: ScopedRefMap<PackageKey, ResolvedPackage>): PackageRegistry => ({\n\tset: refMap.set,\n\tfind: refMap.find,\n\thas: refMap.has,\n\tentries: refMap.entries,\n\tchanges: refMap.changes,\n});\n\n/** Context.Service tag for the per-stack `PackageRegistry`. Plugins\n * yield this in their acquire body. */\nexport class PackageRegistryService extends Context.Service<\n\tPackageRegistryService,\n\tPackageRegistry\n>()('@devstack/plugins/package/PackageRegistry') {}\n\n/** Scope-bound Layer materializing one `PackageRegistry` per stack\n * scope. Boot wiring (CLI / e2e) provides this once per stack;\n * every package/coin/wallet/faucet plugin in the stack yields the\n * SAME instance via Context. */\nexport const layerPackageRegistry: Layer.Layer<PackageRegistryService> = Layer.effect(\n\tPackageRegistryService,\n\tEffect.gen(function* () {\n\t\tconst refMap = yield* PackageRefMap.Service;\n\t\treturn PackageRegistryService.of(wrapRefMap(refMap));\n\t}),\n).pipe(Layer.provide(PackageRefMap.layer));\n\n/** Capability-key constant for the per-stack registry — siblings\n * (Coin, Action, manifest emitter, faucet strategies) look it up\n * through the StrategyContributor registry. */\nexport const PACKAGE_REGISTRY_CAPABILITY_KEY = 'package-registry' as const;\n"],"mappings":";;;;AAuEA,MAAM,gBAAgB,mBAAgD,kBAAkB;AAExF,MAAM,cAAc,YAAwE;CAC3F,KAAK,OAAO;CACZ,MAAM,OAAO;CACb,KAAK,OAAO;CACZ,SAAS,OAAO;CAChB,SAAS,OAAO;CAChB;;;AAID,IAAa,yBAAb,cAA4C,QAAQ,SAGjD,CAAC,4CAA4C,CAAC;;;;;AAMjD,MAAa,uBAA4D,MAAM,OAC9E,wBACA,OAAO,IAAI,aAAa;CACvB,MAAM,SAAS,OAAO,cAAc;AACpC,QAAO,uBAAuB,GAAG,WAAW,OAAO,CAAC;EACnD,CACF,CAAC,KAAK,MAAM,QAAQ,cAAc,MAAM,CAAC;;;;AAK1C,MAAa,kCAAkC"}
1
+ {"version":3,"file":"registry.mjs","names":[],"sources":["../../../src/plugins/package/registry.ts"],"sourcesContent":["// Per-stack PackageRegistry — owned by the L2 Package plugin.\n//\n// The package-domain shape (`ResolvedLocalPackage` /\n// `ResolvedKnownPackage`) lives here at L2 where it belongs. Two\n// `localPackage(...)` calls in the same stack see the same Service\n// instance (one per stack scope), so cross-plugin lookups stay\n// consistent and warm-restart verify can use the previously-resolved\n// `packageId` as a hint.\n//\n// Storage: a self-contained last-write-wins `PackageKey ->\n// ResolvedPackage` map over a plain `Ref<Map>` (formerly the\n// substrate `defineScopedRefMap` single mode, which had exactly two\n// consumers coin + package so it was strangled out and inlined\n// here). LWW semantics: each `set` stamps a fresh monotonic `seq`\n// and replaces the key's lone entry (one entry per key); `entries`\n// orders keys by their entry's seq, so a re-set advances the key's\n// seq and sorts it to the end.\n\nimport { Context, Effect, Layer, Ref } from 'effect';\n\n/** Resolved package handle for a local (built + published) package. */\nexport interface ResolvedLocalPackage {\n\treadonly kind: 'local';\n\treadonly name: string;\n\treadonly packageId: string;\n\treadonly upgradeCapId?: string;\n\treadonly sourcePath: string;\n\treadonly mvrPlaceholder: string;\n\t/** Captured object ids — keyed by user-declared name. */\n\treadonly captured: Readonly<Record<string, string>>;\n}\n\n/** Resolved package handle for a known (verify-only) package. */\nexport interface ResolvedKnownPackage {\n\treadonly kind: 'known';\n\treadonly name: string;\n\treadonly packageId: string;\n\treadonly upgradeCapId?: string;\n\treadonly mvrPlaceholder: string;\n}\n\nexport type ResolvedPackage = ResolvedLocalPackage | ResolvedKnownPackage;\n\n/** Registry key — the user-declared symbolic package name. Kept as a\n * type alias (not a brand) because the same string flows verbatim\n * through `localPackage(name, ...)` / `knownPackage(name, ...)` and\n * out via `entries()` to consumers (codegen, snapshot identity). */\nexport type PackageKey = string;\n\n/** L2 registry shape — the operations exposed on\n * `PackageRegistryService`. A last-write-wins `PackageKey ->\n * ResolvedPackage` map, namespaced to the package domain so\n * consumers share one shape. */\nexport interface PackageRegistry {\n\treadonly set: (key: PackageKey, value: ResolvedPackage) => Effect.Effect<void>;\n\treadonly find: (key: PackageKey) => Effect.Effect<ResolvedPackage | null>;\n\treadonly entries: () => Effect.Effect<ReadonlyArray<readonly [PackageKey, ResolvedPackage]>>;\n}\n\n/** One stored entry: the package plus the monotonic `seq` the last\n * `set` stamped it with. The `seq` drives last-write-wins (highest\n * seq under a key wins) and `entries` insertion order. */\ninterface SeqEntry {\n\treadonly value: ResolvedPackage;\n\treadonly seq: number;\n}\n\n/** Build a self-contained last-write-wins `PackageKey ->\n * ResolvedPackage` registry over a plain `Ref<Map>`. One entry per\n * key (each `set` replaces the key's lone entry under a fresh seq),\n * and `entries` returns pairs ordered by their entry's seq — a\n * re-set of an existing key advances its seq and re-sorts it to the\n * end. */\nconst makePackageRegistry = (): Effect.Effect<PackageRegistry> =>\n\tEffect.gen(function* () {\n\t\tconst store = yield* Ref.make<ReadonlyMap<PackageKey, SeqEntry>>(new Map());\n\t\tconst seqRef = yield* Ref.make(0);\n\n\t\treturn {\n\t\t\tset: (key, value) =>\n\t\t\t\tEffect.gen(function* () {\n\t\t\t\t\tconst seq = yield* Ref.updateAndGet(seqRef, (n) => n + 1);\n\t\t\t\t\tyield* Ref.update(store, (current) => {\n\t\t\t\t\t\tconst next = new Map(current);\n\t\t\t\t\t\tnext.set(key, { value, seq });\n\t\t\t\t\t\treturn next;\n\t\t\t\t\t});\n\t\t\t\t}),\n\t\t\tfind: (key) => Ref.get(store).pipe(Effect.map((state) => state.get(key)?.value ?? null)),\n\t\t\tentries: () =>\n\t\t\t\tRef.get(store).pipe(\n\t\t\t\t\tEffect.map((state) =>\n\t\t\t\t\t\t[...state.entries()]\n\t\t\t\t\t\t\t.sort(([, a], [, b]) => a.seq - b.seq)\n\t\t\t\t\t\t\t.map(([key, e]) => [key, e.value] as const),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t};\n\t});\n\n/** Context.Service tag for the per-stack `PackageRegistry`. Plugins\n * yield this in their acquire body. */\nexport class PackageRegistryService extends Context.Service<\n\tPackageRegistryService,\n\tPackageRegistry\n>()('@devstack/plugins/package/PackageRegistry') {}\n\n/** Scope-bound Layer materializing one `PackageRegistry` per stack\n * scope. Boot wiring (CLI / e2e) provides this once per stack;\n * every package/coin/wallet/faucet plugin in the stack yields the\n * SAME instance via Context. */\nexport const layerPackageRegistry: Layer.Layer<PackageRegistryService> = Layer.effect(\n\tPackageRegistryService,\n\tmakePackageRegistry().pipe(Effect.map(PackageRegistryService.of)),\n);\n\n/** Capability-key constant for the per-stack registry — siblings\n * (Coin, Action, manifest emitter, faucet strategies) look it up\n * through the StrategyContributor registry. */\nexport const PACKAGE_REGISTRY_CAPABILITY_KEY = 'package-registry' as const;\n"],"mappings":";;;;;;;;AAyEA,MAAM,4BACL,OAAO,IAAI,aAAa;CACvB,MAAM,QAAQ,OAAO,IAAI,qBAAwC,IAAI,IAAI,CAAC;CAC1E,MAAM,SAAS,OAAO,IAAI,KAAK,CAAC;CAEhC,OAAO;EACN,MAAM,KAAK,UACV,OAAO,IAAI,aAAa;GACvB,MAAM,MAAM,OAAO,IAAI,aAAa,SAAS,MAAM,IAAI,CAAC;GACxD,OAAO,IAAI,OAAO,QAAQ,YAAY;IACrC,MAAM,OAAO,IAAI,IAAI,OAAO;IAC5B,KAAK,IAAI,KAAK;KAAE;KAAO;IAAI,CAAC;IAC5B,OAAO;GACR,CAAC;EACF,CAAC;EACF,OAAO,QAAQ,IAAI,IAAI,KAAK,CAAC,CAAC,KAAK,OAAO,KAAK,UAAU,MAAM,IAAI,GAAG,CAAC,EAAE,SAAS,IAAI,CAAC;EACvF,eACC,IAAI,IAAI,KAAK,CAAC,CAAC,KACd,OAAO,KAAK,UACX,CAAC,GAAG,MAAM,QAAQ,CAAC,CAAC,CAClB,MAAM,GAAG,IAAI,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,CACrC,KAAK,CAAC,KAAK,OAAO,CAAC,KAAK,EAAE,KAAK,CAAU,CAC5C,CACD;CACF;AACD,CAAC;;;AAIF,IAAa,yBAAb,cAA4C,QAAQ,QAGlD,CAAC,CAAC,2CAA2C,CAAC,CAAC,CAAC;;;;;AAMlD,MAAa,uBAA4D,MAAM,OAC9E,wBACA,oBAAoB,CAAC,CAAC,KAAK,OAAO,IAAI,uBAAuB,EAAE,CAAC,CACjE;;;;AAKA,MAAa,kCAAkC"}
@@ -1 +1 @@
1
- {"version":3,"file":"service.mjs","names":[],"sources":["../../../src/plugins/package/service.ts"],"sourcesContent":["// Package plugin — main acquire body.\n//\n// Dispatch on `opts.mode` ∈ {local, known} and delegate to the\n// per-mode acquire. This file is INTENTIONALLY thin: the substrate\n// concerns (cache key, verify, produce, register) live inside the\n// ArtifactPublisher primitive; the toolchain concerns (build,\n// scrub) live in `build.ts`. We just route.\n//\n// Substrate dependencies arrive via `definePlugin({ dependsOn })`:\n//\n// - suiResource — resolved SuiClient + chainId\n// - publisher account — publisher address + sign-and-execute\n//\n// And via the StrategyContributor registry (by capability key):\n//\n// - chain-probe:<chainId> — ChainProbe<SuiProbeKey>\n// - artifact-publisher — the ArtifactPublisher (substrate\n// primitive, available everywhere)\n//\n// And via the plugin-owned PackageRegistry service (instantiated from\n// the substrate's generic ScopedRefMap primitive — see `registry.ts`).\n//\n// The wiring of these lookups happens at the barrel (`index.ts`); this\n// file accepts them as parameters so it stays testable.\n\nimport { Effect, type Scope } from 'effect';\n\nimport type {\n\tArtifactPublishError,\n\tArtifactPublisher,\n} from '../../primitives/artifact-publisher.ts';\nimport type { ChainProbe } from '../../contracts/chain-probe.ts';\nimport type { SuiProbeKey } from '../sui/index.ts';\nimport { acquireKnown, type KnownModeInputs } from './mode-known.ts';\nimport { acquireLocal, type LocalModeInputs } from './mode-local.ts';\nimport type {\n\tPackageRegistry,\n\tResolvedKnownPackage,\n\tResolvedLocalPackage,\n\tResolvedPackage,\n} from './registry.ts';\nimport type { LocalPackagePublishOutput } from './publish-output.ts';\nimport type { PublishError } from './errors.ts';\n\n/** Discriminated mode union — mirrors the public factory shape\n * (`localPackage(...)` and `knownPackage(...)`). The barrel\n * constructs ONE of these per declared package and the body below\n * routes. */\nexport type PackageMode =\n\t| ({ readonly mode: 'local' } & LocalModeInputs)\n\t| ({ readonly mode: 'known' } & KnownModeInputs);\n\nexport interface BootPackageResult {\n\treadonly resolved: ResolvedPackage;\n\t/** Fresh publish output — populated on cache MISS (the produce\n\t * path ran), `null` on cache hit (verify path). Threaded out so\n\t * the barrel can fan out coin auto-discovery (and any other\n\t * output-consuming siblings) once per fresh publish.\n\t *\n\t * Known mode never publishes, so this is always `null` there. */\n\treadonly output: LocalPackagePublishOutput | null;\n}\n\nexport interface BootLocalPackageResult {\n\treadonly resolved: ResolvedLocalPackage;\n\treadonly output: LocalPackagePublishOutput | null;\n}\n\nexport interface BootKnownPackageResult {\n\treadonly resolved: ResolvedKnownPackage;\n\treadonly output: null;\n}\n\n/** Dispatch on the typed mode. */\nexport function bootPackageService(\n\tpublisher: ArtifactPublisher,\n\tprobe: ChainProbe<SuiProbeKey>,\n\tregistry: PackageRegistry,\n\topts: { readonly mode: 'local' } & LocalModeInputs,\n): Effect.Effect<BootLocalPackageResult, PublishError | ArtifactPublishError, Scope.Scope>;\nexport function bootPackageService(\n\tpublisher: ArtifactPublisher,\n\tprobe: ChainProbe<SuiProbeKey>,\n\tregistry: PackageRegistry,\n\topts: { readonly mode: 'known' } & KnownModeInputs,\n): Effect.Effect<BootKnownPackageResult, PublishError | ArtifactPublishError, Scope.Scope>;\nexport function bootPackageService(\n\tpublisher: ArtifactPublisher,\n\tprobe: ChainProbe<SuiProbeKey>,\n\tregistry: PackageRegistry,\n\topts: PackageMode,\n): Effect.Effect<BootPackageResult, PublishError | ArtifactPublishError, Scope.Scope> {\n\tswitch (opts.mode) {\n\t\tcase 'local':\n\t\t\treturn acquireLocal(publisher, probe, registry, opts).pipe(\n\t\t\t\tEffect.map(({ resolved, output }) => ({ resolved, output })),\n\t\t\t);\n\t\tcase 'known':\n\t\t\treturn acquireKnown(probe, registry, opts).pipe(\n\t\t\t\tEffect.map(({ resolved }) => ({ resolved, output: null })),\n\t\t\t);\n\t}\n}\n"],"mappings":";;;;AAsFA,SAAgB,mBACf,WACA,OACA,UACA,MACqF;AACrF,SAAQ,KAAK,MAAb;EACC,KAAK,QACJ,QAAO,aAAa,WAAW,OAAO,UAAU,KAAK,CAAC,KACrD,OAAO,KAAK,EAAE,UAAU,cAAc;GAAE;GAAU;GAAQ,EAAE,CAC5D;EACF,KAAK,QACJ,QAAO,aAAa,OAAO,UAAU,KAAK,CAAC,KAC1C,OAAO,KAAK,EAAE,gBAAgB;GAAE;GAAU,QAAQ;GAAM,EAAE,CAC1D"}
1
+ {"version":3,"file":"service.mjs","names":[],"sources":["../../../src/plugins/package/service.ts"],"sourcesContent":["// Package plugin — main acquire body.\n//\n// Dispatch on `opts.mode` ∈ {local, known} and delegate to the\n// per-mode acquire. This file is INTENTIONALLY thin: the substrate\n// concerns (cache key, verify, produce, register) live inside the\n// ArtifactPublisher primitive; the toolchain concerns (build,\n// scrub) live in `build.ts`. We just route.\n//\n// Substrate dependencies arrive via `definePlugin({ dependsOn })`:\n//\n// - suiResource — resolved SuiClient + chainId\n// - publisher account — publisher address + sign-and-execute\n//\n// And via the StrategyContributor registry (by capability key):\n//\n// - chain-probe:<chainId> — ChainProbe<SuiProbeKey>\n// - artifact-publisher — the ArtifactPublisher (substrate\n// primitive, available everywhere)\n//\n// And via the plugin-owned PackageRegistry service (a self-contained\n// last-write-wins `PackageKey -> ResolvedPackage` map — see `registry.ts`).\n//\n// The wiring of these lookups happens at the barrel (`index.ts`); this\n// file accepts them as parameters so it stays testable.\n\nimport { Effect, type Scope } from 'effect';\n\nimport type {\n\tArtifactPublishError,\n\tArtifactPublisher,\n} from '../../primitives/artifact-publisher.ts';\nimport type { ChainProbe } from '../../contracts/chain-probe.ts';\nimport type { SuiProbeKey } from '../sui/index.ts';\nimport { acquireKnown, type KnownModeInputs } from './mode-known.ts';\nimport { acquireLocal, type LocalModeInputs } from './mode-local.ts';\nimport type {\n\tPackageRegistry,\n\tResolvedKnownPackage,\n\tResolvedLocalPackage,\n\tResolvedPackage,\n} from './registry.ts';\nimport type { LocalPackagePublishOutput } from './publish-output.ts';\nimport type { PublishError } from './errors.ts';\n\n/** Discriminated mode union — mirrors the public factory shape\n * (`localPackage(...)` and `knownPackage(...)`). The barrel\n * constructs ONE of these per declared package and the body below\n * routes. */\nexport type PackageMode =\n\t| ({ readonly mode: 'local' } & LocalModeInputs)\n\t| ({ readonly mode: 'known' } & KnownModeInputs);\n\nexport interface BootPackageResult {\n\treadonly resolved: ResolvedPackage;\n\t/** Fresh publish output — populated on cache MISS (the produce\n\t * path ran), `null` on cache hit (verify path). Threaded out so\n\t * the barrel can fan out coin auto-discovery (and any other\n\t * output-consuming siblings) once per fresh publish.\n\t *\n\t * Known mode never publishes, so this is always `null` there. */\n\treadonly output: LocalPackagePublishOutput | null;\n}\n\nexport interface BootLocalPackageResult {\n\treadonly resolved: ResolvedLocalPackage;\n\treadonly output: LocalPackagePublishOutput | null;\n}\n\nexport interface BootKnownPackageResult {\n\treadonly resolved: ResolvedKnownPackage;\n\treadonly output: null;\n}\n\n/** Dispatch on the typed mode. */\nexport function bootPackageService(\n\tpublisher: ArtifactPublisher,\n\tprobe: ChainProbe<SuiProbeKey>,\n\tregistry: PackageRegistry,\n\topts: { readonly mode: 'local' } & LocalModeInputs,\n): Effect.Effect<BootLocalPackageResult, PublishError | ArtifactPublishError, Scope.Scope>;\nexport function bootPackageService(\n\tpublisher: ArtifactPublisher,\n\tprobe: ChainProbe<SuiProbeKey>,\n\tregistry: PackageRegistry,\n\topts: { readonly mode: 'known' } & KnownModeInputs,\n): Effect.Effect<BootKnownPackageResult, PublishError | ArtifactPublishError, Scope.Scope>;\nexport function bootPackageService(\n\tpublisher: ArtifactPublisher,\n\tprobe: ChainProbe<SuiProbeKey>,\n\tregistry: PackageRegistry,\n\topts: PackageMode,\n): Effect.Effect<BootPackageResult, PublishError | ArtifactPublishError, Scope.Scope> {\n\tswitch (opts.mode) {\n\t\tcase 'local':\n\t\t\treturn acquireLocal(publisher, probe, registry, opts).pipe(\n\t\t\t\tEffect.map(({ resolved, output }) => ({ resolved, output })),\n\t\t\t);\n\t\tcase 'known':\n\t\t\treturn acquireKnown(probe, registry, opts).pipe(\n\t\t\t\tEffect.map(({ resolved }) => ({ resolved, output: null })),\n\t\t\t);\n\t}\n}\n"],"mappings":";;;;AAsFA,SAAgB,mBACf,WACA,OACA,UACA,MACqF;CACrF,QAAQ,KAAK,MAAb;EACC,KAAK,SACJ,OAAO,aAAa,WAAW,OAAO,UAAU,IAAI,CAAC,CAAC,KACrD,OAAO,KAAK,EAAE,UAAU,cAAc;GAAE;GAAU;EAAO,EAAE,CAC5D;EACD,KAAK,SACJ,OAAO,aAAa,OAAO,UAAU,IAAI,CAAC,CAAC,KAC1C,OAAO,KAAK,EAAE,gBAAgB;GAAE;GAAU,QAAQ;EAAK,EAAE,CAC1D;CACF;AACD"}
@@ -1 +1 @@
1
- {"version":3,"file":"snapshot.mjs","names":[],"sources":["../../../src/plugins/package/snapshot.ts"],"sourcesContent":["// Package plugin — Snapshotable contribution.\n//\n// Distilled doc §Cross-component references §snapshot: \"persisted\n// Package cache entries survive snapshot save/restore; the chain\n// containers are tarred separately and on restore the verify probe\n// re-confirms.\"\n//\n// The Package plugin OWNS the publishMove cache entries in the\n// StateStore — those land under the substrate's runtime-dir root\n// at `state-store/<plugin-key>/...` and are auto-captured by the\n// substrate without an explicit subtree decl. We declare a\n// `missingTolerance: 'fine'` shape because:\n//\n// - A restored stack with a missing cache entry simply re-publishes\n// (cache miss). No data loss.\n// - A restored stack with a present cache entry runs the lenient\n// verify probe; if the chain snapshot also restored, the probe\n// resolves the cached id; otherwise it misses and re-publishes.\n//\n// No managed containers — the build container belongs to the Sui\n// plugin (per-app, declared there). The Move build cache lives at\n// `~/.move/git` on the host (NOT in a container) and is intentionally\n// NOT captured: distilled doc §Cross-component references — vendored\n// deps are content-addressed by sui-cli, re-fetched on demand.\n\nimport { Effect } from 'effect';\n\nimport type { SnapshotableDecl } from '../../contracts/snapshotable.ts';\n\n/** Build the Snapshotable contribution.\n *\n * Identity guard: contributes the package's symbolic name + content\n * hash to the pre-restore identity record. A snapshot taken under\n * source-hash A restored against source-hash A is OK (verify probe\n * re-confirms); a mismatch lets the substrate decide (typically:\n * also OK — re-publish). The identity guard is mostly informational\n * here. */\nexport const makeSnapshotable = (packageName: string, sourceHash: string): SnapshotableDecl => ({\n\tkind: 'snapshotable',\n\tsubtrees: [],\n\tmissingTolerance: 'fine',\n\tpreRestore: Effect.succeed({\n\t\tkind: 'package' as const,\n\t\tname: packageName,\n\t\tsourceHash,\n\t}),\n\tpostRestore: Effect.void,\n});\n"],"mappings":";;;;;;;;;;AAqCA,MAAa,oBAAoB,aAAqB,gBAA0C;CAC/F,MAAM;CACN,UAAU,EAAE;CACZ,kBAAkB;CAClB,YAAY,OAAO,QAAQ;EAC1B,MAAM;EACN,MAAM;EACN;EACA,CAAC;CACF,aAAa,OAAO;CACpB"}
1
+ {"version":3,"file":"snapshot.mjs","names":[],"sources":["../../../src/plugins/package/snapshot.ts"],"sourcesContent":["// Package plugin — Snapshotable contribution.\n//\n// Distilled doc §Cross-component references §snapshot: \"persisted\n// Package cache entries survive snapshot save/restore; the chain\n// containers are tarred separately and on restore the verify probe\n// re-confirms.\"\n//\n// The Package plugin OWNS the publishMove cache entries in the\n// substrate's content-addressed cache — those land under the per-stack\n// runtime root at `cache/<namespace>/<chainId>/...` and are auto-captured\n// by the substrate's cache subtree without an explicit subtree decl. We\n// declare a `missingTolerance: 'fine'` shape because:\n//\n// - A restored stack with a missing cache entry simply re-publishes\n// (cache miss). No data loss.\n// - A restored stack with a present cache entry runs the lenient\n// verify probe; if the chain snapshot also restored, the probe\n// resolves the cached id; otherwise it misses and re-publishes.\n//\n// No managed containers — the build container belongs to the Sui\n// plugin (per-app, declared there). The Move build cache lives at\n// `~/.move/git` on the host (NOT in a container) and is intentionally\n// NOT captured: distilled doc §Cross-component references — vendored\n// deps are content-addressed by sui-cli, re-fetched on demand.\n\nimport { Effect } from 'effect';\n\nimport type { SnapshotableDecl } from '../../contracts/snapshotable.ts';\n\n/** Build the Snapshotable contribution.\n *\n * Identity guard: contributes the package's symbolic name + content\n * hash to the pre-restore identity record. A snapshot taken under\n * source-hash A restored against source-hash A is OK (verify probe\n * re-confirms); a mismatch lets the substrate decide (typically:\n * also OK — re-publish). The identity guard is mostly informational\n * here. */\nexport const makeSnapshotable = (packageName: string, sourceHash: string): SnapshotableDecl => ({\n\tkind: 'snapshotable',\n\tsubtrees: [],\n\tmissingTolerance: 'fine',\n\tpreRestore: Effect.succeed({\n\t\tkind: 'package' as const,\n\t\tname: packageName,\n\t\tsourceHash,\n\t}),\n\tpostRestore: Effect.void,\n});\n"],"mappings":";;;;;;;;;;AAqCA,MAAa,oBAAoB,aAAqB,gBAA0C;CAC/F,MAAM;CACN,UAAU,CAAC;CACX,kBAAkB;CAClB,YAAY,OAAO,QAAQ;EAC1B,MAAM;EACN,MAAM;EACN;CACD,CAAC;CACD,aAAa,OAAO;AACrB"}
@@ -1,6 +1,5 @@
1
1
  import { DASHBOARD_ENTRYPOINTS } from "./dashboard/routable.mjs";
2
2
  import { HOST_SERVICE_ENTRYPOINTS } from "./host-service/routable.mjs";
3
- import { POSTGRES_ENTRYPOINTS } from "./postgres/routable.mjs";
4
3
  import { SEAL_ENTRYPOINTS } from "./seal/routable.mjs";
5
4
  import { SUI_ENTRYPOINTS } from "./sui/routable.mjs";
6
5
  import { WALLET_ENTRYPOINTS } from "./wallet/routable.mjs";
@@ -12,8 +11,7 @@ const BUILT_IN_ENTRYPOINTS = [
12
11
  ...HOST_SERVICE_ENTRYPOINTS,
13
12
  ...WALLET_ENTRYPOINTS,
14
13
  ...WALRUS_ENTRYPOINTS,
15
- ...SEAL_ENTRYPOINTS,
16
- ...POSTGRES_ENTRYPOINTS
14
+ ...SEAL_ENTRYPOINTS
17
15
  ];
18
16
  //#endregion
19
17
  export { BUILT_IN_ENTRYPOINTS };
@@ -1 +1 @@
1
- {"version":3,"file":"router-entrypoints.mjs","names":[],"sources":["../../src/plugins/router-entrypoints.ts"],"sourcesContent":["// Built-in plugin router entrypoints.\n//\n// The router orchestrator owns registry validation and collision checks.\n// Built-in plugins own their public listener names and ports.\n\nimport type { EntrypointDecl } from '../contracts/routable.ts';\nimport { DASHBOARD_ENTRYPOINTS } from './dashboard/routable.ts';\nimport { HOST_SERVICE_ENTRYPOINTS } from './host-service/routable.ts';\nimport { POSTGRES_ENTRYPOINTS } from './postgres/routable.ts';\nimport { SEAL_ENTRYPOINTS } from './seal/routable.ts';\nimport { SUI_ENTRYPOINTS } from './sui/routable.ts';\nimport { WALLET_ENTRYPOINTS } from './wallet/routable.ts';\nimport { WALRUS_ENTRYPOINTS } from './walrus/routable.ts';\n\nexport const BUILT_IN_ENTRYPOINTS: ReadonlyArray<EntrypointDecl> = [\n\t...DASHBOARD_ENTRYPOINTS,\n\t...SUI_ENTRYPOINTS,\n\t...HOST_SERVICE_ENTRYPOINTS,\n\t...WALLET_ENTRYPOINTS,\n\t...WALRUS_ENTRYPOINTS,\n\t...SEAL_ENTRYPOINTS,\n\t...POSTGRES_ENTRYPOINTS,\n];\n"],"mappings":";;;;;;;;AAcA,MAAa,uBAAsD;CAClE,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH"}
1
+ {"version":3,"file":"router-entrypoints.mjs","names":[],"sources":["../../src/plugins/router-entrypoints.ts"],"sourcesContent":["// Built-in plugin router entrypoints.\n//\n// The router orchestrator owns registry validation and collision checks.\n// Built-in plugins own their public listener names and ports.\n\nimport type { EntrypointDecl } from '../contracts/routable.ts';\nimport { DASHBOARD_ENTRYPOINTS } from './dashboard/routable.ts';\nimport { HOST_SERVICE_ENTRYPOINTS } from './host-service/routable.ts';\nimport { SEAL_ENTRYPOINTS } from './seal/routable.ts';\nimport { SUI_ENTRYPOINTS } from './sui/routable.ts';\nimport { WALLET_ENTRYPOINTS } from './wallet/routable.ts';\nimport { WALRUS_ENTRYPOINTS } from './walrus/routable.ts';\n\nexport const BUILT_IN_ENTRYPOINTS: ReadonlyArray<EntrypointDecl> = [\n\t...DASHBOARD_ENTRYPOINTS,\n\t...SUI_ENTRYPOINTS,\n\t...HOST_SERVICE_ENTRYPOINTS,\n\t...WALLET_ENTRYPOINTS,\n\t...WALRUS_ENTRYPOINTS,\n\t...SEAL_ENTRYPOINTS,\n];\n"],"mappings":";;;;;;;AAaA,MAAa,uBAAsD;CAClE,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;AACJ"}
@@ -1,6 +1,5 @@
1
1
  import { readEnv } from "../../../substrate/runtime/typed-env.mjs";
2
2
  import { sealError } from "../errors.mjs";
3
- import { SealSpans } from "../spans.mjs";
4
3
  import { DEFAULT_SEAL_REPO, DEFAULT_SEAL_VERSION } from "./source-fetch.mjs";
5
4
  import { Effect } from "effect";
6
5
  import { fileURLToPath } from "node:url";
@@ -48,7 +47,7 @@ const resolveSealCargoImage = (runtime, inputs) => Effect.gen(function* () {
48
47
  message: `seal image build failed: ${cause.reason}: ${cause.detail}. SEAL_VERSION=${inputs.sealRef} (from ${inputs.sealRepo}/releases). Set SEAL_CARGO_IMAGE_OVERRIDE=<tag> to bypass the build.`,
49
48
  cause
50
49
  })));
51
- }).pipe(Effect.withSpan("devstack.plugin.seal.cargoImage.resolve", { attributes: { [SealSpans.ref]: inputs.sealRef } }));
50
+ });
52
51
  /** Convenience: resolve via the default inputs. */
53
52
  const resolveDefaultSealCargoImage = (runtime, owner) => resolveSealCargoImage(runtime, {
54
53
  sealRepo: DEFAULT_SEAL_REPO,
@@ -1 +1 @@
1
- {"version":3,"file":"cargo-image.mjs","names":[],"sources":["../../../../src/plugins/seal/bootstrap-assets/cargo-image.ts"],"sourcesContent":["// Seal vendored-Dockerfile docker image.\n//\n// The upstream seal release ships pre-built `seal-cli` + `key-server`\n// binaries per platform, and our vendored Dockerfile at\n// `images/seal/Dockerfile` just fetches and packages them.\n//\n// Resolution paths (mirror walrus's two-stage dispatch — distilled-doc\n// §\"Pinned upstream version\" + §\"Optional pre-built image tag override\"):\n//\n// (a) `SEAL_CARGO_IMAGE_OVERRIDE` env — points at a pre-baked\n// registry tag (or a locally-tagged image like `seal-test-stub:latest`).\n// Skips the docker build entirely. The on-disk image is\n// content-addressed by the registry; we just thread it through.\n//\n// (b) Real build via `runtime.ensureImage({ contextPath,\n// dockerfile: 'Dockerfile', buildArgs: { SEAL_VERSION } })`\n// against the vendored Dockerfile at `images/seal/`. Mirrors\n// the sui plugin's `resolveImage` shape.\n\nimport { Effect, type Scope } from 'effect';\nimport { fileURLToPath } from 'node:url';\n\nimport type {\n\tContainerBuildContext,\n\tContainerRuntime,\n\tImageRef,\n} from '../../../contracts/container-runtime.ts';\nimport { readEnv } from '../../../substrate/runtime/typed-env.ts';\nimport { sealError, type SealError } from '../errors.ts';\nimport { SealSpans } from '../spans.ts';\nimport { DEFAULT_SEAL_REPO, DEFAULT_SEAL_VERSION } from './source-fetch.ts';\n\n// ---------------------------------------------------------------------------\n/** Inputs to the seal image resolver. */\nexport interface SealCargoImageInputs<Ref extends string = string> {\n\treadonly sealRepo: typeof DEFAULT_SEAL_REPO;\n\treadonly sealRef: Ref;\n\t/** Owner identity stamped on the built image so label-driven prune\n\t * finds it. */\n\treadonly owner: {\n\t\treadonly app: string;\n\t\treadonly stack: string;\n\t};\n}\n\n// ---------------------------------------------------------------------------\n// Runtime resolver\n// ---------------------------------------------------------------------------\n\n/** Resolve the seal image. Two staged paths:\n *\n * (a) `SEAL_CARGO_IMAGE_OVERRIDE` env var — points at a pre-baked\n * registry tag (or a locally-built fixture image like\n * `seal-test-stub:latest`). Skips the docker build entirely\n * and returns a bare `ImageRef` synthesized from the override\n * tag. CI bakes the image once + pins the tag; the local-\n * keygen boot just reads the env.\n *\n * (b) Real build via `runtime.ensureImage` against the vendored\n * Dockerfile at `packages/devstack/images/seal/`. The\n * Dockerfile is a binary-fetch path (NOT a cargo compile) —\n * the seal release workflow ships pre-built per-platform\n * binaries (`seal-cli`, `key-server`) and we just fetch +\n * package them. Build is content-addressed by docker; same\n * Dockerfile + same SEAL_VERSION → same image hash. */\nexport const resolveSealCargoImage = (\n\truntime: ContainerRuntime,\n\tinputs: SealCargoImageInputs,\n): Effect.Effect<ImageRef, SealError, Scope.Scope> =>\n\tEffect.gen(function* () {\n\t\tconst override = readEnv('SEAL_CARGO_IMAGE_OVERRIDE');\n\t\tif (override && override.length > 0) {\n\t\t\t// Trust-the-tag path. Compose the resolved shape from the\n\t\t\t// pinned tag — the digest is opaque (substrate's\n\t\t\t// content-addressed cache will re-resolve via `docker\n\t\t\t// inspect` when it materializes the image).\n\t\t\treturn { digest: override, tag: override } satisfies ImageRef;\n\t\t}\n\t\t// Vendored-Dockerfile path. Same shape as sui's `resolveImage`\n\t\t// (plugins/sui/mode/local.ts:resolveImage). Context is `images/`\n\t\t// (NOT `images/seal/`) so the Dockerfile can `COPY` the shared\n\t\t// `_shared/signal-forward.sh` snippet alongside the seal-specific\n\t\t// entrypoint. The Dockerfile builds in two stages: (1) ubuntu\n\t\t// base, fetch + chmod the per-arch binaries from the seal release\n\t\t// URL; (2) debian:bookworm-slim runtime with the signal-\n\t\t// forwarding entrypoint shell wrapped around `key-server`.\n\t\tconst buildCtx: ContainerBuildContext = {\n\t\t\t// `fileURLToPath` normalises across platforms (Windows\n\t\t\t// `file:///C:/...` → `C:\\...`; POSIX strips the scheme and\n\t\t\t// percent-decodes). Using `.pathname` directly leaves the\n\t\t\t// leading `/` on Windows drive paths.\n\t\t\tcontextPath: fileURLToPath(new URL('../../../../images/', import.meta.url)),\n\t\t\tdockerfile: 'seal/Dockerfile',\n\t\t\tfingerprintPaths: ['seal/Dockerfile', 'seal/entrypoint.sh', '_shared/signal-forward.sh'],\n\t\t\tbuildArgs: { SEAL_VERSION: inputs.sealRef },\n\t\t\towner: {\n\t\t\t\tapp: inputs.owner.app,\n\t\t\t\tstack: inputs.owner.stack,\n\t\t\t\tplugin: 'seal',\n\t\t\t\trole: 'key-server',\n\t\t\t},\n\t\t};\n\t\treturn yield* runtime.ensureImage(buildCtx).pipe(\n\t\t\tEffect.mapError((cause) =>\n\t\t\t\tsealError('image', {\n\t\t\t\t\tname: 'seal',\n\t\t\t\t\tmessage:\n\t\t\t\t\t\t`seal image build failed: ${cause.reason}: ${cause.detail}. ` +\n\t\t\t\t\t\t`SEAL_VERSION=${inputs.sealRef} (from ${inputs.sealRepo}/releases). ` +\n\t\t\t\t\t\t`Set SEAL_CARGO_IMAGE_OVERRIDE=<tag> to bypass the build.`,\n\t\t\t\t\tcause,\n\t\t\t\t}),\n\t\t\t),\n\t\t);\n\t}).pipe(\n\t\tEffect.withSpan('devstack.plugin.seal.cargoImage.resolve', {\n\t\t\tattributes: {\n\t\t\t\t[SealSpans.ref]: inputs.sealRef,\n\t\t\t},\n\t\t}),\n\t);\n\n/** Convenience: resolve via the default inputs. */\nexport const resolveDefaultSealCargoImage = (\n\truntime: ContainerRuntime,\n\towner: SealCargoImageInputs['owner'],\n): Effect.Effect<ImageRef, SealError, Scope.Scope> =>\n\tresolveSealCargoImage(runtime, {\n\t\tsealRepo: DEFAULT_SEAL_REPO,\n\t\tsealRef: DEFAULT_SEAL_VERSION,\n\t\towner,\n\t});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAiEA,MAAa,yBACZ,SACA,WAEA,OAAO,IAAI,aAAa;CACvB,MAAM,WAAW,QAAQ,4BAA4B;AACrD,KAAI,YAAY,SAAS,SAAS,EAKjC,QAAO;EAAE,QAAQ;EAAU,KAAK;EAAU;CAU3C,MAAM,WAAkC;EAKvC,aAAa,cAAc,IAAI,IAAI,uBAAuB,OAAO,KAAK,IAAI,CAAC;EAC3E,YAAY;EACZ,kBAAkB;GAAC;GAAmB;GAAsB;GAA4B;EACxF,WAAW,EAAE,cAAc,OAAO,SAAS;EAC3C,OAAO;GACN,KAAK,OAAO,MAAM;GAClB,OAAO,OAAO,MAAM;GACpB,QAAQ;GACR,MAAM;GACN;EACD;AACD,QAAO,OAAO,QAAQ,YAAY,SAAS,CAAC,KAC3C,OAAO,UAAU,UAChB,UAAU,SAAS;EAClB,MAAM;EACN,SACC,4BAA4B,MAAM,OAAO,IAAI,MAAM,OAAO,iBAC1C,OAAO,QAAQ,SAAS,OAAO,SAAS;EAEzD;EACA,CAAC,CACF,CACD;EACA,CAAC,KACF,OAAO,SAAS,2CAA2C,EAC1D,YAAY,GACV,UAAU,MAAM,OAAO,SACxB,EACD,CAAC,CACF;;AAGF,MAAa,gCACZ,SACA,UAEA,sBAAsB,SAAS;CAC9B,UAAU;CACV,SAAS;CACT;CACA,CAAC"}
1
+ {"version":3,"file":"cargo-image.mjs","names":[],"sources":["../../../../src/plugins/seal/bootstrap-assets/cargo-image.ts"],"sourcesContent":["// Seal vendored-Dockerfile docker image.\n//\n// The upstream seal release ships pre-built `seal-cli` + `key-server`\n// binaries per platform, and our vendored Dockerfile at\n// `images/seal/Dockerfile` just fetches and packages them.\n//\n// Resolution paths (mirror walrus's two-stage dispatch — distilled-doc\n// §\"Pinned upstream version\" + §\"Optional pre-built image tag override\"):\n//\n// (a) `SEAL_CARGO_IMAGE_OVERRIDE` env — points at a pre-baked\n// registry tag (or a locally-tagged image like `seal-test-stub:latest`).\n// Skips the docker build entirely. The on-disk image is\n// content-addressed by the registry; we just thread it through.\n//\n// (b) Real build via `runtime.ensureImage({ contextPath,\n// dockerfile: 'Dockerfile', buildArgs: { SEAL_VERSION } })`\n// against the vendored Dockerfile at `images/seal/`. Mirrors\n// the sui plugin's `resolveImage` shape.\n\nimport { Effect, type Scope } from 'effect';\nimport { fileURLToPath } from 'node:url';\n\nimport type {\n\tContainerBuildContext,\n\tContainerRuntime,\n\tImageRef,\n} from '../../../contracts/container-runtime.ts';\nimport { readEnv } from '../../../substrate/runtime/typed-env.ts';\nimport { sealError, type SealError } from '../errors.ts';\nimport { DEFAULT_SEAL_REPO, DEFAULT_SEAL_VERSION } from './source-fetch.ts';\n\n// ---------------------------------------------------------------------------\n/** Inputs to the seal image resolver. */\nexport interface SealCargoImageInputs<Ref extends string = string> {\n\treadonly sealRepo: typeof DEFAULT_SEAL_REPO;\n\treadonly sealRef: Ref;\n\t/** Owner identity stamped on the built image so label-driven prune\n\t * finds it. */\n\treadonly owner: {\n\t\treadonly app: string;\n\t\treadonly stack: string;\n\t};\n}\n\n// ---------------------------------------------------------------------------\n// Runtime resolver\n// ---------------------------------------------------------------------------\n\n/** Resolve the seal image. Two staged paths:\n *\n * (a) `SEAL_CARGO_IMAGE_OVERRIDE` env var — points at a pre-baked\n * registry tag (or a locally-built fixture image like\n * `seal-test-stub:latest`). Skips the docker build entirely\n * and returns a bare `ImageRef` synthesized from the override\n * tag. CI bakes the image once + pins the tag; the local-\n * keygen boot just reads the env.\n *\n * (b) Real build via `runtime.ensureImage` against the vendored\n * Dockerfile at `packages/devstack/images/seal/`. The\n * Dockerfile is a binary-fetch path (NOT a cargo compile) —\n * the seal release workflow ships pre-built per-platform\n * binaries (`seal-cli`, `key-server`) and we just fetch +\n * package them. Build is content-addressed by docker; same\n * Dockerfile + same SEAL_VERSION → same image hash. */\nexport const resolveSealCargoImage = (\n\truntime: ContainerRuntime,\n\tinputs: SealCargoImageInputs,\n): Effect.Effect<ImageRef, SealError, Scope.Scope> =>\n\tEffect.gen(function* () {\n\t\tconst override = readEnv('SEAL_CARGO_IMAGE_OVERRIDE');\n\t\tif (override && override.length > 0) {\n\t\t\t// Trust-the-tag path. Compose the resolved shape from the\n\t\t\t// pinned tag — the digest is opaque (substrate's\n\t\t\t// content-addressed cache will re-resolve via `docker\n\t\t\t// inspect` when it materializes the image).\n\t\t\treturn { digest: override, tag: override } satisfies ImageRef;\n\t\t}\n\t\t// Vendored-Dockerfile path. Same shape as sui's `resolveImage`\n\t\t// (plugins/sui/mode/local.ts:resolveImage). Context is `images/`\n\t\t// (NOT `images/seal/`) so the Dockerfile can `COPY` the shared\n\t\t// `_shared/signal-forward.sh` snippet alongside the seal-specific\n\t\t// entrypoint. The Dockerfile builds in two stages: (1) ubuntu\n\t\t// base, fetch + chmod the per-arch binaries from the seal release\n\t\t// URL; (2) debian:bookworm-slim runtime with the signal-\n\t\t// forwarding entrypoint shell wrapped around `key-server`.\n\t\tconst buildCtx: ContainerBuildContext = {\n\t\t\t// `fileURLToPath` normalises across platforms (Windows\n\t\t\t// `file:///C:/...` → `C:\\...`; POSIX strips the scheme and\n\t\t\t// percent-decodes). Using `.pathname` directly leaves the\n\t\t\t// leading `/` on Windows drive paths.\n\t\t\tcontextPath: fileURLToPath(new URL('../../../../images/', import.meta.url)),\n\t\t\tdockerfile: 'seal/Dockerfile',\n\t\t\tfingerprintPaths: ['seal/Dockerfile', 'seal/entrypoint.sh', '_shared/signal-forward.sh'],\n\t\t\tbuildArgs: { SEAL_VERSION: inputs.sealRef },\n\t\t\towner: {\n\t\t\t\tapp: inputs.owner.app,\n\t\t\t\tstack: inputs.owner.stack,\n\t\t\t\tplugin: 'seal',\n\t\t\t\trole: 'key-server',\n\t\t\t},\n\t\t};\n\t\treturn yield* runtime.ensureImage(buildCtx).pipe(\n\t\t\tEffect.mapError((cause) =>\n\t\t\t\tsealError('image', {\n\t\t\t\t\tname: 'seal',\n\t\t\t\t\tmessage:\n\t\t\t\t\t\t`seal image build failed: ${cause.reason}: ${cause.detail}. ` +\n\t\t\t\t\t\t`SEAL_VERSION=${inputs.sealRef} (from ${inputs.sealRepo}/releases). ` +\n\t\t\t\t\t\t`Set SEAL_CARGO_IMAGE_OVERRIDE=<tag> to bypass the build.`,\n\t\t\t\t\tcause,\n\t\t\t\t}),\n\t\t\t),\n\t\t);\n\t});\n\n/** Convenience: resolve via the default inputs. */\nexport const resolveDefaultSealCargoImage = (\n\truntime: ContainerRuntime,\n\towner: SealCargoImageInputs['owner'],\n): Effect.Effect<ImageRef, SealError, Scope.Scope> =>\n\tresolveSealCargoImage(runtime, {\n\t\tsealRepo: DEFAULT_SEAL_REPO,\n\t\tsealRef: DEFAULT_SEAL_VERSION,\n\t\towner,\n\t});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAgEA,MAAa,yBACZ,SACA,WAEA,OAAO,IAAI,aAAa;CACvB,MAAM,WAAW,QAAQ,2BAA2B;CACpD,IAAI,YAAY,SAAS,SAAS,GAKjC,OAAO;EAAE,QAAQ;EAAU,KAAK;CAAS;CAU1C,MAAM,WAAkC;EAKvC,aAAa,cAAc,IAAI,IAAI,uBAAuB,OAAO,KAAK,GAAG,CAAC;EAC1E,YAAY;EACZ,kBAAkB;GAAC;GAAmB;GAAsB;EAA2B;EACvF,WAAW,EAAE,cAAc,OAAO,QAAQ;EAC1C,OAAO;GACN,KAAK,OAAO,MAAM;GAClB,OAAO,OAAO,MAAM;GACpB,QAAQ;GACR,MAAM;EACP;CACD;CACA,OAAO,OAAO,QAAQ,YAAY,QAAQ,CAAC,CAAC,KAC3C,OAAO,UAAU,UAChB,UAAU,SAAS;EAClB,MAAM;EACN,SACC,4BAA4B,MAAM,OAAO,IAAI,MAAM,OAAO,iBAC1C,OAAO,QAAQ,SAAS,OAAO,SAAS;EAEzD;CACD,CAAC,CACF,CACD;AACD,CAAC;;AAGF,MAAa,gCACZ,SACA,UAEA,sBAAsB,SAAS;CAC9B,UAAU;CACV,SAAS;CACT;AACD,CAAC"}
@@ -5,7 +5,6 @@ import { stageAndSwap } from "../../../substrate/runtime/stage-and-swap/index.mj
5
5
  import { hostBindMountOwner } from "../../../substrate/runtime/host-bind-mount-owner.mjs";
6
6
  import { readEnv } from "../../../substrate/runtime/typed-env.mjs";
7
7
  import { sealError } from "../errors.mjs";
8
- import { SealSpans } from "../spans.mjs";
9
8
  import { Effect, FileSystem, Path } from "effect";
10
9
  //#region src/plugins/seal/bootstrap-assets/source-fetch.ts
11
10
  /** Default upstream repo URL — distilled doc §"External" reference. */
@@ -111,11 +110,7 @@ const resolveSealSource = (runtime, inputs) => Effect.gen(function* () {
111
110
  subdir: inputs.subdir,
112
111
  path: subdirPath
113
112
  };
114
- }).pipe(Effect.withSpan("devstack.plugin.seal.moveSource.resolve", { attributes: {
115
- [SealSpans.repo]: inputs.repo,
116
- [SealSpans.ref]: inputs.ref,
117
- [SealSpans.subdir]: inputs.subdir
118
- } }));
113
+ });
119
114
  /** Convenience: resolve via the default inputs. */
120
115
  const resolveDefaultSealSource = (runtime) => resolveSealSource(runtime, {
121
116
  repo: DEFAULT_SEAL_REPO,
@@ -1 +1 @@
1
- {"version":3,"file":"source-fetch.mjs","names":[],"sources":["../../../../src/plugins/seal/bootstrap-assets/source-fetch.ts"],"sourcesContent":["// Seal git-fetched source tree.\n//\n// Resolution paths (mirror walrus's three-stage dispatch):\n//\n// (a) Caller-pinned `movePackagePath` opt — local-keygen mode\n// short-circuits before calling this resolver.\n//\n// (b) `SEAL_MOVE_SOURCE_OVERRIDE` env var — points at a pre-fetched\n// on-disk path. Trust-the-path; no I/O. Useful in CI where the\n// repo is checked out once and reused.\n//\n// (c) Real git fetch via `runtime.runOneShot({ image: 'alpine/git:2.52.0',\n// mounts: [stagingDir→/out], argv: ['clone',...] })`, staged\n// into the per-host source cache before returning the host\n// `move/seal` subdir.\n\nimport { Effect, FileSystem, Path, type Scope } from 'effect';\n\nimport type { ContainerRuntime } from '../../../contracts/container-runtime.ts';\nimport { hostBindMountOwner } from '../../../substrate/runtime/host-bind-mount-owner.ts';\nimport { mintRandomSuffix } from '../../../substrate/runtime/random-suffix.ts';\nimport { tailOutput } from '../../../substrate/runtime/observability/index.ts';\nimport { stageAndSwap } from '../../../substrate/runtime/stage-and-swap/index.ts';\nimport { readEnv } from '../../../substrate/runtime/typed-env.ts';\nimport { sealError, type SealError } from '../errors.ts';\nimport { SealSpans } from '../spans.ts';\n\n// ---------------------------------------------------------------------------\n// Constants — distilled-doc §\"External / upstream sources\"\n// ---------------------------------------------------------------------------\n\n/** Default upstream repo URL — distilled doc §\"External\" reference. */\nexport const DEFAULT_SEAL_REPO = 'https://github.com/MystenLabs/seal' as const;\n\n/** Pinned default ref. Distilled-doc invariant #11: this MUST match\n * the cargo binary's version (the Dockerfile's `SEAL_VERSION` build\n * arg). They move in lockstep. */\nexport const DEFAULT_SEAL_VERSION = 'seal-v0.6.6' as const;\n\n/** Subdirectory containing the Move package. */\nexport const DEFAULT_SEAL_MOVE_SUBDIR = 'move/seal' as const;\n\n/** Pinned helper image for the git clone one-shot. `alpine/git`\n * uses `git` as its entrypoint, so the clone argv starts at\n * `clone`. */\nexport const SEAL_SOURCE_FETCH_IMAGE = 'alpine/git:2.52.0' as const;\n\nconst SEAL_SOURCE_FETCH_TIMEOUT_MS = 5 * 60_000;\n\n// ---------------------------------------------------------------------------\n// Resolved value\n// ---------------------------------------------------------------------------\n\n/** Resolved value for the cloned `move/seal` subdir. The local-keygen\n * mode's acquire body threads this into `publishSealPackage(...)`. */\nexport interface SealSourceFetchResolved {\n\treadonly repo: string;\n\treadonly ref: string;\n\treadonly subdir: string;\n\treadonly path: string;\n}\n\n// ---------------------------------------------------------------------------\n// Runtime resolver\n// ---------------------------------------------------------------------------\n\n/** Inputs to the source resolver. */\nexport interface SealSourceFetchInputs<Ref extends string = string> {\n\treadonly repo: typeof DEFAULT_SEAL_REPO;\n\treadonly ref: Ref;\n\treadonly subdir: typeof DEFAULT_SEAL_MOVE_SUBDIR;\n}\n\nconst nextScratchPaths = (\n\tcacheDir: string,\n): { readonly stagingPath: string; readonly backupPath: string } => {\n\t// 16-char crypto suffix (STYLE_GUIDE §17) — the old\n\t// `pid.counter` scheme collided across two concurrent PROCESSES\n\t// fetching the same ref (counters reset per-process, so pid A's\n\t// `.staging.1` and pid B's `.staging.1` differ only by pid, and\n\t// the staging tree corrupts if a pid is reused). A random suffix\n\t// makes overlap cryptographically negligible regardless of pid.\n\tconst suffix = mintRandomSuffix(16);\n\treturn {\n\t\tstagingPath: `${cacheDir}.staging.${suffix}`,\n\t\tbackupPath: `${cacheDir}.backup.${suffix}`,\n\t};\n};\n\nexport const sealSourceCacheDir = (ref: string): string => {\n\tconst home = readEnv('HOME') ?? '/tmp';\n\treturn `${home}/.cache/devstack/seal-src/${encodeURIComponent(ref)}`;\n};\n\nexport const sealSourcePublishLockPath = (ref: string): string =>\n\t`${sealSourceCacheDir(ref)}.publish.lock`;\n\nconst sourceImageRef = { digest: SEAL_SOURCE_FETCH_IMAGE, tag: SEAL_SOURCE_FETCH_IMAGE } as const;\n\nexport const resolveSealSource = (\n\truntime: ContainerRuntime,\n\tinputs: SealSourceFetchInputs,\n): Effect.Effect<\n\tSealSourceFetchResolved,\n\tSealError,\n\tScope.Scope | FileSystem.FileSystem | Path.Path\n> =>\n\tEffect.gen(function* () {\n\t\tconst override = readEnv('SEAL_MOVE_SOURCE_OVERRIDE');\n\t\tif (override && override.length > 0) {\n\t\t\treturn {\n\t\t\t\trepo: inputs.repo,\n\t\t\t\tref: inputs.ref,\n\t\t\t\tsubdir: inputs.subdir,\n\t\t\t\tpath: override,\n\t\t\t} satisfies SealSourceFetchResolved;\n\t\t}\n\n\t\tconst fs = yield* FileSystem.FileSystem;\n\t\tconst path = yield* Path.Path;\n\t\tconst cacheDir = sealSourceCacheDir(inputs.ref);\n\t\tconst subdirPath = path.join(cacheDir, inputs.subdir);\n\t\tconst cached = yield* fs.exists(subdirPath).pipe(Effect.catch(() => Effect.succeed(false)));\n\t\tif (cached) {\n\t\t\treturn {\n\t\t\t\trepo: inputs.repo,\n\t\t\t\tref: inputs.ref,\n\t\t\t\tsubdir: inputs.subdir,\n\t\t\t\tpath: subdirPath,\n\t\t\t} satisfies SealSourceFetchResolved;\n\t\t}\n\n\t\tconst { stagingPath, backupPath } = nextScratchPaths(cacheDir);\n\t\tyield* stageAndSwap({\n\t\t\ttargetPath: cacheDir,\n\t\t\tstagingPath,\n\t\t\tbackupPath,\n\t\t\tbuild: Effect.gen(function* () {\n\t\t\t\tconst result = yield* Effect.scoped(\n\t\t\t\t\truntime\n\t\t\t\t\t\t.runOneShot({\n\t\t\t\t\t\t\timage: sourceImageRef,\n\t\t\t\t\t\t\tentrypoint: 'git',\n\t\t\t\t\t\t\tuser: hostBindMountOwner(),\n\t\t\t\t\t\t\targv: ['clone', '--depth', '1', '--branch', inputs.ref, inputs.repo, '/out'],\n\t\t\t\t\t\t\tmounts: [{ source: stagingPath, target: '/out' }],\n\t\t\t\t\t\t\ttimeoutMillis: SEAL_SOURCE_FETCH_TIMEOUT_MS,\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.pipe(\n\t\t\t\t\t\t\tEffect.mapError((cause) =>\n\t\t\t\t\t\t\t\tsealError('image', {\n\t\t\t\t\t\t\t\t\tname: 'seal',\n\t\t\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t\t\t`seal move-source: git clone one-shot failed: ${cause.reason}: ${cause.detail}. ` +\n\t\t\t\t\t\t\t\t\t\t`Set SEAL_MOVE_SOURCE_OVERRIDE=<path> or pass movePackagePath to bypass.`,\n\t\t\t\t\t\t\t\t\tcause,\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t);\n\n\t\t\t\tif (result.exitCode !== 0) {\n\t\t\t\t\treturn yield* Effect.fail(\n\t\t\t\t\t\tsealError('image', {\n\t\t\t\t\t\t\tname: 'seal',\n\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t`seal move-source: git clone exited ${result.exitCode}. ` +\n\t\t\t\t\t\t\t\t`Set SEAL_MOVE_SOURCE_OVERRIDE=<path> or pass movePackagePath to bypass.`,\n\t\t\t\t\t\t\texitCode: result.exitCode,\n\t\t\t\t\t\t\tstdout: tailOutput(result.stdout),\n\t\t\t\t\t\t\tstderr: tailOutput(result.stderr),\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst stagedSubdir = path.join(stagingPath, inputs.subdir);\n\t\t\t\tconst stagedSubdirExists = yield* fs\n\t\t\t\t\t.exists(stagedSubdir)\n\t\t\t\t\t.pipe(Effect.catch(() => Effect.succeed(false)));\n\t\t\t\tif (!stagedSubdirExists) {\n\t\t\t\t\treturn yield* Effect.fail(\n\t\t\t\t\t\tsealError('image', {\n\t\t\t\t\t\t\tname: 'seal',\n\t\t\t\t\t\t\tmessage: `seal move-source: clone completed but ${inputs.subdir} was missing from ${inputs.repo}@${inputs.ref}.`,\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}),\n\t\t\tpublishLockPath: sealSourcePublishLockPath(inputs.ref),\n\t\t}).pipe(\n\t\t\tEffect.mapError((cause): SealError => {\n\t\t\t\tif (cause._tag === 'SealError') return cause;\n\t\t\t\treturn sealError('image', {\n\t\t\t\t\tname: 'seal',\n\t\t\t\t\tmessage: `seal move-source: cache publish failed at ${cause.stage}`,\n\t\t\t\t\tcause,\n\t\t\t\t});\n\t\t\t}),\n\t\t);\n\n\t\treturn {\n\t\t\trepo: inputs.repo,\n\t\t\tref: inputs.ref,\n\t\t\tsubdir: inputs.subdir,\n\t\t\tpath: subdirPath,\n\t\t} satisfies SealSourceFetchResolved;\n\t}).pipe(\n\t\tEffect.withSpan('devstack.plugin.seal.moveSource.resolve', {\n\t\t\tattributes: {\n\t\t\t\t[SealSpans.repo]: inputs.repo,\n\t\t\t\t[SealSpans.ref]: inputs.ref,\n\t\t\t\t[SealSpans.subdir]: inputs.subdir,\n\t\t\t},\n\t\t}),\n\t);\n\n/** Convenience: resolve via the default inputs. */\nexport const resolveDefaultSealSource = (\n\truntime: ContainerRuntime,\n): Effect.Effect<\n\tSealSourceFetchResolved,\n\tSealError,\n\tScope.Scope | FileSystem.FileSystem | Path.Path\n> =>\n\tresolveSealSource(runtime, {\n\t\trepo: DEFAULT_SEAL_REPO,\n\t\tref: DEFAULT_SEAL_VERSION,\n\t\tsubdir: DEFAULT_SEAL_MOVE_SUBDIR,\n\t});\n"],"mappings":";;;;;;;;;;;AAgCA,MAAa,oBAAoB;;;;AAKjC,MAAa,uBAAuB;;AAGpC,MAAa,2BAA2B;;;;AAKxC,MAAa,0BAA0B;AAEvC,MAAM,+BAA+B,IAAI;AA0BzC,MAAM,oBACL,aACmE;CAOnE,MAAM,SAAS,iBAAiB,GAAG;AACnC,QAAO;EACN,aAAa,GAAG,SAAS,WAAW;EACpC,YAAY,GAAG,SAAS,UAAU;EAClC;;AAGF,MAAa,sBAAsB,QAAwB;AAE1D,QAAO,GADM,QAAQ,OAAO,IAAI,OACjB,4BAA4B,mBAAmB,IAAI;;AAGnE,MAAa,6BAA6B,QACzC,GAAG,mBAAmB,IAAI,CAAC;AAE5B,MAAM,iBAAiB;CAAE,QAAQ;CAAyB,KAAK;CAAyB;AAExF,MAAa,qBACZ,SACA,WAMA,OAAO,IAAI,aAAa;CACvB,MAAM,WAAW,QAAQ,4BAA4B;AACrD,KAAI,YAAY,SAAS,SAAS,EACjC,QAAO;EACN,MAAM,OAAO;EACb,KAAK,OAAO;EACZ,QAAQ,OAAO;EACf,MAAM;EACN;CAGF,MAAM,KAAK,OAAO,WAAW;CAC7B,MAAM,OAAO,OAAO,KAAK;CACzB,MAAM,WAAW,mBAAmB,OAAO,IAAI;CAC/C,MAAM,aAAa,KAAK,KAAK,UAAU,OAAO,OAAO;AAErD,KAAI,OADkB,GAAG,OAAO,WAAW,CAAC,KAAK,OAAO,YAAY,OAAO,QAAQ,MAAM,CAAC,CAAC,CAE1F,QAAO;EACN,MAAM,OAAO;EACb,KAAK,OAAO;EACZ,QAAQ,OAAO;EACf,MAAM;EACN;CAGF,MAAM,EAAE,aAAa,eAAe,iBAAiB,SAAS;AAC9D,QAAO,aAAa;EACnB,YAAY;EACZ;EACA;EACA,OAAO,OAAO,IAAI,aAAa;GAC9B,MAAM,SAAS,OAAO,OAAO,OAC5B,QACE,WAAW;IACX,OAAO;IACP,YAAY;IACZ,MAAM,oBAAoB;IAC1B,MAAM;KAAC;KAAS;KAAW;KAAK;KAAY,OAAO;KAAK,OAAO;KAAM;KAAO;IAC5E,QAAQ,CAAC;KAAE,QAAQ;KAAa,QAAQ;KAAQ,CAAC;IACjD,eAAe;IACf,CAAC,CACD,KACA,OAAO,UAAU,UAChB,UAAU,SAAS;IAClB,MAAM;IACN,SACC,gDAAgD,MAAM,OAAO,IAAI,MAAM,OAAO;IAE/E;IACA,CAAC,CACF,CACD,CACF;AAED,OAAI,OAAO,aAAa,EACvB,QAAO,OAAO,OAAO,KACpB,UAAU,SAAS;IAClB,MAAM;IACN,SACC,sCAAsC,OAAO,SAAS;IAEvD,UAAU,OAAO;IACjB,QAAQ,WAAW,OAAO,OAAO;IACjC,QAAQ,WAAW,OAAO,OAAO;IACjC,CAAC,CACF;GAGF,MAAM,eAAe,KAAK,KAAK,aAAa,OAAO,OAAO;AAI1D,OAAI,EAAC,OAH6B,GAChC,OAAO,aAAa,CACpB,KAAK,OAAO,YAAY,OAAO,QAAQ,MAAM,CAAC,CAAC,EAEhD,QAAO,OAAO,OAAO,KACpB,UAAU,SAAS;IAClB,MAAM;IACN,SAAS,yCAAyC,OAAO,OAAO,oBAAoB,OAAO,KAAK,GAAG,OAAO,IAAI;IAC9G,CAAC,CACF;IAED;EACF,iBAAiB,0BAA0B,OAAO,IAAI;EACtD,CAAC,CAAC,KACF,OAAO,UAAU,UAAqB;AACrC,MAAI,MAAM,SAAS,YAAa,QAAO;AACvC,SAAO,UAAU,SAAS;GACzB,MAAM;GACN,SAAS,6CAA6C,MAAM;GAC5D;GACA,CAAC;GACD,CACF;AAED,QAAO;EACN,MAAM,OAAO;EACb,KAAK,OAAO;EACZ,QAAQ,OAAO;EACf,MAAM;EACN;EACA,CAAC,KACF,OAAO,SAAS,2CAA2C,EAC1D,YAAY;EACV,UAAU,OAAO,OAAO;EACxB,UAAU,MAAM,OAAO;EACvB,UAAU,SAAS,OAAO;CAC3B,EACD,CAAC,CACF;;AAGF,MAAa,4BACZ,YAMA,kBAAkB,SAAS;CAC1B,MAAM;CACN,KAAK;CACL,QAAQ;CACR,CAAC"}
1
+ {"version":3,"file":"source-fetch.mjs","names":[],"sources":["../../../../src/plugins/seal/bootstrap-assets/source-fetch.ts"],"sourcesContent":["// Seal git-fetched source tree.\n//\n// Resolution paths (mirror walrus's three-stage dispatch):\n//\n// (a) Caller-pinned `movePackagePath` opt — local-keygen mode\n// short-circuits before calling this resolver.\n//\n// (b) `SEAL_MOVE_SOURCE_OVERRIDE` env var — points at a pre-fetched\n// on-disk path. Trust-the-path; no I/O. Useful in CI where the\n// repo is checked out once and reused.\n//\n// (c) Real git fetch via `runtime.runOneShot({ image: 'alpine/git:2.52.0',\n// mounts: [stagingDir→/out], argv: ['clone',...] })`, staged\n// into the per-host source cache before returning the host\n// `move/seal` subdir.\n\nimport { Effect, FileSystem, Path, type Scope } from 'effect';\n\nimport type { ContainerRuntime } from '../../../contracts/container-runtime.ts';\nimport { hostBindMountOwner } from '../../../substrate/runtime/host-bind-mount-owner.ts';\nimport { mintRandomSuffix } from '../../../substrate/runtime/random-suffix.ts';\nimport { tailOutput } from '../../../substrate/runtime/observability/index.ts';\nimport { stageAndSwap } from '../../../substrate/runtime/stage-and-swap/index.ts';\nimport { readEnv } from '../../../substrate/runtime/typed-env.ts';\nimport { sealError, type SealError } from '../errors.ts';\n\n// ---------------------------------------------------------------------------\n// Constants — distilled-doc §\"External / upstream sources\"\n// ---------------------------------------------------------------------------\n\n/** Default upstream repo URL — distilled doc §\"External\" reference. */\nexport const DEFAULT_SEAL_REPO = 'https://github.com/MystenLabs/seal' as const;\n\n/** Pinned default ref. Distilled-doc invariant #11: this MUST match\n * the cargo binary's version (the Dockerfile's `SEAL_VERSION` build\n * arg). They move in lockstep. */\nexport const DEFAULT_SEAL_VERSION = 'seal-v0.6.6' as const;\n\n/** Subdirectory containing the Move package. */\nexport const DEFAULT_SEAL_MOVE_SUBDIR = 'move/seal' as const;\n\n/** Pinned helper image for the git clone one-shot. `alpine/git`\n * uses `git` as its entrypoint, so the clone argv starts at\n * `clone`. */\nexport const SEAL_SOURCE_FETCH_IMAGE = 'alpine/git:2.52.0' as const;\n\nconst SEAL_SOURCE_FETCH_TIMEOUT_MS = 5 * 60_000;\n\n// ---------------------------------------------------------------------------\n// Resolved value\n// ---------------------------------------------------------------------------\n\n/** Resolved value for the cloned `move/seal` subdir. The local-keygen\n * mode's acquire body threads this into `publishSealPackage(...)`. */\nexport interface SealSourceFetchResolved {\n\treadonly repo: string;\n\treadonly ref: string;\n\treadonly subdir: string;\n\treadonly path: string;\n}\n\n// ---------------------------------------------------------------------------\n// Runtime resolver\n// ---------------------------------------------------------------------------\n\n/** Inputs to the source resolver. */\nexport interface SealSourceFetchInputs<Ref extends string = string> {\n\treadonly repo: typeof DEFAULT_SEAL_REPO;\n\treadonly ref: Ref;\n\treadonly subdir: typeof DEFAULT_SEAL_MOVE_SUBDIR;\n}\n\nconst nextScratchPaths = (\n\tcacheDir: string,\n): { readonly stagingPath: string; readonly backupPath: string } => {\n\t// 16-char crypto suffix (STYLE_GUIDE §17) — the old\n\t// `pid.counter` scheme collided across two concurrent PROCESSES\n\t// fetching the same ref (counters reset per-process, so pid A's\n\t// `.staging.1` and pid B's `.staging.1` differ only by pid, and\n\t// the staging tree corrupts if a pid is reused). A random suffix\n\t// makes overlap cryptographically negligible regardless of pid.\n\tconst suffix = mintRandomSuffix(16);\n\treturn {\n\t\tstagingPath: `${cacheDir}.staging.${suffix}`,\n\t\tbackupPath: `${cacheDir}.backup.${suffix}`,\n\t};\n};\n\nexport const sealSourceCacheDir = (ref: string): string => {\n\tconst home = readEnv('HOME') ?? '/tmp';\n\treturn `${home}/.cache/devstack/seal-src/${encodeURIComponent(ref)}`;\n};\n\nexport const sealSourcePublishLockPath = (ref: string): string =>\n\t`${sealSourceCacheDir(ref)}.publish.lock`;\n\nconst sourceImageRef = { digest: SEAL_SOURCE_FETCH_IMAGE, tag: SEAL_SOURCE_FETCH_IMAGE } as const;\n\nexport const resolveSealSource = (\n\truntime: ContainerRuntime,\n\tinputs: SealSourceFetchInputs,\n): Effect.Effect<\n\tSealSourceFetchResolved,\n\tSealError,\n\tScope.Scope | FileSystem.FileSystem | Path.Path\n> =>\n\tEffect.gen(function* () {\n\t\tconst override = readEnv('SEAL_MOVE_SOURCE_OVERRIDE');\n\t\tif (override && override.length > 0) {\n\t\t\treturn {\n\t\t\t\trepo: inputs.repo,\n\t\t\t\tref: inputs.ref,\n\t\t\t\tsubdir: inputs.subdir,\n\t\t\t\tpath: override,\n\t\t\t} satisfies SealSourceFetchResolved;\n\t\t}\n\n\t\tconst fs = yield* FileSystem.FileSystem;\n\t\tconst path = yield* Path.Path;\n\t\tconst cacheDir = sealSourceCacheDir(inputs.ref);\n\t\tconst subdirPath = path.join(cacheDir, inputs.subdir);\n\t\tconst cached = yield* fs.exists(subdirPath).pipe(Effect.catch(() => Effect.succeed(false)));\n\t\tif (cached) {\n\t\t\treturn {\n\t\t\t\trepo: inputs.repo,\n\t\t\t\tref: inputs.ref,\n\t\t\t\tsubdir: inputs.subdir,\n\t\t\t\tpath: subdirPath,\n\t\t\t} satisfies SealSourceFetchResolved;\n\t\t}\n\n\t\tconst { stagingPath, backupPath } = nextScratchPaths(cacheDir);\n\t\tyield* stageAndSwap({\n\t\t\ttargetPath: cacheDir,\n\t\t\tstagingPath,\n\t\t\tbackupPath,\n\t\t\tbuild: Effect.gen(function* () {\n\t\t\t\tconst result = yield* Effect.scoped(\n\t\t\t\t\truntime\n\t\t\t\t\t\t.runOneShot({\n\t\t\t\t\t\t\timage: sourceImageRef,\n\t\t\t\t\t\t\tentrypoint: 'git',\n\t\t\t\t\t\t\tuser: hostBindMountOwner(),\n\t\t\t\t\t\t\targv: ['clone', '--depth', '1', '--branch', inputs.ref, inputs.repo, '/out'],\n\t\t\t\t\t\t\tmounts: [{ source: stagingPath, target: '/out' }],\n\t\t\t\t\t\t\ttimeoutMillis: SEAL_SOURCE_FETCH_TIMEOUT_MS,\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.pipe(\n\t\t\t\t\t\t\tEffect.mapError((cause) =>\n\t\t\t\t\t\t\t\tsealError('image', {\n\t\t\t\t\t\t\t\t\tname: 'seal',\n\t\t\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t\t\t`seal move-source: git clone one-shot failed: ${cause.reason}: ${cause.detail}. ` +\n\t\t\t\t\t\t\t\t\t\t`Set SEAL_MOVE_SOURCE_OVERRIDE=<path> or pass movePackagePath to bypass.`,\n\t\t\t\t\t\t\t\t\tcause,\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t);\n\n\t\t\t\tif (result.exitCode !== 0) {\n\t\t\t\t\treturn yield* Effect.fail(\n\t\t\t\t\t\tsealError('image', {\n\t\t\t\t\t\t\tname: 'seal',\n\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t`seal move-source: git clone exited ${result.exitCode}. ` +\n\t\t\t\t\t\t\t\t`Set SEAL_MOVE_SOURCE_OVERRIDE=<path> or pass movePackagePath to bypass.`,\n\t\t\t\t\t\t\texitCode: result.exitCode,\n\t\t\t\t\t\t\tstdout: tailOutput(result.stdout),\n\t\t\t\t\t\t\tstderr: tailOutput(result.stderr),\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst stagedSubdir = path.join(stagingPath, inputs.subdir);\n\t\t\t\tconst stagedSubdirExists = yield* fs\n\t\t\t\t\t.exists(stagedSubdir)\n\t\t\t\t\t.pipe(Effect.catch(() => Effect.succeed(false)));\n\t\t\t\tif (!stagedSubdirExists) {\n\t\t\t\t\treturn yield* Effect.fail(\n\t\t\t\t\t\tsealError('image', {\n\t\t\t\t\t\t\tname: 'seal',\n\t\t\t\t\t\t\tmessage: `seal move-source: clone completed but ${inputs.subdir} was missing from ${inputs.repo}@${inputs.ref}.`,\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}),\n\t\t\tpublishLockPath: sealSourcePublishLockPath(inputs.ref),\n\t\t}).pipe(\n\t\t\tEffect.mapError((cause): SealError => {\n\t\t\t\tif (cause._tag === 'SealError') return cause;\n\t\t\t\treturn sealError('image', {\n\t\t\t\t\tname: 'seal',\n\t\t\t\t\tmessage: `seal move-source: cache publish failed at ${cause.stage}`,\n\t\t\t\t\tcause,\n\t\t\t\t});\n\t\t\t}),\n\t\t);\n\n\t\treturn {\n\t\t\trepo: inputs.repo,\n\t\t\tref: inputs.ref,\n\t\t\tsubdir: inputs.subdir,\n\t\t\tpath: subdirPath,\n\t\t} satisfies SealSourceFetchResolved;\n\t});\n\n/** Convenience: resolve via the default inputs. */\nexport const resolveDefaultSealSource = (\n\truntime: ContainerRuntime,\n): Effect.Effect<\n\tSealSourceFetchResolved,\n\tSealError,\n\tScope.Scope | FileSystem.FileSystem | Path.Path\n> =>\n\tresolveSealSource(runtime, {\n\t\trepo: DEFAULT_SEAL_REPO,\n\t\tref: DEFAULT_SEAL_VERSION,\n\t\tsubdir: DEFAULT_SEAL_MOVE_SUBDIR,\n\t});\n"],"mappings":";;;;;;;;;;AA+BA,MAAa,oBAAoB;;;;AAKjC,MAAa,uBAAuB;;AAGpC,MAAa,2BAA2B;;;;AAKxC,MAAa,0BAA0B;AAEvC,MAAM,+BAA+B,IAAI;AA0BzC,MAAM,oBACL,aACmE;CAOnE,MAAM,SAAS,iBAAiB,EAAE;CAClC,OAAO;EACN,aAAa,GAAG,SAAS,WAAW;EACpC,YAAY,GAAG,SAAS,UAAU;CACnC;AACD;AAEA,MAAa,sBAAsB,QAAwB;CAE1D,OAAO,GADM,QAAQ,MAAM,KAAK,OACjB,4BAA4B,mBAAmB,GAAG;AAClE;AAEA,MAAa,6BAA6B,QACzC,GAAG,mBAAmB,GAAG,EAAE;AAE5B,MAAM,iBAAiB;CAAE,QAAQ;CAAyB,KAAK;AAAwB;AAEvF,MAAa,qBACZ,SACA,WAMA,OAAO,IAAI,aAAa;CACvB,MAAM,WAAW,QAAQ,2BAA2B;CACpD,IAAI,YAAY,SAAS,SAAS,GACjC,OAAO;EACN,MAAM,OAAO;EACb,KAAK,OAAO;EACZ,QAAQ,OAAO;EACf,MAAM;CACP;CAGD,MAAM,KAAK,OAAO,WAAW;CAC7B,MAAM,OAAO,OAAO,KAAK;CACzB,MAAM,WAAW,mBAAmB,OAAO,GAAG;CAC9C,MAAM,aAAa,KAAK,KAAK,UAAU,OAAO,MAAM;CAEpD,IAAI,OADkB,GAAG,OAAO,UAAU,CAAC,CAAC,KAAK,OAAO,YAAY,OAAO,QAAQ,KAAK,CAAC,CAAC,GAEzF,OAAO;EACN,MAAM,OAAO;EACb,KAAK,OAAO;EACZ,QAAQ,OAAO;EACf,MAAM;CACP;CAGD,MAAM,EAAE,aAAa,eAAe,iBAAiB,QAAQ;CAC7D,OAAO,aAAa;EACnB,YAAY;EACZ;EACA;EACA,OAAO,OAAO,IAAI,aAAa;GAC9B,MAAM,SAAS,OAAO,OAAO,OAC5B,QACE,WAAW;IACX,OAAO;IACP,YAAY;IACZ,MAAM,mBAAmB;IACzB,MAAM;KAAC;KAAS;KAAW;KAAK;KAAY,OAAO;KAAK,OAAO;KAAM;IAAM;IAC3E,QAAQ,CAAC;KAAE,QAAQ;KAAa,QAAQ;IAAO,CAAC;IAChD,eAAe;GAChB,CAAC,CAAC,CACD,KACA,OAAO,UAAU,UAChB,UAAU,SAAS;IAClB,MAAM;IACN,SACC,gDAAgD,MAAM,OAAO,IAAI,MAAM,OAAO;IAE/E;GACD,CAAC,CACF,CACD,CACF;GAEA,IAAI,OAAO,aAAa,GACvB,OAAO,OAAO,OAAO,KACpB,UAAU,SAAS;IAClB,MAAM;IACN,SACC,sCAAsC,OAAO,SAAS;IAEvD,UAAU,OAAO;IACjB,QAAQ,WAAW,OAAO,MAAM;IAChC,QAAQ,WAAW,OAAO,MAAM;GACjC,CAAC,CACF;GAGD,MAAM,eAAe,KAAK,KAAK,aAAa,OAAO,MAAM;GAIzD,IAAI,EAAC,OAH6B,GAChC,OAAO,YAAY,CAAC,CACpB,KAAK,OAAO,YAAY,OAAO,QAAQ,KAAK,CAAC,CAAC,IAE/C,OAAO,OAAO,OAAO,KACpB,UAAU,SAAS;IAClB,MAAM;IACN,SAAS,yCAAyC,OAAO,OAAO,oBAAoB,OAAO,KAAK,GAAG,OAAO,IAAI;GAC/G,CAAC,CACF;EAEF,CAAC;EACD,iBAAiB,0BAA0B,OAAO,GAAG;CACtD,CAAC,CAAC,CAAC,KACF,OAAO,UAAU,UAAqB;EACrC,IAAI,MAAM,SAAS,aAAa,OAAO;EACvC,OAAO,UAAU,SAAS;GACzB,MAAM;GACN,SAAS,6CAA6C,MAAM;GAC5D;EACD,CAAC;CACF,CAAC,CACF;CAEA,OAAO;EACN,MAAM,OAAO;EACb,KAAK,OAAO;EACZ,QAAQ,OAAO;EACf,MAAM;CACP;AACD,CAAC;;AAGF,MAAa,4BACZ,YAMA,kBAAkB,SAAS;CAC1B,MAAM;CACN,KAAK;CACL,QAAQ;AACT,CAAC"}
@@ -1,16 +1,12 @@
1
1
  import { SealKeyServerEntry } from "./registry-publish.mjs";
2
2
 
3
3
  //#region src/plugins/seal/codegen.d.ts
4
- /** Codegen-emitted shape for seal. Mirrors the read-side resolved
5
- * value (sans the per-instance defaults like `weight`). The
6
- * bindings emitter writes a TypeScript file exporting these. */
4
+ /** Codegen-emitted shape for seal. */
7
5
  interface SealBindings {
8
6
  readonly name: string;
9
7
  readonly objectId: string;
10
8
  readonly keyServerUrl: string;
11
9
  readonly serverConfigs: ReadonlyArray<SealKeyServerEntry>;
12
- /** Mode marker for consumers that branch between local-keygen and
13
- * known-deployment surfaces. */
14
10
  readonly mode: 'local-keygen' | 'live' | 'fork-known';
15
11
  }
16
12
  //#endregion
@@ -1,16 +1,87 @@
1
- import { Effect } from "effect";
1
+ import { keyedBucketSpec, liveBucketCodegen, staticBucketCodegen } from "../../contracts/config-bindings.mjs";
2
2
  //#region src/plugins/seal/codegen.ts
3
- /** Build the Codegenable contribution for a seal instance. */
4
- const makeSealCodegenable = (bindings) => ({
5
- kind: "codegenable",
6
- emitterName: "seal-key-server",
7
- outputPath: `seal/${bindings.name}.ts`,
8
- emit: (ctx) => Effect.sync(() => {
9
- ctx.exportConst("sealBindings", bindings);
10
- return ctx.done();
11
- })
12
- });
3
+ /** Build the seal instance's config-binding spec for `name`. `name` / `mode`
4
+ * are structural literals. For a `local-keygen` instance the object id / URL
5
+ * are dynamically-deployed (`resolveValue`) and `serverConfigs` is a runtime
6
+ * committee blob; for a `live` / `fork-known` instance these are DECLARED
7
+ * config, baked as literals. */
8
+ const sealBucketSpec = (structural) => {
9
+ const known = structural.known;
10
+ const fields = known !== void 0 ? [
11
+ {
12
+ key: "name",
13
+ variant: "literal",
14
+ value: structural.name
15
+ },
16
+ {
17
+ key: "mode",
18
+ variant: "literal",
19
+ value: structural.mode
20
+ },
21
+ {
22
+ key: "objectId",
23
+ variant: "literal",
24
+ value: known.objectId
25
+ },
26
+ {
27
+ key: "keyServerUrl",
28
+ variant: "literal",
29
+ value: known.keyServerUrl
30
+ },
31
+ {
32
+ key: "serverConfigs",
33
+ variant: "literal",
34
+ value: known.serverConfigs
35
+ }
36
+ ] : [
37
+ {
38
+ key: "name",
39
+ variant: "literal",
40
+ value: structural.name
41
+ },
42
+ {
43
+ key: "mode",
44
+ variant: "literal",
45
+ value: structural.mode
46
+ },
47
+ {
48
+ key: "objectId",
49
+ variant: "resolved",
50
+ tsType: "string",
51
+ live: (s) => s.objectId
52
+ },
53
+ {
54
+ key: "keyServerUrl",
55
+ variant: "resolved",
56
+ tsType: "string",
57
+ live: (s) => s.keyServerUrl
58
+ },
59
+ {
60
+ key: "serverConfigs",
61
+ variant: "resolved",
62
+ tsType: "ReadonlyArray<{ readonly objectId: string; readonly weight: number; readonly aggregatorUrl?: string }>",
63
+ live: (s) => s.serverConfigs
64
+ }
65
+ ];
66
+ return keyedBucketSpec({
67
+ bucket: "seal.ts",
68
+ kind: "seal",
69
+ key: structural.name,
70
+ fields
71
+ });
72
+ };
73
+ /** Build the LIVE Codegenable contribution for a seal instance. Bakes the
74
+ * resolved key-server fields + feeds the generic id-config `values`
75
+ * channel. */
76
+ const makeSealCodegenable = (bindings) => liveBucketCodegen(sealBucketSpec({
77
+ name: bindings.name,
78
+ mode: bindings.mode
79
+ }), bindings);
80
+ /** Build the STATIC (stack-free) Codegenable contribution for a seal
81
+ * instance. Emits `resolveValue('seal:<name>', '<key>')` for the runtime
82
+ * fields; the committed `seal.ts` carries no baked object id / endpoint URL. */
83
+ const makeSealStaticCodegen = (config) => staticBucketCodegen(sealBucketSpec(config));
13
84
  //#endregion
14
- export { makeSealCodegenable };
85
+ export { makeSealCodegenable, makeSealStaticCodegen };
15
86
 
16
87
  //# sourceMappingURL=codegen.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"codegen.mjs","names":[],"sources":["../../../src/plugins/seal/codegen.ts"],"sourcesContent":["// Seal plugin — Codegenable contribution.\n//\n// Distilled-doc §\"Outputs\": the seal plugin contributes ONE codegen\n// emit shape — the `seal-key-server` config the user-facing\n// bindings consume to construct a `SealClient`. The orchestrator\n// reads this contribution + every other plugin's; the heavy\n// codegen substrate (file writing, type-export grouping) lives in\n// the codegen orchestrator (architecture §6).\n//\n// Tag id discipline:\n//\n// - The emitter name `'seal-key-server'` is pinned here so the\n// generated output and orchestrator attribution stay stable.\n\nimport { Effect } from 'effect';\n\nimport type { CodegenableDecl } from '../../contracts/codegenable.ts';\nimport type { SealKeyServerEntry } from './registry-publish.ts';\n\n// ---------------------------------------------------------------------------\n// Bindings shape\n// ---------------------------------------------------------------------------\n\n/** Codegen-emitted shape for seal. Mirrors the read-side resolved\n * value (sans the per-instance defaults like `weight`). The\n * bindings emitter writes a TypeScript file exporting these. */\nexport interface SealBindings {\n\treadonly name: string;\n\treadonly objectId: string;\n\treadonly keyServerUrl: string;\n\treadonly serverConfigs: ReadonlyArray<SealKeyServerEntry>;\n\t/** Mode marker for consumers that branch between local-keygen and\n\t * known-deployment surfaces. */\n\treadonly mode: 'local-keygen' | 'live' | 'fork-known';\n}\n\n// ---------------------------------------------------------------------------\n// Decl builder\n// ---------------------------------------------------------------------------\n\n/** Build the Codegenable contribution for a seal instance. */\nexport const makeSealCodegenable = (\n\tbindings: SealBindings,\n): CodegenableDecl<'seal-key-server'> => ({\n\tkind: 'codegenable',\n\temitterName: 'seal-key-server',\n\toutputPath: `seal/${bindings.name}.ts`,\n\temit: (ctx) =>\n\t\tEffect.sync(() => {\n\t\t\tctx.exportConst('sealBindings', bindings satisfies SealBindings);\n\t\t\treturn ctx.done();\n\t\t}),\n});\n"],"mappings":";;;AAyCA,MAAa,uBACZ,cACyC;CACzC,MAAM;CACN,aAAa;CACb,YAAY,QAAQ,SAAS,KAAK;CAClC,OAAO,QACN,OAAO,WAAW;AACjB,MAAI,YAAY,gBAAgB,SAAgC;AAChE,SAAO,IAAI,MAAM;GAChB;CACH"}
1
+ {"version":3,"file":"codegen.mjs","names":[],"sources":["../../../src/plugins/seal/codegen.ts"],"sourcesContent":["// Seal plugin — Codegenable contribution, via the UNIFIED config-binding\n// declaration.\n//\n// The seal plugin contributes ONE codegen shape — the `seal-key-server`\n// config the user-facing bindings consume to construct a `SealClient`.\n//\n// ONE declaration, TWO derivations (see `contracts/config-bindings.ts`). Every\n// seal instance folds into a single `generated/seal.ts` exporting\n// `export const seal = { <name>: SealBindings, ... }` (sibling-keyed bucket):\n// - LIVE (boot): bakes the resolved key-server object id / URL / configs\n// AND feeds the generic id-config `values` channel.\n// - STATIC (committed tree): emits `resolveValue('seal:<name>', '<key>')`\n// so the committed `seal.ts` carries NO baked object id / endpoint URL.\n//\n// STRUCTURAL fields (`name`, `mode`) stay literals; the object id, key-server\n// URL, and `serverConfigs` committee (an array blob) are RUNTIME (loaded\n// config data), resolved at app build/dev time.\n\nimport type { CodegenableDecl } from '../../contracts/codegenable.ts';\nimport {\n\tkeyedBucketSpec,\n\tliveBucketCodegen,\n\tstaticBucketCodegen,\n\ttype BucketField,\n\ttype SiblingBucketSpec,\n} from '../../contracts/config-bindings.ts';\nimport type { JsonValue } from '../../orchestrators/codegen/id-config.ts';\nimport type { SealKeyServerEntry } from './registry-publish.ts';\n\n/** Codegen-emitted shape for seal. */\nexport interface SealBindings {\n\treadonly name: string;\n\treadonly objectId: string;\n\treadonly keyServerUrl: string;\n\treadonly serverConfigs: ReadonlyArray<SealKeyServerEntry>;\n\treadonly mode: 'local-keygen' | 'live' | 'fork-known';\n}\n\n/** User-declared known seal ids, available at factory time. The `live` and\n * `fork-known` modes resolve their `{objectId, keyServerUrl, serverConfigs}`\n * tuple at factory time (DECLARED config), so the committed `seal.ts` bakes\n * them as LITERALS. Absent for `local-keygen` (dev-deployed) whose key-server\n * ids/URL are dynamic. */\nexport interface SealKnownIds {\n\treadonly objectId: string;\n\treadonly keyServerUrl: string;\n\treadonly serverConfigs: ReadonlyArray<SealKeyServerEntry>;\n}\n\n/** Static-config shape a seal instance knows BEFORE acquire — the\n * structural names the stack-free `staticCodegen` hook needs. When `known`\n * is present (live / fork-known), its declared ids are baked as literals;\n * otherwise (local-keygen) every id resolves at app build/dev time. */\nexport interface SealStaticConfig {\n\treadonly name: string;\n\treadonly mode: SealBindings['mode'];\n\treadonly known?: SealKnownIds;\n}\n\ntype SealLiveState = SealBindings;\n\n/** Build the seal instance's config-binding spec for `name`. `name` / `mode`\n * are structural literals. For a `local-keygen` instance the object id / URL\n * are dynamically-deployed (`resolveValue`) and `serverConfigs` is a runtime\n * committee blob; for a `live` / `fork-known` instance these are DECLARED\n * config, baked as literals. */\nconst sealBucketSpec = (structural: SealStaticConfig): SiblingBucketSpec<SealLiveState> => {\n\tconst known = structural.known;\n\tconst fields: ReadonlyArray<BucketField<SealLiveState>> =\n\t\tknown !== undefined\n\t\t\t? [\n\t\t\t\t\t{ key: 'name', variant: 'literal', value: structural.name },\n\t\t\t\t\t{ key: 'mode', variant: 'literal', value: structural.mode },\n\t\t\t\t\t{ key: 'objectId', variant: 'literal', value: known.objectId },\n\t\t\t\t\t{ key: 'keyServerUrl', variant: 'literal', value: known.keyServerUrl },\n\t\t\t\t\t{\n\t\t\t\t\t\tkey: 'serverConfigs',\n\t\t\t\t\t\tvariant: 'literal',\n\t\t\t\t\t\tvalue: known.serverConfigs as unknown as JsonValue,\n\t\t\t\t\t},\n\t\t\t\t]\n\t\t\t: [\n\t\t\t\t\t{ key: 'name', variant: 'literal', value: structural.name },\n\t\t\t\t\t{ key: 'mode', variant: 'literal', value: structural.mode },\n\t\t\t\t\t{ key: 'objectId', variant: 'resolved', tsType: 'string', live: (s) => s.objectId },\n\t\t\t\t\t{\n\t\t\t\t\t\tkey: 'keyServerUrl',\n\t\t\t\t\t\tvariant: 'resolved',\n\t\t\t\t\t\ttsType: 'string',\n\t\t\t\t\t\tlive: (s) => s.keyServerUrl,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tkey: 'serverConfigs',\n\t\t\t\t\t\tvariant: 'resolved',\n\t\t\t\t\t\t// Inline structural literal mirroring `SealKeyServerEntry` so the\n\t\t\t\t\t\t// committed `seal.ts` carries the concrete type (no emitted import).\n\t\t\t\t\t\ttsType:\n\t\t\t\t\t\t\t'ReadonlyArray<{ readonly objectId: string; readonly weight: number; readonly aggregatorUrl?: string }>',\n\t\t\t\t\t\tlive: (s) => s.serverConfigs as unknown as JsonValue,\n\t\t\t\t\t},\n\t\t\t\t];\n\treturn keyedBucketSpec({ bucket: 'seal.ts', kind: 'seal', key: structural.name, fields });\n};\n\n/** Build the LIVE Codegenable contribution for a seal instance. Bakes the\n * resolved key-server fields + feeds the generic id-config `values`\n * channel. */\nexport const makeSealCodegenable = (bindings: SealBindings): CodegenableDecl =>\n\tliveBucketCodegen(sealBucketSpec({ name: bindings.name, mode: bindings.mode }), bindings);\n\n/** Build the STATIC (stack-free) Codegenable contribution for a seal\n * instance. Emits `resolveValue('seal:<name>', '<key>')` for the runtime\n * fields; the committed `seal.ts` carries no baked object id / endpoint URL. */\nexport const makeSealStaticCodegen = (config: SealStaticConfig): CodegenableDecl =>\n\tstaticBucketCodegen(sealBucketSpec(config));\n"],"mappings":";;;;;;;AAkEA,MAAM,kBAAkB,eAAmE;CAC1F,MAAM,QAAQ,WAAW;CACzB,MAAM,SACL,UAAU,KAAA,IACP;EACA;GAAE,KAAK;GAAQ,SAAS;GAAW,OAAO,WAAW;EAAK;EAC1D;GAAE,KAAK;GAAQ,SAAS;GAAW,OAAO,WAAW;EAAK;EAC1D;GAAE,KAAK;GAAY,SAAS;GAAW,OAAO,MAAM;EAAS;EAC7D;GAAE,KAAK;GAAgB,SAAS;GAAW,OAAO,MAAM;EAAa;EACrE;GACC,KAAK;GACL,SAAS;GACT,OAAO,MAAM;EACd;CACD,IACC;EACA;GAAE,KAAK;GAAQ,SAAS;GAAW,OAAO,WAAW;EAAK;EAC1D;GAAE,KAAK;GAAQ,SAAS;GAAW,OAAO,WAAW;EAAK;EAC1D;GAAE,KAAK;GAAY,SAAS;GAAY,QAAQ;GAAU,OAAO,MAAM,EAAE;EAAS;EAClF;GACC,KAAK;GACL,SAAS;GACT,QAAQ;GACR,OAAO,MAAM,EAAE;EAChB;EACA;GACC,KAAK;GACL,SAAS;GAGT,QACC;GACD,OAAO,MAAM,EAAE;EAChB;CACD;CACH,OAAO,gBAAgB;EAAE,QAAQ;EAAW,MAAM;EAAQ,KAAK,WAAW;EAAM;CAAO,CAAC;AACzF;;;;AAKA,MAAa,uBAAuB,aACnC,kBAAkB,eAAe;CAAE,MAAM,SAAS;CAAM,MAAM,SAAS;AAAK,CAAC,GAAG,QAAQ;;;;AAKzF,MAAa,yBAAyB,WACrC,oBAAoB,eAAe,MAAM,CAAC"}
@@ -1,6 +1,5 @@
1
1
  import { atomicWriteFile } from "../../substrate/runtime/atomic-write.mjs";
2
2
  import { sealConfigError, sealError } from "./errors.mjs";
3
- import { SealSpans } from "./spans.mjs";
4
3
  import { KEY_SERVER_CONFIG_BASENAME, MASTER_KEY_ENVFILE_BASENAME } from "./keygen.mjs";
5
4
  import { Effect } from "effect";
6
5
  //#region src/plugins/seal/config-render.ts
@@ -12,7 +11,7 @@ const DEFAULT_TS_SDK_REQUIREMENT = ">=0.4.5";
12
11
  * alphanumerics, `:/_.-`, and `0x` — so the conservative whitelist is
13
12
  * safe. The `ts_sdk_version_requirement` allows the SemVer comparator
14
13
  * characters as well. */
15
- const YAML_INTERP_FIELD_RE = /^[0-9a-zA-Z:/_.\-]+$/;
14
+ const YAML_INTERP_FIELD_RE = /^[0-9a-zA-Z:/_.-]+$/;
16
15
  const YAML_INTERP_SEMVER_RE = /^[0-9a-zA-Z:/_.\-<>=^~* |!]+$/;
17
16
  const assertYamlSafe = (field, value, pattern) => {
18
17
  if (pattern.test(value)) return value;
@@ -99,10 +98,7 @@ const stageSealConfig = (yamlBody, masterKeyHex, servicePath, name) => Effect.ge
99
98
  configPath,
100
99
  masterKeyEnvFile
101
100
  };
102
- }).pipe(Effect.withSpan("devstack.plugin.seal.config-render.stage", { attributes: {
103
- [SealSpans.name]: name,
104
- [SealSpans.servicePath]: servicePath
105
- } }));
101
+ });
106
102
  //#endregion
107
103
  export { parseMasterKeyEnvFile, renderSealKeyServerConfig, stageSealConfig };
108
104