@mysten-incubation/devstack 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (833) hide show
  1. package/LICENSE +189 -0
  2. package/README.md +94 -0
  3. package/dist/_virtual/_rolldown/runtime.mjs +13 -0
  4. package/dist/api/define-capabilities.d.mts +25 -0
  5. package/dist/api/define-capabilities.mjs +19 -0
  6. package/dist/api/define-capabilities.mjs.map +1 -0
  7. package/dist/api/define-devstack-with.d.mts +41 -0
  8. package/dist/api/define-devstack-with.mjs +24 -0
  9. package/dist/api/define-devstack-with.mjs.map +1 -0
  10. package/dist/api/define-devstack.d.mts +62 -0
  11. package/dist/api/define-devstack.mjs +108 -0
  12. package/dist/api/define-devstack.mjs.map +1 -0
  13. package/dist/api/define-plugin.d.mts +1 -0
  14. package/dist/api/inference-network.mjs +122 -0
  15. package/dist/api/inference-network.mjs.map +1 -0
  16. package/dist/api/mode-narrowed-factory.d.mts +26 -0
  17. package/dist/api/mode-narrowed-factory.mjs +8 -0
  18. package/dist/api/mode-narrowed-factory.mjs.map +1 -0
  19. package/dist/api/plugin-errors.mjs +10 -0
  20. package/dist/api/plugin-errors.mjs.map +1 -0
  21. package/dist/api/run-stack.d.mts +82 -0
  22. package/dist/api/run-stack.mjs +127 -0
  23. package/dist/api/run-stack.mjs.map +1 -0
  24. package/dist/build-integrations/playwright/config.d.mts +92 -0
  25. package/dist/build-integrations/playwright/config.mjs +71 -0
  26. package/dist/build-integrations/playwright/config.mjs.map +1 -0
  27. package/dist/build-integrations/playwright/errors.d.mts +82 -0
  28. package/dist/build-integrations/playwright/errors.mjs +43 -0
  29. package/dist/build-integrations/playwright/errors.mjs.map +1 -0
  30. package/dist/build-integrations/playwright/global-setup.d.mts +64 -0
  31. package/dist/build-integrations/playwright/global-setup.mjs +44 -0
  32. package/dist/build-integrations/playwright/global-setup.mjs.map +1 -0
  33. package/dist/build-integrations/playwright/index.d.mts +6 -0
  34. package/dist/build-integrations/playwright/index.mjs +6 -0
  35. package/dist/build-integrations/playwright/stack-context.d.mts +95 -0
  36. package/dist/build-integrations/playwright/stack-context.mjs +277 -0
  37. package/dist/build-integrations/playwright/stack-context.mjs.map +1 -0
  38. package/dist/build-integrations/playwright/wallet-context.d.mts +87 -0
  39. package/dist/build-integrations/playwright/wallet-context.mjs +148 -0
  40. package/dist/build-integrations/playwright/wallet-context.mjs.map +1 -0
  41. package/dist/build-integrations/runtime/cold-start-url.d.mts +67 -0
  42. package/dist/build-integrations/runtime/cold-start-url.mjs +56 -0
  43. package/dist/build-integrations/runtime/cold-start-url.mjs.map +1 -0
  44. package/dist/build-integrations/runtime/dapp-kit-slot.mjs +10 -0
  45. package/dist/build-integrations/runtime/dapp-kit-slot.mjs.map +1 -0
  46. package/dist/build-integrations/runtime/discover.d.mts +78 -0
  47. package/dist/build-integrations/runtime/discover.mjs +124 -0
  48. package/dist/build-integrations/runtime/discover.mjs.map +1 -0
  49. package/dist/build-integrations/runtime/endpoint-registry.d.mts +26 -0
  50. package/dist/build-integrations/runtime/endpoint-registry.mjs +41 -0
  51. package/dist/build-integrations/runtime/endpoint-registry.mjs.map +1 -0
  52. package/dist/build-integrations/runtime/errors.d.mts +64 -0
  53. package/dist/build-integrations/runtime/errors.mjs +51 -0
  54. package/dist/build-integrations/runtime/errors.mjs.map +1 -0
  55. package/dist/build-integrations/runtime/index.d.mts +7 -0
  56. package/dist/build-integrations/runtime/index.mjs +6 -0
  57. package/dist/build-integrations/runtime/read-stack-context.d.mts +38 -0
  58. package/dist/build-integrations/runtime/read-stack-context.mjs +130 -0
  59. package/dist/build-integrations/runtime/read-stack-context.mjs.map +1 -0
  60. package/dist/build-integrations/runtime/stack-context.d.mts +53 -0
  61. package/dist/build-integrations/vitest/config.d.mts +62 -0
  62. package/dist/build-integrations/vitest/config.mjs +80 -0
  63. package/dist/build-integrations/vitest/config.mjs.map +1 -0
  64. package/dist/build-integrations/vitest/env.d.mts +48 -0
  65. package/dist/build-integrations/vitest/env.mjs +50 -0
  66. package/dist/build-integrations/vitest/env.mjs.map +1 -0
  67. package/dist/build-integrations/vitest/errors.d.mts +44 -0
  68. package/dist/build-integrations/vitest/errors.mjs +18 -0
  69. package/dist/build-integrations/vitest/errors.mjs.map +1 -0
  70. package/dist/build-integrations/vitest/index.d.mts +6 -0
  71. package/dist/build-integrations/vitest/index.mjs +6 -0
  72. package/dist/build-integrations/vitest/setup.d.mts +53 -0
  73. package/dist/build-integrations/vitest/setup.mjs +56 -0
  74. package/dist/build-integrations/vitest/setup.mjs.map +1 -0
  75. package/dist/build-integrations/vitest/stack-context.d.mts +58 -0
  76. package/dist/build-integrations/vitest/stack-context.mjs +67 -0
  77. package/dist/build-integrations/vitest/stack-context.mjs.map +1 -0
  78. package/dist/cli/main.d.mts +5 -0
  79. package/dist/cli/main.mjs +586 -0
  80. package/dist/cli/main.mjs.map +1 -0
  81. package/dist/cli/prune-direct.mjs +216 -0
  82. package/dist/cli/prune-direct.mjs.map +1 -0
  83. package/dist/cli/snapshot-reader.mjs +73 -0
  84. package/dist/cli/snapshot-reader.mjs.map +1 -0
  85. package/dist/cli/up-lifecycle.mjs +28 -0
  86. package/dist/cli/up-lifecycle.mjs.map +1 -0
  87. package/dist/contracts/capability-decl.d.mts +42 -0
  88. package/dist/contracts/chain-probe.d.mts +26 -0
  89. package/dist/contracts/chain-probe.mjs +8 -0
  90. package/dist/contracts/chain-probe.mjs.map +1 -0
  91. package/dist/contracts/codegenable.d.mts +43 -0
  92. package/dist/contracts/container-runtime.d.mts +245 -0
  93. package/dist/contracts/liveness-classifier.d.mts +19 -0
  94. package/dist/contracts/network-resolver.d.mts +15 -0
  95. package/dist/contracts/network-resolver.mjs +7 -0
  96. package/dist/contracts/network-resolver.mjs.map +1 -0
  97. package/dist/contracts/projection.d.mts +15 -0
  98. package/dist/contracts/routable.d.mts +53 -0
  99. package/dist/contracts/snapshotable.d.mts +39 -0
  100. package/dist/contracts/strategy-contributor.d.mts +26 -0
  101. package/dist/index.d.mts +89 -0
  102. package/dist/index.mjs +37 -0
  103. package/dist/orchestrators/codegen/bindings.d.mts +2 -0
  104. package/dist/orchestrators/codegen/bindings.mjs +340 -0
  105. package/dist/orchestrators/codegen/bindings.mjs.map +1 -0
  106. package/dist/orchestrators/codegen/emit.mjs +56 -0
  107. package/dist/orchestrators/codegen/emit.mjs.map +1 -0
  108. package/dist/orchestrators/codegen/errors.d.mts +1 -0
  109. package/dist/orchestrators/codegen/errors.mjs +66 -0
  110. package/dist/orchestrators/codegen/errors.mjs.map +1 -0
  111. package/dist/orchestrators/codegen/extras.mjs +16 -0
  112. package/dist/orchestrators/codegen/extras.mjs.map +1 -0
  113. package/dist/orchestrators/codegen/format.mjs +109 -0
  114. package/dist/orchestrators/codegen/format.mjs.map +1 -0
  115. package/dist/orchestrators/codegen/gitignore.mjs +67 -0
  116. package/dist/orchestrators/codegen/gitignore.mjs.map +1 -0
  117. package/dist/orchestrators/codegen/paths.d.mts +1 -0
  118. package/dist/orchestrators/codegen/paths.mjs +33 -0
  119. package/dist/orchestrators/codegen/paths.mjs.map +1 -0
  120. package/dist/orchestrators/codegen/permissions.mjs +6 -0
  121. package/dist/orchestrators/codegen/permissions.mjs.map +1 -0
  122. package/dist/orchestrators/codegen/service.d.mts +1 -0
  123. package/dist/orchestrators/codegen/service.mjs +276 -0
  124. package/dist/orchestrators/codegen/service.mjs.map +1 -0
  125. package/dist/orchestrators/router/cleanup.mjs +58 -0
  126. package/dist/orchestrators/router/cleanup.mjs.map +1 -0
  127. package/dist/orchestrators/router/cors.mjs +31 -0
  128. package/dist/orchestrators/router/cors.mjs.map +1 -0
  129. package/dist/orchestrators/router/entrypoints.d.mts +1 -0
  130. package/dist/orchestrators/router/entrypoints.mjs +80 -0
  131. package/dist/orchestrators/router/entrypoints.mjs.map +1 -0
  132. package/dist/orchestrators/router/errors.d.mts +1 -0
  133. package/dist/orchestrators/router/errors.mjs +103 -0
  134. package/dist/orchestrators/router/errors.mjs.map +1 -0
  135. package/dist/orchestrators/router/file-provider.d.mts +1 -0
  136. package/dist/orchestrators/router/file-provider.mjs +320 -0
  137. package/dist/orchestrators/router/file-provider.mjs.map +1 -0
  138. package/dist/orchestrators/router/hostname.d.mts +1 -0
  139. package/dist/orchestrators/router/hostname.mjs +107 -0
  140. package/dist/orchestrators/router/hostname.mjs.map +1 -0
  141. package/dist/orchestrators/router/index.d.mts +1 -0
  142. package/dist/orchestrators/router/profile.d.mts +1 -0
  143. package/dist/orchestrators/router/profile.mjs +109 -0
  144. package/dist/orchestrators/router/profile.mjs.map +1 -0
  145. package/dist/orchestrators/router/service.d.mts +3 -0
  146. package/dist/orchestrators/router/service.mjs +421 -0
  147. package/dist/orchestrators/router/service.mjs.map +1 -0
  148. package/dist/orchestrators/router/traefik-container.d.mts +1 -0
  149. package/dist/orchestrators/router/traefik-container.mjs +229 -0
  150. package/dist/orchestrators/router/traefik-container.mjs.map +1 -0
  151. package/dist/orchestrators/runtime-composition.d.mts +10 -0
  152. package/dist/orchestrators/runtime-composition.mjs +168 -0
  153. package/dist/orchestrators/runtime-composition.mjs.map +1 -0
  154. package/dist/orchestrators/snapshot/capture.d.mts +1 -0
  155. package/dist/orchestrators/snapshot/capture.mjs +350 -0
  156. package/dist/orchestrators/snapshot/capture.mjs.map +1 -0
  157. package/dist/orchestrators/snapshot/descriptor.d.mts +1 -0
  158. package/dist/orchestrators/snapshot/descriptor.mjs +109 -0
  159. package/dist/orchestrators/snapshot/descriptor.mjs.map +1 -0
  160. package/dist/orchestrators/snapshot/identity-guard.d.mts +1 -0
  161. package/dist/orchestrators/snapshot/identity-guard.mjs +132 -0
  162. package/dist/orchestrators/snapshot/identity-guard.mjs.map +1 -0
  163. package/dist/orchestrators/snapshot/image-bundle-tags.mjs +207 -0
  164. package/dist/orchestrators/snapshot/image-bundle-tags.mjs.map +1 -0
  165. package/dist/orchestrators/snapshot/index.d.mts +1 -0
  166. package/dist/orchestrators/snapshot/integrity.d.mts +1 -0
  167. package/dist/orchestrators/snapshot/integrity.mjs +74 -0
  168. package/dist/orchestrators/snapshot/integrity.mjs.map +1 -0
  169. package/dist/orchestrators/snapshot/prune.d.mts +1 -0
  170. package/dist/orchestrators/snapshot/prune.mjs +110 -0
  171. package/dist/orchestrators/snapshot/prune.mjs.map +1 -0
  172. package/dist/orchestrators/snapshot/restore.d.mts +1 -0
  173. package/dist/orchestrators/snapshot/restore.mjs +404 -0
  174. package/dist/orchestrators/snapshot/restore.mjs.map +1 -0
  175. package/dist/orchestrators/snapshot/service.d.mts +1 -0
  176. package/dist/orchestrators/snapshot/service.mjs +296 -0
  177. package/dist/orchestrators/snapshot/service.mjs.map +1 -0
  178. package/dist/orchestrators/snapshot/state-document.mjs +18 -0
  179. package/dist/orchestrators/snapshot/state-document.mjs.map +1 -0
  180. package/dist/orchestrators/snapshot/wipe.d.mts +1 -0
  181. package/dist/orchestrators/snapshot/wipe.mjs +59 -0
  182. package/dist/orchestrators/snapshot/wipe.mjs.map +1 -0
  183. package/dist/plugins/account/codegen.d.mts +12 -0
  184. package/dist/plugins/account/codegen.mjs +22 -0
  185. package/dist/plugins/account/codegen.mjs.map +1 -0
  186. package/dist/plugins/account/errors.d.mts +44 -0
  187. package/dist/plugins/account/errors.mjs +16 -0
  188. package/dist/plugins/account/errors.mjs.map +1 -0
  189. package/dist/plugins/account/funding.d.mts +94 -0
  190. package/dist/plugins/account/funding.mjs +199 -0
  191. package/dist/plugins/account/funding.mjs.map +1 -0
  192. package/dist/plugins/account/index.d.mts +54 -0
  193. package/dist/plugins/account/index.mjs +151 -0
  194. package/dist/plugins/account/index.mjs.map +1 -0
  195. package/dist/plugins/account/keypair.d.mts +32 -0
  196. package/dist/plugins/account/keypair.mjs +99 -0
  197. package/dist/plugins/account/keypair.mjs.map +1 -0
  198. package/dist/plugins/account/lease.mjs +21 -0
  199. package/dist/plugins/account/lease.mjs.map +1 -0
  200. package/dist/plugins/account/registry.d.mts +33 -0
  201. package/dist/plugins/account/registry.mjs +36 -0
  202. package/dist/plugins/account/registry.mjs.map +1 -0
  203. package/dist/plugins/account/service.d.mts +104 -0
  204. package/dist/plugins/account/service.mjs +405 -0
  205. package/dist/plugins/account/service.mjs.map +1 -0
  206. package/dist/plugins/account/snapshot.mjs +33 -0
  207. package/dist/plugins/account/snapshot.mjs.map +1 -0
  208. package/dist/plugins/account/variants/env.mjs +24 -0
  209. package/dist/plugins/account/variants/env.mjs.map +1 -0
  210. package/dist/plugins/account/variants/ephemeral.mjs +72 -0
  211. package/dist/plugins/account/variants/ephemeral.mjs.map +1 -0
  212. package/dist/plugins/account/variants/impersonate.d.mts +16 -0
  213. package/dist/plugins/account/variants/impersonate.mjs +48 -0
  214. package/dist/plugins/account/variants/impersonate.mjs.map +1 -0
  215. package/dist/plugins/account/variants/inline.mjs +13 -0
  216. package/dist/plugins/account/variants/inline.mjs.map +1 -0
  217. package/dist/plugins/account/variants/keystore.mjs +93 -0
  218. package/dist/plugins/account/variants/keystore.mjs.map +1 -0
  219. package/dist/plugins/account/variants/signer.mjs +31 -0
  220. package/dist/plugins/account/variants/signer.mjs.map +1 -0
  221. package/dist/plugins/action/build-context.d.mts +41 -0
  222. package/dist/plugins/action/discriminator.d.mts +20 -0
  223. package/dist/plugins/action/discriminator.mjs +13 -0
  224. package/dist/plugins/action/discriminator.mjs.map +1 -0
  225. package/dist/plugins/action/errors.d.mts +31 -0
  226. package/dist/plugins/action/errors.mjs +13 -0
  227. package/dist/plugins/action/errors.mjs.map +1 -0
  228. package/dist/plugins/action/execute.d.mts +2 -0
  229. package/dist/plugins/action/execute.mjs +145 -0
  230. package/dist/plugins/action/execute.mjs.map +1 -0
  231. package/dist/plugins/action/index.d.mts +56 -0
  232. package/dist/plugins/action/index.mjs +82 -0
  233. package/dist/plugins/action/index.mjs.map +1 -0
  234. package/dist/plugins/action/service.d.mts +26 -0
  235. package/dist/plugins/action/service.mjs +84 -0
  236. package/dist/plugins/action/service.mjs.map +1 -0
  237. package/dist/plugins/coin/address-resolution.d.mts +34 -0
  238. package/dist/plugins/coin/address-resolution.mjs +80 -0
  239. package/dist/plugins/coin/address-resolution.mjs.map +1 -0
  240. package/dist/plugins/coin/codegen.d.mts +16 -0
  241. package/dist/plugins/coin/codegen.mjs +21 -0
  242. package/dist/plugins/coin/codegen.mjs.map +1 -0
  243. package/dist/plugins/coin/discovery.d.mts +26 -0
  244. package/dist/plugins/coin/discovery.mjs +112 -0
  245. package/dist/plugins/coin/discovery.mjs.map +1 -0
  246. package/dist/plugins/coin/errors.d.mts +48 -0
  247. package/dist/plugins/coin/errors.mjs +13 -0
  248. package/dist/plugins/coin/errors.mjs.map +1 -0
  249. package/dist/plugins/coin/index.d.mts +95 -0
  250. package/dist/plugins/coin/index.mjs +172 -0
  251. package/dist/plugins/coin/index.mjs.map +1 -0
  252. package/dist/plugins/coin/metadata.d.mts +15 -0
  253. package/dist/plugins/coin/metadata.mjs +99 -0
  254. package/dist/plugins/coin/metadata.mjs.map +1 -0
  255. package/dist/plugins/coin/mint.d.mts +34 -0
  256. package/dist/plugins/coin/mint.mjs +164 -0
  257. package/dist/plugins/coin/mint.mjs.map +1 -0
  258. package/dist/plugins/coin/registry.d.mts +1 -0
  259. package/dist/plugins/coin/registry.mjs +37 -0
  260. package/dist/plugins/coin/registry.mjs.map +1 -0
  261. package/dist/plugins/coin/service.d.mts +47 -0
  262. package/dist/plugins/coin/service.mjs +51 -0
  263. package/dist/plugins/coin/service.mjs.map +1 -0
  264. package/dist/plugins/coin/snapshot.mjs +19 -0
  265. package/dist/plugins/coin/snapshot.mjs.map +1 -0
  266. package/dist/plugins/coin/type-strings.mjs +49 -0
  267. package/dist/plugins/coin/type-strings.mjs.map +1 -0
  268. package/dist/plugins/deepbook/codegen.d.mts +39 -0
  269. package/dist/plugins/deepbook/codegen.mjs +15 -0
  270. package/dist/plugins/deepbook/codegen.mjs.map +1 -0
  271. package/dist/plugins/deepbook/deploy.mjs +437 -0
  272. package/dist/plugins/deepbook/deploy.mjs.map +1 -0
  273. package/dist/plugins/deepbook/errors.d.mts +29 -0
  274. package/dist/plugins/deepbook/errors.mjs +26 -0
  275. package/dist/plugins/deepbook/errors.mjs.map +1 -0
  276. package/dist/plugins/deepbook/faucet-strategy.d.mts +8 -0
  277. package/dist/plugins/deepbook/faucet-strategy.mjs +81 -0
  278. package/dist/plugins/deepbook/faucet-strategy.mjs.map +1 -0
  279. package/dist/plugins/deepbook/index.d.mts +171 -0
  280. package/dist/plugins/deepbook/index.mjs +359 -0
  281. package/dist/plugins/deepbook/index.mjs.map +1 -0
  282. package/dist/plugins/deepbook/plugin-key.mjs +7 -0
  283. package/dist/plugins/deepbook/plugin-key.mjs.map +1 -0
  284. package/dist/plugins/deepbook/pyth/index.mjs +226 -0
  285. package/dist/plugins/deepbook/pyth/index.mjs.map +1 -0
  286. package/dist/plugins/deepbook/routable.mjs +21 -0
  287. package/dist/plugins/deepbook/routable.mjs.map +1 -0
  288. package/dist/plugins/deepbook/snapshot.mjs +49 -0
  289. package/dist/plugins/deepbook/snapshot.mjs.map +1 -0
  290. package/dist/plugins/deepbook/types.d.mts +125 -0
  291. package/dist/plugins/deepbook/types.mjs +12 -0
  292. package/dist/plugins/deepbook/types.mjs.map +1 -0
  293. package/dist/plugins/faucet/dispatcher.d.mts +9 -0
  294. package/dist/plugins/faucet/dispatcher.mjs +13 -0
  295. package/dist/plugins/faucet/dispatcher.mjs.map +1 -0
  296. package/dist/plugins/faucet/errors.d.mts +86 -0
  297. package/dist/plugins/faucet/errors.mjs +19 -0
  298. package/dist/plugins/faucet/errors.mjs.map +1 -0
  299. package/dist/plugins/faucet/http.mjs +127 -0
  300. package/dist/plugins/faucet/http.mjs.map +1 -0
  301. package/dist/plugins/faucet/index.d.mts +43 -0
  302. package/dist/plugins/faucet/index.mjs +42 -0
  303. package/dist/plugins/faucet/index.mjs.map +1 -0
  304. package/dist/plugins/faucet/service.d.mts +20 -0
  305. package/dist/plugins/faucet/strategies/sui-local.d.mts +23 -0
  306. package/dist/plugins/faucet/strategies/sui-local.mjs +29 -0
  307. package/dist/plugins/faucet/strategies/sui-local.mjs.map +1 -0
  308. package/dist/plugins/host-service/errors.d.mts +27 -0
  309. package/dist/plugins/host-service/errors.mjs +14 -0
  310. package/dist/plugins/host-service/errors.mjs.map +1 -0
  311. package/dist/plugins/host-service/index.d.mts +10 -0
  312. package/dist/plugins/host-service/index.mjs +48 -0
  313. package/dist/plugins/host-service/index.mjs.map +1 -0
  314. package/dist/plugins/host-service/routable.mjs +24 -0
  315. package/dist/plugins/host-service/routable.mjs.map +1 -0
  316. package/dist/plugins/host-service/service.d.mts +49 -0
  317. package/dist/plugins/host-service/service.mjs +375 -0
  318. package/dist/plugins/host-service/service.mjs.map +1 -0
  319. package/dist/plugins/package/build.d.mts +1 -0
  320. package/dist/plugins/package/build.mjs +24 -0
  321. package/dist/plugins/package/build.mjs.map +1 -0
  322. package/dist/plugins/package/codegen.d.mts +19 -0
  323. package/dist/plugins/package/codegen.mjs +41 -0
  324. package/dist/plugins/package/codegen.mjs.map +1 -0
  325. package/dist/plugins/package/dep-resolution.mjs +10 -0
  326. package/dist/plugins/package/dep-resolution.mjs.map +1 -0
  327. package/dist/plugins/package/errors.d.mts +34 -0
  328. package/dist/plugins/package/errors.mjs +13 -0
  329. package/dist/plugins/package/errors.mjs.map +1 -0
  330. package/dist/plugins/package/index.d.mts +109 -0
  331. package/dist/plugins/package/index.mjs +207 -0
  332. package/dist/plugins/package/index.mjs.map +1 -0
  333. package/dist/plugins/package/mode-known.mjs +41 -0
  334. package/dist/plugins/package/mode-known.mjs.map +1 -0
  335. package/dist/plugins/package/mode-local.d.mts +1 -0
  336. package/dist/plugins/package/mode-local.mjs +183 -0
  337. package/dist/plugins/package/mode-local.mjs.map +1 -0
  338. package/dist/plugins/package/publish-executor.mjs +202 -0
  339. package/dist/plugins/package/publish-executor.mjs.map +1 -0
  340. package/dist/plugins/package/publish-output.d.mts +28 -0
  341. package/dist/plugins/package/publish-output.mjs +45 -0
  342. package/dist/plugins/package/publish-output.mjs.map +1 -0
  343. package/dist/plugins/package/registry.d.mts +25 -0
  344. package/dist/plugins/package/registry.mjs +30 -0
  345. package/dist/plugins/package/registry.mjs.map +1 -0
  346. package/dist/plugins/package/service.mjs +20 -0
  347. package/dist/plugins/package/service.mjs.map +1 -0
  348. package/dist/plugins/package/snapshot.mjs +25 -0
  349. package/dist/plugins/package/snapshot.mjs.map +1 -0
  350. package/dist/plugins/postgres/codegen.mjs +42 -0
  351. package/dist/plugins/postgres/codegen.mjs.map +1 -0
  352. package/dist/plugins/postgres/connection.d.mts +33 -0
  353. package/dist/plugins/postgres/connection.mjs +19 -0
  354. package/dist/plugins/postgres/connection.mjs.map +1 -0
  355. package/dist/plugins/postgres/db-ensure.mjs +100 -0
  356. package/dist/plugins/postgres/db-ensure.mjs.map +1 -0
  357. package/dist/plugins/postgres/errors.d.mts +55 -0
  358. package/dist/plugins/postgres/errors.mjs +29 -0
  359. package/dist/plugins/postgres/errors.mjs.map +1 -0
  360. package/dist/plugins/postgres/index.d.mts +37 -0
  361. package/dist/plugins/postgres/index.mjs +75 -0
  362. package/dist/plugins/postgres/index.mjs.map +1 -0
  363. package/dist/plugins/postgres/routable.mjs +33 -0
  364. package/dist/plugins/postgres/routable.mjs.map +1 -0
  365. package/dist/plugins/postgres/service.d.mts +50 -0
  366. package/dist/plugins/postgres/service.mjs +145 -0
  367. package/dist/plugins/postgres/service.mjs.map +1 -0
  368. package/dist/plugins/postgres/snapshot.d.mts +1 -0
  369. package/dist/plugins/postgres/snapshot.mjs +32 -0
  370. package/dist/plugins/postgres/snapshot.mjs.map +1 -0
  371. package/dist/plugins/router-entrypoints.mjs +21 -0
  372. package/dist/plugins/router-entrypoints.mjs.map +1 -0
  373. package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs +59 -0
  374. package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs.map +1 -0
  375. package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs +132 -0
  376. package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs.map +1 -0
  377. package/dist/plugins/seal/codegen.d.mts +19 -0
  378. package/dist/plugins/seal/codegen.mjs +16 -0
  379. package/dist/plugins/seal/codegen.mjs.map +1 -0
  380. package/dist/plugins/seal/config-render.mjs +82 -0
  381. package/dist/plugins/seal/config-render.mjs.map +1 -0
  382. package/dist/plugins/seal/deploy.mjs +198 -0
  383. package/dist/plugins/seal/deploy.mjs.map +1 -0
  384. package/dist/plugins/seal/errors.d.mts +52 -0
  385. package/dist/plugins/seal/errors.mjs +19 -0
  386. package/dist/plugins/seal/errors.mjs.map +1 -0
  387. package/dist/plugins/seal/index.d.mts +161 -0
  388. package/dist/plugins/seal/index.mjs +235 -0
  389. package/dist/plugins/seal/index.mjs.map +1 -0
  390. package/dist/plugins/seal/key-manager.d.mts +22 -0
  391. package/dist/plugins/seal/key-manager.mjs +22 -0
  392. package/dist/plugins/seal/key-manager.mjs.map +1 -0
  393. package/dist/plugins/seal/key-server.mjs +175 -0
  394. package/dist/plugins/seal/key-server.mjs.map +1 -0
  395. package/dist/plugins/seal/keygen.mjs +96 -0
  396. package/dist/plugins/seal/keygen.mjs.map +1 -0
  397. package/dist/plugins/seal/mode/fork-known.d.mts +8 -0
  398. package/dist/plugins/seal/mode/fork-known.mjs +23 -0
  399. package/dist/plugins/seal/mode/fork-known.mjs.map +1 -0
  400. package/dist/plugins/seal/mode/live.d.mts +18 -0
  401. package/dist/plugins/seal/mode/live.mjs +64 -0
  402. package/dist/plugins/seal/mode/live.mjs.map +1 -0
  403. package/dist/plugins/seal/mode/local-keygen.mjs +180 -0
  404. package/dist/plugins/seal/mode/local-keygen.mjs.map +1 -0
  405. package/dist/plugins/seal/plugin-key.mjs +7 -0
  406. package/dist/plugins/seal/plugin-key.mjs.map +1 -0
  407. package/dist/plugins/seal/registry-publish.d.mts +43 -0
  408. package/dist/plugins/seal/registry-publish.mjs +9 -0
  409. package/dist/plugins/seal/registry-publish.mjs.map +1 -0
  410. package/dist/plugins/seal/routable.mjs +57 -0
  411. package/dist/plugins/seal/routable.mjs.map +1 -0
  412. package/dist/plugins/seal/service.mjs +17 -0
  413. package/dist/plugins/seal/service.mjs.map +1 -0
  414. package/dist/plugins/seal/snapshot.mjs +51 -0
  415. package/dist/plugins/seal/snapshot.mjs.map +1 -0
  416. package/dist/plugins/sui/auto-tick.mjs +45 -0
  417. package/dist/plugins/sui/auto-tick.mjs.map +1 -0
  418. package/dist/plugins/sui/chain-build-container.d.mts +1 -0
  419. package/dist/plugins/sui/chain-probe.d.mts +85 -0
  420. package/dist/plugins/sui/chain-probe.mjs +104 -0
  421. package/dist/plugins/sui/chain-probe.mjs.map +1 -0
  422. package/dist/plugins/sui/codegen.d.mts +14 -0
  423. package/dist/plugins/sui/codegen.mjs +26 -0
  424. package/dist/plugins/sui/codegen.mjs.map +1 -0
  425. package/dist/plugins/sui/errors.d.mts +74 -0
  426. package/dist/plugins/sui/errors.mjs +28 -0
  427. package/dist/plugins/sui/errors.mjs.map +1 -0
  428. package/dist/plugins/sui/fork-orchestration.mjs +24 -0
  429. package/dist/plugins/sui/fork-orchestration.mjs.map +1 -0
  430. package/dist/plugins/sui/fork-transaction.mjs +96 -0
  431. package/dist/plugins/sui/fork-transaction.mjs.map +1 -0
  432. package/dist/plugins/sui/index.d.mts +318 -0
  433. package/dist/plugins/sui/index.mjs +182 -0
  434. package/dist/plugins/sui/index.mjs.map +1 -0
  435. package/dist/plugins/sui/mode/external.mjs +60 -0
  436. package/dist/plugins/sui/mode/external.mjs.map +1 -0
  437. package/dist/plugins/sui/mode/fork.mjs +283 -0
  438. package/dist/plugins/sui/mode/fork.mjs.map +1 -0
  439. package/dist/plugins/sui/mode/live.mjs +103 -0
  440. package/dist/plugins/sui/mode/live.mjs.map +1 -0
  441. package/dist/plugins/sui/mode/local.mjs +293 -0
  442. package/dist/plugins/sui/mode/local.mjs.map +1 -0
  443. package/dist/plugins/sui/mode/shared-boot.mjs +254 -0
  444. package/dist/plugins/sui/mode/shared-boot.mjs.map +1 -0
  445. package/dist/plugins/sui/mode/shared.d.mts +103 -0
  446. package/dist/plugins/sui/mode/shared.mjs +12 -0
  447. package/dist/plugins/sui/mode/shared.mjs.map +1 -0
  448. package/dist/plugins/sui/mode/spec.d.mts +94 -0
  449. package/dist/plugins/sui/network-resolver.d.mts +23 -0
  450. package/dist/plugins/sui/routable.mjs +88 -0
  451. package/dist/plugins/sui/routable.mjs.map +1 -0
  452. package/dist/plugins/sui/seed-objects.d.mts +18 -0
  453. package/dist/plugins/sui/seed-objects.mjs +25 -0
  454. package/dist/plugins/sui/seed-objects.mjs.map +1 -0
  455. package/dist/plugins/sui/service.mjs +38 -0
  456. package/dist/plugins/sui/service.mjs.map +1 -0
  457. package/dist/plugins/sui/snapshot.mjs +53 -0
  458. package/dist/plugins/sui/snapshot.mjs.map +1 -0
  459. package/dist/plugins/wallet/codegen.d.mts +33 -0
  460. package/dist/plugins/wallet/codegen.mjs +34 -0
  461. package/dist/plugins/wallet/codegen.mjs.map +1 -0
  462. package/dist/plugins/wallet/errors.d.mts +66 -0
  463. package/dist/plugins/wallet/errors.mjs +16 -0
  464. package/dist/plugins/wallet/errors.mjs.map +1 -0
  465. package/dist/plugins/wallet/index.d.mts +63 -0
  466. package/dist/plugins/wallet/index.mjs +126 -0
  467. package/dist/plugins/wallet/index.mjs.map +1 -0
  468. package/dist/plugins/wallet/origin-policy.d.mts +1 -0
  469. package/dist/plugins/wallet/origin-policy.mjs +65 -0
  470. package/dist/plugins/wallet/origin-policy.mjs.map +1 -0
  471. package/dist/plugins/wallet/pairing.d.mts +11 -0
  472. package/dist/plugins/wallet/pairing.mjs +125 -0
  473. package/dist/plugins/wallet/pairing.mjs.map +1 -0
  474. package/dist/plugins/wallet/protocol.d.mts +1 -0
  475. package/dist/plugins/wallet/protocol.mjs +96 -0
  476. package/dist/plugins/wallet/protocol.mjs.map +1 -0
  477. package/dist/plugins/wallet/routable.mjs +32 -0
  478. package/dist/plugins/wallet/routable.mjs.map +1 -0
  479. package/dist/plugins/wallet/server.d.mts +12 -0
  480. package/dist/plugins/wallet/server.mjs +317 -0
  481. package/dist/plugins/wallet/server.mjs.map +1 -0
  482. package/dist/plugins/wallet/service.d.mts +68 -0
  483. package/dist/plugins/wallet/service.mjs +97 -0
  484. package/dist/plugins/wallet/service.mjs.map +1 -0
  485. package/dist/plugins/wallet/snapshot.d.mts +1 -0
  486. package/dist/plugins/wallet/snapshot.mjs +14 -0
  487. package/dist/plugins/wallet/snapshot.mjs.map +1 -0
  488. package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs +42 -0
  489. package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs.map +1 -0
  490. package/dist/plugins/walrus/codegen.d.mts +38 -0
  491. package/dist/plugins/walrus/codegen.mjs +34 -0
  492. package/dist/plugins/walrus/codegen.mjs.map +1 -0
  493. package/dist/plugins/walrus/deploy-paths.mjs +14 -0
  494. package/dist/plugins/walrus/deploy-paths.mjs.map +1 -0
  495. package/dist/plugins/walrus/deploy.d.mts +1 -0
  496. package/dist/plugins/walrus/deploy.mjs +224 -0
  497. package/dist/plugins/walrus/deploy.mjs.map +1 -0
  498. package/dist/plugins/walrus/errors.d.mts +38 -0
  499. package/dist/plugins/walrus/errors.mjs +26 -0
  500. package/dist/plugins/walrus/errors.mjs.map +1 -0
  501. package/dist/plugins/walrus/faucet-strategy.d.mts +12 -0
  502. package/dist/plugins/walrus/faucet-strategy.mjs +62 -0
  503. package/dist/plugins/walrus/faucet-strategy.mjs.map +1 -0
  504. package/dist/plugins/walrus/index.d.mts +177 -0
  505. package/dist/plugins/walrus/index.mjs +284 -0
  506. package/dist/plugins/walrus/index.mjs.map +1 -0
  507. package/dist/plugins/walrus/mode/known-deploy.d.mts +25 -0
  508. package/dist/plugins/walrus/mode/known-deploy.mjs +71 -0
  509. package/dist/plugins/walrus/mode/known-deploy.mjs.map +1 -0
  510. package/dist/plugins/walrus/mode/local-cluster.d.mts +34 -0
  511. package/dist/plugins/walrus/mode/local-cluster.mjs +153 -0
  512. package/dist/plugins/walrus/mode/local-cluster.mjs.map +1 -0
  513. package/dist/plugins/walrus/plugin-key.mjs +7 -0
  514. package/dist/plugins/walrus/plugin-key.mjs.map +1 -0
  515. package/dist/plugins/walrus/registry-publish.d.mts +24 -0
  516. package/dist/plugins/walrus/registry-publish.mjs +7 -0
  517. package/dist/plugins/walrus/registry-publish.mjs.map +1 -0
  518. package/dist/plugins/walrus/routable.mjs +99 -0
  519. package/dist/plugins/walrus/routable.mjs.map +1 -0
  520. package/dist/plugins/walrus/service.mjs +20 -0
  521. package/dist/plugins/walrus/service.mjs.map +1 -0
  522. package/dist/plugins/walrus/snapshot.mjs +53 -0
  523. package/dist/plugins/walrus/snapshot.mjs.map +1 -0
  524. package/dist/plugins/walrus/storage-nodes.d.mts +15 -0
  525. package/dist/plugins/walrus/storage-nodes.mjs +154 -0
  526. package/dist/plugins/walrus/storage-nodes.mjs.map +1 -0
  527. package/dist/plugins/walrus/wal-swap.d.mts +2 -0
  528. package/dist/plugins/walrus/wal-swap.mjs +58 -0
  529. package/dist/plugins/walrus/wal-swap.mjs.map +1 -0
  530. package/dist/primitives/artifact-publisher.d.mts +12 -0
  531. package/dist/primitives/cache.d.mts +1 -0
  532. package/dist/runtime/built-in-plugin-layers.mjs +49 -0
  533. package/dist/runtime/built-in-plugin-layers.mjs.map +1 -0
  534. package/dist/runtime/docker/client.d.mts +2 -0
  535. package/dist/runtime/docker/client.mjs +54 -0
  536. package/dist/runtime/docker/client.mjs.map +1 -0
  537. package/dist/runtime/docker/container.d.mts +1 -0
  538. package/dist/runtime/docker/container.mjs +562 -0
  539. package/dist/runtime/docker/container.mjs.map +1 -0
  540. package/dist/runtime/docker/errors.d.mts +1 -0
  541. package/dist/runtime/docker/errors.mjs +187 -0
  542. package/dist/runtime/docker/errors.mjs.map +1 -0
  543. package/dist/runtime/docker/exec.d.mts +1 -0
  544. package/dist/runtime/docker/exec.mjs +63 -0
  545. package/dist/runtime/docker/exec.mjs.map +1 -0
  546. package/dist/runtime/docker/image.d.mts +1 -0
  547. package/dist/runtime/docker/image.mjs +278 -0
  548. package/dist/runtime/docker/image.mjs.map +1 -0
  549. package/dist/runtime/docker/index.d.mts +1 -0
  550. package/dist/runtime/docker/inventory.d.mts +1 -0
  551. package/dist/runtime/docker/inventory.mjs +167 -0
  552. package/dist/runtime/docker/inventory.mjs.map +1 -0
  553. package/dist/runtime/docker/labels.d.mts +1 -0
  554. package/dist/runtime/docker/labels.mjs +97 -0
  555. package/dist/runtime/docker/labels.mjs.map +1 -0
  556. package/dist/runtime/docker/logs.d.mts +1 -0
  557. package/dist/runtime/docker/logs.mjs +34 -0
  558. package/dist/runtime/docker/logs.mjs.map +1 -0
  559. package/dist/runtime/docker/network.d.mts +1 -0
  560. package/dist/runtime/docker/network.mjs +168 -0
  561. package/dist/runtime/docker/network.mjs.map +1 -0
  562. package/dist/runtime/docker/service.d.mts +9 -0
  563. package/dist/runtime/docker/service.mjs +266 -0
  564. package/dist/runtime/docker/service.mjs.map +1 -0
  565. package/dist/runtime/docker/sweep.d.mts +1 -0
  566. package/dist/runtime/docker/sweep.mjs +220 -0
  567. package/dist/runtime/docker/sweep.mjs.map +1 -0
  568. package/dist/runtime/docker/volume.d.mts +1 -0
  569. package/dist/runtime/docker/volume.mjs +24 -0
  570. package/dist/runtime/docker/volume.mjs.map +1 -0
  571. package/dist/runtime/docker/wrap.d.mts +1 -0
  572. package/dist/runtime/docker/wrap.mjs +131 -0
  573. package/dist/runtime/docker/wrap.mjs.map +1 -0
  574. package/dist/substrate/brand.d.mts +24 -0
  575. package/dist/substrate/brand.mjs +14 -0
  576. package/dist/substrate/brand.mjs.map +1 -0
  577. package/dist/substrate/cross-process.d.mts +1 -0
  578. package/dist/substrate/cross-process.mjs +28 -0
  579. package/dist/substrate/cross-process.mjs.map +1 -0
  580. package/dist/substrate/events.d.mts +117 -0
  581. package/dist/substrate/identity.d.mts +13 -0
  582. package/dist/substrate/lifecycle.d.mts +12 -0
  583. package/dist/substrate/manifest.d.mts +39 -0
  584. package/dist/substrate/manifest.mjs +33 -0
  585. package/dist/substrate/manifest.mjs.map +1 -0
  586. package/dist/substrate/network.d.mts +34 -0
  587. package/dist/substrate/options.d.mts +23 -0
  588. package/dist/substrate/plugin.d.mts +101 -0
  589. package/dist/substrate/plugin.mjs +61 -0
  590. package/dist/substrate/plugin.mjs.map +1 -0
  591. package/dist/substrate/projection.d.mts +100 -0
  592. package/dist/substrate/runtime/artifact-publisher/index.mjs +76 -0
  593. package/dist/substrate/runtime/artifact-publisher/index.mjs.map +1 -0
  594. package/dist/substrate/runtime/atomic-write.mjs +106 -0
  595. package/dist/substrate/runtime/atomic-write.mjs.map +1 -0
  596. package/dist/substrate/runtime/cache/index.d.mts +1 -0
  597. package/dist/substrate/runtime/cache/schema.d.mts +1 -0
  598. package/dist/substrate/runtime/cache/schema.mjs +22 -0
  599. package/dist/substrate/runtime/cache/schema.mjs.map +1 -0
  600. package/dist/substrate/runtime/cache/service.d.mts +1 -0
  601. package/dist/substrate/runtime/cache/service.mjs +89 -0
  602. package/dist/substrate/runtime/cache/service.mjs.map +1 -0
  603. package/dist/substrate/runtime/capability-sinks/index.d.mts +1 -0
  604. package/dist/substrate/runtime/capability-sinks/layer.d.mts +1 -0
  605. package/dist/substrate/runtime/capability-sinks/layer.mjs +31 -0
  606. package/dist/substrate/runtime/capability-sinks/layer.mjs.map +1 -0
  607. package/dist/substrate/runtime/capability-sinks/service.d.mts +36 -0
  608. package/dist/substrate/runtime/capability-sinks/service.mjs +74 -0
  609. package/dist/substrate/runtime/capability-sinks/service.mjs.map +1 -0
  610. package/dist/substrate/runtime/config-validation.d.mts +38 -0
  611. package/dist/substrate/runtime/config-validation.mjs +137 -0
  612. package/dist/substrate/runtime/config-validation.mjs.map +1 -0
  613. package/dist/substrate/runtime/context-helpers.mjs +32 -0
  614. package/dist/substrate/runtime/context-helpers.mjs.map +1 -0
  615. package/dist/substrate/runtime/cross-process/command-channel/channel.mjs +128 -0
  616. package/dist/substrate/runtime/cross-process/command-channel/channel.mjs.map +1 -0
  617. package/dist/substrate/runtime/cross-process/command-channel/file-channel.mjs +136 -0
  618. package/dist/substrate/runtime/cross-process/command-channel/file-channel.mjs.map +1 -0
  619. package/dist/substrate/runtime/cross-process/command-channel/protocol.mjs +49 -0
  620. package/dist/substrate/runtime/cross-process/command-channel/protocol.mjs.map +1 -0
  621. package/dist/substrate/runtime/cross-process/command-channel/runtime-control-lock.mjs +9 -0
  622. package/dist/substrate/runtime/cross-process/command-channel/runtime-control-lock.mjs.map +1 -0
  623. package/dist/substrate/runtime/cross-process/liveness.mjs +119 -0
  624. package/dist/substrate/runtime/cross-process/liveness.mjs.map +1 -0
  625. package/dist/substrate/runtime/cross-process/roster.mjs +275 -0
  626. package/dist/substrate/runtime/cross-process/roster.mjs.map +1 -0
  627. package/dist/substrate/runtime/cross-process/snapshot-reservation.d.mts +1 -0
  628. package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs +117 -0
  629. package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs.map +1 -0
  630. package/dist/substrate/runtime/cross-process/stack-lock.d.mts +1 -0
  631. package/dist/substrate/runtime/cross-process/stack-lock.mjs +142 -0
  632. package/dist/substrate/runtime/cross-process/stack-lock.mjs.map +1 -0
  633. package/dist/substrate/runtime/current-plugin.mjs +15 -0
  634. package/dist/substrate/runtime/current-plugin.mjs.map +1 -0
  635. package/dist/substrate/runtime/errors.d.mts +1 -0
  636. package/dist/substrate/runtime/errors.mjs +76 -0
  637. package/dist/substrate/runtime/errors.mjs.map +1 -0
  638. package/dist/substrate/runtime/host-tree-tar/index.mjs +364 -0
  639. package/dist/substrate/runtime/host-tree-tar/index.mjs.map +1 -0
  640. package/dist/substrate/runtime/http-probe.d.mts +35 -0
  641. package/dist/substrate/runtime/http-probe.mjs +65 -0
  642. package/dist/substrate/runtime/http-probe.mjs.map +1 -0
  643. package/dist/substrate/runtime/lease-broker/index.d.mts +1 -0
  644. package/dist/substrate/runtime/lease-broker/service.d.mts +64 -0
  645. package/dist/substrate/runtime/lease-broker/service.mjs +155 -0
  646. package/dist/substrate/runtime/lease-broker/service.mjs.map +1 -0
  647. package/dist/substrate/runtime/lifecycle/dep-graph.d.mts +1 -0
  648. package/dist/substrate/runtime/lifecycle/dep-graph.mjs +138 -0
  649. package/dist/substrate/runtime/lifecycle/dep-graph.mjs.map +1 -0
  650. package/dist/substrate/runtime/lifecycle/index.d.mts +1 -0
  651. package/dist/substrate/runtime/lifecycle/lifecycle-fact.mjs +31 -0
  652. package/dist/substrate/runtime/lifecycle/lifecycle-fact.mjs.map +1 -0
  653. package/dist/substrate/runtime/lifecycle/plugin-registry.d.mts +1 -0
  654. package/dist/substrate/runtime/lifecycle/plugin-registry.mjs +133 -0
  655. package/dist/substrate/runtime/lifecycle/plugin-registry.mjs.map +1 -0
  656. package/dist/substrate/runtime/lifecycle/ready-gate.d.mts +1 -0
  657. package/dist/substrate/runtime/lifecycle/ready-gate.mjs +34 -0
  658. package/dist/substrate/runtime/lifecycle/ready-gate.mjs.map +1 -0
  659. package/dist/substrate/runtime/lifecycle/selective-restart.d.mts +1 -0
  660. package/dist/substrate/runtime/lifecycle/selective-restart.mjs +43 -0
  661. package/dist/substrate/runtime/lifecycle/selective-restart.mjs.map +1 -0
  662. package/dist/substrate/runtime/lifecycle/signals.d.mts +1 -0
  663. package/dist/substrate/runtime/lifecycle/signals.mjs +64 -0
  664. package/dist/substrate/runtime/lifecycle/signals.mjs.map +1 -0
  665. package/dist/substrate/runtime/lifecycle/state-machine.d.mts +1 -0
  666. package/dist/substrate/runtime/lifecycle/state-machine.mjs +38 -0
  667. package/dist/substrate/runtime/lifecycle/state-machine.mjs.map +1 -0
  668. package/dist/substrate/runtime/lifecycle/watch-attribution.d.mts +1 -0
  669. package/dist/substrate/runtime/lifecycle/watch-attribution.mjs +27 -0
  670. package/dist/substrate/runtime/lifecycle/watch-attribution.mjs.map +1 -0
  671. package/dist/substrate/runtime/managed-container.d.mts +30 -0
  672. package/dist/substrate/runtime/managed-container.mjs +32 -0
  673. package/dist/substrate/runtime/managed-container.mjs.map +1 -0
  674. package/dist/substrate/runtime/manifest/manifest.mjs +73 -0
  675. package/dist/substrate/runtime/manifest/manifest.mjs.map +1 -0
  676. package/dist/substrate/runtime/mode-errors.d.mts +36 -0
  677. package/dist/substrate/runtime/observability/cascade-formatter.d.mts +1 -0
  678. package/dist/substrate/runtime/observability/cascade-formatter.mjs +135 -0
  679. package/dist/substrate/runtime/observability/cascade-formatter.mjs.map +1 -0
  680. package/dist/substrate/runtime/observability/formatter-registry.d.mts +1 -0
  681. package/dist/substrate/runtime/observability/formatter-registry.mjs +65 -0
  682. package/dist/substrate/runtime/observability/formatter-registry.mjs.map +1 -0
  683. package/dist/substrate/runtime/observability/index.d.mts +3 -0
  684. package/dist/substrate/runtime/observability/logger.d.mts +58 -0
  685. package/dist/substrate/runtime/observability/logger.mjs +89 -0
  686. package/dist/substrate/runtime/observability/logger.mjs.map +1 -0
  687. package/dist/substrate/runtime/observability/pretty-error.d.mts +1 -0
  688. package/dist/substrate/runtime/observability/pretty-error.mjs +119 -0
  689. package/dist/substrate/runtime/observability/pretty-error.mjs.map +1 -0
  690. package/dist/substrate/runtime/observability/process-lines.d.mts +31 -0
  691. package/dist/substrate/runtime/observability/process-lines.mjs +40 -0
  692. package/dist/substrate/runtime/observability/process-lines.mjs.map +1 -0
  693. package/dist/substrate/runtime/observability/redaction.d.mts +28 -0
  694. package/dist/substrate/runtime/observability/redaction.mjs +45 -0
  695. package/dist/substrate/runtime/observability/redaction.mjs.map +1 -0
  696. package/dist/substrate/runtime/observability/spans.d.mts +1 -0
  697. package/dist/substrate/runtime/observability/spans.mjs +87 -0
  698. package/dist/substrate/runtime/observability/spans.mjs.map +1 -0
  699. package/dist/substrate/runtime/observability/subprocess-capture.d.mts +2 -0
  700. package/dist/substrate/runtime/observability/subprocess-capture.mjs +82 -0
  701. package/dist/substrate/runtime/observability/subprocess-capture.mjs.map +1 -0
  702. package/dist/substrate/runtime/paths.d.mts +17 -0
  703. package/dist/substrate/runtime/paths.mjs +61 -0
  704. package/dist/substrate/runtime/paths.mjs.map +1 -0
  705. package/dist/substrate/runtime/port-broker/index.d.mts +1 -0
  706. package/dist/substrate/runtime/port-broker/service.d.mts +1 -0
  707. package/dist/substrate/runtime/port-broker/service.mjs +319 -0
  708. package/dist/substrate/runtime/port-broker/service.mjs.map +1 -0
  709. package/dist/substrate/runtime/post-acquire-tasks.d.mts +1 -0
  710. package/dist/substrate/runtime/post-acquire-tasks.mjs +34 -0
  711. package/dist/substrate/runtime/post-acquire-tasks.mjs.map +1 -0
  712. package/dist/substrate/runtime/probes.d.mts +51 -0
  713. package/dist/substrate/runtime/probes.mjs +84 -0
  714. package/dist/substrate/runtime/probes.mjs.map +1 -0
  715. package/dist/substrate/runtime/process-supervisor.d.mts +57 -0
  716. package/dist/substrate/runtime/process-supervisor.mjs +73 -0
  717. package/dist/substrate/runtime/process-supervisor.mjs.map +1 -0
  718. package/dist/substrate/runtime/projection/operational-endpoints.mjs +44 -0
  719. package/dist/substrate/runtime/projection/operational-endpoints.mjs.map +1 -0
  720. package/dist/substrate/runtime/projection/persisted.mjs +195 -0
  721. package/dist/substrate/runtime/projection/persisted.mjs.map +1 -0
  722. package/dist/substrate/runtime/projection/state-ref.mjs +48 -0
  723. package/dist/substrate/runtime/projection/state-ref.mjs.map +1 -0
  724. package/dist/substrate/runtime/projection/update.mjs +200 -0
  725. package/dist/substrate/runtime/projection/update.mjs.map +1 -0
  726. package/dist/substrate/runtime/retry-policy.d.mts +18 -0
  727. package/dist/substrate/runtime/retry-policy.mjs +16 -0
  728. package/dist/substrate/runtime/retry-policy.mjs.map +1 -0
  729. package/dist/substrate/runtime/run.mjs +86 -0
  730. package/dist/substrate/runtime/run.mjs.map +1 -0
  731. package/dist/substrate/runtime/runtime-decode.d.mts +32 -0
  732. package/dist/substrate/runtime/runtime-decode.mjs +53 -0
  733. package/dist/substrate/runtime/runtime-decode.mjs.map +1 -0
  734. package/dist/substrate/runtime/scoped-http-server.mjs +36 -0
  735. package/dist/substrate/runtime/scoped-http-server.mjs.map +1 -0
  736. package/dist/substrate/runtime/scoped-ref-map/service.mjs +83 -0
  737. package/dist/substrate/runtime/scoped-ref-map/service.mjs.map +1 -0
  738. package/dist/substrate/runtime/stage-and-swap/index.d.mts +1 -0
  739. package/dist/substrate/runtime/stage-and-swap/index.mjs +131 -0
  740. package/dist/substrate/runtime/stage-and-swap/index.mjs.map +1 -0
  741. package/dist/substrate/runtime/state-store/schema.mjs +36 -0
  742. package/dist/substrate/runtime/state-store/schema.mjs.map +1 -0
  743. package/dist/substrate/runtime/strategy-registry/chain-probe-for.d.mts +1 -0
  744. package/dist/substrate/runtime/strategy-registry/chain-probe-for.mjs +22 -0
  745. package/dist/substrate/runtime/strategy-registry/chain-probe-for.mjs.map +1 -0
  746. package/dist/substrate/runtime/strategy-registry/faucet-capability-for.d.mts +1 -0
  747. package/dist/substrate/runtime/strategy-registry/faucet-capability-for.mjs +30 -0
  748. package/dist/substrate/runtime/strategy-registry/faucet-capability-for.mjs.map +1 -0
  749. package/dist/substrate/runtime/strategy-registry/index.d.mts +1 -0
  750. package/dist/substrate/runtime/strategy-registry/service.d.mts +1 -0
  751. package/dist/substrate/runtime/strategy-registry/service.mjs +67 -0
  752. package/dist/substrate/runtime/strategy-registry/service.mjs.map +1 -0
  753. package/dist/substrate/runtime/sui-execute/index.d.mts +11 -0
  754. package/dist/substrate/runtime/sui-execute/index.mjs +144 -0
  755. package/dist/substrate/runtime/sui-execute/index.mjs.map +1 -0
  756. package/dist/substrate/runtime/sui-move-build/index.d.mts +1 -0
  757. package/dist/substrate/runtime/sui-move-build/index.mjs +283 -0
  758. package/dist/substrate/runtime/sui-move-build/index.mjs.map +1 -0
  759. package/dist/substrate/runtime/supervisor.d.mts +1 -0
  760. package/dist/substrate/runtime/supervisor.mjs +831 -0
  761. package/dist/substrate/runtime/supervisor.mjs.map +1 -0
  762. package/dist/surfaces/cli/command-tree.mjs +276 -0
  763. package/dist/surfaces/cli/command-tree.mjs.map +1 -0
  764. package/dist/surfaces/cli/commands/config.mjs +31 -0
  765. package/dist/surfaces/cli/commands/config.mjs.map +1 -0
  766. package/dist/surfaces/cli/commands/confirm-node.mjs +26 -0
  767. package/dist/surfaces/cli/commands/confirm-node.mjs.map +1 -0
  768. package/dist/surfaces/cli/commands/confirm.mjs +26 -0
  769. package/dist/surfaces/cli/commands/confirm.mjs.map +1 -0
  770. package/dist/surfaces/cli/commands/doctor-probes.mjs +452 -0
  771. package/dist/surfaces/cli/commands/doctor-probes.mjs.map +1 -0
  772. package/dist/surfaces/cli/commands/doctor.mjs +38 -0
  773. package/dist/surfaces/cli/commands/doctor.mjs.map +1 -0
  774. package/dist/surfaces/cli/commands/prune-picker.mjs +347 -0
  775. package/dist/surfaces/cli/commands/prune-picker.mjs.map +1 -0
  776. package/dist/surfaces/cli/commands/prune.mjs +178 -0
  777. package/dist/surfaces/cli/commands/prune.mjs.map +1 -0
  778. package/dist/surfaces/cli/commands/snapshot.mjs +141 -0
  779. package/dist/surfaces/cli/commands/snapshot.mjs.map +1 -0
  780. package/dist/surfaces/cli/commands/status.mjs +95 -0
  781. package/dist/surfaces/cli/commands/status.mjs.map +1 -0
  782. package/dist/surfaces/cli/commands/supervisor-presence.mjs +33 -0
  783. package/dist/surfaces/cli/commands/supervisor-presence.mjs.map +1 -0
  784. package/dist/surfaces/cli/commands/wipe.mjs +28 -0
  785. package/dist/surfaces/cli/commands/wipe.mjs.map +1 -0
  786. package/dist/surfaces/cli/envelope.mjs +43 -0
  787. package/dist/surfaces/cli/envelope.mjs.map +1 -0
  788. package/dist/surfaces/cli/errors.mjs +110 -0
  789. package/dist/surfaces/cli/errors.mjs.map +1 -0
  790. package/dist/surfaces/cli/flags.mjs +56 -0
  791. package/dist/surfaces/cli/flags.mjs.map +1 -0
  792. package/dist/surfaces/cli/index.mjs +418 -0
  793. package/dist/surfaces/cli/index.mjs.map +1 -0
  794. package/dist/surfaces/cli/output.mjs +115 -0
  795. package/dist/surfaces/cli/output.mjs.map +1 -0
  796. package/dist/surfaces/cli/sysexits.mjs +139 -0
  797. package/dist/surfaces/cli/sysexits.mjs.map +1 -0
  798. package/dist/surfaces/tui/app.mjs +104 -0
  799. package/dist/surfaces/tui/app.mjs.map +1 -0
  800. package/dist/surfaces/tui/dashboard.mjs +261 -0
  801. package/dist/surfaces/tui/dashboard.mjs.map +1 -0
  802. package/dist/surfaces/tui/display-derivation.mjs +395 -0
  803. package/dist/surfaces/tui/display-derivation.mjs.map +1 -0
  804. package/dist/surfaces/tui/errors.mjs +11 -0
  805. package/dist/surfaces/tui/errors.mjs.map +1 -0
  806. package/dist/surfaces/tui/event-log.mjs +155 -0
  807. package/dist/surfaces/tui/event-log.mjs.map +1 -0
  808. package/dist/surfaces/tui/heartbeat.mjs +33 -0
  809. package/dist/surfaces/tui/heartbeat.mjs.map +1 -0
  810. package/dist/surfaces/tui/index.mjs +50 -0
  811. package/dist/surfaces/tui/index.mjs.map +1 -0
  812. package/dist/surfaces/tui/input.mjs +104 -0
  813. package/dist/surfaces/tui/input.mjs.map +1 -0
  814. package/dist/surfaces/tui/mode-detect.mjs +32 -0
  815. package/dist/surfaces/tui/mode-detect.mjs.map +1 -0
  816. package/dist/surfaces/tui/mount-ink.mjs +31 -0
  817. package/dist/surfaces/tui/mount-ink.mjs.map +1 -0
  818. package/dist/surfaces/tui/plain-renderer.mjs +170 -0
  819. package/dist/surfaces/tui/plain-renderer.mjs.map +1 -0
  820. package/dist/surfaces/tui/resource-table.mjs +507 -0
  821. package/dist/surfaces/tui/resource-table.mjs.map +1 -0
  822. package/images/_shared/signal-forward.sh +77 -0
  823. package/images/postgres/Dockerfile +32 -0
  824. package/images/seal/Dockerfile +68 -0
  825. package/images/seal/entrypoint.sh +65 -0
  826. package/images/sui/Dockerfile +73 -0
  827. package/images/sui/entrypoint.sh +244 -0
  828. package/images/sui-fork/Dockerfile +53 -0
  829. package/images/sui-fork/entrypoint.sh +51 -0
  830. package/images/walrus/Dockerfile +122 -0
  831. package/images/walrus/deploy-walrus.sh +305 -0
  832. package/images/walrus/run-walrus.sh +53 -0
  833. package/package.json +94 -0
