@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,164 @@
1
+ import { decodeUnknown } from "../../substrate/runtime/runtime-decode.mjs";
2
+ import { contentHash } from "../../substrate/brand.mjs";
3
+ import { isSuiFrameworkObjectForCoin } from "./type-strings.mjs";
4
+ import { coinError } from "./errors.mjs";
5
+ import { Effect, Schema } from "effect";
6
+ import { Transaction } from "@mysten/sui/transactions";
7
+ //#region src/plugins/coin/mint.ts
8
+ /** Verify-schema: what we expect when probing the minted coin.
9
+ * IMPORTANT (chain-probe schema constraint from the last sweep):
10
+ * schema literal uses ONLY service-free combinators. */
11
+ const MintedCoinVerifyShape = Schema.Struct({
12
+ objectId: Schema.String,
13
+ type: Schema.String
14
+ });
15
+ /** Build the cache-key content hash. Distilled-doc 13-coin.md
16
+ * §"Persistence model": key shape is
17
+ * `coin/mint/<chainId>/<treasuryCapId>/<recipient>/<amount>`. The
18
+ * substrate's artifact publisher folds in chainId via the `chain` parameter; we
19
+ * fold the remaining columns into `contentHash`. */
20
+ const buildMintContentHash = (parts) => contentHash(`mint/${parts.treasuryCapId}/${parts.recipient}/${parts.amount.toString()}`);
21
+ /** Verify probe — checks the cached minted-coin still exists. Lenient:
22
+ * returns `null` for both not-found AND transient failure (distilled-
23
+ * doc invariant: the next cycle re-derives).
24
+ *
25
+ * IMPORTANT (chain-probe schema constraint): the probe pipeline
26
+ * cannot inject services from the caller. We construct the schema
27
+ * literal at module scope (above) and call `decodeUnknownEffect` —
28
+ * which the substrate's `ChainProbe.get` does internally. This local
29
+ * verify mirrors the call-shape so the constraint is honored.
30
+ *
31
+ * We model the verify here as an inline Effect because the cached
32
+ * minted-coin id is known only AFTER cache lookup — the substrate's
33
+ * `verify` Effect closes over the cached id. */
34
+ const buildVerifyProbe = (sdk, mintedCoinIdOpt) => Effect.gen(function* () {
35
+ if (mintedCoinIdOpt === null) return null;
36
+ const raw = yield* Effect.tryPromise({
37
+ try: () => sdk.core.getObject({ objectId: mintedCoinIdOpt }),
38
+ catch: () => "transient"
39
+ }).pipe(Effect.catch(() => Effect.succeed(null)));
40
+ if (raw === null || raw === void 0) return null;
41
+ return yield* decodeUnknown(MintedCoinVerifyShape, raw, {
42
+ source: "minted coin verify response",
43
+ mkError: (issue) => issue
44
+ }).pipe(Effect.catch(() => Effect.succeed(null)));
45
+ });
46
+ /** Find the minted `Coin<T>` in a result's objectChanges. Returns the
47
+ * objectId of the first `created` entry whose `objectType` matches
48
+ * `0x2::coin::Coin<${fullCoinType}>` (or its address-normalized equivalent).
49
+ *
50
+ * Returns `null` on no match — the caller maps that to a typed parse
51
+ * error.
52
+ *
53
+ * The SDK can report the Sui framework address as compact `0x2` or
54
+ * fully padded `0x000...0002`, so this uses the shared type-string
55
+ * normalizer instead of substring matching. */
56
+ const pickCreatedCoin = (changes, fullCoinType) => {
57
+ for (const change of changes) {
58
+ if (!isCreatedObjectChange(change)) continue;
59
+ if (typeof change.objectType === "string" && isSuiFrameworkObjectForCoin(change.objectType, "Coin", fullCoinType)) return change.objectId;
60
+ }
61
+ return null;
62
+ };
63
+ const isCreatedObjectChange = (raw) => {
64
+ if (raw === null || typeof raw !== "object") return false;
65
+ const r = raw;
66
+ return r.type === "created" && typeof r.objectId === "string";
67
+ };
68
+ /** Build the `ArtifactPublisher` spec for one mint round.
69
+ *
70
+ * Substrate dispatches: cache lookup, verify-on-hit, produce-on-
71
+ * miss-or-verify-fail, register-on-every-cycle. We hand it the
72
+ * procedures; the substrate handles best-effort cache writes per
73
+ * Invariant 2.
74
+ *
75
+ * Note on the `Produced | Verified` union: the artifact publisher's `publish`
76
+ * returns one OR the other shape; both are `CachedMint`-compatible
77
+ * for our purposes, so we collapse downstream. */
78
+ const performMint = (publisher, chain, signer, sdk, inputs) => Effect.gen(function* () {
79
+ const cacheHash = buildMintContentHash(inputs);
80
+ const verified = yield* publisher.publish({
81
+ namespace: "coin-mint",
82
+ chain,
83
+ contentHash: cacheHash,
84
+ verifySchema: MintedCoinVerifyShape,
85
+ verify: (cached) => buildVerifyProbe(sdk, cached.mintedCoinId),
86
+ produce: Effect.gen(function* () {
87
+ yield* Effect.annotateCurrentSpan({
88
+ "coin.mint.recipient": inputs.recipient,
89
+ "coin.mint.fullCoinType": inputs.fullCoinType,
90
+ "coin.mint.amount": inputs.amount.toString()
91
+ });
92
+ const result = yield* signer.withTransactionSigner((lockedSigner) => Effect.gen(function* () {
93
+ const tx = new Transaction();
94
+ if (inputs.gasBudget !== void 0) tx.setGasBudget(inputs.gasBudget);
95
+ tx.setSender(signer.address);
96
+ tx.moveCall({
97
+ target: "0x2::coin::mint_and_transfer",
98
+ typeArguments: [inputs.fullCoinType],
99
+ arguments: [
100
+ tx.object(inputs.treasuryCapId),
101
+ tx.pure.u64(inputs.amount),
102
+ tx.pure.address(inputs.recipient)
103
+ ]
104
+ });
105
+ const txBytes = yield* Effect.tryPromise({
106
+ try: () => tx.build({ client: sdk.client }),
107
+ catch: (cause) => ({
108
+ _tag: "ArtifactPublishError",
109
+ reason: "produce-failed",
110
+ detail: `coin.mint(${inputs.fullCoinType}): Transaction.build failed — ${cause instanceof Error ? cause.message : String(cause)}`
111
+ })
112
+ });
113
+ return yield* lockedSigner.signAndExecute(txBytes).pipe(Effect.mapError((cause) => ({
114
+ _tag: "ArtifactPublishError",
115
+ reason: "produce-failed",
116
+ detail: `coin.mint(${inputs.fullCoinType}): signAndExecute failed — ` + cause.message
117
+ })));
118
+ }));
119
+ const mintedCoinId = pickCreatedCoin(result.objectChanges, inputs.fullCoinType);
120
+ if (mintedCoinId === null) return yield* Effect.fail({
121
+ _tag: "ArtifactPublishError",
122
+ reason: "produce-failed",
123
+ detail: `coin.mint(${inputs.fullCoinType}): minted Coin<T> not found in objectChanges (digest=${result.digest}). ` + mintParseError(inputs.fullCoinType, "minted Coin<T> absent in objectChanges").message
124
+ });
125
+ yield* Effect.annotateCurrentSpan({
126
+ "coin.mint.digest": result.digest,
127
+ "coin.mint.mintedCoinId": mintedCoinId
128
+ });
129
+ return {
130
+ digest: result.digest,
131
+ mintedCoinId,
132
+ recipient: inputs.recipient,
133
+ amount: inputs.amount.toString()
134
+ };
135
+ }),
136
+ register: () => Effect.void
137
+ });
138
+ if ("mintedCoinId" in verified) return {
139
+ digest: verified.digest,
140
+ mintedCoinId: verified.mintedCoinId,
141
+ recipient: verified.recipient,
142
+ amount: BigInt(verified.amount),
143
+ fullCoinType: inputs.fullCoinType
144
+ };
145
+ return {
146
+ digest: null,
147
+ mintedCoinId: verified.objectId,
148
+ recipient: inputs.recipient,
149
+ amount: inputs.amount,
150
+ fullCoinType: inputs.fullCoinType
151
+ };
152
+ }).pipe(Effect.withSpan("coin.mint", { attributes: {
153
+ "coin.mint.recipient": inputs.recipient,
154
+ "coin.mint.fullCoinType": inputs.fullCoinType,
155
+ "coin.mint.amount": inputs.amount.toString()
156
+ } }));
157
+ const mintParseError = (fullCoinType, message) => coinError("mint-parse", {
158
+ identifier: fullCoinType,
159
+ message
160
+ });
161
+ //#endregion
162
+ export { MintedCoinVerifyShape, mintParseError, performMint };
163
+
164
+ //# sourceMappingURL=mint.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mint.mjs","names":["brandContentHash"],"sources":["../../../src/plugins/coin/mint.ts"],"sourcesContent":["// Generic mint — wraps `0x2::coin::mint_and_transfer<T>` in the\n// `ArtifactPublisher` substrate primitive.\n//\n// Distilled-doc 13-coin.md §\"Lifecycle\" §\"mintFromTreasury\":\n//\n// - Cache key: (chainId, treasuryCapId, recipient, amount)\n// - Verify: lenient probe on the cached minted-coin id\n// (Invariant 1 — vanish-detection)\n// - Produce: sign + execute the `mint_and_transfer<T>` tx,\n// find the minted `Coin<T>` in objectChanges\n// - Register: in-memory note of the mint (no global registry —\n// the resolved value carries everything callers\n// need).\n//\n// Best-effort cache writes (distilled-doc Invariant 2): the mint\n// already settled on chain; a state-store IO defect just means the\n// next supervisor cycle re-mints. Don't let a StateStore failure\n// roll back the mint.\n//\n// Substrate constraint: the `ArtifactPublisher.publish` shape\n// already covers cache + verify + produce + register-on-every-cycle.\n// We compose its spec; the substrate dispatches.\n\nimport { Effect, Schema, type Scope } from 'effect';\nimport { Transaction } from '@mysten/sui/transactions';\n\nimport type { ChainId, ContentHash } from '../../substrate/brand.ts';\nimport { contentHash as brandContentHash } from '../../substrate/brand.ts';\nimport { decodeUnknown } from '../../substrate/runtime/runtime-decode.ts';\nimport type {\n\tArtifactPublishError,\n\tArtifactPublisher,\n} from '../../primitives/artifact-publisher.ts';\nimport { coinError, type CoinError } from './errors.ts';\nimport { isSuiFrameworkObjectForCoin } from './type-strings.ts';\n\n/** Sign+execute surface narrowed from `AccountValue.signAndExecute`.\n * We don't import `AccountValue` directly to avoid a layering cycle —\n * the Account plugin imports nothing from coin, so coin re-publishes\n * the structural shape. */\nexport interface MintTransactionSigner {\n\treadonly signAndExecute: (tx: Uint8Array) => Effect.Effect<\n\t\t{\n\t\t\treadonly digest: string;\n\t\t\treadonly objectChanges: ReadonlyArray<unknown>;\n\t\t},\n\t\t{ readonly _tag: 'AccountSignError'; readonly message: string }\n\t>;\n}\n\nexport interface MintSigner extends MintTransactionSigner {\n\treadonly address: string;\n\treadonly withTransactionSigner: <A, E, R>(\n\t\tbody: (signer: MintTransactionSigner) => Effect.Effect<A, E, R>,\n\t) => Effect.Effect<A, E, R>;\n}\n\n/** Cached payload — the stable id verify re-confirms on every cycle.\n * Distilled-doc invariant: the probe MUST consume a STABLE on-chain\n * identifier (the minted Coin<T>'s objectId), NOT a derived hash. */\nexport interface CachedMint {\n\treadonly digest: string;\n\treadonly mintedCoinId: string;\n\treadonly recipient: string;\n\t/** `amount.toString()` — bigint isn't serializable. */\n\treadonly amount: string;\n}\n\n/** Verify-schema: what we expect when probing the minted coin.\n * IMPORTANT (chain-probe schema constraint from the last sweep):\n * schema literal uses ONLY service-free combinators. */\nexport const MintedCoinVerifyShape = Schema.Struct({\n\tobjectId: Schema.String,\n\ttype: Schema.String,\n});\n\n/** Build the cache-key content hash. Distilled-doc 13-coin.md\n * §\"Persistence model\": key shape is\n * `coin/mint/<chainId>/<treasuryCapId>/<recipient>/<amount>`. The\n * substrate's artifact publisher folds in chainId via the `chain` parameter; we\n * fold the remaining columns into `contentHash`. */\nconst buildMintContentHash = (parts: {\n\treadonly treasuryCapId: string;\n\treadonly recipient: string;\n\treadonly amount: bigint;\n}): ContentHash =>\n\tbrandContentHash(`mint/${parts.treasuryCapId}/${parts.recipient}/${parts.amount.toString()}`);\n\nexport interface MintInputs {\n\treadonly fullCoinType: string;\n\treadonly treasuryCapId: string;\n\treadonly recipient: string;\n\treadonly amount: bigint;\n\treadonly gasBudget?: bigint;\n}\n\nexport interface MintResult {\n\t/** Tx digest of the producing mint. `null` on the verify-hit path:\n\t * the artifact publisher's cache-hit verify returns the decoded probe shape\n\t * (which doesn't carry the digest); callers that need the digest\n\t * on cache hit consult the artifact publisher cache directly. */\n\treadonly digest: string | null;\n\treadonly mintedCoinId: string;\n\treadonly recipient: string;\n\treadonly amount: bigint;\n\treadonly fullCoinType: string;\n}\n\n/** Sui SDK shim for the verify probe + transaction build.\n *\n * Narrowed-but-not-too-narrow: the produce body needs to serialize a\n * `Transaction` to BCS bytes, which the Sui SDK's\n * `Transaction.build({ client })` resolves via the client. We accept\n * the full client opaquely (typed `unknown` here — the runtime check\n * is \"does `Transaction.build` accept it\"). The barrel wires the\n * resolved `SuiGrpcClient` through.\n *\n * Why `unknown` rather than `ClientWithCoreApi`: keeps this module\n * free of a direct `@mysten/sui/client` type import — the produce body\n * passes it through opaquely to `Transaction.build`, which validates\n * the shape at runtime.\n *\n * The `core.getObject` field is the verify-probe surface; the\n * `client` field is the build-target. */\nexport interface MintSdkShim {\n\treadonly core: {\n\t\treadonly getObject: (args: { readonly objectId: string }) => Promise<unknown>;\n\t};\n\t/** Opaque client reference for `Transaction.build({ client })`. The\n\t * shim layer doesn't type-narrow this; the Sui barrel hands in the\n\t * resolved `SuiGrpcClient`. */\n\treadonly client: unknown;\n}\n\n/** Verify probe — checks the cached minted-coin still exists. Lenient:\n * returns `null` for both not-found AND transient failure (distilled-\n * doc invariant: the next cycle re-derives).\n *\n * IMPORTANT (chain-probe schema constraint): the probe pipeline\n * cannot inject services from the caller. We construct the schema\n * literal at module scope (above) and call `decodeUnknownEffect` —\n * which the substrate's `ChainProbe.get` does internally. This local\n * verify mirrors the call-shape so the constraint is honored.\n *\n * We model the verify here as an inline Effect because the cached\n * minted-coin id is known only AFTER cache lookup — the substrate's\n * `verify` Effect closes over the cached id. */\nconst buildVerifyProbe = (\n\tsdk: MintSdkShim,\n\tmintedCoinIdOpt: string | null,\n): Effect.Effect<typeof MintedCoinVerifyShape.Type | null, never> =>\n\tEffect.gen(function* () {\n\t\tif (mintedCoinIdOpt === null) return null;\n\t\tconst raw: unknown = yield* Effect.tryPromise({\n\t\t\ttry: () => sdk.core.getObject({ objectId: mintedCoinIdOpt }),\n\t\t\tcatch: () => 'transient' as const,\n\t\t}).pipe(\n\t\t\t// Lenient: not-found AND transient both coerce to null. The\n\t\t\t// artifact publisher's cache layer will then re-run produce.\n\t\t\tEffect.catch(() => Effect.succeed(null)),\n\t\t);\n\t\tif (raw === null || raw === undefined) return null;\n\t\t// Best-effort decode. A decode failure on the verify path is\n\t\t// treated as \"object exists but shape changed unexpectedly\" —\n\t\t// still null so the substrate re-mints rather than carry stale\n\t\t// data forward.\n\t\treturn yield* decodeUnknown(MintedCoinVerifyShape, raw, {\n\t\t\tsource: 'minted coin verify response',\n\t\t\tmkError: (issue) => issue,\n\t\t}).pipe(Effect.catch(() => Effect.succeed(null as typeof MintedCoinVerifyShape.Type | null)));\n\t});\n\n/** Object-change shape narrowed for `pickCreatedCoin`. The gRPC\n * client emits `objectType` as a fully-qualified Sui type string on\n * `created` entries; we sniff for the `Coin<T>` substring (inner\n * generic carries the full coin type, so the match is unambiguous —\n * distilled-doc 13-coin.md Invariant 9). */\ninterface CreatedObjectChange {\n\treadonly type: 'created';\n\treadonly objectId: string;\n\treadonly objectType?: string;\n}\n\n/** Find the minted `Coin<T>` in a result's objectChanges. Returns the\n * objectId of the first `created` entry whose `objectType` matches\n * `0x2::coin::Coin<${fullCoinType}>` (or its address-normalized equivalent).\n *\n * Returns `null` on no match — the caller maps that to a typed parse\n * error.\n *\n * The SDK can report the Sui framework address as compact `0x2` or\n * fully padded `0x000...0002`, so this uses the shared type-string\n * normalizer instead of substring matching. */\nexport const pickCreatedCoin = (\n\tchanges: ReadonlyArray<unknown>,\n\tfullCoinType: string,\n): string | null => {\n\tfor (const change of changes) {\n\t\tif (!isCreatedObjectChange(change)) continue;\n\t\tif (\n\t\t\ttypeof change.objectType === 'string' &&\n\t\t\tisSuiFrameworkObjectForCoin(change.objectType, 'Coin', fullCoinType)\n\t\t) {\n\t\t\treturn change.objectId;\n\t\t}\n\t}\n\treturn null;\n};\n\nconst isCreatedObjectChange = (raw: unknown): raw is CreatedObjectChange => {\n\tif (raw === null || typeof raw !== 'object') return false;\n\tconst r = raw as { type?: unknown; objectId?: unknown };\n\treturn r.type === 'created' && typeof r.objectId === 'string';\n};\n\n/** Build the `ArtifactPublisher` spec for one mint round.\n *\n * Substrate dispatches: cache lookup, verify-on-hit, produce-on-\n * miss-or-verify-fail, register-on-every-cycle. We hand it the\n * procedures; the substrate handles best-effort cache writes per\n * Invariant 2.\n *\n * Note on the `Produced | Verified` union: the artifact publisher's `publish`\n * returns one OR the other shape; both are `CachedMint`-compatible\n * for our purposes, so we collapse downstream. */\nexport const performMint = (\n\tpublisher: ArtifactPublisher,\n\tchain: ChainId,\n\tsigner: MintSigner,\n\tsdk: MintSdkShim,\n\tinputs: MintInputs,\n): Effect.Effect<MintResult, CoinError | ArtifactPublishError, Scope.Scope> =>\n\tEffect.gen(function* () {\n\t\tconst cacheHash = buildMintContentHash(inputs);\n\n\t\tconst verified: CachedMint | { readonly objectId: string; readonly type: string } =\n\t\t\tyield* publisher.publish<CachedMint, typeof MintedCoinVerifyShape.Type>({\n\t\t\t\tnamespace: 'coin-mint',\n\t\t\t\tchain,\n\t\t\t\tcontentHash: cacheHash,\n\t\t\t\tverifySchema: MintedCoinVerifyShape,\n\t\t\t\t// Verify probe runs on cache hit. The artifact publisher threads the\n\t\t\t\t// cached payload through to its internal probe — our\n\t\t\t\t// closure here just hands back a \"null = miss\" signal\n\t\t\t\t// when the cached id has vanished on chain.\n\t\t\t\t//\n\t\t\t\t// The artifact publisher substrate now threads the decoded\n\t\t\t\t// `CachedMint` into `verify(cached)`; we pull\n\t\t\t\t// `mintedCoinId` off it and probe the chain. Lenient\n\t\t\t\t// mode masks transient + not-found → null → substrate\n\t\t\t\t// re-mints rather than carry a stale digest forward.\n\t\t\t\tverify: (cached) => buildVerifyProbe(sdk, cached.mintedCoinId),\n\t\t\t\tproduce: Effect.gen(function* () {\n\t\t\t\t\tyield* Effect.annotateCurrentSpan({\n\t\t\t\t\t\t'coin.mint.recipient': inputs.recipient,\n\t\t\t\t\t\t'coin.mint.fullCoinType': inputs.fullCoinType,\n\t\t\t\t\t\t'coin.mint.amount': inputs.amount.toString(),\n\t\t\t\t\t});\n\n\t\t\t\t\tconst result = yield* signer.withTransactionSigner((lockedSigner) =>\n\t\t\t\t\t\tEffect.gen(function* () {\n\t\t\t\t\t\t\t// 1. Build the Move tx — distilled-doc 13-coin.md\n\t\t\t\t\t\t\t// Invariant 9 pins the call shape:\n\t\t\t\t\t\t\t// `0x2::coin::mint_and_transfer<T>(cap, amount, recipient)`.\n\t\t\t\t\t\t\tconst tx = new Transaction();\n\t\t\t\t\t\t\tif (inputs.gasBudget !== undefined) {\n\t\t\t\t\t\t\t\ttx.setGasBudget(inputs.gasBudget);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttx.setSender(signer.address);\n\t\t\t\t\t\t\ttx.moveCall({\n\t\t\t\t\t\t\t\ttarget: '0x2::coin::mint_and_transfer',\n\t\t\t\t\t\t\t\ttypeArguments: [inputs.fullCoinType],\n\t\t\t\t\t\t\t\targuments: [\n\t\t\t\t\t\t\t\t\ttx.object(inputs.treasuryCapId),\n\t\t\t\t\t\t\t\t\ttx.pure.u64(inputs.amount),\n\t\t\t\t\t\t\t\t\ttx.pure.address(inputs.recipient),\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t// 2. Serialize the tx to BCS bytes while the account lease\n\t\t\t\t\t\t\t// is held. `Transaction.build` resolves gas + object-version\n\t\t\t\t\t\t\t// placeholders via the client.\n\t\t\t\t\t\t\tconst txBytes = yield* Effect.tryPromise({\n\t\t\t\t\t\t\t\ttry: () =>\n\t\t\t\t\t\t\t\t\ttx.build({\n\t\t\t\t\t\t\t\t\t\t// The shim exposes the client opaquely; @mysten/sui\n\t\t\t\t\t\t\t\t\t\t// validates the shape at runtime.\n\t\t\t\t\t\t\t\t\t\tclient: sdk.client as Parameters<typeof tx.build>[0] extends\n\t\t\t\t\t\t\t\t\t\t\t| { client?: infer C }\n\t\t\t\t\t\t\t\t\t\t\t| undefined\n\t\t\t\t\t\t\t\t\t\t\t? C\n\t\t\t\t\t\t\t\t\t\t\t: never,\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\tcatch: (cause): ArtifactPublishError => ({\n\t\t\t\t\t\t\t\t\t_tag: 'ArtifactPublishError',\n\t\t\t\t\t\t\t\t\treason: 'produce-failed',\n\t\t\t\t\t\t\t\t\tdetail:\n\t\t\t\t\t\t\t\t\t\t`coin.mint(${inputs.fullCoinType}): Transaction.build failed — ` +\n\t\t\t\t\t\t\t\t\t\t`${cause instanceof Error ? cause.message : String(cause)}`,\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t// 3. Sign + execute via the Account-supplied signer. Map\n\t\t\t\t\t\t\t// `AccountSignError` → `ArtifactPublishError`. The\n\t\t\t\t\t\t\t// Account plugin's signer handles waitForTransaction internally.\n\t\t\t\t\t\t\treturn yield* lockedSigner.signAndExecute(txBytes).pipe(\n\t\t\t\t\t\t\t\tEffect.mapError(\n\t\t\t\t\t\t\t\t\t(cause): ArtifactPublishError => ({\n\t\t\t\t\t\t\t\t\t\t_tag: 'ArtifactPublishError',\n\t\t\t\t\t\t\t\t\t\treason: 'produce-failed',\n\t\t\t\t\t\t\t\t\t\tdetail:\n\t\t\t\t\t\t\t\t\t\t\t`coin.mint(${inputs.fullCoinType}): signAndExecute failed — ` + cause.message,\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\n\t\t\t\t\t// 4. Find the minted `Coin<T>` in objectChanges via the\n\t\t\t\t\t// inner-generic match (distilled-doc Invariant 9).\n\t\t\t\t\t// `mint_and_transfer` emits a fresh `Coin<T>` owned by\n\t\t\t\t\t// the recipient; look it up by the\n\t\t\t\t\t// `0x2::coin::Coin<${fullCoinType}>` substring.\n\t\t\t\t\tconst mintedCoinId = pickCreatedCoin(result.objectChanges, inputs.fullCoinType);\n\t\t\t\t\tif (mintedCoinId === null) {\n\t\t\t\t\t\treturn yield* Effect.fail({\n\t\t\t\t\t\t\t_tag: 'ArtifactPublishError' as const,\n\t\t\t\t\t\t\treason: 'produce-failed' as const,\n\t\t\t\t\t\t\tdetail:\n\t\t\t\t\t\t\t\t`coin.mint(${inputs.fullCoinType}): minted Coin<T> not found in ` +\n\t\t\t\t\t\t\t\t`objectChanges (digest=${result.digest}). ` +\n\t\t\t\t\t\t\t\tmintParseError(inputs.fullCoinType, 'minted Coin<T> absent in objectChanges')\n\t\t\t\t\t\t\t\t\t.message,\n\t\t\t\t\t\t} satisfies ArtifactPublishError);\n\t\t\t\t\t}\n\n\t\t\t\t\tyield* Effect.annotateCurrentSpan({\n\t\t\t\t\t\t'coin.mint.digest': result.digest,\n\t\t\t\t\t\t'coin.mint.mintedCoinId': mintedCoinId,\n\t\t\t\t\t});\n\n\t\t\t\t\t// 5. Return the cached payload. The artifact publisher caches it under\n\t\t\t\t\t// the content hash; the next cycle's verify probe (on\n\t\t\t\t\t// cache hit) will lenient-probe `mintedCoinId`.\n\t\t\t\t\treturn {\n\t\t\t\t\t\tdigest: result.digest,\n\t\t\t\t\t\tmintedCoinId,\n\t\t\t\t\t\trecipient: inputs.recipient,\n\t\t\t\t\t\tamount: inputs.amount.toString(),\n\t\t\t\t\t} satisfies CachedMint;\n\t\t\t\t}),\n\t\t\t\t// Register on EVERY cycle (hit AND miss). Distilled-doc\n\t\t\t\t// Invariant 6. Coin mint has no global registry to feed —\n\t\t\t\t// the resolved-value carries everything; this is a no-op.\n\t\t\t\tregister: () => Effect.void,\n\t\t\t});\n\n\t\t// Project the union back to MintResult. Both arms carry enough\n\t\t// to reconstruct: produce returns CachedMint; verify returns\n\t\t// the decoded `{ objectId, type }`.\n\t\tif ('mintedCoinId' in verified) {\n\t\t\treturn {\n\t\t\t\tdigest: verified.digest,\n\t\t\t\tmintedCoinId: verified.mintedCoinId,\n\t\t\t\trecipient: verified.recipient,\n\t\t\t\tamount: BigInt(verified.amount),\n\t\t\t\tfullCoinType: inputs.fullCoinType,\n\t\t\t};\n\t\t}\n\t\t// Verify-hit path — the artifact publisher returned the decoded probe shape.\n\t\t// The producing-tx digest lives only in the artifact publisher cache layer (not on\n\t\t// the probe response), so we surface `null` here. Callers that need\n\t\t// the producing digest on a cache hit consult the artifact publisher cache directly.\n\t\treturn {\n\t\t\tdigest: null,\n\t\t\tmintedCoinId: verified.objectId,\n\t\t\trecipient: inputs.recipient,\n\t\t\tamount: inputs.amount,\n\t\t\tfullCoinType: inputs.fullCoinType,\n\t\t};\n\t}).pipe(\n\t\tEffect.withSpan('coin.mint', {\n\t\t\tattributes: {\n\t\t\t\t'coin.mint.recipient': inputs.recipient,\n\t\t\t\t'coin.mint.fullCoinType': inputs.fullCoinType,\n\t\t\t\t'coin.mint.amount': inputs.amount.toString(),\n\t\t\t},\n\t\t}),\n\t);\n\n/** Project an artifact publisher-wire error back to a CoinError when the consumer\n * wants a coin-side tagged shape. The artifact publisher boundary is generic; this\n * helper recovers the typed `mint-tx` / `mint-parse` phase the cause\n * walker uses. */\nexport const mintTxError = (fullCoinType: string, message: string, cause?: unknown): CoinError =>\n\tcoinError('mint-tx', {\n\t\tidentifier: fullCoinType,\n\t\tmessage,\n\t\t...(cause !== undefined ? { cause } : {}),\n\t});\n\nexport const mintParseError = (fullCoinType: string, message: string): CoinError =>\n\tcoinError('mint-parse', {\n\t\tidentifier: fullCoinType,\n\t\tmessage,\n\t});\n"],"mappings":";;;;;;;;;;AAuEA,MAAa,wBAAwB,OAAO,OAAO;CAClD,UAAU,OAAO;CACjB,MAAM,OAAO;CACb,CAAC;;;;;;AAOF,MAAM,wBAAwB,UAK7BA,YAAiB,QAAQ,MAAM,cAAc,GAAG,MAAM,UAAU,GAAG,MAAM,OAAO,UAAU,GAAG;;;;;;;;;;;;;;AA6D9F,MAAM,oBACL,KACA,oBAEA,OAAO,IAAI,aAAa;AACvB,KAAI,oBAAoB,KAAM,QAAO;CACrC,MAAM,MAAe,OAAO,OAAO,WAAW;EAC7C,WAAW,IAAI,KAAK,UAAU,EAAE,UAAU,iBAAiB,CAAC;EAC5D,aAAa;EACb,CAAC,CAAC,KAGF,OAAO,YAAY,OAAO,QAAQ,KAAK,CAAC,CACxC;AACD,KAAI,QAAQ,QAAQ,QAAQ,KAAA,EAAW,QAAO;AAK9C,QAAO,OAAO,cAAc,uBAAuB,KAAK;EACvD,QAAQ;EACR,UAAU,UAAU;EACpB,CAAC,CAAC,KAAK,OAAO,YAAY,OAAO,QAAQ,KAAiD,CAAC,CAAC;EAC5F;;;;;;;;;;;AAuBH,MAAa,mBACZ,SACA,iBACmB;AACnB,MAAK,MAAM,UAAU,SAAS;AAC7B,MAAI,CAAC,sBAAsB,OAAO,CAAE;AACpC,MACC,OAAO,OAAO,eAAe,YAC7B,4BAA4B,OAAO,YAAY,QAAQ,aAAa,CAEpE,QAAO,OAAO;;AAGhB,QAAO;;AAGR,MAAM,yBAAyB,QAA6C;AAC3E,KAAI,QAAQ,QAAQ,OAAO,QAAQ,SAAU,QAAO;CACpD,MAAM,IAAI;AACV,QAAO,EAAE,SAAS,aAAa,OAAO,EAAE,aAAa;;;;;;;;;;;;AAatD,MAAa,eACZ,WACA,OACA,QACA,KACA,WAEA,OAAO,IAAI,aAAa;CACvB,MAAM,YAAY,qBAAqB,OAAO;CAE9C,MAAM,WACL,OAAO,UAAU,QAAuD;EACvE,WAAW;EACX;EACA,aAAa;EACb,cAAc;EAWd,SAAS,WAAW,iBAAiB,KAAK,OAAO,aAAa;EAC9D,SAAS,OAAO,IAAI,aAAa;AAChC,UAAO,OAAO,oBAAoB;IACjC,uBAAuB,OAAO;IAC9B,0BAA0B,OAAO;IACjC,oBAAoB,OAAO,OAAO,UAAU;IAC5C,CAAC;GAEF,MAAM,SAAS,OAAO,OAAO,uBAAuB,iBACnD,OAAO,IAAI,aAAa;IAIvB,MAAM,KAAK,IAAI,aAAa;AAC5B,QAAI,OAAO,cAAc,KAAA,EACxB,IAAG,aAAa,OAAO,UAAU;AAElC,OAAG,UAAU,OAAO,QAAQ;AAC5B,OAAG,SAAS;KACX,QAAQ;KACR,eAAe,CAAC,OAAO,aAAa;KACpC,WAAW;MACV,GAAG,OAAO,OAAO,cAAc;MAC/B,GAAG,KAAK,IAAI,OAAO,OAAO;MAC1B,GAAG,KAAK,QAAQ,OAAO,UAAU;MACjC;KACD,CAAC;IAKF,MAAM,UAAU,OAAO,OAAO,WAAW;KACxC,WACC,GAAG,MAAM,EAGR,QAAQ,IAAI,QAKZ,CAAC;KACH,QAAQ,WAAiC;MACxC,MAAM;MACN,QAAQ;MACR,QACC,aAAa,OAAO,aAAa,gCAC9B,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM;MAC1D;KACD,CAAC;AAKF,WAAO,OAAO,aAAa,eAAe,QAAQ,CAAC,KAClD,OAAO,UACL,WAAiC;KACjC,MAAM;KACN,QAAQ;KACR,QACC,aAAa,OAAO,aAAa,+BAA+B,MAAM;KACvE,EACD,CACD;KACA,CACF;GAOD,MAAM,eAAe,gBAAgB,OAAO,eAAe,OAAO,aAAa;AAC/E,OAAI,iBAAiB,KACpB,QAAO,OAAO,OAAO,KAAK;IACzB,MAAM;IACN,QAAQ;IACR,QACC,aAAa,OAAO,aAAa,uDACR,OAAO,OAAO,OACvC,eAAe,OAAO,cAAc,yCAAyC,CAC3E;IACH,CAAgC;AAGlC,UAAO,OAAO,oBAAoB;IACjC,oBAAoB,OAAO;IAC3B,0BAA0B;IAC1B,CAAC;AAKF,UAAO;IACN,QAAQ,OAAO;IACf;IACA,WAAW,OAAO;IAClB,QAAQ,OAAO,OAAO,UAAU;IAChC;IACA;EAIF,gBAAgB,OAAO;EACvB,CAAC;AAKH,KAAI,kBAAkB,SACrB,QAAO;EACN,QAAQ,SAAS;EACjB,cAAc,SAAS;EACvB,WAAW,SAAS;EACpB,QAAQ,OAAO,SAAS,OAAO;EAC/B,cAAc,OAAO;EACrB;AAMF,QAAO;EACN,QAAQ;EACR,cAAc,SAAS;EACvB,WAAW,OAAO;EAClB,QAAQ,OAAO;EACf,cAAc,OAAO;EACrB;EACA,CAAC,KACF,OAAO,SAAS,aAAa,EAC5B,YAAY;CACX,uBAAuB,OAAO;CAC9B,0BAA0B,OAAO;CACjC,oBAAoB,OAAO,OAAO,UAAU;CAC5C,EACD,CAAC,CACF;AAaF,MAAa,kBAAkB,cAAsB,YACpD,UAAU,cAAc;CACvB,YAAY;CACZ;CACA,CAAC"}
@@ -0,0 +1 @@
1
+ import { Context, Effect, Layer } from "effect";
@@ -0,0 +1,37 @@
1
+ import { defineScopedRefMap } from "../../substrate/runtime/scoped-ref-map/service.mjs";
2
+ import { Context, Effect, Layer } from "effect";
3
+ //#region src/plugins/coin/registry.ts
4
+ const coinKey = (fullCoinType) => fullCoinType;
5
+ const CoinRefMap = defineScopedRefMap("CoinRegistry");
6
+ const wrapRefMap = (refMap) => ({
7
+ register: (record) => refMap.set(coinKey(record.type), record),
8
+ bySymbol: (symbol) => refMap.entries().pipe(Effect.map((entries) => {
9
+ const lowered = symbol.toLowerCase();
10
+ return entries.map(([, r]) => r).filter((r) => r.key === lowered || r.symbol?.toLowerCase() === lowered);
11
+ })),
12
+ byWitness: (packageName, witness) => refMap.entries().pipe(Effect.map((entries) => {
13
+ const lowered = witness.toLowerCase();
14
+ return entries.map(([, r]) => r).find((r) => r.publishingPackageName === packageName && (r.witness === lowered || r.symbol?.toLowerCase() === lowered)) ?? null;
15
+ })),
16
+ byType: (fullCoinType) => refMap.find(coinKey(fullCoinType)).pipe(Effect.map((hit) => hit ?? null)),
17
+ list: () => refMap.entries().pipe(Effect.map((entries) => entries.map(([, r]) => r)))
18
+ });
19
+ /** Context.Service tag for the per-stack `CoinRegistry`. Plugins
20
+ * yield this in their acquire body. */
21
+ var CoinRegistryService = class extends Context.Service()("@devstack-rewrite/plugins/coin/CoinRegistry") {};
22
+ /** Scope-bound Layer materializing one `CoinRegistry` per stack
23
+ * scope. Boot wiring (CLI / e2e) provides this once per stack;
24
+ * every coin/package/wallet/faucet plugin in the stack yields the
25
+ * SAME instance via Context. */
26
+ const coinRegistryLayer = Layer.effect(CoinRegistryService, Effect.gen(function* () {
27
+ const refMap = yield* CoinRefMap.Service;
28
+ return CoinRegistryService.of(wrapRefMap(refMap));
29
+ })).pipe(Layer.provide(CoinRefMap.layer));
30
+ /** Capability-key constant for the per-stack registry — siblings
31
+ * (Wallet, Faucet's treasury-cap mint strategy, Manifest emitter)
32
+ * look it up through the StrategyContributor registry. */
33
+ const COIN_REGISTRY_CAPABILITY_KEY = "coin-registry";
34
+ //#endregion
35
+ export { COIN_REGISTRY_CAPABILITY_KEY, CoinRegistryService, coinRegistryLayer };
36
+
37
+ //# sourceMappingURL=registry.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.mjs","names":[],"sources":["../../../src/plugins/coin/registry.ts"],"sourcesContent":["// Per-stack CoinRegistry — owned by the L2 Coin plugin.\n//\n// Architecture (ARCHITECTURE.md § Substrate name-blindness): the\n// substrate exposes ONLY the generic `ScopedRefMap<K, V>` primitive;\n// each L2 plugin instantiates it with its own domain shape. The\n// `CoinRecord` shape below carries Sui/Move-coin concepts\n// (`witness`, `treasuryCapId`, `metadataId`, `packageId`,\n// `mvrPlaceholder`, `publishingPackageName`, `moduleName`) — those\n// are L2 concerns, not substrate.\n//\n// The five Sui-specific lookup shapes (`bySymbol`, `byWitness`,\n// `byType`, `list`, `register`) live on the L2 `CoinRegistry`\n// wrapper. The underlying generic primitive only knows `K -> V`;\n// the wrapper iterates the snapshot for the symbol / witness /\n// type-based queries (cardinality is bounded by declared coins\n// per stack, typically < 10).\n//\n// Lifetime: one instance per stack scope (the generic primitive's\n// `layer` is scope-bound). Plugins yield `CoinRegistryService`\n// from their `acquire` body; the boot wiring (CLI / e2e) provides\n// the resolved instance once per stack.\n\nimport { Context, Effect, Layer } from 'effect';\n\nimport {\n\tdefineScopedRefMap,\n\ttype ScopedRefMap,\n} from '../../substrate/runtime/scoped-ref-map/index.ts';\n\n/** Discovered-coin record — the value-shape stored in the registry.\n * Superset of the published-coin shape with discovery-populated\n * metadata fields. */\nexport interface CoinRecord {\n\t/** Registry key — the discovered CoinMetadata symbol, falling\n\t * back to the witness name when metadata is absent. Always\n\t * lower-cased for case-insensitive lookups (the original-case\n\t * `symbol` field carries the display form). */\n\treadonly key: string;\n\t/** Fully-qualified on-chain type — `0xPKG::module::Witness`. */\n\treadonly type: string;\n\t/** Lower-cased witness identifier (e.g. `mock_usdc`). Used for\n\t * the `coin.fromPackage(pkg, 'MOCK_USDC')` lookup. */\n\treadonly witness: string;\n\t/** Lower-cased module name. */\n\treadonly moduleName: string;\n\t/** `0` when CoinMetadata absent. */\n\treadonly decimals: number;\n\t/** Display-case symbol from CoinMetadata. Absent when metadata\n\t * fetch failed / coin had no CoinMetadata. */\n\treadonly symbol?: string;\n\treadonly displayName?: string;\n\treadonly iconUrl?: string;\n\t/** Present when the publisher held the cap at publish time AND\n\t * the cap is still address-owned. */\n\treadonly treasuryCapId?: string;\n\treadonly metadataId?: string;\n\t/** The publishing package's id — load-bearing for the\n\t * package-scoped witness lookup. */\n\treadonly packageId: string;\n\t/** Source-of-truth name of the publishing package (the Package\n\t * plugin's symbolic name, NOT the on-chain packageId). Used to\n\t * format error messages and drive the codegen emitter's\n\t * per-package grouping. */\n\treadonly publishingPackageName: string;\n}\n\n/** Registry key — the fully-qualified on-chain coin type. Branded so\n * the generic primitive's `K extends string` constraint applies\n * without leaking the brand to substrate. */\nexport type CoinKey = string & { readonly _brand: 'CoinKey' };\n\nconst coinKey = (fullCoinType: string): CoinKey => fullCoinType as CoinKey;\n\n/** Per-stack registry of all discovered coins. The five lookup\n * shapes are Sui-specific projections over a generic `K -> V`\n * scope-bound ref-map. */\nexport interface CoinRegistry {\n\treadonly register: (record: CoinRecord) => Effect.Effect<void>;\n\treadonly bySymbol: (symbol: string) => Effect.Effect<ReadonlyArray<CoinRecord>>;\n\treadonly byWitness: (packageName: string, witness: string) => Effect.Effect<CoinRecord | null>;\n\treadonly byType: (fullCoinType: string) => Effect.Effect<CoinRecord | null>;\n\treadonly list: () => Effect.Effect<ReadonlyArray<CoinRecord>>;\n}\n\n// Generic substrate primitive — instantiated once per logical\n// registry. The service identity is namespaced by the `name`\n// argument; substrate stays name-blind (it sees only `K` and `V`).\nconst CoinRefMap = defineScopedRefMap<CoinKey, CoinRecord>('CoinRegistry');\n\nconst wrapRefMap = (refMap: ScopedRefMap<CoinKey, CoinRecord>): CoinRegistry => ({\n\tregister: (record) => refMap.set(coinKey(record.type), record),\n\tbySymbol: (symbol) =>\n\t\trefMap.entries().pipe(\n\t\t\tEffect.map((entries) => {\n\t\t\t\tconst lowered = symbol.toLowerCase();\n\t\t\t\treturn entries\n\t\t\t\t\t.map(([, r]) => r)\n\t\t\t\t\t.filter((r) => r.key === lowered || r.symbol?.toLowerCase() === lowered);\n\t\t\t}),\n\t\t),\n\tbyWitness: (packageName, witness) =>\n\t\trefMap.entries().pipe(\n\t\t\tEffect.map((entries) => {\n\t\t\t\tconst lowered = witness.toLowerCase();\n\t\t\t\treturn (\n\t\t\t\t\tentries\n\t\t\t\t\t\t.map(([, r]) => r)\n\t\t\t\t\t\t.find(\n\t\t\t\t\t\t\t(r) =>\n\t\t\t\t\t\t\t\tr.publishingPackageName === packageName &&\n\t\t\t\t\t\t\t\t(r.witness === lowered || r.symbol?.toLowerCase() === lowered),\n\t\t\t\t\t\t) ?? null\n\t\t\t\t);\n\t\t\t}),\n\t\t),\n\tbyType: (fullCoinType) =>\n\t\trefMap.find(coinKey(fullCoinType)).pipe(Effect.map((hit) => hit ?? null)),\n\tlist: () => refMap.entries().pipe(Effect.map((entries) => entries.map(([, r]) => r))),\n});\n\n/** Context.Service tag for the per-stack `CoinRegistry`. Plugins\n * yield this in their acquire body. */\nexport class CoinRegistryService extends Context.Service<CoinRegistryService, CoinRegistry>()(\n\t'@devstack-rewrite/plugins/coin/CoinRegistry',\n) {}\n\n/** Scope-bound Layer materializing one `CoinRegistry` per stack\n * scope. Boot wiring (CLI / e2e) provides this once per stack;\n * every coin/package/wallet/faucet plugin in the stack yields the\n * SAME instance via Context. */\nexport const coinRegistryLayer: Layer.Layer<CoinRegistryService> = Layer.effect(\n\tCoinRegistryService,\n\tEffect.gen(function* () {\n\t\tconst refMap = yield* CoinRefMap.Service;\n\t\treturn CoinRegistryService.of(wrapRefMap(refMap));\n\t}),\n).pipe(Layer.provide(CoinRefMap.layer));\n\n/** Capability-key constant for the per-stack registry — siblings\n * (Wallet, Faucet's treasury-cap mint strategy, Manifest emitter)\n * look it up through the StrategyContributor registry. */\nexport const COIN_REGISTRY_CAPABILITY_KEY = 'coin-registry' as const;\n"],"mappings":";;;AAuEA,MAAM,WAAW,iBAAkC;AAgBnD,MAAM,aAAa,mBAAwC,eAAe;AAE1E,MAAM,cAAc,YAA6D;CAChF,WAAW,WAAW,OAAO,IAAI,QAAQ,OAAO,KAAK,EAAE,OAAO;CAC9D,WAAW,WACV,OAAO,SAAS,CAAC,KAChB,OAAO,KAAK,YAAY;EACvB,MAAM,UAAU,OAAO,aAAa;AACpC,SAAO,QACL,KAAK,GAAG,OAAO,EAAE,CACjB,QAAQ,MAAM,EAAE,QAAQ,WAAW,EAAE,QAAQ,aAAa,KAAK,QAAQ;GACxE,CACF;CACF,YAAY,aAAa,YACxB,OAAO,SAAS,CAAC,KAChB,OAAO,KAAK,YAAY;EACvB,MAAM,UAAU,QAAQ,aAAa;AACrC,SACC,QACE,KAAK,GAAG,OAAO,EAAE,CACjB,MACC,MACA,EAAE,0BAA0B,gBAC3B,EAAE,YAAY,WAAW,EAAE,QAAQ,aAAa,KAAK,SACvD,IAAI;GAEN,CACF;CACF,SAAS,iBACR,OAAO,KAAK,QAAQ,aAAa,CAAC,CAAC,KAAK,OAAO,KAAK,QAAQ,OAAO,KAAK,CAAC;CAC1E,YAAY,OAAO,SAAS,CAAC,KAAK,OAAO,KAAK,YAAY,QAAQ,KAAK,GAAG,OAAO,EAAE,CAAC,CAAC;CACrF;;;AAID,IAAa,sBAAb,cAAyC,QAAQ,SAA4C,CAC5F,8CACA,CAAC;;;;;AAMF,MAAa,oBAAsD,MAAM,OACxE,qBACA,OAAO,IAAI,aAAa;CACvB,MAAM,SAAS,OAAO,WAAW;AACjC,QAAO,oBAAoB,GAAG,WAAW,OAAO,CAAC;EAChD,CACF,CAAC,KAAK,MAAM,QAAQ,WAAW,MAAM,CAAC;;;;AAKvC,MAAa,+BAA+B"}
@@ -0,0 +1,47 @@
1
+ import { ArtifactPublishError } from "../../primitives/artifact-publisher.mjs";
2
+ import { CoinError } from "./errors.mjs";
3
+ import { MintResult, MintSigner } from "./mint.mjs";
4
+ import { BUILTIN_COINS, ResolvedCoin } from "./address-resolution.mjs";
5
+ import { Effect, Scope } from "effect";
6
+
7
+ //#region src/plugins/coin/service.d.ts
8
+ /** Per-instance options threaded into the acquire body. One-of the
9
+ * three address forms. */
10
+ type CoinAddressForm = {
11
+ readonly kind: 'witness';
12
+ readonly publishingPackageName: string;
13
+ readonly witness: string;
14
+ readonly fundingSigner?: MintSigner;
15
+ } | {
16
+ readonly kind: 'known';
17
+ readonly fullCoinType: string;
18
+ } | {
19
+ readonly kind: 'builtin';
20
+ readonly name: keyof typeof BUILTIN_COINS;
21
+ };
22
+ /** The tag's resolved value — the three address forms unified PLUS a
23
+ * closure for the generic mint surface. */
24
+ interface CoinValue extends ResolvedCoin {
25
+ /** Generic mint. Requires the cap id (either resolved from the
26
+ * registry record's `treasuryCapId`, or supplied explicitly for
27
+ * bare-type coins). Each call yields a fresh artifact publisher round (cache
28
+ * hit means short-circuit per the substrate primitive). */
29
+ readonly mint: (signer: MintSigner, opts: {
30
+ readonly to: string;
31
+ readonly amount: bigint;
32
+ readonly treasuryCapId?: string;
33
+ }) => Effect.Effect<MintResult, CoinError | ArtifactPublishError, Scope.Scope>;
34
+ /** Centralized funding strategy, present for local package coins
35
+ * whose publisher still owns the TreasuryCap. The coin barrel
36
+ * publishes it under `coinType:<fullCoinType>` so Account funding
37
+ * can mint arbitrary local coins without bespoke example actions. */
38
+ readonly fundingStrategy?: {
39
+ readonly request: (req: {
40
+ readonly address: string;
41
+ readonly amount: bigint;
42
+ }) => Effect.Effect<void, CoinError | ArtifactPublishError>;
43
+ };
44
+ }
45
+ //#endregion
46
+ export { CoinAddressForm, CoinValue };
47
+ //# sourceMappingURL=service.d.mts.map
@@ -0,0 +1,51 @@
1
+ import { coinError } from "./errors.mjs";
2
+ import { resolveBuiltin, resolveByBareType, resolveByWitness } from "./address-resolution.mjs";
3
+ import { performMint } from "./mint.mjs";
4
+ import { Effect } from "effect";
5
+ //#region src/plugins/coin/service.ts
6
+ /** Resolve a coin instance to the tag's resolved value. */
7
+ const acquireCoin = (form, ctx) => Effect.gen(function* () {
8
+ yield* Effect.annotateCurrentSpan({ "coin.form": form.kind });
9
+ const resolved = yield* (() => {
10
+ switch (form.kind) {
11
+ case "witness": return resolveByWitness(ctx.registry, form.publishingPackageName, form.witness);
12
+ case "known": return resolveByBareType(ctx.sdk, form.fullCoinType);
13
+ case "builtin": return Effect.succeed(resolveBuiltin(form.name));
14
+ }
15
+ })();
16
+ yield* Effect.annotateCurrentSpan({
17
+ "coin.fullCoinType": resolved.fullCoinType,
18
+ "coin.decimals": resolved.decimals,
19
+ "coin.source": resolved.source
20
+ });
21
+ const mint = (signer, opts) => {
22
+ const capId = opts.treasuryCapId ?? resolved.treasuryCapId;
23
+ if (capId === void 0) return Effect.fail(coinError("cap-missing", {
24
+ identifier: resolved.fullCoinType,
25
+ message: `coin('${resolved.fullCoinType}').mint(): no treasury cap available — pass opts.treasuryCapId or use a coin discovered with publisherOwnsCap=true.`
26
+ }));
27
+ const inputs = {
28
+ fullCoinType: resolved.fullCoinType,
29
+ treasuryCapId: capId,
30
+ recipient: opts.to,
31
+ amount: opts.amount
32
+ };
33
+ return performMint(ctx.publisher, ctx.chain, signer, ctx.sdk, inputs);
34
+ };
35
+ const fundingSigner = form.kind === "witness" ? form.fundingSigner : void 0;
36
+ const fundingTreasuryCapId = resolved.treasuryCapId;
37
+ const fundingStrategy = fundingSigner !== void 0 && fundingTreasuryCapId !== void 0 ? { request: (req) => Effect.scoped(mint(fundingSigner, {
38
+ to: req.address,
39
+ amount: req.amount,
40
+ treasuryCapId: fundingTreasuryCapId
41
+ }).pipe(Effect.asVoid)) } : void 0;
42
+ return {
43
+ ...resolved,
44
+ mint,
45
+ ...fundingStrategy === void 0 ? {} : { fundingStrategy }
46
+ };
47
+ });
48
+ //#endregion
49
+ export { acquireCoin };
50
+
51
+ //# sourceMappingURL=service.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service.mjs","names":[],"sources":["../../../src/plugins/coin/service.ts"],"sourcesContent":["// Coin plugin — main acquire body.\n//\n// One-shot value resolution: the three address forms unify behind a\n// single `acquireCoin` Effect. The barrel (`index.ts`) constructs ONE\n// `CoinAcquireInputs` per declared coin instance and routes here.\n//\n// What this file does:\n//\n// 1. Dispatch on the address-form discriminator to the right\n// resolver under `address-resolution.ts`.\n// 2. Project the resolved value into the user-facing `ResolvedCoin`\n// shape that the Tag publishes.\n// 3. Project a `mint(...)` closure (lazy mint — captures the\n// resolved fullCoinType + the cap id; defers the substrate-\n// primitive call to mint time so the cache key is keyed on\n// mint-time inputs, not factory-time ones).\n//\n// What it does NOT do:\n//\n// - Consume the LocalPackagePublishOutput — that's the discovery-fold path\n// handled at compose-time in the barrel (the barrel calls into\n// `discovery.ts` + `metadata.ts` to populate the registry as\n// packages publish; this file just READS the registry).\n// - Wire capabilities — the barrel's job.\n\nimport { Effect, type Scope } from 'effect';\n\nimport type { ChainId } from '../../substrate/brand.ts';\nimport type {\n\tArtifactPublishError,\n\tArtifactPublisher,\n} from '../../primitives/artifact-publisher.ts';\nimport {\n\tBUILTIN_COINS,\n\tresolveBuiltin,\n\tresolveByBareType,\n\tresolveByWitness,\n\ttype ResolvedCoin,\n} from './address-resolution.ts';\nimport { coinError, type CoinError } from './errors.ts';\nimport type { MetadataSdkShim } from './metadata.ts';\nimport {\n\tperformMint,\n\ttype MintInputs,\n\ttype MintResult,\n\ttype MintSdkShim,\n\ttype MintSigner,\n} from './mint.ts';\nimport type { CoinRegistry } from './registry.ts';\n\n/** Per-instance options threaded into the acquire body. One-of the\n * three address forms. */\nexport type CoinAddressForm =\n\t| {\n\t\t\treadonly kind: 'witness';\n\t\t\treadonly publishingPackageName: string;\n\t\t\treadonly witness: string;\n\t\t\treadonly fundingSigner?: MintSigner;\n\t }\n\t| { readonly kind: 'known'; readonly fullCoinType: string }\n\t| { readonly kind: 'builtin'; readonly name: keyof typeof BUILTIN_COINS };\n\n/** Per-acquire context supplied by the barrel from the BuildContext.\n * Carries the resolved per-stack registry, the Sui-side SDK shim\n * (verify probe + tx build), the chain id, and the\n * `ArtifactPublisher` substrate primitive used by `performMint`. */\nexport interface CoinAcquireContext {\n\treadonly registry: CoinRegistry;\n\treadonly sdk: MetadataSdkShim & MintSdkShim;\n\treadonly chain: ChainId;\n\treadonly publisher: ArtifactPublisher;\n}\n\n/** The tag's resolved value — the three address forms unified PLUS a\n * closure for the generic mint surface. */\nexport interface CoinValue extends ResolvedCoin {\n\t/** Generic mint. Requires the cap id (either resolved from the\n\t * registry record's `treasuryCapId`, or supplied explicitly for\n\t * bare-type coins). Each call yields a fresh artifact publisher round (cache\n\t * hit means short-circuit per the substrate primitive). */\n\treadonly mint: (\n\t\tsigner: MintSigner,\n\t\topts: { readonly to: string; readonly amount: bigint; readonly treasuryCapId?: string },\n\t) => Effect.Effect<MintResult, CoinError | ArtifactPublishError, Scope.Scope>;\n\t/** Centralized funding strategy, present for local package coins\n\t * whose publisher still owns the TreasuryCap. The coin barrel\n\t * publishes it under `coinType:<fullCoinType>` so Account funding\n\t * can mint arbitrary local coins without bespoke example actions. */\n\treadonly fundingStrategy?: {\n\t\treadonly request: (req: {\n\t\t\treadonly address: string;\n\t\t\treadonly amount: bigint;\n\t\t}) => Effect.Effect<void, CoinError | ArtifactPublishError>;\n\t};\n}\n\n/** Resolve a coin instance to the tag's resolved value. */\nexport const acquireCoin = (\n\tform: CoinAddressForm,\n\tctx: CoinAcquireContext,\n): Effect.Effect<CoinValue, CoinError> =>\n\tEffect.gen(function* () {\n\t\tyield* Effect.annotateCurrentSpan({\n\t\t\t'coin.form': form.kind,\n\t\t});\n\n\t\tconst resolved: ResolvedCoin = yield* (() => {\n\t\t\tswitch (form.kind) {\n\t\t\t\tcase 'witness':\n\t\t\t\t\treturn resolveByWitness(ctx.registry, form.publishingPackageName, form.witness);\n\t\t\t\tcase 'known':\n\t\t\t\t\treturn resolveByBareType(ctx.sdk, form.fullCoinType);\n\t\t\t\tcase 'builtin':\n\t\t\t\t\treturn Effect.succeed(resolveBuiltin(form.name));\n\t\t\t}\n\t\t})();\n\n\t\tyield* Effect.annotateCurrentSpan({\n\t\t\t'coin.fullCoinType': resolved.fullCoinType,\n\t\t\t'coin.decimals': resolved.decimals,\n\t\t\t'coin.source': resolved.source,\n\t\t});\n\n\t\tconst mint: CoinValue['mint'] = (signer, opts) => {\n\t\t\tconst capId = opts.treasuryCapId ?? resolved.treasuryCapId;\n\t\t\tif (capId === undefined) {\n\t\t\t\treturn Effect.fail(\n\t\t\t\t\tcoinError('cap-missing', {\n\t\t\t\t\t\tidentifier: resolved.fullCoinType,\n\t\t\t\t\t\tmessage: `coin('${resolved.fullCoinType}').mint(): no treasury cap available — pass opts.treasuryCapId or use a coin discovered with publisherOwnsCap=true.`,\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst inputs: MintInputs = {\n\t\t\t\tfullCoinType: resolved.fullCoinType,\n\t\t\t\ttreasuryCapId: capId,\n\t\t\t\trecipient: opts.to,\n\t\t\t\tamount: opts.amount,\n\t\t\t};\n\t\t\treturn performMint(ctx.publisher, ctx.chain, signer, ctx.sdk, inputs);\n\t\t};\n\t\tconst fundingSigner = form.kind === 'witness' ? form.fundingSigner : undefined;\n\t\tconst fundingTreasuryCapId = resolved.treasuryCapId;\n\t\tconst fundingStrategy =\n\t\t\tfundingSigner !== undefined && fundingTreasuryCapId !== undefined\n\t\t\t\t? {\n\t\t\t\t\t\trequest: (req: { readonly address: string; readonly amount: bigint }) =>\n\t\t\t\t\t\t\tEffect.scoped(\n\t\t\t\t\t\t\t\tmint(fundingSigner, {\n\t\t\t\t\t\t\t\t\tto: req.address,\n\t\t\t\t\t\t\t\t\tamount: req.amount,\n\t\t\t\t\t\t\t\t\ttreasuryCapId: fundingTreasuryCapId,\n\t\t\t\t\t\t\t\t}).pipe(Effect.asVoid),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t}\n\t\t\t\t: undefined;\n\t\tconst value: CoinValue = {\n\t\t\t...resolved,\n\t\t\tmint,\n\t\t\t...(fundingStrategy === undefined ? {} : { fundingStrategy }),\n\t\t};\n\t\treturn value;\n\t});\n"],"mappings":";;;;;;AAiGA,MAAa,eACZ,MACA,QAEA,OAAO,IAAI,aAAa;AACvB,QAAO,OAAO,oBAAoB,EACjC,aAAa,KAAK,MAClB,CAAC;CAEF,MAAM,WAAyB,cAAc;AAC5C,UAAQ,KAAK,MAAb;GACC,KAAK,UACJ,QAAO,iBAAiB,IAAI,UAAU,KAAK,uBAAuB,KAAK,QAAQ;GAChF,KAAK,QACJ,QAAO,kBAAkB,IAAI,KAAK,KAAK,aAAa;GACrD,KAAK,UACJ,QAAO,OAAO,QAAQ,eAAe,KAAK,KAAK,CAAC;;KAE/C;AAEJ,QAAO,OAAO,oBAAoB;EACjC,qBAAqB,SAAS;EAC9B,iBAAiB,SAAS;EAC1B,eAAe,SAAS;EACxB,CAAC;CAEF,MAAM,QAA2B,QAAQ,SAAS;EACjD,MAAM,QAAQ,KAAK,iBAAiB,SAAS;AAC7C,MAAI,UAAU,KAAA,EACb,QAAO,OAAO,KACb,UAAU,eAAe;GACxB,YAAY,SAAS;GACrB,SAAS,SAAS,SAAS,aAAa;GACxC,CAAC,CACF;EAEF,MAAM,SAAqB;GAC1B,cAAc,SAAS;GACvB,eAAe;GACf,WAAW,KAAK;GAChB,QAAQ,KAAK;GACb;AACD,SAAO,YAAY,IAAI,WAAW,IAAI,OAAO,QAAQ,IAAI,KAAK,OAAO;;CAEtE,MAAM,gBAAgB,KAAK,SAAS,YAAY,KAAK,gBAAgB,KAAA;CACrE,MAAM,uBAAuB,SAAS;CACtC,MAAM,kBACL,kBAAkB,KAAA,KAAa,yBAAyB,KAAA,IACrD,EACA,UAAU,QACT,OAAO,OACN,KAAK,eAAe;EACnB,IAAI,IAAI;EACR,QAAQ,IAAI;EACZ,eAAe;EACf,CAAC,CAAC,KAAK,OAAO,OAAO,CACtB,EACF,GACA,KAAA;AAMJ,QAAO;EAJN,GAAG;EACH;EACA,GAAI,oBAAoB,KAAA,IAAY,EAAE,GAAG,EAAE,iBAAiB;EAEjD;EACX"}
@@ -0,0 +1,19 @@
1
+ import { Effect } from "effect";
2
+ //#region src/plugins/coin/snapshot.ts
3
+ /** Identity guard for the snapshot orchestrator. Per-coin record so
4
+ * the substrate can dedup by `(plugin, symbol)` if a future
5
+ * per-coin wipe lands. */
6
+ const makeCoinSnapshotable = (parts) => ({
7
+ kind: "snapshotable",
8
+ subtrees: [],
9
+ missingTolerance: "fine",
10
+ preRestore: Effect.succeed({
11
+ kind: "coin",
12
+ symbol: parts.symbol
13
+ }),
14
+ postRestore: Effect.void
15
+ });
16
+ //#endregion
17
+ export { makeCoinSnapshotable };
18
+
19
+ //# sourceMappingURL=snapshot.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snapshot.mjs","names":[],"sources":["../../../src/plugins/coin/snapshot.ts"],"sourcesContent":["// Coin plugin — Snapshotable contribution.\n//\n// Distilled-doc 13-coin.md §Persistence model:\n//\n// - The mint-cache (`coin/mint/<chainId>/...`) lives in the\n// state-store and IS captured by the substrate's auto-included\n// subtree under `runtime/<plugin-key>/state-store/...`. We\n// declare no extra subtrees here.\n// - The `CoinRegistry` is purely in-process; nothing to capture.\n// - Per-Layer-invocation metadata cache is also in-process.\n//\n// The plugin therefore emits a MINIMAL snapshot decl:\n// `missingTolerance: 'fine'` (a fresh stack with no cache entries\n// just re-mints / re-resolves on next acquisition), no subtrees, no\n// containers. The decl exists for shape symmetry with the other\n// plugins and so a per-coin \"wipe\" recipe has a contribution to\n// target in the future.\n\nimport { Effect } from 'effect';\n\nimport type { SnapshotableDecl } from '../../contracts/snapshotable.ts';\n\n/** Identity guard for the snapshot orchestrator. Per-coin record so\n * the substrate can dedup by `(plugin, symbol)` if a future\n * per-coin wipe lands. */\nexport const makeCoinSnapshotable = (parts: { readonly symbol: string }): SnapshotableDecl => ({\n\tkind: 'snapshotable',\n\tsubtrees: [],\n\tmissingTolerance: 'fine',\n\tpreRestore: Effect.succeed({\n\t\tkind: 'coin' as const,\n\t\tsymbol: parts.symbol,\n\t}),\n\tpostRestore: Effect.void,\n});\n"],"mappings":";;;;;AAyBA,MAAa,wBAAwB,WAA0D;CAC9F,MAAM;CACN,UAAU,EAAE;CACZ,kBAAkB;CAClB,YAAY,OAAO,QAAQ;EAC1B,MAAM;EACN,QAAQ,MAAM;EACd,CAAC;CACF,aAAa,OAAO;CACpB"}
@@ -0,0 +1,49 @@
1
+ //#region src/plugins/coin/type-strings.ts
2
+ const normalizeSuiAddress = (address) => {
3
+ if (!address.startsWith("0x")) return null;
4
+ const hex = address.slice(2).toLowerCase();
5
+ if (!/^[0-9a-f]+$/.test(hex)) return null;
6
+ return `0x${hex.replace(/^0+/, "") || "0"}`;
7
+ };
8
+ const normalizeStructTypeAddress = (typeName) => {
9
+ const parts = typeName.split("::");
10
+ if (parts.length !== 3) return null;
11
+ const [address, moduleName, structName] = parts;
12
+ if (address === void 0 || moduleName === void 0 || structName === void 0) return null;
13
+ const normalizedAddress = normalizeSuiAddress(address) ?? (address.startsWith("0x") ? address : null);
14
+ if (normalizedAddress === null) return null;
15
+ return `${normalizedAddress}::${moduleName}::${structName}`;
16
+ };
17
+ /** Parse the inner generic out of Sui-framework `coin::<Wrapper><INNER>`.
18
+ * The SDK may spell the framework address as `0x2` or fully padded
19
+ * `0x000...0002`; normalize before matching. Returns `null` if the
20
+ * inner generic itself carries angle brackets. */
21
+ const pickSuiFrameworkInnerGenericFromModule = (objectType, moduleName, wrapperName) => {
22
+ if (!objectType.endsWith(">")) return null;
23
+ const firstSep = objectType.indexOf("::");
24
+ const secondSep = objectType.indexOf("::", firstSep + 2);
25
+ if (firstSep === -1 || secondSep === -1) return null;
26
+ const address = objectType.slice(0, firstSep);
27
+ const actualModuleName = objectType.slice(firstSep + 2, secondSep);
28
+ const rest = objectType.slice(secondSep + 2);
29
+ if (normalizeSuiAddress(address) !== "0x2") return null;
30
+ if (actualModuleName !== moduleName) return null;
31
+ const wrapperPrefix = `${wrapperName}<`;
32
+ if (!rest.startsWith(wrapperPrefix)) return null;
33
+ const inner = rest.slice(wrapperPrefix.length, -1);
34
+ if (inner.includes("<") || inner.includes(">")) return null;
35
+ if (normalizeStructTypeAddress(inner) === null) return null;
36
+ return inner;
37
+ };
38
+ const pickSuiFrameworkInnerGeneric = (objectType, wrapperName) => pickSuiFrameworkInnerGenericFromModule(objectType, "coin", wrapperName);
39
+ const isSuiFrameworkObjectForCoin = (objectType, wrapperName, fullCoinType) => {
40
+ const inner = pickSuiFrameworkInnerGeneric(objectType, wrapperName);
41
+ if (inner === null) return false;
42
+ const normalizedInner = normalizeStructTypeAddress(inner);
43
+ const normalizedExpected = normalizeStructTypeAddress(fullCoinType);
44
+ return normalizedInner !== null && normalizedExpected !== null && normalizedInner === normalizedExpected;
45
+ };
46
+ //#endregion
47
+ export { isSuiFrameworkObjectForCoin, pickSuiFrameworkInnerGeneric, pickSuiFrameworkInnerGenericFromModule };
48
+
49
+ //# sourceMappingURL=type-strings.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-strings.mjs","names":[],"sources":["../../../src/plugins/coin/type-strings.ts"],"sourcesContent":["export const normalizeSuiAddress = (address: string): string | null => {\n\tif (!address.startsWith('0x')) return null;\n\tconst hex = address.slice(2).toLowerCase();\n\tif (!/^[0-9a-f]+$/.test(hex)) return null;\n\treturn `0x${hex.replace(/^0+/, '') || '0'}`;\n};\n\nexport const normalizeStructTypeAddress = (typeName: string): string | null => {\n\tconst parts = typeName.split('::');\n\tif (parts.length !== 3) return null;\n\tconst [address, moduleName, structName] = parts;\n\tif (address === undefined || moduleName === undefined || structName === undefined) return null;\n\tconst normalizedAddress =\n\t\tnormalizeSuiAddress(address) ?? (address.startsWith('0x') ? address : null);\n\tif (normalizedAddress === null) return null;\n\treturn `${normalizedAddress}::${moduleName}::${structName}`;\n};\n\n/** Parse the inner generic out of Sui-framework `coin::<Wrapper><INNER>`.\n * The SDK may spell the framework address as `0x2` or fully padded\n * `0x000...0002`; normalize before matching. Returns `null` if the\n * inner generic itself carries angle brackets. */\nexport const pickSuiFrameworkInnerGenericFromModule = (\n\tobjectType: string,\n\tmoduleName: string,\n\twrapperName: string,\n): string | null => {\n\tif (!objectType.endsWith('>')) return null;\n\tconst firstSep = objectType.indexOf('::');\n\tconst secondSep = objectType.indexOf('::', firstSep + 2);\n\tif (firstSep === -1 || secondSep === -1) return null;\n\tconst address = objectType.slice(0, firstSep);\n\tconst actualModuleName = objectType.slice(firstSep + 2, secondSep);\n\tconst rest = objectType.slice(secondSep + 2);\n\tif (normalizeSuiAddress(address) !== '0x2') return null;\n\tif (actualModuleName !== moduleName) return null;\n\tconst wrapperPrefix = `${wrapperName}<`;\n\tif (!rest.startsWith(wrapperPrefix)) return null;\n\tconst inner = rest.slice(wrapperPrefix.length, -1);\n\tif (inner.includes('<') || inner.includes('>')) return null;\n\tif (normalizeStructTypeAddress(inner) === null) return null;\n\treturn inner;\n};\n\nexport const pickSuiFrameworkInnerGeneric = (\n\tobjectType: string,\n\twrapperName: string,\n): string | null => pickSuiFrameworkInnerGenericFromModule(objectType, 'coin', wrapperName);\n\nexport const isSuiFrameworkObjectForCoin = (\n\tobjectType: string,\n\twrapperName: string,\n\tfullCoinType: string,\n): boolean => {\n\tconst inner = pickSuiFrameworkInnerGeneric(objectType, wrapperName);\n\tif (inner === null) return false;\n\tconst normalizedInner = normalizeStructTypeAddress(inner);\n\tconst normalizedExpected = normalizeStructTypeAddress(fullCoinType);\n\treturn (\n\t\tnormalizedInner !== null &&\n\t\tnormalizedExpected !== null &&\n\t\tnormalizedInner === normalizedExpected\n\t);\n};\n"],"mappings":";AAAA,MAAa,uBAAuB,YAAmC;AACtE,KAAI,CAAC,QAAQ,WAAW,KAAK,CAAE,QAAO;CACtC,MAAM,MAAM,QAAQ,MAAM,EAAE,CAAC,aAAa;AAC1C,KAAI,CAAC,cAAc,KAAK,IAAI,CAAE,QAAO;AACrC,QAAO,KAAK,IAAI,QAAQ,OAAO,GAAG,IAAI;;AAGvC,MAAa,8BAA8B,aAAoC;CAC9E,MAAM,QAAQ,SAAS,MAAM,KAAK;AAClC,KAAI,MAAM,WAAW,EAAG,QAAO;CAC/B,MAAM,CAAC,SAAS,YAAY,cAAc;AAC1C,KAAI,YAAY,KAAA,KAAa,eAAe,KAAA,KAAa,eAAe,KAAA,EAAW,QAAO;CAC1F,MAAM,oBACL,oBAAoB,QAAQ,KAAK,QAAQ,WAAW,KAAK,GAAG,UAAU;AACvE,KAAI,sBAAsB,KAAM,QAAO;AACvC,QAAO,GAAG,kBAAkB,IAAI,WAAW,IAAI;;;;;;AAOhD,MAAa,0CACZ,YACA,YACA,gBACmB;AACnB,KAAI,CAAC,WAAW,SAAS,IAAI,CAAE,QAAO;CACtC,MAAM,WAAW,WAAW,QAAQ,KAAK;CACzC,MAAM,YAAY,WAAW,QAAQ,MAAM,WAAW,EAAE;AACxD,KAAI,aAAa,MAAM,cAAc,GAAI,QAAO;CAChD,MAAM,UAAU,WAAW,MAAM,GAAG,SAAS;CAC7C,MAAM,mBAAmB,WAAW,MAAM,WAAW,GAAG,UAAU;CAClE,MAAM,OAAO,WAAW,MAAM,YAAY,EAAE;AAC5C,KAAI,oBAAoB,QAAQ,KAAK,MAAO,QAAO;AACnD,KAAI,qBAAqB,WAAY,QAAO;CAC5C,MAAM,gBAAgB,GAAG,YAAY;AACrC,KAAI,CAAC,KAAK,WAAW,cAAc,CAAE,QAAO;CAC5C,MAAM,QAAQ,KAAK,MAAM,cAAc,QAAQ,GAAG;AAClD,KAAI,MAAM,SAAS,IAAI,IAAI,MAAM,SAAS,IAAI,CAAE,QAAO;AACvD,KAAI,2BAA2B,MAAM,KAAK,KAAM,QAAO;AACvD,QAAO;;AAGR,MAAa,gCACZ,YACA,gBACmB,uCAAuC,YAAY,QAAQ,YAAY;AAE3F,MAAa,+BACZ,YACA,aACA,iBACa;CACb,MAAM,QAAQ,6BAA6B,YAAY,YAAY;AACnE,KAAI,UAAU,KAAM,QAAO;CAC3B,MAAM,kBAAkB,2BAA2B,MAAM;CACzD,MAAM,qBAAqB,2BAA2B,aAAa;AACnE,QACC,oBAAoB,QACpB,uBAAuB,QACvB,oBAAoB"}
@@ -0,0 +1,39 @@
1
+ //#region src/plugins/deepbook/codegen.d.ts
2
+ interface DeepbookPoolBinding {
3
+ readonly name: string;
4
+ readonly poolId: string;
5
+ readonly base: string;
6
+ readonly quote: string;
7
+ readonly baseCoinType: string;
8
+ readonly quoteCoinType: string;
9
+ }
10
+ interface DeepbookBindings {
11
+ readonly name: string;
12
+ readonly chain: string;
13
+ readonly packageId: string;
14
+ readonly registryId: string;
15
+ readonly adminCapId: string | null;
16
+ readonly deepTreasuryId: string | null;
17
+ readonly pools: ReadonlyArray<DeepbookPoolBinding>;
18
+ readonly pyth: {
19
+ readonly packageId: string | null;
20
+ readonly stateId: string | null;
21
+ readonly wormholeStateId: string | null;
22
+ readonly feeds: ReadonlyArray<{
23
+ readonly symbol: string;
24
+ readonly feedId: string;
25
+ readonly priceInfoObjectId: string;
26
+ readonly price: string;
27
+ readonly expo: number;
28
+ }>;
29
+ } | null;
30
+ readonly margin: {
31
+ readonly packageId: string;
32
+ readonly registryId: string;
33
+ } | null;
34
+ readonly serverUrl: string | null;
35
+ readonly indexerUrl: string | null;
36
+ }
37
+ //#endregion
38
+ export { DeepbookBindings, DeepbookPoolBinding };
39
+ //# sourceMappingURL=codegen.d.mts.map
@@ -0,0 +1,15 @@
1
+ import { Effect } from "effect";
2
+ //#region src/plugins/deepbook/codegen.ts
3
+ const makeDeepbookCodegenable = (bindings) => ({
4
+ kind: "codegenable",
5
+ emitterName: "deepbook-network",
6
+ outputPath: `deepbook/${bindings.name}.ts`,
7
+ emit: (ctx) => Effect.sync(() => {
8
+ ctx.exportConst("deepbookBindings", bindings);
9
+ return ctx.done();
10
+ })
11
+ });
12
+ //#endregion
13
+ export { makeDeepbookCodegenable };
14
+
15
+ //# sourceMappingURL=codegen.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codegen.mjs","names":[],"sources":["../../../src/plugins/deepbook/codegen.ts"],"sourcesContent":["// Deepbook plugin — Codegenable contribution.\n//\n// One emit shape: `deepbook-network`. Mirrors the resolved value's\n// stable identifiers (package id, registry id, per-pool ids).\n\nimport { Effect } from 'effect';\n\nimport type { CodegenableDecl } from '../../contracts/codegenable.ts';\n\nexport interface DeepbookPoolBinding {\n\treadonly name: string;\n\treadonly poolId: string;\n\treadonly base: string;\n\treadonly quote: string;\n\treadonly baseCoinType: string;\n\treadonly quoteCoinType: string;\n}\n\nexport interface DeepbookBindings {\n\treadonly name: string;\n\treadonly chain: string;\n\treadonly packageId: string;\n\treadonly registryId: string;\n\treadonly adminCapId: string | null;\n\treadonly deepTreasuryId: string | null;\n\treadonly pools: ReadonlyArray<DeepbookPoolBinding>;\n\treadonly pyth: {\n\t\treadonly packageId: string | null;\n\t\treadonly stateId: string | null;\n\t\treadonly wormholeStateId: string | null;\n\t\treadonly feeds: ReadonlyArray<{\n\t\t\treadonly symbol: string;\n\t\t\treadonly feedId: string;\n\t\t\treadonly priceInfoObjectId: string;\n\t\t\treadonly price: string;\n\t\t\treadonly expo: number;\n\t\t}>;\n\t} | null;\n\treadonly margin: {\n\t\treadonly packageId: string;\n\t\treadonly registryId: string;\n\t} | null;\n\treadonly serverUrl: string | null;\n\treadonly indexerUrl: string | null;\n}\n\nexport const makeDeepbookCodegenable = (\n\tbindings: DeepbookBindings,\n): CodegenableDecl<'deepbook-network'> => ({\n\tkind: 'codegenable',\n\temitterName: 'deepbook-network',\n\toutputPath: `deepbook/${bindings.name}.ts`,\n\temit: (ctx) =>\n\t\tEffect.sync(() => {\n\t\t\tctx.exportConst('deepbookBindings', bindings satisfies DeepbookBindings);\n\t\t\treturn ctx.done();\n\t\t}),\n});\n"],"mappings":";;AA8CA,MAAa,2BACZ,cAC0C;CAC1C,MAAM;CACN,aAAa;CACb,YAAY,YAAY,SAAS,KAAK;CACtC,OAAO,QACN,OAAO,WAAW;AACjB,MAAI,YAAY,oBAAoB,SAAoC;AACxE,SAAO,IAAI,MAAM;GAChB;CACH"}