@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
|
@@ -1,831 +0,0 @@
|
|
|
1
|
-
import { resolvePluginDependencies } from "../plugin.mjs";
|
|
2
|
-
import { RuntimeRoot } from "./paths.mjs";
|
|
3
|
-
import { annotateOp, annotatePhase, withPluginSpan, withStackSpan } from "./observability/spans.mjs";
|
|
4
|
-
import { CurrentPluginKey, CurrentPluginProgress } from "./current-plugin.mjs";
|
|
5
|
-
import { Logger as Logger$1 } from "./observability/logger.mjs";
|
|
6
|
-
import { prettyErrorStructured } from "./observability/pretty-error.mjs";
|
|
7
|
-
import { declareAccount, setIdentity, updateRef } from "./projection/update.mjs";
|
|
8
|
-
import { StrategyRegistryService } from "./strategy-registry/service.mjs";
|
|
9
|
-
import { isReadyOrTerminal } from "./lifecycle/state-machine.mjs";
|
|
10
|
-
import { resolveGraph } from "./lifecycle/dep-graph.mjs";
|
|
11
|
-
import { buildDependencyReaderFor, makeEntry, makeRegistry } from "./lifecycle/plugin-registry.mjs";
|
|
12
|
-
import { awaitUpstreams } from "./lifecycle/ready-gate.mjs";
|
|
13
|
-
import { buildWatchIndex, exactPrefixMatch } from "./lifecycle/watch-attribution.mjs";
|
|
14
|
-
import { planFullDrain, planRestart } from "./lifecycle/selective-restart.mjs";
|
|
15
|
-
import { installSignalHandler } from "./lifecycle/signals.mjs";
|
|
16
|
-
import { PostAcquireTaskFailed } from "./post-acquire-tasks.mjs";
|
|
17
|
-
import { CapabilitySinksService } from "./capability-sinks/service.mjs";
|
|
18
|
-
import { layerCapabilitySinksDefault } from "./capability-sinks/layer.mjs";
|
|
19
|
-
import { getOrDefault, getOrDefaultEffect } from "./context-helpers.mjs";
|
|
20
|
-
import { operationalEndpointEventsFromResolvedValue } from "./projection/operational-endpoints.mjs";
|
|
21
|
-
import { Cause, Context, Data, Deferred, Effect, Exit, Fiber, Layer, Queue, Ref, Scope, SubscriptionRef } from "effect";
|
|
22
|
-
//#region src/substrate/runtime/supervisor.ts
|
|
23
|
-
var SupervisorBootError = class extends Data.TaggedError("SupervisorBootError") {};
|
|
24
|
-
var SupervisorPostAcquireFailed = class extends Data.TaggedError("SupervisorPostAcquireFailed") {};
|
|
25
|
-
var CapabilityFactoryFailed = class extends Data.TaggedError("CapabilityFactoryFailed") {};
|
|
26
|
-
/** Fallback used when the supervisor's `pluginContext` doesn't carry a
|
|
27
|
-
* Logger service. Swallows every line — the trade-off is that bare
|
|
28
|
-
* `supervise()` smoke tests stay log-free, while the wired CLI / e2e
|
|
29
|
-
* layer stack picks up the real Logger. */
|
|
30
|
-
const noopLogger = {
|
|
31
|
-
log: () => Effect.void,
|
|
32
|
-
readTag: () => Effect.succeed({
|
|
33
|
-
lines: [],
|
|
34
|
-
truncated: false
|
|
35
|
-
}),
|
|
36
|
-
readAll: Effect.succeed(/* @__PURE__ */ new Map()),
|
|
37
|
-
clearTag: () => Effect.void
|
|
38
|
-
};
|
|
39
|
-
const projectionLevel = (level) => {
|
|
40
|
-
switch (level) {
|
|
41
|
-
case "trace":
|
|
42
|
-
case "debug": return null;
|
|
43
|
-
case "info": return "info";
|
|
44
|
-
case "warn": return "warn";
|
|
45
|
-
case "error":
|
|
46
|
-
case "fatal": return "error";
|
|
47
|
-
default: return "info";
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
const withEventPublishingLogger = (base, ref, hub) => ({
|
|
51
|
-
...base,
|
|
52
|
-
log: (tag, pluginKey, payload) => Effect.gen(function* () {
|
|
53
|
-
yield* base.log(tag, pluginKey, payload);
|
|
54
|
-
if (pluginKey === null) return;
|
|
55
|
-
const level = projectionLevel(payload.level);
|
|
56
|
-
if (level === null) return;
|
|
57
|
-
yield* publish(ref, hub, {
|
|
58
|
-
tag: "log.appended",
|
|
59
|
-
pluginKey,
|
|
60
|
-
line: payload.message,
|
|
61
|
-
level,
|
|
62
|
-
at: Date.now()
|
|
63
|
-
});
|
|
64
|
-
})
|
|
65
|
-
});
|
|
66
|
-
const noopStrategyRegistry = {
|
|
67
|
-
get: (key) => Effect.fail({
|
|
68
|
-
_tag: "StrategyNotFoundError",
|
|
69
|
-
capabilityKey: key,
|
|
70
|
-
registeredKeys: []
|
|
71
|
-
}),
|
|
72
|
-
list: () => Effect.succeed([]),
|
|
73
|
-
register: () => Effect.void
|
|
74
|
-
};
|
|
75
|
-
/** Publishing helper: writes the event to the projection ref AND
|
|
76
|
-
* enqueues it onto the live event hub for renderers that subscribe to
|
|
77
|
-
* the raw stream. */
|
|
78
|
-
const publish = (ref, hub, event) => Effect.gen(function* () {
|
|
79
|
-
yield* updateRef(ref, event);
|
|
80
|
-
yield* Queue.offer(hub, event);
|
|
81
|
-
});
|
|
82
|
-
const setCyclePhase = (ref, phase) => SubscriptionRef.update(ref, (state) => ({
|
|
83
|
-
...state,
|
|
84
|
-
cycle: {
|
|
85
|
-
...state.cycle,
|
|
86
|
-
startedAt: state.cycle.startedAt === 0 ? Date.now() : state.cycle.startedAt,
|
|
87
|
-
phase
|
|
88
|
-
}
|
|
89
|
-
}));
|
|
90
|
-
/** Build the registry's `onTransition` callback — turns status changes
|
|
91
|
-
* into typed events. */
|
|
92
|
-
const buildTransitionEmitter = (ref, hub) => (key, from, to) => publish(ref, hub, {
|
|
93
|
-
tag: "lifecycle.statusChanged",
|
|
94
|
-
pluginKey: key,
|
|
95
|
-
from,
|
|
96
|
-
to,
|
|
97
|
-
at: Date.now()
|
|
98
|
-
});
|
|
99
|
-
const buildRegistry = (graph, parentScope, emit) => Effect.gen(function* () {
|
|
100
|
-
const entries = /* @__PURE__ */ new Map();
|
|
101
|
-
for (const [key, node] of graph.nodes) {
|
|
102
|
-
const entry = yield* makeEntry(node, parentScope);
|
|
103
|
-
entries.set(key, entry);
|
|
104
|
-
}
|
|
105
|
-
return makeRegistry(entries, emit);
|
|
106
|
-
});
|
|
107
|
-
/**
|
|
108
|
-
* Resolve a plugin's `capabilities` field to a concrete decl tuple.
|
|
109
|
-
*
|
|
110
|
-
* Two accepted shapes (see `Plugin.capabilities` for the
|
|
111
|
-
* authoring-side contract):
|
|
112
|
-
*
|
|
113
|
-
* (a) Static — a plain `ReadonlyArray<CapabilityDecl>`. Returned
|
|
114
|
-
* as-is.
|
|
115
|
-
*
|
|
116
|
-
* (b) Dynamic — a `CapabilitiesFactory<…>` function. Invoked with
|
|
117
|
-
* the resolved plugin value + the acquire context built from
|
|
118
|
-
* the supervisor's identity + runtime root. The function is
|
|
119
|
-
* called once per acquire (post-success); the returned tuple
|
|
120
|
-
* flows into `dispatchContributions` like a static one.
|
|
121
|
-
*
|
|
122
|
-
* The dynamic seam exists so plugins' snapshot subtrees, codegen
|
|
123
|
-
* bindings, routable URLs, strategy contributions, etc. can stamp
|
|
124
|
-
* the REAL chain id / package id / network alias produced by their
|
|
125
|
-
* acquire body, instead of the factory-time placeholder strings the
|
|
126
|
-
* static form forces.
|
|
127
|
-
*
|
|
128
|
-
* The substrate stays generic: this resolver doesn't know any
|
|
129
|
-
* service name; the discrimination is purely structural
|
|
130
|
-
* (`typeof === 'function'`).
|
|
131
|
-
*/
|
|
132
|
-
const resolveCapabilities = (pluginKey, field, resolved, acquireContext) => {
|
|
133
|
-
if (field === void 0) return Effect.succeed([]);
|
|
134
|
-
if (typeof field === "function") return Effect.try({
|
|
135
|
-
try: () => field(resolved, acquireContext),
|
|
136
|
-
catch: (cause) => new CapabilityFactoryFailed({
|
|
137
|
-
pluginKey,
|
|
138
|
-
message: `capability factory failed for ${pluginKey}`,
|
|
139
|
-
cause
|
|
140
|
-
})
|
|
141
|
-
});
|
|
142
|
-
return Effect.succeed(field);
|
|
143
|
-
};
|
|
144
|
-
/**
|
|
145
|
-
* Walk a plugin's `capabilities` tuple + `errorContributions` after a
|
|
146
|
-
* successful acquire, route every contribution through the
|
|
147
|
-
* substrate-owned `CapabilitySinksService`. The plugin's scope is
|
|
148
|
-
* provided so each sink's `addFinalizer` lands on the plugin's scope —
|
|
149
|
-
* registrations reap on selective-restart / shutdown.
|
|
150
|
-
*
|
|
151
|
-
* The supervisor stays kind-blind: it builds the contribution union
|
|
152
|
-
* (`{source: 'capability'|'error', ...}`) and the dispatch happens
|
|
153
|
-
* inside the service. Unknown kinds are downgraded to no-ops here so
|
|
154
|
-
* the substrate-open-by-default contract holds — plugin authors can
|
|
155
|
-
* emit a custom-kind decl that is observed only by the orchestrators
|
|
156
|
-
* that registered the matching sink.
|
|
157
|
-
*/
|
|
158
|
-
const dispatchContributions = (pluginKey, capabilities, errorContributions, pluginRole, identity, pluginContext, pluginScope, sinks, ref, hub) => Effect.gen(function* () {
|
|
159
|
-
const strategyRegistry = getOrDefault(pluginContext, StrategyRegistryService, noopStrategyRegistry);
|
|
160
|
-
const harvestCtx = {
|
|
161
|
-
pluginKey,
|
|
162
|
-
identity,
|
|
163
|
-
publish: (event) => publish(ref, hub, event),
|
|
164
|
-
registerStrategy: (decl) => strategyRegistry.register(decl.capabilityKey, decl.strategy, {
|
|
165
|
-
autoMounted: decl.autoMounted,
|
|
166
|
-
...decl.priority === void 0 ? {} : { priority: decl.priority }
|
|
167
|
-
})
|
|
168
|
-
};
|
|
169
|
-
const items = [...capabilities.map((decl) => ({
|
|
170
|
-
source: "capability",
|
|
171
|
-
decl
|
|
172
|
-
})), ...errorContributions.map((contribution) => ({
|
|
173
|
-
source: "error",
|
|
174
|
-
contribution
|
|
175
|
-
}))];
|
|
176
|
-
for (const item of items) {
|
|
177
|
-
const dispatch = sinks.dispatch(item, harvestCtx).pipe(Effect.catchTag("UnknownContributionKind", () => Effect.void));
|
|
178
|
-
yield* Scope.provide(dispatch, pluginScope);
|
|
179
|
-
}
|
|
180
|
-
}).pipe(withPluginSpan("lifecycle.supervisor.dispatchContributions", {
|
|
181
|
-
app: identity.app,
|
|
182
|
-
stack: identity.stack,
|
|
183
|
-
network: identity.chain,
|
|
184
|
-
pluginKey,
|
|
185
|
-
role: pluginRole
|
|
186
|
-
}));
|
|
187
|
-
/**
|
|
188
|
-
* Run one node's `start` under its own scope. Steps:
|
|
189
|
-
* 1. Await upstreams (their ready-gates).
|
|
190
|
-
* 2. Transition `pending → acquiring` (publishes the event).
|
|
191
|
-
* 3. Build resolved dependency values from declared resource refs.
|
|
192
|
-
* 4. Run the plugin's `start` Effect inside the entry's Scope,
|
|
193
|
-
* after providing the substrate-context services bundle so the
|
|
194
|
-
* plugin's R-channel yields (`IdentityContext`,
|
|
195
|
-
* `ContainerRuntimeService`, etc.) resolve to live instances.
|
|
196
|
-
* 5. On success: stash the resolved value + `markReady` (publishes
|
|
197
|
-
* the `ready` transition).
|
|
198
|
-
* 6. On failure: `markFailed` (publishes the `failed` transition, fails
|
|
199
|
-
* the deferred so downstream consumers short-circuit).
|
|
200
|
-
*
|
|
201
|
-
* Errors are caught and stashed onto the registry entry — the outer
|
|
202
|
-
* scheduler doesn't propagate per-plugin failures; ready-gate failure
|
|
203
|
-
* propagation handles the downstream blocking. The supervisor's outer
|
|
204
|
-
* fiber surfaces the union via `Fiber.join` when the user asks for
|
|
205
|
-
* "stack ready or err".
|
|
206
|
-
*/
|
|
207
|
-
const acquireNode = (registry, key, ref, hub, pluginContext, sinks, logger, identity, runtimeRoot) => Effect.gen(function* () {
|
|
208
|
-
const entry = registry.entries.get(key);
|
|
209
|
-
if (entry === void 0) return;
|
|
210
|
-
if ((yield* awaitUpstreams(registry, entry.node).pipe(Effect.matchEffect({
|
|
211
|
-
onFailure: (cause) => Effect.gen(function* () {
|
|
212
|
-
yield* registry.markFailed(key, cause).pipe(Effect.catch(() => Effect.void));
|
|
213
|
-
return false;
|
|
214
|
-
}),
|
|
215
|
-
onSuccess: () => Effect.succeed(true)
|
|
216
|
-
}))) !== true) {
|
|
217
|
-
yield* logger.log(`supervisor/${key}`, key, {
|
|
218
|
-
level: "warn",
|
|
219
|
-
message: "plugin acquire skipped — upstream failed"
|
|
220
|
-
});
|
|
221
|
-
return;
|
|
222
|
-
}
|
|
223
|
-
yield* annotatePhase("acquire");
|
|
224
|
-
yield* logger.log(`supervisor/${key}`, key, {
|
|
225
|
-
level: "debug",
|
|
226
|
-
message: "plugin acquire start",
|
|
227
|
-
fields: { role: entry.node.member.role }
|
|
228
|
-
});
|
|
229
|
-
yield* registry.transition(key, "acquiring").pipe(Effect.catch(() => Effect.void));
|
|
230
|
-
const readDependency = buildDependencyReaderFor(registry, entry.node);
|
|
231
|
-
const deps = resolvePluginDependencies(entry.node.member, readDependency);
|
|
232
|
-
const start = entry.node.member.start;
|
|
233
|
-
const currentPluginContext = pluginContext.pipe(Context.add(CurrentPluginKey, { key }), Context.add(CurrentPluginProgress, { setPhase: (phase) => publish(ref, hub, {
|
|
234
|
-
tag: "lifecycle.phaseSet",
|
|
235
|
-
pluginKey: key,
|
|
236
|
-
phase,
|
|
237
|
-
at: Date.now()
|
|
238
|
-
}) }));
|
|
239
|
-
const providedAcquire = Effect.provide(start(deps), currentPluginContext);
|
|
240
|
-
const result = yield* Scope.provide(providedAcquire, entry.scope).pipe(Effect.matchEffect({
|
|
241
|
-
onFailure: (cause) => Effect.gen(function* () {
|
|
242
|
-
yield* registry.markFailed(key, cause).pipe(Effect.catch(() => Effect.void));
|
|
243
|
-
yield* publish(ref, hub, {
|
|
244
|
-
tag: "error.reported",
|
|
245
|
-
error: prettyErrorStructured(Cause.fail(cause), {
|
|
246
|
-
pluginKey: key,
|
|
247
|
-
severity: "error",
|
|
248
|
-
at: Date.now()
|
|
249
|
-
})
|
|
250
|
-
});
|
|
251
|
-
return { ok: false };
|
|
252
|
-
}),
|
|
253
|
-
onSuccess: (value) => Effect.succeed({
|
|
254
|
-
ok: true,
|
|
255
|
-
value
|
|
256
|
-
})
|
|
257
|
-
}));
|
|
258
|
-
if (result.ok) {
|
|
259
|
-
const acquireContext = {
|
|
260
|
-
identity,
|
|
261
|
-
chain: identity.chain,
|
|
262
|
-
runtimeRoot
|
|
263
|
-
};
|
|
264
|
-
const capsExit = yield* Effect.exit(resolveCapabilities(key, entry.node.member.capabilities, result.value, acquireContext));
|
|
265
|
-
if (Exit.isFailure(capsExit)) {
|
|
266
|
-
yield* registry.markFailed(key, capsExit.cause).pipe(Effect.catch(() => Effect.void));
|
|
267
|
-
yield* publish(ref, hub, {
|
|
268
|
-
tag: "error.reported",
|
|
269
|
-
error: prettyErrorStructured(capsExit.cause, {
|
|
270
|
-
pluginKey: key,
|
|
271
|
-
severity: "error",
|
|
272
|
-
at: Date.now()
|
|
273
|
-
})
|
|
274
|
-
});
|
|
275
|
-
yield* logger.log(`supervisor/${key}`, key, {
|
|
276
|
-
level: "error",
|
|
277
|
-
message: "plugin capability factory failed"
|
|
278
|
-
});
|
|
279
|
-
return;
|
|
280
|
-
}
|
|
281
|
-
const caps = capsExit.value;
|
|
282
|
-
const errorContributions = entry.node.member.errorContributions ?? [];
|
|
283
|
-
if (caps.length > 0 || errorContributions.length > 0) {
|
|
284
|
-
const dispatchExit = yield* Effect.exit(dispatchContributions(key, caps, errorContributions, entry.node.member.role, identity, pluginContext, entry.scope, sinks, ref, hub));
|
|
285
|
-
if (Exit.isFailure(dispatchExit)) {
|
|
286
|
-
yield* registry.markFailed(key, dispatchExit.cause).pipe(Effect.catch(() => Effect.void));
|
|
287
|
-
yield* publish(ref, hub, {
|
|
288
|
-
tag: "error.reported",
|
|
289
|
-
error: prettyErrorStructured(dispatchExit.cause, {
|
|
290
|
-
pluginKey: key,
|
|
291
|
-
severity: "error",
|
|
292
|
-
at: Date.now()
|
|
293
|
-
})
|
|
294
|
-
});
|
|
295
|
-
yield* logger.log(`supervisor/${key}`, key, {
|
|
296
|
-
level: "error",
|
|
297
|
-
message: "plugin capability dispatch failed"
|
|
298
|
-
});
|
|
299
|
-
return;
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
const routablesPresent = caps.some((capability) => capability.kind === "routable");
|
|
303
|
-
for (const event of operationalEndpointEventsFromResolvedValue(key, result.value, Date.now(), { routablesPresent })) yield* publish(ref, hub, event);
|
|
304
|
-
yield* publish(ref, hub, {
|
|
305
|
-
tag: "lifecycle.phaseSet",
|
|
306
|
-
pluginKey: key,
|
|
307
|
-
phase: null,
|
|
308
|
-
at: Date.now()
|
|
309
|
-
});
|
|
310
|
-
yield* registry.markReady(key, result.value).pipe(Effect.catch(() => Effect.void));
|
|
311
|
-
if (entry.node.member.role === "task") yield* registry.transition(key, "done").pipe(Effect.catch(() => Effect.void));
|
|
312
|
-
yield* logger.log(`supervisor/${key}`, key, {
|
|
313
|
-
level: "debug",
|
|
314
|
-
message: entry.node.member.role === "task" ? "plugin done" : "plugin ready",
|
|
315
|
-
fields: {
|
|
316
|
-
capabilities: caps.length,
|
|
317
|
-
errorContributions: errorContributions.length
|
|
318
|
-
}
|
|
319
|
-
});
|
|
320
|
-
} else yield* logger.log(`supervisor/${key}`, key, {
|
|
321
|
-
level: "debug",
|
|
322
|
-
message: "plugin acquire failed"
|
|
323
|
-
});
|
|
324
|
-
}).pipe(withPluginSpan("lifecycle.supervisor.acquireNode", {
|
|
325
|
-
app: identity.app,
|
|
326
|
-
stack: identity.stack,
|
|
327
|
-
network: identity.chain,
|
|
328
|
-
pluginKey: key,
|
|
329
|
-
role: registry.entries.get(key)?.node.member.role ?? "service"
|
|
330
|
-
}));
|
|
331
|
-
const acquireKeys = (registry, keys, ref, hub, pluginContext, sinks, logger, identity, runtimeRoot) => Effect.gen(function* () {
|
|
332
|
-
yield* Effect.annotateCurrentSpan({ "devstack.level.size": keys.length });
|
|
333
|
-
yield* Effect.all(keys.map((key) => acquireNode(registry, key, ref, hub, pluginContext, sinks, logger, identity, runtimeRoot)), {
|
|
334
|
-
concurrency: "unbounded",
|
|
335
|
-
discard: true
|
|
336
|
-
});
|
|
337
|
-
}).pipe(Effect.withSpan("lifecycle.supervisor.acquireKeys"));
|
|
338
|
-
const acquireFullGraph = (graph, registry, ref, hub, pluginContext, sinks, logger, identity, runtimeRoot) => Effect.gen(function* () {
|
|
339
|
-
yield* annotateOp("acquireFullGraph");
|
|
340
|
-
yield* acquireKeys(registry, [...graph.nodes.keys()], ref, hub, pluginContext, sinks, logger, identity, runtimeRoot);
|
|
341
|
-
}).pipe(Effect.withSpan("lifecycle.supervisor.acquireFullGraph"));
|
|
342
|
-
/**
|
|
343
|
-
* Tear down a slice in reverse-dep order, parallel within each level.
|
|
344
|
-
* Each node's scope close runs its finalizers; status transitions
|
|
345
|
-
* `ready → stopping → stopped` are emitted.
|
|
346
|
-
*
|
|
347
|
-
* Architecture § Stack lifecycle: "shutdown.requested → parallel
|
|
348
|
-
* teardown (max grace, not sum grace)".
|
|
349
|
-
*/
|
|
350
|
-
const teardownKeys = (graph, registry, keys) => Effect.gen(function* () {
|
|
351
|
-
const byLevel = graph.levels.map(() => []);
|
|
352
|
-
const keySet = new Set(keys);
|
|
353
|
-
for (let i = 0; i < graph.levels.length; i++) for (const key of graph.levels[i]) if (keySet.has(key)) byLevel[i].push(key);
|
|
354
|
-
for (let i = byLevel.length - 1; i >= 0; i--) {
|
|
355
|
-
const level = byLevel[i];
|
|
356
|
-
if (level.length === 0) continue;
|
|
357
|
-
yield* Effect.all(level.map((key) => teardownNode(registry, key)), {
|
|
358
|
-
concurrency: "unbounded",
|
|
359
|
-
discard: true
|
|
360
|
-
});
|
|
361
|
-
}
|
|
362
|
-
}).pipe(Effect.withSpan("lifecycle.supervisor.teardownKeys"));
|
|
363
|
-
const teardownNode = (registry, key) => Effect.gen(function* () {
|
|
364
|
-
const entry = registry.entries.get(key);
|
|
365
|
-
if (entry === void 0) return;
|
|
366
|
-
const status = yield* registry.getStatus(key).pipe(Effect.catch(() => Effect.succeed("pending")));
|
|
367
|
-
if (status === "ready") yield* registry.transition(key, "stopping").pipe(Effect.catch(() => Effect.void));
|
|
368
|
-
yield* Scope.close(entry.scope, Exit.void).pipe(Effect.catch(() => Effect.void));
|
|
369
|
-
if (status === "ready") yield* registry.transition(key, "stopped").pipe(Effect.catch(() => Effect.void));
|
|
370
|
-
}).pipe(Effect.withSpan("lifecycle.supervisor.teardownNode"));
|
|
371
|
-
const doSelectiveRestart = (graph, registry, ref, hub, roots, pluginContext, sinks, logger, identity, runtimeRoot, parentScope) => Effect.gen(function* () {
|
|
372
|
-
const plan = yield* planRestart(graph, roots);
|
|
373
|
-
const at = Date.now();
|
|
374
|
-
for (const root of roots) yield* publish(ref, hub, {
|
|
375
|
-
tag: "restart.requested",
|
|
376
|
-
target: { pluginKey: root },
|
|
377
|
-
at
|
|
378
|
-
});
|
|
379
|
-
yield* teardownKeys(graph, registry, plan.teardownOrder);
|
|
380
|
-
for (const key of plan.acquireOrder) {
|
|
381
|
-
yield* registry.resetForRestart(key, parentScope).pipe(Effect.catch(() => Effect.void));
|
|
382
|
-
yield* registry.transition(key, "pending").pipe(Effect.catch(() => Effect.void));
|
|
383
|
-
}
|
|
384
|
-
yield* acquireKeys(registry, plan.acquireOrder, ref, hub, pluginContext, sinks, logger, identity, runtimeRoot);
|
|
385
|
-
for (const root of roots) yield* publish(ref, hub, {
|
|
386
|
-
tag: "restart.completed",
|
|
387
|
-
target: { pluginKey: root },
|
|
388
|
-
at: Date.now()
|
|
389
|
-
});
|
|
390
|
-
}).pipe(Effect.withSpan("lifecycle.supervisor.selectiveRestart"));
|
|
391
|
-
const runInjectedCommandHandler = (deps, cmd) => Effect.gen(function* () {
|
|
392
|
-
if (deps.commandHandler === void 0) return;
|
|
393
|
-
const publishFromHandler = (event) => publish(deps.ref, deps.hub, event);
|
|
394
|
-
const exit = yield* Effect.exit(deps.commandHandler(cmd, { publish: publishFromHandler }));
|
|
395
|
-
if (Exit.isSuccess(exit)) {
|
|
396
|
-
for (const event of exit.value) yield* publish(deps.ref, deps.hub, event);
|
|
397
|
-
return;
|
|
398
|
-
}
|
|
399
|
-
if (Cause.hasInterruptsOnly(exit.cause)) return;
|
|
400
|
-
if (cmd.tag === "snapshot.capture") yield* publish(deps.ref, deps.hub, {
|
|
401
|
-
tag: "snapshot.captureFailed",
|
|
402
|
-
...cmd.snapshotId === void 0 ? {} : { snapshotId: cmd.snapshotId },
|
|
403
|
-
...cmd.name === void 0 ? {} : { name: cmd.name },
|
|
404
|
-
summary: Cause.pretty(exit.cause).split("\n")[0] ?? "snapshot capture failed",
|
|
405
|
-
at: Date.now()
|
|
406
|
-
});
|
|
407
|
-
yield* publish(deps.ref, deps.hub, {
|
|
408
|
-
tag: "error.reported",
|
|
409
|
-
error: prettyErrorStructured(exit.cause, {
|
|
410
|
-
pluginKey: null,
|
|
411
|
-
severity: "error",
|
|
412
|
-
at: Date.now()
|
|
413
|
-
})
|
|
414
|
-
});
|
|
415
|
-
yield* deps.logger.log("supervisor", null, {
|
|
416
|
-
level: "error",
|
|
417
|
-
message: `command handler failed for ${cmd.tag}`
|
|
418
|
-
});
|
|
419
|
-
}).pipe(Effect.withSpan("lifecycle.supervisor.injectedCommandHandler"));
|
|
420
|
-
const startBackgroundSnapshotCapture = (deps, cmd) => Effect.gen(function* () {
|
|
421
|
-
const token = yield* Ref.updateAndGet(deps.snapshotCaptureSeq, (n) => n + 1);
|
|
422
|
-
if (!(yield* Ref.modify(deps.snapshotCaptureTask, (state) => state.tag === "idle" ? [true, {
|
|
423
|
-
tag: "starting",
|
|
424
|
-
token,
|
|
425
|
-
snapshotId: cmd.snapshotId ?? null
|
|
426
|
-
}] : [false, state]))) {
|
|
427
|
-
yield* publish(deps.ref, deps.hub, {
|
|
428
|
-
tag: "snapshot.captureSkipped",
|
|
429
|
-
reason: "already-running",
|
|
430
|
-
at: Date.now()
|
|
431
|
-
});
|
|
432
|
-
return;
|
|
433
|
-
}
|
|
434
|
-
yield* publish(deps.ref, deps.hub, {
|
|
435
|
-
tag: "snapshot.captureStarted",
|
|
436
|
-
...cmd.snapshotId === void 0 ? {} : { snapshotId: cmd.snapshotId },
|
|
437
|
-
...cmd.name === void 0 ? {} : { name: cmd.name },
|
|
438
|
-
at: Date.now()
|
|
439
|
-
});
|
|
440
|
-
const fiber = yield* runInjectedCommandHandler(deps, cmd).pipe(Effect.ensuring(Ref.update(deps.snapshotCaptureTask, (state) => state.tag !== "idle" && state.token === token ? { tag: "idle" } : state)), Effect.forkIn(deps.parentScope));
|
|
441
|
-
yield* Ref.update(deps.snapshotCaptureTask, (state) => state.tag === "starting" && state.token === token ? {
|
|
442
|
-
tag: "running",
|
|
443
|
-
token,
|
|
444
|
-
snapshotId: cmd.snapshotId ?? null,
|
|
445
|
-
fiber
|
|
446
|
-
} : state);
|
|
447
|
-
}).pipe(Effect.withSpan("lifecycle.supervisor.backgroundSnapshotCapture"));
|
|
448
|
-
const requestBackgroundSnapshotInterrupt = (deps) => Effect.gen(function* () {
|
|
449
|
-
const fiber = yield* Ref.modify(deps.snapshotCaptureTask, (state) => state.tag === "running" ? [state.fiber, { tag: "idle" }] : [null, state]);
|
|
450
|
-
if (fiber !== null) yield* Effect.sync(() => {
|
|
451
|
-
fiber.interruptUnsafe();
|
|
452
|
-
});
|
|
453
|
-
}).pipe(Effect.withSpan("lifecycle.supervisor.interruptSnapshotCapture"));
|
|
454
|
-
const startBackgroundStackRestart = (deps) => Effect.gen(function* () {
|
|
455
|
-
const token = yield* Ref.updateAndGet(deps.stackRestartSeq, (n) => n + 1);
|
|
456
|
-
if (!(yield* Ref.modify(deps.stackRestartTask, (state) => state.tag === "idle" ? [true, {
|
|
457
|
-
tag: "starting",
|
|
458
|
-
token
|
|
459
|
-
}] : [false, state]))) {
|
|
460
|
-
yield* deps.logger.log("supervisor", null, {
|
|
461
|
-
level: "debug",
|
|
462
|
-
message: "stack restart skipped because one is already running"
|
|
463
|
-
});
|
|
464
|
-
return;
|
|
465
|
-
}
|
|
466
|
-
const fiber = yield* handleCommand(deps, { tag: "stack.restart" }).pipe(Effect.catch(() => Effect.void), Effect.ensuring(Ref.update(deps.stackRestartTask, (state) => state.tag !== "idle" && state.token === token ? { tag: "idle" } : state)), Effect.forkIn(deps.parentScope));
|
|
467
|
-
yield* Ref.update(deps.stackRestartTask, (state) => state.tag === "starting" && state.token === token ? {
|
|
468
|
-
tag: "running",
|
|
469
|
-
token,
|
|
470
|
-
fiber
|
|
471
|
-
} : state);
|
|
472
|
-
}).pipe(Effect.withSpan("lifecycle.supervisor.backgroundStackRestart"));
|
|
473
|
-
const requestBackgroundStackRestartInterrupt = (deps) => Effect.gen(function* () {
|
|
474
|
-
const fiber = yield* Ref.modify(deps.stackRestartTask, (state) => state.tag === "running" ? [state.fiber, { tag: "idle" }] : [null, state]);
|
|
475
|
-
if (fiber !== null) yield* Fiber.interrupt(fiber);
|
|
476
|
-
}).pipe(Effect.withSpan("lifecycle.supervisor.interruptStackRestart"));
|
|
477
|
-
const publishHookFailure = (deps, cause, message, pluginKey = null) => Effect.gen(function* () {
|
|
478
|
-
yield* publish(deps.ref, deps.hub, {
|
|
479
|
-
tag: "error.reported",
|
|
480
|
-
error: prettyErrorStructured(cause, {
|
|
481
|
-
pluginKey,
|
|
482
|
-
severity: "error",
|
|
483
|
-
at: Date.now()
|
|
484
|
-
})
|
|
485
|
-
});
|
|
486
|
-
yield* deps.logger.log("supervisor", null, {
|
|
487
|
-
level: "error",
|
|
488
|
-
message
|
|
489
|
-
});
|
|
490
|
-
});
|
|
491
|
-
const findPostAcquireTaskFailure = (cause) => {
|
|
492
|
-
for (const reason of cause.reasons) {
|
|
493
|
-
if (!Cause.isFailReason(reason)) continue;
|
|
494
|
-
if (reason.error instanceof PostAcquireTaskFailed) return reason.error;
|
|
495
|
-
}
|
|
496
|
-
return null;
|
|
497
|
-
};
|
|
498
|
-
const runPostAcquireHook = (deps) => Effect.gen(function* () {
|
|
499
|
-
if (deps.postAcquireHook === void 0) return;
|
|
500
|
-
const exit = yield* Effect.exit(deps.postAcquireHook({
|
|
501
|
-
graph: deps.graph,
|
|
502
|
-
registry: deps.registry,
|
|
503
|
-
identity: deps.identity,
|
|
504
|
-
runtimeRoot: deps.runtimeRoot
|
|
505
|
-
}));
|
|
506
|
-
if (Exit.isSuccess(exit)) {
|
|
507
|
-
for (const event of exit.value) yield* publish(deps.ref, deps.hub, event);
|
|
508
|
-
return;
|
|
509
|
-
}
|
|
510
|
-
const taskFailure = findPostAcquireTaskFailure(exit.cause);
|
|
511
|
-
if (taskFailure !== null) yield* deps.registry.markFailed(taskFailure.pluginKey, taskFailure.cause).pipe(Effect.catch(() => Effect.void));
|
|
512
|
-
yield* publishHookFailure(deps, exit.cause, taskFailure === null ? "post-acquire hook failed" : `post-acquire task failed: ${taskFailure.label}`, taskFailure?.pluginKey ?? null);
|
|
513
|
-
return yield* Effect.fail(new SupervisorPostAcquireFailed({ cause: exit.cause }));
|
|
514
|
-
}).pipe(Effect.withSpan("lifecycle.supervisor.postAcquireHook"));
|
|
515
|
-
const allReadyOrTerminal = (graph, registry) => Effect.gen(function* () {
|
|
516
|
-
for (const key of graph.nodes.keys()) if (!isReadyOrTerminal(yield* registry.getStatus(key).pipe(Effect.catch(() => Effect.succeed("failed"))))) return false;
|
|
517
|
-
return true;
|
|
518
|
-
});
|
|
519
|
-
const handleCommand = (deps, cmd, options = {}) => Effect.gen(function* () {
|
|
520
|
-
const { graph, registry, ref, hub, shutdownLatch, pluginContext, sinks, logger, identity, runtimeRoot, parentScope } = deps;
|
|
521
|
-
switch (cmd.tag) {
|
|
522
|
-
case "shutdown.requested":
|
|
523
|
-
case "stack.stop":
|
|
524
|
-
yield* requestBackgroundSnapshotInterrupt(deps);
|
|
525
|
-
yield* setCyclePhase(ref, "shutting-down");
|
|
526
|
-
yield* Ref.set(shutdownLatch, true);
|
|
527
|
-
yield* logger.log("supervisor", null, {
|
|
528
|
-
level: "info",
|
|
529
|
-
message: "shutdown requested"
|
|
530
|
-
});
|
|
531
|
-
yield* requestBackgroundStackRestartInterrupt(deps);
|
|
532
|
-
yield* setCyclePhase(ref, "shutting-down");
|
|
533
|
-
yield* teardownKeys(graph, registry, planFullDrain(graph).teardownOrder);
|
|
534
|
-
yield* Effect.yieldNow;
|
|
535
|
-
yield* Deferred.succeed(deps.shutdownComplete, void 0).pipe(Effect.ignore);
|
|
536
|
-
return;
|
|
537
|
-
case "shutdown.hardKillRequested":
|
|
538
|
-
yield* requestBackgroundSnapshotInterrupt(deps);
|
|
539
|
-
yield* publish(ref, hub, {
|
|
540
|
-
tag: "shutdown.escalated",
|
|
541
|
-
signal: cmd.signal,
|
|
542
|
-
exitCode: cmd.exitCode,
|
|
543
|
-
at: cmd.at
|
|
544
|
-
});
|
|
545
|
-
yield* setCyclePhase(ref, "shutting-down");
|
|
546
|
-
yield* Ref.set(shutdownLatch, true);
|
|
547
|
-
yield* requestBackgroundStackRestartInterrupt(deps);
|
|
548
|
-
yield* setCyclePhase(ref, "shutting-down");
|
|
549
|
-
yield* Deferred.succeed(deps.shutdownComplete, void 0).pipe(Effect.ignore);
|
|
550
|
-
yield* logger.log("supervisor", null, {
|
|
551
|
-
level: "fatal",
|
|
552
|
-
message: `shutdown escalated by ${cmd.signal}`,
|
|
553
|
-
fields: {
|
|
554
|
-
signal: cmd.signal,
|
|
555
|
-
exitCode: cmd.exitCode
|
|
556
|
-
}
|
|
557
|
-
});
|
|
558
|
-
return;
|
|
559
|
-
case "stack.restart": {
|
|
560
|
-
const plan = planFullDrain(graph);
|
|
561
|
-
if ((yield* doSelectiveRestart(graph, registry, ref, hub, new Set(plan.slice), pluginContext, sinks, logger, identity, runtimeRoot, parentScope).pipe(Effect.as(true), Effect.catch(() => Effect.succeed(false)))) && (yield* allReadyOrTerminal(graph, registry))) if (options.failOnPostAcquireHook === true) yield* runPostAcquireHook(deps);
|
|
562
|
-
else yield* runPostAcquireHook(deps).pipe(Effect.catch(() => Effect.void));
|
|
563
|
-
return;
|
|
564
|
-
}
|
|
565
|
-
case "selective-restart.requested":
|
|
566
|
-
if ((yield* doSelectiveRestart(graph, registry, ref, hub, new Set([cmd.pluginKey]), pluginContext, sinks, logger, identity, runtimeRoot, parentScope).pipe(Effect.as(true), Effect.catch(() => Effect.succeed(false)))) && (yield* allReadyOrTerminal(graph, registry))) if (options.failOnPostAcquireHook === true) yield* runPostAcquireHook(deps);
|
|
567
|
-
else yield* runPostAcquireHook(deps).pipe(Effect.catch(() => Effect.void));
|
|
568
|
-
return;
|
|
569
|
-
case "apply.requested":
|
|
570
|
-
if (cmd.pluginKey !== void 0) {
|
|
571
|
-
if ((yield* doSelectiveRestart(graph, registry, ref, hub, new Set([cmd.pluginKey]), pluginContext, sinks, logger, identity, runtimeRoot, parentScope).pipe(Effect.as(true), Effect.catch(() => Effect.succeed(false)))) && (yield* allReadyOrTerminal(graph, registry))) if (options.failOnPostAcquireHook === true) yield* runPostAcquireHook(deps);
|
|
572
|
-
else yield* runPostAcquireHook(deps).pipe(Effect.catch(() => Effect.void));
|
|
573
|
-
return;
|
|
574
|
-
}
|
|
575
|
-
if (yield* allReadyOrTerminal(graph, registry)) if (options.failOnPostAcquireHook === true) yield* runPostAcquireHook(deps);
|
|
576
|
-
else yield* runPostAcquireHook(deps).pipe(Effect.catch(() => Effect.void));
|
|
577
|
-
return;
|
|
578
|
-
case "codegen.requested":
|
|
579
|
-
if (yield* allReadyOrTerminal(graph, registry)) if (options.failOnPostAcquireHook === true) yield* runPostAcquireHook(deps);
|
|
580
|
-
else yield* runPostAcquireHook(deps).pipe(Effect.catch(() => Effect.void));
|
|
581
|
-
return;
|
|
582
|
-
case "snapshot.capture":
|
|
583
|
-
yield* startBackgroundSnapshotCapture(deps, cmd);
|
|
584
|
-
return;
|
|
585
|
-
case "snapshot.restore":
|
|
586
|
-
case "snapshot.list":
|
|
587
|
-
case "snapshot.delete":
|
|
588
|
-
case "wipe.requested":
|
|
589
|
-
case "prune.requested":
|
|
590
|
-
yield* runInjectedCommandHandler(deps, cmd);
|
|
591
|
-
return;
|
|
592
|
-
case "advance-clock.requested":
|
|
593
|
-
case "stack.start": return;
|
|
594
|
-
}
|
|
595
|
-
}).pipe(Effect.withSpan("lifecycle.supervisor.handleCommand"));
|
|
596
|
-
const commandLoop = (deps) => Effect.gen(function* () {
|
|
597
|
-
while (true) {
|
|
598
|
-
const next = yield* Queue.take(deps.queuedCommands);
|
|
599
|
-
if (next.kind === "submitted") {
|
|
600
|
-
const exit = yield* Effect.exit(handleCommand(deps, next.submission.command, { failOnPostAcquireHook: true }));
|
|
601
|
-
yield* Deferred.succeed(next.submission.completion, exit).pipe(Effect.ignore);
|
|
602
|
-
} else if (next.command.tag === "stack.restart") yield* startBackgroundStackRestart(deps);
|
|
603
|
-
else yield* handleCommand(deps, next.command).pipe(Effect.catch(() => Effect.void));
|
|
604
|
-
if (yield* Ref.get(deps.shutdownLatch)) return;
|
|
605
|
-
}
|
|
606
|
-
}).pipe(Effect.withSpan("lifecycle.supervisor.commandLoop"));
|
|
607
|
-
/**
|
|
608
|
-
* Prepare a supervisor for `stack` without running the initial acquire.
|
|
609
|
-
* The returned `SupervisorHandle` is Scope-managed; the supervisor's
|
|
610
|
-
* lifecycle is the surrounding Scope's lifecycle. Signal handlers,
|
|
611
|
-
* the command loop, and every plugin's scope are children of the
|
|
612
|
-
* supervisor scope. Callers that mount renderers can subscribe to the
|
|
613
|
-
* returned state before invoking `runInitialAcquire`.
|
|
614
|
-
*
|
|
615
|
-
* `pluginContext` carries the substrate-context services available to
|
|
616
|
-
* each plugin's `acquire` body (`IdentityContext`,
|
|
617
|
-
* `ContainerRuntimeService`, `RuntimeRoot`, `StackPathsService`, etc.).
|
|
618
|
-
* Plugins declare what they need by yielding the corresponding
|
|
619
|
-
* `Context.Service` tag from within `Effect.gen`; the supervisor
|
|
620
|
-
* provides this context before running the acquire effect so the
|
|
621
|
-
* plugin's R-channel narrows to `Scope.Scope` (then to `never` after
|
|
622
|
-
* the per-plugin Scope is provided). The orchestrator layer (L3)
|
|
623
|
-
* builds this context once per stack from its layer stack and hands
|
|
624
|
-
* it to the supervisor; substrate doesn't name the services itself
|
|
625
|
-
* (the context is opaque `Context.Context<never>` at this boundary).
|
|
626
|
-
*
|
|
627
|
-
* `CapabilitySinksService` extension (ARCHITECTURE.md § Plugin-author
|
|
628
|
-
* extension via Layer composition): if the caller layers a
|
|
629
|
-
* `CapabilitySinksService` into `pluginContext`, the supervisor
|
|
630
|
-
* harvests through THAT instance instead of building its own. This is
|
|
631
|
-
* the seam plugin authors use to register custom-kind sinks: compose
|
|
632
|
-
* `layerCapabilitySinksDefault(orchestratorSinks)` with one or more
|
|
633
|
-
* `Layer.effectDiscard` overlays that yield `CapabilitySinksService`
|
|
634
|
-
* and call `registerSink({ kind: 'my-custom', accept: ... })`. The
|
|
635
|
-
* `sinks: OrchestratorSinks` parameter is ignored when context carries
|
|
636
|
-
* a pre-built service (the caller's Layer already supplies whatever
|
|
637
|
-
* sink registrations it wants).
|
|
638
|
-
*
|
|
639
|
-
* Architecture § Stack lifecycle:
|
|
640
|
-
* "defineStack(config) → Identity validated → NetworkResolver
|
|
641
|
-
* consulted → Plugin dep-graph computed → level-batched parallel
|
|
642
|
-
* acquire → manifest.flushed → ready event → cycle running."
|
|
643
|
-
*/
|
|
644
|
-
const startSupervisor = (stack, identity, state, pluginContext = Context.empty(), sinks = [], commandHandler, postAcquireHook, options = {}) => Effect.gen(function* () {
|
|
645
|
-
yield* Effect.annotateCurrentSpan({ "devstack.stack.memberCount": stack.members.length });
|
|
646
|
-
const baseLogger = getOrDefault(pluginContext, Logger$1, noopLogger);
|
|
647
|
-
yield* baseLogger.log("supervisor", null, {
|
|
648
|
-
level: "debug",
|
|
649
|
-
message: "supervisor boot start",
|
|
650
|
-
fields: {
|
|
651
|
-
app: identity.app,
|
|
652
|
-
stack: identity.stack,
|
|
653
|
-
network: identity.chain,
|
|
654
|
-
memberCount: stack.members.length
|
|
655
|
-
}
|
|
656
|
-
});
|
|
657
|
-
yield* SubscriptionRef.update(state, (s) => ({
|
|
658
|
-
...setIdentity(s, {
|
|
659
|
-
app: identity.app,
|
|
660
|
-
stack: identity.stack,
|
|
661
|
-
network: identity.chain
|
|
662
|
-
}),
|
|
663
|
-
cycle: {
|
|
664
|
-
...s.cycle,
|
|
665
|
-
startedAt: s.cycle.startedAt === 0 ? Date.now() : s.cycle.startedAt,
|
|
666
|
-
phase: "booting"
|
|
667
|
-
}
|
|
668
|
-
}));
|
|
669
|
-
const graph = yield* resolveGraph(stack.members).pipe(Effect.mapError((cause) => new SupervisorBootError({ cause })));
|
|
670
|
-
const hub = yield* Queue.unbounded();
|
|
671
|
-
const commands = yield* Queue.unbounded();
|
|
672
|
-
const queuedCommands = yield* Queue.unbounded();
|
|
673
|
-
const stackRestartTask = yield* Ref.make({ tag: "idle" });
|
|
674
|
-
const stackRestartSeq = yield* Ref.make(0);
|
|
675
|
-
const snapshotCaptureTask = yield* Ref.make({ tag: "idle" });
|
|
676
|
-
const snapshotCaptureSeq = yield* Ref.make(0);
|
|
677
|
-
const shutdownLatch = yield* Ref.make(false);
|
|
678
|
-
const shutdownComplete = yield* Deferred.make();
|
|
679
|
-
const initialAcquireStarted = yield* Ref.make(false);
|
|
680
|
-
const logger = withEventPublishingLogger(baseLogger, state, hub);
|
|
681
|
-
const pluginRuntimeContext = pluginContext.pipe(Context.add(Logger$1, Logger$1.of(logger)));
|
|
682
|
-
const supervisorScope = yield* Effect.scope;
|
|
683
|
-
const registry = yield* buildRegistry(graph, supervisorScope, buildTransitionEmitter(state, hub));
|
|
684
|
-
for (const [key, node] of graph.nodes) {
|
|
685
|
-
const declaredAccount = pendingAccountProjection(key, node.member.id, Date.now());
|
|
686
|
-
yield* SubscriptionRef.update(state, (s) => ({
|
|
687
|
-
...declaredAccount === null ? s : declareAccount(s, declaredAccount),
|
|
688
|
-
rows: s.rows.some((r) => r.key === key) ? s.rows : [...s.rows, {
|
|
689
|
-
key,
|
|
690
|
-
role: node.member.role,
|
|
691
|
-
status: "pending",
|
|
692
|
-
phase: null,
|
|
693
|
-
lastError: null,
|
|
694
|
-
logTail: {
|
|
695
|
-
lines: [],
|
|
696
|
-
level: "info",
|
|
697
|
-
truncated: false
|
|
698
|
-
},
|
|
699
|
-
endpoints: [],
|
|
700
|
-
selectiveRestartHighlight: false
|
|
701
|
-
}]
|
|
702
|
-
}));
|
|
703
|
-
}
|
|
704
|
-
const runtimeRoot = getOrDefault(pluginContext, RuntimeRoot, { root: "" }).root;
|
|
705
|
-
const sinksService = yield* getOrDefaultEffect(pluginRuntimeContext, CapabilitySinksService, Effect.gen(function* () {
|
|
706
|
-
return Context.get(yield* Layer.build(layerCapabilitySinksDefault(sinks)), CapabilitySinksService);
|
|
707
|
-
}));
|
|
708
|
-
const enableCommandLoop = options.commandLoop !== false;
|
|
709
|
-
if (enableCommandLoop) {
|
|
710
|
-
yield* Effect.forkScoped(installSignalHandler(commands));
|
|
711
|
-
yield* Effect.forkScoped(Effect.gen(function* () {
|
|
712
|
-
while (true) {
|
|
713
|
-
const command = yield* Queue.take(commands);
|
|
714
|
-
yield* Queue.offer(queuedCommands, {
|
|
715
|
-
kind: "fire-and-forget",
|
|
716
|
-
command
|
|
717
|
-
});
|
|
718
|
-
}
|
|
719
|
-
}));
|
|
720
|
-
}
|
|
721
|
-
const commandLoopDeps = {
|
|
722
|
-
graph,
|
|
723
|
-
registry,
|
|
724
|
-
ref: state,
|
|
725
|
-
hub,
|
|
726
|
-
queuedCommands,
|
|
727
|
-
stackRestartTask,
|
|
728
|
-
stackRestartSeq,
|
|
729
|
-
snapshotCaptureTask,
|
|
730
|
-
snapshotCaptureSeq,
|
|
731
|
-
shutdownLatch,
|
|
732
|
-
shutdownComplete,
|
|
733
|
-
pluginContext: pluginRuntimeContext,
|
|
734
|
-
sinks: sinksService,
|
|
735
|
-
logger,
|
|
736
|
-
identity,
|
|
737
|
-
runtimeRoot,
|
|
738
|
-
parentScope: supervisorScope,
|
|
739
|
-
commandHandler,
|
|
740
|
-
postAcquireHook
|
|
741
|
-
};
|
|
742
|
-
const runInitialAcquire = Effect.gen(function* () {
|
|
743
|
-
if (yield* Ref.modify(initialAcquireStarted, (started) => [started, true])) return;
|
|
744
|
-
if (yield* Ref.get(shutdownLatch)) return;
|
|
745
|
-
yield* acquireFullGraph(graph, registry, state, hub, pluginRuntimeContext, sinksService, logger, identity, runtimeRoot);
|
|
746
|
-
if (yield* Ref.get(shutdownLatch)) return;
|
|
747
|
-
if (yield* allReadyOrTerminal(graph, registry)) {
|
|
748
|
-
yield* runPostAcquireHook(commandLoopDeps);
|
|
749
|
-
if (!(yield* Ref.get(shutdownLatch))) yield* setCyclePhase(state, "running");
|
|
750
|
-
} else if (!(yield* Ref.get(shutdownLatch))) yield* setCyclePhase(state, "running");
|
|
751
|
-
}).pipe(Effect.withSpan("lifecycle.supervisor.initialAcquire"));
|
|
752
|
-
const watchIndex = buildWatchIndex(graph.nodes);
|
|
753
|
-
const notifyWatchFire = (path) => Effect.gen(function* () {
|
|
754
|
-
const matched = /* @__PURE__ */ new Set();
|
|
755
|
-
for (const entry of watchIndex) for (const pat of entry.paths) if (exactPrefixMatch(pat, path)) {
|
|
756
|
-
matched.add(entry.pluginKey);
|
|
757
|
-
break;
|
|
758
|
-
}
|
|
759
|
-
if (matched.size === 0) return;
|
|
760
|
-
yield* Queue.offer(commands, {
|
|
761
|
-
tag: "selective-restart.requested",
|
|
762
|
-
pluginKey: [...matched][0]
|
|
763
|
-
});
|
|
764
|
-
const rest = [...matched].slice(1);
|
|
765
|
-
for (const key of rest) yield* Queue.offer(commands, {
|
|
766
|
-
tag: "selective-restart.requested",
|
|
767
|
-
pluginKey: key
|
|
768
|
-
});
|
|
769
|
-
}).pipe(Effect.withSpan("lifecycle.supervisor.notifyWatchFire"));
|
|
770
|
-
if (enableCommandLoop) yield* Effect.forkScoped(commandLoop(commandLoopDeps));
|
|
771
|
-
yield* Effect.addFinalizer(() => Effect.gen(function* () {
|
|
772
|
-
yield* teardownKeys(graph, registry, planFullDrain(graph).teardownOrder).pipe(Effect.catch(() => Effect.void));
|
|
773
|
-
}));
|
|
774
|
-
const awaitShutdown = Deferred.await(shutdownComplete).pipe(Effect.withSpan("lifecycle.supervisor.awaitShutdown"));
|
|
775
|
-
const runCommand = (command) => Effect.gen(function* () {
|
|
776
|
-
const completion = yield* Deferred.make();
|
|
777
|
-
yield* Queue.offer(queuedCommands, {
|
|
778
|
-
kind: "submitted",
|
|
779
|
-
submission: {
|
|
780
|
-
command,
|
|
781
|
-
completion
|
|
782
|
-
}
|
|
783
|
-
});
|
|
784
|
-
const exit = yield* Deferred.await(completion);
|
|
785
|
-
if (Exit.isFailure(exit)) return yield* Effect.failCause(exit.cause);
|
|
786
|
-
}).pipe(Effect.withSpan("lifecycle.supervisor.runCommand"));
|
|
787
|
-
return {
|
|
788
|
-
handle: {
|
|
789
|
-
identity,
|
|
790
|
-
graph,
|
|
791
|
-
registry,
|
|
792
|
-
events: hub,
|
|
793
|
-
commands,
|
|
794
|
-
runCommand,
|
|
795
|
-
state,
|
|
796
|
-
watchIndex,
|
|
797
|
-
notifyWatchFire,
|
|
798
|
-
awaitShutdown
|
|
799
|
-
},
|
|
800
|
-
runInitialAcquire
|
|
801
|
-
};
|
|
802
|
-
}).pipe(withStackSpan("lifecycle.supervisor.startSupervisor", {
|
|
803
|
-
app: identity.app,
|
|
804
|
-
stack: identity.stack,
|
|
805
|
-
network: identity.chain
|
|
806
|
-
}));
|
|
807
|
-
const pendingAccountProjection = (rowKey, resourceId, updatedAt) => {
|
|
808
|
-
if (!resourceId.startsWith("account/")) return null;
|
|
809
|
-
const name = resourceId.slice(8);
|
|
810
|
-
if (name.length === 0) return null;
|
|
811
|
-
return {
|
|
812
|
-
key: resourceId,
|
|
813
|
-
rowKey,
|
|
814
|
-
name,
|
|
815
|
-
address: null,
|
|
816
|
-
scheme: null,
|
|
817
|
-
source: null,
|
|
818
|
-
funding: {
|
|
819
|
-
status: "pending",
|
|
820
|
-
balanceMist: null,
|
|
821
|
-
requestedMist: null,
|
|
822
|
-
entries: []
|
|
823
|
-
},
|
|
824
|
-
walletVisible: false,
|
|
825
|
-
updatedAt
|
|
826
|
-
};
|
|
827
|
-
};
|
|
828
|
-
//#endregion
|
|
829
|
-
export { startSupervisor };
|
|
830
|
-
|
|
831
|
-
//# sourceMappingURL=supervisor.mjs.map
|