@mysten-incubation/devstack 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (833) hide show
  1. package/LICENSE +189 -0
  2. package/README.md +94 -0
  3. package/dist/_virtual/_rolldown/runtime.mjs +13 -0
  4. package/dist/api/define-capabilities.d.mts +25 -0
  5. package/dist/api/define-capabilities.mjs +19 -0
  6. package/dist/api/define-capabilities.mjs.map +1 -0
  7. package/dist/api/define-devstack-with.d.mts +41 -0
  8. package/dist/api/define-devstack-with.mjs +24 -0
  9. package/dist/api/define-devstack-with.mjs.map +1 -0
  10. package/dist/api/define-devstack.d.mts +62 -0
  11. package/dist/api/define-devstack.mjs +108 -0
  12. package/dist/api/define-devstack.mjs.map +1 -0
  13. package/dist/api/define-plugin.d.mts +1 -0
  14. package/dist/api/inference-network.mjs +122 -0
  15. package/dist/api/inference-network.mjs.map +1 -0
  16. package/dist/api/mode-narrowed-factory.d.mts +26 -0
  17. package/dist/api/mode-narrowed-factory.mjs +8 -0
  18. package/dist/api/mode-narrowed-factory.mjs.map +1 -0
  19. package/dist/api/plugin-errors.mjs +10 -0
  20. package/dist/api/plugin-errors.mjs.map +1 -0
  21. package/dist/api/run-stack.d.mts +82 -0
  22. package/dist/api/run-stack.mjs +127 -0
  23. package/dist/api/run-stack.mjs.map +1 -0
  24. package/dist/build-integrations/playwright/config.d.mts +92 -0
  25. package/dist/build-integrations/playwright/config.mjs +71 -0
  26. package/dist/build-integrations/playwright/config.mjs.map +1 -0
  27. package/dist/build-integrations/playwright/errors.d.mts +82 -0
  28. package/dist/build-integrations/playwright/errors.mjs +43 -0
  29. package/dist/build-integrations/playwright/errors.mjs.map +1 -0
  30. package/dist/build-integrations/playwright/global-setup.d.mts +64 -0
  31. package/dist/build-integrations/playwright/global-setup.mjs +44 -0
  32. package/dist/build-integrations/playwright/global-setup.mjs.map +1 -0
  33. package/dist/build-integrations/playwright/index.d.mts +6 -0
  34. package/dist/build-integrations/playwright/index.mjs +6 -0
  35. package/dist/build-integrations/playwright/stack-context.d.mts +95 -0
  36. package/dist/build-integrations/playwright/stack-context.mjs +277 -0
  37. package/dist/build-integrations/playwright/stack-context.mjs.map +1 -0
  38. package/dist/build-integrations/playwright/wallet-context.d.mts +87 -0
  39. package/dist/build-integrations/playwright/wallet-context.mjs +148 -0
  40. package/dist/build-integrations/playwright/wallet-context.mjs.map +1 -0
  41. package/dist/build-integrations/runtime/cold-start-url.d.mts +67 -0
  42. package/dist/build-integrations/runtime/cold-start-url.mjs +56 -0
  43. package/dist/build-integrations/runtime/cold-start-url.mjs.map +1 -0
  44. package/dist/build-integrations/runtime/dapp-kit-slot.mjs +10 -0
  45. package/dist/build-integrations/runtime/dapp-kit-slot.mjs.map +1 -0
  46. package/dist/build-integrations/runtime/discover.d.mts +78 -0
  47. package/dist/build-integrations/runtime/discover.mjs +124 -0
  48. package/dist/build-integrations/runtime/discover.mjs.map +1 -0
  49. package/dist/build-integrations/runtime/endpoint-registry.d.mts +26 -0
  50. package/dist/build-integrations/runtime/endpoint-registry.mjs +41 -0
  51. package/dist/build-integrations/runtime/endpoint-registry.mjs.map +1 -0
  52. package/dist/build-integrations/runtime/errors.d.mts +64 -0
  53. package/dist/build-integrations/runtime/errors.mjs +51 -0
  54. package/dist/build-integrations/runtime/errors.mjs.map +1 -0
  55. package/dist/build-integrations/runtime/index.d.mts +7 -0
  56. package/dist/build-integrations/runtime/index.mjs +6 -0
  57. package/dist/build-integrations/runtime/read-stack-context.d.mts +38 -0
  58. package/dist/build-integrations/runtime/read-stack-context.mjs +130 -0
  59. package/dist/build-integrations/runtime/read-stack-context.mjs.map +1 -0
  60. package/dist/build-integrations/runtime/stack-context.d.mts +53 -0
  61. package/dist/build-integrations/vitest/config.d.mts +62 -0
  62. package/dist/build-integrations/vitest/config.mjs +80 -0
  63. package/dist/build-integrations/vitest/config.mjs.map +1 -0
  64. package/dist/build-integrations/vitest/env.d.mts +48 -0
  65. package/dist/build-integrations/vitest/env.mjs +50 -0
  66. package/dist/build-integrations/vitest/env.mjs.map +1 -0
  67. package/dist/build-integrations/vitest/errors.d.mts +44 -0
  68. package/dist/build-integrations/vitest/errors.mjs +18 -0
  69. package/dist/build-integrations/vitest/errors.mjs.map +1 -0
  70. package/dist/build-integrations/vitest/index.d.mts +6 -0
  71. package/dist/build-integrations/vitest/index.mjs +6 -0
  72. package/dist/build-integrations/vitest/setup.d.mts +53 -0
  73. package/dist/build-integrations/vitest/setup.mjs +56 -0
  74. package/dist/build-integrations/vitest/setup.mjs.map +1 -0
  75. package/dist/build-integrations/vitest/stack-context.d.mts +58 -0
  76. package/dist/build-integrations/vitest/stack-context.mjs +67 -0
  77. package/dist/build-integrations/vitest/stack-context.mjs.map +1 -0
  78. package/dist/cli/main.d.mts +5 -0
  79. package/dist/cli/main.mjs +586 -0
  80. package/dist/cli/main.mjs.map +1 -0
  81. package/dist/cli/prune-direct.mjs +216 -0
  82. package/dist/cli/prune-direct.mjs.map +1 -0
  83. package/dist/cli/snapshot-reader.mjs +73 -0
  84. package/dist/cli/snapshot-reader.mjs.map +1 -0
  85. package/dist/cli/up-lifecycle.mjs +28 -0
  86. package/dist/cli/up-lifecycle.mjs.map +1 -0
  87. package/dist/contracts/capability-decl.d.mts +42 -0
  88. package/dist/contracts/chain-probe.d.mts +26 -0
  89. package/dist/contracts/chain-probe.mjs +8 -0
  90. package/dist/contracts/chain-probe.mjs.map +1 -0
  91. package/dist/contracts/codegenable.d.mts +43 -0
  92. package/dist/contracts/container-runtime.d.mts +245 -0
  93. package/dist/contracts/liveness-classifier.d.mts +19 -0
  94. package/dist/contracts/network-resolver.d.mts +15 -0
  95. package/dist/contracts/network-resolver.mjs +7 -0
  96. package/dist/contracts/network-resolver.mjs.map +1 -0
  97. package/dist/contracts/projection.d.mts +15 -0
  98. package/dist/contracts/routable.d.mts +53 -0
  99. package/dist/contracts/snapshotable.d.mts +39 -0
  100. package/dist/contracts/strategy-contributor.d.mts +26 -0
  101. package/dist/index.d.mts +89 -0
  102. package/dist/index.mjs +37 -0
  103. package/dist/orchestrators/codegen/bindings.d.mts +2 -0
  104. package/dist/orchestrators/codegen/bindings.mjs +340 -0
  105. package/dist/orchestrators/codegen/bindings.mjs.map +1 -0
  106. package/dist/orchestrators/codegen/emit.mjs +56 -0
  107. package/dist/orchestrators/codegen/emit.mjs.map +1 -0
  108. package/dist/orchestrators/codegen/errors.d.mts +1 -0
  109. package/dist/orchestrators/codegen/errors.mjs +66 -0
  110. package/dist/orchestrators/codegen/errors.mjs.map +1 -0
  111. package/dist/orchestrators/codegen/extras.mjs +16 -0
  112. package/dist/orchestrators/codegen/extras.mjs.map +1 -0
  113. package/dist/orchestrators/codegen/format.mjs +109 -0
  114. package/dist/orchestrators/codegen/format.mjs.map +1 -0
  115. package/dist/orchestrators/codegen/gitignore.mjs +67 -0
  116. package/dist/orchestrators/codegen/gitignore.mjs.map +1 -0
  117. package/dist/orchestrators/codegen/paths.d.mts +1 -0
  118. package/dist/orchestrators/codegen/paths.mjs +33 -0
  119. package/dist/orchestrators/codegen/paths.mjs.map +1 -0
  120. package/dist/orchestrators/codegen/permissions.mjs +6 -0
  121. package/dist/orchestrators/codegen/permissions.mjs.map +1 -0
  122. package/dist/orchestrators/codegen/service.d.mts +1 -0
  123. package/dist/orchestrators/codegen/service.mjs +276 -0
  124. package/dist/orchestrators/codegen/service.mjs.map +1 -0
  125. package/dist/orchestrators/router/cleanup.mjs +58 -0
  126. package/dist/orchestrators/router/cleanup.mjs.map +1 -0
  127. package/dist/orchestrators/router/cors.mjs +31 -0
  128. package/dist/orchestrators/router/cors.mjs.map +1 -0
  129. package/dist/orchestrators/router/entrypoints.d.mts +1 -0
  130. package/dist/orchestrators/router/entrypoints.mjs +80 -0
  131. package/dist/orchestrators/router/entrypoints.mjs.map +1 -0
  132. package/dist/orchestrators/router/errors.d.mts +1 -0
  133. package/dist/orchestrators/router/errors.mjs +103 -0
  134. package/dist/orchestrators/router/errors.mjs.map +1 -0
  135. package/dist/orchestrators/router/file-provider.d.mts +1 -0
  136. package/dist/orchestrators/router/file-provider.mjs +320 -0
  137. package/dist/orchestrators/router/file-provider.mjs.map +1 -0
  138. package/dist/orchestrators/router/hostname.d.mts +1 -0
  139. package/dist/orchestrators/router/hostname.mjs +107 -0
  140. package/dist/orchestrators/router/hostname.mjs.map +1 -0
  141. package/dist/orchestrators/router/index.d.mts +1 -0
  142. package/dist/orchestrators/router/profile.d.mts +1 -0
  143. package/dist/orchestrators/router/profile.mjs +109 -0
  144. package/dist/orchestrators/router/profile.mjs.map +1 -0
  145. package/dist/orchestrators/router/service.d.mts +3 -0
  146. package/dist/orchestrators/router/service.mjs +421 -0
  147. package/dist/orchestrators/router/service.mjs.map +1 -0
  148. package/dist/orchestrators/router/traefik-container.d.mts +1 -0
  149. package/dist/orchestrators/router/traefik-container.mjs +229 -0
  150. package/dist/orchestrators/router/traefik-container.mjs.map +1 -0
  151. package/dist/orchestrators/runtime-composition.d.mts +10 -0
  152. package/dist/orchestrators/runtime-composition.mjs +168 -0
  153. package/dist/orchestrators/runtime-composition.mjs.map +1 -0
  154. package/dist/orchestrators/snapshot/capture.d.mts +1 -0
  155. package/dist/orchestrators/snapshot/capture.mjs +350 -0
  156. package/dist/orchestrators/snapshot/capture.mjs.map +1 -0
  157. package/dist/orchestrators/snapshot/descriptor.d.mts +1 -0
  158. package/dist/orchestrators/snapshot/descriptor.mjs +109 -0
  159. package/dist/orchestrators/snapshot/descriptor.mjs.map +1 -0
  160. package/dist/orchestrators/snapshot/identity-guard.d.mts +1 -0
  161. package/dist/orchestrators/snapshot/identity-guard.mjs +132 -0
  162. package/dist/orchestrators/snapshot/identity-guard.mjs.map +1 -0
  163. package/dist/orchestrators/snapshot/image-bundle-tags.mjs +207 -0
  164. package/dist/orchestrators/snapshot/image-bundle-tags.mjs.map +1 -0
  165. package/dist/orchestrators/snapshot/index.d.mts +1 -0
  166. package/dist/orchestrators/snapshot/integrity.d.mts +1 -0
  167. package/dist/orchestrators/snapshot/integrity.mjs +74 -0
  168. package/dist/orchestrators/snapshot/integrity.mjs.map +1 -0
  169. package/dist/orchestrators/snapshot/prune.d.mts +1 -0
  170. package/dist/orchestrators/snapshot/prune.mjs +110 -0
  171. package/dist/orchestrators/snapshot/prune.mjs.map +1 -0
  172. package/dist/orchestrators/snapshot/restore.d.mts +1 -0
  173. package/dist/orchestrators/snapshot/restore.mjs +404 -0
  174. package/dist/orchestrators/snapshot/restore.mjs.map +1 -0
  175. package/dist/orchestrators/snapshot/service.d.mts +1 -0
  176. package/dist/orchestrators/snapshot/service.mjs +296 -0
  177. package/dist/orchestrators/snapshot/service.mjs.map +1 -0
  178. package/dist/orchestrators/snapshot/state-document.mjs +18 -0
  179. package/dist/orchestrators/snapshot/state-document.mjs.map +1 -0
  180. package/dist/orchestrators/snapshot/wipe.d.mts +1 -0
  181. package/dist/orchestrators/snapshot/wipe.mjs +59 -0
  182. package/dist/orchestrators/snapshot/wipe.mjs.map +1 -0
  183. package/dist/plugins/account/codegen.d.mts +12 -0
  184. package/dist/plugins/account/codegen.mjs +22 -0
  185. package/dist/plugins/account/codegen.mjs.map +1 -0
  186. package/dist/plugins/account/errors.d.mts +44 -0
  187. package/dist/plugins/account/errors.mjs +16 -0
  188. package/dist/plugins/account/errors.mjs.map +1 -0
  189. package/dist/plugins/account/funding.d.mts +94 -0
  190. package/dist/plugins/account/funding.mjs +199 -0
  191. package/dist/plugins/account/funding.mjs.map +1 -0
  192. package/dist/plugins/account/index.d.mts +54 -0
  193. package/dist/plugins/account/index.mjs +151 -0
  194. package/dist/plugins/account/index.mjs.map +1 -0
  195. package/dist/plugins/account/keypair.d.mts +32 -0
  196. package/dist/plugins/account/keypair.mjs +99 -0
  197. package/dist/plugins/account/keypair.mjs.map +1 -0
  198. package/dist/plugins/account/lease.mjs +21 -0
  199. package/dist/plugins/account/lease.mjs.map +1 -0
  200. package/dist/plugins/account/registry.d.mts +33 -0
  201. package/dist/plugins/account/registry.mjs +36 -0
  202. package/dist/plugins/account/registry.mjs.map +1 -0
  203. package/dist/plugins/account/service.d.mts +104 -0
  204. package/dist/plugins/account/service.mjs +405 -0
  205. package/dist/plugins/account/service.mjs.map +1 -0
  206. package/dist/plugins/account/snapshot.mjs +33 -0
  207. package/dist/plugins/account/snapshot.mjs.map +1 -0
  208. package/dist/plugins/account/variants/env.mjs +24 -0
  209. package/dist/plugins/account/variants/env.mjs.map +1 -0
  210. package/dist/plugins/account/variants/ephemeral.mjs +72 -0
  211. package/dist/plugins/account/variants/ephemeral.mjs.map +1 -0
  212. package/dist/plugins/account/variants/impersonate.d.mts +16 -0
  213. package/dist/plugins/account/variants/impersonate.mjs +48 -0
  214. package/dist/plugins/account/variants/impersonate.mjs.map +1 -0
  215. package/dist/plugins/account/variants/inline.mjs +13 -0
  216. package/dist/plugins/account/variants/inline.mjs.map +1 -0
  217. package/dist/plugins/account/variants/keystore.mjs +93 -0
  218. package/dist/plugins/account/variants/keystore.mjs.map +1 -0
  219. package/dist/plugins/account/variants/signer.mjs +31 -0
  220. package/dist/plugins/account/variants/signer.mjs.map +1 -0
  221. package/dist/plugins/action/build-context.d.mts +41 -0
  222. package/dist/plugins/action/discriminator.d.mts +20 -0
  223. package/dist/plugins/action/discriminator.mjs +13 -0
  224. package/dist/plugins/action/discriminator.mjs.map +1 -0
  225. package/dist/plugins/action/errors.d.mts +31 -0
  226. package/dist/plugins/action/errors.mjs +13 -0
  227. package/dist/plugins/action/errors.mjs.map +1 -0
  228. package/dist/plugins/action/execute.d.mts +2 -0
  229. package/dist/plugins/action/execute.mjs +145 -0
  230. package/dist/plugins/action/execute.mjs.map +1 -0
  231. package/dist/plugins/action/index.d.mts +56 -0
  232. package/dist/plugins/action/index.mjs +82 -0
  233. package/dist/plugins/action/index.mjs.map +1 -0
  234. package/dist/plugins/action/service.d.mts +26 -0
  235. package/dist/plugins/action/service.mjs +84 -0
  236. package/dist/plugins/action/service.mjs.map +1 -0
  237. package/dist/plugins/coin/address-resolution.d.mts +34 -0
  238. package/dist/plugins/coin/address-resolution.mjs +80 -0
  239. package/dist/plugins/coin/address-resolution.mjs.map +1 -0
  240. package/dist/plugins/coin/codegen.d.mts +16 -0
  241. package/dist/plugins/coin/codegen.mjs +21 -0
  242. package/dist/plugins/coin/codegen.mjs.map +1 -0
  243. package/dist/plugins/coin/discovery.d.mts +26 -0
  244. package/dist/plugins/coin/discovery.mjs +112 -0
  245. package/dist/plugins/coin/discovery.mjs.map +1 -0
  246. package/dist/plugins/coin/errors.d.mts +48 -0
  247. package/dist/plugins/coin/errors.mjs +13 -0
  248. package/dist/plugins/coin/errors.mjs.map +1 -0
  249. package/dist/plugins/coin/index.d.mts +95 -0
  250. package/dist/plugins/coin/index.mjs +172 -0
  251. package/dist/plugins/coin/index.mjs.map +1 -0
  252. package/dist/plugins/coin/metadata.d.mts +15 -0
  253. package/dist/plugins/coin/metadata.mjs +99 -0
  254. package/dist/plugins/coin/metadata.mjs.map +1 -0
  255. package/dist/plugins/coin/mint.d.mts +34 -0
  256. package/dist/plugins/coin/mint.mjs +164 -0
  257. package/dist/plugins/coin/mint.mjs.map +1 -0
  258. package/dist/plugins/coin/registry.d.mts +1 -0
  259. package/dist/plugins/coin/registry.mjs +37 -0
  260. package/dist/plugins/coin/registry.mjs.map +1 -0
  261. package/dist/plugins/coin/service.d.mts +47 -0
  262. package/dist/plugins/coin/service.mjs +51 -0
  263. package/dist/plugins/coin/service.mjs.map +1 -0
  264. package/dist/plugins/coin/snapshot.mjs +19 -0
  265. package/dist/plugins/coin/snapshot.mjs.map +1 -0
  266. package/dist/plugins/coin/type-strings.mjs +49 -0
  267. package/dist/plugins/coin/type-strings.mjs.map +1 -0
  268. package/dist/plugins/deepbook/codegen.d.mts +39 -0
  269. package/dist/plugins/deepbook/codegen.mjs +15 -0
  270. package/dist/plugins/deepbook/codegen.mjs.map +1 -0
  271. package/dist/plugins/deepbook/deploy.mjs +437 -0
  272. package/dist/plugins/deepbook/deploy.mjs.map +1 -0
  273. package/dist/plugins/deepbook/errors.d.mts +29 -0
  274. package/dist/plugins/deepbook/errors.mjs +26 -0
  275. package/dist/plugins/deepbook/errors.mjs.map +1 -0
  276. package/dist/plugins/deepbook/faucet-strategy.d.mts +8 -0
  277. package/dist/plugins/deepbook/faucet-strategy.mjs +81 -0
  278. package/dist/plugins/deepbook/faucet-strategy.mjs.map +1 -0
  279. package/dist/plugins/deepbook/index.d.mts +171 -0
  280. package/dist/plugins/deepbook/index.mjs +359 -0
  281. package/dist/plugins/deepbook/index.mjs.map +1 -0
  282. package/dist/plugins/deepbook/plugin-key.mjs +7 -0
  283. package/dist/plugins/deepbook/plugin-key.mjs.map +1 -0
  284. package/dist/plugins/deepbook/pyth/index.mjs +226 -0
  285. package/dist/plugins/deepbook/pyth/index.mjs.map +1 -0
  286. package/dist/plugins/deepbook/routable.mjs +21 -0
  287. package/dist/plugins/deepbook/routable.mjs.map +1 -0
  288. package/dist/plugins/deepbook/snapshot.mjs +49 -0
  289. package/dist/plugins/deepbook/snapshot.mjs.map +1 -0
  290. package/dist/plugins/deepbook/types.d.mts +125 -0
  291. package/dist/plugins/deepbook/types.mjs +12 -0
  292. package/dist/plugins/deepbook/types.mjs.map +1 -0
  293. package/dist/plugins/faucet/dispatcher.d.mts +9 -0
  294. package/dist/plugins/faucet/dispatcher.mjs +13 -0
  295. package/dist/plugins/faucet/dispatcher.mjs.map +1 -0
  296. package/dist/plugins/faucet/errors.d.mts +86 -0
  297. package/dist/plugins/faucet/errors.mjs +19 -0
  298. package/dist/plugins/faucet/errors.mjs.map +1 -0
  299. package/dist/plugins/faucet/http.mjs +127 -0
  300. package/dist/plugins/faucet/http.mjs.map +1 -0
  301. package/dist/plugins/faucet/index.d.mts +43 -0
  302. package/dist/plugins/faucet/index.mjs +42 -0
  303. package/dist/plugins/faucet/index.mjs.map +1 -0
  304. package/dist/plugins/faucet/service.d.mts +20 -0
  305. package/dist/plugins/faucet/strategies/sui-local.d.mts +23 -0
  306. package/dist/plugins/faucet/strategies/sui-local.mjs +29 -0
  307. package/dist/plugins/faucet/strategies/sui-local.mjs.map +1 -0
  308. package/dist/plugins/host-service/errors.d.mts +27 -0
  309. package/dist/plugins/host-service/errors.mjs +14 -0
  310. package/dist/plugins/host-service/errors.mjs.map +1 -0
  311. package/dist/plugins/host-service/index.d.mts +10 -0
  312. package/dist/plugins/host-service/index.mjs +48 -0
  313. package/dist/plugins/host-service/index.mjs.map +1 -0
  314. package/dist/plugins/host-service/routable.mjs +24 -0
  315. package/dist/plugins/host-service/routable.mjs.map +1 -0
  316. package/dist/plugins/host-service/service.d.mts +49 -0
  317. package/dist/plugins/host-service/service.mjs +375 -0
  318. package/dist/plugins/host-service/service.mjs.map +1 -0
  319. package/dist/plugins/package/build.d.mts +1 -0
  320. package/dist/plugins/package/build.mjs +24 -0
  321. package/dist/plugins/package/build.mjs.map +1 -0
  322. package/dist/plugins/package/codegen.d.mts +19 -0
  323. package/dist/plugins/package/codegen.mjs +41 -0
  324. package/dist/plugins/package/codegen.mjs.map +1 -0
  325. package/dist/plugins/package/dep-resolution.mjs +10 -0
  326. package/dist/plugins/package/dep-resolution.mjs.map +1 -0
  327. package/dist/plugins/package/errors.d.mts +34 -0
  328. package/dist/plugins/package/errors.mjs +13 -0
  329. package/dist/plugins/package/errors.mjs.map +1 -0
  330. package/dist/plugins/package/index.d.mts +109 -0
  331. package/dist/plugins/package/index.mjs +207 -0
  332. package/dist/plugins/package/index.mjs.map +1 -0
  333. package/dist/plugins/package/mode-known.mjs +41 -0
  334. package/dist/plugins/package/mode-known.mjs.map +1 -0
  335. package/dist/plugins/package/mode-local.d.mts +1 -0
  336. package/dist/plugins/package/mode-local.mjs +183 -0
  337. package/dist/plugins/package/mode-local.mjs.map +1 -0
  338. package/dist/plugins/package/publish-executor.mjs +202 -0
  339. package/dist/plugins/package/publish-executor.mjs.map +1 -0
  340. package/dist/plugins/package/publish-output.d.mts +28 -0
  341. package/dist/plugins/package/publish-output.mjs +45 -0
  342. package/dist/plugins/package/publish-output.mjs.map +1 -0
  343. package/dist/plugins/package/registry.d.mts +25 -0
  344. package/dist/plugins/package/registry.mjs +30 -0
  345. package/dist/plugins/package/registry.mjs.map +1 -0
  346. package/dist/plugins/package/service.mjs +20 -0
  347. package/dist/plugins/package/service.mjs.map +1 -0
  348. package/dist/plugins/package/snapshot.mjs +25 -0
  349. package/dist/plugins/package/snapshot.mjs.map +1 -0
  350. package/dist/plugins/postgres/codegen.mjs +42 -0
  351. package/dist/plugins/postgres/codegen.mjs.map +1 -0
  352. package/dist/plugins/postgres/connection.d.mts +33 -0
  353. package/dist/plugins/postgres/connection.mjs +19 -0
  354. package/dist/plugins/postgres/connection.mjs.map +1 -0
  355. package/dist/plugins/postgres/db-ensure.mjs +100 -0
  356. package/dist/plugins/postgres/db-ensure.mjs.map +1 -0
  357. package/dist/plugins/postgres/errors.d.mts +55 -0
  358. package/dist/plugins/postgres/errors.mjs +29 -0
  359. package/dist/plugins/postgres/errors.mjs.map +1 -0
  360. package/dist/plugins/postgres/index.d.mts +37 -0
  361. package/dist/plugins/postgres/index.mjs +75 -0
  362. package/dist/plugins/postgres/index.mjs.map +1 -0
  363. package/dist/plugins/postgres/routable.mjs +33 -0
  364. package/dist/plugins/postgres/routable.mjs.map +1 -0
  365. package/dist/plugins/postgres/service.d.mts +50 -0
  366. package/dist/plugins/postgres/service.mjs +145 -0
  367. package/dist/plugins/postgres/service.mjs.map +1 -0
  368. package/dist/plugins/postgres/snapshot.d.mts +1 -0
  369. package/dist/plugins/postgres/snapshot.mjs +32 -0
  370. package/dist/plugins/postgres/snapshot.mjs.map +1 -0
  371. package/dist/plugins/router-entrypoints.mjs +21 -0
  372. package/dist/plugins/router-entrypoints.mjs.map +1 -0
  373. package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs +59 -0
  374. package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs.map +1 -0
  375. package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs +132 -0
  376. package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs.map +1 -0
  377. package/dist/plugins/seal/codegen.d.mts +19 -0
  378. package/dist/plugins/seal/codegen.mjs +16 -0
  379. package/dist/plugins/seal/codegen.mjs.map +1 -0
  380. package/dist/plugins/seal/config-render.mjs +82 -0
  381. package/dist/plugins/seal/config-render.mjs.map +1 -0
  382. package/dist/plugins/seal/deploy.mjs +198 -0
  383. package/dist/plugins/seal/deploy.mjs.map +1 -0
  384. package/dist/plugins/seal/errors.d.mts +52 -0
  385. package/dist/plugins/seal/errors.mjs +19 -0
  386. package/dist/plugins/seal/errors.mjs.map +1 -0
  387. package/dist/plugins/seal/index.d.mts +161 -0
  388. package/dist/plugins/seal/index.mjs +235 -0
  389. package/dist/plugins/seal/index.mjs.map +1 -0
  390. package/dist/plugins/seal/key-manager.d.mts +22 -0
  391. package/dist/plugins/seal/key-manager.mjs +22 -0
  392. package/dist/plugins/seal/key-manager.mjs.map +1 -0
  393. package/dist/plugins/seal/key-server.mjs +175 -0
  394. package/dist/plugins/seal/key-server.mjs.map +1 -0
  395. package/dist/plugins/seal/keygen.mjs +96 -0
  396. package/dist/plugins/seal/keygen.mjs.map +1 -0
  397. package/dist/plugins/seal/mode/fork-known.d.mts +8 -0
  398. package/dist/plugins/seal/mode/fork-known.mjs +23 -0
  399. package/dist/plugins/seal/mode/fork-known.mjs.map +1 -0
  400. package/dist/plugins/seal/mode/live.d.mts +18 -0
  401. package/dist/plugins/seal/mode/live.mjs +64 -0
  402. package/dist/plugins/seal/mode/live.mjs.map +1 -0
  403. package/dist/plugins/seal/mode/local-keygen.mjs +180 -0
  404. package/dist/plugins/seal/mode/local-keygen.mjs.map +1 -0
  405. package/dist/plugins/seal/plugin-key.mjs +7 -0
  406. package/dist/plugins/seal/plugin-key.mjs.map +1 -0
  407. package/dist/plugins/seal/registry-publish.d.mts +43 -0
  408. package/dist/plugins/seal/registry-publish.mjs +9 -0
  409. package/dist/plugins/seal/registry-publish.mjs.map +1 -0
  410. package/dist/plugins/seal/routable.mjs +57 -0
  411. package/dist/plugins/seal/routable.mjs.map +1 -0
  412. package/dist/plugins/seal/service.mjs +17 -0
  413. package/dist/plugins/seal/service.mjs.map +1 -0
  414. package/dist/plugins/seal/snapshot.mjs +51 -0
  415. package/dist/plugins/seal/snapshot.mjs.map +1 -0
  416. package/dist/plugins/sui/auto-tick.mjs +45 -0
  417. package/dist/plugins/sui/auto-tick.mjs.map +1 -0
  418. package/dist/plugins/sui/chain-build-container.d.mts +1 -0
  419. package/dist/plugins/sui/chain-probe.d.mts +85 -0
  420. package/dist/plugins/sui/chain-probe.mjs +104 -0
  421. package/dist/plugins/sui/chain-probe.mjs.map +1 -0
  422. package/dist/plugins/sui/codegen.d.mts +14 -0
  423. package/dist/plugins/sui/codegen.mjs +26 -0
  424. package/dist/plugins/sui/codegen.mjs.map +1 -0
  425. package/dist/plugins/sui/errors.d.mts +74 -0
  426. package/dist/plugins/sui/errors.mjs +28 -0
  427. package/dist/plugins/sui/errors.mjs.map +1 -0
  428. package/dist/plugins/sui/fork-orchestration.mjs +24 -0
  429. package/dist/plugins/sui/fork-orchestration.mjs.map +1 -0
  430. package/dist/plugins/sui/fork-transaction.mjs +96 -0
  431. package/dist/plugins/sui/fork-transaction.mjs.map +1 -0
  432. package/dist/plugins/sui/index.d.mts +318 -0
  433. package/dist/plugins/sui/index.mjs +182 -0
  434. package/dist/plugins/sui/index.mjs.map +1 -0
  435. package/dist/plugins/sui/mode/external.mjs +60 -0
  436. package/dist/plugins/sui/mode/external.mjs.map +1 -0
  437. package/dist/plugins/sui/mode/fork.mjs +283 -0
  438. package/dist/plugins/sui/mode/fork.mjs.map +1 -0
  439. package/dist/plugins/sui/mode/live.mjs +103 -0
  440. package/dist/plugins/sui/mode/live.mjs.map +1 -0
  441. package/dist/plugins/sui/mode/local.mjs +293 -0
  442. package/dist/plugins/sui/mode/local.mjs.map +1 -0
  443. package/dist/plugins/sui/mode/shared-boot.mjs +254 -0
  444. package/dist/plugins/sui/mode/shared-boot.mjs.map +1 -0
  445. package/dist/plugins/sui/mode/shared.d.mts +103 -0
  446. package/dist/plugins/sui/mode/shared.mjs +12 -0
  447. package/dist/plugins/sui/mode/shared.mjs.map +1 -0
  448. package/dist/plugins/sui/mode/spec.d.mts +94 -0
  449. package/dist/plugins/sui/network-resolver.d.mts +23 -0
  450. package/dist/plugins/sui/routable.mjs +88 -0
  451. package/dist/plugins/sui/routable.mjs.map +1 -0
  452. package/dist/plugins/sui/seed-objects.d.mts +18 -0
  453. package/dist/plugins/sui/seed-objects.mjs +25 -0
  454. package/dist/plugins/sui/seed-objects.mjs.map +1 -0
  455. package/dist/plugins/sui/service.mjs +38 -0
  456. package/dist/plugins/sui/service.mjs.map +1 -0
  457. package/dist/plugins/sui/snapshot.mjs +53 -0
  458. package/dist/plugins/sui/snapshot.mjs.map +1 -0
  459. package/dist/plugins/wallet/codegen.d.mts +33 -0
  460. package/dist/plugins/wallet/codegen.mjs +34 -0
  461. package/dist/plugins/wallet/codegen.mjs.map +1 -0
  462. package/dist/plugins/wallet/errors.d.mts +66 -0
  463. package/dist/plugins/wallet/errors.mjs +16 -0
  464. package/dist/plugins/wallet/errors.mjs.map +1 -0
  465. package/dist/plugins/wallet/index.d.mts +63 -0
  466. package/dist/plugins/wallet/index.mjs +126 -0
  467. package/dist/plugins/wallet/index.mjs.map +1 -0
  468. package/dist/plugins/wallet/origin-policy.d.mts +1 -0
  469. package/dist/plugins/wallet/origin-policy.mjs +65 -0
  470. package/dist/plugins/wallet/origin-policy.mjs.map +1 -0
  471. package/dist/plugins/wallet/pairing.d.mts +11 -0
  472. package/dist/plugins/wallet/pairing.mjs +125 -0
  473. package/dist/plugins/wallet/pairing.mjs.map +1 -0
  474. package/dist/plugins/wallet/protocol.d.mts +1 -0
  475. package/dist/plugins/wallet/protocol.mjs +96 -0
  476. package/dist/plugins/wallet/protocol.mjs.map +1 -0
  477. package/dist/plugins/wallet/routable.mjs +32 -0
  478. package/dist/plugins/wallet/routable.mjs.map +1 -0
  479. package/dist/plugins/wallet/server.d.mts +12 -0
  480. package/dist/plugins/wallet/server.mjs +317 -0
  481. package/dist/plugins/wallet/server.mjs.map +1 -0
  482. package/dist/plugins/wallet/service.d.mts +68 -0
  483. package/dist/plugins/wallet/service.mjs +97 -0
  484. package/dist/plugins/wallet/service.mjs.map +1 -0
  485. package/dist/plugins/wallet/snapshot.d.mts +1 -0
  486. package/dist/plugins/wallet/snapshot.mjs +14 -0
  487. package/dist/plugins/wallet/snapshot.mjs.map +1 -0
  488. package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs +42 -0
  489. package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs.map +1 -0
  490. package/dist/plugins/walrus/codegen.d.mts +38 -0
  491. package/dist/plugins/walrus/codegen.mjs +34 -0
  492. package/dist/plugins/walrus/codegen.mjs.map +1 -0
  493. package/dist/plugins/walrus/deploy-paths.mjs +14 -0
  494. package/dist/plugins/walrus/deploy-paths.mjs.map +1 -0
  495. package/dist/plugins/walrus/deploy.d.mts +1 -0
  496. package/dist/plugins/walrus/deploy.mjs +224 -0
  497. package/dist/plugins/walrus/deploy.mjs.map +1 -0
  498. package/dist/plugins/walrus/errors.d.mts +38 -0
  499. package/dist/plugins/walrus/errors.mjs +26 -0
  500. package/dist/plugins/walrus/errors.mjs.map +1 -0
  501. package/dist/plugins/walrus/faucet-strategy.d.mts +12 -0
  502. package/dist/plugins/walrus/faucet-strategy.mjs +62 -0
  503. package/dist/plugins/walrus/faucet-strategy.mjs.map +1 -0
  504. package/dist/plugins/walrus/index.d.mts +177 -0
  505. package/dist/plugins/walrus/index.mjs +284 -0
  506. package/dist/plugins/walrus/index.mjs.map +1 -0
  507. package/dist/plugins/walrus/mode/known-deploy.d.mts +25 -0
  508. package/dist/plugins/walrus/mode/known-deploy.mjs +71 -0
  509. package/dist/plugins/walrus/mode/known-deploy.mjs.map +1 -0
  510. package/dist/plugins/walrus/mode/local-cluster.d.mts +34 -0
  511. package/dist/plugins/walrus/mode/local-cluster.mjs +153 -0
  512. package/dist/plugins/walrus/mode/local-cluster.mjs.map +1 -0
  513. package/dist/plugins/walrus/plugin-key.mjs +7 -0
  514. package/dist/plugins/walrus/plugin-key.mjs.map +1 -0
  515. package/dist/plugins/walrus/registry-publish.d.mts +24 -0
  516. package/dist/plugins/walrus/registry-publish.mjs +7 -0
  517. package/dist/plugins/walrus/registry-publish.mjs.map +1 -0
  518. package/dist/plugins/walrus/routable.mjs +99 -0
  519. package/dist/plugins/walrus/routable.mjs.map +1 -0
  520. package/dist/plugins/walrus/service.mjs +20 -0
  521. package/dist/plugins/walrus/service.mjs.map +1 -0
  522. package/dist/plugins/walrus/snapshot.mjs +53 -0
  523. package/dist/plugins/walrus/snapshot.mjs.map +1 -0
  524. package/dist/plugins/walrus/storage-nodes.d.mts +15 -0
  525. package/dist/plugins/walrus/storage-nodes.mjs +154 -0
  526. package/dist/plugins/walrus/storage-nodes.mjs.map +1 -0
  527. package/dist/plugins/walrus/wal-swap.d.mts +2 -0
  528. package/dist/plugins/walrus/wal-swap.mjs +58 -0
  529. package/dist/plugins/walrus/wal-swap.mjs.map +1 -0
  530. package/dist/primitives/artifact-publisher.d.mts +12 -0
  531. package/dist/primitives/cache.d.mts +1 -0
  532. package/dist/runtime/built-in-plugin-layers.mjs +49 -0
  533. package/dist/runtime/built-in-plugin-layers.mjs.map +1 -0
  534. package/dist/runtime/docker/client.d.mts +2 -0
  535. package/dist/runtime/docker/client.mjs +54 -0
  536. package/dist/runtime/docker/client.mjs.map +1 -0
  537. package/dist/runtime/docker/container.d.mts +1 -0
  538. package/dist/runtime/docker/container.mjs +562 -0
  539. package/dist/runtime/docker/container.mjs.map +1 -0
  540. package/dist/runtime/docker/errors.d.mts +1 -0
  541. package/dist/runtime/docker/errors.mjs +187 -0
  542. package/dist/runtime/docker/errors.mjs.map +1 -0
  543. package/dist/runtime/docker/exec.d.mts +1 -0
  544. package/dist/runtime/docker/exec.mjs +63 -0
  545. package/dist/runtime/docker/exec.mjs.map +1 -0
  546. package/dist/runtime/docker/image.d.mts +1 -0
  547. package/dist/runtime/docker/image.mjs +278 -0
  548. package/dist/runtime/docker/image.mjs.map +1 -0
  549. package/dist/runtime/docker/index.d.mts +1 -0
  550. package/dist/runtime/docker/inventory.d.mts +1 -0
  551. package/dist/runtime/docker/inventory.mjs +167 -0
  552. package/dist/runtime/docker/inventory.mjs.map +1 -0
  553. package/dist/runtime/docker/labels.d.mts +1 -0
  554. package/dist/runtime/docker/labels.mjs +97 -0
  555. package/dist/runtime/docker/labels.mjs.map +1 -0
  556. package/dist/runtime/docker/logs.d.mts +1 -0
  557. package/dist/runtime/docker/logs.mjs +34 -0
  558. package/dist/runtime/docker/logs.mjs.map +1 -0
  559. package/dist/runtime/docker/network.d.mts +1 -0
  560. package/dist/runtime/docker/network.mjs +168 -0
  561. package/dist/runtime/docker/network.mjs.map +1 -0
  562. package/dist/runtime/docker/service.d.mts +9 -0
  563. package/dist/runtime/docker/service.mjs +266 -0
  564. package/dist/runtime/docker/service.mjs.map +1 -0
  565. package/dist/runtime/docker/sweep.d.mts +1 -0
  566. package/dist/runtime/docker/sweep.mjs +220 -0
  567. package/dist/runtime/docker/sweep.mjs.map +1 -0
  568. package/dist/runtime/docker/volume.d.mts +1 -0
  569. package/dist/runtime/docker/volume.mjs +24 -0
  570. package/dist/runtime/docker/volume.mjs.map +1 -0
  571. package/dist/runtime/docker/wrap.d.mts +1 -0
  572. package/dist/runtime/docker/wrap.mjs +131 -0
  573. package/dist/runtime/docker/wrap.mjs.map +1 -0
  574. package/dist/substrate/brand.d.mts +24 -0
  575. package/dist/substrate/brand.mjs +14 -0
  576. package/dist/substrate/brand.mjs.map +1 -0
  577. package/dist/substrate/cross-process.d.mts +1 -0
  578. package/dist/substrate/cross-process.mjs +28 -0
  579. package/dist/substrate/cross-process.mjs.map +1 -0
  580. package/dist/substrate/events.d.mts +117 -0
  581. package/dist/substrate/identity.d.mts +13 -0
  582. package/dist/substrate/lifecycle.d.mts +12 -0
  583. package/dist/substrate/manifest.d.mts +39 -0
  584. package/dist/substrate/manifest.mjs +33 -0
  585. package/dist/substrate/manifest.mjs.map +1 -0
  586. package/dist/substrate/network.d.mts +34 -0
  587. package/dist/substrate/options.d.mts +23 -0
  588. package/dist/substrate/plugin.d.mts +101 -0
  589. package/dist/substrate/plugin.mjs +61 -0
  590. package/dist/substrate/plugin.mjs.map +1 -0
  591. package/dist/substrate/projection.d.mts +100 -0
  592. package/dist/substrate/runtime/artifact-publisher/index.mjs +76 -0
  593. package/dist/substrate/runtime/artifact-publisher/index.mjs.map +1 -0
  594. package/dist/substrate/runtime/atomic-write.mjs +106 -0
  595. package/dist/substrate/runtime/atomic-write.mjs.map +1 -0
  596. package/dist/substrate/runtime/cache/index.d.mts +1 -0
  597. package/dist/substrate/runtime/cache/schema.d.mts +1 -0
  598. package/dist/substrate/runtime/cache/schema.mjs +22 -0
  599. package/dist/substrate/runtime/cache/schema.mjs.map +1 -0
  600. package/dist/substrate/runtime/cache/service.d.mts +1 -0
  601. package/dist/substrate/runtime/cache/service.mjs +89 -0
  602. package/dist/substrate/runtime/cache/service.mjs.map +1 -0
  603. package/dist/substrate/runtime/capability-sinks/index.d.mts +1 -0
  604. package/dist/substrate/runtime/capability-sinks/layer.d.mts +1 -0
  605. package/dist/substrate/runtime/capability-sinks/layer.mjs +31 -0
  606. package/dist/substrate/runtime/capability-sinks/layer.mjs.map +1 -0
  607. package/dist/substrate/runtime/capability-sinks/service.d.mts +36 -0
  608. package/dist/substrate/runtime/capability-sinks/service.mjs +74 -0
  609. package/dist/substrate/runtime/capability-sinks/service.mjs.map +1 -0
  610. package/dist/substrate/runtime/config-validation.d.mts +38 -0
  611. package/dist/substrate/runtime/config-validation.mjs +137 -0
  612. package/dist/substrate/runtime/config-validation.mjs.map +1 -0
  613. package/dist/substrate/runtime/context-helpers.mjs +32 -0
  614. package/dist/substrate/runtime/context-helpers.mjs.map +1 -0
  615. package/dist/substrate/runtime/cross-process/command-channel/channel.mjs +128 -0
  616. package/dist/substrate/runtime/cross-process/command-channel/channel.mjs.map +1 -0
  617. package/dist/substrate/runtime/cross-process/command-channel/file-channel.mjs +136 -0
  618. package/dist/substrate/runtime/cross-process/command-channel/file-channel.mjs.map +1 -0
  619. package/dist/substrate/runtime/cross-process/command-channel/protocol.mjs +49 -0
  620. package/dist/substrate/runtime/cross-process/command-channel/protocol.mjs.map +1 -0
  621. package/dist/substrate/runtime/cross-process/command-channel/runtime-control-lock.mjs +9 -0
  622. package/dist/substrate/runtime/cross-process/command-channel/runtime-control-lock.mjs.map +1 -0
  623. package/dist/substrate/runtime/cross-process/liveness.mjs +119 -0
  624. package/dist/substrate/runtime/cross-process/liveness.mjs.map +1 -0
  625. package/dist/substrate/runtime/cross-process/roster.mjs +275 -0
  626. package/dist/substrate/runtime/cross-process/roster.mjs.map +1 -0
  627. package/dist/substrate/runtime/cross-process/snapshot-reservation.d.mts +1 -0
  628. package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs +117 -0
  629. package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs.map +1 -0
  630. package/dist/substrate/runtime/cross-process/stack-lock.d.mts +1 -0
  631. package/dist/substrate/runtime/cross-process/stack-lock.mjs +142 -0
  632. package/dist/substrate/runtime/cross-process/stack-lock.mjs.map +1 -0
  633. package/dist/substrate/runtime/current-plugin.mjs +15 -0
  634. package/dist/substrate/runtime/current-plugin.mjs.map +1 -0
  635. package/dist/substrate/runtime/errors.d.mts +1 -0
  636. package/dist/substrate/runtime/errors.mjs +76 -0
  637. package/dist/substrate/runtime/errors.mjs.map +1 -0
  638. package/dist/substrate/runtime/host-tree-tar/index.mjs +364 -0
  639. package/dist/substrate/runtime/host-tree-tar/index.mjs.map +1 -0
  640. package/dist/substrate/runtime/http-probe.d.mts +35 -0
  641. package/dist/substrate/runtime/http-probe.mjs +65 -0
  642. package/dist/substrate/runtime/http-probe.mjs.map +1 -0
  643. package/dist/substrate/runtime/lease-broker/index.d.mts +1 -0
  644. package/dist/substrate/runtime/lease-broker/service.d.mts +64 -0
  645. package/dist/substrate/runtime/lease-broker/service.mjs +155 -0
  646. package/dist/substrate/runtime/lease-broker/service.mjs.map +1 -0
  647. package/dist/substrate/runtime/lifecycle/dep-graph.d.mts +1 -0
  648. package/dist/substrate/runtime/lifecycle/dep-graph.mjs +138 -0
  649. package/dist/substrate/runtime/lifecycle/dep-graph.mjs.map +1 -0
  650. package/dist/substrate/runtime/lifecycle/index.d.mts +1 -0
  651. package/dist/substrate/runtime/lifecycle/lifecycle-fact.mjs +31 -0
  652. package/dist/substrate/runtime/lifecycle/lifecycle-fact.mjs.map +1 -0
  653. package/dist/substrate/runtime/lifecycle/plugin-registry.d.mts +1 -0
  654. package/dist/substrate/runtime/lifecycle/plugin-registry.mjs +133 -0
  655. package/dist/substrate/runtime/lifecycle/plugin-registry.mjs.map +1 -0
  656. package/dist/substrate/runtime/lifecycle/ready-gate.d.mts +1 -0
  657. package/dist/substrate/runtime/lifecycle/ready-gate.mjs +34 -0
  658. package/dist/substrate/runtime/lifecycle/ready-gate.mjs.map +1 -0
  659. package/dist/substrate/runtime/lifecycle/selective-restart.d.mts +1 -0
  660. package/dist/substrate/runtime/lifecycle/selective-restart.mjs +43 -0
  661. package/dist/substrate/runtime/lifecycle/selective-restart.mjs.map +1 -0
  662. package/dist/substrate/runtime/lifecycle/signals.d.mts +1 -0
  663. package/dist/substrate/runtime/lifecycle/signals.mjs +64 -0
  664. package/dist/substrate/runtime/lifecycle/signals.mjs.map +1 -0
  665. package/dist/substrate/runtime/lifecycle/state-machine.d.mts +1 -0
  666. package/dist/substrate/runtime/lifecycle/state-machine.mjs +38 -0
  667. package/dist/substrate/runtime/lifecycle/state-machine.mjs.map +1 -0
  668. package/dist/substrate/runtime/lifecycle/watch-attribution.d.mts +1 -0
  669. package/dist/substrate/runtime/lifecycle/watch-attribution.mjs +27 -0
  670. package/dist/substrate/runtime/lifecycle/watch-attribution.mjs.map +1 -0
  671. package/dist/substrate/runtime/managed-container.d.mts +30 -0
  672. package/dist/substrate/runtime/managed-container.mjs +32 -0
  673. package/dist/substrate/runtime/managed-container.mjs.map +1 -0
  674. package/dist/substrate/runtime/manifest/manifest.mjs +73 -0
  675. package/dist/substrate/runtime/manifest/manifest.mjs.map +1 -0
  676. package/dist/substrate/runtime/mode-errors.d.mts +36 -0
  677. package/dist/substrate/runtime/observability/cascade-formatter.d.mts +1 -0
  678. package/dist/substrate/runtime/observability/cascade-formatter.mjs +135 -0
  679. package/dist/substrate/runtime/observability/cascade-formatter.mjs.map +1 -0
  680. package/dist/substrate/runtime/observability/formatter-registry.d.mts +1 -0
  681. package/dist/substrate/runtime/observability/formatter-registry.mjs +65 -0
  682. package/dist/substrate/runtime/observability/formatter-registry.mjs.map +1 -0
  683. package/dist/substrate/runtime/observability/index.d.mts +3 -0
  684. package/dist/substrate/runtime/observability/logger.d.mts +58 -0
  685. package/dist/substrate/runtime/observability/logger.mjs +89 -0
  686. package/dist/substrate/runtime/observability/logger.mjs.map +1 -0
  687. package/dist/substrate/runtime/observability/pretty-error.d.mts +1 -0
  688. package/dist/substrate/runtime/observability/pretty-error.mjs +119 -0
  689. package/dist/substrate/runtime/observability/pretty-error.mjs.map +1 -0
  690. package/dist/substrate/runtime/observability/process-lines.d.mts +31 -0
  691. package/dist/substrate/runtime/observability/process-lines.mjs +40 -0
  692. package/dist/substrate/runtime/observability/process-lines.mjs.map +1 -0
  693. package/dist/substrate/runtime/observability/redaction.d.mts +28 -0
  694. package/dist/substrate/runtime/observability/redaction.mjs +45 -0
  695. package/dist/substrate/runtime/observability/redaction.mjs.map +1 -0
  696. package/dist/substrate/runtime/observability/spans.d.mts +1 -0
  697. package/dist/substrate/runtime/observability/spans.mjs +87 -0
  698. package/dist/substrate/runtime/observability/spans.mjs.map +1 -0
  699. package/dist/substrate/runtime/observability/subprocess-capture.d.mts +2 -0
  700. package/dist/substrate/runtime/observability/subprocess-capture.mjs +82 -0
  701. package/dist/substrate/runtime/observability/subprocess-capture.mjs.map +1 -0
  702. package/dist/substrate/runtime/paths.d.mts +17 -0
  703. package/dist/substrate/runtime/paths.mjs +61 -0
  704. package/dist/substrate/runtime/paths.mjs.map +1 -0
  705. package/dist/substrate/runtime/port-broker/index.d.mts +1 -0
  706. package/dist/substrate/runtime/port-broker/service.d.mts +1 -0
  707. package/dist/substrate/runtime/port-broker/service.mjs +319 -0
  708. package/dist/substrate/runtime/port-broker/service.mjs.map +1 -0
  709. package/dist/substrate/runtime/post-acquire-tasks.d.mts +1 -0
  710. package/dist/substrate/runtime/post-acquire-tasks.mjs +34 -0
  711. package/dist/substrate/runtime/post-acquire-tasks.mjs.map +1 -0
  712. package/dist/substrate/runtime/probes.d.mts +51 -0
  713. package/dist/substrate/runtime/probes.mjs +84 -0
  714. package/dist/substrate/runtime/probes.mjs.map +1 -0
  715. package/dist/substrate/runtime/process-supervisor.d.mts +57 -0
  716. package/dist/substrate/runtime/process-supervisor.mjs +73 -0
  717. package/dist/substrate/runtime/process-supervisor.mjs.map +1 -0
  718. package/dist/substrate/runtime/projection/operational-endpoints.mjs +44 -0
  719. package/dist/substrate/runtime/projection/operational-endpoints.mjs.map +1 -0
  720. package/dist/substrate/runtime/projection/persisted.mjs +195 -0
  721. package/dist/substrate/runtime/projection/persisted.mjs.map +1 -0
  722. package/dist/substrate/runtime/projection/state-ref.mjs +48 -0
  723. package/dist/substrate/runtime/projection/state-ref.mjs.map +1 -0
  724. package/dist/substrate/runtime/projection/update.mjs +200 -0
  725. package/dist/substrate/runtime/projection/update.mjs.map +1 -0
  726. package/dist/substrate/runtime/retry-policy.d.mts +18 -0
  727. package/dist/substrate/runtime/retry-policy.mjs +16 -0
  728. package/dist/substrate/runtime/retry-policy.mjs.map +1 -0
  729. package/dist/substrate/runtime/run.mjs +86 -0
  730. package/dist/substrate/runtime/run.mjs.map +1 -0
  731. package/dist/substrate/runtime/runtime-decode.d.mts +32 -0
  732. package/dist/substrate/runtime/runtime-decode.mjs +53 -0
  733. package/dist/substrate/runtime/runtime-decode.mjs.map +1 -0
  734. package/dist/substrate/runtime/scoped-http-server.mjs +36 -0
  735. package/dist/substrate/runtime/scoped-http-server.mjs.map +1 -0
  736. package/dist/substrate/runtime/scoped-ref-map/service.mjs +83 -0
  737. package/dist/substrate/runtime/scoped-ref-map/service.mjs.map +1 -0
  738. package/dist/substrate/runtime/stage-and-swap/index.d.mts +1 -0
  739. package/dist/substrate/runtime/stage-and-swap/index.mjs +131 -0
  740. package/dist/substrate/runtime/stage-and-swap/index.mjs.map +1 -0
  741. package/dist/substrate/runtime/state-store/schema.mjs +36 -0
  742. package/dist/substrate/runtime/state-store/schema.mjs.map +1 -0
  743. package/dist/substrate/runtime/strategy-registry/chain-probe-for.d.mts +1 -0
  744. package/dist/substrate/runtime/strategy-registry/chain-probe-for.mjs +22 -0
  745. package/dist/substrate/runtime/strategy-registry/chain-probe-for.mjs.map +1 -0
  746. package/dist/substrate/runtime/strategy-registry/faucet-capability-for.d.mts +1 -0
  747. package/dist/substrate/runtime/strategy-registry/faucet-capability-for.mjs +30 -0
  748. package/dist/substrate/runtime/strategy-registry/faucet-capability-for.mjs.map +1 -0
  749. package/dist/substrate/runtime/strategy-registry/index.d.mts +1 -0
  750. package/dist/substrate/runtime/strategy-registry/service.d.mts +1 -0
  751. package/dist/substrate/runtime/strategy-registry/service.mjs +67 -0
  752. package/dist/substrate/runtime/strategy-registry/service.mjs.map +1 -0
  753. package/dist/substrate/runtime/sui-execute/index.d.mts +11 -0
  754. package/dist/substrate/runtime/sui-execute/index.mjs +144 -0
  755. package/dist/substrate/runtime/sui-execute/index.mjs.map +1 -0
  756. package/dist/substrate/runtime/sui-move-build/index.d.mts +1 -0
  757. package/dist/substrate/runtime/sui-move-build/index.mjs +283 -0
  758. package/dist/substrate/runtime/sui-move-build/index.mjs.map +1 -0
  759. package/dist/substrate/runtime/supervisor.d.mts +1 -0
  760. package/dist/substrate/runtime/supervisor.mjs +831 -0
  761. package/dist/substrate/runtime/supervisor.mjs.map +1 -0
  762. package/dist/surfaces/cli/command-tree.mjs +276 -0
  763. package/dist/surfaces/cli/command-tree.mjs.map +1 -0
  764. package/dist/surfaces/cli/commands/config.mjs +31 -0
  765. package/dist/surfaces/cli/commands/config.mjs.map +1 -0
  766. package/dist/surfaces/cli/commands/confirm-node.mjs +26 -0
  767. package/dist/surfaces/cli/commands/confirm-node.mjs.map +1 -0
  768. package/dist/surfaces/cli/commands/confirm.mjs +26 -0
  769. package/dist/surfaces/cli/commands/confirm.mjs.map +1 -0
  770. package/dist/surfaces/cli/commands/doctor-probes.mjs +452 -0
  771. package/dist/surfaces/cli/commands/doctor-probes.mjs.map +1 -0
  772. package/dist/surfaces/cli/commands/doctor.mjs +38 -0
  773. package/dist/surfaces/cli/commands/doctor.mjs.map +1 -0
  774. package/dist/surfaces/cli/commands/prune-picker.mjs +347 -0
  775. package/dist/surfaces/cli/commands/prune-picker.mjs.map +1 -0
  776. package/dist/surfaces/cli/commands/prune.mjs +178 -0
  777. package/dist/surfaces/cli/commands/prune.mjs.map +1 -0
  778. package/dist/surfaces/cli/commands/snapshot.mjs +141 -0
  779. package/dist/surfaces/cli/commands/snapshot.mjs.map +1 -0
  780. package/dist/surfaces/cli/commands/status.mjs +95 -0
  781. package/dist/surfaces/cli/commands/status.mjs.map +1 -0
  782. package/dist/surfaces/cli/commands/supervisor-presence.mjs +33 -0
  783. package/dist/surfaces/cli/commands/supervisor-presence.mjs.map +1 -0
  784. package/dist/surfaces/cli/commands/wipe.mjs +28 -0
  785. package/dist/surfaces/cli/commands/wipe.mjs.map +1 -0
  786. package/dist/surfaces/cli/envelope.mjs +43 -0
  787. package/dist/surfaces/cli/envelope.mjs.map +1 -0
  788. package/dist/surfaces/cli/errors.mjs +110 -0
  789. package/dist/surfaces/cli/errors.mjs.map +1 -0
  790. package/dist/surfaces/cli/flags.mjs +56 -0
  791. package/dist/surfaces/cli/flags.mjs.map +1 -0
  792. package/dist/surfaces/cli/index.mjs +418 -0
  793. package/dist/surfaces/cli/index.mjs.map +1 -0
  794. package/dist/surfaces/cli/output.mjs +115 -0
  795. package/dist/surfaces/cli/output.mjs.map +1 -0
  796. package/dist/surfaces/cli/sysexits.mjs +139 -0
  797. package/dist/surfaces/cli/sysexits.mjs.map +1 -0
  798. package/dist/surfaces/tui/app.mjs +104 -0
  799. package/dist/surfaces/tui/app.mjs.map +1 -0
  800. package/dist/surfaces/tui/dashboard.mjs +261 -0
  801. package/dist/surfaces/tui/dashboard.mjs.map +1 -0
  802. package/dist/surfaces/tui/display-derivation.mjs +395 -0
  803. package/dist/surfaces/tui/display-derivation.mjs.map +1 -0
  804. package/dist/surfaces/tui/errors.mjs +11 -0
  805. package/dist/surfaces/tui/errors.mjs.map +1 -0
  806. package/dist/surfaces/tui/event-log.mjs +155 -0
  807. package/dist/surfaces/tui/event-log.mjs.map +1 -0
  808. package/dist/surfaces/tui/heartbeat.mjs +33 -0
  809. package/dist/surfaces/tui/heartbeat.mjs.map +1 -0
  810. package/dist/surfaces/tui/index.mjs +50 -0
  811. package/dist/surfaces/tui/index.mjs.map +1 -0
  812. package/dist/surfaces/tui/input.mjs +104 -0
  813. package/dist/surfaces/tui/input.mjs.map +1 -0
  814. package/dist/surfaces/tui/mode-detect.mjs +32 -0
  815. package/dist/surfaces/tui/mode-detect.mjs.map +1 -0
  816. package/dist/surfaces/tui/mount-ink.mjs +31 -0
  817. package/dist/surfaces/tui/mount-ink.mjs.map +1 -0
  818. package/dist/surfaces/tui/plain-renderer.mjs +170 -0
  819. package/dist/surfaces/tui/plain-renderer.mjs.map +1 -0
  820. package/dist/surfaces/tui/resource-table.mjs +507 -0
  821. package/dist/surfaces/tui/resource-table.mjs.map +1 -0
  822. package/images/_shared/signal-forward.sh +77 -0
  823. package/images/postgres/Dockerfile +32 -0
  824. package/images/seal/Dockerfile +68 -0
  825. package/images/seal/entrypoint.sh +65 -0
  826. package/images/sui/Dockerfile +73 -0
  827. package/images/sui/entrypoint.sh +244 -0
  828. package/images/sui-fork/Dockerfile +53 -0
  829. package/images/sui-fork/entrypoint.sh +51 -0
  830. package/images/walrus/Dockerfile +122 -0
  831. package/images/walrus/deploy-walrus.sh +305 -0
  832. package/images/walrus/run-walrus.sh +53 -0
  833. package/package.json +94 -0
