@mysten-incubation/devstack 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (858) hide show
  1. package/README.md +6 -3
  2. package/dashboard-ui/assets/grpc-a4usE3Nk.js +3 -0
  3. package/dashboard-ui/assets/index-B82Bh84P.css +1 -0
  4. package/dashboard-ui/assets/index-CRYJ4pru.js +1277 -0
  5. package/dashboard-ui/index.html +2 -2
  6. package/dist/api/define-capabilities.d.mts +1 -20
  7. package/dist/api/define-capabilities.mjs +15 -22
  8. package/dist/api/define-capabilities.mjs.map +1 -1
  9. package/dist/api/define-devstack-with.d.mts +7 -1
  10. package/dist/api/define-devstack-with.mjs.map +1 -1
  11. package/dist/api/define-devstack.mjs.map +1 -1
  12. package/dist/api/define-plugin.d.mts +2 -1
  13. package/dist/api/inference-network.d.mts +31 -17
  14. package/dist/api/inference-network.mjs +40 -43
  15. package/dist/api/inference-network.mjs.map +1 -1
  16. package/dist/api/load-config.mjs +88 -0
  17. package/dist/api/load-config.mjs.map +1 -0
  18. package/dist/api/mode-narrowed-factory.d.mts +1 -1
  19. package/dist/api/mode-narrowed-factory.mjs.map +1 -1
  20. package/dist/api/run-stack-internal.mjs +202 -0
  21. package/dist/api/run-stack-internal.mjs.map +1 -0
  22. package/dist/api/run-stack.d.mts +82 -31
  23. package/dist/api/run-stack.mjs +22 -141
  24. package/dist/api/run-stack.mjs.map +1 -1
  25. package/dist/build-integrations/dapp-kit/index.d.mts +61 -0
  26. package/dist/build-integrations/dapp-kit/index.mjs +58 -0
  27. package/dist/build-integrations/dapp-kit/index.mjs.map +1 -0
  28. package/dist/build-integrations/playwright/config.d.mts +1 -30
  29. package/dist/build-integrations/playwright/config.mjs +1 -27
  30. package/dist/build-integrations/playwright/config.mjs.map +1 -1
  31. package/dist/build-integrations/playwright/errors.d.mts +4 -7
  32. package/dist/build-integrations/playwright/errors.mjs.map +1 -1
  33. package/dist/build-integrations/playwright/global-setup.d.mts +42 -71
  34. package/dist/build-integrations/playwright/global-setup.mjs +142 -218
  35. package/dist/build-integrations/playwright/global-setup.mjs.map +1 -1
  36. package/dist/build-integrations/playwright/index.d.mts +2 -2
  37. package/dist/build-integrations/playwright/index.mjs +2 -2
  38. package/dist/build-integrations/playwright/stack-context.d.mts +3 -1
  39. package/dist/build-integrations/playwright/stack-context.mjs +4 -2
  40. package/dist/build-integrations/playwright/stack-context.mjs.map +1 -1
  41. package/dist/build-integrations/playwright/wallet-context.mjs +44 -19
  42. package/dist/build-integrations/playwright/wallet-context.mjs.map +1 -1
  43. package/dist/build-integrations/runtime/cold-start-url.mjs.map +1 -1
  44. package/dist/build-integrations/runtime/conventional-routes.mjs.map +1 -1
  45. package/dist/build-integrations/runtime/dapp-kit-slot.mjs.map +1 -1
  46. package/dist/build-integrations/runtime/discover.d.mts +6 -4
  47. package/dist/build-integrations/runtime/discover.mjs +15 -4
  48. package/dist/build-integrations/runtime/discover.mjs.map +1 -1
  49. package/dist/build-integrations/runtime/endpoint-registry.mjs.map +1 -1
  50. package/dist/build-integrations/runtime/errors.mjs.map +1 -1
  51. package/dist/build-integrations/runtime/read-stack-context.mjs +3 -3
  52. package/dist/build-integrations/runtime/read-stack-context.mjs.map +1 -1
  53. package/dist/build-integrations/runtime/resolve-discovery-env.d.mts +23 -7
  54. package/dist/build-integrations/runtime/resolve-discovery-env.mjs +25 -12
  55. package/dist/build-integrations/runtime/resolve-discovery-env.mjs.map +1 -1
  56. package/dist/build-integrations/runtime/stack-context.d.mts +2 -2
  57. package/dist/build-integrations/vite/index.d.mts +84 -19
  58. package/dist/build-integrations/vite/index.mjs +203 -28
  59. package/dist/build-integrations/vite/index.mjs.map +1 -1
  60. package/dist/build-integrations/vitest/config.d.mts +20 -2
  61. package/dist/build-integrations/vitest/config.mjs +16 -4
  62. package/dist/build-integrations/vitest/config.mjs.map +1 -1
  63. package/dist/build-integrations/vitest/env.d.mts +18 -10
  64. package/dist/build-integrations/vitest/env.mjs +11 -10
  65. package/dist/build-integrations/vitest/env.mjs.map +1 -1
  66. package/dist/build-integrations/vitest/errors.d.mts +7 -11
  67. package/dist/build-integrations/vitest/errors.mjs +3 -4
  68. package/dist/build-integrations/vitest/errors.mjs.map +1 -1
  69. package/dist/build-integrations/vitest/global-setup.d.mts +35 -0
  70. package/dist/build-integrations/vitest/global-setup.mjs +156 -0
  71. package/dist/build-integrations/vitest/global-setup.mjs.map +1 -0
  72. package/dist/build-integrations/vitest/index.d.mts +3 -2
  73. package/dist/build-integrations/vitest/index.mjs +3 -2
  74. package/dist/build-integrations/vitest/setup.mjs +2 -2
  75. package/dist/build-integrations/vitest/setup.mjs.map +1 -1
  76. package/dist/build-integrations/vitest/stack-context.d.mts +5 -3
  77. package/dist/build-integrations/vitest/stack-context.mjs +3 -2
  78. package/dist/build-integrations/vitest/stack-context.mjs.map +1 -1
  79. package/dist/cli/bail.mjs.map +1 -1
  80. package/dist/cli/doctor-probes.mjs +1 -3
  81. package/dist/cli/doctor-probes.mjs.map +1 -1
  82. package/dist/cli/main.d.mts +23 -1
  83. package/dist/cli/main.mjs +63 -8
  84. package/dist/cli/main.mjs.map +1 -1
  85. package/dist/cli/prune-direct.mjs.map +1 -1
  86. package/dist/cli/snapshot-reader.mjs.map +1 -1
  87. package/dist/cli/up-lifecycle.mjs.map +1 -1
  88. package/dist/cli/wirings/apply.mjs +28 -21
  89. package/dist/cli/wirings/apply.mjs.map +1 -1
  90. package/dist/cli/wirings/codegen.mjs +108 -0
  91. package/dist/cli/wirings/codegen.mjs.map +1 -0
  92. package/dist/cli/wirings/config-loader.mjs +12 -62
  93. package/dist/cli/wirings/config-loader.mjs.map +1 -1
  94. package/dist/cli/wirings/dump-ids.mjs +86 -0
  95. package/dist/cli/wirings/dump-ids.mjs.map +1 -0
  96. package/dist/cli/wirings/engine-command.mjs +1 -1
  97. package/dist/cli/wirings/engine-command.mjs.map +1 -1
  98. package/dist/cli/wirings/identity.mjs +2 -2
  99. package/dist/cli/wirings/identity.mjs.map +1 -1
  100. package/dist/cli/wirings/provide-file-system.mjs.map +1 -1
  101. package/dist/cli/wirings/read-devstack-version.mjs +17 -0
  102. package/dist/cli/wirings/read-devstack-version.mjs.map +1 -0
  103. package/dist/cli/wirings/snapshot.mjs +27 -34
  104. package/dist/cli/wirings/snapshot.mjs.map +1 -1
  105. package/dist/cli/wirings/up-ipc.mjs +147 -0
  106. package/dist/cli/wirings/up-ipc.mjs.map +1 -0
  107. package/dist/cli/wirings/up.mjs +218 -198
  108. package/dist/cli/wirings/up.mjs.map +1 -1
  109. package/dist/cli/wirings/wipe.mjs +1 -1
  110. package/dist/cli/wirings/wipe.mjs.map +1 -1
  111. package/dist/contracts/chain-probe.d.mts +1 -1
  112. package/dist/contracts/chain-probe.mjs +1 -1
  113. package/dist/contracts/chain-probe.mjs.map +1 -1
  114. package/dist/contracts/codegenable.d.mts +60 -6
  115. package/dist/contracts/codegenable.mjs +28 -0
  116. package/dist/contracts/codegenable.mjs.map +1 -0
  117. package/dist/contracts/config-bindings.mjs +162 -0
  118. package/dist/contracts/config-bindings.mjs.map +1 -0
  119. package/dist/contracts/container-runtime.d.mts +23 -17
  120. package/dist/contracts/plugin-expander.mjs.map +1 -1
  121. package/dist/contracts/snapshotable.d.mts +5 -7
  122. package/dist/contracts/wallet-protocol.d.mts +2 -5
  123. package/dist/contracts/wallet-protocol.mjs +2 -5
  124. package/dist/contracts/wallet-protocol.mjs.map +1 -1
  125. package/dist/index.d.mts +21 -26
  126. package/dist/index.mjs +8 -9
  127. package/dist/orchestrators/boot.d.mts +28 -0
  128. package/dist/orchestrators/boot.mjs +440 -0
  129. package/dist/orchestrators/boot.mjs.map +1 -0
  130. package/dist/orchestrators/codegen/bindings.d.mts +13 -1
  131. package/dist/orchestrators/codegen/bindings.mjs +23 -9
  132. package/dist/orchestrators/codegen/bindings.mjs.map +1 -1
  133. package/dist/orchestrators/codegen/config-runtime.mjs +208 -0
  134. package/dist/orchestrators/codegen/config-runtime.mjs.map +1 -0
  135. package/dist/orchestrators/codegen/emit.mjs +1 -1
  136. package/dist/orchestrators/codegen/emit.mjs.map +1 -1
  137. package/dist/orchestrators/codegen/errors.mjs +21 -1
  138. package/dist/orchestrators/codegen/errors.mjs.map +1 -1
  139. package/dist/orchestrators/codegen/format.mjs +2 -0
  140. package/dist/orchestrators/codegen/format.mjs.map +1 -1
  141. package/dist/orchestrators/codegen/gitignore.mjs +30 -11
  142. package/dist/orchestrators/codegen/gitignore.mjs.map +1 -1
  143. package/dist/orchestrators/codegen/id-config.mjs +107 -0
  144. package/dist/orchestrators/codegen/id-config.mjs.map +1 -0
  145. package/dist/orchestrators/codegen/output-location.mjs +23 -32
  146. package/dist/orchestrators/codegen/output-location.mjs.map +1 -1
  147. package/dist/orchestrators/codegen/paths.mjs +8 -1
  148. package/dist/orchestrators/codegen/paths.mjs.map +1 -1
  149. package/dist/orchestrators/codegen/permissions.mjs.map +1 -1
  150. package/dist/orchestrators/codegen/service.mjs +286 -58
  151. package/dist/orchestrators/codegen/service.mjs.map +1 -1
  152. package/dist/orchestrators/layers.mjs +31 -0
  153. package/dist/orchestrators/layers.mjs.map +1 -0
  154. package/dist/orchestrators/lifecycle-prune/errors.mjs.map +1 -1
  155. package/dist/orchestrators/lifecycle-prune/index.mjs +8 -10
  156. package/dist/orchestrators/lifecycle-prune/index.mjs.map +1 -1
  157. package/dist/orchestrators/network-options.d.mts +52 -0
  158. package/dist/orchestrators/network-options.mjs +43 -0
  159. package/dist/orchestrators/network-options.mjs.map +1 -0
  160. package/dist/orchestrators/router/cleanup.mjs.map +1 -1
  161. package/dist/orchestrators/router/cors.mjs.map +1 -1
  162. package/dist/orchestrators/router/entrypoints.mjs.map +1 -1
  163. package/dist/orchestrators/router/errors.mjs.map +1 -1
  164. package/dist/orchestrators/router/file-provider.mjs.map +1 -1
  165. package/dist/orchestrators/router/hostname.mjs.map +1 -1
  166. package/dist/orchestrators/router/profile.mjs +1 -1
  167. package/dist/orchestrators/router/profile.mjs.map +1 -1
  168. package/dist/orchestrators/router/service.d.mts +2 -2
  169. package/dist/orchestrators/router/service.mjs +12 -27
  170. package/dist/orchestrators/router/service.mjs.map +1 -1
  171. package/dist/orchestrators/router/traefik-container.mjs +1 -1
  172. package/dist/orchestrators/router/traefik-container.mjs.map +1 -1
  173. package/dist/orchestrators/snapshot/capture.mjs +171 -195
  174. package/dist/orchestrators/snapshot/capture.mjs.map +1 -1
  175. package/dist/orchestrators/snapshot/descriptor.d.mts +1 -1
  176. package/dist/orchestrators/snapshot/descriptor.mjs +53 -11
  177. package/dist/orchestrators/snapshot/descriptor.mjs.map +1 -1
  178. package/dist/orchestrators/snapshot/identity-guard.mjs +3 -5
  179. package/dist/orchestrators/snapshot/identity-guard.mjs.map +1 -1
  180. package/dist/orchestrators/snapshot/image-bundle-tags.mjs +32 -101
  181. package/dist/orchestrators/snapshot/image-bundle-tags.mjs.map +1 -1
  182. package/dist/orchestrators/snapshot/index.mjs +1 -4
  183. package/dist/orchestrators/snapshot/integrity.mjs.map +1 -1
  184. package/dist/orchestrators/snapshot/interrupted-restore.mjs +116 -0
  185. package/dist/orchestrators/snapshot/interrupted-restore.mjs.map +1 -0
  186. package/dist/orchestrators/snapshot/phase-error.mjs.map +1 -1
  187. package/dist/orchestrators/snapshot/prune.mjs +40 -31
  188. package/dist/orchestrators/snapshot/prune.mjs.map +1 -1
  189. package/dist/orchestrators/snapshot/restore.mjs +221 -196
  190. package/dist/orchestrators/snapshot/restore.mjs.map +1 -1
  191. package/dist/orchestrators/snapshot/service.mjs +72 -62
  192. package/dist/orchestrators/snapshot/service.mjs.map +1 -1
  193. package/dist/orchestrators/snapshot/wipe.mjs +67 -56
  194. package/dist/orchestrators/snapshot/wipe.mjs.map +1 -1
  195. package/dist/plugins/account/codegen.mjs +3 -0
  196. package/dist/plugins/account/codegen.mjs.map +1 -1
  197. package/dist/plugins/account/errors.d.mts +2 -2
  198. package/dist/plugins/account/errors.mjs +1 -4
  199. package/dist/plugins/account/errors.mjs.map +1 -1
  200. package/dist/plugins/account/funding.mjs +3 -27
  201. package/dist/plugins/account/funding.mjs.map +1 -1
  202. package/dist/plugins/account/index.d.mts +3 -8
  203. package/dist/plugins/account/index.mjs +71 -35
  204. package/dist/plugins/account/index.mjs.map +1 -1
  205. package/dist/plugins/account/keypair.d.mts +8 -7
  206. package/dist/plugins/account/keypair.mjs +5 -18
  207. package/dist/plugins/account/keypair.mjs.map +1 -1
  208. package/dist/plugins/account/lease.mjs.map +1 -1
  209. package/dist/plugins/account/registry.d.mts +1 -46
  210. package/dist/plugins/account/registry.mjs.map +1 -1
  211. package/dist/plugins/account/service.d.mts +43 -34
  212. package/dist/plugins/account/service.mjs +9 -54
  213. package/dist/plugins/account/service.mjs.map +1 -1
  214. package/dist/plugins/account/snapshot.mjs.map +1 -1
  215. package/dist/plugins/account/variants/ephemeral.mjs.map +1 -1
  216. package/dist/plugins/account/variants/impersonate.mjs.map +1 -1
  217. package/dist/plugins/account/variants/signer.mjs.map +1 -1
  218. package/dist/plugins/action/discriminator.mjs.map +1 -1
  219. package/dist/plugins/action/errors.mjs +1 -4
  220. package/dist/plugins/action/errors.mjs.map +1 -1
  221. package/dist/plugins/action/execute.mjs +3 -4
  222. package/dist/plugins/action/execute.mjs.map +1 -1
  223. package/dist/plugins/action/index.d.mts +2 -2
  224. package/dist/plugins/action/index.mjs +7 -11
  225. package/dist/plugins/action/index.mjs.map +1 -1
  226. package/dist/plugins/action/service.d.mts +5 -7
  227. package/dist/plugins/action/service.mjs +2 -16
  228. package/dist/plugins/action/service.mjs.map +1 -1
  229. package/dist/plugins/coin/address-resolution.mjs.map +1 -1
  230. package/dist/plugins/coin/codegen.mjs +97 -16
  231. package/dist/plugins/coin/codegen.mjs.map +1 -1
  232. package/dist/plugins/coin/discovery.mjs.map +1 -1
  233. package/dist/plugins/coin/errors.mjs +1 -4
  234. package/dist/plugins/coin/errors.mjs.map +1 -1
  235. package/dist/plugins/coin/index.d.mts +4 -34
  236. package/dist/plugins/coin/index.mjs +47 -28
  237. package/dist/plugins/coin/index.mjs.map +1 -1
  238. package/dist/plugins/coin/metadata.d.mts +1 -0
  239. package/dist/plugins/coin/metadata.mjs +8 -9
  240. package/dist/plugins/coin/metadata.mjs.map +1 -1
  241. package/dist/plugins/coin/mint.mjs +7 -21
  242. package/dist/plugins/coin/mint.mjs.map +1 -1
  243. package/dist/plugins/coin/registry.mjs +33 -20
  244. package/dist/plugins/coin/registry.mjs.map +1 -1
  245. package/dist/plugins/coin/service.d.mts +1 -1
  246. package/dist/plugins/coin/service.mjs +1 -8
  247. package/dist/plugins/coin/service.mjs.map +1 -1
  248. package/dist/plugins/coin/snapshot.mjs.map +1 -1
  249. package/dist/plugins/coin/type-strings.mjs.map +1 -1
  250. package/dist/plugins/dashboard/domain.mjs +106 -167
  251. package/dist/plugins/dashboard/domain.mjs.map +1 -1
  252. package/dist/plugins/dashboard/index.mjs +13 -13
  253. package/dist/plugins/dashboard/index.mjs.map +1 -1
  254. package/dist/plugins/dashboard/origin-policy.mjs +3 -3
  255. package/dist/plugins/dashboard/origin-policy.mjs.map +1 -1
  256. package/dist/plugins/dashboard/routable.mjs.map +1 -1
  257. package/dist/plugins/dashboard/schema/builder.mjs.map +1 -1
  258. package/dist/plugins/dashboard/schema/enums.mjs.map +1 -1
  259. package/dist/plugins/dashboard/schema/root.mjs +23 -44
  260. package/dist/plugins/dashboard/schema/root.mjs.map +1 -1
  261. package/dist/plugins/dashboard/schema/types.mjs +37 -91
  262. package/dist/plugins/dashboard/schema/types.mjs.map +1 -1
  263. package/dist/plugins/dashboard/schema.mjs.map +1 -1
  264. package/dist/plugins/dashboard/server.mjs.map +1 -1
  265. package/dist/plugins/deepbook/codegen.d.mts +12 -11
  266. package/dist/plugins/deepbook/codegen.mjs +108 -11
  267. package/dist/plugins/deepbook/codegen.mjs.map +1 -1
  268. package/dist/plugins/deepbook/deploy.mjs +7 -14
  269. package/dist/plugins/deepbook/deploy.mjs.map +1 -1
  270. package/dist/plugins/deepbook/errors.mjs +4 -2
  271. package/dist/plugins/deepbook/errors.mjs.map +1 -1
  272. package/dist/plugins/deepbook/faucet-strategy.mjs +4 -10
  273. package/dist/plugins/deepbook/faucet-strategy.mjs.map +1 -1
  274. package/dist/plugins/deepbook/hash.mjs.map +1 -1
  275. package/dist/plugins/deepbook/index.d.mts +38 -34
  276. package/dist/plugins/deepbook/index.mjs +133 -64
  277. package/dist/plugins/deepbook/index.mjs.map +1 -1
  278. package/dist/plugins/deepbook/plugin-key.mjs.map +1 -1
  279. package/dist/plugins/deepbook/pyth/index.mjs +4 -8
  280. package/dist/plugins/deepbook/pyth/index.mjs.map +1 -1
  281. package/dist/plugins/deepbook/snapshot.mjs +0 -1
  282. package/dist/plugins/deepbook/snapshot.mjs.map +1 -1
  283. package/dist/plugins/deepbook/type-strings.mjs.map +1 -1
  284. package/dist/plugins/deepbook/types.d.mts +2 -1
  285. package/dist/plugins/deepbook/types.mjs.map +1 -1
  286. package/dist/plugins/faucet/dispatcher.d.mts +3 -3
  287. package/dist/plugins/faucet/dispatcher.mjs.map +1 -1
  288. package/dist/plugins/faucet/errors.mjs.map +1 -1
  289. package/dist/plugins/faucet/http.mjs +2 -10
  290. package/dist/plugins/faucet/http.mjs.map +1 -1
  291. package/dist/plugins/faucet/index.mjs +0 -1
  292. package/dist/plugins/faucet/index.mjs.map +1 -1
  293. package/dist/plugins/host-service/errors.d.mts +1 -3
  294. package/dist/plugins/host-service/errors.mjs +1 -2
  295. package/dist/plugins/host-service/errors.mjs.map +1 -1
  296. package/dist/plugins/host-service/index.d.mts +1 -2
  297. package/dist/plugins/host-service/index.mjs +11 -11
  298. package/dist/plugins/host-service/index.mjs.map +1 -1
  299. package/dist/plugins/host-service/routable.mjs.map +1 -1
  300. package/dist/plugins/host-service/service.mjs +13 -13
  301. package/dist/plugins/host-service/service.mjs.map +1 -1
  302. package/dist/plugins/internal/acquire-on-chain-artifact.mjs.map +1 -1
  303. package/dist/plugins/internal/codegen-helpers.mjs +2 -0
  304. package/dist/plugins/internal/codegen-helpers.mjs.map +1 -1
  305. package/dist/plugins/internal/funding-failure-error.mjs.map +1 -1
  306. package/dist/plugins/{postgres → internal/postgres-sidecar}/connection.mjs +1 -1
  307. package/dist/plugins/internal/postgres-sidecar/connection.mjs.map +1 -0
  308. package/dist/plugins/{postgres → internal/postgres-sidecar}/db-ensure.mjs +30 -16
  309. package/dist/plugins/internal/postgres-sidecar/db-ensure.mjs.map +1 -0
  310. package/dist/plugins/internal/postgres-sidecar/errors.mjs +21 -0
  311. package/dist/plugins/internal/postgres-sidecar/errors.mjs.map +1 -0
  312. package/dist/{substrate/runtime/scoped-multimap → plugins/internal/postgres-sidecar}/index.mjs +1 -0
  313. package/dist/plugins/internal/postgres-sidecar/service.mjs +121 -0
  314. package/dist/plugins/internal/postgres-sidecar/service.mjs.map +1 -0
  315. package/dist/plugins/package/build.mjs +2 -2
  316. package/dist/plugins/package/build.mjs.map +1 -1
  317. package/dist/plugins/package/codegen.d.mts +7 -14
  318. package/dist/plugins/package/codegen.mjs +187 -59
  319. package/dist/plugins/package/codegen.mjs.map +1 -1
  320. package/dist/plugins/package/dep-resolution.mjs +51 -3
  321. package/dist/plugins/package/dep-resolution.mjs.map +1 -1
  322. package/dist/plugins/package/errors.mjs +1 -4
  323. package/dist/plugins/package/errors.mjs.map +1 -1
  324. package/dist/plugins/package/git-source.d.mts +18 -0
  325. package/dist/plugins/package/git-source.mjs +119 -0
  326. package/dist/plugins/package/git-source.mjs.map +1 -0
  327. package/dist/plugins/package/index.d.mts +28 -19
  328. package/dist/plugins/package/index.mjs +107 -32
  329. package/dist/plugins/package/index.mjs.map +1 -1
  330. package/dist/plugins/package/mode-known.mjs +2 -2
  331. package/dist/plugins/package/mode-known.mjs.map +1 -1
  332. package/dist/plugins/package/mode-local.mjs +18 -35
  333. package/dist/plugins/package/mode-local.mjs.map +1 -1
  334. package/dist/plugins/package/publish-executor.mjs +13 -8
  335. package/dist/plugins/package/publish-executor.mjs.map +1 -1
  336. package/dist/plugins/package/publish-output.d.mts +1 -11
  337. package/dist/plugins/package/publish-output.mjs +1 -9
  338. package/dist/plugins/package/publish-output.mjs.map +1 -1
  339. package/dist/plugins/package/registry.d.mts +1 -1
  340. package/dist/plugins/package/registry.mjs +26 -14
  341. package/dist/plugins/package/registry.mjs.map +1 -1
  342. package/dist/plugins/package/service.mjs.map +1 -1
  343. package/dist/plugins/package/snapshot.mjs.map +1 -1
  344. package/dist/plugins/router-entrypoints.mjs +1 -3
  345. package/dist/plugins/router-entrypoints.mjs.map +1 -1
  346. package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs +1 -2
  347. package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs.map +1 -1
  348. package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs +1 -6
  349. package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs.map +1 -1
  350. package/dist/plugins/seal/codegen.d.mts +1 -5
  351. package/dist/plugins/seal/codegen.mjs +83 -12
  352. package/dist/plugins/seal/codegen.mjs.map +1 -1
  353. package/dist/plugins/seal/config-render.mjs +2 -6
  354. package/dist/plugins/seal/config-render.mjs.map +1 -1
  355. package/dist/plugins/seal/deploy.mjs +18 -29
  356. package/dist/plugins/seal/deploy.mjs.map +1 -1
  357. package/dist/plugins/seal/errors.d.mts +4 -5
  358. package/dist/plugins/seal/errors.mjs +1 -8
  359. package/dist/plugins/seal/errors.mjs.map +1 -1
  360. package/dist/plugins/seal/index.d.mts +7 -28
  361. package/dist/plugins/seal/index.mjs +69 -47
  362. package/dist/plugins/seal/index.mjs.map +1 -1
  363. package/dist/plugins/seal/key-manager.mjs.map +1 -1
  364. package/dist/plugins/seal/key-server.mjs +1 -6
  365. package/dist/plugins/seal/key-server.mjs.map +1 -1
  366. package/dist/plugins/seal/keygen.mjs +2 -3
  367. package/dist/plugins/seal/keygen.mjs.map +1 -1
  368. package/dist/plugins/seal/mode/fork-known.mjs.map +1 -1
  369. package/dist/plugins/seal/mode/live.mjs +1 -1
  370. package/dist/plugins/seal/mode/live.mjs.map +1 -1
  371. package/dist/plugins/seal/mode/local-keygen.mjs +4 -10
  372. package/dist/plugins/seal/mode/local-keygen.mjs.map +1 -1
  373. package/dist/plugins/seal/plugin-key.mjs.map +1 -1
  374. package/dist/plugins/seal/registry-publish.mjs.map +1 -1
  375. package/dist/plugins/seal/routable.mjs.map +1 -1
  376. package/dist/plugins/seal/service.mjs.map +1 -1
  377. package/dist/plugins/seal/snapshot.mjs +1 -2
  378. package/dist/plugins/seal/snapshot.mjs.map +1 -1
  379. package/dist/plugins/sui/auto-tick.mjs +5 -5
  380. package/dist/plugins/sui/auto-tick.mjs.map +1 -1
  381. package/dist/plugins/sui/chain-build-container.mjs +2 -2
  382. package/dist/plugins/sui/chain-build-container.mjs.map +1 -1
  383. package/dist/plugins/sui/chain-probe.mjs +4 -4
  384. package/dist/plugins/sui/chain-probe.mjs.map +1 -1
  385. package/dist/plugins/sui/codegen.d.mts +9 -7
  386. package/dist/plugins/sui/codegen.mjs +49 -46
  387. package/dist/plugins/sui/codegen.mjs.map +1 -1
  388. package/dist/plugins/sui/errors.d.mts +1 -1
  389. package/dist/plugins/sui/errors.mjs +1 -9
  390. package/dist/plugins/sui/errors.mjs.map +1 -1
  391. package/dist/{substrate/runtime/sui-execute → plugins/sui/exec}/index.d.mts +1 -1
  392. package/dist/{substrate/runtime/sui-execute → plugins/sui/exec}/index.mjs +3 -7
  393. package/dist/plugins/sui/exec/index.mjs.map +1 -0
  394. package/dist/{substrate/runtime/sui-execute → plugins/sui/exec}/sign-and-dispatch.mjs +1 -1
  395. package/dist/plugins/sui/exec/sign-and-dispatch.mjs.map +1 -0
  396. package/dist/plugins/sui/fork-faucet-strategy.mjs +2 -6
  397. package/dist/plugins/sui/fork-faucet-strategy.mjs.map +1 -1
  398. package/dist/plugins/sui/fork-orchestration.mjs +13 -23
  399. package/dist/plugins/sui/fork-orchestration.mjs.map +1 -1
  400. package/dist/plugins/sui/fork-transaction.mjs.map +1 -1
  401. package/dist/plugins/sui/index.d.mts +34 -83
  402. package/dist/plugins/sui/index.mjs +200 -68
  403. package/dist/plugins/sui/index.mjs.map +1 -1
  404. package/dist/{substrate/runtime/sui-ledger → plugins/sui/ledger}/object-ref.mjs +1 -1
  405. package/dist/plugins/sui/ledger/object-ref.mjs.map +1 -0
  406. package/dist/plugins/sui/local-faucet-strategy.mjs +1 -5
  407. package/dist/plugins/sui/local-faucet-strategy.mjs.map +1 -1
  408. package/dist/plugins/sui/log-attrs.mjs +11 -0
  409. package/dist/plugins/sui/log-attrs.mjs.map +1 -0
  410. package/dist/plugins/sui/mode/external.mjs +4 -12
  411. package/dist/plugins/sui/mode/external.mjs.map +1 -1
  412. package/dist/plugins/sui/mode/fork.mjs +19 -16
  413. package/dist/plugins/sui/mode/fork.mjs.map +1 -1
  414. package/dist/plugins/sui/mode/live.mjs +4 -17
  415. package/dist/plugins/sui/mode/live.mjs.map +1 -1
  416. package/dist/plugins/sui/mode/local.d.mts +1 -0
  417. package/dist/plugins/sui/mode/local.mjs +203 -61
  418. package/dist/plugins/sui/mode/local.mjs.map +1 -1
  419. package/dist/plugins/sui/mode/shared-boot.mjs +18 -23
  420. package/dist/plugins/sui/mode/shared-boot.mjs.map +1 -1
  421. package/dist/plugins/sui/mode/shared.d.mts +6 -7
  422. package/dist/plugins/sui/mode/shared.mjs.map +1 -1
  423. package/dist/plugins/sui/mode/spec.d.mts +23 -6
  424. package/dist/{substrate/runtime/sui-move-build → plugins/sui/move}/index.mjs +28 -30
  425. package/dist/plugins/sui/move/index.mjs.map +1 -0
  426. package/dist/plugins/sui/move-summary-runner.mjs +8 -4
  427. package/dist/plugins/sui/move-summary-runner.mjs.map +1 -1
  428. package/dist/{substrate/network.d.mts → plugins/sui/network-config.d.mts} +11 -10
  429. package/dist/plugins/sui/network-resolver.d.mts +6 -6
  430. package/dist/plugins/sui/routable.mjs.map +1 -1
  431. package/dist/plugins/sui/service.mjs +10 -6
  432. package/dist/plugins/sui/service.mjs.map +1 -1
  433. package/dist/plugins/sui/snapshot.mjs +10 -5
  434. package/dist/plugins/sui/snapshot.mjs.map +1 -1
  435. package/dist/plugins/wallet/codegen.d.mts +8 -6
  436. package/dist/plugins/wallet/codegen.mjs +4 -10
  437. package/dist/plugins/wallet/codegen.mjs.map +1 -1
  438. package/dist/plugins/wallet/errors.mjs +1 -4
  439. package/dist/plugins/wallet/errors.mjs.map +1 -1
  440. package/dist/plugins/wallet/index.d.mts +3 -6
  441. package/dist/plugins/wallet/index.mjs +16 -21
  442. package/dist/plugins/wallet/index.mjs.map +1 -1
  443. package/dist/plugins/wallet/origin-policy.mjs +3 -3
  444. package/dist/plugins/wallet/origin-policy.mjs.map +1 -1
  445. package/dist/plugins/wallet/pairing.mjs +6 -24
  446. package/dist/plugins/wallet/pairing.mjs.map +1 -1
  447. package/dist/plugins/wallet/protocol.mjs.map +1 -1
  448. package/dist/plugins/wallet/routable.mjs.map +1 -1
  449. package/dist/plugins/wallet/server.mjs +17 -24
  450. package/dist/plugins/wallet/server.mjs.map +1 -1
  451. package/dist/plugins/wallet/service.d.mts +2 -2
  452. package/dist/plugins/wallet/service.mjs +4 -15
  453. package/dist/plugins/wallet/service.mjs.map +1 -1
  454. package/dist/plugins/wallet/snapshot.mjs.map +1 -1
  455. package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs +1 -5
  456. package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs.map +1 -1
  457. package/dist/plugins/walrus/codegen.d.mts +2 -13
  458. package/dist/plugins/walrus/codegen.mjs +93 -28
  459. package/dist/plugins/walrus/codegen.mjs.map +1 -1
  460. package/dist/plugins/walrus/deploy-paths.mjs +2 -3
  461. package/dist/plugins/walrus/deploy-paths.mjs.map +1 -1
  462. package/dist/plugins/walrus/deploy.mjs +26 -19
  463. package/dist/plugins/walrus/deploy.mjs.map +1 -1
  464. package/dist/plugins/walrus/errors.mjs +1 -8
  465. package/dist/plugins/walrus/errors.mjs.map +1 -1
  466. package/dist/plugins/walrus/faucet-strategy.mjs +15 -1
  467. package/dist/plugins/walrus/faucet-strategy.mjs.map +1 -1
  468. package/dist/plugins/walrus/index.d.mts +13 -44
  469. package/dist/plugins/walrus/index.mjs +119 -122
  470. package/dist/plugins/walrus/index.mjs.map +1 -1
  471. package/dist/plugins/walrus/mode/known-deploy.mjs +6 -6
  472. package/dist/plugins/walrus/mode/known-deploy.mjs.map +1 -1
  473. package/dist/plugins/walrus/mode/local-cluster.d.mts +2 -2
  474. package/dist/plugins/walrus/mode/local-cluster.mjs +2 -10
  475. package/dist/plugins/walrus/mode/local-cluster.mjs.map +1 -1
  476. package/dist/plugins/walrus/plugin-key.mjs.map +1 -1
  477. package/dist/plugins/walrus/registry-publish.mjs.map +1 -1
  478. package/dist/plugins/walrus/routable.mjs.map +1 -1
  479. package/dist/plugins/walrus/service.mjs.map +1 -1
  480. package/dist/plugins/walrus/snapshot.mjs +3 -3
  481. package/dist/plugins/walrus/snapshot.mjs.map +1 -1
  482. package/dist/plugins/walrus/storage-nodes.mjs +53 -14
  483. package/dist/plugins/walrus/storage-nodes.mjs.map +1 -1
  484. package/dist/plugins/walrus/wal-swap.mjs +4 -8
  485. package/dist/plugins/walrus/wal-swap.mjs.map +1 -1
  486. package/dist/primitives/artifact-publisher.mjs.map +1 -1
  487. package/dist/primitives/cache.d.mts +1 -1
  488. package/dist/runtime/docker/client.mjs +47 -3
  489. package/dist/runtime/docker/client.mjs.map +1 -1
  490. package/dist/runtime/docker/container.mjs +37 -57
  491. package/dist/runtime/docker/container.mjs.map +1 -1
  492. package/dist/runtime/docker/errors.mjs.map +1 -1
  493. package/dist/runtime/docker/exec.mjs +2 -2
  494. package/dist/runtime/docker/exec.mjs.map +1 -1
  495. package/dist/runtime/docker/image.mjs +10 -11
  496. package/dist/runtime/docker/image.mjs.map +1 -1
  497. package/dist/runtime/docker/index.mjs +0 -1
  498. package/dist/runtime/docker/inspect-and-decode.mjs.map +1 -1
  499. package/dist/runtime/docker/inventory.mjs +9 -9
  500. package/dist/runtime/docker/inventory.mjs.map +1 -1
  501. package/dist/runtime/docker/labels.mjs +12 -1
  502. package/dist/runtime/docker/labels.mjs.map +1 -1
  503. package/dist/runtime/docker/network.mjs +6 -6
  504. package/dist/runtime/docker/network.mjs.map +1 -1
  505. package/dist/runtime/docker/render-run-args.mjs.map +1 -1
  506. package/dist/runtime/docker/service.mjs +31 -45
  507. package/dist/runtime/docker/service.mjs.map +1 -1
  508. package/dist/runtime/docker/sweep.mjs +14 -64
  509. package/dist/runtime/docker/sweep.mjs.map +1 -1
  510. package/dist/runtime/docker/volume.mjs +1 -1
  511. package/dist/runtime/docker/volume.mjs.map +1 -1
  512. package/dist/runtime/docker/wrap.mjs +14 -2
  513. package/dist/runtime/docker/wrap.mjs.map +1 -1
  514. package/dist/substrate/brand.d.mts +2 -5
  515. package/dist/substrate/brand.mjs +3 -2
  516. package/dist/substrate/brand.mjs.map +1 -1
  517. package/dist/substrate/cross-process.mjs +2 -16
  518. package/dist/substrate/cross-process.mjs.map +1 -1
  519. package/dist/substrate/event-time.mjs +0 -2
  520. package/dist/substrate/event-time.mjs.map +1 -1
  521. package/dist/substrate/events.d.mts +46 -16
  522. package/dist/substrate/identity.d.mts +11 -5
  523. package/dist/substrate/manifest.d.mts +33 -26
  524. package/dist/substrate/manifest.mjs +8 -3
  525. package/dist/substrate/manifest.mjs.map +1 -1
  526. package/dist/substrate/options.d.mts +33 -4
  527. package/dist/substrate/plugin-ctx.d.mts +70 -0
  528. package/dist/substrate/plugin-ctx.mjs +66 -0
  529. package/dist/substrate/plugin-ctx.mjs.map +1 -0
  530. package/dist/substrate/plugin.d.mts +46 -38
  531. package/dist/substrate/plugin.mjs +13 -9
  532. package/dist/substrate/plugin.mjs.map +1 -1
  533. package/dist/substrate/projection.d.mts +1 -1
  534. package/dist/substrate/runtime/atomic-write.mjs +3 -4
  535. package/dist/substrate/runtime/atomic-write.mjs.map +1 -1
  536. package/dist/substrate/runtime/cache/schema.mjs.map +1 -1
  537. package/dist/substrate/runtime/cache/service.mjs +50 -20
  538. package/dist/substrate/runtime/cache/service.mjs.map +1 -1
  539. package/dist/substrate/runtime/config-validation.mjs.map +1 -1
  540. package/dist/substrate/runtime/control-plane/domain.mjs +34 -12
  541. package/dist/substrate/runtime/control-plane/domain.mjs.map +1 -1
  542. package/dist/substrate/runtime/control-plane/service.mjs.map +1 -1
  543. package/dist/substrate/runtime/cross-process/command-channel/channel.mjs +14 -17
  544. package/dist/substrate/runtime/cross-process/command-channel/channel.mjs.map +1 -1
  545. package/dist/substrate/runtime/cross-process/command-channel/file-channel.mjs.map +1 -1
  546. package/dist/substrate/runtime/cross-process/command-channel/protocol.mjs.map +1 -1
  547. package/dist/substrate/runtime/cross-process/command-channel/runtime-control-lock.mjs.map +1 -1
  548. package/dist/substrate/runtime/cross-process/index.mjs +0 -2
  549. package/dist/substrate/runtime/cross-process/live-clock.mjs +1 -1
  550. package/dist/substrate/runtime/cross-process/live-clock.mjs.map +1 -1
  551. package/dist/substrate/runtime/cross-process/liveness.mjs +11 -18
  552. package/dist/substrate/runtime/cross-process/liveness.mjs.map +1 -1
  553. package/dist/substrate/runtime/cross-process/reclaim-stale-file.mjs +2 -2
  554. package/dist/substrate/runtime/cross-process/reclaim-stale-file.mjs.map +1 -1
  555. package/dist/substrate/runtime/cross-process/roster.mjs +17 -127
  556. package/dist/substrate/runtime/cross-process/roster.mjs.map +1 -1
  557. package/dist/substrate/runtime/cross-process/self-pid.mjs.map +1 -1
  558. package/dist/substrate/runtime/cross-process/stack-lock.mjs +29 -28
  559. package/dist/substrate/runtime/cross-process/stack-lock.mjs.map +1 -1
  560. package/dist/substrate/runtime/current-plugin.mjs.map +1 -1
  561. package/dist/substrate/runtime/errors.mjs +1 -13
  562. package/dist/substrate/runtime/errors.mjs.map +1 -1
  563. package/dist/substrate/runtime/format-unknown-error.mjs.map +1 -1
  564. package/dist/substrate/runtime/host-bind-mount-owner.mjs.map +1 -1
  565. package/dist/substrate/runtime/host-gateway.mjs.map +1 -1
  566. package/dist/substrate/runtime/host-tree-tar/index.mjs +15 -163
  567. package/dist/substrate/runtime/host-tree-tar/index.mjs.map +1 -1
  568. package/dist/substrate/runtime/http-probe.d.mts +1 -3
  569. package/dist/substrate/runtime/http-probe.mjs.map +1 -1
  570. package/dist/substrate/runtime/index.mjs +1 -6
  571. package/dist/substrate/runtime/lease-broker/service.mjs +5 -23
  572. package/dist/substrate/runtime/lease-broker/service.mjs.map +1 -1
  573. package/dist/substrate/runtime/lifecycle/dep-graph.mjs +3 -3
  574. package/dist/substrate/runtime/lifecycle/dep-graph.mjs.map +1 -1
  575. package/dist/substrate/runtime/lifecycle/graph-input-id.d.mts +1 -0
  576. package/dist/substrate/runtime/lifecycle/graph-input-id.mjs +133 -0
  577. package/dist/substrate/runtime/lifecycle/graph-input-id.mjs.map +1 -0
  578. package/dist/substrate/runtime/lifecycle/index.mjs +2 -2
  579. package/dist/substrate/runtime/lifecycle/plugin-registry.d.mts +1 -1
  580. package/dist/substrate/runtime/lifecycle/plugin-registry.mjs +22 -1
  581. package/dist/substrate/runtime/lifecycle/plugin-registry.mjs.map +1 -1
  582. package/dist/substrate/runtime/lifecycle/ready-gate.mjs +2 -15
  583. package/dist/substrate/runtime/lifecycle/ready-gate.mjs.map +1 -1
  584. package/dist/substrate/runtime/lifecycle/selective-restart.mjs +29 -25
  585. package/dist/substrate/runtime/lifecycle/selective-restart.mjs.map +1 -1
  586. package/dist/substrate/runtime/lifecycle/signals.mjs +1 -1
  587. package/dist/substrate/runtime/lifecycle/signals.mjs.map +1 -1
  588. package/dist/substrate/runtime/lifecycle/state-machine.mjs.map +1 -1
  589. package/dist/substrate/runtime/lifecycle/watch-attribution.d.mts +1 -1
  590. package/dist/substrate/runtime/lifecycle/watch-attribution.mjs +0 -1
  591. package/dist/substrate/runtime/lifecycle/watch-attribution.mjs.map +1 -1
  592. package/dist/substrate/runtime/managed-container.d.mts +5 -1
  593. package/dist/substrate/runtime/managed-container.mjs +8 -10
  594. package/dist/substrate/runtime/managed-container.mjs.map +1 -1
  595. package/dist/substrate/runtime/manifest/manifest.mjs +8 -30
  596. package/dist/substrate/runtime/manifest/manifest.mjs.map +1 -1
  597. package/dist/substrate/runtime/mode-errors.d.mts +1 -2
  598. package/dist/substrate/runtime/mode-errors.mjs.map +1 -1
  599. package/dist/substrate/runtime/observability/cascade-formatter.mjs +1 -11
  600. package/dist/substrate/runtime/observability/cascade-formatter.mjs.map +1 -1
  601. package/dist/substrate/runtime/observability/ignore-with-log.mjs.map +1 -1
  602. package/dist/substrate/runtime/observability/index.d.mts +1 -1
  603. package/dist/substrate/runtime/observability/index.mjs +4 -6
  604. package/dist/substrate/runtime/observability/log-attrs.mjs +46 -0
  605. package/dist/substrate/runtime/observability/log-attrs.mjs.map +1 -0
  606. package/dist/substrate/runtime/observability/log-store.mjs.map +1 -1
  607. package/dist/substrate/runtime/observability/logger.mjs +3 -3
  608. package/dist/substrate/runtime/observability/logger.mjs.map +1 -1
  609. package/dist/substrate/runtime/observability/output-truncate.mjs.map +1 -1
  610. package/dist/substrate/runtime/observability/pretty-error.mjs.map +1 -1
  611. package/dist/substrate/runtime/observability/process-lines.mjs.map +1 -1
  612. package/dist/substrate/runtime/observability/redaction.mjs.map +1 -1
  613. package/dist/substrate/runtime/observability/subprocess-capture.mjs +2 -2
  614. package/dist/substrate/runtime/observability/subprocess-capture.mjs.map +1 -1
  615. package/dist/substrate/runtime/passthrough-or-wrap.mjs.map +1 -1
  616. package/dist/substrate/runtime/paths.mjs +27 -9
  617. package/dist/substrate/runtime/paths.mjs.map +1 -1
  618. package/dist/substrate/runtime/phase-preserving-produce.mjs.map +1 -1
  619. package/dist/substrate/runtime/port-broker/service.mjs +10 -27
  620. package/dist/substrate/runtime/port-broker/service.mjs.map +1 -1
  621. package/dist/substrate/runtime/post-acquire-tasks.mjs.map +1 -1
  622. package/dist/substrate/runtime/probes.d.mts +2 -3
  623. package/dist/substrate/runtime/probes.mjs.map +1 -1
  624. package/dist/substrate/runtime/process-supervisor.mjs.map +1 -1
  625. package/dist/substrate/runtime/projection/operational-endpoints.mjs.map +1 -1
  626. package/dist/substrate/runtime/projection/state-ref.mjs.map +1 -1
  627. package/dist/substrate/runtime/projection/update.mjs +87 -11
  628. package/dist/substrate/runtime/projection/update.mjs.map +1 -1
  629. package/dist/substrate/runtime/random-suffix.mjs.map +1 -1
  630. package/dist/substrate/runtime/reconcile/fs-plan.mjs +146 -0
  631. package/dist/substrate/runtime/reconcile/fs-plan.mjs.map +1 -0
  632. package/dist/substrate/runtime/reconcile/graph.mjs +19 -0
  633. package/dist/substrate/runtime/reconcile/graph.mjs.map +1 -0
  634. package/dist/substrate/runtime/reconcile/index.mjs +5 -0
  635. package/dist/substrate/runtime/reconcile/label.mjs +41 -0
  636. package/dist/substrate/runtime/reconcile/label.mjs.map +1 -0
  637. package/dist/substrate/runtime/reconcile/spec.mjs +15 -0
  638. package/dist/substrate/runtime/reconcile/spec.mjs.map +1 -0
  639. package/dist/substrate/runtime/retry-policy.d.mts +2 -3
  640. package/dist/substrate/runtime/retry-policy.mjs.map +1 -1
  641. package/dist/substrate/runtime/routed-url.mjs.map +1 -1
  642. package/dist/substrate/runtime/runtime-decode.mjs.map +1 -1
  643. package/dist/substrate/runtime/scoped-http-server.mjs.map +1 -1
  644. package/dist/substrate/runtime/stage-and-swap/index.mjs +49 -12
  645. package/dist/substrate/runtime/stage-and-swap/index.mjs.map +1 -1
  646. package/dist/substrate/runtime/strategy-registry/chain-keyed-strategy-for.mjs.map +1 -1
  647. package/dist/substrate/runtime/strategy-registry/chain-probe-for.mjs.map +1 -1
  648. package/dist/substrate/runtime/strategy-registry/service.mjs +29 -17
  649. package/dist/substrate/runtime/strategy-registry/service.mjs.map +1 -1
  650. package/dist/substrate/runtime/subnet-broker.mjs.map +1 -1
  651. package/dist/substrate/runtime/supervisor/acquire-node.mjs +188 -56
  652. package/dist/substrate/runtime/supervisor/acquire-node.mjs.map +1 -1
  653. package/dist/substrate/runtime/supervisor/background-tasks.mjs +79 -65
  654. package/dist/substrate/runtime/supervisor/background-tasks.mjs.map +1 -1
  655. package/dist/substrate/runtime/supervisor/command-loop.mjs +82 -23
  656. package/dist/substrate/runtime/supervisor/command-loop.mjs.map +1 -1
  657. package/dist/substrate/runtime/supervisor/contribution-dispatcher.mjs +16 -0
  658. package/dist/substrate/runtime/supervisor/contribution-dispatcher.mjs.map +1 -0
  659. package/dist/substrate/runtime/supervisor/errors.mjs +11 -2
  660. package/dist/substrate/runtime/supervisor/errors.mjs.map +1 -1
  661. package/dist/substrate/runtime/supervisor/index.mjs +2 -0
  662. package/dist/substrate/runtime/supervisor/shutdown.mjs +6 -6
  663. package/dist/substrate/runtime/supervisor/shutdown.mjs.map +1 -1
  664. package/dist/substrate/runtime/supervisor/start-supervisor.mjs +60 -70
  665. package/dist/substrate/runtime/supervisor/start-supervisor.mjs.map +1 -1
  666. package/dist/substrate/runtime/supervisor/state.d.mts +1 -1
  667. package/dist/substrate/runtime/supervisor/state.mjs +1 -1
  668. package/dist/substrate/runtime/supervisor/state.mjs.map +1 -1
  669. package/dist/substrate/runtime/supervisor/teardown.mjs +10 -9
  670. package/dist/substrate/runtime/supervisor/teardown.mjs.map +1 -1
  671. package/dist/substrate/runtime/supervisor/wiring.mjs +6 -20
  672. package/dist/substrate/runtime/supervisor/wiring.mjs.map +1 -1
  673. package/dist/substrate/runtime/tar/reader.mjs +216 -0
  674. package/dist/substrate/runtime/tar/reader.mjs.map +1 -0
  675. package/dist/substrate/runtime/typed-env.mjs.map +1 -1
  676. package/dist/substrate/versioned-doc-schema.mjs.map +1 -1
  677. package/dist/substrate/versioned-doc-sync.mjs +5 -5
  678. package/dist/substrate/versioned-doc-sync.mjs.map +1 -1
  679. package/dist/surfaces/cli/command-tree.mjs +49 -7
  680. package/dist/surfaces/cli/command-tree.mjs.map +1 -1
  681. package/dist/surfaces/cli/commands/config.mjs +1 -1
  682. package/dist/surfaces/cli/commands/config.mjs.map +1 -1
  683. package/dist/surfaces/cli/commands/confirm-node.mjs.map +1 -1
  684. package/dist/surfaces/cli/commands/confirm.mjs.map +1 -1
  685. package/dist/surfaces/cli/commands/doctor.mjs +1 -1
  686. package/dist/surfaces/cli/commands/doctor.mjs.map +1 -1
  687. package/dist/surfaces/cli/commands/prune-picker-entry.mjs.map +1 -1
  688. package/dist/surfaces/cli/commands/prune-picker.mjs.map +1 -1
  689. package/dist/surfaces/cli/commands/prune.mjs +1 -1
  690. package/dist/surfaces/cli/commands/prune.mjs.map +1 -1
  691. package/dist/surfaces/cli/commands/snapshot.mjs +1 -1
  692. package/dist/surfaces/cli/commands/snapshot.mjs.map +1 -1
  693. package/dist/surfaces/cli/commands/status.mjs +1 -1
  694. package/dist/surfaces/cli/commands/status.mjs.map +1 -1
  695. package/dist/surfaces/cli/commands/supervisor-presence.mjs.map +1 -1
  696. package/dist/surfaces/cli/commands/wipe.mjs +3 -4
  697. package/dist/surfaces/cli/commands/wipe.mjs.map +1 -1
  698. package/dist/surfaces/cli/envelope.mjs.map +1 -1
  699. package/dist/surfaces/cli/errors.mjs.map +1 -1
  700. package/dist/surfaces/cli/flags.mjs.map +1 -1
  701. package/dist/surfaces/cli/index.mjs +45 -14
  702. package/dist/surfaces/cli/index.mjs.map +1 -1
  703. package/dist/surfaces/cli/output.mjs.map +1 -1
  704. package/dist/surfaces/cli/sysexits.mjs.map +1 -1
  705. package/dist/surfaces/tui/app.mjs +0 -21
  706. package/dist/surfaces/tui/app.mjs.map +1 -1
  707. package/dist/surfaces/tui/dashboard.mjs +0 -48
  708. package/dist/surfaces/tui/dashboard.mjs.map +1 -1
  709. package/dist/surfaces/tui/display-derivation.mjs +80 -16
  710. package/dist/surfaces/tui/display-derivation.mjs.map +1 -1
  711. package/dist/surfaces/tui/errors.mjs.map +1 -1
  712. package/dist/surfaces/tui/event-log.mjs +0 -9
  713. package/dist/surfaces/tui/event-log.mjs.map +1 -1
  714. package/dist/surfaces/tui/heartbeat.mjs.map +1 -1
  715. package/dist/surfaces/tui/index.mjs +2 -2
  716. package/dist/surfaces/tui/index.mjs.map +1 -1
  717. package/dist/surfaces/tui/input.mjs.map +1 -1
  718. package/dist/surfaces/tui/mode-detect.mjs.map +1 -1
  719. package/dist/surfaces/tui/mount-ink.mjs.map +1 -1
  720. package/dist/surfaces/tui/plain-renderer.mjs +26 -19
  721. package/dist/surfaces/tui/plain-renderer.mjs.map +1 -1
  722. package/dist/surfaces/tui/resource-table.mjs +8 -10
  723. package/dist/surfaces/tui/resource-table.mjs.map +1 -1
  724. package/images/postgres/Dockerfile +0 -1
  725. package/images/sui/Dockerfile +27 -54
  726. package/images/sui/entrypoint.sh +17 -179
  727. package/package.json +23 -15
  728. package/dashboard-ui/assets/index-Bmi1UtAg.js +0 -1356
  729. package/dashboard-ui/assets/index-D5EShVt4.js +0 -3
  730. package/dashboard-ui/assets/index-Deml9drg.css +0 -1
  731. package/dist/api/plugin-errors.d.mts +0 -7
  732. package/dist/api/plugin-errors.mjs +0 -10
  733. package/dist/api/plugin-errors.mjs.map +0 -1
  734. package/dist/cli/wirings/build-verb-layers.mjs +0 -42
  735. package/dist/cli/wirings/build-verb-layers.mjs.map +0 -1
  736. package/dist/contracts/capability-decl.d.mts +0 -40
  737. package/dist/orchestrators/built-in-plugin-layers.mjs +0 -54
  738. package/dist/orchestrators/built-in-plugin-layers.mjs.map +0 -1
  739. package/dist/orchestrators/run.mjs +0 -91
  740. package/dist/orchestrators/run.mjs.map +0 -1
  741. package/dist/orchestrators/runtime-composition.d.mts +0 -10
  742. package/dist/orchestrators/runtime-composition.mjs +0 -252
  743. package/dist/orchestrators/runtime-composition.mjs.map +0 -1
  744. package/dist/orchestrators/snapshot/capture-command.d.mts +0 -1
  745. package/dist/orchestrators/snapshot/capture-command.mjs +0 -25
  746. package/dist/orchestrators/snapshot/capture-command.mjs.map +0 -1
  747. package/dist/orchestrators/snapshot/pending-marker.mjs +0 -99
  748. package/dist/orchestrators/snapshot/pending-marker.mjs.map +0 -1
  749. package/dist/orchestrators/snapshot/recover-pending.mjs +0 -223
  750. package/dist/orchestrators/snapshot/recover-pending.mjs.map +0 -1
  751. package/dist/orchestrators/snapshot/state-document.d.mts +0 -1
  752. package/dist/orchestrators/snapshot/state-document.mjs +0 -58
  753. package/dist/orchestrators/snapshot/state-document.mjs.map +0 -1
  754. package/dist/plugins/account/spans.mjs +0 -16
  755. package/dist/plugins/account/spans.mjs.map +0 -1
  756. package/dist/plugins/account/variants/env.mjs +0 -24
  757. package/dist/plugins/account/variants/env.mjs.map +0 -1
  758. package/dist/plugins/account/variants/inline.mjs +0 -13
  759. package/dist/plugins/account/variants/inline.mjs.map +0 -1
  760. package/dist/plugins/account/variants/keystore.mjs +0 -91
  761. package/dist/plugins/account/variants/keystore.mjs.map +0 -1
  762. package/dist/plugins/action/spans.mjs +0 -11
  763. package/dist/plugins/action/spans.mjs.map +0 -1
  764. package/dist/plugins/coin/spans.mjs +0 -20
  765. package/dist/plugins/coin/spans.mjs.map +0 -1
  766. package/dist/plugins/deepbook/spans.mjs +0 -18
  767. package/dist/plugins/deepbook/spans.mjs.map +0 -1
  768. package/dist/plugins/faucet/spans.mjs +0 -12
  769. package/dist/plugins/faucet/spans.mjs.map +0 -1
  770. package/dist/plugins/package/spans.mjs +0 -14
  771. package/dist/plugins/package/spans.mjs.map +0 -1
  772. package/dist/plugins/postgres/codegen.mjs +0 -42
  773. package/dist/plugins/postgres/codegen.mjs.map +0 -1
  774. package/dist/plugins/postgres/connection.d.mts +0 -33
  775. package/dist/plugins/postgres/connection.mjs.map +0 -1
  776. package/dist/plugins/postgres/db-ensure.mjs.map +0 -1
  777. package/dist/plugins/postgres/errors.d.mts +0 -60
  778. package/dist/plugins/postgres/errors.mjs +0 -29
  779. package/dist/plugins/postgres/errors.mjs.map +0 -1
  780. package/dist/plugins/postgres/index.d.mts +0 -37
  781. package/dist/plugins/postgres/index.mjs +0 -68
  782. package/dist/plugins/postgres/index.mjs.map +0 -1
  783. package/dist/plugins/postgres/routable.mjs +0 -33
  784. package/dist/plugins/postgres/routable.mjs.map +0 -1
  785. package/dist/plugins/postgres/service.d.mts +0 -50
  786. package/dist/plugins/postgres/service.mjs +0 -179
  787. package/dist/plugins/postgres/service.mjs.map +0 -1
  788. package/dist/plugins/postgres/snapshot.mjs +0 -32
  789. package/dist/plugins/postgres/snapshot.mjs.map +0 -1
  790. package/dist/plugins/postgres/spans.mjs +0 -11
  791. package/dist/plugins/postgres/spans.mjs.map +0 -1
  792. package/dist/plugins/seal/spans.mjs +0 -18
  793. package/dist/plugins/seal/spans.mjs.map +0 -1
  794. package/dist/plugins/sui/spans.mjs +0 -17
  795. package/dist/plugins/sui/spans.mjs.map +0 -1
  796. package/dist/plugins/wallet/spans.mjs +0 -22
  797. package/dist/plugins/wallet/spans.mjs.map +0 -1
  798. package/dist/plugins/walrus/registry-publish.d.mts +0 -24
  799. package/dist/plugins/walrus/spans.mjs +0 -18
  800. package/dist/plugins/walrus/spans.mjs.map +0 -1
  801. package/dist/runtime/docker/logs.d.mts +0 -1
  802. package/dist/runtime/docker/logs.mjs +0 -34
  803. package/dist/runtime/docker/logs.mjs.map +0 -1
  804. package/dist/substrate/runtime/artifact-publisher/index.mjs +0 -86
  805. package/dist/substrate/runtime/artifact-publisher/index.mjs.map +0 -1
  806. package/dist/substrate/runtime/capability-sinks/index.d.mts +0 -1
  807. package/dist/substrate/runtime/capability-sinks/index.mjs +0 -3
  808. package/dist/substrate/runtime/capability-sinks/layer.d.mts +0 -1
  809. package/dist/substrate/runtime/capability-sinks/layer.mjs +0 -31
  810. package/dist/substrate/runtime/capability-sinks/layer.mjs.map +0 -1
  811. package/dist/substrate/runtime/capability-sinks/service.d.mts +0 -95
  812. package/dist/substrate/runtime/capability-sinks/service.mjs +0 -69
  813. package/dist/substrate/runtime/capability-sinks/service.mjs.map +0 -1
  814. package/dist/substrate/runtime/cross-process/lock.d.mts +0 -1
  815. package/dist/substrate/runtime/cross-process/lock.mjs +0 -23
  816. package/dist/substrate/runtime/cross-process/lock.mjs.map +0 -1
  817. package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs +0 -113
  818. package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs.map +0 -1
  819. package/dist/substrate/runtime/lifecycle/lifecycle-fact.mjs +0 -31
  820. package/dist/substrate/runtime/lifecycle/lifecycle-fact.mjs.map +0 -1
  821. package/dist/substrate/runtime/observability/formatter-registry.d.mts +0 -1
  822. package/dist/substrate/runtime/observability/formatter-registry.mjs +0 -48
  823. package/dist/substrate/runtime/observability/formatter-registry.mjs.map +0 -1
  824. package/dist/substrate/runtime/observability/span-store.d.mts +0 -1
  825. package/dist/substrate/runtime/observability/span-store.mjs +0 -110
  826. package/dist/substrate/runtime/observability/span-store.mjs.map +0 -1
  827. package/dist/substrate/runtime/observability/spans.d.mts +0 -1
  828. package/dist/substrate/runtime/observability/spans.mjs +0 -87
  829. package/dist/substrate/runtime/observability/spans.mjs.map +0 -1
  830. package/dist/substrate/runtime/projection/index.mjs +0 -4
  831. package/dist/substrate/runtime/projection/persisted.mjs +0 -213
  832. package/dist/substrate/runtime/projection/persisted.mjs.map +0 -1
  833. package/dist/substrate/runtime/scoped-multimap/service.mjs +0 -52
  834. package/dist/substrate/runtime/scoped-multimap/service.mjs.map +0 -1
  835. package/dist/substrate/runtime/scoped-ref-map/index.mjs +0 -2
  836. package/dist/substrate/runtime/scoped-ref-map/service.mjs +0 -83
  837. package/dist/substrate/runtime/scoped-ref-map/service.mjs.map +0 -1
  838. package/dist/substrate/runtime/state-store/index.mjs +0 -3
  839. package/dist/substrate/runtime/state-store/schema.d.mts +0 -1
  840. package/dist/substrate/runtime/state-store/schema.mjs +0 -41
  841. package/dist/substrate/runtime/state-store/schema.mjs.map +0 -1
  842. package/dist/substrate/runtime/state-store/service.d.mts +0 -1
  843. package/dist/substrate/runtime/state-store/service.mjs +0 -145
  844. package/dist/substrate/runtime/state-store/service.mjs.map +0 -1
  845. package/dist/substrate/runtime/sui-execute/index.mjs.map +0 -1
  846. package/dist/substrate/runtime/sui-execute/sign-and-dispatch.mjs.map +0 -1
  847. package/dist/substrate/runtime/sui-ledger/object-ref.mjs.map +0 -1
  848. package/dist/substrate/runtime/sui-move-build/index.mjs.map +0 -1
  849. package/dist/substrate/runtime/supervisor/dispatch-contributions.mjs +0 -151
  850. package/dist/substrate/runtime/supervisor/dispatch-contributions.mjs.map +0 -1
  851. package/dist/substrate/state-store.d.mts +0 -1
  852. /package/dist/orchestrators/{snapshot/pending-marker.d.mts → codegen/id-config.d.mts} +0 -0
  853. /package/dist/orchestrators/snapshot/{recover-pending.d.mts → interrupted-restore.d.mts} +0 -0
  854. /package/dist/{substrate/runtime/sui-execute → plugins/sui/exec}/sign-and-dispatch.d.mts +0 -0
  855. /package/dist/plugins/{postgres/snapshot.d.mts → sui/ledger/object-ref.d.mts} +0 -0
  856. /package/dist/{substrate/runtime/sui-move-build → plugins/sui/move}/index.d.mts +0 -0
  857. /package/dist/substrate/runtime/{state-store/index.d.mts → reconcile/graph.d.mts} +0 -0
  858. /package/dist/substrate/runtime/{cross-process/snapshot-reservation.d.mts → supervisor/contribution-dispatcher.d.mts} +0 -0
