@mysten-incubation/devstack 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (833) hide show
  1. package/LICENSE +189 -0
  2. package/README.md +94 -0
  3. package/dist/_virtual/_rolldown/runtime.mjs +13 -0
  4. package/dist/api/define-capabilities.d.mts +25 -0
  5. package/dist/api/define-capabilities.mjs +19 -0
  6. package/dist/api/define-capabilities.mjs.map +1 -0
  7. package/dist/api/define-devstack-with.d.mts +41 -0
  8. package/dist/api/define-devstack-with.mjs +24 -0
  9. package/dist/api/define-devstack-with.mjs.map +1 -0
  10. package/dist/api/define-devstack.d.mts +62 -0
  11. package/dist/api/define-devstack.mjs +108 -0
  12. package/dist/api/define-devstack.mjs.map +1 -0
  13. package/dist/api/define-plugin.d.mts +1 -0
  14. package/dist/api/inference-network.mjs +122 -0
  15. package/dist/api/inference-network.mjs.map +1 -0
  16. package/dist/api/mode-narrowed-factory.d.mts +26 -0
  17. package/dist/api/mode-narrowed-factory.mjs +8 -0
  18. package/dist/api/mode-narrowed-factory.mjs.map +1 -0
  19. package/dist/api/plugin-errors.mjs +10 -0
  20. package/dist/api/plugin-errors.mjs.map +1 -0
  21. package/dist/api/run-stack.d.mts +82 -0
  22. package/dist/api/run-stack.mjs +127 -0
  23. package/dist/api/run-stack.mjs.map +1 -0
  24. package/dist/build-integrations/playwright/config.d.mts +92 -0
  25. package/dist/build-integrations/playwright/config.mjs +71 -0
  26. package/dist/build-integrations/playwright/config.mjs.map +1 -0
  27. package/dist/build-integrations/playwright/errors.d.mts +82 -0
  28. package/dist/build-integrations/playwright/errors.mjs +43 -0
  29. package/dist/build-integrations/playwright/errors.mjs.map +1 -0
  30. package/dist/build-integrations/playwright/global-setup.d.mts +64 -0
  31. package/dist/build-integrations/playwright/global-setup.mjs +44 -0
  32. package/dist/build-integrations/playwright/global-setup.mjs.map +1 -0
  33. package/dist/build-integrations/playwright/index.d.mts +6 -0
  34. package/dist/build-integrations/playwright/index.mjs +6 -0
  35. package/dist/build-integrations/playwright/stack-context.d.mts +95 -0
  36. package/dist/build-integrations/playwright/stack-context.mjs +277 -0
  37. package/dist/build-integrations/playwright/stack-context.mjs.map +1 -0
  38. package/dist/build-integrations/playwright/wallet-context.d.mts +87 -0
  39. package/dist/build-integrations/playwright/wallet-context.mjs +148 -0
  40. package/dist/build-integrations/playwright/wallet-context.mjs.map +1 -0
  41. package/dist/build-integrations/runtime/cold-start-url.d.mts +67 -0
  42. package/dist/build-integrations/runtime/cold-start-url.mjs +56 -0
  43. package/dist/build-integrations/runtime/cold-start-url.mjs.map +1 -0
  44. package/dist/build-integrations/runtime/dapp-kit-slot.mjs +10 -0
  45. package/dist/build-integrations/runtime/dapp-kit-slot.mjs.map +1 -0
  46. package/dist/build-integrations/runtime/discover.d.mts +78 -0
  47. package/dist/build-integrations/runtime/discover.mjs +124 -0
  48. package/dist/build-integrations/runtime/discover.mjs.map +1 -0
  49. package/dist/build-integrations/runtime/endpoint-registry.d.mts +26 -0
  50. package/dist/build-integrations/runtime/endpoint-registry.mjs +41 -0
  51. package/dist/build-integrations/runtime/endpoint-registry.mjs.map +1 -0
  52. package/dist/build-integrations/runtime/errors.d.mts +64 -0
  53. package/dist/build-integrations/runtime/errors.mjs +51 -0
  54. package/dist/build-integrations/runtime/errors.mjs.map +1 -0
  55. package/dist/build-integrations/runtime/index.d.mts +7 -0
  56. package/dist/build-integrations/runtime/index.mjs +6 -0
  57. package/dist/build-integrations/runtime/read-stack-context.d.mts +38 -0
  58. package/dist/build-integrations/runtime/read-stack-context.mjs +130 -0
  59. package/dist/build-integrations/runtime/read-stack-context.mjs.map +1 -0
  60. package/dist/build-integrations/runtime/stack-context.d.mts +53 -0
  61. package/dist/build-integrations/vitest/config.d.mts +62 -0
  62. package/dist/build-integrations/vitest/config.mjs +80 -0
  63. package/dist/build-integrations/vitest/config.mjs.map +1 -0
  64. package/dist/build-integrations/vitest/env.d.mts +48 -0
  65. package/dist/build-integrations/vitest/env.mjs +50 -0
  66. package/dist/build-integrations/vitest/env.mjs.map +1 -0
  67. package/dist/build-integrations/vitest/errors.d.mts +44 -0
  68. package/dist/build-integrations/vitest/errors.mjs +18 -0
  69. package/dist/build-integrations/vitest/errors.mjs.map +1 -0
  70. package/dist/build-integrations/vitest/index.d.mts +6 -0
  71. package/dist/build-integrations/vitest/index.mjs +6 -0
  72. package/dist/build-integrations/vitest/setup.d.mts +53 -0
  73. package/dist/build-integrations/vitest/setup.mjs +56 -0
  74. package/dist/build-integrations/vitest/setup.mjs.map +1 -0
  75. package/dist/build-integrations/vitest/stack-context.d.mts +58 -0
  76. package/dist/build-integrations/vitest/stack-context.mjs +67 -0
  77. package/dist/build-integrations/vitest/stack-context.mjs.map +1 -0
  78. package/dist/cli/main.d.mts +5 -0
  79. package/dist/cli/main.mjs +586 -0
  80. package/dist/cli/main.mjs.map +1 -0
  81. package/dist/cli/prune-direct.mjs +216 -0
  82. package/dist/cli/prune-direct.mjs.map +1 -0
  83. package/dist/cli/snapshot-reader.mjs +73 -0
  84. package/dist/cli/snapshot-reader.mjs.map +1 -0
  85. package/dist/cli/up-lifecycle.mjs +28 -0
  86. package/dist/cli/up-lifecycle.mjs.map +1 -0
  87. package/dist/contracts/capability-decl.d.mts +42 -0
  88. package/dist/contracts/chain-probe.d.mts +26 -0
  89. package/dist/contracts/chain-probe.mjs +8 -0
  90. package/dist/contracts/chain-probe.mjs.map +1 -0
  91. package/dist/contracts/codegenable.d.mts +43 -0
  92. package/dist/contracts/container-runtime.d.mts +245 -0
  93. package/dist/contracts/liveness-classifier.d.mts +19 -0
  94. package/dist/contracts/network-resolver.d.mts +15 -0
  95. package/dist/contracts/network-resolver.mjs +7 -0
  96. package/dist/contracts/network-resolver.mjs.map +1 -0
  97. package/dist/contracts/projection.d.mts +15 -0
  98. package/dist/contracts/routable.d.mts +53 -0
  99. package/dist/contracts/snapshotable.d.mts +39 -0
  100. package/dist/contracts/strategy-contributor.d.mts +26 -0
  101. package/dist/index.d.mts +89 -0
  102. package/dist/index.mjs +37 -0
  103. package/dist/orchestrators/codegen/bindings.d.mts +2 -0
  104. package/dist/orchestrators/codegen/bindings.mjs +340 -0
  105. package/dist/orchestrators/codegen/bindings.mjs.map +1 -0
  106. package/dist/orchestrators/codegen/emit.mjs +56 -0
  107. package/dist/orchestrators/codegen/emit.mjs.map +1 -0
  108. package/dist/orchestrators/codegen/errors.d.mts +1 -0
  109. package/dist/orchestrators/codegen/errors.mjs +66 -0
  110. package/dist/orchestrators/codegen/errors.mjs.map +1 -0
  111. package/dist/orchestrators/codegen/extras.mjs +16 -0
  112. package/dist/orchestrators/codegen/extras.mjs.map +1 -0
  113. package/dist/orchestrators/codegen/format.mjs +109 -0
  114. package/dist/orchestrators/codegen/format.mjs.map +1 -0
  115. package/dist/orchestrators/codegen/gitignore.mjs +67 -0
  116. package/dist/orchestrators/codegen/gitignore.mjs.map +1 -0
  117. package/dist/orchestrators/codegen/paths.d.mts +1 -0
  118. package/dist/orchestrators/codegen/paths.mjs +33 -0
  119. package/dist/orchestrators/codegen/paths.mjs.map +1 -0
  120. package/dist/orchestrators/codegen/permissions.mjs +6 -0
  121. package/dist/orchestrators/codegen/permissions.mjs.map +1 -0
  122. package/dist/orchestrators/codegen/service.d.mts +1 -0
  123. package/dist/orchestrators/codegen/service.mjs +276 -0
  124. package/dist/orchestrators/codegen/service.mjs.map +1 -0
  125. package/dist/orchestrators/router/cleanup.mjs +58 -0
  126. package/dist/orchestrators/router/cleanup.mjs.map +1 -0
  127. package/dist/orchestrators/router/cors.mjs +31 -0
  128. package/dist/orchestrators/router/cors.mjs.map +1 -0
  129. package/dist/orchestrators/router/entrypoints.d.mts +1 -0
  130. package/dist/orchestrators/router/entrypoints.mjs +80 -0
  131. package/dist/orchestrators/router/entrypoints.mjs.map +1 -0
  132. package/dist/orchestrators/router/errors.d.mts +1 -0
  133. package/dist/orchestrators/router/errors.mjs +103 -0
  134. package/dist/orchestrators/router/errors.mjs.map +1 -0
  135. package/dist/orchestrators/router/file-provider.d.mts +1 -0
  136. package/dist/orchestrators/router/file-provider.mjs +320 -0
  137. package/dist/orchestrators/router/file-provider.mjs.map +1 -0
  138. package/dist/orchestrators/router/hostname.d.mts +1 -0
  139. package/dist/orchestrators/router/hostname.mjs +107 -0
  140. package/dist/orchestrators/router/hostname.mjs.map +1 -0
  141. package/dist/orchestrators/router/index.d.mts +1 -0
  142. package/dist/orchestrators/router/profile.d.mts +1 -0
  143. package/dist/orchestrators/router/profile.mjs +109 -0
  144. package/dist/orchestrators/router/profile.mjs.map +1 -0
  145. package/dist/orchestrators/router/service.d.mts +3 -0
  146. package/dist/orchestrators/router/service.mjs +421 -0
  147. package/dist/orchestrators/router/service.mjs.map +1 -0
  148. package/dist/orchestrators/router/traefik-container.d.mts +1 -0
  149. package/dist/orchestrators/router/traefik-container.mjs +229 -0
  150. package/dist/orchestrators/router/traefik-container.mjs.map +1 -0
  151. package/dist/orchestrators/runtime-composition.d.mts +10 -0
  152. package/dist/orchestrators/runtime-composition.mjs +168 -0
  153. package/dist/orchestrators/runtime-composition.mjs.map +1 -0
  154. package/dist/orchestrators/snapshot/capture.d.mts +1 -0
  155. package/dist/orchestrators/snapshot/capture.mjs +350 -0
  156. package/dist/orchestrators/snapshot/capture.mjs.map +1 -0
  157. package/dist/orchestrators/snapshot/descriptor.d.mts +1 -0
  158. package/dist/orchestrators/snapshot/descriptor.mjs +109 -0
  159. package/dist/orchestrators/snapshot/descriptor.mjs.map +1 -0
  160. package/dist/orchestrators/snapshot/identity-guard.d.mts +1 -0
  161. package/dist/orchestrators/snapshot/identity-guard.mjs +132 -0
  162. package/dist/orchestrators/snapshot/identity-guard.mjs.map +1 -0
  163. package/dist/orchestrators/snapshot/image-bundle-tags.mjs +207 -0
  164. package/dist/orchestrators/snapshot/image-bundle-tags.mjs.map +1 -0
  165. package/dist/orchestrators/snapshot/index.d.mts +1 -0
  166. package/dist/orchestrators/snapshot/integrity.d.mts +1 -0
  167. package/dist/orchestrators/snapshot/integrity.mjs +74 -0
  168. package/dist/orchestrators/snapshot/integrity.mjs.map +1 -0
  169. package/dist/orchestrators/snapshot/prune.d.mts +1 -0
  170. package/dist/orchestrators/snapshot/prune.mjs +110 -0
  171. package/dist/orchestrators/snapshot/prune.mjs.map +1 -0
  172. package/dist/orchestrators/snapshot/restore.d.mts +1 -0
  173. package/dist/orchestrators/snapshot/restore.mjs +404 -0
  174. package/dist/orchestrators/snapshot/restore.mjs.map +1 -0
  175. package/dist/orchestrators/snapshot/service.d.mts +1 -0
  176. package/dist/orchestrators/snapshot/service.mjs +296 -0
  177. package/dist/orchestrators/snapshot/service.mjs.map +1 -0
  178. package/dist/orchestrators/snapshot/state-document.mjs +18 -0
  179. package/dist/orchestrators/snapshot/state-document.mjs.map +1 -0
  180. package/dist/orchestrators/snapshot/wipe.d.mts +1 -0
  181. package/dist/orchestrators/snapshot/wipe.mjs +59 -0
  182. package/dist/orchestrators/snapshot/wipe.mjs.map +1 -0
  183. package/dist/plugins/account/codegen.d.mts +12 -0
  184. package/dist/plugins/account/codegen.mjs +22 -0
  185. package/dist/plugins/account/codegen.mjs.map +1 -0
  186. package/dist/plugins/account/errors.d.mts +44 -0
  187. package/dist/plugins/account/errors.mjs +16 -0
  188. package/dist/plugins/account/errors.mjs.map +1 -0
  189. package/dist/plugins/account/funding.d.mts +94 -0
  190. package/dist/plugins/account/funding.mjs +199 -0
  191. package/dist/plugins/account/funding.mjs.map +1 -0
  192. package/dist/plugins/account/index.d.mts +54 -0
  193. package/dist/plugins/account/index.mjs +151 -0
  194. package/dist/plugins/account/index.mjs.map +1 -0
  195. package/dist/plugins/account/keypair.d.mts +32 -0
  196. package/dist/plugins/account/keypair.mjs +99 -0
  197. package/dist/plugins/account/keypair.mjs.map +1 -0
  198. package/dist/plugins/account/lease.mjs +21 -0
  199. package/dist/plugins/account/lease.mjs.map +1 -0
  200. package/dist/plugins/account/registry.d.mts +33 -0
  201. package/dist/plugins/account/registry.mjs +36 -0
  202. package/dist/plugins/account/registry.mjs.map +1 -0
  203. package/dist/plugins/account/service.d.mts +104 -0
  204. package/dist/plugins/account/service.mjs +405 -0
  205. package/dist/plugins/account/service.mjs.map +1 -0
  206. package/dist/plugins/account/snapshot.mjs +33 -0
  207. package/dist/plugins/account/snapshot.mjs.map +1 -0
  208. package/dist/plugins/account/variants/env.mjs +24 -0
  209. package/dist/plugins/account/variants/env.mjs.map +1 -0
  210. package/dist/plugins/account/variants/ephemeral.mjs +72 -0
  211. package/dist/plugins/account/variants/ephemeral.mjs.map +1 -0
  212. package/dist/plugins/account/variants/impersonate.d.mts +16 -0
  213. package/dist/plugins/account/variants/impersonate.mjs +48 -0
  214. package/dist/plugins/account/variants/impersonate.mjs.map +1 -0
  215. package/dist/plugins/account/variants/inline.mjs +13 -0
  216. package/dist/plugins/account/variants/inline.mjs.map +1 -0
  217. package/dist/plugins/account/variants/keystore.mjs +93 -0
  218. package/dist/plugins/account/variants/keystore.mjs.map +1 -0
  219. package/dist/plugins/account/variants/signer.mjs +31 -0
  220. package/dist/plugins/account/variants/signer.mjs.map +1 -0
  221. package/dist/plugins/action/build-context.d.mts +41 -0
  222. package/dist/plugins/action/discriminator.d.mts +20 -0
  223. package/dist/plugins/action/discriminator.mjs +13 -0
  224. package/dist/plugins/action/discriminator.mjs.map +1 -0
  225. package/dist/plugins/action/errors.d.mts +31 -0
  226. package/dist/plugins/action/errors.mjs +13 -0
  227. package/dist/plugins/action/errors.mjs.map +1 -0
  228. package/dist/plugins/action/execute.d.mts +2 -0
  229. package/dist/plugins/action/execute.mjs +145 -0
  230. package/dist/plugins/action/execute.mjs.map +1 -0
  231. package/dist/plugins/action/index.d.mts +56 -0
  232. package/dist/plugins/action/index.mjs +82 -0
  233. package/dist/plugins/action/index.mjs.map +1 -0
  234. package/dist/plugins/action/service.d.mts +26 -0
  235. package/dist/plugins/action/service.mjs +84 -0
  236. package/dist/plugins/action/service.mjs.map +1 -0
  237. package/dist/plugins/coin/address-resolution.d.mts +34 -0
  238. package/dist/plugins/coin/address-resolution.mjs +80 -0
  239. package/dist/plugins/coin/address-resolution.mjs.map +1 -0
  240. package/dist/plugins/coin/codegen.d.mts +16 -0
  241. package/dist/plugins/coin/codegen.mjs +21 -0
  242. package/dist/plugins/coin/codegen.mjs.map +1 -0
  243. package/dist/plugins/coin/discovery.d.mts +26 -0
  244. package/dist/plugins/coin/discovery.mjs +112 -0
  245. package/dist/plugins/coin/discovery.mjs.map +1 -0
  246. package/dist/plugins/coin/errors.d.mts +48 -0
  247. package/dist/plugins/coin/errors.mjs +13 -0
  248. package/dist/plugins/coin/errors.mjs.map +1 -0
  249. package/dist/plugins/coin/index.d.mts +95 -0
  250. package/dist/plugins/coin/index.mjs +172 -0
  251. package/dist/plugins/coin/index.mjs.map +1 -0
  252. package/dist/plugins/coin/metadata.d.mts +15 -0
  253. package/dist/plugins/coin/metadata.mjs +99 -0
  254. package/dist/plugins/coin/metadata.mjs.map +1 -0
  255. package/dist/plugins/coin/mint.d.mts +34 -0
  256. package/dist/plugins/coin/mint.mjs +164 -0
  257. package/dist/plugins/coin/mint.mjs.map +1 -0
  258. package/dist/plugins/coin/registry.d.mts +1 -0
  259. package/dist/plugins/coin/registry.mjs +37 -0
  260. package/dist/plugins/coin/registry.mjs.map +1 -0
  261. package/dist/plugins/coin/service.d.mts +47 -0
  262. package/dist/plugins/coin/service.mjs +51 -0
  263. package/dist/plugins/coin/service.mjs.map +1 -0
  264. package/dist/plugins/coin/snapshot.mjs +19 -0
  265. package/dist/plugins/coin/snapshot.mjs.map +1 -0
  266. package/dist/plugins/coin/type-strings.mjs +49 -0
  267. package/dist/plugins/coin/type-strings.mjs.map +1 -0
  268. package/dist/plugins/deepbook/codegen.d.mts +39 -0
  269. package/dist/plugins/deepbook/codegen.mjs +15 -0
  270. package/dist/plugins/deepbook/codegen.mjs.map +1 -0
  271. package/dist/plugins/deepbook/deploy.mjs +437 -0
  272. package/dist/plugins/deepbook/deploy.mjs.map +1 -0
  273. package/dist/plugins/deepbook/errors.d.mts +29 -0
  274. package/dist/plugins/deepbook/errors.mjs +26 -0
  275. package/dist/plugins/deepbook/errors.mjs.map +1 -0
  276. package/dist/plugins/deepbook/faucet-strategy.d.mts +8 -0
  277. package/dist/plugins/deepbook/faucet-strategy.mjs +81 -0
  278. package/dist/plugins/deepbook/faucet-strategy.mjs.map +1 -0
  279. package/dist/plugins/deepbook/index.d.mts +171 -0
  280. package/dist/plugins/deepbook/index.mjs +359 -0
  281. package/dist/plugins/deepbook/index.mjs.map +1 -0
  282. package/dist/plugins/deepbook/plugin-key.mjs +7 -0
  283. package/dist/plugins/deepbook/plugin-key.mjs.map +1 -0
  284. package/dist/plugins/deepbook/pyth/index.mjs +226 -0
  285. package/dist/plugins/deepbook/pyth/index.mjs.map +1 -0
  286. package/dist/plugins/deepbook/routable.mjs +21 -0
  287. package/dist/plugins/deepbook/routable.mjs.map +1 -0
  288. package/dist/plugins/deepbook/snapshot.mjs +49 -0
  289. package/dist/plugins/deepbook/snapshot.mjs.map +1 -0
  290. package/dist/plugins/deepbook/types.d.mts +125 -0
  291. package/dist/plugins/deepbook/types.mjs +12 -0
  292. package/dist/plugins/deepbook/types.mjs.map +1 -0
  293. package/dist/plugins/faucet/dispatcher.d.mts +9 -0
  294. package/dist/plugins/faucet/dispatcher.mjs +13 -0
  295. package/dist/plugins/faucet/dispatcher.mjs.map +1 -0
  296. package/dist/plugins/faucet/errors.d.mts +86 -0
  297. package/dist/plugins/faucet/errors.mjs +19 -0
  298. package/dist/plugins/faucet/errors.mjs.map +1 -0
  299. package/dist/plugins/faucet/http.mjs +127 -0
  300. package/dist/plugins/faucet/http.mjs.map +1 -0
  301. package/dist/plugins/faucet/index.d.mts +43 -0
  302. package/dist/plugins/faucet/index.mjs +42 -0
  303. package/dist/plugins/faucet/index.mjs.map +1 -0
  304. package/dist/plugins/faucet/service.d.mts +20 -0
  305. package/dist/plugins/faucet/strategies/sui-local.d.mts +23 -0
  306. package/dist/plugins/faucet/strategies/sui-local.mjs +29 -0
  307. package/dist/plugins/faucet/strategies/sui-local.mjs.map +1 -0
  308. package/dist/plugins/host-service/errors.d.mts +27 -0
  309. package/dist/plugins/host-service/errors.mjs +14 -0
  310. package/dist/plugins/host-service/errors.mjs.map +1 -0
  311. package/dist/plugins/host-service/index.d.mts +10 -0
  312. package/dist/plugins/host-service/index.mjs +48 -0
  313. package/dist/plugins/host-service/index.mjs.map +1 -0
  314. package/dist/plugins/host-service/routable.mjs +24 -0
  315. package/dist/plugins/host-service/routable.mjs.map +1 -0
  316. package/dist/plugins/host-service/service.d.mts +49 -0
  317. package/dist/plugins/host-service/service.mjs +375 -0
  318. package/dist/plugins/host-service/service.mjs.map +1 -0
  319. package/dist/plugins/package/build.d.mts +1 -0
  320. package/dist/plugins/package/build.mjs +24 -0
  321. package/dist/plugins/package/build.mjs.map +1 -0
  322. package/dist/plugins/package/codegen.d.mts +19 -0
  323. package/dist/plugins/package/codegen.mjs +41 -0
  324. package/dist/plugins/package/codegen.mjs.map +1 -0
  325. package/dist/plugins/package/dep-resolution.mjs +10 -0
  326. package/dist/plugins/package/dep-resolution.mjs.map +1 -0
  327. package/dist/plugins/package/errors.d.mts +34 -0
  328. package/dist/plugins/package/errors.mjs +13 -0
  329. package/dist/plugins/package/errors.mjs.map +1 -0
  330. package/dist/plugins/package/index.d.mts +109 -0
  331. package/dist/plugins/package/index.mjs +207 -0
  332. package/dist/plugins/package/index.mjs.map +1 -0
  333. package/dist/plugins/package/mode-known.mjs +41 -0
  334. package/dist/plugins/package/mode-known.mjs.map +1 -0
  335. package/dist/plugins/package/mode-local.d.mts +1 -0
  336. package/dist/plugins/package/mode-local.mjs +183 -0
  337. package/dist/plugins/package/mode-local.mjs.map +1 -0
  338. package/dist/plugins/package/publish-executor.mjs +202 -0
  339. package/dist/plugins/package/publish-executor.mjs.map +1 -0
  340. package/dist/plugins/package/publish-output.d.mts +28 -0
  341. package/dist/plugins/package/publish-output.mjs +45 -0
  342. package/dist/plugins/package/publish-output.mjs.map +1 -0
  343. package/dist/plugins/package/registry.d.mts +25 -0
  344. package/dist/plugins/package/registry.mjs +30 -0
  345. package/dist/plugins/package/registry.mjs.map +1 -0
  346. package/dist/plugins/package/service.mjs +20 -0
  347. package/dist/plugins/package/service.mjs.map +1 -0
  348. package/dist/plugins/package/snapshot.mjs +25 -0
  349. package/dist/plugins/package/snapshot.mjs.map +1 -0
  350. package/dist/plugins/postgres/codegen.mjs +42 -0
  351. package/dist/plugins/postgres/codegen.mjs.map +1 -0
  352. package/dist/plugins/postgres/connection.d.mts +33 -0
  353. package/dist/plugins/postgres/connection.mjs +19 -0
  354. package/dist/plugins/postgres/connection.mjs.map +1 -0
  355. package/dist/plugins/postgres/db-ensure.mjs +100 -0
  356. package/dist/plugins/postgres/db-ensure.mjs.map +1 -0
  357. package/dist/plugins/postgres/errors.d.mts +55 -0
  358. package/dist/plugins/postgres/errors.mjs +29 -0
  359. package/dist/plugins/postgres/errors.mjs.map +1 -0
  360. package/dist/plugins/postgres/index.d.mts +37 -0
  361. package/dist/plugins/postgres/index.mjs +75 -0
  362. package/dist/plugins/postgres/index.mjs.map +1 -0
  363. package/dist/plugins/postgres/routable.mjs +33 -0
  364. package/dist/plugins/postgres/routable.mjs.map +1 -0
  365. package/dist/plugins/postgres/service.d.mts +50 -0
  366. package/dist/plugins/postgres/service.mjs +145 -0
  367. package/dist/plugins/postgres/service.mjs.map +1 -0
  368. package/dist/plugins/postgres/snapshot.d.mts +1 -0
  369. package/dist/plugins/postgres/snapshot.mjs +32 -0
  370. package/dist/plugins/postgres/snapshot.mjs.map +1 -0
  371. package/dist/plugins/router-entrypoints.mjs +21 -0
  372. package/dist/plugins/router-entrypoints.mjs.map +1 -0
  373. package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs +59 -0
  374. package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs.map +1 -0
  375. package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs +132 -0
  376. package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs.map +1 -0
  377. package/dist/plugins/seal/codegen.d.mts +19 -0
  378. package/dist/plugins/seal/codegen.mjs +16 -0
  379. package/dist/plugins/seal/codegen.mjs.map +1 -0
  380. package/dist/plugins/seal/config-render.mjs +82 -0
  381. package/dist/plugins/seal/config-render.mjs.map +1 -0
  382. package/dist/plugins/seal/deploy.mjs +198 -0
  383. package/dist/plugins/seal/deploy.mjs.map +1 -0
  384. package/dist/plugins/seal/errors.d.mts +52 -0
  385. package/dist/plugins/seal/errors.mjs +19 -0
  386. package/dist/plugins/seal/errors.mjs.map +1 -0
  387. package/dist/plugins/seal/index.d.mts +161 -0
  388. package/dist/plugins/seal/index.mjs +235 -0
  389. package/dist/plugins/seal/index.mjs.map +1 -0
  390. package/dist/plugins/seal/key-manager.d.mts +22 -0
  391. package/dist/plugins/seal/key-manager.mjs +22 -0
  392. package/dist/plugins/seal/key-manager.mjs.map +1 -0
  393. package/dist/plugins/seal/key-server.mjs +175 -0
  394. package/dist/plugins/seal/key-server.mjs.map +1 -0
  395. package/dist/plugins/seal/keygen.mjs +96 -0
  396. package/dist/plugins/seal/keygen.mjs.map +1 -0
  397. package/dist/plugins/seal/mode/fork-known.d.mts +8 -0
  398. package/dist/plugins/seal/mode/fork-known.mjs +23 -0
  399. package/dist/plugins/seal/mode/fork-known.mjs.map +1 -0
  400. package/dist/plugins/seal/mode/live.d.mts +18 -0
  401. package/dist/plugins/seal/mode/live.mjs +64 -0
  402. package/dist/plugins/seal/mode/live.mjs.map +1 -0
  403. package/dist/plugins/seal/mode/local-keygen.mjs +180 -0
  404. package/dist/plugins/seal/mode/local-keygen.mjs.map +1 -0
  405. package/dist/plugins/seal/plugin-key.mjs +7 -0
  406. package/dist/plugins/seal/plugin-key.mjs.map +1 -0
  407. package/dist/plugins/seal/registry-publish.d.mts +43 -0
  408. package/dist/plugins/seal/registry-publish.mjs +9 -0
  409. package/dist/plugins/seal/registry-publish.mjs.map +1 -0
  410. package/dist/plugins/seal/routable.mjs +57 -0
  411. package/dist/plugins/seal/routable.mjs.map +1 -0
  412. package/dist/plugins/seal/service.mjs +17 -0
  413. package/dist/plugins/seal/service.mjs.map +1 -0
  414. package/dist/plugins/seal/snapshot.mjs +51 -0
  415. package/dist/plugins/seal/snapshot.mjs.map +1 -0
  416. package/dist/plugins/sui/auto-tick.mjs +45 -0
  417. package/dist/plugins/sui/auto-tick.mjs.map +1 -0
  418. package/dist/plugins/sui/chain-build-container.d.mts +1 -0
  419. package/dist/plugins/sui/chain-probe.d.mts +85 -0
  420. package/dist/plugins/sui/chain-probe.mjs +104 -0
  421. package/dist/plugins/sui/chain-probe.mjs.map +1 -0
  422. package/dist/plugins/sui/codegen.d.mts +14 -0
  423. package/dist/plugins/sui/codegen.mjs +26 -0
  424. package/dist/plugins/sui/codegen.mjs.map +1 -0
  425. package/dist/plugins/sui/errors.d.mts +74 -0
  426. package/dist/plugins/sui/errors.mjs +28 -0
  427. package/dist/plugins/sui/errors.mjs.map +1 -0
  428. package/dist/plugins/sui/fork-orchestration.mjs +24 -0
  429. package/dist/plugins/sui/fork-orchestration.mjs.map +1 -0
  430. package/dist/plugins/sui/fork-transaction.mjs +96 -0
  431. package/dist/plugins/sui/fork-transaction.mjs.map +1 -0
  432. package/dist/plugins/sui/index.d.mts +318 -0
  433. package/dist/plugins/sui/index.mjs +182 -0
  434. package/dist/plugins/sui/index.mjs.map +1 -0
  435. package/dist/plugins/sui/mode/external.mjs +60 -0
  436. package/dist/plugins/sui/mode/external.mjs.map +1 -0
  437. package/dist/plugins/sui/mode/fork.mjs +283 -0
  438. package/dist/plugins/sui/mode/fork.mjs.map +1 -0
  439. package/dist/plugins/sui/mode/live.mjs +103 -0
  440. package/dist/plugins/sui/mode/live.mjs.map +1 -0
  441. package/dist/plugins/sui/mode/local.mjs +293 -0
  442. package/dist/plugins/sui/mode/local.mjs.map +1 -0
  443. package/dist/plugins/sui/mode/shared-boot.mjs +254 -0
  444. package/dist/plugins/sui/mode/shared-boot.mjs.map +1 -0
  445. package/dist/plugins/sui/mode/shared.d.mts +103 -0
  446. package/dist/plugins/sui/mode/shared.mjs +12 -0
  447. package/dist/plugins/sui/mode/shared.mjs.map +1 -0
  448. package/dist/plugins/sui/mode/spec.d.mts +94 -0
  449. package/dist/plugins/sui/network-resolver.d.mts +23 -0
  450. package/dist/plugins/sui/routable.mjs +88 -0
  451. package/dist/plugins/sui/routable.mjs.map +1 -0
  452. package/dist/plugins/sui/seed-objects.d.mts +18 -0
  453. package/dist/plugins/sui/seed-objects.mjs +25 -0
  454. package/dist/plugins/sui/seed-objects.mjs.map +1 -0
  455. package/dist/plugins/sui/service.mjs +38 -0
  456. package/dist/plugins/sui/service.mjs.map +1 -0
  457. package/dist/plugins/sui/snapshot.mjs +53 -0
  458. package/dist/plugins/sui/snapshot.mjs.map +1 -0
  459. package/dist/plugins/wallet/codegen.d.mts +33 -0
  460. package/dist/plugins/wallet/codegen.mjs +34 -0
  461. package/dist/plugins/wallet/codegen.mjs.map +1 -0
  462. package/dist/plugins/wallet/errors.d.mts +66 -0
  463. package/dist/plugins/wallet/errors.mjs +16 -0
  464. package/dist/plugins/wallet/errors.mjs.map +1 -0
  465. package/dist/plugins/wallet/index.d.mts +63 -0
  466. package/dist/plugins/wallet/index.mjs +126 -0
  467. package/dist/plugins/wallet/index.mjs.map +1 -0
  468. package/dist/plugins/wallet/origin-policy.d.mts +1 -0
  469. package/dist/plugins/wallet/origin-policy.mjs +65 -0
  470. package/dist/plugins/wallet/origin-policy.mjs.map +1 -0
  471. package/dist/plugins/wallet/pairing.d.mts +11 -0
  472. package/dist/plugins/wallet/pairing.mjs +125 -0
  473. package/dist/plugins/wallet/pairing.mjs.map +1 -0
  474. package/dist/plugins/wallet/protocol.d.mts +1 -0
  475. package/dist/plugins/wallet/protocol.mjs +96 -0
  476. package/dist/plugins/wallet/protocol.mjs.map +1 -0
  477. package/dist/plugins/wallet/routable.mjs +32 -0
  478. package/dist/plugins/wallet/routable.mjs.map +1 -0
  479. package/dist/plugins/wallet/server.d.mts +12 -0
  480. package/dist/plugins/wallet/server.mjs +317 -0
  481. package/dist/plugins/wallet/server.mjs.map +1 -0
  482. package/dist/plugins/wallet/service.d.mts +68 -0
  483. package/dist/plugins/wallet/service.mjs +97 -0
  484. package/dist/plugins/wallet/service.mjs.map +1 -0
  485. package/dist/plugins/wallet/snapshot.d.mts +1 -0
  486. package/dist/plugins/wallet/snapshot.mjs +14 -0
  487. package/dist/plugins/wallet/snapshot.mjs.map +1 -0
  488. package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs +42 -0
  489. package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs.map +1 -0
  490. package/dist/plugins/walrus/codegen.d.mts +38 -0
  491. package/dist/plugins/walrus/codegen.mjs +34 -0
  492. package/dist/plugins/walrus/codegen.mjs.map +1 -0
  493. package/dist/plugins/walrus/deploy-paths.mjs +14 -0
  494. package/dist/plugins/walrus/deploy-paths.mjs.map +1 -0
  495. package/dist/plugins/walrus/deploy.d.mts +1 -0
  496. package/dist/plugins/walrus/deploy.mjs +224 -0
  497. package/dist/plugins/walrus/deploy.mjs.map +1 -0
  498. package/dist/plugins/walrus/errors.d.mts +38 -0
  499. package/dist/plugins/walrus/errors.mjs +26 -0
  500. package/dist/plugins/walrus/errors.mjs.map +1 -0
  501. package/dist/plugins/walrus/faucet-strategy.d.mts +12 -0
  502. package/dist/plugins/walrus/faucet-strategy.mjs +62 -0
  503. package/dist/plugins/walrus/faucet-strategy.mjs.map +1 -0
  504. package/dist/plugins/walrus/index.d.mts +177 -0
  505. package/dist/plugins/walrus/index.mjs +284 -0
  506. package/dist/plugins/walrus/index.mjs.map +1 -0
  507. package/dist/plugins/walrus/mode/known-deploy.d.mts +25 -0
  508. package/dist/plugins/walrus/mode/known-deploy.mjs +71 -0
  509. package/dist/plugins/walrus/mode/known-deploy.mjs.map +1 -0
  510. package/dist/plugins/walrus/mode/local-cluster.d.mts +34 -0
  511. package/dist/plugins/walrus/mode/local-cluster.mjs +153 -0
  512. package/dist/plugins/walrus/mode/local-cluster.mjs.map +1 -0
  513. package/dist/plugins/walrus/plugin-key.mjs +7 -0
  514. package/dist/plugins/walrus/plugin-key.mjs.map +1 -0
  515. package/dist/plugins/walrus/registry-publish.d.mts +24 -0
  516. package/dist/plugins/walrus/registry-publish.mjs +7 -0
  517. package/dist/plugins/walrus/registry-publish.mjs.map +1 -0
  518. package/dist/plugins/walrus/routable.mjs +99 -0
  519. package/dist/plugins/walrus/routable.mjs.map +1 -0
  520. package/dist/plugins/walrus/service.mjs +20 -0
  521. package/dist/plugins/walrus/service.mjs.map +1 -0
  522. package/dist/plugins/walrus/snapshot.mjs +53 -0
  523. package/dist/plugins/walrus/snapshot.mjs.map +1 -0
  524. package/dist/plugins/walrus/storage-nodes.d.mts +15 -0
  525. package/dist/plugins/walrus/storage-nodes.mjs +154 -0
  526. package/dist/plugins/walrus/storage-nodes.mjs.map +1 -0
  527. package/dist/plugins/walrus/wal-swap.d.mts +2 -0
  528. package/dist/plugins/walrus/wal-swap.mjs +58 -0
  529. package/dist/plugins/walrus/wal-swap.mjs.map +1 -0
  530. package/dist/primitives/artifact-publisher.d.mts +12 -0
  531. package/dist/primitives/cache.d.mts +1 -0
  532. package/dist/runtime/built-in-plugin-layers.mjs +49 -0
  533. package/dist/runtime/built-in-plugin-layers.mjs.map +1 -0
  534. package/dist/runtime/docker/client.d.mts +2 -0
  535. package/dist/runtime/docker/client.mjs +54 -0
  536. package/dist/runtime/docker/client.mjs.map +1 -0
  537. package/dist/runtime/docker/container.d.mts +1 -0
  538. package/dist/runtime/docker/container.mjs +562 -0
  539. package/dist/runtime/docker/container.mjs.map +1 -0
  540. package/dist/runtime/docker/errors.d.mts +1 -0
  541. package/dist/runtime/docker/errors.mjs +187 -0
  542. package/dist/runtime/docker/errors.mjs.map +1 -0
  543. package/dist/runtime/docker/exec.d.mts +1 -0
  544. package/dist/runtime/docker/exec.mjs +63 -0
  545. package/dist/runtime/docker/exec.mjs.map +1 -0
  546. package/dist/runtime/docker/image.d.mts +1 -0
  547. package/dist/runtime/docker/image.mjs +278 -0
  548. package/dist/runtime/docker/image.mjs.map +1 -0
  549. package/dist/runtime/docker/index.d.mts +1 -0
  550. package/dist/runtime/docker/inventory.d.mts +1 -0
  551. package/dist/runtime/docker/inventory.mjs +167 -0
  552. package/dist/runtime/docker/inventory.mjs.map +1 -0
  553. package/dist/runtime/docker/labels.d.mts +1 -0
  554. package/dist/runtime/docker/labels.mjs +97 -0
  555. package/dist/runtime/docker/labels.mjs.map +1 -0
  556. package/dist/runtime/docker/logs.d.mts +1 -0
  557. package/dist/runtime/docker/logs.mjs +34 -0
  558. package/dist/runtime/docker/logs.mjs.map +1 -0
  559. package/dist/runtime/docker/network.d.mts +1 -0
  560. package/dist/runtime/docker/network.mjs +168 -0
  561. package/dist/runtime/docker/network.mjs.map +1 -0
  562. package/dist/runtime/docker/service.d.mts +9 -0
  563. package/dist/runtime/docker/service.mjs +266 -0
  564. package/dist/runtime/docker/service.mjs.map +1 -0
  565. package/dist/runtime/docker/sweep.d.mts +1 -0
  566. package/dist/runtime/docker/sweep.mjs +220 -0
  567. package/dist/runtime/docker/sweep.mjs.map +1 -0
  568. package/dist/runtime/docker/volume.d.mts +1 -0
  569. package/dist/runtime/docker/volume.mjs +24 -0
  570. package/dist/runtime/docker/volume.mjs.map +1 -0
  571. package/dist/runtime/docker/wrap.d.mts +1 -0
  572. package/dist/runtime/docker/wrap.mjs +131 -0
  573. package/dist/runtime/docker/wrap.mjs.map +1 -0
  574. package/dist/substrate/brand.d.mts +24 -0
  575. package/dist/substrate/brand.mjs +14 -0
  576. package/dist/substrate/brand.mjs.map +1 -0
  577. package/dist/substrate/cross-process.d.mts +1 -0
  578. package/dist/substrate/cross-process.mjs +28 -0
  579. package/dist/substrate/cross-process.mjs.map +1 -0
  580. package/dist/substrate/events.d.mts +117 -0
  581. package/dist/substrate/identity.d.mts +13 -0
  582. package/dist/substrate/lifecycle.d.mts +12 -0
  583. package/dist/substrate/manifest.d.mts +39 -0
  584. package/dist/substrate/manifest.mjs +33 -0
  585. package/dist/substrate/manifest.mjs.map +1 -0
  586. package/dist/substrate/network.d.mts +34 -0
  587. package/dist/substrate/options.d.mts +23 -0
  588. package/dist/substrate/plugin.d.mts +101 -0
  589. package/dist/substrate/plugin.mjs +61 -0
  590. package/dist/substrate/plugin.mjs.map +1 -0
  591. package/dist/substrate/projection.d.mts +100 -0
  592. package/dist/substrate/runtime/artifact-publisher/index.mjs +76 -0
  593. package/dist/substrate/runtime/artifact-publisher/index.mjs.map +1 -0
  594. package/dist/substrate/runtime/atomic-write.mjs +106 -0
  595. package/dist/substrate/runtime/atomic-write.mjs.map +1 -0
  596. package/dist/substrate/runtime/cache/index.d.mts +1 -0
  597. package/dist/substrate/runtime/cache/schema.d.mts +1 -0
  598. package/dist/substrate/runtime/cache/schema.mjs +22 -0
  599. package/dist/substrate/runtime/cache/schema.mjs.map +1 -0
  600. package/dist/substrate/runtime/cache/service.d.mts +1 -0
  601. package/dist/substrate/runtime/cache/service.mjs +89 -0
  602. package/dist/substrate/runtime/cache/service.mjs.map +1 -0
  603. package/dist/substrate/runtime/capability-sinks/index.d.mts +1 -0
  604. package/dist/substrate/runtime/capability-sinks/layer.d.mts +1 -0
  605. package/dist/substrate/runtime/capability-sinks/layer.mjs +31 -0
  606. package/dist/substrate/runtime/capability-sinks/layer.mjs.map +1 -0
  607. package/dist/substrate/runtime/capability-sinks/service.d.mts +36 -0
  608. package/dist/substrate/runtime/capability-sinks/service.mjs +74 -0
  609. package/dist/substrate/runtime/capability-sinks/service.mjs.map +1 -0
  610. package/dist/substrate/runtime/config-validation.d.mts +38 -0
  611. package/dist/substrate/runtime/config-validation.mjs +137 -0
  612. package/dist/substrate/runtime/config-validation.mjs.map +1 -0
  613. package/dist/substrate/runtime/context-helpers.mjs +32 -0
  614. package/dist/substrate/runtime/context-helpers.mjs.map +1 -0
  615. package/dist/substrate/runtime/cross-process/command-channel/channel.mjs +128 -0
  616. package/dist/substrate/runtime/cross-process/command-channel/channel.mjs.map +1 -0
  617. package/dist/substrate/runtime/cross-process/command-channel/file-channel.mjs +136 -0
  618. package/dist/substrate/runtime/cross-process/command-channel/file-channel.mjs.map +1 -0
  619. package/dist/substrate/runtime/cross-process/command-channel/protocol.mjs +49 -0
  620. package/dist/substrate/runtime/cross-process/command-channel/protocol.mjs.map +1 -0
  621. package/dist/substrate/runtime/cross-process/command-channel/runtime-control-lock.mjs +9 -0
  622. package/dist/substrate/runtime/cross-process/command-channel/runtime-control-lock.mjs.map +1 -0
  623. package/dist/substrate/runtime/cross-process/liveness.mjs +119 -0
  624. package/dist/substrate/runtime/cross-process/liveness.mjs.map +1 -0
  625. package/dist/substrate/runtime/cross-process/roster.mjs +275 -0
  626. package/dist/substrate/runtime/cross-process/roster.mjs.map +1 -0
  627. package/dist/substrate/runtime/cross-process/snapshot-reservation.d.mts +1 -0
  628. package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs +117 -0
  629. package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs.map +1 -0
  630. package/dist/substrate/runtime/cross-process/stack-lock.d.mts +1 -0
  631. package/dist/substrate/runtime/cross-process/stack-lock.mjs +142 -0
  632. package/dist/substrate/runtime/cross-process/stack-lock.mjs.map +1 -0
  633. package/dist/substrate/runtime/current-plugin.mjs +15 -0
  634. package/dist/substrate/runtime/current-plugin.mjs.map +1 -0
  635. package/dist/substrate/runtime/errors.d.mts +1 -0
  636. package/dist/substrate/runtime/errors.mjs +76 -0
  637. package/dist/substrate/runtime/errors.mjs.map +1 -0
  638. package/dist/substrate/runtime/host-tree-tar/index.mjs +364 -0
  639. package/dist/substrate/runtime/host-tree-tar/index.mjs.map +1 -0
  640. package/dist/substrate/runtime/http-probe.d.mts +35 -0
  641. package/dist/substrate/runtime/http-probe.mjs +65 -0
  642. package/dist/substrate/runtime/http-probe.mjs.map +1 -0
  643. package/dist/substrate/runtime/lease-broker/index.d.mts +1 -0
  644. package/dist/substrate/runtime/lease-broker/service.d.mts +64 -0
  645. package/dist/substrate/runtime/lease-broker/service.mjs +155 -0
  646. package/dist/substrate/runtime/lease-broker/service.mjs.map +1 -0
  647. package/dist/substrate/runtime/lifecycle/dep-graph.d.mts +1 -0
  648. package/dist/substrate/runtime/lifecycle/dep-graph.mjs +138 -0
  649. package/dist/substrate/runtime/lifecycle/dep-graph.mjs.map +1 -0
  650. package/dist/substrate/runtime/lifecycle/index.d.mts +1 -0
  651. package/dist/substrate/runtime/lifecycle/lifecycle-fact.mjs +31 -0
  652. package/dist/substrate/runtime/lifecycle/lifecycle-fact.mjs.map +1 -0
  653. package/dist/substrate/runtime/lifecycle/plugin-registry.d.mts +1 -0
  654. package/dist/substrate/runtime/lifecycle/plugin-registry.mjs +133 -0
  655. package/dist/substrate/runtime/lifecycle/plugin-registry.mjs.map +1 -0
  656. package/dist/substrate/runtime/lifecycle/ready-gate.d.mts +1 -0
  657. package/dist/substrate/runtime/lifecycle/ready-gate.mjs +34 -0
  658. package/dist/substrate/runtime/lifecycle/ready-gate.mjs.map +1 -0
  659. package/dist/substrate/runtime/lifecycle/selective-restart.d.mts +1 -0
  660. package/dist/substrate/runtime/lifecycle/selective-restart.mjs +43 -0
  661. package/dist/substrate/runtime/lifecycle/selective-restart.mjs.map +1 -0
  662. package/dist/substrate/runtime/lifecycle/signals.d.mts +1 -0
  663. package/dist/substrate/runtime/lifecycle/signals.mjs +64 -0
  664. package/dist/substrate/runtime/lifecycle/signals.mjs.map +1 -0
  665. package/dist/substrate/runtime/lifecycle/state-machine.d.mts +1 -0
  666. package/dist/substrate/runtime/lifecycle/state-machine.mjs +38 -0
  667. package/dist/substrate/runtime/lifecycle/state-machine.mjs.map +1 -0
  668. package/dist/substrate/runtime/lifecycle/watch-attribution.d.mts +1 -0
  669. package/dist/substrate/runtime/lifecycle/watch-attribution.mjs +27 -0
  670. package/dist/substrate/runtime/lifecycle/watch-attribution.mjs.map +1 -0
  671. package/dist/substrate/runtime/managed-container.d.mts +30 -0
  672. package/dist/substrate/runtime/managed-container.mjs +32 -0
  673. package/dist/substrate/runtime/managed-container.mjs.map +1 -0
  674. package/dist/substrate/runtime/manifest/manifest.mjs +73 -0
  675. package/dist/substrate/runtime/manifest/manifest.mjs.map +1 -0
  676. package/dist/substrate/runtime/mode-errors.d.mts +36 -0
  677. package/dist/substrate/runtime/observability/cascade-formatter.d.mts +1 -0
  678. package/dist/substrate/runtime/observability/cascade-formatter.mjs +135 -0
  679. package/dist/substrate/runtime/observability/cascade-formatter.mjs.map +1 -0
  680. package/dist/substrate/runtime/observability/formatter-registry.d.mts +1 -0
  681. package/dist/substrate/runtime/observability/formatter-registry.mjs +65 -0
  682. package/dist/substrate/runtime/observability/formatter-registry.mjs.map +1 -0
  683. package/dist/substrate/runtime/observability/index.d.mts +3 -0
  684. package/dist/substrate/runtime/observability/logger.d.mts +58 -0
  685. package/dist/substrate/runtime/observability/logger.mjs +89 -0
  686. package/dist/substrate/runtime/observability/logger.mjs.map +1 -0
  687. package/dist/substrate/runtime/observability/pretty-error.d.mts +1 -0
  688. package/dist/substrate/runtime/observability/pretty-error.mjs +119 -0
  689. package/dist/substrate/runtime/observability/pretty-error.mjs.map +1 -0
  690. package/dist/substrate/runtime/observability/process-lines.d.mts +31 -0
  691. package/dist/substrate/runtime/observability/process-lines.mjs +40 -0
  692. package/dist/substrate/runtime/observability/process-lines.mjs.map +1 -0
  693. package/dist/substrate/runtime/observability/redaction.d.mts +28 -0
  694. package/dist/substrate/runtime/observability/redaction.mjs +45 -0
  695. package/dist/substrate/runtime/observability/redaction.mjs.map +1 -0
  696. package/dist/substrate/runtime/observability/spans.d.mts +1 -0
  697. package/dist/substrate/runtime/observability/spans.mjs +87 -0
  698. package/dist/substrate/runtime/observability/spans.mjs.map +1 -0
  699. package/dist/substrate/runtime/observability/subprocess-capture.d.mts +2 -0
  700. package/dist/substrate/runtime/observability/subprocess-capture.mjs +82 -0
  701. package/dist/substrate/runtime/observability/subprocess-capture.mjs.map +1 -0
  702. package/dist/substrate/runtime/paths.d.mts +17 -0
  703. package/dist/substrate/runtime/paths.mjs +61 -0
  704. package/dist/substrate/runtime/paths.mjs.map +1 -0
  705. package/dist/substrate/runtime/port-broker/index.d.mts +1 -0
  706. package/dist/substrate/runtime/port-broker/service.d.mts +1 -0
  707. package/dist/substrate/runtime/port-broker/service.mjs +319 -0
  708. package/dist/substrate/runtime/port-broker/service.mjs.map +1 -0
  709. package/dist/substrate/runtime/post-acquire-tasks.d.mts +1 -0
  710. package/dist/substrate/runtime/post-acquire-tasks.mjs +34 -0
  711. package/dist/substrate/runtime/post-acquire-tasks.mjs.map +1 -0
  712. package/dist/substrate/runtime/probes.d.mts +51 -0
  713. package/dist/substrate/runtime/probes.mjs +84 -0
  714. package/dist/substrate/runtime/probes.mjs.map +1 -0
  715. package/dist/substrate/runtime/process-supervisor.d.mts +57 -0
  716. package/dist/substrate/runtime/process-supervisor.mjs +73 -0
  717. package/dist/substrate/runtime/process-supervisor.mjs.map +1 -0
  718. package/dist/substrate/runtime/projection/operational-endpoints.mjs +44 -0
  719. package/dist/substrate/runtime/projection/operational-endpoints.mjs.map +1 -0
  720. package/dist/substrate/runtime/projection/persisted.mjs +195 -0
  721. package/dist/substrate/runtime/projection/persisted.mjs.map +1 -0
  722. package/dist/substrate/runtime/projection/state-ref.mjs +48 -0
  723. package/dist/substrate/runtime/projection/state-ref.mjs.map +1 -0
  724. package/dist/substrate/runtime/projection/update.mjs +200 -0
  725. package/dist/substrate/runtime/projection/update.mjs.map +1 -0
  726. package/dist/substrate/runtime/retry-policy.d.mts +18 -0
  727. package/dist/substrate/runtime/retry-policy.mjs +16 -0
  728. package/dist/substrate/runtime/retry-policy.mjs.map +1 -0
  729. package/dist/substrate/runtime/run.mjs +86 -0
  730. package/dist/substrate/runtime/run.mjs.map +1 -0
  731. package/dist/substrate/runtime/runtime-decode.d.mts +32 -0
  732. package/dist/substrate/runtime/runtime-decode.mjs +53 -0
  733. package/dist/substrate/runtime/runtime-decode.mjs.map +1 -0
  734. package/dist/substrate/runtime/scoped-http-server.mjs +36 -0
  735. package/dist/substrate/runtime/scoped-http-server.mjs.map +1 -0
  736. package/dist/substrate/runtime/scoped-ref-map/service.mjs +83 -0
  737. package/dist/substrate/runtime/scoped-ref-map/service.mjs.map +1 -0
  738. package/dist/substrate/runtime/stage-and-swap/index.d.mts +1 -0
  739. package/dist/substrate/runtime/stage-and-swap/index.mjs +131 -0
  740. package/dist/substrate/runtime/stage-and-swap/index.mjs.map +1 -0
  741. package/dist/substrate/runtime/state-store/schema.mjs +36 -0
  742. package/dist/substrate/runtime/state-store/schema.mjs.map +1 -0
  743. package/dist/substrate/runtime/strategy-registry/chain-probe-for.d.mts +1 -0
  744. package/dist/substrate/runtime/strategy-registry/chain-probe-for.mjs +22 -0
  745. package/dist/substrate/runtime/strategy-registry/chain-probe-for.mjs.map +1 -0
  746. package/dist/substrate/runtime/strategy-registry/faucet-capability-for.d.mts +1 -0
  747. package/dist/substrate/runtime/strategy-registry/faucet-capability-for.mjs +30 -0
  748. package/dist/substrate/runtime/strategy-registry/faucet-capability-for.mjs.map +1 -0
  749. package/dist/substrate/runtime/strategy-registry/index.d.mts +1 -0
  750. package/dist/substrate/runtime/strategy-registry/service.d.mts +1 -0
  751. package/dist/substrate/runtime/strategy-registry/service.mjs +67 -0
  752. package/dist/substrate/runtime/strategy-registry/service.mjs.map +1 -0
  753. package/dist/substrate/runtime/sui-execute/index.d.mts +11 -0
  754. package/dist/substrate/runtime/sui-execute/index.mjs +144 -0
  755. package/dist/substrate/runtime/sui-execute/index.mjs.map +1 -0
  756. package/dist/substrate/runtime/sui-move-build/index.d.mts +1 -0
  757. package/dist/substrate/runtime/sui-move-build/index.mjs +283 -0
  758. package/dist/substrate/runtime/sui-move-build/index.mjs.map +1 -0
  759. package/dist/substrate/runtime/supervisor.d.mts +1 -0
  760. package/dist/substrate/runtime/supervisor.mjs +831 -0
  761. package/dist/substrate/runtime/supervisor.mjs.map +1 -0
  762. package/dist/surfaces/cli/command-tree.mjs +276 -0
  763. package/dist/surfaces/cli/command-tree.mjs.map +1 -0
  764. package/dist/surfaces/cli/commands/config.mjs +31 -0
  765. package/dist/surfaces/cli/commands/config.mjs.map +1 -0
  766. package/dist/surfaces/cli/commands/confirm-node.mjs +26 -0
  767. package/dist/surfaces/cli/commands/confirm-node.mjs.map +1 -0
  768. package/dist/surfaces/cli/commands/confirm.mjs +26 -0
  769. package/dist/surfaces/cli/commands/confirm.mjs.map +1 -0
  770. package/dist/surfaces/cli/commands/doctor-probes.mjs +452 -0
  771. package/dist/surfaces/cli/commands/doctor-probes.mjs.map +1 -0
  772. package/dist/surfaces/cli/commands/doctor.mjs +38 -0
  773. package/dist/surfaces/cli/commands/doctor.mjs.map +1 -0
  774. package/dist/surfaces/cli/commands/prune-picker.mjs +347 -0
  775. package/dist/surfaces/cli/commands/prune-picker.mjs.map +1 -0
  776. package/dist/surfaces/cli/commands/prune.mjs +178 -0
  777. package/dist/surfaces/cli/commands/prune.mjs.map +1 -0
  778. package/dist/surfaces/cli/commands/snapshot.mjs +141 -0
  779. package/dist/surfaces/cli/commands/snapshot.mjs.map +1 -0
  780. package/dist/surfaces/cli/commands/status.mjs +95 -0
  781. package/dist/surfaces/cli/commands/status.mjs.map +1 -0
  782. package/dist/surfaces/cli/commands/supervisor-presence.mjs +33 -0
  783. package/dist/surfaces/cli/commands/supervisor-presence.mjs.map +1 -0
  784. package/dist/surfaces/cli/commands/wipe.mjs +28 -0
  785. package/dist/surfaces/cli/commands/wipe.mjs.map +1 -0
  786. package/dist/surfaces/cli/envelope.mjs +43 -0
  787. package/dist/surfaces/cli/envelope.mjs.map +1 -0
  788. package/dist/surfaces/cli/errors.mjs +110 -0
  789. package/dist/surfaces/cli/errors.mjs.map +1 -0
  790. package/dist/surfaces/cli/flags.mjs +56 -0
  791. package/dist/surfaces/cli/flags.mjs.map +1 -0
  792. package/dist/surfaces/cli/index.mjs +418 -0
  793. package/dist/surfaces/cli/index.mjs.map +1 -0
  794. package/dist/surfaces/cli/output.mjs +115 -0
  795. package/dist/surfaces/cli/output.mjs.map +1 -0
  796. package/dist/surfaces/cli/sysexits.mjs +139 -0
  797. package/dist/surfaces/cli/sysexits.mjs.map +1 -0
  798. package/dist/surfaces/tui/app.mjs +104 -0
  799. package/dist/surfaces/tui/app.mjs.map +1 -0
  800. package/dist/surfaces/tui/dashboard.mjs +261 -0
  801. package/dist/surfaces/tui/dashboard.mjs.map +1 -0
  802. package/dist/surfaces/tui/display-derivation.mjs +395 -0
  803. package/dist/surfaces/tui/display-derivation.mjs.map +1 -0
  804. package/dist/surfaces/tui/errors.mjs +11 -0
  805. package/dist/surfaces/tui/errors.mjs.map +1 -0
  806. package/dist/surfaces/tui/event-log.mjs +155 -0
  807. package/dist/surfaces/tui/event-log.mjs.map +1 -0
  808. package/dist/surfaces/tui/heartbeat.mjs +33 -0
  809. package/dist/surfaces/tui/heartbeat.mjs.map +1 -0
  810. package/dist/surfaces/tui/index.mjs +50 -0
  811. package/dist/surfaces/tui/index.mjs.map +1 -0
  812. package/dist/surfaces/tui/input.mjs +104 -0
  813. package/dist/surfaces/tui/input.mjs.map +1 -0
  814. package/dist/surfaces/tui/mode-detect.mjs +32 -0
  815. package/dist/surfaces/tui/mode-detect.mjs.map +1 -0
  816. package/dist/surfaces/tui/mount-ink.mjs +31 -0
  817. package/dist/surfaces/tui/mount-ink.mjs.map +1 -0
  818. package/dist/surfaces/tui/plain-renderer.mjs +170 -0
  819. package/dist/surfaces/tui/plain-renderer.mjs.map +1 -0
  820. package/dist/surfaces/tui/resource-table.mjs +507 -0
  821. package/dist/surfaces/tui/resource-table.mjs.map +1 -0
  822. package/images/_shared/signal-forward.sh +77 -0
  823. package/images/postgres/Dockerfile +32 -0
  824. package/images/seal/Dockerfile +68 -0
  825. package/images/seal/entrypoint.sh +65 -0
  826. package/images/sui/Dockerfile +73 -0
  827. package/images/sui/entrypoint.sh +244 -0
  828. package/images/sui-fork/Dockerfile +53 -0
  829. package/images/sui-fork/entrypoint.sh +51 -0
  830. package/images/walrus/Dockerfile +122 -0
  831. package/images/walrus/deploy-walrus.sh +305 -0
  832. package/images/walrus/run-walrus.sh +53 -0
  833. package/package.json +94 -0
