@mysten-incubation/devstack 0.0.1 → 0.1.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 (838) hide show
  1. package/README.md +7 -3
  2. package/dashboard-ui/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
  3. package/dashboard-ui/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
  4. package/dashboard-ui/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
  5. package/dashboard-ui/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
  6. package/dashboard-ui/assets/geist-mono-cyrillic-ext-wght-normal-I4S5GZfc.woff2 +0 -0
  7. package/dashboard-ui/assets/geist-mono-cyrillic-wght-normal-BmXc_FBt.woff2 +0 -0
  8. package/dashboard-ui/assets/geist-mono-latin-ext-wght-normal-DrnZ1wKl.woff2 +0 -0
  9. package/dashboard-ui/assets/geist-mono-latin-wght-normal-B_7UjwxQ.woff2 +0 -0
  10. package/dashboard-ui/assets/geist-mono-symbols2-wght-normal-GZpp1pK2.woff2 +0 -0
  11. package/dashboard-ui/assets/geist-mono-vietnamese-wght-normal-D8KDMBhC.woff2 +0 -0
  12. package/dashboard-ui/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
  13. package/dashboard-ui/assets/index-Bmi1UtAg.js +1356 -0
  14. package/dashboard-ui/assets/index-D5EShVt4.js +3 -0
  15. package/dashboard-ui/assets/index-Deml9drg.css +1 -0
  16. package/dashboard-ui/index.html +13 -0
  17. package/dist/api/define-capabilities.d.mts +14 -3
  18. package/dist/api/define-capabilities.mjs +18 -1
  19. package/dist/api/define-capabilities.mjs.map +1 -1
  20. package/dist/api/define-devstack.d.mts +1 -1
  21. package/dist/api/define-devstack.mjs +6 -26
  22. package/dist/api/define-devstack.mjs.map +1 -1
  23. package/dist/api/define-plugin.d.mts +1 -0
  24. package/dist/api/define-plugin.mjs +2 -0
  25. package/dist/api/inference-network.d.mts +132 -0
  26. package/dist/api/inference-network.mjs +105 -16
  27. package/dist/api/inference-network.mjs.map +1 -1
  28. package/dist/api/plugin-errors.d.mts +7 -0
  29. package/dist/api/run-stack.d.mts +20 -9
  30. package/dist/api/run-stack.mjs +56 -29
  31. package/dist/api/run-stack.mjs.map +1 -1
  32. package/dist/build-integrations/playwright/config.d.mts +6 -4
  33. package/dist/build-integrations/playwright/config.mjs +5 -3
  34. package/dist/build-integrations/playwright/config.mjs.map +1 -1
  35. package/dist/build-integrations/playwright/errors.d.mts +1 -1
  36. package/dist/build-integrations/playwright/global-setup.d.mts +43 -17
  37. package/dist/build-integrations/playwright/global-setup.mjs +250 -13
  38. package/dist/build-integrations/playwright/global-setup.mjs.map +1 -1
  39. package/dist/build-integrations/playwright/index.d.mts +5 -3
  40. package/dist/build-integrations/playwright/index.mjs +4 -2
  41. package/dist/build-integrations/playwright/stack-context.d.mts +0 -1
  42. package/dist/build-integrations/playwright/stack-context.mjs +24 -63
  43. package/dist/build-integrations/playwright/stack-context.mjs.map +1 -1
  44. package/dist/build-integrations/playwright/wallet-context.d.mts +7 -10
  45. package/dist/build-integrations/playwright/wallet-context.mjs +8 -13
  46. package/dist/build-integrations/playwright/wallet-context.mjs.map +1 -1
  47. package/dist/build-integrations/runtime/cold-start-url.d.mts +5 -0
  48. package/dist/build-integrations/runtime/cold-start-url.mjs +4 -3
  49. package/dist/build-integrations/runtime/cold-start-url.mjs.map +1 -1
  50. package/dist/build-integrations/runtime/conventional-routes.d.mts +51 -0
  51. package/dist/build-integrations/runtime/conventional-routes.mjs +92 -0
  52. package/dist/build-integrations/runtime/conventional-routes.mjs.map +1 -0
  53. package/dist/build-integrations/runtime/discover.d.mts +38 -30
  54. package/dist/build-integrations/runtime/discover.mjs +73 -70
  55. package/dist/build-integrations/runtime/discover.mjs.map +1 -1
  56. package/dist/build-integrations/runtime/endpoint-registry.d.mts +3 -1
  57. package/dist/build-integrations/runtime/endpoint-registry.mjs +3 -1
  58. package/dist/build-integrations/runtime/endpoint-registry.mjs.map +1 -1
  59. package/dist/build-integrations/runtime/index.d.mts +7 -2
  60. package/dist/build-integrations/runtime/index.mjs +9 -2
  61. package/dist/build-integrations/runtime/manifest-types.d.mts +2 -0
  62. package/dist/build-integrations/runtime/manifest-types.mjs +3 -0
  63. package/dist/build-integrations/runtime/playwright-stack-context-slot.d.mts +29 -0
  64. package/dist/build-integrations/runtime/playwright-stack-context-slot.mjs +10 -0
  65. package/dist/build-integrations/runtime/playwright-stack-context-slot.mjs.map +1 -0
  66. package/dist/build-integrations/runtime/read-stack-context.d.mts +1 -1
  67. package/dist/build-integrations/runtime/read-stack-context.mjs +10 -4
  68. package/dist/build-integrations/runtime/read-stack-context.mjs.map +1 -1
  69. package/dist/build-integrations/runtime/resolve-discovery-env.d.mts +48 -0
  70. package/dist/build-integrations/runtime/resolve-discovery-env.mjs +42 -0
  71. package/dist/build-integrations/runtime/resolve-discovery-env.mjs.map +1 -0
  72. package/dist/build-integrations/runtime/stack-context.d.mts +1 -1
  73. package/dist/build-integrations/runtime/wallet-paths.mjs +2 -0
  74. package/dist/build-integrations/vite/index.d.mts +51 -0
  75. package/dist/build-integrations/vite/index.mjs +73 -0
  76. package/dist/build-integrations/vite/index.mjs.map +1 -0
  77. package/dist/build-integrations/vitest/env.d.mts +4 -3
  78. package/dist/build-integrations/vitest/env.mjs +6 -4
  79. package/dist/build-integrations/vitest/env.mjs.map +1 -1
  80. package/dist/build-integrations/vitest/errors.d.mts +25 -4
  81. package/dist/build-integrations/vitest/errors.mjs +15 -2
  82. package/dist/build-integrations/vitest/errors.mjs.map +1 -1
  83. package/dist/build-integrations/vitest/index.d.mts +2 -2
  84. package/dist/build-integrations/vitest/index.mjs +3 -3
  85. package/dist/build-integrations/vitest/setup.d.mts +4 -2
  86. package/dist/build-integrations/vitest/setup.mjs +2 -2
  87. package/dist/build-integrations/vitest/setup.mjs.map +1 -1
  88. package/dist/build-integrations/vitest/stack-context.d.mts +0 -1
  89. package/dist/build-integrations/vitest/stack-context.mjs +33 -13
  90. package/dist/build-integrations/vitest/stack-context.mjs.map +1 -1
  91. package/dist/cli/bail.mjs +23 -0
  92. package/dist/cli/bail.mjs.map +1 -0
  93. package/dist/{surfaces/cli/commands → cli}/doctor-probes.mjs +26 -16
  94. package/dist/cli/doctor-probes.mjs.map +1 -0
  95. package/dist/cli/main.d.mts +15 -1
  96. package/dist/cli/main.mjs +166 -482
  97. package/dist/cli/main.mjs.map +1 -1
  98. package/dist/cli/prune-direct.mjs +31 -201
  99. package/dist/cli/prune-direct.mjs.map +1 -1
  100. package/dist/cli/snapshot-reader.mjs +14 -11
  101. package/dist/cli/snapshot-reader.mjs.map +1 -1
  102. package/dist/cli/up-lifecycle.mjs +4 -1
  103. package/dist/cli/up-lifecycle.mjs.map +1 -1
  104. package/dist/cli/wirings/apply.mjs +95 -0
  105. package/dist/cli/wirings/apply.mjs.map +1 -0
  106. package/dist/cli/wirings/build-verb-layers.mjs +42 -0
  107. package/dist/cli/wirings/build-verb-layers.mjs.map +1 -0
  108. package/dist/cli/wirings/config-loader.mjs +69 -0
  109. package/dist/cli/wirings/config-loader.mjs.map +1 -0
  110. package/dist/cli/wirings/engine-command.mjs +30 -0
  111. package/dist/cli/wirings/engine-command.mjs.map +1 -0
  112. package/dist/cli/wirings/identity.mjs +72 -0
  113. package/dist/cli/wirings/identity.mjs.map +1 -0
  114. package/dist/cli/wirings/provide-file-system.mjs +7 -0
  115. package/dist/cli/wirings/provide-file-system.mjs.map +1 -0
  116. package/dist/cli/wirings/snapshot.mjs +177 -0
  117. package/dist/cli/wirings/snapshot.mjs.map +1 -0
  118. package/dist/cli/wirings/up.mjs +287 -0
  119. package/dist/cli/wirings/up.mjs.map +1 -0
  120. package/dist/cli/wirings/wipe.mjs +40 -0
  121. package/dist/cli/wirings/wipe.mjs.map +1 -0
  122. package/dist/contracts/capability-decl.d.mts +0 -2
  123. package/dist/contracts/codegenable.d.mts +43 -0
  124. package/dist/contracts/container-runtime.d.mts +26 -1
  125. package/dist/contracts/faucet-strategy.d.mts +25 -0
  126. package/dist/contracts/funding-strategy.d.mts +42 -0
  127. package/dist/contracts/plugin-expander.mjs +60 -0
  128. package/dist/contracts/plugin-expander.mjs.map +1 -0
  129. package/dist/contracts/projection.d.mts +5 -3
  130. package/dist/contracts/renderer.d.mts +23 -0
  131. package/dist/contracts/routable.d.mts +14 -1
  132. package/dist/contracts/snapshotable.d.mts +25 -3
  133. package/dist/contracts/wallet-protocol.d.mts +52 -0
  134. package/dist/contracts/wallet-protocol.mjs +52 -0
  135. package/dist/contracts/wallet-protocol.mjs.map +1 -0
  136. package/dist/index.d.mts +26 -25
  137. package/dist/index.mjs +20 -13
  138. package/dist/{runtime → orchestrators}/built-in-plugin-layers.mjs +10 -5
  139. package/dist/orchestrators/built-in-plugin-layers.mjs.map +1 -0
  140. package/dist/orchestrators/codegen/bindings.d.mts +1 -2
  141. package/dist/orchestrators/codegen/bindings.mjs +52 -186
  142. package/dist/orchestrators/codegen/bindings.mjs.map +1 -1
  143. package/dist/orchestrators/codegen/emit.mjs +19 -1
  144. package/dist/orchestrators/codegen/emit.mjs.map +1 -1
  145. package/dist/orchestrators/codegen/errors.mjs +8 -3
  146. package/dist/orchestrators/codegen/errors.mjs.map +1 -1
  147. package/dist/orchestrators/codegen/format.mjs +47 -39
  148. package/dist/orchestrators/codegen/format.mjs.map +1 -1
  149. package/dist/orchestrators/codegen/gitignore.mjs +3 -1
  150. package/dist/orchestrators/codegen/gitignore.mjs.map +1 -1
  151. package/dist/orchestrators/codegen/output-location.mjs +40 -0
  152. package/dist/orchestrators/codegen/output-location.mjs.map +1 -0
  153. package/dist/orchestrators/codegen/paths.d.mts +1 -1
  154. package/dist/orchestrators/codegen/paths.mjs +40 -14
  155. package/dist/orchestrators/codegen/paths.mjs.map +1 -1
  156. package/dist/orchestrators/codegen/permissions.mjs +3 -1
  157. package/dist/orchestrators/codegen/permissions.mjs.map +1 -1
  158. package/dist/orchestrators/codegen/service.mjs +157 -105
  159. package/dist/orchestrators/codegen/service.mjs.map +1 -1
  160. package/dist/orchestrators/lifecycle-prune/errors.mjs +31 -0
  161. package/dist/orchestrators/lifecycle-prune/errors.mjs.map +1 -0
  162. package/dist/orchestrators/lifecycle-prune/index.mjs +350 -0
  163. package/dist/orchestrators/lifecycle-prune/index.mjs.map +1 -0
  164. package/dist/orchestrators/router/cleanup.mjs +26 -27
  165. package/dist/orchestrators/router/cleanup.mjs.map +1 -1
  166. package/dist/orchestrators/router/entrypoints.mjs +2 -2
  167. package/dist/orchestrators/router/entrypoints.mjs.map +1 -1
  168. package/dist/orchestrators/router/file-provider.mjs +14 -5
  169. package/dist/orchestrators/router/file-provider.mjs.map +1 -1
  170. package/dist/orchestrators/router/hostname.mjs +19 -55
  171. package/dist/orchestrators/router/hostname.mjs.map +1 -1
  172. package/dist/orchestrators/router/index.mjs +11 -0
  173. package/dist/orchestrators/router/profile.mjs +2 -2
  174. package/dist/orchestrators/router/sentinels.mjs +26 -0
  175. package/dist/orchestrators/router/sentinels.mjs.map +1 -0
  176. package/dist/orchestrators/router/service.mjs +40 -37
  177. package/dist/orchestrators/router/service.mjs.map +1 -1
  178. package/dist/orchestrators/router/traefik-container.mjs +27 -16
  179. package/dist/orchestrators/router/traefik-container.mjs.map +1 -1
  180. package/dist/{substrate/runtime → orchestrators}/run.mjs +26 -21
  181. package/dist/orchestrators/run.mjs.map +1 -0
  182. package/dist/orchestrators/runtime-composition.d.mts +1 -1
  183. package/dist/orchestrators/runtime-composition.mjs +123 -39
  184. package/dist/orchestrators/runtime-composition.mjs.map +1 -1
  185. package/dist/orchestrators/snapshot/capture-command.d.mts +1 -0
  186. package/dist/orchestrators/snapshot/capture-command.mjs +25 -0
  187. package/dist/orchestrators/snapshot/capture-command.mjs.map +1 -0
  188. package/dist/orchestrators/snapshot/capture.mjs +42 -28
  189. package/dist/orchestrators/snapshot/capture.mjs.map +1 -1
  190. package/dist/orchestrators/snapshot/descriptor.mjs +35 -10
  191. package/dist/orchestrators/snapshot/descriptor.mjs.map +1 -1
  192. package/dist/orchestrators/snapshot/identity-guard.mjs +1 -1
  193. package/dist/orchestrators/snapshot/index.mjs +13 -0
  194. package/dist/orchestrators/snapshot/integrity.d.mts +1 -1
  195. package/dist/orchestrators/snapshot/integrity.mjs +73 -17
  196. package/dist/orchestrators/snapshot/integrity.mjs.map +1 -1
  197. package/dist/orchestrators/snapshot/pending-marker.d.mts +1 -0
  198. package/dist/orchestrators/snapshot/pending-marker.mjs +99 -0
  199. package/dist/orchestrators/snapshot/pending-marker.mjs.map +1 -0
  200. package/dist/orchestrators/snapshot/phase-error.mjs +23 -0
  201. package/dist/orchestrators/snapshot/phase-error.mjs.map +1 -0
  202. package/dist/orchestrators/snapshot/prune.mjs +20 -55
  203. package/dist/orchestrators/snapshot/prune.mjs.map +1 -1
  204. package/dist/orchestrators/snapshot/recover-pending.d.mts +1 -0
  205. package/dist/orchestrators/snapshot/recover-pending.mjs +223 -0
  206. package/dist/orchestrators/snapshot/recover-pending.mjs.map +1 -0
  207. package/dist/orchestrators/snapshot/restore.mjs +118 -84
  208. package/dist/orchestrators/snapshot/restore.mjs.map +1 -1
  209. package/dist/orchestrators/snapshot/service.mjs +53 -56
  210. package/dist/orchestrators/snapshot/service.mjs.map +1 -1
  211. package/dist/orchestrators/snapshot/state-document.d.mts +1 -0
  212. package/dist/orchestrators/snapshot/state-document.mjs +47 -7
  213. package/dist/orchestrators/snapshot/state-document.mjs.map +1 -1
  214. package/dist/orchestrators/snapshot/wipe.mjs +67 -10
  215. package/dist/orchestrators/snapshot/wipe.mjs.map +1 -1
  216. package/dist/plugins/account/codegen.mjs +9 -8
  217. package/dist/plugins/account/codegen.mjs.map +1 -1
  218. package/dist/plugins/account/errors.d.mts +33 -6
  219. package/dist/plugins/account/errors.mjs.map +1 -1
  220. package/dist/plugins/account/funding.d.mts +29 -19
  221. package/dist/plugins/account/funding.mjs +84 -66
  222. package/dist/plugins/account/funding.mjs.map +1 -1
  223. package/dist/plugins/account/index.d.mts +2 -4
  224. package/dist/plugins/account/index.mjs +64 -31
  225. package/dist/plugins/account/index.mjs.map +1 -1
  226. package/dist/plugins/account/keypair.mjs +6 -9
  227. package/dist/plugins/account/keypair.mjs.map +1 -1
  228. package/dist/plugins/account/lease.mjs +1 -0
  229. package/dist/plugins/account/lease.mjs.map +1 -1
  230. package/dist/plugins/account/registry.d.mts +14 -1
  231. package/dist/plugins/account/registry.mjs +18 -18
  232. package/dist/plugins/account/registry.mjs.map +1 -1
  233. package/dist/plugins/account/service.d.mts +23 -4
  234. package/dist/plugins/account/service.mjs +83 -45
  235. package/dist/plugins/account/service.mjs.map +1 -1
  236. package/dist/plugins/account/snapshot.mjs +2 -5
  237. package/dist/plugins/account/snapshot.mjs.map +1 -1
  238. package/dist/plugins/account/spans.mjs +16 -0
  239. package/dist/plugins/account/spans.mjs.map +1 -0
  240. package/dist/plugins/account/variants/keystore.mjs +6 -8
  241. package/dist/plugins/account/variants/keystore.mjs.map +1 -1
  242. package/dist/plugins/action/build-context.d.mts +3 -2
  243. package/dist/plugins/action/errors.d.mts +16 -12
  244. package/dist/plugins/action/errors.mjs.map +1 -1
  245. package/dist/plugins/action/execute.mjs +65 -103
  246. package/dist/plugins/action/execute.mjs.map +1 -1
  247. package/dist/plugins/action/index.d.mts +0 -2
  248. package/dist/plugins/action/index.mjs +17 -13
  249. package/dist/plugins/action/index.mjs.map +1 -1
  250. package/dist/plugins/action/service.mjs +38 -35
  251. package/dist/plugins/action/service.mjs.map +1 -1
  252. package/dist/plugins/action/spans.mjs +11 -0
  253. package/dist/plugins/action/spans.mjs.map +1 -0
  254. package/dist/plugins/coin/codegen.mjs +9 -8
  255. package/dist/plugins/coin/codegen.mjs.map +1 -1
  256. package/dist/plugins/coin/discovery.mjs +8 -4
  257. package/dist/plugins/coin/discovery.mjs.map +1 -1
  258. package/dist/plugins/coin/index.d.mts +11 -29
  259. package/dist/plugins/coin/index.mjs +56 -27
  260. package/dist/plugins/coin/index.mjs.map +1 -1
  261. package/dist/plugins/coin/metadata.mjs +8 -15
  262. package/dist/plugins/coin/metadata.mjs.map +1 -1
  263. package/dist/plugins/coin/mint.d.mts +30 -11
  264. package/dist/plugins/coin/mint.mjs +78 -74
  265. package/dist/plugins/coin/mint.mjs.map +1 -1
  266. package/dist/plugins/coin/registry.mjs +4 -7
  267. package/dist/plugins/coin/registry.mjs.map +1 -1
  268. package/dist/plugins/coin/service.d.mts +39 -1
  269. package/dist/plugins/coin/service.mjs +11 -4
  270. package/dist/plugins/coin/service.mjs.map +1 -1
  271. package/dist/plugins/coin/spans.mjs +20 -0
  272. package/dist/plugins/coin/spans.mjs.map +1 -0
  273. package/dist/plugins/dashboard/domain.mjs +402 -0
  274. package/dist/plugins/dashboard/domain.mjs.map +1 -0
  275. package/dist/plugins/dashboard/index.d.mts +29 -0
  276. package/dist/plugins/dashboard/index.mjs +91 -0
  277. package/dist/plugins/dashboard/index.mjs.map +1 -0
  278. package/dist/plugins/dashboard/origin-policy.mjs +36 -0
  279. package/dist/plugins/dashboard/origin-policy.mjs.map +1 -0
  280. package/dist/plugins/dashboard/routable.mjs +27 -0
  281. package/dist/plugins/dashboard/routable.mjs.map +1 -0
  282. package/dist/plugins/dashboard/schema/builder.mjs +21 -0
  283. package/dist/plugins/dashboard/schema/builder.mjs.map +1 -0
  284. package/dist/plugins/dashboard/schema/enums.mjs +72 -0
  285. package/dist/plugins/dashboard/schema/enums.mjs.map +1 -0
  286. package/dist/plugins/dashboard/schema/root.mjs +351 -0
  287. package/dist/plugins/dashboard/schema/root.mjs.map +1 -0
  288. package/dist/plugins/dashboard/schema/types.mjs +508 -0
  289. package/dist/plugins/dashboard/schema/types.mjs.map +1 -0
  290. package/dist/plugins/dashboard/schema.mjs +11 -0
  291. package/dist/plugins/dashboard/schema.mjs.map +1 -0
  292. package/dist/plugins/dashboard/server.mjs +166 -0
  293. package/dist/plugins/dashboard/server.mjs.map +1 -0
  294. package/dist/plugins/deepbook/deploy.mjs +53 -115
  295. package/dist/plugins/deepbook/deploy.mjs.map +1 -1
  296. package/dist/plugins/deepbook/errors.mjs +1 -0
  297. package/dist/plugins/deepbook/errors.mjs.map +1 -1
  298. package/dist/plugins/deepbook/faucet-strategy.mjs +47 -34
  299. package/dist/plugins/deepbook/faucet-strategy.mjs.map +1 -1
  300. package/dist/plugins/deepbook/hash.mjs +9 -0
  301. package/dist/plugins/deepbook/hash.mjs.map +1 -0
  302. package/dist/plugins/deepbook/index.d.mts +1 -10
  303. package/dist/plugins/deepbook/index.mjs +25 -22
  304. package/dist/plugins/deepbook/index.mjs.map +1 -1
  305. package/dist/plugins/deepbook/pyth/index.mjs +26 -55
  306. package/dist/plugins/deepbook/pyth/index.mjs.map +1 -1
  307. package/dist/plugins/deepbook/snapshot.mjs +17 -29
  308. package/dist/plugins/deepbook/snapshot.mjs.map +1 -1
  309. package/dist/plugins/deepbook/spans.mjs +18 -0
  310. package/dist/plugins/deepbook/spans.mjs.map +1 -0
  311. package/dist/plugins/deepbook/type-strings.mjs +65 -0
  312. package/dist/plugins/deepbook/type-strings.mjs.map +1 -0
  313. package/dist/plugins/deepbook/types.d.mts +2 -3
  314. package/dist/plugins/deepbook/types.mjs.map +1 -1
  315. package/dist/plugins/faucet/dispatcher.d.mts +21 -2
  316. package/dist/plugins/faucet/dispatcher.mjs +1 -2
  317. package/dist/plugins/faucet/dispatcher.mjs.map +1 -1
  318. package/dist/plugins/faucet/errors.d.mts +11 -24
  319. package/dist/plugins/faucet/errors.mjs.map +1 -1
  320. package/dist/plugins/faucet/http.mjs +33 -14
  321. package/dist/plugins/faucet/http.mjs.map +1 -1
  322. package/dist/plugins/faucet/index.d.mts +15 -5
  323. package/dist/plugins/faucet/index.mjs +3 -0
  324. package/dist/plugins/faucet/index.mjs.map +1 -1
  325. package/dist/plugins/faucet/spans.mjs +12 -0
  326. package/dist/plugins/faucet/spans.mjs.map +1 -0
  327. package/dist/plugins/host-service/errors.d.mts +1 -1
  328. package/dist/plugins/host-service/index.mjs +34 -8
  329. package/dist/plugins/host-service/index.mjs.map +1 -1
  330. package/dist/plugins/host-service/routable.mjs +2 -1
  331. package/dist/plugins/host-service/routable.mjs.map +1 -1
  332. package/dist/plugins/host-service/service.d.mts +21 -0
  333. package/dist/plugins/host-service/service.mjs +136 -81
  334. package/dist/plugins/host-service/service.mjs.map +1 -1
  335. package/dist/plugins/internal/acquire-on-chain-artifact.mjs +23 -0
  336. package/dist/plugins/internal/acquire-on-chain-artifact.mjs.map +1 -0
  337. package/dist/plugins/internal/codegen-helpers.mjs +18 -0
  338. package/dist/plugins/internal/codegen-helpers.mjs.map +1 -0
  339. package/dist/plugins/internal/funding-failure-error.mjs +32 -0
  340. package/dist/plugins/internal/funding-failure-error.mjs.map +1 -0
  341. package/dist/plugins/package/build.mjs +1 -1
  342. package/dist/plugins/package/build.mjs.map +1 -1
  343. package/dist/plugins/package/codegen.mjs +26 -0
  344. package/dist/plugins/package/codegen.mjs.map +1 -1
  345. package/dist/plugins/package/errors.d.mts +16 -6
  346. package/dist/plugins/package/errors.mjs.map +1 -1
  347. package/dist/plugins/package/index.d.mts +0 -4
  348. package/dist/plugins/package/index.mjs +27 -21
  349. package/dist/plugins/package/index.mjs.map +1 -1
  350. package/dist/plugins/package/mode-known.mjs +26 -12
  351. package/dist/plugins/package/mode-known.mjs.map +1 -1
  352. package/dist/plugins/package/mode-local.mjs +47 -41
  353. package/dist/plugins/package/mode-local.mjs.map +1 -1
  354. package/dist/plugins/package/publish-executor.mjs +55 -114
  355. package/dist/plugins/package/publish-executor.mjs.map +1 -1
  356. package/dist/plugins/package/registry.mjs +2 -1
  357. package/dist/plugins/package/registry.mjs.map +1 -1
  358. package/dist/plugins/package/service.mjs.map +1 -1
  359. package/dist/plugins/package/spans.mjs +14 -0
  360. package/dist/plugins/package/spans.mjs.map +1 -0
  361. package/dist/plugins/postgres/db-ensure.mjs +19 -12
  362. package/dist/plugins/postgres/db-ensure.mjs.map +1 -1
  363. package/dist/plugins/postgres/errors.d.mts +5 -0
  364. package/dist/plugins/postgres/errors.mjs.map +1 -1
  365. package/dist/plugins/postgres/index.mjs +10 -17
  366. package/dist/plugins/postgres/index.mjs.map +1 -1
  367. package/dist/plugins/postgres/service.mjs +58 -24
  368. package/dist/plugins/postgres/service.mjs.map +1 -1
  369. package/dist/plugins/postgres/snapshot.mjs.map +1 -1
  370. package/dist/plugins/postgres/spans.mjs +11 -0
  371. package/dist/plugins/postgres/spans.mjs.map +1 -0
  372. package/dist/plugins/router-entrypoints.mjs +4 -4
  373. package/dist/plugins/router-entrypoints.mjs.map +1 -1
  374. package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs +15 -13
  375. package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs.map +1 -1
  376. package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs +15 -19
  377. package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs.map +1 -1
  378. package/dist/plugins/seal/codegen.d.mts +2 -3
  379. package/dist/plugins/seal/codegen.mjs.map +1 -1
  380. package/dist/plugins/seal/config-render.mjs +35 -8
  381. package/dist/plugins/seal/config-render.mjs.map +1 -1
  382. package/dist/plugins/seal/deploy.mjs +31 -39
  383. package/dist/plugins/seal/deploy.mjs.map +1 -1
  384. package/dist/plugins/seal/errors.d.mts +1 -3
  385. package/dist/plugins/seal/errors.mjs +7 -1
  386. package/dist/plugins/seal/errors.mjs.map +1 -1
  387. package/dist/plugins/seal/index.d.mts +1 -6
  388. package/dist/plugins/seal/index.mjs +40 -14
  389. package/dist/plugins/seal/index.mjs.map +1 -1
  390. package/dist/plugins/seal/key-manager.d.mts +1 -9
  391. package/dist/plugins/seal/key-manager.mjs +2 -18
  392. package/dist/plugins/seal/key-manager.mjs.map +1 -1
  393. package/dist/plugins/seal/key-server.mjs +37 -36
  394. package/dist/plugins/seal/key-server.mjs.map +1 -1
  395. package/dist/plugins/seal/keygen.mjs +16 -17
  396. package/dist/plugins/seal/keygen.mjs.map +1 -1
  397. package/dist/plugins/seal/mode/fork-known.mjs +36 -14
  398. package/dist/plugins/seal/mode/fork-known.mjs.map +1 -1
  399. package/dist/plugins/seal/mode/live.d.mts +6 -4
  400. package/dist/plugins/seal/mode/live.mjs +14 -21
  401. package/dist/plugins/seal/mode/live.mjs.map +1 -1
  402. package/dist/plugins/seal/mode/local-keygen.mjs +57 -21
  403. package/dist/plugins/seal/mode/local-keygen.mjs.map +1 -1
  404. package/dist/plugins/seal/registry-publish.mjs +1 -0
  405. package/dist/plugins/seal/registry-publish.mjs.map +1 -1
  406. package/dist/plugins/seal/routable.mjs.map +1 -1
  407. package/dist/plugins/seal/service.mjs.map +1 -1
  408. package/dist/plugins/seal/spans.mjs +18 -0
  409. package/dist/plugins/seal/spans.mjs.map +1 -0
  410. package/dist/plugins/sui/auto-tick.mjs +17 -23
  411. package/dist/plugins/sui/auto-tick.mjs.map +1 -1
  412. package/dist/plugins/sui/chain-build-container.mjs +18 -0
  413. package/dist/plugins/sui/chain-build-container.mjs.map +1 -0
  414. package/dist/plugins/sui/chain-probe.d.mts +5 -5
  415. package/dist/plugins/sui/chain-probe.mjs +28 -58
  416. package/dist/plugins/sui/chain-probe.mjs.map +1 -1
  417. package/dist/plugins/sui/codegen.mjs +26 -0
  418. package/dist/plugins/sui/codegen.mjs.map +1 -1
  419. package/dist/plugins/sui/errors.d.mts +2 -29
  420. package/dist/plugins/sui/errors.mjs +1 -3
  421. package/dist/plugins/sui/errors.mjs.map +1 -1
  422. package/dist/plugins/sui/fork-faucet-strategy.d.mts +1 -0
  423. package/dist/plugins/sui/fork-faucet-strategy.mjs +55 -0
  424. package/dist/plugins/sui/fork-faucet-strategy.mjs.map +1 -0
  425. package/dist/plugins/sui/fork-orchestration.d.mts +1 -0
  426. package/dist/plugins/sui/fork-orchestration.mjs +170 -2
  427. package/dist/plugins/sui/fork-orchestration.mjs.map +1 -1
  428. package/dist/plugins/sui/fork-transaction.d.mts +2 -0
  429. package/dist/plugins/sui/fork-transaction.mjs +92 -28
  430. package/dist/plugins/sui/fork-transaction.mjs.map +1 -1
  431. package/dist/plugins/sui/index.d.mts +33 -70
  432. package/dist/plugins/sui/index.mjs +58 -35
  433. package/dist/plugins/sui/index.mjs.map +1 -1
  434. package/dist/plugins/{faucet/strategies/sui-local.mjs → sui/local-faucet-strategy.mjs} +10 -7
  435. package/dist/plugins/sui/local-faucet-strategy.mjs.map +1 -0
  436. package/dist/plugins/sui/mode/external.mjs +7 -13
  437. package/dist/plugins/sui/mode/external.mjs.map +1 -1
  438. package/dist/plugins/sui/mode/fork.mjs +136 -59
  439. package/dist/plugins/sui/mode/fork.mjs.map +1 -1
  440. package/dist/plugins/sui/mode/live.mjs +10 -16
  441. package/dist/plugins/sui/mode/live.mjs.map +1 -1
  442. package/dist/plugins/sui/mode/local.mjs +37 -36
  443. package/dist/plugins/sui/mode/local.mjs.map +1 -1
  444. package/dist/plugins/sui/mode/shared-boot.mjs +38 -115
  445. package/dist/plugins/sui/mode/shared-boot.mjs.map +1 -1
  446. package/dist/plugins/sui/mode/shared.d.mts +1 -5
  447. package/dist/plugins/sui/mode/shared.mjs.map +1 -1
  448. package/dist/plugins/sui/mode/spec.d.mts +18 -0
  449. package/dist/plugins/sui/move-summary-runner.mjs +207 -0
  450. package/dist/plugins/sui/move-summary-runner.mjs.map +1 -0
  451. package/dist/plugins/sui/network-resolver.d.mts +4 -3
  452. package/dist/plugins/sui/service.mjs.map +1 -1
  453. package/dist/plugins/sui/snapshot.mjs +3 -0
  454. package/dist/plugins/sui/snapshot.mjs.map +1 -1
  455. package/dist/plugins/sui/spans.mjs +17 -0
  456. package/dist/plugins/sui/spans.mjs.map +1 -0
  457. package/dist/plugins/wallet/codegen.d.mts +0 -1
  458. package/dist/plugins/wallet/codegen.mjs +8 -9
  459. package/dist/plugins/wallet/codegen.mjs.map +1 -1
  460. package/dist/plugins/wallet/index.d.mts +6 -8
  461. package/dist/plugins/wallet/index.mjs +46 -35
  462. package/dist/plugins/wallet/index.mjs.map +1 -1
  463. package/dist/plugins/wallet/origin-policy.mjs +12 -28
  464. package/dist/plugins/wallet/origin-policy.mjs.map +1 -1
  465. package/dist/plugins/wallet/pairing.mjs +6 -4
  466. package/dist/plugins/wallet/pairing.mjs.map +1 -1
  467. package/dist/plugins/wallet/protocol.d.mts +1 -0
  468. package/dist/plugins/wallet/protocol.mjs +5 -44
  469. package/dist/plugins/wallet/protocol.mjs.map +1 -1
  470. package/dist/plugins/wallet/routable.mjs +2 -8
  471. package/dist/plugins/wallet/routable.mjs.map +1 -1
  472. package/dist/plugins/wallet/server.mjs +36 -44
  473. package/dist/plugins/wallet/server.mjs.map +1 -1
  474. package/dist/plugins/wallet/service.d.mts +1 -5
  475. package/dist/plugins/wallet/service.mjs +22 -18
  476. package/dist/plugins/wallet/service.mjs.map +1 -1
  477. package/dist/plugins/wallet/spans.mjs +22 -0
  478. package/dist/plugins/wallet/spans.mjs.map +1 -0
  479. package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs +33 -8
  480. package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs.map +1 -1
  481. package/dist/plugins/walrus/codegen.d.mts +3 -3
  482. package/dist/plugins/walrus/codegen.mjs.map +1 -1
  483. package/dist/plugins/walrus/deploy-paths.mjs +21 -5
  484. package/dist/plugins/walrus/deploy-paths.mjs.map +1 -1
  485. package/dist/plugins/walrus/deploy.mjs +67 -69
  486. package/dist/plugins/walrus/deploy.mjs.map +1 -1
  487. package/dist/plugins/walrus/errors.mjs +1 -0
  488. package/dist/plugins/walrus/errors.mjs.map +1 -1
  489. package/dist/plugins/walrus/faucet-strategy.mjs +12 -7
  490. package/dist/plugins/walrus/faucet-strategy.mjs.map +1 -1
  491. package/dist/plugins/walrus/index.d.mts +2 -13
  492. package/dist/plugins/walrus/index.mjs +18 -23
  493. package/dist/plugins/walrus/index.mjs.map +1 -1
  494. package/dist/plugins/walrus/mode/known-deploy.mjs +7 -5
  495. package/dist/plugins/walrus/mode/known-deploy.mjs.map +1 -1
  496. package/dist/plugins/walrus/mode/local-cluster.mjs +26 -7
  497. package/dist/plugins/walrus/mode/local-cluster.mjs.map +1 -1
  498. package/dist/plugins/walrus/registry-publish.mjs.map +1 -1
  499. package/dist/plugins/walrus/routable.mjs +7 -23
  500. package/dist/plugins/walrus/routable.mjs.map +1 -1
  501. package/dist/plugins/walrus/service.mjs.map +1 -1
  502. package/dist/plugins/walrus/spans.mjs +18 -0
  503. package/dist/plugins/walrus/spans.mjs.map +1 -0
  504. package/dist/plugins/walrus/storage-nodes.d.mts +6 -2
  505. package/dist/plugins/walrus/storage-nodes.mjs +15 -8
  506. package/dist/plugins/walrus/storage-nodes.mjs.map +1 -1
  507. package/dist/plugins/walrus/wal-swap.mjs +58 -15
  508. package/dist/plugins/walrus/wal-swap.mjs.map +1 -1
  509. package/dist/primitives/artifact-publisher.d.mts +1 -1
  510. package/dist/primitives/artifact-publisher.mjs +15 -0
  511. package/dist/primitives/artifact-publisher.mjs.map +1 -0
  512. package/dist/runtime/docker/client.mjs +17 -4
  513. package/dist/runtime/docker/client.mjs.map +1 -1
  514. package/dist/runtime/docker/container.mjs +219 -132
  515. package/dist/runtime/docker/container.mjs.map +1 -1
  516. package/dist/runtime/docker/errors.mjs +0 -6
  517. package/dist/runtime/docker/errors.mjs.map +1 -1
  518. package/dist/runtime/docker/exec.mjs +21 -18
  519. package/dist/runtime/docker/exec.mjs.map +1 -1
  520. package/dist/runtime/docker/image.mjs +36 -13
  521. package/dist/runtime/docker/image.mjs.map +1 -1
  522. package/dist/runtime/docker/index.mjs +14 -0
  523. package/dist/runtime/docker/inspect-and-decode.mjs +51 -0
  524. package/dist/runtime/docker/inspect-and-decode.mjs.map +1 -0
  525. package/dist/runtime/docker/inventory.mjs +14 -11
  526. package/dist/runtime/docker/inventory.mjs.map +1 -1
  527. package/dist/runtime/docker/labels.mjs +38 -5
  528. package/dist/runtime/docker/labels.mjs.map +1 -1
  529. package/dist/runtime/docker/logs.d.mts +1 -1
  530. package/dist/runtime/docker/logs.mjs.map +1 -1
  531. package/dist/runtime/docker/network.mjs +83 -47
  532. package/dist/runtime/docker/network.mjs.map +1 -1
  533. package/dist/runtime/docker/render-run-args.mjs +82 -0
  534. package/dist/runtime/docker/render-run-args.mjs.map +1 -0
  535. package/dist/runtime/docker/service.d.mts +1 -1
  536. package/dist/runtime/docker/service.mjs +12 -7
  537. package/dist/runtime/docker/service.mjs.map +1 -1
  538. package/dist/runtime/docker/sweep.mjs +118 -43
  539. package/dist/runtime/docker/sweep.mjs.map +1 -1
  540. package/dist/runtime/docker/volume.mjs +2 -0
  541. package/dist/runtime/docker/volume.mjs.map +1 -1
  542. package/dist/runtime/docker/wrap.mjs +30 -1
  543. package/dist/runtime/docker/wrap.mjs.map +1 -1
  544. package/dist/substrate/cross-process.mjs +14 -8
  545. package/dist/substrate/cross-process.mjs.map +1 -1
  546. package/dist/substrate/event-time.mjs +33 -0
  547. package/dist/substrate/event-time.mjs.map +1 -0
  548. package/dist/substrate/events.d.mts +28 -8
  549. package/dist/substrate/identity.d.mts +2 -1
  550. package/dist/substrate/manifest.d.mts +68 -5
  551. package/dist/substrate/manifest.mjs +34 -5
  552. package/dist/substrate/manifest.mjs.map +1 -1
  553. package/dist/substrate/network.d.mts +3 -5
  554. package/dist/substrate/options.d.mts +0 -2
  555. package/dist/substrate/plugin.d.mts +13 -0
  556. package/dist/substrate/plugin.mjs +4 -2
  557. package/dist/substrate/plugin.mjs.map +1 -1
  558. package/dist/substrate/projection.d.mts +35 -3
  559. package/dist/substrate/runtime/artifact-publisher/index.mjs +19 -9
  560. package/dist/substrate/runtime/artifact-publisher/index.mjs.map +1 -1
  561. package/dist/substrate/runtime/atomic-write.mjs +97 -32
  562. package/dist/substrate/runtime/atomic-write.mjs.map +1 -1
  563. package/dist/substrate/runtime/cache/index.mjs +3 -0
  564. package/dist/substrate/runtime/cache/schema.mjs +2 -2
  565. package/dist/substrate/runtime/cache/schema.mjs.map +1 -1
  566. package/dist/substrate/runtime/cache/service.mjs +9 -7
  567. package/dist/substrate/runtime/cache/service.mjs.map +1 -1
  568. package/dist/substrate/runtime/capability-sinks/index.d.mts +1 -1
  569. package/dist/substrate/runtime/capability-sinks/index.mjs +3 -0
  570. package/dist/substrate/runtime/capability-sinks/layer.mjs +1 -1
  571. package/dist/substrate/runtime/capability-sinks/service.d.mts +61 -2
  572. package/dist/substrate/runtime/capability-sinks/service.mjs +21 -26
  573. package/dist/substrate/runtime/capability-sinks/service.mjs.map +1 -1
  574. package/dist/substrate/runtime/config-validation.d.mts +1 -13
  575. package/dist/substrate/runtime/config-validation.mjs +2 -91
  576. package/dist/substrate/runtime/config-validation.mjs.map +1 -1
  577. package/dist/substrate/runtime/container-runtime.d.mts +1 -0
  578. package/dist/substrate/runtime/container-runtime.mjs +2 -0
  579. package/dist/substrate/runtime/control-plane/domain.mjs +101 -0
  580. package/dist/substrate/runtime/control-plane/domain.mjs.map +1 -0
  581. package/dist/substrate/runtime/control-plane/service.mjs +7 -0
  582. package/dist/substrate/runtime/control-plane/service.mjs.map +1 -0
  583. package/dist/substrate/runtime/cross-process/command-channel/channel.mjs +46 -19
  584. package/dist/substrate/runtime/cross-process/command-channel/channel.mjs.map +1 -1
  585. package/dist/substrate/runtime/cross-process/command-channel/file-channel.mjs +30 -12
  586. package/dist/substrate/runtime/cross-process/command-channel/file-channel.mjs.map +1 -1
  587. package/dist/substrate/runtime/cross-process/command-channel/index.mjs +5 -0
  588. package/dist/substrate/runtime/cross-process/command-channel/protocol.mjs +11 -2
  589. package/dist/substrate/runtime/cross-process/command-channel/protocol.mjs.map +1 -1
  590. package/dist/substrate/runtime/cross-process/command-channel/runtime-control-lock.mjs +1 -1
  591. package/dist/substrate/runtime/cross-process/index.mjs +11 -0
  592. package/dist/substrate/runtime/cross-process/live-clock.mjs +34 -0
  593. package/dist/substrate/runtime/cross-process/live-clock.mjs.map +1 -0
  594. package/dist/substrate/runtime/cross-process/liveness.mjs +52 -10
  595. package/dist/substrate/runtime/cross-process/liveness.mjs.map +1 -1
  596. package/dist/substrate/runtime/cross-process/lock.d.mts +1 -0
  597. package/dist/substrate/runtime/cross-process/lock.mjs +23 -0
  598. package/dist/substrate/runtime/cross-process/lock.mjs.map +1 -0
  599. package/dist/substrate/runtime/cross-process/reclaim-stale-file.mjs +64 -0
  600. package/dist/substrate/runtime/cross-process/reclaim-stale-file.mjs.map +1 -0
  601. package/dist/substrate/runtime/cross-process/roster.mjs +97 -83
  602. package/dist/substrate/runtime/cross-process/roster.mjs.map +1 -1
  603. package/dist/substrate/runtime/cross-process/self-pid.mjs +8 -0
  604. package/dist/substrate/runtime/cross-process/self-pid.mjs.map +1 -0
  605. package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs +24 -28
  606. package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs.map +1 -1
  607. package/dist/substrate/runtime/cross-process/stack-lock.mjs +41 -20
  608. package/dist/substrate/runtime/cross-process/stack-lock.mjs.map +1 -1
  609. package/dist/substrate/runtime/current-plugin.mjs +2 -2
  610. package/dist/substrate/runtime/current-plugin.mjs.map +1 -1
  611. package/dist/substrate/runtime/errors.mjs +12 -6
  612. package/dist/substrate/runtime/errors.mjs.map +1 -1
  613. package/dist/substrate/runtime/format-unknown-error.mjs +30 -0
  614. package/dist/substrate/runtime/format-unknown-error.mjs.map +1 -0
  615. package/dist/substrate/runtime/host-bind-mount-owner.mjs +10 -0
  616. package/dist/substrate/runtime/host-bind-mount-owner.mjs.map +1 -0
  617. package/dist/substrate/runtime/host-gateway.mjs +20 -0
  618. package/dist/substrate/runtime/host-gateway.mjs.map +1 -0
  619. package/dist/substrate/runtime/host-tree-tar/index.mjs +61 -50
  620. package/dist/substrate/runtime/host-tree-tar/index.mjs.map +1 -1
  621. package/dist/substrate/runtime/http-probe.d.mts +1 -1
  622. package/dist/substrate/runtime/index.mjs +14 -0
  623. package/dist/substrate/runtime/lease-broker/index.d.mts +1 -1
  624. package/dist/substrate/runtime/lease-broker/index.mjs +2 -0
  625. package/dist/substrate/runtime/lease-broker/service.d.mts +1 -64
  626. package/dist/substrate/runtime/lease-broker/service.mjs +1 -1
  627. package/dist/substrate/runtime/lease-broker/service.mjs.map +1 -1
  628. package/dist/substrate/runtime/lifecycle/dep-graph.mjs +22 -3
  629. package/dist/substrate/runtime/lifecycle/dep-graph.mjs.map +1 -1
  630. package/dist/substrate/runtime/lifecycle/index.mjs +9 -0
  631. package/dist/substrate/runtime/lifecycle/lifecycle-fact.mjs.map +1 -1
  632. package/dist/substrate/runtime/lifecycle/plugin-registry.mjs +20 -3
  633. package/dist/substrate/runtime/lifecycle/plugin-registry.mjs.map +1 -1
  634. package/dist/substrate/runtime/lifecycle/selective-restart.mjs +1 -1
  635. package/dist/substrate/runtime/lifecycle/signals.mjs +5 -5
  636. package/dist/substrate/runtime/lifecycle/signals.mjs.map +1 -1
  637. package/dist/substrate/runtime/lifecycle/state-machine.mjs +1 -1
  638. package/dist/substrate/runtime/managed-container.d.mts +19 -1
  639. package/dist/substrate/runtime/managed-container.mjs +20 -1
  640. package/dist/substrate/runtime/managed-container.mjs.map +1 -1
  641. package/dist/substrate/runtime/manifest/index.mjs +3 -0
  642. package/dist/substrate/runtime/manifest/manifest.mjs +15 -11
  643. package/dist/substrate/runtime/manifest/manifest.mjs.map +1 -1
  644. package/dist/substrate/runtime/mode-errors.mjs +20 -0
  645. package/dist/substrate/runtime/mode-errors.mjs.map +1 -0
  646. package/dist/substrate/runtime/observability/cascade-formatter.mjs +9 -13
  647. package/dist/substrate/runtime/observability/cascade-formatter.mjs.map +1 -1
  648. package/dist/substrate/runtime/observability/formatter-registry.mjs +19 -36
  649. package/dist/substrate/runtime/observability/formatter-registry.mjs.map +1 -1
  650. package/dist/substrate/runtime/observability/ignore-with-log.d.mts +1 -0
  651. package/dist/substrate/runtime/observability/ignore-with-log.mjs +17 -0
  652. package/dist/substrate/runtime/observability/ignore-with-log.mjs.map +1 -0
  653. package/dist/substrate/runtime/observability/index.d.mts +1 -1
  654. package/dist/substrate/runtime/observability/index.mjs +13 -0
  655. package/dist/substrate/runtime/observability/log-store.d.mts +1 -0
  656. package/dist/substrate/runtime/observability/log-store.mjs +175 -0
  657. package/dist/substrate/runtime/observability/log-store.mjs.map +1 -0
  658. package/dist/substrate/runtime/observability/logger.d.mts +2 -1
  659. package/dist/substrate/runtime/observability/logger.mjs +5 -9
  660. package/dist/substrate/runtime/observability/logger.mjs.map +1 -1
  661. package/dist/substrate/runtime/observability/output-truncate.mjs +35 -0
  662. package/dist/substrate/runtime/observability/output-truncate.mjs.map +1 -0
  663. package/dist/substrate/runtime/observability/pretty-error.mjs +9 -12
  664. package/dist/substrate/runtime/observability/pretty-error.mjs.map +1 -1
  665. package/dist/substrate/runtime/observability/redaction.d.mts +2 -13
  666. package/dist/substrate/runtime/observability/redaction.mjs +8 -14
  667. package/dist/substrate/runtime/observability/redaction.mjs.map +1 -1
  668. package/dist/substrate/runtime/observability/span-store.d.mts +1 -0
  669. package/dist/substrate/runtime/observability/span-store.mjs +110 -0
  670. package/dist/substrate/runtime/observability/span-store.mjs.map +1 -0
  671. package/dist/substrate/runtime/observability/spans.mjs +14 -14
  672. package/dist/substrate/runtime/observability/spans.mjs.map +1 -1
  673. package/dist/substrate/runtime/observability/subprocess-capture.mjs +1 -1
  674. package/dist/substrate/runtime/passthrough-or-wrap.mjs +33 -0
  675. package/dist/substrate/runtime/passthrough-or-wrap.mjs.map +1 -0
  676. package/dist/substrate/runtime/paths.d.mts +1 -1
  677. package/dist/substrate/runtime/paths.mjs +4 -3
  678. package/dist/substrate/runtime/paths.mjs.map +1 -1
  679. package/dist/substrate/runtime/phase-preserving-produce.mjs +40 -0
  680. package/dist/substrate/runtime/phase-preserving-produce.mjs.map +1 -0
  681. package/dist/substrate/runtime/port-broker/index.mjs +3 -0
  682. package/dist/substrate/runtime/port-broker/service.mjs +170 -126
  683. package/dist/substrate/runtime/port-broker/service.mjs.map +1 -1
  684. package/dist/substrate/runtime/post-acquire-tasks.mjs +1 -1
  685. package/dist/substrate/runtime/post-acquire-tasks.mjs.map +1 -1
  686. package/dist/substrate/runtime/probes.d.mts +7 -5
  687. package/dist/substrate/runtime/probes.mjs +3 -1
  688. package/dist/substrate/runtime/probes.mjs.map +1 -1
  689. package/dist/substrate/runtime/projection/index.mjs +4 -0
  690. package/dist/substrate/runtime/projection/operational-endpoints.mjs +1 -2
  691. package/dist/substrate/runtime/projection/operational-endpoints.mjs.map +1 -1
  692. package/dist/substrate/runtime/projection/persisted.mjs +33 -15
  693. package/dist/substrate/runtime/projection/persisted.mjs.map +1 -1
  694. package/dist/substrate/runtime/projection/state-ref.mjs +26 -2
  695. package/dist/substrate/runtime/projection/state-ref.mjs.map +1 -1
  696. package/dist/substrate/runtime/projection/update.mjs +88 -24
  697. package/dist/substrate/runtime/projection/update.mjs.map +1 -1
  698. package/dist/substrate/runtime/random-suffix.mjs +11 -0
  699. package/dist/substrate/runtime/random-suffix.mjs.map +1 -0
  700. package/dist/substrate/runtime/retry-policy.d.mts +59 -1
  701. package/dist/substrate/runtime/retry-policy.mjs +66 -1
  702. package/dist/substrate/runtime/retry-policy.mjs.map +1 -1
  703. package/dist/substrate/runtime/routed-url.d.mts +1 -0
  704. package/dist/substrate/runtime/routed-url.mjs +79 -0
  705. package/dist/substrate/runtime/routed-url.mjs.map +1 -0
  706. package/dist/substrate/runtime/runtime-decode.d.mts +1 -1
  707. package/dist/substrate/runtime/runtime-decode.mjs.map +1 -1
  708. package/dist/substrate/runtime/scoped-http-server.mjs +2 -3
  709. package/dist/substrate/runtime/scoped-http-server.mjs.map +1 -1
  710. package/dist/substrate/runtime/scoped-multimap/index.mjs +2 -0
  711. package/dist/substrate/runtime/scoped-multimap/service.mjs +52 -0
  712. package/dist/substrate/runtime/scoped-multimap/service.mjs.map +1 -0
  713. package/dist/substrate/runtime/scoped-ref-map/index.mjs +2 -0
  714. package/dist/substrate/runtime/scoped-ref-map/service.mjs +2 -2
  715. package/dist/substrate/runtime/scoped-ref-map/service.mjs.map +1 -1
  716. package/dist/substrate/runtime/stage-and-swap/index.mjs +72 -4
  717. package/dist/substrate/runtime/stage-and-swap/index.mjs.map +1 -1
  718. package/dist/substrate/runtime/state-store/index.d.mts +1 -0
  719. package/dist/substrate/runtime/state-store/index.mjs +3 -0
  720. package/dist/substrate/runtime/state-store/schema.d.mts +1 -0
  721. package/dist/substrate/runtime/state-store/schema.mjs +19 -14
  722. package/dist/substrate/runtime/state-store/schema.mjs.map +1 -1
  723. package/dist/substrate/runtime/state-store/service.d.mts +1 -0
  724. package/dist/substrate/runtime/state-store/service.mjs +145 -0
  725. package/dist/substrate/runtime/state-store/service.mjs.map +1 -0
  726. package/dist/substrate/runtime/strategy-registry/chain-keyed-strategy-for.d.mts +1 -0
  727. package/dist/substrate/runtime/strategy-registry/chain-keyed-strategy-for.mjs +33 -0
  728. package/dist/substrate/runtime/strategy-registry/chain-keyed-strategy-for.mjs.map +1 -0
  729. package/dist/substrate/runtime/strategy-registry/chain-probe-for.mjs +1 -1
  730. package/dist/substrate/runtime/strategy-registry/chain-probe-for.mjs.map +1 -1
  731. package/dist/substrate/runtime/strategy-registry/index.mjs +4 -0
  732. package/dist/substrate/runtime/strategy-registry/service.mjs +19 -33
  733. package/dist/substrate/runtime/strategy-registry/service.mjs.map +1 -1
  734. package/dist/substrate/runtime/subnet-broker.mjs +60 -0
  735. package/dist/substrate/runtime/subnet-broker.mjs.map +1 -0
  736. package/dist/substrate/runtime/sui-execute/index.d.mts +21 -1
  737. package/dist/substrate/runtime/sui-execute/index.mjs +84 -20
  738. package/dist/substrate/runtime/sui-execute/index.mjs.map +1 -1
  739. package/dist/substrate/runtime/sui-execute/sign-and-dispatch.d.mts +1 -0
  740. package/dist/substrate/runtime/sui-execute/sign-and-dispatch.mjs +32 -0
  741. package/dist/substrate/runtime/sui-execute/sign-and-dispatch.mjs.map +1 -0
  742. package/dist/substrate/runtime/sui-ledger/object-ref.mjs +32 -0
  743. package/dist/substrate/runtime/sui-ledger/object-ref.mjs.map +1 -0
  744. package/dist/substrate/runtime/sui-move-build/index.mjs +93 -19
  745. package/dist/substrate/runtime/sui-move-build/index.mjs.map +1 -1
  746. package/dist/substrate/runtime/supervisor/acquire-node.mjs +181 -0
  747. package/dist/substrate/runtime/supervisor/acquire-node.mjs.map +1 -0
  748. package/dist/substrate/runtime/supervisor/background-tasks.mjs +144 -0
  749. package/dist/substrate/runtime/supervisor/background-tasks.mjs.map +1 -0
  750. package/dist/substrate/runtime/supervisor/command-loop.mjs +68 -0
  751. package/dist/substrate/runtime/supervisor/command-loop.mjs.map +1 -0
  752. package/dist/substrate/runtime/supervisor/dispatch-contributions.mjs +151 -0
  753. package/dist/substrate/runtime/supervisor/dispatch-contributions.mjs.map +1 -0
  754. package/dist/substrate/runtime/supervisor/errors.d.mts +1 -0
  755. package/dist/substrate/runtime/supervisor/errors.mjs +9 -0
  756. package/dist/substrate/runtime/supervisor/errors.mjs.map +1 -0
  757. package/dist/substrate/runtime/supervisor/index.d.mts +1 -0
  758. package/dist/substrate/runtime/supervisor/index.mjs +3 -0
  759. package/dist/substrate/runtime/supervisor/shutdown.mjs +51 -0
  760. package/dist/substrate/runtime/supervisor/shutdown.mjs.map +1 -0
  761. package/dist/substrate/runtime/supervisor/start-supervisor.d.mts +1 -0
  762. package/dist/substrate/runtime/supervisor/start-supervisor.mjs +250 -0
  763. package/dist/substrate/runtime/supervisor/start-supervisor.mjs.map +1 -0
  764. package/dist/substrate/runtime/supervisor/state.d.mts +1 -0
  765. package/dist/substrate/runtime/supervisor/state.mjs +22 -0
  766. package/dist/substrate/runtime/supervisor/state.mjs.map +1 -0
  767. package/dist/substrate/runtime/supervisor/teardown.mjs +57 -0
  768. package/dist/substrate/runtime/supervisor/teardown.mjs.map +1 -0
  769. package/dist/substrate/runtime/supervisor/types.d.mts +1 -0
  770. package/dist/substrate/runtime/supervisor/wiring.mjs +133 -0
  771. package/dist/substrate/runtime/supervisor/wiring.mjs.map +1 -0
  772. package/dist/substrate/runtime/typed-env.mjs +8 -0
  773. package/dist/substrate/runtime/typed-env.mjs.map +1 -0
  774. package/dist/substrate/state-store.d.mts +1 -0
  775. package/dist/substrate/versioned-doc-schema.mjs +17 -0
  776. package/dist/substrate/versioned-doc-schema.mjs.map +1 -0
  777. package/dist/substrate/versioned-doc-sync.mjs +94 -0
  778. package/dist/substrate/versioned-doc-sync.mjs.map +1 -0
  779. package/dist/surfaces/cli/command-tree.mjs.map +1 -1
  780. package/dist/surfaces/cli/commands/index.mjs +9 -0
  781. package/dist/surfaces/cli/commands/prune-picker-entry.mjs +13 -0
  782. package/dist/surfaces/cli/commands/prune-picker-entry.mjs.map +1 -0
  783. package/dist/surfaces/cli/commands/prune-picker.mjs +3 -2
  784. package/dist/surfaces/cli/commands/prune-picker.mjs.map +1 -1
  785. package/dist/surfaces/cli/commands/prune.mjs +34 -17
  786. package/dist/surfaces/cli/commands/prune.mjs.map +1 -1
  787. package/dist/surfaces/cli/commands/status.mjs +2 -2
  788. package/dist/surfaces/cli/commands/status.mjs.map +1 -1
  789. package/dist/surfaces/cli/commands/supervisor-presence.mjs +5 -3
  790. package/dist/surfaces/cli/commands/supervisor-presence.mjs.map +1 -1
  791. package/dist/surfaces/cli/commands/wipe.mjs +38 -4
  792. package/dist/surfaces/cli/commands/wipe.mjs.map +1 -1
  793. package/dist/surfaces/cli/errors.mjs +1 -1
  794. package/dist/surfaces/cli/errors.mjs.map +1 -1
  795. package/dist/surfaces/cli/flags.mjs +0 -1
  796. package/dist/surfaces/cli/flags.mjs.map +1 -1
  797. package/dist/surfaces/cli/index.mjs +98 -18
  798. package/dist/surfaces/cli/index.mjs.map +1 -1
  799. package/dist/surfaces/cli/output.mjs +1 -0
  800. package/dist/surfaces/cli/output.mjs.map +1 -1
  801. package/dist/surfaces/cli/sysexits.mjs +2 -1
  802. package/dist/surfaces/cli/sysexits.mjs.map +1 -1
  803. package/dist/surfaces/tui/app.mjs +25 -3
  804. package/dist/surfaces/tui/app.mjs.map +1 -1
  805. package/dist/surfaces/tui/display-derivation.mjs +23 -74
  806. package/dist/surfaces/tui/display-derivation.mjs.map +1 -1
  807. package/dist/surfaces/tui/event-log.mjs +35 -23
  808. package/dist/surfaces/tui/event-log.mjs.map +1 -1
  809. package/dist/surfaces/tui/input.mjs +5 -1
  810. package/dist/surfaces/tui/input.mjs.map +1 -1
  811. package/dist/surfaces/tui/plain-renderer.mjs +70 -34
  812. package/dist/surfaces/tui/plain-renderer.mjs.map +1 -1
  813. package/package.json +24 -4
  814. package/dist/contracts/liveness-classifier.d.mts +0 -19
  815. package/dist/contracts/network-resolver.d.mts +0 -15
  816. package/dist/contracts/network-resolver.mjs +0 -7
  817. package/dist/contracts/network-resolver.mjs.map +0 -1
  818. package/dist/orchestrators/codegen/extras.mjs +0 -16
  819. package/dist/orchestrators/codegen/extras.mjs.map +0 -1
  820. package/dist/plugins/deepbook/routable.mjs +0 -21
  821. package/dist/plugins/deepbook/routable.mjs.map +0 -1
  822. package/dist/plugins/faucet/service.d.mts +0 -20
  823. package/dist/plugins/faucet/strategies/sui-local.d.mts +0 -23
  824. package/dist/plugins/faucet/strategies/sui-local.mjs.map +0 -1
  825. package/dist/plugins/sui/seed-objects.d.mts +0 -18
  826. package/dist/plugins/sui/seed-objects.mjs +0 -25
  827. package/dist/plugins/sui/seed-objects.mjs.map +0 -1
  828. package/dist/runtime/built-in-plugin-layers.mjs.map +0 -1
  829. package/dist/substrate/runtime/context-helpers.mjs +0 -32
  830. package/dist/substrate/runtime/context-helpers.mjs.map +0 -1
  831. package/dist/substrate/runtime/run.mjs.map +0 -1
  832. package/dist/substrate/runtime/strategy-registry/faucet-capability-for.mjs +0 -30
  833. package/dist/substrate/runtime/strategy-registry/faucet-capability-for.mjs.map +0 -1
  834. package/dist/substrate/runtime/supervisor.d.mts +0 -1
  835. package/dist/substrate/runtime/supervisor.mjs +0 -831
  836. package/dist/substrate/runtime/supervisor.mjs.map +0 -1
  837. package/dist/surfaces/cli/commands/doctor-probes.mjs.map +0 -1
  838. /package/dist/{substrate/runtime/strategy-registry/faucet-capability-for.d.mts → plugins/faucet/http.d.mts} +0 -0
