@mysten-incubation/devstack 0.1.1 → 0.3.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 (861) hide show
  1. package/README.md +6 -3
  2. package/dashboard-ui/assets/grpc-Clz0oOtc.js +3 -0
  3. package/dashboard-ui/assets/index-B82Bh84P.css +1 -0
  4. package/dashboard-ui/assets/index-Cmqv9kiU.js +1283 -0
  5. package/dashboard-ui/index.html +2 -2
  6. package/dist/api/define-capabilities.d.mts +1 -20
  7. package/dist/api/define-capabilities.mjs +15 -22
  8. package/dist/api/define-capabilities.mjs.map +1 -1
  9. package/dist/api/define-devstack-with.d.mts +7 -1
  10. package/dist/api/define-devstack-with.mjs.map +1 -1
  11. package/dist/api/define-devstack.mjs.map +1 -1
  12. package/dist/api/define-plugin.d.mts +2 -1
  13. package/dist/api/inference-network.d.mts +31 -17
  14. package/dist/api/inference-network.mjs +40 -43
  15. package/dist/api/inference-network.mjs.map +1 -1
  16. package/dist/api/load-config.mjs +88 -0
  17. package/dist/api/load-config.mjs.map +1 -0
  18. package/dist/api/mode-narrowed-factory.d.mts +1 -1
  19. package/dist/api/mode-narrowed-factory.mjs.map +1 -1
  20. package/dist/api/run-stack-internal.mjs +203 -0
  21. package/dist/api/run-stack-internal.mjs.map +1 -0
  22. package/dist/api/run-stack.d.mts +82 -31
  23. package/dist/api/run-stack.mjs +22 -141
  24. package/dist/api/run-stack.mjs.map +1 -1
  25. package/dist/build-integrations/dapp-kit/index.d.mts +61 -0
  26. package/dist/build-integrations/dapp-kit/index.mjs +58 -0
  27. package/dist/build-integrations/dapp-kit/index.mjs.map +1 -0
  28. package/dist/build-integrations/playwright/config.d.mts +3 -31
  29. package/dist/build-integrations/playwright/config.mjs +2 -28
  30. package/dist/build-integrations/playwright/config.mjs.map +1 -1
  31. package/dist/build-integrations/playwright/errors.d.mts +4 -7
  32. package/dist/build-integrations/playwright/errors.mjs.map +1 -1
  33. package/dist/build-integrations/playwright/global-setup.d.mts +42 -71
  34. package/dist/build-integrations/playwright/global-setup.mjs +142 -218
  35. package/dist/build-integrations/playwright/global-setup.mjs.map +1 -1
  36. package/dist/build-integrations/playwright/index.d.mts +2 -2
  37. package/dist/build-integrations/playwright/index.mjs +2 -2
  38. package/dist/build-integrations/playwright/stack-context.d.mts +3 -1
  39. package/dist/build-integrations/playwright/stack-context.mjs +4 -2
  40. package/dist/build-integrations/playwright/stack-context.mjs.map +1 -1
  41. package/dist/build-integrations/playwright/wallet-context.mjs +44 -19
  42. package/dist/build-integrations/playwright/wallet-context.mjs.map +1 -1
  43. package/dist/build-integrations/runtime/cold-start-url.mjs.map +1 -1
  44. package/dist/build-integrations/runtime/conventional-routes.mjs.map +1 -1
  45. package/dist/build-integrations/runtime/dapp-kit-slot.mjs.map +1 -1
  46. package/dist/build-integrations/runtime/discover.d.mts +6 -4
  47. package/dist/build-integrations/runtime/discover.mjs +15 -4
  48. package/dist/build-integrations/runtime/discover.mjs.map +1 -1
  49. package/dist/build-integrations/runtime/endpoint-registry.mjs.map +1 -1
  50. package/dist/build-integrations/runtime/errors.mjs.map +1 -1
  51. package/dist/build-integrations/runtime/read-stack-context.mjs +3 -3
  52. package/dist/build-integrations/runtime/read-stack-context.mjs.map +1 -1
  53. package/dist/build-integrations/runtime/resolve-discovery-env.d.mts +23 -7
  54. package/dist/build-integrations/runtime/resolve-discovery-env.mjs +25 -12
  55. package/dist/build-integrations/runtime/resolve-discovery-env.mjs.map +1 -1
  56. package/dist/build-integrations/runtime/stack-context.d.mts +2 -2
  57. package/dist/build-integrations/vite/index.d.mts +114 -19
  58. package/dist/build-integrations/vite/index.mjs +239 -28
  59. package/dist/build-integrations/vite/index.mjs.map +1 -1
  60. package/dist/build-integrations/vitest/config.d.mts +20 -2
  61. package/dist/build-integrations/vitest/config.mjs +15 -4
  62. package/dist/build-integrations/vitest/config.mjs.map +1 -1
  63. package/dist/build-integrations/vitest/env.d.mts +18 -10
  64. package/dist/build-integrations/vitest/env.mjs +11 -10
  65. package/dist/build-integrations/vitest/env.mjs.map +1 -1
  66. package/dist/build-integrations/vitest/errors.d.mts +7 -11
  67. package/dist/build-integrations/vitest/errors.mjs +3 -4
  68. package/dist/build-integrations/vitest/errors.mjs.map +1 -1
  69. package/dist/build-integrations/vitest/global-setup.d.mts +35 -0
  70. package/dist/build-integrations/vitest/global-setup.mjs +156 -0
  71. package/dist/build-integrations/vitest/global-setup.mjs.map +1 -0
  72. package/dist/build-integrations/vitest/index.d.mts +3 -2
  73. package/dist/build-integrations/vitest/index.mjs +3 -2
  74. package/dist/build-integrations/vitest/setup.mjs +2 -2
  75. package/dist/build-integrations/vitest/setup.mjs.map +1 -1
  76. package/dist/build-integrations/vitest/stack-context.d.mts +5 -3
  77. package/dist/build-integrations/vitest/stack-context.mjs +3 -2
  78. package/dist/build-integrations/vitest/stack-context.mjs.map +1 -1
  79. package/dist/cli/bail.mjs.map +1 -1
  80. package/dist/cli/doctor-probes.mjs +8 -5
  81. package/dist/cli/doctor-probes.mjs.map +1 -1
  82. package/dist/cli/main.d.mts +23 -1
  83. package/dist/cli/main.mjs +63 -8
  84. package/dist/cli/main.mjs.map +1 -1
  85. package/dist/cli/prune-direct.mjs.map +1 -1
  86. package/dist/cli/snapshot-reader.mjs.map +1 -1
  87. package/dist/cli/up-lifecycle.mjs.map +1 -1
  88. package/dist/cli/wirings/apply.mjs +28 -21
  89. package/dist/cli/wirings/apply.mjs.map +1 -1
  90. package/dist/cli/wirings/codegen.mjs +108 -0
  91. package/dist/cli/wirings/codegen.mjs.map +1 -0
  92. package/dist/cli/wirings/config-loader.mjs +12 -62
  93. package/dist/cli/wirings/config-loader.mjs.map +1 -1
  94. package/dist/cli/wirings/dump-ids.mjs +86 -0
  95. package/dist/cli/wirings/dump-ids.mjs.map +1 -0
  96. package/dist/cli/wirings/engine-command.mjs +1 -1
  97. package/dist/cli/wirings/engine-command.mjs.map +1 -1
  98. package/dist/cli/wirings/identity.mjs +2 -2
  99. package/dist/cli/wirings/identity.mjs.map +1 -1
  100. package/dist/cli/wirings/provide-file-system.mjs.map +1 -1
  101. package/dist/cli/wirings/read-devstack-version.mjs +17 -0
  102. package/dist/cli/wirings/read-devstack-version.mjs.map +1 -0
  103. package/dist/cli/wirings/snapshot.mjs +27 -34
  104. package/dist/cli/wirings/snapshot.mjs.map +1 -1
  105. package/dist/cli/wirings/up-ipc.mjs +147 -0
  106. package/dist/cli/wirings/up-ipc.mjs.map +1 -0
  107. package/dist/cli/wirings/up.mjs +225 -198
  108. package/dist/cli/wirings/up.mjs.map +1 -1
  109. package/dist/cli/wirings/wipe.mjs +1 -1
  110. package/dist/cli/wirings/wipe.mjs.map +1 -1
  111. package/dist/contracts/chain-probe.d.mts +1 -1
  112. package/dist/contracts/chain-probe.mjs +1 -1
  113. package/dist/contracts/chain-probe.mjs.map +1 -1
  114. package/dist/contracts/codegenable.d.mts +60 -6
  115. package/dist/contracts/codegenable.mjs +28 -0
  116. package/dist/contracts/codegenable.mjs.map +1 -0
  117. package/dist/contracts/config-bindings.mjs +162 -0
  118. package/dist/contracts/config-bindings.mjs.map +1 -0
  119. package/dist/contracts/container-runtime.d.mts +23 -17
  120. package/dist/contracts/plugin-expander.mjs.map +1 -1
  121. package/dist/contracts/snapshotable.d.mts +5 -7
  122. package/dist/contracts/wallet-protocol.d.mts +2 -5
  123. package/dist/contracts/wallet-protocol.mjs +2 -5
  124. package/dist/contracts/wallet-protocol.mjs.map +1 -1
  125. package/dist/index.d.mts +21 -26
  126. package/dist/index.mjs +8 -9
  127. package/dist/orchestrators/boot.d.mts +28 -0
  128. package/dist/orchestrators/boot.mjs +450 -0
  129. package/dist/orchestrators/boot.mjs.map +1 -0
  130. package/dist/orchestrators/codegen/bindings.d.mts +13 -1
  131. package/dist/orchestrators/codegen/bindings.mjs +23 -9
  132. package/dist/orchestrators/codegen/bindings.mjs.map +1 -1
  133. package/dist/orchestrators/codegen/config-runtime.mjs +208 -0
  134. package/dist/orchestrators/codegen/config-runtime.mjs.map +1 -0
  135. package/dist/orchestrators/codegen/emit.mjs +1 -1
  136. package/dist/orchestrators/codegen/emit.mjs.map +1 -1
  137. package/dist/orchestrators/codegen/errors.mjs +21 -1
  138. package/dist/orchestrators/codegen/errors.mjs.map +1 -1
  139. package/dist/orchestrators/codegen/format.mjs +2 -0
  140. package/dist/orchestrators/codegen/format.mjs.map +1 -1
  141. package/dist/orchestrators/codegen/gitignore.mjs +30 -11
  142. package/dist/orchestrators/codegen/gitignore.mjs.map +1 -1
  143. package/dist/orchestrators/codegen/id-config.mjs +107 -0
  144. package/dist/orchestrators/codegen/id-config.mjs.map +1 -0
  145. package/dist/orchestrators/codegen/output-location.mjs +23 -32
  146. package/dist/orchestrators/codegen/output-location.mjs.map +1 -1
  147. package/dist/orchestrators/codegen/paths.mjs +8 -1
  148. package/dist/orchestrators/codegen/paths.mjs.map +1 -1
  149. package/dist/orchestrators/codegen/permissions.mjs.map +1 -1
  150. package/dist/orchestrators/codegen/service.mjs +303 -60
  151. package/dist/orchestrators/codegen/service.mjs.map +1 -1
  152. package/dist/orchestrators/layers.mjs +31 -0
  153. package/dist/orchestrators/layers.mjs.map +1 -0
  154. package/dist/orchestrators/lifecycle-prune/errors.mjs.map +1 -1
  155. package/dist/orchestrators/lifecycle-prune/index.mjs +8 -10
  156. package/dist/orchestrators/lifecycle-prune/index.mjs.map +1 -1
  157. package/dist/orchestrators/network-options.d.mts +52 -0
  158. package/dist/orchestrators/network-options.mjs +43 -0
  159. package/dist/orchestrators/network-options.mjs.map +1 -0
  160. package/dist/orchestrators/router/cleanup.mjs.map +1 -1
  161. package/dist/orchestrators/router/cors.mjs.map +1 -1
  162. package/dist/orchestrators/router/entrypoints.mjs.map +1 -1
  163. package/dist/orchestrators/router/errors.mjs.map +1 -1
  164. package/dist/orchestrators/router/file-provider.mjs.map +1 -1
  165. package/dist/orchestrators/router/hostname.mjs.map +1 -1
  166. package/dist/orchestrators/router/profile.mjs +1 -1
  167. package/dist/orchestrators/router/profile.mjs.map +1 -1
  168. package/dist/orchestrators/router/service.d.mts +2 -2
  169. package/dist/orchestrators/router/service.mjs +12 -27
  170. package/dist/orchestrators/router/service.mjs.map +1 -1
  171. package/dist/orchestrators/router/traefik-container.mjs +1 -1
  172. package/dist/orchestrators/router/traefik-container.mjs.map +1 -1
  173. package/dist/orchestrators/snapshot/capture.mjs +171 -195
  174. package/dist/orchestrators/snapshot/capture.mjs.map +1 -1
  175. package/dist/orchestrators/snapshot/descriptor.d.mts +1 -1
  176. package/dist/orchestrators/snapshot/descriptor.mjs +53 -11
  177. package/dist/orchestrators/snapshot/descriptor.mjs.map +1 -1
  178. package/dist/orchestrators/snapshot/identity-guard.mjs +3 -5
  179. package/dist/orchestrators/snapshot/identity-guard.mjs.map +1 -1
  180. package/dist/orchestrators/snapshot/image-bundle-tags.mjs +32 -101
  181. package/dist/orchestrators/snapshot/image-bundle-tags.mjs.map +1 -1
  182. package/dist/orchestrators/snapshot/index.mjs +1 -4
  183. package/dist/orchestrators/snapshot/integrity.mjs.map +1 -1
  184. package/dist/orchestrators/snapshot/interrupted-restore.mjs +116 -0
  185. package/dist/orchestrators/snapshot/interrupted-restore.mjs.map +1 -0
  186. package/dist/orchestrators/snapshot/phase-error.mjs.map +1 -1
  187. package/dist/orchestrators/snapshot/prune.mjs +40 -31
  188. package/dist/orchestrators/snapshot/prune.mjs.map +1 -1
  189. package/dist/orchestrators/snapshot/restore.mjs +221 -196
  190. package/dist/orchestrators/snapshot/restore.mjs.map +1 -1
  191. package/dist/orchestrators/snapshot/service.mjs +72 -62
  192. package/dist/orchestrators/snapshot/service.mjs.map +1 -1
  193. package/dist/orchestrators/snapshot/wipe.mjs +67 -56
  194. package/dist/orchestrators/snapshot/wipe.mjs.map +1 -1
  195. package/dist/plugins/account/codegen.mjs +3 -0
  196. package/dist/plugins/account/codegen.mjs.map +1 -1
  197. package/dist/plugins/account/errors.d.mts +2 -2
  198. package/dist/plugins/account/errors.mjs +1 -4
  199. package/dist/plugins/account/errors.mjs.map +1 -1
  200. package/dist/plugins/account/funding.mjs +3 -27
  201. package/dist/plugins/account/funding.mjs.map +1 -1
  202. package/dist/plugins/account/index.d.mts +3 -8
  203. package/dist/plugins/account/index.mjs +71 -35
  204. package/dist/plugins/account/index.mjs.map +1 -1
  205. package/dist/plugins/account/keypair.d.mts +8 -7
  206. package/dist/plugins/account/keypair.mjs +5 -18
  207. package/dist/plugins/account/keypair.mjs.map +1 -1
  208. package/dist/plugins/account/lease.mjs.map +1 -1
  209. package/dist/plugins/account/registry.d.mts +1 -46
  210. package/dist/plugins/account/registry.mjs.map +1 -1
  211. package/dist/plugins/account/service.d.mts +43 -34
  212. package/dist/plugins/account/service.mjs +9 -54
  213. package/dist/plugins/account/service.mjs.map +1 -1
  214. package/dist/plugins/account/snapshot.mjs.map +1 -1
  215. package/dist/plugins/account/variants/ephemeral.mjs.map +1 -1
  216. package/dist/plugins/account/variants/impersonate.mjs.map +1 -1
  217. package/dist/plugins/account/variants/signer.mjs.map +1 -1
  218. package/dist/plugins/action/discriminator.mjs.map +1 -1
  219. package/dist/plugins/action/errors.mjs +1 -4
  220. package/dist/plugins/action/errors.mjs.map +1 -1
  221. package/dist/plugins/action/execute.mjs +3 -4
  222. package/dist/plugins/action/execute.mjs.map +1 -1
  223. package/dist/plugins/action/index.d.mts +2 -2
  224. package/dist/plugins/action/index.mjs +7 -11
  225. package/dist/plugins/action/index.mjs.map +1 -1
  226. package/dist/plugins/action/service.d.mts +5 -7
  227. package/dist/plugins/action/service.mjs +2 -16
  228. package/dist/plugins/action/service.mjs.map +1 -1
  229. package/dist/plugins/coin/address-resolution.mjs.map +1 -1
  230. package/dist/plugins/coin/codegen.mjs +97 -16
  231. package/dist/plugins/coin/codegen.mjs.map +1 -1
  232. package/dist/plugins/coin/discovery.mjs.map +1 -1
  233. package/dist/plugins/coin/errors.mjs +1 -4
  234. package/dist/plugins/coin/errors.mjs.map +1 -1
  235. package/dist/plugins/coin/index.d.mts +4 -34
  236. package/dist/plugins/coin/index.mjs +47 -28
  237. package/dist/plugins/coin/index.mjs.map +1 -1
  238. package/dist/plugins/coin/metadata.d.mts +1 -0
  239. package/dist/plugins/coin/metadata.mjs +8 -9
  240. package/dist/plugins/coin/metadata.mjs.map +1 -1
  241. package/dist/plugins/coin/mint.mjs +7 -21
  242. package/dist/plugins/coin/mint.mjs.map +1 -1
  243. package/dist/plugins/coin/registry.mjs +33 -20
  244. package/dist/plugins/coin/registry.mjs.map +1 -1
  245. package/dist/plugins/coin/service.d.mts +1 -1
  246. package/dist/plugins/coin/service.mjs +1 -8
  247. package/dist/plugins/coin/service.mjs.map +1 -1
  248. package/dist/plugins/coin/snapshot.mjs.map +1 -1
  249. package/dist/plugins/coin/type-strings.mjs.map +1 -1
  250. package/dist/plugins/dashboard/domain.mjs +124 -168
  251. package/dist/plugins/dashboard/domain.mjs.map +1 -1
  252. package/dist/plugins/dashboard/index.mjs +13 -13
  253. package/dist/plugins/dashboard/index.mjs.map +1 -1
  254. package/dist/plugins/dashboard/origin-policy.mjs +3 -3
  255. package/dist/plugins/dashboard/origin-policy.mjs.map +1 -1
  256. package/dist/plugins/dashboard/routable.mjs.map +1 -1
  257. package/dist/plugins/dashboard/schema/builder.mjs.map +1 -1
  258. package/dist/plugins/dashboard/schema/enums.mjs.map +1 -1
  259. package/dist/plugins/dashboard/schema/root.mjs +25 -46
  260. package/dist/plugins/dashboard/schema/root.mjs.map +1 -1
  261. package/dist/plugins/dashboard/schema/types.mjs +52 -93
  262. package/dist/plugins/dashboard/schema/types.mjs.map +1 -1
  263. package/dist/plugins/dashboard/schema.mjs.map +1 -1
  264. package/dist/plugins/dashboard/server.mjs.map +1 -1
  265. package/dist/plugins/deepbook/codegen.d.mts +12 -11
  266. package/dist/plugins/deepbook/codegen.mjs +108 -11
  267. package/dist/plugins/deepbook/codegen.mjs.map +1 -1
  268. package/dist/plugins/deepbook/deploy.mjs +7 -14
  269. package/dist/plugins/deepbook/deploy.mjs.map +1 -1
  270. package/dist/plugins/deepbook/errors.mjs +4 -2
  271. package/dist/plugins/deepbook/errors.mjs.map +1 -1
  272. package/dist/plugins/deepbook/faucet-strategy.mjs +4 -10
  273. package/dist/plugins/deepbook/faucet-strategy.mjs.map +1 -1
  274. package/dist/plugins/deepbook/hash.mjs.map +1 -1
  275. package/dist/plugins/deepbook/index.d.mts +45 -37
  276. package/dist/plugins/deepbook/index.mjs +136 -67
  277. package/dist/plugins/deepbook/index.mjs.map +1 -1
  278. package/dist/plugins/deepbook/plugin-key.mjs.map +1 -1
  279. package/dist/plugins/deepbook/pyth/index.mjs +4 -8
  280. package/dist/plugins/deepbook/pyth/index.mjs.map +1 -1
  281. package/dist/plugins/deepbook/snapshot.mjs +0 -1
  282. package/dist/plugins/deepbook/snapshot.mjs.map +1 -1
  283. package/dist/plugins/deepbook/type-strings.mjs.map +1 -1
  284. package/dist/plugins/deepbook/types.d.mts +2 -1
  285. package/dist/plugins/deepbook/types.mjs.map +1 -1
  286. package/dist/plugins/faucet/dispatcher.d.mts +3 -3
  287. package/dist/plugins/faucet/dispatcher.mjs.map +1 -1
  288. package/dist/plugins/faucet/errors.mjs.map +1 -1
  289. package/dist/plugins/faucet/http.mjs +2 -10
  290. package/dist/plugins/faucet/http.mjs.map +1 -1
  291. package/dist/plugins/faucet/index.mjs +0 -1
  292. package/dist/plugins/faucet/index.mjs.map +1 -1
  293. package/dist/plugins/host-service/errors.d.mts +1 -3
  294. package/dist/plugins/host-service/errors.mjs +1 -2
  295. package/dist/plugins/host-service/errors.mjs.map +1 -1
  296. package/dist/plugins/host-service/index.d.mts +1 -2
  297. package/dist/plugins/host-service/index.mjs +11 -11
  298. package/dist/plugins/host-service/index.mjs.map +1 -1
  299. package/dist/plugins/host-service/routable.mjs.map +1 -1
  300. package/dist/plugins/host-service/service.mjs +13 -13
  301. package/dist/plugins/host-service/service.mjs.map +1 -1
  302. package/dist/plugins/internal/acquire-on-chain-artifact.mjs.map +1 -1
  303. package/dist/plugins/internal/codegen-helpers.mjs +2 -0
  304. package/dist/plugins/internal/codegen-helpers.mjs.map +1 -1
  305. package/dist/plugins/internal/funding-failure-error.mjs.map +1 -1
  306. package/dist/plugins/{postgres → internal/postgres-sidecar}/connection.mjs +1 -1
  307. package/dist/plugins/internal/postgres-sidecar/connection.mjs.map +1 -0
  308. package/dist/plugins/{postgres → internal/postgres-sidecar}/db-ensure.mjs +30 -16
  309. package/dist/plugins/internal/postgres-sidecar/db-ensure.mjs.map +1 -0
  310. package/dist/plugins/internal/postgres-sidecar/errors.mjs +21 -0
  311. package/dist/plugins/internal/postgres-sidecar/errors.mjs.map +1 -0
  312. package/dist/{substrate/runtime/scoped-multimap → plugins/internal/postgres-sidecar}/index.mjs +1 -0
  313. package/dist/plugins/internal/postgres-sidecar/service.mjs +121 -0
  314. package/dist/plugins/internal/postgres-sidecar/service.mjs.map +1 -0
  315. package/dist/plugins/package/build.mjs +2 -2
  316. package/dist/plugins/package/build.mjs.map +1 -1
  317. package/dist/plugins/package/codegen.d.mts +7 -14
  318. package/dist/plugins/package/codegen.mjs +187 -59
  319. package/dist/plugins/package/codegen.mjs.map +1 -1
  320. package/dist/plugins/package/dep-resolution.mjs +51 -3
  321. package/dist/plugins/package/dep-resolution.mjs.map +1 -1
  322. package/dist/plugins/package/errors.mjs +1 -4
  323. package/dist/plugins/package/errors.mjs.map +1 -1
  324. package/dist/plugins/package/git-source.d.mts +18 -0
  325. package/dist/plugins/package/git-source.mjs +119 -0
  326. package/dist/plugins/package/git-source.mjs.map +1 -0
  327. package/dist/plugins/package/index.d.mts +28 -19
  328. package/dist/plugins/package/index.mjs +107 -32
  329. package/dist/plugins/package/index.mjs.map +1 -1
  330. package/dist/plugins/package/mode-known.mjs +2 -2
  331. package/dist/plugins/package/mode-known.mjs.map +1 -1
  332. package/dist/plugins/package/mode-local.mjs +18 -35
  333. package/dist/plugins/package/mode-local.mjs.map +1 -1
  334. package/dist/plugins/package/publish-executor.mjs +13 -8
  335. package/dist/plugins/package/publish-executor.mjs.map +1 -1
  336. package/dist/plugins/package/publish-output.d.mts +1 -11
  337. package/dist/plugins/package/publish-output.mjs +1 -9
  338. package/dist/plugins/package/publish-output.mjs.map +1 -1
  339. package/dist/plugins/package/registry.d.mts +1 -1
  340. package/dist/plugins/package/registry.mjs +26 -14
  341. package/dist/plugins/package/registry.mjs.map +1 -1
  342. package/dist/plugins/package/service.mjs.map +1 -1
  343. package/dist/plugins/package/snapshot.mjs.map +1 -1
  344. package/dist/plugins/router-entrypoints.mjs +1 -3
  345. package/dist/plugins/router-entrypoints.mjs.map +1 -1
  346. package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs +1 -2
  347. package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs.map +1 -1
  348. package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs +1 -6
  349. package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs.map +1 -1
  350. package/dist/plugins/seal/codegen.d.mts +1 -5
  351. package/dist/plugins/seal/codegen.mjs +83 -12
  352. package/dist/plugins/seal/codegen.mjs.map +1 -1
  353. package/dist/plugins/seal/config-render.mjs +2 -6
  354. package/dist/plugins/seal/config-render.mjs.map +1 -1
  355. package/dist/plugins/seal/deploy.mjs +18 -29
  356. package/dist/plugins/seal/deploy.mjs.map +1 -1
  357. package/dist/plugins/seal/errors.d.mts +4 -5
  358. package/dist/plugins/seal/errors.mjs +1 -8
  359. package/dist/plugins/seal/errors.mjs.map +1 -1
  360. package/dist/plugins/seal/index.d.mts +7 -28
  361. package/dist/plugins/seal/index.mjs +69 -47
  362. package/dist/plugins/seal/index.mjs.map +1 -1
  363. package/dist/plugins/seal/key-manager.mjs.map +1 -1
  364. package/dist/plugins/seal/key-server.mjs +1 -6
  365. package/dist/plugins/seal/key-server.mjs.map +1 -1
  366. package/dist/plugins/seal/keygen.mjs +2 -3
  367. package/dist/plugins/seal/keygen.mjs.map +1 -1
  368. package/dist/plugins/seal/mode/fork-known.mjs.map +1 -1
  369. package/dist/plugins/seal/mode/live.mjs +1 -1
  370. package/dist/plugins/seal/mode/live.mjs.map +1 -1
  371. package/dist/plugins/seal/mode/local-keygen.mjs +4 -10
  372. package/dist/plugins/seal/mode/local-keygen.mjs.map +1 -1
  373. package/dist/plugins/seal/plugin-key.mjs.map +1 -1
  374. package/dist/plugins/seal/registry-publish.mjs.map +1 -1
  375. package/dist/plugins/seal/routable.mjs.map +1 -1
  376. package/dist/plugins/seal/service.mjs.map +1 -1
  377. package/dist/plugins/seal/snapshot.mjs +1 -2
  378. package/dist/plugins/seal/snapshot.mjs.map +1 -1
  379. package/dist/plugins/sui/auto-tick.mjs +5 -5
  380. package/dist/plugins/sui/auto-tick.mjs.map +1 -1
  381. package/dist/plugins/sui/chain-build-container.mjs +2 -2
  382. package/dist/plugins/sui/chain-build-container.mjs.map +1 -1
  383. package/dist/plugins/sui/chain-probe.mjs +4 -4
  384. package/dist/plugins/sui/chain-probe.mjs.map +1 -1
  385. package/dist/plugins/sui/codegen.d.mts +9 -7
  386. package/dist/plugins/sui/codegen.mjs +49 -46
  387. package/dist/plugins/sui/codegen.mjs.map +1 -1
  388. package/dist/plugins/sui/errors.d.mts +1 -1
  389. package/dist/plugins/sui/errors.mjs +1 -9
  390. package/dist/plugins/sui/errors.mjs.map +1 -1
  391. package/dist/{substrate/runtime/sui-execute → plugins/sui/exec}/index.d.mts +1 -1
  392. package/dist/{substrate/runtime/sui-execute → plugins/sui/exec}/index.mjs +3 -7
  393. package/dist/plugins/sui/exec/index.mjs.map +1 -0
  394. package/dist/{substrate/runtime/sui-execute → plugins/sui/exec}/sign-and-dispatch.mjs +1 -1
  395. package/dist/plugins/sui/exec/sign-and-dispatch.mjs.map +1 -0
  396. package/dist/plugins/sui/fork-faucet-strategy.mjs +2 -6
  397. package/dist/plugins/sui/fork-faucet-strategy.mjs.map +1 -1
  398. package/dist/plugins/sui/fork-orchestration.mjs +13 -23
  399. package/dist/plugins/sui/fork-orchestration.mjs.map +1 -1
  400. package/dist/plugins/sui/fork-transaction.mjs.map +1 -1
  401. package/dist/plugins/sui/index.d.mts +44 -93
  402. package/dist/plugins/sui/index.mjs +200 -68
  403. package/dist/plugins/sui/index.mjs.map +1 -1
  404. package/dist/{substrate/runtime/sui-ledger → plugins/sui/ledger}/object-ref.mjs +1 -1
  405. package/dist/plugins/sui/ledger/object-ref.mjs.map +1 -0
  406. package/dist/plugins/sui/local-faucet-strategy.mjs +1 -5
  407. package/dist/plugins/sui/local-faucet-strategy.mjs.map +1 -1
  408. package/dist/plugins/sui/log-attrs.mjs +11 -0
  409. package/dist/plugins/sui/log-attrs.mjs.map +1 -0
  410. package/dist/plugins/sui/mode/external.mjs +4 -12
  411. package/dist/plugins/sui/mode/external.mjs.map +1 -1
  412. package/dist/plugins/sui/mode/fork.mjs +19 -16
  413. package/dist/plugins/sui/mode/fork.mjs.map +1 -1
  414. package/dist/plugins/sui/mode/live.mjs +4 -17
  415. package/dist/plugins/sui/mode/live.mjs.map +1 -1
  416. package/dist/plugins/sui/mode/local.d.mts +1 -0
  417. package/dist/plugins/sui/mode/local.mjs +203 -61
  418. package/dist/plugins/sui/mode/local.mjs.map +1 -1
  419. package/dist/plugins/sui/mode/shared-boot.mjs +18 -23
  420. package/dist/plugins/sui/mode/shared-boot.mjs.map +1 -1
  421. package/dist/plugins/sui/mode/shared.d.mts +6 -7
  422. package/dist/plugins/sui/mode/shared.mjs.map +1 -1
  423. package/dist/plugins/sui/mode/spec.d.mts +23 -6
  424. package/dist/{substrate/runtime/sui-move-build → plugins/sui/move}/index.mjs +28 -30
  425. package/dist/plugins/sui/move/index.mjs.map +1 -0
  426. package/dist/plugins/sui/move-summary-runner.mjs +37 -6
  427. package/dist/plugins/sui/move-summary-runner.mjs.map +1 -1
  428. package/dist/{substrate/network.d.mts → plugins/sui/network-config.d.mts} +11 -10
  429. package/dist/plugins/sui/network-resolver.d.mts +6 -6
  430. package/dist/plugins/sui/routable.mjs.map +1 -1
  431. package/dist/plugins/sui/service.mjs +10 -6
  432. package/dist/plugins/sui/service.mjs.map +1 -1
  433. package/dist/plugins/sui/snapshot.mjs +10 -5
  434. package/dist/plugins/sui/snapshot.mjs.map +1 -1
  435. package/dist/plugins/wallet/codegen.d.mts +8 -6
  436. package/dist/plugins/wallet/codegen.mjs +4 -10
  437. package/dist/plugins/wallet/codegen.mjs.map +1 -1
  438. package/dist/plugins/wallet/errors.mjs +1 -4
  439. package/dist/plugins/wallet/errors.mjs.map +1 -1
  440. package/dist/plugins/wallet/index.d.mts +3 -6
  441. package/dist/plugins/wallet/index.mjs +16 -21
  442. package/dist/plugins/wallet/index.mjs.map +1 -1
  443. package/dist/plugins/wallet/origin-policy.mjs +3 -3
  444. package/dist/plugins/wallet/origin-policy.mjs.map +1 -1
  445. package/dist/plugins/wallet/pairing.mjs +6 -24
  446. package/dist/plugins/wallet/pairing.mjs.map +1 -1
  447. package/dist/plugins/wallet/protocol.mjs.map +1 -1
  448. package/dist/plugins/wallet/routable.mjs.map +1 -1
  449. package/dist/plugins/wallet/server.mjs +17 -24
  450. package/dist/plugins/wallet/server.mjs.map +1 -1
  451. package/dist/plugins/wallet/service.d.mts +2 -2
  452. package/dist/plugins/wallet/service.mjs +4 -15
  453. package/dist/plugins/wallet/service.mjs.map +1 -1
  454. package/dist/plugins/wallet/snapshot.mjs.map +1 -1
  455. package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs +1 -5
  456. package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs.map +1 -1
  457. package/dist/plugins/walrus/codegen.d.mts +2 -13
  458. package/dist/plugins/walrus/codegen.mjs +93 -28
  459. package/dist/plugins/walrus/codegen.mjs.map +1 -1
  460. package/dist/plugins/walrus/deploy-paths.mjs +2 -3
  461. package/dist/plugins/walrus/deploy-paths.mjs.map +1 -1
  462. package/dist/plugins/walrus/deploy.mjs +26 -19
  463. package/dist/plugins/walrus/deploy.mjs.map +1 -1
  464. package/dist/plugins/walrus/errors.mjs +1 -8
  465. package/dist/plugins/walrus/errors.mjs.map +1 -1
  466. package/dist/plugins/walrus/faucet-strategy.mjs +15 -1
  467. package/dist/plugins/walrus/faucet-strategy.mjs.map +1 -1
  468. package/dist/plugins/walrus/index.d.mts +13 -44
  469. package/dist/plugins/walrus/index.mjs +119 -122
  470. package/dist/plugins/walrus/index.mjs.map +1 -1
  471. package/dist/plugins/walrus/mode/known-deploy.mjs +6 -6
  472. package/dist/plugins/walrus/mode/known-deploy.mjs.map +1 -1
  473. package/dist/plugins/walrus/mode/local-cluster.d.mts +2 -2
  474. package/dist/plugins/walrus/mode/local-cluster.mjs +2 -10
  475. package/dist/plugins/walrus/mode/local-cluster.mjs.map +1 -1
  476. package/dist/plugins/walrus/plugin-key.mjs.map +1 -1
  477. package/dist/plugins/walrus/registry-publish.mjs.map +1 -1
  478. package/dist/plugins/walrus/routable.mjs.map +1 -1
  479. package/dist/plugins/walrus/service.mjs.map +1 -1
  480. package/dist/plugins/walrus/snapshot.mjs +3 -3
  481. package/dist/plugins/walrus/snapshot.mjs.map +1 -1
  482. package/dist/plugins/walrus/storage-nodes.mjs +53 -14
  483. package/dist/plugins/walrus/storage-nodes.mjs.map +1 -1
  484. package/dist/plugins/walrus/wal-swap.mjs +4 -8
  485. package/dist/plugins/walrus/wal-swap.mjs.map +1 -1
  486. package/dist/primitives/artifact-publisher.mjs.map +1 -1
  487. package/dist/primitives/cache.d.mts +1 -1
  488. package/dist/runtime/docker/client.mjs +47 -3
  489. package/dist/runtime/docker/client.mjs.map +1 -1
  490. package/dist/runtime/docker/container.mjs +37 -57
  491. package/dist/runtime/docker/container.mjs.map +1 -1
  492. package/dist/runtime/docker/errors.mjs.map +1 -1
  493. package/dist/runtime/docker/exec.mjs +2 -2
  494. package/dist/runtime/docker/exec.mjs.map +1 -1
  495. package/dist/runtime/docker/image.mjs +10 -11
  496. package/dist/runtime/docker/image.mjs.map +1 -1
  497. package/dist/runtime/docker/index.mjs +0 -1
  498. package/dist/runtime/docker/inspect-and-decode.mjs.map +1 -1
  499. package/dist/runtime/docker/inventory.mjs +9 -9
  500. package/dist/runtime/docker/inventory.mjs.map +1 -1
  501. package/dist/runtime/docker/labels.mjs +12 -1
  502. package/dist/runtime/docker/labels.mjs.map +1 -1
  503. package/dist/runtime/docker/network.mjs +6 -6
  504. package/dist/runtime/docker/network.mjs.map +1 -1
  505. package/dist/runtime/docker/render-run-args.mjs.map +1 -1
  506. package/dist/runtime/docker/service.mjs +31 -45
  507. package/dist/runtime/docker/service.mjs.map +1 -1
  508. package/dist/runtime/docker/sweep.mjs +14 -64
  509. package/dist/runtime/docker/sweep.mjs.map +1 -1
  510. package/dist/runtime/docker/volume.mjs +1 -1
  511. package/dist/runtime/docker/volume.mjs.map +1 -1
  512. package/dist/runtime/docker/wrap.mjs +14 -2
  513. package/dist/runtime/docker/wrap.mjs.map +1 -1
  514. package/dist/substrate/brand.d.mts +2 -5
  515. package/dist/substrate/brand.mjs +3 -2
  516. package/dist/substrate/brand.mjs.map +1 -1
  517. package/dist/substrate/cross-process.mjs +2 -16
  518. package/dist/substrate/cross-process.mjs.map +1 -1
  519. package/dist/substrate/event-time.mjs +0 -2
  520. package/dist/substrate/event-time.mjs.map +1 -1
  521. package/dist/substrate/events.d.mts +46 -16
  522. package/dist/substrate/identity.d.mts +11 -5
  523. package/dist/substrate/manifest.d.mts +33 -26
  524. package/dist/substrate/manifest.mjs +8 -3
  525. package/dist/substrate/manifest.mjs.map +1 -1
  526. package/dist/substrate/options.d.mts +33 -4
  527. package/dist/substrate/plugin-ctx.d.mts +70 -0
  528. package/dist/substrate/plugin-ctx.mjs +66 -0
  529. package/dist/substrate/plugin-ctx.mjs.map +1 -0
  530. package/dist/substrate/plugin.d.mts +46 -38
  531. package/dist/substrate/plugin.mjs +13 -9
  532. package/dist/substrate/plugin.mjs.map +1 -1
  533. package/dist/substrate/projection.d.mts +1 -1
  534. package/dist/substrate/runtime/atomic-write.mjs +3 -4
  535. package/dist/substrate/runtime/atomic-write.mjs.map +1 -1
  536. package/dist/substrate/runtime/cache/schema.mjs.map +1 -1
  537. package/dist/substrate/runtime/cache/service.mjs +50 -20
  538. package/dist/substrate/runtime/cache/service.mjs.map +1 -1
  539. package/dist/substrate/runtime/config-validation.mjs.map +1 -1
  540. package/dist/substrate/runtime/control-plane/domain.mjs +34 -12
  541. package/dist/substrate/runtime/control-plane/domain.mjs.map +1 -1
  542. package/dist/substrate/runtime/control-plane/service.mjs.map +1 -1
  543. package/dist/substrate/runtime/cross-process/command-channel/channel.mjs +14 -17
  544. package/dist/substrate/runtime/cross-process/command-channel/channel.mjs.map +1 -1
  545. package/dist/substrate/runtime/cross-process/command-channel/file-channel.mjs.map +1 -1
  546. package/dist/substrate/runtime/cross-process/command-channel/protocol.mjs.map +1 -1
  547. package/dist/substrate/runtime/cross-process/command-channel/runtime-control-lock.mjs.map +1 -1
  548. package/dist/substrate/runtime/cross-process/index.mjs +0 -2
  549. package/dist/substrate/runtime/cross-process/live-clock.mjs +1 -1
  550. package/dist/substrate/runtime/cross-process/live-clock.mjs.map +1 -1
  551. package/dist/substrate/runtime/cross-process/liveness.mjs +11 -18
  552. package/dist/substrate/runtime/cross-process/liveness.mjs.map +1 -1
  553. package/dist/substrate/runtime/cross-process/reclaim-stale-file.mjs +2 -2
  554. package/dist/substrate/runtime/cross-process/reclaim-stale-file.mjs.map +1 -1
  555. package/dist/substrate/runtime/cross-process/roster.mjs +17 -127
  556. package/dist/substrate/runtime/cross-process/roster.mjs.map +1 -1
  557. package/dist/substrate/runtime/cross-process/self-pid.mjs.map +1 -1
  558. package/dist/substrate/runtime/cross-process/stack-lock.mjs +29 -28
  559. package/dist/substrate/runtime/cross-process/stack-lock.mjs.map +1 -1
  560. package/dist/substrate/runtime/current-plugin.mjs.map +1 -1
  561. package/dist/substrate/runtime/errors.mjs +1 -13
  562. package/dist/substrate/runtime/errors.mjs.map +1 -1
  563. package/dist/substrate/runtime/format-unknown-error.mjs.map +1 -1
  564. package/dist/substrate/runtime/host-bind-mount-owner.mjs.map +1 -1
  565. package/dist/substrate/runtime/host-gateway.mjs.map +1 -1
  566. package/dist/substrate/runtime/host-tree-tar/index.mjs +15 -163
  567. package/dist/substrate/runtime/host-tree-tar/index.mjs.map +1 -1
  568. package/dist/substrate/runtime/http-probe.d.mts +1 -3
  569. package/dist/substrate/runtime/http-probe.mjs.map +1 -1
  570. package/dist/substrate/runtime/index.mjs +2 -6
  571. package/dist/substrate/runtime/lease-broker/service.mjs +5 -23
  572. package/dist/substrate/runtime/lease-broker/service.mjs.map +1 -1
  573. package/dist/substrate/runtime/lifecycle/dep-graph.mjs +3 -3
  574. package/dist/substrate/runtime/lifecycle/dep-graph.mjs.map +1 -1
  575. package/dist/substrate/runtime/lifecycle/file-watcher.mjs +54 -0
  576. package/dist/substrate/runtime/lifecycle/file-watcher.mjs.map +1 -0
  577. package/dist/substrate/runtime/lifecycle/graph-input-id.d.mts +1 -0
  578. package/dist/substrate/runtime/lifecycle/graph-input-id.mjs +133 -0
  579. package/dist/substrate/runtime/lifecycle/graph-input-id.mjs.map +1 -0
  580. package/dist/substrate/runtime/lifecycle/index.mjs +3 -2
  581. package/dist/substrate/runtime/lifecycle/plugin-registry.d.mts +1 -1
  582. package/dist/substrate/runtime/lifecycle/plugin-registry.mjs +22 -1
  583. package/dist/substrate/runtime/lifecycle/plugin-registry.mjs.map +1 -1
  584. package/dist/substrate/runtime/lifecycle/ready-gate.mjs +2 -15
  585. package/dist/substrate/runtime/lifecycle/ready-gate.mjs.map +1 -1
  586. package/dist/substrate/runtime/lifecycle/selective-restart.mjs +29 -25
  587. package/dist/substrate/runtime/lifecycle/selective-restart.mjs.map +1 -1
  588. package/dist/substrate/runtime/lifecycle/signals.mjs +1 -1
  589. package/dist/substrate/runtime/lifecycle/signals.mjs.map +1 -1
  590. package/dist/substrate/runtime/lifecycle/state-machine.mjs.map +1 -1
  591. package/dist/substrate/runtime/lifecycle/watch-attribution.d.mts +1 -1
  592. package/dist/substrate/runtime/lifecycle/watch-attribution.mjs +76 -7
  593. package/dist/substrate/runtime/lifecycle/watch-attribution.mjs.map +1 -1
  594. package/dist/substrate/runtime/managed-container.d.mts +5 -1
  595. package/dist/substrate/runtime/managed-container.mjs +8 -10
  596. package/dist/substrate/runtime/managed-container.mjs.map +1 -1
  597. package/dist/substrate/runtime/manifest/manifest.mjs +8 -30
  598. package/dist/substrate/runtime/manifest/manifest.mjs.map +1 -1
  599. package/dist/substrate/runtime/mode-errors.d.mts +1 -2
  600. package/dist/substrate/runtime/mode-errors.mjs.map +1 -1
  601. package/dist/substrate/runtime/observability/cascade-formatter.mjs +1 -11
  602. package/dist/substrate/runtime/observability/cascade-formatter.mjs.map +1 -1
  603. package/dist/substrate/runtime/observability/ignore-with-log.mjs.map +1 -1
  604. package/dist/substrate/runtime/observability/index.d.mts +1 -1
  605. package/dist/substrate/runtime/observability/index.mjs +4 -6
  606. package/dist/substrate/runtime/observability/log-attrs.mjs +46 -0
  607. package/dist/substrate/runtime/observability/log-attrs.mjs.map +1 -0
  608. package/dist/substrate/runtime/observability/log-store.mjs.map +1 -1
  609. package/dist/substrate/runtime/observability/logger.mjs +3 -3
  610. package/dist/substrate/runtime/observability/logger.mjs.map +1 -1
  611. package/dist/substrate/runtime/observability/output-truncate.mjs.map +1 -1
  612. package/dist/substrate/runtime/observability/pretty-error.mjs.map +1 -1
  613. package/dist/substrate/runtime/observability/process-lines.mjs.map +1 -1
  614. package/dist/substrate/runtime/observability/redaction.mjs.map +1 -1
  615. package/dist/substrate/runtime/observability/subprocess-capture.mjs +2 -2
  616. package/dist/substrate/runtime/observability/subprocess-capture.mjs.map +1 -1
  617. package/dist/substrate/runtime/passthrough-or-wrap.mjs.map +1 -1
  618. package/dist/substrate/runtime/paths.mjs +27 -9
  619. package/dist/substrate/runtime/paths.mjs.map +1 -1
  620. package/dist/substrate/runtime/phase-preserving-produce.mjs.map +1 -1
  621. package/dist/substrate/runtime/port-broker/service.mjs +10 -27
  622. package/dist/substrate/runtime/port-broker/service.mjs.map +1 -1
  623. package/dist/substrate/runtime/post-acquire-tasks.mjs.map +1 -1
  624. package/dist/substrate/runtime/probes.d.mts +2 -3
  625. package/dist/substrate/runtime/probes.mjs.map +1 -1
  626. package/dist/substrate/runtime/process-supervisor.mjs.map +1 -1
  627. package/dist/substrate/runtime/projection/operational-endpoints.mjs.map +1 -1
  628. package/dist/substrate/runtime/projection/state-ref.mjs.map +1 -1
  629. package/dist/substrate/runtime/projection/update.mjs +87 -11
  630. package/dist/substrate/runtime/projection/update.mjs.map +1 -1
  631. package/dist/substrate/runtime/random-suffix.mjs.map +1 -1
  632. package/dist/substrate/runtime/reconcile/fs-plan.mjs +146 -0
  633. package/dist/substrate/runtime/reconcile/fs-plan.mjs.map +1 -0
  634. package/dist/substrate/runtime/reconcile/graph.mjs +19 -0
  635. package/dist/substrate/runtime/reconcile/graph.mjs.map +1 -0
  636. package/dist/substrate/runtime/reconcile/index.mjs +5 -0
  637. package/dist/substrate/runtime/reconcile/label.mjs +41 -0
  638. package/dist/substrate/runtime/reconcile/label.mjs.map +1 -0
  639. package/dist/substrate/runtime/reconcile/spec.mjs +15 -0
  640. package/dist/substrate/runtime/reconcile/spec.mjs.map +1 -0
  641. package/dist/substrate/runtime/retry-policy.d.mts +2 -3
  642. package/dist/substrate/runtime/retry-policy.mjs.map +1 -1
  643. package/dist/substrate/runtime/routed-url.mjs.map +1 -1
  644. package/dist/substrate/runtime/runtime-decode.mjs.map +1 -1
  645. package/dist/substrate/runtime/scoped-http-server.mjs.map +1 -1
  646. package/dist/substrate/runtime/stage-and-swap/index.mjs +49 -12
  647. package/dist/substrate/runtime/stage-and-swap/index.mjs.map +1 -1
  648. package/dist/substrate/runtime/strategy-registry/chain-keyed-strategy-for.mjs.map +1 -1
  649. package/dist/substrate/runtime/strategy-registry/chain-probe-for.mjs.map +1 -1
  650. package/dist/substrate/runtime/strategy-registry/service.mjs +29 -17
  651. package/dist/substrate/runtime/strategy-registry/service.mjs.map +1 -1
  652. package/dist/substrate/runtime/subnet-broker.mjs.map +1 -1
  653. package/dist/substrate/runtime/supervisor/acquire-node.mjs +188 -56
  654. package/dist/substrate/runtime/supervisor/acquire-node.mjs.map +1 -1
  655. package/dist/substrate/runtime/supervisor/background-tasks.mjs +79 -65
  656. package/dist/substrate/runtime/supervisor/background-tasks.mjs.map +1 -1
  657. package/dist/substrate/runtime/supervisor/command-loop.mjs +82 -23
  658. package/dist/substrate/runtime/supervisor/command-loop.mjs.map +1 -1
  659. package/dist/substrate/runtime/supervisor/contribution-dispatcher.d.mts +1 -0
  660. package/dist/substrate/runtime/supervisor/contribution-dispatcher.mjs +16 -0
  661. package/dist/substrate/runtime/supervisor/contribution-dispatcher.mjs.map +1 -0
  662. package/dist/substrate/runtime/supervisor/errors.mjs +11 -2
  663. package/dist/substrate/runtime/supervisor/errors.mjs.map +1 -1
  664. package/dist/substrate/runtime/supervisor/index.mjs +2 -0
  665. package/dist/substrate/runtime/supervisor/shutdown.mjs +6 -6
  666. package/dist/substrate/runtime/supervisor/shutdown.mjs.map +1 -1
  667. package/dist/substrate/runtime/supervisor/start-supervisor.mjs +61 -75
  668. package/dist/substrate/runtime/supervisor/start-supervisor.mjs.map +1 -1
  669. package/dist/substrate/runtime/supervisor/state.d.mts +1 -1
  670. package/dist/substrate/runtime/supervisor/state.mjs +1 -1
  671. package/dist/substrate/runtime/supervisor/state.mjs.map +1 -1
  672. package/dist/substrate/runtime/supervisor/teardown.mjs +10 -9
  673. package/dist/substrate/runtime/supervisor/teardown.mjs.map +1 -1
  674. package/dist/substrate/runtime/supervisor/wiring.mjs +6 -20
  675. package/dist/substrate/runtime/supervisor/wiring.mjs.map +1 -1
  676. package/dist/substrate/runtime/tar/reader.mjs +216 -0
  677. package/dist/substrate/runtime/tar/reader.mjs.map +1 -0
  678. package/dist/substrate/runtime/typed-env.mjs.map +1 -1
  679. package/dist/substrate/versioned-doc-schema.mjs.map +1 -1
  680. package/dist/substrate/versioned-doc-sync.mjs +5 -5
  681. package/dist/substrate/versioned-doc-sync.mjs.map +1 -1
  682. package/dist/surfaces/cli/command-tree.mjs +49 -7
  683. package/dist/surfaces/cli/command-tree.mjs.map +1 -1
  684. package/dist/surfaces/cli/commands/config.mjs +1 -1
  685. package/dist/surfaces/cli/commands/config.mjs.map +1 -1
  686. package/dist/surfaces/cli/commands/confirm-node.mjs.map +1 -1
  687. package/dist/surfaces/cli/commands/confirm.mjs.map +1 -1
  688. package/dist/surfaces/cli/commands/doctor.mjs +1 -1
  689. package/dist/surfaces/cli/commands/doctor.mjs.map +1 -1
  690. package/dist/surfaces/cli/commands/prune-picker-entry.mjs.map +1 -1
  691. package/dist/surfaces/cli/commands/prune-picker.mjs.map +1 -1
  692. package/dist/surfaces/cli/commands/prune.mjs +1 -1
  693. package/dist/surfaces/cli/commands/prune.mjs.map +1 -1
  694. package/dist/surfaces/cli/commands/snapshot.mjs +1 -1
  695. package/dist/surfaces/cli/commands/snapshot.mjs.map +1 -1
  696. package/dist/surfaces/cli/commands/status.mjs +1 -1
  697. package/dist/surfaces/cli/commands/status.mjs.map +1 -1
  698. package/dist/surfaces/cli/commands/supervisor-presence.mjs.map +1 -1
  699. package/dist/surfaces/cli/commands/wipe.mjs +3 -4
  700. package/dist/surfaces/cli/commands/wipe.mjs.map +1 -1
  701. package/dist/surfaces/cli/envelope.mjs.map +1 -1
  702. package/dist/surfaces/cli/errors.mjs.map +1 -1
  703. package/dist/surfaces/cli/flags.mjs.map +1 -1
  704. package/dist/surfaces/cli/index.mjs +45 -14
  705. package/dist/surfaces/cli/index.mjs.map +1 -1
  706. package/dist/surfaces/cli/output.mjs.map +1 -1
  707. package/dist/surfaces/cli/sysexits.mjs.map +1 -1
  708. package/dist/surfaces/tui/app.mjs +0 -21
  709. package/dist/surfaces/tui/app.mjs.map +1 -1
  710. package/dist/surfaces/tui/dashboard.mjs +0 -48
  711. package/dist/surfaces/tui/dashboard.mjs.map +1 -1
  712. package/dist/surfaces/tui/display-derivation.mjs +80 -16
  713. package/dist/surfaces/tui/display-derivation.mjs.map +1 -1
  714. package/dist/surfaces/tui/errors.mjs.map +1 -1
  715. package/dist/surfaces/tui/event-log.mjs +0 -9
  716. package/dist/surfaces/tui/event-log.mjs.map +1 -1
  717. package/dist/surfaces/tui/heartbeat.mjs.map +1 -1
  718. package/dist/surfaces/tui/index.mjs +2 -2
  719. package/dist/surfaces/tui/index.mjs.map +1 -1
  720. package/dist/surfaces/tui/input.mjs.map +1 -1
  721. package/dist/surfaces/tui/mode-detect.mjs.map +1 -1
  722. package/dist/surfaces/tui/mount-ink.mjs.map +1 -1
  723. package/dist/surfaces/tui/plain-renderer.mjs +26 -19
  724. package/dist/surfaces/tui/plain-renderer.mjs.map +1 -1
  725. package/dist/surfaces/tui/resource-table.mjs +8 -10
  726. package/dist/surfaces/tui/resource-table.mjs.map +1 -1
  727. package/images/postgres/Dockerfile +0 -1
  728. package/images/sui/Dockerfile +27 -54
  729. package/images/sui/entrypoint.sh +17 -179
  730. package/package.json +23 -15
  731. package/dashboard-ui/assets/index-Bmi1UtAg.js +0 -1356
  732. package/dashboard-ui/assets/index-D5EShVt4.js +0 -3
  733. package/dashboard-ui/assets/index-Deml9drg.css +0 -1
  734. package/dist/api/plugin-errors.d.mts +0 -7
  735. package/dist/api/plugin-errors.mjs +0 -10
  736. package/dist/api/plugin-errors.mjs.map +0 -1
  737. package/dist/cli/wirings/build-verb-layers.mjs +0 -42
  738. package/dist/cli/wirings/build-verb-layers.mjs.map +0 -1
  739. package/dist/contracts/capability-decl.d.mts +0 -40
  740. package/dist/orchestrators/built-in-plugin-layers.mjs +0 -54
  741. package/dist/orchestrators/built-in-plugin-layers.mjs.map +0 -1
  742. package/dist/orchestrators/run.mjs +0 -91
  743. package/dist/orchestrators/run.mjs.map +0 -1
  744. package/dist/orchestrators/runtime-composition.d.mts +0 -10
  745. package/dist/orchestrators/runtime-composition.mjs +0 -252
  746. package/dist/orchestrators/runtime-composition.mjs.map +0 -1
  747. package/dist/orchestrators/snapshot/capture-command.d.mts +0 -1
  748. package/dist/orchestrators/snapshot/capture-command.mjs +0 -25
  749. package/dist/orchestrators/snapshot/capture-command.mjs.map +0 -1
  750. package/dist/orchestrators/snapshot/pending-marker.mjs +0 -99
  751. package/dist/orchestrators/snapshot/pending-marker.mjs.map +0 -1
  752. package/dist/orchestrators/snapshot/recover-pending.mjs +0 -223
  753. package/dist/orchestrators/snapshot/recover-pending.mjs.map +0 -1
  754. package/dist/orchestrators/snapshot/state-document.d.mts +0 -1
  755. package/dist/orchestrators/snapshot/state-document.mjs +0 -58
  756. package/dist/orchestrators/snapshot/state-document.mjs.map +0 -1
  757. package/dist/plugins/account/spans.mjs +0 -16
  758. package/dist/plugins/account/spans.mjs.map +0 -1
  759. package/dist/plugins/account/variants/env.mjs +0 -24
  760. package/dist/plugins/account/variants/env.mjs.map +0 -1
  761. package/dist/plugins/account/variants/inline.mjs +0 -13
  762. package/dist/plugins/account/variants/inline.mjs.map +0 -1
  763. package/dist/plugins/account/variants/keystore.mjs +0 -91
  764. package/dist/plugins/account/variants/keystore.mjs.map +0 -1
  765. package/dist/plugins/action/spans.mjs +0 -11
  766. package/dist/plugins/action/spans.mjs.map +0 -1
  767. package/dist/plugins/coin/spans.mjs +0 -20
  768. package/dist/plugins/coin/spans.mjs.map +0 -1
  769. package/dist/plugins/deepbook/spans.mjs +0 -18
  770. package/dist/plugins/deepbook/spans.mjs.map +0 -1
  771. package/dist/plugins/faucet/spans.mjs +0 -12
  772. package/dist/plugins/faucet/spans.mjs.map +0 -1
  773. package/dist/plugins/package/spans.mjs +0 -14
  774. package/dist/plugins/package/spans.mjs.map +0 -1
  775. package/dist/plugins/postgres/codegen.mjs +0 -42
  776. package/dist/plugins/postgres/codegen.mjs.map +0 -1
  777. package/dist/plugins/postgres/connection.d.mts +0 -33
  778. package/dist/plugins/postgres/connection.mjs.map +0 -1
  779. package/dist/plugins/postgres/db-ensure.mjs.map +0 -1
  780. package/dist/plugins/postgres/errors.d.mts +0 -60
  781. package/dist/plugins/postgres/errors.mjs +0 -29
  782. package/dist/plugins/postgres/errors.mjs.map +0 -1
  783. package/dist/plugins/postgres/index.d.mts +0 -37
  784. package/dist/plugins/postgres/index.mjs +0 -68
  785. package/dist/plugins/postgres/index.mjs.map +0 -1
  786. package/dist/plugins/postgres/routable.mjs +0 -33
  787. package/dist/plugins/postgres/routable.mjs.map +0 -1
  788. package/dist/plugins/postgres/service.d.mts +0 -50
  789. package/dist/plugins/postgres/service.mjs +0 -179
  790. package/dist/plugins/postgres/service.mjs.map +0 -1
  791. package/dist/plugins/postgres/snapshot.mjs +0 -32
  792. package/dist/plugins/postgres/snapshot.mjs.map +0 -1
  793. package/dist/plugins/postgres/spans.mjs +0 -11
  794. package/dist/plugins/postgres/spans.mjs.map +0 -1
  795. package/dist/plugins/seal/spans.mjs +0 -18
  796. package/dist/plugins/seal/spans.mjs.map +0 -1
  797. package/dist/plugins/sui/spans.mjs +0 -17
  798. package/dist/plugins/sui/spans.mjs.map +0 -1
  799. package/dist/plugins/wallet/spans.mjs +0 -22
  800. package/dist/plugins/wallet/spans.mjs.map +0 -1
  801. package/dist/plugins/walrus/registry-publish.d.mts +0 -24
  802. package/dist/plugins/walrus/spans.mjs +0 -18
  803. package/dist/plugins/walrus/spans.mjs.map +0 -1
  804. package/dist/runtime/docker/logs.d.mts +0 -1
  805. package/dist/runtime/docker/logs.mjs +0 -34
  806. package/dist/runtime/docker/logs.mjs.map +0 -1
  807. package/dist/substrate/runtime/artifact-publisher/index.mjs +0 -86
  808. package/dist/substrate/runtime/artifact-publisher/index.mjs.map +0 -1
  809. package/dist/substrate/runtime/capability-sinks/index.d.mts +0 -1
  810. package/dist/substrate/runtime/capability-sinks/index.mjs +0 -3
  811. package/dist/substrate/runtime/capability-sinks/layer.d.mts +0 -1
  812. package/dist/substrate/runtime/capability-sinks/layer.mjs +0 -31
  813. package/dist/substrate/runtime/capability-sinks/layer.mjs.map +0 -1
  814. package/dist/substrate/runtime/capability-sinks/service.d.mts +0 -95
  815. package/dist/substrate/runtime/capability-sinks/service.mjs +0 -69
  816. package/dist/substrate/runtime/capability-sinks/service.mjs.map +0 -1
  817. package/dist/substrate/runtime/cross-process/lock.d.mts +0 -1
  818. package/dist/substrate/runtime/cross-process/lock.mjs +0 -23
  819. package/dist/substrate/runtime/cross-process/lock.mjs.map +0 -1
  820. package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs +0 -113
  821. package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs.map +0 -1
  822. package/dist/substrate/runtime/lifecycle/lifecycle-fact.mjs +0 -31
  823. package/dist/substrate/runtime/lifecycle/lifecycle-fact.mjs.map +0 -1
  824. package/dist/substrate/runtime/observability/formatter-registry.d.mts +0 -1
  825. package/dist/substrate/runtime/observability/formatter-registry.mjs +0 -48
  826. package/dist/substrate/runtime/observability/formatter-registry.mjs.map +0 -1
  827. package/dist/substrate/runtime/observability/span-store.d.mts +0 -1
  828. package/dist/substrate/runtime/observability/span-store.mjs +0 -110
  829. package/dist/substrate/runtime/observability/span-store.mjs.map +0 -1
  830. package/dist/substrate/runtime/observability/spans.d.mts +0 -1
  831. package/dist/substrate/runtime/observability/spans.mjs +0 -87
  832. package/dist/substrate/runtime/observability/spans.mjs.map +0 -1
  833. package/dist/substrate/runtime/projection/index.mjs +0 -4
  834. package/dist/substrate/runtime/projection/persisted.mjs +0 -213
  835. package/dist/substrate/runtime/projection/persisted.mjs.map +0 -1
  836. package/dist/substrate/runtime/scoped-multimap/service.mjs +0 -52
  837. package/dist/substrate/runtime/scoped-multimap/service.mjs.map +0 -1
  838. package/dist/substrate/runtime/scoped-ref-map/index.mjs +0 -2
  839. package/dist/substrate/runtime/scoped-ref-map/service.mjs +0 -83
  840. package/dist/substrate/runtime/scoped-ref-map/service.mjs.map +0 -1
  841. package/dist/substrate/runtime/state-store/index.mjs +0 -3
  842. package/dist/substrate/runtime/state-store/schema.d.mts +0 -1
  843. package/dist/substrate/runtime/state-store/schema.mjs +0 -41
  844. package/dist/substrate/runtime/state-store/schema.mjs.map +0 -1
  845. package/dist/substrate/runtime/state-store/service.d.mts +0 -1
  846. package/dist/substrate/runtime/state-store/service.mjs +0 -145
  847. package/dist/substrate/runtime/state-store/service.mjs.map +0 -1
  848. package/dist/substrate/runtime/sui-execute/index.mjs.map +0 -1
  849. package/dist/substrate/runtime/sui-execute/sign-and-dispatch.mjs.map +0 -1
  850. package/dist/substrate/runtime/sui-ledger/object-ref.mjs.map +0 -1
  851. package/dist/substrate/runtime/sui-move-build/index.mjs.map +0 -1
  852. package/dist/substrate/runtime/supervisor/dispatch-contributions.mjs +0 -151
  853. package/dist/substrate/runtime/supervisor/dispatch-contributions.mjs.map +0 -1
  854. package/dist/substrate/state-store.d.mts +0 -1
  855. /package/dist/orchestrators/{snapshot/pending-marker.d.mts → codegen/id-config.d.mts} +0 -0
  856. /package/dist/orchestrators/snapshot/{recover-pending.d.mts → interrupted-restore.d.mts} +0 -0
  857. /package/dist/{substrate/runtime/sui-execute → plugins/sui/exec}/sign-and-dispatch.d.mts +0 -0
  858. /package/dist/plugins/{postgres/snapshot.d.mts → sui/ledger/object-ref.d.mts} +0 -0
  859. /package/dist/{substrate/runtime/sui-move-build → plugins/sui/move}/index.d.mts +0 -0
  860. /package/dist/substrate/runtime/{cross-process/snapshot-reservation.d.mts → lifecycle/file-watcher.d.mts} +0 -0
  861. /package/dist/substrate/runtime/{state-store/index.d.mts → reconcile/graph.d.mts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"types.mjs","names":["HealthEnum"],"sources":["../../../../src/plugins/dashboard/schema/types.ts"],"sourcesContent":["// Dashboard object types — real Pothos object refs over the projection.\n//\n// Sources are the substrate projection shapes (Row, Endpoint,\n// AccountProjection, …). Service/Endpoint/Account/Package are registered\n// as relay Nodes via `builder.node`, with an opaque global id derived from\n// their natural key and a `loadOne` that re-finds them in the current\n// snapshot (read from the request's `ctx.state`) so the auto-generated\n// `node`/`nodes` queries resolve.\n//\n// `StackState` and `HealthSummary` are computed views over a snapshot —\n// `StackState` carries the snapshot itself as its source so nested\n// resolvers (e.g. Service.endpoints) can join against sibling arrays.\n\nimport { Effect, SubscriptionRef } from 'effect';\nimport { builder } from './builder.ts';\nimport {\n\tAccountScheme,\n\tAccountSource,\n\tDeepbookMode,\n\tErrorSeverity,\n\tFundingStatus,\n\tHealth as HealthEnum,\n\tLifecycleStatus,\n\tLogLevel,\n\tPackageKind,\n\tPluginRole,\n\tRowSection,\n\tWireProtocol,\n} from './enums.ts';\nimport type { Health } from './enums.ts';\nimport type { ControlPlaneSnapshotEntry } from '../../../substrate/runtime/control-plane/service.ts';\nimport type {\n\tDashboardCoinCap,\n\tDashboardDeepbookInfo,\n\tDashboardDeepbookPool,\n\tDashboardFundableCoin,\n\tDashboardPostgresStats,\n\tDashboardPostgresTable,\n\tDashboardSealInfo,\n\tDashboardSealKeyServer,\n} from '../domain.ts';\nimport type { LogRecord, SpanRecord } from '../../../substrate/runtime/observability/index.ts';\nimport type {\n\tAccountProjection,\n\tBuildEntry as BuildEntryShape,\n\tEndpoint as EndpointShape,\n\tLogTail as LogTailShape,\n\tPackageProjection,\n\tRow,\n\tStructuredError,\n\tSubscribableState,\n} from '../../../substrate/projection.ts';\n\n/** A snapshot-carrying service row. The snapshot lets `endpoints` join the\n * row's endpoint keys against the projection's endpoint array. */\nexport interface ServiceSource {\n\treadonly row: Row;\n\treadonly snapshot: SubscribableState;\n}\n\ntype FundingEntrySource = NonNullable<AccountProjection['funding']['entries']>[number];\n\nexport interface HealthSummarySource {\n\treadonly total: number;\n\treadonly ready: number;\n\treadonly active: number;\n\treadonly failed: number;\n\treadonly waiting: number;\n\treadonly health: Health;\n}\n\n/** Compute the stack health summary from the projection rows. `active`\n * counts rows mid-flight (acquiring/stopping); `waiting` counts rows that\n * have not started (pending). Overall `health` is `failed`→blocked,\n * any-active→active, all-ready (with ≥1 row)→ready, otherwise empty. */\nexport const computeHealthSummary = (rows: ReadonlyArray<Row>): HealthSummarySource => {\n\tlet ready = 0;\n\tlet active = 0;\n\tlet failed = 0;\n\tlet waiting = 0;\n\tfor (const row of rows) {\n\t\tswitch (row.status) {\n\t\t\tcase 'ready':\n\t\t\tcase 'done':\n\t\t\tcase 'stopped':\n\t\t\t\tready += 1;\n\t\t\t\tbreak;\n\t\t\tcase 'acquiring':\n\t\t\tcase 'stopping':\n\t\t\t\tactive += 1;\n\t\t\t\tbreak;\n\t\t\tcase 'failed':\n\t\t\t\tfailed += 1;\n\t\t\t\tbreak;\n\t\t\tcase 'pending':\n\t\t\t\twaiting += 1;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\tconst total = rows.length;\n\tconst health: Health =\n\t\tfailed > 0\n\t\t\t? 'blocked'\n\t\t\t: active > 0\n\t\t\t\t? 'active'\n\t\t\t\t: total > 0 && ready === total\n\t\t\t\t\t? 'ready'\n\t\t\t\t\t: 'empty';\n\treturn { total, ready, active, failed, waiting, health };\n};\n\nconst readSnapshot = (\n\tref: SubscriptionRef.SubscriptionRef<SubscribableState>,\n): Promise<SubscribableState> => Effect.runPromise(SubscriptionRef.get(ref));\n\n// --- Identity / Cycle ---------------------------------------------------\nexport const Identity = builder.objectRef<SubscribableState['identity']>('Identity').implement({\n\tdescription: 'Stack identity triple (app/stack/network).',\n\tfields: (t) => ({\n\t\tapp: t.exposeString('app'),\n\t\tstack: t.exposeString('stack'),\n\t\tnetwork: t.exposeString('network'),\n\t}),\n});\n\nexport const Cycle = builder.objectRef<SubscribableState['cycle']>('Cycle').implement({\n\tdescription: 'The current boot/restart cycle.',\n\tfields: (t) => ({\n\t\tid: t.exposeInt('id'),\n\t\tstartedAt: t.exposeFloat('startedAt'),\n\t\t// Carried as String: the raw union ('booting'|…|'shutting-down') is the\n\t\t// wire contract, and 'shutting-down' is not a valid GraphQL enum name.\n\t\tphase: t.field({ type: 'String', resolve: (c) => c.phase }),\n\t}),\n});\n\n// --- Endpoint (Node) ----------------------------------------------------\nexport const Endpoint = builder.objectRef<EndpointShape>('Endpoint');\nbuilder.node(Endpoint, {\n\tdescription: 'A routed endpoint contributed by a plugin.',\n\tid: { resolve: (e) => e.endpointKey },\n\tloadOne: async (id, ctx) => {\n\t\tconst snapshot = await readSnapshot(ctx.state);\n\t\treturn snapshot.endpoints.find((e) => e.endpointKey === id) ?? null;\n\t},\n\tfields: (t) => ({\n\t\tendpointKey: t.exposeString('endpointKey'),\n\t\tpluginKey: t.exposeString('pluginKey'),\n\t\tname: t.exposeString('name'),\n\t\turl: t.exposeString('url'),\n\t\tdisplayUrl: t.exposeString('displayUrl', { nullable: true }),\n\t\twireProtocol: t.field({ type: WireProtocol, resolve: (e) => e.wireProtocol }),\n\t\tregisteredAt: t.exposeFloat('registeredAt'),\n\t}),\n});\n\n// --- LogTail / StackError ----------------------------------------------\nexport const LogTail = builder.objectRef<LogTailShape>('LogTail').implement({\n\tdescription: 'The tail of a plugin log stream.',\n\tfields: (t) => ({\n\t\tlines: t.exposeStringList('lines'),\n\t\tlevel: t.field({ type: LogLevel, resolve: (l) => l.level }),\n\t\ttruncated: t.exposeBoolean('truncated'),\n\t}),\n});\n\nexport const StackError = builder.objectRef<StructuredError>('StackError').implement({\n\tdescription: 'A structured error reported by a plugin or the engine.',\n\tfields: (t) => ({\n\t\tat: t.exposeFloat('at'),\n\t\tpluginKey: t.exposeString('pluginKey', { nullable: true }),\n\t\ttag: t.exposeString('tag'),\n\t\tsummary: t.exposeString('summary'),\n\t\tchain: t.exposeStringList('chain'),\n\t\tseverity: t.field({ type: ErrorSeverity, resolve: (e) => e.severity }),\n\t}),\n});\n\n// --- Service (Node, wraps a Row) ---------------------------------------\nexport const Service = builder.objectRef<ServiceSource>('Service');\nbuilder.node(Service, {\n\tdescription: 'A visible plugin instance (one projection row).',\n\tid: { resolve: (s) => s.row.key },\n\tloadOne: async (id, ctx) => {\n\t\tconst snapshot = await readSnapshot(ctx.state);\n\t\tconst row = snapshot.rows.find((r) => r.key === id);\n\t\treturn row ? { row, snapshot } : null;\n\t},\n\tfields: (t) => ({\n\t\tkey: t.string({ resolve: (s) => s.row.key }),\n\t\trole: t.field({ type: PluginRole, resolve: (s) => s.row.role }),\n\t\tstatus: t.field({ type: LifecycleStatus, resolve: (s) => s.row.status }),\n\t\tsection: t.field({ type: RowSection, resolve: (s) => s.row.section }),\n\t\tendpointSection: t.field({ type: RowSection, resolve: (s) => s.row.endpointSection }),\n\t\tphase: t.string({ nullable: true, resolve: (s) => s.row.phase }),\n\t\tselectiveRestartHighlight: t.boolean({\n\t\t\tresolve: (s) => s.row.selectiveRestartHighlight,\n\t\t}),\n\t\tlastError: t.field({\n\t\t\ttype: StackError,\n\t\t\tnullable: true,\n\t\t\tresolve: (s) => s.row.lastError,\n\t\t}),\n\t\tlogTail: t.field({ type: LogTail, resolve: (s) => s.row.logTail }),\n\t\tendpoints: t.field({\n\t\t\ttype: [Endpoint],\n\t\t\tdescription: \"The row's endpoints, joined from the snapshot by key + pluginKey.\",\n\t\t\tresolve: (s) => {\n\t\t\t\tconst keys = new Set<string>(s.row.endpoints);\n\t\t\t\treturn s.snapshot.endpoints.filter(\n\t\t\t\t\t(e) => keys.has(e.endpointKey) && e.pluginKey === s.row.key,\n\t\t\t\t);\n\t\t\t},\n\t\t}),\n\t}),\n});\n\n// --- Funding ------------------------------------------------------------\nexport const FundingEntry = builder.objectRef<FundingEntrySource>('FundingEntry').implement({\n\tdescription: 'One coin-type funding outcome for an account.',\n\tfields: (t) => ({\n\t\tcoin: t.exposeString('coin'),\n\t\tfullCoinType: t.exposeString('fullCoinType'),\n\t\tamount: t.exposeString('amount'),\n\t\t// String for the same reason as Cycle.phase: 'already-satisfied' is not\n\t\t// a valid GraphQL enum name; the raw union string is the wire contract.\n\t\tstatus: t.field({ type: 'String', resolve: (e) => e.status }),\n\t}),\n});\n\nexport const AccountFunding = builder\n\t.objectRef<AccountProjection['funding']>('AccountFunding')\n\t.implement({\n\t\tdescription: 'Funding state for an account.',\n\t\tfields: (t) => ({\n\t\t\tstatus: t.field({ type: FundingStatus, resolve: (f) => f.status }),\n\t\t\tbalanceMist: t.exposeString('balanceMist', { nullable: true }),\n\t\t\trequestedMist: t.exposeString('requestedMist', { nullable: true }),\n\t\t\tentries: t.field({\n\t\t\t\ttype: [FundingEntry],\n\t\t\t\tresolve: (f) => f.entries ?? [],\n\t\t\t}),\n\t\t}),\n\t});\n\n// --- Account (Node) -----------------------------------------------------\nexport const Account = builder.objectRef<AccountProjection>('Account');\nbuilder.node(Account, {\n\tdescription: 'A managed or impersonated account.',\n\tid: { resolve: (a) => a.key },\n\tloadOne: async (id, ctx) => {\n\t\tconst snapshot = await readSnapshot(ctx.state);\n\t\treturn snapshot.accounts.find((a) => a.key === id) ?? null;\n\t},\n\tfields: (t) => ({\n\t\tkey: t.exposeString('key'),\n\t\trowKey: t.exposeString('rowKey', { nullable: true }),\n\t\tname: t.exposeString('name'),\n\t\taddress: t.exposeString('address', { nullable: true }),\n\t\tscheme: t.field({ type: AccountScheme, nullable: true, resolve: (a) => a.scheme }),\n\t\tsource: t.field({ type: AccountSource, nullable: true, resolve: (a) => a.source }),\n\t\twalletVisible: t.exposeBoolean('walletVisible'),\n\t\tupdatedAt: t.exposeFloat('updatedAt'),\n\t\tfunding: t.field({ type: AccountFunding, resolve: (a) => a.funding }),\n\t}),\n});\n\n// --- Package (Node) -----------------------------------------------------\nexport const Package = builder.objectRef<PackageProjection>('Package');\nbuilder.node(Package, {\n\tdescription: 'A local or known on-chain package.',\n\tid: { resolve: (p) => p.key },\n\tloadOne: async (id, ctx) => {\n\t\tconst snapshot = await readSnapshot(ctx.state);\n\t\treturn snapshot.packages.find((p) => p.key === id) ?? null;\n\t},\n\tfields: (t) => ({\n\t\tkey: t.exposeString('key'),\n\t\trowKey: t.exposeString('rowKey', { nullable: true }),\n\t\tname: t.exposeString('name'),\n\t\tkind: t.field({ type: PackageKind, resolve: (p) => p.kind }),\n\t\tpackageId: t.exposeString('packageId'),\n\t\tupgradeCapId: t.exposeString('upgradeCapId', { nullable: true }),\n\t\tmvrPlaceholder: t.exposeString('mvrPlaceholder'),\n\t\tsourcePath: t.exposeString('sourcePath', { nullable: true }),\n\t\tupdatedAt: t.exposeFloat('updatedAt'),\n\t}),\n});\n\n// --- BuildEntry / LastEvent --------------------------------------------\nexport const BuildEntry = builder.objectRef<BuildEntryShape>('BuildEntry').implement({\n\tdescription: 'A stack build progress entry.',\n\tfields: (t) => ({\n\t\tpluginKey: t.exposeString('pluginKey', { nullable: true }),\n\t\tphase: t.exposeString('phase'),\n\t\tprogress: t.exposeString('progress'),\n\t\tstartedAt: t.exposeFloat('startedAt'),\n\t}),\n});\n\nexport const LastEvent = builder.objectRef<SubscribableState['lastEvent']>('LastEvent').implement({\n\tdescription: 'The most recent event seq/timestamp the engine emitted.',\n\tfields: (t) => ({\n\t\tseq: t.exposeInt('seq'),\n\t\tat: t.exposeFloat('at'),\n\t}),\n});\n\n// --- HealthSummary ------------------------------------------------------\nexport const HealthSummary = builder.objectRef<HealthSummarySource>('HealthSummary').implement({\n\tdescription: 'Derived stack health counts.',\n\tfields: (t) => ({\n\t\ttotal: t.exposeInt('total'),\n\t\tready: t.exposeInt('ready'),\n\t\tactive: t.exposeInt('active'),\n\t\tfailed: t.exposeInt('failed'),\n\t\twaiting: t.exposeInt('waiting'),\n\t\thealth: t.field({ type: HealthEnum, resolve: (h) => h.health }),\n\t}),\n});\n\n// --- Plugin-domain object types ----------------------------------------\n//\n// Sources are the app-agnostic `ControlPlane*` shapes the supervisor\n// populates from resolved plugin values. These cover only what the browser\n// cannot reach directly: codegen capability ids, in-process plugin state,\n// the snapshot catalog, and PG wire-protocol stats. Numeric counts/sizes\n// are carried as Float (GraphQL Int caps at 2^31; pg sizes can exceed it).\n\nexport const SnapshotEntry = builder\n\t.objectRef<ControlPlaneSnapshotEntry>('SnapshotEntry')\n\t.implement({\n\t\tdescription: 'A snapshot catalog entry (orchestrator `list`).',\n\t\tfields: (t) => ({\n\t\t\tid: t.exposeString('id'),\n\t\t\tlabel: t.exposeString('label', { nullable: true }),\n\t\t\tcreatedAt: t.exposeFloat('createdAt', { nullable: true }),\n\t\t\tapp: t.exposeString('app', { nullable: true }),\n\t\t\tstack: t.exposeString('stack', { nullable: true }),\n\t\t\tnetwork: t.exposeString('network', { nullable: true }),\n\t\t\tparticipants: t.exposeStringList('participants'),\n\t\t\tcontainerCount: t.exposeInt('containerCount'),\n\t\t\tsubtreeCount: t.exposeInt('subtreeCount'),\n\t\t\tcorrupt: t.exposeBoolean('corrupt'),\n\t\t}),\n\t});\n\nexport const DeepbookPool = builder.objectRef<DashboardDeepbookPool>('DeepbookPool').implement({\n\tdescription: 'A DeepBook pool object id + coin types (prices are chain-direct).',\n\tfields: (t) => ({\n\t\tname: t.exposeString('name'),\n\t\tpoolId: t.exposeString('poolId'),\n\t\tbaseCoinType: t.exposeString('baseCoinType'),\n\t\tquoteCoinType: t.exposeString('quoteCoinType'),\n\t}),\n});\n\nexport const DeepbookInfo = builder.objectRef<DashboardDeepbookInfo>('DeepbookInfo').implement({\n\tdescription: 'A DeepBook deployment: registry/admin/pool ids + market-maker state.',\n\tfields: (t) => ({\n\t\tpluginKey: t.exposeString('pluginKey'),\n\t\tname: t.exposeString('name'),\n\t\tmode: t.field({ type: DeepbookMode, resolve: (d) => d.mode }),\n\t\tchain: t.exposeString('chain'),\n\t\tpackageId: t.exposeString('packageId'),\n\t\tregistryId: t.exposeString('registryId'),\n\t\tadminCapId: t.exposeString('adminCapId', { nullable: true }),\n\t\tdeepTreasuryId: t.exposeString('deepTreasuryId', { nullable: true }),\n\t\tpools: t.field({ type: [DeepbookPool], resolve: (d) => d.pools }),\n\t\tmarketMakerRunning: t.exposeBoolean('marketMakerRunning'),\n\t\tserverUrl: t.exposeString('serverUrl', { nullable: true }),\n\t\tindexerUrl: t.exposeString('indexerUrl', { nullable: true }),\n\t}),\n});\n\nexport const SealKeyServer = builder.objectRef<DashboardSealKeyServer>('SealKeyServer').implement({\n\tdescription: 'One Seal key-server config (objectId + weight).',\n\tfields: (t) => ({\n\t\tobjectId: t.exposeString('objectId'),\n\t\tweight: t.exposeInt('weight'),\n\t}),\n});\n\nexport const SealInfo = builder.objectRef<DashboardSealInfo>('SealInfo').implement({\n\tdescription: 'A Seal key-server deployment (objectId/threshold/mode/keyServers).',\n\tfields: (t) => ({\n\t\tpluginKey: t.exposeString('pluginKey'),\n\t\t// String, not enum: 'local-keygen'/'fork-known' are illegal GraphQL\n\t\t// enum value names (hyphens). The raw union string is the wire contract.\n\t\tmode: t.field({ type: 'String', resolve: (s) => s.mode }),\n\t\tobjectId: t.exposeString('objectId'),\n\t\tkeyServerUrl: t.exposeString('keyServerUrl'),\n\t\tkeyServers: t.field({ type: [SealKeyServer], resolve: (s) => s.keyServers }),\n\t\tthreshold: t.exposeInt('threshold'),\n\t}),\n});\n\nexport const CoinCap = builder.objectRef<DashboardCoinCap>('CoinCap').implement({\n\tdescription: \"A coin's treasury-cap id (drives Mint) + addressing facts.\",\n\tfields: (t) => ({\n\t\tpluginKey: t.exposeString('pluginKey'),\n\t\tsymbol: t.exposeString('symbol', { nullable: true }),\n\t\tfullCoinType: t.exposeString('fullCoinType'),\n\t\tdecimals: t.exposeInt('decimals'),\n\t\t// String, not enum: 'on-chain' is an illegal GraphQL enum value name.\n\t\tsource: t.field({ type: 'String', resolve: (c) => c.source }),\n\t\ttreasuryCapId: t.exposeString('treasuryCapId', { nullable: true }),\n\t\tpackageId: t.exposeString('packageId', { nullable: true }),\n\t}),\n});\n\nexport const FundableCoin = builder.objectRef<DashboardFundableCoin>('FundableCoin').implement({\n\tdescription:\n\t\t'A coin the dashboard faucet can fund right now. SUI is fixed-amount; ' +\n\t\t'WAL/DEEP honor an amount and require the recipient to be a resolved account.',\n\tfields: (t) => ({\n\t\tsymbol: t.exposeString('symbol'),\n\t\tcoinType: t.exposeString('coinType'),\n\t\t/** True when the underlying strategy honors a caller-supplied amount\n\t\t * (WAL/DEEP swaps). SUI is fixed-amount (false). */\n\t\thonorsAmount: t.exposeBoolean('honorsAmount'),\n\t\t/** True when funding requires the recipient to BE a resolved account\n\t\t * (the swap spends that account's own SUI). SUI is false. */\n\t\trequiresAccountSigner: t.exposeBoolean('requiresAccountSigner'),\n\t}),\n});\n\nexport const PostgresTable = builder.objectRef<DashboardPostgresTable>('PostgresTable').implement({\n\tdescription: 'Per-table row estimate + total size (bytes).',\n\tfields: (t) => ({\n\t\tschema: t.exposeString('schema'),\n\t\tname: t.exposeString('name'),\n\t\trowEstimate: t.exposeFloat('rowEstimate'),\n\t\ttotalBytes: t.exposeFloat('totalBytes'),\n\t}),\n});\n\nexport const PostgresStats = builder.objectRef<DashboardPostgresStats>('PostgresStats').implement({\n\tdescription:\n\t\t'Postgres wire-protocol stats (db size, connections, per-table). Gathered by exec; the browser cannot speak the PG protocol.',\n\tfields: (t) => ({\n\t\tpluginKey: t.exposeString('pluginKey'),\n\t\tdatabase: t.exposeString('database'),\n\t\t// Plain (password-less) DSN only — the credentialed form never leaves\n\t\t// the backend.\n\t\tplainUrl: t.exposeString('plainUrl'),\n\t\tdatabaseBytes: t.exposeFloat('databaseBytes'),\n\t\tconnectionCount: t.exposeInt('connectionCount'),\n\t\ttables: t.field({ type: [PostgresTable], resolve: (p) => p.tables }),\n\t\tavailable: t.exposeBoolean('available'),\n\t\tdetail: t.exposeString('detail', { nullable: true }),\n\t}),\n});\n\n// --- Observability: LogRecord / SpanRecord -----------------------------\n//\n// Sources are the substrate observability ring records. `level` (logs) and\n// `status` (spans) are carried as String, not GraphQL enums: the log level\n// vocabulary (trace/debug/info/warn/error/fatal) is wider than the\n// projection's row-tail LogLevel enum, and keeping it String decouples the\n// queryable surface from the row-tail enum (same hyphen/illegal-enum-safe\n// String pattern used by SealMode/CoinSource above). Structured `fields` /\n// `attributes` are serialized to a JSON string — the schema has no JSON\n// scalar and the console renders them as a detail blob.\n\nconst fieldsJson = (fields: Readonly<Record<string, unknown>>): string => {\n\ttry {\n\t\treturn JSON.stringify(fields);\n\t} catch {\n\t\treturn '{}';\n\t}\n};\n\nexport const LogRecordType = builder.objectRef<LogRecord>('LogRecord').implement({\n\tdescription:\n\t\t'One cross-service log record (queryable Console \"Logs\" tab). Fed off the same logger path as the per-row projection tail.',\n\tfields: (t) => ({\n\t\tseq: t.exposeFloat('seq'),\n\t\ttimestampMillis: t.exposeFloat('timestampMillis'),\n\t\t// String: wider than the row-tail LogLevel enum (trace/debug/fatal).\n\t\tlevel: t.field({ type: 'String', resolve: (r) => r.level }),\n\t\tservice: t.exposeString('service'),\n\t\tmessage: t.exposeString('message'),\n\t\t/** Structured fields as a JSON string (no JSON scalar in this schema). */\n\t\tfieldsJson: t.field({ type: 'String', resolve: (r) => fieldsJson(r.fields) }),\n\t}),\n});\n\nexport const SpanRecordType = builder.objectRef<SpanRecord>('SpanRecord').implement({\n\tdescription:\n\t\t'One completed span (queryable Console \"Traces\" tab). Recorded by the supervisor\\'s recording Tracer.',\n\tfields: (t) => ({\n\t\ttraceId: t.exposeString('traceId'),\n\t\tspanId: t.exposeString('spanId'),\n\t\tparentId: t.exposeString('parentId', { nullable: true }),\n\t\tname: t.exposeString('name'),\n\t\tservice: t.exposeString('service', { nullable: true }),\n\t\tstartMillis: t.exposeFloat('startMillis'),\n\t\tdurationMillis: t.exposeFloat('durationMillis'),\n\t\t// String: 'ok'/'error' kept as the raw wire contract.\n\t\tstatus: t.field({ type: 'String', resolve: (r) => r.status }),\n\t\t/** Flattened span attributes as a JSON string. */\n\t\tattributesJson: t.field({ type: 'String', resolve: (r) => fieldsJson(r.attributes) }),\n\t}),\n});\n\n// --- Observability filter inputs ---------------------------------------\n\nexport const LogFilterInput = builder.inputType('LogFilter', {\n\tfields: (t) => ({\n\t\tservices: t.stringList({ required: false }),\n\t\t/** Levels (trace/debug/info/warn/error/fatal). Strings, not an enum\n\t\t * (the level vocabulary is wider than the row-tail LogLevel enum). */\n\t\tlevels: t.stringList({ required: false }),\n\t\tsearch: t.string({ required: false }),\n\t\tsinceMillis: t.float({ required: false }),\n\t\tlimit: t.int({ required: false }),\n\t}),\n});\n\nexport const SpanFilterInput = builder.inputType('SpanFilter', {\n\tfields: (t) => ({\n\t\tservices: t.stringList({ required: false }),\n\t\t/** Statuses ('ok' / 'error'). Strings, not an enum. */\n\t\tstatuses: t.stringList({ required: false }),\n\t\tsearch: t.string({ required: false }),\n\t\tsinceMillis: t.float({ required: false }),\n\t\tlimit: t.int({ required: false }),\n\t}),\n});\n\n// --- StackState (source = the snapshot itself) -------------------------\nexport const StackState = builder.objectRef<SubscribableState>('StackState').implement({\n\tdescription: 'A full live projection snapshot.',\n\tfields: (t) => ({\n\t\tidentity: t.field({ type: Identity, resolve: (s) => s.identity }),\n\t\tcycle: t.field({ type: Cycle, resolve: (s) => s.cycle }),\n\t\tsummary: t.field({ type: HealthSummary, resolve: (s) => computeHealthSummary(s.rows) }),\n\t\tservices: t.field({\n\t\t\ttype: [Service],\n\t\t\tresolve: (s) => s.rows.map((row) => ({ row, snapshot: s })),\n\t\t}),\n\t\tendpoints: t.field({ type: [Endpoint], resolve: (s) => s.endpoints }),\n\t\taccounts: t.field({ type: [Account], resolve: (s) => s.accounts }),\n\t\tpackages: t.field({ type: [Package], resolve: (s) => s.packages }),\n\t\terrors: t.field({ type: [StackError], resolve: (s) => s.errors }),\n\t\tstackBuild: t.field({ type: [BuildEntry], resolve: (s) => s.stackBuild }),\n\t\tlastEvent: t.field({ type: LastEvent, nullable: true, resolve: (s) => s.lastEvent }),\n\t}),\n});\n"],"mappings":";;;;;;;;AA2EA,MAAa,wBAAwB,SAAkD;CACtF,IAAI,QAAQ;CACZ,IAAI,SAAS;CACb,IAAI,SAAS;CACb,IAAI,UAAU;AACd,MAAK,MAAM,OAAO,KACjB,SAAQ,IAAI,QAAZ;EACC,KAAK;EACL,KAAK;EACL,KAAK;AACJ,YAAS;AACT;EACD,KAAK;EACL,KAAK;AACJ,aAAU;AACV;EACD,KAAK;AACJ,aAAU;AACV;EACD,KAAK;AACJ,cAAW;AACX;;CAGH,MAAM,QAAQ,KAAK;AASnB,QAAO;EAAE;EAAO;EAAO;EAAQ;EAAQ;EAAS,QAP/C,SAAS,IACN,YACA,SAAS,IACR,W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AAG,EAAE;GAC3D,CAAC;EACF,WAAW,EAAE,MAAM;GAAE,MAAM,CAAC,SAAS;GAAE,UAAU,MAAM,EAAE;GAAW,CAAC;EACrE,UAAU,EAAE,MAAM;GAAE,MAAM,CAAC,QAAQ;GAAE,UAAU,MAAM,EAAE;GAAU,CAAC;EAClE,UAAU,EAAE,MAAM;GAAE,MAAM,CAAC,QAAQ;GAAE,UAAU,MAAM,EAAE;GAAU,CAAC;EAClE,QAAQ,EAAE,MAAM;GAAE,MAAM,CAAC,WAAW;GAAE,UAAU,MAAM,EAAE;GAAQ,CAAC;EACjE,YAAY,EAAE,MAAM;GAAE,MAAM,CAAC,WAAW;GAAE,UAAU,MAAM,EAAE;GAAY,CAAC;EACzE,WAAW,EAAE,MAAM;GAAE,MAAM;GAAW,UAAU;GAAM,UAAU,MAAM,EAAE;GAAW,CAAC;EACpF;CACD,CAAC"}