@@ -1,153 +1,34 @@
1
- import { readStackEngine } from "./define-devstack.mjs";
2
- import { appName, chainId, stackName } from "../substrate/brand.mjs";
3
- import "../substrate/runtime/capability-sinks/index.mjs";
4
- import { makeProjectionRefSync } from "../substrate/runtime/projection/state-ref.mjs";
5
- import "../substrate/runtime/index.mjs";
6
- import { buildSubstrateLayers, superviseStackEffect } from "../orchestrators/run.mjs";
7
- import { buildProductionOrchestratorSinks, buildProductionPostAcquireHook, layerProductionOrchestrators } from "../orchestrators/runtime-composition.mjs";
8
- import { resolveCodegenOutput } from "../orchestrators/codegen/output-location.mjs";
9
- import { extendBuiltInPluginContext, layerBuiltInPluginRuntime } from "../orchestrators/built-in-plugin-layers.mjs";
10
- import { resolveAppName, resolveNetworkSync, resolveStackName, resolveStateDir } from "./inference-network.mjs";
11
- import { Cause, Deferred, Effect, Exit, Fiber, Layer, Logger, Queue, Ref, Stream } from "effect";
1
+ import { runStackWithBoot } from "./run-stack-internal.mjs";
12
2
  //#region src/api/run-stack.ts