@@ -0,0 +1,56 @@
1
+ import { AnyResourceRef, DependencyInput, DependencyList, Plugin, ResolvedDependencies, ResourceRef } from "../../substrate/plugin.mjs";
2
+ import { SeedObjectsAccumulator } from "../sui/seed-objects.mjs";
3
+ import { SuiClient } from "../sui/mode/shared.mjs";
4
+ import { SuiOptions } from "../sui/mode/spec.mjs";
5
+ import { ActionError, ActionPhase } from "./errors.mjs";
6
+ import { DynamicDiscriminator } from "./discriminator.mjs";
7
+ import { ActionReceipt } from "./service.mjs";
8
+ import { ActionBuildContext } from "./build-context.mjs";
9
+ import { Effect, Scope } from "effect";
10
+
11
+ //#region src/plugins/action/index.d.ts
12
+ /** A user-supplied upstream resource ref. The user passes plugin values
13
+ * such as `account('alice')` or `localPackage('demo', ...)`; object,
14
+ * tuple, and single-ref shapes are preserved for the action body. */
15
+ type ActionUpstreamRef = AnyResourceRef;
16
+ /** Options for `action(name, opts)`. */
17
+ type ActionDependencySpec = DependencyInput;
18
+ type ResolvedActionDependencies<Input extends ActionDependencySpec> = ResolvedDependencies<Input>;
19
+ interface ActionOptions<DependsOn extends ActionDependencySpec> {
20
+ /** Upstream refs the action depends on. The shape determines the
21
+ * second argument passed to `body`. */
22
+ readonly dependsOn: DependsOn;
23
+ /** Optional caller-supplied discriminator material. Two shapes:
24
+ * a literal `string`, or a callback `(ctx, deps) => Effect<string>`
25
+ * that receives action helpers plus resolved deps shaped like
26
+ * `dependsOn`, so the discriminator can derive its value from
27
+ * upstream resolved values. See
28
+ * `discriminator.ts`. */
29
+ readonly discriminator?: DynamicDiscriminator<ResolvedActionDependencies<DependsOn>>;
30
+ /** The user's body. Receives action helpers plus resolved deps
31
+ * shaped like `dependsOn`, then returns the on-chain effect.
32
+ *
33
+ * Errors raised here surface as `ActionError({phase:'sign'})`
34
+ * unless the body raises an `ActionError` itself (in which case
35
+ * it propagates verbatim). */
36
+ readonly body: (ctx: ActionBuildContext, deps: ResolvedActionDependencies<DependsOn>) => Effect.Effect<ActionReceipt, ActionError, Scope.Scope>;
37
+ }
38
+ /** Construct the action plugin instance.
39
+ *
40
+ * The result is a plugin/resource ref that:
41
+ *
42
+ * - publishes an `ActionReceipt`-typed resource identified by
43
+ * `action:<name>`,
44
+ * - `dependsOn:` `[suiResource, ...userDependencies]` (Sui hard upstream for
45
+ * ChainProbe lookup + chainId folding),
46
+ * - `role: 'task'` — Action has no long-lived resources;
47
+ * the substrate's lifecycle wrap surfaces it as "done" after
48
+ * `start` resolves.
49
+ */
50
+ declare const action: <const Name extends string, const DependsOn extends ActionDependencySpec>(name: Name, opts: ActionOptions<DependsOn>) => Plugin<`action:${Name}`, ActionReceipt, readonly [ResourceRef<"sui", SuiClient & {
51
+ readonly mode: SuiOptions["mode"];
52
+ readonly seedObjects: SeedObjectsAccumulator;
53
+ }>, ...DependencyList<DependsOn>], readonly []>;
54
+ //#endregion
55
+ export { ActionOptions, ActionUpstreamRef, action };
56
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1,82 @@
1
+ import { definePlugin, dependencyList, resolveDependencyValues, resource } from "../../substrate/plugin.mjs";
2
+ import { pluginErrorContributions } from "../../api/plugin-errors.mjs";
3
+ import { suiResource } from "../sui/index.mjs";
4
+ import { ArtifactPublisherService } from "../../substrate/runtime/artifact-publisher/index.mjs";
5
+ import { chainProbeFor } from "../../substrate/runtime/strategy-registry/chain-probe-for.mjs";
6
+ import { ACTION_ERROR_TAGS, actionError } from "./errors.mjs";
7
+ import { signAndExecute } from "./execute.mjs";
8
+ import { bootActionService, resolveDiscriminator } from "./service.mjs";
9
+ import { Effect } from "effect";
10
+ //#region src/plugins/action/index.ts
11
+ const actionErrorContributions = pluginErrorContributions(ACTION_ERROR_TAGS);
12
+ /** Resource id constructor. The symbolic action name is part of the tag
13
+ * identity so two `action('foo', ...)` calls in one stack collide
14
+ * cleanly at compose time. */
15
+ const actionResourceId = (name) => `action:${name}`;
16
+ /** Construct the action plugin instance.
17
+ *
18
+ * The result is a plugin/resource ref that:
19
+ *
20
+ * - publishes an `ActionReceipt`-typed resource identified by
21
+ * `action:<name>`,
22
+ * - `dependsOn:` `[suiResource, ...userDependencies]` (Sui hard upstream for
23
+ * ChainProbe lookup + chainId folding),
24
+ * - `role: 'task'` — Action has no long-lived resources;
25
+ * the substrate's lifecycle wrap surfaces it as "done" after
26
+ * `start` resolves.
27
+ */
28
+ const action = (name, opts) => {
29
+ const actionRef = resource(actionResourceId(name));
30
+ const upstreamRefs = dependencyList(opts.dependsOn);
31
+ const dependencies = [suiResource, ...upstreamRefs];
32
+ const dependencyResourceIds = upstreamRefs.map(({ id }) => id);
33
+ return definePlugin({
34
+ id: actionRef.id,
35
+ dependsOn: dependencies,
36
+ role: "task",
37
+ start: (deps) => Effect.gen(function* () {
38
+ const [sui, ...resolvedUpstream] = deps;
39
+ const resolvedByResourceId = new Map(upstreamRefs.map((ref, index) => [ref.id, resolvedUpstream[index]]));
40
+ const readDeclaredDependency = (id) => {
41
+ if (!resolvedByResourceId.has(id)) throw new Error(`Action '${name}': dependency '${id}' was not resolved.`);
42
+ return resolvedByResourceId.get(id);
43
+ };
44
+ const publisher = yield* ArtifactPublisherService;
45
+ const probe = yield* chainProbeFor(sui.chain);
46
+ const bodyCtx = {
47
+ sui,
48
+ signAndExecute: (account, build) => signAndExecute({
49
+ actionName: name,
50
+ sui,
51
+ account,
52
+ build
53
+ })
54
+ };
55
+ const bodyDeps = resolveDependencyValues(opts.dependsOn, (member) => readDeclaredDependency(member.id));
56
+ return yield* bootActionService(publisher, probe, {
57
+ actionName: name,
58
+ chainId: sui.chain,
59
+ staticDiscriminator: {
60
+ actionName: name,
61
+ dependencyResourceIds
62
+ },
63
+ dynamicMaterial: resolveDiscriminator(name, opts.discriminator, bodyCtx, bodyDeps),
64
+ body: opts.body(bodyCtx, bodyDeps)
65
+ }).pipe(Effect.catch((err) => {
66
+ if (err._tag === "ActionError") return Effect.fail(err);
67
+ const detail = err.detail ?? `Action '${name}': substrate failure.`;
68
+ return Effect.fail(actionError("sign", {
69
+ actionName: name,
70
+ message: detail,
71
+ cause: err
72
+ }));
73
+ }));
74
+ }),
75
+ capabilities: [],
76
+ errorContributions: actionErrorContributions
77
+ });
78
+ };
79
+ //#endregion
80
+ export { action };
81
+
82
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":["signAndExecuteImpl"],"sources":["../../../src/plugins/action/index.ts"],"sourcesContent":["// Action plugin — barrel + `action(name, opts)` factory.\n//\n// Architecture (16-action.md): an action is a ONE-SHOT on-chain effect\n// (mint, create-singleton-object, seed-config, etc.) that runs after\n// its declared upstream refs (typically a signer account + one or more\n// published packages) are ready. The result (digest + change arrays)\n// is yieldable through the action resource.\n//\n// User-facing factory shape (recommended high-level form):\n//\n// const openLobby = action('connect-four.openLobby', {\n// dependsOn: { signer: alice, pkg: connectFour },\n// body: (ctx, { signer, pkg }) =>\n// ctx.signAndExecute(signer, (tx) => {\n// tx.moveCall({ target: `${pkg.packageId}::game::create_lobby` });\n// }),\n// });\n//\n// The `ctx.signAndExecute(account, build)` helper folds the full\n// build → sign → execute (with `include: {effects, objectTypes}`) →\n// wait-for-finality → envelope-projection pipeline into a single call\n// (see `execute.ts`). The returned `ActionReceipt` carries the real\n// transaction digest and an `objectChanges` array that surfaces the\n// SDK's `changedObjects` (with `kind: 'created' | 'mutated'` + the\n// fully-qualified `objectType` string when available).\n//\n// Resource id: `'action:<name>'` — one tag per user-declared action (the\n// symbolic name is part of the identity so two `action('foo', ...)`\n// calls in one stack collide cleanly at compose time).\n//\n// Caching: delegated to the substrate's `ArtifactPublisher`.\n// Namespace is `action`; the cache key folds chainId + content-hash\n// derived from (name, dependencyResourceIds, dynamic discriminator).\n\nimport { Effect, type Scope } from 'effect';\n\nimport {\n\tdefinePlugin,\n\tdependencyList,\n\tresource,\n\tresolveDependencyValues,\n\ttype AnyResourceRef,\n\ttype DependencyInput,\n\ttype ResolvedDependencies,\n} from '../../api/define-plugin.ts';\nimport { pluginErrorContributions } from '../../api/plugin-errors.ts';\nimport { ArtifactPublisherService } from '../../substrate/runtime/artifact-publisher/index.ts';\nimport { chainProbeFor } from '../../substrate/runtime/strategy-registry/index.ts';\nimport { suiResource } from '../sui/index.ts';\nimport type { SuiProbeKey } from '../sui/chain-probe.ts';\n\nimport type { ActionBuildContext } from './build-context.ts';\nimport { actionError, ACTION_ERROR_TAGS, type ActionError } from './errors.ts';\nimport type { DynamicDiscriminator } from './discriminator.ts';\nimport { signAndExecute as signAndExecuteImpl } from './execute.ts';\nimport {\n\tbootActionService,\n\tresolveDiscriminator,\n\ttype ActionAcquireInputs,\n\ttype ActionReceipt,\n} from './service.ts';\n\nconst actionErrorContributions = pluginErrorContributions(ACTION_ERROR_TAGS);\n\n// ---------------------------------------------------------------------------\n// Resource — one per declared action, keyed by symbolic name\n// ---------------------------------------------------------------------------\n\n/** Resource id constructor. The symbolic action name is part of the tag\n * identity so two `action('foo', ...)` calls in one stack collide\n * cleanly at compose time. */\nexport const actionResourceId = <Name extends string>(name: Name): `action:${Name}` =>\n\t`action:${name}`;\n\nexport type ActionResourceId<Name extends string> = `action:${Name}`;\n\n// ---------------------------------------------------------------------------\n// User-facing factory shape\n// ---------------------------------------------------------------------------\n\n/** A user-supplied upstream resource ref. The user passes plugin values\n * such as `account('alice')` or `localPackage('demo', ...)`; object,\n * tuple, and single-ref shapes are preserved for the action body. */\nexport type ActionUpstreamRef = AnyResourceRef;\n\n/** Options for `action(name, opts)`. */\ntype ActionDependencySpec = DependencyInput;\n\ntype ResolvedActionDependencies<Input extends ActionDependencySpec> = ResolvedDependencies<Input>;\n\nexport interface ActionOptions<DependsOn extends ActionDependencySpec> {\n\t/** Upstream refs the action depends on. The shape determines the\n\t * second argument passed to `body`. */\n\treadonly dependsOn: DependsOn;\n\t/** Optional caller-supplied discriminator material. Two shapes:\n\t * a literal `string`, or a callback `(ctx, deps) => Effect<string>`\n\t * that receives action helpers plus resolved deps shaped like\n\t * `dependsOn`, so the discriminator can derive its value from\n\t * upstream resolved values. See\n\t * `discriminator.ts`. */\n\treadonly discriminator?: DynamicDiscriminator<ResolvedActionDependencies<DependsOn>>;\n\t/** The user's body. Receives action helpers plus resolved deps\n\t * shaped like `dependsOn`, then returns the on-chain effect.\n\t *\n\t * Errors raised here surface as `ActionError({phase:'sign'})`\n\t * unless the body raises an `ActionError` itself (in which case\n\t * it propagates verbatim). */\n\treadonly body: (\n\t\tctx: ActionBuildContext,\n\t\tdeps: ResolvedActionDependencies<DependsOn>,\n\t) => Effect.Effect<ActionReceipt, ActionError, Scope.Scope>;\n}\n\n// ---------------------------------------------------------------------------\n// Factory\n// ---------------------------------------------------------------------------\n\n/** Construct the action plugin instance.\n *\n * The result is a plugin/resource ref that:\n *\n * - publishes an `ActionReceipt`-typed resource identified by\n * `action:<name>`,\n * - `dependsOn:` `[suiResource, ...userDependencies]` (Sui hard upstream for\n * ChainProbe lookup + chainId folding),\n * - `role: 'task'` — Action has no long-lived resources;\n * the substrate's lifecycle wrap surfaces it as \"done\" after\n * `start` resolves.\n */\nexport const action = <const Name extends string, const DependsOn extends ActionDependencySpec>(\n\tname: Name,\n\topts: ActionOptions<DependsOn>,\n) => {\n\tconst actionRef = resource<ActionResourceId<Name>, ActionReceipt>(actionResourceId(name));\n\n\t// Flatten the user-supplied upstream refs for ordering. The start\n\t// body below keeps the original `dependsOn` shape so it can\n\t// reconstruct the user's dependency argument.\n\tconst upstreamRefs = dependencyList(opts.dependsOn);\n\tconst dependencies = [suiResource, ...upstreamRefs] as const;\n\n\t// Static discriminator pieces — known at factory construction\n\t// time. The tag-ids preserve the literal `id` so two actions with\n\t// identical bodies but different upstream packages get different\n\t// cache keys.\n\tconst dependencyResourceIds = upstreamRefs.map(({ id }) => id) as ReadonlyArray<string>;\n\n\treturn definePlugin({\n\t\tid: actionRef.id,\n\t\tdependsOn: dependencies,\n\t\t// Action has no long-lived resources — the body runs once at\n\t\t// acquire and returns; supervisor's lifecycle wrap surfaces\n\t\t// \"done\" after that.\n\t\trole: 'task',\n\t\tstart: (deps) =>\n\t\t\tEffect.gen(function* () {\n\t\t\t\tconst [sui, ...resolvedUpstream] = deps;\n\t\t\t\tconst resolvedByResourceId = new Map<string, unknown>(\n\t\t\t\t\tupstreamRefs.map((ref, index) => [ref.id, resolvedUpstream[index]]),\n\t\t\t\t);\n\t\t\t\tconst readDeclaredDependency = (id: string): unknown => {\n\t\t\t\t\tif (!resolvedByResourceId.has(id)) {\n\t\t\t\t\t\tthrow new Error(`Action '${name}': dependency '${id}' was not resolved.`);\n\t\t\t\t\t}\n\t\t\t\t\treturn resolvedByResourceId.get(id);\n\t\t\t\t};\n\n\t\t\t\t// Substrate-context primitives. artifact publisher + strategy registry\n\t\t\t\t// are both provided by the supervisor's pluginContext.\n\t\t\t\tconst publisher = yield* ArtifactPublisherService;\n\t\t\t\tconst probe = yield* chainProbeFor<SuiProbeKey>(sui.chain);\n\n\t\t\t\t// Compose the user's body Effect, closing over the\n\t\t\t\t// action helper context. Resolved upstream values are\n\t\t\t\t// passed separately in the same shape as `dependsOn`.\n\t\t\t\t// - `ctx.sui` — the resolved SuiClient (always set;\n\t\t\t\t// suiResource is the hard upstream).\n\t\t\t\t// - `ctx.signAndExecute(account, build)` — high-level\n\t\t\t\t// helper that drives the full build → sign → execute\n\t\t\t\t// → wait → project pipeline against the supplied\n\t\t\t\t// account, returning a parsed `ActionReceipt`. This\n\t\t\t\t// is what most action bodies want — it folds the\n\t\t\t\t// SDK-boundary cast + `include: {effects, objectTypes}`\n\t\t\t\t// execute + finality wait + envelope projection.\n\t\t\t\tconst bodyCtx: ActionBuildContext = {\n\t\t\t\t\tsui,\n\t\t\t\t\tsignAndExecute: (account, build) =>\n\t\t\t\t\t\tsignAndExecuteImpl({\n\t\t\t\t\t\t\tactionName: name,\n\t\t\t\t\t\t\tsui,\n\t\t\t\t\t\t\taccount,\n\t\t\t\t\t\t\tbuild,\n\t\t\t\t\t\t}),\n\t\t\t\t};\n\n\t\t\t\tconst bodyDeps = resolveDependencyValues(opts.dependsOn, (member) =>\n\t\t\t\t\treadDeclaredDependency(member.id),\n\t\t\t\t) as ResolvedActionDependencies<DependsOn>;\n\t\t\t\tconst acquireInputs: ActionAcquireInputs = {\n\t\t\t\t\tactionName: name,\n\t\t\t\t\tchainId: sui.chain,\n\t\t\t\t\tstaticDiscriminator: {\n\t\t\t\t\t\tactionName: name,\n\t\t\t\t\t\tdependencyResourceIds,\n\t\t\t\t\t},\n\t\t\t\t\tdynamicMaterial: resolveDiscriminator(name, opts.discriminator, bodyCtx, bodyDeps),\n\t\t\t\t\tbody: opts.body(bodyCtx, bodyDeps),\n\t\t\t\t};\n\n\t\t\t\tconst receipt = yield* bootActionService(publisher, probe, acquireInputs).pipe(\n\t\t\t\t\tEffect.catch((err): Effect.Effect<ActionReceipt, ActionError> => {\n\t\t\t\t\t\t// Re-wrap the ArtifactPublishError into an\n\t\t\t\t\t\t// ActionError so downstream consumers always see\n\t\t\t\t\t\t// the typed `ActionError` shape. The detail\n\t\t\t\t\t\t// already includes the phase + message from the\n\t\t\t\t\t\t// produce-side mapper.\n\t\t\t\t\t\tif ((err as { _tag?: string })._tag === 'ActionError') {\n\t\t\t\t\t\t\treturn Effect.fail(err as ActionError);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst detail =\n\t\t\t\t\t\t\t(err as { detail?: string }).detail ?? `Action '${name}': substrate failure.`;\n\t\t\t\t\t\treturn Effect.fail(\n\t\t\t\t\t\t\tactionError('sign', {\n\t\t\t\t\t\t\t\tactionName: name,\n\t\t\t\t\t\t\t\tmessage: detail,\n\t\t\t\t\t\t\t\tcause: err,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t);\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t\treturn receipt;\n\t\t\t}),\n\t\t// No capability decls today. Future surfaces (codegen of\n\t\t// action receipts, manifest extras) land here.\n\t\tcapabilities: [] as const,\n\t\t// Plugin-side error vocabulary. The supervisor's harvest loop\n\t\t// folds this into the substrate's FormatterRegistry; the\n\t\t// cascade formatter then renders `ActionError`-tagged failures\n\t\t// with the action's phase/message header.\n\t\terrorContributions: actionErrorContributions,\n\t});\n};\n\n// ---------------------------------------------------------------------------\n// Re-exports\n// ---------------------------------------------------------------------------\n\nexport type { ActionBuildContext } from './build-context.ts';\nexport type { ActionError, ActionPhase } from './errors.ts';\nexport { ACTION_ERROR_TAGS } from './errors.ts';\nexport type { ActionLifecyclePhase } from './lifecycle.ts';\nexport type { DynamicDiscriminator, StaticDiscriminator } from './discriminator.ts';\nexport type { ActionReceipt } from './service.ts';\nexport { ActionReceiptSchema } from './service.ts';\nexport type { ActionObjectChange } from './execute.ts';\nexport { signAndExecute } from './execute.ts';\n"],"mappings":";;;;;;;;;;AA8DA,MAAM,2BAA2B,yBAAyB,kBAAkB;;;;AAS5E,MAAa,oBAAyC,SACrD,UAAU;;;;;;;;;;;;;AAyDX,MAAa,UACZ,MACA,SACI;CACJ,MAAM,YAAY,SAAgD,iBAAiB,KAAK,CAAC;CAKzF,MAAM,eAAe,eAAe,KAAK,UAAU;CACnD,MAAM,eAAe,CAAC,aAAa,GAAG,aAAa;CAMnD,MAAM,wBAAwB,aAAa,KAAK,EAAE,SAAS,GAAG;AAE9D,QAAO,aAAa;EACnB,IAAI,UAAU;EACd,WAAW;EAIX,MAAM;EACN,QAAQ,SACP,OAAO,IAAI,aAAa;GACvB,MAAM,CAAC,KAAK,GAAG,oBAAoB;GACnC,MAAM,uBAAuB,IAAI,IAChC,aAAa,KAAK,KAAK,UAAU,CAAC,IAAI,IAAI,iBAAiB,OAAO,CAAC,CACnE;GACD,MAAM,0BAA0B,OAAwB;AACvD,QAAI,CAAC,qBAAqB,IAAI,GAAG,CAChC,OAAM,IAAI,MAAM,WAAW,KAAK,iBAAiB,GAAG,qBAAqB;AAE1E,WAAO,qBAAqB,IAAI,GAAG;;GAKpC,MAAM,YAAY,OAAO;GACzB,MAAM,QAAQ,OAAO,cAA2B,IAAI,MAAM;GAc1D,MAAM,UAA8B;IACnC;IACA,iBAAiB,SAAS,UACzBA,eAAmB;KAClB,YAAY;KACZ;KACA;KACA;KACA,CAAC;IACH;GAED,MAAM,WAAW,wBAAwB,KAAK,YAAY,WACzD,uBAAuB,OAAO,GAAG,CACjC;AAiCD,UAAO,OArBgB,kBAAkB,WAAW,OAAO;IAV1D,YAAY;IACZ,SAAS,IAAI;IACb,qBAAqB;KACpB,YAAY;KACZ;KACA;IACD,iBAAiB,qBAAqB,MAAM,KAAK,eAAe,SAAS,SAAS;IAClF,MAAM,KAAK,KAAK,SAAS,SAAS;IAGqC,CAAC,CAAC,KACzE,OAAO,OAAO,QAAmD;AAMhE,QAAK,IAA0B,SAAS,cACvC,QAAO,OAAO,KAAK,IAAmB;IAEvC,MAAM,SACJ,IAA4B,UAAU,WAAW,KAAK;AACxD,WAAO,OAAO,KACb,YAAY,QAAQ;KACnB,YAAY;KACZ,SAAS;KACT,OAAO;KACP,CAAC,CACF;KACA,CACF;IAEA;EAGH,cAAc,EAAE;EAKhB,oBAAoB;EACpB,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { Effect, Schema, Scope } from "effect";
2
+
3
+ //#region src/plugins/action/service.d.ts
4
+ /** Action receipt — the cached value. Minimal shape: digest is the
5
+ * load-bearing identifier (drives verify probe + downstream
6
+ * consumers); the change arrays are surfaced opaquely (typed
7
+ * `unknown` here so the cache schema stays narrow) but the in-memory
8
+ * shape produced by the `ctx.signAndExecute` helper is
9
+ * `ActionObjectChange` (`{ kind: 'created' | 'mutated', objectId,
10
+ * objectType?, outputState?, idOperation? }`). Consumers can cast or
11
+ * use `findCreatedByType`-style helpers — mirrors v3's
12
+ * `pickCreatedByType(r.objectChanges, ...)` pattern from
13
+ * `examples/connect-four/devstack.config.ts`.
14
+ *
15
+ * Distilled doc §"Capabilities PRODUCED" — the v3 Action's `TxResult`
16
+ * carries `digest`, `effects`, `objectChanges`, `balanceChanges`. We
17
+ * narrow to the columns that fit the cache + are actually used by
18
+ * downstream consumers. */
19
+ interface ActionReceipt {
20
+ readonly digest: string;
21
+ readonly objectChanges?: ReadonlyArray<unknown>;
22
+ readonly balanceChanges?: ReadonlyArray<unknown>;
23
+ }
24
+ //#endregion
25
+ export { ActionReceipt };
26
+ //# sourceMappingURL=service.d.mts.map
@@ -0,0 +1,84 @@
1
+ import { contentHash } from "../../substrate/brand.mjs";
2
+ import { actionError } from "./errors.mjs";
3
+ import { composeDiscriminatorMaterial } from "./discriminator.mjs";
4
+ import { Effect, Schema } from "effect";
5
+ import { createHash } from "node:crypto";
6
+ Schema.Struct({
7
+ digest: Schema.String,
8
+ objectChanges: Schema.optional(Schema.Array(Schema.Unknown)),
9
+ balanceChanges: Schema.optional(Schema.Array(Schema.Unknown))
10
+ });
11
+ /** Verify-probe shape — what `getTransaction(digest)` returns on
12
+ * success. We don't decode the full transaction envelope; presence
13
+ * of the digest field is the "exists" signal. The lenient probe
14
+ * already coerces transient + not-found to null. */
15
+ const VerifyTxShape = Schema.Struct({ digest: Schema.String });
16
+ /** Resolve a `DynamicDiscriminator` against the action's
17
+ * action context and resolved dependency values. Two input shapes
18
+ * (per `DynamicDiscriminator`) collapse onto
19
+ * `Effect<string | undefined, ActionError>`. */
20
+ const resolveDiscriminator = (actionName, dynamic, ctx, deps) => {
21
+ if (dynamic === void 0) return Effect.succeed(void 0);
22
+ if (typeof dynamic === "string") return Effect.succeed(dynamic);
23
+ return dynamic(ctx, deps).pipe(Effect.catch((cause) => Effect.fail(cause._tag === "ActionError" ? cause : actionError("discriminator", {
24
+ actionName,
25
+ message: `Action '${actionName}': discriminator Effect failed.`,
26
+ cause
27
+ }))));
28
+ };
29
+ /** Build the verify-probe Effect for a given cached digest. Lenient
30
+ * mode coerces transient + not-found to null; the substrate then
31
+ * re-produces on null. */
32
+ const buildVerifyProbe = (probe, cachedDigest) => probe.get({
33
+ kind: "transaction",
34
+ digest: cachedDigest
35
+ }, VerifyTxShape, "lenient").pipe(Effect.catch(() => Effect.succeed(null)));
36
+ /** Main acquire body. Composes the ArtifactSpec for the action
37
+ * and yields it to the publisher.
38
+ *
39
+ * Returns the cached/produced `ActionReceipt`. Errors flow as
40
+ * `ActionError | ArtifactPublishError` — the latter when the substrate
41
+ * itself surfaces a produce-failure wrap. */
42
+ const bootActionService = (publisher, probe, inputs) => Effect.gen(function* () {
43
+ yield* Effect.annotateCurrentSpan({
44
+ "action.name": inputs.actionName,
45
+ "action.chain": inputs.chainId
46
+ });
47
+ const resolvedDynamic = yield* inputs.dynamicMaterial;
48
+ const material = composeDiscriminatorMaterial(inputs.staticDiscriminator, resolvedDynamic);
49
+ const inputsHash = contentHash(createHash("sha256").update(material).digest("hex"));
50
+ const produced = yield* publisher.publish({
51
+ namespace: "action",
52
+ chain: inputs.chainId,
53
+ contentHash: inputsHash,
54
+ verifySchema: VerifyTxShape,
55
+ verify: (cached) => buildVerifyProbe(probe, cached.digest),
56
+ produce: Effect.gen(function* () {
57
+ yield* Effect.annotateCurrentSpan({ "action.phase": "building" });
58
+ const receipt = yield* inputs.body.pipe(Effect.catch((cause) => Effect.fail(cause?._tag === "ActionError" ? cause : actionError("sign", {
59
+ actionName: inputs.actionName,
60
+ message: `Action '${inputs.actionName}': body Effect failed.`,
61
+ cause
62
+ }))));
63
+ yield* Effect.annotateCurrentSpan({
64
+ "action.phase": "parsing",
65
+ "action.digest": receipt.digest
66
+ });
67
+ return receipt;
68
+ }).pipe(Effect.mapError((err) => ({
69
+ _tag: "ArtifactPublishError",
70
+ reason: "produce-failed",
71
+ detail: `action.${inputs.actionName} ${err.phase}: ${err.message}`
72
+ }))),
73
+ register: (_artifact) => Effect.void
74
+ });
75
+ if ("digest" in produced && typeof produced.digest === "string") return produced;
76
+ return yield* Effect.fail(actionError("parse", {
77
+ actionName: inputs.actionName,
78
+ message: `Action '${inputs.actionName}': cached payload missing digest.`
79
+ }));
80
+ });
81
+ //#endregion
82
+ export { bootActionService, resolveDiscriminator };
83
+
84
+ //# sourceMappingURL=service.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service.mjs","names":["brandContentHash"],"sources":["../../../src/plugins/action/service.ts"],"sourcesContent":["// Action plugin — main acquire body.\n//\n// Architecture (16-action.md): an action is a ONE-SHOT on-chain effect\n// that runs once per (chain × content-hash), caches its receipt, and\n// re-fires when its discriminator changes (or the chain regenesises).\n//\n// Implementation: thin wrapper over `ArtifactPublisher`. The\n// substrate handles the cache → verify → produce → register cycle; this\n// file composes the spec:\n//\n// - namespace = `action`\n// - chain = Sui dependency's resolved `chain`\n// - contentHash = hash of (actionName, upstreamResourceIds[], dynamic\n// discriminator if any)\n// - verifySchema = `ActionReceiptSchema` — Schema-validated cached\n// shape so a corrupt entry surfaces as a miss\n// - verify = `chainProbe.get({kind:'transaction', digest},\n// VerifyTxShape, 'lenient')` — null on transient\n// or not-found, NOT raise.\n// - produce = user's `body(ctx)` Effect. Wraps any non-tagged\n// throw in `ActionError({phase:'sign'})`.\n// - register = no-op (Action declares no in-process registry —\n// mirrors v3 `services/action.ts:189-191` \"Action\n// does NOT populate any in-process registries\").\n//\n// Constraints honored:\n//\n// - Cache key folds (name, chainId, dependency resource ids, discriminator?) —\n// 16-action.md invariant #1.\n// - Dynamic discriminator re-runs on EVERY acquire — invariant #6.\n// - Lenient verify probe — invariant #4.\n// - signAndExecute failure routes via ActionError(phase: 'sign') —\n// invariant #8 (mirroring v3's `PublishError({phase:'publish-tx'})`,\n// but tagged separately so action consumers `catchTag('ActionError')`\n// without clashing with package's tagged error).\n\nimport { createHash } from 'node:crypto';\n\nimport { Effect, Schema, type Scope } from 'effect';\n\nimport { contentHash as brandContentHash, type ChainId } from '../../substrate/brand.ts';\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/chain-probe.ts';\nimport type { ActionBuildContext } from './build-context.ts';\nimport { actionError, type ActionError } from './errors.ts';\nimport {\n\tcomposeDiscriminatorMaterial,\n\ttype DynamicDiscriminator,\n\ttype StaticDiscriminator,\n} from './discriminator.ts';\n\n/** Action receipt — the cached value. Minimal shape: digest is the\n * load-bearing identifier (drives verify probe + downstream\n * consumers); the change arrays are surfaced opaquely (typed\n * `unknown` here so the cache schema stays narrow) but the in-memory\n * shape produced by the `ctx.signAndExecute` helper is\n * `ActionObjectChange` (`{ kind: 'created' | 'mutated', objectId,\n * objectType?, outputState?, idOperation? }`). Consumers can cast or\n * use `findCreatedByType`-style helpers — mirrors v3's\n * `pickCreatedByType(r.objectChanges, ...)` pattern from\n * `examples/connect-four/devstack.config.ts`.\n *\n * Distilled doc §\"Capabilities PRODUCED\" — the v3 Action's `TxResult`\n * carries `digest`, `effects`, `objectChanges`, `balanceChanges`. We\n * narrow to the columns that fit the cache + are actually used by\n * downstream consumers. */\nexport interface ActionReceipt {\n\treadonly digest: string;\n\treadonly objectChanges?: ReadonlyArray<unknown>;\n\treadonly balanceChanges?: ReadonlyArray<unknown>;\n}\n\n/** Schema for the cached `ActionReceipt`. `objectChanges` /\n * `balanceChanges` are `Unknown`-typed arrays — we don't enforce the\n * SDK's wide change-shape here because callers project these\n * manually (mirrors v3's `pickCreatedByType(r.objectChanges, ...)`\n * pattern from `examples/connect-four/devstack.config.ts`). */\nexport const ActionReceiptSchema = Schema.Struct({\n\tdigest: Schema.String,\n\tobjectChanges: Schema.optional(Schema.Array(Schema.Unknown)),\n\tbalanceChanges: Schema.optional(Schema.Array(Schema.Unknown)),\n});\n\n/** Verify-probe shape — what `getTransaction(digest)` returns on\n * success. We don't decode the full transaction envelope; presence\n * of the digest field is the \"exists\" signal. The lenient probe\n * already coerces transient + not-found to null. */\nconst VerifyTxShape = Schema.Struct({\n\tdigest: Schema.String,\n});\n\n/** Per-acquire inputs handed to `bootActionService`. The dynamic\n * discriminator is pre-resolved by `index.ts` — at this layer the\n * `staticDiscriminator` + optional `dynamicMaterial` string suffice. */\nexport interface ActionAcquireInputs {\n\treadonly actionName: string;\n\treadonly chainId: ChainId;\n\treadonly staticDiscriminator: StaticDiscriminator;\n\t/** Resolved dynamic-discriminator material — already projected to\n\t * a string at acquire-time by `index.ts` (the callback form\n\t * receives the `ActionBuildContext` there). */\n\treadonly dynamicMaterial: Effect.Effect<string | undefined, ActionError>;\n\t/** The user's body Effect. Receives no parameter — it closes over\n\t * upstream-tag values via the outer `acquire` scope. Returns the\n\t * receipt of the on-chain effect; the plugin caches this. */\n\treadonly body: Effect.Effect<ActionReceipt, ActionError, Scope.Scope>;\n}\n\n/** Resolve a `DynamicDiscriminator` against the action's\n * action context and resolved dependency values. Two input shapes\n * (per `DynamicDiscriminator`) collapse onto\n * `Effect<string | undefined, ActionError>`. */\nexport const resolveDiscriminator = <Deps>(\n\tactionName: string,\n\tdynamic: DynamicDiscriminator<Deps> | undefined,\n\tctx: ActionBuildContext,\n\tdeps: Deps,\n): Effect.Effect<string | undefined, ActionError> => {\n\tif (dynamic === undefined) return Effect.succeed(undefined);\n\tif (typeof dynamic === 'string') return Effect.succeed(dynamic);\n\treturn dynamic(ctx, deps).pipe(\n\t\tEffect.catch(\n\t\t\t(cause): Effect.Effect<string, ActionError> =>\n\t\t\t\tEffect.fail(\n\t\t\t\t\t// If the user's discriminator Effect itself raises an\n\t\t\t\t\t// ActionError, surface it verbatim. Otherwise wrap.\n\t\t\t\t\t(cause as ActionError)._tag === 'ActionError'\n\t\t\t\t\t\t? (cause as ActionError)\n\t\t\t\t\t\t: actionError('discriminator', {\n\t\t\t\t\t\t\t\tactionName,\n\t\t\t\t\t\t\t\tmessage: `Action '${actionName}': discriminator Effect failed.`,\n\t\t\t\t\t\t\t\tcause,\n\t\t\t\t\t\t\t}),\n\t\t\t\t),\n\t\t),\n\t);\n};\n\n/** Build the verify-probe Effect for a given cached digest. Lenient\n * mode coerces transient + not-found to null; the substrate then\n * re-produces on null. */\nconst buildVerifyProbe = (\n\tprobe: ChainProbe<SuiProbeKey>,\n\tcachedDigest: string,\n): Effect.Effect<typeof VerifyTxShape.Type | null, never> =>\n\tprobe.get({ kind: 'transaction', digest: cachedDigest }, VerifyTxShape, 'lenient').pipe(\n\t\t// `decode-failed` on verify is stale shape — null so the\n\t\t// substrate re-fires rather than carry forward a mismatch.\n\t\tEffect.catch(() => Effect.succeed(null as typeof VerifyTxShape.Type | null)),\n\t);\n\n/** Main acquire body. Composes the ArtifactSpec for the action\n * and yields it to the publisher.\n *\n * Returns the cached/produced `ActionReceipt`. Errors flow as\n * `ActionError | ArtifactPublishError` — the latter when the substrate\n * itself surfaces a produce-failure wrap. */\nexport const bootActionService = (\n\tpublisher: ArtifactPublisher,\n\tprobe: ChainProbe<SuiProbeKey>,\n\tinputs: ActionAcquireInputs,\n): Effect.Effect<ActionReceipt, ActionError | ArtifactPublishError, Scope.Scope> =>\n\tEffect.gen(function* () {\n\t\tyield* Effect.annotateCurrentSpan({\n\t\t\t'action.name': inputs.actionName,\n\t\t\t'action.chain': inputs.chainId,\n\t\t});\n\n\t\t// --- Pull the pre-projected dynamic-discriminator material\n\t\t// (every acquire — hit OR miss). The callback form's\n\t\t// `(ctx) => Effect<string>` is invoked by `index.ts` before\n\t\t// reaching here, so this layer sees only the resolved Effect.\n\t\tconst resolvedDynamic = yield* inputs.dynamicMaterial;\n\n\t\t// --- Compose content-hash inputs\n\t\tconst material = composeDiscriminatorMaterial(inputs.staticDiscriminator, resolvedDynamic);\n\t\tconst inputsHash = brandContentHash(createHash('sha256').update(material).digest('hex'));\n\n\t\t// --- Submit the spec to the publisher.\n\t\t//\n\t\t// The artifact publisher substrate decodes the cached `ActionReceipt` and\n\t\t// passes it into `verify(cached)` — so the verify Effect can\n\t\t// pull the digest off the cached payload directly. No\n\t\t// in-process registry-hop required (mirrors the seam pattern\n\t\t// the package plugin's mode-local TODO calls out).\n\t\tconst produced = yield* publisher.publish<ActionReceipt, typeof VerifyTxShape.Type>({\n\t\t\tnamespace: 'action',\n\t\t\tchain: inputs.chainId,\n\t\t\tcontentHash: inputsHash,\n\t\t\tverifySchema: VerifyTxShape,\n\t\t\tverify: (cached) => buildVerifyProbe(probe, cached.digest),\n\t\t\tproduce: Effect.gen(function* () {\n\t\t\t\tyield* Effect.annotateCurrentSpan({\n\t\t\t\t\t'action.phase': 'building',\n\t\t\t\t});\n\t\t\t\tconst receipt: ActionReceipt = yield* inputs.body.pipe(\n\t\t\t\t\tEffect.catch(\n\t\t\t\t\t\t(cause): Effect.Effect<ActionReceipt, ActionError> =>\n\t\t\t\t\t\t\tEffect.fail(\n\t\t\t\t\t\t\t\t(cause as ActionError)?._tag === 'ActionError'\n\t\t\t\t\t\t\t\t\t? (cause as ActionError)\n\t\t\t\t\t\t\t\t\t: actionError('sign', {\n\t\t\t\t\t\t\t\t\t\t\tactionName: inputs.actionName,\n\t\t\t\t\t\t\t\t\t\t\tmessage: `Action '${inputs.actionName}': body Effect failed.`,\n\t\t\t\t\t\t\t\t\t\t\tcause,\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\tyield* Effect.annotateCurrentSpan({\n\t\t\t\t\t'action.phase': 'parsing',\n\t\t\t\t\t'action.digest': receipt.digest,\n\t\t\t\t});\n\t\t\t\treturn receipt;\n\t\t\t}).pipe(\n\t\t\t\tEffect.mapError(\n\t\t\t\t\t(err): ArtifactPublishError => ({\n\t\t\t\t\t\t_tag: 'ArtifactPublishError',\n\t\t\t\t\t\treason: 'produce-failed',\n\t\t\t\t\t\tdetail: `action.${inputs.actionName} ${err.phase}: ${err.message}`,\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t),\n\t\t\tregister: (_artifact) =>\n\t\t\t\t// Action declares no in-process registry (mirrors v3's\n\t\t\t\t// `services/action.ts:189-191` \"Action does NOT populate\n\t\t\t\t// any in-process registries\"). The cached digest is now\n\t\t\t\t// threaded directly via the artifact publisher's `verify(cached)`\n\t\t\t\t// parameter — no register-hop hint required.\n\t\t\t\tEffect.void,\n\t\t});\n\n\t\t// The publisher returns `Produced | Verified`. Both shapes\n\t\t// carry `digest`; the action's resolved value is the cached\n\t\t// receipt (full `ActionReceipt` on produce/decoded-hit, or a\n\t\t// projected `{digest}` on bare-verify-hit). Callers expect the\n\t\t// wider shape — surface defensively.\n\t\tif ('digest' in produced && typeof produced.digest === 'string') {\n\t\t\t// Already-`ActionReceipt`-shaped. Cast through to recover\n\t\t\t// the optional change arrays if present.\n\t\t\treturn produced as ActionReceipt;\n\t\t}\n\t\t// Defensive: unreachable under the current substrate (verify\n\t\t// returns the bare `{digest}` shape; the substrate falls back\n\t\t// to it ONLY when the cached payload failed to decode, which\n\t\t// we treat as miss elsewhere). Surface a parse-phase error.\n\t\treturn yield* Effect.fail(\n\t\t\tactionError('parse', {\n\t\t\t\tactionName: inputs.actionName,\n\t\t\t\tmessage: `Action '${inputs.actionName}': cached payload missing digest.`,\n\t\t\t}),\n\t\t);\n\t});\n"],"mappings":";;;;;AAiFmC,OAAO,OAAO;CAChD,QAAQ,OAAO;CACf,eAAe,OAAO,SAAS,OAAO,MAAM,OAAO,QAAQ,CAAC;CAC5D,gBAAgB,OAAO,SAAS,OAAO,MAAM,OAAO,QAAQ,CAAC;CAC7D,CAAC;;;;;AAMF,MAAM,gBAAgB,OAAO,OAAO,EACnC,QAAQ,OAAO,QACf,CAAC;;;;;AAuBF,MAAa,wBACZ,YACA,SACA,KACA,SACoD;AACpD,KAAI,YAAY,KAAA,EAAW,QAAO,OAAO,QAAQ,KAAA,EAAU;AAC3D,KAAI,OAAO,YAAY,SAAU,QAAO,OAAO,QAAQ,QAAQ;AAC/D,QAAO,QAAQ,KAAK,KAAK,CAAC,KACzB,OAAO,OACL,UACA,OAAO,KAGL,MAAsB,SAAS,gBAC5B,QACD,YAAY,iBAAiB;EAC7B;EACA,SAAS,WAAW,WAAW;EAC/B;EACA,CAAC,CACJ,CACF,CACD;;;;;AAMF,MAAM,oBACL,OACA,iBAEA,MAAM,IAAI;CAAE,MAAM;CAAe,QAAQ;CAAc,EAAE,eAAe,UAAU,CAAC,KAGlF,OAAO,YAAY,OAAO,QAAQ,KAAyC,CAAC,CAC5E;;;;;;;AAQF,MAAa,qBACZ,WACA,OACA,WAEA,OAAO,IAAI,aAAa;AACvB,QAAO,OAAO,oBAAoB;EACjC,eAAe,OAAO;EACtB,gBAAgB,OAAO;EACvB,CAAC;CAMF,MAAM,kBAAkB,OAAO,OAAO;CAGtC,MAAM,WAAW,6BAA6B,OAAO,qBAAqB,gBAAgB;CAC1F,MAAM,aAAaA,YAAiB,WAAW,SAAS,CAAC,OAAO,SAAS,CAAC,OAAO,MAAM,CAAC;CASxF,MAAM,WAAW,OAAO,UAAU,QAAkD;EACnF,WAAW;EACX,OAAO,OAAO;EACd,aAAa;EACb,cAAc;EACd,SAAS,WAAW,iBAAiB,OAAO,OAAO,OAAO;EAC1D,SAAS,OAAO,IAAI,aAAa;AAChC,UAAO,OAAO,oBAAoB,EACjC,gBAAgB,YAChB,CAAC;GACF,MAAM,UAAyB,OAAO,OAAO,KAAK,KACjD,OAAO,OACL,UACA,OAAO,KACL,OAAuB,SAAS,gBAC7B,QACD,YAAY,QAAQ;IACpB,YAAY,OAAO;IACnB,SAAS,WAAW,OAAO,WAAW;IACtC;IACA,CAAC,CACJ,CACF,CACD;AACD,UAAO,OAAO,oBAAoB;IACjC,gBAAgB;IAChB,iBAAiB,QAAQ;IACzB,CAAC;AACF,UAAO;IACN,CAAC,KACF,OAAO,UACL,SAA+B;GAC/B,MAAM;GACN,QAAQ;GACR,QAAQ,UAAU,OAAO,WAAW,GAAG,IAAI,MAAM,IAAI,IAAI;GACzD,EACD,CACD;EACD,WAAW,cAMV,OAAO;EACR,CAAC;AAOF,KAAI,YAAY,YAAY,OAAO,SAAS,WAAW,SAGtD,QAAO;AAMR,QAAO,OAAO,OAAO,KACpB,YAAY,SAAS;EACpB,YAAY,OAAO;EACnB,SAAS,WAAW,OAAO,WAAW;EACtC,CAAC,CACF;EACA"}
@@ -0,0 +1,34 @@
1
+ import { Effect } from "effect";
2
+
3
+ //#region src/plugins/coin/address-resolution.d.ts
4
+ /** The Tag's resolved value. One uniform shape across all three
5
+ * address forms — downstream consumers branch on `source` only if
6
+ * they care about provenance. */
7
+ interface ResolvedCoin {
8
+ readonly fullCoinType: string;
9
+ readonly decimals: number;
10
+ readonly source: 'registry' | 'on-chain' | 'builtin';
11
+ readonly symbol?: string;
12
+ readonly displayName?: string;
13
+ readonly iconUrl?: string;
14
+ readonly treasuryCapId?: string;
15
+ readonly metadataId?: string;
16
+ readonly packageId?: string;
17
+ }
18
+ /** Distilled-doc 13-coin.md Invariant 4: `BUILTIN_COINS.sui` MUST
19
+ * always be `0x2::sui::SUI` with `decimals: 9`. Protocol-defined; any
20
+ * divergence breaks downstream guards (Deepbook's SUI guard, the
21
+ * balance UI's canonical-type compare). */
22
+ declare const BUILTIN_COINS: {
23
+ readonly sui: {
24
+ fullCoinType: string;
25
+ decimals: number;
26
+ source: "builtin";
27
+ symbol: string;
28
+ displayName: string;
29
+ };
30
+ };
31
+ type BuiltinCoinName = keyof typeof BUILTIN_COINS;
32
+ //#endregion
33
+ export { BUILTIN_COINS, BuiltinCoinName, ResolvedCoin };
34
+ //# sourceMappingURL=address-resolution.d.mts.map
@@ -0,0 +1,80 @@
1
+ import { coinError } from "./errors.mjs";
2
+ import { fetchCoinMetadataOnce, isBareCoinType, validateBareCoinType } from "./metadata.mjs";
3
+ import { Effect } from "effect";
4
+ //#region src/plugins/coin/address-resolution.ts
5
+ /** Distilled-doc 13-coin.md Invariant 4: `BUILTIN_COINS.sui` MUST
6
+ * always be `0x2::sui::SUI` with `decimals: 9`. Protocol-defined; any
7
+ * divergence breaks downstream guards (Deepbook's SUI guard, the
8
+ * balance UI's canonical-type compare). */
9
+ const BUILTIN_COINS = { sui: {
10
+ fullCoinType: "0x2::sui::SUI",
11
+ decimals: 9,
12
+ source: "builtin",
13
+ symbol: "SUI",
14
+ displayName: "Sui"
15
+ } };
16
+ /** Resolve a builtin coin. Pure constant — no Effect, no upstream. */
17
+ const resolveBuiltin = (name) => BUILTIN_COINS[name];
18
+ /** Project a `CoinRecord` to the resolved-value shape. Shared across
19
+ * registry-backed forms. */
20
+ const projectRecord = (record, source) => ({
21
+ fullCoinType: record.type,
22
+ decimals: record.decimals,
23
+ source,
24
+ ...record.symbol !== void 0 ? { symbol: record.symbol } : {},
25
+ ...record.displayName !== void 0 ? { displayName: record.displayName } : {},
26
+ ...record.iconUrl !== void 0 ? { iconUrl: record.iconUrl } : {},
27
+ ...record.treasuryCapId !== void 0 ? { treasuryCapId: record.treasuryCapId } : {},
28
+ ...record.metadataId !== void 0 ? { metadataId: record.metadataId } : {},
29
+ packageId: record.packageId
30
+ });
31
+ /** Resolve a coin by `(publishing package's symbolic name, witness)`.
32
+ * Distilled-doc 13-coin.md §"Lifecycle" path 3: the caller yields
33
+ * the package tag first to force the dep edge; this helper assumes
34
+ * the registry is already populated by the time it runs. */
35
+ const resolveByWitness = (registry, packageName, witness) => Effect.gen(function* () {
36
+ const record = yield* registry.byWitness(packageName, witness);
37
+ if (record === null) {
38
+ const candidates = (yield* registry.list()).filter((r) => r.publishingPackageName === packageName).map((r) => r.symbol ?? r.witness);
39
+ return yield* Effect.fail(coinError("not-found", {
40
+ identifier: `${packageName}::${witness}`,
41
+ message: `coin.fromPackage('${packageName}', '${witness}'): witness not present in the package's discovered coins.`,
42
+ candidates
43
+ }));
44
+ }
45
+ return projectRecord(record, "registry");
46
+ });
47
+ /** Resolve a coin by bare on-chain type. Calls `getCoinMetadata`
48
+ * against the resolved Sui client; soft-degrades to `decimals: 0` on
49
+ * RPC failure (distilled-doc 13-coin.md Failure modes table).
50
+ *
51
+ * Bare type is validated first (distilled-doc invariant 7: refuses
52
+ * nested generics). The validator surfaces `CoinError('nested-
53
+ * generic')`; everything else falls through to the lenient fetch. */
54
+ const resolveByBareType = (sdk, fullCoinType) => Effect.gen(function* () {
55
+ const validation = validateBareCoinType(fullCoinType);
56
+ if (validation !== null) return yield* Effect.fail(validation);
57
+ if (!isBareCoinType(fullCoinType)) return yield* Effect.fail(coinError("not-found", {
58
+ identifier: fullCoinType,
59
+ message: `coin.known('${fullCoinType}'): not a bare on-chain coin type — expected '0xHEX::module::Witness'.`
60
+ }));
61
+ const metadata = yield* fetchCoinMetadataOnce(sdk, fullCoinType);
62
+ if (metadata === null) return {
63
+ fullCoinType,
64
+ decimals: 0,
65
+ source: "on-chain"
66
+ };
67
+ return {
68
+ fullCoinType,
69
+ decimals: metadata.decimals,
70
+ source: "on-chain",
71
+ symbol: metadata.symbol,
72
+ displayName: metadata.name,
73
+ ...metadata.iconUrl !== void 0 ? { iconUrl: metadata.iconUrl } : {},
74
+ metadataId: metadata.id
75
+ };
76
+ });
77
+ //#endregion
78
+ export { BUILTIN_COINS, resolveBuiltin, resolveByBareType, resolveByWitness };
79
+
80
+ //# sourceMappingURL=address-resolution.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"address-resolution.mjs","names":[],"sources":["../../../src/plugins/coin/address-resolution.ts"],"sourcesContent":["// Coin address-resolution — the three user-facing forms unified.\n//\n// Distilled-doc 13-coin.md §Configuration: the user-facing\n// `coin(...)` factory takes one of three address forms. Each form\n// resolves to a `ResolvedCoin`:\n//\n// 1. **Package-scoped witness** — `coin.fromPackage(pkg, 'MOCK_USDC')`.\n// Forces a dependency edge on the publishing package resource, then\n// reads its publish output's discovered coins. Statically typed\n// against local packages only (KnownPackages have no output).\n//\n// 2. **Bare on-chain type** — `coin.known('0x...::DEEP::DEEP')`.\n// Bypasses the registry; calls `getCoinMetadata` against the\n// resolved Sui client. Use for live-net coins (mainnet DEEP).\n//\n// 3. **Builtin SUI** — `coin.builtin('sui')`. Pure constant.\n// Resolves to `0x2::sui::SUI` with `decimals: 9` synchronously.\n//\n// Each form returns a `ResolvedCoin` carrying the same shape so\n// downstream consumers (Wallet balance UI, Faucet treasury-cap mint,\n// Deepbook market maker) see one consistent value.\n\nimport { Effect } from 'effect';\n\nimport { coinError, type CoinError } from './errors.ts';\nimport {\n\tfetchCoinMetadataOnce,\n\tisBareCoinType,\n\tvalidateBareCoinType,\n\ttype MetadataSdkShim,\n} from './metadata.ts';\nimport type { CoinRecord, CoinRegistry } from './registry.ts';\n\n/** The Tag's resolved value. One uniform shape across all three\n * address forms — downstream consumers branch on `source` only if\n * they care about provenance. */\nexport interface ResolvedCoin {\n\treadonly fullCoinType: string;\n\treadonly decimals: number;\n\treadonly source: 'registry' | 'on-chain' | 'builtin';\n\treadonly symbol?: string;\n\treadonly displayName?: string;\n\treadonly iconUrl?: string;\n\treadonly treasuryCapId?: string;\n\treadonly metadataId?: string;\n\treadonly packageId?: string;\n}\n\n// -----------------------------------------------------------------------------\n// Builtin SUI\n// -----------------------------------------------------------------------------\n\n/** Distilled-doc 13-coin.md Invariant 4: `BUILTIN_COINS.sui` MUST\n * always be `0x2::sui::SUI` with `decimals: 9`. Protocol-defined; any\n * divergence breaks downstream guards (Deepbook's SUI guard, the\n * balance UI's canonical-type compare). */\nexport const BUILTIN_COINS = {\n\tsui: {\n\t\tfullCoinType: '0x2::sui::SUI',\n\t\tdecimals: 9,\n\t\tsource: 'builtin' as const,\n\t\tsymbol: 'SUI',\n\t\tdisplayName: 'Sui',\n\t} satisfies ResolvedCoin,\n} as const;\n\nexport type BuiltinCoinName = keyof typeof BUILTIN_COINS;\n\n/** Resolve a builtin coin. Pure constant — no Effect, no upstream. */\nexport const resolveBuiltin = (name: BuiltinCoinName): ResolvedCoin => BUILTIN_COINS[name];\n\n// -----------------------------------------------------------------------------\n// Registry record projection\n// -----------------------------------------------------------------------------\n\n/** Project a `CoinRecord` to the resolved-value shape. Shared across\n * registry-backed forms. */\nconst projectRecord = (record: CoinRecord, source: 'registry'): ResolvedCoin => ({\n\tfullCoinType: record.type,\n\tdecimals: record.decimals,\n\tsource,\n\t...(record.symbol !== undefined ? { symbol: record.symbol } : {}),\n\t...(record.displayName !== undefined ? { displayName: record.displayName } : {}),\n\t...(record.iconUrl !== undefined ? { iconUrl: record.iconUrl } : {}),\n\t...(record.treasuryCapId !== undefined ? { treasuryCapId: record.treasuryCapId } : {}),\n\t...(record.metadataId !== undefined ? { metadataId: record.metadataId } : {}),\n\tpackageId: record.packageId,\n});\n\n// -----------------------------------------------------------------------------\n// Form 1: package-scoped witness → registry\n// -----------------------------------------------------------------------------\n\n/** Resolve a coin by `(publishing package's symbolic name, witness)`.\n * Distilled-doc 13-coin.md §\"Lifecycle\" path 3: the caller yields\n * the package tag first to force the dep edge; this helper assumes\n * the registry is already populated by the time it runs. */\nexport const resolveByWitness = (\n\tregistry: CoinRegistry,\n\tpackageName: string,\n\twitness: string,\n): Effect.Effect<ResolvedCoin, CoinError> =>\n\tEffect.gen(function* () {\n\t\tconst record = yield* registry.byWitness(packageName, witness);\n\t\tif (record === null) {\n\t\t\tconst candidates = (yield* registry.list())\n\t\t\t\t.filter((r) => r.publishingPackageName === packageName)\n\t\t\t\t.map((r) => r.symbol ?? r.witness);\n\t\t\treturn yield* Effect.fail(\n\t\t\t\tcoinError('not-found', {\n\t\t\t\t\tidentifier: `${packageName}::${witness}`,\n\t\t\t\t\tmessage: `coin.fromPackage('${packageName}', '${witness}'): witness not present in the package's discovered coins.`,\n\t\t\t\t\tcandidates,\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\t\treturn projectRecord(record, 'registry');\n\t});\n\n// -----------------------------------------------------------------------------\n// Form 2: bare on-chain type → live RPC\n// -----------------------------------------------------------------------------\n\n/** Resolve a coin by bare on-chain type. Calls `getCoinMetadata`\n * against the resolved Sui client; soft-degrades to `decimals: 0` on\n * RPC failure (distilled-doc 13-coin.md Failure modes table).\n *\n * Bare type is validated first (distilled-doc invariant 7: refuses\n * nested generics). The validator surfaces `CoinError('nested-\n * generic')`; everything else falls through to the lenient fetch. */\nexport const resolveByBareType = (\n\tsdk: MetadataSdkShim,\n\tfullCoinType: string,\n): Effect.Effect<ResolvedCoin, CoinError> =>\n\tEffect.gen(function* () {\n\t\tconst validation = validateBareCoinType(fullCoinType);\n\t\tif (validation !== null) {\n\t\t\treturn yield* Effect.fail(validation);\n\t\t}\n\t\tif (!isBareCoinType(fullCoinType)) {\n\t\t\treturn yield* Effect.fail(\n\t\t\t\tcoinError('not-found', {\n\t\t\t\t\tidentifier: fullCoinType,\n\t\t\t\t\tmessage: `coin.known('${fullCoinType}'): not a bare on-chain coin type — expected '0xHEX::module::Witness'.`,\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\t\tconst metadata = yield* fetchCoinMetadataOnce(sdk, fullCoinType);\n\t\tif (metadata === null) {\n\t\t\t// Soft-degradation: surface a record with decimals=0 and no\n\t\t\t// metadata. Downstream consumers that NEED metadata see\n\t\t\t// degraded fields — but we don't fail boot.\n\t\t\treturn {\n\t\t\t\tfullCoinType,\n\t\t\t\tdecimals: 0,\n\t\t\t\tsource: 'on-chain',\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\tfullCoinType,\n\t\t\tdecimals: metadata.decimals,\n\t\t\tsource: 'on-chain',\n\t\t\tsymbol: metadata.symbol,\n\t\t\tdisplayName: metadata.name,\n\t\t\t...(metadata.iconUrl !== undefined ? { iconUrl: metadata.iconUrl } : {}),\n\t\t\tmetadataId: metadata.id,\n\t\t};\n\t});\n"],"mappings":";;;;;;;;AAwDA,MAAa,gBAAgB,EAC5B,KAAK;CACJ,cAAc;CACd,UAAU;CACV,QAAQ;CACR,QAAQ;CACR,aAAa;CACb,EACD;;AAKD,MAAa,kBAAkB,SAAwC,cAAc;;;AAQrF,MAAM,iBAAiB,QAAoB,YAAsC;CAChF,cAAc,OAAO;CACrB,UAAU,OAAO;CACjB;CACA,GAAI,OAAO,WAAW,KAAA,IAAY,EAAE,QAAQ,OAAO,QAAQ,GAAG,EAAE;CAChE,GAAI,OAAO,gBAAgB,KAAA,IAAY,EAAE,aAAa,OAAO,aAAa,GAAG,EAAE;CAC/E,GAAI,OAAO,YAAY,KAAA,IAAY,EAAE,SAAS,OAAO,SAAS,GAAG,EAAE;CACnE,GAAI,OAAO,kBAAkB,KAAA,IAAY,EAAE,eAAe,OAAO,eAAe,GAAG,EAAE;CACrF,GAAI,OAAO,eAAe,KAAA,IAAY,EAAE,YAAY,OAAO,YAAY,GAAG,EAAE;CAC5E,WAAW,OAAO;CAClB;;;;;AAUD,MAAa,oBACZ,UACA,aACA,YAEA,OAAO,IAAI,aAAa;CACvB,MAAM,SAAS,OAAO,SAAS,UAAU,aAAa,QAAQ;AAC9D,KAAI,WAAW,MAAM;EACpB,MAAM,cAAc,OAAO,SAAS,MAAM,EACxC,QAAQ,MAAM,EAAE,0BAA0B,YAAY,CACtD,KAAK,MAAM,EAAE,UAAU,EAAE,QAAQ;AACnC,SAAO,OAAO,OAAO,KACpB,UAAU,aAAa;GACtB,YAAY,GAAG,YAAY,IAAI;GAC/B,SAAS,qBAAqB,YAAY,MAAM,QAAQ;GACxD;GACA,CAAC,CACF;;AAEF,QAAO,cAAc,QAAQ,WAAW;EACvC;;;;;;;;AAaH,MAAa,qBACZ,KACA,iBAEA,OAAO,IAAI,aAAa;CACvB,MAAM,aAAa,qBAAqB,aAAa;AACrD,KAAI,eAAe,KAClB,QAAO,OAAO,OAAO,KAAK,WAAW;AAEtC,KAAI,CAAC,eAAe,aAAa,CAChC,QAAO,OAAO,OAAO,KACpB,UAAU,aAAa;EACtB,YAAY;EACZ,SAAS,eAAe,aAAa;EACrC,CAAC,CACF;CAEF,MAAM,WAAW,OAAO,sBAAsB,KAAK,aAAa;AAChE,KAAI,aAAa,KAIhB,QAAO;EACN;EACA,UAAU;EACV,QAAQ;EACR;AAEF,QAAO;EACN;EACA,UAAU,SAAS;EACnB,QAAQ;EACR,QAAQ,SAAS;EACjB,aAAa,SAAS;EACtB,GAAI,SAAS,YAAY,KAAA,IAAY,EAAE,SAAS,SAAS,SAAS,GAAG,EAAE;EACvE,YAAY,SAAS;EACrB;EACA"}
@@ -0,0 +1,16 @@
1
+ //#region src/plugins/coin/codegen.d.ts
2
+ /** The typed shape per emitted coin record. */
3
+ interface CoinBindings {
4
+ readonly symbol: string;
5
+ readonly fullCoinType: string;
6
+ readonly decimals: number;
7
+ readonly displayName?: string;
8
+ readonly iconUrl?: string;
9
+ readonly treasuryCapId?: string;
10
+ readonly metadataId?: string;
11
+ readonly packageId?: string;
12
+ readonly source: 'registry' | 'on-chain' | 'builtin';
13
+ }
14
+ //#endregion
15
+ export { CoinBindings };
16
+ //# sourceMappingURL=codegen.d.mts.map
@@ -0,0 +1,21 @@
1
+ import { Effect } from "effect";
2
+ //#region src/plugins/coin/codegen.ts
3
+ /** Construct the Codegenable contribution for one coin instance.
4
+ *
5
+ * Emitter name is literal `coin/${symbol}` so the orchestrator can
6
+ * group them and folds them into a single `coins.ts` at staging
7
+ * time. Mirrors `account/${name}` naming in the Account plugin. */
8
+ const makeCoinCodegen = (parts) => ({
9
+ kind: "codegenable",
10
+ emitterName: `coin/${parts.symbol}`,
11
+ outputPath: `coins/${parts.symbol}.ts`,
12
+ sensitive: false,
13
+ emit: (ctx) => Effect.sync(() => {
14
+ ctx.exportConst(parts.symbol, parts.resolved);
15
+ return ctx.done();
16
+ })
17
+ });
18
+ //#endregion
19
+ export { makeCoinCodegen };
20
+
21
+ //# sourceMappingURL=codegen.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codegen.mjs","names":[],"sources":["../../../src/plugins/coin/codegen.ts"],"sourcesContent":["// Coin plugin — Codegenable contribution.\n//\n// Distilled-doc 13-coin.md §\"Files written\": the codegen orchestrator\n// projects the per-stack CoinRegistry into a generated `coins.ts`\n// table:\n//\n// export const coins = {\n// mUSDC: { type, decimals, sdkCoin, symbol, ... },\n// mWETH: { type, decimals, sdkCoin, symbol, ... },\n// } as const;\n// export type CoinName = keyof typeof coins;\n//\n// This file declares the SEAM — the typed binding shape and the\n// per-coin contribution. The heavy lift (writing the bytes, merging\n// all coins into one file) happens in the codegen orchestrator\n// (plugin/codegen layer, NOT this plugin); it walks every member's\n// caps tuple, finds the Coin-emitted contributions, and emits ONE\n// `coins.ts` referencing every entry.\n//\n// Per-coin shape mirrors the v3 `CoinEntry` (manifest schema) sans\n// the `sdkCoin` runtime projection — that lives in the SDK adapter\n// at codegen time, not in the binding shape.\n\nimport { Effect } from 'effect';\n\nimport type { CodegenableDecl } from '../../contracts/codegenable.ts';\n\n/** The typed shape per emitted coin record. */\nexport interface CoinBindings {\n\treadonly symbol: string;\n\treadonly fullCoinType: string;\n\treadonly decimals: number;\n\treadonly displayName?: string;\n\treadonly iconUrl?: string;\n\treadonly treasuryCapId?: string;\n\treadonly metadataId?: string;\n\treadonly packageId?: string;\n\treadonly source: 'registry' | 'on-chain' | 'builtin';\n}\n\n/** Construct the Codegenable contribution for one coin instance.\n *\n * Emitter name is literal `coin/${symbol}` so the orchestrator can\n * group them and folds them into a single `coins.ts` at staging\n * time. Mirrors `account/${name}` naming in the Account plugin. */\nexport const makeCoinCodegen = <Symbol extends string>(parts: {\n\treadonly symbol: Symbol;\n\treadonly resolved: CoinBindings;\n}): CodegenableDecl<`coin/${Symbol}`> => ({\n\tkind: 'codegenable',\n\temitterName: `coin/${parts.symbol}` as `coin/${Symbol}`,\n\toutputPath: `coins/${parts.symbol}.ts`,\n\tsensitive: false,\n\temit: (ctx) =>\n\t\tEffect.sync(() => {\n\t\t\tctx.exportConst(parts.symbol, parts.resolved);\n\t\t\treturn ctx.done();\n\t\t}),\n});\n"],"mappings":";;;;;;;AA6CA,MAAa,mBAA0C,WAGb;CACzC,MAAM;CACN,aAAa,QAAQ,MAAM;CAC3B,YAAY,SAAS,MAAM,OAAO;CAClC,WAAW;CACX,OAAO,QACN,OAAO,WAAW;AACjB,MAAI,YAAY,MAAM,QAAQ,MAAM,SAAS;AAC7C,SAAO,IAAI,MAAM;GAChB;CACH"}
@@ -0,0 +1,26 @@
1
+ //#region src/plugins/coin/discovery.d.ts
2
+ /** A discovered coin pulled out of a publish output. The downstream
3
+ * metadata enricher in `metadata.ts` turns this into a full
4
+ * `CoinRecord`. */
5
+ interface DiscoveredCoin {
6
+ /** `0xPKG::module::Witness`. */
7
+ readonly fullCoinType: string;
8
+ /** Lower-cased witness name. */
9
+ readonly witness: string;
10
+ /** Lower-cased module name. */
11
+ readonly moduleName: string;
12
+ readonly treasuryCapId?: string;
13
+ readonly treasuryCapOwner?: string;
14
+ readonly metadataId?: string;
15
+ readonly decimals?: number;
16
+ readonly symbol?: string;
17
+ readonly displayName?: string;
18
+ readonly iconUrl?: string;
19
+ /** True when the cap is address-owned by the publisher at the
20
+ * end of the publish tx. Distilled-doc invariant: the faucet's
21
+ * treasury-cap-mint auto-registration is gated off this flag. */
22
+ readonly publisherOwnsCap: boolean;
23
+ }
24
+ //#endregion
25
+ export { DiscoveredCoin };
26
+ //# sourceMappingURL=discovery.d.mts.map
@@ -0,0 +1,112 @@
1
+ import { pickSuiFrameworkInnerGeneric, pickSuiFrameworkInnerGenericFromModule } from "./type-strings.mjs";
2
+ //#region src/plugins/coin/discovery.ts
3
+ /** Extract module + witness from `0xPKG::module::Witness`. */
4
+ const splitCoinType = (fullCoinType) => {
5
+ const parts = fullCoinType.split("::");
6
+ if (parts.length !== 3) return null;
7
+ const [, moduleName, witness] = parts;
8
+ if (moduleName === void 0 || witness === void 0) return null;
9
+ return {
10
+ moduleName,
11
+ witness
12
+ };
13
+ };
14
+ /** Read the address owner from a package-publish-output change. Handles
15
+ * the SDK's discriminated owner-shape; non-address owners surface as
16
+ * `undefined`. The owner shape varies across SDK versions; this
17
+ * helper covers the common surface and degrades gracefully. */
18
+ const pickAddressOwner = (change) => {
19
+ const owner = change.owner;
20
+ if (owner === void 0 || owner === null) return void 0;
21
+ if (typeof owner === "string") return owner;
22
+ if (typeof owner === "object" && "AddressOwner" in owner) return owner.AddressOwner;
23
+ };
24
+ const pickString = (json, key) => {
25
+ const value = json[key];
26
+ return typeof value === "string" && value.length > 0 ? value : void 0;
27
+ };
28
+ const pickNumber = (json, key) => {
29
+ const value = json[key];
30
+ return typeof value === "number" && Number.isFinite(value) ? value : void 0;
31
+ };
32
+ const pickMetadata = (change) => {
33
+ const json = change.json;
34
+ if (json === null || typeof json !== "object" || Array.isArray(json)) return null;
35
+ const record = json;
36
+ const decimals = pickNumber(record, "decimals");
37
+ const symbol = pickString(record, "symbol");
38
+ const displayName = pickString(record, "name");
39
+ const iconUrl = pickString(record, "iconUrl") ?? pickString(record, "icon_url");
40
+ if (decimals === void 0 && symbol === void 0 && displayName === void 0 && iconUrl === void 0) return null;
41
+ return {
42
+ ...decimals === void 0 ? {} : { decimals },
43
+ ...symbol === void 0 ? {} : { symbol },
44
+ ...displayName === void 0 ? {} : { displayName },
45
+ ...iconUrl === void 0 ? {} : { iconUrl }
46
+ };
47
+ };
48
+ /** Walk a publish output for coin pairs.
49
+ *
50
+ * Sort ascending by fullCoinType — distilled-doc invariant 6 — so
51
+ * the registry sees a stable order across re-runs of the same
52
+ * publish.
53
+ *
54
+ * Pure. No Effect / RPC. */
55
+ const discoverCoinsFromPublish = (output) => {
56
+ const publisher = output.publisher;
57
+ const caps = /* @__PURE__ */ new Map();
58
+ const metadata = /* @__PURE__ */ new Map();
59
+ for (const change of output.objectChanges) {
60
+ if (change.type !== "created") continue;
61
+ if (!change.objectType) continue;
62
+ const capInner = pickSuiFrameworkInnerGeneric(change.objectType, "TreasuryCap");
63
+ if (capInner !== null && change.objectId !== void 0) {
64
+ caps.set(capInner, {
65
+ id: change.objectId,
66
+ owner: pickAddressOwner(change)
67
+ });
68
+ continue;
69
+ }
70
+ const metaInner = pickSuiFrameworkInnerGeneric(change.objectType, "CoinMetadata");
71
+ if (metaInner !== null && change.objectId !== void 0) {
72
+ metadata.set(metaInner, {
73
+ id: change.objectId,
74
+ ...pickMetadata(change) ?? {}
75
+ });
76
+ continue;
77
+ }
78
+ const currencyInner = pickSuiFrameworkInnerGenericFromModule(change.objectType, "coin_registry", "Currency");
79
+ if (currencyInner !== null && change.objectId !== void 0) metadata.set(currencyInner, {
80
+ id: change.objectId,
81
+ ...pickMetadata(change) ?? {}
82
+ });
83
+ }
84
+ const allTypes = new Set([...caps.keys(), ...metadata.keys()]);
85
+ const records = [];
86
+ for (const fullCoinType of allTypes) {
87
+ const parts = splitCoinType(fullCoinType);
88
+ if (!parts) continue;
89
+ const cap = caps.get(fullCoinType);
90
+ const meta = metadata.get(fullCoinType);
91
+ const publisherOwnsCap = cap !== void 0 && cap.owner === publisher;
92
+ records.push({
93
+ fullCoinType,
94
+ witness: parts.witness.toLowerCase(),
95
+ moduleName: parts.moduleName.toLowerCase(),
96
+ treasuryCapId: cap?.id,
97
+ treasuryCapOwner: cap?.owner,
98
+ metadataId: meta?.id,
99
+ ...meta?.decimals === void 0 ? {} : { decimals: meta.decimals },
100
+ ...meta?.symbol === void 0 ? {} : { symbol: meta.symbol },
101
+ ...meta?.displayName === void 0 ? {} : { displayName: meta.displayName },
102
+ ...meta?.iconUrl === void 0 ? {} : { iconUrl: meta.iconUrl },
103
+ publisherOwnsCap
104
+ });
105
+ }
106
+ records.sort((a, b) => a.fullCoinType < b.fullCoinType ? -1 : a.fullCoinType > b.fullCoinType ? 1 : 0);
107
+ return records;
108
+ };
109
+ //#endregion
110
+ export { discoverCoinsFromPublish };
111
+
112
+ //# sourceMappingURL=discovery.mjs.map