@mysten-incubation/devstack 0.1.1 → 0.2.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.
- package/README.md +6 -3
- package/dashboard-ui/assets/grpc-a4usE3Nk.js +3 -0
- package/dashboard-ui/assets/index-B82Bh84P.css +1 -0
- package/dashboard-ui/assets/index-CRYJ4pru.js +1277 -0
- package/dashboard-ui/index.html +2 -2
- package/dist/api/define-capabilities.d.mts +1 -20
- package/dist/api/define-capabilities.mjs +15 -22
- package/dist/api/define-capabilities.mjs.map +1 -1
- package/dist/api/define-devstack-with.d.mts +7 -1
- package/dist/api/define-devstack-with.mjs.map +1 -1
- package/dist/api/define-devstack.mjs.map +1 -1
- package/dist/api/define-plugin.d.mts +2 -1
- package/dist/api/inference-network.d.mts +31 -17
- package/dist/api/inference-network.mjs +40 -43
- package/dist/api/inference-network.mjs.map +1 -1
- package/dist/api/load-config.mjs +88 -0
- package/dist/api/load-config.mjs.map +1 -0
- package/dist/api/mode-narrowed-factory.d.mts +1 -1
- package/dist/api/mode-narrowed-factory.mjs.map +1 -1
- package/dist/api/run-stack-internal.mjs +202 -0
- package/dist/api/run-stack-internal.mjs.map +1 -0
- package/dist/api/run-stack.d.mts +82 -31
- package/dist/api/run-stack.mjs +22 -141
- package/dist/api/run-stack.mjs.map +1 -1
- package/dist/build-integrations/dapp-kit/index.d.mts +61 -0
- package/dist/build-integrations/dapp-kit/index.mjs +58 -0
- package/dist/build-integrations/dapp-kit/index.mjs.map +1 -0
- package/dist/build-integrations/playwright/config.d.mts +1 -30
- package/dist/build-integrations/playwright/config.mjs +1 -27
- package/dist/build-integrations/playwright/config.mjs.map +1 -1
- package/dist/build-integrations/playwright/errors.d.mts +4 -7
- package/dist/build-integrations/playwright/errors.mjs.map +1 -1
- package/dist/build-integrations/playwright/global-setup.d.mts +42 -71
- package/dist/build-integrations/playwright/global-setup.mjs +142 -218
- package/dist/build-integrations/playwright/global-setup.mjs.map +1 -1
- package/dist/build-integrations/playwright/index.d.mts +2 -2
- package/dist/build-integrations/playwright/index.mjs +2 -2
- package/dist/build-integrations/playwright/stack-context.d.mts +3 -1
- package/dist/build-integrations/playwright/stack-context.mjs +4 -2
- package/dist/build-integrations/playwright/stack-context.mjs.map +1 -1
- package/dist/build-integrations/playwright/wallet-context.mjs +44 -19
- package/dist/build-integrations/playwright/wallet-context.mjs.map +1 -1
- package/dist/build-integrations/runtime/cold-start-url.mjs.map +1 -1
- package/dist/build-integrations/runtime/conventional-routes.mjs.map +1 -1
- package/dist/build-integrations/runtime/dapp-kit-slot.mjs.map +1 -1
- package/dist/build-integrations/runtime/discover.d.mts +6 -4
- package/dist/build-integrations/runtime/discover.mjs +15 -4
- package/dist/build-integrations/runtime/discover.mjs.map +1 -1
- package/dist/build-integrations/runtime/endpoint-registry.mjs.map +1 -1
- package/dist/build-integrations/runtime/errors.mjs.map +1 -1
- package/dist/build-integrations/runtime/read-stack-context.mjs +3 -3
- package/dist/build-integrations/runtime/read-stack-context.mjs.map +1 -1
- package/dist/build-integrations/runtime/resolve-discovery-env.d.mts +23 -7
- package/dist/build-integrations/runtime/resolve-discovery-env.mjs +25 -12
- package/dist/build-integrations/runtime/resolve-discovery-env.mjs.map +1 -1
- package/dist/build-integrations/runtime/stack-context.d.mts +2 -2
- package/dist/build-integrations/vite/index.d.mts +84 -19
- package/dist/build-integrations/vite/index.mjs +203 -28
- package/dist/build-integrations/vite/index.mjs.map +1 -1
- package/dist/build-integrations/vitest/config.d.mts +20 -2
- package/dist/build-integrations/vitest/config.mjs +16 -4
- package/dist/build-integrations/vitest/config.mjs.map +1 -1
- package/dist/build-integrations/vitest/env.d.mts +18 -10
- package/dist/build-integrations/vitest/env.mjs +11 -10
- package/dist/build-integrations/vitest/env.mjs.map +1 -1
- package/dist/build-integrations/vitest/errors.d.mts +7 -11
- package/dist/build-integrations/vitest/errors.mjs +3 -4
- package/dist/build-integrations/vitest/errors.mjs.map +1 -1
- package/dist/build-integrations/vitest/global-setup.d.mts +35 -0
- package/dist/build-integrations/vitest/global-setup.mjs +156 -0
- package/dist/build-integrations/vitest/global-setup.mjs.map +1 -0
- package/dist/build-integrations/vitest/index.d.mts +3 -2
- package/dist/build-integrations/vitest/index.mjs +3 -2
- package/dist/build-integrations/vitest/setup.mjs +2 -2
- package/dist/build-integrations/vitest/setup.mjs.map +1 -1
- package/dist/build-integrations/vitest/stack-context.d.mts +5 -3
- package/dist/build-integrations/vitest/stack-context.mjs +3 -2
- package/dist/build-integrations/vitest/stack-context.mjs.map +1 -1
- package/dist/cli/bail.mjs.map +1 -1
- package/dist/cli/doctor-probes.mjs +1 -3
- package/dist/cli/doctor-probes.mjs.map +1 -1
- package/dist/cli/main.d.mts +23 -1
- package/dist/cli/main.mjs +63 -8
- package/dist/cli/main.mjs.map +1 -1
- package/dist/cli/prune-direct.mjs.map +1 -1
- package/dist/cli/snapshot-reader.mjs.map +1 -1
- package/dist/cli/up-lifecycle.mjs.map +1 -1
- package/dist/cli/wirings/apply.mjs +28 -21
- package/dist/cli/wirings/apply.mjs.map +1 -1
- package/dist/cli/wirings/codegen.mjs +108 -0
- package/dist/cli/wirings/codegen.mjs.map +1 -0
- package/dist/cli/wirings/config-loader.mjs +12 -62
- package/dist/cli/wirings/config-loader.mjs.map +1 -1
- package/dist/cli/wirings/dump-ids.mjs +86 -0
- package/dist/cli/wirings/dump-ids.mjs.map +1 -0
- package/dist/cli/wirings/engine-command.mjs +1 -1
- package/dist/cli/wirings/engine-command.mjs.map +1 -1
- package/dist/cli/wirings/identity.mjs +2 -2
- package/dist/cli/wirings/identity.mjs.map +1 -1
- package/dist/cli/wirings/provide-file-system.mjs.map +1 -1
- package/dist/cli/wirings/read-devstack-version.mjs +17 -0
- package/dist/cli/wirings/read-devstack-version.mjs.map +1 -0
- package/dist/cli/wirings/snapshot.mjs +27 -34
- package/dist/cli/wirings/snapshot.mjs.map +1 -1
- package/dist/cli/wirings/up-ipc.mjs +147 -0
- package/dist/cli/wirings/up-ipc.mjs.map +1 -0
- package/dist/cli/wirings/up.mjs +218 -198
- package/dist/cli/wirings/up.mjs.map +1 -1
- package/dist/cli/wirings/wipe.mjs +1 -1
- package/dist/cli/wirings/wipe.mjs.map +1 -1
- package/dist/contracts/chain-probe.d.mts +1 -1
- package/dist/contracts/chain-probe.mjs +1 -1
- package/dist/contracts/chain-probe.mjs.map +1 -1
- package/dist/contracts/codegenable.d.mts +60 -6
- package/dist/contracts/codegenable.mjs +28 -0
- package/dist/contracts/codegenable.mjs.map +1 -0
- package/dist/contracts/config-bindings.mjs +162 -0
- package/dist/contracts/config-bindings.mjs.map +1 -0
- package/dist/contracts/container-runtime.d.mts +23 -17
- package/dist/contracts/plugin-expander.mjs.map +1 -1
- package/dist/contracts/snapshotable.d.mts +5 -7
- package/dist/contracts/wallet-protocol.d.mts +2 -5
- package/dist/contracts/wallet-protocol.mjs +2 -5
- package/dist/contracts/wallet-protocol.mjs.map +1 -1
- package/dist/index.d.mts +21 -26
- package/dist/index.mjs +8 -9
- package/dist/orchestrators/boot.d.mts +28 -0
- package/dist/orchestrators/boot.mjs +440 -0
- package/dist/orchestrators/boot.mjs.map +1 -0
- package/dist/orchestrators/codegen/bindings.d.mts +13 -1
- package/dist/orchestrators/codegen/bindings.mjs +23 -9
- package/dist/orchestrators/codegen/bindings.mjs.map +1 -1
- package/dist/orchestrators/codegen/config-runtime.mjs +208 -0
- package/dist/orchestrators/codegen/config-runtime.mjs.map +1 -0
- package/dist/orchestrators/codegen/emit.mjs +1 -1
- package/dist/orchestrators/codegen/emit.mjs.map +1 -1
- package/dist/orchestrators/codegen/errors.mjs +21 -1
- package/dist/orchestrators/codegen/errors.mjs.map +1 -1
- package/dist/orchestrators/codegen/format.mjs +2 -0
- package/dist/orchestrators/codegen/format.mjs.map +1 -1
- package/dist/orchestrators/codegen/gitignore.mjs +30 -11
- package/dist/orchestrators/codegen/gitignore.mjs.map +1 -1
- package/dist/orchestrators/codegen/id-config.mjs +107 -0
- package/dist/orchestrators/codegen/id-config.mjs.map +1 -0
- package/dist/orchestrators/codegen/output-location.mjs +23 -32
- package/dist/orchestrators/codegen/output-location.mjs.map +1 -1
- package/dist/orchestrators/codegen/paths.mjs +8 -1
- package/dist/orchestrators/codegen/paths.mjs.map +1 -1
- package/dist/orchestrators/codegen/permissions.mjs.map +1 -1
- package/dist/orchestrators/codegen/service.mjs +286 -58
- package/dist/orchestrators/codegen/service.mjs.map +1 -1
- package/dist/orchestrators/layers.mjs +31 -0
- package/dist/orchestrators/layers.mjs.map +1 -0
- package/dist/orchestrators/lifecycle-prune/errors.mjs.map +1 -1
- package/dist/orchestrators/lifecycle-prune/index.mjs +8 -10
- package/dist/orchestrators/lifecycle-prune/index.mjs.map +1 -1
- package/dist/orchestrators/network-options.d.mts +52 -0
- package/dist/orchestrators/network-options.mjs +43 -0
- package/dist/orchestrators/network-options.mjs.map +1 -0
- package/dist/orchestrators/router/cleanup.mjs.map +1 -1
- package/dist/orchestrators/router/cors.mjs.map +1 -1
- package/dist/orchestrators/router/entrypoints.mjs.map +1 -1
- package/dist/orchestrators/router/errors.mjs.map +1 -1
- package/dist/orchestrators/router/file-provider.mjs.map +1 -1
- package/dist/orchestrators/router/hostname.mjs.map +1 -1
- package/dist/orchestrators/router/profile.mjs +1 -1
- package/dist/orchestrators/router/profile.mjs.map +1 -1
- package/dist/orchestrators/router/service.d.mts +2 -2
- package/dist/orchestrators/router/service.mjs +12 -27
- package/dist/orchestrators/router/service.mjs.map +1 -1
- package/dist/orchestrators/router/traefik-container.mjs +1 -1
- package/dist/orchestrators/router/traefik-container.mjs.map +1 -1
- package/dist/orchestrators/snapshot/capture.mjs +171 -195
- package/dist/orchestrators/snapshot/capture.mjs.map +1 -1
- package/dist/orchestrators/snapshot/descriptor.d.mts +1 -1
- package/dist/orchestrators/snapshot/descriptor.mjs +53 -11
- package/dist/orchestrators/snapshot/descriptor.mjs.map +1 -1
- package/dist/orchestrators/snapshot/identity-guard.mjs +3 -5
- package/dist/orchestrators/snapshot/identity-guard.mjs.map +1 -1
- package/dist/orchestrators/snapshot/image-bundle-tags.mjs +32 -101
- package/dist/orchestrators/snapshot/image-bundle-tags.mjs.map +1 -1
- package/dist/orchestrators/snapshot/index.mjs +1 -4
- package/dist/orchestrators/snapshot/integrity.mjs.map +1 -1
- package/dist/orchestrators/snapshot/interrupted-restore.mjs +116 -0
- package/dist/orchestrators/snapshot/interrupted-restore.mjs.map +1 -0
- package/dist/orchestrators/snapshot/phase-error.mjs.map +1 -1
- package/dist/orchestrators/snapshot/prune.mjs +40 -31
- package/dist/orchestrators/snapshot/prune.mjs.map +1 -1
- package/dist/orchestrators/snapshot/restore.mjs +221 -196
- package/dist/orchestrators/snapshot/restore.mjs.map +1 -1
- package/dist/orchestrators/snapshot/service.mjs +72 -62
- package/dist/orchestrators/snapshot/service.mjs.map +1 -1
- package/dist/orchestrators/snapshot/wipe.mjs +67 -56
- package/dist/orchestrators/snapshot/wipe.mjs.map +1 -1
- package/dist/plugins/account/codegen.mjs +3 -0
- package/dist/plugins/account/codegen.mjs.map +1 -1
- package/dist/plugins/account/errors.d.mts +2 -2
- package/dist/plugins/account/errors.mjs +1 -4
- package/dist/plugins/account/errors.mjs.map +1 -1
- package/dist/plugins/account/funding.mjs +3 -27
- package/dist/plugins/account/funding.mjs.map +1 -1
- package/dist/plugins/account/index.d.mts +3 -8
- package/dist/plugins/account/index.mjs +71 -35
- package/dist/plugins/account/index.mjs.map +1 -1
- package/dist/plugins/account/keypair.d.mts +8 -7
- package/dist/plugins/account/keypair.mjs +5 -18
- package/dist/plugins/account/keypair.mjs.map +1 -1
- package/dist/plugins/account/lease.mjs.map +1 -1
- package/dist/plugins/account/registry.d.mts +1 -46
- package/dist/plugins/account/registry.mjs.map +1 -1
- package/dist/plugins/account/service.d.mts +43 -34
- package/dist/plugins/account/service.mjs +9 -54
- package/dist/plugins/account/service.mjs.map +1 -1
- package/dist/plugins/account/snapshot.mjs.map +1 -1
- package/dist/plugins/account/variants/ephemeral.mjs.map +1 -1
- package/dist/plugins/account/variants/impersonate.mjs.map +1 -1
- package/dist/plugins/account/variants/signer.mjs.map +1 -1
- package/dist/plugins/action/discriminator.mjs.map +1 -1
- package/dist/plugins/action/errors.mjs +1 -4
- package/dist/plugins/action/errors.mjs.map +1 -1
- package/dist/plugins/action/execute.mjs +3 -4
- package/dist/plugins/action/execute.mjs.map +1 -1
- package/dist/plugins/action/index.d.mts +2 -2
- package/dist/plugins/action/index.mjs +7 -11
- package/dist/plugins/action/index.mjs.map +1 -1
- package/dist/plugins/action/service.d.mts +5 -7
- package/dist/plugins/action/service.mjs +2 -16
- package/dist/plugins/action/service.mjs.map +1 -1
- package/dist/plugins/coin/address-resolution.mjs.map +1 -1
- package/dist/plugins/coin/codegen.mjs +97 -16
- package/dist/plugins/coin/codegen.mjs.map +1 -1
- package/dist/plugins/coin/discovery.mjs.map +1 -1
- package/dist/plugins/coin/errors.mjs +1 -4
- package/dist/plugins/coin/errors.mjs.map +1 -1
- package/dist/plugins/coin/index.d.mts +4 -34
- package/dist/plugins/coin/index.mjs +47 -28
- package/dist/plugins/coin/index.mjs.map +1 -1
- package/dist/plugins/coin/metadata.d.mts +1 -0
- package/dist/plugins/coin/metadata.mjs +8 -9
- package/dist/plugins/coin/metadata.mjs.map +1 -1
- package/dist/plugins/coin/mint.mjs +7 -21
- package/dist/plugins/coin/mint.mjs.map +1 -1
- package/dist/plugins/coin/registry.mjs +33 -20
- package/dist/plugins/coin/registry.mjs.map +1 -1
- package/dist/plugins/coin/service.d.mts +1 -1
- package/dist/plugins/coin/service.mjs +1 -8
- package/dist/plugins/coin/service.mjs.map +1 -1
- package/dist/plugins/coin/snapshot.mjs.map +1 -1
- package/dist/plugins/coin/type-strings.mjs.map +1 -1
- package/dist/plugins/dashboard/domain.mjs +106 -167
- package/dist/plugins/dashboard/domain.mjs.map +1 -1
- package/dist/plugins/dashboard/index.mjs +13 -13
- package/dist/plugins/dashboard/index.mjs.map +1 -1
- package/dist/plugins/dashboard/origin-policy.mjs +3 -3
- package/dist/plugins/dashboard/origin-policy.mjs.map +1 -1
- package/dist/plugins/dashboard/routable.mjs.map +1 -1
- package/dist/plugins/dashboard/schema/builder.mjs.map +1 -1
- package/dist/plugins/dashboard/schema/enums.mjs.map +1 -1
- package/dist/plugins/dashboard/schema/root.mjs +23 -44
- package/dist/plugins/dashboard/schema/root.mjs.map +1 -1
- package/dist/plugins/dashboard/schema/types.mjs +37 -91
- package/dist/plugins/dashboard/schema/types.mjs.map +1 -1
- package/dist/plugins/dashboard/schema.mjs.map +1 -1
- package/dist/plugins/dashboard/server.mjs.map +1 -1
- package/dist/plugins/deepbook/codegen.d.mts +12 -11
- package/dist/plugins/deepbook/codegen.mjs +108 -11
- package/dist/plugins/deepbook/codegen.mjs.map +1 -1
- package/dist/plugins/deepbook/deploy.mjs +7 -14
- package/dist/plugins/deepbook/deploy.mjs.map +1 -1
- package/dist/plugins/deepbook/errors.mjs +4 -2
- package/dist/plugins/deepbook/errors.mjs.map +1 -1
- package/dist/plugins/deepbook/faucet-strategy.mjs +4 -10
- package/dist/plugins/deepbook/faucet-strategy.mjs.map +1 -1
- package/dist/plugins/deepbook/hash.mjs.map +1 -1
- package/dist/plugins/deepbook/index.d.mts +38 -34
- package/dist/plugins/deepbook/index.mjs +133 -64
- package/dist/plugins/deepbook/index.mjs.map +1 -1
- package/dist/plugins/deepbook/plugin-key.mjs.map +1 -1
- package/dist/plugins/deepbook/pyth/index.mjs +4 -8
- package/dist/plugins/deepbook/pyth/index.mjs.map +1 -1
- package/dist/plugins/deepbook/snapshot.mjs +0 -1
- package/dist/plugins/deepbook/snapshot.mjs.map +1 -1
- package/dist/plugins/deepbook/type-strings.mjs.map +1 -1
- package/dist/plugins/deepbook/types.d.mts +2 -1
- package/dist/plugins/deepbook/types.mjs.map +1 -1
- package/dist/plugins/faucet/dispatcher.d.mts +3 -3
- package/dist/plugins/faucet/dispatcher.mjs.map +1 -1
- package/dist/plugins/faucet/errors.mjs.map +1 -1
- package/dist/plugins/faucet/http.mjs +2 -10
- package/dist/plugins/faucet/http.mjs.map +1 -1
- package/dist/plugins/faucet/index.mjs +0 -1
- package/dist/plugins/faucet/index.mjs.map +1 -1
- package/dist/plugins/host-service/errors.d.mts +1 -3
- package/dist/plugins/host-service/errors.mjs +1 -2
- package/dist/plugins/host-service/errors.mjs.map +1 -1
- package/dist/plugins/host-service/index.d.mts +1 -2
- package/dist/plugins/host-service/index.mjs +11 -11
- package/dist/plugins/host-service/index.mjs.map +1 -1
- package/dist/plugins/host-service/routable.mjs.map +1 -1
- package/dist/plugins/host-service/service.mjs +13 -13
- package/dist/plugins/host-service/service.mjs.map +1 -1
- package/dist/plugins/internal/acquire-on-chain-artifact.mjs.map +1 -1
- package/dist/plugins/internal/codegen-helpers.mjs +2 -0
- package/dist/plugins/internal/codegen-helpers.mjs.map +1 -1
- package/dist/plugins/internal/funding-failure-error.mjs.map +1 -1
- package/dist/plugins/{postgres → internal/postgres-sidecar}/connection.mjs +1 -1
- package/dist/plugins/internal/postgres-sidecar/connection.mjs.map +1 -0
- package/dist/plugins/{postgres → internal/postgres-sidecar}/db-ensure.mjs +30 -16
- package/dist/plugins/internal/postgres-sidecar/db-ensure.mjs.map +1 -0
- package/dist/plugins/internal/postgres-sidecar/errors.mjs +21 -0
- package/dist/plugins/internal/postgres-sidecar/errors.mjs.map +1 -0
- package/dist/{substrate/runtime/scoped-multimap → plugins/internal/postgres-sidecar}/index.mjs +1 -0
- package/dist/plugins/internal/postgres-sidecar/service.mjs +121 -0
- package/dist/plugins/internal/postgres-sidecar/service.mjs.map +1 -0
- package/dist/plugins/package/build.mjs +2 -2
- package/dist/plugins/package/build.mjs.map +1 -1
- package/dist/plugins/package/codegen.d.mts +7 -14
- package/dist/plugins/package/codegen.mjs +187 -59
- package/dist/plugins/package/codegen.mjs.map +1 -1
- package/dist/plugins/package/dep-resolution.mjs +51 -3
- package/dist/plugins/package/dep-resolution.mjs.map +1 -1
- package/dist/plugins/package/errors.mjs +1 -4
- package/dist/plugins/package/errors.mjs.map +1 -1
- package/dist/plugins/package/git-source.d.mts +18 -0
- package/dist/plugins/package/git-source.mjs +119 -0
- package/dist/plugins/package/git-source.mjs.map +1 -0
- package/dist/plugins/package/index.d.mts +28 -19
- package/dist/plugins/package/index.mjs +107 -32
- package/dist/plugins/package/index.mjs.map +1 -1
- package/dist/plugins/package/mode-known.mjs +2 -2
- package/dist/plugins/package/mode-known.mjs.map +1 -1
- package/dist/plugins/package/mode-local.mjs +18 -35
- package/dist/plugins/package/mode-local.mjs.map +1 -1
- package/dist/plugins/package/publish-executor.mjs +13 -8
- package/dist/plugins/package/publish-executor.mjs.map +1 -1
- package/dist/plugins/package/publish-output.d.mts +1 -11
- package/dist/plugins/package/publish-output.mjs +1 -9
- package/dist/plugins/package/publish-output.mjs.map +1 -1
- package/dist/plugins/package/registry.d.mts +1 -1
- package/dist/plugins/package/registry.mjs +26 -14
- package/dist/plugins/package/registry.mjs.map +1 -1
- package/dist/plugins/package/service.mjs.map +1 -1
- package/dist/plugins/package/snapshot.mjs.map +1 -1
- package/dist/plugins/router-entrypoints.mjs +1 -3
- package/dist/plugins/router-entrypoints.mjs.map +1 -1
- package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs +1 -2
- package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs.map +1 -1
- package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs +1 -6
- package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs.map +1 -1
- package/dist/plugins/seal/codegen.d.mts +1 -5
- package/dist/plugins/seal/codegen.mjs +83 -12
- package/dist/plugins/seal/codegen.mjs.map +1 -1
- package/dist/plugins/seal/config-render.mjs +2 -6
- package/dist/plugins/seal/config-render.mjs.map +1 -1
- package/dist/plugins/seal/deploy.mjs +18 -29
- package/dist/plugins/seal/deploy.mjs.map +1 -1
- package/dist/plugins/seal/errors.d.mts +4 -5
- package/dist/plugins/seal/errors.mjs +1 -8
- package/dist/plugins/seal/errors.mjs.map +1 -1
- package/dist/plugins/seal/index.d.mts +7 -28
- package/dist/plugins/seal/index.mjs +69 -47
- package/dist/plugins/seal/index.mjs.map +1 -1
- package/dist/plugins/seal/key-manager.mjs.map +1 -1
- package/dist/plugins/seal/key-server.mjs +1 -6
- package/dist/plugins/seal/key-server.mjs.map +1 -1
- package/dist/plugins/seal/keygen.mjs +2 -3
- package/dist/plugins/seal/keygen.mjs.map +1 -1
- package/dist/plugins/seal/mode/fork-known.mjs.map +1 -1
- package/dist/plugins/seal/mode/live.mjs +1 -1
- package/dist/plugins/seal/mode/live.mjs.map +1 -1
- package/dist/plugins/seal/mode/local-keygen.mjs +4 -10
- package/dist/plugins/seal/mode/local-keygen.mjs.map +1 -1
- package/dist/plugins/seal/plugin-key.mjs.map +1 -1
- package/dist/plugins/seal/registry-publish.mjs.map +1 -1
- package/dist/plugins/seal/routable.mjs.map +1 -1
- package/dist/plugins/seal/service.mjs.map +1 -1
- package/dist/plugins/seal/snapshot.mjs +1 -2
- package/dist/plugins/seal/snapshot.mjs.map +1 -1
- package/dist/plugins/sui/auto-tick.mjs +5 -5
- package/dist/plugins/sui/auto-tick.mjs.map +1 -1
- package/dist/plugins/sui/chain-build-container.mjs +2 -2
- package/dist/plugins/sui/chain-build-container.mjs.map +1 -1
- package/dist/plugins/sui/chain-probe.mjs +4 -4
- package/dist/plugins/sui/chain-probe.mjs.map +1 -1
- package/dist/plugins/sui/codegen.d.mts +9 -7
- package/dist/plugins/sui/codegen.mjs +49 -46
- package/dist/plugins/sui/codegen.mjs.map +1 -1
- package/dist/plugins/sui/errors.d.mts +1 -1
- package/dist/plugins/sui/errors.mjs +1 -9
- package/dist/plugins/sui/errors.mjs.map +1 -1
- package/dist/{substrate/runtime/sui-execute → plugins/sui/exec}/index.d.mts +1 -1
- package/dist/{substrate/runtime/sui-execute → plugins/sui/exec}/index.mjs +3 -7
- package/dist/plugins/sui/exec/index.mjs.map +1 -0
- package/dist/{substrate/runtime/sui-execute → plugins/sui/exec}/sign-and-dispatch.mjs +1 -1
- package/dist/plugins/sui/exec/sign-and-dispatch.mjs.map +1 -0
- package/dist/plugins/sui/fork-faucet-strategy.mjs +2 -6
- package/dist/plugins/sui/fork-faucet-strategy.mjs.map +1 -1
- package/dist/plugins/sui/fork-orchestration.mjs +13 -23
- package/dist/plugins/sui/fork-orchestration.mjs.map +1 -1
- package/dist/plugins/sui/fork-transaction.mjs.map +1 -1
- package/dist/plugins/sui/index.d.mts +34 -83
- package/dist/plugins/sui/index.mjs +200 -68
- package/dist/plugins/sui/index.mjs.map +1 -1
- package/dist/{substrate/runtime/sui-ledger → plugins/sui/ledger}/object-ref.mjs +1 -1
- package/dist/plugins/sui/ledger/object-ref.mjs.map +1 -0
- package/dist/plugins/sui/local-faucet-strategy.mjs +1 -5
- package/dist/plugins/sui/local-faucet-strategy.mjs.map +1 -1
- package/dist/plugins/sui/log-attrs.mjs +11 -0
- package/dist/plugins/sui/log-attrs.mjs.map +1 -0
- package/dist/plugins/sui/mode/external.mjs +4 -12
- package/dist/plugins/sui/mode/external.mjs.map +1 -1
- package/dist/plugins/sui/mode/fork.mjs +19 -16
- package/dist/plugins/sui/mode/fork.mjs.map +1 -1
- package/dist/plugins/sui/mode/live.mjs +4 -17
- package/dist/plugins/sui/mode/live.mjs.map +1 -1
- package/dist/plugins/sui/mode/local.d.mts +1 -0
- package/dist/plugins/sui/mode/local.mjs +203 -61
- package/dist/plugins/sui/mode/local.mjs.map +1 -1
- package/dist/plugins/sui/mode/shared-boot.mjs +18 -23
- package/dist/plugins/sui/mode/shared-boot.mjs.map +1 -1
- package/dist/plugins/sui/mode/shared.d.mts +6 -7
- package/dist/plugins/sui/mode/shared.mjs.map +1 -1
- package/dist/plugins/sui/mode/spec.d.mts +23 -6
- package/dist/{substrate/runtime/sui-move-build → plugins/sui/move}/index.mjs +28 -30
- package/dist/plugins/sui/move/index.mjs.map +1 -0
- package/dist/plugins/sui/move-summary-runner.mjs +8 -4
- package/dist/plugins/sui/move-summary-runner.mjs.map +1 -1
- package/dist/{substrate/network.d.mts → plugins/sui/network-config.d.mts} +11 -10
- package/dist/plugins/sui/network-resolver.d.mts +6 -6
- package/dist/plugins/sui/routable.mjs.map +1 -1
- package/dist/plugins/sui/service.mjs +10 -6
- package/dist/plugins/sui/service.mjs.map +1 -1
- package/dist/plugins/sui/snapshot.mjs +10 -5
- package/dist/plugins/sui/snapshot.mjs.map +1 -1
- package/dist/plugins/wallet/codegen.d.mts +8 -6
- package/dist/plugins/wallet/codegen.mjs +4 -10
- package/dist/plugins/wallet/codegen.mjs.map +1 -1
- package/dist/plugins/wallet/errors.mjs +1 -4
- package/dist/plugins/wallet/errors.mjs.map +1 -1
- package/dist/plugins/wallet/index.d.mts +3 -6
- package/dist/plugins/wallet/index.mjs +16 -21
- package/dist/plugins/wallet/index.mjs.map +1 -1
- package/dist/plugins/wallet/origin-policy.mjs +3 -3
- package/dist/plugins/wallet/origin-policy.mjs.map +1 -1
- package/dist/plugins/wallet/pairing.mjs +6 -24
- package/dist/plugins/wallet/pairing.mjs.map +1 -1
- package/dist/plugins/wallet/protocol.mjs.map +1 -1
- package/dist/plugins/wallet/routable.mjs.map +1 -1
- package/dist/plugins/wallet/server.mjs +17 -24
- package/dist/plugins/wallet/server.mjs.map +1 -1
- package/dist/plugins/wallet/service.d.mts +2 -2
- package/dist/plugins/wallet/service.mjs +4 -15
- package/dist/plugins/wallet/service.mjs.map +1 -1
- package/dist/plugins/wallet/snapshot.mjs.map +1 -1
- package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs +1 -5
- package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs.map +1 -1
- package/dist/plugins/walrus/codegen.d.mts +2 -13
- package/dist/plugins/walrus/codegen.mjs +93 -28
- package/dist/plugins/walrus/codegen.mjs.map +1 -1
- package/dist/plugins/walrus/deploy-paths.mjs +2 -3
- package/dist/plugins/walrus/deploy-paths.mjs.map +1 -1
- package/dist/plugins/walrus/deploy.mjs +26 -19
- package/dist/plugins/walrus/deploy.mjs.map +1 -1
- package/dist/plugins/walrus/errors.mjs +1 -8
- package/dist/plugins/walrus/errors.mjs.map +1 -1
- package/dist/plugins/walrus/faucet-strategy.mjs +15 -1
- package/dist/plugins/walrus/faucet-strategy.mjs.map +1 -1
- package/dist/plugins/walrus/index.d.mts +13 -44
- package/dist/plugins/walrus/index.mjs +119 -122
- package/dist/plugins/walrus/index.mjs.map +1 -1
- package/dist/plugins/walrus/mode/known-deploy.mjs +6 -6
- package/dist/plugins/walrus/mode/known-deploy.mjs.map +1 -1
- package/dist/plugins/walrus/mode/local-cluster.d.mts +2 -2
- package/dist/plugins/walrus/mode/local-cluster.mjs +2 -10
- package/dist/plugins/walrus/mode/local-cluster.mjs.map +1 -1
- package/dist/plugins/walrus/plugin-key.mjs.map +1 -1
- package/dist/plugins/walrus/registry-publish.mjs.map +1 -1
- package/dist/plugins/walrus/routable.mjs.map +1 -1
- package/dist/plugins/walrus/service.mjs.map +1 -1
- package/dist/plugins/walrus/snapshot.mjs +3 -3
- package/dist/plugins/walrus/snapshot.mjs.map +1 -1
- package/dist/plugins/walrus/storage-nodes.mjs +53 -14
- package/dist/plugins/walrus/storage-nodes.mjs.map +1 -1
- package/dist/plugins/walrus/wal-swap.mjs +4 -8
- package/dist/plugins/walrus/wal-swap.mjs.map +1 -1
- package/dist/primitives/artifact-publisher.mjs.map +1 -1
- package/dist/primitives/cache.d.mts +1 -1
- package/dist/runtime/docker/client.mjs +47 -3
- package/dist/runtime/docker/client.mjs.map +1 -1
- package/dist/runtime/docker/container.mjs +37 -57
- package/dist/runtime/docker/container.mjs.map +1 -1
- package/dist/runtime/docker/errors.mjs.map +1 -1
- package/dist/runtime/docker/exec.mjs +2 -2
- package/dist/runtime/docker/exec.mjs.map +1 -1
- package/dist/runtime/docker/image.mjs +10 -11
- package/dist/runtime/docker/image.mjs.map +1 -1
- package/dist/runtime/docker/index.mjs +0 -1
- package/dist/runtime/docker/inspect-and-decode.mjs.map +1 -1
- package/dist/runtime/docker/inventory.mjs +9 -9
- package/dist/runtime/docker/inventory.mjs.map +1 -1
- package/dist/runtime/docker/labels.mjs +12 -1
- package/dist/runtime/docker/labels.mjs.map +1 -1
- package/dist/runtime/docker/network.mjs +6 -6
- package/dist/runtime/docker/network.mjs.map +1 -1
- package/dist/runtime/docker/render-run-args.mjs.map +1 -1
- package/dist/runtime/docker/service.mjs +31 -45
- package/dist/runtime/docker/service.mjs.map +1 -1
- package/dist/runtime/docker/sweep.mjs +14 -64
- package/dist/runtime/docker/sweep.mjs.map +1 -1
- package/dist/runtime/docker/volume.mjs +1 -1
- package/dist/runtime/docker/volume.mjs.map +1 -1
- package/dist/runtime/docker/wrap.mjs +14 -2
- package/dist/runtime/docker/wrap.mjs.map +1 -1
- package/dist/substrate/brand.d.mts +2 -5
- package/dist/substrate/brand.mjs +3 -2
- package/dist/substrate/brand.mjs.map +1 -1
- package/dist/substrate/cross-process.mjs +2 -16
- package/dist/substrate/cross-process.mjs.map +1 -1
- package/dist/substrate/event-time.mjs +0 -2
- package/dist/substrate/event-time.mjs.map +1 -1
- package/dist/substrate/events.d.mts +46 -16
- package/dist/substrate/identity.d.mts +11 -5
- package/dist/substrate/manifest.d.mts +33 -26
- package/dist/substrate/manifest.mjs +8 -3
- package/dist/substrate/manifest.mjs.map +1 -1
- package/dist/substrate/options.d.mts +33 -4
- package/dist/substrate/plugin-ctx.d.mts +70 -0
- package/dist/substrate/plugin-ctx.mjs +66 -0
- package/dist/substrate/plugin-ctx.mjs.map +1 -0
- package/dist/substrate/plugin.d.mts +46 -38
- package/dist/substrate/plugin.mjs +13 -9
- package/dist/substrate/plugin.mjs.map +1 -1
- package/dist/substrate/projection.d.mts +1 -1
- package/dist/substrate/runtime/atomic-write.mjs +3 -4
- package/dist/substrate/runtime/atomic-write.mjs.map +1 -1
- package/dist/substrate/runtime/cache/schema.mjs.map +1 -1
- package/dist/substrate/runtime/cache/service.mjs +50 -20
- package/dist/substrate/runtime/cache/service.mjs.map +1 -1
- package/dist/substrate/runtime/config-validation.mjs.map +1 -1
- package/dist/substrate/runtime/control-plane/domain.mjs +34 -12
- package/dist/substrate/runtime/control-plane/domain.mjs.map +1 -1
- package/dist/substrate/runtime/control-plane/service.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/command-channel/channel.mjs +14 -17
- package/dist/substrate/runtime/cross-process/command-channel/channel.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/command-channel/file-channel.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/command-channel/protocol.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/command-channel/runtime-control-lock.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/index.mjs +0 -2
- package/dist/substrate/runtime/cross-process/live-clock.mjs +1 -1
- package/dist/substrate/runtime/cross-process/live-clock.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/liveness.mjs +11 -18
- package/dist/substrate/runtime/cross-process/liveness.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/reclaim-stale-file.mjs +2 -2
- package/dist/substrate/runtime/cross-process/reclaim-stale-file.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/roster.mjs +17 -127
- package/dist/substrate/runtime/cross-process/roster.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/self-pid.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/stack-lock.mjs +29 -28
- package/dist/substrate/runtime/cross-process/stack-lock.mjs.map +1 -1
- package/dist/substrate/runtime/current-plugin.mjs.map +1 -1
- package/dist/substrate/runtime/errors.mjs +1 -13
- package/dist/substrate/runtime/errors.mjs.map +1 -1
- package/dist/substrate/runtime/format-unknown-error.mjs.map +1 -1
- package/dist/substrate/runtime/host-bind-mount-owner.mjs.map +1 -1
- package/dist/substrate/runtime/host-gateway.mjs.map +1 -1
- package/dist/substrate/runtime/host-tree-tar/index.mjs +15 -163
- package/dist/substrate/runtime/host-tree-tar/index.mjs.map +1 -1
- package/dist/substrate/runtime/http-probe.d.mts +1 -3
- package/dist/substrate/runtime/http-probe.mjs.map +1 -1
- package/dist/substrate/runtime/index.mjs +1 -6
- package/dist/substrate/runtime/lease-broker/service.mjs +5 -23
- package/dist/substrate/runtime/lease-broker/service.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/dep-graph.mjs +3 -3
- package/dist/substrate/runtime/lifecycle/dep-graph.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/graph-input-id.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/graph-input-id.mjs +133 -0
- package/dist/substrate/runtime/lifecycle/graph-input-id.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/index.mjs +2 -2
- package/dist/substrate/runtime/lifecycle/plugin-registry.d.mts +1 -1
- package/dist/substrate/runtime/lifecycle/plugin-registry.mjs +22 -1
- package/dist/substrate/runtime/lifecycle/plugin-registry.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/ready-gate.mjs +2 -15
- package/dist/substrate/runtime/lifecycle/ready-gate.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/selective-restart.mjs +29 -25
- package/dist/substrate/runtime/lifecycle/selective-restart.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/signals.mjs +1 -1
- package/dist/substrate/runtime/lifecycle/signals.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/state-machine.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/watch-attribution.d.mts +1 -1
- package/dist/substrate/runtime/lifecycle/watch-attribution.mjs +0 -1
- package/dist/substrate/runtime/lifecycle/watch-attribution.mjs.map +1 -1
- package/dist/substrate/runtime/managed-container.d.mts +5 -1
- package/dist/substrate/runtime/managed-container.mjs +8 -10
- package/dist/substrate/runtime/managed-container.mjs.map +1 -1
- package/dist/substrate/runtime/manifest/manifest.mjs +8 -30
- package/dist/substrate/runtime/manifest/manifest.mjs.map +1 -1
- package/dist/substrate/runtime/mode-errors.d.mts +1 -2
- package/dist/substrate/runtime/mode-errors.mjs.map +1 -1
- package/dist/substrate/runtime/observability/cascade-formatter.mjs +1 -11
- package/dist/substrate/runtime/observability/cascade-formatter.mjs.map +1 -1
- package/dist/substrate/runtime/observability/ignore-with-log.mjs.map +1 -1
- package/dist/substrate/runtime/observability/index.d.mts +1 -1
- package/dist/substrate/runtime/observability/index.mjs +4 -6
- package/dist/substrate/runtime/observability/log-attrs.mjs +46 -0
- package/dist/substrate/runtime/observability/log-attrs.mjs.map +1 -0
- package/dist/substrate/runtime/observability/log-store.mjs.map +1 -1
- package/dist/substrate/runtime/observability/logger.mjs +3 -3
- package/dist/substrate/runtime/observability/logger.mjs.map +1 -1
- package/dist/substrate/runtime/observability/output-truncate.mjs.map +1 -1
- package/dist/substrate/runtime/observability/pretty-error.mjs.map +1 -1
- package/dist/substrate/runtime/observability/process-lines.mjs.map +1 -1
- package/dist/substrate/runtime/observability/redaction.mjs.map +1 -1
- package/dist/substrate/runtime/observability/subprocess-capture.mjs +2 -2
- package/dist/substrate/runtime/observability/subprocess-capture.mjs.map +1 -1
- package/dist/substrate/runtime/passthrough-or-wrap.mjs.map +1 -1
- package/dist/substrate/runtime/paths.mjs +27 -9
- package/dist/substrate/runtime/paths.mjs.map +1 -1
- package/dist/substrate/runtime/phase-preserving-produce.mjs.map +1 -1
- package/dist/substrate/runtime/port-broker/service.mjs +10 -27
- package/dist/substrate/runtime/port-broker/service.mjs.map +1 -1
- package/dist/substrate/runtime/post-acquire-tasks.mjs.map +1 -1
- package/dist/substrate/runtime/probes.d.mts +2 -3
- package/dist/substrate/runtime/probes.mjs.map +1 -1
- package/dist/substrate/runtime/process-supervisor.mjs.map +1 -1
- package/dist/substrate/runtime/projection/operational-endpoints.mjs.map +1 -1
- package/dist/substrate/runtime/projection/state-ref.mjs.map +1 -1
- package/dist/substrate/runtime/projection/update.mjs +87 -11
- package/dist/substrate/runtime/projection/update.mjs.map +1 -1
- package/dist/substrate/runtime/random-suffix.mjs.map +1 -1
- package/dist/substrate/runtime/reconcile/fs-plan.mjs +146 -0
- package/dist/substrate/runtime/reconcile/fs-plan.mjs.map +1 -0
- package/dist/substrate/runtime/reconcile/graph.mjs +19 -0
- package/dist/substrate/runtime/reconcile/graph.mjs.map +1 -0
- package/dist/substrate/runtime/reconcile/index.mjs +5 -0
- package/dist/substrate/runtime/reconcile/label.mjs +41 -0
- package/dist/substrate/runtime/reconcile/label.mjs.map +1 -0
- package/dist/substrate/runtime/reconcile/spec.mjs +15 -0
- package/dist/substrate/runtime/reconcile/spec.mjs.map +1 -0
- package/dist/substrate/runtime/retry-policy.d.mts +2 -3
- package/dist/substrate/runtime/retry-policy.mjs.map +1 -1
- package/dist/substrate/runtime/routed-url.mjs.map +1 -1
- package/dist/substrate/runtime/runtime-decode.mjs.map +1 -1
- package/dist/substrate/runtime/scoped-http-server.mjs.map +1 -1
- package/dist/substrate/runtime/stage-and-swap/index.mjs +49 -12
- package/dist/substrate/runtime/stage-and-swap/index.mjs.map +1 -1
- package/dist/substrate/runtime/strategy-registry/chain-keyed-strategy-for.mjs.map +1 -1
- package/dist/substrate/runtime/strategy-registry/chain-probe-for.mjs.map +1 -1
- package/dist/substrate/runtime/strategy-registry/service.mjs +29 -17
- package/dist/substrate/runtime/strategy-registry/service.mjs.map +1 -1
- package/dist/substrate/runtime/subnet-broker.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/acquire-node.mjs +188 -56
- package/dist/substrate/runtime/supervisor/acquire-node.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/background-tasks.mjs +79 -65
- package/dist/substrate/runtime/supervisor/background-tasks.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/command-loop.mjs +82 -23
- package/dist/substrate/runtime/supervisor/command-loop.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/contribution-dispatcher.mjs +16 -0
- package/dist/substrate/runtime/supervisor/contribution-dispatcher.mjs.map +1 -0
- package/dist/substrate/runtime/supervisor/errors.mjs +11 -2
- package/dist/substrate/runtime/supervisor/errors.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/index.mjs +2 -0
- package/dist/substrate/runtime/supervisor/shutdown.mjs +6 -6
- package/dist/substrate/runtime/supervisor/shutdown.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/start-supervisor.mjs +60 -70
- package/dist/substrate/runtime/supervisor/start-supervisor.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/state.d.mts +1 -1
- package/dist/substrate/runtime/supervisor/state.mjs +1 -1
- package/dist/substrate/runtime/supervisor/state.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/teardown.mjs +10 -9
- package/dist/substrate/runtime/supervisor/teardown.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/wiring.mjs +6 -20
- package/dist/substrate/runtime/supervisor/wiring.mjs.map +1 -1
- package/dist/substrate/runtime/tar/reader.mjs +216 -0
- package/dist/substrate/runtime/tar/reader.mjs.map +1 -0
- package/dist/substrate/runtime/typed-env.mjs.map +1 -1
- package/dist/substrate/versioned-doc-schema.mjs.map +1 -1
- package/dist/substrate/versioned-doc-sync.mjs +5 -5
- package/dist/substrate/versioned-doc-sync.mjs.map +1 -1
- package/dist/surfaces/cli/command-tree.mjs +49 -7
- package/dist/surfaces/cli/command-tree.mjs.map +1 -1
- package/dist/surfaces/cli/commands/config.mjs +1 -1
- package/dist/surfaces/cli/commands/config.mjs.map +1 -1
- package/dist/surfaces/cli/commands/confirm-node.mjs.map +1 -1
- package/dist/surfaces/cli/commands/confirm.mjs.map +1 -1
- package/dist/surfaces/cli/commands/doctor.mjs +1 -1
- package/dist/surfaces/cli/commands/doctor.mjs.map +1 -1
- package/dist/surfaces/cli/commands/prune-picker-entry.mjs.map +1 -1
- package/dist/surfaces/cli/commands/prune-picker.mjs.map +1 -1
- package/dist/surfaces/cli/commands/prune.mjs +1 -1
- package/dist/surfaces/cli/commands/prune.mjs.map +1 -1
- package/dist/surfaces/cli/commands/snapshot.mjs +1 -1
- package/dist/surfaces/cli/commands/snapshot.mjs.map +1 -1
- package/dist/surfaces/cli/commands/status.mjs +1 -1
- package/dist/surfaces/cli/commands/status.mjs.map +1 -1
- package/dist/surfaces/cli/commands/supervisor-presence.mjs.map +1 -1
- package/dist/surfaces/cli/commands/wipe.mjs +3 -4
- package/dist/surfaces/cli/commands/wipe.mjs.map +1 -1
- package/dist/surfaces/cli/envelope.mjs.map +1 -1
- package/dist/surfaces/cli/errors.mjs.map +1 -1
- package/dist/surfaces/cli/flags.mjs.map +1 -1
- package/dist/surfaces/cli/index.mjs +45 -14
- package/dist/surfaces/cli/index.mjs.map +1 -1
- package/dist/surfaces/cli/output.mjs.map +1 -1
- package/dist/surfaces/cli/sysexits.mjs.map +1 -1
- package/dist/surfaces/tui/app.mjs +0 -21
- package/dist/surfaces/tui/app.mjs.map +1 -1
- package/dist/surfaces/tui/dashboard.mjs +0 -48
- package/dist/surfaces/tui/dashboard.mjs.map +1 -1
- package/dist/surfaces/tui/display-derivation.mjs +80 -16
- package/dist/surfaces/tui/display-derivation.mjs.map +1 -1
- package/dist/surfaces/tui/errors.mjs.map +1 -1
- package/dist/surfaces/tui/event-log.mjs +0 -9
- package/dist/surfaces/tui/event-log.mjs.map +1 -1
- package/dist/surfaces/tui/heartbeat.mjs.map +1 -1
- package/dist/surfaces/tui/index.mjs +2 -2
- package/dist/surfaces/tui/index.mjs.map +1 -1
- package/dist/surfaces/tui/input.mjs.map +1 -1
- package/dist/surfaces/tui/mode-detect.mjs.map +1 -1
- package/dist/surfaces/tui/mount-ink.mjs.map +1 -1
- package/dist/surfaces/tui/plain-renderer.mjs +26 -19
- package/dist/surfaces/tui/plain-renderer.mjs.map +1 -1
- package/dist/surfaces/tui/resource-table.mjs +8 -10
- package/dist/surfaces/tui/resource-table.mjs.map +1 -1
- package/images/postgres/Dockerfile +0 -1
- package/images/sui/Dockerfile +27 -54
- package/images/sui/entrypoint.sh +17 -179
- package/package.json +23 -15
- package/dashboard-ui/assets/index-Bmi1UtAg.js +0 -1356
- package/dashboard-ui/assets/index-D5EShVt4.js +0 -3
- package/dashboard-ui/assets/index-Deml9drg.css +0 -1
- package/dist/api/plugin-errors.d.mts +0 -7
- package/dist/api/plugin-errors.mjs +0 -10
- package/dist/api/plugin-errors.mjs.map +0 -1
- package/dist/cli/wirings/build-verb-layers.mjs +0 -42
- package/dist/cli/wirings/build-verb-layers.mjs.map +0 -1
- package/dist/contracts/capability-decl.d.mts +0 -40
- package/dist/orchestrators/built-in-plugin-layers.mjs +0 -54
- package/dist/orchestrators/built-in-plugin-layers.mjs.map +0 -1
- package/dist/orchestrators/run.mjs +0 -91
- package/dist/orchestrators/run.mjs.map +0 -1
- package/dist/orchestrators/runtime-composition.d.mts +0 -10
- package/dist/orchestrators/runtime-composition.mjs +0 -252
- package/dist/orchestrators/runtime-composition.mjs.map +0 -1
- package/dist/orchestrators/snapshot/capture-command.d.mts +0 -1
- package/dist/orchestrators/snapshot/capture-command.mjs +0 -25
- package/dist/orchestrators/snapshot/capture-command.mjs.map +0 -1
- package/dist/orchestrators/snapshot/pending-marker.mjs +0 -99
- package/dist/orchestrators/snapshot/pending-marker.mjs.map +0 -1
- package/dist/orchestrators/snapshot/recover-pending.mjs +0 -223
- package/dist/orchestrators/snapshot/recover-pending.mjs.map +0 -1
- package/dist/orchestrators/snapshot/state-document.d.mts +0 -1
- package/dist/orchestrators/snapshot/state-document.mjs +0 -58
- package/dist/orchestrators/snapshot/state-document.mjs.map +0 -1
- package/dist/plugins/account/spans.mjs +0 -16
- package/dist/plugins/account/spans.mjs.map +0 -1
- package/dist/plugins/account/variants/env.mjs +0 -24
- package/dist/plugins/account/variants/env.mjs.map +0 -1
- package/dist/plugins/account/variants/inline.mjs +0 -13
- package/dist/plugins/account/variants/inline.mjs.map +0 -1
- package/dist/plugins/account/variants/keystore.mjs +0 -91
- package/dist/plugins/account/variants/keystore.mjs.map +0 -1
- package/dist/plugins/action/spans.mjs +0 -11
- package/dist/plugins/action/spans.mjs.map +0 -1
- package/dist/plugins/coin/spans.mjs +0 -20
- package/dist/plugins/coin/spans.mjs.map +0 -1
- package/dist/plugins/deepbook/spans.mjs +0 -18
- package/dist/plugins/deepbook/spans.mjs.map +0 -1
- package/dist/plugins/faucet/spans.mjs +0 -12
- package/dist/plugins/faucet/spans.mjs.map +0 -1
- package/dist/plugins/package/spans.mjs +0 -14
- package/dist/plugins/package/spans.mjs.map +0 -1
- package/dist/plugins/postgres/codegen.mjs +0 -42
- package/dist/plugins/postgres/codegen.mjs.map +0 -1
- package/dist/plugins/postgres/connection.d.mts +0 -33
- package/dist/plugins/postgres/connection.mjs.map +0 -1
- package/dist/plugins/postgres/db-ensure.mjs.map +0 -1
- package/dist/plugins/postgres/errors.d.mts +0 -60
- package/dist/plugins/postgres/errors.mjs +0 -29
- package/dist/plugins/postgres/errors.mjs.map +0 -1
- package/dist/plugins/postgres/index.d.mts +0 -37
- package/dist/plugins/postgres/index.mjs +0 -68
- package/dist/plugins/postgres/index.mjs.map +0 -1
- package/dist/plugins/postgres/routable.mjs +0 -33
- package/dist/plugins/postgres/routable.mjs.map +0 -1
- package/dist/plugins/postgres/service.d.mts +0 -50
- package/dist/plugins/postgres/service.mjs +0 -179
- package/dist/plugins/postgres/service.mjs.map +0 -1
- package/dist/plugins/postgres/snapshot.mjs +0 -32
- package/dist/plugins/postgres/snapshot.mjs.map +0 -1
- package/dist/plugins/postgres/spans.mjs +0 -11
- package/dist/plugins/postgres/spans.mjs.map +0 -1
- package/dist/plugins/seal/spans.mjs +0 -18
- package/dist/plugins/seal/spans.mjs.map +0 -1
- package/dist/plugins/sui/spans.mjs +0 -17
- package/dist/plugins/sui/spans.mjs.map +0 -1
- package/dist/plugins/wallet/spans.mjs +0 -22
- package/dist/plugins/wallet/spans.mjs.map +0 -1
- package/dist/plugins/walrus/registry-publish.d.mts +0 -24
- package/dist/plugins/walrus/spans.mjs +0 -18
- package/dist/plugins/walrus/spans.mjs.map +0 -1
- package/dist/runtime/docker/logs.d.mts +0 -1
- package/dist/runtime/docker/logs.mjs +0 -34
- package/dist/runtime/docker/logs.mjs.map +0 -1
- package/dist/substrate/runtime/artifact-publisher/index.mjs +0 -86
- package/dist/substrate/runtime/artifact-publisher/index.mjs.map +0 -1
- package/dist/substrate/runtime/capability-sinks/index.d.mts +0 -1
- package/dist/substrate/runtime/capability-sinks/index.mjs +0 -3
- package/dist/substrate/runtime/capability-sinks/layer.d.mts +0 -1
- package/dist/substrate/runtime/capability-sinks/layer.mjs +0 -31
- package/dist/substrate/runtime/capability-sinks/layer.mjs.map +0 -1
- package/dist/substrate/runtime/capability-sinks/service.d.mts +0 -95
- package/dist/substrate/runtime/capability-sinks/service.mjs +0 -69
- package/dist/substrate/runtime/capability-sinks/service.mjs.map +0 -1
- package/dist/substrate/runtime/cross-process/lock.d.mts +0 -1
- package/dist/substrate/runtime/cross-process/lock.mjs +0 -23
- package/dist/substrate/runtime/cross-process/lock.mjs.map +0 -1
- package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs +0 -113
- package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs.map +0 -1
- package/dist/substrate/runtime/lifecycle/lifecycle-fact.mjs +0 -31
- package/dist/substrate/runtime/lifecycle/lifecycle-fact.mjs.map +0 -1
- package/dist/substrate/runtime/observability/formatter-registry.d.mts +0 -1
- package/dist/substrate/runtime/observability/formatter-registry.mjs +0 -48
- package/dist/substrate/runtime/observability/formatter-registry.mjs.map +0 -1
- package/dist/substrate/runtime/observability/span-store.d.mts +0 -1
- package/dist/substrate/runtime/observability/span-store.mjs +0 -110
- package/dist/substrate/runtime/observability/span-store.mjs.map +0 -1
- package/dist/substrate/runtime/observability/spans.d.mts +0 -1
- package/dist/substrate/runtime/observability/spans.mjs +0 -87
- package/dist/substrate/runtime/observability/spans.mjs.map +0 -1
- package/dist/substrate/runtime/projection/index.mjs +0 -4
- package/dist/substrate/runtime/projection/persisted.mjs +0 -213
- package/dist/substrate/runtime/projection/persisted.mjs.map +0 -1
- package/dist/substrate/runtime/scoped-multimap/service.mjs +0 -52
- package/dist/substrate/runtime/scoped-multimap/service.mjs.map +0 -1
- package/dist/substrate/runtime/scoped-ref-map/index.mjs +0 -2
- package/dist/substrate/runtime/scoped-ref-map/service.mjs +0 -83
- package/dist/substrate/runtime/scoped-ref-map/service.mjs.map +0 -1
- package/dist/substrate/runtime/state-store/index.mjs +0 -3
- package/dist/substrate/runtime/state-store/schema.d.mts +0 -1
- package/dist/substrate/runtime/state-store/schema.mjs +0 -41
- package/dist/substrate/runtime/state-store/schema.mjs.map +0 -1
- package/dist/substrate/runtime/state-store/service.d.mts +0 -1
- package/dist/substrate/runtime/state-store/service.mjs +0 -145
- package/dist/substrate/runtime/state-store/service.mjs.map +0 -1
- package/dist/substrate/runtime/sui-execute/index.mjs.map +0 -1
- package/dist/substrate/runtime/sui-execute/sign-and-dispatch.mjs.map +0 -1
- package/dist/substrate/runtime/sui-ledger/object-ref.mjs.map +0 -1
- package/dist/substrate/runtime/sui-move-build/index.mjs.map +0 -1
- package/dist/substrate/runtime/supervisor/dispatch-contributions.mjs +0 -151
- package/dist/substrate/runtime/supervisor/dispatch-contributions.mjs.map +0 -1
- package/dist/substrate/state-store.d.mts +0 -1
- /package/dist/orchestrators/{snapshot/pending-marker.d.mts → codegen/id-config.d.mts} +0 -0
- /package/dist/orchestrators/snapshot/{recover-pending.d.mts → interrupted-restore.d.mts} +0 -0
- /package/dist/{substrate/runtime/sui-execute → plugins/sui/exec}/sign-and-dispatch.d.mts +0 -0
- /package/dist/plugins/{postgres/snapshot.d.mts → sui/ledger/object-ref.d.mts} +0 -0
- /package/dist/{substrate/runtime/sui-move-build → plugins/sui/move}/index.d.mts +0 -0
- /package/dist/substrate/runtime/{state-store/index.d.mts → reconcile/graph.d.mts} +0 -0
- /package/dist/substrate/runtime/{cross-process/snapshot-reservation.d.mts → supervisor/contribution-dispatcher.d.mts} +0 -0
|
@@ -1,41 +1,34 @@
|
|
|
1
1
|
import { builder } from "./builder.mjs";
|
|
2
2
|
import { AccountScheme, AccountSource, DeepbookMode, ErrorSeverity, FundingStatus, Health, LifecycleStatus, LogLevel, PackageKind, PluginRole, RowSection, WireProtocol } from "./enums.mjs";
|
|
3
|
+
import { deriveHealth, deriveStackViewModel } from "../../../surfaces/tui/display-derivation.mjs";
|
|
3
4
|
import { Effect, SubscriptionRef } from "effect";
|
|
4
5
|
//#region src/plugins/dashboard/schema/types.ts
|
|
5
|
-
/** Compute the stack health summary from the projection rows.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
/** Compute the stack health summary from the projection rows. Delegates to
|
|
7
|
+
* the surface-neutral `deriveStackViewModel` (the single canonical
|
|
8
|
+
* bucketing) + `deriveHealth(counts, 'web')` (the named web policy), then
|
|
9
|
+
* folds the ViewModel's discrete `stoppedRows` into this adapter's `ready`
|
|
10
|
+
* field — preserving the web GraphQL stopped→ready contract. The fold lives
|
|
11
|
+
* HERE, in the web adapter, not in the shared ViewModel, so the TUI policy
|
|
12
|
+
* is unaffected. `active` counts rows mid-flight (acquiring/stopping);
|
|
13
|
+
* `waiting` counts rows that have not started (pending). Overall `health`
|
|
14
|
+
* is `failed`→blocked, any-active→active, all-(ready|stopped) (with ≥1
|
|
15
|
+
* row)→ready, otherwise empty. */
|
|
9
16
|
const computeHealthSummary = (rows) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
ready += 1;
|
|
19
|
-
break;
|
|
20
|
-
case "acquiring":
|
|
21
|
-
case "stopping":
|
|
22
|
-
active += 1;
|
|
23
|
-
break;
|
|
24
|
-
case "failed":
|
|
25
|
-
failed += 1;
|
|
26
|
-
break;
|
|
27
|
-
case "pending":
|
|
28
|
-
waiting += 1;
|
|
29
|
-
break;
|
|
30
|
-
}
|
|
31
|
-
const total = rows.length;
|
|
17
|
+
const vm = deriveStackViewModel({
|
|
18
|
+
rows,
|
|
19
|
+
endpoints: [],
|
|
20
|
+
accounts: [],
|
|
21
|
+
packages: [],
|
|
22
|
+
errors: []
|
|
23
|
+
});
|
|
24
|
+
const health = deriveHealth(vm, "web");
|
|
32
25
|
return {
|
|
33
|
-
total,
|
|
34
|
-
ready,
|
|
35
|
-
active,
|
|
36
|
-
failed,
|
|
37
|
-
waiting,
|
|
38
|
-
health
|
|
26
|
+
total: vm.total,
|
|
27
|
+
ready: vm.readyRows + vm.stoppedRows,
|
|
28
|
+
active: vm.activeRows,
|
|
29
|
+
failed: vm.failedRows,
|
|
30
|
+
waiting: vm.waitingRows,
|
|
31
|
+
health
|
|
39
32
|
};
|
|
40
33
|
};
|
|
41
34
|
const readSnapshot = (ref) => Effect.runPromise(SubscriptionRef.get(ref));
|
|
@@ -275,6 +268,10 @@ const SnapshotEntry = builder.objectRef("SnapshotEntry").implement({
|
|
|
275
268
|
app: t.exposeString("app", { nullable: true }),
|
|
276
269
|
stack: t.exposeString("stack", { nullable: true }),
|
|
277
270
|
network: t.exposeString("network", { nullable: true }),
|
|
271
|
+
snapshotGraphInputId: t.exposeString("snapshotGraphInputId", { nullable: true }),
|
|
272
|
+
currentGraphInputId: t.exposeString("currentGraphInputId", { nullable: true }),
|
|
273
|
+
graphInputStatus: t.exposeString("graphInputStatus"),
|
|
274
|
+
graphInputWarning: t.exposeString("graphInputWarning", { nullable: true }),
|
|
278
275
|
participants: t.exposeStringList("participants"),
|
|
279
276
|
containerCount: t.exposeInt("containerCount"),
|
|
280
277
|
subtreeCount: t.exposeInt("subtreeCount"),
|
|
@@ -299,7 +296,7 @@ const DeepbookInfo = builder.objectRef("DeepbookInfo").implement({
|
|
|
299
296
|
type: DeepbookMode,
|
|
300
297
|
resolve: (d) => d.mode
|
|
301
298
|
}),
|
|
302
|
-
|
|
299
|
+
network: t.exposeString("network"),
|
|
303
300
|
packageId: t.exposeString("packageId"),
|
|
304
301
|
registryId: t.exposeString("registryId"),
|
|
305
302
|
adminCapId: t.exposeString("adminCapId", { nullable: true }),
|
|
@@ -310,7 +307,8 @@ const DeepbookInfo = builder.objectRef("DeepbookInfo").implement({
|
|
|
310
307
|
}),
|
|
311
308
|
marketMakerRunning: t.exposeBoolean("marketMakerRunning"),
|
|
312
309
|
serverUrl: t.exposeString("serverUrl", { nullable: true }),
|
|
313
|
-
indexerUrl: t.exposeString("indexerUrl", { nullable: true })
|
|
310
|
+
indexerUrl: t.exposeString("indexerUrl", { nullable: true }),
|
|
311
|
+
narrowingFault: t.exposeString("narrowingFault", { nullable: true })
|
|
314
312
|
})
|
|
315
313
|
});
|
|
316
314
|
const SealKeyServer = builder.objectRef("SealKeyServer").implement({
|
|
@@ -334,7 +332,8 @@ const SealInfo = builder.objectRef("SealInfo").implement({
|
|
|
334
332
|
type: [SealKeyServer],
|
|
335
333
|
resolve: (s) => s.keyServers
|
|
336
334
|
}),
|
|
337
|
-
threshold: t.exposeInt("threshold")
|
|
335
|
+
threshold: t.exposeInt("threshold"),
|
|
336
|
+
narrowingFault: t.exposeString("narrowingFault", { nullable: true })
|
|
338
337
|
})
|
|
339
338
|
});
|
|
340
339
|
const CoinCap = builder.objectRef("CoinCap").implement({
|
|
@@ -349,7 +348,8 @@ const CoinCap = builder.objectRef("CoinCap").implement({
|
|
|
349
348
|
resolve: (c) => c.source
|
|
350
349
|
}),
|
|
351
350
|
treasuryCapId: t.exposeString("treasuryCapId", { nullable: true }),
|
|
352
|
-
packageId: t.exposeString("packageId", { nullable: true })
|
|
351
|
+
packageId: t.exposeString("packageId", { nullable: true }),
|
|
352
|
+
narrowingFault: t.exposeString("narrowingFault", { nullable: true })
|
|
353
353
|
})
|
|
354
354
|
});
|
|
355
355
|
const FundableCoin = builder.objectRef("FundableCoin").implement({
|
|
@@ -365,31 +365,6 @@ const FundableCoin = builder.objectRef("FundableCoin").implement({
|
|
|
365
365
|
requiresAccountSigner: t.exposeBoolean("requiresAccountSigner")
|
|
366
366
|
})
|
|
367
367
|
});
|
|
368
|
-
const PostgresTable = builder.objectRef("PostgresTable").implement({
|
|
369
|
-
description: "Per-table row estimate + total size (bytes).",
|
|
370
|
-
fields: (t) => ({
|
|
371
|
-
schema: t.exposeString("schema"),
|
|
372
|
-
name: t.exposeString("name"),
|
|
373
|
-
rowEstimate: t.exposeFloat("rowEstimate"),
|
|
374
|
-
totalBytes: t.exposeFloat("totalBytes")
|
|
375
|
-
})
|
|
376
|
-
});
|
|
377
|
-
const PostgresStats = builder.objectRef("PostgresStats").implement({
|
|
378
|
-
description: "Postgres wire-protocol stats (db size, connections, per-table). Gathered by exec; the browser cannot speak the PG protocol.",
|
|
379
|
-
fields: (t) => ({
|
|
380
|
-
pluginKey: t.exposeString("pluginKey"),
|
|
381
|
-
database: t.exposeString("database"),
|
|
382
|
-
plainUrl: t.exposeString("plainUrl"),
|
|
383
|
-
databaseBytes: t.exposeFloat("databaseBytes"),
|
|
384
|
-
connectionCount: t.exposeInt("connectionCount"),
|
|
385
|
-
tables: t.field({
|
|
386
|
-
type: [PostgresTable],
|
|
387
|
-
resolve: (p) => p.tables
|
|
388
|
-
}),
|
|
389
|
-
available: t.exposeBoolean("available"),
|
|
390
|
-
detail: t.exposeString("detail", { nullable: true })
|
|
391
|
-
})
|
|
392
|
-
});
|
|
393
368
|
const fieldsJson = (fields) => {
|
|
394
369
|
try {
|
|
395
370
|
return JSON.stringify(fields);
|
|
@@ -415,27 +390,6 @@ const LogRecordType = builder.objectRef("LogRecord").implement({
|
|
|
415
390
|
})
|
|
416
391
|
})
|
|
417
392
|
});
|
|
418
|
-
const SpanRecordType = builder.objectRef("SpanRecord").implement({
|
|
419
|
-
description: "One completed span (queryable Console \"Traces\" tab). Recorded by the supervisor's recording Tracer.",
|
|
420
|
-
fields: (t) => ({
|
|
421
|
-
traceId: t.exposeString("traceId"),
|
|
422
|
-
spanId: t.exposeString("spanId"),
|
|
423
|
-
parentId: t.exposeString("parentId", { nullable: true }),
|
|
424
|
-
name: t.exposeString("name"),
|
|
425
|
-
service: t.exposeString("service", { nullable: true }),
|
|
426
|
-
startMillis: t.exposeFloat("startMillis"),
|
|
427
|
-
durationMillis: t.exposeFloat("durationMillis"),
|
|
428
|
-
status: t.field({
|
|
429
|
-
type: "String",
|
|
430
|
-
resolve: (r) => r.status
|
|
431
|
-
}),
|
|
432
|
-
/** Flattened span attributes as a JSON string. */
|
|
433
|
-
attributesJson: t.field({
|
|
434
|
-
type: "String",
|
|
435
|
-
resolve: (r) => fieldsJson(r.attributes)
|
|
436
|
-
})
|
|
437
|
-
})
|
|
438
|
-
});
|
|
439
393
|
const LogFilterInput = builder.inputType("LogFilter", { fields: (t) => ({
|
|
440
394
|
services: t.stringList({ required: false }),
|
|
441
395
|
/** Levels (trace/debug/info/warn/error/fatal). Strings, not an enum
|
|
@@ -445,14 +399,6 @@ const LogFilterInput = builder.inputType("LogFilter", { fields: (t) => ({
|
|
|
445
399
|
sinceMillis: t.float({ required: false }),
|
|
446
400
|
limit: t.int({ required: false })
|
|
447
401
|
}) });
|
|
448
|
-
const SpanFilterInput = builder.inputType("SpanFilter", { fields: (t) => ({
|
|
449
|
-
services: t.stringList({ required: false }),
|
|
450
|
-
/** Statuses ('ok' / 'error'). Strings, not an enum. */
|
|
451
|
-
statuses: t.stringList({ required: false }),
|
|
452
|
-
search: t.string({ required: false }),
|
|
453
|
-
sinceMillis: t.float({ required: false }),
|
|
454
|
-
limit: t.int({ required: false })
|
|
455
|
-
}) });
|
|
456
402
|
const StackState = builder.objectRef("StackState").implement({
|
|
457
403
|
description: "A full live projection snapshot.",
|
|
458
404
|
fields: (t) => ({
|
|
@@ -503,6 +449,6 @@ const StackState = builder.objectRef("StackState").implement({
|
|
|
503
449
|
})
|
|
504
450
|
});
|
|
505
451
|
//#endregion
|
|
506
|
-
export { Account, CoinCap, DeepbookInfo, FundableCoin, LogFilterInput, LogRecordType, Package,
|
|
452
|
+
export { Account, CoinCap, DeepbookInfo, FundableCoin, LogFilterInput, LogRecordType, Package, SealInfo, Service, SnapshotEntry, StackState };
|
|
507
453
|
|
|
508
454
|
//# sourceMappingURL=types.mjs.map
|
|
@@ -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,QA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AAa;CACb,SAAS,OAAO;EACf,UAAU,EAAE,MAAM;GAAE,MAAM;GAAU,UAAU,MAAM,EAAE;GAAU,CAAC;EACjE,OAAO,EAAE,MAAM;GAAE,MAAM;GAAO,UAAU,MAAM,EAAE;GAAO,CAAC;EACxD,SAAS,EAAE,MAAM;GAAE,MAAM;GAAe,UAAU,MAAM,qBAAqB,EAAE,KAAK;GAAE,CAAC;EACvF,UAAU,EAAE,MAAM;GACjB,MAAM,CAAC,QAAQ;GACf,UAAU,MAAM,EAAE,KAAK,KAAK,SAAS;IAAE;IAAK,UAAU;IAAG,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\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 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\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\tmarketMakerRunning: t.exposeBoolean('marketMakerRunning'),\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":";;;;;;;;;;;;;;;AAoFA,MAAa,wBAAwB,SAAkD;CACtF,MAAM,KAAK,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E,UAAU,MAAM,CAAC;AACjC,GACD,CAAC;AAGD,MAAa,aAAa,QAAQ,UAA6B,YAAY,CAAC,CAAC,UAAU;CACtF,aAAa;CACb,SAAS,OAAO;EACf,UAAU,EAAE,MAAM;GAAE,MAAM;GAAU,UAAU,MAAM,EAAE;EAAS,CAAC;EAChE,OAAO,EAAE,MAAM;GAAE,MAAM;GAAO,UAAU,MAAM,EAAE;EAAM,CAAC;EACvD,SAAS,EAAE,MAAM;GAAE,MAAM;GAAe,UAAU,MAAM,qBAAqB,EAAE,IAAI;EAAE,CAAC;EACtF,UAAU,EAAE,MAAM;GACjB,MAAM,CAAC,OAAO;GACd,UAAU,MAAM,EAAE,KAAK,KAAK,SAAS;IAAE;IAAK,UAAU;GAAE,EAAE;EAC3D,CAAC;EACD,WAAW,EAAE,MAAM;GAAE,MAAM,CAAC,QAAQ;GAAG,UAAU,MAAM,EAAE;EAAU,CAAC;EACpE,UAAU,EAAE,MAAM;GAAE,MAAM,CAAC,OAAO;GAAG,UAAU,MAAM,EAAE;EAAS,CAAC;EACjE,UAAU,EAAE,MAAM;GAAE,MAAM,CAAC,OAAO;GAAG,UAAU,MAAM,EAAE;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,
|
|
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,IAAI,CAAC,aAAa,KAC9B;;AAG9B,MAAM,YAAY,oBAAoC;;;;;;;;;;wBAU9B,gBAAgB,IAAI,gBAAgB;;;;aAI/C,KAAK,UAAU,gBAAgB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkC7C,MAAM,kBACJ,YACA,YAAkC;CAClC,MAAM,SAAS,QAAQ,QAAQ,IAAI,SAAS;AAI5C,KAAI,YAAY,QAAQ,OAAO,KAAK,KAAM,QAAO;AAEjD,QAAO;EAAE,QAAQ,CAAC,OAAiB;EAAE,aAAa;EAAO;;;AAI3D,MAAM,mBAAmB,QAAwB;CAChD,MAAM,UAAU,IAAI,MAAM,QAAQ,EAAE,CAAC,MAAM;AAC3C,KAAI;AACH,SAAO,mBAAmB,QA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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.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,GAAG,CAAC;AAExF,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;AACV;AAEA,MAAM,kBAAkB,SAAyB;CAChD,MAAM,MAAM,KAAK,YAAY,GAAG;CAEhC,OAAO,cADK,QAAQ,K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QAAQ,KACP,gDAAgD,UAAU,oJAC3D;CAGD,MAAM,OAAO,WAAW;EACvB,QAAQ;EACR,eAAe,KAAK;EACpB;EACA,UAAU;EACV,aAAa;EAMb,MAAM,eAAe,KAAK,YAAY;CACvC,CAAC;CACD,MAAM,eAAe,SAAS,eAAe;CAK7C,MAAM,aAAa,aAClB,aAAa,mBAAmB,SAAS,WAAW,GAAG,gBAAgB,EAAE;CAE1E,MAAM,YAAY,KAAyC,YAA6B;EACvF,IAAI;GACH,IAAI,CAAC,SAAS,OAAO,CAAC,CAAC,OAAO,GAAG,OAAO;GACxC,MAAM,OAAO,aAAa,OAAO;GACjC,IAAI,aAAa;GACjB,IAAI,UAAU,gBAAgB,eAAe,OAAO,CAAC;GACrD,IAAI,IAAI,IAAI;GACZ,OAAO;EACR,QAAQ;GACP,OAAO;EACR;CACD;CAEA,QAAQ,KAAK,QAAQ;EAEpB,MAAM,WAAW,gBADL,IAAI,OAAO,GACa;EACpC,IAAI,UAAU,QAAQ,GAAG;GACxB,KAAU,KAAK,GAAG;GAClB;EACD;EAGA,IAAI,CAAC,aAAa;GACjB,IAAI,aAAa;GACjB,IAAI,UAAU,gBAAgB,0BAA0B;GACxD,IAAI,IAAI,YAAY;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
|
|
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
|
-
|
|
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
|
|
39
|
+
export { DeepbookBindings };
|
|
39
40
|
//# sourceMappingURL=codegen.d.mts.map
|
|
@@ -1,15 +1,112 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { keyedBucketSpec, liveBucketCodegen, staticBucketCodegen } from "../../contracts/config-bindings.mjs";
|
|
2
2
|
//#region src/plugins/deepbook/codegen.ts
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|