@mysten-incubation/devstack 0.0.1 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -3
- package/dashboard-ui/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
- package/dashboard-ui/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
- package/dashboard-ui/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
- package/dashboard-ui/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
- package/dashboard-ui/assets/geist-mono-cyrillic-ext-wght-normal-I4S5GZfc.woff2 +0 -0
- package/dashboard-ui/assets/geist-mono-cyrillic-wght-normal-BmXc_FBt.woff2 +0 -0
- package/dashboard-ui/assets/geist-mono-latin-ext-wght-normal-DrnZ1wKl.woff2 +0 -0
- package/dashboard-ui/assets/geist-mono-latin-wght-normal-B_7UjwxQ.woff2 +0 -0
- package/dashboard-ui/assets/geist-mono-symbols2-wght-normal-GZpp1pK2.woff2 +0 -0
- package/dashboard-ui/assets/geist-mono-vietnamese-wght-normal-D8KDMBhC.woff2 +0 -0
- package/dashboard-ui/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
- package/dashboard-ui/assets/index-Bmi1UtAg.js +1356 -0
- package/dashboard-ui/assets/index-D5EShVt4.js +3 -0
- package/dashboard-ui/assets/index-Deml9drg.css +1 -0
- package/dashboard-ui/index.html +13 -0
- package/dist/api/define-capabilities.d.mts +14 -3
- package/dist/api/define-capabilities.mjs +18 -1
- package/dist/api/define-capabilities.mjs.map +1 -1
- package/dist/api/define-devstack.d.mts +1 -1
- package/dist/api/define-devstack.mjs +6 -26
- package/dist/api/define-devstack.mjs.map +1 -1
- package/dist/api/define-plugin.d.mts +1 -0
- package/dist/api/define-plugin.mjs +2 -0
- package/dist/api/inference-network.d.mts +132 -0
- package/dist/api/inference-network.mjs +105 -16
- package/dist/api/inference-network.mjs.map +1 -1
- package/dist/api/plugin-errors.d.mts +7 -0
- package/dist/api/run-stack.d.mts +20 -9
- package/dist/api/run-stack.mjs +56 -29
- package/dist/api/run-stack.mjs.map +1 -1
- package/dist/build-integrations/playwright/config.d.mts +6 -4
- package/dist/build-integrations/playwright/config.mjs +5 -3
- package/dist/build-integrations/playwright/config.mjs.map +1 -1
- package/dist/build-integrations/playwright/errors.d.mts +1 -1
- package/dist/build-integrations/playwright/global-setup.d.mts +43 -17
- package/dist/build-integrations/playwright/global-setup.mjs +250 -13
- package/dist/build-integrations/playwright/global-setup.mjs.map +1 -1
- package/dist/build-integrations/playwright/index.d.mts +5 -3
- package/dist/build-integrations/playwright/index.mjs +4 -2
- package/dist/build-integrations/playwright/stack-context.d.mts +0 -1
- package/dist/build-integrations/playwright/stack-context.mjs +24 -63
- package/dist/build-integrations/playwright/stack-context.mjs.map +1 -1
- package/dist/build-integrations/playwright/wallet-context.d.mts +7 -10
- package/dist/build-integrations/playwright/wallet-context.mjs +8 -13
- package/dist/build-integrations/playwright/wallet-context.mjs.map +1 -1
- package/dist/build-integrations/runtime/cold-start-url.d.mts +5 -0
- package/dist/build-integrations/runtime/cold-start-url.mjs +4 -3
- package/dist/build-integrations/runtime/cold-start-url.mjs.map +1 -1
- package/dist/build-integrations/runtime/conventional-routes.d.mts +51 -0
- package/dist/build-integrations/runtime/conventional-routes.mjs +92 -0
- package/dist/build-integrations/runtime/conventional-routes.mjs.map +1 -0
- package/dist/build-integrations/runtime/discover.d.mts +38 -30
- package/dist/build-integrations/runtime/discover.mjs +73 -70
- package/dist/build-integrations/runtime/discover.mjs.map +1 -1
- package/dist/build-integrations/runtime/endpoint-registry.d.mts +3 -1
- package/dist/build-integrations/runtime/endpoint-registry.mjs +3 -1
- package/dist/build-integrations/runtime/endpoint-registry.mjs.map +1 -1
- package/dist/build-integrations/runtime/index.d.mts +7 -2
- package/dist/build-integrations/runtime/index.mjs +9 -2
- package/dist/build-integrations/runtime/manifest-types.d.mts +2 -0
- package/dist/build-integrations/runtime/manifest-types.mjs +3 -0
- package/dist/build-integrations/runtime/playwright-stack-context-slot.d.mts +29 -0
- package/dist/build-integrations/runtime/playwright-stack-context-slot.mjs +10 -0
- package/dist/build-integrations/runtime/playwright-stack-context-slot.mjs.map +1 -0
- package/dist/build-integrations/runtime/read-stack-context.d.mts +1 -1
- package/dist/build-integrations/runtime/read-stack-context.mjs +10 -4
- package/dist/build-integrations/runtime/read-stack-context.mjs.map +1 -1
- package/dist/build-integrations/runtime/resolve-discovery-env.d.mts +48 -0
- package/dist/build-integrations/runtime/resolve-discovery-env.mjs +42 -0
- package/dist/build-integrations/runtime/resolve-discovery-env.mjs.map +1 -0
- package/dist/build-integrations/runtime/stack-context.d.mts +1 -1
- package/dist/build-integrations/runtime/wallet-paths.mjs +2 -0
- package/dist/build-integrations/vite/index.d.mts +51 -0
- package/dist/build-integrations/vite/index.mjs +73 -0
- package/dist/build-integrations/vite/index.mjs.map +1 -0
- package/dist/build-integrations/vitest/env.d.mts +4 -3
- package/dist/build-integrations/vitest/env.mjs +6 -4
- package/dist/build-integrations/vitest/env.mjs.map +1 -1
- package/dist/build-integrations/vitest/errors.d.mts +25 -4
- package/dist/build-integrations/vitest/errors.mjs +15 -2
- package/dist/build-integrations/vitest/errors.mjs.map +1 -1
- package/dist/build-integrations/vitest/index.d.mts +2 -2
- package/dist/build-integrations/vitest/index.mjs +3 -3
- package/dist/build-integrations/vitest/setup.d.mts +4 -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 +0 -1
- package/dist/build-integrations/vitest/stack-context.mjs +33 -13
- package/dist/build-integrations/vitest/stack-context.mjs.map +1 -1
- package/dist/cli/bail.mjs +23 -0
- package/dist/cli/bail.mjs.map +1 -0
- package/dist/{surfaces/cli/commands → cli}/doctor-probes.mjs +26 -16
- package/dist/cli/doctor-probes.mjs.map +1 -0
- package/dist/cli/main.d.mts +15 -1
- package/dist/cli/main.mjs +166 -482
- package/dist/cli/main.mjs.map +1 -1
- package/dist/cli/prune-direct.mjs +31 -201
- package/dist/cli/prune-direct.mjs.map +1 -1
- package/dist/cli/snapshot-reader.mjs +14 -11
- package/dist/cli/snapshot-reader.mjs.map +1 -1
- package/dist/cli/up-lifecycle.mjs +4 -1
- package/dist/cli/up-lifecycle.mjs.map +1 -1
- package/dist/cli/wirings/apply.mjs +95 -0
- package/dist/cli/wirings/apply.mjs.map +1 -0
- package/dist/cli/wirings/build-verb-layers.mjs +42 -0
- package/dist/cli/wirings/build-verb-layers.mjs.map +1 -0
- package/dist/cli/wirings/config-loader.mjs +69 -0
- package/dist/cli/wirings/config-loader.mjs.map +1 -0
- package/dist/cli/wirings/engine-command.mjs +30 -0
- package/dist/cli/wirings/engine-command.mjs.map +1 -0
- package/dist/cli/wirings/identity.mjs +72 -0
- package/dist/cli/wirings/identity.mjs.map +1 -0
- package/dist/cli/wirings/provide-file-system.mjs +7 -0
- package/dist/cli/wirings/provide-file-system.mjs.map +1 -0
- package/dist/cli/wirings/snapshot.mjs +177 -0
- package/dist/cli/wirings/snapshot.mjs.map +1 -0
- package/dist/cli/wirings/up.mjs +287 -0
- package/dist/cli/wirings/up.mjs.map +1 -0
- package/dist/cli/wirings/wipe.mjs +40 -0
- package/dist/cli/wirings/wipe.mjs.map +1 -0
- package/dist/contracts/capability-decl.d.mts +0 -2
- package/dist/contracts/codegenable.d.mts +43 -0
- package/dist/contracts/container-runtime.d.mts +26 -1
- package/dist/contracts/faucet-strategy.d.mts +25 -0
- package/dist/contracts/funding-strategy.d.mts +42 -0
- package/dist/contracts/plugin-expander.mjs +60 -0
- package/dist/contracts/plugin-expander.mjs.map +1 -0
- package/dist/contracts/projection.d.mts +5 -3
- package/dist/contracts/renderer.d.mts +23 -0
- package/dist/contracts/routable.d.mts +14 -1
- package/dist/contracts/snapshotable.d.mts +25 -3
- package/dist/contracts/wallet-protocol.d.mts +52 -0
- package/dist/contracts/wallet-protocol.mjs +52 -0
- package/dist/contracts/wallet-protocol.mjs.map +1 -0
- package/dist/index.d.mts +26 -25
- package/dist/index.mjs +20 -13
- package/dist/{runtime → orchestrators}/built-in-plugin-layers.mjs +10 -5
- package/dist/orchestrators/built-in-plugin-layers.mjs.map +1 -0
- package/dist/orchestrators/codegen/bindings.d.mts +1 -2
- package/dist/orchestrators/codegen/bindings.mjs +52 -186
- package/dist/orchestrators/codegen/bindings.mjs.map +1 -1
- package/dist/orchestrators/codegen/emit.mjs +19 -1
- package/dist/orchestrators/codegen/emit.mjs.map +1 -1
- package/dist/orchestrators/codegen/errors.mjs +8 -3
- package/dist/orchestrators/codegen/errors.mjs.map +1 -1
- package/dist/orchestrators/codegen/format.mjs +47 -39
- package/dist/orchestrators/codegen/format.mjs.map +1 -1
- package/dist/orchestrators/codegen/gitignore.mjs +3 -1
- package/dist/orchestrators/codegen/gitignore.mjs.map +1 -1
- package/dist/orchestrators/codegen/output-location.mjs +40 -0
- package/dist/orchestrators/codegen/output-location.mjs.map +1 -0
- package/dist/orchestrators/codegen/paths.d.mts +1 -1
- package/dist/orchestrators/codegen/paths.mjs +40 -14
- package/dist/orchestrators/codegen/paths.mjs.map +1 -1
- package/dist/orchestrators/codegen/permissions.mjs +3 -1
- package/dist/orchestrators/codegen/permissions.mjs.map +1 -1
- package/dist/orchestrators/codegen/service.mjs +157 -105
- package/dist/orchestrators/codegen/service.mjs.map +1 -1
- package/dist/orchestrators/lifecycle-prune/errors.mjs +31 -0
- package/dist/orchestrators/lifecycle-prune/errors.mjs.map +1 -0
- package/dist/orchestrators/lifecycle-prune/index.mjs +350 -0
- package/dist/orchestrators/lifecycle-prune/index.mjs.map +1 -0
- package/dist/orchestrators/router/cleanup.mjs +26 -27
- package/dist/orchestrators/router/cleanup.mjs.map +1 -1
- package/dist/orchestrators/router/entrypoints.mjs +2 -2
- package/dist/orchestrators/router/entrypoints.mjs.map +1 -1
- package/dist/orchestrators/router/file-provider.mjs +14 -5
- package/dist/orchestrators/router/file-provider.mjs.map +1 -1
- package/dist/orchestrators/router/hostname.mjs +19 -55
- package/dist/orchestrators/router/hostname.mjs.map +1 -1
- package/dist/orchestrators/router/index.mjs +11 -0
- package/dist/orchestrators/router/profile.mjs +2 -2
- package/dist/orchestrators/router/sentinels.mjs +26 -0
- package/dist/orchestrators/router/sentinels.mjs.map +1 -0
- package/dist/orchestrators/router/service.mjs +40 -37
- package/dist/orchestrators/router/service.mjs.map +1 -1
- package/dist/orchestrators/router/traefik-container.mjs +27 -16
- package/dist/orchestrators/router/traefik-container.mjs.map +1 -1
- package/dist/{substrate/runtime → orchestrators}/run.mjs +26 -21
- package/dist/orchestrators/run.mjs.map +1 -0
- package/dist/orchestrators/runtime-composition.d.mts +1 -1
- package/dist/orchestrators/runtime-composition.mjs +123 -39
- package/dist/orchestrators/runtime-composition.mjs.map +1 -1
- package/dist/orchestrators/snapshot/capture-command.d.mts +1 -0
- package/dist/orchestrators/snapshot/capture-command.mjs +25 -0
- package/dist/orchestrators/snapshot/capture-command.mjs.map +1 -0
- package/dist/orchestrators/snapshot/capture.mjs +42 -28
- package/dist/orchestrators/snapshot/capture.mjs.map +1 -1
- package/dist/orchestrators/snapshot/descriptor.mjs +35 -10
- package/dist/orchestrators/snapshot/descriptor.mjs.map +1 -1
- package/dist/orchestrators/snapshot/identity-guard.mjs +1 -1
- package/dist/orchestrators/snapshot/index.mjs +13 -0
- package/dist/orchestrators/snapshot/integrity.d.mts +1 -1
- package/dist/orchestrators/snapshot/integrity.mjs +73 -17
- package/dist/orchestrators/snapshot/integrity.mjs.map +1 -1
- package/dist/orchestrators/snapshot/pending-marker.d.mts +1 -0
- package/dist/orchestrators/snapshot/pending-marker.mjs +99 -0
- package/dist/orchestrators/snapshot/pending-marker.mjs.map +1 -0
- package/dist/orchestrators/snapshot/phase-error.mjs +23 -0
- package/dist/orchestrators/snapshot/phase-error.mjs.map +1 -0
- package/dist/orchestrators/snapshot/prune.mjs +20 -55
- package/dist/orchestrators/snapshot/prune.mjs.map +1 -1
- package/dist/orchestrators/snapshot/recover-pending.d.mts +1 -0
- package/dist/orchestrators/snapshot/recover-pending.mjs +223 -0
- package/dist/orchestrators/snapshot/recover-pending.mjs.map +1 -0
- package/dist/orchestrators/snapshot/restore.mjs +118 -84
- package/dist/orchestrators/snapshot/restore.mjs.map +1 -1
- package/dist/orchestrators/snapshot/service.mjs +53 -56
- package/dist/orchestrators/snapshot/service.mjs.map +1 -1
- package/dist/orchestrators/snapshot/state-document.d.mts +1 -0
- package/dist/orchestrators/snapshot/state-document.mjs +47 -7
- package/dist/orchestrators/snapshot/state-document.mjs.map +1 -1
- package/dist/orchestrators/snapshot/wipe.mjs +67 -10
- package/dist/orchestrators/snapshot/wipe.mjs.map +1 -1
- package/dist/plugins/account/codegen.mjs +9 -8
- package/dist/plugins/account/codegen.mjs.map +1 -1
- package/dist/plugins/account/errors.d.mts +33 -6
- package/dist/plugins/account/errors.mjs.map +1 -1
- package/dist/plugins/account/funding.d.mts +29 -19
- package/dist/plugins/account/funding.mjs +84 -66
- package/dist/plugins/account/funding.mjs.map +1 -1
- package/dist/plugins/account/index.d.mts +2 -4
- package/dist/plugins/account/index.mjs +64 -31
- package/dist/plugins/account/index.mjs.map +1 -1
- package/dist/plugins/account/keypair.mjs +6 -9
- package/dist/plugins/account/keypair.mjs.map +1 -1
- package/dist/plugins/account/lease.mjs +1 -0
- package/dist/plugins/account/lease.mjs.map +1 -1
- package/dist/plugins/account/registry.d.mts +14 -1
- package/dist/plugins/account/registry.mjs +18 -18
- package/dist/plugins/account/registry.mjs.map +1 -1
- package/dist/plugins/account/service.d.mts +23 -4
- package/dist/plugins/account/service.mjs +83 -45
- package/dist/plugins/account/service.mjs.map +1 -1
- package/dist/plugins/account/snapshot.mjs +2 -5
- package/dist/plugins/account/snapshot.mjs.map +1 -1
- package/dist/plugins/account/spans.mjs +16 -0
- package/dist/plugins/account/spans.mjs.map +1 -0
- package/dist/plugins/account/variants/keystore.mjs +6 -8
- package/dist/plugins/account/variants/keystore.mjs.map +1 -1
- package/dist/plugins/action/build-context.d.mts +3 -2
- package/dist/plugins/action/errors.d.mts +16 -12
- package/dist/plugins/action/errors.mjs.map +1 -1
- package/dist/plugins/action/execute.mjs +65 -103
- package/dist/plugins/action/execute.mjs.map +1 -1
- package/dist/plugins/action/index.d.mts +0 -2
- package/dist/plugins/action/index.mjs +17 -13
- package/dist/plugins/action/index.mjs.map +1 -1
- package/dist/plugins/action/service.mjs +38 -35
- package/dist/plugins/action/service.mjs.map +1 -1
- package/dist/plugins/action/spans.mjs +11 -0
- package/dist/plugins/action/spans.mjs.map +1 -0
- package/dist/plugins/coin/codegen.mjs +9 -8
- package/dist/plugins/coin/codegen.mjs.map +1 -1
- package/dist/plugins/coin/discovery.mjs +8 -4
- package/dist/plugins/coin/discovery.mjs.map +1 -1
- package/dist/plugins/coin/index.d.mts +11 -29
- package/dist/plugins/coin/index.mjs +56 -27
- package/dist/plugins/coin/index.mjs.map +1 -1
- package/dist/plugins/coin/metadata.mjs +8 -15
- package/dist/plugins/coin/metadata.mjs.map +1 -1
- package/dist/plugins/coin/mint.d.mts +30 -11
- package/dist/plugins/coin/mint.mjs +78 -74
- package/dist/plugins/coin/mint.mjs.map +1 -1
- package/dist/plugins/coin/registry.mjs +4 -7
- package/dist/plugins/coin/registry.mjs.map +1 -1
- package/dist/plugins/coin/service.d.mts +39 -1
- package/dist/plugins/coin/service.mjs +11 -4
- package/dist/plugins/coin/service.mjs.map +1 -1
- package/dist/plugins/coin/spans.mjs +20 -0
- package/dist/plugins/coin/spans.mjs.map +1 -0
- package/dist/plugins/dashboard/domain.mjs +402 -0
- package/dist/plugins/dashboard/domain.mjs.map +1 -0
- package/dist/plugins/dashboard/index.d.mts +29 -0
- package/dist/plugins/dashboard/index.mjs +91 -0
- package/dist/plugins/dashboard/index.mjs.map +1 -0
- package/dist/plugins/dashboard/origin-policy.mjs +36 -0
- package/dist/plugins/dashboard/origin-policy.mjs.map +1 -0
- package/dist/plugins/dashboard/routable.mjs +27 -0
- package/dist/plugins/dashboard/routable.mjs.map +1 -0
- package/dist/plugins/dashboard/schema/builder.mjs +21 -0
- package/dist/plugins/dashboard/schema/builder.mjs.map +1 -0
- package/dist/plugins/dashboard/schema/enums.mjs +72 -0
- package/dist/plugins/dashboard/schema/enums.mjs.map +1 -0
- package/dist/plugins/dashboard/schema/root.mjs +351 -0
- package/dist/plugins/dashboard/schema/root.mjs.map +1 -0
- package/dist/plugins/dashboard/schema/types.mjs +508 -0
- package/dist/plugins/dashboard/schema/types.mjs.map +1 -0
- package/dist/plugins/dashboard/schema.mjs +11 -0
- package/dist/plugins/dashboard/schema.mjs.map +1 -0
- package/dist/plugins/dashboard/server.mjs +166 -0
- package/dist/plugins/dashboard/server.mjs.map +1 -0
- package/dist/plugins/deepbook/deploy.mjs +53 -115
- package/dist/plugins/deepbook/deploy.mjs.map +1 -1
- package/dist/plugins/deepbook/errors.mjs +1 -0
- package/dist/plugins/deepbook/errors.mjs.map +1 -1
- package/dist/plugins/deepbook/faucet-strategy.mjs +47 -34
- package/dist/plugins/deepbook/faucet-strategy.mjs.map +1 -1
- package/dist/plugins/deepbook/hash.mjs +9 -0
- package/dist/plugins/deepbook/hash.mjs.map +1 -0
- package/dist/plugins/deepbook/index.d.mts +1 -10
- package/dist/plugins/deepbook/index.mjs +25 -22
- package/dist/plugins/deepbook/index.mjs.map +1 -1
- package/dist/plugins/deepbook/pyth/index.mjs +26 -55
- package/dist/plugins/deepbook/pyth/index.mjs.map +1 -1
- package/dist/plugins/deepbook/snapshot.mjs +17 -29
- package/dist/plugins/deepbook/snapshot.mjs.map +1 -1
- package/dist/plugins/deepbook/spans.mjs +18 -0
- package/dist/plugins/deepbook/spans.mjs.map +1 -0
- package/dist/plugins/deepbook/type-strings.mjs +65 -0
- package/dist/plugins/deepbook/type-strings.mjs.map +1 -0
- package/dist/plugins/deepbook/types.d.mts +2 -3
- package/dist/plugins/deepbook/types.mjs.map +1 -1
- package/dist/plugins/faucet/dispatcher.d.mts +21 -2
- package/dist/plugins/faucet/dispatcher.mjs +1 -2
- package/dist/plugins/faucet/dispatcher.mjs.map +1 -1
- package/dist/plugins/faucet/errors.d.mts +11 -24
- package/dist/plugins/faucet/errors.mjs.map +1 -1
- package/dist/plugins/faucet/http.mjs +33 -14
- package/dist/plugins/faucet/http.mjs.map +1 -1
- package/dist/plugins/faucet/index.d.mts +15 -5
- package/dist/plugins/faucet/index.mjs +3 -0
- package/dist/plugins/faucet/index.mjs.map +1 -1
- package/dist/plugins/faucet/spans.mjs +12 -0
- package/dist/plugins/faucet/spans.mjs.map +1 -0
- package/dist/plugins/host-service/errors.d.mts +1 -1
- package/dist/plugins/host-service/index.mjs +34 -8
- package/dist/plugins/host-service/index.mjs.map +1 -1
- package/dist/plugins/host-service/routable.mjs +2 -1
- package/dist/plugins/host-service/routable.mjs.map +1 -1
- package/dist/plugins/host-service/service.d.mts +21 -0
- package/dist/plugins/host-service/service.mjs +136 -81
- package/dist/plugins/host-service/service.mjs.map +1 -1
- package/dist/plugins/internal/acquire-on-chain-artifact.mjs +23 -0
- package/dist/plugins/internal/acquire-on-chain-artifact.mjs.map +1 -0
- package/dist/plugins/internal/codegen-helpers.mjs +18 -0
- package/dist/plugins/internal/codegen-helpers.mjs.map +1 -0
- package/dist/plugins/internal/funding-failure-error.mjs +32 -0
- package/dist/plugins/internal/funding-failure-error.mjs.map +1 -0
- package/dist/plugins/package/build.mjs +1 -1
- package/dist/plugins/package/build.mjs.map +1 -1
- package/dist/plugins/package/codegen.mjs +26 -0
- package/dist/plugins/package/codegen.mjs.map +1 -1
- package/dist/plugins/package/errors.d.mts +16 -6
- package/dist/plugins/package/errors.mjs.map +1 -1
- package/dist/plugins/package/index.d.mts +0 -4
- package/dist/plugins/package/index.mjs +27 -21
- package/dist/plugins/package/index.mjs.map +1 -1
- package/dist/plugins/package/mode-known.mjs +26 -12
- package/dist/plugins/package/mode-known.mjs.map +1 -1
- package/dist/plugins/package/mode-local.mjs +47 -41
- package/dist/plugins/package/mode-local.mjs.map +1 -1
- package/dist/plugins/package/publish-executor.mjs +55 -114
- package/dist/plugins/package/publish-executor.mjs.map +1 -1
- package/dist/plugins/package/registry.mjs +2 -1
- package/dist/plugins/package/registry.mjs.map +1 -1
- package/dist/plugins/package/service.mjs.map +1 -1
- package/dist/plugins/package/spans.mjs +14 -0
- package/dist/plugins/package/spans.mjs.map +1 -0
- package/dist/plugins/postgres/db-ensure.mjs +19 -12
- package/dist/plugins/postgres/db-ensure.mjs.map +1 -1
- package/dist/plugins/postgres/errors.d.mts +5 -0
- package/dist/plugins/postgres/errors.mjs.map +1 -1
- package/dist/plugins/postgres/index.mjs +10 -17
- package/dist/plugins/postgres/index.mjs.map +1 -1
- package/dist/plugins/postgres/service.mjs +58 -24
- package/dist/plugins/postgres/service.mjs.map +1 -1
- package/dist/plugins/postgres/snapshot.mjs.map +1 -1
- package/dist/plugins/postgres/spans.mjs +11 -0
- package/dist/plugins/postgres/spans.mjs.map +1 -0
- package/dist/plugins/router-entrypoints.mjs +4 -4
- package/dist/plugins/router-entrypoints.mjs.map +1 -1
- package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs +15 -13
- package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs.map +1 -1
- package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs +15 -19
- package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs.map +1 -1
- package/dist/plugins/seal/codegen.d.mts +2 -3
- package/dist/plugins/seal/codegen.mjs.map +1 -1
- package/dist/plugins/seal/config-render.mjs +35 -8
- package/dist/plugins/seal/config-render.mjs.map +1 -1
- package/dist/plugins/seal/deploy.mjs +31 -39
- package/dist/plugins/seal/deploy.mjs.map +1 -1
- package/dist/plugins/seal/errors.d.mts +1 -3
- package/dist/plugins/seal/errors.mjs +7 -1
- package/dist/plugins/seal/errors.mjs.map +1 -1
- package/dist/plugins/seal/index.d.mts +1 -6
- package/dist/plugins/seal/index.mjs +40 -14
- package/dist/plugins/seal/index.mjs.map +1 -1
- package/dist/plugins/seal/key-manager.d.mts +1 -9
- package/dist/plugins/seal/key-manager.mjs +2 -18
- package/dist/plugins/seal/key-manager.mjs.map +1 -1
- package/dist/plugins/seal/key-server.mjs +37 -36
- package/dist/plugins/seal/key-server.mjs.map +1 -1
- package/dist/plugins/seal/keygen.mjs +16 -17
- package/dist/plugins/seal/keygen.mjs.map +1 -1
- package/dist/plugins/seal/mode/fork-known.mjs +36 -14
- package/dist/plugins/seal/mode/fork-known.mjs.map +1 -1
- package/dist/plugins/seal/mode/live.d.mts +6 -4
- package/dist/plugins/seal/mode/live.mjs +14 -21
- package/dist/plugins/seal/mode/live.mjs.map +1 -1
- package/dist/plugins/seal/mode/local-keygen.mjs +57 -21
- package/dist/plugins/seal/mode/local-keygen.mjs.map +1 -1
- package/dist/plugins/seal/registry-publish.mjs +1 -0
- 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/spans.mjs +18 -0
- package/dist/plugins/seal/spans.mjs.map +1 -0
- package/dist/plugins/sui/auto-tick.mjs +17 -23
- package/dist/plugins/sui/auto-tick.mjs.map +1 -1
- package/dist/plugins/sui/chain-build-container.mjs +18 -0
- package/dist/plugins/sui/chain-build-container.mjs.map +1 -0
- package/dist/plugins/sui/chain-probe.d.mts +5 -5
- package/dist/plugins/sui/chain-probe.mjs +28 -58
- package/dist/plugins/sui/chain-probe.mjs.map +1 -1
- package/dist/plugins/sui/codegen.mjs +26 -0
- package/dist/plugins/sui/codegen.mjs.map +1 -1
- package/dist/plugins/sui/errors.d.mts +2 -29
- package/dist/plugins/sui/errors.mjs +1 -3
- package/dist/plugins/sui/errors.mjs.map +1 -1
- package/dist/plugins/sui/fork-faucet-strategy.d.mts +1 -0
- package/dist/plugins/sui/fork-faucet-strategy.mjs +55 -0
- package/dist/plugins/sui/fork-faucet-strategy.mjs.map +1 -0
- package/dist/plugins/sui/fork-orchestration.d.mts +1 -0
- package/dist/plugins/sui/fork-orchestration.mjs +170 -2
- package/dist/plugins/sui/fork-orchestration.mjs.map +1 -1
- package/dist/plugins/sui/fork-transaction.d.mts +2 -0
- package/dist/plugins/sui/fork-transaction.mjs +92 -28
- package/dist/plugins/sui/fork-transaction.mjs.map +1 -1
- package/dist/plugins/sui/index.d.mts +33 -70
- package/dist/plugins/sui/index.mjs +58 -35
- package/dist/plugins/sui/index.mjs.map +1 -1
- package/dist/plugins/{faucet/strategies/sui-local.mjs → sui/local-faucet-strategy.mjs} +10 -7
- package/dist/plugins/sui/local-faucet-strategy.mjs.map +1 -0
- package/dist/plugins/sui/mode/external.mjs +7 -13
- package/dist/plugins/sui/mode/external.mjs.map +1 -1
- package/dist/plugins/sui/mode/fork.mjs +136 -59
- package/dist/plugins/sui/mode/fork.mjs.map +1 -1
- package/dist/plugins/sui/mode/live.mjs +10 -16
- package/dist/plugins/sui/mode/live.mjs.map +1 -1
- package/dist/plugins/sui/mode/local.mjs +37 -36
- package/dist/plugins/sui/mode/local.mjs.map +1 -1
- package/dist/plugins/sui/mode/shared-boot.mjs +38 -115
- package/dist/plugins/sui/mode/shared-boot.mjs.map +1 -1
- package/dist/plugins/sui/mode/shared.d.mts +1 -5
- package/dist/plugins/sui/mode/shared.mjs.map +1 -1
- package/dist/plugins/sui/mode/spec.d.mts +18 -0
- package/dist/plugins/sui/move-summary-runner.mjs +207 -0
- package/dist/plugins/sui/move-summary-runner.mjs.map +1 -0
- package/dist/plugins/sui/network-resolver.d.mts +4 -3
- package/dist/plugins/sui/service.mjs.map +1 -1
- package/dist/plugins/sui/snapshot.mjs +3 -0
- package/dist/plugins/sui/snapshot.mjs.map +1 -1
- package/dist/plugins/sui/spans.mjs +17 -0
- package/dist/plugins/sui/spans.mjs.map +1 -0
- package/dist/plugins/wallet/codegen.d.mts +0 -1
- package/dist/plugins/wallet/codegen.mjs +8 -9
- package/dist/plugins/wallet/codegen.mjs.map +1 -1
- package/dist/plugins/wallet/index.d.mts +6 -8
- package/dist/plugins/wallet/index.mjs +46 -35
- package/dist/plugins/wallet/index.mjs.map +1 -1
- package/dist/plugins/wallet/origin-policy.mjs +12 -28
- package/dist/plugins/wallet/origin-policy.mjs.map +1 -1
- package/dist/plugins/wallet/pairing.mjs +6 -4
- package/dist/plugins/wallet/pairing.mjs.map +1 -1
- package/dist/plugins/wallet/protocol.d.mts +1 -0
- package/dist/plugins/wallet/protocol.mjs +5 -44
- package/dist/plugins/wallet/protocol.mjs.map +1 -1
- package/dist/plugins/wallet/routable.mjs +2 -8
- package/dist/plugins/wallet/routable.mjs.map +1 -1
- package/dist/plugins/wallet/server.mjs +36 -44
- package/dist/plugins/wallet/server.mjs.map +1 -1
- package/dist/plugins/wallet/service.d.mts +1 -5
- package/dist/plugins/wallet/service.mjs +22 -18
- package/dist/plugins/wallet/service.mjs.map +1 -1
- package/dist/plugins/wallet/spans.mjs +22 -0
- package/dist/plugins/wallet/spans.mjs.map +1 -0
- package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs +33 -8
- package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs.map +1 -1
- package/dist/plugins/walrus/codegen.d.mts +3 -3
- package/dist/plugins/walrus/codegen.mjs.map +1 -1
- package/dist/plugins/walrus/deploy-paths.mjs +21 -5
- package/dist/plugins/walrus/deploy-paths.mjs.map +1 -1
- package/dist/plugins/walrus/deploy.mjs +67 -69
- package/dist/plugins/walrus/deploy.mjs.map +1 -1
- package/dist/plugins/walrus/errors.mjs +1 -0
- package/dist/plugins/walrus/errors.mjs.map +1 -1
- package/dist/plugins/walrus/faucet-strategy.mjs +12 -7
- package/dist/plugins/walrus/faucet-strategy.mjs.map +1 -1
- package/dist/plugins/walrus/index.d.mts +2 -13
- package/dist/plugins/walrus/index.mjs +18 -23
- package/dist/plugins/walrus/index.mjs.map +1 -1
- package/dist/plugins/walrus/mode/known-deploy.mjs +7 -5
- package/dist/plugins/walrus/mode/known-deploy.mjs.map +1 -1
- package/dist/plugins/walrus/mode/local-cluster.mjs +26 -7
- package/dist/plugins/walrus/mode/local-cluster.mjs.map +1 -1
- package/dist/plugins/walrus/registry-publish.mjs.map +1 -1
- package/dist/plugins/walrus/routable.mjs +7 -23
- package/dist/plugins/walrus/routable.mjs.map +1 -1
- package/dist/plugins/walrus/service.mjs.map +1 -1
- package/dist/plugins/walrus/spans.mjs +18 -0
- package/dist/plugins/walrus/spans.mjs.map +1 -0
- package/dist/plugins/walrus/storage-nodes.d.mts +6 -2
- package/dist/plugins/walrus/storage-nodes.mjs +15 -8
- package/dist/plugins/walrus/storage-nodes.mjs.map +1 -1
- package/dist/plugins/walrus/wal-swap.mjs +58 -15
- package/dist/plugins/walrus/wal-swap.mjs.map +1 -1
- package/dist/primitives/artifact-publisher.d.mts +1 -1
- package/dist/primitives/artifact-publisher.mjs +15 -0
- package/dist/primitives/artifact-publisher.mjs.map +1 -0
- package/dist/runtime/docker/client.mjs +17 -4
- package/dist/runtime/docker/client.mjs.map +1 -1
- package/dist/runtime/docker/container.mjs +219 -132
- package/dist/runtime/docker/container.mjs.map +1 -1
- package/dist/runtime/docker/errors.mjs +0 -6
- package/dist/runtime/docker/errors.mjs.map +1 -1
- package/dist/runtime/docker/exec.mjs +21 -18
- package/dist/runtime/docker/exec.mjs.map +1 -1
- package/dist/runtime/docker/image.mjs +36 -13
- package/dist/runtime/docker/image.mjs.map +1 -1
- package/dist/runtime/docker/index.mjs +14 -0
- package/dist/runtime/docker/inspect-and-decode.mjs +51 -0
- package/dist/runtime/docker/inspect-and-decode.mjs.map +1 -0
- package/dist/runtime/docker/inventory.mjs +14 -11
- package/dist/runtime/docker/inventory.mjs.map +1 -1
- package/dist/runtime/docker/labels.mjs +38 -5
- package/dist/runtime/docker/labels.mjs.map +1 -1
- package/dist/runtime/docker/logs.d.mts +1 -1
- package/dist/runtime/docker/logs.mjs.map +1 -1
- package/dist/runtime/docker/network.mjs +83 -47
- package/dist/runtime/docker/network.mjs.map +1 -1
- package/dist/runtime/docker/render-run-args.mjs +82 -0
- package/dist/runtime/docker/render-run-args.mjs.map +1 -0
- package/dist/runtime/docker/service.d.mts +1 -1
- package/dist/runtime/docker/service.mjs +12 -7
- package/dist/runtime/docker/service.mjs.map +1 -1
- package/dist/runtime/docker/sweep.mjs +118 -43
- package/dist/runtime/docker/sweep.mjs.map +1 -1
- package/dist/runtime/docker/volume.mjs +2 -0
- package/dist/runtime/docker/volume.mjs.map +1 -1
- package/dist/runtime/docker/wrap.mjs +30 -1
- package/dist/runtime/docker/wrap.mjs.map +1 -1
- package/dist/substrate/cross-process.mjs +14 -8
- package/dist/substrate/cross-process.mjs.map +1 -1
- package/dist/substrate/event-time.mjs +33 -0
- package/dist/substrate/event-time.mjs.map +1 -0
- package/dist/substrate/events.d.mts +28 -8
- package/dist/substrate/identity.d.mts +2 -1
- package/dist/substrate/manifest.d.mts +68 -5
- package/dist/substrate/manifest.mjs +34 -5
- package/dist/substrate/manifest.mjs.map +1 -1
- package/dist/substrate/network.d.mts +3 -5
- package/dist/substrate/options.d.mts +0 -2
- package/dist/substrate/plugin.d.mts +13 -0
- package/dist/substrate/plugin.mjs +4 -2
- package/dist/substrate/plugin.mjs.map +1 -1
- package/dist/substrate/projection.d.mts +35 -3
- package/dist/substrate/runtime/artifact-publisher/index.mjs +19 -9
- package/dist/substrate/runtime/artifact-publisher/index.mjs.map +1 -1
- package/dist/substrate/runtime/atomic-write.mjs +97 -32
- package/dist/substrate/runtime/atomic-write.mjs.map +1 -1
- package/dist/substrate/runtime/cache/index.mjs +3 -0
- package/dist/substrate/runtime/cache/schema.mjs +2 -2
- package/dist/substrate/runtime/cache/schema.mjs.map +1 -1
- package/dist/substrate/runtime/cache/service.mjs +9 -7
- package/dist/substrate/runtime/cache/service.mjs.map +1 -1
- package/dist/substrate/runtime/capability-sinks/index.d.mts +1 -1
- package/dist/substrate/runtime/capability-sinks/index.mjs +3 -0
- package/dist/substrate/runtime/capability-sinks/layer.mjs +1 -1
- package/dist/substrate/runtime/capability-sinks/service.d.mts +61 -2
- package/dist/substrate/runtime/capability-sinks/service.mjs +21 -26
- package/dist/substrate/runtime/capability-sinks/service.mjs.map +1 -1
- package/dist/substrate/runtime/config-validation.d.mts +1 -13
- package/dist/substrate/runtime/config-validation.mjs +2 -91
- package/dist/substrate/runtime/config-validation.mjs.map +1 -1
- package/dist/substrate/runtime/container-runtime.d.mts +1 -0
- package/dist/substrate/runtime/container-runtime.mjs +2 -0
- package/dist/substrate/runtime/control-plane/domain.mjs +101 -0
- package/dist/substrate/runtime/control-plane/domain.mjs.map +1 -0
- package/dist/substrate/runtime/control-plane/service.mjs +7 -0
- package/dist/substrate/runtime/control-plane/service.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/command-channel/channel.mjs +46 -19
- package/dist/substrate/runtime/cross-process/command-channel/channel.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/command-channel/file-channel.mjs +30 -12
- package/dist/substrate/runtime/cross-process/command-channel/file-channel.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/command-channel/index.mjs +5 -0
- package/dist/substrate/runtime/cross-process/command-channel/protocol.mjs +11 -2
- 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 +1 -1
- package/dist/substrate/runtime/cross-process/index.mjs +11 -0
- package/dist/substrate/runtime/cross-process/live-clock.mjs +34 -0
- package/dist/substrate/runtime/cross-process/live-clock.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/liveness.mjs +52 -10
- package/dist/substrate/runtime/cross-process/liveness.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/lock.d.mts +1 -0
- package/dist/substrate/runtime/cross-process/lock.mjs +23 -0
- package/dist/substrate/runtime/cross-process/lock.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/reclaim-stale-file.mjs +64 -0
- package/dist/substrate/runtime/cross-process/reclaim-stale-file.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/roster.mjs +97 -83
- package/dist/substrate/runtime/cross-process/roster.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/self-pid.mjs +8 -0
- package/dist/substrate/runtime/cross-process/self-pid.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs +24 -28
- package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/stack-lock.mjs +41 -20
- package/dist/substrate/runtime/cross-process/stack-lock.mjs.map +1 -1
- package/dist/substrate/runtime/current-plugin.mjs +2 -2
- package/dist/substrate/runtime/current-plugin.mjs.map +1 -1
- package/dist/substrate/runtime/errors.mjs +12 -6
- package/dist/substrate/runtime/errors.mjs.map +1 -1
- package/dist/substrate/runtime/format-unknown-error.mjs +30 -0
- package/dist/substrate/runtime/format-unknown-error.mjs.map +1 -0
- package/dist/substrate/runtime/host-bind-mount-owner.mjs +10 -0
- package/dist/substrate/runtime/host-bind-mount-owner.mjs.map +1 -0
- package/dist/substrate/runtime/host-gateway.mjs +20 -0
- package/dist/substrate/runtime/host-gateway.mjs.map +1 -0
- package/dist/substrate/runtime/host-tree-tar/index.mjs +61 -50
- package/dist/substrate/runtime/host-tree-tar/index.mjs.map +1 -1
- package/dist/substrate/runtime/http-probe.d.mts +1 -1
- package/dist/substrate/runtime/index.mjs +14 -0
- package/dist/substrate/runtime/lease-broker/index.d.mts +1 -1
- package/dist/substrate/runtime/lease-broker/index.mjs +2 -0
- package/dist/substrate/runtime/lease-broker/service.d.mts +1 -64
- package/dist/substrate/runtime/lease-broker/service.mjs +1 -1
- package/dist/substrate/runtime/lease-broker/service.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/dep-graph.mjs +22 -3
- package/dist/substrate/runtime/lifecycle/dep-graph.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/index.mjs +9 -0
- package/dist/substrate/runtime/lifecycle/lifecycle-fact.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/plugin-registry.mjs +20 -3
- package/dist/substrate/runtime/lifecycle/plugin-registry.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/selective-restart.mjs +1 -1
- package/dist/substrate/runtime/lifecycle/signals.mjs +5 -5
- package/dist/substrate/runtime/lifecycle/signals.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/state-machine.mjs +1 -1
- package/dist/substrate/runtime/managed-container.d.mts +19 -1
- package/dist/substrate/runtime/managed-container.mjs +20 -1
- package/dist/substrate/runtime/managed-container.mjs.map +1 -1
- package/dist/substrate/runtime/manifest/index.mjs +3 -0
- package/dist/substrate/runtime/manifest/manifest.mjs +15 -11
- package/dist/substrate/runtime/manifest/manifest.mjs.map +1 -1
- package/dist/substrate/runtime/mode-errors.mjs +20 -0
- package/dist/substrate/runtime/mode-errors.mjs.map +1 -0
- package/dist/substrate/runtime/observability/cascade-formatter.mjs +9 -13
- package/dist/substrate/runtime/observability/cascade-formatter.mjs.map +1 -1
- package/dist/substrate/runtime/observability/formatter-registry.mjs +19 -36
- package/dist/substrate/runtime/observability/formatter-registry.mjs.map +1 -1
- package/dist/substrate/runtime/observability/ignore-with-log.d.mts +1 -0
- package/dist/substrate/runtime/observability/ignore-with-log.mjs +17 -0
- package/dist/substrate/runtime/observability/ignore-with-log.mjs.map +1 -0
- package/dist/substrate/runtime/observability/index.d.mts +1 -1
- package/dist/substrate/runtime/observability/index.mjs +13 -0
- package/dist/substrate/runtime/observability/log-store.d.mts +1 -0
- package/dist/substrate/runtime/observability/log-store.mjs +175 -0
- package/dist/substrate/runtime/observability/log-store.mjs.map +1 -0
- package/dist/substrate/runtime/observability/logger.d.mts +2 -1
- package/dist/substrate/runtime/observability/logger.mjs +5 -9
- package/dist/substrate/runtime/observability/logger.mjs.map +1 -1
- package/dist/substrate/runtime/observability/output-truncate.mjs +35 -0
- package/dist/substrate/runtime/observability/output-truncate.mjs.map +1 -0
- package/dist/substrate/runtime/observability/pretty-error.mjs +9 -12
- package/dist/substrate/runtime/observability/pretty-error.mjs.map +1 -1
- package/dist/substrate/runtime/observability/redaction.d.mts +2 -13
- package/dist/substrate/runtime/observability/redaction.mjs +8 -14
- package/dist/substrate/runtime/observability/redaction.mjs.map +1 -1
- package/dist/substrate/runtime/observability/span-store.d.mts +1 -0
- package/dist/substrate/runtime/observability/span-store.mjs +110 -0
- package/dist/substrate/runtime/observability/span-store.mjs.map +1 -0
- package/dist/substrate/runtime/observability/spans.mjs +14 -14
- package/dist/substrate/runtime/observability/spans.mjs.map +1 -1
- package/dist/substrate/runtime/observability/subprocess-capture.mjs +1 -1
- package/dist/substrate/runtime/passthrough-or-wrap.mjs +33 -0
- package/dist/substrate/runtime/passthrough-or-wrap.mjs.map +1 -0
- package/dist/substrate/runtime/paths.d.mts +1 -1
- package/dist/substrate/runtime/paths.mjs +4 -3
- package/dist/substrate/runtime/paths.mjs.map +1 -1
- package/dist/substrate/runtime/phase-preserving-produce.mjs +40 -0
- package/dist/substrate/runtime/phase-preserving-produce.mjs.map +1 -0
- package/dist/substrate/runtime/port-broker/index.mjs +3 -0
- package/dist/substrate/runtime/port-broker/service.mjs +170 -126
- package/dist/substrate/runtime/port-broker/service.mjs.map +1 -1
- package/dist/substrate/runtime/post-acquire-tasks.mjs +1 -1
- package/dist/substrate/runtime/post-acquire-tasks.mjs.map +1 -1
- package/dist/substrate/runtime/probes.d.mts +7 -5
- package/dist/substrate/runtime/probes.mjs +3 -1
- package/dist/substrate/runtime/probes.mjs.map +1 -1
- package/dist/substrate/runtime/projection/index.mjs +4 -0
- package/dist/substrate/runtime/projection/operational-endpoints.mjs +1 -2
- package/dist/substrate/runtime/projection/operational-endpoints.mjs.map +1 -1
- package/dist/substrate/runtime/projection/persisted.mjs +33 -15
- package/dist/substrate/runtime/projection/persisted.mjs.map +1 -1
- package/dist/substrate/runtime/projection/state-ref.mjs +26 -2
- package/dist/substrate/runtime/projection/state-ref.mjs.map +1 -1
- package/dist/substrate/runtime/projection/update.mjs +88 -24
- package/dist/substrate/runtime/projection/update.mjs.map +1 -1
- package/dist/substrate/runtime/random-suffix.mjs +11 -0
- package/dist/substrate/runtime/random-suffix.mjs.map +1 -0
- package/dist/substrate/runtime/retry-policy.d.mts +59 -1
- package/dist/substrate/runtime/retry-policy.mjs +66 -1
- package/dist/substrate/runtime/retry-policy.mjs.map +1 -1
- package/dist/substrate/runtime/routed-url.d.mts +1 -0
- package/dist/substrate/runtime/routed-url.mjs +79 -0
- package/dist/substrate/runtime/routed-url.mjs.map +1 -0
- package/dist/substrate/runtime/runtime-decode.d.mts +1 -1
- package/dist/substrate/runtime/runtime-decode.mjs.map +1 -1
- package/dist/substrate/runtime/scoped-http-server.mjs +2 -3
- package/dist/substrate/runtime/scoped-http-server.mjs.map +1 -1
- package/dist/substrate/runtime/scoped-multimap/index.mjs +2 -0
- package/dist/substrate/runtime/scoped-multimap/service.mjs +52 -0
- package/dist/substrate/runtime/scoped-multimap/service.mjs.map +1 -0
- package/dist/substrate/runtime/scoped-ref-map/index.mjs +2 -0
- package/dist/substrate/runtime/scoped-ref-map/service.mjs +2 -2
- package/dist/substrate/runtime/scoped-ref-map/service.mjs.map +1 -1
- package/dist/substrate/runtime/stage-and-swap/index.mjs +72 -4
- package/dist/substrate/runtime/stage-and-swap/index.mjs.map +1 -1
- package/dist/substrate/runtime/state-store/index.d.mts +1 -0
- package/dist/substrate/runtime/state-store/index.mjs +3 -0
- package/dist/substrate/runtime/state-store/schema.d.mts +1 -0
- package/dist/substrate/runtime/state-store/schema.mjs +19 -14
- package/dist/substrate/runtime/state-store/schema.mjs.map +1 -1
- package/dist/substrate/runtime/state-store/service.d.mts +1 -0
- package/dist/substrate/runtime/state-store/service.mjs +145 -0
- package/dist/substrate/runtime/state-store/service.mjs.map +1 -0
- package/dist/substrate/runtime/strategy-registry/chain-keyed-strategy-for.d.mts +1 -0
- package/dist/substrate/runtime/strategy-registry/chain-keyed-strategy-for.mjs +33 -0
- package/dist/substrate/runtime/strategy-registry/chain-keyed-strategy-for.mjs.map +1 -0
- package/dist/substrate/runtime/strategy-registry/chain-probe-for.mjs +1 -1
- package/dist/substrate/runtime/strategy-registry/chain-probe-for.mjs.map +1 -1
- package/dist/substrate/runtime/strategy-registry/index.mjs +4 -0
- package/dist/substrate/runtime/strategy-registry/service.mjs +19 -33
- package/dist/substrate/runtime/strategy-registry/service.mjs.map +1 -1
- package/dist/substrate/runtime/subnet-broker.mjs +60 -0
- package/dist/substrate/runtime/subnet-broker.mjs.map +1 -0
- package/dist/substrate/runtime/sui-execute/index.d.mts +21 -1
- package/dist/substrate/runtime/sui-execute/index.mjs +84 -20
- package/dist/substrate/runtime/sui-execute/index.mjs.map +1 -1
- package/dist/substrate/runtime/sui-execute/sign-and-dispatch.d.mts +1 -0
- package/dist/substrate/runtime/sui-execute/sign-and-dispatch.mjs +32 -0
- package/dist/substrate/runtime/sui-execute/sign-and-dispatch.mjs.map +1 -0
- package/dist/substrate/runtime/sui-ledger/object-ref.mjs +32 -0
- package/dist/substrate/runtime/sui-ledger/object-ref.mjs.map +1 -0
- package/dist/substrate/runtime/sui-move-build/index.mjs +93 -19
- package/dist/substrate/runtime/sui-move-build/index.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/acquire-node.mjs +181 -0
- package/dist/substrate/runtime/supervisor/acquire-node.mjs.map +1 -0
- package/dist/substrate/runtime/supervisor/background-tasks.mjs +144 -0
- package/dist/substrate/runtime/supervisor/background-tasks.mjs.map +1 -0
- package/dist/substrate/runtime/supervisor/command-loop.mjs +68 -0
- package/dist/substrate/runtime/supervisor/command-loop.mjs.map +1 -0
- package/dist/substrate/runtime/supervisor/dispatch-contributions.mjs +151 -0
- package/dist/substrate/runtime/supervisor/dispatch-contributions.mjs.map +1 -0
- package/dist/substrate/runtime/supervisor/errors.d.mts +1 -0
- package/dist/substrate/runtime/supervisor/errors.mjs +9 -0
- package/dist/substrate/runtime/supervisor/errors.mjs.map +1 -0
- package/dist/substrate/runtime/supervisor/index.d.mts +1 -0
- package/dist/substrate/runtime/supervisor/index.mjs +3 -0
- package/dist/substrate/runtime/supervisor/shutdown.mjs +51 -0
- package/dist/substrate/runtime/supervisor/shutdown.mjs.map +1 -0
- package/dist/substrate/runtime/supervisor/start-supervisor.d.mts +1 -0
- package/dist/substrate/runtime/supervisor/start-supervisor.mjs +250 -0
- package/dist/substrate/runtime/supervisor/start-supervisor.mjs.map +1 -0
- package/dist/substrate/runtime/supervisor/state.d.mts +1 -0
- package/dist/substrate/runtime/supervisor/state.mjs +22 -0
- package/dist/substrate/runtime/supervisor/state.mjs.map +1 -0
- package/dist/substrate/runtime/supervisor/teardown.mjs +57 -0
- package/dist/substrate/runtime/supervisor/teardown.mjs.map +1 -0
- package/dist/substrate/runtime/supervisor/types.d.mts +1 -0
- package/dist/substrate/runtime/supervisor/wiring.mjs +133 -0
- package/dist/substrate/runtime/supervisor/wiring.mjs.map +1 -0
- package/dist/substrate/runtime/typed-env.mjs +8 -0
- package/dist/substrate/runtime/typed-env.mjs.map +1 -0
- package/dist/substrate/state-store.d.mts +1 -0
- package/dist/substrate/versioned-doc-schema.mjs +17 -0
- package/dist/substrate/versioned-doc-schema.mjs.map +1 -0
- package/dist/substrate/versioned-doc-sync.mjs +94 -0
- package/dist/substrate/versioned-doc-sync.mjs.map +1 -0
- package/dist/surfaces/cli/command-tree.mjs.map +1 -1
- package/dist/surfaces/cli/commands/index.mjs +9 -0
- package/dist/surfaces/cli/commands/prune-picker-entry.mjs +13 -0
- package/dist/surfaces/cli/commands/prune-picker-entry.mjs.map +1 -0
- package/dist/surfaces/cli/commands/prune-picker.mjs +3 -2
- package/dist/surfaces/cli/commands/prune-picker.mjs.map +1 -1
- package/dist/surfaces/cli/commands/prune.mjs +34 -17
- package/dist/surfaces/cli/commands/prune.mjs.map +1 -1
- package/dist/surfaces/cli/commands/status.mjs +2 -2
- package/dist/surfaces/cli/commands/status.mjs.map +1 -1
- package/dist/surfaces/cli/commands/supervisor-presence.mjs +5 -3
- package/dist/surfaces/cli/commands/supervisor-presence.mjs.map +1 -1
- package/dist/surfaces/cli/commands/wipe.mjs +38 -4
- package/dist/surfaces/cli/commands/wipe.mjs.map +1 -1
- package/dist/surfaces/cli/errors.mjs +1 -1
- package/dist/surfaces/cli/errors.mjs.map +1 -1
- package/dist/surfaces/cli/flags.mjs +0 -1
- package/dist/surfaces/cli/flags.mjs.map +1 -1
- package/dist/surfaces/cli/index.mjs +98 -18
- package/dist/surfaces/cli/index.mjs.map +1 -1
- package/dist/surfaces/cli/output.mjs +1 -0
- package/dist/surfaces/cli/output.mjs.map +1 -1
- package/dist/surfaces/cli/sysexits.mjs +2 -1
- package/dist/surfaces/cli/sysexits.mjs.map +1 -1
- package/dist/surfaces/tui/app.mjs +25 -3
- package/dist/surfaces/tui/app.mjs.map +1 -1
- package/dist/surfaces/tui/display-derivation.mjs +23 -74
- package/dist/surfaces/tui/display-derivation.mjs.map +1 -1
- package/dist/surfaces/tui/event-log.mjs +35 -23
- package/dist/surfaces/tui/event-log.mjs.map +1 -1
- package/dist/surfaces/tui/input.mjs +5 -1
- package/dist/surfaces/tui/input.mjs.map +1 -1
- package/dist/surfaces/tui/plain-renderer.mjs +70 -34
- package/dist/surfaces/tui/plain-renderer.mjs.map +1 -1
- package/package.json +24 -4
- package/dist/contracts/liveness-classifier.d.mts +0 -19
- package/dist/contracts/network-resolver.d.mts +0 -15
- package/dist/contracts/network-resolver.mjs +0 -7
- package/dist/contracts/network-resolver.mjs.map +0 -1
- package/dist/orchestrators/codegen/extras.mjs +0 -16
- package/dist/orchestrators/codegen/extras.mjs.map +0 -1
- package/dist/plugins/deepbook/routable.mjs +0 -21
- package/dist/plugins/deepbook/routable.mjs.map +0 -1
- package/dist/plugins/faucet/service.d.mts +0 -20
- package/dist/plugins/faucet/strategies/sui-local.d.mts +0 -23
- package/dist/plugins/faucet/strategies/sui-local.mjs.map +0 -1
- package/dist/plugins/sui/seed-objects.d.mts +0 -18
- package/dist/plugins/sui/seed-objects.mjs +0 -25
- package/dist/plugins/sui/seed-objects.mjs.map +0 -1
- package/dist/runtime/built-in-plugin-layers.mjs.map +0 -1
- package/dist/substrate/runtime/context-helpers.mjs +0 -32
- package/dist/substrate/runtime/context-helpers.mjs.map +0 -1
- package/dist/substrate/runtime/run.mjs.map +0 -1
- package/dist/substrate/runtime/strategy-registry/faucet-capability-for.mjs +0 -30
- package/dist/substrate/runtime/strategy-registry/faucet-capability-for.mjs.map +0 -1
- package/dist/substrate/runtime/supervisor.d.mts +0 -1
- package/dist/substrate/runtime/supervisor.mjs +0 -831
- package/dist/substrate/runtime/supervisor.mjs.map +0 -1
- package/dist/surfaces/cli/commands/doctor-probes.mjs.map +0 -1
- /package/dist/{substrate/runtime/strategy-registry/faucet-capability-for.d.mts → plugins/faucet/http.d.mts} +0 -0
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { checkOrigin } from "./origin-policy.mjs";
|
|
2
|
+
import { dashboardSchema } from "./schema.mjs";
|
|
3
|
+
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
4
|
+
import { join, normalize, resolve, sep } from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
import { createYoga } from "graphql-yoga";
|
|
7
|
+
//#region src/plugins/dashboard/server.ts
|
|
8
|
+
const DASHBOARD_UI_DIR = fileURLToPath(new URL("../../../dashboard-ui", import.meta.url));
|
|
9
|
+
const CONTENT_TYPES = {
|
|
10
|
+
".html": "text/html; charset=utf-8",
|
|
11
|
+
".js": "text/javascript; charset=utf-8",
|
|
12
|
+
".mjs": "text/javascript; charset=utf-8",
|
|
13
|
+
".css": "text/css; charset=utf-8",
|
|
14
|
+
".json": "application/json; charset=utf-8",
|
|
15
|
+
".map": "application/json; charset=utf-8",
|
|
16
|
+
".svg": "image/svg+xml",
|
|
17
|
+
".png": "image/png",
|
|
18
|
+
".jpg": "image/jpeg",
|
|
19
|
+
".jpeg": "image/jpeg",
|
|
20
|
+
".gif": "image/gif",
|
|
21
|
+
".webp": "image/webp",
|
|
22
|
+
".ico": "image/x-icon",
|
|
23
|
+
".woff": "font/woff",
|
|
24
|
+
".woff2": "font/woff2",
|
|
25
|
+
".ttf": "font/ttf",
|
|
26
|
+
".txt": "text/plain; charset=utf-8",
|
|
27
|
+
".wasm": "application/wasm"
|
|
28
|
+
};
|
|
29
|
+
const contentTypeFor = (path) => {
|
|
30
|
+
const dot = path.lastIndexOf(".");
|
|
31
|
+
return CONTENT_TYPES[dot === -1 ? "" : path.slice(dot).toLowerCase()] ?? "application/octet-stream";
|
|
32
|
+
};
|
|
33
|
+
const testPage = (graphqlEndpoint) => `<!doctype html>
|
|
34
|
+
<html lang="en">
|
|
35
|
+
<head><meta charset="utf-8" /><title>devstack dashboard — API test</title>
|
|
36
|
+
<style>body{font:14px/1.5 ui-monospace,monospace;background:#05080f;color:#e6eefb;margin:0;padding:24px}
|
|
37
|
+
button{font:inherit;background:#1b2740;color:#e6eefb;border:1px solid #2c3c5e;border-radius:6px;padding:6px 12px;cursor:pointer}
|
|
38
|
+
pre{background:#0b1322;border:1px solid #1b2740;border-radius:8px;padding:16px;overflow:auto;max-height:70vh}
|
|
39
|
+
a{color:#69b7ff}</style></head>
|
|
40
|
+
<body>
|
|
41
|
+
<h1>devstack dashboard — API test</h1>
|
|
42
|
+
<p>The bundled UI was not found (run <code>pnpm build</code> to bundle it). Falling back to the API test page.</p>
|
|
43
|
+
<p>GraphiQL: <a href="${graphqlEndpoint}">${graphqlEndpoint}</a></p>
|
|
44
|
+
<p><button id="load">query { state }</button> <button id="restart">mutation { restart }</button></p>
|
|
45
|
+
<pre id="out">…</pre>
|
|
46
|
+
<script type="module">
|
|
47
|
+
const ep = ${JSON.stringify(graphqlEndpoint)};
|
|
48
|
+
const out = document.getElementById('out');
|
|
49
|
+
async function gql(query){
|
|
50
|
+
const r = await fetch(ep,{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify({query})});
|
|
51
|
+
return r.json();
|
|
52
|
+
}
|
|
53
|
+
document.getElementById('load').onclick = async () => {
|
|
54
|
+
out.textContent = JSON.stringify(await gql('{ ping state { cycle { id phase } summary { total ready failed health } services { key status } } }'), null, 2);
|
|
55
|
+
};
|
|
56
|
+
document.getElementById('restart').onclick = async () => {
|
|
57
|
+
out.textContent = JSON.stringify(await gql('mutation { restart { ok command } }'), null, 2);
|
|
58
|
+
};
|
|
59
|
+
<\/script>
|
|
60
|
+
</body></html>`;
|
|
61
|
+
/** CORS policy for the control plane, driven by the stack-scoped origin
|
|
62
|
+
* allowlist (`origin-policy.ts`).
|
|
63
|
+
*
|
|
64
|
+
* The GraphQL schema exposes DESTRUCTIVE mutations (wipe/prune/shutdown/
|
|
65
|
+
* restart/restoreSnapshot/deleteSnapshot/mint). Since JSON POSTs are
|
|
66
|
+
* preflighted, a correct CORS policy is a real defense: it stops any
|
|
67
|
+
* site the user happens to be visiting — INCLUDING a sibling devstack
|
|
68
|
+
* stack on another `*.localhost` host — from driving a cross-origin
|
|
69
|
+
* request against this stack's dashboard.
|
|
70
|
+
*
|
|
71
|
+
* We reflect the request `Origin` back ONLY when it is in THIS stack's
|
|
72
|
+
* allowlist (the dashboard's own router-fronted origin + direct loopback
|
|
73
|
+
* origins + caller-supplied `allowedOrigins`). The same-origin bundled SPA
|
|
74
|
+
* is served from the routed origin, so its `Origin` is in the allowlist and
|
|
75
|
+
* works. Every other origin — including a bare `*.localhost` from another
|
|
76
|
+
* stack — is denied (no `Access-Control-Allow-Origin` → the browser blocks
|
|
77
|
+
* the cross-origin read/write). A missing Origin (server-side tooling, the
|
|
78
|
+
* readiness probe) yields no CORS headers but a normal response.
|
|
79
|
+
* `credentials` stays `false`. */
|
|
80
|
+
const corsOptionsFor = (policy) => (request) => {
|
|
81
|
+
const origin = request.headers.get("origin");
|
|
82
|
+
if (checkOrigin(policy, origin) !== "ok") return false;
|
|
83
|
+
return {
|
|
84
|
+
origin: [origin],
|
|
85
|
+
credentials: false
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
/** Strip query/hash and decode a request path into a relative file path. */
|
|
89
|
+
const requestPathname = (url) => {
|
|
90
|
+
const noQuery = url.split(/[?#]/, 1)[0] ?? "/";
|
|
91
|
+
try {
|
|
92
|
+
return decodeURIComponent(noQuery);
|
|
93
|
+
} catch {
|
|
94
|
+
return noQuery;
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
/** Resolve a request pathname to an absolute file inside `root`, returning
|
|
98
|
+
* `undefined` for traversal attempts or paths that escape `root`.
|
|
99
|
+
*
|
|
100
|
+
* Traversal is REJECTED, not re-rooted: if the normalized path still bears
|
|
101
|
+
* a `..` segment we bail rather than stripping it and serving a different
|
|
102
|
+
* file than was requested. The `startsWith(root)` guard then closes any
|
|
103
|
+
* residual escape (e.g. a sibling dir sharing a prefix). */
|
|
104
|
+
const safeResolve = (root, pathname) => {
|
|
105
|
+
const normalized = normalize(pathname);
|
|
106
|
+
if (normalized === ".." || normalized.startsWith(`..${sep}`) || normalized.startsWith("../") || normalized.includes(`${sep}..${sep}`) || normalized.includes("/../") || normalized.endsWith(`${sep}..`) || normalized.endsWith("/..")) return;
|
|
107
|
+
const abs = resolve(root, normalized.replace(/^[/\\]+/, ""));
|
|
108
|
+
const rootWithSep = root.endsWith(sep) ? root : root + sep;
|
|
109
|
+
if (abs !== root && !abs.startsWith(rootWithSep)) return void 0;
|
|
110
|
+
return abs;
|
|
111
|
+
};
|
|
112
|
+
/** Build a Node request listener routing `/graphql` to yoga and everything
|
|
113
|
+
* else to the bundled SPA (with an index.html fallback for client routing).
|
|
114
|
+
* Falls back to the inline API test page when the UI bundle is absent. */
|
|
115
|
+
const makeDashboardListener = (opts) => {
|
|
116
|
+
const graphqlEndpoint = opts.graphqlEndpoint ?? "/graphql";
|
|
117
|
+
const assetsDir = opts.assetsDir ?? DASHBOARD_UI_DIR;
|
|
118
|
+
const indexHtmlPath = join(assetsDir, "index.html");
|
|
119
|
+
const uiAvailable = existsSync(indexHtmlPath);
|
|
120
|
+
if (!uiAvailable) console.warn(`[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.`);
|
|
121
|
+
const yoga = createYoga({
|
|
122
|
+
schema: dashboardSchema,
|
|
123
|
+
context: () => opts.context,
|
|
124
|
+
graphqlEndpoint,
|
|
125
|
+
graphiql: true,
|
|
126
|
+
landingPage: false,
|
|
127
|
+
cors: corsOptionsFor(opts.originPolicy)
|
|
128
|
+
});
|
|
129
|
+
const fallbackPage = testPage(graphqlEndpoint);
|
|
130
|
+
const isGraphql = (pathname) => pathname === graphqlEndpoint || pathname.startsWith(`${graphqlEndpoint}/`);
|
|
131
|
+
const sendFile = (res, absPath) => {
|
|
132
|
+
try {
|
|
133
|
+
if (!statSync(absPath).isFile()) return false;
|
|
134
|
+
const body = readFileSync(absPath);
|
|
135
|
+
res.statusCode = 200;
|
|
136
|
+
res.setHeader("content-type", contentTypeFor(absPath));
|
|
137
|
+
res.end(body);
|
|
138
|
+
return true;
|
|
139
|
+
} catch {
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
return (req, res) => {
|
|
144
|
+
const pathname = requestPathname(req.url ?? "/");
|
|
145
|
+
if (isGraphql(pathname)) {
|
|
146
|
+
yoga(req, res);
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
if (!uiAvailable) {
|
|
150
|
+
res.statusCode = 200;
|
|
151
|
+
res.setHeader("content-type", "text/html; charset=utf-8");
|
|
152
|
+
res.end(fallbackPage);
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
const abs = pathname === "/" ? void 0 : safeResolve(assetsDir, pathname);
|
|
156
|
+
if (abs !== void 0 && sendFile(res, abs)) return;
|
|
157
|
+
if (sendFile(res, indexHtmlPath)) return;
|
|
158
|
+
res.statusCode = 404;
|
|
159
|
+
res.setHeader("content-type", "text/plain; charset=utf-8");
|
|
160
|
+
res.end("not found");
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
//#endregion
|
|
164
|
+
export { makeDashboardListener };
|
|
165
|
+
|
|
166
|
+
//# sourceMappingURL=server.mjs.map
|
|
@@ -0,0 +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,QAAQ;SAC3B;AACP,SAAO;;;;;;;;;;AAWT,MAAM,eAAe,MAAc,aAAyC;CAC3E,MAAM,aAAa,UAAU,SAAS;AAGtC,KACC,eAAe,QACf,WAAW,WAAW,KAAK,MAAM,IACjC,WAAW,WAAW,MAAM,IAC5B,WAAW,SAAS,GAAG,IAAI,IAAI,MAAM,IACrC,WAAW,SAAS,OAAO,IAC3B,WAAW,SAAS,GAAG,IAAI,IAAI,IAC/B,WAAW,SAAS,MAAM,CAE1B;CAGD,MAAM,MAAM,QAAQ,MADR,WAAW,QAAQ,WAAW,GACb,CAAC;CAC9B,MAAM,cAAc,KAAK,SAAS,IAAI,GAAG,OAAO,OAAO;AACvD,KAAI,QAAQ,QAAQ,CAAC,IAAI,WAAW,YAAY,CAAE,QAAO,KAAA;AACzD,QAAO;;;;;AAMR,MAAa,yBAAyB,SAAwD;CAC7F,MAAM,kBAAkB,KAAK,mBAAmB;CAChD,MAAM,YAAY,KAAK,aAAa;CACpC,MAAM,gBAAgB,KAAK,WAAW,aAAa;CACnD,MAAM,cAAc,WAAW,cAAc;AAE7C,KAAI,CAAC,YAEJ,SAAQ,KACP,gDAAgD,UAAU,qJAC1D;CAGF,MAAM,OAAO,WAAW;EACvB,QAAQ;EACR,eAAe,KAAK;EACpB;EACA,UAAU;EACV,aAAa;EAMb,MAAM,eAAe,KAAK,aAAa;EACvC,CAAC;CACF,MAAM,eAAe,SAAS,gBAAgB;CAK9C,MAAM,aAAa,aAClB,aAAa,mBAAmB,SAAS,WAAW,GAAG,gBAAgB,GAAG;CAE3E,MAAM,YAAY,KAAyC,YAA6B;AACvF,MAAI;AACH,OAAI,CAAC,SAAS,QAAQ,CAAC,QAAQ,CAAE,QAAO;GACxC,MAAM,OAAO,aAAa,QAAQ;AAClC,OAAI,aAAa;AACjB,OAAI,UAAU,gBAAgB,eAAe,QAAQ,CAAC;AACtD,OAAI,IAAI,KAAK;AACb,UAAO;UACA;AACP,UAAO;;;AAIT,SAAQ,KAAK,QAAQ;EAEpB,MAAM,WAAW,gBADL,IAAI,OAAO,IACc;AACrC,MAAI,UAAU,SAAS,EAAE;AACnB,QAAK,KAAK,IAAI;AACnB;;AAID,MAAI,CAAC,aAAa;AACjB,OAAI,aAAa;AACjB,OAAI,UAAU,gBAAgB,2BAA2B;AACzD,OAAI,IAAI,aAAa;AACrB;;EAGD,MAAM,MAAM,aAAa,MAAM,KAAA,IAAY,YAAY,WAAW,SAAS;AAG3E,MAAI,QAAQ,KAAA,KAAa,SAAS,KAAK,IAAI,CAAE;AAI7C,MAAI,SAAS,KAAK,cAAc,CAAE;AAElC,MAAI,aAAa;AACjB,MAAI,UAAU,gBAAgB,4BAA4B;AAC1D,MAAI,IAAI,YAAY"}
|
|
@@ -1,30 +1,19 @@
|
|
|
1
|
-
import { chainId
|
|
2
|
-
import {
|
|
1
|
+
import { chainId } from "../../substrate/brand.mjs";
|
|
2
|
+
import { probeManyLenient } from "../../substrate/runtime/probes.mjs";
|
|
3
|
+
import { STALE_OBJECT_VERSION_RETRY_PROFILE, makeSpacedRetrySchedule } from "../../substrate/runtime/retry-policy.mjs";
|
|
4
|
+
import { executeSuiTx, formatExecutedFailure, isSuiStaleObjectVersionError } from "../../substrate/runtime/sui-execute/index.mjs";
|
|
5
|
+
import { artifactPublishError } from "../../primitives/artifact-publisher.mjs";
|
|
6
|
+
import { acquireOnChainArtifact } from "../internal/acquire-on-chain-artifact.mjs";
|
|
7
|
+
import { DeepbookSpans } from "./spans.mjs";
|
|
3
8
|
import { deepbookPluginError } from "./errors.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
9
|
+
import { currentLedgerObjectRef } from "../../substrate/runtime/sui-ledger/object-ref.mjs";
|
|
10
|
+
import { stableContentHash } from "./hash.mjs";
|
|
11
|
+
import { isPoolForPair } from "./type-strings.mjs";
|
|
12
|
+
import { Effect } from "effect";
|
|
6
13
|
import { normalizeStructTag, normalizeSuiAddress } from "@mysten/sui/utils";
|
|
7
14
|
import { Transaction } from "@mysten/sui/transactions";
|
|
8
15
|
import { bcs } from "@mysten/sui/bcs";
|
|
9
16
|
//#region src/plugins/deepbook/deploy.ts
|
|
10
|
-
const CachedDeepbookPoolSchema = Schema.Struct({
|
|
11
|
-
name: Schema.String,
|
|
12
|
-
poolId: Schema.String,
|
|
13
|
-
base: Schema.String,
|
|
14
|
-
quote: Schema.String,
|
|
15
|
-
baseCoinType: Schema.String,
|
|
16
|
-
quoteCoinType: Schema.String,
|
|
17
|
-
tickSize: Schema.String,
|
|
18
|
-
lotSize: Schema.String,
|
|
19
|
-
minSize: Schema.String
|
|
20
|
-
});
|
|
21
|
-
const CachedDeepbookPoolsSchema = Schema.Struct({ pools: Schema.Array(CachedDeepbookPoolSchema) });
|
|
22
|
-
const CachedDeepbookSeedResultSchema = Schema.Struct({
|
|
23
|
-
poolName: Schema.String,
|
|
24
|
-
balanceManagerId: Schema.String,
|
|
25
|
-
digest: Schema.String
|
|
26
|
-
});
|
|
27
|
-
const stableContentHash = (input) => contentHash(createHash("sha256").update(input).digest("hex"));
|
|
28
17
|
const fromCachedPools = (cached) => ({ pools: cached.pools.map((pool) => ({
|
|
29
18
|
name: pool.name,
|
|
30
19
|
poolId: pool.poolId,
|
|
@@ -84,25 +73,19 @@ const seedInputsHash = (pkg, signer, spec, pool) => stableContentHash([
|
|
|
84
73
|
String(order.payWithDeep ?? false)
|
|
85
74
|
].join("|"))
|
|
86
75
|
].join("||"));
|
|
76
|
+
const sdkGetObjectLenient = (sdk, objectId) => Effect.tryPromise({
|
|
77
|
+
try: () => sdk.core.getObject({ objectId }),
|
|
78
|
+
catch: () => null
|
|
79
|
+
}).pipe(Effect.catch(() => Effect.succeed(null)));
|
|
87
80
|
const buildVerifyProbe = (sdk, cached) => Effect.gen(function* () {
|
|
88
|
-
|
|
89
|
-
const raw = yield* Effect.tryPromise({
|
|
90
|
-
try: () => sdk.core.getObject({ objectId: pool.poolId }),
|
|
91
|
-
catch: () => null
|
|
92
|
-
}).pipe(Effect.catch(() => Effect.succeed(null)));
|
|
93
|
-
if (raw === null || raw === void 0) return null;
|
|
94
|
-
}
|
|
81
|
+
if ((yield* probeManyLenient(cached.pools.map((pool) => sdkGetObjectLenient(sdk, pool.poolId)))).some((raw) => raw === null || raw === void 0)) return null;
|
|
95
82
|
return cached;
|
|
96
83
|
});
|
|
97
84
|
const buildSeedVerifyProbe = (sdk, cached) => Effect.gen(function* () {
|
|
98
|
-
const raw = yield*
|
|
99
|
-
try: () => sdk.core.getObject({ objectId: cached.balanceManagerId }),
|
|
100
|
-
catch: () => null
|
|
101
|
-
}).pipe(Effect.catch(() => Effect.succeed(null)));
|
|
85
|
+
const raw = yield* sdkGetObjectLenient(sdk, cached.balanceManagerId);
|
|
102
86
|
if (raw === null || raw === void 0) return null;
|
|
103
87
|
return cached;
|
|
104
88
|
});
|
|
105
|
-
const simulateClient = (sdk) => sdk.client;
|
|
106
89
|
const findExistingPoolId = (sdk, signer, pkg, spec) => Effect.tryPromise({
|
|
107
90
|
try: async () => {
|
|
108
91
|
const tx = new Transaction();
|
|
@@ -112,7 +95,7 @@ const findExistingPoolId = (sdk, signer, pkg, spec) => Effect.tryPromise({
|
|
|
112
95
|
typeArguments: [spec.baseCoinType, spec.quoteCoinType],
|
|
113
96
|
arguments: [tx.object(pkg.registryId)]
|
|
114
97
|
});
|
|
115
|
-
const bytes = (await
|
|
98
|
+
const bytes = (await sdk.client.core.simulateTransaction({
|
|
116
99
|
transaction: tx,
|
|
117
100
|
include: {
|
|
118
101
|
commandResults: true,
|
|
@@ -120,7 +103,9 @@ const findExistingPoolId = (sdk, signer, pkg, spec) => Effect.tryPromise({
|
|
|
120
103
|
}
|
|
121
104
|
})).commandResults?.[0]?.returnValues?.[0]?.bcs;
|
|
122
105
|
if (bytes === void 0) return null;
|
|
123
|
-
|
|
106
|
+
const normalized = normalizeSuiAddress(bcs.Address.parse(bytes));
|
|
107
|
+
if (normalized === normalizeSuiAddress("0x0")) return null;
|
|
108
|
+
return normalized;
|
|
124
109
|
},
|
|
125
110
|
catch: () => null
|
|
126
111
|
}).pipe(Effect.catch(() => Effect.succeed(null)));
|
|
@@ -133,52 +118,42 @@ const findExistingPools = (sdk, signer, pkg, pools) => Effect.gen(function* () {
|
|
|
133
118
|
return found;
|
|
134
119
|
});
|
|
135
120
|
const pickCreatedPool = (changes, spec) => {
|
|
136
|
-
const base = normalizeStructTag(spec.baseCoinType);
|
|
137
|
-
const quote = normalizeStructTag(spec.quoteCoinType);
|
|
138
121
|
for (const change of changes) {
|
|
139
122
|
const type = change.objectType;
|
|
140
123
|
if (change.idOperation !== "Created" || type === void 0) continue;
|
|
141
|
-
if (
|
|
142
|
-
if (type.includes(base) && type.includes(quote)) return change.objectId;
|
|
124
|
+
if (isPoolForPair(type, spec.baseCoinType, spec.quoteCoinType)) return change.objectId;
|
|
143
125
|
}
|
|
144
126
|
return null;
|
|
145
127
|
};
|
|
146
128
|
const mapArtifactError = (phase, err) => deepbookPluginError(phase, err._tag === "ArtifactPublishError" ? err.detail : String(err));
|
|
147
|
-
const transactionBuildClient = (sdk) => sdk.client;
|
|
148
129
|
const ORDER_TYPE_POST_ONLY = 3;
|
|
149
130
|
const SELF_MATCHING_CANCEL_TAKER = 1;
|
|
150
131
|
const MAX_TIMESTAMP = 18446744073709551615n;
|
|
151
132
|
const SUI_TYPE = normalizeStructTag("0x2::sui::SUI");
|
|
152
133
|
const SEED_GAS_BUDGET = 500000000n;
|
|
153
134
|
const LOCALNET_REFERENCE_GAS_PRICE = 1000n;
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
};
|
|
163
|
-
const isStaleObjectVersionError = (err) => {
|
|
164
|
-
const message = decodeErrorMessage(err.message);
|
|
165
|
-
return message.includes("needs to be rebuilt because object") && message.includes("current version");
|
|
166
|
-
};
|
|
167
|
-
const executeSuiTxWithStaleObjectRetry = (params, attempt = 0) => executeSuiTx(params).pipe(Effect.catch((err) => isStaleObjectVersionError(err) && attempt < STALE_OBJECT_MAX_RETRIES ? Effect.sleep(`${STALE_OBJECT_RETRY_DELAY_MS} millis`).pipe(Effect.andThen(executeSuiTxWithStaleObjectRetry(params, attempt + 1))) : Effect.fail(err)));
|
|
135
|
+
/** Retry `executeSuiTx` when the SDK reports a stale object version
|
|
136
|
+
* (concurrent re-versioning of a shared registry / pool object). The
|
|
137
|
+
* build closure rebuilds the transaction with fresh refs each attempt;
|
|
138
|
+
* caps at `STALE_OBJECT_VERSION_RETRY_PROFILE.attempts` so a true
|
|
139
|
+
* failure surfaces instead of looping forever. */
|
|
140
|
+
const executeSuiTxWithStaleObjectRetry = (params) => executeSuiTx(params).pipe(Effect.retry({
|
|
141
|
+
schedule: makeSpacedRetrySchedule(STALE_OBJECT_VERSION_RETRY_PROFILE.delayMs, STALE_OBJECT_VERSION_RETRY_PROFILE.attempts),
|
|
142
|
+
while: isSuiStaleObjectVersionError
|
|
143
|
+
}));
|
|
168
144
|
const createDeepbookPools = (publisher, sdk, chain, signer, pkg, pools) => Effect.gen(function* () {
|
|
169
145
|
if (pools.length === 0) return { pools: [] };
|
|
170
|
-
const produced = yield* publisher
|
|
146
|
+
const produced = yield* acquireOnChainArtifact(publisher, {
|
|
171
147
|
namespace: "deepbook/pools",
|
|
172
148
|
chain: chainId(chain),
|
|
173
149
|
contentHash: poolInputsHash(pkg, signer, pools),
|
|
174
|
-
verifySchema: CachedDeepbookPoolsSchema,
|
|
175
150
|
verify: (cached) => buildVerifyProbe(sdk, cached),
|
|
176
151
|
produce: Effect.gen(function* () {
|
|
177
152
|
const existingPools = yield* findExistingPools(sdk, signer, pkg, pools);
|
|
178
153
|
const missingPools = pools.filter((pool) => !existingPools.has(pool.name));
|
|
179
154
|
const cachedPools = [];
|
|
180
155
|
if (missingPools.length > 0) {
|
|
181
|
-
const
|
|
156
|
+
const result = yield* executeSuiTx({
|
|
182
157
|
client: sdk.client,
|
|
183
158
|
signer,
|
|
184
159
|
build: async () => {
|
|
@@ -202,34 +177,27 @@ const createDeepbookPools = (publisher, sdk, chain, signer, pkg, pools) => Effec
|
|
|
202
177
|
tx.object(pkg.adminCapId)
|
|
203
178
|
]
|
|
204
179
|
});
|
|
205
|
-
return tx.build({ client:
|
|
180
|
+
return tx.build({ client: sdk.client });
|
|
206
181
|
}
|
|
207
|
-
}).pipe(Effect.mapError((err) => ({
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
detail: `deepbook pool transaction failed: ${err.message}`
|
|
211
|
-
})));
|
|
182
|
+
}).pipe(Effect.mapError((err) => artifactPublishError("produce-failed", `deepbook pool transaction failed: ${err.message}`)));
|
|
183
|
+
if (result.$kind === "FailedTransaction") return yield* Effect.fail(artifactPublishError("produce-failed", `deepbook pool transaction on-chain execution failed ` + formatExecutedFailure(result.FailedTransaction)));
|
|
184
|
+
const receipt = result.Transaction;
|
|
212
185
|
for (const pool of missingPools) {
|
|
213
186
|
const poolId = pickCreatedPool(receipt.objectChanges, pool);
|
|
214
|
-
if (poolId === null) return yield* Effect.fail({
|
|
215
|
-
_tag: "ArtifactPublishError",
|
|
216
|
-
reason: "produce-failed",
|
|
217
|
-
detail: `deepbook pool '${pool.name}' not found in objectChanges (digest=${receipt.digest}).`
|
|
218
|
-
});
|
|
187
|
+
if (poolId === null) return yield* Effect.fail(artifactPublishError("produce-failed", `deepbook pool '${pool.name}' not found in objectChanges (digest=${receipt.digest}).`));
|
|
219
188
|
cachedPools.push(toCachedPool(pool, poolId));
|
|
220
189
|
}
|
|
221
190
|
}
|
|
222
191
|
return { pools: pools.map((pool) => existingPools.get(pool.name) ?? cachedPools.find((p) => p.name === pool.name)).filter((pool) => pool !== void 0) };
|
|
223
|
-
})
|
|
224
|
-
register: () => Effect.void
|
|
192
|
+
})
|
|
225
193
|
}).pipe(Effect.mapError((err) => mapArtifactError("create-pools", err)));
|
|
226
194
|
const producedPools = new Map(produced.pools.map((pool) => [pool.name, pool]));
|
|
227
195
|
const resolvedPools = pools.map((pool) => producedPools.get(pool.name));
|
|
228
196
|
if (resolvedPools.some((pool) => pool === void 0)) return yield* Effect.fail(deepbookPluginError("create-pools", "deepbook pool creation did not return every pool."));
|
|
229
197
|
return fromCachedPools({ pools: resolvedPools.filter((pool) => pool !== void 0) });
|
|
230
198
|
}).pipe(Effect.withSpan("devstack.plugin.deepbook.createPools", { attributes: {
|
|
231
|
-
|
|
232
|
-
|
|
199
|
+
[DeepbookSpans.packageId]: pkg.packageId,
|
|
200
|
+
[DeepbookSpans.poolCount]: pools.length
|
|
233
201
|
} }));
|
|
234
202
|
const poolByName = (pools, name) => pools.find((pool) => pool.name === name);
|
|
235
203
|
const pickCreatedBalanceManager = (changes) => {
|
|
@@ -262,19 +230,14 @@ const requestSeedFunding = (strategy, signer, coinType, amount) => {
|
|
|
262
230
|
return strategy.request({
|
|
263
231
|
address: signer.address,
|
|
264
232
|
amount
|
|
265
|
-
}).pipe(Effect.mapError((err) => ({
|
|
266
|
-
_tag: "ArtifactPublishError",
|
|
267
|
-
reason: "produce-failed",
|
|
268
|
-
detail: `deepbook seed funding failed for ${coinType} to publisher '${signer.name}' amount=${amount}: ${errorDetail(err)}`
|
|
269
|
-
})));
|
|
233
|
+
}).pipe(Effect.mapError((err) => artifactPublishError("produce-failed", `deepbook seed funding failed for ${coinType} to publisher '${signer.name}' amount=${amount}: ${errorDetail(err)}`)));
|
|
270
234
|
};
|
|
271
|
-
const coinListClient = (sdk) => sdk.client;
|
|
272
235
|
const selectOwnedCoinsForBalance = async (sdk, signer, coinType, amount, purpose) => {
|
|
273
236
|
const selected = [];
|
|
274
237
|
let selectedBalance = 0n;
|
|
275
238
|
let cursor = null;
|
|
276
239
|
do {
|
|
277
|
-
const page = await
|
|
240
|
+
const page = await sdk.client.core.listCoins({
|
|
278
241
|
owner: signer.address,
|
|
279
242
|
coinType,
|
|
280
243
|
cursor,
|
|
@@ -295,23 +258,6 @@ const selectOwnedCoinsForBalance = async (sdk, signer, coinType, amount, purpose
|
|
|
295
258
|
selectedBalance
|
|
296
259
|
};
|
|
297
260
|
};
|
|
298
|
-
const ledgerObjectClient = (sdk) => sdk.client;
|
|
299
|
-
const currentLedgerObjectRef = async (sdk, objectId) => {
|
|
300
|
-
const object = (await ledgerObjectClient(sdk).ledgerService.getObject({
|
|
301
|
-
objectId,
|
|
302
|
-
readMask: { paths: [
|
|
303
|
-
"object_id",
|
|
304
|
-
"version",
|
|
305
|
-
"digest"
|
|
306
|
-
] }
|
|
307
|
-
})).response?.object;
|
|
308
|
-
if (object === void 0 || object.objectId === void 0 || object.version === void 0 || object.digest === void 0) throw new Error(`object '${objectId}' was not found while resolving a DeepBook seed input.`);
|
|
309
|
-
return {
|
|
310
|
-
objectId: object.objectId,
|
|
311
|
-
version: object.version.toString(),
|
|
312
|
-
digest: object.digest
|
|
313
|
-
};
|
|
314
|
-
};
|
|
315
261
|
const setExplicitSeedGasPayment = async (tx, sdk, signer, suiDepositAmount) => {
|
|
316
262
|
const { selected } = await selectOwnedCoinsForBalance(sdk, signer, SUI_TYPE, SEED_GAS_BUDGET + suiDepositAmount, "DeepBook seed gas and SUI deposits");
|
|
317
263
|
const gasRefs = await Promise.all(selected.map((coin) => currentLedgerObjectRef(sdk, coin.objectId)));
|
|
@@ -352,16 +298,15 @@ const seedDeepbookPools = (publisher, sdk, chain, signer, pkg, specs, pools) =>
|
|
|
352
298
|
if (seed === void 0 || seed.orders.length === 0) continue;
|
|
353
299
|
const pool = poolByName(pools, spec.name);
|
|
354
300
|
if (pool === void 0) return yield* Effect.fail(deepbookPluginError("create-pools", `deepbook seed pool '${spec.name}' was not created.`));
|
|
355
|
-
const result = yield* publisher
|
|
301
|
+
const result = yield* acquireOnChainArtifact(publisher, {
|
|
356
302
|
namespace: `deepbook/seed/${spec.name}`,
|
|
357
303
|
chain: chainId(chain),
|
|
358
304
|
contentHash: seedInputsHash(pkg, signer, spec, pool),
|
|
359
|
-
verifySchema: CachedDeepbookSeedResultSchema,
|
|
360
305
|
verify: (cached) => buildSeedVerifyProbe(sdk, cached),
|
|
361
306
|
produce: Effect.gen(function* () {
|
|
362
307
|
yield* requestSeedFunding(spec.baseFundingStrategy, signer, pool.baseCoinType, seed.baseAmount);
|
|
363
308
|
yield* requestSeedFunding(spec.quoteFundingStrategy, signer, pool.quoteCoinType, seed.quoteAmount);
|
|
364
|
-
const
|
|
309
|
+
const result = yield* executeSuiTxWithStaleObjectRetry({
|
|
365
310
|
client: sdk.client,
|
|
366
311
|
signer,
|
|
367
312
|
build: async () => {
|
|
@@ -403,33 +348,26 @@ const seedDeepbookPools = (publisher, sdk, chain, signer, pkg, specs, pools) =>
|
|
|
403
348
|
]
|
|
404
349
|
});
|
|
405
350
|
tx.transferObjects([balanceManager], signer.address);
|
|
406
|
-
return tx.build({ client:
|
|
351
|
+
return tx.build({ client: sdk.client });
|
|
407
352
|
}
|
|
408
|
-
}).pipe(Effect.mapError((err) => ({
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
detail: `deepbook seed transaction failed for pool '${spec.name}': ${err.message}`
|
|
412
|
-
})));
|
|
353
|
+
}).pipe(Effect.mapError((err) => artifactPublishError("produce-failed", `deepbook seed transaction failed for pool '${spec.name}': ${err.message}`)));
|
|
354
|
+
if (result.$kind === "FailedTransaction") return yield* Effect.fail(artifactPublishError("produce-failed", `deepbook seed transaction on-chain execution failed for pool '${spec.name}' ` + formatExecutedFailure(result.FailedTransaction)));
|
|
355
|
+
const receipt = result.Transaction;
|
|
413
356
|
const balanceManagerId = pickCreatedBalanceManager(receipt.objectChanges);
|
|
414
|
-
if (balanceManagerId === null) return yield* Effect.fail({
|
|
415
|
-
_tag: "ArtifactPublishError",
|
|
416
|
-
reason: "produce-failed",
|
|
417
|
-
detail: `deepbook seed BalanceManager not found in objectChanges (digest=${receipt.digest}).`
|
|
418
|
-
});
|
|
357
|
+
if (balanceManagerId === null) return yield* Effect.fail(artifactPublishError("produce-failed", `deepbook seed BalanceManager not found in objectChanges (digest=${receipt.digest}).`));
|
|
419
358
|
return {
|
|
420
359
|
poolName: spec.name,
|
|
421
360
|
balanceManagerId,
|
|
422
361
|
digest: receipt.digest
|
|
423
362
|
};
|
|
424
|
-
})
|
|
425
|
-
register: () => Effect.void
|
|
363
|
+
})
|
|
426
364
|
}).pipe(Effect.mapError((err) => mapArtifactError("create-pools", err)));
|
|
427
365
|
seeded.push(result);
|
|
428
366
|
}
|
|
429
367
|
return seeded;
|
|
430
368
|
}).pipe(Effect.withSpan("devstack.plugin.deepbook.seedPools", { attributes: {
|
|
431
|
-
|
|
432
|
-
|
|
369
|
+
[DeepbookSpans.packageId]: pkg.packageId,
|
|
370
|
+
[DeepbookSpans.poolCount]: specs.filter((spec) => spec.seed !== void 0).length
|
|
433
371
|
} }));
|
|
434
372
|
//#endregion
|
|
435
373
|
export { createDeepbookPools, seedDeepbookPools };
|