13
- const resolveIdentity = (stack, opts, cwd) => {
14
- const app = resolveAppName({
15
- explicit: opts?.app,
16
- cwd
17
- });
18
- const stackNameStr = resolveStackName({
19
- explicit: opts?.stack ?? stack.options.stackName,
20
- cwd
21
- });
22
- const resolved = resolveNetworkSync({
23
- explicit: opts?.network,
24
- env: process.env.DEVSTACK_NETWORK,
25
- explicitSource: "runStack({ identity.network })"
26
- });
27
- return {
28
- app: appName(app),
29
- stack: stackName(stackNameStr),
30
- chain: chainId(resolved.raw)
31
- };
32
- };
33
- const toBootError = (cause) => ({
34
- _tag: "BootError",
35
- cause
36
- });
37
3
  /**
38
4
  * Boot a `Stack` for programmatic embedding. Returns a `RunHandle`
39
5
  * synchronously; the supervisor fiber is forked on `start`.
40
6
  *
41
- * Lifecycle:
7
+ * Programmatic contract — call, then drive the returned handle's Effects:
42
8
  *
43
- * 1. `runStack(stack, opts)` — synchronous; no fiber forked yet.
44
- * 2. `await Effect.runPromise(handle.start)` forks the supervisor,
45
- * blocks until every plugin reaches `ready` (or fails with
46
- * `BootError`).
47
- * 3. Use `handle.events` / `handle.state` to observe.
9
+ * 1. `runStack(stack, opts)` — synchronous; NO fiber forked yet. Safe to
10
+ * read `handle.identity` and subscribe to `handle.state` /
11
+ * `handle.events` right away.
12
+ * 2. `await Effect.runPromise(handle.start)` — forks the supervisor and
13
+ * blocks until every plugin reaches `ready` (or fails with `BootError`).
14
+ * 3. Observe via `handle.state` (snapshot / changes) and `handle.events`
15
+ * (single-consumer tail); drive via `handle.commands` /
16
+ * `handle.runCommand`.
48
17
  * 4. `await Effect.runPromise(handle.stop)` — graceful shutdown.
49
- * 5. `handle.awaitShutdown` resolves once finalizers complete.
18
+ * 5. `await Effect.runPromise(handle.awaitShutdown)` resolves once scope
19
+ * finalizers complete (or re-raises a post-boot supervisor death).
50
20
  *
51
- * Internal architecture: the handle stores a `Deferred` for boot
52
- * completion. The supervised body forks a watcher fiber over the
53
- * registry's `awaitReady` per node; once every node is `ready` (or one
54
- * fails) the deferred completes. `start` awaits it.
21
+ * Thin facade: delegates to `runStackWithBoot` (in `run-stack-internal.ts`)
22
+ * with a zero-`boot` bag and no `commandHandler`, so this public path is
23
+ * byte-identical to the pre-seam `runStack` body. The boot-injection seam
24
+ * the CLI `up` verb consumes is non-public — it is NOT re-exported from
25
+ * `index.ts`, and its substrate types never appear on `RunHandle`.
55
26
  */