@@ -1,6 +1,13 @@
1
+ import { WALLET_AUTH_HEADER, WALLET_BEARER_PREFIX, WALLET_ENDPOINT_KEY, WALLET_ENDPOINT_NAME, WALLET_PROTOCOL_PREFIX, WALLET_TOKEN_FRAGMENT_KEY, WALLET_TOKEN_HEX_LENGTH, WalletHttpPath } from "../../contracts/wallet-protocol.mjs";
2
+ import { ManifestEnvelopeSchema } from "../../substrate/manifest.mjs";
3
+ import { DEFAULT_DISCOVERY_STACK, DEFAULT_DISCOVERY_STATE_DIR, DISCOVERY_ENV, resolveDiscoveryEnv } from "./resolve-discovery-env.mjs";
1
4
  import { ManifestDiscoveryError, ManifestShapeError, NoConventionalRouteError } from "./errors.mjs";
2
- import { DEFAULT_STACK, DEFAULT_STATE_DIR, discoverBuildIntegrationIdentity, discoverManifestPath, readAppName, readAppNameWalkup } from "./discover.mjs";
5
+ import { DEFAULT_STACK, DEFAULT_STATE_DIR, discoverManifestPath, discoverSingleStackManifestPath, readAppName, readAppNameWalkup } from "./discover.mjs";
6
+ import "./manifest-types.mjs";
3
7
  import { EndpointRegistry } from "./endpoint-registry.mjs";