1
+ {"version":3,"file":"types.mjs","names":["HealthEnum"],"sources":["../../../../src/plugins/dashboard/schema/types.ts"],"sourcesContent":["// Dashboard object types — real Pothos object refs over the projection.\n//\n// Sources are the substrate projection shapes (Row, Endpoint,\n// AccountProjection, …). Service/Endpoint/Account/Package are registered\n// as relay Nodes via `builder.node`, with an opaque global id derived from\n// their natural key and a `loadOne` that re-finds them in the current\n// snapshot (read from the request's `ctx.state`) so the auto-generated\n// `node`/`nodes` queries resolve.\n//\n// `StackState` and `HealthSummary` are computed views over a snapshot —\n// `StackState` carries the snapshot itself as its source so nested\n// resolvers (e.g. Service.endpoints) can join against sibling arrays.\n\nimport { Effect, SubscriptionRef } from 'effect';\nimport { builder } from './builder.ts';\nimport {\n\tAccountScheme,\n\tAccountSource,\n\tDeepbookMode,\n\tErrorSeverity,\n\tFundingStatus,\n\tHealth as HealthEnum,\n\tLifecycleStatus,\n\tLogLevel,\n\tPackageKind,\n\tPluginRole,\n\tRowSection,\n\tWireProtocol,\n} from './enums.ts';\nimport type { Health } from './enums.ts';\nimport type { ControlPlaneSnapshotEntry } from '../../../substrate/runtime/control-plane/service.ts';\nimport type {\n\tDashboardCoinCap,\n\tDashboardDeepbookInfo,\n\tDashboardDeepbookPool,\n\tDashboardFundableCoin,\n\tDashboardPythFeed,\n\tDashboardSealInfo,\n\tDashboardSealKeyServer,\n} from '../domain.ts';\n// The surface-neutral health derivation lives in the TUI module\n// (`display-derivation.ts`) but is itself ink/react-free with type-only\n// substrate imports — so the web schema can reuse the SAME canonical\n// bucketing + named policies without acquiring any TUI/ink coupling.\nimport { deriveHealth, deriveStackViewModel } from '../../../surfaces/tui/display-derivation.ts';\nimport type { LogRecord } from '../../../substrate/runtime/observability/index.ts';\nimport type {\n\tAccountProjection,\n\tBuildEntry as BuildEntryShape,\n\tEndpoint as EndpointShape,\n\tLogTail as LogTailShape,\n\tPackageProjection,\n\tRow,\n\tStructuredError,\n\tSubscribableState,\n} from '../../../substrate/projection.ts';\n\n/** A snapshot-carrying service row. The snapshot lets `endpoints` join the\n * row's endpoint keys against the projection's endpoint array. */\nexport interface ServiceSource {\n\treadonly row: Row;\n\treadonly snapshot: SubscribableState;\n}\n\ntype FundingEntrySource = NonNullable<AccountProjection['funding']['entries']>[number];\n\nexport interface HealthSummarySource {\n\treadonly total: number;\n\treadonly ready: number;\n\treadonly active: number;\n\treadonly failed: number;\n\treadonly waiting: number;\n\treadonly health: Health;\n}\n\n/** Compute the stack health summary from the projection rows. Delegates to\n * the surface-neutral `deriveStackViewModel` (the single canonical\n * bucketing) + `deriveHealth(counts, 'web')` (the named web policy), then\n * folds the ViewModel's discrete `stoppedRows` into this adapter's `ready`\n * field — preserving the web GraphQL stopped→ready contract. The fold lives\n * HERE, in the web adapter, not in the shared ViewModel, so the TUI policy\n * is unaffected. `active` counts rows mid-flight (acquiring/stopping);\n * `waiting` counts rows that have not started (pending). Overall `health`\n * is `failed`→blocked, any-active→active, all-(ready|stopped) (with ≥1\n * row)→ready, otherwise empty. */\nexport const computeHealthSummary = (rows: ReadonlyArray<Row>): HealthSummarySource => {\n\tconst vm = deriveStackViewModel({\n\t\trows,\n\t\tendpoints: [],\n\t\taccounts: [],\n\t\tpackages: [],\n\t\terrors: [],\n\t});\n\tconst health: Health = deriveHealth(vm, 'web');\n\treturn {\n\t\ttotal: vm.total,\n\t\t// Web GraphQL contract: `stopped` rows count toward `ready`.\n\t\tready: vm.readyRows + vm.stoppedRows,\n\t\tactive: vm.activeRows,\n\t\tfailed: vm.failedRows,\n\t\twaiting: vm.waitingRows,\n\t\thealth,\n\t};\n};\n\nconst readSnapshot = (\n\tref: SubscriptionRef.SubscriptionRef<SubscribableState>,\n): Promise<SubscribableState> => Effect.runPromise(SubscriptionRef.get(ref));\n\n// --- Identity / Cycle ---------------------------------------------------\nexport const Identity = builder.objectRef<SubscribableState['identity']>('Identity').implement({\n\tdescription: 'Stack identity triple (app/stack/network).',\n\tfields: (t) => ({\n\t\tapp: t.exposeString('app'),\n\t\tstack: t.exposeString('stack'),\n\t\tnetwork: t.exposeString('network'),\n\t}),\n});\n\nexport const Cycle = builder.objectRef<SubscribableState['cycle']>('Cycle').implement({\n\tdescription: 'The current boot/restart cycle.',\n\tfields: (t) => ({\n\t\tid: t.exposeInt('id'),\n\t\tstartedAt: t.exposeFloat('startedAt'),\n\t\t// Carried as String: the raw union ('booting'|…|'shutting-down') is the\n\t\t// wire contract, and 'shutting-down' is not a valid GraphQL enum name.\n\t\tphase: t.field({ type: 'String', resolve: (c) => c.phase }),\n\t}),\n});\n\n// --- Endpoint (Node) ----------------------------------------------------\nexport const Endpoint = builder.objectRef<EndpointShape>('Endpoint');\nbuilder.node(Endpoint, {\n\tdescription: 'A routed endpoint contributed by a plugin.',\n\tid: { resolve: (e) => e.endpointKey },\n\tloadOne: async (id, ctx) => {\n\t\tconst snapshot = await readSnapshot(ctx.state);\n\t\treturn snapshot.endpoints.find((e) => e.endpointKey === id) ?? null;\n\t},\n\tfields: (t) => ({\n\t\tendpointKey: t.exposeString('endpointKey'),\n\t\tpluginKey: t.exposeString('pluginKey'),\n\t\tname: t.exposeString('name'),\n\t\turl: t.exposeString('url'),\n\t\tdisplayUrl: t.exposeString('displayUrl', { nullable: true }),\n\t\twireProtocol: t.field({ type: WireProtocol, resolve: (e) => e.wireProtocol }),\n\t\tregisteredAt: t.exposeFloat('registeredAt'),\n\t}),\n});\n\n// --- LogTail / StackError ----------------------------------------------\nexport const LogTail = builder.objectRef<LogTailShape>('LogTail').implement({\n\tdescription: 'The tail of a plugin log stream.',\n\tfields: (t) => ({\n\t\tlines: t.exposeStringList('lines'),\n\t\tlevel: t.field({ type: LogLevel, resolve: (l) => l.level }),\n\t\ttruncated: t.exposeBoolean('truncated'),\n\t}),\n});\n\nexport const StackError = builder.objectRef<StructuredError>('StackError').implement({\n\tdescription: 'A structured error reported by a plugin or the engine.',\n\tfields: (t) => ({\n\t\tat: t.exposeFloat('at'),\n\t\tpluginKey: t.exposeString('pluginKey', { nullable: true }),\n\t\ttag: t.exposeString('tag'),\n\t\tsummary: t.exposeString('summary'),\n\t\tchain: t.exposeStringList('chain'),\n\t\tseverity: t.field({ type: ErrorSeverity, resolve: (e) => e.severity }),\n\t}),\n});\n\n// --- Service (Node, wraps a Row) ---------------------------------------\nexport const Service = builder.objectRef<ServiceSource>('Service');\nbuilder.node(Service, {\n\tdescription: 'A visible plugin instance (one projection row).',\n\tid: { resolve: (s) => s.row.key },\n\tloadOne: async (id, ctx) => {\n\t\tconst snapshot = await readSnapshot(ctx.state);\n\t\tconst row = snapshot.rows.find((r) => r.key === id);\n\t\treturn row ? { row, snapshot } : null;\n\t},\n\tfields: (t) => ({\n\t\tkey: t.string({ resolve: (s) => s.row.key }),\n\t\trole: t.field({ type: PluginRole, resolve: (s) => s.row.role }),\n\t\tstatus: t.field({ type: LifecycleStatus, resolve: (s) => s.row.status }),\n\t\tsection: t.field({ type: RowSection, resolve: (s) => s.row.section }),\n\t\tendpointSection: t.field({ type: RowSection, resolve: (s) => s.row.endpointSection }),\n\t\tphase: t.string({ nullable: true, resolve: (s) => s.row.phase }),\n\t\tselectiveRestartHighlight: t.boolean({\n\t\t\tresolve: (s) => s.row.selectiveRestartHighlight,\n\t\t}),\n\t\tlastError: t.field({\n\t\t\ttype: StackError,\n\t\t\tnullable: true,\n\t\t\tresolve: (s) => s.row.lastError,\n\t\t}),\n\t\tlogTail: t.field({ type: LogTail, resolve: (s) => s.row.logTail }),\n\t\tendpoints: t.field({\n\t\t\ttype: [Endpoint],\n\t\t\tdescription: \"The row's endpoints, joined from the snapshot by key + pluginKey.\",\n\t\t\tresolve: (s) => {\n\t\t\t\tconst keys = new Set<string>(s.row.endpoints);\n\t\t\t\treturn s.snapshot.endpoints.filter(\n\t\t\t\t\t(e) => keys.has(e.endpointKey) && e.pluginKey === s.row.key,\n\t\t\t\t);\n\t\t\t},\n\t\t}),\n\t}),\n});\n\n// --- Funding ------------------------------------------------------------\nexport const FundingEntry = builder.objectRef<FundingEntrySource>('FundingEntry').implement({\n\tdescription: 'One coin-type funding outcome for an account.',\n\tfields: (t) => ({\n\t\tcoin: t.exposeString('coin'),\n\t\tfullCoinType: t.exposeString('fullCoinType'),\n\t\tamount: t.exposeString('amount'),\n\t\t// String for the same reason as Cycle.phase: 'already-satisfied' is not\n\t\t// a valid GraphQL enum name; the raw union string is the wire contract.\n\t\tstatus: t.field({ type: 'String', resolve: (e) => e.status }),\n\t}),\n});\n\nexport const AccountFunding = builder\n\t.objectRef<AccountProjection['funding']>('AccountFunding')\n\t.implement({\n\t\tdescription: 'Funding state for an account.',\n\t\tfields: (t) => ({\n\t\t\tstatus: t.field({ type: FundingStatus, resolve: (f) => f.status }),\n\t\t\tbalanceMist: t.exposeString('balanceMist', { nullable: true }),\n\t\t\trequestedMist: t.exposeString('requestedMist', { nullable: true }),\n\t\t\tentries: t.field({\n\t\t\t\ttype: [FundingEntry],\n\t\t\t\tresolve: (f) => f.entries ?? [],\n\t\t\t}),\n\t\t}),\n\t});\n\n// --- Account (Node) -----------------------------------------------------\nexport const Account = builder.objectRef<AccountProjection>('Account');\nbuilder.node(Account, {\n\tdescription: 'A managed or impersonated account.',\n\tid: { resolve: (a) => a.key },\n\tloadOne: async (id, ctx) => {\n\t\tconst snapshot = await readSnapshot(ctx.state);\n\t\treturn snapshot.accounts.find((a) => a.key === id) ?? null;\n\t},\n\tfields: (t) => ({\n\t\tkey: t.exposeString('key'),\n\t\trowKey: t.exposeString('rowKey', { nullable: true }),\n\t\tname: t.exposeString('name'),\n\t\taddress: t.exposeString('address', { nullable: true }),\n\t\tscheme: t.field({ type: AccountScheme, nullable: true, resolve: (a) => a.scheme }),\n\t\tsource: t.field({ type: AccountSource, nullable: true, resolve: (a) => a.source }),\n\t\twalletVisible: t.exposeBoolean('walletVisible'),\n\t\tupdatedAt: t.exposeFloat('updatedAt'),\n\t\tfunding: t.field({ type: AccountFunding, resolve: (a) => a.funding }),\n\t}),\n});\n\n// --- Package (Node) -----------------------------------------------------\nexport const Package = builder.objectRef<PackageProjection>('Package');\nbuilder.node(Package, {\n\tdescription: 'A local or known on-chain package.',\n\tid: { resolve: (p) => p.key },\n\tloadOne: async (id, ctx) => {\n\t\tconst snapshot = await readSnapshot(ctx.state);\n\t\treturn snapshot.packages.find((p) => p.key === id) ?? null;\n\t},\n\tfields: (t) => ({\n\t\tkey: t.exposeString('key'),\n\t\trowKey: t.exposeString('rowKey', { nullable: true }),\n\t\tname: t.exposeString('name'),\n\t\tkind: t.field({ type: PackageKind, resolve: (p) => p.kind }),\n\t\tpackageId: t.exposeString('packageId'),\n\t\tupgradeCapId: t.exposeString('upgradeCapId', { nullable: true }),\n\t\tmvrPlaceholder: t.exposeString('mvrPlaceholder'),\n\t\tsourcePath: t.exposeString('sourcePath', { nullable: true }),\n\t\tupdatedAt: t.exposeFloat('updatedAt'),\n\t}),\n});\n\n// --- BuildEntry / LastEvent --------------------------------------------\nexport const BuildEntry = builder.objectRef<BuildEntryShape>('BuildEntry').implement({\n\tdescription: 'A stack build progress entry.',\n\tfields: (t) => ({\n\t\tpluginKey: t.exposeString('pluginKey', { nullable: true }),\n\t\tphase: t.exposeString('phase'),\n\t\tprogress: t.exposeString('progress'),\n\t\tstartedAt: t.exposeFloat('startedAt'),\n\t}),\n});\n\nexport const LastEvent = builder.objectRef<SubscribableState['lastEvent']>('LastEvent').implement({\n\tdescription: 'The most recent event seq/timestamp the engine emitted.',\n\tfields: (t) => ({\n\t\tseq: t.exposeInt('seq'),\n\t\tat: t.exposeFloat('at'),\n\t}),\n});\n\n// --- HealthSummary ------------------------------------------------------\nexport const HealthSummary = builder.objectRef<HealthSummarySource>('HealthSummary').implement({\n\tdescription: 'Derived stack health counts.',\n\tfields: (t) => ({\n\t\ttotal: t.exposeInt('total'),\n\t\tready: t.exposeInt('ready'),\n\t\tactive: t.exposeInt('active'),\n\t\tfailed: t.exposeInt('failed'),\n\t\twaiting: t.exposeInt('waiting'),\n\t\thealth: t.field({ type: HealthEnum, resolve: (h) => h.health }),\n\t}),\n});\n\n// --- Plugin-domain object types ----------------------------------------\n//\n// Sources are the app-agnostic `ControlPlane*` shapes the supervisor\n// populates from resolved plugin values. These cover only what the browser\n// cannot reach directly: codegen capability ids, in-process plugin state,\n// and the snapshot catalog. Numeric counts/sizes are carried as Float\n// (GraphQL Int caps at 2^31).\n\nexport const SnapshotEntry = builder\n\t.objectRef<ControlPlaneSnapshotEntry>('SnapshotEntry')\n\t.implement({\n\t\tdescription: 'A snapshot catalog entry (orchestrator `list`).',\n\t\tfields: (t) => ({\n\t\t\tid: t.exposeString('id'),\n\t\t\tlabel: t.exposeString('label', { nullable: true }),\n\t\t\tcreatedAt: t.exposeFloat('createdAt', { nullable: true }),\n\t\t\tapp: t.exposeString('app', { nullable: true }),\n\t\t\tstack: t.exposeString('stack', { nullable: true }),\n\t\t\tnetwork: t.exposeString('network', { nullable: true }),\n\t\t\tsnapshotGraphInputId: t.exposeString('snapshotGraphInputId', { nullable: true }),\n\t\t\tcurrentGraphInputId: t.exposeString('currentGraphInputId', { nullable: true }),\n\t\t\tgraphInputStatus: t.exposeString('graphInputStatus'),\n\t\t\tgraphInputWarning: t.exposeString('graphInputWarning', { nullable: true }),\n\t\t\tparticipants: t.exposeStringList('participants'),\n\t\t\tcontainerCount: t.exposeInt('containerCount'),\n\t\t\tsubtreeCount: t.exposeInt('subtreeCount'),\n\t\t\tcorrupt: t.exposeBoolean('corrupt'),\n\t\t}),\n\t});\n\nexport const DeepbookPool = builder.objectRef<DashboardDeepbookPool>('DeepbookPool').implement({\n\tdescription: 'A DeepBook pool object id + coin types (prices are chain-direct).',\n\tfields: (t) => ({\n\t\tname: t.exposeString('name'),\n\t\tpoolId: t.exposeString('poolId'),\n\t\tbaseCoinType: t.exposeString('baseCoinType'),\n\t\tquoteCoinType: t.exposeString('quoteCoinType'),\n\t}),\n});\n\nexport const PythPriceFeed = builder.objectRef<DashboardPythFeed>('PythPriceFeed').implement({\n\tdescription:\n\t\t'A Pyth price feed seeded inside DeepBook at boot. `price`/`expo` are FIXED ' +\n\t\t'boot-time mock values (static, not a live quote).',\n\tfields: (t) => ({\n\t\tsymbol: t.exposeString('symbol'),\n\t\tpriceInfoObjectId: t.exposeString('priceInfoObjectId'),\n\t\t// String (not Int/Float): the boot-time mock price is a signed integer in\n\t\t// feed-native scale carried as a string to survive the wire intact.\n\t\tprice: t.exposeString('price'),\n\t\texpo: t.exposeInt('expo'),\n\t}),\n});\n\nexport const DeepbookInfo = builder.objectRef<DashboardDeepbookInfo>('DeepbookInfo').implement({\n\tdescription:\n\t\t'A DeepBook deployment: registry/admin/pool ids + seed-liquidity state + Pyth feeds.',\n\tfields: (t) => ({\n\t\tpluginKey: t.exposeString('pluginKey'),\n\t\tname: t.exposeString('name'),\n\t\tmode: t.field({ type: DeepbookMode, resolve: (d) => d.mode }),\n\t\tnetwork: t.exposeString('network'),\n\t\tpackageId: t.exposeString('packageId'),\n\t\tregistryId: t.exposeString('registryId'),\n\t\tadminCapId: t.exposeString('adminCapId', { nullable: true }),\n\t\tdeepTreasuryId: t.exposeString('deepTreasuryId', { nullable: true }),\n\t\tpools: t.field({ type: [DeepbookPool], resolve: (d) => d.pools }),\n\t\t// Pyth price feeds seeded inside this DeepBook deployment (boot-time mocks).\n\t\tpythFeeds: t.field({ type: [PythPriceFeed], resolve: (d) => d.pythFeeds }),\n\t\t// `true` when one or more pools placed seed orders at boot (NOT a running\n\t\t// market-maker process).\n\t\thasSeedLiquidity: t.exposeBoolean('hasSeedLiquidity'),\n\t\tserverUrl: t.exposeString('serverUrl', { nullable: true }),\n\t\tindexerUrl: t.exposeString('indexerUrl', { nullable: true }),\n\t\t// Fail-loud: non-null when a required field failed to narrow off the\n\t\t// opaque resolved value (schema drift surfaced, not silently degraded).\n\t\tnarrowingFault: t.exposeString('narrowingFault', { nullable: true }),\n\t}),\n});\n\nexport const SealKeyServer = builder.objectRef<DashboardSealKeyServer>('SealKeyServer').implement({\n\tdescription: 'One Seal key-server config (objectId + weight).',\n\tfields: (t) => ({\n\t\tobjectId: t.exposeString('objectId'),\n\t\tweight: t.exposeInt('weight'),\n\t}),\n});\n\nexport const SealInfo = builder.objectRef<DashboardSealInfo>('SealInfo').implement({\n\tdescription: 'A Seal key-server deployment (objectId/threshold/mode/keyServers).',\n\tfields: (t) => ({\n\t\tpluginKey: t.exposeString('pluginKey'),\n\t\t// String, not enum: 'local-keygen'/'fork-known' are illegal GraphQL\n\t\t// enum value names (hyphens). The raw union string is the wire contract.\n\t\tmode: t.field({ type: 'String', resolve: (s) => s.mode }),\n\t\tobjectId: t.exposeString('objectId'),\n\t\tkeyServerUrl: t.exposeString('keyServerUrl'),\n\t\tkeyServers: t.field({ type: [SealKeyServer], resolve: (s) => s.keyServers }),\n\t\tthreshold: t.exposeInt('threshold'),\n\t\t// Fail-loud: non-null when a required field failed to narrow.\n\t\tnarrowingFault: t.exposeString('narrowingFault', { nullable: true }),\n\t}),\n});\n\nexport const CoinCap = builder.objectRef<DashboardCoinCap>('CoinCap').implement({\n\tdescription: \"A coin's treasury-cap id (drives Mint) + addressing facts.\",\n\tfields: (t) => ({\n\t\tpluginKey: t.exposeString('pluginKey'),\n\t\tsymbol: t.exposeString('symbol', { nullable: true }),\n\t\tfullCoinType: t.exposeString('fullCoinType'),\n\t\tdecimals: t.exposeInt('decimals'),\n\t\t// String, not enum: 'on-chain' is an illegal GraphQL enum value name.\n\t\tsource: t.field({ type: 'String', resolve: (c) => c.source }),\n\t\ttreasuryCapId: t.exposeString('treasuryCapId', { nullable: true }),\n\t\tpackageId: t.exposeString('packageId', { nullable: true }),\n\t\t// Fail-loud: non-null when a required field failed to narrow.\n\t\tnarrowingFault: t.exposeString('narrowingFault', { nullable: true }),\n\t}),\n});\n\nexport const FundableCoin = builder.objectRef<DashboardFundableCoin>('FundableCoin').implement({\n\tdescription:\n\t\t'A coin the dashboard faucet can fund right now. SUI is fixed-amount; ' +\n\t\t'WAL/DEEP honor an amount and require the recipient to be a resolved account.',\n\tfields: (t) => ({\n\t\tsymbol: t.exposeString('symbol'),\n\t\tcoinType: t.exposeString('coinType'),\n\t\t/** True when the underlying strategy honors a caller-supplied amount\n\t\t * (WAL/DEEP swaps). SUI is fixed-amount (false). */\n\t\thonorsAmount: t.exposeBoolean('honorsAmount'),\n\t\t/** True when funding requires the recipient to BE a resolved account\n\t\t * (the swap spends that account's own SUI). SUI is false. */\n\t\trequiresAccountSigner: t.exposeBoolean('requiresAccountSigner'),\n\t}),\n});\n\n// --- Observability: LogRecord ------------------------------------------\n//\n// Source is the substrate observability log ring records. `level` is\n// carried as String, not a GraphQL enum: the log level vocabulary\n// (trace/debug/info/warn/error/fatal) is wider than the projection's\n// row-tail LogLevel enum, and keeping it String decouples the queryable\n// surface from the row-tail enum (same hyphen/illegal-enum-safe String\n// pattern used by SealMode/CoinSource above). Structured `fields` are\n// serialized to a JSON string — the schema has no JSON scalar and the\n// console renders them as a detail blob.\n\nconst fieldsJson = (fields: Readonly<Record<string, unknown>>): string => {\n\ttry {\n\t\treturn JSON.stringify(fields);\n\t} catch {\n\t\treturn '{}';\n\t}\n};\n\nexport const LogRecordType = builder.objectRef<LogRecord>('LogRecord').implement({\n\tdescription:\n\t\t'One cross-service log record (queryable Console \"Logs\" tab). Fed off the same logger path as the per-row projection tail.',\n\tfields: (t) => ({\n\t\tseq: t.exposeFloat('seq'),\n\t\ttimestampMillis: t.exposeFloat('timestampMillis'),\n\t\t// String: wider than the row-tail LogLevel enum (trace/debug/fatal).\n\t\tlevel: t.field({ type: 'String', resolve: (r) => r.level }),\n\t\tservice: t.exposeString('service'),\n\t\tmessage: t.exposeString('message'),\n\t\t/** Structured fields as a JSON string (no JSON scalar in this schema). */\n\t\tfieldsJson: t.field({ type: 'String', resolve: (r) => fieldsJson(r.fields) }),\n\t}),\n});\n\n// --- Observability filter inputs ---------------------------------------\n\nexport const LogFilterInput = builder.inputType('LogFilter', {\n\tfields: (t) => ({\n\t\tservices: t.stringList({ required: false }),\n\t\t/** Levels (trace/debug/info/warn/error/fatal). Strings, not an enum\n\t\t * (the level vocabulary is wider than the row-tail LogLevel enum). */\n\t\tlevels: t.stringList({ required: false }),\n\t\tsearch: t.string({ required: false }),\n\t\tsinceMillis: t.float({ required: false }),\n\t\tlimit: t.int({ required: false }),\n\t}),\n});\n\n// --- StackState (source = the snapshot itself) -------------------------\nexport const StackState = builder.objectRef<SubscribableState>('StackState').implement({\n\tdescription: 'A full live projection snapshot.',\n\tfields: (t) => ({\n\t\tidentity: t.field({ type: Identity, resolve: (s) => s.identity }),\n\t\tcycle: t.field({ type: Cycle, resolve: (s) => s.cycle }),\n\t\tsummary: t.field({ type: HealthSummary, resolve: (s) => computeHealthSummary(s.rows) }),\n\t\tservices: t.field({\n\t\t\ttype: [Service],\n\t\t\tresolve: (s) => s.rows.map((row) => ({ row, snapshot: s })),\n\t\t}),\n\t\tendpoints: t.field({ type: [Endpoint], resolve: (s) => s.endpoints }),\n\t\taccounts: t.field({ type: [Account], resolve: (s) => s.accounts }),\n\t\tpackages: t.field({ type: [Package], resolve: (s) => s.packages }),\n\t\terrors: t.field({ type: [StackError], resolve: (s) => s.errors }),\n\t\tstackBuild: t.field({ type: [BuildEntry], resolve: (s) => s.stackBuild }),\n\t\tlastEvent: t.field({ type: LastEvent, nullable: true, resolve: (s) => s.lastEvent }),\n\t}),\n});\n"],"mappings":";;;;;;;;;;;;;;;AAqFA,MAAa,wBAAwB,SAAkD;CACtF,MAAM,KAAK,qBAAqB;EAC/B;EACA,WAAW,CAAC;EACZ,UAAU,CAAC;EACX,UAAU,CAAC;EACX,QAAQ,CAAC;CACV,CAAC;CACD,MAAM,SAAiB,aAAa,IAAI,KAAK;CAC7C,OAAO;EACN,OAAO,GAAG;EAEV,OAAO,GAAG,YAAY,GAAG;EACzB,QAAQ,GAAG;EACX,QAAQ,GAAG;EACX,SAAS,GAAG;EACZ;CACD;AACD;AAEA,MAAM,gBACL,QACgC,OAAO,WAAW,gBAAgB,IAAI,GAAG,CAAC;AAG3E,MAAa,WAAW,QAAQ,UAAyC,UAAU,CAAC,CAAC,UAAU;CAC9F,aAAa;CACb,SAAS,OAAO;EACf,KAAK,EAAE,aAAa,KAAK;EACzB,OAAO,EAAE,aAAa,OAAO;EAC7B,SAAS,EAAE,aAAa,SAAS;CAClC;AACD,CAAC;AAED,MAAa,QAAQ,QAAQ,UAAsC,OAAO,CAAC,CAAC,UAAU;CACrF,aAAa;CACb,SAAS,OAAO;EACf,IAAI,EAAE,UAAU,IAAI;EACpB,WAAW,EAAE,YAAY,WAAW;EAGpC,OAAO,EAAE,MAAM;GAAE,MAAM;GAAU,UAAU,MAAM,EAAE;EAAM,CAAC;CAC3D;AACD,CAAC;AAGD,MAAa,WAAW,QAAQ,UAAyB,UAAU;AACnE,QAAQ,KAAK,UAAU;CACtB,aAAa;CACb,IAAI,EAAE,UAAU,MAAM,EAAE,YAAY;CACpC,SAAS,OAAO,IAAI,QAAQ;EAE3B,QAAO,MADgB,aAAa,IAAI,KAAK,EAAA,CAC7B,UAAU,MAAM,MAAM,EAAE,gBAAgB,EAAE,KAAK;CAChE;CACA,SAAS,OAAO;EACf,aAAa,EAAE,aAA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E;EAAS,CAAC;EACjE,QAAQ,EAAE,MAAM;GAAE,MAAM,CAAC,UAAU;GAAG,UAAU,MAAM,EAAE;EAAO,CAAC;EAChE,YAAY,EAAE,MAAM;GAAE,MAAM,CAAC,UAAU;GAAG,UAAU,MAAM,EAAE;EAAW,CAAC;EACxE,WAAW,EAAE,MAAM;GAAE,MAAM;GAAW,UAAU;GAAM,UAAU,MAAM,EAAE;EAAU,CAAC;CACpF;AACD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"schema.mjs","names":[],"sources":["../../../src/plugins/dashboard/schema.ts"],"sourcesContent":["// Dashboard GraphQL schema (Pothos, code-first) — assembly entry.\n//\n// One typed schema covers the control plane:\n// - queries: `state` (full projection snapshot, real object types),\n// relay node/connection access, and a `ping` probe.\n// - mutations: map to `EngineCommand`s (restart, snapshot, apply, …),\n// each returning a typed `CommandResult`.\n// - subscriptions: `state` streams projection changes over SSE (yoga).\n//\n// The schema is defined at module level across `./schema/{builder,enums,\n// types,root}.ts`; importing those modules registers their enums/types/root\n// fields on the shared `builder`. The package is marked `sideEffects: true`, so\n// these registration imports are preserved through the bundler. Per-request\n// dependencies (the `state` ref + `publishCommand`) flow through the GraphQL\n// context (`DashboardContext`).\n\nimport { builder } from './schema/builder.ts';\nimport './schema/enums.ts';\nimport './schema/types.ts';\nimport './schema/root.ts';\n\nexport type { DashboardContext } from './schema/builder.ts';\n\n/** The dashboard control-plane GraphQL schema. */\nexport const dashboardSchema = builder.toSchema();\n"],"mappings":";;;;;;AAwBA,MAAa,kBAAkB,QAAQ,UAAU"}
1
+ {"version":3,"file":"schema.mjs","names":[],"sources":["../../../src/plugins/dashboard/schema.ts"],"sourcesContent":["// Dashboard GraphQL schema (Pothos, code-first) — assembly entry.\n//\n// One typed schema covers the control plane:\n// - queries: `state` (full projection snapshot, real object types),\n// relay node/connection access, and a `ping` probe.\n// - mutations: map to `EngineCommand`s (restart, snapshot, apply, …),\n// each returning a typed `CommandResult`.\n// - subscriptions: `state` streams projection changes over SSE (yoga).\n//\n// The schema is defined at module level across `./schema/{builder,enums,\n// types,root}.ts`; importing those modules registers their enums/types/root\n// fields on the shared `builder`. The package is marked `sideEffects: true`, so\n// these registration imports are preserved through the bundler. Per-request\n// dependencies (the `state` ref + `publishCommand`) flow through the GraphQL\n// context (`DashboardContext`).\n\nimport { builder } from './schema/builder.ts';\nimport './schema/enums.ts';\nimport './schema/types.ts';\nimport './schema/root.ts';\n\nexport type { DashboardContext } from './schema/builder.ts';\n\n/** The dashboard control-plane GraphQL schema. */\nexport const dashboardSchema = builder.toSchema();\n"],"mappings":";;;;;;AAwBA,MAAa,kBAAkB,QAAQ,SAAS"}
@@ -1 +1 @@
1
- {"version":3,"file":"server.mjs","names":[],"sources":["../../../src/plugins/dashboard/server.ts"],"sourcesContent":["// Dashboard HTTP listener.\n//\n// graphql-yoga hosts the Pothos schema at `/graphql` (with GraphiQL for\n// manual testing and SSE for subscriptions). Every other path serves the\n// built React SPA bundled with this package under `dashboard-ui/` (produced\n// by `pnpm build`'s `build:dashboard-ui` step and shipped via the package\n// `files` array). The listener is handed to `listenScopedHttpServer`, which\n// owns bind + graceful close.\n//\n// The SPA is served as static files with a client-side-routing fallback to\n// `index.html`. When the UI has not been built (the bundled dir is absent),\n// the listener logs a warning once and falls back to the inline test page so\n// `/graphql` and manual API checks keep working.\n\nimport { existsSync, readFileSync, statSync } from 'node:fs';\nimport { join, normalize, resolve, sep } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { createYoga, type CORSOptions } from 'graphql-yoga';\nimport { dashboardSchema, type DashboardContext } from './schema.ts';\nimport { checkOrigin, type OriginPolicy } from './origin-policy.ts';\nimport type { HttpRequestListener } from '../../substrate/runtime/scoped-http-server.ts';\n\nexport interface DashboardListenerOptions {\n\t/** Per-request control-plane context (the `state` ref + `publishCommand`).\n\t * The dashboard is single-tenant, so this is constant for the server's\n\t * lifetime and handed to yoga as a static `context` factory. */\n\treadonly context: DashboardContext;\n\t/** Stack-scoped origin allowlist (see `origin-policy.ts`). Gates the CORS\n\t * reflection on `/graphql`: an Origin in the allowlist is echoed back; a\n\t * missing Origin (server-side / readiness probe) gets a normal response\n\t * with no CORS headers; any other Origin is denied (no `Access-Control-\n\t * Allow-Origin` → the browser blocks the cross-origin read/write). */\n\treadonly originPolicy: OriginPolicy;\n\t/** GraphQL path. Defaults to `/graphql`. */\n\treadonly graphqlEndpoint?: string;\n\t/** Override the bundled UI assets dir (mainly for tests). Defaults to the\n\t * package's `dashboard-ui/` directory resolved from this module. */\n\treadonly assetsDir?: string;\n}\n\n// The built SPA is copied into `<package root>/dashboard-ui/`. This module\n// compiles to `<root>/dist/plugins/dashboard/server.mjs`; the source lives at\n// `<root>/src/plugins/dashboard/server.ts`. Both are three levels below the\n// package root, so the same relative path resolves the bundled dir whether\n// running from `dist/` (installed dependency or repo build) or `src/`\n// (`--experimental-strip-types`).\nconst DASHBOARD_UI_DIR = fileURLToPath(new URL('../../../dashboard-ui', import.meta.url));\n\nconst CONTENT_TYPES: Record<string, string> = {\n\t'.html': 'text/html; charset=utf-8',\n\t'.js': 'text/javascript; charset=utf-8',\n\t'.mjs': 'text/javascript; charset=utf-8',\n\t'.css': 'text/css; charset=utf-8',\n\t'.json': 'application/json; charset=utf-8',\n\t'.map': 'application/json; charset=utf-8',\n\t'.svg': 'image/svg+xml',\n\t'.png': 'image/png',\n\t'.jpg': 'image/jpeg',\n\t'.jpeg': 'image/jpeg',\n\t'.gif': 'image/gif',\n\t'.webp': 'image/webp',\n\t'.ico': 'image/x-icon',\n\t'.woff': 'font/woff',\n\t'.woff2': 'font/woff2',\n\t'.ttf': 'font/ttf',\n\t'.txt': 'text/plain; charset=utf-8',\n\t'.wasm': 'application/wasm',\n};\n\nconst contentTypeFor = (path: string): string => {\n\tconst dot = path.lastIndexOf('.');\n\tconst ext = dot === -1 ? '' : path.slice(dot).toLowerCase();\n\treturn CONTENT_TYPES[ext] ?? 'application/octet-stream';\n};\n\nconst testPage = (graphqlEndpoint: string): string => `<!doctype html>\n<html lang=\"en\">\n<head><meta charset=\"utf-8\" /><title>devstack dashboard — API test</title>\n<style>body{font:14px/1.5 ui-monospace,monospace;background:#05080f;color:#e6eefb;margin:0;padding:24px}\nbutton{font:inherit;background:#1b2740;color:#e6eefb;border:1px solid #2c3c5e;border-radius:6px;padding:6px 12px;cursor:pointer}\npre{background:#0b1322;border:1px solid #1b2740;border-radius:8px;padding:16px;overflow:auto;max-height:70vh}\na{color:#69b7ff}</style></head>\n<body>\n<h1>devstack dashboard — API test</h1>\n<p>The bundled UI was not found (run <code>pnpm build</code> to bundle it). Falling back to the API test page.</p>\n<p>GraphiQL: <a href=\"${graphqlEndpoint}\">${graphqlEndpoint}</a></p>\n<p><button id=\"load\">query { state }</button> <button id=\"restart\">mutation { restart }</button></p>\n<pre id=\"out\">…</pre>\n<script type=\"module\">\nconst ep = ${JSON.stringify(graphqlEndpoint)};\nconst out = document.getElementById('out');\nasync function gql(query){\n const r = await fetch(ep,{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify({query})});\n return r.json();\n}\ndocument.getElementById('load').onclick = async () => {\n out.textContent = JSON.stringify(await gql('{ ping state { cycle { id phase } summary { total ready failed health } services { key status } } }'), null, 2);\n};\ndocument.getElementById('restart').onclick = async () => {\n out.textContent = JSON.stringify(await gql('mutation { restart { ok command } }'), null, 2);\n};\n</script>\n</body></html>`;\n\n/** CORS policy for the control plane, driven by the stack-scoped origin\n * allowlist (`origin-policy.ts`).\n *\n * The GraphQL schema exposes DESTRUCTIVE mutations (wipe/prune/shutdown/\n * restart/restoreSnapshot/deleteSnapshot/mint). Since JSON POSTs are\n * preflighted, a correct CORS policy is a real defense: it stops any\n * site the user happens to be visiting — INCLUDING a sibling devstack\n * stack on another `*.localhost` host — from driving a cross-origin\n * request against this stack's dashboard.\n *\n * We reflect the request `Origin` back ONLY when it is in THIS stack's\n * allowlist (the dashboard's own router-fronted origin + direct loopback\n * origins + caller-supplied `allowedOrigins`). The same-origin bundled SPA\n * is served from the routed origin, so its `Origin` is in the allowlist and\n * works. Every other origin — including a bare `*.localhost` from another\n * stack — is denied (no `Access-Control-Allow-Origin` → the browser blocks\n * the cross-origin read/write). A missing Origin (server-side tooling, the\n * readiness probe) yields no CORS headers but a normal response.\n * `credentials` stays `false`. */\nconst corsOptionsFor =\n\t(policy: OriginPolicy) =>\n\t(request: Request): CORSOptions => {\n\t\tconst origin = request.headers.get('origin');\n\t\t// No Origin (same-origin / non-CORS request) or a forbidden Origin →\n\t\t// no CORS headers. `false` denies; CORS never alters the status, so a\n\t\t// no-Origin server-side request still gets its normal 200 response.\n\t\tif (checkOrigin(policy, origin) !== 'ok') return false;\n\t\t// Reflect this exact origin (single-element array → echoed verbatim).\n\t\treturn { origin: [origin as string], credentials: false };\n\t};\n\n/** Strip query/hash and decode a request path into a relative file path. */\nconst requestPathname = (url: string): string => {\n\tconst noQuery = url.split(/[?#]/, 1)[0] ?? '/';\n\ttry {\n\t\treturn decodeURIComponent(noQuery);\n\t} catch {\n\t\treturn noQuery;\n\t}\n};\n\n/** Resolve a request pathname to an absolute file inside `root`, returning\n * `undefined` for traversal attempts or paths that escape `root`.\n *\n * Traversal is REJECTED, not re-rooted: if the normalized path still bears\n * a `..` segment we bail rather than stripping it and serving a different\n * file than was requested. The `startsWith(root)` guard then closes any\n * residual escape (e.g. a sibling dir sharing a prefix). */\nconst safeResolve = (root: string, pathname: string): string | undefined => {\n\tconst normalized = normalize(pathname);\n\t// A surviving `..` segment means the request tried to climb out of `root`;\n\t// reject rather than re-root. Cover both separators and bare/trailing forms.\n\tif (\n\t\tnormalized === '..' ||\n\t\tnormalized.startsWith(`..${sep}`) ||\n\t\tnormalized.startsWith('../') ||\n\t\tnormalized.includes(`${sep}..${sep}`) ||\n\t\tnormalized.includes('/../') ||\n\t\tnormalized.endsWith(`${sep}..`) ||\n\t\tnormalized.endsWith('/..')\n\t) {\n\t\treturn undefined;\n\t}\n\tconst rel = normalized.replace(/^[/\\\\]+/, '');\n\tconst abs = resolve(root, rel);\n\tconst rootWithSep = root.endsWith(sep) ? root : root + sep;\n\tif (abs !== root && !abs.startsWith(rootWithSep)) return undefined;\n\treturn abs;\n};\n\n/** Build a Node request listener routing `/graphql` to yoga and everything\n * else to the bundled SPA (with an index.html fallback for client routing).\n * Falls back to the inline API test page when the UI bundle is absent. */\nexport const makeDashboardListener = (opts: DashboardListenerOptions): HttpRequestListener => {\n\tconst graphqlEndpoint = opts.graphqlEndpoint ?? '/graphql';\n\tconst assetsDir = opts.assetsDir ?? DASHBOARD_UI_DIR;\n\tconst indexHtmlPath = join(assetsDir, 'index.html');\n\tconst uiAvailable = existsSync(indexHtmlPath);\n\n\tif (!uiAvailable) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\n\t\t\t`[devstack:dashboard] bundled UI not found at ${assetsDir}; serving the API test page only. Run \\`pnpm build\\` (or \\`pnpm --filter @mysten-incubation/devstack build:dashboard-ui\\`) to bundle the dashboard.`,\n\t\t);\n\t}\n\n\tconst yoga = createYoga({\n\t\tschema: dashboardSchema,\n\t\tcontext: () => opts.context,\n\t\tgraphqlEndpoint,\n\t\tgraphiql: true,\n\t\tlandingPage: false,\n\t\t// Stack-scoped origin allowlist (see `corsOptionsFor` / `origin-policy.ts`):\n\t\t// reflect only origins in THIS stack's allowlist so the same-origin bundled\n\t\t// SPA works while arbitrary sites — including a sibling stack on another\n\t\t// `*.localhost` host — are denied cross-origin access to the destructive\n\t\t// control-plane mutations.\n\t\tcors: corsOptionsFor(opts.originPolicy),\n\t});\n\tconst fallbackPage = testPage(graphqlEndpoint);\n\n\t// Reserve `/graphql` by DECODED pathname so encoded variants\n\t// (`/graphql%2F…`, `/%67raphql`) route to yoga instead of leaking into the\n\t// static/SPA path. `pathname` is already query/hash-stripped + decoded.\n\tconst isGraphql = (pathname: string): boolean =>\n\t\tpathname === graphqlEndpoint || pathname.startsWith(`${graphqlEndpoint}/`);\n\n\tconst sendFile = (res: Parameters<HttpRequestListener>[1], absPath: string): boolean => {\n\t\ttry {\n\t\t\tif (!statSync(absPath).isFile()) return false;\n\t\t\tconst body = readFileSync(absPath);\n\t\t\tres.statusCode = 200;\n\t\t\tres.setHeader('content-type', contentTypeFor(absPath));\n\t\t\tres.end(body);\n\t\t\treturn true;\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t};\n\n\treturn (req, res) => {\n\t\tconst url = req.url ?? '/';\n\t\tconst pathname = requestPathname(url);\n\t\tif (isGraphql(pathname)) {\n\t\t\tvoid yoga(req, res);\n\t\t\treturn;\n\t\t}\n\n\t\t// No bundled UI: keep the API test page as an honest fallback.\n\t\tif (!uiAvailable) {\n\t\t\tres.statusCode = 200;\n\t\t\tres.setHeader('content-type', 'text/html; charset=utf-8');\n\t\t\tres.end(fallbackPage);\n\t\t\treturn;\n\t\t}\n\n\t\tconst abs = pathname === '/' ? undefined : safeResolve(assetsDir, pathname);\n\n\t\t// Serve a real static asset when one matches the request path.\n\t\tif (abs !== undefined && sendFile(res, abs)) return;\n\n\t\t// SPA fallback: any other path (client-side route) gets index.html so\n\t\t// the React router can take over.\n\t\tif (sendFile(res, indexHtmlPath)) return;\n\n\t\tres.statusCode = 404;\n\t\tres.setHeader('content-type', 'text/plain; charset=utf-8');\n\t\tres.end('not found');\n\t};\n};\n"],"mappings":";;;;;;;AA8CA,MAAM,mBAAmB,cAAc,IAAI,IAAI,yBAAyB,OAAO,KAAK,IAAI,CAAC;AAEzF,MAAM,gBAAwC;CAC7C,SAAS;CACT,OAAO;CACP,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,QAAQ;CACR,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,SAAS;CACT,UAAU;CACV,QAAQ;CACR,QAAQ;CACR,SAAS;CACT;AAED,MAAM,kBAAkB,SAAyB;CAChD,MAAM,MAAM,KAAK,YAAY,IAAI;AAEjC,QAAO,cADK,QAAQ,KAAK,KAAK,KAAK,MAAM,IA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ACvB,QAAQ;EACR,eAAe,KAAK;EACpB;EACA,UAAU;EACV,aAAa;EAMb,MAAM,eAAe,KAAK,aAAa;EACvC,CAAC;CACF,MAAM,eAAe,SAAS,gBAAgB;CAK9C,MAAM,aAAa,aAClB,aAAa,mBAAmB,SAAS,WAAW,GAAG,gBAAgB,GAAG;CAE3E,MAAM,YAAY,KAAyC,YAA6B;AACvF,MAAI;AACH,OAAI,CAAC,SAAS,QAAQ,CAAC,QAAQ,CAAE,QAAO;GACxC,MAAM,OAAO,aAAa,QAAQ;AAClC,OAAI,aAAa;AACjB,OAAI,UAAU,gBAAgB,eAAe,QAAQ,CAAC;AACtD,OAAI,IAAI,KAAK;AACb,UAAO;UACA;AACP,UAAO;;;AAIT,SAAQ,KAAK,QAAQ;EAEpB,MAAM,WAAW,gBADL,IAAI,OAAO,IACc;AACrC,MAAI,UAAU,SAAS,EAAE;AACnB,QAAK,KAAK,IAAI;AACnB;;AAID,MAAI,CAAC,aAAa;AACjB,OAAI,aAAa;AACjB,OAAI,UAAU,gBAAgB,2BAA2B;AACzD,OAAI,IAAI,aAAa;AACrB;;EAGD,MAAM,MAAM,aAAa,MAAM,KAAA,IAAY,YAAY,WAAW,SAAS;AAG3E,MAAI,QAAQ,KAAA,KAAa,SAAS,KAAK,IAAI,CAAE;AAI7C,MAAI,SAAS,KAAK,cAAc,CAAE;AAElC,MAAI,aAAa;AACjB,MAAI,UAAU,gBAAgB,4BAA4B;AAC1D,MAAI,IAAI,YAAY"}
1
+ {"version":3,"file":"server.mjs","names":[],"sources":["../../../src/plugins/dashboard/server.ts"],"sourcesContent":["// Dashboard HTTP listener.\n//\n// graphql-yoga hosts the Pothos schema at `/graphql` (with GraphiQL for\n// manual testing and SSE for subscriptions). Every other path serves the\n// built React SPA bundled with this package under `dashboard-ui/` (produced\n// by `pnpm build`'s `build:dashboard-ui` step and shipped via the package\n// `files` array). The listener is handed to `listenScopedHttpServer`, which\n// owns bind + graceful close.\n//\n// The SPA is served as static files with a client-side-routing fallback to\n// `index.html`. When the UI has not been built (the bundled dir is absent),\n// the listener logs a warning once and falls back to the inline test page so\n// `/graphql` and manual API checks keep working.\n\nimport { existsSync, readFileSync, statSync } from 'node:fs';\nimport { join, normalize, resolve, sep } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { createYoga, type CORSOptions } from 'graphql-yoga';\nimport { dashboardSchema, type DashboardContext } from './schema.ts';\nimport { checkOrigin, type OriginPolicy } from './origin-policy.ts';\nimport type { HttpRequestListener } from '../../substrate/runtime/scoped-http-server.ts';\n\nexport interface DashboardListenerOptions {\n\t/** Per-request control-plane context (the `state` ref + `publishCommand`).\n\t * The dashboard is single-tenant, so this is constant for the server's\n\t * lifetime and handed to yoga as a static `context` factory. */\n\treadonly context: DashboardContext;\n\t/** Stack-scoped origin allowlist (see `origin-policy.ts`). Gates the CORS\n\t * reflection on `/graphql`: an Origin in the allowlist is echoed back; a\n\t * missing Origin (server-side / readiness probe) gets a normal response\n\t * with no CORS headers; any other Origin is denied (no `Access-Control-\n\t * Allow-Origin` → the browser blocks the cross-origin read/write). */\n\treadonly originPolicy: OriginPolicy;\n\t/** GraphQL path. Defaults to `/graphql`. */\n\treadonly graphqlEndpoint?: string;\n\t/** Override the bundled UI assets dir (mainly for tests). Defaults to the\n\t * package's `dashboard-ui/` directory resolved from this module. */\n\treadonly assetsDir?: string;\n}\n\n// The built SPA is copied into `<package root>/dashboard-ui/`. This module\n// compiles to `<root>/dist/plugins/dashboard/server.mjs`; the source lives at\n// `<root>/src/plugins/dashboard/server.ts`. Both are three levels below the\n// package root, so the same relative path resolves the bundled dir whether\n// running from `dist/` (installed dependency or repo build) or `src/`\n// (`--experimental-strip-types`).\nconst DASHBOARD_UI_DIR = fileURLToPath(new URL('../../../dashboard-ui', import.meta.url));\n\nconst CONTENT_TYPES: Record<string, string> = {\n\t'.html': 'text/html; charset=utf-8',\n\t'.js': 'text/javascript; charset=utf-8',\n\t'.mjs': 'text/javascript; charset=utf-8',\n\t'.css': 'text/css; charset=utf-8',\n\t'.json': 'application/json; charset=utf-8',\n\t'.map': 'application/json; charset=utf-8',\n\t'.svg': 'image/svg+xml',\n\t'.png': 'image/png',\n\t'.jpg': 'image/jpeg',\n\t'.jpeg': 'image/jpeg',\n\t'.gif': 'image/gif',\n\t'.webp': 'image/webp',\n\t'.ico': 'image/x-icon',\n\t'.woff': 'font/woff',\n\t'.woff2': 'font/woff2',\n\t'.ttf': 'font/ttf',\n\t'.txt': 'text/plain; charset=utf-8',\n\t'.wasm': 'application/wasm',\n};\n\nconst contentTypeFor = (path: string): string => {\n\tconst dot = path.lastIndexOf('.');\n\tconst ext = dot === -1 ? '' : path.slice(dot).toLowerCase();\n\treturn CONTENT_TYPES[ext] ?? 'application/octet-stream';\n};\n\nconst testPage = (graphqlEndpoint: string): string => `<!doctype html>\n<html lang=\"en\">\n<head><meta charset=\"utf-8\" /><title>devstack dashboard — API test</title>\n<style>body{font:14px/1.5 ui-monospace,monospace;background:#05080f;color:#e6eefb;margin:0;padding:24px}\nbutton{font:inherit;background:#1b2740;color:#e6eefb;border:1px solid #2c3c5e;border-radius:6px;padding:6px 12px;cursor:pointer}\npre{background:#0b1322;border:1px solid #1b2740;border-radius:8px;padding:16px;overflow:auto;max-height:70vh}\na{color:#69b7ff}</style></head>\n<body>\n<h1>devstack dashboard — API test</h1>\n<p>The bundled UI was not found (run <code>pnpm build</code> to bundle it). Falling back to the API test page.</p>\n<p>GraphiQL: <a href=\"${graphqlEndpoint}\">${graphqlEndpoint}</a></p>\n<p><button id=\"load\">query { state }</button> <button id=\"restart\">mutation { restart }</button></p>\n<pre id=\"out\">…</pre>\n<script type=\"module\">\nconst ep = ${JSON.stringify(graphqlEndpoint)};\nconst out = document.getElementById('out');\nasync function gql(query){\n const r = await fetch(ep,{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify({query})});\n return r.json();\n}\ndocument.getElementById('load').onclick = async () => {\n out.textContent = JSON.stringify(await gql('{ ping state { cycle { id phase } summary { total ready failed health } services { key status } } }'), null, 2);\n};\ndocument.getElementById('restart').onclick = async () => {\n out.textContent = JSON.stringify(await gql('mutation { restart { ok command } }'), null, 2);\n};\n</script>\n</body></html>`;\n\n/** CORS policy for the control plane, driven by the stack-scoped origin\n * allowlist (`origin-policy.ts`).\n *\n * The GraphQL schema exposes DESTRUCTIVE mutations (wipe/prune/shutdown/\n * restart/restoreSnapshot/deleteSnapshot/mint). Since JSON POSTs are\n * preflighted, a correct CORS policy is a real defense: it stops any\n * site the user happens to be visiting — INCLUDING a sibling devstack\n * stack on another `*.localhost` host — from driving a cross-origin\n * request against this stack's dashboard.\n *\n * We reflect the request `Origin` back ONLY when it is in THIS stack's\n * allowlist (the dashboard's own router-fronted origin + direct loopback\n * origins + caller-supplied `allowedOrigins`). The same-origin bundled SPA\n * is served from the routed origin, so its `Origin` is in the allowlist and\n * works. Every other origin — including a bare `*.localhost` from another\n * stack — is denied (no `Access-Control-Allow-Origin` → the browser blocks\n * the cross-origin read/write). A missing Origin (server-side tooling, the\n * readiness probe) yields no CORS headers but a normal response.\n * `credentials` stays `false`. */\nconst corsOptionsFor =\n\t(policy: OriginPolicy) =>\n\t(request: Request): CORSOptions => {\n\t\tconst origin = request.headers.get('origin');\n\t\t// No Origin (same-origin / non-CORS request) or a forbidden Origin →\n\t\t// no CORS headers. `false` denies; CORS never alters the status, so a\n\t\t// no-Origin server-side request still gets its normal 200 response.\n\t\tif (checkOrigin(policy, origin) !== 'ok') return false;\n\t\t// Reflect this exact origin (single-element array → echoed verbatim).\n\t\treturn { origin: [origin as string], credentials: false };\n\t};\n\n/** Strip query/hash and decode a request path into a relative file path. */\nconst requestPathname = (url: string): string => {\n\tconst noQuery = url.split(/[?#]/, 1)[0] ?? '/';\n\ttry {\n\t\treturn decodeURIComponent(noQuery);\n\t} catch {\n\t\treturn noQuery;\n\t}\n};\n\n/** Resolve a request pathname to an absolute file inside `root`, returning\n * `undefined` for traversal attempts or paths that escape `root`.\n *\n * Traversal is REJECTED, not re-rooted: if the normalized path still bears\n * a `..` segment we bail rather than stripping it and serving a different\n * file than was requested. The `startsWith(root)` guard then closes any\n * residual escape (e.g. a sibling dir sharing a prefix). */\nconst safeResolve = (root: string, pathname: string): string | undefined => {\n\tconst normalized = normalize(pathname);\n\t// A surviving `..` segment means the request tried to climb out of `root`;\n\t// reject rather than re-root. Cover both separators and bare/trailing forms.\n\tif (\n\t\tnormalized === '..' ||\n\t\tnormalized.startsWith(`..${sep}`) ||\n\t\tnormalized.startsWith('../') ||\n\t\tnormalized.includes(`${sep}..${sep}`) ||\n\t\tnormalized.includes('/../') ||\n\t\tnormalized.endsWith(`${sep}..`) ||\n\t\tnormalized.endsWith('/..')\n\t) {\n\t\treturn undefined;\n\t}\n\tconst rel = normalized.replace(/^[/\\\\]+/, '');\n\tconst abs = resolve(root, rel);\n\tconst rootWithSep = root.endsWith(sep) ? root : root + sep;\n\tif (abs !== root && !abs.startsWith(rootWithSep)) return undefined;\n\treturn abs;\n};\n\n/** Build a Node request listener routing `/graphql` to yoga and everything\n * else to the bundled SPA (with an index.html fallback for client routing).\n * Falls back to the inline API test page when the UI bundle is absent. */\nexport const makeDashboardListener = (opts: DashboardListenerOptions): HttpRequestListener => {\n\tconst graphqlEndpoint = opts.graphqlEndpoint ?? '/graphql';\n\tconst assetsDir = opts.assetsDir ?? DASHBOARD_UI_DIR;\n\tconst indexHtmlPath = join(assetsDir, 'index.html');\n\tconst uiAvailable = existsSync(indexHtmlPath);\n\n\tif (!uiAvailable) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\n\t\t\t`[devstack:dashboard] bundled UI not found at ${assetsDir}; serving the API test page only. Run \\`pnpm build\\` (or \\`pnpm --filter @mysten-incubation/devstack build:dashboard-ui\\`) to bundle the dashboard.`,\n\t\t);\n\t}\n\n\tconst yoga = createYoga({\n\t\tschema: dashboardSchema,\n\t\tcontext: () => opts.context,\n\t\tgraphqlEndpoint,\n\t\tgraphiql: true,\n\t\tlandingPage: false,\n\t\t// Stack-scoped origin allowlist (see `corsOptionsFor` / `origin-policy.ts`):\n\t\t// reflect only origins in THIS stack's allowlist so the same-origin bundled\n\t\t// SPA works while arbitrary sites — including a sibling stack on another\n\t\t// `*.localhost` host — are denied cross-origin access to the destructive\n\t\t// control-plane mutations.\n\t\tcors: corsOptionsFor(opts.originPolicy),\n\t});\n\tconst fallbackPage = testPage(graphqlEndpoint);\n\n\t// Reserve `/graphql` by DECODED pathname so encoded variants\n\t// (`/graphql%2F…`, `/%67raphql`) route to yoga instead of leaking into the\n\t// static/SPA path. `pathname` is already query/hash-stripped + decoded.\n\tconst isGraphql = (pathname: string): boolean =>\n\t\tpathname === graphqlEndpoint || pathname.startsWith(`${graphqlEndpoint}/`);\n\n\tconst sendFile = (res: Parameters<HttpRequestListener>[1], absPath: string): boolean => {\n\t\ttry {\n\t\t\tif (!statSync(absPath).isFile()) return false;\n\t\t\tconst body = readFileSync(absPath);\n\t\t\tres.statusCode = 200;\n\t\t\tres.setHeader('content-type', contentTypeFor(absPath));\n\t\t\tres.end(body);\n\t\t\treturn true;\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t};\n\n\treturn (req, res) => {\n\t\tconst url = req.url ?? '/';\n\t\tconst pathname = requestPathname(url);\n\t\tif (isGraphql(pathname)) {\n\t\t\tvoid yoga(req, res);\n\t\t\treturn;\n\t\t}\n\n\t\t// No bundled UI: keep the API test page as an honest fallback.\n\t\tif (!uiAvailable) {\n\t\t\tres.statusCode = 200;\n\t\t\tres.setHeader('content-type', 'text/html; charset=utf-8');\n\t\t\tres.end(fallbackPage);\n\t\t\treturn;\n\t\t}\n\n\t\tconst abs = pathname === '/' ? undefined : safeResolve(assetsDir, pathname);\n\n\t\t// Serve a real static asset when one matches the request path.\n\t\tif (abs !== undefined && sendFile(res, abs)) return;\n\n\t\t// SPA fallback: any other path (client-side route) gets index.html so\n\t\t// the React router can take over.\n\t\tif (sendFile(res, indexHtmlPath)) return;\n\n\t\tres.statusCode = 404;\n\t\tres.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GACpB;EACD;EAEA,MAAM,MAAM,aAAa,MAAM,KAAA,IAAY,YAAY,WAAW,QAAQ;EAG1E,IAAI,QAAQ,KAAA,KAAa,SAAS,KAAK,GAAG,GAAG;EAI7C,IAAI,SAAS,KAAK,aAAa,GAAG;EAElC,IAAI,aAAa;EACjB,IAAI,UAAU,gBAAgB,2BAA2B;EACzD,IAAI,IAAI,WAAW;CACpB;AACD"}
@@ -1,20 +1,21 @@
1
1
  //#region src/plugins/deepbook/codegen.d.ts
2
- interface DeepbookPoolBinding {
3
- readonly name: string;
4
- readonly poolId: string;
5
- readonly base: string;
6
- readonly quote: string;
7
- readonly baseCoinType: string;
8
- readonly quoteCoinType: string;
9
- }
10
2
  interface DeepbookBindings {
11
3
  readonly name: string;
12
- readonly chain: string;
4
+ readonly network: string;
13
5
  readonly packageId: string;
14
6
  readonly registryId: string;
15
7
  readonly adminCapId: string | null;
16
8
  readonly deepTreasuryId: string | null;
17
- readonly pools: ReadonlyArray<DeepbookPoolBinding>;
9
+ /** Per-pool typed shape (informational only — pools resolve as one blob):
10
+ * `{ name, poolId, base, quote, baseCoinType, quoteCoinType }`. */
11
+ readonly pools: ReadonlyArray<{
12
+ readonly name: string;
13
+ readonly poolId: string;
14
+ readonly base: string;
15
+ readonly quote: string;
16
+ readonly baseCoinType: string;
17
+ readonly quoteCoinType: string;
18
+ }>;
18
19
  readonly pyth: {
19
20
  readonly packageId: string | null;
20
21
  readonly stateId: string | null;
@@ -35,5 +36,5 @@ interface DeepbookBindings {
35
36
  readonly indexerUrl: string | null;
36
37
  }
37
38
  //#endregion
38
- export { DeepbookBindings, DeepbookPoolBinding };
39
+ export { DeepbookBindings };
39
40
  //# sourceMappingURL=codegen.d.mts.map
@@ -1,15 +1,112 @@
1
- import { Effect } from "effect";
1
+ import { keyedBucketSpec, liveBucketCodegen, staticBucketCodegen } from "../../contracts/config-bindings.mjs";
2
2
  //#region src/plugins/deepbook/codegen.ts
3
- const makeDeepbookCodegenable = (bindings) => ({
4
- kind: "codegenable",
5
- emitterName: "deepbook-network",
6
- outputPath: `deepbook/${bindings.name}.ts`,
7
- emit: (ctx) => Effect.sync(() => {
8
- ctx.exportConst("deepbookBindings", bindings);
9
- return ctx.done();
10
- })
11
- });
3
+ /** TS source-type strings for the resolved deepbook fields, so the committed
4
+ * `deepbook.ts` carries the SAME concrete types `DeepbookBindings` declares
5
+ * (the generic `resolveValue` channel would otherwise return `unknown`). The
6
+ * composite blobs (`pools`/`pyth`/`margin`) inline the structural literal
7
+ * types so no emitted type-import is needed. */
8
+ const POOL_TS_TYPE = "ReadonlyArray<{ readonly name: string; readonly poolId: string; readonly base: string; readonly quote: string; readonly baseCoinType: string; readonly quoteCoinType: string }>";
9
+ const PYTH_TS_TYPE = "{ readonly packageId: string | null; readonly stateId: string | null; readonly wormholeStateId: string | null; readonly feeds: ReadonlyArray<{ readonly symbol: string; readonly feedId: string; readonly priceInfoObjectId: string; readonly price: string; readonly expo: number }> } | null";
10
+ const MARGIN_TS_TYPE = "{ readonly packageId: string; readonly registryId: string } | null";
11
+ /** Build the deepbook instance's config-binding spec for `name`. `name` /
12
+ * `network` are structural literals; the deployment ids + composite values
13
+ * are runtime-resolved (`resolveValue`). */
14
+ const deepbookBucketSpec = (structural) => {
15
+ const known = structural.known;
16
+ const idField = (key, live) => known !== void 0 ? {
17
+ key,
18
+ variant: "literal",
19
+ value: known[key]
20
+ } : {
21
+ key,
22
+ variant: "resolved",
23
+ tsType: "string",
24
+ live
25
+ };
26
+ const fields = [
27
+ {
28
+ key: "name",
29
+ variant: "literal",
30
+ value: structural.name
31
+ },
32
+ {
33
+ key: "network",
34
+ variant: "literal",
35
+ value: structural.network
36
+ },
37
+ idField("packageId", (s) => s.packageId),
38
+ idField("registryId", (s) => s.registryId),
39
+ {
40
+ key: "adminCapId",
41
+ variant: "resolved",
42
+ tsType: "string | null",
43
+ live: (s) => s.adminCapId
44
+ },
45
+ known !== void 0 ? {
46
+ key: "deepTreasuryId",
47
+ variant: "literal",
48
+ value: known.deepTreasuryId ?? null
49
+ } : {
50
+ key: "deepTreasuryId",
51
+ variant: "resolved",
52
+ tsType: "string | null",
53
+ live: (s) => s.deepTreasuryId
54
+ },
55
+ {
56
+ key: "pools",
57
+ variant: "resolved",
58
+ tsType: POOL_TS_TYPE,
59
+ live: (s) => s.pools
60
+ },
61
+ known !== void 0 ? {
62
+ key: "pyth",
63
+ variant: "literal",
64
+ value: known.pyth ?? null
65
+ } : {
66
+ key: "pyth",
67
+ variant: "resolved",
68
+ tsType: PYTH_TS_TYPE,
69
+ live: (s) => s.pyth
70
+ },
71
+ {
72
+ key: "margin",
73
+ variant: "resolved",
74
+ tsType: MARGIN_TS_TYPE,
75
+ live: (s) => s.margin
76
+ },
77
+ {
78
+ key: "serverUrl",
79
+ variant: "resolved",
80
+ tsType: "string | null",
81
+ live: (s) => s.serverUrl
82
+ },
83
+ {
84
+ key: "indexerUrl",
85
+ variant: "resolved",
86
+ tsType: "string | null",
87
+ live: (s) => s.indexerUrl
88
+ }
89
+ ];
90
+ return keyedBucketSpec({
91
+ bucket: "deepbook.ts",
92
+ kind: "deepbook",
93
+ key: structural.name,
94
+ fields
95
+ });
96
+ };
97
+ /** Build the LIVE Codegenable contribution for a deepbook instance. Bakes
98
+ * the resolved deployment + feeds the generic id-config `values` channel.
99
+ * Every instance folds into one `generated/deepbook.ts` exporting
100
+ * `export const deepbook = { <name>: DeepbookBindings, ... }`. */
101
+ const makeDeepbookCodegenable = (bindings) => liveBucketCodegen(deepbookBucketSpec({
102
+ name: bindings.name,
103
+ network: bindings.network
104
+ }), bindings);
105
+ /** Build the STATIC (stack-free) Codegenable contribution for a deepbook
106
+ * instance. Emits `resolveValue('deepbook:<name>', '<key>')` for the runtime
107
+ * fields; the committed `deepbook.ts` carries no baked on-chain id / URL. */
108
+ const makeDeepbookStaticCodegen = (config) => staticBucketCodegen(deepbookBucketSpec(config));
12
109
  //#endregion
13
- export { makeDeepbookCodegenable };
110
+ export { makeDeepbookCodegenable, makeDeepbookStaticCodegen };
14
111
 
15
112
  //# sourceMappingURL=codegen.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"codegen.mjs","names":[],"sources":["../../../src/plugins/deepbook/codegen.ts"],"sourcesContent":["// Deepbook plugin — Codegenable contribution.\n//\n// One emit shape: `deepbook-network`. Mirrors the resolved value's\n// stable identifiers (package id, registry id, per-pool ids).\n\nimport { Effect } from 'effect';\n\nimport type { CodegenableDecl } from '../../contracts/codegenable.ts';\n\nexport interface DeepbookPoolBinding {\n\treadonly name: string;\n\treadonly poolId: string;\n\treadonly base: string;\n\treadonly quote: string;\n\treadonly baseCoinType: string;\n\treadonly quoteCoinType: string;\n}\n\nexport interface DeepbookBindings {\n\treadonly name: string;\n\treadonly chain: string;\n\treadonly packageId: string;\n\treadonly registryId: string;\n\treadonly adminCapId: string | null;\n\treadonly deepTreasuryId: string | null;\n\treadonly pools: ReadonlyArray<DeepbookPoolBinding>;\n\treadonly pyth: {\n\t\treadonly packageId: string | null;\n\t\treadonly stateId: string | null;\n\t\treadonly wormholeStateId: string | null;\n\t\treadonly feeds: ReadonlyArray<{\n\t\t\treadonly symbol: string;\n\t\t\treadonly feedId: string;\n\t\t\treadonly priceInfoObjectId: string;\n\t\t\treadonly price: string;\n\t\t\treadonly expo: number;\n\t\t}>;\n\t} | null;\n\treadonly margin: {\n\t\treadonly packageId: string;\n\t\treadonly registryId: string;\n\t} | null;\n\treadonly serverUrl: string | null;\n\treadonly indexerUrl: string | null;\n}\n\nexport const makeDeepbookCodegenable = (\n\tbindings: DeepbookBindings,\n): CodegenableDecl<'deepbook-network'> => ({\n\tkind: 'codegenable',\n\temitterName: 'deepbook-network',\n\toutputPath: `deepbook/${bindings.name}.ts`,\n\temit: (ctx) =>\n\t\tEffect.sync(() => {\n\t\t\tctx.exportConst('deepbookBindings', bindings satisfies DeepbookBindings);\n\t\t\treturn ctx.done();\n\t\t}),\n});\n"],"mappings":";;AA8CA,MAAa,2BACZ,cAC0C;CAC1C,MAAM;CACN,aAAa;CACb,YAAY,YAAY,SAAS,KAAK;CACtC,OAAO,QACN,OAAO,WAAW;AACjB,MAAI,YAAY,oBAAoB,SAAoC;AACxE,SAAO,IAAI,MAAM;GAChB;CACH"}
1
+ {"version":3,"file":"codegen.mjs","names":[],"sources":["../../../src/plugins/deepbook/codegen.ts"],"sourcesContent":["// Deepbook plugin — Codegenable contribution, via the UNIFIED config-binding\n// declaration.\n//\n// ONE declaration, TWO derivations. A deepbook instance declares its\n// `deepbook.ts` contribution ONCE as a `ConfigBindingSet` (rooted under its\n// instance name). The framework derives both behaviors (see\n// `contracts/config-bindings.ts`):\n// - LIVE (boot): bakes the resolved deployment (package / registry / pool\n// ids, pyth feed ids, …) AND feeds the generic id-config `values`\n// channel.\n// - STATIC (committed tree): emits `resolveValue('deepbook:<name>', '<key>')`\n// so the committed `deepbook.ts` carries NO baked on-chain id / URL.\n//\n// STRUCTURAL fields (`name`, `network`) stay literals. The scalar ids\n// (`packageId` / `registryId` / `adminCapId` / `deepTreasuryId`) and the\n// composite values (`pools` / `pyth` / `margin` / endpoint URLs) are RUNTIME\n// (loaded config data). The composite values carry interleaved structural\n// names + runtime ids in array shapes the flat config-path model can't split,\n// so each is resolved as ONE whole-value blob through the generic channel.\n\nimport type { CodegenableDecl } from '../../contracts/codegenable.ts';\nimport {\n\tkeyedBucketSpec,\n\tliveBucketCodegen,\n\tstaticBucketCodegen,\n\ttype BucketField,\n\ttype SiblingBucketSpec,\n} from '../../contracts/config-bindings.ts';\nimport type { JsonValue } from '../../orchestrators/codegen/id-config.ts';\n\nexport interface DeepbookBindings {\n\treadonly name: string;\n\treadonly network: string;\n\treadonly packageId: string;\n\treadonly registryId: string;\n\treadonly adminCapId: string | null;\n\treadonly deepTreasuryId: string | null;\n\t/** Per-pool typed shape (informational only — pools resolve as one blob):\n\t * `{ name, poolId, base, quote, baseCoinType, quoteCoinType }`. */\n\treadonly pools: ReadonlyArray<{\n\t\treadonly name: string;\n\t\treadonly poolId: string;\n\t\treadonly base: string;\n\t\treadonly quote: string;\n\t\treadonly baseCoinType: string;\n\t\treadonly quoteCoinType: string;\n\t}>;\n\treadonly pyth: {\n\t\treadonly packageId: string | null;\n\t\treadonly stateId: string | null;\n\t\treadonly wormholeStateId: string | null;\n\t\treadonly feeds: ReadonlyArray<{\n\t\t\treadonly symbol: string;\n\t\t\treadonly feedId: string;\n\t\t\treadonly priceInfoObjectId: string;\n\t\t\treadonly price: string;\n\t\t\treadonly expo: number;\n\t\t}>;\n\t} | null;\n\treadonly margin: {\n\t\treadonly packageId: string;\n\t\treadonly registryId: string;\n\t} | null;\n\treadonly serverUrl: string | null;\n\treadonly indexerUrl: string | null;\n}\n\n/** User-declared known/override deployment ids, available at factory time. A\n * KNOWN or OVERRIDE deployment's ids are DECLARED config (not loaded-at-runtime\n * data), so the committed `deepbook.ts` bakes them as LITERALS. Only the\n * always-declared scalar ids + the (declared, feed-less) pyth blob are carried;\n * the dynamically-discovered fields (`adminCapId` for known, `pools`, server\n * URLs) stay `resolveValue`. */\nexport interface DeepbookKnownIds {\n\treadonly packageId: string;\n\treadonly registryId: string;\n\treadonly deepTreasuryId?: string | null;\n\treadonly pyth?: DeepbookBindings['pyth'];\n}\n\n/** Static-config shape a deepbook instance can describe BEFORE acquire —\n * the structural names the stack-free `staticCodegen` hook needs. When\n * `known` is present (known / override mode), its declared ids are baked as\n * literals; otherwise (local mode) every id resolves at app build/dev time. */\nexport interface DeepbookStaticConfig {\n\treadonly name: string;\n\treadonly network: string;\n\treadonly known?: DeepbookKnownIds;\n}\n\ntype DeepbookLiveState = DeepbookBindings;\n\n/** TS source-type strings for the resolved deepbook fields, so the committed\n * `deepbook.ts` carries the SAME concrete types `DeepbookBindings` declares\n * (the generic `resolveValue` channel would otherwise return `unknown`). The\n * composite blobs (`pools`/`pyth`/`margin`) inline the structural literal\n * types so no emitted type-import is needed. */\nconst POOL_TS_TYPE =\n\t'ReadonlyArray<{ readonly name: string; readonly poolId: string; readonly base: string; readonly quote: string; readonly baseCoinType: string; readonly quoteCoinType: string }>';\nconst PYTH_TS_TYPE =\n\t'{ readonly packageId: string | null; readonly stateId: string | null; readonly wormholeStateId: string | null; readonly feeds: ReadonlyArray<{ readonly symbol: string; readonly feedId: string; readonly priceInfoObjectId: string; readonly price: string; readonly expo: number }> } | null';\nconst MARGIN_TS_TYPE = '{ readonly packageId: string; readonly registryId: string } | null';\n\n/** Build the deepbook instance's config-binding spec for `name`. `name` /\n * `network` are structural literals; the deployment ids + composite values\n * are runtime-resolved (`resolveValue`). */\nconst deepbookBucketSpec = (\n\tstructural: DeepbookStaticConfig,\n): SiblingBucketSpec<DeepbookLiveState> => {\n\tconst known = structural.known;\n\t// A known/override deployment's declared scalar ids are config, baked as\n\t// literals; a local deployment's ids are dynamic, resolved at build/dev time.\n\tconst idField = (\n\t\tkey: 'packageId' | 'registryId',\n\t\tlive: (s: DeepbookLiveState) => JsonValue,\n\t): BucketField<DeepbookLiveState> =>\n\t\tknown !== undefined\n\t\t\t? { key, variant: 'literal', value: known[key] }\n\t\t\t: { key, variant: 'resolved', tsType: 'string', live };\n\tconst fields: ReadonlyArray<BucketField<DeepbookLiveState>> = [\n\t\t{ key: 'name', variant: 'literal', value: structural.name },\n\t\t{ key: 'network', variant: 'literal', value: structural.network },\n\t\tidField('packageId', (s) => s.packageId),\n\t\tidField('registryId', (s) => s.registryId),\n\t\t// `adminCapId` is null for known/override (never declared there) and\n\t\t// dynamically captured for local — always resolved.\n\t\t{ key: 'adminCapId', variant: 'resolved', tsType: 'string | null', live: (s) => s.adminCapId },\n\t\t// `deepTreasuryId` is a declared known-deployment id when present; a\n\t\t// dynamic local capture otherwise.\n\t\tknown !== undefined\n\t\t\t? {\n\t\t\t\t\tkey: 'deepTreasuryId',\n\t\t\t\t\tvariant: 'literal',\n\t\t\t\t\tvalue: (known.deepTreasuryId ?? null) as JsonValue,\n\t\t\t\t}\n\t\t\t: {\n\t\t\t\t\tkey: 'deepTreasuryId',\n\t\t\t\t\tvariant: 'resolved',\n\t\t\t\t\ttsType: 'string | null',\n\t\t\t\t\tlive: (s) => s.deepTreasuryId,\n\t\t\t\t},\n\t\t// `pools` is always dynamically discovered (even known/override start\n\t\t// empty + may be populated live) — resolved as one whole-value blob.\n\t\t{\n\t\t\tkey: 'pools',\n\t\t\tvariant: 'resolved',\n\t\t\ttsType: POOL_TS_TYPE,\n\t\t\tlive: (s) => s.pools as unknown as JsonValue,\n\t\t},\n\t\t// `pyth` is a DECLARED testnet/mainnet blob for known deployments\n\t\t// (literal); a dynamically-deployed mock-Pyth blob for local (resolved).\n\t\tknown !== undefined\n\t\t\t? { key: 'pyth', variant: 'literal', value: (known.pyth ?? null) as JsonValue }\n\t\t\t: {\n\t\t\t\t\tkey: 'pyth',\n\t\t\t\t\tvariant: 'resolved',\n\t\t\t\t\ttsType: PYTH_TS_TYPE,\n\t\t\t\t\tlive: (s) => s.pyth as unknown as JsonValue,\n\t\t\t\t},\n\t\t{\n\t\t\tkey: 'margin',\n\t\t\tvariant: 'resolved',\n\t\t\ttsType: MARGIN_TS_TYPE,\n\t\t\tlive: (s) => s.margin as unknown as JsonValue,\n\t\t},\n\t\t{ key: 'serverUrl', variant: 'resolved', tsType: 'string | null', live: (s) => s.serverUrl },\n\t\t{ key: 'indexerUrl', variant: 'resolved', tsType: 'string | null', live: (s) => s.indexerUrl },\n\t];\n\treturn keyedBucketSpec({ bucket: 'deepbook.ts', kind: 'deepbook', key: structural.name, fields });\n};\n\n/** Build the LIVE Codegenable contribution for a deepbook instance. Bakes\n * the resolved deployment + feeds the generic id-config `values` channel.\n * Every instance folds into one `generated/deepbook.ts` exporting\n * `export const deepbook = { <name>: DeepbookBindings, ... }`. */\nexport const makeDeepbookCodegenable = (bindings: DeepbookBindings): CodegenableDecl =>\n\tliveBucketCodegen(\n\t\tdeepbookBucketSpec({ name: bindings.name, network: bindings.network }),\n\t\tbindings,\n\t);\n\n/** Build the STATIC (stack-free) Codegenable contribution for a deepbook\n * instance. Emits `resolveValue('deepbook:<name>', '<key>')` for the runtime\n * fields; the committed `deepbook.ts` carries no baked on-chain id / URL. */\nexport const makeDeepbookStaticCodegen = (config: DeepbookStaticConfig): CodegenableDecl =>\n\tstaticBucketCodegen(deepbookBucketSpec(config));\n"],"mappings":";;;;;;;AAiGA,MAAM,eACL;AACD,MAAM,eACL;AACD,MAAM,iBAAiB;;;;AAKvB,MAAM,sBACL,eAC0C;CAC1C,MAAM,QAAQ,WAAW;CAGzB,MAAM,WACL,KACA,SAEA,UAAU,KAAA,IACP;EAAE;EAAK,SAAS;EAAW,OAAO,MAAM;CAAK,IAC7C;EAAE;EAAK,SAAS;EAAY,QAAQ;EAAU;CAAK;CACvD,MAAM,SAAwD;EAC7D;GAAE,KAAK;GAAQ,SAAS;GAAW,OAAO,WAAW;EAAK;EAC1D;GAAE,KAAK;GAAW,SAAS;GAAW,OAAO,WAAW;EAAQ;EAChE,QAAQ,cAAc,MAAM,EAAE,SAAS;EACvC,QAAQ,eAAe,MAAM,EAAE,UAAU;EAGzC;GAAE,KAAK;GAAc,SAAS;GAAY,QAAQ;GAAiB,OAAO,MAAM,EAAE;EAAW;EAG7F,UAAU,KAAA,IACP;GACA,KAAK;GACL,SAAS;GACT,OAAQ,MAAM,kBAAkB;EACjC,IACC;GACA,KAAK;GACL,SAAS;GACT,QAAQ;GACR,OAAO,MAAM,EAAE;EAChB;EAGF;GACC,KAAK;GACL,SAAS;GACT,QAAQ;GACR,OAAO,MAAM,EAAE;EAChB;EAGA,UAAU,KAAA,IACP;GAAE,KAAK;GAAQ,SAAS;GAAW,OAAQ,MAAM,QAAQ;EAAmB,IAC5E;GACA,KAAK;GACL,SAAS;GACT,QAAQ;GACR,OAAO,MAAM,EAAE;EAChB;EACF;GACC,KAAK;GACL,SAAS;GACT,QAAQ;GACR,OAAO,MAAM,EAAE;EAChB;EACA;GAAE,KAAK;GAAa,SAAS;GAAY,QAAQ;GAAiB,OAAO,MAAM,EAAE;EAAU;EAC3F;GAAE,KAAK;GAAc,SAAS;GAAY,QAAQ;GAAiB,OAAO,MAAM,EAAE;EAAW;CAC9F;CACA,OAAO,gBAAgB;EAAE,QAAQ;EAAe,MAAM;EAAY,KAAK,WAAW;EAAM;CAAO,CAAC;AACjG;;;;;AAMA,MAAa,2BAA2B,aACvC,kBACC,mBAAmB;CAAE,MAAM,SAAS;CAAM,SAAS,SAAS;AAAQ,CAAC,GACrE,QACD;;;;AAKD,MAAa,6BAA6B,WACzC,oBAAoB,mBAAmB,MAAM,CAAC"}
@@ -1,12 +1,11 @@
1
- import { chainId } from "../../substrate/brand.mjs";
2
1
  import { probeManyLenient } from "../../substrate/runtime/probes.mjs";
3
2
  import { STALE_OBJECT_VERSION_RETRY_PROFILE, makeSpacedRetrySchedule } from "../../substrate/runtime/retry-policy.mjs";
4
- import { executeSuiTx, formatExecutedFailure, isSuiStaleObjectVersionError } from "../../substrate/runtime/sui-execute/index.mjs";
3
+ import { executeSuiTx, formatExecutedFailure, isSuiStaleObjectVersionError } from "../sui/exec/index.mjs";
4
+ import { currentLedgerObjectRef } from "../sui/ledger/object-ref.mjs";
5
+ import "../sui/index.mjs";
5
6
  import { artifactPublishError } from "../../primitives/artifact-publisher.mjs";
6
7
  import { acquireOnChainArtifact } from "../internal/acquire-on-chain-artifact.mjs";
7
- import { DeepbookSpans } from "./spans.mjs";
8
8
  import { deepbookPluginError } from "./errors.mjs";
9
- import { currentLedgerObjectRef } from "../../substrate/runtime/sui-ledger/object-ref.mjs";
10
9
  import { stableContentHash } from "./hash.mjs";
11
10
  import { isPoolForPair } from "./type-strings.mjs";
12
11
  import { Effect } from "effect";
@@ -145,7 +144,7 @@ const createDeepbookPools = (publisher, sdk, chain, signer, pkg, pools) => Effec
145
144
  if (pools.length === 0) return { pools: [] };
146
145
  const produced = yield* acquireOnChainArtifact(publisher, {
147
146
  namespace: "deepbook/pools",
148
- chain: chainId(chain),
147
+ chain,
149
148
  contentHash: poolInputsHash(pkg, signer, pools),
150
149
  verify: (cached) => buildVerifyProbe(sdk, cached),
151
150
  produce: Effect.gen(function* () {
@@ -195,10 +194,7 @@ const createDeepbookPools = (publisher, sdk, chain, signer, pkg, pools) => Effec
195
194
  const resolvedPools = pools.map((pool) => producedPools.get(pool.name));
196
195
  if (resolvedPools.some((pool) => pool === void 0)) return yield* Effect.fail(deepbookPluginError("create-pools", "deepbook pool creation did not return every pool."));
197
196
  return fromCachedPools({ pools: resolvedPools.filter((pool) => pool !== void 0) });
198
- }).pipe(Effect.withSpan("devstack.plugin.deepbook.createPools", { attributes: {
199
- [DeepbookSpans.packageId]: pkg.packageId,
200
- [DeepbookSpans.poolCount]: pools.length
201
- } }));
197
+ });
202
198
  const poolByName = (pools, name) => pools.find((pool) => pool.name === name);
203
199
  const pickCreatedBalanceManager = (changes) => {
204
200
  for (const change of changes) {
@@ -300,7 +296,7 @@ const seedDeepbookPools = (publisher, sdk, chain, signer, pkg, specs, pools) =>
300
296
  if (pool === void 0) return yield* Effect.fail(deepbookPluginError("create-pools", `deepbook seed pool '${spec.name}' was not created.`));
301
297
  const result = yield* acquireOnChainArtifact(publisher, {
302
298
  namespace: `deepbook/seed/${spec.name}`,
303
- chain: chainId(chain),
299
+ chain,
304
300
  contentHash: seedInputsHash(pkg, signer, spec, pool),
305
301
  verify: (cached) => buildSeedVerifyProbe(sdk, cached),
306
302
  produce: Effect.gen(function* () {
@@ -365,10 +361,7 @@ const seedDeepbookPools = (publisher, sdk, chain, signer, pkg, specs, pools) =>
365
361
  seeded.push(result);
366
362
  }
367
363
  return seeded;
368
- }).pipe(Effect.withSpan("devstack.plugin.deepbook.seedPools", { attributes: {
369
- [DeepbookSpans.packageId]: pkg.packageId,
370
- [DeepbookSpans.poolCount]: specs.filter((spec) => spec.seed !== void 0).length
371
- } }));
364
+ });
372
365
  //#endregion
373
366
  export { createDeepbookPools, seedDeepbookPools };
374
367