@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 @@
1
+ {"version":3,"file":"ephemeral.mjs","names":[],"sources":["../../../../src/plugins/account/variants/ephemeral.ts"],"sourcesContent":["// Account variant — ephemeral (generate-or-recover, fund-by-default).\n//\n// Distilled-doc invariants:\n//\n// - \"Concurrent first-time keypair persistence\": EXCL-create write.\n// Two parallel generators must not both win; the loser falls\n// back to reading the winner's persisted key.\n// - \"Restrictive file permissions\": 0o600 secret + 0o700 parent.\n// - \"Bare form equals ephemeral-funded\": this resolver is what the\n// bare `account('alice')` factory call lands on.\n// - \"Auto-promotion to fork-impersonate funding\": handled in\n// `funding.ts`; this file just hands off the address. The\n// promotion event is emitted there (loud-by-default).\n//\n// Persistence note: these accounts are \"ephemeral\" relative to user-\n// managed key material, but they are stable inside a devstack runtime\n// root. Package cache keys and wallet accounts depend on that stability\n// across warm starts.\n\nimport { dirname } from 'node:path';\nimport * as nodeFs from 'node:fs/promises';\n\nimport { Effect } from 'effect';\n\nimport { decodeBech32Secret, generateEd25519Keypair, type ResolvedKeypair } from '../keypair.ts';\nimport { accountAcquireError, type AccountAcquireError } from '../errors.ts';\n\nexport interface EphemeralVariantArgs {\n\treadonly name: string;\n\t/** Filesystem path where the bech32 secret will be persisted by\n\t * the resolver and covered by the account snapshot capability. */\n\treadonly secretFilePath: string;\n}\n\ntype WriteResult = 'wrote' | 'exists';\n\nconst isErrnoCode = (cause: unknown, code: string): boolean =>\n\ttypeof cause === 'object' &&\n\tcause !== null &&\n\t'code' in cause &&\n\t(cause as { readonly code?: unknown }).code === code;\n\nconst bestEffortChmod = (path: string, mode: number): Effect.Effect<void> =>\n\tEffect.promise(() => nodeFs.chmod(path, mode)).pipe(Effect.ignore);\n\nconst readPersistedKeypair = (\n\targs: EphemeralVariantArgs,\n\tmessage: string,\n): Effect.Effect<ResolvedKeypair, AccountAcquireError> =>\n\tEffect.gen(function* () {\n\t\tconst raw = yield* Effect.tryPromise({\n\t\t\ttry: () => nodeFs.readFile(args.secretFilePath, 'utf8'),\n\t\t\tcatch: (cause): AccountAcquireError =>\n\t\t\t\taccountAcquireError({\n\t\t\t\t\tphase: 'read-persisted-keypair',\n\t\t\t\t\taccountName: args.name,\n\t\t\t\t\tvariant: 'ephemeral',\n\t\t\t\t\tmessage,\n\t\t\t\t\tcause,\n\t\t\t\t}),\n\t\t});\n\t\tyield* bestEffortChmod(args.secretFilePath, 0o600);\n\t\treturn yield* decodeBech32Secret(raw.trim(), args.name, 'ephemeral');\n\t});\n\nconst readPersistedKeypairIfPresent = (\n\targs: EphemeralVariantArgs,\n): Effect.Effect<ResolvedKeypair | null, AccountAcquireError> =>\n\treadPersistedKeypair(\n\t\targs,\n\t\t`Account '${args.name}': failed to read persisted ephemeral keypair at ${args.secretFilePath}.`,\n\t).pipe(\n\t\tEffect.catch((cause: AccountAcquireError) =>\n\t\t\tisErrnoCode(cause.cause, 'ENOENT') ? Effect.succeed(null) : Effect.fail(cause),\n\t\t),\n\t);\n\nconst persistGeneratedSecret = (\n\targs: EphemeralVariantArgs,\n\tsecret: string,\n): Effect.Effect<WriteResult, AccountAcquireError> =>\n\tEffect.tryPromise({\n\t\ttry: async () => {\n\t\t\tawait nodeFs.mkdir(dirname(args.secretFilePath), { recursive: true, mode: 0o700 });\n\t\t\tawait nodeFs.chmod(dirname(args.secretFilePath), 0o700).catch(() => {});\n\t\t\ttry {\n\t\t\t\tawait nodeFs.writeFile(args.secretFilePath, secret, { flag: 'wx', mode: 0o600 });\n\t\t\t\treturn 'wrote';\n\t\t\t} catch (cause) {\n\t\t\t\tif (isErrnoCode(cause, 'EEXIST')) return 'exists';\n\t\t\t\tthrow cause;\n\t\t\t}\n\t\t},\n\t\tcatch: (cause): AccountAcquireError =>\n\t\t\taccountAcquireError({\n\t\t\t\tphase: 'persist-keypair',\n\t\t\t\taccountName: args.name,\n\t\t\t\tvariant: 'ephemeral',\n\t\t\t\tmessage: `Account '${args.name}': failed to persist ephemeral keypair at ${args.secretFilePath}.`,\n\t\t\t\tcause,\n\t\t\t}),\n\t});\n\n/** Resolve the ephemeral variant — read or generate an Ed25519 keypair.\n *\n * First-time writes use O_EXCL so parallel acquires for the same\n * account cannot both publish different addresses; the loser re-reads\n * the winner's file and returns the persisted identity. */\nexport const resolveEphemeralVariant = (\n\targs: EphemeralVariantArgs,\n): Effect.Effect<ResolvedKeypair, AccountAcquireError> =>\n\tEffect.gen(function* () {\n\t\tconst persisted = yield* readPersistedKeypairIfPresent(args);\n\t\tif (persisted !== null) return persisted;\n\n\t\tconst generated = yield* generateEd25519Keypair(args.name);\n\t\tif (generated.bech32Secret === null) {\n\t\t\treturn yield* Effect.fail(\n\t\t\t\taccountAcquireError({\n\t\t\t\t\tphase: 'generate-keypair',\n\t\t\t\t\taccountName: args.name,\n\t\t\t\t\tvariant: 'ephemeral',\n\t\t\t\t\tmessage: `Account '${args.name}': generated keypair did not expose a bech32 secret.`,\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\n\t\tconst writeResult = yield* persistGeneratedSecret(args, generated.bech32Secret);\n\t\tif (writeResult === 'exists') {\n\t\t\treturn yield* readPersistedKeypair(\n\t\t\t\targs,\n\t\t\t\t`Account '${args.name}': lost ephemeral keypair write race at ${args.secretFilePath} and failed to read the winner.`,\n\t\t\t);\n\t\t}\n\n\t\tyield* bestEffortChmod(args.secretFilePath, 0o600);\n\t\treturn generated;\n\t});\n"],"mappings":";;;;;;AAoCA,MAAM,eAAe,OAAgB,SACpC,OAAO,UAAU,YACjB,UAAU,QACV,UAAU,SACT,MAAsC,SAAS;AAEjD,MAAM,mBAAmB,MAAc,SACtC,OAAO,cAAc,OAAO,MAAM,MAAM,KAAK,CAAC,CAAC,KAAK,OAAO,OAAO;AAEnE,MAAM,wBACL,MACA,YAEA,OAAO,IAAI,aAAa;CACvB,MAAM,MAAM,OAAO,OAAO,WAAW;EACpC,WAAW,OAAO,SAAS,KAAK,gBAAgB,OAAO;EACvD,QAAQ,UACP,oBAAoB;GACnB,OAAO;GACP,aAAa,KAAK;GAClB,SAAS;GACT;GACA;GACA,CAAC;EACH,CAAC;AACF,QAAO,gBAAgB,KAAK,gBAAgB,IAAM;AAClD,QAAO,OAAO,mBAAmB,IAAI,MAAM,EAAE,KAAK,MAAM,YAAY;EACnE;AAEH,MAAM,iCACL,SAEA,qBACC,MACA,YAAY,KAAK,KAAK,mDAAmD,KAAK,eAAe,GAC7F,CAAC,KACD,OAAO,OAAO,UACb,YAAY,MAAM,OAAO,SAAS,GAAG,OAAO,QAAQ,KAAK,GAAG,OAAO,KAAK,MAAM,CAC9E,CACD;AAEF,MAAM,0BACL,MACA,WAEA,OAAO,WAAW;CACjB,KAAK,YAAY;AAChB,QAAM,OAAO,MAAM,QAAQ,KAAK,eAAe,EAAE;GAAE,WAAW;GAAM,MAAM;GAAO,CAAC;AAClF,QAAM,OAAO,MAAM,QAAQ,KAAK,eAAe,EAAE,IAAM,CAAC,YAAY,GAAG;AACvE,MAAI;AACH,SAAM,OAAO,UAAU,KAAK,gBAAgB,QAAQ;IAAE,MAAM;IAAM,MAAM;IAAO,CAAC;AAChF,UAAO;WACC,OAAO;AACf,OAAI,YAAY,OAAO,SAAS,CAAE,QAAO;AACzC,SAAM;;;CAGR,QAAQ,UACP,oBAAoB;EACnB,OAAO;EACP,aAAa,KAAK;EAClB,SAAS;EACT,SAAS,YAAY,KAAK,KAAK,4CAA4C,KAAK,eAAe;EAC/F;EACA,CAAC;CACH,CAAC;;;;;;AAOH,MAAa,2BACZ,SAEA,OAAO,IAAI,aAAa;CACvB,MAAM,YAAY,OAAO,8BAA8B,KAAK;AAC5D,KAAI,cAAc,KAAM,QAAO;CAE/B,MAAM,YAAY,OAAO,uBAAuB,KAAK,KAAK;AAC1D,KAAI,UAAU,iBAAiB,KAC9B,QAAO,OAAO,OAAO,KACpB,oBAAoB;EACnB,OAAO;EACP,aAAa,KAAK;EAClB,SAAS;EACT,SAAS,YAAY,KAAK,KAAK;EAC/B,CAAC,CACF;AAIF,MAAI,OADuB,uBAAuB,MAAM,UAAU,aAAa,MAC3D,SACnB,QAAO,OAAO,qBACb,MACA,YAAY,KAAK,KAAK,0CAA0C,KAAK,eAAe,iCACpF;AAGF,QAAO,gBAAgB,KAAK,gBAAgB,IAAM;AAClD,QAAO;EACN"}
@@ -0,0 +1,16 @@
1
+ import { Effect } from "effect";
2
+
3
+ //#region src/plugins/account/variants/impersonate.d.ts
4
+ /** The synthetic impersonation signer object. THROWS SYNCHRONOUSLY
5
+ * on direct sign calls; routes `signAndExecute` through the fork's
6
+ * empty-signature submit path (wired in `service.ts`). */
7
+ interface SyntheticImpersonationSigner {
8
+ readonly _kind: 'impersonate';
9
+ readonly toSuiAddress: () => string;
10
+ readonly getKeyScheme: () => 'ed25519';
11
+ readonly signTransaction: () => never;
12
+ readonly signPersonalMessage: () => never;
13
+ }
14
+ //#endregion
15
+ export { SyntheticImpersonationSigner };
16
+ //# sourceMappingURL=impersonate.d.mts.map
@@ -0,0 +1,48 @@
1
+ import { accountAcquireError, accountSignError } from "../errors.mjs";
2
+ import { Effect } from "effect";
3
+ //#region src/plugins/account/variants/impersonate.ts
4
+ const makeSyntheticSigner = (accountName, address) => ({
5
+ _kind: "impersonate",
6
+ toSuiAddress: () => address,
7
+ getKeyScheme: () => "ed25519",
8
+ signTransaction: () => {
9
+ throw accountSignError({
10
+ phase: "impersonation-bypass-attempt",
11
+ accountName,
12
+ address,
13
+ message: `Account '${accountName}' is an impersonation account — direct sign calls are forbidden. Route through signAndExecute (which goes via the fork's impersonation submit path).`
14
+ });
15
+ },
16
+ signPersonalMessage: () => {
17
+ throw accountSignError({
18
+ phase: "impersonation-bypass-attempt",
19
+ accountName,
20
+ address,
21
+ message: `Account '${accountName}' is an impersonation account — signPersonalMessage is not supported.`
22
+ });
23
+ }
24
+ });
25
+ /** Resolve the impersonate variant.
26
+ *
27
+ * Distilled-doc invariant: refuse outside fork mode. The refusal
28
+ * is a typed acquisition error pointing at the runtime requirement. */
29
+ const resolveImpersonateVariant = (args) => {
30
+ if (args.suiMode !== "fork") return Effect.fail(accountAcquireError({
31
+ phase: "bind-impersonation-slot",
32
+ accountName: args.name,
33
+ variant: "impersonate",
34
+ message: `Account '${args.name}' uses {kind:'impersonate'} but Sui runtime is '${args.suiMode}'. Impersonation only works on fork-mode networks.`,
35
+ hint: `Switch to suiFor(network).fork.{mainnet|testnet|devnet}(...) — or use a different account variant.`
36
+ }));
37
+ return Effect.succeed({
38
+ address: args.address,
39
+ scheme: "ed25519",
40
+ publicKey: new Uint8Array(32),
41
+ signer: makeSyntheticSigner(args.name, args.address),
42
+ bech32Secret: null
43
+ });
44
+ };
45
+ //#endregion
46
+ export { resolveImpersonateVariant };
47
+
48
+ //# sourceMappingURL=impersonate.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"impersonate.mjs","names":[],"sources":["../../../../src/plugins/account/variants/impersonate.ts"],"sourcesContent":["// Account variant — impersonate (fork-mode only).\n//\n// Distilled-doc invariants:\n//\n// - \"Impersonation only on fork\": the variant must refuse outside\n// fork-runtime. The refusal lands at variant-resolution time\n// (typed AccountAcquireError, phase: bind-impersonation-slot).\n//\n// - \"Sign-and-execute is the only execution surface for\n// impersonation\": synthetic impersonation signers must THROW\n// SYNCHRONOUSLY on direct sign calls so accidental bypass is\n// loud, not silent. We surface this through the\n// `SyntheticImpersonationSigner` object's `signTransaction` /\n// `signPersonalMessage` methods.\n//\n// - \"publicKey caveat\": the resolved value's `publicKey` is a\n// zero buffer. The resolved-account TYPE (in `service.ts`)\n// encodes the source discriminator so consumers can't accidentally\n// treat an impersonation publicKey as authoritative.\n//\n// Distilled-doc opportunity: \"Move the synthetic impersonation\n// signer next to the other fork-only helpers\". For now, it stays\n// here because the variant resolver is the only construction site —\n// if Wallet ever needs to materialize impersonation signers directly,\n// we lift this into `plugins/sui/fork-orchestration.ts`.\n\nimport { Effect } from 'effect';\n\nimport { accountAcquireError, accountSignError, type AccountAcquireError } from '../errors.ts';\nimport type { ResolvedKeypair } from '../keypair.ts';\n\nexport interface ImpersonateVariantArgs {\n\treadonly name: string;\n\t/** The address to execute AS. Must appear in the fork's seed\n\t * manifest's owned-object index (typically by being listed\n\t * in `Sui({fork:{seed:{addresses}}})`). */\n\treadonly address: string;\n\t/** Sui's resolved runtime mode — gates the refusal-outside-fork\n\t * check. */\n\treadonly suiMode: 'local' | 'local-rpc' | 'live' | 'fork';\n}\n\n/** The synthetic impersonation signer object. THROWS SYNCHRONOUSLY\n * on direct sign calls; routes `signAndExecute` through the fork's\n * empty-signature submit path (wired in `service.ts`). */\nexport interface SyntheticImpersonationSigner {\n\treadonly _kind: 'impersonate';\n\treadonly toSuiAddress: () => string;\n\treadonly getKeyScheme: () => 'ed25519';\n\treadonly signTransaction: () => never;\n\treadonly signPersonalMessage: () => never;\n}\n\nconst makeSyntheticSigner = (\n\taccountName: string,\n\taddress: string,\n): SyntheticImpersonationSigner => ({\n\t_kind: 'impersonate',\n\ttoSuiAddress: () => address,\n\t// Stable lie: report ed25519 so manifest serialization doesn't\n\t// have to branch. Consumers that need the truth read `source`\n\t// off the resolved-account value (architecture-distilled\n\t// invariant).\n\tgetKeyScheme: () => 'ed25519',\n\tsignTransaction: () => {\n\t\tthrow accountSignError({\n\t\t\tphase: 'impersonation-bypass-attempt',\n\t\t\taccountName,\n\t\t\taddress,\n\t\t\tmessage: `Account '${accountName}' is an impersonation account — direct sign calls are forbidden. Route through signAndExecute (which goes via the fork's impersonation submit path).`,\n\t\t});\n\t},\n\tsignPersonalMessage: () => {\n\t\tthrow accountSignError({\n\t\t\tphase: 'impersonation-bypass-attempt',\n\t\t\taccountName,\n\t\t\taddress,\n\t\t\tmessage: `Account '${accountName}' is an impersonation account — signPersonalMessage is not supported.`,\n\t\t});\n\t},\n});\n\n/** Resolve the impersonate variant.\n *\n * Distilled-doc invariant: refuse outside fork mode. The refusal\n * is a typed acquisition error pointing at the runtime requirement. */\nexport const resolveImpersonateVariant = (\n\targs: ImpersonateVariantArgs,\n): Effect.Effect<ResolvedKeypair, AccountAcquireError> => {\n\tif (args.suiMode !== 'fork') {\n\t\treturn Effect.fail(\n\t\t\taccountAcquireError({\n\t\t\t\tphase: 'bind-impersonation-slot',\n\t\t\t\taccountName: args.name,\n\t\t\t\tvariant: 'impersonate',\n\t\t\t\tmessage: `Account '${args.name}' uses {kind:'impersonate'} but Sui runtime is '${args.suiMode}'. Impersonation only works on fork-mode networks.`,\n\t\t\t\thint: `Switch to suiFor(network).fork.{mainnet|testnet|devnet}(...) — or use a different account variant.`,\n\t\t\t}),\n\t\t);\n\t}\n\treturn Effect.succeed({\n\t\taddress: args.address,\n\t\tscheme: 'ed25519',\n\t\t// Zero-buffer publicKey — the type-level lie. The `source`\n\t\t// discriminator on the resolved AccountValue is the\n\t\t// trustworthy signal.\n\t\tpublicKey: new Uint8Array(32),\n\t\tsigner: makeSyntheticSigner(args.name, args.address),\n\t\tbech32Secret: null,\n\t} satisfies ResolvedKeypair);\n};\n"],"mappings":";;;AAqDA,MAAM,uBACL,aACA,aACmC;CACnC,OAAO;CACP,oBAAoB;CAKpB,oBAAoB;CACpB,uBAAuB;AACtB,QAAM,iBAAiB;GACtB,OAAO;GACP;GACA;GACA,SAAS,YAAY,YAAY;GACjC,CAAC;;CAEH,2BAA2B;AAC1B,QAAM,iBAAiB;GACtB,OAAO;GACP;GACA;GACA,SAAS,YAAY,YAAY;GACjC,CAAC;;CAEH;;;;;AAMD,MAAa,6BACZ,SACyD;AACzD,KAAI,KAAK,YAAY,OACpB,QAAO,OAAO,KACb,oBAAoB;EACnB,OAAO;EACP,aAAa,KAAK;EAClB,SAAS;EACT,SAAS,YAAY,KAAK,KAAK,kDAAkD,KAAK,QAAQ;EAC9F,MAAM;EACN,CAAC,CACF;AAEF,QAAO,OAAO,QAAQ;EACrB,SAAS,KAAK;EACd,QAAQ;EAIR,WAAW,IAAI,WAAW,GAAG;EAC7B,QAAQ,oBAAoB,KAAK,MAAM,KAAK,QAAQ;EACpD,cAAc;EACd,CAA2B"}
@@ -0,0 +1,13 @@
1
+ import { decodeBech32Secret, resolvedKeypairFromEd25519Bytes } from "../keypair.mjs";
2
+ import "effect";
3
+ //#region src/plugins/account/variants/inline.ts
4
+ /** Resolve the inline variant. String input takes the bech32 decode
5
+ * path; Uint8Array input takes the raw-bytes-into-Ed25519 path. */
6
+ const resolveInlineVariant = (args) => {
7
+ if (typeof args.privateKey === "string") return decodeBech32Secret(args.privateKey, args.name, "inline");
8
+ return resolvedKeypairFromEd25519Bytes(args.privateKey, args.name, "inline");
9
+ };
10
+ //#endregion
11
+ export { resolveInlineVariant };
12
+
13
+ //# sourceMappingURL=inline.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inline.mjs","names":[],"sources":["../../../../src/plugins/account/variants/inline.ts"],"sourcesContent":["// Account variant — inline (literal bech32 secret in config).\n//\n// Distilled-doc warning: TESTS AND DEMOS ONLY. The key is serialized\n// as part of the user's devstack config; if that file is committed,\n// the key is in their git history. The user-facing factory in\n// `index.ts` mirrors the warning in JSDoc.\n//\n// This file accepts either a `string` (bech32 form) or a `Uint8Array`\n// (raw 32-byte secret key). Both funnel through Ed25519 construction\n// so downstream paths are uniform.\n\nimport { Effect } from 'effect';\n\nimport {\n\tdecodeBech32Secret,\n\tresolvedKeypairFromEd25519Bytes,\n\ttype ResolvedKeypair,\n} from '../keypair.ts';\nimport type { AccountAcquireError } from '../errors.ts';\n\nexport interface InlineVariantArgs {\n\treadonly name: string;\n\treadonly privateKey: string | Uint8Array;\n}\n\n/** Resolve the inline variant. String input takes the bech32 decode\n * path; Uint8Array input takes the raw-bytes-into-Ed25519 path. */\nexport const resolveInlineVariant = (\n\targs: InlineVariantArgs,\n): Effect.Effect<ResolvedKeypair, AccountAcquireError> => {\n\tif (typeof args.privateKey === 'string') {\n\t\treturn decodeBech32Secret(args.privateKey, args.name, 'inline');\n\t}\n\treturn resolvedKeypairFromEd25519Bytes(args.privateKey, args.name, 'inline');\n};\n"],"mappings":";;;;;AA2BA,MAAa,wBACZ,SACyD;AACzD,KAAI,OAAO,KAAK,eAAe,SAC9B,QAAO,mBAAmB,KAAK,YAAY,KAAK,MAAM,SAAS;AAEhE,QAAO,gCAAgC,KAAK,YAAY,KAAK,MAAM,SAAS"}
@@ -0,0 +1,93 @@
1
+ import { decodeJsonText } from "../../../substrate/runtime/runtime-decode.mjs";
2
+ import { accountAcquireError } from "../errors.mjs";
3
+ import { decodeBech32Secret } from "../keypair.mjs";
4
+ import { Effect, Schema } from "effect";
5
+ import { promises } from "node:fs";
6
+ import { decodeSuiPrivateKey } from "@mysten/sui/cryptography";
7
+ import { Ed25519Keypair } from "@mysten/sui/keypairs/ed25519";
8
+ //#region src/plugins/account/variants/keystore.ts
9
+ const AliasesShape = Schema.Array(Schema.Struct({
10
+ alias: Schema.String,
11
+ public_key_base64: Schema.optional(Schema.String)
12
+ }));
13
+ const KeystoreShape = Schema.Array(Schema.String);
14
+ /** Resolve the keystore variant. */
15
+ const resolveKeystoreVariant = (args) => Effect.gen(function* () {
16
+ const rows = yield* decodeJsonText(KeystoreShape, yield* Effect.tryPromise({
17
+ try: () => promises.readFile(args.path, "utf-8"),
18
+ catch: (cause) => accountAcquireError({
19
+ phase: "load-keystore",
20
+ accountName: args.name,
21
+ variant: "keystore",
22
+ message: `Account '${args.name}': failed to read keystore at '${args.path}'.`,
23
+ hint: "Verify the path exists and is readable. The Sui CLI default is `~/.sui/sui_config/sui.keystore`.",
24
+ cause
25
+ })
26
+ }), {
27
+ source: args.path,
28
+ mkError: (issue) => accountAcquireError({
29
+ phase: "load-keystore",
30
+ accountName: args.name,
31
+ variant: "keystore",
32
+ message: issue.message === "failed to parse JSON" ? `Account '${args.name}': keystore at '${args.path}' is not valid JSON.` : `Account '${args.name}': keystore at '${args.path}' did not match the expected schema (array of bech32 strings).`,
33
+ cause: issue.cause
34
+ })
35
+ });
36
+ const aliasIdx = yield* resolveAliasIndex(`${args.path.replace(/\.keystore$/, "")}.aliases`, args.aliasOrAddress).pipe(Effect.orElseSucceed(() => -1));
37
+ if (aliasIdx >= 0 && aliasIdx < rows.length) {
38
+ const bech32 = rows[aliasIdx];
39
+ return yield* decodeBech32Secret(bech32, args.name, "keystore");
40
+ }
41
+ const wantAddr = normalizeAddress(args.aliasOrAddress);
42
+ for (const bech32 of rows) {
43
+ const addr = yield* tryDeriveAddress(bech32).pipe(Effect.orElseSucceed(() => null));
44
+ if (addr !== null && normalizeAddress(addr) === wantAddr) return yield* decodeBech32Secret(bech32, args.name, "keystore");
45
+ }
46
+ return yield* Effect.fail(accountAcquireError({
47
+ phase: "load-keystore",
48
+ accountName: args.name,
49
+ variant: "keystore",
50
+ message: `Account '${args.name}': keystore at '${args.path}' has no entry matching alias-or-address '${args.aliasOrAddress}'.`,
51
+ hint: "Check the sibling sui.aliases file for the alias spelling, or pass the on-chain address (0x-prefixed) directly."
52
+ }));
53
+ });
54
+ const resolveAliasIndex = (aliasesPath, want) => Effect.gen(function* () {
55
+ return (yield* decodeJsonText(AliasesShape, yield* Effect.tryPromise({
56
+ try: () => promises.readFile(aliasesPath, "utf-8"),
57
+ catch: (cause) => accountAcquireError({
58
+ phase: "load-keystore",
59
+ accountName: "<keystore>",
60
+ variant: "keystore",
61
+ message: `aliases file '${aliasesPath}' missing or unreadable`,
62
+ cause
63
+ })
64
+ }), {
65
+ source: aliasesPath,
66
+ mkError: (issue) => accountAcquireError({
67
+ phase: "load-keystore",
68
+ accountName: "<keystore>",
69
+ variant: "keystore",
70
+ message: issue.message === "failed to parse JSON" ? `aliases file '${aliasesPath}' is not valid JSON` : `aliases file '${aliasesPath}' did not match the expected schema`,
71
+ cause: issue.cause
72
+ })
73
+ })).findIndex((row) => row.alias === want);
74
+ });
75
+ /** Derive the on-chain address from a bech32 secret without
76
+ * surfacing a typed error — used by the by-address scan, which
77
+ * swallows per-row failures and moves on. */
78
+ const tryDeriveAddress = (bech32) => Effect.try({
79
+ try: () => {
80
+ const parsed = decodeSuiPrivateKey(bech32);
81
+ if (parsed.scheme !== "ED25519") throw new Error(`scheme ${parsed.scheme} not yet derivable here`);
82
+ return Ed25519Keypair.fromSecretKey(parsed.secretKey).toSuiAddress();
83
+ },
84
+ catch: (cause) => cause instanceof Error ? cause : new Error(String(cause))
85
+ });
86
+ const normalizeAddress = (addr) => {
87
+ const lower = addr.toLowerCase();
88
+ return lower.startsWith("0x") ? lower : `0x${lower}`;
89
+ };
90
+ //#endregion
91
+ export { resolveKeystoreVariant };
92
+
93
+ //# sourceMappingURL=keystore.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keystore.mjs","names":["fs"],"sources":["../../../../src/plugins/account/variants/keystore.ts"],"sourcesContent":["// Account variant — keystore (read from Sui CLI keystore file).\n//\n// Distilled-doc surface: read a `suiprivkey1...` entry by alias or\n// by address from a CLI-shape keystore file. Devstack NEVER copies\n// the keystore — only reads. Persistence stays with the user's\n// CLI tooling.\n//\n// Keystore file shape (canonical sui-cli output):\n// `<path>` — a JSON array of bech32 `suiprivkey1...` strings\n// `<path>.aliases` — a sibling JSON array of `{alias, public_key_base64}`\n// entries; the array's index matches the keystore.\n//\n// Lookup precedence: alias match first (case-sensitive), then by-address\n// match (the resolver decodes each bech32 row, derives the address,\n// and compares). The address path is intentionally O(n) — keystores\n// are small and the alternative is a side-table the CLI doesn't\n// maintain.\n\nimport { Effect, Schema } from 'effect';\nimport { promises as fs } from 'node:fs';\n\nimport { decodeJsonText } from '../../../substrate/runtime/runtime-decode.ts';\nimport { accountAcquireError, type AccountAcquireError } from '../errors.ts';\nimport { decodeBech32Secret, type ResolvedKeypair } from '../keypair.ts';\nimport { decodeSuiPrivateKey } from '@mysten/sui/cryptography';\nimport { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';\n\nexport interface KeystoreVariantArgs {\n\treadonly name: string;\n\t/** Absolute path to the keystore file. Defaults at the factory\n\t * boundary to `~/.sui/sui_config/sui.keystore`. */\n\treadonly path: string;\n\t/** Alias name (from the sibling `sui.aliases` file) OR the\n\t * on-chain address — the resolver tries alias first, then a\n\t * by-address lookup. */\n\treadonly aliasOrAddress: string;\n}\n\nconst AliasesShape = Schema.Array(\n\tSchema.Struct({\n\t\talias: Schema.String,\n\t\t// Optional because some CLI versions omit it for newer rows;\n\t\t// we only need the alias for the alias-path.\n\t\tpublic_key_base64: Schema.optional(Schema.String),\n\t}),\n);\n\nconst KeystoreShape = Schema.Array(Schema.String);\n\n/** Resolve the keystore variant. */\nexport const resolveKeystoreVariant = (\n\targs: KeystoreVariantArgs,\n): Effect.Effect<ResolvedKeypair, AccountAcquireError> =>\n\tEffect.gen(function* () {\n\t\t// --- read + parse the keystore ----------------------------------\n\t\tconst raw = yield* Effect.tryPromise({\n\t\t\ttry: () => fs.readFile(args.path, 'utf-8'),\n\t\t\tcatch: (cause): AccountAcquireError =>\n\t\t\t\taccountAcquireError({\n\t\t\t\t\tphase: 'load-keystore',\n\t\t\t\t\taccountName: args.name,\n\t\t\t\t\tvariant: 'keystore',\n\t\t\t\t\tmessage: `Account '${args.name}': failed to read keystore at '${args.path}'.`,\n\t\t\t\t\thint: 'Verify the path exists and is readable. The Sui CLI default is `~/.sui/sui_config/sui.keystore`.',\n\t\t\t\t\tcause,\n\t\t\t\t}),\n\t\t});\n\t\tconst rows = yield* decodeJsonText(KeystoreShape, raw, {\n\t\t\tsource: args.path,\n\t\t\tmkError: (issue): AccountAcquireError =>\n\t\t\t\taccountAcquireError({\n\t\t\t\t\tphase: 'load-keystore',\n\t\t\t\t\taccountName: args.name,\n\t\t\t\t\tvariant: 'keystore',\n\t\t\t\t\tmessage:\n\t\t\t\t\t\tissue.message === 'failed to parse JSON'\n\t\t\t\t\t\t\t? `Account '${args.name}': keystore at '${args.path}' is not valid JSON.`\n\t\t\t\t\t\t\t: `Account '${args.name}': keystore at '${args.path}' did not match the expected schema (array of bech32 strings).`,\n\t\t\t\t\tcause: issue.cause,\n\t\t\t\t}),\n\t\t});\n\n\t\t// --- alias path -------------------------------------------------\n\t\t// Best-effort: missing aliases file is not fatal — fall through\n\t\t// to the by-address path.\n\t\tconst aliasesPath = `${args.path.replace(/\\.keystore$/, '')}.aliases`;\n\t\tconst aliasIdx = yield* resolveAliasIndex(aliasesPath, args.aliasOrAddress).pipe(\n\t\t\tEffect.orElseSucceed(() => -1),\n\t\t);\n\t\tif (aliasIdx >= 0 && aliasIdx < rows.length) {\n\t\t\tconst bech32 = rows[aliasIdx]!;\n\t\t\treturn yield* decodeBech32Secret(bech32, args.name, 'keystore');\n\t\t}\n\n\t\t// --- by-address path -------------------------------------------\n\t\t// Normalize the lookup key to a lowercased 0x-prefixed string so\n\t\t// comparisons match regardless of caller casing.\n\t\tconst wantAddr = normalizeAddress(args.aliasOrAddress);\n\t\tfor (const bech32 of rows) {\n\t\t\tconst addr = yield* tryDeriveAddress(bech32).pipe(Effect.orElseSucceed(() => null));\n\t\t\tif (addr !== null && normalizeAddress(addr) === wantAddr) {\n\t\t\t\treturn yield* decodeBech32Secret(bech32, args.name, 'keystore');\n\t\t\t}\n\t\t}\n\n\t\treturn yield* Effect.fail(\n\t\t\taccountAcquireError({\n\t\t\t\tphase: 'load-keystore',\n\t\t\t\taccountName: args.name,\n\t\t\t\tvariant: 'keystore',\n\t\t\t\tmessage: `Account '${args.name}': keystore at '${args.path}' has no entry matching alias-or-address '${args.aliasOrAddress}'.`,\n\t\t\t\thint: 'Check the sibling sui.aliases file for the alias spelling, or pass the on-chain address (0x-prefixed) directly.',\n\t\t\t}),\n\t\t);\n\t});\n\nconst resolveAliasIndex = (\n\taliasesPath: string,\n\twant: string,\n): Effect.Effect<number, AccountAcquireError> =>\n\tEffect.gen(function* () {\n\t\tconst raw = yield* Effect.tryPromise({\n\t\t\ttry: () => fs.readFile(aliasesPath, 'utf-8'),\n\t\t\tcatch: (cause): AccountAcquireError =>\n\t\t\t\taccountAcquireError({\n\t\t\t\t\tphase: 'load-keystore',\n\t\t\t\t\taccountName: '<keystore>',\n\t\t\t\t\tvariant: 'keystore',\n\t\t\t\t\tmessage: `aliases file '${aliasesPath}' missing or unreadable`,\n\t\t\t\t\tcause,\n\t\t\t\t}),\n\t\t});\n\t\tconst aliases = yield* decodeJsonText(AliasesShape, raw, {\n\t\t\tsource: aliasesPath,\n\t\t\tmkError: (issue): AccountAcquireError =>\n\t\t\t\taccountAcquireError({\n\t\t\t\t\tphase: 'load-keystore',\n\t\t\t\t\taccountName: '<keystore>',\n\t\t\t\t\tvariant: 'keystore',\n\t\t\t\t\tmessage:\n\t\t\t\t\t\tissue.message === 'failed to parse JSON'\n\t\t\t\t\t\t\t? `aliases file '${aliasesPath}' is not valid JSON`\n\t\t\t\t\t\t\t: `aliases file '${aliasesPath}' did not match the expected schema`,\n\t\t\t\t\tcause: issue.cause,\n\t\t\t\t}),\n\t\t});\n\t\treturn aliases.findIndex((row) => row.alias === want);\n\t});\n\n/** Derive the on-chain address from a bech32 secret without\n * surfacing a typed error — used by the by-address scan, which\n * swallows per-row failures and moves on. */\nconst tryDeriveAddress = (bech32: string): Effect.Effect<string, Error> =>\n\tEffect.try({\n\t\ttry: () => {\n\t\t\tconst parsed = decodeSuiPrivateKey(bech32);\n\t\t\tif (parsed.scheme !== 'ED25519') {\n\t\t\t\tthrow new Error(`scheme ${parsed.scheme} not yet derivable here`);\n\t\t\t}\n\t\t\treturn Ed25519Keypair.fromSecretKey(parsed.secretKey).toSuiAddress();\n\t\t},\n\t\tcatch: (cause) => (cause instanceof Error ? cause : new Error(String(cause))),\n\t});\n\nconst normalizeAddress = (addr: string): string => {\n\tconst lower = addr.toLowerCase();\n\treturn lower.startsWith('0x') ? lower : `0x${lower}`;\n};\n"],"mappings":";;;;;;;;AAsCA,MAAM,eAAe,OAAO,MAC3B,OAAO,OAAO;CACb,OAAO,OAAO;CAGd,mBAAmB,OAAO,SAAS,OAAO,OAAO;CACjD,CAAC,CACF;AAED,MAAM,gBAAgB,OAAO,MAAM,OAAO,OAAO;;AAGjD,MAAa,0BACZ,SAEA,OAAO,IAAI,aAAa;CAcvB,MAAM,OAAO,OAAO,eAAe,eAAe,OAZ/B,OAAO,WAAW;EACpC,WAAWA,SAAG,SAAS,KAAK,MAAM,QAAQ;EAC1C,QAAQ,UACP,oBAAoB;GACnB,OAAO;GACP,aAAa,KAAK;GAClB,SAAS;GACT,SAAS,YAAY,KAAK,KAAK,iCAAiC,KAAK,KAAK;GAC1E,MAAM;GACN;GACA,CAAC;EACH,CAAC,EACqD;EACtD,QAAQ,KAAK;EACb,UAAU,UACT,oBAAoB;GACnB,OAAO;GACP,aAAa,KAAK;GAClB,SAAS;GACT,SACC,MAAM,YAAY,yBACf,YAAY,KAAK,KAAK,kBAAkB,KAAK,KAAK,wBAClD,YAAY,KAAK,KAAK,kBAAkB,KAAK,KAAK;GACtD,OAAO,MAAM;GACb,CAAC;EACH,CAAC;CAMF,MAAM,WAAW,OAAO,kBAAkB,GADnB,KAAK,KAAK,QAAQ,eAAe,GAAG,CAAC,WACL,KAAK,eAAe,CAAC,KAC3E,OAAO,oBAAoB,GAAG,CAC9B;AACD,KAAI,YAAY,KAAK,WAAW,KAAK,QAAQ;EAC5C,MAAM,SAAS,KAAK;AACpB,SAAO,OAAO,mBAAmB,QAAQ,KAAK,MAAM,WAAW;;CAMhE,MAAM,WAAW,iBAAiB,KAAK,eAAe;AACtD,MAAK,MAAM,UAAU,MAAM;EAC1B,MAAM,OAAO,OAAO,iBAAiB,OAAO,CAAC,KAAK,OAAO,oBAAoB,KAAK,CAAC;AACnF,MAAI,SAAS,QAAQ,iBAAiB,KAAK,KAAK,SAC/C,QAAO,OAAO,mBAAmB,QAAQ,KAAK,MAAM,WAAW;;AAIjE,QAAO,OAAO,OAAO,KACpB,oBAAoB;EACnB,OAAO;EACP,aAAa,KAAK;EAClB,SAAS;EACT,SAAS,YAAY,KAAK,KAAK,kBAAkB,KAAK,KAAK,4CAA4C,KAAK,eAAe;EAC3H,MAAM;EACN,CAAC,CACF;EACA;AAEH,MAAM,qBACL,aACA,SAEA,OAAO,IAAI,aAAa;AA0BvB,SAAO,OAdgB,eAAe,cAAc,OAXjC,OAAO,WAAW;EACpC,WAAWA,SAAG,SAAS,aAAa,QAAQ;EAC5C,QAAQ,UACP,oBAAoB;GACnB,OAAO;GACP,aAAa;GACb,SAAS;GACT,SAAS,iBAAiB,YAAY;GACtC;GACA,CAAC;EACH,CAAC,EACuD;EACxD,QAAQ;EACR,UAAU,UACT,oBAAoB;GACnB,OAAO;GACP,aAAa;GACb,SAAS;GACT,SACC,MAAM,YAAY,yBACf,iBAAiB,YAAY,uBAC7B,iBAAiB,YAAY;GACjC,OAAO,MAAM;GACb,CAAC;EACH,CAAC,EACa,WAAW,QAAQ,IAAI,UAAU,KAAK;EACpD;;;;AAKH,MAAM,oBAAoB,WACzB,OAAO,IAAI;CACV,WAAW;EACV,MAAM,SAAS,oBAAoB,OAAO;AAC1C,MAAI,OAAO,WAAW,UACrB,OAAM,IAAI,MAAM,UAAU,OAAO,OAAO,yBAAyB;AAElE,SAAO,eAAe,cAAc,OAAO,UAAU,CAAC,cAAc;;CAErE,QAAQ,UAAW,iBAAiB,QAAQ,QAAQ,IAAI,MAAM,OAAO,MAAM,CAAC;CAC5E,CAAC;AAEH,MAAM,oBAAoB,SAAyB;CAClD,MAAM,QAAQ,KAAK,aAAa;AAChC,QAAO,MAAM,WAAW,KAAK,GAAG,QAAQ,KAAK"}
@@ -0,0 +1,31 @@
1
+ import { accountAcquireError } from "../errors.mjs";
2
+ import { normalizeScheme } from "../keypair.mjs";
3
+ import { Effect } from "effect";
4
+ //#region src/plugins/account/variants/signer.ts
5
+ /** Resolve the signer variant.
6
+ *
7
+ * The body reads the address + scheme via the SDK shim and hands
8
+ * back the resolved-keypair view. The `bech32Secret` field is
9
+ * `null` — we never fish the secret out of an external signer. */
10
+ const resolveSignerVariant = (args) => Effect.gen(function* () {
11
+ return {
12
+ address: args.addressOverride ?? args.signer.toSuiAddress(),
13
+ scheme: yield* normalizeScheme(args.signer.getKeyScheme(), args.name, "signer"),
14
+ publicKey: yield* Effect.try({
15
+ try: () => args.signer.getPublicKey().toRawBytes(),
16
+ catch: (cause) => accountAcquireError({
17
+ phase: "bind-signer",
18
+ accountName: args.name,
19
+ variant: "signer",
20
+ message: `Account '${args.name}': signer.getPublicKey().toRawBytes() threw.`,
21
+ cause
22
+ })
23
+ }),
24
+ signer: args.signer,
25
+ bech32Secret: null
26
+ };
27
+ });
28
+ //#endregion
29
+ export { resolveSignerVariant };
30
+
31
+ //# sourceMappingURL=signer.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signer.mjs","names":[],"sources":["../../../../src/plugins/account/variants/signer.ts"],"sourcesContent":["// Account variant — signer (provided as a Signer object directly).\n//\n// Distilled-doc surface: the escape hatch for hardware wallets,\n// custom KMS adapters, and dApp-side signers. Devstack NEVER calls\n// `getSecretKey()` on this branch — the supplied signer's\n// `signTransaction` / `signPersonalMessage` / `signAndExecuteTransaction`\n// methods are called directly.\n//\n// Type-encoded contract: the `signer` field is the @mysten/sui\n// abstract `Signer` shape. We accept `unknown` here at the variant\n// boundary (the substrate's import surface stays SDK-free for tree-\n// shaking and version-pinning); the user-facing factory in `index.ts`\n// pins `Signer` from `@mysten/sui/cryptography`.\n\nimport { Effect } from 'effect';\n\nimport { accountAcquireError, type AccountAcquireError } from '../errors.ts';\nimport { normalizeScheme, type ResolvedKeypair } from '../keypair.ts';\n\nexport interface SignerVariantArgs {\n\treadonly name: string;\n\t/** A `@mysten/sui/cryptography` `Signer` instance. Typed loosely\n\t * here; the user-facing factory pins the SDK type. */\n\treadonly signer: {\n\t\treadonly toSuiAddress: () => string;\n\t\treadonly getKeyScheme: () => string;\n\t\treadonly getPublicKey: () => { readonly toRawBytes: () => Uint8Array };\n\t};\n\t/** Optional address override. When omitted, `signer.toSuiAddress()`\n\t * is called. Useful for signers whose address is more expensive\n\t * to derive than to memoize. */\n\treadonly addressOverride?: string;\n}\n\n/** Resolve the signer variant.\n *\n * The body reads the address + scheme via the SDK shim and hands\n * back the resolved-keypair view. The `bech32Secret` field is\n * `null` — we never fish the secret out of an external signer. */\nexport const resolveSignerVariant = (\n\targs: SignerVariantArgs,\n): Effect.Effect<ResolvedKeypair, AccountAcquireError> =>\n\tEffect.gen(function* () {\n\t\tconst address = args.addressOverride ?? args.signer.toSuiAddress();\n\t\tconst rawScheme = args.signer.getKeyScheme();\n\t\tconst scheme = yield* normalizeScheme(rawScheme, args.name, 'signer');\n\t\tconst publicKey = yield* Effect.try({\n\t\t\ttry: () => args.signer.getPublicKey().toRawBytes(),\n\t\t\tcatch: (cause) =>\n\t\t\t\taccountAcquireError({\n\t\t\t\t\tphase: 'bind-signer',\n\t\t\t\t\taccountName: args.name,\n\t\t\t\t\tvariant: 'signer',\n\t\t\t\t\tmessage: `Account '${args.name}': signer.getPublicKey().toRawBytes() threw.`,\n\t\t\t\t\tcause,\n\t\t\t\t}),\n\t\t});\n\t\treturn {\n\t\t\taddress,\n\t\t\tscheme,\n\t\t\tpublicKey,\n\t\t\tsigner: args.signer,\n\t\t\tbech32Secret: null,\n\t\t} satisfies ResolvedKeypair;\n\t});\n"],"mappings":";;;;;;;;;AAuCA,MAAa,wBACZ,SAEA,OAAO,IAAI,aAAa;AAevB,QAAO;EACN,SAfe,KAAK,mBAAmB,KAAK,OAAO,cAAc;EAgBjE,QAAA,OAdqB,gBADJ,KAAK,OAAO,cACiB,EAAE,KAAK,MAAM,SAAS;EAepE,WAAA,OAdwB,OAAO,IAAI;GACnC,WAAW,KAAK,OAAO,cAAc,CAAC,YAAY;GAClD,QAAQ,UACP,oBAAoB;IACnB,OAAO;IACP,aAAa,KAAK;IAClB,SAAS;IACT,SAAS,YAAY,KAAK,KAAK;IAC/B;IACA,CAAC;GACH,CAAC;EAKD,QAAQ,KAAK;EACb,cAAc;EACd;EACA"}
@@ -0,0 +1,41 @@
1
+ import { SuiClient } from "../sui/mode/shared.mjs";
2
+ import { AccountValue } from "../account/service.mjs";
3
+ import { ActionError } from "./errors.mjs";
4
+ import { ActionReceipt } from "./service.mjs";
5
+ import { Effect, Scope } from "effect";
6
+ import { Transaction } from "@mysten/sui/transactions";
7
+
8
+ //#region src/plugins/action/build-context.d.ts
9
+ /** Build-time context handed to the user's `body` callback (and the
10
+ * optional `discriminator` callback).
11
+ *
12
+ * Carries:
13
+ *
14
+ * - `sui` — the resolved `SuiClient` (sdk shim + chain id + opaque
15
+ * `client` for `Transaction.build({client})`). Threaded eagerly
16
+ * because suiResource is always part of the action's hard upstream.
17
+ * - `signAndExecute(account, build)` — high-level helper. Drives
18
+ * the full build → sign → execute → wait → project pipeline
19
+ * against the supplied account, returning a parsed
20
+ * `ActionReceipt`. Folds the SDK boundary cast +
21
+ * `include: {effects, objectTypes}` execute + finality wait +
22
+ * envelope projection into a single call. Errors surface as
23
+ * `ActionError` (phase `sign` for transport / RPC failures;
24
+ * `parse` for envelope-shape failures). */
25
+ interface ActionBuildContext {
26
+ /** Resolved SuiClient. suiResource is part of action's hard upstream so
27
+ * this is always populated. */
28
+ readonly sui: SuiClient;
29
+ /** High-level: build + sign + execute + wait + project the
30
+ * transaction in one call. The `account` is the signer, usually
31
+ * from the resolved dependency values passed to the action body.
32
+ * The `build` callback populates the fresh `Transaction`; the
33
+ * sender is set automatically to `account.address`. Returns a
34
+ * parsed `ActionReceipt` whose `objectChanges` array is non-empty
35
+ * when the transaction created or mutated on-chain objects (the
36
+ * SDK is invoked with `include: { effects, objectTypes }`). */
37
+ readonly signAndExecute: (account: AccountValue, build: (tx: Transaction) => void) => Effect.Effect<ActionReceipt, ActionError, Scope.Scope>;
38
+ }
39
+ //#endregion
40
+ export { ActionBuildContext };
41
+ //# sourceMappingURL=build-context.d.mts.map
@@ -0,0 +1,20 @@
1
+ import { ActionError } from "./errors.mjs";
2
+ import { ActionBuildContext } from "./build-context.mjs";
3
+ import { Effect } from "effect";
4
+
5
+ //#region src/plugins/action/discriminator.d.ts
6
+ /** Dynamic portion (resolved at acquire time). Two accepted shapes:
7
+ *
8
+ * - `string` — literal cache-key fragment, used verbatim.
9
+ * - `(ctx, deps) => Effect<string, ActionError>` — callback receiving
10
+ * action helpers and resolved deps in the same shape
11
+ * as the body callback. The Effect is yielded at
12
+ * acquire time so the callback can derive the
13
+ * discriminator from upstream resolved values (e.g.
14
+ * fold in a freshly-published package id). Re-runs
15
+ * on EVERY acquire (hit OR miss). User errors
16
+ * propagate as `ActionError({phase: 'discriminator'})`. */
17
+ type DynamicDiscriminator<Deps = unknown> = string | ((ctx: ActionBuildContext, deps: Deps) => Effect.Effect<string, ActionError>);
18
+ //#endregion
19
+ export { DynamicDiscriminator };
20
+ //# sourceMappingURL=discriminator.d.mts.map
@@ -0,0 +1,13 @@
1
+ //#region src/plugins/action/discriminator.ts
2
+ /** Build the content-hash input string from static + resolved-dynamic
3
+ * pieces. Canonical shape: newline-delimited so two strings with
4
+ * shared prefixes hash differently. */
5
+ const composeDiscriminatorMaterial = (staticParts, resolvedDynamic) => {
6
+ const lines = [`action=${staticParts.actionName}`, `dependencies=${JSON.stringify(staticParts.dependencyResourceIds)}`];
7
+ if (resolvedDynamic !== void 0) lines.push(`discriminator=${resolvedDynamic}`);
8
+ return lines.join("\n");
9
+ };
10
+ //#endregion
11
+ export { composeDiscriminatorMaterial };
12
+
13
+ //# sourceMappingURL=discriminator.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discriminator.mjs","names":[],"sources":["../../../src/plugins/action/discriminator.ts"],"sourcesContent":["// Action plugin — discriminator types.\n//\n// An action's cache key is `action/<chainId>/<contentHash>` where the\n// content hash folds in:\n//\n// - `actionName` — symbolic action name (drives namespace + TUI\n// attribution).\n// - `chainId` — substrate-folded automatically (substrate-side\n// of the artifact publisher cache key).\n// - `consumedKeys` — the literal resource ids of every entry in\n// `dependsOn`. Folded so reordering/changing\n// upstream deps invalidates the cache. Static —\n// resolved at factory construction time.\n// - `discriminator` — OPTIONAL caller-supplied extra material. Two\n// accepted shapes: a literal `string`, or a\n// callback `(ctx, deps) => Effect<string>`\n// receiving action helpers and resolved deps\n// shaped by `dependsOn`. The callback form re-runs\n// on EVERY acquire (hit OR miss) — mirrors v3's `cacheKey:\n// Effect<string>` semantics (16-action.md\n// invariant 5/6).\n//\n// The dynamic discriminator covers the common case where the action's\n// idempotency hinges on a value not known until upstream resolution\n// completes. The v3 example: `cacheKey: Effect.gen(function* () {\n// const pkg = yield* connectFour; return pkg.packageId; })`.\n\nimport type { Effect } from 'effect';\n\nimport type { ActionError } from './errors.ts';\nimport type { ActionBuildContext } from './build-context.ts';\n\n/** Static portion of the discriminator (known at factory construction\n * time). The substrate folds this into the content-hash so the\n * cache key changes when these fields do. */\nexport interface StaticDiscriminator {\n\t/** Symbolic action name. */\n\treadonly actionName: string;\n\t/** Resource-id literals of every entry in `dependsOn`, in declaration\n\t * order. Reordering MUST invalidate the cache (this is the v3\n\t * behavior — `needs.map(n => n.key)` was folded in order). */\n\treadonly dependencyResourceIds: ReadonlyArray<string>;\n}\n\n/** Dynamic portion (resolved at acquire time). Two accepted shapes:\n *\n * - `string` — literal cache-key fragment, used verbatim.\n * - `(ctx, deps) => Effect<string, ActionError>` — callback receiving\n * action helpers and resolved deps in the same shape\n * as the body callback. The Effect is yielded at\n * acquire time so the callback can derive the\n * discriminator from upstream resolved values (e.g.\n * fold in a freshly-published package id). Re-runs\n * on EVERY acquire (hit OR miss). User errors\n * propagate as `ActionError({phase: 'discriminator'})`. */\nexport type DynamicDiscriminator<Deps = unknown> =\n\t| string\n\t| ((ctx: ActionBuildContext, deps: Deps) => Effect.Effect<string, ActionError>);\n\n/** Build the content-hash input string from static + resolved-dynamic\n * pieces. Canonical shape: newline-delimited so two strings with\n * shared prefixes hash differently. */\nexport const composeDiscriminatorMaterial = (\n\tstaticParts: StaticDiscriminator,\n\tresolvedDynamic: string | undefined,\n): string => {\n\tconst lines: string[] = [\n\t\t`action=${staticParts.actionName}`,\n\t\t`dependencies=${JSON.stringify(staticParts.dependencyResourceIds)}`,\n\t];\n\tif (resolvedDynamic !== undefined) {\n\t\tlines.push(`discriminator=${resolvedDynamic}`);\n\t}\n\treturn lines.join('\\n');\n};\n"],"mappings":";;;;AA8DA,MAAa,gCACZ,aACA,oBACY;CACZ,MAAM,QAAkB,CACvB,UAAU,YAAY,cACtB,gBAAgB,KAAK,UAAU,YAAY,sBAAsB,GACjE;AACD,KAAI,oBAAoB,KAAA,EACvB,OAAM,KAAK,iBAAiB,kBAAkB;AAE/C,QAAO,MAAM,KAAK,KAAK"}
@@ -0,0 +1,31 @@
1
+ //#region src/plugins/action/errors.d.ts
2
+ /** Phases for `ActionError`. Closed sum — adding a phase requires
3
+ * editing this file (and the plugin doc's catalog).
4
+ *
5
+ * Phase semantics:
6
+ * - `discriminator` — `opts.discriminator` Effect evaluation failed.
7
+ * User-code defect or yielded upstream raised.
8
+ * - `build` — `opts.body`'s build phase (the user-supplied
9
+ * Effect) failed before producing a transaction.
10
+ * - `sign` — `signAndExecute` failed (gas, bytecode
11
+ * verification, RPC).
12
+ * - `parse` — the action's receipt projection (digest /
13
+ * objectChanges) was malformed.
14
+ * - `verify` — verify probe authoritatively raised (transient
15
+ * is masked by the lenient probe — does NOT raise
16
+ * this).
17
+ */
18
+ type ActionPhase = 'discriminator' | 'build' | 'sign' | 'parse' | 'verify';
19
+ /** Single tagged action error. */
20
+ interface ActionError {
21
+ readonly _tag: 'ActionError';
22
+ readonly phase: ActionPhase;
23
+ /** Symbolic action name (the user-declared `action.name`). Flows
24
+ * into the cache key namespace and the TUI row title. */
25
+ readonly actionName: string;
26
+ readonly message: string;
27
+ readonly cause?: unknown;
28
+ }
29
+ //#endregion
30
+ export { ActionError, ActionPhase };
31
+ //# sourceMappingURL=errors.d.mts.map
@@ -0,0 +1,13 @@
1
+ //#region src/plugins/action/errors.ts
2
+ const actionError = (phase, parts) => ({
3
+ _tag: "ActionError",
4
+ phase,
5
+ ...parts
6
+ });
7
+ /** Error tags this plugin contributes — surfaced to the cause walker
8
+ * via `PluginErrorContribution`. */
9
+ const ACTION_ERROR_TAGS = ["ActionError"];
10
+ //#endregion
11
+ export { ACTION_ERROR_TAGS, actionError };
12
+
13
+ //# sourceMappingURL=errors.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.mjs","names":[],"sources":["../../../src/plugins/action/errors.ts"],"sourcesContent":["// Action plugin — typed errors.\n//\n// Distilled doc 16-action.md \"Failure modes\": signing failure routes\n// through `PublishError({ phase: 'publish-tx' })`. The rewrite splits\n// the user-facing action error from `package`'s `PublishError` because\n// action-specific phases (build, sign, parse) carry different semantics\n// — `build` here is the user-supplied transaction-builder Effect,\n// `sign` is the `signAndExecute` invocation, `parse` covers downstream\n// receipt projection.\n//\n// Per architecture §Effect, errors are plain interfaces with a `_tag`\n// discriminator; `Effect.catchTag` / `catchTags` match on the literal.\n\n/** Phases for `ActionError`. Closed sum — adding a phase requires\n * editing this file (and the plugin doc's catalog).\n *\n * Phase semantics:\n * - `discriminator` — `opts.discriminator` Effect evaluation failed.\n * User-code defect or yielded upstream raised.\n * - `build` — `opts.body`'s build phase (the user-supplied\n * Effect) failed before producing a transaction.\n * - `sign` — `signAndExecute` failed (gas, bytecode\n * verification, RPC).\n * - `parse` — the action's receipt projection (digest /\n * objectChanges) was malformed.\n * - `verify` — verify probe authoritatively raised (transient\n * is masked by the lenient probe — does NOT raise\n * this).\n */\nexport type ActionPhase = 'discriminator' | 'build' | 'sign' | 'parse' | 'verify';\n\n/** Single tagged action error. */\nexport interface ActionError {\n\treadonly _tag: 'ActionError';\n\treadonly phase: ActionPhase;\n\t/** Symbolic action name (the user-declared `action.name`). Flows\n\t * into the cache key namespace and the TUI row title. */\n\treadonly actionName: string;\n\treadonly message: string;\n\treadonly cause?: unknown;\n}\n\nexport const actionError = (\n\tphase: ActionPhase,\n\tparts: Omit<ActionError, '_tag' | 'phase'>,\n): ActionError => ({ _tag: 'ActionError', phase, ...parts });\n\n/** Error tags this plugin contributes — surfaced to the cause walker\n * via `PluginErrorContribution`. */\nexport const ACTION_ERROR_TAGS = ['ActionError'] as const;\n"],"mappings":";AA0CA,MAAa,eACZ,OACA,WACkB;CAAE,MAAM;CAAe;CAAO,GAAG;CAAO;;;AAI3D,MAAa,oBAAoB,CAAC,cAAc"}
@@ -0,0 +1,2 @@
1
+ import { Effect, Scope } from "effect";
2
+ import { Transaction } from "@mysten/sui/transactions";
@@ -0,0 +1,145 @@
1
+ import { buildForkImpersonationTransactionBytes } from "../sui/fork-transaction.mjs";
2
+ import { actionError } from "./errors.mjs";
3
+ import { Effect } from "effect";
4
+ import { Transaction } from "@mysten/sui/transactions";
5
+ //#region src/plugins/action/execute.ts
6
+ const projectAccountObjectChanges = (changes) => changes.filter((change) => typeof change === "object" && change !== null && typeof change.objectId === "string").map((change) => {
7
+ const entry = {
8
+ kind: change.type === "created" || change.kind === "created" ? "created" : "mutated",
9
+ objectId: change.objectId
10
+ };
11
+ if (typeof change.objectType === "string") entry.objectType = change.objectType;
12
+ if (typeof change.outputState === "string") entry.outputState = change.outputState;
13
+ if (typeof change.idOperation === "string") entry.idOperation = change.idOperation;
14
+ return entry;
15
+ });
16
+ const receiptFromAccountTx = (tx) => ({
17
+ digest: tx.digest,
18
+ objectChanges: projectAccountObjectChanges(tx.objectChanges),
19
+ balanceChanges: tx.balanceChanges
20
+ });
21
+ /** Drive the full build → sign → execute → wait → project pipeline.
22
+ *
23
+ * Allocates a fresh `Transaction`, sets the sender to the account's
24
+ * address, lets the caller populate it via the `build` callback,
25
+ * serialises via `Transaction.build({ client })`, signs via the
26
+ * account's transaction-signer scope, executes via the SDK's
27
+ * `executeTransaction` (with `include: { effects: true, objectTypes:
28
+ * true }` so the SDK surfaces `changedObjects` + types), waits for
29
+ * finality, and projects the envelope into an `ActionReceipt`.
30
+ *
31
+ * All failures surface as `ActionError`:
32
+ * - `build` callback throws → `phase: 'sign'` (matches the existing
33
+ * catch-all phase for body-side failures).
34
+ * - `Transaction.build` rejects → `phase: 'sign'`.
35
+ * - `signTransaction` rejects → `phase: 'sign'`.
36
+ * - `executeTransaction` rejects → `phase: 'sign'`.
37
+ * - SDK returns `FailedTransaction` → `phase: 'sign'`.
38
+ * - SDK returns no digest → `phase: 'parse'`.
39
+ * - `waitForTransaction` rejects → `phase: 'sign'`.
40
+ *
41
+ * The `actionName` parameter threads into every error's `actionName`
42
+ * field so cause-walker output stays attributable.
43
+ */
44
+ const signAndExecute = (params) => Effect.gen(function* () {
45
+ const { actionName, sui, account, build } = params;
46
+ return yield* account.withTransactionSigner((lockedSigner) => Effect.gen(function* () {
47
+ const tx = new Transaction();
48
+ tx.setSender(account.address);
49
+ yield* Effect.try({
50
+ try: () => build(tx),
51
+ catch: (cause) => actionError("sign", {
52
+ actionName,
53
+ message: `Action '${actionName}': build callback threw before serialisation.`,
54
+ cause
55
+ })
56
+ });
57
+ const txBytes = account.source === "impersonate" ? yield* buildForkImpersonationTransactionBytes(tx, account.address, sui.sdk.core).pipe(Effect.mapError((cause) => actionError("sign", {
58
+ actionName,
59
+ message: `Action '${actionName}': fork impersonation Transaction.build failed — ${cause.message}.`,
60
+ cause
61
+ }))) : yield* Effect.tryPromise({
62
+ try: () => tx.build({ client: sui.sdk.client }),
63
+ catch: (cause) => actionError("sign", {
64
+ actionName,
65
+ message: `Action '${actionName}': Transaction.build failed — ${cause instanceof Error ? cause.message : String(cause)}.`,
66
+ cause
67
+ })
68
+ });
69
+ if (account.source === "impersonate") return receiptFromAccountTx(yield* lockedSigner.signAndExecute(txBytes).pipe(Effect.mapError((cause) => actionError("sign", {
70
+ actionName,
71
+ message: `Action '${actionName}': account.signAndExecute failed for '${account.name}' (address=${account.address}): ${cause instanceof Error ? cause.message : String(cause)}`,
72
+ cause
73
+ }))));
74
+ const signed = yield* lockedSigner.signTransaction(txBytes).pipe(Effect.mapError((cause) => actionError("sign", {
75
+ actionName,
76
+ message: `Action '${actionName}': account.signTransaction failed for '${account.name}' (address=${account.address}): ${cause instanceof Error ? cause.message : String(cause)}`,
77
+ cause
78
+ })));
79
+ const sdkClient = sui.sdk.client;
80
+ const env = yield* Effect.tryPromise({
81
+ try: () => sdkClient.executeTransaction({
82
+ transaction: txBytes,
83
+ signatures: [signed.signature],
84
+ include: {
85
+ effects: true,
86
+ objectTypes: true
87
+ }
88
+ }),
89
+ catch: (cause) => actionError("sign", {
90
+ actionName,
91
+ message: `Action '${actionName}': executeTransaction failed — ` + (cause instanceof Error ? cause.message : String(cause)),
92
+ cause
93
+ })
94
+ });
95
+ if (env.$kind === "FailedTransaction") {
96
+ const failedDigest = env.FailedTransaction?.digest;
97
+ if (failedDigest !== void 0) yield* Effect.tryPromise({
98
+ try: () => sdkClient.waitForTransaction({ digest: failedDigest }),
99
+ catch: (cause) => actionError("sign", {
100
+ actionName,
101
+ message: `Action '${actionName}': waitForTransaction(${failedDigest}) failed.`,
102
+ cause
103
+ })
104
+ });
105
+ return yield* Effect.fail(actionError("sign", {
106
+ actionName,
107
+ message: `Action '${actionName}': FailedTransaction (digest=${env.FailedTransaction?.digest ?? "<unknown>"}): ${env.FailedTransaction?.status?.error ?? "<no error>"}`
108
+ }));
109
+ }
110
+ const txOk = env.Transaction;
111
+ if (txOk?.digest === void 0) return yield* Effect.fail(actionError("parse", {
112
+ actionName,
113
+ message: `Action '${actionName}': executeTransaction returned no digest.`
114
+ }));
115
+ yield* Effect.tryPromise({
116
+ try: () => sdkClient.waitForTransaction({ digest: txOk.digest }),
117
+ catch: (cause) => actionError("sign", {
118
+ actionName,
119
+ message: `Action '${actionName}': waitForTransaction(${txOk.digest}) failed.`,
120
+ cause
121
+ })
122
+ });
123
+ const objectTypes = txOk.objectTypes ?? {};
124
+ const objectChanges = (txOk.effects?.changedObjects ?? []).filter((c) => typeof c.objectId === "string").map((c) => {
125
+ const objectType = objectTypes[c.objectId];
126
+ const entry = {
127
+ kind: c.idOperation === "Created" ? "created" : "mutated",
128
+ objectId: c.objectId
129
+ };
130
+ if (objectType !== void 0) entry.objectType = objectType;
131
+ if (c.outputState !== void 0) entry.outputState = c.outputState;
132
+ if (c.idOperation !== void 0) entry.idOperation = c.idOperation;
133
+ return entry;
134
+ });
135
+ return {
136
+ digest: txOk.digest,
137
+ objectChanges,
138
+ balanceChanges: []
139
+ };
140
+ }));
141
+ }).pipe(Effect.withSpan("devstack.plugin.action.signAndExecute", { attributes: { "action.name": params.actionName } }));
142
+ //#endregion
143
+ export { signAndExecute };
144
+
145
+ //# sourceMappingURL=execute.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execute.mjs","names":[],"sources":["../../../src/plugins/action/execute.ts"],"sourcesContent":["// Action plugin — `signAndExecute` helper.\n//\n// This module encapsulates the \"build → sign → execute → wait → project\"\n// roundtrip that every action body needs to perform a Move call against\n// the booted Sui chain. Without it, every action body re-implements the\n// SDK boundary cast on `sdk.client.executeTransaction` + the SDK envelope\n// projection + the post-submit `waitForTransaction` gate.\n//\n// The same wiring lives in `plugins/package/publish-executor.ts` — both\n// sites cast the opaque `sdk.client` to call `executeTransaction({\n// include: { effects: true, objectTypes: true }})` so they recover\n// `changedObjects` + their fully-qualified types. Both run through the\n// Account plugin's transaction-signer scope so `Transaction.build`,\n// signing, execute, and finality wait serialize per address.\n//\n// What this helper extracts: the SDK-envelope projection + the\n// finality-wait. Per call sites:\n//\n// - The user supplies a `build(tx)` callback that populates the\n// `Transaction` synchronously (moveCalls, transferObjects, etc.).\n// - The user supplies the signing `account` (an `AccountValue` from\n// the action's resolved dependency values); we sign with the\n// locked transaction signer and drive the SDK's\n// `executeTransaction` directly.\n// - The helper returns an `ActionReceipt` projection: `{ digest,\n// objectChanges }`. The `objectChanges` array is shaped uniformly so\n// downstream consumers can pick by `objectType` substring.\n//\n// All failures route through `ActionError` (phase: `sign` for transport\n// / RPC failures; `parse` for \"no digest\" / \"wrong envelope shape\"\n// situations). The action plugin's outer wrap collapses these into the\n// substrate's artifact publisher `produce-failed` channel.\n\nimport { Effect, type Scope } from 'effect';\n\nimport { Transaction } from '@mysten/sui/transactions';\n\nimport type { AccountValue, TxResult } from '../account/service.ts';\nimport type { SuiClient } from '../sui/index.ts';\nimport { buildForkImpersonationTransactionBytes } from '../sui/fork-transaction.ts';\n\nimport { actionError, type ActionError } from './errors.ts';\nimport type { ActionReceipt } from './service.ts';\n\n// ---------------------------------------------------------------------------\n// Receipt object-change projection\n// ---------------------------------------------------------------------------\n\n/** Flat object-change record surfaced on an `ActionReceipt`. Mirrors\n * the package plugin's `PublishObjectChange` shape so consumers can\n * reuse `findCreatedByType`-style helpers across the two surfaces.\n *\n * - `kind`: 'created' when `idOperation === 'Created'`, else 'mutated'\n * (we expose the same two buckets the package plugin uses; finer\n * distinctions are recoverable from the raw `idOperation` /\n * `outputState` fields preserved alongside).\n * - `objectType`: optional fully-qualified type string\n * (`<packageId>::<module>::<Name>`) — present when the SDK's\n * `objectTypes` map carries the id. */\nexport interface ActionObjectChange {\n\treadonly kind: 'created' | 'mutated';\n\treadonly objectId: string;\n\treadonly objectType?: string;\n\treadonly outputState?: string;\n\treadonly idOperation?: string;\n}\n\n// ---------------------------------------------------------------------------\n// SDK shape — kept narrow, mirrors the cast in publish-executor.ts\n// ---------------------------------------------------------------------------\n\ninterface SdkExecuteClient {\n\treadonly executeTransaction: (args: {\n\t\treadonly transaction: Uint8Array;\n\t\treadonly signatures: ReadonlyArray<string>;\n\t\treadonly include?: {\n\t\t\treadonly effects?: boolean;\n\t\t\treadonly objectTypes?: boolean;\n\t\t};\n\t}) => Promise<unknown>;\n\treadonly waitForTransaction: (args: {\n\t\treadonly digest: string;\n\t\treadonly include?: { readonly effects?: boolean };\n\t\treadonly timeout?: number;\n\t}) => Promise<unknown>;\n}\n\ninterface RawExecuteEnvelope {\n\treadonly $kind?: 'Transaction' | 'FailedTransaction';\n\treadonly Transaction?: {\n\t\treadonly digest?: string;\n\t\treadonly effects?: {\n\t\t\treadonly changedObjects?: ReadonlyArray<{\n\t\t\t\treadonly objectId?: string;\n\t\t\t\treadonly outputState?: string;\n\t\t\t\treadonly idOperation?: string;\n\t\t\t}>;\n\t\t};\n\t\treadonly objectTypes?: Readonly<Record<string, string>>;\n\t};\n\treadonly FailedTransaction?: {\n\t\treadonly digest?: string;\n\t\treadonly status?: { readonly error?: string };\n\t};\n}\n\nconst projectAccountObjectChanges = (\n\tchanges: ReadonlyArray<unknown>,\n): ReadonlyArray<ActionObjectChange> =>\n\tchanges\n\t\t.filter(\n\t\t\t(\n\t\t\t\tchange,\n\t\t\t): change is {\n\t\t\t\treadonly type?: string;\n\t\t\t\treadonly kind?: string;\n\t\t\t\treadonly objectId: string;\n\t\t\t\treadonly objectType?: string;\n\t\t\t\treadonly outputState?: string;\n\t\t\t\treadonly idOperation?: string;\n\t\t\t} =>\n\t\t\t\ttypeof change === 'object' &&\n\t\t\t\tchange !== null &&\n\t\t\t\ttypeof (change as { readonly objectId?: unknown }).objectId === 'string',\n\t\t)\n\t\t.map((change) => {\n\t\t\tconst entry: {\n\t\t\t\t-readonly [K in keyof ActionObjectChange]: ActionObjectChange[K];\n\t\t\t} = {\n\t\t\t\tkind: change.type === 'created' || change.kind === 'created' ? 'created' : 'mutated',\n\t\t\t\tobjectId: change.objectId,\n\t\t\t};\n\t\t\tif (typeof change.objectType === 'string') entry.objectType = change.objectType;\n\t\t\tif (typeof change.outputState === 'string') entry.outputState = change.outputState;\n\t\t\tif (typeof change.idOperation === 'string') entry.idOperation = change.idOperation;\n\t\t\treturn entry;\n\t\t});\n\nconst receiptFromAccountTx = (tx: TxResult): ActionReceipt => ({\n\tdigest: tx.digest,\n\tobjectChanges: projectAccountObjectChanges(tx.objectChanges),\n\tbalanceChanges: tx.balanceChanges,\n});\n\n// ---------------------------------------------------------------------------\n// `signAndExecute` helper\n// ---------------------------------------------------------------------------\n\n/** Drive the full build → sign → execute → wait → project pipeline.\n *\n * Allocates a fresh `Transaction`, sets the sender to the account's\n * address, lets the caller populate it via the `build` callback,\n * serialises via `Transaction.build({ client })`, signs via the\n * account's transaction-signer scope, executes via the SDK's\n * `executeTransaction` (with `include: { effects: true, objectTypes:\n * true }` so the SDK surfaces `changedObjects` + types), waits for\n * finality, and projects the envelope into an `ActionReceipt`.\n *\n * All failures surface as `ActionError`:\n * - `build` callback throws → `phase: 'sign'` (matches the existing\n * catch-all phase for body-side failures).\n * - `Transaction.build` rejects → `phase: 'sign'`.\n * - `signTransaction` rejects → `phase: 'sign'`.\n * - `executeTransaction` rejects → `phase: 'sign'`.\n * - SDK returns `FailedTransaction` → `phase: 'sign'`.\n * - SDK returns no digest → `phase: 'parse'`.\n * - `waitForTransaction` rejects → `phase: 'sign'`.\n *\n * The `actionName` parameter threads into every error's `actionName`\n * field so cause-walker output stays attributable.\n */\nexport const signAndExecute = (params: {\n\treadonly actionName: string;\n\treadonly sui: SuiClient;\n\treadonly account: AccountValue;\n\treadonly build: (tx: Transaction) => void;\n}): Effect.Effect<ActionReceipt, ActionError, Scope.Scope> =>\n\tEffect.gen(function* () {\n\t\tconst { actionName, sui, account, build } = params;\n\t\treturn yield* account.withTransactionSigner((lockedSigner) =>\n\t\t\tEffect.gen(function* () {\n\t\t\t\t// --- 1. Allocate + populate the Transaction ------------------\n\t\t\t\tconst tx = new Transaction();\n\t\t\t\ttx.setSender(account.address);\n\t\t\t\tyield* Effect.try({\n\t\t\t\t\ttry: () => build(tx),\n\t\t\t\t\tcatch: (cause): ActionError =>\n\t\t\t\t\t\tactionError('sign', {\n\t\t\t\t\t\t\tactionName,\n\t\t\t\t\t\t\tmessage: `Action '${actionName}': build callback threw before serialisation.`,\n\t\t\t\t\t\t\tcause,\n\t\t\t\t\t\t}),\n\t\t\t\t});\n\n\t\t\t\t// --- 2. Serialise via the mode-appropriate path --------------\n\t\t\t\tconst txBytes =\n\t\t\t\t\taccount.source === 'impersonate'\n\t\t\t\t\t\t? yield* buildForkImpersonationTransactionBytes(tx, account.address, sui.sdk.core).pipe(\n\t\t\t\t\t\t\t\tEffect.mapError(\n\t\t\t\t\t\t\t\t\t(cause): ActionError =>\n\t\t\t\t\t\t\t\t\t\tactionError('sign', {\n\t\t\t\t\t\t\t\t\t\t\tactionName,\n\t\t\t\t\t\t\t\t\t\t\tmessage: `Action '${actionName}': fork impersonation Transaction.build failed — ${cause.message}.`,\n\t\t\t\t\t\t\t\t\t\t\tcause,\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t: yield* Effect.tryPromise({\n\t\t\t\t\t\t\t\ttry: () =>\n\t\t\t\t\t\t\t\t\ttx.build({\n\t\t\t\t\t\t\t\t\t\tclient: sui.sdk.client as Parameters<typeof tx.build>[0] extends\n\t\t\t\t\t\t\t\t\t\t\t| { client?: infer C }\n\t\t\t\t\t\t\t\t\t\t\t| undefined\n\t\t\t\t\t\t\t\t\t\t\t? C\n\t\t\t\t\t\t\t\t\t\t\t: never,\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\tcatch: (cause): ActionError =>\n\t\t\t\t\t\t\t\t\tactionError('sign', {\n\t\t\t\t\t\t\t\t\t\tactionName,\n\t\t\t\t\t\t\t\t\t\tmessage: `Action '${actionName}': Transaction.build failed — ${\n\t\t\t\t\t\t\t\t\t\t\tcause instanceof Error ? cause.message : String(cause)\n\t\t\t\t\t\t\t\t\t\t}.`,\n\t\t\t\t\t\t\t\t\t\tcause,\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t});\n\n\t\t\t\tif (account.source === 'impersonate') {\n\t\t\t\t\tconst executed = yield* lockedSigner.signAndExecute(txBytes).pipe(\n\t\t\t\t\t\tEffect.mapError(\n\t\t\t\t\t\t\t(cause): ActionError =>\n\t\t\t\t\t\t\t\tactionError('sign', {\n\t\t\t\t\t\t\t\t\tactionName,\n\t\t\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t\t\t`Action '${actionName}': account.signAndExecute failed for ` +\n\t\t\t\t\t\t\t\t\t\t`'${account.name}' (address=${account.address}): ${\n\t\t\t\t\t\t\t\t\t\t\tcause instanceof Error ? cause.message : String(cause)\n\t\t\t\t\t\t\t\t\t\t}`,\n\t\t\t\t\t\t\t\t\tcause,\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t\treturn receiptFromAccountTx(executed);\n\t\t\t\t}\n\n\t\t\t\t// --- 3. Sign with the account -------------------------------\n\t\t\t\tconst signed = yield* lockedSigner.signTransaction(txBytes).pipe(\n\t\t\t\t\tEffect.mapError(\n\t\t\t\t\t\t(cause): ActionError =>\n\t\t\t\t\t\t\tactionError('sign', {\n\t\t\t\t\t\t\t\tactionName,\n\t\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t\t`Action '${actionName}': account.signTransaction failed for ` +\n\t\t\t\t\t\t\t\t\t`'${account.name}' (address=${account.address}): ${\n\t\t\t\t\t\t\t\t\t\tcause instanceof Error ? cause.message : String(cause)\n\t\t\t\t\t\t\t\t\t}`,\n\t\t\t\t\t\t\t\tcause,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t),\n\t\t\t\t);\n\n\t\t\t\t// --- 4. Execute via the SDK (with effects+objectTypes) ------\n\t\t\t\tconst sdkClient = sui.sdk.client as SdkExecuteClient;\n\t\t\t\tconst raw = yield* Effect.tryPromise({\n\t\t\t\t\ttry: () =>\n\t\t\t\t\t\tsdkClient.executeTransaction({\n\t\t\t\t\t\t\ttransaction: txBytes,\n\t\t\t\t\t\t\tsignatures: [signed.signature],\n\t\t\t\t\t\t\tinclude: { effects: true, objectTypes: true },\n\t\t\t\t\t\t}),\n\t\t\t\t\tcatch: (cause): ActionError =>\n\t\t\t\t\t\tactionError('sign', {\n\t\t\t\t\t\t\tactionName,\n\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t`Action '${actionName}': executeTransaction failed — ` +\n\t\t\t\t\t\t\t\t(cause instanceof Error ? cause.message : String(cause)),\n\t\t\t\t\t\t\tcause,\n\t\t\t\t\t\t}),\n\t\t\t\t});\n\n\t\t\t\t// --- 5. Project the envelope --------------------------------\n\t\t\t\tconst env = raw as RawExecuteEnvelope;\n\t\t\t\tif (env.$kind === 'FailedTransaction') {\n\t\t\t\t\tconst failedDigest = env.FailedTransaction?.digest;\n\t\t\t\t\tif (failedDigest !== undefined) {\n\t\t\t\t\t\tyield* Effect.tryPromise({\n\t\t\t\t\t\t\ttry: () => sdkClient.waitForTransaction({ digest: failedDigest }),\n\t\t\t\t\t\t\tcatch: (cause): ActionError =>\n\t\t\t\t\t\t\t\tactionError('sign', {\n\t\t\t\t\t\t\t\t\tactionName,\n\t\t\t\t\t\t\t\t\tmessage: `Action '${actionName}': waitForTransaction(${failedDigest}) failed.`,\n\t\t\t\t\t\t\t\t\tcause,\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\treturn yield* Effect.fail(\n\t\t\t\t\t\tactionError('sign', {\n\t\t\t\t\t\t\tactionName,\n\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t`Action '${actionName}': FailedTransaction ` +\n\t\t\t\t\t\t\t\t`(digest=${env.FailedTransaction?.digest ?? '<unknown>'}): ` +\n\t\t\t\t\t\t\t\t`${env.FailedTransaction?.status?.error ?? '<no error>'}`,\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tconst txOk = env.Transaction;\n\t\t\t\tif (txOk?.digest === undefined) {\n\t\t\t\t\treturn yield* Effect.fail(\n\t\t\t\t\t\tactionError('parse', {\n\t\t\t\t\t\t\tactionName,\n\t\t\t\t\t\t\tmessage: `Action '${actionName}': executeTransaction returned no digest.`,\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// --- 6. Wait for finality -----------------------------------\n\t\t\t\tyield* Effect.tryPromise({\n\t\t\t\t\ttry: () => sdkClient.waitForTransaction({ digest: txOk.digest! }),\n\t\t\t\t\tcatch: (cause): ActionError =>\n\t\t\t\t\t\tactionError('sign', {\n\t\t\t\t\t\t\tactionName,\n\t\t\t\t\t\t\tmessage: `Action '${actionName}': waitForTransaction(${txOk.digest}) failed.`,\n\t\t\t\t\t\t\tcause,\n\t\t\t\t\t\t}),\n\t\t\t\t});\n\n\t\t\t\t// --- 7. Project changedObjects into the receipt's objectChanges\n\t\t\t\tconst objectTypes = txOk.objectTypes ?? {};\n\t\t\t\tconst objectChanges: ReadonlyArray<ActionObjectChange> = (\n\t\t\t\t\ttxOk.effects?.changedObjects ?? []\n\t\t\t\t)\n\t\t\t\t\t.filter(\n\t\t\t\t\t\t(c): c is { objectId: string; outputState?: string; idOperation?: string } =>\n\t\t\t\t\t\t\ttypeof c.objectId === 'string',\n\t\t\t\t\t)\n\t\t\t\t\t.map((c) => {\n\t\t\t\t\t\tconst objectType = objectTypes[c.objectId];\n\t\t\t\t\t\tconst entry: {\n\t\t\t\t\t\t\t-readonly [K in keyof ActionObjectChange]: ActionObjectChange[K];\n\t\t\t\t\t\t} = {\n\t\t\t\t\t\t\tkind: c.idOperation === 'Created' ? 'created' : 'mutated',\n\t\t\t\t\t\t\tobjectId: c.objectId,\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (objectType !== undefined) entry.objectType = objectType;\n\t\t\t\t\t\tif (c.outputState !== undefined) entry.outputState = c.outputState;\n\t\t\t\t\t\tif (c.idOperation !== undefined) entry.idOperation = c.idOperation;\n\t\t\t\t\t\treturn entry;\n\t\t\t\t\t});\n\n\t\t\t\tconst receipt: ActionReceipt = {\n\t\t\t\t\tdigest: txOk.digest,\n\t\t\t\t\tobjectChanges,\n\t\t\t\t\tbalanceChanges: [],\n\t\t\t\t};\n\t\t\t\treturn receipt;\n\t\t\t}),\n\t\t);\n\t}).pipe(\n\t\tEffect.withSpan('devstack.plugin.action.signAndExecute', {\n\t\t\tattributes: { 'action.name': params.actionName },\n\t\t}),\n\t);\n"],"mappings":";;;;;AA0GA,MAAM,+BACL,YAEA,QACE,QAEC,WASA,OAAO,WAAW,YAClB,WAAW,QACX,OAAQ,OAA2C,aAAa,SACjE,CACA,KAAK,WAAW;CAChB,MAAM,QAEF;EACH,MAAM,OAAO,SAAS,aAAa,OAAO,SAAS,YAAY,YAAY;EAC3E,UAAU,OAAO;EACjB;AACD,KAAI,OAAO,OAAO,eAAe,SAAU,OAAM,aAAa,OAAO;AACrE,KAAI,OAAO,OAAO,gBAAgB,SAAU,OAAM,cAAc,OAAO;AACvE,KAAI,OAAO,OAAO,gBAAgB,SAAU,OAAM,cAAc,OAAO;AACvE,QAAO;EACN;AAEJ,MAAM,wBAAwB,QAAiC;CAC9D,QAAQ,GAAG;CACX,eAAe,4BAA4B,GAAG,cAAc;CAC5D,gBAAgB,GAAG;CACnB;;;;;;;;;;;;;;;;;;;;;;;;AA6BD,MAAa,kBAAkB,WAM9B,OAAO,IAAI,aAAa;CACvB,MAAM,EAAE,YAAY,KAAK,SAAS,UAAU;AAC5C,QAAO,OAAO,QAAQ,uBAAuB,iBAC5C,OAAO,IAAI,aAAa;EAEvB,MAAM,KAAK,IAAI,aAAa;AAC5B,KAAG,UAAU,QAAQ,QAAQ;AAC7B,SAAO,OAAO,IAAI;GACjB,WAAW,MAAM,GAAG;GACpB,QAAQ,UACP,YAAY,QAAQ;IACnB;IACA,SAAS,WAAW,WAAW;IAC/B;IACA,CAAC;GACH,CAAC;EAGF,MAAM,UACL,QAAQ,WAAW,gBAChB,OAAO,uCAAuC,IAAI,QAAQ,SAAS,IAAI,IAAI,KAAK,CAAC,KACjF,OAAO,UACL,UACA,YAAY,QAAQ;GACnB;GACA,SAAS,WAAW,WAAW,mDAAmD,MAAM,QAAQ;GAChG;GACA,CAAC,CACH,CACD,GACA,OAAO,OAAO,WAAW;GACzB,WACC,GAAG,MAAM,EACR,QAAQ,IAAI,IAAI,QAKhB,CAAC;GACH,QAAQ,UACP,YAAY,QAAQ;IACnB;IACA,SAAS,WAAW,WAAW,gCAC9B,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM,CACtD;IACD;IACA,CAAC;GACH,CAAC;AAEL,MAAI,QAAQ,WAAW,cAetB,QAAO,qBAAqB,OAdJ,aAAa,eAAe,QAAQ,CAAC,KAC5D,OAAO,UACL,UACA,YAAY,QAAQ;GACnB;GACA,SACC,WAAW,WAAW,wCAClB,QAAQ,KAAK,aAAa,QAAQ,QAAQ,KAC7C,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM;GAExD;GACA,CAAC,CACH,CACD,CACoC;EAItC,MAAM,SAAS,OAAO,aAAa,gBAAgB,QAAQ,CAAC,KAC3D,OAAO,UACL,UACA,YAAY,QAAQ;GACnB;GACA,SACC,WAAW,WAAW,yCAClB,QAAQ,KAAK,aAAa,QAAQ,QAAQ,KAC7C,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM;GAExD;GACA,CAAC,CACH,CACD;EAGD,MAAM,YAAY,IAAI,IAAI;EAmB1B,MAAM,MAAM,OAlBO,OAAO,WAAW;GACpC,WACC,UAAU,mBAAmB;IAC5B,aAAa;IACb,YAAY,CAAC,OAAO,UAAU;IAC9B,SAAS;KAAE,SAAS;KAAM,aAAa;KAAM;IAC7C,CAAC;GACH,QAAQ,UACP,YAAY,QAAQ;IACnB;IACA,SACC,WAAW,WAAW,oCACrB,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM;IACxD;IACA,CAAC;GACH,CAAC;AAIF,MAAI,IAAI,UAAU,qBAAqB;GACtC,MAAM,eAAe,IAAI,mBAAmB;AAC5C,OAAI,iBAAiB,KAAA,EACpB,QAAO,OAAO,WAAW;IACxB,WAAW,UAAU,mBAAmB,EAAE,QAAQ,cAAc,CAAC;IACjE,QAAQ,UACP,YAAY,QAAQ;KACnB;KACA,SAAS,WAAW,WAAW,wBAAwB,aAAa;KACpE;KACA,CAAC;IACH,CAAC;AAEH,UAAO,OAAO,OAAO,KACpB,YAAY,QAAQ;IACnB;IACA,SACC,WAAW,WAAW,+BACX,IAAI,mBAAmB,UAAU,YAAY,KACrD,IAAI,mBAAmB,QAAQ,SAAS;IAC5C,CAAC,CACF;;EAEF,MAAM,OAAO,IAAI;AACjB,MAAI,MAAM,WAAW,KAAA,EACpB,QAAO,OAAO,OAAO,KACpB,YAAY,SAAS;GACpB;GACA,SAAS,WAAW,WAAW;GAC/B,CAAC,CACF;AAIF,SAAO,OAAO,WAAW;GACxB,WAAW,UAAU,mBAAmB,EAAE,QAAQ,KAAK,QAAS,CAAC;GACjE,QAAQ,UACP,YAAY,QAAQ;IACnB;IACA,SAAS,WAAW,WAAW,wBAAwB,KAAK,OAAO;IACnE;IACA,CAAC;GACH,CAAC;EAGF,MAAM,cAAc,KAAK,eAAe,EAAE;EAC1C,MAAM,iBACL,KAAK,SAAS,kBAAkB,EAAE,EAEjC,QACC,MACA,OAAO,EAAE,aAAa,SACvB,CACA,KAAK,MAAM;GACX,MAAM,aAAa,YAAY,EAAE;GACjC,MAAM,QAEF;IACH,MAAM,EAAE,gBAAgB,YAAY,YAAY;IAChD,UAAU,EAAE;IACZ;AACD,OAAI,eAAe,KAAA,EAAW,OAAM,aAAa;AACjD,OAAI,EAAE,gBAAgB,KAAA,EAAW,OAAM,cAAc,EAAE;AACvD,OAAI,EAAE,gBAAgB,KAAA,EAAW,OAAM,cAAc,EAAE;AACvD,UAAO;IACN;AAOH,SAAO;GAJN,QAAQ,KAAK;GACb;GACA,gBAAgB,EAAE;GAEL;GACb,CACF;EACA,CAAC,KACF,OAAO,SAAS,yCAAyC,EACxD,YAAY,EAAE,eAAe,OAAO,YAAY,EAChD,CAAC,CACF"}