56
- const runStack = (stack, opts = {}) => {
57
- const engineStack = readStackEngine(stack);
58
- const runtimeRoot = resolveStateDir({
59
- runtimeRoot: opts.runtimeRoot,
60
- stateDir: opts.stateDir ?? engineStack.options.stateDir,
61
- env: process.env.DEVSTACK_STATE_DIR,
62
- cwd: process.cwd()
63
- });
64
- const appRoot = opts.appRoot ?? process.cwd();
65
- const identity = resolveIdentity(stack, opts.identity, appRoot);
66
- const codegen = opts.codegen ?? engineStack.options.codegen;
67
- const supervisedStack = {
68
- _tag: "Stack",
69
- members: engineStack.members,
70
- options: engineStack.options
71
- };
72
- const state = makeProjectionRefSync();
73
- const bootDeferred = Effect.runSync(Deferred.make());
74
- const stopRequested = Effect.runSync(Deferred.make());
75
- const eventQueueRef = Effect.runSync(Deferred.make());
76
- const fiberRef = Effect.runSync(Deferred.make());
77
- const startClaim = Effect.runSync(Ref.make(false));
78
- const midRunCauseRef = Effect.runSync(Ref.make(null));
79
- const codegenOutput = resolveCodegenOutput({
80
- appRoot,
81
- effectiveStack: String(identity.stack),
82
- primaryStack: engineStack.options.stackName,
83
- explicitOutputDir: codegen?.outputDir,
84
- explicitStackSubdir: codegen?.stackSubdir ?? null
85
- });
86
- const substrate = layerProductionOrchestrators({ codegen: {
87
- appRoot,
88
- outputDir: codegenOutput.outputDir,
89
- stackSubdir: codegenOutput.stackSubdir
90
- } }).pipe(Layer.provideMerge(buildSubstrateLayers(identity, runtimeRoot)));
91
- const supervised = Effect.gen(function* () {
92
- const orchestratorSinks = yield* buildProductionOrchestratorSinks();
93
- yield* superviseStackEffect(supervisedStack, identity, state, {
94
- orchestratorSinks,
95
- postAcquireHook: yield* buildProductionPostAcquireHook({ extras: stack.options.extras }),
96
- extendContext: (ctx) => Effect.gen(function* () {
97
- const builtInContext = yield* extendBuiltInPluginContext(ctx);
98
- return opts.extendContext === void 0 ? builtInContext : yield* opts.extendContext(builtInContext);
99
- }),
100
- beforeInitialAcquire: (handle) => Effect.gen(function* () {
101
- yield* Deferred.succeed(eventQueueRef, handle.events).pipe(Effect.catch(() => Effect.void));
102
- yield* Effect.forkScoped(Effect.gen(function* () {
103
- yield* Deferred.await(stopRequested);
104
- yield* Queue.offer(handle.commands, { tag: "shutdown.requested" });
105
- }));
106
- }),
107
- withinScope: (handle) => Effect.gen(function* () {
108
- yield* Effect.forkScoped(Effect.gen(function* () {
109
- const firstFailure = (yield* Effect.forEach(handle.graph.nodes, ([key]) => handle.registry.awaitReady(key).pipe(Effect.exit), { concurrency: "unbounded" })).find(Exit.isFailure);
110
- if (firstFailure === void 0) yield* Deferred.succeed(bootDeferred, void 0);
111
- else yield* Deferred.fail(bootDeferred, toBootError(firstFailure.cause));
112
- }));
113
- })
114
- }).pipe(Effect.provide(layerBuiltInPluginRuntime(orchestratorSinks)));
115
- });
116
- const loggerLayer = Logger.layer([]);
117
- const supervisedProgram = supervised.pipe(Effect.provide(substrate), Effect.provide(loggerLayer)).pipe(Effect.catchCause((cause) => Effect.gen(function* () {
118
- const bootAlreadyCompleted = yield* Deferred.isDone(bootDeferred);
119
- yield* Deferred.fail(bootDeferred, toBootError(cause)).pipe(Effect.asVoid, Effect.catch(() => Effect.void));
120
- if (bootAlreadyCompleted) yield* Ref.set(midRunCauseRef, cause);
121
- yield* Effect.logError(`devstack runStack: supervisor died\n${Cause.pretty(cause)}`);
122
- })));
123
- return {
124
- start: Effect.uninterruptibleMask((restore) => Effect.gen(function* () {
125
- if (yield* Ref.modify(startClaim, (started) => started ? [false, true] : [true, true])) {
126
- const fiber = yield* Effect.forkDetach(supervisedProgram);
127
- yield* Deferred.succeed(fiberRef, fiber);
128
- }
129
- yield* restore(Deferred.await(bootDeferred));
130
- })),
131
- stop: Effect.gen(function* () {
132
- yield* Deferred.succeed(stopRequested, void 0).pipe(Effect.catch(() => Effect.void));
133
- if (!(yield* Deferred.isDone(fiberRef))) return;
134
- const fiber = yield* Deferred.await(fiberRef);
135
- yield* Fiber.await(fiber);
136
- }),
137
- awaitShutdown: Effect.gen(function* () {
138
- if (!(yield* Deferred.isDone(fiberRef))) return;
139
- const fiber = yield* Deferred.await(fiberRef);
140
- yield* Fiber.await(fiber);
141
- const midRunCause = yield* Ref.get(midRunCauseRef);
142
- if (midRunCause !== null) return yield* Effect.failCause(midRunCause);
143
- }),
144
- events: Stream.unwrap(Effect.gen(function* () {
145
- const queue = yield* Deferred.await(eventQueueRef);
146
- return Stream.fromQueue(queue);
147
- })),
148
- state
149
- };
150
- };
27
+ const runStack = (stack, opts = {}) => runStackWithBoot(stack, {
28
+ ...opts,
29
+ commandHandler: void 0,
30
+ boot: void 0
31
+ });
151
32
  //#endregion
152
33
  export { runStack };
153
34
 
