@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,94 @@
1
+ import { AnyResourceRef, ResourceRef } from "../../substrate/plugin.mjs";
2
+ import { CoinResourceId } from "../coin/index.mjs";
3
+ import { AccountValue } from "./service.mjs";
4
+ import { Effect } from "effect";
5
+
6
+ //#region src/plugins/account/funding.d.ts
7
+ /** Direct resource ref shape for a coin upstream. The user passes the
8
+ * result of `coin.fromPackage(...)` / `coin.known(...)` /
9
+ * `coin.builtin(...)` — NOT a bare string or discriminator. Generic
10
+ * over the literal symbol so the account's dependency tuple preserves
11
+ * each per-coin resource id (`coin:managed_coin/managed_coin`,
12
+ * `coin:wal`, ...).
13
+ *
14
+ * Architecture (Direct Member Refs): cross-plugin references at the
15
+ * user-facing surface are plugin/resource refs directly — no opaque
16
+ * tag or string discriminator vocabulary. */
17
+ interface AccountFundingCoinValue {
18
+ readonly fullCoinType: string;
19
+ readonly symbol?: string;
20
+ }
21
+ type CoinMember<Sym extends string = string> = ResourceRef<CoinResourceId<Sym>, AccountFundingCoinValue>;
22
+ /** Optional dependency edge for the plugin that contributes the
23
+ * funding strategy. Coin refs force the coin metadata edge; `via`
24
+ * forces the strategy-provider edge (e.g. a known DeepBook
25
+ * deployment that contributes `coinType:<DEEP>`). */
26
+ type CrossCuttingFundingProvider = AnyResourceRef | readonly AnyResourceRef[];
27
+ /** Built-in SUI funding entry. This uses the same account funding
28
+ * list as arbitrary coins but avoids requiring `coin.builtin('sui')`
29
+ * for the normal SUI faucet path. */
30
+ interface SuiFundingEntry {
31
+ readonly coin: 'sui';
32
+ readonly amount: number | bigint;
33
+ }
34
+ /** A single cross-cutting funding entry. `coin` is a direct member ref
35
+ * (the value returned by `coin.fromPackage(...)` etc.) — the account plugin
36
+ * threads it through `dependsOn` so the substrate's dep graph forces
37
+ * the publishing / discovery edge to land before funding.
38
+ *
39
+ * Distilled-doc invariant ("Strict upstream declaration"): coin
40
+ * references cited by Account must force a dep edge. `via` is the
41
+ * same contract for the strategy contributor that can satisfy the
42
+ * funding request. */
43
+ interface CrossCuttingFundingEntry<M extends CoinMember = CoinMember> {
44
+ readonly coin: M;
45
+ readonly amount: bigint;
46
+ readonly via?: CrossCuttingFundingProvider;
47
+ }
48
+ type AccountFundingEntry<M extends CoinMember = CoinMember> = SuiFundingEntry | CrossCuttingFundingEntry<M>;
49
+ type AccountFunding = ReadonlyArray<AccountFundingEntry>;
50
+ /** Internal projected shape — the acquire body in `account/index.ts`
51
+ * receives each funding entry's resolved `CoinValue`, reads
52
+ * `fullCoinType`, and passes the projected entries to
53
+ * `applyCrossCuttingFunding`. The funding pass never sees the raw
54
+ * member refs — keeps the strategy dispatch logic
55
+ * substrate-name-blind. */
56
+ interface ProjectedFundingEntry {
57
+ readonly coin: string;
58
+ readonly fullCoinType: string;
59
+ readonly amount: bigint;
60
+ }
61
+ type ProjectedFunding = ReadonlyArray<ProjectedFundingEntry>;
62
+ interface AccountFundingResult {
63
+ readonly requested: ProjectedFunding;
64
+ readonly applied: ProjectedFunding;
65
+ }
66
+ /** Request passed to account funding strategies. `amount` uses the
67
+ * funded coin's smallest unit. The resolved account handle is present
68
+ * so strategies without an admin signer can perform account-owned
69
+ * swaps while still sharing the central funding dispatcher. */
70
+ interface AccountFundingRequest {
71
+ readonly address: string;
72
+ readonly amount: bigint;
73
+ readonly account: AccountValue;
74
+ }
75
+ interface AccountFundingStrategy<E = unknown> {
76
+ readonly request: (req: AccountFundingRequest) => Effect.Effect<void, E>;
77
+ /** True when the strategy calls `account.withTransactionSigner`.
78
+ * The dispatcher must not acquire the same non-reentrant
79
+ * per-address lease outside the strategy. */
80
+ readonly usesAccountSigner?: boolean;
81
+ }
82
+ /** The canonical builtin SUI coin type. Used by the funding dispatch
83
+ * to route SUI entries to the faucet strategy (same key as the
84
+ * default-funding pass), and by everything that needs to detect
85
+ * "this is the protocol-defined SUI". Mirrors `BUILTIN_COINS.sui`
86
+ * in the coin plugin. */
87
+ declare const SUI_FULL_COIN_TYPE: "0x2::sui::SUI";
88
+ /** Default funding amount for ephemeral accounts — 1 SUI in MIST.
89
+ * Documented at the user-facing factory so a bare `account('alice')`
90
+ * is predictable. */
91
+ declare const DEFAULT_EPHEMERAL_FUND_MIST = 1000000000n;
92
+ //#endregion
93
+ export { AccountFunding, AccountFundingCoinValue, AccountFundingEntry, AccountFundingRequest, AccountFundingResult, AccountFundingStrategy, CoinMember, CrossCuttingFundingEntry, CrossCuttingFundingProvider, DEFAULT_EPHEMERAL_FUND_MIST, ProjectedFunding, ProjectedFundingEntry, SUI_FULL_COIN_TYPE, SuiFundingEntry };
94
+ //# sourceMappingURL=funding.d.mts.map
@@ -0,0 +1,199 @@
1
+ import { setCurrentPluginPhase } from "../../substrate/runtime/current-plugin.mjs";
2
+ import { StrategyRegistryService } from "../../substrate/runtime/strategy-registry/service.mjs";
3
+ import { faucetCapabilityFor } from "../../substrate/runtime/strategy-registry/faucet-capability-for.mjs";
4
+ import { accountAcquireError } from "./errors.mjs";
5
+ import { withAddressLease } from "./lease.mjs";
6
+ import { Duration, Effect } from "effect";
7
+ //#region src/plugins/account/funding.ts
8
+ /** The canonical builtin SUI coin type. Used by the funding dispatch
9
+ * to route SUI entries to the faucet strategy (same key as the
10
+ * default-funding pass), and by everything that needs to detect
11
+ * "this is the protocol-defined SUI". Mirrors `BUILTIN_COINS.sui`
12
+ * in the coin plugin. */
13
+ const SUI_FULL_COIN_TYPE = "0x2::sui::SUI";
14
+ /** Default funding amount for ephemeral accounts — 1 SUI in MIST.
15
+ * Documented at the user-facing factory so a bare `account('alice')`
16
+ * is predictable. */
17
+ const DEFAULT_EPHEMERAL_FUND_MIST = 1000000000n;
18
+ const FUNDING_SETTLEMENT_INTERVAL_MS = 250;
19
+ const FUNDING_SETTLEMENT_TIMEOUT_MS = 3e4;
20
+ /** Apply the default-funding pass for an ephemeral account.
21
+ *
22
+ * Wiring: yields `StrategyRegistryService` (the R-channel from
23
+ * Round 7), looks up the faucet strategy registered by the Sui
24
+ * plugin under `faucet:request:<chainId>`, and dispatches a request
25
+ * through it. Per-address serialization is enforced by acquiring
26
+ * the address lock around the wire call. */
27
+ const fundEphemeralDefault = (parts) => Effect.gen(function* () {
28
+ if (parts.suiMode === "fork") yield* parts.emitAutoPromotionEvent();
29
+ if (parts.amountMist <= 0n) return;
30
+ yield* setCurrentPluginPhase("checking SUI funding");
31
+ const existingBalance = yield* readExistingBalance(parts.balanceReader, {
32
+ owner: parts.address,
33
+ coinType: SUI_FULL_COIN_TYPE
34
+ });
35
+ if (existingBalance !== null && existingBalance >= parts.amountMist) return;
36
+ const strategy = yield* faucetCapabilityFor(parts.chainId).pipe(Effect.catchTag("StrategyNotFoundError", (err) => Effect.fail(accountAcquireError({
37
+ phase: "fund-default",
38
+ accountName: parts.accountName,
39
+ variant: "ephemeral",
40
+ message: `Account '${parts.accountName}': no faucet strategy registered for chain '${parts.chainId}' (sui mode=${parts.suiMode}). Registered keys: [${err.registeredKeys.join(", ")}].`,
41
+ hint: parts.suiMode === "fork" ? "Fork networks have no HTTP faucet — compose a plugin that contributes defineFaucetStrategy(...) for this chain id." : "Ensure a sui() plugin with a faucet-bearing mode (local/live-testnet/live-devnet) is in the stack."
42
+ }))));
43
+ const wrapFaucetFailure = (cause) => Effect.fail(accountAcquireError({
44
+ phase: "fund-default",
45
+ accountName: parts.accountName,
46
+ variant: "ephemeral",
47
+ message: `Account '${parts.accountName}': faucet strategy request failed for chain '${parts.chainId}' (tag=${cause._tag}).`,
48
+ cause,
49
+ hint: "See the cause chain — typical roots are the faucet container not yet ready (FaucetUnreachable), the wall-clock budget elapsed (FaucetExhausted), or the body returned Failure (FaucetBodyError)."
50
+ }));
51
+ yield* setCurrentPluginPhase("funding SUI");
52
+ yield* withAddressLease(parts.broker, parts.accountName, parts.address, strategy.request({
53
+ address: parts.address,
54
+ amount: parts.amountMist
55
+ }).pipe(Effect.catchTags({
56
+ FaucetUnreachable: wrapFaucetFailure,
57
+ FaucetExhausted: wrapFaucetFailure,
58
+ FaucetBodyError: wrapFaucetFailure
59
+ })));
60
+ yield* setCurrentPluginPhase("waiting for SUI funding settlement");
61
+ yield* waitForBalanceAtLeast({
62
+ balanceReader: parts.balanceReader,
63
+ accountName: parts.accountName,
64
+ variant: "ephemeral",
65
+ phase: "fund-default",
66
+ owner: parts.address,
67
+ coinType: SUI_FULL_COIN_TYPE,
68
+ coinLabel: "SUI",
69
+ amount: parts.amountMist
70
+ });
71
+ yield* Effect.annotateCurrentSpan({
72
+ "account.name": parts.accountName,
73
+ "account.address": parts.address,
74
+ "fund.amount.mist": parts.amountMist.toString(),
75
+ "sui.chain": parts.chainId,
76
+ "sui.mode": parts.suiMode
77
+ });
78
+ }).pipe(Effect.withSpan("devstack.plugin.account.fundEphemeralDefault", { attributes: {
79
+ "account.name": parts.accountName,
80
+ "account.address": parts.address,
81
+ "sui.mode": parts.suiMode
82
+ } }));
83
+ /** Apply the cross-cutting funding pass. Variant-agnostic — runs for
84
+ * every variant once the keypair / impersonation slot is bound and
85
+ * the address is known.
86
+ *
87
+ * Distilled-doc invariant: "Optional Faucet is a noop, not an
88
+ * error". Absence of a registered strategy for a non-SUI coin's
89
+ * capability key short-circuits silently (the entry is dropped).
90
+ * Explicit SUI entries are stricter: they route through the active
91
+ * chain's faucet strategy and fail loudly when none is registered.
92
+ * This lets a test author opt INTO arbitrary-coin funding without
93
+ * forcing every surrounding network to satisfy every custom coin.
94
+ *
95
+ * Wiring: SUI entries (`fullCoinType === '0x2::sui::SUI'`) dispatch
96
+ * through `faucet:request:<chainId>` (same key as the default pass);
97
+ * other entries dispatch through `coinType:<fullCoinType>` keys
98
+ * contributed by the respective Coin/Walrus/Seal plugins.
99
+ *
100
+ * Entries are processed serially. Strategies that use the resolved
101
+ * account signer acquire the per-address lease internally; strategies
102
+ * that do not are wrapped by this dispatcher. */
103
+ const applyCrossCuttingFunding = (parts) => Effect.gen(function* () {
104
+ if (parts.funding.length === 0) return [];
105
+ const registry = yield* StrategyRegistryService;
106
+ const applied = [];
107
+ for (const entry of parts.funding) {
108
+ if (entry.amount <= 0n) continue;
109
+ yield* setCurrentPluginPhase(`checking ${entry.coin} funding`);
110
+ const existingBalance = yield* readExistingBalance(parts.balanceReader, {
111
+ owner: parts.address,
112
+ coinType: entry.fullCoinType
113
+ });
114
+ if (existingBalance !== null && existingBalance >= entry.amount) {
115
+ applied.push(entry);
116
+ continue;
117
+ }
118
+ const isSui = entry.fullCoinType === SUI_FULL_COIN_TYPE;
119
+ const coinKey = `coinType:${entry.fullCoinType}`;
120
+ const strategy = yield* (isSui ? faucetCapabilityFor(parts.chainId) : registry.get(coinKey)).pipe(Effect.catchTag("StrategyNotFoundError", (err) => isSui ? Effect.fail(accountAcquireError({
121
+ phase: "fund-cross-cutting",
122
+ accountName: parts.accountName,
123
+ variant: parts.variant,
124
+ message: `Account '${parts.accountName}': no SUI funding strategy registered for chain '${parts.chainId}'. Registered keys: [${err.registeredKeys.join(", ")}].`,
125
+ cause: err,
126
+ hint: "Ensure a sui() plugin with a faucet-bearing mode (local/live-testnet/live-devnet) is in the stack."
127
+ })) : Effect.succeed(null)));
128
+ if (strategy === null) continue;
129
+ const key = isSui ? `faucet:request:${parts.chainId}` : coinKey;
130
+ const wrapCrossCuttingFailure = (cause) => {
131
+ const tag = typeof cause === "object" && cause !== null && "_tag" in cause ? String(cause._tag) : "unknown";
132
+ return accountAcquireError({
133
+ phase: "fund-cross-cutting",
134
+ accountName: parts.accountName,
135
+ variant: parts.variant,
136
+ message: `Account '${parts.accountName}': cross-cutting funding failed for coin (key='${key}') amount=${entry.amount} (tag=${tag}).`,
137
+ cause,
138
+ hint: "Cross-cutting funding requires the matching strategy to be registered at the time of acquire — check the plugin that contributes this coin and any `via` dependency."
139
+ });
140
+ };
141
+ const request = strategy.request({
142
+ address: parts.address,
143
+ amount: entry.amount,
144
+ account: parts.account
145
+ }).pipe(Effect.mapError(wrapCrossCuttingFailure));
146
+ yield* setCurrentPluginPhase(`funding ${entry.coin}`);
147
+ yield* strategy.usesAccountSigner === true ? request : withAddressLease(parts.broker, parts.accountName, parts.address, request);
148
+ yield* setCurrentPluginPhase(`waiting for ${entry.coin} funding settlement`);
149
+ yield* waitForBalanceAtLeast({
150
+ balanceReader: parts.balanceReader,
151
+ accountName: parts.accountName,
152
+ variant: parts.variant,
153
+ phase: "fund-cross-cutting",
154
+ owner: parts.address,
155
+ coinType: entry.fullCoinType,
156
+ coinLabel: entry.coin,
157
+ amount: entry.amount
158
+ });
159
+ applied.push(entry);
160
+ }
161
+ yield* Effect.annotateCurrentSpan({
162
+ "account.name": parts.accountName,
163
+ "account.address": parts.address,
164
+ "fund.cross-cutting.count": parts.funding.length,
165
+ "sui.chain": parts.chainId
166
+ });
167
+ return applied;
168
+ }).pipe(Effect.withSpan("devstack.plugin.account.applyCrossCuttingFunding", { attributes: {
169
+ "account.name": parts.accountName,
170
+ "account.address": parts.address,
171
+ "fund.cross-cutting.entries": parts.funding.length
172
+ } }));
173
+ const readExistingBalance = (balanceReader, args) => balanceReader === void 0 ? Effect.succeed(null) : balanceReader.readBalance(args);
174
+ const waitForBalanceAtLeast = (parts) => {
175
+ if (parts.balanceReader === void 0) return Effect.void;
176
+ return Effect.gen(function* () {
177
+ const startedAt = Date.now();
178
+ let lastBalance = null;
179
+ for (;;) {
180
+ lastBalance = yield* readExistingBalance(parts.balanceReader, {
181
+ owner: parts.owner,
182
+ coinType: parts.coinType
183
+ });
184
+ if (lastBalance !== null && lastBalance >= parts.amount) return;
185
+ if (Date.now() - startedAt >= FUNDING_SETTLEMENT_TIMEOUT_MS) return yield* Effect.fail(accountAcquireError({
186
+ phase: parts.phase,
187
+ accountName: parts.accountName,
188
+ variant: parts.variant,
189
+ message: `Account '${parts.accountName}': funding for ${parts.coinLabel} was accepted but balance did not reach ${parts.amount} before the settlement timeout (last=${lastBalance === null ? "<unavailable>" : lastBalance}).`,
190
+ hint: "The faucet or funding strategy returned before the funded coin became spendable. Check the funding strategy finality gate and Sui RPC health."
191
+ }));
192
+ yield* Effect.sleep(Duration.millis(FUNDING_SETTLEMENT_INTERVAL_MS));
193
+ }
194
+ });
195
+ };
196
+ //#endregion
197
+ export { DEFAULT_EPHEMERAL_FUND_MIST, SUI_FULL_COIN_TYPE, applyCrossCuttingFunding, fundEphemeralDefault };
198
+
199
+ //# sourceMappingURL=funding.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"funding.mjs","names":[],"sources":["../../../src/plugins/account/funding.ts"],"sourcesContent":["// Account plugin — funding logic.\n//\n// Two funding paths converge here:\n//\n// 1. **Default funding** — applies to the `ephemeral` variant only.\n// On non-fork networks: faucet POST via the SUI HTTP strategy\n// auto-registered by Faucet (see 11-faucet.md). On fork networks:\n// \"pay from a seed via impersonation\" because forks have no\n// faucet. The auto-promotion is LOUD by default per the\n// architecture's \"no silent surprises\" principle — we emit a\n// `log.appended` event the first time a stack hits this path.\n//\n// 2. **Cross-cutting funding** — declared per-account via\n// `AccountOptions.funding`. Applies to every variant.\n// Dispatched through the ambient strategy registry. Missing\n// strategy for non-SUI coins ⇒ silent noop (architecture-\n// mandated test-ergonomics contract, distilled-doc invariant:\n// \"Optional Faucet is a noop, not an error\"). Explicit SUI\n// entries use the SUI faucet strategy and fail loudly when no\n// faucet-bearing strategy exists.\n//\n// Distilled-doc invariant: per-address serialization — concurrent\n// funding requests for the same address MUST serialize. We share the\n// substrate `LeaseBroker` handle from `service.ts` and open a fresh\n// scope per wire call so the lease releases the moment that call\n// returns. Each cross-cutting iteration is its own scope: the broker\n// is non-reentrant by design, so a hypothetical loop holding a single\n// lease across iterations would deadlock the second one.\n\nimport { Duration, Effect } from 'effect';\n\nimport type { FaucetStrategy } from '../faucet/strategies/sui-local.ts';\nimport {\n\tfaucetCapabilityFor,\n\tStrategyRegistryService,\n} from '../../substrate/runtime/strategy-registry/index.ts';\nimport type { AnyResourceRef, ResourceRef } from '../../api/define-plugin.ts';\nimport type { LeaseBroker } from '../../substrate/runtime/lease-broker/index.ts';\nimport type { ChainId } from '../../substrate/brand.ts';\nimport type { CoinResourceId } from '../coin/index.ts';\nimport { setCurrentPluginPhase } from '../../substrate/runtime/current-plugin.ts';\n\nimport {\n\taccountAcquireError,\n\ttype AccountAcquireError,\n\ttype AccountVariantKind,\n} from './errors.ts';\nimport { withAddressLease } from './lease.ts';\nimport type { AccountValue } from './service.ts';\n\n/** Direct resource ref shape for a coin upstream. The user passes the\n * result of `coin.fromPackage(...)` / `coin.known(...)` /\n * `coin.builtin(...)` — NOT a bare string or discriminator. Generic\n * over the literal symbol so the account's dependency tuple preserves\n * each per-coin resource id (`coin:managed_coin/managed_coin`,\n * `coin:wal`, ...).\n *\n * Architecture (Direct Member Refs): cross-plugin references at the\n * user-facing surface are plugin/resource refs directly — no opaque\n * tag or string discriminator vocabulary. */\nexport interface AccountFundingCoinValue {\n\treadonly fullCoinType: string;\n\treadonly symbol?: string;\n}\n\nexport type CoinMember<Sym extends string = string> = ResourceRef<\n\tCoinResourceId<Sym>,\n\tAccountFundingCoinValue\n>;\n\n/** Optional dependency edge for the plugin that contributes the\n * funding strategy. Coin refs force the coin metadata edge; `via`\n * forces the strategy-provider edge (e.g. a known DeepBook\n * deployment that contributes `coinType:<DEEP>`). */\nexport type CrossCuttingFundingProvider = AnyResourceRef | readonly AnyResourceRef[];\n\n/** Built-in SUI funding entry. This uses the same account funding\n * list as arbitrary coins but avoids requiring `coin.builtin('sui')`\n * for the normal SUI faucet path. */\nexport interface SuiFundingEntry {\n\treadonly coin: 'sui';\n\treadonly amount: number | bigint;\n}\n\n/** A single cross-cutting funding entry. `coin` is a direct member ref\n * (the value returned by `coin.fromPackage(...)` etc.) — the account plugin\n * threads it through `dependsOn` so the substrate's dep graph forces\n * the publishing / discovery edge to land before funding.\n *\n * Distilled-doc invariant (\"Strict upstream declaration\"): coin\n * references cited by Account must force a dep edge. `via` is the\n * same contract for the strategy contributor that can satisfy the\n * funding request. */\nexport interface CrossCuttingFundingEntry<M extends CoinMember = CoinMember> {\n\treadonly coin: M;\n\treadonly amount: bigint;\n\treadonly via?: CrossCuttingFundingProvider;\n}\n\nexport type AccountFundingEntry<M extends CoinMember = CoinMember> =\n\t| SuiFundingEntry\n\t| CrossCuttingFundingEntry<M>;\n\nexport type AccountFunding = ReadonlyArray<AccountFundingEntry>;\n\n/** Internal projected shape — the acquire body in `account/index.ts`\n * receives each funding entry's resolved `CoinValue`, reads\n * `fullCoinType`, and passes the projected entries to\n * `applyCrossCuttingFunding`. The funding pass never sees the raw\n * member refs — keeps the strategy dispatch logic\n * substrate-name-blind. */\nexport interface ProjectedFundingEntry {\n\treadonly coin: string;\n\treadonly fullCoinType: string;\n\treadonly amount: bigint;\n}\n\nexport type ProjectedFunding = ReadonlyArray<ProjectedFundingEntry>;\n\nexport interface AccountFundingResult {\n\treadonly requested: ProjectedFunding;\n\treadonly applied: ProjectedFunding;\n}\n\n/** Request passed to account funding strategies. `amount` uses the\n * funded coin's smallest unit. The resolved account handle is present\n * so strategies without an admin signer can perform account-owned\n * swaps while still sharing the central funding dispatcher. */\nexport interface AccountFundingRequest {\n\treadonly address: string;\n\treadonly amount: bigint;\n\treadonly account: AccountValue;\n}\n\nexport interface AccountFundingStrategy<E = unknown> {\n\treadonly request: (req: AccountFundingRequest) => Effect.Effect<void, E>;\n\t/** True when the strategy calls `account.withTransactionSigner`.\n\t * The dispatcher must not acquire the same non-reentrant\n\t * per-address lease outside the strategy. */\n\treadonly usesAccountSigner?: boolean;\n}\n\nexport interface FundingBalanceReader {\n\treadonly readBalance: (args: {\n\t\treadonly owner: string;\n\t\treadonly coinType: string;\n\t}) => Effect.Effect<bigint | null>;\n}\n\n/** The canonical builtin SUI coin type. Used by the funding dispatch\n * to route SUI entries to the faucet strategy (same key as the\n * default-funding pass), and by everything that needs to detect\n * \"this is the protocol-defined SUI\". Mirrors `BUILTIN_COINS.sui`\n * in the coin plugin. */\nexport const SUI_FULL_COIN_TYPE = '0x2::sui::SUI' as const;\n\n/** Default funding amount for ephemeral accounts — 1 SUI in MIST.\n * Documented at the user-facing factory so a bare `account('alice')`\n * is predictable. */\nexport const DEFAULT_EPHEMERAL_FUND_MIST = 1_000_000_000n;\n\nconst FUNDING_SETTLEMENT_INTERVAL_MS = 250;\nconst FUNDING_SETTLEMENT_TIMEOUT_MS = 30_000;\n\n/** Inputs the default-funding pass needs from the per-acquire ctx. */\nexport interface FundEphemeralDefaultArgs {\n\treadonly accountName: string;\n\treadonly address: string;\n\treadonly amountMist: bigint;\n\treadonly suiMode: 'local' | 'local-rpc' | 'live' | 'fork';\n\t/** Resolved sui chain id — the substrate-level chain identity used\n\t * to compose the faucet strategy's capability key\n\t * (`faucet:request:<chainId>`). */\n\treadonly chainId: ChainId;\n\t/** Loud-by-default auto-promotion event (called on fork before the\n\t * strategy is invoked, per the architecture's \"no silent surprises\"\n\t * principle). */\n\treadonly emitAutoPromotionEvent: () => Effect.Effect<void>;\n\t/** Substrate lease-broker handle — funding opens a fresh scope per\n\t * wire call and acquires the per-address lease so concurrent wire\n\t * calls for the same address serialize at the chain boundary. */\n\treadonly broker: LeaseBroker;\n\treadonly balanceReader?: FundingBalanceReader;\n}\n\n/** Apply the default-funding pass for an ephemeral account.\n *\n * Wiring: yields `StrategyRegistryService` (the R-channel from\n * Round 7), looks up the faucet strategy registered by the Sui\n * plugin under `faucet:request:<chainId>`, and dispatches a request\n * through it. Per-address serialization is enforced by acquiring\n * the address lock around the wire call. */\nexport const fundEphemeralDefault = (\n\tparts: FundEphemeralDefaultArgs,\n): Effect.Effect<void, AccountAcquireError, StrategyRegistryService> =>\n\tEffect.gen(function* () {\n\t\t// LOUD AUTO-PROMOTION — distilled-doc invariant: \"no silent\n\t\t// surprises\". Emit BEFORE attempting the dispatch so the user\n\t\t// sees the path change even if the wire call subsequently\n\t\t// fails. On fork we surface the path-change event; on non-fork\n\t\t// the strategy registered by Sui IS the canonical default and\n\t\t// no auto-promotion is needed.\n\t\tif (parts.suiMode === 'fork') {\n\t\t\tyield* parts.emitAutoPromotionEvent();\n\t\t}\n\n\t\t// Zero-amount short-circuit — both real strategies treat zero\n\t\t// as a no-op; doing the same here avoids a registry lookup +\n\t\t// span emission for the legitimately-no-funding case.\n\t\tif (parts.amountMist <= 0n) {\n\t\t\treturn;\n\t\t}\n\n\t\tyield* setCurrentPluginPhase('checking SUI funding');\n\t\tconst existingBalance = yield* readExistingBalance(parts.balanceReader, {\n\t\t\towner: parts.address,\n\t\t\tcoinType: SUI_FULL_COIN_TYPE,\n\t\t});\n\t\tif (existingBalance !== null && existingBalance >= parts.amountMist) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Look up the strategy. Sui auto-registers a faucet strategy\n\t\t// on non-fork modes; fork-mode strategies have to be supplied\n\t\t// by the faucet plugin (with the fork admin closed over). If\n\t\t// nothing is registered we surface a typed, actionable error\n\t\t// pointing at the architecture's contract: ephemeral-on-non-\n\t\t// fork without a Faucet MUST fail at acquire time.\n\t\tconst strategy = yield* faucetCapabilityFor<FaucetStrategy>(parts.chainId).pipe(\n\t\t\tEffect.catchTag('StrategyNotFoundError', (err) =>\n\t\t\t\tEffect.fail(\n\t\t\t\t\taccountAcquireError({\n\t\t\t\t\t\tphase: 'fund-default',\n\t\t\t\t\t\taccountName: parts.accountName,\n\t\t\t\t\t\tvariant: 'ephemeral',\n\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t`Account '${parts.accountName}': no faucet strategy registered for ` +\n\t\t\t\t\t\t\t`chain '${parts.chainId}' (sui mode=${parts.suiMode}). ` +\n\t\t\t\t\t\t\t`Registered keys: [${err.registeredKeys.join(', ')}].`,\n\t\t\t\t\t\thint:\n\t\t\t\t\t\t\tparts.suiMode === 'fork'\n\t\t\t\t\t\t\t\t? 'Fork networks have no HTTP faucet — compose a plugin that contributes defineFaucetStrategy(...) for this chain id.'\n\t\t\t\t\t\t\t\t: 'Ensure a sui() plugin with a faucet-bearing mode (local/live-testnet/live-devnet) is in the stack.',\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t// Per-address serialization around the wire call. The lease is\n\t\t// scope-bound and releases as soon as `request(...)` returns;\n\t\t// two concurrent funding requests for the same address — e.g.\n\t\t// ephemeral default + cross-cutting SUI top-up — interleave\n\t\t// deterministically via the broker's FIFO queue.\n\t\tconst wrapFaucetFailure = (cause: {\n\t\t\treadonly _tag: 'FaucetUnreachable' | 'FaucetExhausted' | 'FaucetBodyError';\n\t\t}) =>\n\t\t\tEffect.fail(\n\t\t\t\taccountAcquireError({\n\t\t\t\t\tphase: 'fund-default',\n\t\t\t\t\taccountName: parts.accountName,\n\t\t\t\t\tvariant: 'ephemeral',\n\t\t\t\t\tmessage:\n\t\t\t\t\t\t`Account '${parts.accountName}': faucet strategy request failed ` +\n\t\t\t\t\t\t`for chain '${parts.chainId}' (tag=${cause._tag}).`,\n\t\t\t\t\tcause,\n\t\t\t\t\thint:\n\t\t\t\t\t\t'See the cause chain — typical roots are the faucet container ' +\n\t\t\t\t\t\t'not yet ready (FaucetUnreachable), the wall-clock budget elapsed ' +\n\t\t\t\t\t\t'(FaucetExhausted), or the body returned Failure (FaucetBodyError).',\n\t\t\t\t}),\n\t\t\t);\n\t\tyield* setCurrentPluginPhase('funding SUI');\n\t\tyield* withAddressLease(\n\t\t\tparts.broker,\n\t\t\tparts.accountName,\n\t\t\tparts.address,\n\t\t\tstrategy.request({ address: parts.address, amount: parts.amountMist }).pipe(\n\t\t\t\tEffect.catchTags({\n\t\t\t\t\tFaucetUnreachable: wrapFaucetFailure,\n\t\t\t\t\tFaucetExhausted: wrapFaucetFailure,\n\t\t\t\t\tFaucetBodyError: wrapFaucetFailure,\n\t\t\t\t}),\n\t\t\t),\n\t\t);\n\t\tyield* setCurrentPluginPhase('waiting for SUI funding settlement');\n\t\tyield* waitForBalanceAtLeast({\n\t\t\tbalanceReader: parts.balanceReader,\n\t\t\taccountName: parts.accountName,\n\t\t\tvariant: 'ephemeral',\n\t\t\tphase: 'fund-default',\n\t\t\towner: parts.address,\n\t\t\tcoinType: SUI_FULL_COIN_TYPE,\n\t\t\tcoinLabel: 'SUI',\n\t\t\tamount: parts.amountMist,\n\t\t});\n\n\t\tyield* Effect.annotateCurrentSpan({\n\t\t\t'account.name': parts.accountName,\n\t\t\t'account.address': parts.address,\n\t\t\t'fund.amount.mist': parts.amountMist.toString(),\n\t\t\t'sui.chain': parts.chainId,\n\t\t\t'sui.mode': parts.suiMode,\n\t\t});\n\t}).pipe(\n\t\tEffect.withSpan('devstack.plugin.account.fundEphemeralDefault', {\n\t\t\tattributes: {\n\t\t\t\t'account.name': parts.accountName,\n\t\t\t\t'account.address': parts.address,\n\t\t\t\t'sui.mode': parts.suiMode,\n\t\t\t},\n\t\t}),\n\t);\n\n/** Inputs the cross-cutting funding pass needs from the per-acquire ctx.\n *\n * `funding` is the PROJECTED shape — the acquire body in\n * `account/index.ts` receives each user-supplied `CoinMember` as a\n * resolved dependency and projects to `{fullCoinType, amount}` BEFORE\n * invoking this pass. Keeps the dispatch logic substrate-name-blind. */\nexport interface ApplyCrossCuttingFundingArgs {\n\treadonly accountName: string;\n\treadonly address: string;\n\treadonly variant: AccountVariantKind;\n\treadonly account: AccountValue;\n\treadonly funding: ProjectedFunding;\n\treadonly chainId: ChainId;\n\treadonly broker: LeaseBroker;\n\treadonly balanceReader?: FundingBalanceReader;\n}\n\n/** Apply the cross-cutting funding pass. Variant-agnostic — runs for\n * every variant once the keypair / impersonation slot is bound and\n * the address is known.\n *\n * Distilled-doc invariant: \"Optional Faucet is a noop, not an\n * error\". Absence of a registered strategy for a non-SUI coin's\n * capability key short-circuits silently (the entry is dropped).\n * Explicit SUI entries are stricter: they route through the active\n * chain's faucet strategy and fail loudly when none is registered.\n * This lets a test author opt INTO arbitrary-coin funding without\n * forcing every surrounding network to satisfy every custom coin.\n *\n * Wiring: SUI entries (`fullCoinType === '0x2::sui::SUI'`) dispatch\n * through `faucet:request:<chainId>` (same key as the default pass);\n * other entries dispatch through `coinType:<fullCoinType>` keys\n * contributed by the respective Coin/Walrus/Seal plugins.\n *\n * Entries are processed serially. Strategies that use the resolved\n * account signer acquire the per-address lease internally; strategies\n * that do not are wrapped by this dispatcher. */\nexport const applyCrossCuttingFunding = (\n\tparts: ApplyCrossCuttingFundingArgs,\n): Effect.Effect<ProjectedFunding, AccountAcquireError, StrategyRegistryService> =>\n\tEffect.gen(function* () {\n\t\tif (parts.funding.length === 0) {\n\t\t\treturn [];\n\t\t}\n\t\tconst registry = yield* StrategyRegistryService;\n\t\tconst applied: ProjectedFundingEntry[] = [];\n\n\t\tfor (const entry of parts.funding) {\n\t\t\tif (entry.amount <= 0n) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tyield* setCurrentPluginPhase(`checking ${entry.coin} funding`);\n\t\t\tconst existingBalance = yield* readExistingBalance(parts.balanceReader, {\n\t\t\t\towner: parts.address,\n\t\t\t\tcoinType: entry.fullCoinType,\n\t\t\t});\n\t\t\tif (existingBalance !== null && existingBalance >= entry.amount) {\n\t\t\t\tapplied.push(entry);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Resolve the capability key from the projected coin type.\n\t\t\t//\n\t\t\t// SUI (`0x2::sui::SUI`) → reuse the faucet-request key so the\n\t\t\t// SUI auto-registered strategy fields the request (this\n\t\t\t// matches the default-funding pass and keeps the registry\n\t\t\t// surface uniform).\n\t\t\t//\n\t\t\t// Everything else → `coinType:<fullCoinType>` so user-defined\n\t\t\t// Coin plugins (and Walrus's exchange strategy keyed by\n\t\t\t// `coinType:<WAL fullCoinType>`) can contribute strategies\n\t\t\t// declaratively.\n\t\t\tconst isSui = entry.fullCoinType === SUI_FULL_COIN_TYPE;\n\t\t\tconst coinKey = `coinType:${entry.fullCoinType}` as const;\n\t\t\tconst lookup = isSui\n\t\t\t\t? faucetCapabilityFor<AccountFundingStrategy>(parts.chainId)\n\t\t\t\t: registry.get<typeof coinKey, AccountFundingStrategy>(coinKey);\n\n\t\t\t// Architecture-distilled: optional-faucet-is-noop for\n\t\t\t// arbitrary coins. Explicit SUI entries are the normal gas\n\t\t\t// faucet path, so missing strategy is actionable and loud.\n\t\t\tconst strategy = yield* lookup.pipe(\n\t\t\t\tEffect.catchTag('StrategyNotFoundError', (err) =>\n\t\t\t\t\tisSui\n\t\t\t\t\t\t? Effect.fail(\n\t\t\t\t\t\t\t\taccountAcquireError({\n\t\t\t\t\t\t\t\t\tphase: 'fund-cross-cutting',\n\t\t\t\t\t\t\t\t\taccountName: parts.accountName,\n\t\t\t\t\t\t\t\t\tvariant: parts.variant,\n\t\t\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t\t\t`Account '${parts.accountName}': no SUI funding strategy registered ` +\n\t\t\t\t\t\t\t\t\t\t`for chain '${parts.chainId}'. Registered keys: [${err.registeredKeys.join(', ')}].`,\n\t\t\t\t\t\t\t\t\tcause: err,\n\t\t\t\t\t\t\t\t\thint: 'Ensure a sui() plugin with a faucet-bearing mode (local/live-testnet/live-devnet) is in the stack.',\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t: Effect.succeed(null as AccountFundingStrategy | null),\n\t\t\t\t),\n\t\t\t);\n\t\t\tif (strategy === null) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst key = isSui ? (`faucet:request:${parts.chainId}` as const) : coinKey;\n\t\t\tconst wrapCrossCuttingFailure = (cause: unknown): AccountAcquireError => {\n\t\t\t\tconst tag =\n\t\t\t\t\ttypeof cause === 'object' && cause !== null && '_tag' in cause\n\t\t\t\t\t\t? String((cause as { readonly _tag?: unknown })._tag)\n\t\t\t\t\t\t: 'unknown';\n\t\t\t\treturn accountAcquireError({\n\t\t\t\t\tphase: 'fund-cross-cutting',\n\t\t\t\t\taccountName: parts.accountName,\n\t\t\t\t\tvariant: parts.variant,\n\t\t\t\t\tmessage:\n\t\t\t\t\t\t`Account '${parts.accountName}': cross-cutting funding ` +\n\t\t\t\t\t\t`failed for coin (key='${key}') amount=${entry.amount} ` +\n\t\t\t\t\t\t`(tag=${tag}).`,\n\t\t\t\t\tcause,\n\t\t\t\t\thint:\n\t\t\t\t\t\t'Cross-cutting funding requires the matching strategy ' +\n\t\t\t\t\t\t'to be registered at the time of acquire — check the ' +\n\t\t\t\t\t\t'plugin that contributes this coin and any `via` dependency.',\n\t\t\t\t});\n\t\t\t};\n\t\t\tconst request = strategy\n\t\t\t\t.request({ address: parts.address, amount: entry.amount, account: parts.account })\n\t\t\t\t.pipe(Effect.mapError(wrapCrossCuttingFailure));\n\t\t\tyield* setCurrentPluginPhase(`funding ${entry.coin}`);\n\t\t\tyield* strategy.usesAccountSigner === true\n\t\t\t\t? request\n\t\t\t\t: withAddressLease(parts.broker, parts.accountName, parts.address, request);\n\t\t\tyield* setCurrentPluginPhase(`waiting for ${entry.coin} funding settlement`);\n\t\t\tyield* waitForBalanceAtLeast({\n\t\t\t\tbalanceReader: parts.balanceReader,\n\t\t\t\taccountName: parts.accountName,\n\t\t\t\tvariant: parts.variant,\n\t\t\t\tphase: 'fund-cross-cutting',\n\t\t\t\towner: parts.address,\n\t\t\t\tcoinType: entry.fullCoinType,\n\t\t\t\tcoinLabel: entry.coin,\n\t\t\t\tamount: entry.amount,\n\t\t\t});\n\t\t\tapplied.push(entry);\n\t\t}\n\n\t\tyield* Effect.annotateCurrentSpan({\n\t\t\t'account.name': parts.accountName,\n\t\t\t'account.address': parts.address,\n\t\t\t'fund.cross-cutting.count': parts.funding.length,\n\t\t\t'sui.chain': parts.chainId,\n\t\t});\n\t\treturn applied;\n\t}).pipe(\n\t\tEffect.withSpan('devstack.plugin.account.applyCrossCuttingFunding', {\n\t\t\tattributes: {\n\t\t\t\t'account.name': parts.accountName,\n\t\t\t\t'account.address': parts.address,\n\t\t\t\t'fund.cross-cutting.entries': parts.funding.length,\n\t\t\t},\n\t\t}),\n\t);\n\nconst readExistingBalance = (\n\tbalanceReader: FundingBalanceReader | undefined,\n\targs: {\n\t\treadonly owner: string;\n\t\treadonly coinType: string;\n\t},\n): Effect.Effect<bigint | null> =>\n\tbalanceReader === undefined ? Effect.succeed(null) : balanceReader.readBalance(args);\n\nconst waitForBalanceAtLeast = (parts: {\n\treadonly balanceReader: FundingBalanceReader | undefined;\n\treadonly accountName: string;\n\treadonly variant: AccountVariantKind;\n\treadonly phase: 'fund-default' | 'fund-cross-cutting';\n\treadonly owner: string;\n\treadonly coinType: string;\n\treadonly coinLabel: string;\n\treadonly amount: bigint;\n}): Effect.Effect<void, AccountAcquireError> => {\n\tif (parts.balanceReader === undefined) {\n\t\treturn Effect.void;\n\t}\n\treturn Effect.gen(function* () {\n\t\tconst startedAt = Date.now();\n\t\tlet lastBalance: bigint | null = null;\n\t\tfor (;;) {\n\t\t\tlastBalance = yield* readExistingBalance(parts.balanceReader, {\n\t\t\t\towner: parts.owner,\n\t\t\t\tcoinType: parts.coinType,\n\t\t\t});\n\t\t\tif (lastBalance !== null && lastBalance >= parts.amount) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (Date.now() - startedAt >= FUNDING_SETTLEMENT_TIMEOUT_MS) {\n\t\t\t\treturn yield* Effect.fail(\n\t\t\t\t\taccountAcquireError({\n\t\t\t\t\t\tphase: parts.phase,\n\t\t\t\t\t\taccountName: parts.accountName,\n\t\t\t\t\t\tvariant: parts.variant,\n\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t`Account '${parts.accountName}': funding for ${parts.coinLabel} was accepted ` +\n\t\t\t\t\t\t\t`but balance did not reach ${parts.amount} before the settlement timeout ` +\n\t\t\t\t\t\t\t`(last=${lastBalance === null ? '<unavailable>' : lastBalance}).`,\n\t\t\t\t\t\thint:\n\t\t\t\t\t\t\t'The faucet or funding strategy returned before the funded coin became spendable. ' +\n\t\t\t\t\t\t\t'Check the funding strategy finality gate and Sui RPC health.',\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t}\n\t\t\tyield* Effect.sleep(Duration.millis(FUNDING_SETTLEMENT_INTERVAL_MS));\n\t\t}\n\t});\n};\n"],"mappings":"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"}
@@ -0,0 +1,54 @@
1
+ import { CodegenableDecl } from "../../contracts/codegenable.mjs";
2
+ import { ProjectionDecl } from "../../contracts/projection.mjs";
3
+ import { SnapshotableDecl } from "../../contracts/snapshotable.mjs";
4
+ import { StrategyContributorDecl } from "../../contracts/strategy-contributor.mjs";
5
+ import { AnyResourceRef, Plugin, ResourceRef } from "../../substrate/plugin.mjs";
6
+ import { SeedObjectsAccumulator } from "../sui/seed-objects.mjs";
7
+ import { SuiClient } from "../sui/mode/shared.mjs";
8
+ import { SuiOptions } from "../sui/mode/spec.mjs";
9
+ import { AccountAcquireError, AccountAcquirePhase, AccountError, AccountSignError, AccountSignPhase, AccountVariantKind } from "./errors.mjs";
10
+ import { AccountOptions, AccountValue, TxResult } from "./service.mjs";
11
+ import { AccountFunding, AccountFundingCoinValue, AccountFundingEntry, AccountFundingRequest, AccountFundingResult, AccountFundingStrategy, CoinMember, CrossCuttingFundingEntry, CrossCuttingFundingProvider, DEFAULT_EPHEMERAL_FUND_MIST, ProjectedFunding, ProjectedFundingEntry, SUI_FULL_COIN_TYPE, SuiFundingEntry } from "./funding.mjs";
12
+ import { AccountRegistryEntry, AccountRegistryFunding } from "./registry.mjs";
13
+ import { AccountBindings } from "./codegen.mjs";
14
+ import { ResolvedKeypair, SignatureScheme } from "./keypair.mjs";
15
+ import { SyntheticImpersonationSigner } from "./variants/impersonate.mjs";
16
+ //#region src/plugins/account/index.d.ts
17
+ /** Per-account-instance resource. The substrate's resource id MUST be unique
18
+ * across the stack — we encode the account name as a literal-typed
19
+ * template literal so the compiler catches duplicate-name composes
20
+ * at the `defineDevstack` call site.
21
+ *
22
+ * Distilled-doc invariant: resource id flows into the on-disk path, the
23
+ * manifest key, container labels, and generated TypeScript exports —
24
+ * the identifier-safe name validation (in `service.ts`) protects
25
+ * those call sites. */
26
+ type AccountResourceId<Name extends string> = `account/${Name}`;
27
+ /** Construct the account plugin instance.
28
+ *
29
+ * Variants — typed at the API boundary via the discriminated
30
+ * `AccountOptions` union. The factory's second arg is OPTIONAL —
31
+ * omitting it yields the bare-form default (ephemeral + default
32
+ * funding). Passing a non-matching `kind:` is a compile error
33
+ * thanks to the union's discriminator.
34
+ *
35
+ * Distilled-doc invariant: the name is validated at the FACTORY
36
+ * boundary (not just at acquire time) so a typo surfaces
37
+ * immediately, not at runtime. */
38
+ type FundingCoinDependencies<Entries extends readonly unknown[]> = Entries extends readonly [infer Head, ...infer Tail] ? Head extends {
39
+ readonly coin: infer Coin;
40
+ } ? Coin extends CoinMember ? readonly [Coin, ...FundingCoinDependencies<Tail>] : FundingCoinDependencies<Tail> : FundingCoinDependencies<Tail> : readonly [];
41
+ type FundingProviderDependenciesFor<Provider> = Provider extends readonly AnyResourceRef[] ? Provider : Provider extends AnyResourceRef ? readonly [Provider] : readonly [];
42
+ type FundingEntryProviderDependencies<Entry> = Entry extends {
43
+ readonly coin: CoinMember;
44
+ } ? 'via' extends keyof Entry ? Entry extends {
45
+ readonly via: infer Provider;
46
+ } ? FundingProviderDependenciesFor<Provider> : readonly [] : readonly [] : readonly [];
47
+ type FundingProviderDependencies<Entries extends readonly unknown[]> = Entries extends readonly [infer Head, ...infer Tail] ? readonly [...FundingEntryProviderDependencies<Head>, ...FundingProviderDependencies<Tail>] : readonly [];
48
+ declare const account: <const N extends string, const Funding extends AccountFunding = readonly []>(name: N, opts?: AccountOptions<Funding>) => Plugin<`account/${N}`, AccountValue, readonly [ResourceRef<"sui", SuiClient & {
49
+ readonly mode: SuiOptions["mode"];
50
+ readonly seedObjects: SeedObjectsAccumulator;
51
+ }>, ...FundingCoinDependencies<Funding>, ...FundingProviderDependencies<Funding>], readonly [SnapshotableDecl, CodegenableDecl<`account/${N}`>, StrategyContributorDecl<`account:${N}`, AccountRegistryEntry>, ProjectionDecl]>;
52
+ //#endregion
53
+ export { AccountResourceId, account };
54
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1,151 @@
1
+ import { definePlugin, resource } from "../../substrate/plugin.mjs";
2
+ import { pluginErrorContributions } from "../../api/plugin-errors.mjs";
3
+ import { IdentityContext, StackPathsService } from "../../substrate/runtime/paths.mjs";
4
+ import { SpanAttr } from "../../substrate/runtime/observability/spans.mjs";
5
+ import { suiResource } from "../sui/index.mjs";
6
+ import { makeAccountCodegen } from "./codegen.mjs";
7
+ import { ACCOUNT_ERROR_TAGS } from "./errors.mjs";
8
+ import { SUI_FULL_COIN_TYPE } from "./funding.mjs";
9
+ import { makeAccountProjectionContribution, makeAccountRegistryContribution } from "./registry.mjs";
10
+ import { makeAccountSnapshotable } from "./snapshot.mjs";
11
+ import { acquireAccount, assertAccountName } from "./service.mjs";
12
+ import { Effect } from "effect";
13
+ //#region src/plugins/account/index.ts
14
+ const accountErrorContributions = pluginErrorContributions(ACCOUNT_ERROR_TAGS);
15
+ const accountResource = (name) => resource(`account/${name}`);
16
+ const isCoinFundingEntry = (entry) => typeof entry === "object" && entry.coin !== "sui";
17
+ const fundingProviders = (provider) => {
18
+ if (provider === void 0) return [];
19
+ return Array.isArray(provider) ? provider : [provider];
20
+ };
21
+ const fundingAmountToBigInt = (amount) => {
22
+ if (typeof amount === "bigint") {
23
+ if (amount < 0n) throw new TypeError(`SUI funding amount must be a non-negative integer in MIST.`);
24
+ return amount;
25
+ }
26
+ if (!Number.isSafeInteger(amount) || amount < 0) throw new TypeError(`SUI funding amount must be a non-negative safe integer in MIST.`);
27
+ return BigInt(amount);
28
+ };
29
+ const coinLabelFor = (coin) => coin.symbol ?? coin.fullCoinType.split("::").at(-1) ?? coin.fullCoinType;
30
+ const account = (name, opts) => {
31
+ assertAccountName(name);
32
+ const opts2 = opts === void 0 ? {
33
+ kind: "ephemeral",
34
+ name
35
+ } : {
36
+ ...opts,
37
+ name
38
+ };
39
+ const accountRef = accountResource(name);
40
+ const fundingEntryList = opts?.funding ?? [];
41
+ const coinFundingEntries = fundingEntryList.filter(isCoinFundingEntry);
42
+ const fundingMembers = coinFundingEntries.map((e) => e.coin);
43
+ const strategyProviderMembers = coinFundingEntries.flatMap((entry) => fundingProviders(entry.via));
44
+ const dependencies = [
45
+ suiResource,
46
+ ...fundingMembers,
47
+ ...strategyProviderMembers
48
+ ];
49
+ return definePlugin({
50
+ id: accountRef.id,
51
+ dependsOn: dependencies,
52
+ role: "task",
53
+ start: (deps) => Effect.gen(function* () {
54
+ const [sui, ...resolvedDeps] = deps;
55
+ const resolvedCoinValues = resolvedDeps.slice(0, coinFundingEntries.length);
56
+ const identity = yield* IdentityContext;
57
+ const paths = yield* StackPathsService;
58
+ let coinIndex = 0;
59
+ const projectedFunding = fundingEntryList.map((entry) => {
60
+ if (entry.coin === "sui") return {
61
+ coin: "SUI",
62
+ fullCoinType: SUI_FULL_COIN_TYPE,
63
+ amount: fundingAmountToBigInt(entry.amount)
64
+ };
65
+ const resolvedCoin = resolvedCoinValues[coinIndex];
66
+ coinIndex += 1;
67
+ return {
68
+ coin: coinLabelFor(resolvedCoin),
69
+ fullCoinType: resolvedCoin.fullCoinType,
70
+ amount: entry.amount
71
+ };
72
+ });
73
+ return yield* acquireAccount(opts2, {
74
+ sui: {
75
+ mode: sui.mode,
76
+ chain: sui.chain,
77
+ sdk: sui.sdk,
78
+ fork: sui.fork
79
+ },
80
+ runtimeRoot: paths.stackRoot,
81
+ app: identity.app,
82
+ stack: identity.stack,
83
+ emitAutoPromotionEvent: () => Effect.logWarning("account funding auto-promoted for fork mode").pipe(Effect.annotateLogs({
84
+ [SpanAttr.accountName]: name,
85
+ [SpanAttr.accountFundingFrom]: "faucet",
86
+ [SpanAttr.accountFundingTo]: "pay-from-seed-via-impersonate",
87
+ [SpanAttr.suiMode]: "fork"
88
+ })),
89
+ projectedFunding
90
+ });
91
+ }),
92
+ errorContributions: accountErrorContributions,
93
+ capabilities: ({ value: resolved, runtime: acquireCtx2 }) => {
94
+ const realEntry = {
95
+ name,
96
+ address: resolved.address,
97
+ scheme: resolved.scheme,
98
+ source: resolved.source,
99
+ funding: fundingProjectionForResult(resolved.funding)
100
+ };
101
+ const bindings = {
102
+ name,
103
+ address: resolved.address,
104
+ scheme: resolved.scheme,
105
+ source: resolved.source
106
+ };
107
+ return [
108
+ makeAccountSnapshotable({
109
+ accountName: name,
110
+ variant: opts2.kind,
111
+ app: acquireCtx2.identity.app,
112
+ stack: acquireCtx2.identity.stack
113
+ }),
114
+ makeAccountCodegen({
115
+ name,
116
+ resolved: bindings
117
+ }),
118
+ makeAccountRegistryContribution(realEntry),
119
+ makeAccountProjectionContribution(realEntry)
120
+ ];
121
+ }
122
+ });
123
+ };
124
+ const fundingProjectionForResult = (funding) => {
125
+ if (funding.requested.length === 0) return {
126
+ status: "skipped",
127
+ balanceMist: null,
128
+ requestedMist: null,
129
+ entries: []
130
+ };
131
+ const appliedKeys = new Set(funding.applied.map(fundingEntryKey));
132
+ const entries = funding.requested.map((entry) => ({
133
+ coin: entry.coin,
134
+ fullCoinType: entry.fullCoinType,
135
+ amount: entry.amount.toString(),
136
+ status: appliedKeys.has(fundingEntryKey(entry)) ? "funded" : "skipped"
137
+ }));
138
+ const requestedMist = funding.requested.find((entry) => entry.fullCoinType === "0x2::sui::SUI")?.amount.toString() ?? null;
139
+ const fundedCount = entries.filter((entry) => entry.status === "funded").length;
140
+ return {
141
+ status: fundedCount === entries.length ? "funded" : fundedCount === 0 ? "skipped" : "unknown",
142
+ balanceMist: null,
143
+ requestedMist,
144
+ entries
145
+ };
146
+ };
147
+ const fundingEntryKey = (entry) => `${entry.fullCoinType}:${entry.amount}`;
148
+ //#endregion
149
+ export { account };
150
+
151
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../src/plugins/account/index.ts"],"sourcesContent":["// Account plugin — barrel + `account(name, opts?)` factory.\n//\n// Architecture (12-account.md): Account is the named-identity layer\n// for devstack. It acquires a keypair (or impersonation slot), funds\n// it (default + cross-cutting), registers `{name, address}`, and\n// publishes a per-account resolved value via a unique resource id.\n//\n// User-facing factory shape:\n//\n// account('alice') // default ephemeral\n// account('alice', { kind: 'ephemeral', funding: [{ coin: 'sui', amount: 5_000_000_000n }] })\n// account('alice', { kind: 'keystore', path: '~/.sui/keystore', aliasOrAddress: 'alice' })\n// account('alice', { kind: 'env', key: 'ALICE_PRIVATE_KEY' })\n// account('alice', { kind: 'inline', privateKey: 'suiprivkey1...' })\n// account('alice', { kind: 'signer', signer: hardwareWallet })\n// account('alice', { kind: 'impersonate', address: '0xabc...' })\n//\n// **Bare-form default**: `account('alice')` is shorthand for\n//\n// { kind: 'ephemeral' } plus default SUI funding.\n//\n// Distilled-doc invariant (12-account.md \"Make the bare-form auto-\n// promotion to fork-impersonate funding discoverable\"): on fork-\n// runtime Sui, the default-funding pass internally promotes from\n// \"faucet POST\" to \"pay-from-seed-via-impersonate\" because no\n// faucet exists on a fork. The promotion is LOUD by default — we\n// emit a `log.appended` event the first time the promotion fires\n// (see `funding.ts`).\n//\n// The plugin emits THREE capability decls + an error-tag contribution:\n//\n// 1. Snapshotable — secret-material subtree (ephemeral only).\n// 2. Codegenable — `account-map` bindings (name → address).\n// 3. StrategyContributor — per-stack `account:<name>` registry entry.\n//\n// Plus `errorContributions: [{ errorTags: ACCOUNT_ERROR_TAGS }]` —\n// harvested by the supervisor into the FormatterRegistry so the\n// cascade formatter renders account-tagged failures with the right\n// taxonomy header.\n\nimport { Effect } from 'effect';\n\nimport { definePlugin, resource, type AnyResourceRef } from '../../api/define-plugin.ts';\nimport { pluginErrorContributions } from '../../api/plugin-errors.ts';\nimport { SpanAttr } from '../../substrate/runtime/observability/spans.ts';\nimport { IdentityContext, StackPathsService } from '../../substrate/runtime/paths.ts';\nimport { suiResource } from '../sui/index.ts';\n\nimport { makeAccountCodegen, type AccountBindings } from './codegen.ts';\nimport { ACCOUNT_ERROR_TAGS } from './errors.ts';\nimport {\n\tSUI_FULL_COIN_TYPE,\n\ttype AccountFunding,\n\ttype AccountFundingEntry,\n\ttype AccountFundingResult,\n\ttype CrossCuttingFundingEntry,\n\ttype CrossCuttingFundingProvider,\n\ttype CoinMember,\n\ttype ProjectedFundingEntry,\n} from './funding.ts';\nimport {\n\tmakeAccountProjectionContribution,\n\tmakeAccountRegistryContribution,\n\ttype AccountRegistryEntry,\n\ttype AccountRegistryFunding,\n} from './registry.ts';\nimport { makeAccountSnapshotable } from './snapshot.ts';\nimport {\n\tacquireAccount,\n\tassertAccountName,\n\ttype AccountAcquireContext,\n\ttype AccountOptions,\n\ttype ResolvedAccountOptions,\n\ttype AccountValue,\n} from './service.ts';\n\nconst accountErrorContributions = pluginErrorContributions(ACCOUNT_ERROR_TAGS);\n\n// ---------------------------------------------------------------------------\n// Resource construction\n// ---------------------------------------------------------------------------\n\n/** Per-account-instance resource. The substrate's resource id MUST be unique\n * across the stack — we encode the account name as a literal-typed\n * template literal so the compiler catches duplicate-name composes\n * at the `defineDevstack` call site.\n *\n * Distilled-doc invariant: resource id flows into the on-disk path, the\n * manifest key, container labels, and generated TypeScript exports —\n * the identifier-safe name validation (in `service.ts`) protects\n * those call sites. */\nexport type AccountResourceId<Name extends string> = `account/${Name}`;\n\nconst accountResource = <Name extends string>(name: Name) =>\n\tresource<AccountResourceId<Name>, AccountValue>(`account/${name}` as AccountResourceId<Name>);\n\n// ---------------------------------------------------------------------------\n// User-facing factory\n// ---------------------------------------------------------------------------\n\n/** Construct the account plugin instance.\n *\n * Variants — typed at the API boundary via the discriminated\n * `AccountOptions` union. The factory's second arg is OPTIONAL —\n * omitting it yields the bare-form default (ephemeral + default\n * funding). Passing a non-matching `kind:` is a compile error\n * thanks to the union's discriminator.\n *\n * Distilled-doc invariant: the name is validated at the FACTORY\n * boundary (not just at acquire time) so a typo surfaces\n * immediately, not at runtime. */\ntype FundingCoinDependencies<Entries extends readonly unknown[]> = Entries extends readonly [\n\tinfer Head,\n\t...infer Tail,\n]\n\t? Head extends { readonly coin: infer Coin }\n\t\t? Coin extends CoinMember\n\t\t\t? readonly [Coin, ...FundingCoinDependencies<Tail>]\n\t\t\t: FundingCoinDependencies<Tail>\n\t\t: FundingCoinDependencies<Tail>\n\t: readonly [];\n\ntype FundingProviderDependenciesFor<Provider> = Provider extends readonly AnyResourceRef[]\n\t? Provider\n\t: Provider extends AnyResourceRef\n\t\t? readonly [Provider]\n\t\t: readonly [];\n\ntype FundingEntryProviderDependencies<Entry> = Entry extends { readonly coin: CoinMember }\n\t? 'via' extends keyof Entry\n\t\t? Entry extends { readonly via: infer Provider }\n\t\t\t? FundingProviderDependenciesFor<Provider>\n\t\t\t: readonly []\n\t\t: readonly []\n\t: readonly [];\n\ntype FundingProviderDependencies<Entries extends readonly unknown[]> = Entries extends readonly [\n\tinfer Head,\n\t...infer Tail,\n]\n\t? readonly [...FundingEntryProviderDependencies<Head>, ...FundingProviderDependencies<Tail>]\n\t: readonly [];\n\ntype AccountDependencyMembers<Funding extends AccountFunding> = readonly [\n\ttypeof suiResource,\n\t...FundingCoinDependencies<Funding>,\n\t...FundingProviderDependencies<Funding>,\n];\n\nconst isCoinFundingEntry = (entry: AccountFundingEntry): entry is CrossCuttingFundingEntry =>\n\ttypeof entry === 'object' && entry.coin !== 'sui';\n\nconst fundingProviders = (\n\tprovider: CrossCuttingFundingProvider | undefined,\n): ReadonlyArray<AnyResourceRef> => {\n\tif (provider === undefined) return [];\n\treturn Array.isArray(provider)\n\t\t? (provider as ReadonlyArray<AnyResourceRef>)\n\t\t: [provider as AnyResourceRef];\n};\n\nconst fundingAmountToBigInt = (amount: number | bigint): bigint => {\n\tif (typeof amount === 'bigint') {\n\t\tif (amount < 0n) {\n\t\t\tthrow new TypeError(`SUI funding amount must be a non-negative integer in MIST.`);\n\t\t}\n\t\treturn amount;\n\t}\n\tif (!Number.isSafeInteger(amount) || amount < 0) {\n\t\tthrow new TypeError(`SUI funding amount must be a non-negative safe integer in MIST.`);\n\t}\n\treturn BigInt(amount);\n};\n\nconst coinLabelFor = (coin: { readonly fullCoinType: string; readonly symbol?: string }): string =>\n\tcoin.symbol ?? coin.fullCoinType.split('::').at(-1) ?? coin.fullCoinType;\n\nexport const account = <const N extends string, const Funding extends AccountFunding = readonly []>(\n\tname: N,\n\topts?: AccountOptions<Funding>,\n) => {\n\tassertAccountName(name);\n\n\t// Normalize bare-form to ephemeral default. The user-facing\n\t// `AccountOptions` union does not include \"kind absent\" — we\n\t// inject the default here so the rest of the body sees a\n\t// fully-discriminated value.\n\tconst opts2: ResolvedAccountOptions =\n\t\topts === undefined\n\t\t\t? { kind: 'ephemeral', name }\n\t\t\t: ({ ...opts, name } as ResolvedAccountOptions);\n\n\tconst accountRef = accountResource(name);\n\n\t// Pull the funding resource tuple out of opts (may be undefined for\n\t// the bare form / variants without funding). The tuple preserves\n\t// plugin-valued refs when the caller passed coin plugins, so\n\t// recursive stack composition can include those publishers.\n\tconst fundingEntries = (opts?.funding ?? []) as unknown as Funding;\n\tconst fundingEntryList = fundingEntries as AccountFunding;\n\tconst coinFundingEntries = fundingEntryList.filter(isCoinFundingEntry);\n\tconst fundingMembers = coinFundingEntries.map((e) => e.coin);\n\tconst strategyProviderMembers = coinFundingEntries.flatMap((entry) =>\n\t\tfundingProviders(entry.via),\n\t);\n\tconst dependencies = [\n\t\tsuiResource,\n\t\t...fundingMembers,\n\t\t...strategyProviderMembers,\n\t] as unknown as AccountDependencyMembers<Funding>;\n\n\treturn definePlugin({\n\t\tid: accountRef.id,\n\t\tdependsOn: dependencies,\n\t\t// Account is a value-producer (no long-lived server / container);\n\t\t// tasks acquire their value, publish contributions, then reach\n\t\t// `done`.\n\t\trole: 'task',\n\t\tstart: (deps) =>\n\t\t\tEffect.gen(function* () {\n\t\t\t\tconst [sui, ...resolvedDeps] = deps;\n\t\t\t\tconst resolvedCoinValues = resolvedDeps.slice(\n\t\t\t\t\t0,\n\t\t\t\t\tcoinFundingEntries.length,\n\t\t\t\t) as ReadonlyArray<{\n\t\t\t\t\treadonly fullCoinType: string;\n\t\t\t\t\treadonly symbol?: string;\n\t\t\t\t}>;\n\t\t\t\t// Identity + on-disk runtime root come from the\n\t\t\t\t// supervisor-provided substrate context.\n\t\t\t\tconst identity = yield* IdentityContext;\n\t\t\t\tconst paths = yield* StackPathsService;\n\n\t\t\t\t// Project each funding dependency value to a\n\t\t\t\t// `{fullCoinType, amount}` projection. Dependency order\n\t\t\t\t// mirrors `fundingEntries`, after the hard Sui upstream.\n\t\t\t\tlet coinIndex = 0;\n\t\t\t\tconst projectedFunding: ReadonlyArray<ProjectedFundingEntry> = fundingEntryList.map(\n\t\t\t\t\t(entry) => {\n\t\t\t\t\t\tif (entry.coin === 'sui') {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tcoin: 'SUI',\n\t\t\t\t\t\t\t\tfullCoinType: SUI_FULL_COIN_TYPE,\n\t\t\t\t\t\t\t\tamount: fundingAmountToBigInt(entry.amount),\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst resolvedCoin = resolvedCoinValues[coinIndex]!;\n\t\t\t\t\t\tcoinIndex += 1;\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tcoin: coinLabelFor(resolvedCoin),\n\t\t\t\t\t\t\tfullCoinType: resolvedCoin.fullCoinType,\n\t\t\t\t\t\t\tamount: entry.amount,\n\t\t\t\t\t\t};\n\t\t\t\t\t},\n\t\t\t\t);\n\n\t\t\t\tconst acquireCtx: AccountAcquireContext = {\n\t\t\t\t\tsui: {\n\t\t\t\t\t\tmode: sui.mode,\n\t\t\t\t\t\tchain: sui.chain,\n\t\t\t\t\t\tsdk: sui.sdk,\n\t\t\t\t\t\tfork: sui.fork,\n\t\t\t\t\t},\n\t\t\t\t\truntimeRoot: paths.stackRoot,\n\t\t\t\t\tapp: identity.app,\n\t\t\t\t\tstack: identity.stack,\n\t\t\t\t\temitAutoPromotionEvent: () =>\n\t\t\t\t\t\tEffect.logWarning('account funding auto-promoted for fork mode').pipe(\n\t\t\t\t\t\t\tEffect.annotateLogs({\n\t\t\t\t\t\t\t\t[SpanAttr.accountName]: name,\n\t\t\t\t\t\t\t\t[SpanAttr.accountFundingFrom]: 'faucet',\n\t\t\t\t\t\t\t\t[SpanAttr.accountFundingTo]: 'pay-from-seed-via-impersonate',\n\t\t\t\t\t\t\t\t[SpanAttr.suiMode]: 'fork',\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\tprojectedFunding,\n\t\t\t\t};\n\t\t\t\treturn yield* acquireAccount(opts2, acquireCtx);\n\t\t\t}),\n\t\t// Dynamic capability factory — receives the resolved\n\t\t// `AccountValue` + acquire context AFTER `acquire` succeeds.\n\t\t// Lets snapshot + codegen + registry decls reference the\n\t\t// REAL address (and identity app/stack) — the static form\n\t\t// would force placeholder values for fields only known at\n\t\t// acquire time.\n\t\terrorContributions: accountErrorContributions,\n\t\tcapabilities: ({ value: resolved, runtime: acquireCtx2 }) => {\n\t\t\tconst realEntry: AccountRegistryEntry = {\n\t\t\t\tname,\n\t\t\t\taddress: resolved.address,\n\t\t\t\tscheme: resolved.scheme,\n\t\t\t\tsource: resolved.source,\n\t\t\t\tfunding: fundingProjectionForResult(resolved.funding),\n\t\t\t};\n\t\t\tconst bindings: AccountBindings = {\n\t\t\t\tname,\n\t\t\t\taddress: resolved.address,\n\t\t\t\tscheme: resolved.scheme,\n\t\t\t\tsource: resolved.source,\n\t\t\t};\n\t\t\tconst snapshot = makeAccountSnapshotable({\n\t\t\t\taccountName: name,\n\t\t\t\tvariant: opts2.kind,\n\t\t\t\tapp: acquireCtx2.identity.app,\n\t\t\t\tstack: acquireCtx2.identity.stack,\n\t\t\t});\n\t\t\tconst codegen = makeAccountCodegen<N>({ name, resolved: bindings });\n\t\t\tconst registry = makeAccountRegistryContribution<N>(\n\t\t\t\trealEntry as AccountRegistryEntry & { readonly name: N },\n\t\t\t);\n\t\t\tconst projection = makeAccountProjectionContribution<N>(\n\t\t\t\trealEntry as AccountRegistryEntry & { readonly name: N },\n\t\t\t);\n\t\t\treturn [snapshot, codegen, registry, projection] as const;\n\t\t},\n\t});\n};\n\nconst fundingProjectionForResult = (funding: AccountFundingResult): AccountRegistryFunding => {\n\tif (funding.requested.length === 0) {\n\t\treturn { status: 'skipped', balanceMist: null, requestedMist: null, entries: [] };\n\t}\n\n\tconst appliedKeys = new Set(funding.applied.map(fundingEntryKey));\n\tconst entries = funding.requested.map((entry) => ({\n\t\tcoin: entry.coin,\n\t\tfullCoinType: entry.fullCoinType,\n\t\tamount: entry.amount.toString(),\n\t\tstatus: appliedKeys.has(fundingEntryKey(entry)) ? ('funded' as const) : ('skipped' as const),\n\t}));\n\tconst requestedMist =\n\t\tfunding.requested\n\t\t\t.find((entry) => entry.fullCoinType === SUI_FULL_COIN_TYPE)\n\t\t\t?.amount.toString() ?? null;\n\tconst fundedCount = entries.filter((entry) => entry.status === 'funded').length;\n\treturn {\n\t\tstatus: fundedCount === entries.length ? 'funded' : fundedCount === 0 ? 'skipped' : 'unknown',\n\t\tbalanceMist: null,\n\t\trequestedMist,\n\t\tentries,\n\t};\n};\n\nconst fundingEntryKey = (entry: ProjectedFundingEntry): string =>\n\t`${entry.fullCoinType}:${entry.amount}`;\n\n// ---------------------------------------------------------------------------\n// Re-exports for advanced callers (Coin, Wallet, Package)\n// ---------------------------------------------------------------------------\n\nexport type { AccountOptions, ResolvedAccountOptions, AccountValue, TxResult } from './service.ts';\nexport type {\n\tAccountError,\n\tAccountAcquireError,\n\tAccountAcquirePhase,\n\tAccountSignError,\n\tAccountSignPhase,\n\tAccountVariantKind,\n} from './errors.ts';\nexport { ACCOUNT_ERROR_TAGS } from './errors.ts';\nexport type {\n\tAccountFunding,\n\tAccountFundingEntry,\n\tAccountFundingCoinValue,\n\tAccountFundingResult,\n\tAccountFundingRequest,\n\tAccountFundingStrategy,\n\tCoinMember,\n\tCrossCuttingFundingEntry,\n\tCrossCuttingFundingProvider,\n\tProjectedFunding,\n\tProjectedFundingEntry,\n\tSuiFundingEntry,\n} from './funding.ts';\nexport { DEFAULT_EPHEMERAL_FUND_MIST, SUI_FULL_COIN_TYPE } from './funding.ts';\nexport type { AccountBindings } from './codegen.ts';\nexport type {\n\tAccountRegistryEntry,\n\tAccountRegistryFunding,\n\tAccountRegistryKey,\n} from './registry.ts';\nexport { accountRegistryKey } from './registry.ts';\nexport type { SyntheticImpersonationSigner } from './variants/impersonate.ts';\nexport type { SignatureScheme, ResolvedKeypair } from './keypair.ts';\n"],"mappings":"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"}
@@ -0,0 +1,32 @@
1
+ import { Effect } from "effect";
2
+
3
+ //#region src/plugins/account/keypair.d.ts
4
+ /** Lowercased signature scheme — the canonical wire form. The SDK
5
+ * occasionally hands us `'ED25519'` / `'Secp256k1'`; the boundary
6
+ * conversion lives in `normalizeScheme`. */
7
+ type SignatureScheme = 'ed25519' | 'secp256k1' | 'secp256r1';
8
+ /** Resolved keypair shape — the variant resolvers all funnel into
9
+ * this so the funding + register passes are variant-agnostic.
10
+ *
11
+ * Note: impersonation accounts do NOT produce a `Keypair`; they
12
+ * produce a `SyntheticImpersonationSigner` (see
13
+ * `variants/impersonate.ts`). The discriminator lives on the
14
+ * resolved `AccountValue` (architecture: distilled doc opportunity
15
+ * "Tighten the resolved-account type"). */
16
+ interface ResolvedKeypair {
17
+ readonly address: string;
18
+ readonly scheme: SignatureScheme;
19
+ readonly publicKey: Uint8Array;
20
+ /** Opaque signer handle — typed loosely here because the four
21
+ * real variants (ed25519/secp256k1/secp256r1 + bring-your-own
22
+ * Signer) share no narrow TS type beyond `Signer`. The wallet /
23
+ * sign-and-execute capability narrows downstream. */
24
+ readonly signer: unknown;
25
+ /** Bech32-encoded secret. Only present for ephemeral / inline /
26
+ * env / keystore variants — `null` for `signer` (we never ask
27
+ * for it) and `impersonate` (no secret exists). */
28
+ readonly bech32Secret: string | null;
29
+ }
30
+ //#endregion
31
+ export { ResolvedKeypair, SignatureScheme };
32
+ //# sourceMappingURL=keypair.d.mts.map