@mysten-incubation/devstack 0.0.1 → 0.1.1
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 +8 -4
- 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 +41 -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
package/dist/cli/main.mjs
CHANGED
|
@@ -1,149 +1,72 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import { readStackEngine } from "../api/define-devstack.mjs";
|
|
6
|
-
import { makeProjectionRef } from "../substrate/runtime/projection/state-ref.mjs";
|
|
7
|
-
import { persistProjectionChanges, readProjectionSnapshot, writeProjectionSnapshot } from "../substrate/runtime/projection/persisted.mjs";
|
|
8
|
-
import { buildSubstrateLayers, superviseStackEffect } from "../substrate/runtime/run.mjs";
|
|
9
|
-
import { commandChannelPaths, makeCommandChannelPublisher, makeCommandChannelSubscriber } from "../substrate/runtime/cross-process/command-channel/channel.mjs";
|
|
10
|
-
import { SnapshotOrchestratorService } from "../orchestrators/snapshot/service.mjs";
|
|
11
|
-
import { buildProductionOrchestratorSinks, buildProductionPostAcquireHook, layerProductionOrchestrators } from "../orchestrators/runtime-composition.mjs";
|
|
12
|
-
import { extendBuiltInPluginContext, layerBuiltInPluginRuntime } from "../runtime/built-in-plugin-layers.mjs";
|
|
13
|
-
import { resolveAppName, resolveStackName } from "../api/inference-network.mjs";
|
|
2
|
+
import { readProjectionSnapshot } from "../substrate/runtime/projection/persisted.mjs";
|
|
3
|
+
import "../substrate/runtime/index.mjs";
|
|
4
|
+
import { DevstackNetworkParseError, resolveAppName, resolveNetworkSync, resolveStackName, resolveStateDir } from "../api/inference-network.mjs";
|
|
14
5
|
import { ExitCode } from "../surfaces/cli/sysexits.mjs";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { defaultProbes } from "../surfaces/cli/commands/doctor-probes.mjs";
|
|
6
|
+
import { CliUsageError } from "../surfaces/cli/errors.mjs";
|
|
7
|
+
import { ENV_VARS } from "../surfaces/cli/flags.mjs";
|
|
8
|
+
import { emitFailure, nodeProcessIO } from "../surfaces/cli/output.mjs";
|
|
19
9
|
import { dispatch } from "../surfaces/cli/index.mjs";
|
|
10
|
+
import { defaultProbes } from "./doctor-probes.mjs";
|
|
20
11
|
import { nodeConfirmPrompt } from "../surfaces/cli/commands/confirm-node.mjs";
|
|
21
|
-
import { makeTuiSurface } from "../surfaces/tui/index.mjs";
|
|
22
12
|
import { makeSnapshotReader } from "./snapshot-reader.mjs";
|
|
23
|
-
import { makeQueueCommandPublisher, resolveUpRendererMode } from "./up-lifecycle.mjs";
|
|
24
13
|
import { makeDirectPruneDeps } from "./prune-direct.mjs";
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
14
|
+
import { makeConfigLoader, resolveConfigPath } from "./wirings/config-loader.mjs";
|
|
15
|
+
import { runUpLive } from "./wirings/up.mjs";
|
|
16
|
+
import { runApplyLive } from "./wirings/apply.mjs";
|
|
17
|
+
import { runSnapshotCaptureLiveAware, runSnapshotDeleteDirect, runSnapshotRestoreDirect } from "./wirings/snapshot.mjs";
|
|
18
|
+
import { runWipeDirect, runWipePlanDirect } from "./wirings/wipe.mjs";
|
|
19
|
+
import { Effect } from "effect";
|
|
20
|
+
import { realpathSync } from "node:fs";
|
|
21
|
+
import { dirname, resolve } from "node:path";
|
|
28
22
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
29
23
|
//#region src/cli/main.ts
|
|
30
|
-
const DEFAULT_CONFIG_PATH = "./devstack.config.ts";
|
|
31
|
-
const LIVE_APPLY_ACK_TIMEOUT_MILLIS = 600 * 1e3;
|
|
32
|
-
const stackRootFor = (runtimeRoot, stack) => resolve(runtimeRoot, "stacks", stack);
|
|
33
|
-
const rosterPathsFor = (stackRoot) => ({
|
|
34
|
-
stackLockFile: resolve(stackRoot, "stack.lock"),
|
|
35
|
-
rosterFile: resolve(stackRoot, "roster.json")
|
|
36
|
-
});
|
|
37
|
-
const ENGINE_COMMAND_TAGS = new Set([
|
|
38
|
-
"stack.start",
|
|
39
|
-
"stack.stop",
|
|
40
|
-
"stack.restart",
|
|
41
|
-
"apply.requested",
|
|
42
|
-
"codegen.requested",
|
|
43
|
-
"snapshot.capture",
|
|
44
|
-
"snapshot.restore",
|
|
45
|
-
"snapshot.list",
|
|
46
|
-
"snapshot.delete",
|
|
47
|
-
"wipe.requested",
|
|
48
|
-
"prune.requested",
|
|
49
|
-
"advance-clock.requested",
|
|
50
|
-
"shutdown.requested",
|
|
51
|
-
"shutdown.hardKillRequested",
|
|
52
|
-
"selective-restart.requested"
|
|
53
|
-
]);
|
|
54
|
-
const hasString = (value, key) => typeof value[key] === "string";
|
|
55
|
-
const isEngineCommand = (value) => {
|
|
56
|
-
if (typeof value !== "object" || value === null) return false;
|
|
57
|
-
const record = value;
|
|
58
|
-
if (typeof record.tag !== "string" || !ENGINE_COMMAND_TAGS.has(record.tag)) return false;
|
|
59
|
-
switch (record.tag) {
|
|
60
|
-
case "snapshot.restore":
|
|
61
|
-
case "snapshot.delete": return hasString(record, "snapshotId");
|
|
62
|
-
case "advance-clock.requested": return typeof record.toMillis === "number";
|
|
63
|
-
case "shutdown.hardKillRequested": return (record.signal === "SIGINT" || record.signal === "SIGTERM") && typeof record.exitCode === "number" && typeof record.at === "number";
|
|
64
|
-
case "selective-restart.requested": return hasString(record, "pluginKey");
|
|
65
|
-
case "apply.requested": return record.pluginKey === void 0 || typeof record.pluginKey === "string";
|
|
66
|
-
case "snapshot.capture": return (record.snapshotId === void 0 || typeof record.snapshotId === "string") && (record.name === void 0 || typeof record.name === "string");
|
|
67
|
-
default: return true;
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
const findCliSupervisorLiveError = (cause) => {
|
|
71
|
-
for (const reason of cause.reasons) {
|
|
72
|
-
if (!Cause.isFailReason(reason)) continue;
|
|
73
|
-
const error = reason.error;
|
|
74
|
-
if (error instanceof CliSupervisorLiveError) return error;
|
|
75
|
-
if (typeof error === "object" && error !== null && error._tag === "CliSupervisorLiveError") return error;
|
|
76
|
-
}
|
|
77
|
-
return null;
|
|
78
|
-
};
|
|
79
|
-
const resolveConfigPath = (configPath) => {
|
|
80
|
-
const target = configPath ?? DEFAULT_CONFIG_PATH;
|
|
81
|
-
const explicit = isAbsolute(target) ? target : resolve(process.cwd(), target);
|
|
82
|
-
if (existsSync(explicit)) return explicit;
|
|
83
|
-
if (configPath !== void 0 && configPath !== DEFAULT_CONFIG_PATH) return null;
|
|
84
|
-
let dir = process.cwd();
|
|
85
|
-
for (;;) {
|
|
86
|
-
const candidate = resolve(dir, "devstack.config.ts");
|
|
87
|
-
if (existsSync(candidate)) return candidate;
|
|
88
|
-
const parent = resolve(dir, "..");
|
|
89
|
-
if (parent === dir) return null;
|
|
90
|
-
dir = parent;
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
const validateStackModule = (resolvedConfigPath, mod) => {
|
|
94
|
-
const def = mod.default;
|
|
95
|
-
if (def === null || typeof def !== "object" || def._tag !== "Stack") throw new CliConfigInvalidError({ message: `config at ${resolvedConfigPath} does not default-export a Stack value (got _tag=${String(def?._tag)})` });
|
|
96
|
-
let stack;
|
|
97
|
-
try {
|
|
98
|
-
stack = readStackEngine(def);
|
|
99
|
-
} catch (cause) {
|
|
100
|
-
throw new CliConfigInvalidError({ message: `config at ${resolvedConfigPath} default-exported an invalid Stack handle: ${cause instanceof Error ? cause.message : String(cause)}` });
|
|
101
|
-
}
|
|
102
|
-
return {
|
|
103
|
-
stack,
|
|
104
|
-
resolvedConfigPath
|
|
105
|
-
};
|
|
106
|
-
};
|
|
107
|
-
const makeConfigLoader = () => ({ load: (configPath) => Effect.gen(function* () {
|
|
108
|
-
const abs = resolveConfigPath(configPath);
|
|
109
|
-
if (abs === null) {
|
|
110
|
-
const attempted = configPath !== void 0 ? resolve(process.cwd(), configPath) : resolve(process.cwd(), DEFAULT_CONFIG_PATH);
|
|
111
|
-
return yield* Effect.fail(new CliConfigNotFoundError({
|
|
112
|
-
message: `devstack config not found at ${attempted}`,
|
|
113
|
-
searchedPaths: [attempted]
|
|
114
|
-
}));
|
|
115
|
-
}
|
|
116
|
-
const url = pathToFileURL(abs).href;
|
|
117
|
-
const mod = yield* Effect.tryPromise({
|
|
118
|
-
try: () => import(url),
|
|
119
|
-
catch: (cause) => new CliConfigInvalidError({
|
|
120
|
-
message: `failed to import ${abs}: ${cause instanceof Error ? cause.message : String(cause)}`,
|
|
121
|
-
cause
|
|
122
|
-
})
|
|
123
|
-
});
|
|
124
|
-
return yield* Effect.try({
|
|
125
|
-
try: () => validateStackModule(abs, mod),
|
|
126
|
-
catch: (cause) => cause instanceof CliConfigInvalidError ? cause : new CliConfigInvalidError({
|
|
127
|
-
message: `invalid config at ${abs}`,
|
|
128
|
-
cause
|
|
129
|
-
})
|
|
130
|
-
});
|
|
131
|
-
}) });
|
|
132
24
|
/** Resolve identity from flags + env. App and stack fall through the
|
|
133
|
-
* shared cwd/package metadata resolver before their defaults.
|
|
25
|
+
* shared cwd/package metadata resolver before their defaults.
|
|
26
|
+
*
|
|
27
|
+
* State-dir precedence ladder:
|
|
28
|
+
* `--state-dir` flag (`stateDir`) > `config.options.stateDir`
|
|
29
|
+
* (`configStateDir`) > `$DEVSTACK_STATE_DIR` > `<cwd>/.devstack`.
|
|
30
|
+
* The flag maps to `resolveStateDir`'s top `runtimeRoot` rung and the
|
|
31
|
+
* config value to its `stateDir` rung so the flag always wins over a
|
|
32
|
+
* config-declared `defineDevstack({ stateDir })`.
|
|
33
|
+
*
|
|
34
|
+
* Stack-name precedence ladder (the SAME flag-beats-config shape as
|
|
35
|
+
* state-dir, so the two are consistent and reviewable side-by-side):
|
|
36
|
+
* `--stack` flag / `$DEVSTACK_STACK` (`params.stack`)
|
|
37
|
+
* > config's `defineDevstack({ stackName })`
|
|
38
|
+
* > cwd/package inference (default `'main'`).
|
|
39
|
+
* Config-vs-explicit resolution can't happen here (the config isn't
|
|
40
|
+
* loaded yet for the no-config verbs), so we record the explicit value
|
|
41
|
+
* on `ResolvedIdentity.explicitStack` and let the verb wirings apply
|
|
42
|
+
* `config.stackName` ONLY when no explicit stack was given — see
|
|
43
|
+
* `effectiveStackName` in `cli/wirings/identity.ts`. `params.stack` is
|
|
44
|
+
* exactly the explicit `--stack`-or-`$DEVSTACK_STACK` value (the argv
|
|
45
|
+
* pre-parser seeds it from env, then lets the flag overwrite it), and
|
|
46
|
+
* is `undefined` when neither was provided. */
|
|
134
47
|
const resolveIdentity = (params) => {
|
|
135
48
|
const cwd = params.cwd ?? process.cwd();
|
|
136
49
|
const app = resolveAppName({
|
|
137
50
|
explicit: params.app,
|
|
138
51
|
cwd
|
|
139
52
|
});
|
|
140
|
-
const runtimeRoot =
|
|
53
|
+
const runtimeRoot = resolveStateDir({
|
|
54
|
+
runtimeRoot: params.stateDir,
|
|
55
|
+
stateDir: params.configStateDir,
|
|
56
|
+
env: process.env.DEVSTACK_STATE_DIR,
|
|
57
|
+
cwd
|
|
58
|
+
});
|
|
141
59
|
const stacksRoot = resolve(runtimeRoot, "stacks");
|
|
60
|
+
const explicitStack = params.stack !== void 0 && params.stack.length > 0 ? params.stack : void 0;
|
|
142
61
|
const stack = resolveStackName({
|
|
143
62
|
explicit: params.stack,
|
|
144
63
|
cwd
|
|
145
64
|
});
|
|
146
|
-
const network =
|
|
65
|
+
const network = resolveNetworkSync({
|
|
66
|
+
explicit: params.network,
|
|
67
|
+
env: process.env.DEVSTACK_NETWORK,
|
|
68
|
+
explicitSource: "--network"
|
|
69
|
+
}).raw;
|
|
147
70
|
const stackRoot = resolve(stacksRoot, stack);
|
|
148
71
|
return {
|
|
149
72
|
app,
|
|
@@ -152,377 +75,68 @@ const resolveIdentity = (params) => {
|
|
|
152
75
|
runtimeRoot,
|
|
153
76
|
stacksRoot,
|
|
154
77
|
stackRoot,
|
|
155
|
-
rosterFile: resolve(stackRoot, "roster.json")
|
|
78
|
+
rosterFile: resolve(stackRoot, "roster.json"),
|
|
79
|
+
explicitStack
|
|
156
80
|
};
|
|
157
81
|
};
|
|
158
|
-
const projectionStatusReader = (identity) => ({ readState: (
|
|
159
|
-
const commandResultFromProcess = () => ({ exitCode: typeof process.exitCode === "number" ? process.exitCode : 0 });
|
|
82
|
+
const projectionStatusReader = (identity) => ({ readState: () => Effect.sync(() => readProjectionSnapshot(identity.stackRoot)) });
|
|
160
83
|
const buildDirectDeps = (identity) => {
|
|
161
|
-
const loader = makeConfigLoader();
|
|
162
84
|
return {
|
|
163
85
|
up: { run: (flags) => runUpLive(flags.configPath, identity, {
|
|
164
86
|
renderer: flags.renderer,
|
|
165
87
|
stdoutIsTty: Boolean(process.stdout.isTTY)
|
|
166
|
-
})
|
|
167
|
-
apply: { run: (flags) => runApplyLive(flags.configPath, identity)
|
|
88
|
+
}) },
|
|
89
|
+
apply: { run: (flags) => runApplyLive(flags.configPath, identity) },
|
|
168
90
|
status: { reader: projectionStatusReader(identity) },
|
|
169
|
-
snapshot:
|
|
91
|
+
snapshot: {
|
|
92
|
+
reader: makeSnapshotReader(identity),
|
|
93
|
+
capture: (args) => runSnapshotCaptureLiveAware(identity, args),
|
|
94
|
+
restore: (snapshotId) => runSnapshotRestoreDirect(identity, snapshotId),
|
|
95
|
+
delete: (snapshotId) => runSnapshotDeleteDirect(identity, snapshotId),
|
|
96
|
+
confirm: nodeConfirmPrompt
|
|
97
|
+
},
|
|
170
98
|
prune: makeDirectPruneDeps({ runtimeRoot: identity.runtimeRoot }),
|
|
171
99
|
doctor: { probes: defaultProbes({
|
|
172
100
|
stateDir: identity.runtimeRoot,
|
|
173
101
|
appRoot: identity.stacksRoot
|
|
174
102
|
}) },
|
|
175
|
-
config: { loader },
|
|
103
|
+
config: { loader: makeConfigLoader() },
|
|
176
104
|
wipe: {
|
|
177
105
|
wipe: () => runWipeDirect(identity),
|
|
106
|
+
plan: () => runWipePlanDirect(identity),
|
|
178
107
|
confirm: nodeConfirmPrompt
|
|
179
108
|
}
|
|
180
109
|
};
|
|
181
110
|
};
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
onProgress: (progress) => handlerCtx.publish({
|
|
190
|
-
tag: "snapshot.captureProgress",
|
|
191
|
-
...cmd.snapshotId === void 0 ? {} : { snapshotId: cmd.snapshotId },
|
|
192
|
-
...cmd.name === void 0 ? {} : { name: cmd.name },
|
|
193
|
-
phase: progress.phase,
|
|
194
|
-
...progress.detail === void 0 ? {} : { detail: progress.detail },
|
|
195
|
-
...progress.pausedContainers === void 0 ? {} : { pausedContainers: progress.pausedContainers },
|
|
196
|
-
...progress.totalContainers === void 0 ? {} : { totalContainers: progress.totalContainers },
|
|
197
|
-
at: Date.now()
|
|
198
|
-
})
|
|
199
|
-
})).pipe(Effect.map((meta) => [{
|
|
200
|
-
tag: "snapshot.captured",
|
|
201
|
-
snapshotId: meta.id,
|
|
202
|
-
...meta.label === null ? {} : { name: meta.label },
|
|
203
|
-
at: Date.now()
|
|
204
|
-
}]));
|
|
205
|
-
case "snapshot.restore": return provideFileSystem(params.snapshot.restore({ id: cmd.snapshotId })).pipe(Effect.map((meta) => [{
|
|
206
|
-
tag: "snapshot.restored",
|
|
207
|
-
snapshotId: meta.id,
|
|
208
|
-
at: Date.now()
|
|
209
|
-
}]));
|
|
210
|
-
case "snapshot.list": return provideFileSystem(params.snapshot.list).pipe(Effect.as([]));
|
|
211
|
-
case "snapshot.delete": return provideFileSystem(params.snapshot.delete(cmd.snapshotId)).pipe(Effect.as([]));
|
|
212
|
-
case "wipe.requested": return provideFileSystem(params.snapshot.wipe({})).pipe(Effect.as([]));
|
|
213
|
-
case "prune.requested": return provideFileSystem(params.snapshot.prune({})).pipe(Effect.as([]));
|
|
214
|
-
default: return Effect.succeed([]);
|
|
215
|
-
}
|
|
216
|
-
};
|
|
217
|
-
};
|
|
218
|
-
const installLiveSupervisorRoster = (params) => Effect.gen(function* () {
|
|
219
|
-
const paths = rosterPathsFor(params.stackRoot);
|
|
220
|
-
if (!(yield* claim(paths)).soleHolder) {
|
|
221
|
-
yield* release(paths).pipe(Effect.catch(() => Effect.void));
|
|
222
|
-
return yield* Effect.fail(new CliSupervisorLiveError({
|
|
223
|
-
app: params.app,
|
|
224
|
-
stack: params.stack,
|
|
225
|
-
hint: "use `devstack apply` from another shell, or choose a different --stack name"
|
|
226
|
-
}));
|
|
227
|
-
}
|
|
228
|
-
yield* Effect.addFinalizer(() => release(paths).pipe(Effect.catch(() => Effect.void)));
|
|
229
|
-
yield* Effect.forkScoped(heartbeatFiber(paths));
|
|
230
|
-
});
|
|
231
|
-
const installCommandChannelBridge = (params) => Effect.gen(function* () {
|
|
232
|
-
const subscriber = yield* makeCommandChannelSubscriber(commandChannelPaths(params.stackRoot), { fromOffset: "current" });
|
|
233
|
-
yield* Effect.forkScoped(subscriber.commands.pipe(Stream.runForEach((record) => Effect.gen(function* () {
|
|
234
|
-
if (!isEngineCommand(record.command)) {
|
|
235
|
-
yield* subscriber.fail(record.id, "invalid command", "command payload did not match EngineCommand").pipe(Effect.catch(() => Effect.void));
|
|
236
|
-
return;
|
|
237
|
-
}
|
|
238
|
-
yield* params.handle.runCommand(record.command).pipe(Effect.andThen(subscriber.ack(record.id)), Effect.catchCause((cause) => subscriber.fail(record.id, "command failed", Cause.pretty(cause)).pipe(Effect.catch(() => Effect.void))));
|
|
239
|
-
})), Effect.catchCause((cause) => Effect.sync(() => {
|
|
240
|
-
process.stderr.write(`command channel failed: ${Cause.pretty(cause)}\n`);
|
|
241
|
-
}))));
|
|
242
|
-
return { publishEvent: (event) => subscriber.publishEvent(event).pipe(Effect.catch(() => Effect.void)) };
|
|
243
|
-
});
|
|
244
|
-
/**
|
|
245
|
-
* Run `devstack up`. Wires the substrate Layer stack, supervisor,
|
|
246
|
-
* attached renderer, and in-process TUI command queue. The Effect runs
|
|
247
|
-
* as the outer Node fiber so SIGINT reaches scope finalizers.
|
|
248
|
-
*/
|
|
249
|
-
const runUpLive = (configPath, identity, options) => {
|
|
250
|
-
const loader = makeConfigLoader();
|
|
251
|
-
return Effect.gen(function* () {
|
|
252
|
-
const loaded = yield* loader.load(configPath).pipe(Effect.catch((err) => Effect.sync(() => {
|
|
253
|
-
process.stderr.write(`error: ${err.message}\n`);
|
|
254
|
-
process.exitCode = err._tag === "CliConfigNotFoundError" ? 66 : 78;
|
|
255
|
-
return null;
|
|
256
|
-
})));
|
|
257
|
-
if (loaded === null) return;
|
|
258
|
-
const stack = loaded.stack;
|
|
259
|
-
const identityValue = {
|
|
260
|
-
app: appName(identity.app),
|
|
261
|
-
stack: stackName(stack.options.stackName ?? identity.stack),
|
|
262
|
-
chain: chainId(identity.network)
|
|
263
|
-
};
|
|
264
|
-
const appRoot = dirname(loaded.resolvedConfigPath);
|
|
265
|
-
const rendererMode = resolveUpRendererMode({
|
|
266
|
-
cliRenderer: options.renderer,
|
|
267
|
-
stackRenderer: stack.options.renderer,
|
|
268
|
-
stdoutIsTty: options.stdoutIsTty
|
|
269
|
-
});
|
|
270
|
-
const substrateLayers = layerProductionOrchestrators({ codegen: {
|
|
271
|
-
appRoot,
|
|
272
|
-
outputDir: stack.options.codegen?.outputDir,
|
|
273
|
-
stackSubdir: stack.options.codegen?.stackSubdir ?? null
|
|
274
|
-
} }).pipe(Layer.provideMerge(buildSubstrateLayers(identityValue, identity.runtimeRoot)));
|
|
275
|
-
yield* Effect.gen(function* () {
|
|
276
|
-
const state = yield* makeProjectionRef();
|
|
277
|
-
const snapshotCommandHandler = makeSnapshotCommandHandler({
|
|
278
|
-
snapshot: yield* SnapshotOrchestratorService,
|
|
279
|
-
fs: yield* FileSystem.FileSystem
|
|
280
|
-
});
|
|
281
|
-
const orchestratorSinks = yield* buildProductionOrchestratorSinks();
|
|
282
|
-
const postAcquireHook = yield* buildProductionPostAcquireHook({ extras: stack.options.extras });
|
|
283
|
-
yield* superviseStackEffect({
|
|
284
|
-
_tag: "Stack",
|
|
285
|
-
members: stack.members,
|
|
286
|
-
options: stack.options
|
|
287
|
-
}, identityValue, state, {
|
|
288
|
-
orchestratorSinks,
|
|
289
|
-
commandHandler: snapshotCommandHandler,
|
|
290
|
-
postAcquireHook,
|
|
291
|
-
extendContext: extendBuiltInPluginContext,
|
|
292
|
-
beforeInitialAcquire: (handle) => Effect.gen(function* () {
|
|
293
|
-
const stackPaths = yield* StackPathsService;
|
|
294
|
-
const commandChannel = yield* installCommandChannelBridge({
|
|
295
|
-
stackRoot: stackPaths.stackRoot,
|
|
296
|
-
handle
|
|
297
|
-
});
|
|
298
|
-
yield* installLiveSupervisorRoster({
|
|
299
|
-
stackRoot: stackPaths.stackRoot,
|
|
300
|
-
app: String(identityValue.app),
|
|
301
|
-
stack: String(identityValue.stack)
|
|
302
|
-
});
|
|
303
|
-
const rendererEvents = yield* Queue.unbounded();
|
|
304
|
-
const renderer = makeTuiSurface({
|
|
305
|
-
mode: rendererMode,
|
|
306
|
-
publishCommand: makeQueueCommandPublisher(handle.commands)
|
|
307
|
-
});
|
|
308
|
-
yield* Effect.addFinalizer(() => renderer.flush.pipe(Effect.catch(() => Effect.void)));
|
|
309
|
-
yield* Effect.forkScoped(renderer.mount(handle.state, Stream.fromQueue(rendererEvents)).pipe(Effect.catch((cause) => Effect.sync(() => {
|
|
310
|
-
process.stderr.write(`renderer failed: ${cause.detail ?? String(cause)}\n`);
|
|
311
|
-
}))));
|
|
312
|
-
yield* Effect.forkScoped(persistProjectionChanges(stackPaths.stackRoot, handle.state));
|
|
313
|
-
yield* Effect.forkScoped(Stream.fromQueue(handle.events).pipe(Stream.runForEach((event) => Effect.gen(function* () {
|
|
314
|
-
yield* Queue.offer(rendererEvents, event);
|
|
315
|
-
yield* commandChannel.publishEvent(event);
|
|
316
|
-
}))));
|
|
317
|
-
})
|
|
318
|
-
}).pipe(Effect.provide(layerBuiltInPluginRuntime(orchestratorSinks)));
|
|
319
|
-
}).pipe(Effect.provide(substrateLayers), Effect.provide(Logger.layer([])), Effect.matchCauseEffect({
|
|
320
|
-
onFailure: (cause) => Effect.sync(() => {
|
|
321
|
-
const live = findCliSupervisorLiveError(cause);
|
|
322
|
-
if (live !== null) {
|
|
323
|
-
process.stderr.write(`error: supervisor live for ${live.app}/${live.stack}\n`);
|
|
324
|
-
if (live.hint !== void 0) process.stderr.write(`hint: ${live.hint}\n`);
|
|
325
|
-
process.exitCode = ExitCode.SUPERVISOR_LIVE;
|
|
326
|
-
return;
|
|
327
|
-
}
|
|
328
|
-
process.stderr.write(`\nerror: stack failed\n${Cause.pretty(cause)}\n`);
|
|
329
|
-
process.exitCode = 1;
|
|
330
|
-
}),
|
|
331
|
-
onSuccess: () => Effect.sync(() => {
|
|
332
|
-
process.exitCode ??= 0;
|
|
333
|
-
})
|
|
334
|
-
}));
|
|
335
|
-
});
|
|
336
|
-
};
|
|
337
|
-
const runApplyAgainstLiveSupervisor = (identity, identityValue) => Effect.gen(function* () {
|
|
338
|
-
const stackRoot = stackRootFor(identity.runtimeRoot, String(identityValue.stack));
|
|
339
|
-
if (!(yield* probeSupervisorPresence(resolve(stackRoot, "roster.json")).pipe(Effect.catch(() => Effect.succeed({
|
|
340
|
-
live: false,
|
|
341
|
-
pid: null,
|
|
342
|
-
hostname: null
|
|
343
|
-
})))).live) return false;
|
|
344
|
-
const exit = yield* Effect.exit(Effect.gen(function* () {
|
|
345
|
-
const publisher = yield* makeCommandChannelPublisher(commandChannelPaths(stackRoot));
|
|
346
|
-
const published = yield* publisher.publish({ tag: "apply.requested" });
|
|
347
|
-
const reply = yield* publisher.awaitCompletion(published.id, { timeoutMillis: LIVE_APPLY_ACK_TIMEOUT_MILLIS });
|
|
348
|
-
if (!reply.ok) return yield* Effect.fail(reply.message);
|
|
349
|
-
}));
|
|
350
|
-
if (Exit.isFailure(exit)) {
|
|
351
|
-
process.stderr.write(`\nerror: live stack apply failed\n${Cause.pretty(exit.cause)}\n`);
|
|
352
|
-
process.exitCode = 1;
|
|
353
|
-
return true;
|
|
354
|
-
}
|
|
355
|
-
process.exitCode ??= 0;
|
|
356
|
-
return true;
|
|
357
|
-
});
|
|
358
|
-
const runApplyLive = (configPath, identity) => {
|
|
359
|
-
const loader = makeConfigLoader();
|
|
360
|
-
return Effect.gen(function* () {
|
|
361
|
-
const loaded = yield* loader.load(configPath).pipe(Effect.matchEffect({
|
|
362
|
-
onFailure: (err) => Effect.gen(function* () {
|
|
363
|
-
process.stderr.write(`error: ${err.message}\n`);
|
|
364
|
-
process.exitCode = err._tag === "CliConfigNotFoundError" ? 66 : 78;
|
|
365
|
-
return yield* Effect.fail("config-load-failed");
|
|
366
|
-
}),
|
|
367
|
-
onSuccess: (v) => Effect.succeed(v)
|
|
368
|
-
}));
|
|
369
|
-
const stack = loaded.stack;
|
|
370
|
-
const identityValue = {
|
|
371
|
-
app: appName(identity.app),
|
|
372
|
-
stack: stackName(stack.options.stackName ?? identity.stack),
|
|
373
|
-
chain: chainId(identity.network)
|
|
374
|
-
};
|
|
375
|
-
if (yield* runApplyAgainstLiveSupervisor(identity, identityValue)) return;
|
|
376
|
-
const substrateLayers = layerProductionOrchestrators({ codegen: {
|
|
377
|
-
appRoot: dirname(loaded.resolvedConfigPath),
|
|
378
|
-
outputDir: stack.options.codegen?.outputDir,
|
|
379
|
-
stackSubdir: stack.options.codegen?.stackSubdir ?? null
|
|
380
|
-
} }).pipe(Layer.provideMerge(buildSubstrateLayers(identityValue, identity.runtimeRoot)));
|
|
381
|
-
yield* Effect.gen(function* () {
|
|
382
|
-
const state = yield* makeProjectionRef();
|
|
383
|
-
const orchestratorSinks = yield* buildProductionOrchestratorSinks();
|
|
384
|
-
const postAcquireHook = yield* buildProductionPostAcquireHook({ extras: stack.options.extras });
|
|
385
|
-
yield* superviseStackEffect({
|
|
386
|
-
_tag: "Stack",
|
|
387
|
-
members: stack.members,
|
|
388
|
-
options: stack.options
|
|
389
|
-
}, identityValue, state, {
|
|
390
|
-
orchestratorSinks,
|
|
391
|
-
postAcquireHook,
|
|
392
|
-
lifetime: "one-shot",
|
|
393
|
-
extendContext: extendBuiltInPluginContext
|
|
394
|
-
}).pipe(Effect.provide(layerBuiltInPluginRuntime(orchestratorSinks)));
|
|
395
|
-
yield* writeProjectionSnapshot((yield* StackPathsService).stackRoot, yield* SubscriptionRef.get(state));
|
|
396
|
-
}).pipe(Effect.provide(substrateLayers), Effect.provide(Logger.layer([Logger.consolePretty()])), Effect.matchCauseEffect({
|
|
397
|
-
onFailure: (cause) => Effect.sync(() => {
|
|
398
|
-
process.stderr.write(`\nerror: stack apply failed\n${Cause.pretty(cause)}\n`);
|
|
399
|
-
process.exitCode = 1;
|
|
400
|
-
}),
|
|
401
|
-
onSuccess: () => Effect.sync(() => {
|
|
402
|
-
process.exitCode ??= 0;
|
|
403
|
-
})
|
|
404
|
-
}));
|
|
405
|
-
}).pipe(Effect.catch(() => Effect.void));
|
|
406
|
-
};
|
|
407
|
-
const snapshotIdentityParticipants = (meta) => Object.entries(meta.identity).map(([plugin, value]) => ({
|
|
408
|
-
plugin,
|
|
409
|
-
liveIdentity: Effect.succeed({ [plugin]: value })
|
|
410
|
-
}));
|
|
411
|
-
const identityValueFor = (identity, stack) => ({
|
|
412
|
-
app: appName(identity.app),
|
|
413
|
-
stack: stackName(stack?.options.stackName ?? identity.stack),
|
|
414
|
-
chain: chainId(identity.network)
|
|
415
|
-
});
|
|
416
|
-
const directSnapshotLayers = (identity) => layerProductionOrchestrators().pipe(Layer.provideMerge(buildSubstrateLayers(identityValueFor(identity), identity.runtimeRoot)));
|
|
417
|
-
const provideFileSystem = (fs, effect) => effect.pipe(Effect.provideService(FileSystem.FileSystem, fs));
|
|
418
|
-
const ensureNoLiveSupervisor = (identity, hint) => Effect.gen(function* () {
|
|
419
|
-
if ((yield* probeSupervisorPresence(identity.rosterFile).pipe(Effect.catch(() => Effect.succeed({
|
|
420
|
-
live: false,
|
|
421
|
-
pid: null,
|
|
422
|
-
hostname: null
|
|
423
|
-
})))).live) return yield* Effect.fail(new CliSupervisorLiveError({
|
|
424
|
-
app: identity.app,
|
|
425
|
-
stack: identity.stack,
|
|
426
|
-
hint
|
|
427
|
-
}));
|
|
428
|
-
});
|
|
429
|
-
const runSnapshotRestoreDirect = (identity, snapshotId) => {
|
|
430
|
-
const restored = Effect.gen(function* () {
|
|
431
|
-
const snapshot = yield* SnapshotOrchestratorService;
|
|
432
|
-
const fs = yield* FileSystem.FileSystem;
|
|
433
|
-
const meta = (yield* provideFileSystem(fs, snapshot.list)).find((entry) => entry.id === snapshotId)?.metadata ?? null;
|
|
434
|
-
const participants = meta === null ? [] : snapshotIdentityParticipants(meta);
|
|
435
|
-
yield* provideFileSystem(fs, snapshot.restore({
|
|
436
|
-
id: snapshotId,
|
|
437
|
-
participants
|
|
438
|
-
}));
|
|
439
|
-
}).pipe(Effect.provide(directSnapshotLayers(identity)), Effect.provide(Logger.layer([Logger.consolePretty()])));
|
|
440
|
-
return ensureNoLiveSupervisor(identity, "shut down the attached `devstack up` session before restoring a snapshot").pipe(Effect.andThen(restored));
|
|
441
|
-
};
|
|
442
|
-
const runSnapshotDeleteDirect = (identity, snapshotId) => {
|
|
443
|
-
return Effect.gen(function* () {
|
|
444
|
-
const snapshot = yield* SnapshotOrchestratorService;
|
|
445
|
-
yield* provideFileSystem(yield* FileSystem.FileSystem, snapshot.delete(snapshotId));
|
|
446
|
-
}).pipe(Effect.provide(directSnapshotLayers(identity)), Effect.provide(Logger.layer([Logger.consolePretty()])));
|
|
447
|
-
};
|
|
448
|
-
const runSnapshotCaptureDirect = (identity, args) => {
|
|
449
|
-
const loader = makeConfigLoader();
|
|
450
|
-
return Effect.gen(function* () {
|
|
451
|
-
const loaded = yield* loader.load(args.configPath);
|
|
452
|
-
const stack = loaded.stack;
|
|
453
|
-
const identityValue = identityValueFor(identity, stack);
|
|
454
|
-
const substrateLayers = layerProductionOrchestrators({ codegen: {
|
|
455
|
-
appRoot: dirname(loaded.resolvedConfigPath),
|
|
456
|
-
outputDir: stack.options.codegen?.outputDir,
|
|
457
|
-
stackSubdir: stack.options.codegen?.stackSubdir ?? null
|
|
458
|
-
} }).pipe(Layer.provideMerge(buildSubstrateLayers(identityValue, identity.runtimeRoot)));
|
|
459
|
-
return yield* Effect.gen(function* () {
|
|
460
|
-
const state = yield* makeProjectionRef();
|
|
461
|
-
const snapshot = yield* SnapshotOrchestratorService;
|
|
462
|
-
const fs = yield* FileSystem.FileSystem;
|
|
463
|
-
const orchestratorSinks = yield* buildProductionOrchestratorSinks();
|
|
464
|
-
const postAcquireHook = yield* buildProductionPostAcquireHook({ extras: stack.options.extras });
|
|
465
|
-
let captureExit = Exit.succeed(void 0);
|
|
466
|
-
const capturedMeta = { current: null };
|
|
467
|
-
yield* superviseStackEffect({
|
|
468
|
-
_tag: "Stack",
|
|
469
|
-
members: stack.members,
|
|
470
|
-
options: stack.options
|
|
471
|
-
}, identityValue, state, {
|
|
472
|
-
orchestratorSinks,
|
|
473
|
-
postAcquireHook,
|
|
474
|
-
lifetime: "one-shot",
|
|
475
|
-
extendContext: extendBuiltInPluginContext,
|
|
476
|
-
withinScope: () => provideFileSystem(fs, snapshot.capture({
|
|
477
|
-
id: args.snapshotId,
|
|
478
|
-
label: args.name
|
|
479
|
-
})).pipe(Effect.tap((meta) => Effect.sync(() => {
|
|
480
|
-
capturedMeta.current = meta;
|
|
481
|
-
})), Effect.asVoid, Effect.exit, Effect.tap((exit) => Effect.sync(() => {
|
|
482
|
-
captureExit = exit;
|
|
483
|
-
})), Effect.asVoid)
|
|
484
|
-
}).pipe(Effect.provide(layerBuiltInPluginRuntime(orchestratorSinks)));
|
|
485
|
-
if (Exit.isFailure(captureExit)) yield* Effect.failCause(captureExit.cause);
|
|
486
|
-
if (capturedMeta.current === null) return yield* Effect.die("snapshot capture completed without metadata");
|
|
487
|
-
const meta = capturedMeta.current;
|
|
488
|
-
yield* writeProjectionSnapshot((yield* StackPathsService).stackRoot, yield* SubscriptionRef.get(state));
|
|
489
|
-
return {
|
|
490
|
-
snapshotId: meta.id,
|
|
491
|
-
name: meta.label ?? meta.id
|
|
492
|
-
};
|
|
493
|
-
}).pipe(Effect.provide(substrateLayers), Effect.provide(Logger.layer([Logger.consolePretty()])));
|
|
494
|
-
});
|
|
495
|
-
};
|
|
496
|
-
const makeDirectSnapshotDeps = (identity) => ({
|
|
497
|
-
reader: makeSnapshotReader(identity),
|
|
498
|
-
capture: (args) => runSnapshotCaptureDirect(identity, args),
|
|
499
|
-
restore: (snapshotId) => runSnapshotRestoreDirect(identity, snapshotId),
|
|
500
|
-
delete: (snapshotId) => runSnapshotDeleteDirect(identity, snapshotId),
|
|
501
|
-
confirm: nodeConfirmPrompt
|
|
502
|
-
});
|
|
503
|
-
const runWipeDirect = (identity) => Effect.gen(function* () {
|
|
504
|
-
yield* ensureNoLiveSupervisor(identity, "shut down the attached `devstack up` session first");
|
|
505
|
-
return yield* Effect.gen(function* () {
|
|
506
|
-
const snapshot = yield* SnapshotOrchestratorService;
|
|
507
|
-
yield* provideFileSystem(yield* FileSystem.FileSystem, snapshot.wipe({}));
|
|
508
|
-
yield* removeRouterDispatchFilesForStack({
|
|
509
|
-
runtimeRoot: identity.runtimeRoot,
|
|
510
|
-
app: identity.app,
|
|
511
|
-
stack: identity.stack
|
|
512
|
-
});
|
|
513
|
-
}).pipe(Effect.provide(directSnapshotLayers(identity)), Effect.provide(Logger.layer([Logger.consolePretty()])));
|
|
514
|
-
});
|
|
111
|
+
/** @internal Exported for tests. Resolves identity flag inputs from a
|
|
112
|
+
* `--app <x>` / `--stack <x>` / `--network <x>` / `--state-dir <x>` /
|
|
113
|
+
* `--config <x>` argv, falling back to `DEVSTACK_*` env vars. Throws
|
|
114
|
+
* on a missing or flag-shaped value so a typo doesn't silently demote
|
|
115
|
+
* a downstream flag, and on a duplicate flag (`--app a --app b`) so
|
|
116
|
+
* the pre-parser does not silently last-write-wins a value that
|
|
117
|
+
* Stricli will later reject outright. */
|
|
515
118
|
const identityInputsFromArgv = (argv, env) => {
|
|
516
119
|
let app = env.DEVSTACK_APP;
|
|
517
120
|
let stack = env.DEVSTACK_STACK;
|
|
518
121
|
let network = env.DEVSTACK_NETWORK;
|
|
519
|
-
let stateDir
|
|
122
|
+
let stateDir;
|
|
520
123
|
let configPath = env.DEVSTACK_CONFIG;
|
|
124
|
+
const seenArgvFlags = /* @__PURE__ */ new Set();
|
|
521
125
|
for (let i = 0; i < argv.length; i += 1) {
|
|
522
126
|
const token = argv[i];
|
|
523
127
|
const readValue = (name) => {
|
|
524
|
-
|
|
525
|
-
if (token
|
|
128
|
+
let value;
|
|
129
|
+
if (token.startsWith(`--${name}=`)) value = token.slice(name.length + 3);
|
|
130
|
+
else if (token === `--${name}`) {
|
|
131
|
+
const next = argv[i + 1];
|
|
132
|
+
if (next === void 0) throw new CliUsageError({ message: `flag --${name} requires a value` });
|
|
133
|
+
if (next.startsWith("--")) throw new CliUsageError({ message: `flag --${name} requires a value; got "${next}" which looks like a flag` });
|
|
134
|
+
value = next;
|
|
135
|
+
}
|
|
136
|
+
if (value === void 0) return void 0;
|
|
137
|
+
if (seenArgvFlags.has(name)) throw new CliUsageError({ message: `flag --${name} given more than once` });
|
|
138
|
+
seenArgvFlags.add(name);
|
|
139
|
+
return value;
|
|
526
140
|
};
|
|
527
141
|
app = readValue("app") ?? app;
|
|
528
142
|
stack = readValue("stack") ?? stack;
|
|
@@ -542,17 +156,89 @@ const identityCwdFromConfig = (configPath) => {
|
|
|
542
156
|
const resolved = resolveConfigPath(configPath);
|
|
543
157
|
return resolved === null ? process.cwd() : dirname(resolved);
|
|
544
158
|
};
|
|
159
|
+
/** Whether the resolved argv is a purely-informational invocation that
|
|
160
|
+
* never consumes `identity.runtimeRoot` (the only value the config
|
|
161
|
+
* pre-load feeds). For these we SKIP `configStateDirBestEffort` so we
|
|
162
|
+
* don't dynamic-import (and run the top-level side effects of) the
|
|
163
|
+
* user's `devstack.config.ts` — plus walk parent dirs — for commands
|
|
164
|
+
* the file header itself says must stay cheap:
|
|
165
|
+
*
|
|
166
|
+
* - empty argv → Stricli prints root help
|
|
167
|
+
* - `--help`/`-h` or `--version`/`-v` anywhere → Stricli short-circuits
|
|
168
|
+
* - first token `schema` → emits the static CLI schema (no state dir)
|
|
169
|
+
*
|
|
170
|
+
* An unknown verb also never reaches a state-dir consumer (Stricli
|
|
171
|
+
* fails the parse), but we keep pre-loading on the general path: the
|
|
172
|
+
* pre-parser already accepted the identity flags, and gating on a
|
|
173
|
+
* closed verb set here would duplicate the dispatcher's route table.
|
|
174
|
+
* The two flagged-as-wasteful informational paths (help/version/schema)
|
|
175
|
+
* are the ones with a registered short-circuit, so skipping exactly
|
|
176
|
+
* those removes the eager-import surprise without re-deriving routes. */
|
|
177
|
+
const argvSkipsConfigPreload = (argv) => {
|
|
178
|
+
if (argv.length === 0) return true;
|
|
179
|
+
for (const token of argv) if (token === "--help" || token === "-h" || token === "--version" || token === "-v") return true;
|
|
180
|
+
return argv.find((token) => !token.startsWith("-")) === "schema";
|
|
181
|
+
};
|
|
182
|
+
/** Best-effort read of `config.options.stateDir` (the value a program
|
|
183
|
+
* sets via `defineDevstack({ stateDir })`) for the state-dir precedence
|
|
184
|
+
* ladder in `resolveIdentity`. Swallows EVERY config-loader failure
|
|
185
|
+
* (not-found AND evaluation errors) and returns `undefined`:
|
|
186
|
+
*
|
|
187
|
+
* - No-config verbs (`prune`, `wipe`) MUST keep resolving identity
|
|
188
|
+
* without a config, so a missing config silently falls through to
|
|
189
|
+
* the flag > env > cwd ladder.
|
|
190
|
+
* - A genuinely malformed config is NOT surfaced here — the verbs that
|
|
191
|
+
* actually consume config (`up` / `apply` via `makeConfigLoader`)
|
|
192
|
+
* re-load it and surface the typed `CliConfig*` error through the
|
|
193
|
+
* normal envelope path, so behavior for those verbs is unchanged.
|
|
194
|
+
*
|
|
195
|
+
* This is one redundant config evaluation for `up` / `apply` (the verb
|
|
196
|
+
* wiring re-loads via its own loader); threading the loaded value into
|
|
197
|
+
* the verb dispatch would require touching the off-limits `wirings/up.ts`
|
|
198
|
+
* signature, so the duplicate import is accepted deliberately. */
|
|
199
|
+
const configStateDirBestEffort = async (configPath) => {
|
|
200
|
+
const loaded = await Effect.runPromise(makeConfigLoader().load(configPath).pipe(Effect.option));
|
|
201
|
+
if (loaded._tag === "None") return void 0;
|
|
202
|
+
const stateDir = loaded.value.stack.options?.stateDir;
|
|
203
|
+
return stateDir !== void 0 && stateDir.length > 0 ? stateDir : void 0;
|
|
204
|
+
};
|
|
545
205
|
const runCli = async (argv = process.argv.slice(2)) => {
|
|
546
206
|
const stdinIsTty = Boolean(process.stdin.isTTY);
|
|
547
207
|
const env = { ...process.env };
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
208
|
+
let identityInputs;
|
|
209
|
+
try {
|
|
210
|
+
identityInputs = identityInputsFromArgv(argv, env);
|
|
211
|
+
} catch (cause) {
|
|
212
|
+
const error = cause instanceof CliUsageError ? cause : new CliUsageError({ message: cause instanceof Error ? cause.message : String(cause) });
|
|
213
|
+
const jsonMode = env[ENV_VARS.JSON] === "1" || argv.includes("--json");
|
|
214
|
+
await Effect.runPromise(emitFailure(nodeProcessIO, jsonMode ? "json" : "human", {
|
|
215
|
+
command: "(parse-argv)",
|
|
216
|
+
elapsedMs: 0,
|
|
217
|
+
error
|
|
218
|
+
}));
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
const configStateDir = argvSkipsConfigPreload(argv) ? void 0 : await configStateDirBestEffort(identityInputs.configPath);
|
|
222
|
+
let identity;
|
|
223
|
+
try {
|
|
224
|
+
identity = resolveIdentity({
|
|
225
|
+
app: identityInputs.app,
|
|
226
|
+
stack: identityInputs.stack,
|
|
227
|
+
network: identityInputs.network,
|
|
228
|
+
stateDir: identityInputs.stateDir,
|
|
229
|
+
configStateDir,
|
|
230
|
+
cwd: identityCwdFromConfig(identityInputs.configPath)
|
|
231
|
+
});
|
|
232
|
+
} catch (cause) {
|
|
233
|
+
const error = cause instanceof DevstackNetworkParseError ? new CliUsageError({ message: cause.message }) : cause instanceof CliUsageError ? cause : new CliUsageError({ message: cause instanceof Error ? cause.message : String(cause) });
|
|
234
|
+
const jsonMode = env[ENV_VARS.JSON] === "1" || argv.includes("--json");
|
|
235
|
+
await Effect.runPromise(emitFailure(nodeProcessIO, jsonMode ? "json" : "human", {
|
|
236
|
+
command: "(resolve-identity)",
|
|
237
|
+
elapsedMs: 0,
|
|
238
|
+
error
|
|
239
|
+
}));
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
556
242
|
const deps = buildDirectDeps(identity);
|
|
557
243
|
await Effect.runPromise(dispatch(deps, {
|
|
558
244
|
argv,
|
|
@@ -576,11 +262,9 @@ const isMainEntrypoint = () => {
|
|
|
576
262
|
};
|
|
577
263
|
if (isMainEntrypoint()) runCli().catch((err) => {
|
|
578
264
|
process.stderr.write(`error: ${err instanceof Error ? err.message : String(err)}\n`);
|
|
579
|
-
process.exitCode =
|
|
580
|
-
}).then(() => {
|
|
581
|
-
process.exit(process.exitCode ?? 0);
|
|
265
|
+
process.exitCode = ExitCode.GENERIC;
|
|
582
266
|
});
|
|
583
267
|
//#endregion
|
|
584
|
-
export { runCli };
|
|
268
|
+
export { identityInputsFromArgv, runCli };
|
|
585
269
|
|
|
586
270
|
//# sourceMappingURL=main.mjs.map
|