@@ -1 +1 @@
1
- {"version":3,"file":"run-stack.mjs","names":[],"sources":["../../src/api/run-stack.ts"],"sourcesContent":["// `runStack(stack, opts?)` — top-level programmatic embedding.\n//\n// `defineDevstack(...)` returns a static `Stack<Members>` manifest with\n// no runnable surface. Library consumers (vitest setup, custom hosts,\n// Effect-native apps, embedded fixtures) would otherwise have to\n// re-implement `cli/wirings/up.ts:runUpLive`'s substrate Layer composition.\n// `runStack` is the single embedder seam — it consumes the same\n// `orchestrators/runtime-composition.ts` helper the CLI consumes. See\n// ARCHITECTURE.md §\"Layer composition lives at L3, not L0\".\n//\n// Shape:\n//\n// ```ts\n// const stack = defineDevstack(...);\n// const handle = runStack(stack, { runtimeRoot: '/tmp/devstack' });\n// await Effect.runPromise(handle.start);\n// // ... interact ...\n// await Effect.runPromise(handle.stop);\n// await Effect.runPromise(handle.awaitShutdown);\n// ```\n//\n// `start` resolves when every plugin has reached `ready` (or when one\n// fails to acquire — `start` then fails with `BootError`). `stop`\n// triggers graceful shutdown; `awaitShutdown` resolves when the fiber\n// finishes its scope finalizers.\n\nimport {\n\tCause,\n\tContext,\n\tDeferred,\n\tEffect,\n\tExit,\n\tFiber,\n\tLayer,\n\tLogger,\n\tQueue,\n\tRef,\n\tScope,\n\tStream,\n\tSubscriptionRef,\n} from 'effect';\n\nimport { appName, chainId, stackName } from '../substrate/brand.ts';\nimport type { Identity } from '../substrate/identity.ts';\nimport type { EngineEvent } from '../substrate/events.ts';\nimport type { SubscribableState } from '../substrate/projection.ts';\nimport { CapabilitySinksService } from '../substrate/runtime/capability-sinks/index.ts';\nimport { makeProjectionRefSync } from '../substrate/runtime/index.ts';\nimport { buildSubstrateLayers, superviseStackEffect } from '../orchestrators/run.ts';\nimport {\n\tbuildProductionOrchestratorSinks,\n\tbuildProductionPostAcquireHook,\n\tlayerProductionOrchestrators,\n\ttype ProductionCodegenOptions,\n} from '../orchestrators/runtime-composition.ts';\nimport { resolveCodegenOutput } from '../orchestrators/codegen/output-location.ts';\nimport {\n\textendBuiltInPluginContext,\n\tlayerBuiltInPluginRuntime,\n} from '../orchestrators/built-in-plugin-layers.ts';\nimport { readStackEngine, type Stack } from './define-devstack.ts';\nimport type { AnyPlugin } from '../substrate/plugin.ts';\nimport {\n\tresolveAppName,\n\tresolveNetworkSync,\n\tresolveStackName,\n\tresolveStateDir,\n} from './inference-network.ts';\n\n// -----------------------------------------------------------------------------\n// Public types\n// -----------------------------------------------------------------------------\n\n/** Identity overrides for `runStack`. App and stack fall back through\n * shared package metadata inference after their env overrides. */\nexport interface RunStackIdentityOptions {\n\treadonly app?: string;\n\treadonly stack?: string;\n\treadonly network?: string;\n}\n\nexport interface RunStackOptions {\n\t/** Identity overrides — falls back to env + library defaults. */\n\treadonly identity?: RunStackIdentityOptions;\n\t/** User application root. Codegen defaults to `<appRoot>/src/generated`.\n\t * Defaults to `process.cwd()`. */\n\treadonly appRoot?: string;\n\t/** Codegen output overrides for embedded tests or custom app layout. */\n\treadonly codegen?: Omit<ProductionCodegenOptions, 'appRoot'>;\n\t/** Filesystem root under which the substrate stores per-stack\n\t * artifacts (cache, snapshots, manifest, projection, etc.).\n\t * Precedence: `runtimeRoot` > `stateDir` (this option or\n\t * `DevstackOptions.stateDir` on the stack) > `$DEVSTACK_STATE_DIR`\n\t * > `<cwd>/.devstack`. */\n\treadonly runtimeRoot?: string;\n\t/** Sibling of `runtimeRoot` — the `DevstackOptions.stateDir` field\n\t * threaded through `runStack` so a stack-level default can be\n\t * overridden per-embedding without forcing every call site to\n\t * flip between `runtimeRoot` and `stateDir`. Same semantics as\n\t * `runtimeRoot`; lower precedence. */\n\treadonly stateDir?: string;\n\t/** Extend the plugin execution context after built-in plugin\n\t * services are installed. Use this for custom plugin-author\n\t * services, capability sinks, or logger overrides. */\n\treadonly extendContext?: (\n\t\tctx: Context.Context<never>,\n\t) => Effect.Effect<Context.Context<never>, never, Scope.Scope | CapabilitySinksService>;\n}\n\n/** Boot error surfaced by `RunHandle.start`. Wraps the supervisor's\n * startup failure tree for cascade-formatter rendering. */\nexport interface BootError {\n\treadonly _tag: 'BootError';\n\treadonly cause: Cause.Cause<unknown>;\n}\n\n/** Programmatic handle. Symmetric with the attached CLI surface:\n * `events`, `state`, and `awaitShutdown` are the same primitives the\n * TUI consumes in-process. */\nexport interface RunHandle {\n\t/** Boot the supervisor and resolve when every plugin reaches\n\t * `ready`. Fails with `BootError` if any plugin's acquire path\n\t * fails. */\n\treadonly start: Effect.Effect<void, BootError, never>;\n\t/** Trigger graceful shutdown: enqueues `shutdown.requested` onto\n\t * the supervisor's command channel, then awaits the fiber. */\n\treadonly stop: Effect.Effect<void, never, never>;\n\t/** Resolve when the supervisor fiber exits. Succeeds on a clean\n\t * shutdown; fails with the captured `Cause` if the supervisor died\n\t * mid-run after boot completed (e.g. a plugin scope finalizer\n\t * defect). Boot-time failures still surface via `start`. */\n\treadonly awaitShutdown: Effect.Effect<void, unknown, never>;\n\t/** Tail of typed engine events from the supervisor's hub. The\n\t * upstream is a `Queue.Dequeue`; consume via `Stream.run...`. */\n\treadonly events: Stream.Stream<EngineEvent, never, never>;\n\t/** The supervisor's live projection. Renderers + tests read this\n\t * directly; changes flow through `SubscriptionRef.changes`. */\n\treadonly state: SubscriptionRef.SubscriptionRef<SubscribableState>;\n}\n\n// -----------------------------------------------------------------------------\n// Identity resolution\n// -----------------------------------------------------------------------------\n\nconst resolveIdentity = (\n\tstack: Stack<ReadonlyArray<AnyPlugin>>,\n\topts: RunStackIdentityOptions | undefined,\n\tcwd: string,\n): Identity => {\n\tconst app = resolveAppName({\n\t\texplicit: opts?.app,\n\t\tcwd,\n\t});\n\tconst stackNameStr = resolveStackName({\n\t\texplicit: opts?.stack ?? stack.options.stackName,\n\t\tcwd,\n\t});\n\t// Parse + validate up-front so a malformed value fails here rather\n\t// than downstream when a plugin probes the chain id. We keep the\n\t// raw input string (`'sui:local'`, `'sui:testnet'`, …) for the\n\t// chain-id brand so existing on-disk cache namespaces and plugin\n\t// equality checks (`chain === 'sui:testnet'`) remain stable.\n\tconst resolved = resolveNetworkSync({\n\t\texplicit: opts?.network,\n\t\tenv: process.env.DEVSTACK_NETWORK,\n\t\texplicitSource: 'runStack({ identity.network })',\n\t});\n\treturn {\n\t\tapp: appName(app),\n\t\tstack: stackName(stackNameStr),\n\t\tchain: chainId(resolved.raw),\n\t};\n};\n\nconst toBootError = (cause: Cause.Cause<unknown>): BootError => ({\n\t_tag: 'BootError',\n\tcause,\n});\n\n// -----------------------------------------------------------------------------\n// runStack\n// -----------------------------------------------------------------------------\n\n/**\n * Boot a `Stack` for programmatic embedding. Returns a `RunHandle`\n * synchronously; the supervisor fiber is forked on `start`.\n *\n * Lifecycle:\n *\n * 1. `runStack(stack, opts)` — synchronous; no fiber forked yet.\n * 2. `await Effect.runPromise(handle.start)` — forks the supervisor,\n * blocks until every plugin reaches `ready` (or fails with\n * `BootError`).\n * 3. Use `handle.events` / `handle.state` to observe.\n * 4. `await Effect.runPromise(handle.stop)` — graceful shutdown.\n * 5. `handle.awaitShutdown` resolves once finalizers complete.\n *\n * Internal architecture: the handle stores a `Deferred` for boot\n * completion. The supervised body forks a watcher fiber over the\n * registry's `awaitReady` per node; once every node is `ready` (or one\n * fails) the deferred completes. `start` awaits it.\n */\nexport const runStack = (\n\tstack: Stack<ReadonlyArray<AnyPlugin>>,\n\topts: RunStackOptions = {},\n): RunHandle => {\n\tconst engineStack = readStackEngine(stack);\n\tconst runtimeRoot = resolveStateDir({\n\t\truntimeRoot: opts.runtimeRoot,\n\t\tstateDir: opts.stateDir ?? engineStack.options.stateDir,\n\t\tenv: process.env.DEVSTACK_STATE_DIR,\n\t\tcwd: process.cwd(),\n\t});\n\tconst appRoot = opts.appRoot ?? process.cwd();\n\tconst identity = resolveIdentity(stack, opts.identity, appRoot);\n\tconst codegen = opts.codegen ?? engineStack.options.codegen;\n\n\tconst supervisedStack = {\n\t\t_tag: 'Stack' as const,\n\t\tmembers: engineStack.members,\n\t\toptions: engineStack.options,\n\t};\n\n\t// State + handle slots are created at `runStack(...)` time so the\n\t// caller can subscribe to `state.changes` BEFORE `start` runs.\n\t// `Deferred.make` is sync-effect (no side-effects, no async);\n\t// `Effect.runSync` is safe for it. The projection ref is allocated\n\t// via the explicit `makeProjectionRefSync` so the sync contract is\n\t// pinned at the substrate constructor — if `makeProjectionRef`\n\t// ever picks up an async/Layer wrapper (`withSpan`, annotation),\n\t// `makeProjectionRefSync` must remain sync-only or be replaced by\n\t// a Deferred-handoff seam at this boot-time call site.\n\tconst state = makeProjectionRefSync();\n\tconst bootDeferred = Effect.runSync(Deferred.make<void, BootError>());\n\tconst stopRequested = Effect.runSync(Deferred.make<void>());\n\tconst eventQueueRef = Effect.runSync(Deferred.make<Queue.Dequeue<EngineEvent>>());\n\tconst fiberRef = Effect.runSync(Deferred.make<Fiber.Fiber<void, never>>());\n\tconst startClaim = Effect.runSync(Ref.make(false));\n\t// Tee for mid-run defects/failures. `Deferred.fail(bootDeferred, …)`\n\t// below is a no-op once `bootDeferred` has succeeded (post-boot), so\n\t// without this sibling ref a late scope-finalizer defect would\n\t// otherwise leave the supervised fiber exiting `Success(void)` and\n\t// `awaitShutdown` resolving clean — the operator would have no\n\t// signal. `awaitShutdown` re-raises whatever this ref captured.\n\tconst midRunCauseRef = Effect.runSync(Ref.make<Cause.Cause<unknown> | null>(null));\n\n\t// Resolve the per-stack codegen output location: primary run (effective\n\t// stack === config `stackName`) → `src/generated/`; a secondary\n\t// embedding → `.devstack/stacks/<stack>/generated/`. An explicit\n\t// `opts.codegen.outputDir` (or the stack's own\n\t// `codegen.outputDir`) is honored verbatim by the resolver. Both the\n\t// primary stack (`engineStack.options.stackName`) and the effective\n\t// stack (the resolved `identity.stack`) are in scope here, mirroring\n\t// the CLI's `buildVerbLayers` seam.\n\tconst codegenOutput = resolveCodegenOutput({\n\t\tappRoot,\n\t\teffectiveStack: String(identity.stack),\n\t\tprimaryStack: engineStack.options.stackName,\n\t\texplicitOutputDir: codegen?.outputDir,\n\t\texplicitStackSubdir: codegen?.stackSubdir ?? null,\n\t});\n\tconst substrate = layerProductionOrchestrators({\n\t\tcodegen: {\n\t\t\tappRoot,\n\t\t\toutputDir: codegenOutput.outputDir,\n\t\t\tstackSubdir: codegenOutput.stackSubdir,\n\t\t},\n\t}).pipe(Layer.provideMerge(buildSubstrateLayers(identity, runtimeRoot)));\n\n\tconst supervised = Effect.gen(function* () {\n\t\tconst orchestratorSinks = yield* buildProductionOrchestratorSinks();\n\t\tconst postAcquireHook = yield* buildProductionPostAcquireHook({ extras: stack.options.extras });\n\t\tyield* superviseStackEffect(supervisedStack, identity, state, {\n\t\t\torchestratorSinks,\n\t\t\tpostAcquireHook,\n\t\t\textendContext: (ctx) =>\n\t\t\t\tEffect.gen(function* () {\n\t\t\t\t\tconst builtInContext = yield* extendBuiltInPluginContext(ctx);\n\t\t\t\t\treturn opts.extendContext === undefined\n\t\t\t\t\t\t? builtInContext\n\t\t\t\t\t\t: yield* opts.extendContext(builtInContext);\n\t\t\t\t}),\n\t\t\tbeforeInitialAcquire: (handle) =>\n\t\t\t\tEffect.gen(function* () {\n\t\t\t\t\tyield* Deferred.succeed(eventQueueRef, handle.events).pipe(\n\t\t\t\t\t\tEffect.catch(() => Effect.void),\n\t\t\t\t\t);\n\n\t\t\t\t\t// Bridge `stop` requests onto the supervisor's command\n\t\t\t\t\t// channel before acquire starts so a boot failure cannot\n\t\t\t\t\t// leave the public handle without an event/command bridge.\n\t\t\t\t\tyield* Effect.forkScoped(\n\t\t\t\t\t\tEffect.gen(function* () {\n\t\t\t\t\t\t\tyield* Deferred.await(stopRequested);\n\t\t\t\t\t\t\tyield* Queue.offer(handle.commands, {\n\t\t\t\t\t\t\t\ttag: 'shutdown.requested',\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t}),\n\t\t\twithinScope: (handle) =>\n\t\t\t\tEffect.gen(function* () {\n\t\t\t\t\t// Watch every plugin for `ready`; resolve `bootDeferred` once\n\t\t\t\t\t// every node has reached ready (or one fails). The\n\t\t\t\t\t// `awaitReady` callbacks resolve from the per-plugin\n\t\t\t\t\t// ready-gates the registry holds — see supervisor §\n\t\t\t\t\t// \"ready-gate awaits its acquire effect\".\n\t\t\t\t\t// Both forks tie to the surrounding scope (the supervised\n\t\t\t\t\t// scope inside superviseStackEffect). When the supervisor\n\t\t\t\t\t// scope closes — either via graceful shutdown or interrupt\n\t\t\t\t\t// — these fibers are torn down with it.\n\t\t\t\t\tyield* Effect.forkScoped(\n\t\t\t\t\t\tEffect.gen(function* () {\n\t\t\t\t\t\t\tconst exits = yield* Effect.forEach(\n\t\t\t\t\t\t\t\thandle.graph.nodes,\n\t\t\t\t\t\t\t\t([key]) => handle.registry.awaitReady(key).pipe(Effect.exit),\n\t\t\t\t\t\t\t\t{ concurrency: 'unbounded' },\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tconst firstFailure = exits.find(Exit.isFailure);\n\t\t\t\t\t\t\tif (firstFailure === undefined) {\n\t\t\t\t\t\t\t\tyield* Deferred.succeed(bootDeferred, undefined);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tyield* Deferred.fail(bootDeferred, toBootError(firstFailure.cause));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t}),\n\t\t}).pipe(Effect.provide(layerBuiltInPluginRuntime(orchestratorSinks)));\n\t});\n\n\tconst loggerLayer = Logger.layer([]);\n\tconst layered = supervised.pipe(Effect.provide(substrate), Effect.provide(loggerLayer));\n\n\t// Convert any uncaught cause into a boot failure if the deferred\n\t// hasn't completed. If `bootDeferred` HAS already succeeded then\n\t// `Deferred.fail` is a no-op — the cause is a mid-run failure\n\t// (e.g. a plugin scope finalizer defect) and would otherwise be\n\t// silently dropped: the fiber exits `Success(void)` and\n\t// `awaitShutdown` resolves clean. Tee the cause into\n\t// `midRunCauseRef` so `awaitShutdown` can re-surface it, AND emit\n\t// `Effect.logError(Cause.pretty(cause))` so observability stays\n\t// loud regardless of whether anyone awaits. Boot failures (still in\n\t// the bootDeferred-pending window) only surface via `start`, not\n\t// here — we'd otherwise re-raise them on `awaitShutdown` after\n\t// `start` already rejected.\n\tconst supervisedProgram: Effect.Effect<void, never, never> = layered.pipe(\n\t\tEffect.catchCause((cause) =>\n\t\t\tEffect.gen(function* () {\n\t\t\t\tconst bootAlreadyCompleted = yield* Deferred.isDone(bootDeferred);\n\t\t\t\tyield* Deferred.fail(bootDeferred, toBootError(cause)).pipe(\n\t\t\t\t\tEffect.asVoid,\n\t\t\t\t\tEffect.catch(() => Effect.void),\n\t\t\t\t);\n\t\t\t\tif (bootAlreadyCompleted) {\n\t\t\t\t\tyield* Ref.set(midRunCauseRef, cause);\n\t\t\t\t}\n\t\t\t\tyield* Effect.logError(`devstack runStack: supervisor died\\n${Cause.pretty(cause)}`);\n\t\t\t}),\n\t\t),\n\t);\n\n\tconst start: Effect.Effect<void, BootError, never> = Effect.uninterruptibleMask((restore) =>\n\t\tEffect.gen(function* () {\n\t\t\tconst shouldStart = yield* Ref.modify(startClaim, (started) =>\n\t\t\t\tstarted ? [false, true] : [true, true],\n\t\t\t);\n\t\t\tif (shouldStart) {\n\t\t\t\t// `forkDetach` (v4 spelling of v3's `forkDaemon`) decouples the\n\t\t\t\t// supervisor fiber from the `start` fiber's scope. `forkChild`\n\t\t\t\t// would tie the supervisor to whatever fiber runs `start`, and\n\t\t\t\t// once `start` resolves (after `bootDeferred` succeeds) the\n\t\t\t\t// runtime would interrupt the supervisor — transitioning every\n\t\t\t\t// plugin `ready → stopping → stopped` before the caller can\n\t\t\t\t// read post-ready state or call `handle.stop`. The handle's\n\t\t\t\t// explicit `stop` + `awaitShutdown` paths are the only\n\t\t\t\t// shutdown signals; the captured `Fiber` reference is how the\n\t\t\t\t// daemon stays releasable.\n\t\t\t\tconst fiber = yield* Effect.forkDetach(supervisedProgram);\n\t\t\t\tyield* Deferred.succeed(fiberRef, fiber);\n\t\t\t}\n\t\t\tyield* restore(Deferred.await(bootDeferred));\n\t\t}),\n\t);\n\n\tconst stop: Effect.Effect<void, never, never> = Effect.gen(function* () {\n\t\tyield* Deferred.succeed(stopRequested, undefined).pipe(Effect.catch(() => Effect.void));\n\t\tconst alreadyStarted = yield* Deferred.isDone(fiberRef);\n\t\tif (!alreadyStarted) {\n\t\t\treturn;\n\t\t}\n\t\tconst fiber = yield* Deferred.await(fiberRef);\n\t\t// `Fiber.await` returns an `Exit` without raising — handles both\n\t\t// success and interrupt-cause cases (the supervisor's\n\t\t// graceful-shutdown path closes the scope, which surfaces as an\n\t\t// interrupt cause if the fiber was mid-await on the latch poll).\n\t\tyield* Fiber.await(fiber);\n\t});\n\n\tconst awaitShutdown: Effect.Effect<void, unknown, never> = Effect.gen(function* () {\n\t\tconst alreadyStarted = yield* Deferred.isDone(fiberRef);\n\t\tif (!alreadyStarted) {\n\t\t\treturn;\n\t\t}\n\t\tconst fiber = yield* Deferred.await(fiberRef);\n\t\tyield* Fiber.await(fiber);\n\t\t// Re-surface any mid-run defect/failure captured by the\n\t\t// supervised body's `catchCause` (boot failures are already\n\t\t// surfaced via `start`). Without this re-raise a plugin scope\n\t\t// finalizer defect would silently drop and operators get no\n\t\t// signal — see the comment on `midRunCauseRef` above.\n\t\tconst midRunCause = yield* Ref.get(midRunCauseRef);\n\t\tif (midRunCause !== null) {\n\t\t\treturn yield* Effect.failCause(midRunCause);\n\t\t}\n\t});\n\n\tconst events: Stream.Stream<EngineEvent, never, never> = Stream.unwrap(\n\t\tEffect.gen(function* () {\n\t\t\tconst queue = yield* Deferred.await(eventQueueRef);\n\t\t\treturn Stream.fromQueue(queue);\n\t\t}),\n\t);\n\n\treturn {\n\t\tstart,\n\t\tstop,\n\t\tawaitShutdown,\n\t\tevents,\n\t\tstate,\n\t};\n};\n"],"mappings":";;;;;;;;;;;;AAgJA,MAAM,mBACL,OACA,MACA,QACc;CACd,MAAM,MAAM,eAAe;EAC1B,UAAU,MAAM;EAChB;EACA,CAAC;CACF,MAAM,eAAe,iBAAiB;EACrC,UAAU,MAAM,SAAS,MAAM,QAAQ;EACvC;EACA,CAAC;CAMF,MAAM,WAAW,mBAAmB;EACnC,UAAU,MAAM;EAChB,KAAK,QAAQ,IAAI;EACjB,gBAAgB;EAChB,CAAC;AACF,QAAO;EACN,KAAK,QAAQ,IAAI;EACjB,OAAO,UAAU,aAAa;EAC9B,OAAO,QAAQ,SAAS,IAAI;EAC5B;;AAGF,MAAM,eAAe,WAA4C;CAChE,MAAM;CACN;CACA;;;;;;;;;;;;;;;;;;;;AAyBD,MAAa,YACZ,OACA,OAAwB,EAAE,KACX;CACf,MAAM,cAAc,gBAAgB,MAAM;CAC1C,MAAM,cAAc,gBAAgB;EACnC,aAAa,KAAK;EAClB,UAAU,KAAK,YAAY,YAAY,QAAQ;EAC/C,KAAK,QAAQ,IAAI;EACjB,KAAK,QAAQ,KAAK;EAClB,CAAC;CACF,MAAM,UAAU,KAAK,WAAW,QAAQ,KAAK;CAC7C,MAAM,WAAW,gBAAgB,OAAO,KAAK,UAAU,QAAQ;CAC/D,MAAM,UAAU,KAAK,WAAW,YAAY,QAAQ;CAEpD,MAAM,kBAAkB;EACvB,MAAM;EACN,SAAS,YAAY;EACrB,SAAS,YAAY;EACrB;CAWD,MAAM,QAAQ,uBAAuB;CACrC,MAAM,eAAe,OAAO,QAAQ,SAAS,MAAuB,CAAC;CACrE,MAAM,gBAAgB,OAAO,QAAQ,SAAS,MAAY,CAAC;CAC3D,MAAM,gBAAgB,OAAO,QAAQ,SAAS,MAAkC,CAAC;CACjF,MAAM,WAAW,OAAO,QAAQ,SAAS,MAAgC,CAAC;CAC1E,MAAM,aAAa,OAAO,QAAQ,IAAI,KAAK,MAAM,CAAC;CAOlD,MAAM,iBAAiB,OAAO,QAAQ,IAAI,KAAkC,KAAK,CAAC;CAUlF,MAAM,gBAAgB,qBAAqB;EAC1C;EACA,gBAAgB,OAAO,SAAS,MAAM;EACtC,cAAc,YAAY,QAAQ;EAClC,mBAAmB,SAAS;EAC5B,qBAAqB,SAAS,eAAe;EAC7C,CAAC;CACF,MAAM,YAAY,6BAA6B,EAC9C,SAAS;EACR;EACA,WAAW,cAAc;EACzB,aAAa,cAAc;EAC3B,EACD,CAAC,CAAC,KAAK,MAAM,aAAa,qBAAqB,UAAU,YAAY,CAAC,CAAC;CAExE,MAAM,aAAa,OAAO,IAAI,aAAa;EAC1C,MAAM,oBAAoB,OAAO,kCAAkC;AAEnE,SAAO,qBAAqB,iBAAiB,UAAU,OAAO;GAC7D;GACA,iBAAA,OAH8B,+BAA+B,EAAE,QAAQ,MAAM,QAAQ,QAAQ,CAAC;GAI9F,gBAAgB,QACf,OAAO,IAAI,aAAa;IACvB,MAAM,iBAAiB,OAAO,2BAA2B,IAAI;AAC7D,WAAO,KAAK,kBAAkB,KAAA,IAC3B,iBACA,OAAO,KAAK,cAAc,eAAe;KAC3C;GACH,uBAAuB,WACtB,OAAO,IAAI,aAAa;AACvB,WAAO,SAAS,QAAQ,eAAe,OAAO,OAAO,CAAC,KACrD,OAAO,YAAY,OAAO,KAAK,CAC/B;AAKD,WAAO,OAAO,WACb,OAAO,IAAI,aAAa;AACvB,YAAO,SAAS,MAAM,cAAc;AACpC,YAAO,MAAM,MAAM,OAAO,UAAU,EACnC,KAAK,sBACL,CAAC;MACD,CACF;KACA;GACH,cAAc,WACb,OAAO,IAAI,aAAa;AAUvB,WAAO,OAAO,WACb,OAAO,IAAI,aAAa;KAMvB,MAAM,gBAAe,OALA,OAAO,QAC3B,OAAO,MAAM,QACZ,CAAC,SAAS,OAAO,SAAS,WAAW,IAAI,CAAC,KAAK,OAAO,KAAK,EAC5D,EAAE,aAAa,aAAa,CAC5B,EAC0B,KAAK,KAAK,UAAU;AAC/C,SAAI,iBAAiB,KAAA,EACpB,QAAO,SAAS,QAAQ,cAAc,KAAA,EAAU;SAEhD,QAAO,SAAS,KAAK,cAAc,YAAY,aAAa,MAAM,CAAC;MAEnE,CACF;KACA;GACH,CAAC,CAAC,KAAK,OAAO,QAAQ,0BAA0B,kBAAkB,CAAC,CAAC;GACpE;CAEF,MAAM,cAAc,OAAO,MAAM,EAAE,CAAC;CAepC,MAAM,oBAdU,WAAW,KAAK,OAAO,QAAQ,UAAU,EAAE,OAAO,QAAQ,YAAY,CAclB,CAAC,KACpE,OAAO,YAAY,UAClB,OAAO,IAAI,aAAa;EACvB,MAAM,uBAAuB,OAAO,SAAS,OAAO,aAAa;AACjE,SAAO,SAAS,KAAK,cAAc,YAAY,MAAM,CAAC,CAAC,KACtD,OAAO,QACP,OAAO,YAAY,OAAO,KAAK,CAC/B;AACD,MAAI,qBACH,QAAO,IAAI,IAAI,gBAAgB,MAAM;AAEtC,SAAO,OAAO,SAAS,uCAAuC,MAAM,OAAO,MAAM,GAAG;GACnF,CACF,CACD;AAgED,QAAO;EACN,OA/DoD,OAAO,qBAAqB,YAChF,OAAO,IAAI,aAAa;AAIvB,OAAI,OAHuB,IAAI,OAAO,aAAa,YAClD,UAAU,CAAC,OAAO,KAAK,GAAG,CAAC,MAAM,KAAK,CACtC,EACgB;IAWhB,MAAM,QAAQ,OAAO,OAAO,WAAW,kBAAkB;AACzD,WAAO,SAAS,QAAQ,UAAU,MAAM;;AAEzC,UAAO,QAAQ,SAAS,MAAM,aAAa,CAAC;IAC3C,CA2CG;EACL,MAzC+C,OAAO,IAAI,aAAa;AACvE,UAAO,SAAS,QAAQ,eAAe,KAAA,EAAU,CAAC,KAAK,OAAO,YAAY,OAAO,KAAK,CAAC;AAEvF,OAAI,EAAC,OADyB,SAAS,OAAO,SAAS,EAEtD;GAED,MAAM,QAAQ,OAAO,SAAS,MAAM,SAAS;AAK7C,UAAO,MAAM,MAAM,MAAM;IA8BrB;EACJ,eA5B0D,OAAO,IAAI,aAAa;AAElF,OAAI,EAAC,OADyB,SAAS,OAAO,SAAS,EAEtD;GAED,MAAM,QAAQ,OAAO,SAAS,MAAM,SAAS;AAC7C,UAAO,MAAM,MAAM,MAAM;GAMzB,MAAM,cAAc,OAAO,IAAI,IAAI,eAAe;AAClD,OAAI,gBAAgB,KACnB,QAAO,OAAO,OAAO,UAAU,YAAY;IAc/B;EACb,QAXwD,OAAO,OAC/D,OAAO,IAAI,aAAa;GACvB,MAAM,QAAQ,OAAO,SAAS,MAAM,cAAc;AAClD,UAAO,OAAO,UAAU,MAAM;IAC7B,CAOI;EACN;EACA"}
1
+ {"version":3,"file":"run-stack.mjs","names":[],"sources":["../../src/api/run-stack.ts"],"sourcesContent":["// `runStack(stack, opts?)` — top-level programmatic embedding.\n//\n// `defineDevstack(...)` returns a static `Stack<Members>` manifest with\n// no runnable surface. Library consumers (vitest setup, custom hosts,\n// Effect-native apps, embedded fixtures) would otherwise have to\n// re-implement `cli/wirings/up.ts:runUpLive`'s substrate Layer composition.\n// `runStack` is the single embedder seam — it consumes the same\n// `orchestrators/boot.ts` helpers the CLI consumes. See\n// ARCHITECTURE.md §\"Layer composition lives at L3, not L0\".\n//\n// This module is the THIN PUBLIC FACADE. The implementation — plus the\n// non-public boot-injection seam the CLI `up` verb routes through —\n// lives in `run-stack-internal.ts`. `runStack` delegates there with a\n// zero-`boot` bag, so the public surface (`RunHandle`, `RunStackOptions`,\n// `BootError`) and the zero-`boot` path stay byte-identical. The substrate\n// types on the internal seam (`InternalRunHandle`, the bag, the\n// `SupervisorHandle`) NEVER reach this public surface or `index.ts`.\n//\n// Shape:\n//\n// ```ts\n// const stack = defineDevstack(...);\n// const handle = runStack(stack, { runtimeRoot: '/tmp/devstack' });\n// await Effect.runPromise(handle.start);\n// // ... interact ...\n// await Effect.runPromise(handle.stop);\n// await Effect.runPromise(handle.awaitShutdown);\n// ```\n//\n// `start` resolves when every plugin has reached `ready` (or when one\n// fails to acquire — `start` then fails with `BootError`). `stop`\n// triggers graceful shutdown; `awaitShutdown` resolves when the fiber\n// finishes its scope finalizers.\n\nimport type { Cause, Context, Effect, Queue, Scope, Stream, SubscriptionRef } from 'effect';\n\nimport type { Identity } from '../substrate/identity.ts';\nimport type { EngineCommand, EngineEvent } from '../substrate/events.ts';\nimport type { SubscribableState } from '../substrate/projection.ts';\nimport type { ProductionCodegenOptions } from '../orchestrators/boot.ts';\nimport type { Stack } from './define-devstack.ts';\nimport type { AnyPlugin } from '../substrate/plugin.ts';\nimport { runStackWithBoot } from './run-stack-internal.ts';\n\n// -----------------------------------------------------------------------------\n// Public types\n// -----------------------------------------------------------------------------\n\n/** Identity overrides for `runStack`. App and stack fall back through\n * shared package metadata inference after their env overrides. */\nexport interface RunStackIdentityOptions {\n\treadonly app?: string;\n\treadonly stack?: string;\n\treadonly network?: string;\n}\n\nexport interface RunStackOptions {\n\t/** Identity overrides — falls back to env + library defaults. */\n\treadonly identity?: RunStackIdentityOptions;\n\t/** User application root. Codegen defaults to `<appRoot>/src/generated`.\n\t * Defaults to `process.cwd()`. */\n\treadonly appRoot?: string;\n\t/** Codegen output overrides for embedded tests or custom app layout. */\n\treadonly codegen?: Omit<ProductionCodegenOptions, 'appRoot'>;\n\t/** Filesystem root under which the substrate stores per-stack\n\t * artifacts (cache, snapshots, manifest, projection, etc.).\n\t * Precedence: `runtimeRoot` > `stateDir` (this option or\n\t * `DevstackOptions.stateDir` on the stack) > `$DEVSTACK_STATE_DIR`\n\t * > `<cwd>/.devstack`. */\n\treadonly runtimeRoot?: string;\n\t/** Sibling of `runtimeRoot` — the `DevstackOptions.stateDir` field\n\t * threaded through `runStack` so a stack-level default can be\n\t * overridden per-embedding without forcing every call site to\n\t * flip between `runtimeRoot` and `stateDir`. Same semantics as\n\t * `runtimeRoot`; lower precedence. */\n\treadonly stateDir?: string;\n\t/** Extend the plugin execution context after built-in plugin\n\t * services are installed. Use this for custom plugin-author\n\t * services or logger overrides. */\n\treadonly extendContext?: (\n\t\tctx: Context.Context<never>,\n\t) => Effect.Effect<Context.Context<never>, never, Scope.Scope>;\n}\n\n/** Boot error surfaced by `RunHandle.start`. Wraps the supervisor's\n * startup failure tree for cascade-formatter rendering. */\nexport interface BootError {\n\treadonly _tag: 'BootError';\n\treadonly cause: Cause.Cause<unknown>;\n}\n\n/**\n * The programmatic handle `runStack` returns. It is a small bag of Effect\n * values + readable refs — a functional surface, not an object with methods:\n * each lifecycle action (`start` / `stop` / `awaitShutdown`) is an\n * `Effect` you run, and each observation channel (`events` / `state`) is a\n * value you read. Returned synchronously, BEFORE any fiber is forked, so a\n * caller can subscribe to `state` / `events` ahead of `start`.\n *\n * Symmetric with the attached CLI surface: `events`, `state`, and\n * `awaitShutdown` are the SAME in-process primitives the TUI consumes.\n *\n * Typical use:\n *\n * const handle = runStack(stack, opts);\n * await Effect.runPromise(handle.start); // boot → all ready\n * const snapshot = await Effect.runPromise(SubscriptionRef.get(handle.state));\n * await Effect.runPromise(handle.stop); // graceful shutdown\n * await Effect.runPromise(handle.awaitShutdown); // finalizers done\n */\nexport interface RunHandle {\n\t/** Fork the supervisor fiber and resolve once EVERY plugin reaches\n\t * `ready` (or a terminal `done`). Fails with `BootError` if any\n\t * plugin's initial-acquire path fails. Idempotent: a second `start`\n\t * is a no-op that just awaits the same boot gate. */\n\treadonly start: Effect.Effect<void, BootError, never>;\n\t/** Request graceful shutdown: publishes `shutdown.requested` onto the\n\t * supervisor's command channel (driving scope finalizers), then awaits\n\t * the fiber. Safe to call before `start` (returns immediately) and\n\t * more than once. */\n\treadonly stop: Effect.Effect<void, never, never>;\n\t/** Resolve when the supervisor fiber exits. Succeeds on a clean\n\t * shutdown; fails with the captured `Cause` if the supervisor died\n\t * mid-run AFTER boot completed (e.g. a plugin scope-finalizer defect).\n\t * Boot-time failures surface via `start`, not here — so a host that\n\t * blocks the process on this Effect stays up for the supervisor's\n\t * whole lifetime and learns of a post-boot death. */\n\treadonly awaitShutdown: Effect.Effect<void, unknown, never>;\n\t/** Tail of typed engine events off the supervisor's hub. SINGLE\n\t * CONSUMER: the upstream is a `Queue.Dequeue`, so taking an event\n\t * removes it — running this stream from two places SPLITS the events\n\t * between them rather than fanning out. Consume it once (e.g. via\n\t * `Stream.runForEach`) and tee downstream if you need multiple sinks.\n\t * Empty until `start` wires the hub. */\n\treadonly events: Stream.Stream<EngineEvent, never, never>;\n\t/** The supervisor's live projection — the single read-model of stack\n\t * state (identity, per-plugin lifecycle, cycle phase, log tail). Live\n\t * for the supervisor's whole process lifetime: snapshot it with\n\t * `SubscriptionRef.get`, or observe updates via `SubscriptionRef.changes`.\n\t * Renderers + tests read it directly; nothing writes through it. */\n\treadonly state: SubscriptionRef.SubscriptionRef<SubscribableState>;\n\t/** Fire-and-forget publish side of the supervisor's command channel —\n\t * enqueue an `EngineCommand` (`shutdown.requested`,\n\t * `selective-restart.requested`, snapshot/wipe/prune verbs, …) and\n\t * return immediately. The same queue the supervisor drains; the signal\n\t * handler and the `stop` bridge publish here too. Use `runCommand` when\n\t * you need to await the command's outcome. */\n\treadonly commands: Queue.Enqueue<EngineCommand>;\n\t/** Submit-and-AWAIT dispatch: publishes `command` in-band on the\n\t * supervisor's command loop and resolves when the loop finishes\n\t * handling it, re-failing with the handler's cause. Use this (over\n\t * `commands`) when the caller must know the command succeeded —\n\t * e.g. a destructive `snapshot.restore`. (The cross-process IPC bridge\n\t * layers ack-correlation on top of this.) */\n\treadonly runCommand: (command: EngineCommand) => Effect.Effect<void, unknown, never>;\n\t/** The resolved `Identity` — app / stack / network — this handle booted\n\t * with, after all option > env > inference resolution. Available\n\t * synchronously, BEFORE `start`. */\n\treadonly identity: Identity;\n}\n\n// -----------------------------------------------------------------------------\n// runStack\n// -----------------------------------------------------------------------------\n\n/**\n * Boot a `Stack` for programmatic embedding. Returns a `RunHandle`\n * synchronously; the supervisor fiber is forked on `start`.\n *\n * Programmatic contract — call, then drive the returned handle's Effects:\n *\n * 1. `runStack(stack, opts)` — synchronous; NO fiber forked yet. Safe to\n * read `handle.identity` and subscribe to `handle.state` /\n * `handle.events` right away.\n * 2. `await Effect.runPromise(handle.start)` — forks the supervisor and\n * blocks until every plugin reaches `ready` (or fails with `BootError`).\n * 3. Observe via `handle.state` (snapshot / changes) and `handle.events`\n * (single-consumer tail); drive via `handle.commands` /\n * `handle.runCommand`.\n * 4. `await Effect.runPromise(handle.stop)` — graceful shutdown.\n * 5. `await Effect.runPromise(handle.awaitShutdown)` — resolves once scope\n * finalizers complete (or re-raises a post-boot supervisor death).\n *\n * Thin facade: delegates to `runStackWithBoot` (in `run-stack-internal.ts`)\n * with a zero-`boot` bag and no `commandHandler`, so this public path is\n * byte-identical to the pre-seam `runStack` body. The boot-injection seam\n * the CLI `up` verb consumes is non-public — it is NOT re-exported from\n * `index.ts`, and its substrate types never appear on `RunHandle`.\n */\nexport const runStack = (\n\tstack: Stack<ReadonlyArray<AnyPlugin>>,\n\topts: RunStackOptions = {},\n): RunHandle => runStackWithBoot(stack, { ...opts, commandHandler: undefined, boot: undefined });\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA6LA,MAAa,YACZ,OACA,OAAwB,CAAC,MACV,iBAAiB,OAAO;CAAE,GAAG;CAAM,gBAAgB,KAAA;CAAW,MAAM,KAAA;AAAU,CAAC"}
@@ -0,0 +1,61 @@
1
+ //#region src/build-integrations/dapp-kit/index.d.ts
2
+ /** A wallet-standard account as surfaced by dApp Kit. The dev wallet sets each
3
+ * account's `label` to its devstack account name (`alice`, `bob`, …). */
4
+ interface UiWalletAccountLike {
5
+ readonly address: string;
6
+ readonly label?: string;
7
+ }
8
+ interface UiWalletLike {
9
+ readonly name: string;
10
+ readonly accounts: readonly UiWalletAccountLike[];
11
+ }
12
+ /**
13
+ * The slice of a dApp Kit instance this bridge drives, generic over the app's
14
+ * concrete wallet type `W` (inferred from `$wallets`). The account type is
15
+ * DERIVED as `W['accounts'][number]` rather than inferred separately, so the
16
+ * objects pulled from `$wallets` flow back into `connectWallet` /
17
+ * `switchAccount` as their real (branded `UiWallet` / `UiWalletAccount`) types
18
+ * — a structural stand-in is not assignable to dApp Kit's branded parameters.
19
+ * The app passes its real `createDAppKit(...)` return value and `W` is inferred.
20
+ */
21
+ interface TestableDAppKit<W extends UiWalletLike> {
22
+ connectWallet(args: {
23
+ wallet: W;
24
+ account: W['accounts'][number];
25
+ }): Promise<unknown>;
26
+ switchAccount(args: {
27
+ account: W['accounts'][number];
28
+ }): void;
29
+ readonly stores: {
30
+ readonly $wallets: {
31
+ get(): readonly W[];
32
+ };
33
+ readonly $connection: {
34
+ get(): {
35
+ readonly isConnected: boolean;
36
+ readonly wallet: {
37
+ readonly name: string;
38
+ } | null;
39
+ };
40
+ };
41
+ };
42
+ }
43
+ /**
44
+ * Register `dAppKit` with the `globalThis.__devstackDAppKit__` test slot that
45
+ * Playwright's `connectAs` / `selectAccount` helpers drive. Call once, DEV-only,
46
+ * after `createDAppKit(...)`:
47
+ *
48
+ * ```ts
49
+ * export const dAppKit = createDAppKit({ ... });
50
+ * if (import.meta.env.DEV) registerDAppKitForTesting(dAppKit);
51
+ * ```
52
+ *
53
+ * The published `selectAccount` performs a real connection: if already connected
54
+ * to the dev wallet it switches the active account; otherwise it connects,
55
+ * selecting the requested account. Account names resolve to the dev wallet's
56
+ * wallet-standard accounts by `label` (the devstack account name).
57
+ */
58
+ declare function registerDAppKitForTesting<W extends UiWalletLike>(dAppKit: TestableDAppKit<W>): void;
59
+ //#endregion
60
+ export { TestableDAppKit, registerDAppKitForTesting };
61
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1,58 @@
1
+ import "../runtime/dapp-kit-slot.mjs";
2
+ //#region src/build-integrations/dapp-kit/index.ts
3
+ /** How long `selectAccount` waits for the dev wallet (and the requested
4
+ * account) to register before giving up — the wallet comes up asynchronously,
5
+ * so a `connectAs(...)` fired right after page load may beat it. */
6
+ const RESOLVE_TIMEOUT_MS = 1e4;
7
+ const RESOLVE_POLL_MS = 50;
8
+ const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
9
+ /**
10
+ * Register `dAppKit` with the `globalThis.__devstackDAppKit__` test slot that
11
+ * Playwright's `connectAs` / `selectAccount` helpers drive. Call once, DEV-only,
12
+ * after `createDAppKit(...)`:
13
+ *
14
+ * ```ts
15
+ * export const dAppKit = createDAppKit({ ... });
16
+ * if (import.meta.env.DEV) registerDAppKitForTesting(dAppKit);
17
+ * ```
18
+ *
19
+ * The published `selectAccount` performs a real connection: if already connected
20
+ * to the dev wallet it switches the active account; otherwise it connects,
21
+ * selecting the requested account. Account names resolve to the dev wallet's
22
+ * wallet-standard accounts by `label` (the devstack account name).
23
+ */
24
+ function registerDAppKitForTesting(dAppKit) {
25
+ const resolveLabelledAccount = async (accountName) => {
26
+ const deadline = Date.now() + RESOLVE_TIMEOUT_MS;
27
+ for (;;) {
28
+ for (const wallet of dAppKit.stores.$wallets.get()) {
29
+ const account = wallet.accounts.find((candidate) => candidate.label === accountName);
30
+ if (account !== void 0) return {
31
+ wallet,
32
+ account
33
+ };
34
+ }
35
+ if (Date.now() >= deadline) return null;
36
+ await sleep(RESOLVE_POLL_MS);
37
+ }
38
+ };
39
+ const selectAccount = async (accountName) => {
40
+ const found = await resolveLabelledAccount(accountName);
41
+ if (found === null) throw new Error(`connectAs("${accountName}"): no dev-wallet account labelled "${accountName}" registered within ${RESOLVE_TIMEOUT_MS}ms. Confirm the dev wallet is injected and the account name exists.`);
42
+ const { wallet, account } = found;
43
+ const connection = dAppKit.stores.$connection.get();
44
+ if (connection.isConnected && connection.wallet?.name === wallet.name) {
45
+ dAppKit.switchAccount({ account });
46
+ return;
47
+ }
48
+ await dAppKit.connectWallet({
49
+ wallet,
50
+ account
51
+ });
52
+ };
53
+ globalThis.__devstackDAppKit__ = { selectAccount };
54
+ }
55
+ //#endregion
56
+ export { registerDAppKitForTesting };
57
+
58
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../src/build-integrations/dapp-kit/index.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n//\n// dApp Kit test bridge — registers an app's dApp Kit instance so the Playwright\n// `connectAs` helper can drive a REAL connection during e2e.\n//\n// This is a TESTING feature, not an app feature. The app calls\n// `registerDAppKitForTesting(dAppKit)` DEV-only (it is a no-op consumer in\n// production: a `vite build` strips the `import.meta.env.DEV` branch and the\n// dev wallet is never injected). It performs NO connection on its own — the app\n// loads disconnected, dApp Kit's own `autoConnect` only re-connects a genuine\n// prior session, and an actual connection happens solely when a test calls the\n// published slot.\n//\n// The connection goes through dApp Kit's public API (`connectWallet` /\n// `switchAccount`) — no localStorage seeding, no narrowing/widening the\n// wallet's exposed accounts.\n//\n// Browser-safe: this module (and the `dapp-kit-slot` contract it imports) must\n// never pull in `node:*` — it is bundled into app pages by Vite.\n\nimport { DAPP_KIT_SLOT_KEY, type DAppKitSlot } from '../runtime/dapp-kit-slot.ts';\n\n/** A wallet-standard account as surfaced by dApp Kit. The dev wallet sets each\n * account's `label` to its devstack account name (`alice`, `bob`, …). */\ninterface UiWalletAccountLike {\n\treadonly address: string;\n\treadonly label?: string;\n}\n\ninterface UiWalletLike {\n\treadonly name: string;\n\treadonly accounts: readonly UiWalletAccountLike[];\n}\n\n/**\n * The slice of a dApp Kit instance this bridge drives, generic over the app's\n * concrete wallet type `W` (inferred from `$wallets`). The account type is\n * DERIVED as `W['accounts'][number]` rather than inferred separately, so the\n * objects pulled from `$wallets` flow back into `connectWallet` /\n * `switchAccount` as their real (branded `UiWallet` / `UiWalletAccount`) types\n * — a structural stand-in is not assignable to dApp Kit's branded parameters.\n * The app passes its real `createDAppKit(...)` return value and `W` is inferred.\n */\nexport interface TestableDAppKit<W extends UiWalletLike> {\n\tconnectWallet(args: { wallet: W; account: W['accounts'][number] }): Promise<unknown>;\n\tswitchAccount(args: { account: W['accounts'][number] }): void;\n\treadonly stores: {\n\t\treadonly $wallets: { get(): readonly W[] };\n\t\treadonly $connection: {\n\t\t\tget(): { readonly isConnected: boolean; readonly wallet: { readonly name: string } | null };\n\t\t};\n\t};\n}\n\n/** How long `selectAccount` waits for the dev wallet (and the requested\n * account) to register before giving up — the wallet comes up asynchronously,\n * so a `connectAs(...)` fired right after page load may beat it. */\nconst RESOLVE_TIMEOUT_MS = 10_000;\nconst RESOLVE_POLL_MS = 50;\n\nconst sleep = (ms: number): Promise<void> => new Promise((resolve) => setTimeout(resolve, ms));\n\n/**\n * Register `dAppKit` with the `globalThis.__devstackDAppKit__` test slot that\n * Playwright's `connectAs` / `selectAccount` helpers drive. Call once, DEV-only,\n * after `createDAppKit(...)`:\n *\n * ```ts\n * export const dAppKit = createDAppKit({ ... });\n * if (import.meta.env.DEV) registerDAppKitForTesting(dAppKit);\n * ```\n *\n * The published `selectAccount` performs a real connection: if already connected\n * to the dev wallet it switches the active account; otherwise it connects,\n * selecting the requested account. Account names resolve to the dev wallet's\n * wallet-standard accounts by `label` (the devstack account name).\n */\nexport function registerDAppKitForTesting<W extends UiWalletLike>(\n\tdAppKit: TestableDAppKit<W>,\n): void {\n\tconst resolveLabelledAccount = async (\n\t\taccountName: string,\n\t): Promise<{ wallet: W; account: W['accounts'][number] } | null> => {\n\t\tconst deadline = Date.now() + RESOLVE_TIMEOUT_MS;\n\t\tfor (;;) {\n\t\t\tfor (const wallet of dAppKit.stores.$wallets.get()) {\n\t\t\t\tconst account = wallet.accounts.find((candidate) => candidate.label === accountName);\n\t\t\t\tif (account !== undefined) return { wallet, account };\n\t\t\t}\n\t\t\tif (Date.now() >= deadline) return null;\n\t\t\tawait sleep(RESOLVE_POLL_MS);\n\t\t}\n\t};\n\n\tconst selectAccount = async (accountName: string): Promise<void> => {\n\t\tconst found = await resolveLabelledAccount(accountName);\n\t\tif (found === null) {\n\t\t\tthrow new Error(\n\t\t\t\t`connectAs(\"${accountName}\"): no dev-wallet account labelled \"${accountName}\" ` +\n\t\t\t\t\t`registered within ${RESOLVE_TIMEOUT_MS}ms. Confirm the dev wallet is injected ` +\n\t\t\t\t\t`and the account name exists.`,\n\t\t\t);\n\t\t}\n\t\tconst { wallet, account } = found;\n\t\tconst connection = dAppKit.stores.$connection.get();\n\t\tif (connection.isConnected && connection.wallet?.name === wallet.name) {\n\t\t\t// Already connected to the dev wallet — just switch the active account.\n\t\t\tdAppKit.switchAccount({ account });\n\t\t\treturn;\n\t\t}\n\t\tawait dAppKit.connectWallet({ wallet, account });\n\t};\n\n\t(globalThis as { [DAPP_KIT_SLOT_KEY]?: DAppKitSlot }).__devstackDAppKit__ = { selectAccount };\n}\n"],"mappings":";;;;;AA0DA,MAAM,qBAAqB;AAC3B,MAAM,kBAAkB;AAExB,MAAM,SAAS,OAA8B,IAAI,SAAS,YAAY,WAAW,SAAS,EAAE,CAAC;;;;;;;;;;;;;;;;AAiB7F,SAAgB,0BACf,SACO;CACP,MAAM,yBAAyB,OAC9B,gBACmE;EACnE,MAAM,WAAW,KAAK,IAAI,IAAI;EAC9B,SAAS;GACR,KAAK,MAAM,UAAU,QAAQ,OAAO,SAAS,IAAI,GAAG;IACnD,MAAM,UAAU,OAAO,SAAS,MAAM,cAAc,UAAU,UAAU,WAAW;IACnF,IAAI,YAAY,KAAA,GAAW,OAAO;KAAE;KAAQ;IAAQ;GACrD;GACA,IAAI,KAAK,IAAI,KAAK,UAAU,OAAO;GACnC,MAAM,MAAM,eAAe;EAC5B;CACD;CAEA,MAAM,gBAAgB,OAAO,gBAAuC;EACnE,MAAM,QAAQ,MAAM,uBAAuB,WAAW;EACtD,IAAI,UAAU,MACb,MAAM,IAAI,MACT,cAAc,YAAY,sCAAsC,YAAY,sBACtD,mBAAmB,oEAE1C;EAED,MAAM,EAAE,QAAQ,YAAY;EAC5B,MAAM,aAAa,QAAQ,OAAO,YAAY,IAAI;EAClD,IAAI,WAAW,eAAe,WAAW,QAAQ,SAAS,OAAO,MAAM;GAEtE,QAAQ,cAAc,EAAE,QAAQ,CAAC;GACjC;EACD;EACA,MAAM,QAAQ,cAAc;GAAE;GAAQ;EAAQ,CAAC;CAChD;CAEA,WAAsD,sBAAsB,EAAE,cAAc;AAC7F"}
@@ -25,19 +25,6 @@ interface PlaywrightProjectShape {
25
25
  name: string;
26
26
  use: Record<string, unknown>;
27
27
  }
28
- interface PlaywrightWebServerConfigShape {
29
- readonly command: string;
30
- readonly url: string;
31
- readonly reuseExistingServer: boolean;
32
- readonly timeout: number;
33
- readonly stdout: 'pipe' | 'ignore';
34
- readonly stderr: 'pipe' | 'ignore';
35
- readonly gracefulShutdown: {
36
- readonly signal: 'SIGTERM';
37
- readonly timeout: number;
38
- };
39
- readonly env?: Record<string, string>;
40
- }
41
28
  interface DevstackPlaywrightBaseConfigOptions {
42
29
  /** Test directory. Default: `'./e2e'` (architecture invariant). */
43
30
  readonly testDir?: string;
@@ -54,21 +41,6 @@ interface DevstackPlaywrightEndpointOptions extends ResolveStackContextOptions {
54
41
  * bypassed entirely. */
55
42
  readonly baseURL?: string;
56
43
  }
57
- interface DevstackPlaywrightWebServerOptions extends DevstackPlaywrightEndpointOptions {
58
- /** Command Playwright runs to bring up the stack. Default:
59
- * `'pnpm dev'`. */
60
- readonly command?: string;
61
- /** Hard cap (ms) for `webServer` URL to become reachable. Default:
62
- * 300_000 (5 min) — accounts for cold supervisor boot under
63
- * Docker pulls. */
64
- readonly webServerTimeoutMs?: number;
65
- /** Hard cap (ms) for `webServer.gracefulShutdown`. Default: 10_000
66
- * (10 s) — load-bearing per architecture § Invariants. */
67
- readonly gracefulShutdownTimeoutMs?: number;
68
- /** Extra env to forward to `webServer.command`. Merged after the
69
- * preset's own env (PLAYWRIGHT=1, DEVSTACK_STACK). */
70
- readonly env?: Record<string, string>;
71
- }
72
44
  interface DevstackPlaywrightProjectsOptions {
73
45
  /** Extra Playwright projects to append to the default Chromium
74
46
  * project. */
@@ -88,7 +60,6 @@ declare const resolveDevstackPlaywrightBaseURL: (options?: DevstackPlaywrightEnd
88
60
  declare const devstackPlaywrightBaseConfig: (options?: DevstackPlaywrightBaseConfigOptions) => PlaywrightBaseConfigShape;
89
61
  declare const devstackPlaywrightUse: (options?: DevstackPlaywrightUseOptions) => PlaywrightUseConfigShape;
90
62
  declare const devstackPlaywrightProjects: (options?: DevstackPlaywrightProjectsOptions) => PlaywrightProjectShape[];
91
- declare const devstackPlaywrightWebServer: (options?: DevstackPlaywrightWebServerOptions) => PlaywrightWebServerConfigShape;
92
63
  //#endregion
93
- export { DevstackPlaywrightBaseConfigOptions, DevstackPlaywrightEndpointOptions, DevstackPlaywrightProjectsOptions, DevstackPlaywrightUseOptions, DevstackPlaywrightWebServerOptions, PlaywrightBaseConfigShape, PlaywrightProjectShape, PlaywrightUseConfigShape, PlaywrightWebServerConfigShape, devstackPlaywrightBaseConfig, devstackPlaywrightProjects, devstackPlaywrightUse, devstackPlaywrightWebServer, resolveDevstackPlaywrightBaseURL };
64
+ export { DevstackPlaywrightBaseConfigOptions, DevstackPlaywrightEndpointOptions, DevstackPlaywrightProjectsOptions, DevstackPlaywrightUseOptions, PlaywrightBaseConfigShape, PlaywrightProjectShape, PlaywrightUseConfigShape, devstackPlaywrightBaseConfig, devstackPlaywrightProjects, devstackPlaywrightUse, resolveDevstackPlaywrightBaseURL };
94
65
  //# sourceMappingURL=config.d.mts.map
@@ -3,9 +3,6 @@ import { resolveEndpointUrl } from "./stack-context.mjs";
3
3
  //#region src/build-integrations/playwright/config.ts
4
4
  const DEFAULT_GLOBAL_SETUP = "@mysten-incubation/devstack/playwright/global-setup";
5
5
  const DEFAULT_TEST_DIR = "./e2e";
6
- const DEFAULT_COMMAND = "pnpm dev";
7
- const DEFAULT_WEBSERVER_TIMEOUT_MS = 3e5;
8
- const DEFAULT_GRACEFUL_SHUTDOWN_MS = 1e4;
9
6
  const DEFAULT_ENDPOINT_NAME = BUILT_IN_ENDPOINT_ALIASES.app;
10
7
  /**
11
8
  * Resolve the browser app URL Playwright should target. This is the
@@ -44,30 +41,7 @@ const devstackPlaywrightProjects = (options = {}) => [{
44
41
  name: "chromium",
45
42
  use: { browserName: "chromium" }
46
43
  }, ...options.projects ?? []];
47
- const devstackPlaywrightWebServer = (options = {}) => {
48
- const env = options.env ? { ...options.env } : {};
49
- const ci = Boolean(process.env.CI);
50
- const baseURL = resolveDevstackPlaywrightBaseURL(options);
51
- const presetEnv = {
52
- PLAYWRIGHT: "1",
53
- ...options.stack !== void 0 ? { DEVSTACK_STACK: options.stack } : {},
54
- ...env
55
- };
56
- return {
57
- command: options.command ?? DEFAULT_COMMAND,
58
- url: baseURL,
59
- reuseExistingServer: !ci,
60
- timeout: options.webServerTimeoutMs ?? DEFAULT_WEBSERVER_TIMEOUT_MS,
61
- stdout: "pipe",
62
- stderr: "pipe",
63
- gracefulShutdown: {
64
- signal: "SIGTERM",
65
- timeout: options.gracefulShutdownTimeoutMs ?? DEFAULT_GRACEFUL_SHUTDOWN_MS
66
- },
67
- env: presetEnv
68
- };
69
- };
70
44
  //#endregion
71
- export { devstackPlaywrightBaseConfig, devstackPlaywrightProjects, devstackPlaywrightUse, devstackPlaywrightWebServer, resolveDevstackPlaywrightBaseURL };
45
+ export { devstackPlaywrightBaseConfig, devstackPlaywrightProjects, devstackPlaywrightUse, resolveDevstackPlaywrightBaseURL };
72
46
 
73
47
  //# sourceMappingURL=config.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.mjs","names":[],"sources":["../../../src/build-integrations/playwright/config.ts"],"sourcesContent":["// Playwright config helpers.\n//\n// Architecture (distilled/23-build-integrations.md § Playwright /\n// \"What it produces\"):\n//\n// Composable pieces for a canonical `PlaywrightTestConfig`\n// (workers 1, fullyParallel false, `testDir: './e2e'`,\n// CI-aware reporter/retries/forbidOnly, graceful-shutdown wiring\n// with a SIGTERM + 10s timeout), plus `webServer` + `baseURL`\n// low-level resolvers.\n//\n// Load-bearing invariants this module enforces:\n// - `workers: 1` and `fullyParallel: false` — single supervisor per\n// stack; parallel tests would contend on shared faucet / wallet\n// / RPC (distilled § Invariants).\n// - `webServer.gracefulShutdown` SIGTERM + 10s — without this the\n// default SIGKILL-on-shell orphans vite + supervisor descendants\n// holding ports (distilled § Learnings: \"Graceful-shutdown wiring\n// at the Playwright layer fixed a real bug\").\n// - `webServer.url` settable at config-load time even with no\n// manifest — via cold-start fallback to a conventional URL.\n// - `webServer.reuseExistingServer: !CI` — dev iteration reuses,\n// CI always boots fresh.\n//\n// This module returns `PlaywrightTestConfig`-shaped fragments. We do\n// NOT import `@playwright/test` at module init: the types are\n// structural and we accept the optional-peer cost rather than\n// importing transitively from a build-integration that must be\n// loadable without `@playwright/test` (matching the Vitest helpers'\n// optional-peer pattern).\n\nimport { BUILT_IN_ENDPOINT_ALIASES } from '../runtime/conventional-routes.ts';\nimport { type ResolveStackContextOptions, resolveEndpointUrl } from './stack-context.ts';\n\n// -----------------------------------------------------------------------------\n// PlaywrightTestConfig shape (structural; we do NOT import the type\n// directly to keep `@playwright/test` an optional peer)\n// -----------------------------------------------------------------------------\n\ntype PlaywrightReporterShape = [string] | [string, Record<string, unknown>];\ntype PlaywrightGlobalSetupShape = string | string[];\n\nconst DEFAULT_GLOBAL_SETUP = '@mysten-incubation/devstack/playwright/global-setup';\n\n/** Base subset of `PlaywrightTestConfig` this surface produces. The\n * full type lives in `@playwright/test`; we keep this structural so\n * the helpers compile without the peer. */\nexport interface PlaywrightBaseConfigShape {\n\treadonly testDir: string;\n\treadonly fullyParallel: boolean;\n\treadonly forbidOnly: boolean;\n\treadonly retries: number;\n\treadonly workers: number;\n\treadonly reporter: PlaywrightReporterShape[] | string;\n\treadonly globalSetup?: PlaywrightGlobalSetupShape;\n\treadonly globalTeardown?: string;\n}\n\nexport type PlaywrightUseConfigShape = {\n\treadonly baseURL: string;\n\treadonly trace: 'on-first-retry' | 'off' | 'retain-on-failure';\n\treadonly screenshot: 'only-on-failure' | 'off' | 'on';\n} & Record<string, unknown>;\n\nexport interface PlaywrightProjectShape {\n\tname: string;\n\tuse: Record<string, unknown>;\n}\n\nexport interface PlaywrightWebServerConfigShape {\n\treadonly command: string;\n\treadonly url: string;\n\treadonly reuseExistingServer: boolean;\n\treadonly timeout: number;\n\treadonly stdout: 'pipe' | 'ignore';\n\treadonly stderr: 'pipe' | 'ignore';\n\treadonly gracefulShutdown: { readonly signal: 'SIGTERM'; readonly timeout: number };\n\treadonly env?: Record<string, string>;\n}\n\n// -----------------------------------------------------------------------------\n// Public option shape\n// -----------------------------------------------------------------------------\n\nexport interface DevstackPlaywrightBaseConfigOptions {\n\t/** Test directory. Default: `'./e2e'` (architecture invariant). */\n\treadonly testDir?: string;\n\n\t/** Path to a global-setup module. Default: the devstack setup that\n\t * waits for post-acquire codegen before specs load the app. Pass\n\t * `null` to keep the property omitted when composing conditionally. */\n\treadonly globalSetup?: PlaywrightGlobalSetupShape | null;\n}\n\nexport interface DevstackPlaywrightEndpointOptions extends ResolveStackContextOptions {\n\t/** Endpoint name whose URL becomes `webServer.url` + `use.baseURL`.\n\t * Default: `'dev'` (the host-service dev server endpoint). */\n\treadonly endpointName?: string;\n\n\t/** Explicit baseURL override. When set, manifest discovery is\n\t * bypassed entirely. */\n\treadonly baseURL?: string;\n}\n\nexport interface DevstackPlaywrightWebServerOptions extends DevstackPlaywrightEndpointOptions {\n\t/** Command Playwright runs to bring up the stack. Default:\n\t * `'pnpm dev'`. */\n\treadonly command?: string;\n\n\t/** Hard cap (ms) for `webServer` URL to become reachable. Default:\n\t * 300_000 (5 min) — accounts for cold supervisor boot under\n\t * Docker pulls. */\n\treadonly webServerTimeoutMs?: number;\n\n\t/** Hard cap (ms) for `webServer.gracefulShutdown`. Default: 10_000\n\t * (10 s) — load-bearing per architecture § Invariants. */\n\treadonly gracefulShutdownTimeoutMs?: number;\n\n\t/** Extra env to forward to `webServer.command`. Merged after the\n\t * preset's own env (PLAYWRIGHT=1, DEVSTACK_STACK). */\n\treadonly env?: Record<string, string>;\n}\n\nexport interface DevstackPlaywrightProjectsOptions {\n\t/** Extra Playwright projects to append to the default Chromium\n\t * project. */\n\treadonly projects?: ReadonlyArray<PlaywrightProjectShape>;\n}\n\nexport interface DevstackPlaywrightUseOptions extends DevstackPlaywrightEndpointOptions {\n\treadonly trace?: PlaywrightUseConfigShape['trace'];\n\treadonly screenshot?: PlaywrightUseConfigShape['screenshot'];\n\treadonly use?: Omit<Partial<PlaywrightUseConfigShape>, 'baseURL'>;\n}\n\n// -----------------------------------------------------------------------------\n// Defaults\n// -----------------------------------------------------------------------------\n\nconst DEFAULT_TEST_DIR = './e2e';\nconst DEFAULT_COMMAND = 'pnpm dev';\nconst DEFAULT_WEBSERVER_TIMEOUT_MS = 300_000;\nconst DEFAULT_GRACEFUL_SHUTDOWN_MS = 10_000;\nconst DEFAULT_ENDPOINT_NAME = BUILT_IN_ENDPOINT_ALIASES.app;\n\n// -----------------------------------------------------------------------------\n// Builders\n// -----------------------------------------------------------------------------\n\n/**\n * Resolve the browser app URL Playwright should target. This is the\n * only helper here that may synchronously read the manifest; callers\n * can pass `baseURL` to bypass discovery entirely.\n */\nexport const resolveDevstackPlaywrightBaseURL = (\n\toptions: DevstackPlaywrightEndpointOptions = {},\n): string => {\n\tconst endpointName = options.endpointName ?? DEFAULT_ENDPOINT_NAME;\n\treturn (\n\t\toptions.baseURL ??\n\t\tresolveEndpointUrl(endpointName, {\n\t\t\t...(options.cwd !== undefined ? { cwd: options.cwd } : {}),\n\t\t\t...(options.manifestPath !== undefined ? { manifestPath: options.manifestPath } : {}),\n\t\t\t...(options.stack !== undefined ? { stack: options.stack } : {}),\n\t\t\t...(options.stateDir !== undefined ? { stateDir: options.stateDir } : {}),\n\t\t\t...(options.env !== undefined ? { env: options.env } : {}),\n\t\t}).url\n\t);\n};\n\nexport const devstackPlaywrightBaseConfig = (\n\toptions: DevstackPlaywrightBaseConfigOptions = {},\n): PlaywrightBaseConfigShape => {\n\tconst ci = Boolean(process.env.CI);\n\treturn {\n\t\ttestDir: options.testDir ?? DEFAULT_TEST_DIR,\n\t\tfullyParallel: false,\n\t\tforbidOnly: ci,\n\t\tretries: ci ? 2 : 0,\n\t\tworkers: 1,\n\t\treporter: ci ? [['github'], ['list']] : 'list',\n\t\tglobalSetup:\n\t\t\toptions.globalSetup === null ? undefined : (options.globalSetup ?? DEFAULT_GLOBAL_SETUP),\n\t};\n};\n\nexport const devstackPlaywrightUse = (\n\toptions: DevstackPlaywrightUseOptions = {},\n): PlaywrightUseConfigShape => ({\n\tbaseURL: resolveDevstackPlaywrightBaseURL(options),\n\ttrace: options.trace ?? 'on-first-retry',\n\tscreenshot: options.screenshot ?? 'only-on-failure',\n\t...options.use,\n});\n\nexport const devstackPlaywrightProjects = (\n\toptions: DevstackPlaywrightProjectsOptions = {},\n): PlaywrightProjectShape[] => [\n\t{\n\t\tname: 'chromium',\n\t\tuse: { browserName: 'chromium' },\n\t},\n\t...(options.projects ?? []),\n];\n\nexport const devstackPlaywrightWebServer = (\n\toptions: DevstackPlaywrightWebServerOptions = {},\n): PlaywrightWebServerConfigShape => {\n\tconst env = options.env ? { ...options.env } : {};\n\tconst ci = Boolean(process.env.CI);\n\tconst baseURL = resolveDevstackPlaywrightBaseURL(options);\n\tconst presetEnv: Record<string, string> = {\n\t\tPLAYWRIGHT: '1',\n\t\t...(options.stack !== undefined ? { DEVSTACK_STACK: options.stack } : {}),\n\t\t...env,\n\t};\n\n\treturn {\n\t\tcommand: options.command ?? DEFAULT_COMMAND,\n\t\turl: baseURL,\n\t\treuseExistingServer: !ci,\n\t\ttimeout: options.webServerTimeoutMs ?? DEFAULT_WEBSERVER_TIMEOUT_MS,\n\t\tstdout: 'pipe',\n\t\tstderr: 'pipe',\n\t\tgracefulShutdown: {\n\t\t\tsignal: 'SIGTERM',\n\t\t\ttimeout: options.gracefulShutdownTimeoutMs ?? DEFAULT_GRACEFUL_SHUTDOWN_MS,\n\t\t},\n\t\tenv: presetEnv,\n\t};\n};\n"],"mappings":";;;AA0CA,MAAM,uBAAuB;AAiG7B,MAAM,mBAAmB;AACzB,MAAM,kBAAkB;AACxB,MAAM,+BAA+B;AACrC,MAAM,+BAA+B;AACrC,MAAM,wBAAwB,0BAA0B;;;;;;AAWxD,MAAa,oCACZ,UAA6C,EAAE,KACnC;CACZ,MAAM,eAAe,QAAQ,gBAAgB;AAC7C,QACC,QAAQ,WACR,mBAAmB,cAAc;EAChC,GAAI,QAAQ,QAAQ,KAAA,IAAY,EAAE,KAAK,QAAQ,KAAK,GAAG,EAAE;EACzD,GAAI,QAAQ,iBAAiB,KAAA,IAAY,EAAE,cAAc,QAAQ,cAAc,GAAG,EAAE;EACpF,GAAI,QAAQ,UAAU,KAAA,IAAY,EAAE,OAAO,QAAQ,OAAO,GAAG,EAAE;EAC/D,GAAI,QAAQ,aAAa,KAAA,IAAY,EAAE,UAAU,QAAQ,UAAU,GAAG,EAAE;EACxE,GAAI,QAAQ,QAAQ,KAAA,IAAY,EAAE,KAAK,QAAQ,KAAK,GAAG,EAAE;EACzD,CAAC,CAAC;;AAIL,MAAa,gCACZ,UAA+C,EAAE,KAClB;CAC/B,MAAM,KAAK,QAAQ,QAAQ,IAAI,GAAG;AAClC,QAAO;EACN,SAAS,QAAQ,WAAW;EAC5B,eAAe;EACf,YAAY;EACZ,SAAS,KAAK,IAAI;EAClB,SAAS;EACT,UAAU,KAAK,CAAC,CAAC,SAAS,EAAE,CAAC,OAAO,CAAC,GAAG;EACxC,aACC,QAAQ,gBAAgB,OAAO,KAAA,IAAa,QAAQ,eAAe;EACpE;;AAGF,MAAa,yBACZ,UAAwC,EAAE,MACX;CAC/B,SAAS,iCAAiC,QAAQ;CAClD,OAAO,QAAQ,SAAS;CACxB,YAAY,QAAQ,cAAc;CAClC,GAAG,QAAQ;CACX;AAED,MAAa,8BACZ,UAA6C,EAAE,KACjB,CAC9B;CACC,MAAM;CACN,KAAK,EAAE,aAAa,YAAY;CAChC,EACD,GAAI,QAAQ,YAAY,EAAE,CAC1B;AAED,MAAa,+BACZ,UAA8C,EAAE,KACZ;CACpC,MAAM,MAAM,QAAQ,MAAM,EAAE,GAAG,QAAQ,KAAK,GAAG,EAAE;CACjD,MAAM,KAAK,QAAQ,QAAQ,IAAI,GAAG;CAClC,MAAM,UAAU,iCAAiC,QAAQ;CACzD,MAAM,YAAoC;EACzC,YAAY;EACZ,GAAI,QAAQ,UAAU,KAAA,IAAY,EAAE,gBAAgB,QAAQ,OAAO,GAAG,EAAE;EACxE,GAAG;EACH;AAED,QAAO;EACN,SAAS,QAAQ,WAAW;EAC5B,KAAK;EACL,qBAAqB,CAAC;EACtB,SAAS,QAAQ,sBAAsB;EACvC,QAAQ;EACR,QAAQ;EACR,kBAAkB;GACjB,QAAQ;GACR,SAAS,QAAQ,6BAA6B;GAC9C;EACD,KAAK;EACL"}
1
+ {"version":3,"file":"config.mjs","names":[],"sources":["../../../src/build-integrations/playwright/config.ts"],"sourcesContent":["// Playwright config helpers.\n//\n// Architecture (distilled/23-build-integrations.md § Playwright /\n// \"What it produces\"):\n//\n// Composable pieces for a canonical `PlaywrightTestConfig`\n// (workers 1, fullyParallel false, `testDir: './e2e'`,\n// CI-aware reporter/retries/forbidOnly), plus a `baseURL` resolver.\n//\n// The stack is booted by the `globalSetup` (programmatic `runStack`,\n// see `global-setup.ts`), NOT by Playwright's `webServer`. Playwright's\n// `webServer` shells out (`pnpm dev`) and force-kills the supervisor on\n// teardown before its container drain finishes, orphaning containers;\n// the in-process `runStack` boot + `handle.stop` teardown drains cleanly.\n//\n// Load-bearing invariants this module enforces:\n// - `workers: 1` and `fullyParallel: false` — single supervisor per\n// stack; parallel tests would contend on shared faucet / wallet\n// / RPC (distilled § Invariants).\n// - `use.baseURL` settable at config-load time even with no manifest —\n// via cold-start fallback to a conventional URL (the stack the\n// globalSetup boots later answers on that conventional router host).\n//\n// This module returns `PlaywrightTestConfig`-shaped fragments. We do\n// NOT import `@playwright/test` at module init: the types are\n// structural and we accept the optional-peer cost rather than\n// importing transitively from a build-integration that must be\n// loadable without `@playwright/test` (matching the Vitest helpers'\n// optional-peer pattern).\n\nimport { BUILT_IN_ENDPOINT_ALIASES } from '../runtime/conventional-routes.ts';\nimport { type ResolveStackContextOptions, resolveEndpointUrl } from './stack-context.ts';\n\n// -----------------------------------------------------------------------------\n// PlaywrightTestConfig shape (structural; we do NOT import the type\n// directly to keep `@playwright/test` an optional peer)\n// -----------------------------------------------------------------------------\n\ntype PlaywrightReporterShape = [string] | [string, Record<string, unknown>];\ntype PlaywrightGlobalSetupShape = string | string[];\n\nconst DEFAULT_GLOBAL_SETUP = '@mysten-incubation/devstack/playwright/global-setup';\n\n/** Base subset of `PlaywrightTestConfig` this surface produces. The\n * full type lives in `@playwright/test`; we keep this structural so\n * the helpers compile without the peer. */\nexport interface PlaywrightBaseConfigShape {\n\treadonly testDir: string;\n\treadonly fullyParallel: boolean;\n\treadonly forbidOnly: boolean;\n\treadonly retries: number;\n\treadonly workers: number;\n\treadonly reporter: PlaywrightReporterShape[] | string;\n\treadonly globalSetup?: PlaywrightGlobalSetupShape;\n\treadonly globalTeardown?: string;\n}\n\nexport type PlaywrightUseConfigShape = {\n\treadonly baseURL: string;\n\treadonly trace: 'on-first-retry' | 'off' | 'retain-on-failure';\n\treadonly screenshot: 'only-on-failure' | 'off' | 'on';\n} & Record<string, unknown>;\n\nexport interface PlaywrightProjectShape {\n\tname: string;\n\tuse: Record<string, unknown>;\n}\n\n// -----------------------------------------------------------------------------\n// Public option shape\n// -----------------------------------------------------------------------------\n\nexport interface DevstackPlaywrightBaseConfigOptions {\n\t/** Test directory. Default: `'./e2e'` (architecture invariant). */\n\treadonly testDir?: string;\n\n\t/** Path to a global-setup module. Default: the devstack setup that\n\t * waits for post-acquire codegen before specs load the app. Pass\n\t * `null` to keep the property omitted when composing conditionally. */\n\treadonly globalSetup?: PlaywrightGlobalSetupShape | null;\n}\n\nexport interface DevstackPlaywrightEndpointOptions extends ResolveStackContextOptions {\n\t/** Endpoint name whose URL becomes `webServer.url` + `use.baseURL`.\n\t * Default: `'dev'` (the host-service dev server endpoint). */\n\treadonly endpointName?: string;\n\n\t/** Explicit baseURL override. When set, manifest discovery is\n\t * bypassed entirely. */\n\treadonly baseURL?: string;\n}\n\nexport interface DevstackPlaywrightProjectsOptions {\n\t/** Extra Playwright projects to append to the default Chromium\n\t * project. */\n\treadonly projects?: ReadonlyArray<PlaywrightProjectShape>;\n}\n\nexport interface DevstackPlaywrightUseOptions extends DevstackPlaywrightEndpointOptions {\n\treadonly trace?: PlaywrightUseConfigShape['trace'];\n\treadonly screenshot?: PlaywrightUseConfigShape['screenshot'];\n\treadonly use?: Omit<Partial<PlaywrightUseConfigShape>, 'baseURL'>;\n}\n\n// -----------------------------------------------------------------------------\n// Defaults\n// -----------------------------------------------------------------------------\n\nconst DEFAULT_TEST_DIR = './e2e';\nconst DEFAULT_ENDPOINT_NAME = BUILT_IN_ENDPOINT_ALIASES.app;\n\n// -----------------------------------------------------------------------------\n// Builders\n// -----------------------------------------------------------------------------\n\n/**\n * Resolve the browser app URL Playwright should target. This is the\n * only helper here that may synchronously read the manifest; callers\n * can pass `baseURL` to bypass discovery entirely.\n */\nexport const resolveDevstackPlaywrightBaseURL = (\n\toptions: DevstackPlaywrightEndpointOptions = {},\n): string => {\n\tconst endpointName = options.endpointName ?? DEFAULT_ENDPOINT_NAME;\n\treturn (\n\t\toptions.baseURL ??\n\t\tresolveEndpointUrl(endpointName, {\n\t\t\t...(options.cwd !== undefined ? { cwd: options.cwd } : {}),\n\t\t\t...(options.manifestPath !== undefined ? { manifestPath: options.manifestPath } : {}),\n\t\t\t...(options.stack !== undefined ? { stack: options.stack } : {}),\n\t\t\t...(options.stateDir !== undefined ? { stateDir: options.stateDir } : {}),\n\t\t\t...(options.env !== undefined ? { env: options.env } : {}),\n\t\t}).url\n\t);\n};\n\nexport const devstackPlaywrightBaseConfig = (\n\toptions: DevstackPlaywrightBaseConfigOptions = {},\n): PlaywrightBaseConfigShape => {\n\tconst ci = Boolean(process.env.CI);\n\treturn {\n\t\ttestDir: options.testDir ?? DEFAULT_TEST_DIR,\n\t\tfullyParallel: false,\n\t\tforbidOnly: ci,\n\t\tretries: ci ? 2 : 0,\n\t\tworkers: 1,\n\t\treporter: ci ? [['github'], ['list']] : 'list',\n\t\tglobalSetup:\n\t\t\toptions.globalSetup === null ? undefined : (options.globalSetup ?? DEFAULT_GLOBAL_SETUP),\n\t};\n};\n\nexport const devstackPlaywrightUse = (\n\toptions: DevstackPlaywrightUseOptions = {},\n): PlaywrightUseConfigShape => ({\n\tbaseURL: resolveDevstackPlaywrightBaseURL(options),\n\ttrace: options.trace ?? 'on-first-retry',\n\tscreenshot: options.screenshot ?? 'only-on-failure',\n\t...options.use,\n});\n\nexport const devstackPlaywrightProjects = (\n\toptions: DevstackPlaywrightProjectsOptions = {},\n): PlaywrightProjectShape[] => [\n\t{\n\t\tname: 'chromium',\n\t\tuse: { browserName: 'chromium' },\n\t},\n\t...(options.projects ?? []),\n];\n"],"mappings":";;;AAyCA,MAAM,uBAAuB;AAmE7B,MAAM,mBAAmB;AACzB,MAAM,wBAAwB,0BAA0B;;;;;;AAWxD,MAAa,oCACZ,UAA6C,CAAC,MAClC;CACZ,MAAM,eAAe,QAAQ,gBAAgB;CAC7C,OACC,QAAQ,WACR,mBAAmB,cAAc;EAChC,GAAI,QAAQ,QAAQ,KAAA,IAAY,EAAE,KAAK,QAAQ,IAAI,IAAI,CAAC;EACxD,GAAI,QAAQ,iBAAiB,KAAA,IAAY,EAAE,cAAc,QAAQ,aAAa,IAAI,CAAC;EACnF,GAAI,QAAQ,UAAU,KAAA,IAAY,EAAE,OAAO,QAAQ,MAAM,IAAI,CAAC;EAC9D,GAAI,QAAQ,aAAa,KAAA,IAAY,EAAE,UAAU,QAAQ,SAAS,IAAI,CAAC;EACvE,GAAI,QAAQ,QAAQ,KAAA,IAAY,EAAE,KAAK,QAAQ,IAAI,IAAI,CAAC;CACzD,CAAC,CAAC,CAAC;AAEL;AAEA,MAAa,gCACZ,UAA+C,CAAC,MACjB;CAC/B,MAAM,KAAK,QAAQ,QAAQ,IAAI,EAAE;CACjC,OAAO;EACN,SAAS,QAAQ,WAAW;EAC5B,eAAe;EACf,YAAY;EACZ,SAAS,KAAK,IAAI;EAClB,SAAS;EACT,UAAU,KAAK,CAAC,CAAC,QAAQ,GAAG,CAAC,MAAM,CAAC,IAAI;EACxC,aACC,QAAQ,gBAAgB,OAAO,KAAA,IAAa,QAAQ,eAAe;CACrE;AACD;AAEA,MAAa,yBACZ,UAAwC,CAAC,OACV;CAC/B,SAAS,iCAAiC,OAAO;CACjD,OAAO,QAAQ,SAAS;CACxB,YAAY,QAAQ,cAAc;CAClC,GAAG,QAAQ;AACZ;AAEA,MAAa,8BACZ,UAA6C,CAAC,MAChB,CAC9B;CACC,MAAM;CACN,KAAK,EAAE,aAAa,WAAW;AAChC,GACA,GAAI,QAAQ,YAAY,CAAC,CAC1B"}
@@ -1,8 +1,5 @@
1
- import * as _$effect_Cause0 from "effect/Cause";
2
- import * as _$effect_Types0 from "effect/Types";
3
-
4
1
  //#region src/build-integrations/playwright/errors.d.ts
5
- declare const PlaywrightManifestDiscoveryError_base: new <A extends Record<string, any> = {}>(args: _$effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => _$effect_Cause0.YieldableError & {
2
+ declare const PlaywrightManifestDiscoveryError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
6
3
  readonly _tag: "PlaywrightManifestDiscoveryError";
7
4
  } & Readonly<A>;
8
5
  /**
@@ -20,7 +17,7 @@ declare class PlaywrightManifestDiscoveryError extends PlaywrightManifestDiscove
20
17
  readonly endpointKey?: string;
21
18
  readonly recoveryHint: string;
22
19
  }> {}
23
- declare const PlaywrightManifestShapeError_base: new <A extends Record<string, any> = {}>(args: _$effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => _$effect_Cause0.YieldableError & {
20
+ declare const PlaywrightManifestShapeError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
24
21
  readonly _tag: "PlaywrightManifestShapeError";
25
22
  } & Readonly<A>;
26
23
  /**
@@ -37,7 +34,7 @@ declare class PlaywrightManifestShapeError extends PlaywrightManifestShapeError_
37
34
  readonly recoveryHint: string;
38
35
  readonly cause?: unknown;
39
36
  }> {}
40
- declare const PlaywrightEndpointNotFoundError_base: new <A extends Record<string, any> = {}>(args: _$effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => _$effect_Cause0.YieldableError & {
37
+ declare const PlaywrightEndpointNotFoundError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
41
38
  readonly _tag: "PlaywrightEndpointNotFoundError";
42
39
  } & Readonly<A>;
43
40
  /**
@@ -54,7 +51,7 @@ declare class PlaywrightEndpointNotFoundError extends PlaywrightEndpointNotFound
54
51
  readonly manifestKeys?: ReadonlyArray<string>;
55
52
  readonly recoveryHint: string;
56
53
  }> {}
57
- declare const PlaywrightWalletAdapterError_base: new <A extends Record<string, any> = {}>(args: _$effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => _$effect_Cause0.YieldableError & {
54
+ declare const PlaywrightWalletAdapterError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
58
55
  readonly _tag: "PlaywrightWalletAdapterError";
59
56
  } & Readonly<A>;
60
57
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"errors.mjs","names":[],"sources":["../../../src/build-integrations/playwright/errors.ts"],"sourcesContent":["// Playwright build-integration errors.\n//\n// Architecture (distilled/23-build-integrations.md § Playwright):\n// every failure surface for the preset is a tagged error so the\n// config-load (synchronous, runs before any supervisor exists) can\n// raise a structured signal with an embedded recovery recipe rather\n// than an opaque downstream NPE.\n//\n// Scope discipline: this surface owns FOUR error tags. Anything that\n// would be a fifth tag is either upstream (manifest schema error from\n// the L0 substrate, which we re-raise unchanged) or a programmer\n// defect (Effect.die / throw — not part of this contract).\n//\n// The Playwright config-load is synchronous (Playwright's\n// `defineConfig` is sync), so these errors are constructed and\n// thrown rather than `Effect.fail`-ed. The surface mirrors the\n// `Data.TaggedError` shape so the tags are uniform across the\n// codebase, but the catch sites are `try` / `instanceof` in\n// Playwright host code.\n\nimport { Data } from 'effect';\n\n// -----------------------------------------------------------------------------\n// Discovery — manifest could not be located and no conventional URL\n// fallback exists for the requested endpoint.\n// -----------------------------------------------------------------------------\n\n/**\n * The manifest could not be located on disk (no stack-scoped file\n * along the walk-up path) AND the requested endpoint has no\n * conventional URL fallback in the endpoint declaration registry.\n *\n * Recovery: run `devstack up` once to materialize the manifest, OR\n * pass an explicit `baseURL` to the Playwright config helpers to\n * bypass the discovery path.\n */\nexport class PlaywrightManifestDiscoveryError extends Data.TaggedError(\n\t'PlaywrightManifestDiscoveryError',\n)<{\n\treadonly message: string;\n\treadonly searchedPaths: ReadonlyArray<string>;\n\treadonly endpointKey?: string;\n\treadonly recoveryHint: string;\n}> {}\n\n// -----------------------------------------------------------------------------\n// Shape — manifest exists but failed to decode against the L0\n// envelope schema.\n// -----------------------------------------------------------------------------\n\n/**\n * The manifest file was located but failed to decode against\n * `ManifestEnvelopeSchema`. Wraps the substrate's `ManifestError`\n * (reason = `decode-failed` | `version-mismatch`) with a recovery\n * recipe targeted at the Playwright user (delete + re-run `devstack\n * up` rather than the engine-side recovery).\n */\nexport class PlaywrightManifestShapeError extends Data.TaggedError('PlaywrightManifestShapeError')<{\n\treadonly message: string;\n\treadonly manifestPath: string;\n\treadonly phase: 'shape' | 'parse' | 'version-mismatch';\n\treadonly recoveryHint: string;\n\treadonly cause?: unknown;\n}> {}\n\n// -----------------------------------------------------------------------------\n// Endpoint lookup — manifest decoded fine but the requested endpoint\n// is absent from the flat lookup.\n// -----------------------------------------------------------------------------\n\n/**\n * The manifest decoded but the requested endpoint name/alias is not\n * present.\n * Typically caused by a typo in user config or by referencing an\n * endpoint owned by a plugin not present in the resolved stack.\n */\nexport class PlaywrightEndpointNotFoundError extends Data.TaggedError(\n\t'PlaywrightEndpointNotFoundError',\n)<{\n\treadonly message: string;\n\treadonly endpointKey: string;\n\treadonly endpointName?: string;\n\treadonly available: ReadonlyArray<string>;\n\treadonly manifestKeys?: ReadonlyArray<string>;\n\treadonly recoveryHint: string;\n}> {}\n\n// -----------------------------------------------------------------------------\n// Wallet adapter — the in-spec wallet helper could not talk to the\n// dev wallet's HTTP API.\n// -----------------------------------------------------------------------------\n\n/**\n * The wallet-context test helper failed to reach the dev wallet's\n * HTTP API (the supervisor's wallet plugin exposes an endpoint that\n * tests POST to for sign-tx flows). Typical causes: supervisor not\n * up, wallet endpoint not yet registered in the manifest, network\n * partition between test runner and supervisor.\n *\n * This tag is throwable from in-spec helpers AND constructible by\n * `wallet-context.ts` callers; it carries enough detail to format a\n * Playwright-friendly assertion failure.\n */\nexport class PlaywrightWalletAdapterError extends Data.TaggedError('PlaywrightWalletAdapterError')<{\n\treadonly message: string;\n\treadonly operation: 'sign-tx' | 'list-accounts' | 'switch-account' | 'fetch';\n\treadonly url?: string;\n\treadonly status?: number;\n\treadonly cause?: unknown;\n}> {}\n\n// -----------------------------------------------------------------------------\n// Union for catch sites that want to handle every surface tag.\n// -----------------------------------------------------------------------------\n\n/** Discriminated union of every error the Playwright preset emits. */\nexport type PlaywrightIntegrationError =\n\t| PlaywrightManifestDiscoveryError\n\t| PlaywrightManifestShapeError\n\t| PlaywrightEndpointNotFoundError\n\t| PlaywrightWalletAdapterError;\n"],"mappings":";;;;;;;;;;;AAoCA,IAAa,mCAAb,cAAsD,KAAK,YAC1D,mCACA,CAKE;;;;;;;;AAcH,IAAa,+BAAb,cAAkD,KAAK,YAAY,+BAA+B,CAM/F;;;;;;;AAaH,IAAa,kCAAb,cAAqD,KAAK,YACzD,kCACA,CAOE;;;;;;;;;;;;AAkBH,IAAa,+BAAb,cAAkD,KAAK,YAAY,+BAA+B,CAM/F"}
1
+ {"version":3,"file":"errors.mjs","names":[],"sources":["../../../src/build-integrations/playwright/errors.ts"],"sourcesContent":["// Playwright build-integration errors.\n//\n// Architecture (distilled/23-build-integrations.md § Playwright):\n// every failure surface for the preset is a tagged error so the\n// config-load (synchronous, runs before any supervisor exists) can\n// raise a structured signal with an embedded recovery recipe rather\n// than an opaque downstream NPE.\n//\n// Scope discipline: this surface owns FOUR error tags. Anything that\n// would be a fifth tag is either upstream (manifest schema error from\n// the L0 substrate, which we re-raise unchanged) or a programmer\n// defect (Effect.die / throw — not part of this contract).\n//\n// The Playwright config-load is synchronous (Playwright's\n// `defineConfig` is sync), so these errors are constructed and\n// thrown rather than `Effect.fail`-ed. The surface mirrors the\n// `Data.TaggedError` shape so the tags are uniform across the\n// codebase, but the catch sites are `try` / `instanceof` in\n// Playwright host code.\n\nimport { Data } from 'effect';\n\n// -----------------------------------------------------------------------------\n// Discovery — manifest could not be located and no conventional URL\n// fallback exists for the requested endpoint.\n// -----------------------------------------------------------------------------\n\n/**\n * The manifest could not be located on disk (no stack-scoped file\n * along the walk-up path) AND the requested endpoint has no\n * conventional URL fallback in the endpoint declaration registry.\n *\n * Recovery: run `devstack up` once to materialize the manifest, OR\n * pass an explicit `baseURL` to the Playwright config helpers to\n * bypass the discovery path.\n */\nexport class PlaywrightManifestDiscoveryError extends Data.TaggedError(\n\t'PlaywrightManifestDiscoveryError',\n)<{\n\treadonly message: string;\n\treadonly searchedPaths: ReadonlyArray<string>;\n\treadonly endpointKey?: string;\n\treadonly recoveryHint: string;\n}> {}\n\n// -----------------------------------------------------------------------------\n// Shape — manifest exists but failed to decode against the L0\n// envelope schema.\n// -----------------------------------------------------------------------------\n\n/**\n * The manifest file was located but failed to decode against\n * `ManifestEnvelopeSchema`. Wraps the substrate's `ManifestError`\n * (reason = `decode-failed` | `version-mismatch`) with a recovery\n * recipe targeted at the Playwright user (delete + re-run `devstack\n * up` rather than the engine-side recovery).\n */\nexport class PlaywrightManifestShapeError extends Data.TaggedError('PlaywrightManifestShapeError')<{\n\treadonly message: string;\n\treadonly manifestPath: string;\n\treadonly phase: 'shape' | 'parse' | 'version-mismatch';\n\treadonly recoveryHint: string;\n\treadonly cause?: unknown;\n}> {}\n\n// -----------------------------------------------------------------------------\n// Endpoint lookup — manifest decoded fine but the requested endpoint\n// is absent from the flat lookup.\n// -----------------------------------------------------------------------------\n\n/**\n * The manifest decoded but the requested endpoint name/alias is not\n * present.\n * Typically caused by a typo in user config or by referencing an\n * endpoint owned by a plugin not present in the resolved stack.\n */\nexport class PlaywrightEndpointNotFoundError extends Data.TaggedError(\n\t'PlaywrightEndpointNotFoundError',\n)<{\n\treadonly message: string;\n\treadonly endpointKey: string;\n\treadonly endpointName?: string;\n\treadonly available: ReadonlyArray<string>;\n\treadonly manifestKeys?: ReadonlyArray<string>;\n\treadonly recoveryHint: string;\n}> {}\n\n// -----------------------------------------------------------------------------\n// Wallet adapter — the in-spec wallet helper could not talk to the\n// dev wallet's HTTP API.\n// -----------------------------------------------------------------------------\n\n/**\n * The wallet-context test helper failed to reach the dev wallet's\n * HTTP API (the supervisor's wallet plugin exposes an endpoint that\n * tests POST to for sign-tx flows). Typical causes: supervisor not\n * up, wallet endpoint not yet registered in the manifest, network\n * partition between test runner and supervisor.\n *\n * This tag is throwable from in-spec helpers AND constructible by\n * `wallet-context.ts` callers; it carries enough detail to format a\n * Playwright-friendly assertion failure.\n */\nexport class PlaywrightWalletAdapterError extends Data.TaggedError('PlaywrightWalletAdapterError')<{\n\treadonly message: string;\n\treadonly operation: 'sign-tx' | 'list-accounts' | 'switch-account' | 'fetch';\n\treadonly url?: string;\n\treadonly status?: number;\n\treadonly cause?: unknown;\n}> {}\n\n// -----------------------------------------------------------------------------\n// Union for catch sites that want to handle every surface tag.\n// -----------------------------------------------------------------------------\n\n/** Discriminated union of every error the Playwright preset emits. */\nexport type PlaywrightIntegrationError =\n\t| PlaywrightManifestDiscoveryError\n\t| PlaywrightManifestShapeError\n\t| PlaywrightEndpointNotFoundError\n\t| PlaywrightWalletAdapterError;\n"],"mappings":";;;;;;;;;;;AAoCA,IAAa,mCAAb,cAAsD,KAAK,YAC1D,kCACD,CAAC,CAKE,CAAC;;;;;;;;AAcJ,IAAa,+BAAb,cAAkD,KAAK,YAAY,8BAA8B,CAAC,CAM/F,CAAC;;;;;;;AAaJ,IAAa,kCAAb,cAAqD,KAAK,YACzD,iCACD,CAAC,CAOE,CAAC;;;;;;;;;;;;AAkBJ,IAAa,+BAAb,cAAkD,KAAK,YAAY,8BAA8B,CAAC,CAM/F,CAAC"}