@@ -0,0 +1,122 @@
1
+ import { readFileSync } from "node:fs";
2
+ import { dirname, resolve } from "node:path";
3
+ //#region src/api/inference-network.ts
4
+ const DEFAULT_STACK_NAME = "main";
5
+ const usefulName = (value) => {
6
+ const trimmed = value?.trim();
7
+ if (trimmed === void 0 || trimmed.length === 0) return void 0;
8
+ const unscoped = trimmed.replace(/^@[^/]+\//, "").replace(/^[^a-zA-Z0-9]+/, "");
9
+ return unscoped.length > 0 ? unscoped : void 0;
10
+ };
11
+ const readPackageName = (dir) => {
12
+ try {
13
+ const pkg = JSON.parse(readFileSync(resolve(dir, "package.json"), "utf8"));
14
+ return typeof pkg.name === "string" ? usefulName(pkg.name) : void 0;
15
+ } catch {
16
+ return;
17
+ }
18
+ };
19
+ const inferPackageNameFromCwd = (cwd = process.cwd()) => {
20
+ let dir = resolve(cwd);
21
+ for (let i = 0; i < 32; i += 1) {
22
+ const name = readPackageName(dir);
23
+ if (name !== void 0) return name;
24
+ const parent = dirname(dir);
25
+ if (parent === dir) return void 0;
26
+ dir = parent;
27
+ }
28
+ };
29
+ const resolveStackName = (options = {}) => {
30
+ const explicit = usefulName(options.explicit);
31
+ if (explicit !== void 0) return explicit;
32
+ const fromEnv = usefulName((options.env ?? process.env).DEVSTACK_STACK);
33
+ if (fromEnv !== void 0) return fromEnv;
34
+ const fromPackage = inferPackageNameFromCwd(options.cwd);
35
+ if (fromPackage !== void 0) return fromPackage;
36
+ return options.defaultName ?? "main";
37
+ };
38
+ const resolveAppName = (options = {}) => {
39
+ const explicit = usefulName(options.explicit);
40
+ if (explicit !== void 0) return explicit;
41
+ const fromEnv = usefulName((options.env ?? process.env).DEVSTACK_APP);
42
+ if (fromEnv !== void 0) return fromEnv;
43
+ const fromPackage = inferPackageNameFromCwd(options.cwd);
44
+ if (fromPackage !== void 0) return fromPackage;
45
+ return options.defaultName ?? "devstack";
46
+ };
47
+ const ACTIVE_DEVSTACK_NETWORK_NAMES = [
48
+ "localnet",
49
+ "testnet",
50
+ "mainnet",
51
+ "devnet"
52
+ ];
53
+ const FORK_DEVSTACK_NETWORK_NAMES = [
54
+ "testnet-fork",
55
+ "mainnet-fork",
56
+ "devnet-fork"
57
+ ];
58
+ const DEVSTACK_NETWORK_NAMES = [...ACTIVE_DEVSTACK_NETWORK_NAMES, ...FORK_DEVSTACK_NETWORK_NAMES];
59
+ const NETWORK_ALIASES = {
60
+ local: "localnet",
61
+ localnet: "localnet",
62
+ "sui:local": "localnet",
63
+ "sui:localnet": "localnet",
64
+ testnet: "testnet",
65
+ "sui:testnet": "testnet",
66
+ mainnet: "mainnet",
67
+ "sui:mainnet": "mainnet",
68
+ devnet: "devnet",
69
+ "sui:devnet": "devnet",
70
+ "testnet-fork": "testnet-fork",
71
+ "sui:testnet-fork": "testnet-fork",
72
+ "mainnet-fork": "mainnet-fork",
73
+ "sui:mainnet-fork": "mainnet-fork",
74
+ "devnet-fork": "devnet-fork",
75
+ "sui:devnet-fork": "devnet-fork"
76
+ };
77
+ var DevstackNetworkParseError = class extends Error {
78
+ _tag = "DevstackNetworkParseError";
79
+ value;
80
+ source;
81
+ supported;
82
+ constructor(args) {
83
+ super(`${args.source} must be one of: ${DEVSTACK_NETWORK_NAMES.join(", ")} (got ${JSON.stringify(args.value)})`);
84
+ this.name = "DevstackNetworkParseError";
85
+ this.value = args.value;
86
+ this.source = args.source;
87
+ this.supported = DEVSTACK_NETWORK_NAMES;
88
+ }
89
+ };
90
+ const parseDevstackNetwork = (value, source = "DEVSTACK_NETWORK") => {
91
+ const raw = value?.trim();
92
+ const name = raw === void 0 || raw.length === 0 ? "localnet" : NETWORK_ALIASES[raw];
93
+ if (name === void 0) throw new DevstackNetworkParseError({
94
+ value: raw ?? "",
95
+ source
96
+ });
97
+ switch (name) {
98
+ case "localnet": return {
99
+ mode: "local",
100
+ name
101
+ };
102
+ case "testnet":
103
+ case "mainnet":
104
+ case "devnet": return {
105
+ mode: "live",
106
+ name,
107
+ network: name
108
+ };
109
+ case "testnet-fork":
110
+ case "mainnet-fork":
111
+ case "devnet-fork": return {
112
+ mode: "fork",
113
+ name,
114
+ upstream: name.replace(/-fork$/, "")
115
+ };
116
+ }
117
+ };
118
+ const parseDevstackNetworkName = (value, source = "DEVSTACK_NETWORK") => parseDevstackNetwork(value, source).name;
119
+ //#endregion
120
+ export { DEFAULT_STACK_NAME, parseDevstackNetworkName, resolveAppName, resolveStackName };
121
+
122
+ //# sourceMappingURL=inference-network.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inference-network.mjs","names":[],"sources":["../../src/api/inference-network.ts"],"sourcesContent":["import { readFileSync } from 'node:fs';\nimport { dirname, resolve } from 'node:path';\n\nexport const DEFAULT_STACK_NAME = 'main';\n\nexport interface StackNameResolutionOptions {\n\treadonly explicit?: string;\n\treadonly env?: Readonly<Record<string, string | undefined>>;\n\treadonly cwd?: string;\n\treadonly defaultName?: string;\n}\n\nexport interface AppNameResolutionOptions {\n\treadonly explicit?: string;\n\treadonly env?: Readonly<Record<string, string | undefined>>;\n\treadonly cwd?: string;\n\treadonly defaultName?: string;\n}\n\nconst usefulName = (value: string | undefined): string | undefined => {\n\tconst trimmed = value?.trim();\n\tif (trimmed === undefined || trimmed.length === 0) return undefined;\n\tconst unscoped = trimmed.replace(/^@[^/]+\\//, '').replace(/^[^a-zA-Z0-9]+/, '');\n\treturn unscoped.length > 0 ? unscoped : undefined;\n};\n\nexport const readPackageName = (dir: string): string | undefined => {\n\ttry {\n\t\tconst pkg = JSON.parse(readFileSync(resolve(dir, 'package.json'), 'utf8')) as {\n\t\t\treadonly name?: string;\n\t\t};\n\t\treturn typeof pkg.name === 'string' ? usefulName(pkg.name) : undefined;\n\t} catch {\n\t\treturn undefined;\n\t}\n};\n\nexport const inferPackageNameFromCwd = (cwd: string = process.cwd()): string | undefined => {\n\tlet dir = resolve(cwd);\n\tfor (let i = 0; i < 32; i += 1) {\n\t\tconst name = readPackageName(dir);\n\t\tif (name !== undefined) return name;\n\t\tconst parent = dirname(dir);\n\t\tif (parent === dir) return undefined;\n\t\tdir = parent;\n\t}\n\treturn undefined;\n};\n\nexport const resolveStackName = (options: StackNameResolutionOptions = {}): string => {\n\tconst explicit = usefulName(options.explicit);\n\tif (explicit !== undefined) return explicit;\n\tconst env = options.env ?? process.env;\n\tconst fromEnv = usefulName(env.DEVSTACK_STACK);\n\tif (fromEnv !== undefined) return fromEnv;\n\tconst fromPackage = inferPackageNameFromCwd(options.cwd);\n\tif (fromPackage !== undefined) return fromPackage;\n\treturn options.defaultName ?? DEFAULT_STACK_NAME;\n};\n\nexport const resolveAppName = (options: AppNameResolutionOptions = {}): string => {\n\tconst explicit = usefulName(options.explicit);\n\tif (explicit !== undefined) return explicit;\n\tconst env = options.env ?? process.env;\n\tconst fromEnv = usefulName(env.DEVSTACK_APP);\n\tif (fromEnv !== undefined) return fromEnv;\n\tconst fromPackage = inferPackageNameFromCwd(options.cwd);\n\tif (fromPackage !== undefined) return fromPackage;\n\treturn options.defaultName ?? 'devstack';\n};\n\nexport const ACTIVE_DEVSTACK_NETWORK_NAMES = ['localnet', 'testnet', 'mainnet', 'devnet'] as const;\n\nexport const FORK_DEVSTACK_NETWORK_NAMES = ['testnet-fork', 'mainnet-fork', 'devnet-fork'] as const;\n\nexport const DEVSTACK_NETWORK_NAMES = [\n\t...ACTIVE_DEVSTACK_NETWORK_NAMES,\n\t...FORK_DEVSTACK_NETWORK_NAMES,\n] as const;\n\nexport type ActiveDevstackNetworkName = (typeof ACTIVE_DEVSTACK_NETWORK_NAMES)[number];\nexport type ForkDevstackNetworkName = (typeof FORK_DEVSTACK_NETWORK_NAMES)[number];\nexport type DevstackNetworkName = (typeof DEVSTACK_NETWORK_NAMES)[number];\nexport type LiveDevstackNetworkName = 'testnet' | 'mainnet' | 'devnet';\n\nexport type ParsedDevstackNetwork =\n\t| {\n\t\t\treadonly mode: 'local';\n\t\t\treadonly name: 'localnet';\n\t }\n\t| {\n\t\t\treadonly mode: 'live';\n\t\t\treadonly name: LiveDevstackNetworkName;\n\t\t\treadonly network: LiveDevstackNetworkName;\n\t }\n\t| {\n\t\t\treadonly mode: 'fork';\n\t\t\treadonly name: ForkDevstackNetworkName;\n\t\t\treadonly upstream: LiveDevstackNetworkName;\n\t };\n\nconst NETWORK_ALIASES: Readonly<Record<string, DevstackNetworkName>> = {\n\tlocal: 'localnet',\n\tlocalnet: 'localnet',\n\t'sui:local': 'localnet',\n\t'sui:localnet': 'localnet',\n\ttestnet: 'testnet',\n\t'sui:testnet': 'testnet',\n\tmainnet: 'mainnet',\n\t'sui:mainnet': 'mainnet',\n\tdevnet: 'devnet',\n\t'sui:devnet': 'devnet',\n\t'testnet-fork': 'testnet-fork',\n\t'sui:testnet-fork': 'testnet-fork',\n\t'mainnet-fork': 'mainnet-fork',\n\t'sui:mainnet-fork': 'mainnet-fork',\n\t'devnet-fork': 'devnet-fork',\n\t'sui:devnet-fork': 'devnet-fork',\n};\n\nexport class DevstackNetworkParseError extends Error {\n\treadonly _tag = 'DevstackNetworkParseError';\n\treadonly value: string;\n\treadonly source: string;\n\treadonly supported: ReadonlyArray<DevstackNetworkName>;\n\n\tconstructor(args: { readonly value: string; readonly source: string }) {\n\t\tsuper(\n\t\t\t`${args.source} must be one of: ${DEVSTACK_NETWORK_NAMES.join(', ')} (got ${JSON.stringify(args.value)})`,\n\t\t);\n\t\tthis.name = 'DevstackNetworkParseError';\n\t\tthis.value = args.value;\n\t\tthis.source = args.source;\n\t\tthis.supported = DEVSTACK_NETWORK_NAMES;\n\t}\n}\n\nexport const parseDevstackNetwork = (\n\tvalue: string | undefined,\n\tsource = 'DEVSTACK_NETWORK',\n): ParsedDevstackNetwork => {\n\tconst raw = value?.trim();\n\tconst name = raw === undefined || raw.length === 0 ? 'localnet' : NETWORK_ALIASES[raw];\n\tif (name === undefined) {\n\t\tthrow new DevstackNetworkParseError({ value: raw ?? '', source });\n\t}\n\tswitch (name) {\n\t\tcase 'localnet':\n\t\t\treturn { mode: 'local', name };\n\t\tcase 'testnet':\n\t\tcase 'mainnet':\n\t\tcase 'devnet':\n\t\t\treturn { mode: 'live', name, network: name };\n\t\tcase 'testnet-fork':\n\t\tcase 'mainnet-fork':\n\t\tcase 'devnet-fork':\n\t\t\treturn {\n\t\t\t\tmode: 'fork',\n\t\t\t\tname,\n\t\t\t\tupstream: name.replace(/-fork$/, '') as LiveDevstackNetworkName,\n\t\t\t};\n\t}\n};\n\nexport const parseDevstackNetworkName = (\n\tvalue: string | undefined,\n\tsource = 'DEVSTACK_NETWORK',\n): DevstackNetworkName => parseDevstackNetwork(value, source).name;\n"],"mappings":"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"}
@@ -0,0 +1,26 @@
1
+ import { NetworkConfig, NetworkMode } from "../substrate/network.mjs";
2
+
3
+ //#region src/api/mode-narrowed-factory.d.ts
4
+ /** A factories record keyed by network mode. Each branch is an
5
+ * arbitrary record of factory functions. */
6
+ type FactoriesByMode<F extends Partial<Record<NetworkMode, unknown>>> = F;
7
+ /** Project the factories record to the branch that matches a network's
8
+ * mode. Branches that aren't present collapse to `never`, which makes
9
+ * the property access fail at compile time. */
10
+ type FactoriesFor<F extends Partial<Record<NetworkMode, unknown>>, Mode extends NetworkMode> = Mode extends keyof F ? F[Mode] : never;
11
+ /**
12
+ * Plugin-author entry point. Pass a per-mode factories record; receive
13
+ * a callable namespace. The returned value type is
14
+ * narrowed to the matching mode branch — illegal-mode property access
15
+ * is a compile error.
16
+ *
17
+ * Two casts here are the boundary between runtime breadth and type-level
18
+ * narrowness (type-prototype results §"Where I had to use any/casts"):
19
+ * - The runtime returns the full factories record.
20
+ * - The type system projects it down to the matching branch.
21
+ */
22
+ type ModeNamespace<F extends Partial<Record<NetworkMode, unknown>>> = <N extends NetworkConfig>(network: N) => FactoriesFor<F, N['mode']>;
23
+ declare function defineModeNamespace<F extends Partial<Record<NetworkMode, unknown>>>(factoriesPerMode: F): ModeNamespace<F>;
24
+ //#endregion
25
+ export { FactoriesByMode, FactoriesFor, ModeNamespace, defineModeNamespace };
26
+ //# sourceMappingURL=mode-narrowed-factory.d.mts.map
@@ -0,0 +1,8 @@
1
+ //#region src/api/mode-narrowed-factory.ts
2
+ function defineModeNamespace(factoriesPerMode) {
3
+ return ((network) => factoriesPerMode[network.mode]);
4
+ }
5
+ //#endregion
6
+ export { defineModeNamespace };
7
+
8
+ //# sourceMappingURL=mode-narrowed-factory.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mode-narrowed-factory.mjs","names":[],"sources":["../../src/api/mode-narrowed-factory.ts"],"sourcesContent":["// Mode-narrowed factory helper.\n//\n// Architecture Tension 11 + type-prototype finding #4: a plugin's\n// factories are exposed as an object indexed by `NetworkMode`. When a\n// stack passes a typed-narrow network through `defineDevstackWith`, the\n// callback receives a namespace whose accessible properties are exactly\n// those present in the network's mode branch. Asking for the wrong\n// branch is a compile error at the call site.\n//\n// Two surfaces:\n//\n// - `defineModeNamespace({ local, live, fork })` — plugin authors\n// declare their per-mode factories once; the helper hands back a\n// callable namespace that does the narrowing.\n\nimport type { NetworkConfig, NetworkMode } from '../substrate/network.ts';\n\n/** A factories record keyed by network mode. Each branch is an\n * arbitrary record of factory functions. */\nexport type FactoriesByMode<F extends Partial<Record<NetworkMode, unknown>>> = F;\n\n/** Project the factories record to the branch that matches a network's\n * mode. Branches that aren't present collapse to `never`, which makes\n * the property access fail at compile time. */\nexport type FactoriesFor<\n\tF extends Partial<Record<NetworkMode, unknown>>,\n\tMode extends NetworkMode,\n> = Mode extends keyof F ? F[Mode] : never;\n\n/**\n * Plugin-author entry point. Pass a per-mode factories record; receive\n * a callable namespace. The returned value type is\n * narrowed to the matching mode branch — illegal-mode property access\n * is a compile error.\n *\n * Two casts here are the boundary between runtime breadth and type-level\n * narrowness (type-prototype results §\"Where I had to use any/casts\"):\n * - The runtime returns the full factories record.\n * - The type system projects it down to the matching branch.\n */\nexport type ModeNamespace<F extends Partial<Record<NetworkMode, unknown>>> = <\n\tN extends NetworkConfig,\n>(\n\tnetwork: N,\n) => FactoriesFor<F, N['mode']>;\n\nexport function defineModeNamespace<F extends Partial<Record<NetworkMode, unknown>>>(\n\tfactoriesPerMode: F,\n): ModeNamespace<F> {\n\treturn (<N extends NetworkConfig>(network: N) =>\n\t\tfactoriesPerMode[network.mode as keyof F] as FactoriesFor<F, N['mode']>) as ModeNamespace<F>;\n}\n"],"mappings":";AA8CA,SAAgB,oBACf,kBACmB;AACnB,UAAkC,YACjC,iBAAiB,QAAQ"}
@@ -0,0 +1,10 @@
1
+ //#region src/api/plugin-errors.ts
2
+ const pluginErrorContributions = (errorTags, formatter) => [{
3
+ _tag: "PluginErrorContribution",
4
+ errorTags,
5
+ ...formatter === void 0 ? {} : { formatter }
6
+ }];
7
+ //#endregion
8
+ export { pluginErrorContributions };
9
+
10
+ //# sourceMappingURL=plugin-errors.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-errors.mjs","names":[],"sources":["../../src/api/plugin-errors.ts"],"sourcesContent":["import type { PluginErrorContribution } from '../substrate/plugin.ts';\n\nexport const pluginErrorContributions = <Tags extends ReadonlyArray<string>>(\n\terrorTags: Tags,\n\tformatter?: PluginErrorContribution['formatter'],\n): readonly [PluginErrorContribution] => [\n\t{\n\t\t_tag: 'PluginErrorContribution',\n\t\terrorTags,\n\t\t...(formatter === undefined ? {} : { formatter }),\n\t},\n];\n"],"mappings":";AAEA,MAAa,4BACZ,WACA,cACwC,CACxC;CACC,MAAM;CACN;CACA,GAAI,cAAc,KAAA,IAAY,EAAE,GAAG,EAAE,WAAW;CAChD,CACD"}
@@ -0,0 +1,82 @@
1
+ import { SubscribableState } from "../substrate/projection.mjs";
2
+ import { EngineEvent } from "../substrate/events.mjs";
3
+ import { AnyPlugin } from "../substrate/plugin.mjs";
4
+ import { Stack } from "./define-devstack.mjs";
5
+ import { ProductionCodegenOptions } from "../orchestrators/runtime-composition.mjs";
6
+ import { Cause, Effect, Layer, Stream, SubscriptionRef } from "effect";
7
+
8
+ //#region src/api/run-stack.d.ts
9
+ /** Identity overrides for `runStack`. App and stack fall back through
10
+ * shared package metadata inference after their env overrides. */
11
+ interface RunStackIdentityOptions {
12
+ readonly app?: string;
13
+ readonly stack?: string;
14
+ readonly network?: string;
15
+ }
16
+ interface RunStackOptions {
17
+ /** Identity overrides — falls back to env + library defaults. */
18
+ readonly identity?: RunStackIdentityOptions;
19
+ /** User application root. Codegen defaults to `<appRoot>/src/generated`.
20
+ * Defaults to `process.cwd()`. */
21
+ readonly appRoot?: string;
22
+ /** Codegen output overrides for embedded tests or custom app layout. */
23
+ readonly codegen?: Omit<ProductionCodegenOptions, 'appRoot'>;
24
+ /** Filesystem root under which the substrate stores per-stack
25
+ * artifacts (cache, snapshots, manifest, projection, etc.).
26
+ * Defaults to `$DEVSTACK_STATE_DIR` then `<cwd>/.devstack`. */
27
+ readonly runtimeRoot?: string;
28
+ /** Extra Layer composition. Reserved for plugin-author overlays
29
+ * (e.g. custom `CapabilitySinks`, Logger) per ARCHITECTURE.md
30
+ * § Plugin-author extension via Layer composition. */
31
+ readonly layers?: Layer.Layer<never>;
32
+ }
33
+ /** Boot error surfaced by `RunHandle.start`. Wraps the supervisor's
34
+ * startup failure tree for cascade-formatter rendering. */
35
+ interface BootError {
36
+ readonly _tag: 'BootError';
37
+ readonly cause: Cause.Cause<unknown>;
38
+ }
39
+ /** Programmatic handle. Symmetric with the attached CLI surface:
40
+ * `events`, `state`, and `awaitShutdown` are the same primitives the
41
+ * TUI consumes in-process. */
42
+ interface RunHandle {
43
+ /** Boot the supervisor and resolve when every plugin reaches
44
+ * `ready`. Fails with `BootError` if any plugin's acquire path
45
+ * fails. */
46
+ readonly start: Effect.Effect<void, BootError, never>;
47
+ /** Trigger graceful shutdown: enqueues `shutdown.requested` onto
48
+ * the supervisor's command channel, then awaits the fiber. */
49
+ readonly stop: Effect.Effect<void, never, never>;
50
+ /** Resolve when the supervisor fiber exits. Always succeeds — any
51
+ * errors surface via `start`. */
52
+ readonly awaitShutdown: Effect.Effect<void, never, never>;
53
+ /** Tail of typed engine events from the supervisor's hub. The
54
+ * upstream is a `Queue.Dequeue`; consume via `Stream.run...`. */
55
+ readonly events: Stream.Stream<EngineEvent, never, never>;
56
+ /** The supervisor's live projection. Renderers + tests read this
57
+ * directly; changes flow through `SubscriptionRef.changes`. */
58
+ readonly state: SubscriptionRef.SubscriptionRef<SubscribableState>;
59
+ }
60
+ /**
61
+ * Boot a `Stack` for programmatic embedding. Returns a `RunHandle`
62
+ * synchronously; the supervisor fiber is forked on `start`.
63
+ *
64
+ * Lifecycle:
65
+ *
66
+ * 1. `runStack(stack, opts)` — synchronous; no fiber forked yet.
67
+ * 2. `await Effect.runPromise(handle.start)` — forks the supervisor,
68
+ * blocks until every plugin reaches `ready` (or fails with
69
+ * `BootError`).
70
+ * 3. Use `handle.events` / `handle.state` to observe.
71
+ * 4. `await Effect.runPromise(handle.stop)` — graceful shutdown.
72
+ * 5. `handle.awaitShutdown` resolves once finalizers complete.
73
+ *
74
+ * Internal architecture: the handle stores a `Deferred` for boot
75
+ * completion. The supervised body forks a watcher fiber over the
76
+ * registry's `awaitReady` per node; once every node is `ready` (or one
77
+ * fails) the deferred completes. `start` awaits it.
78
+ */
79
+ declare const runStack: (stack: Stack<ReadonlyArray<AnyPlugin>>, opts?: RunStackOptions) => RunHandle;
80
+ //#endregion
81
+ export { BootError, RunHandle, RunStackIdentityOptions, RunStackOptions, runStack };
82
+ //# sourceMappingURL=run-stack.d.mts.map
@@ -0,0 +1,127 @@
1
+ import { appName, chainId, stackName } from "../substrate/brand.mjs";
2
+ import { readStackEngine } from "./define-devstack.mjs";
3
+ import { makeProjectionRef } from "../substrate/runtime/projection/state-ref.mjs";
4
+ import { buildSubstrateLayers, superviseStackEffect } from "../substrate/runtime/run.mjs";
5
+ import { buildProductionOrchestratorSinks, buildProductionPostAcquireHook, layerProductionOrchestrators } from "../orchestrators/runtime-composition.mjs";
6
+ import { extendBuiltInPluginContext, layerBuiltInPluginRuntime } from "../runtime/built-in-plugin-layers.mjs";
7
+ import { resolveAppName, resolveStackName } from "./inference-network.mjs";
8
+ import { Deferred, Effect, Exit, Fiber, Layer, Logger, Queue, Stream } from "effect";
9
+ //#region src/api/run-stack.ts
10
+ const resolveIdentity = (stack, opts, cwd) => {
11
+ const app = resolveAppName({
12
+ explicit: opts?.app,
13
+ cwd
14
+ });
15
+ const stackNameStr = resolveStackName({
16
+ explicit: opts?.stack ?? stack.options.stackName,
17
+ cwd
18
+ });
19
+ const network = opts?.network ?? process.env.DEVSTACK_NETWORK ?? "sui:local";
20
+ return {
21
+ app: appName(app),
22
+ stack: stackName(stackNameStr),
23
+ chain: chainId(network)
24
+ };
25
+ };
26
+ const resolveRuntimeRoot = (override) => {
27
+ if (override !== void 0) return override;
28
+ const envRoot = process.env.DEVSTACK_STATE_DIR;
29
+ if (envRoot !== void 0 && envRoot.length > 0) return envRoot;
30
+ return `${process.cwd()}/.devstack`;
31
+ };
32
+ const toBootError = (cause) => ({
33
+ _tag: "BootError",
34
+ cause
35
+ });
36
+ /**
37
+ * Boot a `Stack` for programmatic embedding. Returns a `RunHandle`
38
+ * synchronously; the supervisor fiber is forked on `start`.
39
+ *
40
+ * Lifecycle:
41
+ *
42
+ * 1. `runStack(stack, opts)` — synchronous; no fiber forked yet.
43
+ * 2. `await Effect.runPromise(handle.start)` — forks the supervisor,
44
+ * blocks until every plugin reaches `ready` (or fails with
45
+ * `BootError`).
46
+ * 3. Use `handle.events` / `handle.state` to observe.
47
+ * 4. `await Effect.runPromise(handle.stop)` — graceful shutdown.
48
+ * 5. `handle.awaitShutdown` resolves once finalizers complete.
49
+ *
50
+ * Internal architecture: the handle stores a `Deferred` for boot
51
+ * completion. The supervised body forks a watcher fiber over the
52
+ * registry's `awaitReady` per node; once every node is `ready` (or one
53
+ * fails) the deferred completes. `start` awaits it.
54
+ */
55
+ const runStack = (stack, opts = {}) => {
56
+ const engineStack = readStackEngine(stack);
57
+ const runtimeRoot = resolveRuntimeRoot(opts.runtimeRoot);
58
+ const appRoot = opts.appRoot ?? process.cwd();
59
+ const identity = resolveIdentity(stack, opts.identity, appRoot);
60
+ const codegen = opts.codegen ?? engineStack.options.codegen;
61
+ const supervisedStack = {
62
+ _tag: "Stack",
63
+ members: engineStack.members,
64
+ options: engineStack.options
65
+ };
66
+ const state = Effect.runSync(makeProjectionRef());
67
+ const bootDeferred = Effect.runSync(Deferred.make());
68
+ const stopRequested = Effect.runSync(Deferred.make());
69
+ const eventQueueRef = Effect.runSync(Deferred.make());
70
+ const fiberRef = Effect.runSync(Deferred.make());
71
+ const substrate = layerProductionOrchestrators({ codegen: {
72
+ appRoot,
73
+ outputDir: codegen?.outputDir,
74
+ stackSubdir: codegen?.stackSubdir ?? null
75
+ } }).pipe(Layer.provideMerge(buildSubstrateLayers(identity, runtimeRoot)));
76
+ const supervised = Effect.gen(function* () {
77
+ const orchestratorSinks = yield* buildProductionOrchestratorSinks();
78
+ yield* superviseStackEffect(supervisedStack, identity, state, {
79
+ orchestratorSinks,
80
+ postAcquireHook: yield* buildProductionPostAcquireHook({ extras: stack.options.extras }),
81
+ extendContext: extendBuiltInPluginContext,
82
+ withinScope: (handle) => Effect.gen(function* () {
83
+ yield* Deferred.succeed(eventQueueRef, handle.events);
84
+ yield* Effect.forkScoped(Effect.gen(function* () {
85
+ const firstFailure = (yield* Effect.forEach(handle.graph.nodes, ([key]) => handle.registry.awaitReady(key).pipe(Effect.exit), { concurrency: "unbounded" })).find(Exit.isFailure);
86
+ if (firstFailure === void 0) yield* Deferred.succeed(bootDeferred, void 0);
87
+ else yield* Deferred.fail(bootDeferred, toBootError(firstFailure.cause));
88
+ }));
89
+ yield* Effect.forkScoped(Effect.gen(function* () {
90
+ yield* Deferred.await(stopRequested);
91
+ yield* Queue.offer(handle.commands, { tag: "shutdown.requested" });
92
+ }));
93
+ })
94
+ }).pipe(Effect.provide(layerBuiltInPluginRuntime(orchestratorSinks)));
95
+ });
96
+ const loggerLayer = Logger.layer([]);
97
+ const supervisedProgram = (opts.layers === void 0 ? supervised.pipe(Effect.provide(substrate), Effect.provide(loggerLayer)) : supervised.pipe(Effect.provide(substrate), Effect.provide(loggerLayer), Effect.provide(opts.layers))).pipe(Effect.catchCause((cause) => Deferred.fail(bootDeferred, toBootError(cause)).pipe(Effect.asVoid, Effect.catch(() => Effect.void))));
98
+ return {
99
+ start: Effect.gen(function* () {
100
+ if (!(yield* Deferred.isDone(fiberRef))) {
101
+ const fiber = yield* Effect.forkDetach(supervisedProgram);
102
+ yield* Deferred.succeed(fiberRef, fiber);
103
+ }
104
+ yield* Deferred.await(bootDeferred);
105
+ }),
106
+ stop: Effect.gen(function* () {
107
+ yield* Deferred.succeed(stopRequested, void 0).pipe(Effect.catch(() => Effect.void));
108
+ if (!(yield* Deferred.isDone(fiberRef))) return;
109
+ const fiber = yield* Deferred.await(fiberRef);
110
+ yield* Fiber.await(fiber);
111
+ }),
112
+ awaitShutdown: Effect.gen(function* () {
113
+ if (!(yield* Deferred.isDone(fiberRef))) return;
114
+ const fiber = yield* Deferred.await(fiberRef);
115
+ yield* Fiber.await(fiber);
116
+ }),
117
+ events: Stream.unwrap(Effect.gen(function* () {
118
+ const queue = yield* Deferred.await(eventQueueRef);
119
+ return Stream.fromQueue(queue);
120
+ })),
121
+ state
122
+ };
123
+ };
124
+ //#endregion
125
+ export { runStack };
126
+
127
+ //# sourceMappingURL=run-stack.mjs.map
@@ -0,0 +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// Cutover blocker #3 (api-surface-design.md § Stack handle, parity-\n// matrix.md \"Programmatic embedding\"): `defineDevstack(...)` returns a\n// static `Stack<Members>` manifest with no runnable surface. Library\n// consumers (vitest setup, custom hosts, Effect-native apps, embedded\n// fixtures) had to re-implement `cli/main.ts:runUpLive`'s substrate\n// Layer composition. `runStack` is the single seam — it consumes the\n// shared `substrate/runtime/run.ts` helper the CLI also consumes.\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\tDeferred,\n\tEffect,\n\tExit,\n\tFiber,\n\tLayer,\n\tLogger,\n\tQueue,\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 { makeProjectionRef } from '../substrate/runtime/projection/index.ts';\nimport { buildSubstrateLayers, superviseStackEffect } from '../substrate/runtime/run.ts';\nimport {\n\tbuildProductionOrchestratorSinks,\n\tbuildProductionPostAcquireHook,\n\tlayerProductionOrchestrators,\n\ttype ProductionCodegenOptions,\n} from '../orchestrators/runtime-composition.ts';\nimport {\n\textendBuiltInPluginContext,\n\tlayerBuiltInPluginRuntime,\n} from '../runtime/built-in-plugin-layers.ts';\nimport { readStackEngine, type Stack } from './define-devstack.ts';\nimport type { AnyPlugin } from '../substrate/plugin.ts';\nimport { resolveAppName, resolveStackName } 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 * Defaults to `$DEVSTACK_STATE_DIR` then `<cwd>/.devstack`. */\n\treadonly runtimeRoot?: string;\n\t/** Extra Layer composition. Reserved for plugin-author overlays\n\t * (e.g. custom `CapabilitySinks`, Logger) per ARCHITECTURE.md\n\t * § Plugin-author extension via Layer composition. */\n\treadonly layers?: Layer.Layer<never>;\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. Always succeeds — any\n\t * errors surface via `start`. */\n\treadonly awaitShutdown: Effect.Effect<void, never, 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\tconst network = opts?.network ?? process.env.DEVSTACK_NETWORK ?? 'sui:local';\n\treturn {\n\t\tapp: appName(app),\n\t\tstack: stackName(stackNameStr),\n\t\tchain: chainId(network),\n\t};\n};\n\nconst resolveRuntimeRoot = (override: string | undefined): string => {\n\tif (override !== undefined) return override;\n\tconst envRoot = process.env.DEVSTACK_STATE_DIR;\n\tif (envRoot !== undefined && envRoot.length > 0) return envRoot;\n\treturn `${process.cwd()}/.devstack`;\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 = resolveRuntimeRoot(opts.runtimeRoot);\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// `SubscriptionRef.make` and `Deferred.make` are both sync-effects\n\t// (no side-effects, no async); `Effect.runSync` is safe here.\n\tconst state = Effect.runSync(makeProjectionRef());\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\n\tconst substrate = layerProductionOrchestrators({\n\t\tcodegen: {\n\t\t\tappRoot,\n\t\t\toutputDir: codegen?.outputDir,\n\t\t\tstackSubdir: codegen?.stackSubdir ?? null,\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: extendBuiltInPluginContext,\n\t\t\twithinScope: (handle) =>\n\t\t\t\tEffect.gen(function* () {\n\t\t\t\t\tyield* Deferred.succeed(eventQueueRef, handle.events);\n\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\n\t\t\t\t\t// Bridge `stop` requests onto the supervisor's command\n\t\t\t\t\t// channel. The supervisor's command loop treats\n\t\t\t\t\t// `shutdown.requested` as the graceful-shutdown signal.\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}).pipe(Effect.provide(layerBuiltInPluginRuntime(orchestratorSinks)));\n\t});\n\n\tconst loggerLayer = Logger.layer([]);\n\tconst layered =\n\t\topts.layers === undefined\n\t\t\t? supervised.pipe(Effect.provide(substrate), Effect.provide(loggerLayer))\n\t\t\t: supervised.pipe(\n\t\t\t\t\tEffect.provide(substrate),\n\t\t\t\t\tEffect.provide(loggerLayer),\n\t\t\t\t\tEffect.provide(opts.layers),\n\t\t\t\t);\n\n\t// Convert any uncaught cause into a boot failure if the deferred\n\t// hasn't completed. The cause is preserved via the fiber's exit for\n\t// `awaitShutdown` consumers that need to inspect it.\n\tconst supervisedProgram: Effect.Effect<void, never, never> = layered.pipe(\n\t\tEffect.catchCause((cause) =>\n\t\t\tDeferred.fail(bootDeferred, toBootError(cause)).pipe(\n\t\t\t\tEffect.asVoid,\n\t\t\t\tEffect.catch(() => Effect.void),\n\t\t\t),\n\t\t),\n\t);\n\n\tconst start: Effect.Effect<void, BootError, never> = Effect.gen(function* () {\n\t\tconst alreadyStarted = yield* Deferred.isDone(fiberRef);\n\t\tif (!alreadyStarted) {\n\t\t\t// `forkDetach` (v4 spelling of v3's `forkDaemon`) decouples the\n\t\t\t// supervisor fiber from the `start` fiber's scope. `forkChild`\n\t\t\t// would tie the supervisor to whatever fiber runs `start`, and\n\t\t\t// once `start` resolves (after `bootDeferred` succeeds) the\n\t\t\t// runtime would interrupt the supervisor — transitioning every\n\t\t\t// plugin `ready → stopping → stopped` before the caller can\n\t\t\t// read post-ready state or call `handle.stop`. The handle's\n\t\t\t// explicit `stop` + `awaitShutdown` paths are the only\n\t\t\t// shutdown signals; the captured `Fiber` reference is how the\n\t\t\t// daemon stays releasable.\n\t\t\tconst fiber = yield* Effect.forkDetach(supervisedProgram);\n\t\t\tyield* Deferred.succeed(fiberRef, fiber);\n\t\t}\n\t\tyield* Deferred.await(bootDeferred);\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, never, 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});\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":"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"}
@@ -0,0 +1,92 @@
1
+ import { ResolveStackContextOptions } from "./stack-context.mjs";
2
+
3
+ //#region src/build-integrations/playwright/config.d.ts
4
+ type PlaywrightReporterShape = [string] | [string, Record<string, unknown>];
5
+ /** Base subset of `PlaywrightTestConfig` this surface produces. The
6
+ * full type lives in `@playwright/test`; we keep this structural so
7
+ * the helpers compile without the peer. */
8
+ interface PlaywrightBaseConfigShape {
9
+ readonly testDir: string;
10
+ readonly fullyParallel: boolean;
11
+ readonly forbidOnly: boolean;
12
+ readonly retries: number;
13
+ readonly workers: number;
14
+ readonly reporter: PlaywrightReporterShape[] | string;
15
+ readonly globalSetup?: string;
16
+ readonly globalTeardown?: string;
17
+ }
18
+ type PlaywrightUseConfigShape = {
19
+ readonly baseURL: string;
20
+ readonly trace: 'on-first-retry' | 'off' | 'retain-on-failure';
21
+ readonly screenshot: 'only-on-failure' | 'off' | 'on';
22
+ } & Record<string, unknown>;
23
+ interface PlaywrightProjectShape {
24
+ name: string;
25
+ use: Record<string, unknown>;
26
+ }
27
+ interface PlaywrightWebServerConfigShape {
28
+ readonly command: string;
29
+ readonly url: string;
30
+ readonly reuseExistingServer: boolean;
31
+ readonly timeout: number;
32
+ readonly stdout: 'pipe' | 'ignore';
33
+ readonly stderr: 'pipe' | 'ignore';
34
+ readonly gracefulShutdown: {
35
+ readonly signal: 'SIGTERM';
36
+ readonly timeout: number;
37
+ };
38
+ readonly env?: Record<string, string>;
39
+ }
40
+ interface DevstackPlaywrightBaseConfigOptions {
41
+ /** Test directory. Default: `'./e2e'` (architecture invariant). */
42
+ readonly testDir?: string;
43
+ /** Path to a global-setup module. Default: not wired. Pass `null`
44
+ * to keep the property omitted when composing conditionally. */
45
+ readonly globalSetup?: string | null;
46
+ }
47
+ interface DevstackPlaywrightEndpointOptions extends ResolveStackContextOptions {
48
+ /** Endpoint name whose URL becomes `webServer.url` + `use.baseURL`.
49
+ * Default: `'dev'` (the host-service dev server endpoint). */
50
+ readonly endpointName?: string;
51
+ /** Explicit baseURL override. When set, manifest discovery is
52
+ * bypassed entirely. */
53
+ readonly baseURL?: string;
54
+ }
55
+ interface DevstackPlaywrightWebServerOptions extends DevstackPlaywrightEndpointOptions {
56
+ /** Command Playwright runs to bring up the stack. Default:
57
+ * `'pnpm dev'`. */
58
+ readonly command?: string;
59
+ /** Hard cap (ms) for `webServer` URL to become reachable. Default:
60
+ * 300_000 (5 min) — accounts for cold supervisor boot under
61
+ * Docker pulls. */
62
+ readonly webServerTimeoutMs?: number;
63
+ /** Hard cap (ms) for `webServer.gracefulShutdown`. Default: 10_000
64
+ * (10 s) — load-bearing per architecture § Invariants. */
65
+ readonly gracefulShutdownTimeoutMs?: number;
66
+ /** Extra env to forward to `webServer.command`. Merged after the
67
+ * preset's own env (PLAYWRIGHT=1, DEVSTACK_STACK). */
68
+ readonly env?: Record<string, string>;
69
+ }
70
+ interface DevstackPlaywrightProjectsOptions {
71
+ /** Extra Playwright projects to append to the default Chromium
72
+ * project. */
73
+ readonly projects?: ReadonlyArray<PlaywrightProjectShape>;
74
+ }
75
+ interface DevstackPlaywrightUseOptions extends DevstackPlaywrightEndpointOptions {
76
+ readonly trace?: PlaywrightUseConfigShape['trace'];
77
+ readonly screenshot?: PlaywrightUseConfigShape['screenshot'];
78
+ readonly use?: Omit<Partial<PlaywrightUseConfigShape>, 'baseURL'>;
79
+ }
80
+ /**
81
+ * Resolve the browser app URL Playwright should target. This is the
82
+ * only helper here that may synchronously read the manifest; callers
83
+ * can pass `baseURL` to bypass discovery entirely.
84
+ */
85
+ declare const resolveDevstackPlaywrightBaseURL: (options?: DevstackPlaywrightEndpointOptions) => string;
86
+ declare const devstackPlaywrightBaseConfig: (options?: DevstackPlaywrightBaseConfigOptions) => PlaywrightBaseConfigShape;
87
+ declare const devstackPlaywrightUse: (options?: DevstackPlaywrightUseOptions) => PlaywrightUseConfigShape;
88
+ declare const devstackPlaywrightProjects: (options?: DevstackPlaywrightProjectsOptions) => PlaywrightProjectShape[];
89
+ declare const devstackPlaywrightWebServer: (options?: DevstackPlaywrightWebServerOptions) => PlaywrightWebServerConfigShape;
90
+ //#endregion
91
+ export { DevstackPlaywrightBaseConfigOptions, DevstackPlaywrightEndpointOptions, DevstackPlaywrightProjectsOptions, DevstackPlaywrightUseOptions, DevstackPlaywrightWebServerOptions, PlaywrightBaseConfigShape, PlaywrightProjectShape, PlaywrightUseConfigShape, PlaywrightWebServerConfigShape, devstackPlaywrightBaseConfig, devstackPlaywrightProjects, devstackPlaywrightUse, devstackPlaywrightWebServer, resolveDevstackPlaywrightBaseURL };
92
+ //# sourceMappingURL=config.d.mts.map
@@ -0,0 +1,71 @@
1
+ import { resolveEndpointUrl } from "./stack-context.mjs";
2
+ //#region src/build-integrations/playwright/config.ts
3
+ const DEFAULT_TEST_DIR = "./e2e";
4
+ const DEFAULT_COMMAND = "pnpm dev";
5
+ const DEFAULT_WEBSERVER_TIMEOUT_MS = 3e5;
6
+ const DEFAULT_GRACEFUL_SHUTDOWN_MS = 1e4;
7
+ const DEFAULT_ENDPOINT_NAME = "dev";
8
+ /**
9
+ * Resolve the browser app URL Playwright should target. This is the
10
+ * only helper here that may synchronously read the manifest; callers
11
+ * can pass `baseURL` to bypass discovery entirely.
12
+ */
13
+ const resolveDevstackPlaywrightBaseURL = (options = {}) => {
14
+ const endpointName = options.endpointName ?? DEFAULT_ENDPOINT_NAME;
15
+ return options.baseURL ?? resolveEndpointUrl(endpointName, {
16
+ ...options.cwd !== void 0 ? { cwd: options.cwd } : {},
17
+ ...options.manifestPath !== void 0 ? { manifestPath: options.manifestPath } : {},
18
+ ...options.stack !== void 0 ? { stack: options.stack } : {},
19
+ ...options.stateDir !== void 0 ? { stateDir: options.stateDir } : {},
20
+ ...options.env !== void 0 ? { env: options.env } : {}
21
+ }).url;
22
+ };
23
+ const devstackPlaywrightBaseConfig = (options = {}) => {
24
+ const ci = Boolean(process.env.CI);
25
+ return {
26
+ testDir: options.testDir ?? DEFAULT_TEST_DIR,
27
+ fullyParallel: false,
28
+ forbidOnly: ci,
29
+ retries: ci ? 2 : 0,
30
+ workers: 1,
31
+ reporter: ci ? [["github"], ["list"]] : "list",
32
+ globalSetup: options.globalSetup === null ? void 0 : options.globalSetup ?? void 0
33
+ };
34
+ };
35
+ const devstackPlaywrightUse = (options = {}) => ({
36
+ baseURL: resolveDevstackPlaywrightBaseURL(options),
37
+ trace: options.trace ?? "on-first-retry",
38
+ screenshot: options.screenshot ?? "only-on-failure",
39
+ ...options.use ?? {}
40
+ });
41
+ const devstackPlaywrightProjects = (options = {}) => [{
42
+ name: "chromium",
43
+ use: { browserName: "chromium" }
44
+ }, ...options.projects ?? []];
45
+ const devstackPlaywrightWebServer = (options = {}) => {
46
+ const env = options.env ? { ...options.env } : {};
47
+ const ci = Boolean(process.env.CI);
48
+ const baseURL = resolveDevstackPlaywrightBaseURL(options);
49
+ const presetEnv = {
50
+ PLAYWRIGHT: "1",
51
+ ...options.stack !== void 0 ? { DEVSTACK_STACK: options.stack } : {},
52
+ ...env
53
+ };
54
+ return {
55
+ command: options.command ?? DEFAULT_COMMAND,
56
+ url: baseURL,
57
+ reuseExistingServer: !ci,
58
+ timeout: options.webServerTimeoutMs ?? DEFAULT_WEBSERVER_TIMEOUT_MS,
59
+ stdout: "pipe",
60
+ stderr: "pipe",
61
+ gracefulShutdown: {
62
+ signal: "SIGTERM",
63
+ timeout: options.gracefulShutdownTimeoutMs ?? DEFAULT_GRACEFUL_SHUTDOWN_MS
64
+ },
65
+ env: presetEnv
66
+ };
67
+ };
68
+ //#endregion
69
+ export { devstackPlaywrightBaseConfig, devstackPlaywrightProjects, devstackPlaywrightUse, devstackPlaywrightWebServer, resolveDevstackPlaywrightBaseURL };
70
+
71
+ //# sourceMappingURL=config.mjs.map
@@ -0,0 +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 { 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>];\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?: string;\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: not wired. Pass `null`\n\t * to keep the property omitted when composing conditionally. */\n\treadonly globalSetup?: string | 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 = 'dev';\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: options.globalSetup === null ? undefined : (options.globalSetup ?? undefined),\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":";;AAsIA,MAAM,mBAAmB;AACzB,MAAM,kBAAkB;AACxB,MAAM,+BAA+B;AACrC,MAAM,+BAA+B;AACrC,MAAM,wBAAwB;;;;;;AAW9B,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,aAAa,QAAQ,gBAAgB,OAAO,KAAA,IAAa,QAAQ,eAAe,KAAA;EAChF;;AAGF,MAAa,yBACZ,UAAwC,EAAE,MACX;CAC/B,SAAS,iCAAiC,QAAQ;CAClD,OAAO,QAAQ,SAAS;CACxB,YAAY,QAAQ,cAAc;CAClC,GAAI,QAAQ,OAAO,EAAE;CACrB;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"}