4
8
  import { CONSUMER_MANIFEST_VERSION, manifestEnvelopeFromStackContext, readStackContext } from "./read-stack-context.mjs";
5
9
  import { coldStartUrl, conventionalRouteHost, conventionalRouteUrl, conventionalRoutesFromHints, tryColdStartUrl } from "./cold-start-url.mjs";
6
- export { CONSUMER_MANIFEST_VERSION, DEFAULT_STACK, DEFAULT_STATE_DIR, EndpointRegistry, ManifestDiscoveryError, ManifestShapeError, NoConventionalRouteError, coldStartUrl, conventionalRouteHost, conventionalRouteUrl, conventionalRoutesFromHints, discoverBuildIntegrationIdentity, discoverManifestPath, manifestEnvelopeFromStackContext, readAppName, readAppNameWalkup, readStackContext, tryColdStartUrl };
10
+ import "./wallet-paths.mjs";
11
+ import { BUILT_IN_CONVENTIONAL_HINTS, BUILT_IN_ENDPOINT_ALIASES, DEFAULT_ROUTER_ENTRYPOINT_PORT, builtInConventionalRoutes, resolveBuiltInEndpointAlias } from "./conventional-routes.mjs";
12
+ import { PLAYWRIGHT_STACK_CONTEXT_SLOT_KEY } from "./playwright-stack-context-slot.mjs";
13
+ export { BUILT_IN_CONVENTIONAL_HINTS, BUILT_IN_ENDPOINT_ALIASES, CONSUMER_MANIFEST_VERSION, DEFAULT_DISCOVERY_STACK, DEFAULT_DISCOVERY_STATE_DIR, DEFAULT_ROUTER_ENTRYPOINT_PORT, DEFAULT_STACK, DEFAULT_STATE_DIR, DISCOVERY_ENV, EndpointRegistry, ManifestDiscoveryError, ManifestEnvelopeSchema, ManifestShapeError, NoConventionalRouteError, PLAYWRIGHT_STACK_CONTEXT_SLOT_KEY, WALLET_AUTH_HEADER, WALLET_BEARER_PREFIX, WALLET_ENDPOINT_KEY, WALLET_ENDPOINT_NAME, WALLET_PROTOCOL_PREFIX, WALLET_TOKEN_FRAGMENT_KEY, WALLET_TOKEN_HEX_LENGTH, WalletHttpPath, builtInConventionalRoutes, coldStartUrl, conventionalRouteHost, conventionalRouteUrl, conventionalRoutesFromHints, discoverManifestPath, discoverSingleStackManifestPath, manifestEnvelopeFromStackContext, readAppName, readAppNameWalkup, readStackContext, resolveBuiltInEndpointAlias, resolveDiscoveryEnv, tryColdStartUrl };
@@ -0,0 +1,2 @@
1
+ import { EndpointEntry, ManifestEnvelope, ManifestEnvelopeSchema } from "../../substrate/manifest.mjs";
2
+ import { decodeUnknownSync, parseJsonTextSync } from "../../substrate/runtime/runtime-decode.mjs";
@@ -0,0 +1,3 @@
1
+ import "../../substrate/runtime/runtime-decode.mjs";
2
+ import "../../substrate/manifest.mjs";
3
+ export {};
@@ -0,0 +1,29 @@
1
+ //#region src/build-integrations/runtime/playwright-stack-context-slot.d.ts
2
+ /** The literal property name on `globalThis` that global-setup writes
3
+ * the prewarmed stack fixture to. In-spec helpers read from here when
4
+ * present; absent => global-setup didn't run (user opted out via
5
+ * `globalSetup: null`). */
6
+ declare const PLAYWRIGHT_STACK_CONTEXT_SLOT_KEY: "__devstackPlaywrightStackContext__";
7
+ /** Prewarmed stack fixture shape. Mirrors what global-setup builds from
8
+ * the manifest read; in-spec helpers consume it as a frozen view.
9
+ *
10
+ * `generation` is a monotonically-increasing token stamped each time
11
+ * global-setup populates the slot. Downstream readers can compare
12
+ * against a previously-cached generation to detect a stale view (e.g.
13
+ * Playwright retried with `reuseExistingServer:false`, which re-runs
14
+ * global-setup; helpers caching the fixture across spec files would
15
+ * otherwise hold a fixture pointing at a torn-down stack). */
16
+ interface PlaywrightStackFixture {
17
+ readonly endpoints: Readonly<Record<string, string>>;
18
+ readonly walletEndpoint: string | null;
19
+ readonly manifestPath: string;
20
+ readonly stack: string;
21
+ readonly app: string;
22
+ readonly generation: number;
23
+ }
24
+ declare global {
25
+ var __devstackPlaywrightStackContext__: PlaywrightStackFixture | undefined;
26
+ }
27
+ //#endregion
28
+ export { PLAYWRIGHT_STACK_CONTEXT_SLOT_KEY, PlaywrightStackFixture };
29
+ //# sourceMappingURL=playwright-stack-context-slot.d.mts.map
@@ -0,0 +1,10 @@
1
+ //#region src/build-integrations/runtime/playwright-stack-context-slot.ts
2
+ /** The literal property name on `globalThis` that global-setup writes
3
+ * the prewarmed stack fixture to. In-spec helpers read from here when
4
+ * present; absent => global-setup didn't run (user opted out via
5
+ * `globalSetup: null`). */
6
+ const PLAYWRIGHT_STACK_CONTEXT_SLOT_KEY = "__devstackPlaywrightStackContext__";
7
+ //#endregion
8
+ export { PLAYWRIGHT_STACK_CONTEXT_SLOT_KEY };
9
+
10
+ //# sourceMappingURL=playwright-stack-context-slot.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"playwright-stack-context-slot.mjs","names":[],"sources":["../../../src/build-integrations/runtime/playwright-stack-context-slot.ts"],"sourcesContent":["// Typed contract for the `globalThis.__devstackPlaywrightStackContext__`\n// fixture slot Playwright global-setup populates.\n//\n// Sibling to `dapp-kit-slot.ts` — one slot ownership per consumer keeps\n// the typed `declare global` block minimal and lets the playwright\n// surface import only what it needs.\n//\n// The slot's NAME is part of the cross-process contract: in-spec helpers\n// (`wallet-context.ts`, fixture readers) look up `globalThis[KEY]` to\n// avoid repeating the manifest disk read in every worker. Renames cascade\n// through every consumer.\n//\n// This module evaluates in Node build-integration callers only — Playwright\n// global-setup runs server-side. No `node:*` imports here so it stays\n// importable from any TS context.\n\n/** The literal property name on `globalThis` that global-setup writes\n * the prewarmed stack fixture to. In-spec helpers read from here when\n * present; absent => global-setup didn't run (user opted out via\n * `globalSetup: null`). */\nexport const PLAYWRIGHT_STACK_CONTEXT_SLOT_KEY = '__devstackPlaywrightStackContext__' as const;\n\n/** Prewarmed stack fixture shape. Mirrors what global-setup builds from\n * the manifest read; in-spec helpers consume it as a frozen view.\n *\n * `generation` is a monotonically-increasing token stamped each time\n * global-setup populates the slot. Downstream readers can compare\n * against a previously-cached generation to detect a stale view (e.g.\n * Playwright retried with `reuseExistingServer:false`, which re-runs\n * global-setup; helpers caching the fixture across spec files would\n * otherwise hold a fixture pointing at a torn-down stack). */\nexport interface PlaywrightStackFixture {\n\treadonly endpoints: Readonly<Record<string, string>>;\n\treadonly walletEndpoint: string | null;\n\treadonly manifestPath: string;\n\treadonly stack: string;\n\treadonly app: string;\n\treadonly generation: number;\n}\n\ndeclare global {\n\t// eslint-disable-next-line no-var\n\tvar __devstackPlaywrightStackContext__: PlaywrightStackFixture | undefined;\n}\n"],"mappings":";;;;;AAoBA,MAAa,oCAAoC"}
@@ -1,5 +1,5 @@
1
- import { ManifestEnvelope } from "../../substrate/manifest.mjs";
2
1
  import { DiscoverManifestPathOptions } from "./discover.mjs";