@@ -0,0 +1,124 @@
1
+ import { DEFAULT_STACK_NAME } from "../../api/inference-network.mjs";
2
+ import { ManifestDiscoveryError } from "./errors.mjs";
3
+ import { existsSync, readFileSync } from "node:fs";
4
+ import { dirname, join, resolve } from "node:path";
5
+ //#region src/build-integrations/runtime/discover.ts
6
+ /** Default name of the supervisor's per-user state directory. Mirrors
7
+ * the L0 path resolver. Held here as a literal so the discover walk
8
+ * doesn't reach into the substrate package. */
9
+ const DEFAULT_STATE_DIR = ".devstack";
10
+ /** Default stack name when neither `opts.stack` nor `$DEVSTACK_STACK`
11
+ * yields a useful value. */
12
+ const DEFAULT_STACK = DEFAULT_STACK_NAME;
13
+ const resolveBuildIntegrationStack = (explicit, env = process.env) => {
14
+ const trimmed = (explicit ?? env.DEVSTACK_STACK)?.trim();
15
+ return trimmed !== void 0 && trimmed.length > 0 ? trimmed : DEFAULT_STACK;
16
+ };
17
+ /** Read `name` out of `<dir>/package.json`, strip the `@scope/`
18
+ * prefix and any leading non-alphanumerics. Returns `undefined`
19
+ * when the file is missing / unreadable / has no name field. */
20
+ const readAppName = (dir) => {
21
+ try {
22
+ const pkg = JSON.parse(readFileSync(resolve(dir, "package.json"), "utf8"));
23
+ if (typeof pkg.name !== "string") return void 0;
24
+ const stripped = pkg.name.replace(/^@[^/]+\//, "").replace(/^[^a-zA-Z0-9]+/, "");
25
+ return stripped.length > 0 ? stripped : void 0;
26
+ } catch {
27
+ return;
28
+ }
29
+ };
30
+ /** Walk up from `cwd` to find the closest `package.json` and return
31
+ * its un-scoped `name` field. Returns `undefined` if no package.json
32
+ * is reachable. Bounded to 32 levels — defense against pathological
33
+ * symlink loops. */
34
+ const readAppNameWalkup = (cwd) => {
35
+ let dir = resolve(cwd);
36
+ for (let i = 0; i < 32; i += 1) {
37
+ const name = readAppName(dir);
38
+ if (name !== void 0) return name;
39
+ const parent = dirname(dir);
40
+ if (parent === dir) return void 0;
41
+ dir = parent;
42
+ }
43
+ };
44
+ /** Resolve the framework-neutral identity tuple build integrations
45
+ * need at config-load time. The manifest path is returned even when
46
+ * it does not exist yet so cold-start callers can still compute
47
+ * conventional URLs and watch-ignore paths. */
48
+ const discoverBuildIntegrationIdentity = (options = {}) => {
49
+ const env = options.env ?? process.env;
50
+ const cwd = options.cwd ?? process.cwd();
51
+ const stack = resolveBuildIntegrationStack(options.stack, env);
52
+ const stateDirName = options.stateDir ?? env.DEVSTACK_STATE_DIR ?? ".devstack";
53
+ const discovered = discoverManifestPath({
54
+ cwd,
55
+ stack,
56
+ stateDir: stateDirName,
57
+ env
58
+ });
59
+ const manifestPath = discovered ?? resolve(cwd, stateDirName, "stacks", stack, "manifest.json");
60
+ const stateDir = discovered !== void 0 ? dirname(dirname(dirname(discovered))) : resolve(cwd, stateDirName);
61
+ return {
62
+ app: options.app ?? env.DEVSTACK_APP ?? readAppNameWalkup(cwd),
63
+ stack,
64
+ stateDir,
65
+ manifestPath
66
+ };
67
+ };
68
+ /**
69
+ * Locate an existing devstack manifest on disk. Sync — Playwright's
70
+ * config loader and apps' startup paths both depend on this being
71
+ * synchronous.
72
+ *
73
+ * Returns the absolute path of the first match per the precedence
74
+ * documented at the top of this module, or `undefined` if no candidate
75
+ * exists. Pass `{ required: true }` to throw `ManifestDiscoveryError`
76
+ * on miss instead.
77
+ */
78
+ function discoverManifestPath(opts = {}) {
79
+ const env = opts.env ?? process.env;
80
+ const envOverride = env.DEVSTACK_MANIFEST_PATH;
81
+ if (envOverride !== void 0 && envOverride !== "") {
82
+ const resolved = resolve(envOverride);
83
+ if (existsSync(resolved)) return resolved;
84
+ if (opts.required === true) throw new ManifestDiscoveryError({
85
+ phase: "env-missing",
86
+ path: resolved,
87
+ message: `[devstack] DEVSTACK_MANIFEST_PATH points at ${resolved}, but no file exists there. Unset the env var or run \`devstack up\` to write the manifest.`
88
+ });
89
+ return;
90
+ }
91
+ if (opts.override !== void 0 && opts.override !== "") {
92
+ const resolved = resolve(opts.override);
93
+ if (existsSync(resolved)) return resolved;
94
+ if (opts.required === true) throw new ManifestDiscoveryError({
95
+ phase: "override-missing",
96
+ path: resolved,
97
+ message: `[devstack] explicit manifest path ${resolved} does not exist. Run \`devstack up\` to write the manifest first.`
98
+ });
99
+ return;
100
+ }
101
+ const startDir = opts.cwd ?? process.cwd();
102
+ const stack = resolveBuildIntegrationStack(opts.stack, env);
103
+ const stateDir = opts.stateDir ?? env.DEVSTACK_STATE_DIR ?? ".devstack";
104
+ let dir = resolve(startDir);
105
+ while (true) {
106
+ const candidate = join(dir, stateDir, "stacks", stack, "manifest.json");
107
+ if (existsSync(candidate)) return candidate;
108
+ const parent = dirname(dir);
109
+ if (parent === dir) break;
110
+ dir = parent;
111
+ }
112
+ if (opts.required === true) {
113
+ const expected = resolve(startDir, stateDir, "stacks", stack, "manifest.json");
114
+ throw new ManifestDiscoveryError({
115
+ phase: "walk-up",
116
+ path: expected,
117
+ message: `[devstack] no manifest.json found walking up from ${startDir} (looked for ${stateDir}/stacks/${stack}/manifest.json at each level). Run \`devstack up\` — it writes the manifest at ${expected}.`
118
+ });
119
+ }
120
+ }
121
+ //#endregion
122
+ export { DEFAULT_STACK, DEFAULT_STATE_DIR, discoverBuildIntegrationIdentity, discoverManifestPath, readAppName, readAppNameWalkup, resolveBuildIntegrationStack };
123
+
124
+ //# sourceMappingURL=discover.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discover.mjs","names":[],"sources":["../../../src/build-integrations/runtime/discover.ts"],"sourcesContent":["// Manifest discovery — sync walk-up resolver.\n//\n// Read-side L5 (consumer) bridge between the on-disk manifest the\n// supervisor writes and the apps / build tools that need to find it.\n//\n// Precedence (top to bottom):\n//\n// 1. `DEVSTACK_MANIFEST_PATH` env var — top-level escape hatch. Wins\n// over every other input. If set to a missing file, returns\n// `undefined` (or throws when `required: true`).\n// 2. `override` argument — caller-explicit path. Same precedence\n// semantics as the env var, one rung lower.\n// 3. Walk up from `opts.cwd ?? process.cwd()`. At each directory,\n// check `<stateDir>/stacks/<stack>/manifest.json`. Build\n// integrations resolve `<stack>` from explicit option, then\n// `DEVSTACK_STACK`, then `main`; package metadata is app identity,\n// not an implicit manifest stack selector. The walk stops at the\n// filesystem root.\n//\n// Stack-scoped ONLY. The supervisor writes to\n// `<stateDir>/stacks/<stack>/manifest.json` exclusively; a hit at a\n// flat `<stateDir>/manifest.json` would be stale data from a deleted\n// stack, which would silently steer consumers at the wrong URLs /\n// package ids. Architecture § invariants: \"stack-scoped paths only —\n// a stale flat manifest must NOT be returned.\"\n//\n// Sync because the only host-process that drives this resolver is\n// Playwright config-load, and Playwright's loader API is sync. Cost is\n// a handful of `existsSync` calls — cheap.\n\nimport { existsSync, readFileSync } from 'node:fs';\nimport { dirname, join, resolve } from 'node:path';\n\nimport { ManifestDiscoveryError } from './errors.ts';\nimport { DEFAULT_STACK_NAME } from '../../api/inference-network.ts';\n\n/** Default name of the supervisor's per-user state directory. Mirrors\n * the L0 path resolver. Held here as a literal so the discover walk\n * doesn't reach into the substrate package. */\nexport const DEFAULT_STATE_DIR = '.devstack';\n\n/** Default stack name when neither `opts.stack` nor `$DEVSTACK_STACK`\n * yields a useful value. */\nexport const DEFAULT_STACK = DEFAULT_STACK_NAME;\n\nexport const resolveBuildIntegrationStack = (\n\texplicit: string | undefined,\n\tenv: Readonly<Record<string, string | undefined>> = process.env,\n): string => {\n\tconst selected = explicit ?? env.DEVSTACK_STACK;\n\tconst trimmed = selected?.trim();\n\treturn trimmed !== undefined && trimmed.length > 0 ? trimmed : DEFAULT_STACK;\n};\n\nexport interface DiscoverManifestPathOptions {\n\t/** Caller-supplied override path. Bypasses the walk-up but is still\n\t * existence-checked. Lower precedence than\n\t * `DEVSTACK_MANIFEST_PATH`. */\n\treadonly override?: string;\n\t/** Starting directory for the walk-up. Defaults to\n\t * `process.cwd()`. */\n\treadonly cwd?: string;\n\t/** Stack name. Defaults through `$DEVSTACK_STACK`, then `'main'`. */\n\treadonly stack?: string;\n\t/** State-dir name. Defaults to `$DEVSTACK_STATE_DIR ?? '.devstack'`.\n\t * Absolute paths are honored — the walk-up degenerates into a\n\t * single existence check in that case. */\n\treadonly stateDir?: string;\n\t/** Env bag for the env-precedence step. Defaults to `process.env`.\n\t * Tests pass a fixture (often `{}`) to suppress leaks from the\n\t * ambient environment. */\n\treadonly env?: Readonly<Record<string, string | undefined>>;\n\t/** When `true`, throw `ManifestDiscoveryError` on miss instead of\n\t * returning `undefined`. Default `false` (lets callers that treat\n\t * \"no manifest\" as cold-start branch cleanly). */\n\treadonly required?: boolean;\n}\n\nexport interface BuildIntegrationIdentity {\n\treadonly app: string | undefined;\n\treadonly stack: string;\n\treadonly stateDir: string;\n\treadonly manifestPath: string;\n}\n\nexport interface DiscoverBuildIntegrationIdentityOptions {\n\t/** Resolution cwd. Defaults to `process.cwd()`. */\n\treadonly cwd?: string;\n\t/** Explicit app name. Overrides env + package.json walk-up. */\n\treadonly app?: string;\n\t/** Explicit stack name. Overrides `DEVSTACK_STACK`; otherwise\n\t * defaults to `main`. */\n\treadonly stack?: string;\n\t/** Explicit state-dir name. Overrides `DEVSTACK_STATE_DIR`. */\n\treadonly stateDir?: string;\n\t/** Env bag for tests and config loaders. Defaults to `process.env`. */\n\treadonly env?: Readonly<Record<string, string | undefined>>;\n}\n\n/** Read `name` out of `<dir>/package.json`, strip the `@scope/`\n * prefix and any leading non-alphanumerics. Returns `undefined`\n * when the file is missing / unreadable / has no name field. */\nexport const readAppName = (dir: string): string | undefined => {\n\ttry {\n\t\tconst pkg = JSON.parse(readFileSync(resolve(dir, 'package.json'), 'utf8')) as {\n\t\t\tname?: string;\n\t\t};\n\t\tif (typeof pkg.name !== 'string') return undefined;\n\t\tconst stripped = pkg.name.replace(/^@[^/]+\\//, '').replace(/^[^a-zA-Z0-9]+/, '');\n\t\treturn stripped.length > 0 ? stripped : undefined;\n\t} catch {\n\t\treturn undefined;\n\t}\n};\n\n/** Walk up from `cwd` to find the closest `package.json` and return\n * its un-scoped `name` field. Returns `undefined` if no package.json\n * is reachable. Bounded to 32 levels — defense against pathological\n * symlink loops. */\nexport const readAppNameWalkup = (cwd: string): string | undefined => {\n\tlet dir = resolve(cwd);\n\tfor (let i = 0; i < 32; i += 1) {\n\t\tconst name = readAppName(dir);\n\t\tif (name !== undefined) return name;\n\t\tconst parent = dirname(dir);\n\t\tif (parent === dir) return undefined;\n\t\tdir = parent;\n\t}\n\treturn undefined;\n};\n\n/** Resolve the framework-neutral identity tuple build integrations\n * need at config-load time. The manifest path is returned even when\n * it does not exist yet so cold-start callers can still compute\n * conventional URLs and watch-ignore paths. */\nexport const discoverBuildIntegrationIdentity = (\n\toptions: DiscoverBuildIntegrationIdentityOptions = {},\n): BuildIntegrationIdentity => {\n\tconst env = options.env ?? (process.env as Readonly<Record<string, string | undefined>>);\n\tconst cwd = options.cwd ?? process.cwd();\n\tconst stack = resolveBuildIntegrationStack(options.stack, env);\n\tconst stateDirName = options.stateDir ?? env.DEVSTACK_STATE_DIR ?? DEFAULT_STATE_DIR;\n\n\tconst discovered = discoverManifestPath({ cwd, stack, stateDir: stateDirName, env });\n\tconst manifestPath = discovered ?? resolve(cwd, stateDirName, 'stacks', stack, 'manifest.json');\n\tconst stateDir =\n\t\tdiscovered !== undefined ? dirname(dirname(dirname(discovered))) : resolve(cwd, stateDirName);\n\tconst app = options.app ?? env.DEVSTACK_APP ?? readAppNameWalkup(cwd);\n\n\treturn { app, stack, stateDir, manifestPath };\n};\n\n/**\n * Locate an existing devstack manifest on disk. Sync — Playwright's\n * config loader and apps' startup paths both depend on this being\n * synchronous.\n *\n * Returns the absolute path of the first match per the precedence\n * documented at the top of this module, or `undefined` if no candidate\n * exists. Pass `{ required: true }` to throw `ManifestDiscoveryError`\n * on miss instead.\n */\nexport function discoverManifestPath(opts: DiscoverManifestPathOptions = {}): string | undefined {\n\tconst env = opts.env ?? (process.env as Readonly<Record<string, string | undefined>>);\n\tconst envOverride = env.DEVSTACK_MANIFEST_PATH;\n\tif (envOverride !== undefined && envOverride !== '') {\n\t\tconst resolved = resolve(envOverride);\n\t\tif (existsSync(resolved)) return resolved;\n\t\tif (opts.required === true) {\n\t\t\tthrow new ManifestDiscoveryError({\n\t\t\t\tphase: 'env-missing',\n\t\t\t\tpath: resolved,\n\t\t\t\tmessage:\n\t\t\t\t\t`[devstack] DEVSTACK_MANIFEST_PATH points at ${resolved}, but no file exists there. ` +\n\t\t\t\t\t`Unset the env var or run \\`devstack up\\` to write the manifest.`,\n\t\t\t});\n\t\t}\n\t\treturn undefined;\n\t}\n\tif (opts.override !== undefined && opts.override !== '') {\n\t\tconst resolved = resolve(opts.override);\n\t\tif (existsSync(resolved)) return resolved;\n\t\tif (opts.required === true) {\n\t\t\tthrow new ManifestDiscoveryError({\n\t\t\t\tphase: 'override-missing',\n\t\t\t\tpath: resolved,\n\t\t\t\tmessage:\n\t\t\t\t\t`[devstack] explicit manifest path ${resolved} does not exist. ` +\n\t\t\t\t\t`Run \\`devstack up\\` to write the manifest first.`,\n\t\t\t});\n\t\t}\n\t\treturn undefined;\n\t}\n\tconst startDir = opts.cwd ?? process.cwd();\n\tconst stack = resolveBuildIntegrationStack(opts.stack, env);\n\tconst stateDir = opts.stateDir ?? env.DEVSTACK_STATE_DIR ?? DEFAULT_STATE_DIR;\n\tlet dir = resolve(startDir);\n\twhile (true) {\n\t\tconst candidate = join(dir, stateDir, 'stacks', stack, 'manifest.json');\n\t\tif (existsSync(candidate)) return candidate;\n\t\tconst parent = dirname(dir);\n\t\tif (parent === dir) break;\n\t\tdir = parent;\n\t}\n\tif (opts.required === true) {\n\t\tconst expected = resolve(startDir, stateDir, 'stacks', stack, 'manifest.json');\n\t\tthrow new ManifestDiscoveryError({\n\t\t\tphase: 'walk-up',\n\t\t\tpath: expected,\n\t\t\tmessage:\n\t\t\t\t`[devstack] no manifest.json found walking up from ${startDir} ` +\n\t\t\t\t`(looked for ${stateDir}/stacks/${stack}/manifest.json at each level). ` +\n\t\t\t\t`Run \\`devstack up\\` — it writes the manifest at ${expected}.`,\n\t\t});\n\t}\n\treturn undefined;\n}\n"],"mappings":";;;;;;;;AAuCA,MAAa,oBAAoB;;;AAIjC,MAAa,gBAAgB;AAE7B,MAAa,gCACZ,UACA,MAAoD,QAAQ,QAChD;CAEZ,MAAM,WADW,YAAY,IAAI,iBACP,MAAM;AAChC,QAAO,YAAY,KAAA,KAAa,QAAQ,SAAS,IAAI,UAAU;;;;;AAmDhE,MAAa,eAAe,QAAoC;AAC/D,KAAI;EACH,MAAM,MAAM,KAAK,MAAM,aAAa,QAAQ,KAAK,eAAe,EAAE,OAAO,CAAC;AAG1E,MAAI,OAAO,IAAI,SAAS,SAAU,QAAO,KAAA;EACzC,MAAM,WAAW,IAAI,KAAK,QAAQ,aAAa,GAAG,CAAC,QAAQ,kBAAkB,GAAG;AAChF,SAAO,SAAS,SAAS,IAAI,WAAW,KAAA;SACjC;AACP;;;;;;;AAQF,MAAa,qBAAqB,QAAoC;CACrE,IAAI,MAAM,QAAQ,IAAI;AACtB,MAAK,IAAI,IAAI,GAAG,IAAI,IAAI,KAAK,GAAG;EAC/B,MAAM,OAAO,YAAY,IAAI;AAC7B,MAAI,SAAS,KAAA,EAAW,QAAO;EAC/B,MAAM,SAAS,QAAQ,IAAI;AAC3B,MAAI,WAAW,IAAK,QAAO,KAAA;AAC3B,QAAM;;;;;;;AASR,MAAa,oCACZ,UAAmD,EAAE,KACvB;CAC9B,MAAM,MAAM,QAAQ,OAAQ,QAAQ;CACpC,MAAM,MAAM,QAAQ,OAAO,QAAQ,KAAK;CACxC,MAAM,QAAQ,6BAA6B,QAAQ,OAAO,IAAI;CAC9D,MAAM,eAAe,QAAQ,YAAY,IAAI,sBAAA;CAE7C,MAAM,aAAa,qBAAqB;EAAE;EAAK;EAAO,UAAU;EAAc;EAAK,CAAC;CACpF,MAAM,eAAe,cAAc,QAAQ,KAAK,cAAc,UAAU,OAAO,gBAAgB;CAC/F,MAAM,WACL,eAAe,KAAA,IAAY,QAAQ,QAAQ,QAAQ,WAAW,CAAC,CAAC,GAAG,QAAQ,KAAK,aAAa;AAG9F,QAAO;EAAE,KAFG,QAAQ,OAAO,IAAI,gBAAgB,kBAAkB,IAAI;EAEvD;EAAO;EAAU;EAAc;;;;;;;;;;;;AAa9C,SAAgB,qBAAqB,OAAoC,EAAE,EAAsB;CAChG,MAAM,MAAM,KAAK,OAAQ,QAAQ;CACjC,MAAM,cAAc,IAAI;AACxB,KAAI,gBAAgB,KAAA,KAAa,gBAAgB,IAAI;EACpD,MAAM,WAAW,QAAQ,YAAY;AACrC,MAAI,WAAW,SAAS,CAAE,QAAO;AACjC,MAAI,KAAK,aAAa,KACrB,OAAM,IAAI,uBAAuB;GAChC,OAAO;GACP,MAAM;GACN,SACC,+CAA+C,SAAS;GAEzD,CAAC;AAEH;;AAED,KAAI,KAAK,aAAa,KAAA,KAAa,KAAK,aAAa,IAAI;EACxD,MAAM,WAAW,QAAQ,KAAK,SAAS;AACvC,MAAI,WAAW,SAAS,CAAE,QAAO;AACjC,MAAI,KAAK,aAAa,KACrB,OAAM,IAAI,uBAAuB;GAChC,OAAO;GACP,MAAM;GACN,SACC,qCAAqC,SAAS;GAE/C,CAAC;AAEH;;CAED,MAAM,WAAW,KAAK,OAAO,QAAQ,KAAK;CAC1C,MAAM,QAAQ,6BAA6B,KAAK,OAAO,IAAI;CAC3D,MAAM,WAAW,KAAK,YAAY,IAAI,sBAAA;CACtC,IAAI,MAAM,QAAQ,SAAS;AAC3B,QAAO,MAAM;EACZ,MAAM,YAAY,KAAK,KAAK,UAAU,UAAU,OAAO,gBAAgB;AACvE,MAAI,WAAW,UAAU,CAAE,QAAO;EAClC,MAAM,SAAS,QAAQ,IAAI;AAC3B,MAAI,WAAW,IAAK;AACpB,QAAM;;AAEP,KAAI,KAAK,aAAa,MAAM;EAC3B,MAAM,WAAW,QAAQ,UAAU,UAAU,UAAU,OAAO,gBAAgB;AAC9E,QAAM,IAAI,uBAAuB;GAChC,OAAO;GACP,MAAM;GACN,SACC,qDAAqD,SAAS,eAC/C,SAAS,UAAU,MAAM,iFACW,SAAS;GAC7D,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { ResolvedEndpoint } from "./stack-context.mjs";
2
+
3
+ //#region src/build-integrations/runtime/endpoint-registry.d.ts
4
+ /** Read-only registry over the manifest's `endpoints` map. */
5
+ declare class EndpointRegistry {
6
+ private readonly entries;
7
+ private readonly byNameIndex;
8
+ constructor(entries: ReadonlyArray<ResolvedEndpoint>);
9
+ /** Look up an endpoint by its declared name. Returns `undefined`
10
+ * when the name isn't in the manifest — callers that want a hard
11
+ * fail should `??` to a thrown error. */
12
+ byName(name: string): ResolvedEndpoint | undefined;
13
+ /** Group endpoints by the plugin that emitted them. Used by the
14
+ * CLI status output. */
15
+ byPluginKey(pluginKey: string): ReadonlyArray<ResolvedEndpoint>;
16
+ /** Filter endpoints by wire protocol (`http`, `h2c`). */
17
+ byKind(wireProtocol: string): ReadonlyArray<ResolvedEndpoint>;
18
+ /** All endpoints, alphabetical by name. */
19
+ all(): ReadonlyArray<ResolvedEndpoint>;
20
+ /** Names of every endpoint, alphabetical. Convenience for error
21
+ * messages that want to list "the supported names are: ...". */
22
+ names(): ReadonlyArray<string>;
23
+ }
24
+ //#endregion
25
+ export { EndpointRegistry };
26
+ //# sourceMappingURL=endpoint-registry.d.mts.map
@@ -0,0 +1,41 @@
1
+ //#region src/build-integrations/runtime/endpoint-registry.ts
2
+ /** Read-only registry over the manifest's `endpoints` map. */
3
+ var EndpointRegistry = class {
4
+ entries;
5
+ byNameIndex;
6
+ constructor(entries) {
7
+ const sorted = [...entries].sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0);
8
+ this.entries = sorted;
9
+ const map = /* @__PURE__ */ new Map();
10
+ for (const entry of sorted) map.set(entry.name, entry);
11
+ this.byNameIndex = map;
12
+ }
13
+ /** Look up an endpoint by its declared name. Returns `undefined`
14
+ * when the name isn't in the manifest — callers that want a hard
15
+ * fail should `??` to a thrown error. */
16
+ byName(name) {
17
+ return this.byNameIndex.get(name);
18
+ }
19
+ /** Group endpoints by the plugin that emitted them. Used by the
20
+ * CLI status output. */
21
+ byPluginKey(pluginKey) {
22
+ return this.entries.filter((e) => e.pluginKey === pluginKey);
23
+ }
24
+ /** Filter endpoints by wire protocol (`http`, `h2c`). */
25
+ byKind(wireProtocol) {
26
+ return this.entries.filter((e) => e.wireProtocol === wireProtocol);
27
+ }
28
+ /** All endpoints, alphabetical by name. */
29
+ all() {
30
+ return this.entries;
31
+ }
32
+ /** Names of every endpoint, alphabetical. Convenience for error
33
+ * messages that want to list "the supported names are: ...". */
34
+ names() {
35
+ return this.entries.map((e) => e.name);
36
+ }
37
+ };
38
+ //#endregion
39
+ export { EndpointRegistry };
40
+
41
+ //# sourceMappingURL=endpoint-registry.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoint-registry.mjs","names":[],"sources":["../../../src/build-integrations/runtime/endpoint-registry.ts"],"sourcesContent":["// Typed endpoint lookup.\n//\n// `EndpointRegistry` wraps the manifest's flat `endpoints` map with\n// the small set of queries every consumer asks of it:\n//\n// - `byName(name)`: the load-bearing lookup. Playwright `baseURL`\n// and codegen emitters all key off endpoint name.\n// - `byPluginKey(key)`: group endpoints by the plugin that emitted\n// them. The CLI `status` command uses this to print one block\n// per plugin.\n// - `byKind(kind)`: kind is currently `wireProtocol` (`http` vs\n// `h2c`). Cheap projection; lets callers filter the gRPC endpoints\n// out of an HTTP-only health check.\n// - `all()`: stable-ordered iteration. Order is alphabetical by\n// endpoint name — the manifest writer emits in input-order, but\n// consumer iteration shouldn't depend on plugin registration\n// order.\n//\n// Plain class — no Effect, no Schema. Callable from any consumer\n// runtime (Node, browser bundle that imported the manifest via the\n// build-integration alias).\n\nimport type { ResolvedEndpoint } from './stack-context.ts';\n\n/** Read-only registry over the manifest's `endpoints` map. */\nexport class EndpointRegistry {\n\tprivate readonly entries: ReadonlyArray<ResolvedEndpoint>;\n\tprivate readonly byNameIndex: ReadonlyMap<string, ResolvedEndpoint>;\n\n\tconstructor(entries: ReadonlyArray<ResolvedEndpoint>) {\n\t\t// Defensive: sort by name so iteration is stable across\n\t\t// supervisor runs even if the writer hashed plugins in a\n\t\t// different order this time.\n\t\tconst sorted = [...entries].sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0));\n\t\tthis.entries = sorted;\n\t\tconst map = new Map<string, ResolvedEndpoint>();\n\t\tfor (const entry of sorted) map.set(entry.name, entry);\n\t\tthis.byNameIndex = map;\n\t}\n\n\t/** Look up an endpoint by its declared name. Returns `undefined`\n\t * when the name isn't in the manifest — callers that want a hard\n\t * fail should `??` to a thrown error. */\n\tbyName(name: string): ResolvedEndpoint | undefined {\n\t\treturn this.byNameIndex.get(name);\n\t}\n\n\t/** Group endpoints by the plugin that emitted them. Used by the\n\t * CLI status output. */\n\tbyPluginKey(pluginKey: string): ReadonlyArray<ResolvedEndpoint> {\n\t\treturn this.entries.filter((e) => e.pluginKey === pluginKey);\n\t}\n\n\t/** Filter endpoints by wire protocol (`http`, `h2c`). */\n\tbyKind(wireProtocol: string): ReadonlyArray<ResolvedEndpoint> {\n\t\treturn this.entries.filter((e) => e.wireProtocol === wireProtocol);\n\t}\n\n\t/** All endpoints, alphabetical by name. */\n\tall(): ReadonlyArray<ResolvedEndpoint> {\n\t\treturn this.entries;\n\t}\n\n\t/** Names of every endpoint, alphabetical. Convenience for error\n\t * messages that want to list \"the supported names are: ...\". */\n\tnames(): ReadonlyArray<string> {\n\t\treturn this.entries.map((e) => e.name);\n\t}\n}\n"],"mappings":";;AAyBA,IAAa,mBAAb,MAA8B;CAC7B;CACA;CAEA,YAAY,SAA0C;EAIrD,MAAM,SAAS,CAAC,GAAG,QAAQ,CAAC,MAAM,GAAG,MAAO,EAAE,OAAO,EAAE,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,IAAI,EAAG;AAC5F,OAAK,UAAU;EACf,MAAM,sBAAM,IAAI,KAA+B;AAC/C,OAAK,MAAM,SAAS,OAAQ,KAAI,IAAI,MAAM,MAAM,MAAM;AACtD,OAAK,cAAc;;;;;CAMpB,OAAO,MAA4C;AAClD,SAAO,KAAK,YAAY,IAAI,KAAK;;;;CAKlC,YAAY,WAAoD;AAC/D,SAAO,KAAK,QAAQ,QAAQ,MAAM,EAAE,cAAc,UAAU;;;CAI7D,OAAO,cAAuD;AAC7D,SAAO,KAAK,QAAQ,QAAQ,MAAM,EAAE,iBAAiB,aAAa;;;CAInE,MAAuC;AACtC,SAAO,KAAK;;;;CAKb,QAA+B;AAC9B,SAAO,KAAK,QAAQ,KAAK,MAAM,EAAE,KAAK"}
@@ -0,0 +1,64 @@
1
+ //#region src/build-integrations/runtime/errors.d.ts
2
+ /** Phase of a `ManifestDiscoveryError`. `walk-up` means the resolver
3
+ * walked from cwd to root without finding a stack-scoped manifest;
4
+ * `env-missing` means `DEVSTACK_MANIFEST_PATH` (top-precedence
5
+ * override) pointed at a file that doesn't exist; `override-missing`
6
+ * means a caller-supplied `manifestPath` / `override` doesn't exist;
7
+ * `required-missing` is the catch-all for the `required: true`
8
+ * branches. */
9
+ type ManifestDiscoveryPhase = 'walk-up' | 'env-missing' | 'override-missing' | 'required-missing';
10
+ /** Thrown when the manifest cannot be located on disk. The message
11
+ * embeds the candidate path and the canonical recovery recipe
12
+ * (`run devstack up`); the field shape is stable so structured-log
13
+ * consumers can pattern-match without parsing strings. */
14
+ declare class ManifestDiscoveryError extends Error {
15
+ readonly name = "ManifestDiscoveryError";
16
+ readonly phase: ManifestDiscoveryPhase;
17
+ readonly path: string | undefined;
18
+ readonly cause?: unknown;
19
+ constructor(args: {
20
+ readonly phase: ManifestDiscoveryPhase;
21
+ readonly message: string;
22
+ readonly path?: string;
23
+ readonly cause?: unknown;
24
+ });
25
+ }
26
+ /** Phase of a `ManifestShapeError`. `parse` means `JSON.parse` rejected
27
+ * the bytes (truncation mid-write, hand-edit); `shape` means the bytes
28
+ * parsed but the decoded value failed schema validation (wrong / stale
29
+ * envelope shape); `version` means the manifest's `manifestVersion`
30
+ * doesn't match the version this consumer was built against. */
31
+ type ManifestShapePhase = 'parse' | 'shape' | 'version';
32
+ /** Thrown when a discovered manifest exists but fails to parse / decode
33
+ * / version-match. Carries the offending path so the recovery recipe
34
+ * (`rm <path> && devstack up`) is actionable. */
35
+ declare class ManifestShapeError extends Error {
36
+ readonly name = "ManifestShapeError";
37
+ readonly phase: ManifestShapePhase;
38
+ readonly path: string;
39
+ readonly cause?: unknown;
40
+ constructor(args: {
41
+ readonly phase: ManifestShapePhase;
42
+ readonly message: string;
43
+ readonly path: string;
44
+ readonly cause?: unknown;
45
+ });
46
+ }
47
+ /** Thrown by `coldStartUrl(endpoint)` when the endpoint name is not
48
+ * registered in the conventional-routes table and no manifest is
49
+ * available either. The message lists the supported endpoint names
50
+ * (derived from the registry, not hard-coded) so typos surface
51
+ * obviously. */
52
+ declare class NoConventionalRouteError extends Error {
53
+ readonly name = "NoConventionalRouteError";
54
+ readonly endpoint: string;
55
+ readonly supported: ReadonlyArray<string>;
56
+ constructor(args: {
57
+ readonly endpoint: string;
58
+ readonly supported: ReadonlyArray<string>;
59
+ readonly message: string;
60
+ });
61
+ }
62
+ //#endregion
63
+ export { ManifestDiscoveryError, ManifestDiscoveryPhase, ManifestShapeError, ManifestShapePhase, NoConventionalRouteError };
64
+ //# sourceMappingURL=errors.d.mts.map
@@ -0,0 +1,51 @@
1
+ //#region src/build-integrations/runtime/errors.ts
2
+ /** Thrown when the manifest cannot be located on disk. The message
3
+ * embeds the candidate path and the canonical recovery recipe
4
+ * (`run devstack up`); the field shape is stable so structured-log
5
+ * consumers can pattern-match without parsing strings. */
6
+ var ManifestDiscoveryError = class extends Error {
7
+ name = "ManifestDiscoveryError";
8
+ phase;
9
+ path;
10
+ cause;
11
+ constructor(args) {
12
+ super(args.message);
13
+ this.phase = args.phase;
14
+ this.path = args.path;
15
+ if (args.cause !== void 0) this.cause = args.cause;
16
+ }
17
+ };
18
+ /** Thrown when a discovered manifest exists but fails to parse / decode
19
+ * / version-match. Carries the offending path so the recovery recipe
20
+ * (`rm <path> && devstack up`) is actionable. */
21
+ var ManifestShapeError = class extends Error {
22
+ name = "ManifestShapeError";
23
+ phase;
24
+ path;
25
+ cause;
26
+ constructor(args) {
27
+ super(args.message);
28
+ this.phase = args.phase;
29
+ this.path = args.path;
30
+ if (args.cause !== void 0) this.cause = args.cause;
31
+ }
32
+ };
33
+ /** Thrown by `coldStartUrl(endpoint)` when the endpoint name is not
34
+ * registered in the conventional-routes table and no manifest is
35
+ * available either. The message lists the supported endpoint names
36
+ * (derived from the registry, not hard-coded) so typos surface
37
+ * obviously. */
38
+ var NoConventionalRouteError = class extends Error {
39
+ name = "NoConventionalRouteError";
40
+ endpoint;
41
+ supported;
42
+ constructor(args) {
43
+ super(args.message);
44
+ this.endpoint = args.endpoint;
45
+ this.supported = args.supported;
46
+ }
47
+ };
48
+ //#endregion
49
+ export { ManifestDiscoveryError, ManifestShapeError, NoConventionalRouteError };
50
+
51
+ //# sourceMappingURL=errors.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.mjs","names":[],"sources":["../../../src/build-integrations/runtime/errors.ts"],"sourcesContent":["// Build-integrations / runtime errors.\n//\n// The read-side surface for consumer code (apps, build tools). Two\n// failure shapes that callers care about distinguishing:\n//\n// - `ManifestDiscoveryError`: no manifest could be located. Includes\n// a recovery hint (\"run `devstack up`\") and the candidate path the\n// resolver expected.\n// - `ManifestShapeError`: a manifest was found but failed to parse\n// or decode. The two phases (`parse` vs `shape`) drive distinct\n// recovery recipes the caller can print.\n//\n// These are PLAIN classes (no Effect tags) because the read surface is\n// sync-blocking — apps load the manifest at startup and rely on plain\n// `try` / `catch`. The Effect-flavored read path (CLI / codegen) wraps\n// these into structured failure channels.\n\n/** Phase of a `ManifestDiscoveryError`. `walk-up` means the resolver\n * walked from cwd to root without finding a stack-scoped manifest;\n * `env-missing` means `DEVSTACK_MANIFEST_PATH` (top-precedence\n * override) pointed at a file that doesn't exist; `override-missing`\n * means a caller-supplied `manifestPath` / `override` doesn't exist;\n * `required-missing` is the catch-all for the `required: true`\n * branches. */\nexport type ManifestDiscoveryPhase =\n\t| 'walk-up'\n\t| 'env-missing'\n\t| 'override-missing'\n\t| 'required-missing';\n\n/** Thrown when the manifest cannot be located on disk. The message\n * embeds the candidate path and the canonical recovery recipe\n * (`run devstack up`); the field shape is stable so structured-log\n * consumers can pattern-match without parsing strings. */\nexport class ManifestDiscoveryError extends Error {\n\toverride readonly name = 'ManifestDiscoveryError';\n\treadonly phase: ManifestDiscoveryPhase;\n\treadonly path: string | undefined;\n\toverride readonly cause?: unknown;\n\tconstructor(args: {\n\t\treadonly phase: ManifestDiscoveryPhase;\n\t\treadonly message: string;\n\t\treadonly path?: string;\n\t\treadonly cause?: unknown;\n\t}) {\n\t\tsuper(args.message);\n\t\tthis.phase = args.phase;\n\t\tthis.path = args.path;\n\t\tif (args.cause !== undefined) this.cause = args.cause;\n\t}\n}\n\n/** Phase of a `ManifestShapeError`. `parse` means `JSON.parse` rejected\n * the bytes (truncation mid-write, hand-edit); `shape` means the bytes\n * parsed but the decoded value failed schema validation (wrong / stale\n * envelope shape); `version` means the manifest's `manifestVersion`\n * doesn't match the version this consumer was built against. */\nexport type ManifestShapePhase = 'parse' | 'shape' | 'version';\n\n/** Thrown when a discovered manifest exists but fails to parse / decode\n * / version-match. Carries the offending path so the recovery recipe\n * (`rm <path> && devstack up`) is actionable. */\nexport class ManifestShapeError extends Error {\n\toverride readonly name = 'ManifestShapeError';\n\treadonly phase: ManifestShapePhase;\n\treadonly path: string;\n\toverride readonly cause?: unknown;\n\tconstructor(args: {\n\t\treadonly phase: ManifestShapePhase;\n\t\treadonly message: string;\n\t\treadonly path: string;\n\t\treadonly cause?: unknown;\n\t}) {\n\t\tsuper(args.message);\n\t\tthis.phase = args.phase;\n\t\tthis.path = args.path;\n\t\tif (args.cause !== undefined) this.cause = args.cause;\n\t}\n}\n\n/** Thrown by `coldStartUrl(endpoint)` when the endpoint name is not\n * registered in the conventional-routes table and no manifest is\n * available either. The message lists the supported endpoint names\n * (derived from the registry, not hard-coded) so typos surface\n * obviously. */\nexport class NoConventionalRouteError extends Error {\n\toverride readonly name = 'NoConventionalRouteError';\n\treadonly endpoint: string;\n\treadonly supported: ReadonlyArray<string>;\n\tconstructor(args: {\n\t\treadonly endpoint: string;\n\t\treadonly supported: ReadonlyArray<string>;\n\t\treadonly message: string;\n\t}) {\n\t\tsuper(args.message);\n\t\tthis.endpoint = args.endpoint;\n\t\tthis.supported = args.supported;\n\t}\n}\n"],"mappings":";;;;;AAkCA,IAAa,yBAAb,cAA4C,MAAM;CACjD,OAAyB;CACzB;CACA;CACA;CACA,YAAY,MAKT;AACF,QAAM,KAAK,QAAQ;AACnB,OAAK,QAAQ,KAAK;AAClB,OAAK,OAAO,KAAK;AACjB,MAAI,KAAK,UAAU,KAAA,EAAW,MAAK,QAAQ,KAAK;;;;;;AAclD,IAAa,qBAAb,cAAwC,MAAM;CAC7C,OAAyB;CACzB;CACA;CACA;CACA,YAAY,MAKT;AACF,QAAM,KAAK,QAAQ;AACnB,OAAK,QAAQ,KAAK;AAClB,OAAK,OAAO,KAAK;AACjB,MAAI,KAAK,UAAU,KAAA,EAAW,MAAK,QAAQ,KAAK;;;;;;;;AASlD,IAAa,2BAAb,cAA8C,MAAM;CACnD,OAAyB;CACzB;CACA;CACA,YAAY,MAIT;AACF,QAAM,KAAK,QAAQ;AACnB,OAAK,WAAW,KAAK;AACrB,OAAK,YAAY,KAAK"}
@@ -0,0 +1,7 @@
1
+ import { BuildIntegrationIdentity, DEFAULT_STACK, DEFAULT_STATE_DIR, DiscoverBuildIntegrationIdentityOptions, DiscoverManifestPathOptions, discoverBuildIntegrationIdentity, discoverManifestPath, readAppName, readAppNameWalkup } from "./discover.mjs";
2
+ import { EndpointRegistry } from "./endpoint-registry.mjs";
3
+ import { ResolvedEndpoint, StackContext, StackIdentity } from "./stack-context.mjs";
4
+ import { CONSUMER_MANIFEST_VERSION, ReadStackContextOptions, manifestEnvelopeFromStackContext, readStackContext } from "./read-stack-context.mjs";
5
+ import { ColdStartUrlOptions, ConventionalRoute, ConventionalRouteHint, ConventionalRouteHostInput, ConventionalRouteUrlInput, coldStartUrl, conventionalRouteHost, conventionalRouteUrl, conventionalRoutesFromHints, tryColdStartUrl } from "./cold-start-url.mjs";
6
+ import { ManifestDiscoveryError, ManifestDiscoveryPhase, ManifestShapeError, ManifestShapePhase, NoConventionalRouteError } from "./errors.mjs";
7
+ export { type BuildIntegrationIdentity, CONSUMER_MANIFEST_VERSION, type ColdStartUrlOptions, type ConventionalRoute, type ConventionalRouteHint, type ConventionalRouteHostInput, type ConventionalRouteUrlInput, DEFAULT_STACK, DEFAULT_STATE_DIR, type DiscoverBuildIntegrationIdentityOptions, type DiscoverManifestPathOptions, EndpointRegistry, ManifestDiscoveryError, type ManifestDiscoveryPhase, ManifestShapeError, type ManifestShapePhase, NoConventionalRouteError, type ReadStackContextOptions, type ResolvedEndpoint, type StackContext, type StackIdentity, coldStartUrl, conventionalRouteHost, conventionalRouteUrl, conventionalRoutesFromHints, discoverBuildIntegrationIdentity, discoverManifestPath, manifestEnvelopeFromStackContext, readAppName, readAppNameWalkup, readStackContext, tryColdStartUrl };
@@ -0,0 +1,6 @@
1
+ import { ManifestDiscoveryError, ManifestShapeError, NoConventionalRouteError } from "./errors.mjs";
2
+ import { DEFAULT_STACK, DEFAULT_STATE_DIR, discoverBuildIntegrationIdentity, discoverManifestPath, readAppName, readAppNameWalkup } from "./discover.mjs";
3
+ import { EndpointRegistry } from "./endpoint-registry.mjs";
4
+ import { CONSUMER_MANIFEST_VERSION, manifestEnvelopeFromStackContext, readStackContext } from "./read-stack-context.mjs";
5
+ 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 };
@@ -0,0 +1,38 @@
1
+ import { ManifestEnvelope } from "../../substrate/manifest.mjs";
2
+ import { DiscoverManifestPathOptions } from "./discover.mjs";
3
+ import { StackContext } from "./stack-context.mjs";
4
+
5
+ //#region src/build-integrations/runtime/read-stack-context.d.ts
6
+ /** Pinned manifest-envelope version this consumer build was compiled
7
+ * against. Must match the substrate's `CURRENT_MANIFEST_VERSION`
8
+ * (kept as a literal here so the read path doesn't reach into the
9
+ * substrate's writer module just for a number). When the substrate
10
+ * bumps, the consumer must bump in lockstep — the version mismatch
11
+ * error message names the recovery recipe. */
12
+ declare const CONSUMER_MANIFEST_VERSION: 1;
13
+ interface ReadStackContextOptions extends DiscoverManifestPathOptions {
14
+ /** Caller-supplied explicit manifest path. When set, bypasses the
15
+ * walk-up (still existence-checked). Named `manifestPath` for
16
+ * ergonomic parity with the CLI's `--manifest-path` flag. */
17
+ readonly manifestPath?: string;
18
+ }
19
+ /** Reconstruct the manifest envelope from the runtime projection.
20
+ * Integration adapters that preserve their older envelope-shaped
21
+ * surfaces use this instead of duplicating endpoint-registry
22
+ * projection logic. */
23
+ declare const manifestEnvelopeFromStackContext: (ctx: StackContext) => ManifestEnvelope;
24
+ /**
25
+ * Sync read + decode + project. Throws `ManifestDiscoveryError` (no
26
+ * manifest located) or `ManifestShapeError` (manifest found but
27
+ * malformed / wrong version).
28
+ *
29
+ * Used by:
30
+ * - Apps' generated `stack-handle.ts` at startup.
31
+ * - Playwright config-load (`baseURL`, `webServer.url`).
32
+ * - CLI surfaces that prefer sync-then-Effect.try over a native
33
+ * Effect read.
34
+ */
35
+ declare const readStackContext: (opts?: ReadStackContextOptions) => StackContext;
36
+ //#endregion
37
+ export { CONSUMER_MANIFEST_VERSION, ReadStackContextOptions, manifestEnvelopeFromStackContext, readStackContext };
38
+ //# sourceMappingURL=read-stack-context.d.mts.map
@@ -0,0 +1,130 @@
1
+ import { ManifestEnvelopeSchema } from "../../substrate/manifest.mjs";
2
+ import { ManifestDiscoveryError, ManifestShapeError } from "./errors.mjs";
3
+ import { discoverManifestPath } from "./discover.mjs";
4
+ import { EndpointRegistry } from "./endpoint-registry.mjs";
5
+ import { Schema } from "effect";
6
+ import { readFileSync } from "node:fs";
7
+ //#region src/build-integrations/runtime/read-stack-context.ts
8
+ /** Pinned manifest-envelope version this consumer build was compiled
9
+ * against. Must match the substrate's `CURRENT_MANIFEST_VERSION`
10
+ * (kept as a literal here so the read path doesn't reach into the
11
+ * substrate's writer module just for a number). When the substrate
12
+ * bumps, the consumer must bump in lockstep — the version mismatch
13
+ * error message names the recovery recipe. */
14
+ const CONSUMER_MANIFEST_VERSION = 1;
15
+ const decodeEnvelope = Schema.decodeUnknownSync(ManifestEnvelopeSchema);
16
+ const resolveManifestPath = (opts) => {
17
+ const override = opts.manifestPath ?? opts.override;
18
+ const resolved = discoverManifestPath({
19
+ ...opts,
20
+ ...override !== void 0 ? { override } : {},
21
+ required: true
22
+ });
23
+ if (resolved === void 0) throw new ManifestDiscoveryError({
24
+ phase: "required-missing",
25
+ message: "[devstack] manifest discovery returned undefined despite required: true"
26
+ });
27
+ return resolved;
28
+ };
29
+ const parseAndDecode = (raw, manifestPath) => {
30
+ let parsed;
31
+ try {
32
+ parsed = JSON.parse(raw);
33
+ } catch (cause) {
34
+ throw new ManifestShapeError({
35
+ phase: "parse",
36
+ path: manifestPath,
37
+ message: `[devstack] manifest at ${manifestPath} is not valid JSON (truncation or hand-edit). RECOVERY: \`rm ${manifestPath} && devstack up\` to regenerate.`,
38
+ cause
39
+ });
40
+ }
41
+ let decoded;
42
+ try {
43
+ decoded = decodeEnvelope(parsed);
44
+ } catch (cause) {
45
+ throw new ManifestShapeError({
46
+ phase: "shape",
47
+ path: manifestPath,
48
+ message: `[devstack] manifest at ${manifestPath} does not match the manifest envelope schema (stale shape or hand-edit). RECOVERY: \`rm ${manifestPath} && devstack up\` to regenerate.`,
49
+ cause
50
+ });
51
+ }
52
+ if (decoded.manifestVersion !== 1) throw new ManifestShapeError({
53
+ phase: "version",
54
+ path: manifestPath,
55
+ message: `[devstack] manifest at ${manifestPath} has version ${decoded.manifestVersion}, but this consumer was built for version 1. RECOVERY: upgrade your devstack consumer dependency, or \`rm ${manifestPath} && devstack up\` to regenerate against the new version.`
56
+ });
57
+ return decoded;
58
+ };
59
+ /** Project the decoded envelope to a plain `StackContext`. */
60
+ const project = (envelope, manifestPath) => {
61
+ const entries = [];
62
+ for (const raw of Object.values(envelope.endpoints)) entries.push({
63
+ name: raw.name,
64
+ url: raw.url,
65
+ displayUrl: raw.displayUrl,
66
+ wireProtocol: raw.wireProtocol,
67
+ pluginKey: raw.pluginKey,
68
+ endpointKey: raw.endpointKey
69
+ });
70
+ return {
71
+ identity: {
72
+ app: envelope.identity.app,
73
+ stack: envelope.identity.stack,
74
+ chain: envelope.identity.chain
75
+ },
76
+ manifestPath,
77
+ manifestVersion: envelope.manifestVersion,
78
+ endpoints: new EndpointRegistry(entries),
79
+ services: envelope.services,
80
+ extras: envelope.extras
81
+ };
82
+ };
83
+ /** Reconstruct the manifest envelope from the runtime projection.
84
+ * Integration adapters that preserve their older envelope-shaped
85
+ * surfaces use this instead of duplicating endpoint-registry
86
+ * projection logic. */
87
+ const manifestEnvelopeFromStackContext = (ctx) => ({
88
+ identity: ctx.identity,
89
+ manifestVersion: ctx.manifestVersion,
90
+ services: ctx.services,
91
+ endpoints: Object.fromEntries(ctx.endpoints.all().map((e) => [e.endpointKey, {
92
+ name: e.name,
93
+ url: e.url,
94
+ displayUrl: e.displayUrl,
95
+ wireProtocol: e.wireProtocol,
96
+ pluginKey: e.pluginKey,
97
+ endpointKey: e.endpointKey
98
+ }])),
99
+ extras: ctx.extras
100
+ });
101
+ /**
102
+ * Sync read + decode + project. Throws `ManifestDiscoveryError` (no
103
+ * manifest located) or `ManifestShapeError` (manifest found but
104
+ * malformed / wrong version).
105
+ *
106
+ * Used by:
107
+ * - Apps' generated `stack-handle.ts` at startup.
108
+ * - Playwright config-load (`baseURL`, `webServer.url`).
109
+ * - CLI surfaces that prefer sync-then-Effect.try over a native
110
+ * Effect read.
111
+ */
112
+ const readStackContext = (opts = {}) => {
113
+ const manifestPath = resolveManifestPath(opts);
114
+ let raw;
115
+ try {
116
+ raw = readFileSync(manifestPath, "utf8");
117
+ } catch (cause) {
118
+ throw new ManifestShapeError({
119
+ phase: "parse",
120
+ path: manifestPath,
121
+ message: `[devstack] failed to read manifest at ${manifestPath}: ${String(cause)}`,
122
+ cause
123
+ });
124
+ }
125
+ return project(parseAndDecode(raw, manifestPath), manifestPath);
126
+ };
127
+ //#endregion
128
+ export { CONSUMER_MANIFEST_VERSION, manifestEnvelopeFromStackContext, readStackContext };
129
+
130
+ //# sourceMappingURL=read-stack-context.mjs.map
@@ -0,0 +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"}
@@ -0,0 +1,53 @@
1
+ import { EndpointRegistry } from "./endpoint-registry.mjs";
2
+
3
+ //#region src/build-integrations/runtime/stack-context.d.ts
4
+ /** Identity tuple — mirrors `ManifestEnvelope['identity']` from the
5
+ * substrate. Re-stated here so consumer code doesn't reach into the
6
+ * substrate package. */
7
+ interface StackIdentity {
8
+ readonly app: string;
9
+ readonly stack: string;
10
+ readonly chain: string;
11
+ }
12
+ /** Flat endpoint entry exposed to consumers. Mirrors the substrate's
13
+ * `EndpointEntry` but uses plain strings (no `Brand<>`) so callers
14
+ * don't need to import the substrate's branded types. */
15
+ interface ResolvedEndpoint {
16
+ readonly name: string;
17
+ readonly url: string;
18
+ readonly displayUrl: string | null;
19
+ readonly wireProtocol: string;
20
+ readonly pluginKey: string;
21
+ readonly endpointKey: string;
22
+ }
23
+ /** Read-only projection of the manifest. Consumers — Playwright
24
+ * `baseURL` / `webServer`, codegen emitters that read their own
25
+ * slice, the CLI's `status` command — key off the fields here.
26
+ *
27
+ * Field shape is deliberately a SUPER-SET of "what the substrate
28
+ * schema decoded": discovery surfaces add the resolved `manifestPath`
29
+ * and the typed `endpoints` registry that wraps the flat map. */
30
+ interface StackContext {
31
+ /** Stack identity — name / app / chain. */
32
+ readonly identity: StackIdentity;
33
+ /** Absolute path to the on-disk manifest the projection derives
34
+ * from. Used by error messages and by callers that want to watch
35
+ * the file. */
36
+ readonly manifestPath: string;
37
+ /** Envelope schema version pinned by the substrate. Consumers
38
+ * forwarding to per-version migration paths gate on this. */
39
+ readonly manifestVersion: number;
40
+ /** Typed endpoint registry — `byName(name)` returns the
41
+ * `ResolvedEndpoint` (or `undefined`); `all()` lists them; group
42
+ * helpers (`byPluginKey`, `byKind`) live on the registry too. */
43
+ readonly endpoints: EndpointRegistry;
44
+ /** Per-plugin opaque service slices — keyed by `pluginKey`. The
45
+ * typed per-service shape lives in each plugin's Codegenable
46
+ * output, not here. */
47
+ readonly services: Readonly<Record<string, unknown>>;
48
+ /** Per-plugin opaque extras — keyed by `pluginKey`. */
49
+ readonly extras: Readonly<Record<string, unknown>>;
50
+ }
51
+ //#endregion
52
+ export { ResolvedEndpoint, StackContext, StackIdentity };
53
+ //# sourceMappingURL=stack-context.d.mts.map