@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,119 @@
1
+ import { isTaggedError } from "./cascade-formatter.mjs";
2
+ //#region src/substrate/runtime/observability/pretty-error.ts
3
+ /**
4
+ * Render a Cause as a `StructuredError` suitable for the projection's
5
+ * `errors` field. The `chain` array carries the per-layer summaries
6
+ * (header lines only — the full multi-line render is what `prettyCause`
7
+ * returns).
8
+ *
9
+ * Use the projection-shaped variant when building an `error.reported`
10
+ * event; use `prettyCause` when rendering for human display.
11
+ */
12
+ const prettyErrorStructured = (cause, options) => {
13
+ const at = options?.at ?? Date.now();
14
+ const pluginKey = options?.pluginKey ?? null;
15
+ const severity = options?.severity ?? "error";
16
+ const { tag, summary } = extractHeadline(cause);
17
+ return {
18
+ at,
19
+ pluginKey,
20
+ tag,
21
+ summary,
22
+ chain: extractChain(cause),
23
+ severity
24
+ };
25
+ };
26
+ /** Walk the cause's first `Fail` reason and pull out the outermost
27
+ * tag + message for projection.summary. */
28
+ const extractHeadline = (cause) => {
29
+ const reasons = cause.reasons;
30
+ for (const reason of reasons) {
31
+ if (reason._tag === "Fail") {
32
+ const error = reason.error;
33
+ if (isTaggedError(error)) return {
34
+ tag: error._tag,
35
+ summary: headlineText(error) ?? error._tag
36
+ };
37
+ if (error instanceof Error) return {
38
+ tag: error.name,
39
+ summary: error.message
40
+ };
41
+ return {
42
+ tag: "UnknownFailure",
43
+ summary: String(error)
44
+ };
45
+ }
46
+ if (reason._tag === "Die") {
47
+ const defect = reason.defect;
48
+ if (isTaggedError(defect)) return {
49
+ tag: `Defect[${defect._tag}]`,
50
+ summary: headlineText(defect) ?? defect._tag
51
+ };
52
+ if (defect instanceof Error) return {
53
+ tag: "Defect",
54
+ summary: defect.message
55
+ };
56
+ return {
57
+ tag: "Defect",
58
+ summary: String(defect)
59
+ };
60
+ }
61
+ if (reason._tag === "Interrupt") return {
62
+ tag: "Interrupt",
63
+ summary: "fiber interrupted"
64
+ };
65
+ }
66
+ return {
67
+ tag: "EmptyCause",
68
+ summary: "(empty cause)"
69
+ };
70
+ };
71
+ const headlineText = (value) => {
72
+ for (const key of [
73
+ "message",
74
+ "detail",
75
+ "stderr"
76
+ ]) {
77
+ const field = value[key];
78
+ if (typeof field === "string" && field.trim().length > 0) return field.trim();
79
+ }
80
+ return null;
81
+ };
82
+ /** Walk every layer of the cause's outermost `Fail` chain and build a
83
+ * list of `<tag>: <message>` strings — one per nested layer. */
84
+ const extractChain = (cause) => {
85
+ const reasons = cause.reasons;
86
+ const out = [];
87
+ for (const reason of reasons) walkChainFromReason(reason, out, /* @__PURE__ */ new WeakSet());
88
+ return out;
89
+ };
90
+ const walkChainFromReason = (reason, out, visited) => {
91
+ if (typeof reason !== "object" || reason === null) return;
92
+ const r = reason;
93
+ if (r._tag === "Fail") walkChainFromValue(r.error, out, visited);
94
+ else if (r._tag === "Die") walkChainFromValue(r.defect, out, visited);
95
+ else if (r._tag === "Interrupt") out.push("Interrupt");
96
+ };
97
+ const walkChainFromValue = (value, out, visited) => {
98
+ if (value === void 0 || value === null) return;
99
+ if (typeof value === "object") {
100
+ if (visited.has(value)) return;
101
+ visited.add(value);
102
+ }
103
+ if (isTaggedError(value)) {
104
+ const tag = value._tag;
105
+ const msg = headlineText(value) ?? "";
106
+ out.push(msg ? `${tag}: ${msg}` : tag);
107
+ if (value.cause !== void 0 && value.cause !== null) walkChainFromValue(value.cause, out, visited);
108
+ return;
109
+ }
110
+ if (value instanceof Error) {
111
+ out.push(`${value.name}: ${value.message}`);
112
+ return;
113
+ }
114
+ out.push(String(value));
115
+ };
116
+ //#endregion
117
+ export { prettyErrorStructured };
118
+
119
+ //# sourceMappingURL=pretty-error.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pretty-error.mjs","names":[],"sources":["../../../../src/substrate/runtime/observability/pretty-error.ts"],"sourcesContent":["// Pretty-error renderer.\n//\n// Architecture § L0 Observability: one cause walker, shared with\n// renderers. The cascade-formatter is the pure walk; this module is\n// the IO + convenience layer:\n// - `prettyError(unknown)` — convenience for \"I have a thrown value\"\n// and don't want to thread a Cause.\n// - `prettyCause(cause)` — the supervisor's path: the engine\n// catches via `Effect.catchCause` and renders.\n// - `prettyErrorStructured` — render to a `StructuredError` shape\n// suitable for the projection's `errors` field.\n//\n// This module is *thin* — all real formatting logic is in\n// `cascade-formatter.ts`. Splitting them keeps the formatter pure\n// + reusable while letting this module evolve IO conventions.\n\nimport type { Cause } from 'effect';\n\nimport type { PluginKey } from '../../brand.ts';\nimport type { StructuredError } from '../../projection.ts';\n\nimport {\n\ttype FormatOptions,\n\ttype FormatterRegistry,\n\ttype TaggedErrorLike,\n\tformatCause,\n\tformatValue,\n\tisTaggedError,\n} from './cascade-formatter.ts';\n\nexport type { FormatOptions, FormatterRegistry, TaggedErrorLike };\n\n/** Render any value (Cause, tagged error, plain Error, anything)\n * using the cascade rules. The pretty-error variant exists so\n * callers don't have to know whether they have a Cause or an Error. */\nexport const prettyError = (value: unknown, options?: FormatOptions): string =>\n\tformatValue(value, options);\n\n/** Render an Effect `Cause.Cause<E>` directly. The supervisor's preferred\n * entry point (it has a Cause from `Effect.catchCause`). */\nexport const prettyCause = <E>(cause: Cause.Cause<E>, options?: FormatOptions): string =>\n\tformatCause(cause, options);\n\n// -----------------------------------------------------------------------------\n// Structured projection\n// -----------------------------------------------------------------------------\n\nexport interface StructureOptions extends FormatOptions {\n\treadonly at?: number;\n\treadonly pluginKey?: PluginKey | null;\n\treadonly severity?: StructuredError['severity'];\n}\n\n/**\n * Render a Cause as a `StructuredError` suitable for the projection's\n * `errors` field. The `chain` array carries the per-layer summaries\n * (header lines only — the full multi-line render is what `prettyCause`\n * returns).\n *\n * Use the projection-shaped variant when building an `error.reported`\n * event; use `prettyCause` when rendering for human display.\n */\nexport const prettyErrorStructured = <E>(\n\tcause: Cause.Cause<E>,\n\toptions?: StructureOptions,\n): StructuredError => {\n\tconst at = options?.at ?? Date.now();\n\tconst pluginKey = options?.pluginKey ?? null;\n\tconst severity = options?.severity ?? 'error';\n\n\tconst { tag, summary } = extractHeadline(cause);\n\tconst chain = extractChain(cause);\n\n\treturn { at, pluginKey, tag, summary, chain, severity };\n};\n\n/** Walk the cause's first `Fail` reason and pull out the outermost\n * tag + message for projection.summary. */\nconst extractHeadline = (cause: Cause.Cause<unknown>): { tag: string; summary: string } => {\n\tconst reasons = (cause as unknown as { reasons: ReadonlyArray<{ _tag: string }> }).reasons;\n\tfor (const reason of reasons) {\n\t\tif (reason._tag === 'Fail') {\n\t\t\tconst error = (reason as unknown as { error: unknown }).error;\n\t\t\tif (isTaggedError(error)) {\n\t\t\t\treturn {\n\t\t\t\t\ttag: error._tag,\n\t\t\t\t\tsummary: headlineText(error) ?? error._tag,\n\t\t\t\t};\n\t\t\t}\n\t\t\tif (error instanceof Error) {\n\t\t\t\treturn { tag: error.name, summary: error.message };\n\t\t\t}\n\t\t\treturn { tag: 'UnknownFailure', summary: String(error) };\n\t\t}\n\t\tif (reason._tag === 'Die') {\n\t\t\tconst defect = (reason as unknown as { defect: unknown }).defect;\n\t\t\tif (isTaggedError(defect)) {\n\t\t\t\treturn {\n\t\t\t\t\ttag: `Defect[${defect._tag}]`,\n\t\t\t\t\tsummary: headlineText(defect) ?? defect._tag,\n\t\t\t\t};\n\t\t\t}\n\t\t\tif (defect instanceof Error) {\n\t\t\t\treturn { tag: 'Defect', summary: defect.message };\n\t\t\t}\n\t\t\treturn { tag: 'Defect', summary: String(defect) };\n\t\t}\n\t\tif (reason._tag === 'Interrupt') {\n\t\t\treturn { tag: 'Interrupt', summary: 'fiber interrupted' };\n\t\t}\n\t}\n\treturn { tag: 'EmptyCause', summary: '(empty cause)' };\n};\n\nconst headlineText = (value: TaggedErrorLike): string | null => {\n\tfor (const key of ['message', 'detail', 'stderr'] as const) {\n\t\tconst field = value[key];\n\t\tif (typeof field === 'string' && field.trim().length > 0) return field.trim();\n\t}\n\treturn null;\n};\n\n/** Walk every layer of the cause's outermost `Fail` chain and build a\n * list of `<tag>: <message>` strings — one per nested layer. */\nconst extractChain = (cause: Cause.Cause<unknown>): ReadonlyArray<string> => {\n\tconst reasons = (cause as unknown as { reasons: ReadonlyArray<unknown> }).reasons;\n\tconst out: Array<string> = [];\n\tfor (const reason of reasons) {\n\t\twalkChainFromReason(reason, out, new WeakSet());\n\t}\n\treturn out;\n};\n\nconst walkChainFromReason = (\n\treason: unknown,\n\tout: Array<string>,\n\tvisited: WeakSet<object>,\n): void => {\n\tif (typeof reason !== 'object' || reason === null) return;\n\tconst r = reason as { _tag?: unknown; error?: unknown; defect?: unknown; fiberId?: unknown };\n\tif (r._tag === 'Fail') walkChainFromValue(r.error, out, visited);\n\telse if (r._tag === 'Die') walkChainFromValue(r.defect, out, visited);\n\telse if (r._tag === 'Interrupt') out.push('Interrupt');\n};\n\nconst walkChainFromValue = (value: unknown, out: Array<string>, visited: WeakSet<object>): void => {\n\tif (value === undefined || value === null) return;\n\tif (typeof value === 'object') {\n\t\tif (visited.has(value as object)) return;\n\t\tvisited.add(value as object);\n\t}\n\tif (isTaggedError(value)) {\n\t\tconst tag = value._tag;\n\t\tconst msg = headlineText(value) ?? '';\n\t\tout.push(msg ? `${tag}: ${msg}` : tag);\n\t\tif (value.cause !== undefined && value.cause !== null) {\n\t\t\twalkChainFromValue(value.cause, out, visited);\n\t\t}\n\t\treturn;\n\t}\n\tif (value instanceof Error) {\n\t\tout.push(`${value.name}: ${value.message}`);\n\t\treturn;\n\t}\n\tout.push(String(value));\n};\n"],"mappings":";;;;;;;;;;;AA8DA,MAAa,yBACZ,OACA,YACqB;CACrB,MAAM,KAAK,SAAS,MAAM,KAAK,KAAK;CACpC,MAAM,YAAY,SAAS,aAAa;CACxC,MAAM,WAAW,SAAS,YAAY;CAEtC,MAAM,EAAE,KAAK,YAAY,gBAAgB,MAAM;AAG/C,QAAO;EAAE;EAAI;EAAW;EAAK;EAAS,OAFxB,aAAa,MAEgB;EAAE;EAAU;;;;AAKxD,MAAM,mBAAmB,UAAkE;CAC1F,MAAM,UAAW,MAAkE;AACnF,MAAK,MAAM,UAAU,SAAS;AAC7B,MAAI,OAAO,SAAS,QAAQ;GAC3B,MAAM,QAAS,OAAyC;AACxD,OAAI,cAAc,MAAM,CACvB,QAAO;IACN,KAAK,MAAM;IACX,SAAS,aAAa,MAAM,IAAI,MAAM;IACtC;AAEF,OAAI,iBAAiB,MACpB,QAAO;IAAE,KAAK,MAAM;IAAM,SAAS,MAAM;IAAS;AAEnD,UAAO;IAAE,KAAK;IAAkB,SAAS,OAAO,MAAM;IAAE;;AAEzD,MAAI,OAAO,SAAS,OAAO;GAC1B,MAAM,SAAU,OAA0C;AAC1D,OAAI,cAAc,OAAO,CACxB,QAAO;IACN,KAAK,UAAU,OAAO,KAAK;IAC3B,SAAS,aAAa,OAAO,IAAI,OAAO;IACxC;AAEF,OAAI,kBAAkB,MACrB,QAAO;IAAE,KAAK;IAAU,SAAS,OAAO;IAAS;AAElD,UAAO;IAAE,KAAK;IAAU,SAAS,OAAO,OAAO;IAAE;;AAElD,MAAI,OAAO,SAAS,YACnB,QAAO;GAAE,KAAK;GAAa,SAAS;GAAqB;;AAG3D,QAAO;EAAE,KAAK;EAAc,SAAS;EAAiB;;AAGvD,MAAM,gBAAgB,UAA0C;AAC/D,MAAK,MAAM,OAAO;EAAC;EAAW;EAAU;EAAS,EAAW;EAC3D,MAAM,QAAQ,MAAM;AACpB,MAAI,OAAO,UAAU,YAAY,MAAM,MAAM,CAAC,SAAS,EAAG,QAAO,MAAM,MAAM;;AAE9E,QAAO;;;;AAKR,MAAM,gBAAgB,UAAuD;CAC5E,MAAM,UAAW,MAAyD;CAC1E,MAAM,MAAqB,EAAE;AAC7B,MAAK,MAAM,UAAU,QACpB,qBAAoB,QAAQ,qBAAK,IAAI,SAAS,CAAC;AAEhD,QAAO;;AAGR,MAAM,uBACL,QACA,KACA,YACU;AACV,KAAI,OAAO,WAAW,YAAY,WAAW,KAAM;CACnD,MAAM,IAAI;AACV,KAAI,EAAE,SAAS,OAAQ,oBAAmB,EAAE,OAAO,KAAK,QAAQ;UACvD,EAAE,SAAS,MAAO,oBAAmB,EAAE,QAAQ,KAAK,QAAQ;UAC5D,EAAE,SAAS,YAAa,KAAI,KAAK,YAAY;;AAGvD,MAAM,sBAAsB,OAAgB,KAAoB,YAAmC;AAClG,KAAI,UAAU,KAAA,KAAa,UAAU,KAAM;AAC3C,KAAI,OAAO,UAAU,UAAU;AAC9B,MAAI,QAAQ,IAAI,MAAgB,CAAE;AAClC,UAAQ,IAAI,MAAgB;;AAE7B,KAAI,cAAc,MAAM,EAAE;EACzB,MAAM,MAAM,MAAM;EAClB,MAAM,MAAM,aAAa,MAAM,IAAI;AACnC,MAAI,KAAK,MAAM,GAAG,IAAI,IAAI,QAAQ,IAAI;AACtC,MAAI,MAAM,UAAU,KAAA,KAAa,MAAM,UAAU,KAChD,oBAAmB,MAAM,OAAO,KAAK,QAAQ;AAE9C;;AAED,KAAI,iBAAiB,OAAO;AAC3B,MAAI,KAAK,GAAG,MAAM,KAAK,IAAI,MAAM,UAAU;AAC3C;;AAED,KAAI,KAAK,OAAO,MAAM,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { PluginKey } from "../../brand.mjs";
2
+ import { LogLevel, LoggerShape } from "./logger.mjs";
3
+ import { Effect, Scope, Stream } from "effect";
4
+
5
+ //#region src/substrate/runtime/observability/process-lines.d.ts
6
+ declare namespace process_lines_d_exports {
7
+ export { ObserveProcessLinesOptions, ObservedProcessLine, ProcessByteStream, ProcessOutputStream, observeProcessLines, readableToByteStream, splitUtf8Lines };
8
+ }
9
+ type ProcessOutputStream = 'stdout' | 'stderr';
10
+ interface ObservedProcessLine {
11
+ readonly stream: ProcessOutputStream;
12
+ readonly line: string;
13
+ }
14
+ interface ObserveProcessLinesOptions {
15
+ readonly logger: LoggerShape;
16
+ readonly tag: string;
17
+ readonly pluginKey: PluginKey | null;
18
+ readonly fields?: Readonly<Record<string, unknown>>;
19
+ readonly onLine?: (line: ObservedProcessLine) => Effect.Effect<void>;
20
+ readonly levelForStream?: (stream: ProcessOutputStream) => LogLevel;
21
+ }
22
+ type ProcessByteStream<E = unknown, R = never> = Stream.Stream<Uint8Array, E, R>;
23
+ declare const splitUtf8Lines: <E, R>(stream: ProcessByteStream<E, R>) => Stream.Stream<string, E, R>;
24
+ declare const readableToByteStream: (stream: AsyncIterable<Uint8Array> | null | undefined, mapError?: (cause: unknown) => unknown) => ProcessByteStream;
25
+ declare const observeProcessLines: (streams: {
26
+ readonly stdout?: ProcessByteStream | null;
27
+ readonly stderr?: ProcessByteStream | null;
28
+ }, options: ObserveProcessLinesOptions) => Effect.Effect<void, never, Scope.Scope>;
29
+ //#endregion
30
+ export { ObserveProcessLinesOptions, ObservedProcessLine, ProcessByteStream, ProcessOutputStream, observeProcessLines, process_lines_d_exports, readableToByteStream, splitUtf8Lines };
31
+ //# sourceMappingURL=process-lines.d.mts.map
@@ -0,0 +1,40 @@
1
+ import { __exportAll } from "../../../_virtual/_rolldown/runtime.mjs";
2
+ import { Effect, Stream } from "effect";
3
+ //#region src/substrate/runtime/observability/process-lines.ts
4
+ var process_lines_exports = /* @__PURE__ */ __exportAll({
5
+ observeProcessLines: () => observeProcessLines,
6
+ readableToByteStream: () => readableToByteStream,
7
+ splitUtf8Lines: () => splitUtf8Lines
8
+ });
9
+ const splitUtf8Lines = (stream) => stream.pipe(Stream.decodeText(), Stream.splitLines);
10
+ const readableToByteStream = (stream, mapError = (cause) => cause) => {
11
+ if (stream === null || stream === void 0) return Stream.empty;
12
+ return Stream.fromAsyncIterable(stream, mapError);
13
+ };
14
+ const defaultLevelForStream = (stream) => stream === "stderr" ? "warn" : "info";
15
+ const drainLineStream = (stream, streamName, options) => {
16
+ const levelForStream = options.levelForStream ?? defaultLevelForStream;
17
+ const fields = options.fields ?? {};
18
+ return splitUtf8Lines(stream).pipe(Stream.tap((line) => Effect.gen(function* () {
19
+ yield* options.logger.log(options.tag, options.pluginKey, {
20
+ level: levelForStream(streamName),
21
+ message: line,
22
+ fields: {
23
+ ...fields,
24
+ stream: streamName
25
+ }
26
+ }).pipe(Effect.ignore);
27
+ if (options.onLine !== void 0) yield* options.onLine({
28
+ stream: streamName,
29
+ line
30
+ }).pipe(Effect.ignore);
31
+ })), Stream.runDrain, Effect.ignore);
32
+ };
33
+ const observeProcessLines = (streams, options) => Effect.gen(function* () {
34
+ if (streams.stdout !== void 0 && streams.stdout !== null) yield* drainLineStream(streams.stdout, "stdout", options).pipe(Effect.forkScoped);
35
+ if (streams.stderr !== void 0 && streams.stderr !== null) yield* drainLineStream(streams.stderr, "stderr", options).pipe(Effect.forkScoped);
36
+ });
37
+ //#endregion
38
+ export { observeProcessLines, process_lines_exports, readableToByteStream, splitUtf8Lines };
39
+
40
+ //# sourceMappingURL=process-lines.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-lines.mjs","names":[],"sources":["../../../../src/substrate/runtime/observability/process-lines.ts"],"sourcesContent":["import { Effect, Stream } from 'effect';\nimport type { Scope } from 'effect';\n\nimport type { PluginKey } from '../../brand.ts';\nimport type { LoggerShape, LogLevel } from './logger.ts';\n\nexport type ProcessOutputStream = 'stdout' | 'stderr';\n\nexport interface ObservedProcessLine {\n\treadonly stream: ProcessOutputStream;\n\treadonly line: string;\n}\n\nexport interface ObserveProcessLinesOptions {\n\treadonly logger: LoggerShape;\n\treadonly tag: string;\n\treadonly pluginKey: PluginKey | null;\n\treadonly fields?: Readonly<Record<string, unknown>>;\n\treadonly onLine?: (line: ObservedProcessLine) => Effect.Effect<void>;\n\treadonly levelForStream?: (stream: ProcessOutputStream) => LogLevel;\n}\n\nexport type ProcessByteStream<E = unknown, R = never> = Stream.Stream<Uint8Array, E, R>;\n\nexport const splitUtf8Lines = <E, R>(\n\tstream: ProcessByteStream<E, R>,\n): Stream.Stream<string, E, R> => stream.pipe(Stream.decodeText(), Stream.splitLines);\n\nexport const readableToByteStream = (\n\tstream: AsyncIterable<Uint8Array> | null | undefined,\n\tmapError: (cause: unknown) => unknown = (cause) => cause,\n): ProcessByteStream => {\n\tif (stream === null || stream === undefined) return Stream.empty;\n\treturn Stream.fromAsyncIterable(stream, mapError);\n};\n\nconst defaultLevelForStream = (stream: ProcessOutputStream): LogLevel =>\n\tstream === 'stderr' ? 'warn' : 'info';\n\nconst drainLineStream = (\n\tstream: ProcessByteStream,\n\tstreamName: ProcessOutputStream,\n\toptions: ObserveProcessLinesOptions,\n): Effect.Effect<void, never> => {\n\tconst levelForStream = options.levelForStream ?? defaultLevelForStream;\n\tconst fields = options.fields ?? {};\n\tconst drain = splitUtf8Lines(stream).pipe(\n\t\tStream.tap((line) =>\n\t\t\tEffect.gen(function* () {\n\t\t\t\tyield* options.logger\n\t\t\t\t\t.log(options.tag, options.pluginKey, {\n\t\t\t\t\t\tlevel: levelForStream(streamName),\n\t\t\t\t\t\tmessage: line,\n\t\t\t\t\t\tfields: { ...fields, stream: streamName },\n\t\t\t\t\t})\n\t\t\t\t\t.pipe(Effect.ignore);\n\t\t\t\tif (options.onLine !== undefined) {\n\t\t\t\t\tyield* options.onLine({ stream: streamName, line }).pipe(Effect.ignore);\n\t\t\t\t}\n\t\t\t}),\n\t\t),\n\t\tStream.runDrain,\n\t\tEffect.ignore,\n\t);\n\treturn drain;\n};\n\nexport const observeProcessLines = (\n\tstreams: {\n\t\treadonly stdout?: ProcessByteStream | null;\n\t\treadonly stderr?: ProcessByteStream | null;\n\t},\n\toptions: ObserveProcessLinesOptions,\n): Effect.Effect<void, never, Scope.Scope> =>\n\tEffect.gen(function* () {\n\t\tif (streams.stdout !== undefined && streams.stdout !== null) {\n\t\t\tyield* drainLineStream(streams.stdout, 'stdout', options).pipe(Effect.forkScoped);\n\t\t}\n\t\tif (streams.stderr !== undefined && streams.stderr !== null) {\n\t\t\tyield* drainLineStream(streams.stderr, 'stderr', options).pipe(Effect.forkScoped);\n\t\t}\n\t});\n"],"mappings":";;;;;;;;AAwBA,MAAa,kBACZ,WACiC,OAAO,KAAK,OAAO,YAAY,EAAE,OAAO,WAAW;AAErF,MAAa,wBACZ,QACA,YAAyC,UAAU,UAC5B;AACvB,KAAI,WAAW,QAAQ,WAAW,KAAA,EAAW,QAAO,OAAO;AAC3D,QAAO,OAAO,kBAAkB,QAAQ,SAAS;;AAGlD,MAAM,yBAAyB,WAC9B,WAAW,WAAW,SAAS;AAEhC,MAAM,mBACL,QACA,YACA,YACgC;CAChC,MAAM,iBAAiB,QAAQ,kBAAkB;CACjD,MAAM,SAAS,QAAQ,UAAU,EAAE;AAmBnC,QAlBc,eAAe,OAAO,CAAC,KACpC,OAAO,KAAK,SACX,OAAO,IAAI,aAAa;AACvB,SAAO,QAAQ,OACb,IAAI,QAAQ,KAAK,QAAQ,WAAW;GACpC,OAAO,eAAe,WAAW;GACjC,SAAS;GACT,QAAQ;IAAE,GAAG;IAAQ,QAAQ;IAAY;GACzC,CAAC,CACD,KAAK,OAAO,OAAO;AACrB,MAAI,QAAQ,WAAW,KAAA,EACtB,QAAO,QAAQ,OAAO;GAAE,QAAQ;GAAY;GAAM,CAAC,CAAC,KAAK,OAAO,OAAO;GAEvE,CACF,EACD,OAAO,UACP,OAAO,OAEI;;AAGb,MAAa,uBACZ,SAIA,YAEA,OAAO,IAAI,aAAa;AACvB,KAAI,QAAQ,WAAW,KAAA,KAAa,QAAQ,WAAW,KACtD,QAAO,gBAAgB,QAAQ,QAAQ,UAAU,QAAQ,CAAC,KAAK,OAAO,WAAW;AAElF,KAAI,QAAQ,WAAW,KAAA,KAAa,QAAQ,WAAW,KACtD,QAAO,gBAAgB,QAAQ,QAAQ,UAAU,QAAQ,CAAC,KAAK,OAAO,WAAW;EAEjF"}
@@ -0,0 +1,28 @@
1
+ import { Context, Effect, Layer } from "effect";
2
+
3
+ //#region src/substrate/runtime/observability/redaction.d.ts
4
+ declare namespace redaction_d_exports {
5
+ export { RedactionRule, Redactor, RedactorShape, layerRedactor, redactText, redactValue };
6
+ }
7
+ type RedactionRule = {
8
+ readonly kind: 'literal';
9
+ readonly value: string;
10
+ readonly replacement?: string;
11
+ } | {
12
+ readonly kind: 'pattern';
13
+ readonly pattern: RegExp;
14
+ readonly replacement?: string;
15
+ };
16
+ interface RedactorShape {
17
+ readonly register: (rule: RedactionRule) => Effect.Effect<void>;
18
+ readonly redact: (text: string) => Effect.Effect<string>;
19
+ readonly rules: Effect.Effect<ReadonlyArray<RedactionRule>>;
20
+ }
21
+ declare const Redactor_base: Context.ServiceClass<Redactor, "@devstack-rewrite/substrate/Redactor", RedactorShape>;
22
+ declare class Redactor extends Redactor_base {}
23
+ declare const redactText: (text: string, rules: ReadonlyArray<RedactionRule>) => string;
24
+ declare const redactValue: (value: unknown, rules: ReadonlyArray<RedactionRule>, visited?: WeakSet<object>) => unknown;
25
+ declare const layerRedactor: Layer.Layer<Redactor>;
26
+ //#endregion
27
+ export { RedactionRule, Redactor, RedactorShape, layerRedactor, redactText, redactValue, redaction_d_exports };
28
+ //# sourceMappingURL=redaction.d.mts.map
@@ -0,0 +1,45 @@
1
+ import { __exportAll } from "../../../_virtual/_rolldown/runtime.mjs";
2
+ import { Context, Effect, Layer, Ref } from "effect";
3
+ //#region src/substrate/runtime/observability/redaction.ts
4
+ var redaction_exports = /* @__PURE__ */ __exportAll({
5
+ Redactor: () => Redactor,
6
+ layerRedactor: () => layerRedactor,
7
+ redactText: () => redactText,
8
+ redactValue: () => redactValue
9
+ });
10
+ var Redactor = class extends Context.Service()("@devstack-rewrite/substrate/Redactor") {};
11
+ const DEFAULT_REPLACEMENT = "<redacted>";
12
+ const escapeRegExp = (value) => value.replace(/[.*+?^${}()|[\]\\]/gu, "\\$&");
13
+ const redactText = (text, rules) => {
14
+ let next = text;
15
+ for (const rule of rules) {
16
+ const replacement = rule.replacement ?? DEFAULT_REPLACEMENT;
17
+ if (rule.kind === "literal") {
18
+ if (rule.value.length === 0) continue;
19
+ next = next.replace(new RegExp(escapeRegExp(rule.value), "gu"), replacement);
20
+ } else next = next.replace(rule.pattern, replacement);
21
+ }
22
+ return next;
23
+ };
24
+ const redactValue = (value, rules, visited = /* @__PURE__ */ new WeakSet()) => {
25
+ if (typeof value === "string") return redactText(value, rules);
26
+ if (typeof value !== "object" || value === null) return value;
27
+ if (visited.has(value)) return value;
28
+ visited.add(value);
29
+ if (Array.isArray(value)) return value.map((entry) => redactValue(entry, rules, visited));
30
+ const out = {};
31
+ for (const [key, entry] of Object.entries(value)) out[key] = redactValue(entry, rules, visited);
32
+ return out;
33
+ };
34
+ const layerRedactor = Layer.effect(Redactor, Effect.gen(function* () {
35
+ const ref = yield* Ref.make([]);
36
+ return Redactor.of({
37
+ register: (rule) => Ref.update(ref, (rules) => [...rules, rule]),
38
+ redact: (text) => Ref.get(ref).pipe(Effect.map((rules) => redactText(text, rules))),
39
+ rules: Ref.get(ref)
40
+ });
41
+ }));
42
+ //#endregion
43
+ export { Redactor, layerRedactor, redactText, redactValue, redaction_exports };
44
+
45
+ //# sourceMappingURL=redaction.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redaction.mjs","names":[],"sources":["../../../../src/substrate/runtime/observability/redaction.ts"],"sourcesContent":["import { Context, Effect, Layer, Ref } from 'effect';\n\nexport type RedactionRule =\n\t| {\n\t\t\treadonly kind: 'literal';\n\t\t\treadonly value: string;\n\t\t\treadonly replacement?: string;\n\t }\n\t| {\n\t\t\treadonly kind: 'pattern';\n\t\t\treadonly pattern: RegExp;\n\t\t\treadonly replacement?: string;\n\t };\n\nexport interface RedactorShape {\n\treadonly register: (rule: RedactionRule) => Effect.Effect<void>;\n\treadonly redact: (text: string) => Effect.Effect<string>;\n\treadonly rules: Effect.Effect<ReadonlyArray<RedactionRule>>;\n}\n\nexport class Redactor extends Context.Service<Redactor, RedactorShape>()(\n\t'@devstack-rewrite/substrate/Redactor',\n) {}\n\nconst DEFAULT_REPLACEMENT = '<redacted>';\n\nconst escapeRegExp = (value: string): string => value.replace(/[.*+?^${}()|[\\]\\\\]/gu, '\\\\$&');\n\nexport const redactText = (text: string, rules: ReadonlyArray<RedactionRule>): string => {\n\tlet next = text;\n\tfor (const rule of rules) {\n\t\tconst replacement = rule.replacement ?? DEFAULT_REPLACEMENT;\n\t\tif (rule.kind === 'literal') {\n\t\t\tif (rule.value.length === 0) continue;\n\t\t\tnext = next.replace(new RegExp(escapeRegExp(rule.value), 'gu'), replacement);\n\t\t} else {\n\t\t\tnext = next.replace(rule.pattern, replacement);\n\t\t}\n\t}\n\treturn next;\n};\n\nexport const redactValue = (\n\tvalue: unknown,\n\trules: ReadonlyArray<RedactionRule>,\n\tvisited: WeakSet<object> = new WeakSet(),\n): unknown => {\n\tif (typeof value === 'string') return redactText(value, rules);\n\tif (typeof value !== 'object' || value === null) return value;\n\tif (visited.has(value)) return value;\n\tvisited.add(value);\n\tif (Array.isArray(value)) return value.map((entry) => redactValue(entry, rules, visited));\n\tconst out: Record<string, unknown> = {};\n\tfor (const [key, entry] of Object.entries(value)) {\n\t\tout[key] = redactValue(entry, rules, visited);\n\t}\n\treturn out;\n};\n\nexport const layerRedactor: Layer.Layer<Redactor> = Layer.effect(\n\tRedactor,\n\tEffect.gen(function* () {\n\t\tconst ref = yield* Ref.make<ReadonlyArray<RedactionRule>>([]);\n\t\treturn Redactor.of({\n\t\t\tregister: (rule) => Ref.update(ref, (rules) => [...rules, rule]),\n\t\t\tredact: (text) => Ref.get(ref).pipe(Effect.map((rules) => redactText(text, rules))),\n\t\t\trules: Ref.get(ref),\n\t\t});\n\t}),\n);\n"],"mappings":";;;;;;;;;AAoBA,IAAa,WAAb,cAA8B,QAAQ,SAAkC,CACvE,uCACA,CAAC;AAEF,MAAM,sBAAsB;AAE5B,MAAM,gBAAgB,UAA0B,MAAM,QAAQ,wBAAwB,OAAO;AAE7F,MAAa,cAAc,MAAc,UAAgD;CACxF,IAAI,OAAO;AACX,MAAK,MAAM,QAAQ,OAAO;EACzB,MAAM,cAAc,KAAK,eAAe;AACxC,MAAI,KAAK,SAAS,WAAW;AAC5B,OAAI,KAAK,MAAM,WAAW,EAAG;AAC7B,UAAO,KAAK,QAAQ,IAAI,OAAO,aAAa,KAAK,MAAM,EAAE,KAAK,EAAE,YAAY;QAE5E,QAAO,KAAK,QAAQ,KAAK,SAAS,YAAY;;AAGhD,QAAO;;AAGR,MAAa,eACZ,OACA,OACA,0BAA2B,IAAI,SAAS,KAC3B;AACb,KAAI,OAAO,UAAU,SAAU,QAAO,WAAW,OAAO,MAAM;AAC9D,KAAI,OAAO,UAAU,YAAY,UAAU,KAAM,QAAO;AACxD,KAAI,QAAQ,IAAI,MAAM,CAAE,QAAO;AAC/B,SAAQ,IAAI,MAAM;AAClB,KAAI,MAAM,QAAQ,MAAM,CAAE,QAAO,MAAM,KAAK,UAAU,YAAY,OAAO,OAAO,QAAQ,CAAC;CACzF,MAAM,MAA+B,EAAE;AACvC,MAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,MAAM,CAC/C,KAAI,OAAO,YAAY,OAAO,OAAO,QAAQ;AAE9C,QAAO;;AAGR,MAAa,gBAAuC,MAAM,OACzD,UACA,OAAO,IAAI,aAAa;CACvB,MAAM,MAAM,OAAO,IAAI,KAAmC,EAAE,CAAC;AAC7D,QAAO,SAAS,GAAG;EAClB,WAAW,SAAS,IAAI,OAAO,MAAM,UAAU,CAAC,GAAG,OAAO,KAAK,CAAC;EAChE,SAAS,SAAS,IAAI,IAAI,IAAI,CAAC,KAAK,OAAO,KAAK,UAAU,WAAW,MAAM,MAAM,CAAC,CAAC;EACnF,OAAO,IAAI,IAAI,IAAI;EACnB,CAAC;EACD,CACF"}
@@ -0,0 +1 @@
1
+ import { Effect } from "effect";
@@ -0,0 +1,87 @@
1
+ import { Effect } from "effect";
2
+ //#region src/substrate/runtime/observability/spans.ts
3
+ /** Canonical span-attribute keys. Single source of truth for the
4
+ * observability vocabulary. */
5
+ const SpanAttr = {
6
+ accountFundingFrom: "account.funding.from",
7
+ accountFundingTo: "account.funding.to",
8
+ accountName: "account.name",
9
+ app: "devstack.app",
10
+ stack: "devstack.stack",
11
+ network: "devstack.network",
12
+ coinType: "coin.type",
13
+ plugin: "devstack.plugin",
14
+ role: "devstack.role",
15
+ phase: "devstack.phase",
16
+ containerName: "container.name",
17
+ containerRole: "container.role",
18
+ event: "event.name",
19
+ errorCode: "error.code",
20
+ errorCause: "error.cause",
21
+ errorMessage: "error.message",
22
+ exitCode: "process.exit.code",
23
+ exitSignal: "process.exit.signal",
24
+ exitStatus: "process.exit.status",
25
+ endpointKey: "devstack.endpoint.key",
26
+ httpMethod: "http.method",
27
+ httpPath: "http.path",
28
+ httpUrl: "http.url",
29
+ host: "server.address",
30
+ logTag: "log.tag",
31
+ port: "server.port",
32
+ cycleId: "devstack.cycle.id",
33
+ op: "devstack.op",
34
+ requestId: "devstack.request.id",
35
+ rosterHeartbeatIntervalMs: "roster.heartbeat.intervalMs",
36
+ serviceName: "devstack.service.name",
37
+ stageAndSwapStagingPath: "stageAndSwap.stagingPath",
38
+ stageAndSwapTargetPath: "stageAndSwap.targetPath",
39
+ suiAutoTickIntervalMs: "sui.autoTick.intervalMs",
40
+ suiMode: "sui.mode",
41
+ walletToken: "wallet.token",
42
+ walletBearerValid: "wallet.auth.bearerValid",
43
+ walletLocalhostViteEnabled: "wallet.localhostViteEnabled",
44
+ walletOrigin: "wallet.origin",
45
+ walletTokenFile: "wallet.tokenFile",
46
+ walletUrl: "wallet.url"
47
+ };
48
+ /**
49
+ * Wrap an Effect in a stack-scoped span. Sets `devstack.app`,
50
+ * `devstack.stack`, `devstack.network` attributes. Use at the
51
+ * top-level engine entry points (boot, cycle start, supervisor
52
+ * loop) — not inside per-plugin code (use `withPluginSpan` for that).
53
+ */
54
+ const withStackSpan = (name, ctx) => (effect) => effect.pipe(Effect.withSpan(name, { attributes: {
55
+ [SpanAttr.app]: ctx.app,
56
+ [SpanAttr.stack]: ctx.stack,
57
+ [SpanAttr.network]: ctx.network
58
+ } }));
59
+ /**
60
+ * Wrap an Effect in a plugin-scoped span. Inherits stack identity from
61
+ * the surrounding Context (callers should compose with
62
+ * `withStackSpan` at the top so the stack identity propagates).
63
+ */
64
+ const withPluginSpan = (name, ctx) => (effect) => effect.pipe(Effect.withSpan(name, { attributes: {
65
+ [SpanAttr.app]: ctx.app,
66
+ [SpanAttr.stack]: ctx.stack,
67
+ [SpanAttr.network]: ctx.network,
68
+ [SpanAttr.plugin]: ctx.pluginKey,
69
+ [SpanAttr.role]: ctx.role
70
+ } }));
71
+ /**
72
+ * Annotate the current span with a phase marker. Cheap; safe to call
73
+ * from anywhere. Used by the supervisor when transitioning a plugin
74
+ * through acquire phases so the OTEL trace correlates with the
75
+ * lifecycle stream.
76
+ */
77
+ const annotatePhase = (phase) => Effect.annotateCurrentSpan({ [SpanAttr.phase]: phase });
78
+ /**
79
+ * Annotate the current span with a subprocess `op` tag. Mirrors the
80
+ * `CaptureError.op` field so a failure that originates in a captured
81
+ * subprocess can be traced back to its span by `devstack.op`.
82
+ */
83
+ const annotateOp = (op) => Effect.annotateCurrentSpan({ [SpanAttr.op]: op });
84
+ //#endregion
85
+ export { SpanAttr, annotateOp, annotatePhase, withPluginSpan, withStackSpan };
86
+
87
+ //# sourceMappingURL=spans.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spans.mjs","names":[],"sources":["../../../../src/substrate/runtime/observability/spans.ts"],"sourcesContent":["// Span propagation wrappers.\n//\n// Architecture § L0 Observability: \"span/annotation conventions\".\n// Centralises the attribute keys so every wrapped span uses the same\n// vocabulary — OTEL consumers can filter by `devstack.app`,\n// `devstack.stack`, `devstack.plugin`, `devstack.role` reliably.\n//\n// Discipline: no service names appear anywhere; only the four\n// engine-level dimensions. Plugins call `withPluginSpan` and pass\n// their `pluginKey` + `role`.\n\nimport { Effect } from 'effect';\n\nimport type { PluginKey } from '../../brand.ts';\nimport type { PluginRole } from '../../lifecycle.ts';\n\n/** Canonical span-attribute keys. Single source of truth for the\n * observability vocabulary. */\nexport const SpanAttr = {\n\taccountFundingFrom: 'account.funding.from',\n\taccountFundingTo: 'account.funding.to',\n\taccountName: 'account.name',\n\tapp: 'devstack.app',\n\tstack: 'devstack.stack',\n\tnetwork: 'devstack.network',\n\tcoinType: 'coin.type',\n\tplugin: 'devstack.plugin',\n\trole: 'devstack.role',\n\tphase: 'devstack.phase',\n\tcontainerName: 'container.name',\n\tcontainerRole: 'container.role',\n\tevent: 'event.name',\n\terrorCode: 'error.code',\n\terrorCause: 'error.cause',\n\terrorMessage: 'error.message',\n\texitCode: 'process.exit.code',\n\texitSignal: 'process.exit.signal',\n\texitStatus: 'process.exit.status',\n\tendpointKey: 'devstack.endpoint.key',\n\thttpMethod: 'http.method',\n\thttpPath: 'http.path',\n\thttpUrl: 'http.url',\n\thost: 'server.address',\n\tlogTag: 'log.tag',\n\tport: 'server.port',\n\tcycleId: 'devstack.cycle.id',\n\top: 'devstack.op',\n\trequestId: 'devstack.request.id',\n\trosterHeartbeatIntervalMs: 'roster.heartbeat.intervalMs',\n\tserviceName: 'devstack.service.name',\n\tstageAndSwapStagingPath: 'stageAndSwap.stagingPath',\n\tstageAndSwapTargetPath: 'stageAndSwap.targetPath',\n\tsuiAutoTickIntervalMs: 'sui.autoTick.intervalMs',\n\tsuiMode: 'sui.mode',\n\twalletToken: 'wallet.token',\n\twalletBearerValid: 'wallet.auth.bearerValid',\n\twalletLocalhostViteEnabled: 'wallet.localhostViteEnabled',\n\twalletOrigin: 'wallet.origin',\n\twalletTokenFile: 'wallet.tokenFile',\n\twalletUrl: 'wallet.url',\n} as const;\n\nexport interface StackSpanContext {\n\treadonly app: string;\n\treadonly stack: string;\n\treadonly network: string;\n}\n\nexport interface PluginSpanContext extends StackSpanContext {\n\treadonly pluginKey: PluginKey;\n\treadonly role: PluginRole;\n}\n\n/**\n * Wrap an Effect in a stack-scoped span. Sets `devstack.app`,\n * `devstack.stack`, `devstack.network` attributes. Use at the\n * top-level engine entry points (boot, cycle start, supervisor\n * loop) — not inside per-plugin code (use `withPluginSpan` for that).\n */\nexport const withStackSpan =\n\t(name: string, ctx: StackSpanContext) =>\n\t<A, E, R>(effect: Effect.Effect<A, E, R>): Effect.Effect<A, E, R> =>\n\t\teffect.pipe(\n\t\t\tEffect.withSpan(name, {\n\t\t\t\tattributes: {\n\t\t\t\t\t[SpanAttr.app]: ctx.app,\n\t\t\t\t\t[SpanAttr.stack]: ctx.stack,\n\t\t\t\t\t[SpanAttr.network]: ctx.network,\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\n/**\n * Wrap an Effect in a plugin-scoped span. Inherits stack identity from\n * the surrounding Context (callers should compose with\n * `withStackSpan` at the top so the stack identity propagates).\n */\nexport const withPluginSpan =\n\t(name: string, ctx: PluginSpanContext) =>\n\t<A, E, R>(effect: Effect.Effect<A, E, R>): Effect.Effect<A, E, R> =>\n\t\teffect.pipe(\n\t\t\tEffect.withSpan(name, {\n\t\t\t\tattributes: {\n\t\t\t\t\t[SpanAttr.app]: ctx.app,\n\t\t\t\t\t[SpanAttr.stack]: ctx.stack,\n\t\t\t\t\t[SpanAttr.network]: ctx.network,\n\t\t\t\t\t[SpanAttr.plugin]: ctx.pluginKey,\n\t\t\t\t\t[SpanAttr.role]: ctx.role,\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\n/**\n * Annotate the current span with a phase marker. Cheap; safe to call\n * from anywhere. Used by the supervisor when transitioning a plugin\n * through acquire phases so the OTEL trace correlates with the\n * lifecycle stream.\n */\nexport const annotatePhase = (phase: string): Effect.Effect<void> =>\n\tEffect.annotateCurrentSpan({ [SpanAttr.phase]: phase });\n\n/**\n * Annotate the current span with the engine cycle id. Called once per\n * cycle at supervisor entry.\n */\nexport const annotateCycle = (cycleId: number): Effect.Effect<void> =>\n\tEffect.annotateCurrentSpan({ [SpanAttr.cycleId]: cycleId });\n\n/**\n * Annotate the current span with a subprocess `op` tag. Mirrors the\n * `CaptureError.op` field so a failure that originates in a captured\n * subprocess can be traced back to its span by `devstack.op`.\n */\nexport const annotateOp = (op: string): Effect.Effect<void> =>\n\tEffect.annotateCurrentSpan({ [SpanAttr.op]: op });\n"],"mappings":";;;;AAkBA,MAAa,WAAW;CACvB,oBAAoB;CACpB,kBAAkB;CAClB,aAAa;CACb,KAAK;CACL,OAAO;CACP,SAAS;CACT,UAAU;CACV,QAAQ;CACR,MAAM;CACN,OAAO;CACP,eAAe;CACf,eAAe;CACf,OAAO;CACP,WAAW;CACX,YAAY;CACZ,cAAc;CACd,UAAU;CACV,YAAY;CACZ,YAAY;CACZ,aAAa;CACb,YAAY;CACZ,UAAU;CACV,SAAS;CACT,MAAM;CACN,QAAQ;CACR,MAAM;CACN,SAAS;CACT,IAAI;CACJ,WAAW;CACX,2BAA2B;CAC3B,aAAa;CACb,yBAAyB;CACzB,wBAAwB;CACxB,uBAAuB;CACvB,SAAS;CACT,aAAa;CACb,mBAAmB;CACnB,4BAA4B;CAC5B,cAAc;CACd,iBAAiB;CACjB,WAAW;CACX;;;;;;;AAmBD,MAAa,iBACX,MAAc,SACL,WACT,OAAO,KACN,OAAO,SAAS,MAAM,EACrB,YAAY;EACV,SAAS,MAAM,IAAI;EACnB,SAAS,QAAQ,IAAI;EACrB,SAAS,UAAU,IAAI;CACxB,EACD,CAAC,CACF;;;;;;AAOH,MAAa,kBACX,MAAc,SACL,WACT,OAAO,KACN,OAAO,SAAS,MAAM,EACrB,YAAY;EACV,SAAS,MAAM,IAAI;EACnB,SAAS,QAAQ,IAAI;EACrB,SAAS,UAAU,IAAI;EACvB,SAAS,SAAS,IAAI;EACtB,SAAS,OAAO,IAAI;CACrB,EACD,CAAC,CACF;;;;;;;AAQH,MAAa,iBAAiB,UAC7B,OAAO,oBAAoB,GAAG,SAAS,QAAQ,OAAO,CAAC;;;;;;AAcxD,MAAa,cAAc,OAC1B,OAAO,oBAAoB,GAAG,SAAS,KAAK,IAAI,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { Effect } from "effect";
2
+ import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process";
@@ -0,0 +1,82 @@
1
+ import { splitUtf8Lines } from "./process-lines.mjs";
2
+ import { Data, Effect, Stream } from "effect";
3
+ import "effect/unstable/process";
4
+ //#region src/substrate/runtime/observability/subprocess-capture.ts
5
+ /**
6
+ * The one subprocess-capture error class. Two failure modes:
7
+ *
8
+ * (a) Spawner failure (binary missing, fork limit, pipe setup). The
9
+ * `cause` field carries the spawner's raw failure; `exitCode` is
10
+ * undefined.
11
+ * (b) Non-zero exit when `opts.nonZeroIsFailure` was true. The
12
+ * `exitCode`, `stdout`, `stderr` fields are populated;
13
+ * `cause` is undefined.
14
+ *
15
+ * Downstream wrappers (plugins) wrap this with their own envelopes via
16
+ * `Effect.mapError`. The `op` field carries through so the failure
17
+ * attribution survives.
18
+ */
19
+ var CaptureError = class extends Data.TaggedError("CaptureError") {};
20
+ const DEFAULT_STDERR_TRUNC = 500;
21
+ const truncateTo = (text, limit) => {
22
+ if (!Number.isFinite(limit) || text.length <= limit) return text;
23
+ return `${text.slice(0, limit)}…[truncated]`;
24
+ };
25
+ const opOf = (cmd, override) => {
26
+ if (override !== void 0) return override;
27
+ if (cmd._tag === "StandardCommand") return cmd.command;
28
+ return "piped-command";
29
+ };
30
+ const drainObserved = (stream, observer) => {
31
+ if (!observer) return Stream.mkString(Stream.decodeText(stream));
32
+ const lines = splitUtf8Lines(stream).pipe(Stream.tap((line) => observer(line).pipe(Effect.ignore)));
33
+ return Stream.runFold(lines, () => "", (acc, line) => acc.length === 0 ? line : `${acc}\n${line}`);
34
+ };
35
+ /**
36
+ * Spawn `cmd`, drain stdout + stderr + exit code concurrently. Returns
37
+ * the captured result, or fails with `CaptureError` if the spawner
38
+ * itself failed (or if `nonZeroIsFailure` was set and the child exited
39
+ * non-zero).
40
+ *
41
+ * One function. One error class. Stream observers are opt-in via
42
+ * `opts.onStdoutLine` / `opts.onStderrLine` — the streaming and
43
+ * non-streaming variants are no longer separate functions.
44
+ */
45
+ const capture = (spawner, cmd, opts) => {
46
+ const op = opOf(cmd, opts?.op);
47
+ const stderrLimit = opts?.stderrTruncate ?? DEFAULT_STDERR_TRUNC;
48
+ const stdoutLimit = opts?.stdoutTruncate ?? Infinity;
49
+ const nonZeroIsFailure = opts?.nonZeroIsFailure ?? false;
50
+ const onStdoutLine = opts?.onStdoutLine;
51
+ const onStderrLine = opts?.onStderrLine;
52
+ const mapSpawn = (cause) => new CaptureError({
53
+ op,
54
+ stdout: "",
55
+ stderr: "",
56
+ cause
57
+ });
58
+ return Effect.scoped(Effect.gen(function* () {
59
+ const handle = yield* spawner.spawn(cmd).pipe(Effect.mapError(mapSpawn));
60
+ const [stdoutText, stderrText, code] = yield* Effect.all([
61
+ drainObserved(handle.stdout, onStdoutLine).pipe(Effect.mapError(mapSpawn)),
62
+ drainObserved(handle.stderr, onStderrLine).pipe(Effect.mapError(mapSpawn)),
63
+ handle.exitCode.pipe(Effect.mapError(mapSpawn))
64
+ ], { concurrency: "unbounded" });
65
+ const result = {
66
+ exitCode: code,
67
+ stdout: truncateTo(stdoutText, stdoutLimit),
68
+ stderr: truncateTo(stderrText, stderrLimit)
69
+ };
70
+ if (nonZeroIsFailure && result.exitCode !== 0) return yield* Effect.fail(new CaptureError({
71
+ op,
72
+ exitCode: result.exitCode,
73
+ stdout: result.stdout,
74
+ stderr: result.stderr
75
+ }));
76
+ return result;
77
+ }));
78
+ };
79
+ //#endregion
80
+ export { capture };
81
+
82
+ //# sourceMappingURL=subprocess-capture.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subprocess-capture.mjs","names":[],"sources":["../../../../src/substrate/runtime/observability/subprocess-capture.ts"],"sourcesContent":["// Subprocess output capture — one variant, one error.\n//\n// Architecture § Collapsed: the legacy package shipped per-service\n// per-line docker log sinks and four spawn-and-capture helpers\n// (`captureCommand`, `captureCommandOrFail`, `captureCommandStreaming`,\n// `captureCommandStreamingOrFail`); this module collapses them to one\n// shape parameterised by options.\n//\n// Surface:\n//\n// capture(spawner, cmd, opts) -> Effect<CaptureResult, CaptureError>\n//\n// - Always returns `CaptureResult` for zero AND non-zero exits when\n// `opts.nonZeroIsFailure` is unset (or `false`). The caller decides.\n// - With `opts.nonZeroIsFailure: true` the Effect fails with\n// `CaptureError` carrying `exitCode` on non-zero exit.\n// - With `opts.onStdoutLine` set, each stdout line is emitted to the\n// callback as it arrives (line-buffered across chunk boundaries).\n// The full stdout is still returned in `CaptureResult.stdout` so\n// the error envelope downstream stays uniform.\n// - With `opts.onStderrLine` set, same shape for stderr (motivated\n// by the L1 per-line sink that promotes WARN/ERROR markers — see\n// architecture L1 § \"Shared per-line streaming sink\").\n//\n// One error class for every failure mode (spawner failure, non-zero\n// exit when promoted). The `op` tag attributes the failure to a\n// specific subprocess invocation; downstream wrappers route this into\n// their own envelopes via `Effect.mapError`.\n\nimport { Effect, Stream } from 'effect';\nimport { Data } from 'effect';\nimport type { ChildProcess } from 'effect/unstable/process';\nimport { ChildProcessSpawner } from 'effect/unstable/process';\n\nimport { splitUtf8Lines } from './process-lines.ts';\n\n// -----------------------------------------------------------------------------\n// Single error class\n// -----------------------------------------------------------------------------\n\n/**\n * The one subprocess-capture error class. Two failure modes:\n *\n * (a) Spawner failure (binary missing, fork limit, pipe setup). The\n * `cause` field carries the spawner's raw failure; `exitCode` is\n * undefined.\n * (b) Non-zero exit when `opts.nonZeroIsFailure` was true. The\n * `exitCode`, `stdout`, `stderr` fields are populated;\n * `cause` is undefined.\n *\n * Downstream wrappers (plugins) wrap this with their own envelopes via\n * `Effect.mapError`. The `op` field carries through so the failure\n * attribution survives.\n */\nexport class CaptureError extends Data.TaggedError('CaptureError')<{\n\treadonly op: string;\n\treadonly exitCode?: number;\n\treadonly stdout: string;\n\treadonly stderr: string;\n\treadonly cause?: unknown;\n}> {}\n\n// -----------------------------------------------------------------------------\n// Public types\n// -----------------------------------------------------------------------------\n\nexport interface CaptureResult {\n\treadonly exitCode: number;\n\treadonly stdout: string;\n\treadonly stderr: string;\n}\n\nexport interface CaptureOptions {\n\t/**\n\t * Caller-supplied tag identifying the subprocess invocation. Embedded\n\t * in any `CaptureError` so downstream envelopes have stable\n\t * attribution. Defaults to the command's `command` field when absent.\n\t */\n\treadonly op?: string;\n\t/**\n\t * Maximum stderr bytes preserved on a captured-error path. Past the\n\t * limit, the surplus is dropped and `…[truncated]` is appended.\n\t * Default 500 (tightest of the historical policies; common case is\n\t * a TUI row that must fit one line).\n\t */\n\treadonly stderrTruncate?: number;\n\t/**\n\t * Maximum stdout bytes preserved on a captured-error path. Default\n\t * `Infinity` — most callers want full stdout for parsing.\n\t */\n\treadonly stdoutTruncate?: number;\n\t/**\n\t * Promote a non-zero exit code into a `CaptureError`. The error\n\t * carries the captured stdout/stderr verbatim. Default `false` (the\n\t * caller decides).\n\t */\n\treadonly nonZeroIsFailure?: boolean;\n\t/**\n\t * Per-line stdout observer. Lines are buffered across chunk boundaries\n\t * via `Stream.splitLines`. Callback errors are ignored (the capture\n\t * must never abort because narration failed).\n\t */\n\treadonly onStdoutLine?: (line: string) => Effect.Effect<void>;\n\t/**\n\t * Per-line stderr observer. Same semantics as `onStdoutLine`. The L1\n\t * shared per-line sink (level promotion: stderr lines containing\n\t * `WARN`/`ERROR` markers) routes through here.\n\t */\n\treadonly onStderrLine?: (line: string) => Effect.Effect<void>;\n}\n\n// -----------------------------------------------------------------------------\n// Constants\n// -----------------------------------------------------------------------------\n\nconst DEFAULT_STDERR_TRUNC = 500;\n\n// -----------------------------------------------------------------------------\n// Helpers\n// -----------------------------------------------------------------------------\n\nconst truncateTo = (text: string, limit: number): string => {\n\tif (!Number.isFinite(limit) || text.length <= limit) return text;\n\treturn `${text.slice(0, limit)}…[truncated]`;\n};\n\nconst opOf = (cmd: ChildProcess.Command, override: string | undefined): string => {\n\tif (override !== undefined) return override;\n\tif (cmd._tag === 'StandardCommand') return cmd.command;\n\treturn 'piped-command';\n};\n\ntype SpawnerService = ReturnType<typeof ChildProcessSpawner.make>;\n\nconst drainObserved = <E>(\n\tstream: Stream.Stream<Uint8Array, E>,\n\tobserver: ((line: string) => Effect.Effect<void>) | undefined,\n): Effect.Effect<string, E> => {\n\tif (!observer) {\n\t\treturn Stream.mkString(Stream.decodeText(stream));\n\t}\n\tconst lines = splitUtf8Lines(stream).pipe(\n\t\tStream.tap((line) => observer(line).pipe(Effect.ignore)),\n\t);\n\t// Re-fold lines into the full stdout/stderr string. We don't append\n\t// a trailing newline — mirrors the non-observed path so the captured\n\t// error shape is uniform regardless of whether an observer was set.\n\treturn Stream.runFold(\n\t\tlines,\n\t\t() => '',\n\t\t(acc, line) => (acc.length === 0 ? line : `${acc}\\n${line}`),\n\t);\n};\n\n// -----------------------------------------------------------------------------\n// The one capture function\n// -----------------------------------------------------------------------------\n\n/**\n * Spawn `cmd`, drain stdout + stderr + exit code concurrently. Returns\n * the captured result, or fails with `CaptureError` if the spawner\n * itself failed (or if `nonZeroIsFailure` was set and the child exited\n * non-zero).\n *\n * One function. One error class. Stream observers are opt-in via\n * `opts.onStdoutLine` / `opts.onStderrLine` — the streaming and\n * non-streaming variants are no longer separate functions.\n */\nexport const capture = (\n\tspawner: SpawnerService,\n\tcmd: ChildProcess.Command,\n\topts?: CaptureOptions,\n): Effect.Effect<CaptureResult, CaptureError> => {\n\tconst op = opOf(cmd, opts?.op);\n\tconst stderrLimit = opts?.stderrTruncate ?? DEFAULT_STDERR_TRUNC;\n\tconst stdoutLimit = opts?.stdoutTruncate ?? Infinity;\n\tconst nonZeroIsFailure = opts?.nonZeroIsFailure ?? false;\n\tconst onStdoutLine = opts?.onStdoutLine;\n\tconst onStderrLine = opts?.onStderrLine;\n\tconst mapSpawn = (cause: unknown): CaptureError =>\n\t\tnew CaptureError({ op, stdout: '', stderr: '', cause });\n\n\treturn Effect.scoped(\n\t\tEffect.gen(function* () {\n\t\t\tconst handle = yield* spawner.spawn(cmd).pipe(Effect.mapError(mapSpawn));\n\t\t\tconst [stdoutText, stderrText, code] = yield* Effect.all(\n\t\t\t\t[\n\t\t\t\t\tdrainObserved(handle.stdout, onStdoutLine).pipe(Effect.mapError(mapSpawn)),\n\t\t\t\t\tdrainObserved(handle.stderr, onStderrLine).pipe(Effect.mapError(mapSpawn)),\n\t\t\t\t\thandle.exitCode.pipe(Effect.mapError(mapSpawn)),\n\t\t\t\t],\n\t\t\t\t{ concurrency: 'unbounded' },\n\t\t\t);\n\t\t\tconst result: CaptureResult = {\n\t\t\t\texitCode: code as number,\n\t\t\t\tstdout: truncateTo(stdoutText, stdoutLimit),\n\t\t\t\tstderr: truncateTo(stderrText, stderrLimit),\n\t\t\t};\n\t\t\tif (nonZeroIsFailure && result.exitCode !== 0) {\n\t\t\t\treturn yield* Effect.fail(\n\t\t\t\t\tnew CaptureError({\n\t\t\t\t\t\top,\n\t\t\t\t\t\texitCode: result.exitCode,\n\t\t\t\t\t\tstdout: result.stdout,\n\t\t\t\t\t\tstderr: result.stderr,\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn result;\n\t\t}),\n\t);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAsDA,IAAa,eAAb,cAAkC,KAAK,YAAY,eAAe,CAM/D;AAuDH,MAAM,uBAAuB;AAM7B,MAAM,cAAc,MAAc,UAA0B;AAC3D,KAAI,CAAC,OAAO,SAAS,MAAM,IAAI,KAAK,UAAU,MAAO,QAAO;AAC5D,QAAO,GAAG,KAAK,MAAM,GAAG,MAAM,CAAC;;AAGhC,MAAM,QAAQ,KAA2B,aAAyC;AACjF,KAAI,aAAa,KAAA,EAAW,QAAO;AACnC,KAAI,IAAI,SAAS,kBAAmB,QAAO,IAAI;AAC/C,QAAO;;AAKR,MAAM,iBACL,QACA,aAC8B;AAC9B,KAAI,CAAC,SACJ,QAAO,OAAO,SAAS,OAAO,WAAW,OAAO,CAAC;CAElD,MAAM,QAAQ,eAAe,OAAO,CAAC,KACpC,OAAO,KAAK,SAAS,SAAS,KAAK,CAAC,KAAK,OAAO,OAAO,CAAC,CACxD;AAID,QAAO,OAAO,QACb,aACM,KACL,KAAK,SAAU,IAAI,WAAW,IAAI,OAAO,GAAG,IAAI,IAAI,OACrD;;;;;;;;;;;;AAiBF,MAAa,WACZ,SACA,KACA,SACgD;CAChD,MAAM,KAAK,KAAK,KAAK,MAAM,GAAG;CAC9B,MAAM,cAAc,MAAM,kBAAkB;CAC5C,MAAM,cAAc,MAAM,kBAAkB;CAC5C,MAAM,mBAAmB,MAAM,oBAAoB;CACnD,MAAM,eAAe,MAAM;CAC3B,MAAM,eAAe,MAAM;CAC3B,MAAM,YAAY,UACjB,IAAI,aAAa;EAAE;EAAI,QAAQ;EAAI,QAAQ;EAAI;EAAO,CAAC;AAExD,QAAO,OAAO,OACb,OAAO,IAAI,aAAa;EACvB,MAAM,SAAS,OAAO,QAAQ,MAAM,IAAI,CAAC,KAAK,OAAO,SAAS,SAAS,CAAC;EACxE,MAAM,CAAC,YAAY,YAAY,QAAQ,OAAO,OAAO,IACpD;GACC,cAAc,OAAO,QAAQ,aAAa,CAAC,KAAK,OAAO,SAAS,SAAS,CAAC;GAC1E,cAAc,OAAO,QAAQ,aAAa,CAAC,KAAK,OAAO,SAAS,SAAS,CAAC;GAC1E,OAAO,SAAS,KAAK,OAAO,SAAS,SAAS,CAAC;GAC/C,EACD,EAAE,aAAa,aAAa,CAC5B;EACD,MAAM,SAAwB;GAC7B,UAAU;GACV,QAAQ,WAAW,YAAY,YAAY;GAC3C,QAAQ,WAAW,YAAY,YAAY;GAC3C;AACD,MAAI,oBAAoB,OAAO,aAAa,EAC3C,QAAO,OAAO,OAAO,KACpB,IAAI,aAAa;GAChB;GACA,UAAU,OAAO;GACjB,QAAQ,OAAO;GACf,QAAQ,OAAO;GACf,CAAC,CACF;AAEF,SAAO;GACN,CACF"}
@@ -0,0 +1,17 @@
1
+ import { Identity } from "../identity.mjs";
2
+ import { Context, Layer, Path } from "effect";
3
+
4
+ //#region src/substrate/runtime/paths.d.ts
5
+ declare const IdentityContext_base: Context.ServiceClass<IdentityContext, "@devstack-rewrite/substrate/Identity", Identity>;
6
+ /**
7
+ * Identity-bound. Same shape as `substrate/identity.ts`'s `Identity`,
8
+ * but lifted into a Context service so path resolution can yield it
9
+ * without taking it as a function argument.
10
+ *
11
+ * Boot wires this once (Identity is validated up front); the
12
+ * resolver and every consumer reads from this single source.
13
+ */
14
+ declare class IdentityContext extends IdentityContext_base {}
15
+ //#endregion
16
+ export { IdentityContext };
17
+ //# sourceMappingURL=paths.d.mts.map
@@ -0,0 +1,61 @@
1
+ import { Context, Effect, Layer, Path } from "effect";
2
+ //#region src/substrate/runtime/paths.ts
3
+ var RuntimeRoot = class extends Context.Service()("@devstack-rewrite/substrate/RuntimeRoot") {};
4
+ /** Build a `RuntimeRoot` layer pinned to a literal path. */
5
+ const layerRuntimeRoot = (root) => Layer.succeed(RuntimeRoot)({ root });
6
+ /**
7
+ * Identity-bound. Same shape as `substrate/identity.ts`'s `Identity`,
8
+ * but lifted into a Context service so path resolution can yield it
9
+ * without taking it as a function argument.
10
+ *
11
+ * Boot wires this once (Identity is validated up front); the
12
+ * resolver and every consumer reads from this single source.
13
+ */
14
+ var IdentityContext = class extends Context.Service()("@devstack-rewrite/substrate/Identity") {};
15
+ const layerIdentity = (identity) => Layer.succeed(IdentityContext)(identity);
16
+ /**
17
+ * The path resolver service. Yields `StackPaths` once per stack —
18
+ * `Effect.cached`-friendly since `Identity` + `RuntimeRoot` are
19
+ * boot-immutable.
20
+ */
21
+ var StackPathsService = class extends Context.Service()("@devstack-rewrite/substrate/StackPaths") {};
22
+ /**
23
+ * Layer that materializes the resolver from `RuntimeRoot` +
24
+ * `IdentityContext` + the Effect `Path` service. The cache helper
25
+ * uses `Path.join` so OS-correct separators round-trip on Windows
26
+ * (defense-in-depth — devstack is posix-only in practice but the
27
+ * cost of `Path.join` over template strings is zero).
28
+ */
29
+ const layerStackPaths = Layer.effect(StackPathsService, Effect.gen(function* () {
30
+ const { root } = yield* RuntimeRoot;
31
+ const identity = yield* IdentityContext;
32
+ const path = yield* Path.Path;
33
+ const stackRoot = path.join(root, "stacks", identity.stack);
34
+ const cacheDir = path.join(stackRoot, "cache");
35
+ const cacheNamespaceDir = (namespace) => path.join(cacheDir, namespace);
36
+ const cacheChainDir = (namespace, chain) => path.join(cacheNamespaceDir(namespace), chain);
37
+ const cacheEntry = (namespace, chain, contentHash) => {
38
+ const dir = cacheChainDir(namespace, chain);
39
+ return {
40
+ dir,
41
+ file: path.join(dir, `${contentHash}.json`)
42
+ };
43
+ };
44
+ return StackPathsService.of({
45
+ stackRoot,
46
+ stateFile: path.join(stackRoot, "state.json"),
47
+ stateLockHint: path.join(stackRoot, "state.json.lock"),
48
+ cacheDir,
49
+ snapshotDir: path.join(stackRoot, "snapshots"),
50
+ stackLockFile: path.join(stackRoot, "stack.lock"),
51
+ rosterFile: path.join(stackRoot, "roster.json"),
52
+ snapshotReservationFile: path.join(stackRoot, "snapshot.reservation"),
53
+ cacheEntry,
54
+ cacheChainDir,
55
+ cacheNamespaceDir
56
+ });
57
+ }));
58
+ //#endregion
59
+ export { IdentityContext, RuntimeRoot, StackPathsService, layerIdentity, layerRuntimeRoot, layerStackPaths };
60
+
61
+ //# sourceMappingURL=paths.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.mjs","names":[],"sources":["../../../src/substrate/runtime/paths.ts"],"sourcesContent":["// Unified path resolver.\n//\n// Architecture § \"What's collapsed\" — three path resolvers\n// (state-store, service-paths, snapshot) consolidate to one. This is\n// the L0 helper every disk-touching subsystem reaches for; nothing\n// else in the runtime package may compose `<root>/stacks/<stack>/...`\n// by hand.\n//\n// The resolver is a typed bundle: given an `Identity` and the\n// `RuntimeRoot`, it returns the closed set of paths the substrate\n// understands. Subsystems that need a sub-path inside one of those\n// (e.g. cache namespace + chain + content-hash) compose ON TOP of the\n// bundle's `cacheDir`, but they NEVER reach for\n// `path.join(root, 'stacks', stack)` themselves.\n\nimport { Context, Effect, Layer, Path } from 'effect';\n\nimport type { Identity } from '../identity.ts';\n\n/**\n * Runtime root — the on-disk base under which every stack's state\n * lives. Defaults to `.devstack`, but is injectable so tests pin to\n * a tempdir and parallel-stack tests pin to per-test prefixes.\n *\n * Held as a tagged service so the rest of the substrate can request\n * it without threading the string through every signature.\n */\nexport interface RuntimeRootShape {\n\treadonly root: string;\n}\n\nexport class RuntimeRoot extends Context.Service<RuntimeRoot, RuntimeRootShape>()(\n\t'@devstack-rewrite/substrate/RuntimeRoot',\n) {}\n\n/** Build a `RuntimeRoot` layer pinned to a literal path. */\nexport const layerRuntimeRoot = (root: string): Layer.Layer<RuntimeRoot> =>\n\tLayer.succeed(RuntimeRoot)({ root });\n\n/**\n * Identity-bound. Same shape as `substrate/identity.ts`'s `Identity`,\n * but lifted into a Context service so path resolution can yield it\n * without taking it as a function argument.\n *\n * Boot wires this once (Identity is validated up front); the\n * resolver and every consumer reads from this single source.\n */\nexport class IdentityContext extends Context.Service<IdentityContext, Identity>()(\n\t'@devstack-rewrite/substrate/Identity',\n) {}\n\nexport const layerIdentity = (identity: Identity): Layer.Layer<IdentityContext> =>\n\tLayer.succeed(IdentityContext)(identity);\n\n/**\n * Closed bundle the resolver returns. Three groups of paths:\n *\n * - `stackRoot` and the cross-process artifacts (lock, roster,\n * command channel, snapshot reservation) live directly under the stack\n * directory. Cross-process safety lives here.\n * - `stateFile` is the per-stack state-store JSON. ONE file per\n * stack — schema-validated on read.\n * - `cacheDir` is the parent directory; the cache subsystem\n * composes `<cacheDir>/<namespace>/<chainId>/<contentHash>.json`\n * via a helper on this resolver. Subsystems do NOT reach into\n * `cacheDir` with their own `path.join` calls.\n */\nexport interface StackPaths {\n\treadonly stackRoot: string;\n\treadonly stateFile: string;\n\treadonly stateLockHint: string;\n\treadonly cacheDir: string;\n\treadonly snapshotDir: string;\n\treadonly stackLockFile: string;\n\treadonly rosterFile: string;\n\treadonly snapshotReservationFile: string;\n\t/**\n\t * Helper that composes the cache entry path from cache-key\n\t * components. The substrate folds the components together here so\n\t * that nothing else in the runtime tree builds cache paths.\n\t */\n\treadonly cacheEntry: (\n\t\tnamespace: string,\n\t\tchain: string,\n\t\tcontentHash: string,\n\t) => { readonly dir: string; readonly file: string };\n\t/** Helper that returns the cache namespace directory for a given\n\t * namespace + chain — for `readDirectory` enumeration. */\n\treadonly cacheChainDir: (namespace: string, chain: string) => string;\n\t/** Helper that returns the cache namespace directory (across all\n\t * chains) — for namespace-scoped enumeration. */\n\treadonly cacheNamespaceDir: (namespace: string) => string;\n}\n\n/**\n * The path resolver service. Yields `StackPaths` once per stack —\n * `Effect.cached`-friendly since `Identity` + `RuntimeRoot` are\n * boot-immutable.\n */\nexport class StackPathsService extends Context.Service<StackPathsService, StackPaths>()(\n\t'@devstack-rewrite/substrate/StackPaths',\n) {}\n\n/**\n * Layer that materializes the resolver from `RuntimeRoot` +\n * `IdentityContext` + the Effect `Path` service. The cache helper\n * uses `Path.join` so OS-correct separators round-trip on Windows\n * (defense-in-depth — devstack is posix-only in practice but the\n * cost of `Path.join` over template strings is zero).\n */\nexport const layerStackPaths: Layer.Layer<\n\tStackPathsService,\n\tnever,\n\tRuntimeRoot | IdentityContext | Path.Path\n> = Layer.effect(\n\tStackPathsService,\n\tEffect.gen(function* () {\n\t\tconst { root } = yield* RuntimeRoot;\n\t\tconst identity = yield* IdentityContext;\n\t\tconst path = yield* Path.Path;\n\t\tconst stackRoot = path.join(root, 'stacks', identity.stack);\n\t\tconst cacheDir = path.join(stackRoot, 'cache');\n\t\tconst cacheNamespaceDir = (namespace: string): string => path.join(cacheDir, namespace);\n\t\tconst cacheChainDir = (namespace: string, chain: string): string =>\n\t\t\tpath.join(cacheNamespaceDir(namespace), chain);\n\t\tconst cacheEntry = (\n\t\t\tnamespace: string,\n\t\t\tchain: string,\n\t\t\tcontentHash: string,\n\t\t): { readonly dir: string; readonly file: string } => {\n\t\t\tconst dir = cacheChainDir(namespace, chain);\n\t\t\treturn { dir, file: path.join(dir, `${contentHash}.json`) };\n\t\t};\n\t\treturn StackPathsService.of({\n\t\t\tstackRoot,\n\t\t\tstateFile: path.join(stackRoot, 'state.json'),\n\t\t\tstateLockHint: path.join(stackRoot, 'state.json.lock'),\n\t\t\tcacheDir,\n\t\t\tsnapshotDir: path.join(stackRoot, 'snapshots'),\n\t\t\tstackLockFile: path.join(stackRoot, 'stack.lock'),\n\t\t\trosterFile: path.join(stackRoot, 'roster.json'),\n\t\t\tsnapshotReservationFile: path.join(stackRoot, 'snapshot.reservation'),\n\t\t\tcacheEntry,\n\t\t\tcacheChainDir,\n\t\t\tcacheNamespaceDir,\n\t\t});\n\t}),\n);\n"],"mappings":";;AA+BA,IAAa,cAAb,cAAiC,QAAQ,SAAwC,CAChF,0CACA,CAAC;;AAGF,MAAa,oBAAoB,SAChC,MAAM,QAAQ,YAAY,CAAC,EAAE,MAAM,CAAC;;;;;;;;;AAUrC,IAAa,kBAAb,cAAqC,QAAQ,SAAoC,CAChF,uCACA,CAAC;AAEF,MAAa,iBAAiB,aAC7B,MAAM,QAAQ,gBAAgB,CAAC,SAAS;;;;;;AA+CzC,IAAa,oBAAb,cAAuC,QAAQ,SAAwC,CACtF,yCACA,CAAC;;;;;;;;AASF,MAAa,kBAIT,MAAM,OACT,mBACA,OAAO,IAAI,aAAa;CACvB,MAAM,EAAE,SAAS,OAAO;CACxB,MAAM,WAAW,OAAO;CACxB,MAAM,OAAO,OAAO,KAAK;CACzB,MAAM,YAAY,KAAK,KAAK,MAAM,UAAU,SAAS,MAAM;CAC3D,MAAM,WAAW,KAAK,KAAK,WAAW,QAAQ;CAC9C,MAAM,qBAAqB,cAA8B,KAAK,KAAK,UAAU,UAAU;CACvF,MAAM,iBAAiB,WAAmB,UACzC,KAAK,KAAK,kBAAkB,UAAU,EAAE,MAAM;CAC/C,MAAM,cACL,WACA,OACA,gBACqD;EACrD,MAAM,MAAM,cAAc,WAAW,MAAM;AAC3C,SAAO;GAAE;GAAK,MAAM,KAAK,KAAK,KAAK,GAAG,YAAY,OAAO;GAAE;;AAE5D,QAAO,kBAAkB,GAAG;EAC3B;EACA,WAAW,KAAK,KAAK,WAAW,aAAa;EAC7C,eAAe,KAAK,KAAK,WAAW,kBAAkB;EACtD;EACA,aAAa,KAAK,KAAK,WAAW,YAAY;EAC9C,eAAe,KAAK,KAAK,WAAW,aAAa;EACjD,YAAY,KAAK,KAAK,WAAW,cAAc;EAC/C,yBAAyB,KAAK,KAAK,WAAW,uBAAuB;EACrE;EACA;EACA;EACA,CAAC;EACD,CACF"}
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ import { Context, Effect, Layer, Scope } from "effect";