2
+ import { ManifestEnvelope } from "../../substrate/manifest.mjs";
3
3
  import { StackContext } from "./stack-context.mjs";
4
4
 
5
5
  //#region src/build-integrations/runtime/read-stack-context.d.ts
@@ -1,8 +1,9 @@
1
+ import { decodeUnknownSync, parseJsonTextSync } from "../../substrate/runtime/runtime-decode.mjs";
1
2
  import { ManifestEnvelopeSchema } from "../../substrate/manifest.mjs";
2
3
  import { ManifestDiscoveryError, ManifestShapeError } from "./errors.mjs";
3
4
  import { discoverManifestPath } from "./discover.mjs";
5
+ import "./manifest-types.mjs";
4
6
  import { EndpointRegistry } from "./endpoint-registry.mjs";
5
- import { Schema } from "effect";
6
7
  import { readFileSync } from "node:fs";
7
8
  //#region src/build-integrations/runtime/read-stack-context.ts
8
9
  /** Pinned manifest-envelope version this consumer build was compiled
@@ -12,7 +13,6 @@ import { readFileSync } from "node:fs";
12
13
  * bumps, the consumer must bump in lockstep — the version mismatch
13
14
  * error message names the recovery recipe. */
14
15
  const CONSUMER_MANIFEST_VERSION = 1;
15
- const decodeEnvelope = Schema.decodeUnknownSync(ManifestEnvelopeSchema);
16
16
  const resolveManifestPath = (opts) => {
17
17
  const override = opts.manifestPath ?? opts.override;
18
18
  const resolved = discoverManifestPath({
@@ -29,7 +29,10 @@ const resolveManifestPath = (opts) => {
29
29
  const parseAndDecode = (raw, manifestPath) => {
30
30
  let parsed;
31
31
  try {
32
- parsed = JSON.parse(raw);
32
+ parsed = parseJsonTextSync(raw, {
33
+ source: manifestPath,
34
+ mkError: (issue) => issue
35
+ });
33
36
  } catch (cause) {
34
37
  throw new ManifestShapeError({
35
38
  phase: "parse",
@@ -40,7 +43,10 @@ const parseAndDecode = (raw, manifestPath) => {
40
43
  }
41
44
  let decoded;
42
45
  try {
43
- decoded = decodeEnvelope(parsed);
46
+ decoded = decodeUnknownSync(ManifestEnvelopeSchema, parsed, {
47
+ source: manifestPath,
48
+ mkError: (issue) => issue
49
+ });
44
50
  } catch (cause) {
45
51
  throw new ManifestShapeError({
46
52
  phase: "shape",
@@ -1 +1 @@
1
- {"version":3,"file":"read-stack-context.mjs","names":[],"sources":["../../../src/build-integrations/runtime/read-stack-context.ts"],"sourcesContent":["// Sync manifest reader + projection.\n//\n// Read-side L5 surface. Loads the manifest envelope from disk,\n// validates it via the substrate's `ManifestEnvelopeSchema`, and\n// projects it to a plain TS `StackContext` consumer code can use\n// without depending on Effect or Schema.\n//\n// Sync — apps and Playwright config-load are sync surfaces. The cost\n// is one `readFileSync` and one synchronous Schema decode.\n//\n// Error contract:\n//\n// - Missing manifest → `ManifestDiscoveryError` (with `phase`).\n// - Manifest exists but `JSON.parse` rejected the bytes →\n// `ManifestShapeError(phase: 'parse')`.\n// - Manifest parsed but failed schema validation →\n// `ManifestShapeError(phase: 'shape')`.\n// - Manifest decoded but `manifestVersion` doesn't match the\n// consumer's pinned `CURRENT_MANIFEST_VERSION` →\n// `ManifestShapeError(phase: 'version')`.\n//\n// All three are plain `Error` subclasses (see `./errors.ts`) so the\n// caller's try / catch / instanceof flow works without importing\n// Effect. The CLI / codegen surfaces can still wrap this function in\n// `Effect.try` to lift the failure channel.\n//\n// Implementation detail: we use Effect Schema INTERNALLY for the\n// envelope decode (`ManifestEnvelopeSchema` lives in the substrate),\n// but the API surface is plain TS. Schema is a validation tool here,\n// not an exposed type.\n\nimport { Schema } from 'effect';\nimport { readFileSync } from 'node:fs';\n\nimport { ManifestEnvelopeSchema, type ManifestEnvelope } from '../../substrate/manifest.ts';\nimport { discoverManifestPath, type DiscoverManifestPathOptions } from './discover.ts';\nimport { EndpointRegistry } from './endpoint-registry.ts';\nimport { ManifestDiscoveryError, ManifestShapeError } from './errors.ts';\nimport type { ResolvedEndpoint, StackContext } from './stack-context.ts';\n\n/** Pinned manifest-envelope version this consumer build was compiled\n * against. Must match the substrate's `CURRENT_MANIFEST_VERSION`\n * (kept as a literal here so the read path doesn't reach into the\n * substrate's writer module just for a number). When the substrate\n * bumps, the consumer must bump in lockstep — the version mismatch\n * error message names the recovery recipe. */\nexport const CONSUMER_MANIFEST_VERSION = 1 as const;\n\nexport interface ReadStackContextOptions extends DiscoverManifestPathOptions {\n\t/** Caller-supplied explicit manifest path. When set, bypasses the\n\t * walk-up (still existence-checked). Named `manifestPath` for\n\t * ergonomic parity with the CLI's `--manifest-path` flag. */\n\treadonly manifestPath?: string;\n}\n\n// Pre-build the decoder so each read isn't paying the Schema-build\n// cost. `decodeUnknownSync` throws on shape failure; we catch + rewrap.\nconst decodeEnvelope = Schema.decodeUnknownSync(ManifestEnvelopeSchema);\n\nconst resolveManifestPath = (opts: ReadStackContextOptions): string => {\n\tconst override = opts.manifestPath ?? opts.override;\n\tconst resolved = discoverManifestPath({\n\t\t...opts,\n\t\t...(override !== undefined ? { override } : {}),\n\t\trequired: true,\n\t});\n\t// `required: true` throws on miss; this branch is unreachable but\n\t// keeps the type narrow without an `!`.\n\tif (resolved === undefined) {\n\t\tthrow new ManifestDiscoveryError({\n\t\t\tphase: 'required-missing',\n\t\t\tmessage: '[devstack] manifest discovery returned undefined despite required: true',\n\t\t});\n\t}\n\treturn resolved;\n};\n\nconst parseAndDecode = (raw: string, manifestPath: string): ManifestEnvelope => {\n\tlet parsed: unknown;\n\ttry {\n\t\tparsed = JSON.parse(raw);\n\t} catch (cause) {\n\t\tthrow new ManifestShapeError({\n\t\t\tphase: 'parse',\n\t\t\tpath: manifestPath,\n\t\t\tmessage:\n\t\t\t\t`[devstack] manifest at ${manifestPath} is not valid JSON ` +\n\t\t\t\t`(truncation or hand-edit). ` +\n\t\t\t\t`RECOVERY: \\`rm ${manifestPath} && devstack up\\` to regenerate.`,\n\t\t\tcause,\n\t\t});\n\t}\n\tlet decoded: ManifestEnvelope;\n\ttry {\n\t\tdecoded = decodeEnvelope(parsed) as ManifestEnvelope;\n\t} catch (cause) {\n\t\tthrow new ManifestShapeError({\n\t\t\tphase: 'shape',\n\t\t\tpath: manifestPath,\n\t\t\tmessage:\n\t\t\t\t`[devstack] manifest at ${manifestPath} does not match the manifest envelope schema ` +\n\t\t\t\t`(stale shape or hand-edit). ` +\n\t\t\t\t`RECOVERY: \\`rm ${manifestPath} && devstack up\\` to regenerate.`,\n\t\t\tcause,\n\t\t});\n\t}\n\tif (decoded.manifestVersion !== CONSUMER_MANIFEST_VERSION) {\n\t\tthrow new ManifestShapeError({\n\t\t\tphase: 'version',\n\t\t\tpath: manifestPath,\n\t\t\tmessage:\n\t\t\t\t`[devstack] manifest at ${manifestPath} has version ${decoded.manifestVersion}, ` +\n\t\t\t\t`but this consumer was built for version ${CONSUMER_MANIFEST_VERSION}. ` +\n\t\t\t\t`RECOVERY: upgrade your devstack consumer dependency, or \\`rm ${manifestPath} && devstack up\\` ` +\n\t\t\t\t`to regenerate against the new version.`,\n\t\t});\n\t}\n\treturn decoded;\n};\n\n/** Project the decoded envelope to a plain `StackContext`. */\nconst project = (envelope: ManifestEnvelope, manifestPath: string): StackContext => {\n\tconst entries: ResolvedEndpoint[] = [];\n\tfor (const raw of Object.values(envelope.endpoints)) {\n\t\tentries.push({\n\t\t\tname: raw.name,\n\t\t\turl: raw.url,\n\t\t\tdisplayUrl: raw.displayUrl,\n\t\t\twireProtocol: raw.wireProtocol,\n\t\t\tpluginKey: raw.pluginKey as string,\n\t\t\tendpointKey: raw.endpointKey as string,\n\t\t});\n\t}\n\treturn {\n\t\tidentity: {\n\t\t\tapp: envelope.identity.app,\n\t\t\tstack: envelope.identity.stack,\n\t\t\tchain: envelope.identity.chain,\n\t\t},\n\t\tmanifestPath,\n\t\tmanifestVersion: envelope.manifestVersion,\n\t\tendpoints: new EndpointRegistry(entries),\n\t\tservices: envelope.services,\n\t\textras: envelope.extras,\n\t};\n};\n\n/** Reconstruct the manifest envelope from the runtime projection.\n * Integration adapters that preserve their older envelope-shaped\n * surfaces use this instead of duplicating endpoint-registry\n * projection logic. */\nexport const manifestEnvelopeFromStackContext = (ctx: StackContext): ManifestEnvelope => ({\n\tidentity: ctx.identity as ManifestEnvelope['identity'],\n\tmanifestVersion: ctx.manifestVersion,\n\tservices: ctx.services,\n\tendpoints: Object.fromEntries(\n\t\tctx.endpoints.all().map((e) => [\n\t\t\te.endpointKey,\n\t\t\t{\n\t\t\t\tname: e.name,\n\t\t\t\turl: e.url,\n\t\t\t\tdisplayUrl: e.displayUrl,\n\t\t\t\twireProtocol: e.wireProtocol,\n\t\t\t\tpluginKey: e.pluginKey as never,\n\t\t\t\tendpointKey: e.endpointKey as never,\n\t\t\t},\n\t\t]),\n\t) as ManifestEnvelope['endpoints'],\n\textras: ctx.extras,\n});\n\n/**\n * Sync read + decode + project. Throws `ManifestDiscoveryError` (no\n * manifest located) or `ManifestShapeError` (manifest found but\n * malformed / wrong version).\n *\n * Used by:\n * - Apps' generated `stack-handle.ts` at startup.\n * - Playwright config-load (`baseURL`, `webServer.url`).\n * - CLI surfaces that prefer sync-then-Effect.try over a native\n * Effect read.\n */\nexport const readStackContext = (opts: ReadStackContextOptions = {}): StackContext => {\n\tconst manifestPath = resolveManifestPath(opts);\n\tlet raw: string;\n\ttry {\n\t\traw = readFileSync(manifestPath, 'utf8');\n\t} catch (cause) {\n\t\t// File existed at discovery time but is unreadable now — race\n\t\t// with the supervisor's atomic-write would be a parse failure on\n\t\t// the next read; a true EACCES / disk-disconnect surfaces here.\n\t\tthrow new ManifestShapeError({\n\t\t\tphase: 'parse',\n\t\t\tpath: manifestPath,\n\t\t\tmessage: `[devstack] failed to read manifest at ${manifestPath}: ${String(cause)}`,\n\t\t\tcause,\n\t\t});\n\t}\n\tconst envelope = parseAndDecode(raw, manifestPath);\n\treturn project(envelope, manifestPath);\n};\n"],"mappings":";;;;;;;;;;;;;AA8CA,MAAa,4BAA4B;AAWzC,MAAM,iBAAiB,OAAO,kBAAkB,uBAAuB;AAEvE,MAAM,uBAAuB,SAA0C;CACtE,MAAM,WAAW,KAAK,gBAAgB,KAAK;CAC3C,MAAM,WAAW,qBAAqB;EACrC,GAAG;EACH,GAAI,aAAa,KAAA,IAAY,EAAE,UAAU,GAAG,EAAE;EAC9C,UAAU;EACV,CAAC;AAGF,KAAI,aAAa,KAAA,EAChB,OAAM,IAAI,uBAAuB;EAChC,OAAO;EACP,SAAS;EACT,CAAC;AAEH,QAAO;;AAGR,MAAM,kBAAkB,KAAa,iBAA2C;CAC/E,IAAI;AACJ,KAAI;AACH,WAAS,KAAK,MAAM,IAAI;UAChB,OAAO;AACf,QAAM,IAAI,mBAAmB;GAC5B,OAAO;GACP,MAAM;GACN,SACC,0BAA0B,aAAa,+DAErB,aAAa;GAChC;GACA,CAAC;;CAEH,IAAI;AACJ,KAAI;AACH,YAAU,eAAe,OAAO;UACxB,OAAO;AACf,QAAM,IAAI,mBAAmB;GAC5B,OAAO;GACP,MAAM;GACN,SACC,0BAA0B,aAAa,0FAErB,aAAa;GAChC;GACA,CAAC;;AAEH,KAAI,QAAQ,oBAAA,EACX,OAAM,IAAI,mBAAmB;EAC5B,OAAO;EACP,MAAM;EACN,SACC,0BAA0B,aAAa,eAAe,QAAQ,gBAAgB,4GAEd,aAAa;EAE9E,CAAC;AAEH,QAAO;;;AAIR,MAAM,WAAW,UAA4B,iBAAuC;CACnF,MAAM,UAA8B,EAAE;AACtC,MAAK,MAAM,OAAO,OAAO,OAAO,SAAS,UAAU,CAClD,SAAQ,KAAK;EACZ,MAAM,IAAI;EACV,KAAK,IAAI;EACT,YAAY,IAAI;EAChB,cAAc,IAAI;EAClB,WAAW,IAAI;EACf,aAAa,IAAI;EACjB,CAAC;AAEH,QAAO;EACN,UAAU;GACT,KAAK,SAAS,SAAS;GACvB,OAAO,SAAS,SAAS;GACzB,OAAO,SAAS,SAAS;GACzB;EACD;EACA,iBAAiB,SAAS;EAC1B,WAAW,IAAI,iBAAiB,QAAQ;EACxC,UAAU,SAAS;EACnB,QAAQ,SAAS;EACjB;;;;;;AAOF,MAAa,oCAAoC,SAAyC;CACzF,UAAU,IAAI;CACd,iBAAiB,IAAI;CACrB,UAAU,IAAI;CACd,WAAW,OAAO,YACjB,IAAI,UAAU,KAAK,CAAC,KAAK,MAAM,CAC9B,EAAE,aACF;EACC,MAAM,EAAE;EACR,KAAK,EAAE;EACP,YAAY,EAAE;EACd,cAAc,EAAE;EAChB,WAAW,EAAE;EACb,aAAa,EAAE;EACf,CACD,CAAC,CACF;CACD,QAAQ,IAAI;CACZ;;;;;;;;;;;;AAaD,MAAa,oBAAoB,OAAgC,EAAE,KAAmB;CACrF,MAAM,eAAe,oBAAoB,KAAK;CAC9C,IAAI;AACJ,KAAI;AACH,QAAM,aAAa,cAAc,OAAO;UAChC,OAAO;AAIf,QAAM,IAAI,mBAAmB;GAC5B,OAAO;GACP,MAAM;GACN,SAAS,yCAAyC,aAAa,IAAI,OAAO,MAAM;GAChF;GACA,CAAC;;AAGH,QAAO,QADU,eAAe,KAAK,aACd,EAAE,aAAa"}
1
+ {"version":3,"file":"read-stack-context.mjs","names":[],"sources":["../../../src/build-integrations/runtime/read-stack-context.ts"],"sourcesContent":["// Sync manifest reader + projection.\n//\n// Read-side L5 surface. Loads the manifest envelope from disk,\n// validates it via the substrate's `ManifestEnvelopeSchema`, and\n// projects it to a plain TS `StackContext` consumer code can use\n// without depending on Effect or Schema.\n//\n// Sync — apps and Playwright config-load are sync surfaces. The cost\n// is one `readFileSync` and one synchronous Schema decode.\n//\n// Error contract:\n//\n// - Missing manifest → `ManifestDiscoveryError` (with `phase`).\n// - Manifest exists but `JSON.parse` rejected the bytes →\n// `ManifestShapeError(phase: 'parse')`.\n// - Manifest parsed but failed schema validation →\n// `ManifestShapeError(phase: 'shape')`.\n// - Manifest decoded but `manifestVersion` doesn't match the\n// consumer's pinned `CURRENT_MANIFEST_VERSION` →\n// `ManifestShapeError(phase: 'version')`.\n//\n// All three are plain `Error` subclasses (see `./errors.ts`) so the\n// caller's try / catch / instanceof flow works without importing\n// Effect. The CLI / codegen surfaces can still wrap this function in\n// `Effect.try` to lift the failure channel.\n//\n// Implementation detail: we use Effect Schema INTERNALLY for the\n// envelope decode (`ManifestEnvelopeSchema` lives in the substrate),\n// but the API surface is plain TS. Schema is a validation tool here,\n// not an exposed type.\n\nimport { readFileSync } from 'node:fs';\n\nimport {\n\tdecodeUnknownSync,\n\tManifestEnvelopeSchema,\n\tparseJsonTextSync,\n\ttype ManifestEnvelope,\n\ttype EndpointEntry,\n} from './manifest-types.ts';\nimport { discoverManifestPath, type DiscoverManifestPathOptions } from './discover.ts';\nimport { EndpointRegistry } from './endpoint-registry.ts';\nimport { ManifestDiscoveryError, ManifestShapeError } from './errors.ts';\nimport type { ResolvedEndpoint, StackContext } from './stack-context.ts';\n\n/** Pinned manifest-envelope version this consumer build was compiled\n * against. Must match the substrate's `CURRENT_MANIFEST_VERSION`\n * (kept as a literal here so the read path doesn't reach into the\n * substrate's writer module just for a number). When the substrate\n * bumps, the consumer must bump in lockstep — the version mismatch\n * error message names the recovery recipe. */\nexport const CONSUMER_MANIFEST_VERSION = 1 as const;\n\nexport interface ReadStackContextOptions extends DiscoverManifestPathOptions {\n\t/** Caller-supplied explicit manifest path. When set, bypasses the\n\t * walk-up (still existence-checked). Named `manifestPath` for\n\t * ergonomic parity with the CLI's `--manifest-path` flag. */\n\treadonly manifestPath?: string;\n}\n\nconst resolveManifestPath = (opts: ReadStackContextOptions): string => {\n\tconst override = opts.manifestPath ?? opts.override;\n\tconst resolved = discoverManifestPath({\n\t\t...opts,\n\t\t...(override !== undefined ? { override } : {}),\n\t\trequired: true,\n\t});\n\t// `required: true` throws on miss; this branch is unreachable but\n\t// keeps the type narrow without an `!`.\n\tif (resolved === undefined) {\n\t\tthrow new ManifestDiscoveryError({\n\t\t\tphase: 'required-missing',\n\t\t\tmessage: '[devstack] manifest discovery returned undefined despite required: true',\n\t\t});\n\t}\n\treturn resolved;\n};\n\nconst parseAndDecode = (raw: string, manifestPath: string): ManifestEnvelope => {\n\tlet parsed: unknown;\n\ttry {\n\t\tparsed = parseJsonTextSync(raw, {\n\t\t\tsource: manifestPath,\n\t\t\tmkError: (issue) => issue,\n\t\t});\n\t} catch (cause) {\n\t\tthrow new ManifestShapeError({\n\t\t\tphase: 'parse',\n\t\t\tpath: manifestPath,\n\t\t\tmessage:\n\t\t\t\t`[devstack] manifest at ${manifestPath} is not valid JSON ` +\n\t\t\t\t`(truncation or hand-edit). ` +\n\t\t\t\t`RECOVERY: \\`rm ${manifestPath} && devstack up\\` to regenerate.`,\n\t\t\tcause,\n\t\t});\n\t}\n\tlet decoded: ManifestEnvelope;\n\ttry {\n\t\tdecoded = decodeUnknownSync(ManifestEnvelopeSchema, parsed, {\n\t\t\tsource: manifestPath,\n\t\t\tmkError: (issue) => issue,\n\t\t});\n\t} catch (cause) {\n\t\tthrow new ManifestShapeError({\n\t\t\tphase: 'shape',\n\t\t\tpath: manifestPath,\n\t\t\tmessage:\n\t\t\t\t`[devstack] manifest at ${manifestPath} does not match the manifest envelope schema ` +\n\t\t\t\t`(stale shape or hand-edit). ` +\n\t\t\t\t`RECOVERY: \\`rm ${manifestPath} && devstack up\\` to regenerate.`,\n\t\t\tcause,\n\t\t});\n\t}\n\tif (decoded.manifestVersion !== CONSUMER_MANIFEST_VERSION) {\n\t\tthrow new ManifestShapeError({\n\t\t\tphase: 'version',\n\t\t\tpath: manifestPath,\n\t\t\tmessage:\n\t\t\t\t`[devstack] manifest at ${manifestPath} has version ${decoded.manifestVersion}, ` +\n\t\t\t\t`but this consumer was built for version ${CONSUMER_MANIFEST_VERSION}. ` +\n\t\t\t\t`RECOVERY: upgrade your devstack consumer dependency, or \\`rm ${manifestPath} && devstack up\\` ` +\n\t\t\t\t`to regenerate against the new version.`,\n\t\t});\n\t}\n\treturn decoded;\n};\n\n/** Project the decoded envelope to a plain `StackContext`. */\nconst project = (envelope: ManifestEnvelope, manifestPath: string): StackContext => {\n\tconst entries: ResolvedEndpoint[] = [];\n\tfor (const raw of Object.values(envelope.endpoints)) {\n\t\tentries.push({\n\t\t\tname: raw.name,\n\t\t\turl: raw.url,\n\t\t\tdisplayUrl: raw.displayUrl,\n\t\t\twireProtocol: raw.wireProtocol,\n\t\t\tpluginKey: raw.pluginKey,\n\t\t\tendpointKey: raw.endpointKey,\n\t\t});\n\t}\n\treturn {\n\t\tidentity: {\n\t\t\tapp: envelope.identity.app,\n\t\t\tstack: envelope.identity.stack,\n\t\t\tchain: envelope.identity.chain,\n\t\t},\n\t\tmanifestPath,\n\t\tmanifestVersion: envelope.manifestVersion,\n\t\tendpoints: new EndpointRegistry(entries),\n\t\tservices: envelope.services,\n\t\textras: envelope.extras,\n\t};\n};\n\n/** Reconstruct the manifest envelope from the runtime projection.\n * Integration adapters that preserve their older envelope-shaped\n * surfaces use this instead of duplicating endpoint-registry\n * projection logic. */\nexport const manifestEnvelopeFromStackContext = (ctx: StackContext): ManifestEnvelope => ({\n\tidentity: ctx.identity,\n\tmanifestVersion: ctx.manifestVersion,\n\tservices: ctx.services,\n\tendpoints: Object.fromEntries(\n\t\tctx.endpoints.all().map((e): [string, EndpointEntry] => [\n\t\t\te.endpointKey,\n\t\t\t{\n\t\t\t\tname: e.name,\n\t\t\t\turl: e.url,\n\t\t\t\tdisplayUrl: e.displayUrl,\n\t\t\t\twireProtocol: e.wireProtocol,\n\t\t\t\tpluginKey: e.pluginKey,\n\t\t\t\tendpointKey: e.endpointKey,\n\t\t\t},\n\t\t]),\n\t),\n\textras: ctx.extras,\n});\n\n/**\n * Sync read + decode + project. Throws `ManifestDiscoveryError` (no\n * manifest located) or `ManifestShapeError` (manifest found but\n * malformed / wrong version).\n *\n * Used by:\n * - Apps' generated `stack-handle.ts` at startup.\n * - Playwright config-load (`baseURL`, `webServer.url`).\n * - CLI surfaces that prefer sync-then-Effect.try over a native\n * Effect read.\n */\nexport const readStackContext = (opts: ReadStackContextOptions = {}): StackContext => {\n\tconst manifestPath = resolveManifestPath(opts);\n\tlet raw: string;\n\ttry {\n\t\traw = readFileSync(manifestPath, 'utf8');\n\t} catch (cause) {\n\t\t// File existed at discovery time but is unreadable now — race\n\t\t// with the supervisor's atomic-write would be a parse failure on\n\t\t// the next read; a true EACCES / disk-disconnect surfaces here.\n\t\tthrow new ManifestShapeError({\n\t\t\tphase: 'parse',\n\t\t\tpath: manifestPath,\n\t\t\tmessage: `[devstack] failed to read manifest at ${manifestPath}: ${String(cause)}`,\n\t\t\tcause,\n\t\t});\n\t}\n\tconst envelope = parseAndDecode(raw, manifestPath);\n\treturn project(envelope, manifestPath);\n};\n"],"mappings":";;;;;;;;;;;;;;AAmDA,MAAa,4BAA4B;AASzC,MAAM,uBAAuB,SAA0C;CACtE,MAAM,WAAW,KAAK,gBAAgB,KAAK;CAC3C,MAAM,WAAW,qBAAqB;EACrC,GAAG;EACH,GAAI,aAAa,KAAA,IAAY,EAAE,UAAU,GAAG,EAAE;EAC9C,UAAU;EACV,CAAC;AAGF,KAAI,aAAa,KAAA,EAChB,OAAM,IAAI,uBAAuB;EAChC,OAAO;EACP,SAAS;EACT,CAAC;AAEH,QAAO;;AAGR,MAAM,kBAAkB,KAAa,iBAA2C;CAC/E,IAAI;AACJ,KAAI;AACH,WAAS,kBAAkB,KAAK;GAC/B,QAAQ;GACR,UAAU,UAAU;GACpB,CAAC;UACM,OAAO;AACf,QAAM,IAAI,mBAAmB;GAC5B,OAAO;GACP,MAAM;GACN,SACC,0BAA0B,aAAa,+DAErB,aAAa;GAChC;GACA,CAAC;;CAEH,IAAI;AACJ,KAAI;AACH,YAAU,kBAAkB,wBAAwB,QAAQ;GAC3D,QAAQ;GACR,UAAU,UAAU;GACpB,CAAC;UACM,OAAO;AACf,QAAM,IAAI,mBAAmB;GAC5B,OAAO;GACP,MAAM;GACN,SACC,0BAA0B,aAAa,0FAErB,aAAa;GAChC;GACA,CAAC;;AAEH,KAAI,QAAQ,oBAAA,EACX,OAAM,IAAI,mBAAmB;EAC5B,OAAO;EACP,MAAM;EACN,SACC,0BAA0B,aAAa,eAAe,QAAQ,gBAAgB,4GAEd,aAAa;EAE9E,CAAC;AAEH,QAAO;;;AAIR,MAAM,WAAW,UAA4B,iBAAuC;CACnF,MAAM,UAA8B,EAAE;AACtC,MAAK,MAAM,OAAO,OAAO,OAAO,SAAS,UAAU,CAClD,SAAQ,KAAK;EACZ,MAAM,IAAI;EACV,KAAK,IAAI;EACT,YAAY,IAAI;EAChB,cAAc,IAAI;EAClB,WAAW,IAAI;EACf,aAAa,IAAI;EACjB,CAAC;AAEH,QAAO;EACN,UAAU;GACT,KAAK,SAAS,SAAS;GACvB,OAAO,SAAS,SAAS;GACzB,OAAO,SAAS,SAAS;GACzB;EACD;EACA,iBAAiB,SAAS;EAC1B,WAAW,IAAI,iBAAiB,QAAQ;EACxC,UAAU,SAAS;EACnB,QAAQ,SAAS;EACjB;;;;;;AAOF,MAAa,oCAAoC,SAAyC;CACzF,UAAU,IAAI;CACd,iBAAiB,IAAI;CACrB,UAAU,IAAI;CACd,WAAW,OAAO,YACjB,IAAI,UAAU,KAAK,CAAC,KAAK,MAA+B,CACvD,EAAE,aACF;EACC,MAAM,EAAE;EACR,KAAK,EAAE;EACP,YAAY,EAAE;EACd,cAAc,EAAE;EAChB,WAAW,EAAE;EACb,aAAa,EAAE;EACf,CACD,CAAC,CACF;CACD,QAAQ,IAAI;CACZ;;;;;;;;;;;;AAaD,MAAa,oBAAoB,OAAgC,EAAE,KAAmB;CACrF,MAAM,eAAe,oBAAoB,KAAK;CAC9C,IAAI;AACJ,KAAI;AACH,QAAM,aAAa,cAAc,OAAO;UAChC,OAAO;AAIf,QAAM,IAAI,mBAAmB;GAC5B,OAAO;GACP,MAAM;GACN,SAAS,yCAAyC,aAAa,IAAI,OAAO,MAAM;GAChF;GACA,CAAC;;AAGH,QAAO,QADU,eAAe,KAAK,aACd,EAAE,aAAa"}
@@ -0,0 +1,48 @@
1
+ //#region src/build-integrations/runtime/resolve-discovery-env.d.ts
2
+ /** Default state-dir / runtime-root name when neither an explicit
3
+ * option nor any env override is present. Mirrors `DEFAULT_STATE_DIR`
4
+ * in `discover.ts` (same literal `.devstack`). */
5
+ declare const DEFAULT_DISCOVERY_STATE_DIR = ".devstack";
6
+ /** Default stack name when neither an explicit option nor
7
+ * `$DEVSTACK_STACK` yields a value. */
8
+ declare const DEFAULT_DISCOVERY_STACK = "main";
9
+ /** Env-var names the discovery ladder consults for the stack +
10
+ * state-dir rungs. `MANIFEST_PATH` lives here for documentation parity
11
+ * with the integration env tables but is resolved by
12
+ * `discoverManifestPath`, not this ladder. */
13
+ declare const DISCOVERY_ENV: {
14
+ readonly STACK: "DEVSTACK_STACK";
15
+ readonly RUNTIME_ROOT: "DEVSTACK_RUNTIME_ROOT"; /** Legacy alias for `RUNTIME_ROOT`; lower precedence. */
16
+ readonly STATE_DIR: "DEVSTACK_STATE_DIR";
17
+ readonly MANIFEST_PATH: "DEVSTACK_MANIFEST_PATH";
18
+ };
19
+ interface ResolveDiscoveryEnvOptions {
20
+ /** Explicit stack name. Wins over `$DEVSTACK_STACK`. */
21
+ readonly stack?: string;
22
+ /** Explicit state-dir / runtime-root. Wins over both env vars. */
23
+ readonly stateDir?: string;
24
+ }
25
+ interface ResolvedDiscoveryEnv {
26
+ /** Resolved stack name (never empty). */
27
+ readonly stack: string;
28
+ /** Resolved state-dir / runtime-root (never empty). May be absolute
29
+ * — `discoverManifestPath` degenerates the walk-up to a single
30
+ * existence check in that case. */
31
+ readonly stateDir: string;
32
+ }
33
+ /**
34
+ * Resolve the canonical stack + state-dir ladder.
35
+ *
36
+ * Precedence (highest → lowest), identical for both rungs:
37
+ * - stack: `options.stack` > `$DEVSTACK_STACK` > `'main'`
38
+ * - stateDir: `options.stateDir` > `$DEVSTACK_RUNTIME_ROOT`
39
+ * > `$DEVSTACK_STATE_DIR` > `'.devstack'`
40
+ *
41
+ * Empty-string env values are treated as unset (a blank
42
+ * `DEVSTACK_STATE_DIR=` must not pin the state root to the cwd). Pure —
43
+ * no `process.env` read; callers pass the bag (a fixture in tests).
44
+ */
45
+ declare const resolveDiscoveryEnv: (env: Readonly<Record<string, string | undefined>>, options?: ResolveDiscoveryEnvOptions) => ResolvedDiscoveryEnv;
46
+ //#endregion
47
+ export { DEFAULT_DISCOVERY_STACK, DEFAULT_DISCOVERY_STATE_DIR, DISCOVERY_ENV, ResolveDiscoveryEnvOptions, ResolvedDiscoveryEnv, resolveDiscoveryEnv };
48
+ //# sourceMappingURL=resolve-discovery-env.d.mts.map
@@ -0,0 +1,42 @@
1
+ //#region src/build-integrations/runtime/resolve-discovery-env.ts
2
+ /** Default state-dir / runtime-root name when neither an explicit
3
+ * option nor any env override is present. Mirrors `DEFAULT_STATE_DIR`
4
+ * in `discover.ts` (same literal `.devstack`). */
5
+ const DEFAULT_DISCOVERY_STATE_DIR = ".devstack";
6
+ /** Default stack name when neither an explicit option nor
7
+ * `$DEVSTACK_STACK` yields a value. */
8
+ const DEFAULT_DISCOVERY_STACK = "main";
9
+ /** Env-var names the discovery ladder consults for the stack +
10
+ * state-dir rungs. `MANIFEST_PATH` lives here for documentation parity
11
+ * with the integration env tables but is resolved by
12
+ * `discoverManifestPath`, not this ladder. */
13
+ const DISCOVERY_ENV = {
14
+ STACK: "DEVSTACK_STACK",
15
+ RUNTIME_ROOT: "DEVSTACK_RUNTIME_ROOT",
16
+ /** Legacy alias for `RUNTIME_ROOT`; lower precedence. */
17
+ STATE_DIR: "DEVSTACK_STATE_DIR",
18
+ MANIFEST_PATH: "DEVSTACK_MANIFEST_PATH"
19
+ };
20
+ const firstNonEmpty = (...candidates) => {
21
+ for (const candidate of candidates) if (candidate !== void 0 && candidate !== "") return candidate;
22
+ };
23
+ /**
24
+ * Resolve the canonical stack + state-dir ladder.
25
+ *
26
+ * Precedence (highest → lowest), identical for both rungs:
27
+ * - stack: `options.stack` > `$DEVSTACK_STACK` > `'main'`
28
+ * - stateDir: `options.stateDir` > `$DEVSTACK_RUNTIME_ROOT`
29
+ * > `$DEVSTACK_STATE_DIR` > `'.devstack'`
30
+ *
31
+ * Empty-string env values are treated as unset (a blank
32
+ * `DEVSTACK_STATE_DIR=` must not pin the state root to the cwd). Pure —
33
+ * no `process.env` read; callers pass the bag (a fixture in tests).
34
+ */
35
+ const resolveDiscoveryEnv = (env, options = {}) => ({
36
+ stack: firstNonEmpty(options.stack?.trim(), env[DISCOVERY_ENV.STACK]?.trim()) ?? "main",
37
+ stateDir: firstNonEmpty(options.stateDir, env[DISCOVERY_ENV.RUNTIME_ROOT], env[DISCOVERY_ENV.STATE_DIR]) ?? ".devstack"
38
+ });
39
+ //#endregion
40
+ export { DEFAULT_DISCOVERY_STACK, DEFAULT_DISCOVERY_STATE_DIR, DISCOVERY_ENV, resolveDiscoveryEnv };
41
+
42
+ //# sourceMappingURL=resolve-discovery-env.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-discovery-env.mjs","names":[],"sources":["../../../src/build-integrations/runtime/resolve-discovery-env.ts"],"sourcesContent":["// Shared discovery env-ladder resolver.\n//\n// ONE place that turns (caller options + env bag) into the resolved\n// `{ stack, stateDir }` tuple every build integration discovers a\n// manifest with. Before this existed the ladder was copy-pasted in\n// `discover.ts`, the vitest loader, the playwright stack-context, and\n// the playwright global-setup single-stack fallback — and the two\n// playwright sites had drifted: they read only `DEVSTACK_STATE_DIR`\n// and silently ignored `DEVSTACK_RUNTIME_ROOT`. Consolidating here\n// makes that omission impossible and matches STYLE_GUIDE §7: \"L5 build\n// integrations use `build-integrations/runtime/` as the canonical\n// substrate; per-integration reimplementations of manifest discovery\n// consolidate there.\"\n//\n// `DEVSTACK_MANIFEST_PATH` is deliberately NOT resolved here — it is a\n// whole-path escape hatch handled inside `discoverManifestPath`\n// (env-miss must throw, not fall through to the walk-up), so threading\n// it through this stateDir/stack ladder would be the wrong layer.\n\n/** Default state-dir / runtime-root name when neither an explicit\n * option nor any env override is present. Mirrors `DEFAULT_STATE_DIR`\n * in `discover.ts` (same literal `.devstack`). */\nexport const DEFAULT_DISCOVERY_STATE_DIR = '.devstack';\n\n/** Default stack name when neither an explicit option nor\n * `$DEVSTACK_STACK` yields a value. */\nexport const DEFAULT_DISCOVERY_STACK = 'main';\n\n/** Env-var names the discovery ladder consults for the stack +\n * state-dir rungs. `MANIFEST_PATH` lives here for documentation parity\n * with the integration env tables but is resolved by\n * `discoverManifestPath`, not this ladder. */\nexport const DISCOVERY_ENV = {\n\tSTACK: 'DEVSTACK_STACK',\n\tRUNTIME_ROOT: 'DEVSTACK_RUNTIME_ROOT',\n\t/** Legacy alias for `RUNTIME_ROOT`; lower precedence. */\n\tSTATE_DIR: 'DEVSTACK_STATE_DIR',\n\tMANIFEST_PATH: 'DEVSTACK_MANIFEST_PATH',\n} as const;\n\nexport interface ResolveDiscoveryEnvOptions {\n\t/** Explicit stack name. Wins over `$DEVSTACK_STACK`. */\n\treadonly stack?: string;\n\t/** Explicit state-dir / runtime-root. Wins over both env vars. */\n\treadonly stateDir?: string;\n}\n\nexport interface ResolvedDiscoveryEnv {\n\t/** Resolved stack name (never empty). */\n\treadonly stack: string;\n\t/** Resolved state-dir / runtime-root (never empty). May be absolute\n\t * — `discoverManifestPath` degenerates the walk-up to a single\n\t * existence check in that case. */\n\treadonly stateDir: string;\n}\n\nconst firstNonEmpty = (\n\t...candidates: ReadonlyArray<string | undefined>\n): string | undefined => {\n\tfor (const candidate of candidates) {\n\t\tif (candidate !== undefined && candidate !== '') return candidate;\n\t}\n\treturn undefined;\n};\n\n/**\n * Resolve the canonical stack + state-dir ladder.\n *\n * Precedence (highest → lowest), identical for both rungs:\n * - stack: `options.stack` > `$DEVSTACK_STACK` > `'main'`\n * - stateDir: `options.stateDir` > `$DEVSTACK_RUNTIME_ROOT`\n * > `$DEVSTACK_STATE_DIR` > `'.devstack'`\n *\n * Empty-string env values are treated as unset (a blank\n * `DEVSTACK_STATE_DIR=` must not pin the state root to the cwd). Pure —\n * no `process.env` read; callers pass the bag (a fixture in tests).\n */\nexport const resolveDiscoveryEnv = (\n\tenv: Readonly<Record<string, string | undefined>>,\n\toptions: ResolveDiscoveryEnvOptions = {},\n): ResolvedDiscoveryEnv => ({\n\tstack:\n\t\tfirstNonEmpty(options.stack?.trim(), env[DISCOVERY_ENV.STACK]?.trim()) ??\n\t\tDEFAULT_DISCOVERY_STACK,\n\tstateDir:\n\t\tfirstNonEmpty(\n\t\t\toptions.stateDir,\n\t\t\tenv[DISCOVERY_ENV.RUNTIME_ROOT],\n\t\t\tenv[DISCOVERY_ENV.STATE_DIR],\n\t\t) ?? DEFAULT_DISCOVERY_STATE_DIR,\n});\n"],"mappings":";;;;AAsBA,MAAa,8BAA8B;;;AAI3C,MAAa,0BAA0B;;;;;AAMvC,MAAa,gBAAgB;CAC5B,OAAO;CACP,cAAc;;CAEd,WAAW;CACX,eAAe;CACf;AAkBD,MAAM,iBACL,GAAG,eACqB;AACxB,MAAK,MAAM,aAAa,WACvB,KAAI,cAAc,KAAA,KAAa,cAAc,GAAI,QAAO;;;;;;;;;;;;;;AAiB1D,MAAa,uBACZ,KACA,UAAsC,EAAE,MACb;CAC3B,OACC,cAAc,QAAQ,OAAO,MAAM,EAAE,IAAI,cAAc,QAAQ,MAAM,CAAC,IAAA;CAEvE,UACC,cACC,QAAQ,UACR,IAAI,cAAc,eAClB,IAAI,cAAc,WAClB,IAAA;CACF"}
@@ -16,7 +16,7 @@ interface ResolvedEndpoint {
16
16
  readonly name: string;
17
17
  readonly url: string;
18
18
  readonly displayUrl: string | null;
19
- readonly wireProtocol: string;
19
+ readonly wireProtocol: 'http' | 'h2c' | 'tcp';
20
20
  readonly pluginKey: string;
21
21
  readonly endpointKey: string;
22
22
  }
@@ -0,0 +1,2 @@
1
+ import "../../contracts/wallet-protocol.mjs";
2
+ export {};
@@ -0,0 +1,51 @@
1
+ //#region src/build-integrations/vite/index.d.ts
2
+ /** Default import-alias prefix. Customizable via `options.alias` (some
3
+ * apps prefer `@gen`, `~generated`, …). The app MUST use the SAME
4
+ * prefix in three derivable places: this plugin option, the
5
+ * `tsconfig` `paths` entry, and its import specifiers. */
6
+ declare const DEFAULT_GENERATED_ALIAS = "@generated";
7
+ interface DevstackVitePluginOptions {
8
+ /** Import-alias prefix. Default `'@generated'`. */
9
+ readonly alias?: string;
10
+ /** Explicit generated dir — bypasses manifest discovery entirely
11
+ * (escape hatch for unusual layouts / tests). Relative paths
12
+ * resolve against the Vite root. */
13
+ readonly generatedDir?: string;
14
+ }
15
+ /** A `vite` `Plugin`'s `config` hook receives the partial user config.
16
+ * We only ever read `config.root` and return a `resolve.alias` patch,
17
+ * so a one-field structural subset is enough — this keeps the module
18
+ * loadable without `vite` types (mirroring how the playwright/vitest
19
+ * presets avoid importing their optional peer at module init). */
20
+ interface ViteUserConfigLike {
21
+ readonly root?: string;
22
+ }
23
+ /** The structural `Plugin` shape we return — `name` + a `config` hook.
24
+ * Typed as the loose object Vite accepts (Vite's `Plugin` is
25
+ * structurally compatible) so callers spread it into `plugins: []`
26
+ * without devstack depending on `vite`. */
27
+ interface DevstackVitePlugin {
28
+ readonly name: string;
29
+ readonly config: (config: ViteUserConfigLike) => {
30
+ readonly resolve: {
31
+ readonly alias: Record<string, string>;
32
+ };
33
+ };
34
+ }
35
+ /**
36
+ * Build the devstack Vite plugin that aliases `options.alias`
37
+ * (default `@generated`) at the active stack's codegen output dir.
38
+ *
39
+ * // vite.config.ts
40
+ * import { devstackVitePlugin } from '@mysten-incubation/devstack/vite';
41
+ * export default defineConfig({ plugins: [devstackVitePlugin()] });
42
+ * // or devstackVitePlugin({ alias: '@gen' })
43
+ *
44
+ * The plugin's `config` hook merges `resolve.alias[<prefix>] = <dir>`
45
+ * into the user config (Vite deep-merges the returned partial). Sync;
46
+ * reads `process.env` + the manifest once at config-load.
47
+ */
48
+ declare const devstackVitePlugin: (options?: DevstackVitePluginOptions) => DevstackVitePlugin;
49
+ //#endregion
50
+ export { DEFAULT_GENERATED_ALIAS, DevstackVitePlugin, DevstackVitePluginOptions, devstackVitePlugin };
51
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1,73 @@
1
+ import { resolveDiscoveryEnv } from "../runtime/resolve-discovery-env.mjs";
2
+ import { discoverManifestPath } from "../runtime/discover.mjs";
3
+ import "../runtime/index.mjs";
4
+ import { existsSync, readFileSync } from "node:fs";
5
+ import { resolve } from "node:path";
6
+ //#region src/build-integrations/vite/index.ts
7
+ /** Default import-alias prefix. Customizable via `options.alias` (some
8
+ * apps prefer `@gen`, `~generated`, …). The app MUST use the SAME
9
+ * prefix in three derivable places: this plugin option, the
10
+ * `tsconfig` `paths` entry, and its import specifiers. */
11
+ const DEFAULT_GENERATED_ALIAS = "@generated";
12
+ /** Default home-stack output subpath, relative to the Vite root. The
13
+ * cold-start fallback when no manifest / `codegen.generatedDir` is on
14
+ * disk yet. Mirrors `output-location.ts`'s home rule. */
15
+ const FALLBACK_GENERATED_SUBPATH = "src/generated";
16
+ /** Best-effort, SYNC read of the manifest-recorded `codegen.generatedDir`
17
+ * for the active stack. Returns the absolute dir, or `null` on any
18
+ * miss (no manifest yet, no `codegen` field, unreadable/corrupt file).
19
+ * Never throws — the caller falls back to `src/generated/`. We read +
20
+ * `JSON.parse` directly (rather than the schema-decoding
21
+ * `readStackContext`, which (a) drops the `codegen` field in its
22
+ * projection and (b) throws on a version mismatch) so an out-of-date
23
+ * or partially-written manifest degrades to the cold-start fallback
24
+ * instead of crashing the dev server. */
25
+ const readGeneratedDirFromManifest = (env, cwd) => {
26
+ try {
27
+ const { stack, stateDir } = resolveDiscoveryEnv(env);
28
+ const manifestPath = discoverManifestPath({
29
+ env,
30
+ stack,
31
+ stateDir,
32
+ cwd
33
+ });
34
+ if (manifestPath === void 0 || !existsSync(manifestPath)) return null;
35
+ const parsed = JSON.parse(readFileSync(manifestPath, "utf8"));
36
+ if (typeof parsed !== "object" || parsed === null) return null;
37
+ const codegen = parsed.codegen;
38
+ if (typeof codegen !== "object" || codegen === null) return null;
39
+ const generatedDir = codegen.generatedDir;
40
+ return typeof generatedDir === "string" && generatedDir.length > 0 ? generatedDir : null;
41
+ } catch {
42
+ return null;
43
+ }
44
+ };
45
+ /**
46
+ * Build the devstack Vite plugin that aliases `options.alias`
47
+ * (default `@generated`) at the active stack's codegen output dir.
48
+ *
49
+ * // vite.config.ts
50
+ * import { devstackVitePlugin } from '@mysten-incubation/devstack/vite';
51
+ * export default defineConfig({ plugins: [devstackVitePlugin()] });
52
+ * // or devstackVitePlugin({ alias: '@gen' })
53
+ *
54
+ * The plugin's `config` hook merges `resolve.alias[<prefix>] = <dir>`
55
+ * into the user config (Vite deep-merges the returned partial). Sync;
56
+ * reads `process.env` + the manifest once at config-load.
57
+ */
58
+ const devstackVitePlugin = (options = {}) => {
59
+ const alias = options.alias ?? "@generated";
60
+ return {
61
+ name: "devstack:generated-alias",
62
+ config: (config) => {
63
+ const root = config.root ?? process.cwd();
64
+ const explicit = options.generatedDir;
65
+ const generatedDir = explicit !== void 0 ? resolve(root, explicit) : readGeneratedDirFromManifest(process.env, root) ?? resolve(root, FALLBACK_GENERATED_SUBPATH);
66
+ return { resolve: { alias: { [alias]: generatedDir } } };
67
+ }
68
+ };
69
+ };
70
+ //#endregion
71
+ export { DEFAULT_GENERATED_ALIAS, devstackVitePlugin };
72
+
73
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../src/build-integrations/vite/index.ts"],"sourcesContent":["// Vite build-integration — `@generated` alias plugin.\n//\n// notes/per-stack-codegen-design.md §\"Import mapping via a customizable\n// alias\": app source imports its Move codegen through a configurable\n// alias prefix (default `@generated`) instead of `./generated`. This\n// plugin points that alias at the ACTIVE stack's output dir — the EXACT\n// dir codegen wrote to for the current stack — so two stacks of the\n// same app (`pnpm dev` on the home stack + `pnpm test:e2e` on a\n// `--stack e2e` override) resolve `@generated/*` to different\n// directories and never read each other's clobbered package-id /\n// wallet-pair-token literals.\n//\n// The target is the manifest-recorded `codegen.generatedDir` (the\n// single source of truth — the supervisor wrote it at flush time; see\n// `orchestrators/codegen/output-location.ts` +\n// `runtime-composition.ts`). Resolution:\n// 1. `options.generatedDir` — explicit escape hatch, used verbatim.\n// 2. `resolveDiscoveryEnv(process.env)` → `{ stack, stateDir }`\n// (single source of truth; honors `DEVSTACK_STACK` +\n// `DEVSTACK_RUNTIME_ROOT`/`DEVSTACK_STATE_DIR`), then\n// `discoverManifestPath(...)` locates `<stateDir>/stacks/<stack>/manifest.json`,\n// and we read its `codegen.generatedDir`.\n// 3. Cold-start fallback — no manifest / no field yet → `<root>/src/generated`.\n// (In the supervised flow Vite starts AFTER post-acquire codegen,\n// so the field is present; the fallback is the pre-`up` window.)\n//\n// Because Playwright's `webServer` runs the app's OWN Vite as a child\n// inheriting `DEVSTACK_STACK`, the same plugin serves both `pnpm dev`\n// and the e2e dev server automatically. Vitest has its own Vite\n// pipeline, so apps add this plugin to `vitest.config.ts` too.\n//\n// SYNC + dependency-light, mirroring the playwright/vitest helpers: NO\n// heavy imports at module top-level, and `vite` is NOT imported (it is\n// an app-side dev dependency, not a devstack runtime dep). The return\n// value is a STRUCTURAL Vite `Plugin` — a `{ name, config }` object —\n// typed loosely so this module loads without `vite` installed. The\n// manifest read goes through the same `build-integrations/runtime`\n// machinery the playwright/vitest integrations use.\n\nimport { existsSync, readFileSync } from 'node:fs';\nimport { resolve } from 'node:path';\n\nimport { discoverManifestPath, resolveDiscoveryEnv } from '../runtime/index.ts';\n\n/** Default import-alias prefix. Customizable via `options.alias` (some\n * apps prefer `@gen`, `~generated`, …). The app MUST use the SAME\n * prefix in three derivable places: this plugin option, the\n * `tsconfig` `paths` entry, and its import specifiers. */\nexport const DEFAULT_GENERATED_ALIAS = '@generated';\n\n/** Default home-stack output subpath, relative to the Vite root. The\n * cold-start fallback when no manifest / `codegen.generatedDir` is on\n * disk yet. Mirrors `output-location.ts`'s home rule. */\nconst FALLBACK_GENERATED_SUBPATH = 'src/generated';\n\nexport interface DevstackVitePluginOptions {\n\t/** Import-alias prefix. Default `'@generated'`. */\n\treadonly alias?: string;\n\t/** Explicit generated dir — bypasses manifest discovery entirely\n\t * (escape hatch for unusual layouts / tests). Relative paths\n\t * resolve against the Vite root. */\n\treadonly generatedDir?: string;\n}\n\n/** A `vite` `Plugin`'s `config` hook receives the partial user config.\n * We only ever read `config.root` and return a `resolve.alias` patch,\n * so a one-field structural subset is enough — this keeps the module\n * loadable without `vite` types (mirroring how the playwright/vitest\n * presets avoid importing their optional peer at module init). */\ninterface ViteUserConfigLike {\n\treadonly root?: string;\n}\n\n/** The structural `Plugin` shape we return — `name` + a `config` hook.\n * Typed as the loose object Vite accepts (Vite's `Plugin` is\n * structurally compatible) so callers spread it into `plugins: []`\n * without devstack depending on `vite`. */\nexport interface DevstackVitePlugin {\n\treadonly name: string;\n\treadonly config: (config: ViteUserConfigLike) => {\n\t\treadonly resolve: { readonly alias: Record<string, string> };\n\t};\n}\n\n/** Best-effort, SYNC read of the manifest-recorded `codegen.generatedDir`\n * for the active stack. Returns the absolute dir, or `null` on any\n * miss (no manifest yet, no `codegen` field, unreadable/corrupt file).\n * Never throws — the caller falls back to `src/generated/`. We read +\n * `JSON.parse` directly (rather than the schema-decoding\n * `readStackContext`, which (a) drops the `codegen` field in its\n * projection and (b) throws on a version mismatch) so an out-of-date\n * or partially-written manifest degrades to the cold-start fallback\n * instead of crashing the dev server. */\nconst readGeneratedDirFromManifest = (\n\tenv: Readonly<Record<string, string | undefined>>,\n\tcwd: string,\n): string | null => {\n\ttry {\n\t\tconst { stack, stateDir } = resolveDiscoveryEnv(env);\n\t\tconst manifestPath = discoverManifestPath({ env, stack, stateDir, cwd });\n\t\tif (manifestPath === undefined || !existsSync(manifestPath)) return null;\n\t\tconst parsed: unknown = JSON.parse(readFileSync(manifestPath, 'utf8'));\n\t\tif (typeof parsed !== 'object' || parsed === null) return null;\n\t\tconst codegen = (parsed as { readonly codegen?: unknown }).codegen;\n\t\tif (typeof codegen !== 'object' || codegen === null) return null;\n\t\tconst generatedDir = (codegen as { readonly generatedDir?: unknown }).generatedDir;\n\t\treturn typeof generatedDir === 'string' && generatedDir.length > 0 ? generatedDir : null;\n\t} catch {\n\t\t// Discovery / read / parse failure → cold-start fallback. A\n\t\t// best-effort alias resolver must never fail the Vite config load.\n\t\treturn null;\n\t}\n};\n\n/**\n * Build the devstack Vite plugin that aliases `options.alias`\n * (default `@generated`) at the active stack's codegen output dir.\n *\n * // vite.config.ts\n * import { devstackVitePlugin } from '@mysten-incubation/devstack/vite';\n * export default defineConfig({ plugins: [devstackVitePlugin()] });\n * // or devstackVitePlugin({ alias: '@gen' })\n *\n * The plugin's `config` hook merges `resolve.alias[<prefix>] = <dir>`\n * into the user config (Vite deep-merges the returned partial). Sync;\n * reads `process.env` + the manifest once at config-load.\n */\nexport const devstackVitePlugin = (options: DevstackVitePluginOptions = {}): DevstackVitePlugin => {\n\tconst alias = options.alias ?? DEFAULT_GENERATED_ALIAS;\n\treturn {\n\t\tname: 'devstack:generated-alias',\n\t\tconfig: (config: ViteUserConfigLike) => {\n\t\t\tconst root = config.root ?? process.cwd();\n\t\t\t// Explicit `generatedDir` wins (relative → resolved against the\n\t\t\t// Vite root). Otherwise consult the manifest-recorded dir, then\n\t\t\t// fall back to the home-stack `src/generated/` for the\n\t\t\t// pre-supervisor cold-start window.\n\t\t\tconst explicit = options.generatedDir;\n\t\t\tconst generatedDir =\n\t\t\t\texplicit !== undefined\n\t\t\t\t\t? resolve(root, explicit)\n\t\t\t\t\t: (readGeneratedDirFromManifest(\n\t\t\t\t\t\t\tprocess.env as Readonly<Record<string, string | undefined>>,\n\t\t\t\t\t\t\troot,\n\t\t\t\t\t\t) ?? resolve(root, FALLBACK_GENERATED_SUBPATH));\n\t\t\t// Return a partial config; Vite merges `resolve.alias` into the\n\t\t\t// existing alias map. A bare-prefix alias (no trailing `/`)\n\t\t\t// matches both `@generated` and `@generated/foo.js` under Vite's\n\t\t\t// default string-alias resolution.\n\t\t\treturn { resolve: { alias: { [alias]: generatedDir } } };\n\t\t},\n\t};\n};\n"],"mappings":";;;;;;;;;;AAgDA,MAAa,0BAA0B;;;;AAKvC,MAAM,6BAA6B;;;;;;;;;;AAwCnC,MAAM,gCACL,KACA,QACmB;AACnB,KAAI;EACH,MAAM,EAAE,OAAO,aAAa,oBAAoB,IAAI;EACpD,MAAM,eAAe,qBAAqB;GAAE;GAAK;GAAO;GAAU;GAAK,CAAC;AACxE,MAAI,iBAAiB,KAAA,KAAa,CAAC,WAAW,aAAa,CAAE,QAAO;EACpE,MAAM,SAAkB,KAAK,MAAM,aAAa,cAAc,OAAO,CAAC;AACtE,MAAI,OAAO,WAAW,YAAY,WAAW,KAAM,QAAO;EAC1D,MAAM,UAAW,OAA0C;AAC3D,MAAI,OAAO,YAAY,YAAY,YAAY,KAAM,QAAO;EAC5D,MAAM,eAAgB,QAAgD;AACtE,SAAO,OAAO,iBAAiB,YAAY,aAAa,SAAS,IAAI,eAAe;SAC7E;AAGP,SAAO;;;;;;;;;;;;;;;;AAiBT,MAAa,sBAAsB,UAAqC,EAAE,KAAyB;CAClG,MAAM,QAAQ,QAAQ,SAAA;AACtB,QAAO;EACN,MAAM;EACN,SAAS,WAA+B;GACvC,MAAM,OAAO,OAAO,QAAQ,QAAQ,KAAK;GAKzC,MAAM,WAAW,QAAQ;GACzB,MAAM,eACL,aAAa,KAAA,IACV,QAAQ,MAAM,SAAS,GACtB,6BACD,QAAQ,KACR,KACA,IAAI,QAAQ,MAAM,2BAA2B;AAKjD,UAAO,EAAE,SAAS,EAAE,OAAO,GAAG,QAAQ,cAAc,EAAE,EAAE;;EAEzD"}
@@ -18,9 +18,10 @@ declare const VITEST_ENV_VARS: {
18
18
  readonly MANIFEST_PATH: "DEVSTACK_MANIFEST_PATH";
19
19
  };
20
20
  type VitestEnvVarName = (typeof VITEST_ENV_VARS)[keyof typeof VITEST_ENV_VARS];
21
- /** Default stack name when `DEVSTACK_STACK` is unset. Mirrors the
22
- * engine's "main" default but tests should explicitly set
23
- * `DEVSTACK_STACK=test` rather than rely on this. */
21
+ /** Default stack name when `DEVSTACK_STACK` is unset. Re-exported from
22
+ * the discovery ladder's `DEFAULT_DISCOVERY_STACK` (single source of
23
+ * truth) but tests should explicitly set `DEVSTACK_STACK=test`
24
+ * rather than rely on this. */
24
25
  declare const DEFAULT_STACK_NAME = "main";
25
26
  /** Default runtime root when neither `DEVSTACK_RUNTIME_ROOT` nor the
26
27
  * legacy `DEVSTACK_STATE_DIR` is set. */
@@ -1,3 +1,4 @@
1
+ import { DEFAULT_DISCOVERY_STACK } from "../runtime/resolve-discovery-env.mjs";
1
2
  //#region src/build-integrations/vitest/env.ts
2
3
  /** Env-var names the vitest integration consults. Centralized so
3
4
  * test-setup printouts can name the var the caller forgot to set. */
@@ -17,10 +18,11 @@ const VITEST_ENV_VARS = {
17
18
  * by hand. */
18
19
  MANIFEST_PATH: "DEVSTACK_MANIFEST_PATH"
19
20
  };
20
- /** Default stack name when `DEVSTACK_STACK` is unset. Mirrors the
21
- * engine's "main" default but tests should explicitly set
22
- * `DEVSTACK_STACK=test` rather than rely on this. */
23
- const DEFAULT_STACK_NAME = "main";
21
+ /** Default stack name when `DEVSTACK_STACK` is unset. Re-exported from
22
+ * the discovery ladder's `DEFAULT_DISCOVERY_STACK` (single source of
23
+ * truth) but tests should explicitly set `DEVSTACK_STACK=test`
24
+ * rather than rely on this. */
25
+ const DEFAULT_STACK_NAME = DEFAULT_DISCOVERY_STACK;
24
26
  /** Default runtime root when neither `DEVSTACK_RUNTIME_ROOT` nor the
25
27
  * legacy `DEVSTACK_STATE_DIR` is set. */
26
28
  const DEFAULT_RUNTIME_ROOT = ".devstack";
@@ -1 +1 @@
1
- {"version":3,"file":"env.mjs","names":[],"sources":["../../../src/build-integrations/vitest/env.ts"],"sourcesContent":["// Vitest build-integration — env-var contract.\n//\n// Architecture (distilled/23-build-integrations.md § Inputs /\n// dependencies, distilled/24-examples.md § Lifecycle / invocation\n// patterns): test runs MUST set `DEVSTACK_STACK=test` so they don't\n// contend with a parallel `pnpm dev` on the `main` stack. The\n// supervisor's port allocator + manifest discovery key off this var\n// to keep two stacks coexisting.\n//\n// `DEVSTACK_RUNTIME_ROOT` is the optional override for the on-disk\n// state root that contains `stacks/<stack>/manifest.json`. It maps to\n// the legacy `DEVSTACK_STATE_DIR` env var; both names are accepted on\n// read so the rewrite can roll out without coordinated env-var\n// renames across every example app.\n//\n// `DEVSTACK_MANIFEST_PATH` is the top-of-the-precedence-ladder escape\n// hatch the engine writes; build integrations also honor it. Listed\n// here for completeness — the typical vitest run does not set it.\n//\n// NOTE: this module is a pure declaration of names + defaults. No env\n// reads happen at module import time; readers fetch on demand so\n// tests can stub `process.env` per-case.\n\n// -----------------------------------------------------------------------------\n// Canonical env-var names\n// -----------------------------------------------------------------------------\n\n/** Env-var names the vitest integration consults. Centralized so\n * test-setup printouts can name the var the caller forgot to set. */\nexport const VITEST_ENV_VARS = {\n\t/** Stack name; the canonical signal for \"isolate this test run\n\t * from other stacks\". Tests SHOULD set this to `'test'`. */\n\tSTACK: 'DEVSTACK_STACK',\n\t/** Override for the runtime root that holds\n\t * `stacks/<stack>/manifest.json`. Defaults to `.devstack`. */\n\tRUNTIME_ROOT: 'DEVSTACK_RUNTIME_ROOT',\n\t/** Legacy alias for `RUNTIME_ROOT`. Accepted on read so the\n\t * rewrite can coexist with example apps that still set the\n\t * pre-rewrite name. New callers should use `RUNTIME_ROOT`. */\n\tRUNTIME_ROOT_LEGACY: 'DEVSTACK_STATE_DIR',\n\t/** Top-precedence absolute path to a specific manifest file. The\n\t * engine sets this when it spawns child processes; rarely set\n\t * by hand. */\n\tMANIFEST_PATH: 'DEVSTACK_MANIFEST_PATH',\n} as const;\n\nexport type VitestEnvVarName = (typeof VITEST_ENV_VARS)[keyof typeof VITEST_ENV_VARS];\n\n// -----------------------------------------------------------------------------\n// Defaults\n// -----------------------------------------------------------------------------\n\n/** Default stack name when `DEVSTACK_STACK` is unset. Mirrors the\n * engine's \"main\" default — but tests should explicitly set\n * `DEVSTACK_STACK=test` rather than rely on this. */\nexport const DEFAULT_STACK_NAME = 'main';\n\n/** Default runtime root when neither `DEVSTACK_RUNTIME_ROOT` nor the\n * legacy `DEVSTACK_STATE_DIR` is set. */\nexport const DEFAULT_RUNTIME_ROOT = '.devstack';\n\n/** The recommended stack name for test runs — the value the\n * `test`-script env should set. Exported as a constant so example\n * apps' `package.json` can wire it from one symbol if a future\n * scaffolder lands. */\nexport const RECOMMENDED_TEST_STACK = 'test';\n\n// -----------------------------------------------------------------------------\n// Pure resolvers — no module-init side effects\n// -----------------------------------------------------------------------------\n\nexport interface ResolvedVitestEnv {\n\treadonly stack: string;\n\treadonly runtimeRoot: string;\n\treadonly manifestPathOverride: string | undefined;\n\t/** True when the caller's env explicitly set `DEVSTACK_STACK`. The\n\t * test-setup hook uses this to print a louder advisory when a\n\t * user runs `pnpm test` without the recommended wiring. */\n\treadonly stackWasExplicit: boolean;\n}\n\n/** Resolve the vitest env contract from an arbitrary env bag.\n * Side-effect free — tests pass a fixture; production code passes\n * `process.env`. */\nexport const resolveVitestEnv = (\n\tenv: Readonly<Record<string, string | undefined>>,\n): ResolvedVitestEnv => {\n\tconst stackRaw = env[VITEST_ENV_VARS.STACK];\n\tconst stack = stackRaw !== undefined && stackRaw !== '' ? stackRaw : DEFAULT_STACK_NAME;\n\tconst runtimeRoot =\n\t\tenv[VITEST_ENV_VARS.RUNTIME_ROOT] ??\n\t\tenv[VITEST_ENV_VARS.RUNTIME_ROOT_LEGACY] ??\n\t\tDEFAULT_RUNTIME_ROOT;\n\tconst manifestPathOverride = env[VITEST_ENV_VARS.MANIFEST_PATH];\n\treturn {\n\t\tstack,\n\t\truntimeRoot: runtimeRoot === '' ? DEFAULT_RUNTIME_ROOT : runtimeRoot,\n\t\tmanifestPathOverride:\n\t\t\tmanifestPathOverride !== undefined && manifestPathOverride !== ''\n\t\t\t\t? manifestPathOverride\n\t\t\t\t: undefined,\n\t\tstackWasExplicit: stackRaw !== undefined && stackRaw !== '',\n\t};\n};\n"],"mappings":";;;AA6BA,MAAa,kBAAkB;;;CAG9B,OAAO;;;CAGP,cAAc;;;;CAId,qBAAqB;;;;CAIrB,eAAe;CACf;;;;AAWD,MAAa,qBAAqB;;;AAIlC,MAAa,uBAAuB;;;;;AAMpC,MAAa,yBAAyB;;;;AAmBtC,MAAa,oBACZ,QACuB;CACvB,MAAM,WAAW,IAAI,gBAAgB;CACrC,MAAM,QAAQ,aAAa,KAAA,KAAa,aAAa,KAAK,WAAW;CACrE,MAAM,cACL,IAAI,gBAAgB,iBACpB,IAAI,gBAAgB,wBAAA;CAErB,MAAM,uBAAuB,IAAI,gBAAgB;AACjD,QAAO;EACN;EACA,aAAa,gBAAgB,KAAK,uBAAuB;EACzD,sBACC,yBAAyB,KAAA,KAAa,yBAAyB,KAC5D,uBACA,KAAA;EACJ,kBAAkB,aAAa,KAAA,KAAa,aAAa;EACzD"}
1
+ {"version":3,"file":"env.mjs","names":[],"sources":["../../../src/build-integrations/vitest/env.ts"],"sourcesContent":["// Vitest build-integration — env-var contract.\n//\n// Architecture (distilled/23-build-integrations.md § Inputs /\n// dependencies, distilled/24-examples.md § Lifecycle / invocation\n// patterns): test runs MUST set `DEVSTACK_STACK=test` so they don't\n// contend with a parallel `pnpm dev` on the `main` stack. The\n// supervisor's port allocator + manifest discovery key off this var\n// to keep two stacks coexisting.\n//\n// `DEVSTACK_RUNTIME_ROOT` is the optional override for the on-disk\n// state root that contains `stacks/<stack>/manifest.json`. It maps to\n// the legacy `DEVSTACK_STATE_DIR` env var; both names are accepted on\n// read so the rewrite can roll out without coordinated env-var\n// renames across every example app.\n//\n// `DEVSTACK_MANIFEST_PATH` is the top-of-the-precedence-ladder escape\n// hatch the engine writes; build integrations also honor it. Listed\n// here for completeness — the typical vitest run does not set it.\n//\n// NOTE: this module is a pure declaration of names + defaults. No env\n// reads happen at module import time; readers fetch on demand so\n// tests can stub `process.env` per-case.\n\nimport { DEFAULT_DISCOVERY_STACK } from '../runtime/resolve-discovery-env.ts';\n\n// -----------------------------------------------------------------------------\n// Canonical env-var names\n// -----------------------------------------------------------------------------\n\n/** Env-var names the vitest integration consults. Centralized so\n * test-setup printouts can name the var the caller forgot to set. */\nexport const VITEST_ENV_VARS = {\n\t/** Stack name; the canonical signal for \"isolate this test run\n\t * from other stacks\". Tests SHOULD set this to `'test'`. */\n\tSTACK: 'DEVSTACK_STACK',\n\t/** Override for the runtime root that holds\n\t * `stacks/<stack>/manifest.json`. Defaults to `.devstack`. */\n\tRUNTIME_ROOT: 'DEVSTACK_RUNTIME_ROOT',\n\t/** Legacy alias for `RUNTIME_ROOT`. Accepted on read so the\n\t * rewrite can coexist with example apps that still set the\n\t * pre-rewrite name. New callers should use `RUNTIME_ROOT`. */\n\tRUNTIME_ROOT_LEGACY: 'DEVSTACK_STATE_DIR',\n\t/** Top-precedence absolute path to a specific manifest file. The\n\t * engine sets this when it spawns child processes; rarely set\n\t * by hand. */\n\tMANIFEST_PATH: 'DEVSTACK_MANIFEST_PATH',\n} as const;\n\nexport type VitestEnvVarName = (typeof VITEST_ENV_VARS)[keyof typeof VITEST_ENV_VARS];\n\n// -----------------------------------------------------------------------------\n// Defaults\n// -----------------------------------------------------------------------------\n\n/** Default stack name when `DEVSTACK_STACK` is unset. Re-exported from\n * the discovery ladder's `DEFAULT_DISCOVERY_STACK` (single source of\n * truth) — but tests should explicitly set `DEVSTACK_STACK=test`\n * rather than rely on this. */\nexport const DEFAULT_STACK_NAME = DEFAULT_DISCOVERY_STACK;\n\n/** Default runtime root when neither `DEVSTACK_RUNTIME_ROOT` nor the\n * legacy `DEVSTACK_STATE_DIR` is set. */\nexport const DEFAULT_RUNTIME_ROOT = '.devstack';\n\n/** The recommended stack name for test runs — the value the\n * `test`-script env should set. Exported as a constant so example\n * apps' `package.json` can wire it from one symbol if a future\n * scaffolder lands. */\nexport const RECOMMENDED_TEST_STACK = 'test';\n\n// -----------------------------------------------------------------------------\n// Pure resolvers — no module-init side effects\n// -----------------------------------------------------------------------------\n\nexport interface ResolvedVitestEnv {\n\treadonly stack: string;\n\treadonly runtimeRoot: string;\n\treadonly manifestPathOverride: string | undefined;\n\t/** True when the caller's env explicitly set `DEVSTACK_STACK`. The\n\t * test-setup hook uses this to print a louder advisory when a\n\t * user runs `pnpm test` without the recommended wiring. */\n\treadonly stackWasExplicit: boolean;\n}\n\n/** Resolve the vitest env contract from an arbitrary env bag.\n * Side-effect free — tests pass a fixture; production code passes\n * `process.env`. */\nexport const resolveVitestEnv = (\n\tenv: Readonly<Record<string, string | undefined>>,\n): ResolvedVitestEnv => {\n\tconst stackRaw = env[VITEST_ENV_VARS.STACK];\n\tconst stack = stackRaw !== undefined && stackRaw !== '' ? stackRaw : DEFAULT_STACK_NAME;\n\tconst runtimeRoot =\n\t\tenv[VITEST_ENV_VARS.RUNTIME_ROOT] ??\n\t\tenv[VITEST_ENV_VARS.RUNTIME_ROOT_LEGACY] ??\n\t\tDEFAULT_RUNTIME_ROOT;\n\tconst manifestPathOverride = env[VITEST_ENV_VARS.MANIFEST_PATH];\n\treturn {\n\t\tstack,\n\t\truntimeRoot: runtimeRoot === '' ? DEFAULT_RUNTIME_ROOT : runtimeRoot,\n\t\tmanifestPathOverride:\n\t\t\tmanifestPathOverride !== undefined && manifestPathOverride !== ''\n\t\t\t\t? manifestPathOverride\n\t\t\t\t: undefined,\n\t\tstackWasExplicit: stackRaw !== undefined && stackRaw !== '',\n\t};\n};\n"],"mappings":";;;;AA+BA,MAAa,kBAAkB;;;CAG9B,OAAO;;;CAGP,cAAc;;;;CAId,qBAAqB;;;;CAIrB,eAAe;CACf;;;;;AAYD,MAAa,qBAAqB;;;AAIlC,MAAa,uBAAuB;;;;;AAMpC,MAAa,yBAAyB;;;;AAmBtC,MAAa,oBACZ,QACuB;CACvB,MAAM,WAAW,IAAI,gBAAgB;CACrC,MAAM,QAAQ,aAAa,KAAA,KAAa,aAAa,KAAK,WAAW;CACrE,MAAM,cACL,IAAI,gBAAgB,iBACpB,IAAI,gBAAgB,wBAAA;CAErB,MAAM,uBAAuB,IAAI,gBAAgB;AACjD,QAAO;EACN;EACA,aAAa,gBAAgB,KAAK,uBAAuB;EACzD,sBACC,yBAAyB,KAAA,KAAa,yBAAyB,KAC5D,uBACA,KAAA;EACJ,kBAAkB,aAAa,KAAA,KAAa,aAAa;EACzD"}
@@ -1,5 +1,5 @@
1
- import * as _$effect_Types0 from "effect/Types";
2
1
  import * as _$effect_Cause0 from "effect/Cause";
2
+ import * as _$effect_Types0 from "effect/Types";
3
3
 
4
4
  //#region src/build-integrations/vitest/errors.d.ts
5
5
  declare const VitestManifestNotFoundError_base: new <A extends Record<string, any> = {}>(args: _$effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => _$effect_Cause0.YieldableError & {
@@ -19,7 +19,14 @@ declare const VitestManifestShapeError_base: new <A extends Record<string, any>
19
19
  readonly _tag: "VitestManifestShapeError";
20
20
  } & Readonly<A>;
21
21
  /** The manifest exists but doesn't decode against the L0 envelope schema
22
- * — either malformed JSON or shape drift after a manifestVersion bump. */
22
+ * — either malformed JSON (`parse`) or shape drift (`shape`).
23
+ *
24
+ * Distinct from `VitestManifestVersionMismatchError`: this tag carries
25
+ * the "manifest looks like garbage / your envelope was wrong" recovery
26
+ * ("regenerate the manifest"); the version-mismatch tag carries the
27
+ * "build-integration and supervisor are at different versions"
28
+ * recovery (upgrade the consumer dependency). Splitting the two lets
29
+ * callers `catchTag` independently and surface a precise hint. */
23
30
  declare class VitestManifestShapeError extends VitestManifestShapeError_base<{
24
31
  readonly message: string;
25
32
  readonly path: string;
@@ -27,6 +34,20 @@ declare class VitestManifestShapeError extends VitestManifestShapeError_base<{
27
34
  readonly recovery: string;
28
35
  readonly cause?: unknown;
29
36
  }> {}
37
+ declare const VitestManifestVersionMismatchError_base: new <A extends Record<string, any> = {}>(args: _$effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => _$effect_Cause0.YieldableError & {
38
+ readonly _tag: "VitestManifestVersionMismatchError";
39
+ } & Readonly<A>;
40
+ /** The manifest exists, decodes structurally, but its `manifestVersion`
41
+ * doesn't match what this consumer build was compiled for. Distinct
42
+ * from `VitestManifestShapeError` so callers can `catchTag` the two
43
+ * separately — the recovery action is "upgrade your devstack
44
+ * consumer dependency" rather than "regenerate the manifest". */
45
+ declare class VitestManifestVersionMismatchError extends VitestManifestVersionMismatchError_base<{
46
+ readonly message: string;
47
+ readonly path: string;
48
+ readonly recovery: string;
49
+ readonly cause?: unknown;
50
+ }> {}
30
51
  declare const VitestSetupPreconditionError_base: new <A extends Record<string, any> = {}>(args: _$effect_Types0.VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => _$effect_Cause0.YieldableError & {
31
52
  readonly _tag: "VitestSetupPreconditionError";
32
53
  } & Readonly<A>;
@@ -38,7 +59,7 @@ declare class VitestSetupPreconditionError extends VitestSetupPreconditionError_
38
59
  readonly message: string;
39
60
  readonly hint?: string;
40
61
  }> {}
41
- type VitestIntegrationError = VitestManifestNotFoundError | VitestManifestShapeError | VitestSetupPreconditionError;
62
+ type VitestIntegrationError = VitestManifestNotFoundError | VitestManifestShapeError | VitestManifestVersionMismatchError | VitestSetupPreconditionError;
42
63
  //#endregion
43
- export { VitestIntegrationError, VitestManifestNotFoundError, VitestManifestShapeError, VitestSetupPreconditionError };
64
+ export { VitestIntegrationError, VitestManifestNotFoundError, VitestManifestShapeError, VitestManifestVersionMismatchError, VitestSetupPreconditionError };
44
65
  //# sourceMappingURL=errors.d.mts.map
@@ -5,14 +5,27 @@ import { Data } from "effect";
5
5
  * run yet or the wrong stack/state-dir is configured. */
6
6
  var VitestManifestNotFoundError = class extends Data.TaggedError("VitestManifestNotFoundError") {};
7
7
  /** The manifest exists but doesn't decode against the L0 envelope schema
8
- * — either malformed JSON or shape drift after a manifestVersion bump. */
8
+ * — either malformed JSON (`parse`) or shape drift (`shape`).
9
+ *
10
+ * Distinct from `VitestManifestVersionMismatchError`: this tag carries
11
+ * the "manifest looks like garbage / your envelope was wrong" recovery
12
+ * ("regenerate the manifest"); the version-mismatch tag carries the
13
+ * "build-integration and supervisor are at different versions"
14
+ * recovery (upgrade the consumer dependency). Splitting the two lets
15
+ * callers `catchTag` independently and surface a precise hint. */
9
16
  var VitestManifestShapeError = class extends Data.TaggedError("VitestManifestShapeError") {};
17
+ /** The manifest exists, decodes structurally, but its `manifestVersion`
18
+ * doesn't match what this consumer build was compiled for. Distinct
19
+ * from `VitestManifestShapeError` so callers can `catchTag` the two
20
+ * separately — the recovery action is "upgrade your devstack
21
+ * consumer dependency" rather than "regenerate the manifest". */
22
+ var VitestManifestVersionMismatchError = class extends Data.TaggedError("VitestManifestVersionMismatchError") {};
10
23
  /** A test-setup precondition was violated. Currently only one case:
11
24
  * the caller asked for `requireDevstack: true` but the manifest wasn't
12
25
  * discoverable. Distinct from the discovery error because the caller
13
26
  * opted IN to the requirement. */
14
27
  var VitestSetupPreconditionError = class extends Data.TaggedError("VitestSetupPreconditionError") {};
15
28
  //#endregion
16
- export { VitestManifestNotFoundError, VitestManifestShapeError, VitestSetupPreconditionError };
29
+ export { VitestManifestNotFoundError, VitestManifestShapeError, VitestManifestVersionMismatchError, VitestSetupPreconditionError };
17
30
 
18
31
  //# sourceMappingURL=errors.mjs.map