@mysten-incubation/devstack 0.0.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/LICENSE +189 -0
- package/README.md +94 -0
- package/dist/_virtual/_rolldown/runtime.mjs +13 -0
- package/dist/api/define-capabilities.d.mts +25 -0
- package/dist/api/define-capabilities.mjs +19 -0
- package/dist/api/define-capabilities.mjs.map +1 -0
- package/dist/api/define-devstack-with.d.mts +41 -0
- package/dist/api/define-devstack-with.mjs +24 -0
- package/dist/api/define-devstack-with.mjs.map +1 -0
- package/dist/api/define-devstack.d.mts +62 -0
- package/dist/api/define-devstack.mjs +108 -0
- package/dist/api/define-devstack.mjs.map +1 -0
- package/dist/api/define-plugin.d.mts +1 -0
- package/dist/api/inference-network.mjs +122 -0
- package/dist/api/inference-network.mjs.map +1 -0
- package/dist/api/mode-narrowed-factory.d.mts +26 -0
- package/dist/api/mode-narrowed-factory.mjs +8 -0
- package/dist/api/mode-narrowed-factory.mjs.map +1 -0
- package/dist/api/plugin-errors.mjs +10 -0
- package/dist/api/plugin-errors.mjs.map +1 -0
- package/dist/api/run-stack.d.mts +82 -0
- package/dist/api/run-stack.mjs +127 -0
- package/dist/api/run-stack.mjs.map +1 -0
- package/dist/build-integrations/playwright/config.d.mts +92 -0
- package/dist/build-integrations/playwright/config.mjs +71 -0
- package/dist/build-integrations/playwright/config.mjs.map +1 -0
- package/dist/build-integrations/playwright/errors.d.mts +82 -0
- package/dist/build-integrations/playwright/errors.mjs +43 -0
- package/dist/build-integrations/playwright/errors.mjs.map +1 -0
- package/dist/build-integrations/playwright/global-setup.d.mts +64 -0
- package/dist/build-integrations/playwright/global-setup.mjs +44 -0
- package/dist/build-integrations/playwright/global-setup.mjs.map +1 -0
- package/dist/build-integrations/playwright/index.d.mts +6 -0
- package/dist/build-integrations/playwright/index.mjs +6 -0
- package/dist/build-integrations/playwright/stack-context.d.mts +95 -0
- package/dist/build-integrations/playwright/stack-context.mjs +277 -0
- package/dist/build-integrations/playwright/stack-context.mjs.map +1 -0
- package/dist/build-integrations/playwright/wallet-context.d.mts +87 -0
- package/dist/build-integrations/playwright/wallet-context.mjs +148 -0
- package/dist/build-integrations/playwright/wallet-context.mjs.map +1 -0
- package/dist/build-integrations/runtime/cold-start-url.d.mts +67 -0
- package/dist/build-integrations/runtime/cold-start-url.mjs +56 -0
- package/dist/build-integrations/runtime/cold-start-url.mjs.map +1 -0
- package/dist/build-integrations/runtime/dapp-kit-slot.mjs +10 -0
- package/dist/build-integrations/runtime/dapp-kit-slot.mjs.map +1 -0
- package/dist/build-integrations/runtime/discover.d.mts +78 -0
- package/dist/build-integrations/runtime/discover.mjs +124 -0
- package/dist/build-integrations/runtime/discover.mjs.map +1 -0
- package/dist/build-integrations/runtime/endpoint-registry.d.mts +26 -0
- package/dist/build-integrations/runtime/endpoint-registry.mjs +41 -0
- package/dist/build-integrations/runtime/endpoint-registry.mjs.map +1 -0
- package/dist/build-integrations/runtime/errors.d.mts +64 -0
- package/dist/build-integrations/runtime/errors.mjs +51 -0
- package/dist/build-integrations/runtime/errors.mjs.map +1 -0
- package/dist/build-integrations/runtime/index.d.mts +7 -0
- package/dist/build-integrations/runtime/index.mjs +6 -0
- package/dist/build-integrations/runtime/read-stack-context.d.mts +38 -0
- package/dist/build-integrations/runtime/read-stack-context.mjs +130 -0
- package/dist/build-integrations/runtime/read-stack-context.mjs.map +1 -0
- package/dist/build-integrations/runtime/stack-context.d.mts +53 -0
- package/dist/build-integrations/vitest/config.d.mts +62 -0
- package/dist/build-integrations/vitest/config.mjs +80 -0
- package/dist/build-integrations/vitest/config.mjs.map +1 -0
- package/dist/build-integrations/vitest/env.d.mts +48 -0
- package/dist/build-integrations/vitest/env.mjs +50 -0
- package/dist/build-integrations/vitest/env.mjs.map +1 -0
- package/dist/build-integrations/vitest/errors.d.mts +44 -0
- package/dist/build-integrations/vitest/errors.mjs +18 -0
- package/dist/build-integrations/vitest/errors.mjs.map +1 -0
- package/dist/build-integrations/vitest/index.d.mts +6 -0
- package/dist/build-integrations/vitest/index.mjs +6 -0
- package/dist/build-integrations/vitest/setup.d.mts +53 -0
- package/dist/build-integrations/vitest/setup.mjs +56 -0
- package/dist/build-integrations/vitest/setup.mjs.map +1 -0
- package/dist/build-integrations/vitest/stack-context.d.mts +58 -0
- package/dist/build-integrations/vitest/stack-context.mjs +67 -0
- package/dist/build-integrations/vitest/stack-context.mjs.map +1 -0
- package/dist/cli/main.d.mts +5 -0
- package/dist/cli/main.mjs +586 -0
- package/dist/cli/main.mjs.map +1 -0
- package/dist/cli/prune-direct.mjs +216 -0
- package/dist/cli/prune-direct.mjs.map +1 -0
- package/dist/cli/snapshot-reader.mjs +73 -0
- package/dist/cli/snapshot-reader.mjs.map +1 -0
- package/dist/cli/up-lifecycle.mjs +28 -0
- package/dist/cli/up-lifecycle.mjs.map +1 -0
- package/dist/contracts/capability-decl.d.mts +42 -0
- package/dist/contracts/chain-probe.d.mts +26 -0
- package/dist/contracts/chain-probe.mjs +8 -0
- package/dist/contracts/chain-probe.mjs.map +1 -0
- package/dist/contracts/codegenable.d.mts +43 -0
- package/dist/contracts/container-runtime.d.mts +245 -0
- package/dist/contracts/liveness-classifier.d.mts +19 -0
- package/dist/contracts/network-resolver.d.mts +15 -0
- package/dist/contracts/network-resolver.mjs +7 -0
- package/dist/contracts/network-resolver.mjs.map +1 -0
- package/dist/contracts/projection.d.mts +15 -0
- package/dist/contracts/routable.d.mts +53 -0
- package/dist/contracts/snapshotable.d.mts +39 -0
- package/dist/contracts/strategy-contributor.d.mts +26 -0
- package/dist/index.d.mts +89 -0
- package/dist/index.mjs +37 -0
- package/dist/orchestrators/codegen/bindings.d.mts +2 -0
- package/dist/orchestrators/codegen/bindings.mjs +340 -0
- package/dist/orchestrators/codegen/bindings.mjs.map +1 -0
- package/dist/orchestrators/codegen/emit.mjs +56 -0
- package/dist/orchestrators/codegen/emit.mjs.map +1 -0
- package/dist/orchestrators/codegen/errors.d.mts +1 -0
- package/dist/orchestrators/codegen/errors.mjs +66 -0
- package/dist/orchestrators/codegen/errors.mjs.map +1 -0
- package/dist/orchestrators/codegen/extras.mjs +16 -0
- package/dist/orchestrators/codegen/extras.mjs.map +1 -0
- package/dist/orchestrators/codegen/format.mjs +109 -0
- package/dist/orchestrators/codegen/format.mjs.map +1 -0
- package/dist/orchestrators/codegen/gitignore.mjs +67 -0
- package/dist/orchestrators/codegen/gitignore.mjs.map +1 -0
- package/dist/orchestrators/codegen/paths.d.mts +1 -0
- package/dist/orchestrators/codegen/paths.mjs +33 -0
- package/dist/orchestrators/codegen/paths.mjs.map +1 -0
- package/dist/orchestrators/codegen/permissions.mjs +6 -0
- package/dist/orchestrators/codegen/permissions.mjs.map +1 -0
- package/dist/orchestrators/codegen/service.d.mts +1 -0
- package/dist/orchestrators/codegen/service.mjs +276 -0
- package/dist/orchestrators/codegen/service.mjs.map +1 -0
- package/dist/orchestrators/router/cleanup.mjs +58 -0
- package/dist/orchestrators/router/cleanup.mjs.map +1 -0
- package/dist/orchestrators/router/cors.mjs +31 -0
- package/dist/orchestrators/router/cors.mjs.map +1 -0
- package/dist/orchestrators/router/entrypoints.d.mts +1 -0
- package/dist/orchestrators/router/entrypoints.mjs +80 -0
- package/dist/orchestrators/router/entrypoints.mjs.map +1 -0
- package/dist/orchestrators/router/errors.d.mts +1 -0
- package/dist/orchestrators/router/errors.mjs +103 -0
- package/dist/orchestrators/router/errors.mjs.map +1 -0
- package/dist/orchestrators/router/file-provider.d.mts +1 -0
- package/dist/orchestrators/router/file-provider.mjs +320 -0
- package/dist/orchestrators/router/file-provider.mjs.map +1 -0
- package/dist/orchestrators/router/hostname.d.mts +1 -0
- package/dist/orchestrators/router/hostname.mjs +107 -0
- package/dist/orchestrators/router/hostname.mjs.map +1 -0
- package/dist/orchestrators/router/index.d.mts +1 -0
- package/dist/orchestrators/router/profile.d.mts +1 -0
- package/dist/orchestrators/router/profile.mjs +109 -0
- package/dist/orchestrators/router/profile.mjs.map +1 -0
- package/dist/orchestrators/router/service.d.mts +3 -0
- package/dist/orchestrators/router/service.mjs +421 -0
- package/dist/orchestrators/router/service.mjs.map +1 -0
- package/dist/orchestrators/router/traefik-container.d.mts +1 -0
- package/dist/orchestrators/router/traefik-container.mjs +229 -0
- package/dist/orchestrators/router/traefik-container.mjs.map +1 -0
- package/dist/orchestrators/runtime-composition.d.mts +10 -0
- package/dist/orchestrators/runtime-composition.mjs +168 -0
- package/dist/orchestrators/runtime-composition.mjs.map +1 -0
- package/dist/orchestrators/snapshot/capture.d.mts +1 -0
- package/dist/orchestrators/snapshot/capture.mjs +350 -0
- package/dist/orchestrators/snapshot/capture.mjs.map +1 -0
- package/dist/orchestrators/snapshot/descriptor.d.mts +1 -0
- package/dist/orchestrators/snapshot/descriptor.mjs +109 -0
- package/dist/orchestrators/snapshot/descriptor.mjs.map +1 -0
- package/dist/orchestrators/snapshot/identity-guard.d.mts +1 -0
- package/dist/orchestrators/snapshot/identity-guard.mjs +132 -0
- package/dist/orchestrators/snapshot/identity-guard.mjs.map +1 -0
- package/dist/orchestrators/snapshot/image-bundle-tags.mjs +207 -0
- package/dist/orchestrators/snapshot/image-bundle-tags.mjs.map +1 -0
- package/dist/orchestrators/snapshot/index.d.mts +1 -0
- package/dist/orchestrators/snapshot/integrity.d.mts +1 -0
- package/dist/orchestrators/snapshot/integrity.mjs +74 -0
- package/dist/orchestrators/snapshot/integrity.mjs.map +1 -0
- package/dist/orchestrators/snapshot/prune.d.mts +1 -0
- package/dist/orchestrators/snapshot/prune.mjs +110 -0
- package/dist/orchestrators/snapshot/prune.mjs.map +1 -0
- package/dist/orchestrators/snapshot/restore.d.mts +1 -0
- package/dist/orchestrators/snapshot/restore.mjs +404 -0
- package/dist/orchestrators/snapshot/restore.mjs.map +1 -0
- package/dist/orchestrators/snapshot/service.d.mts +1 -0
- package/dist/orchestrators/snapshot/service.mjs +296 -0
- package/dist/orchestrators/snapshot/service.mjs.map +1 -0
- package/dist/orchestrators/snapshot/state-document.mjs +18 -0
- package/dist/orchestrators/snapshot/state-document.mjs.map +1 -0
- package/dist/orchestrators/snapshot/wipe.d.mts +1 -0
- package/dist/orchestrators/snapshot/wipe.mjs +59 -0
- package/dist/orchestrators/snapshot/wipe.mjs.map +1 -0
- package/dist/plugins/account/codegen.d.mts +12 -0
- package/dist/plugins/account/codegen.mjs +22 -0
- package/dist/plugins/account/codegen.mjs.map +1 -0
- package/dist/plugins/account/errors.d.mts +44 -0
- package/dist/plugins/account/errors.mjs +16 -0
- package/dist/plugins/account/errors.mjs.map +1 -0
- package/dist/plugins/account/funding.d.mts +94 -0
- package/dist/plugins/account/funding.mjs +199 -0
- package/dist/plugins/account/funding.mjs.map +1 -0
- package/dist/plugins/account/index.d.mts +54 -0
- package/dist/plugins/account/index.mjs +151 -0
- package/dist/plugins/account/index.mjs.map +1 -0
- package/dist/plugins/account/keypair.d.mts +32 -0
- package/dist/plugins/account/keypair.mjs +99 -0
- package/dist/plugins/account/keypair.mjs.map +1 -0
- package/dist/plugins/account/lease.mjs +21 -0
- package/dist/plugins/account/lease.mjs.map +1 -0
- package/dist/plugins/account/registry.d.mts +33 -0
- package/dist/plugins/account/registry.mjs +36 -0
- package/dist/plugins/account/registry.mjs.map +1 -0
- package/dist/plugins/account/service.d.mts +104 -0
- package/dist/plugins/account/service.mjs +405 -0
- package/dist/plugins/account/service.mjs.map +1 -0
- package/dist/plugins/account/snapshot.mjs +33 -0
- package/dist/plugins/account/snapshot.mjs.map +1 -0
- package/dist/plugins/account/variants/env.mjs +24 -0
- package/dist/plugins/account/variants/env.mjs.map +1 -0
- package/dist/plugins/account/variants/ephemeral.mjs +72 -0
- package/dist/plugins/account/variants/ephemeral.mjs.map +1 -0
- package/dist/plugins/account/variants/impersonate.d.mts +16 -0
- package/dist/plugins/account/variants/impersonate.mjs +48 -0
- package/dist/plugins/account/variants/impersonate.mjs.map +1 -0
- package/dist/plugins/account/variants/inline.mjs +13 -0
- package/dist/plugins/account/variants/inline.mjs.map +1 -0
- package/dist/plugins/account/variants/keystore.mjs +93 -0
- package/dist/plugins/account/variants/keystore.mjs.map +1 -0
- package/dist/plugins/account/variants/signer.mjs +31 -0
- package/dist/plugins/account/variants/signer.mjs.map +1 -0
- package/dist/plugins/action/build-context.d.mts +41 -0
- package/dist/plugins/action/discriminator.d.mts +20 -0
- package/dist/plugins/action/discriminator.mjs +13 -0
- package/dist/plugins/action/discriminator.mjs.map +1 -0
- package/dist/plugins/action/errors.d.mts +31 -0
- package/dist/plugins/action/errors.mjs +13 -0
- package/dist/plugins/action/errors.mjs.map +1 -0
- package/dist/plugins/action/execute.d.mts +2 -0
- package/dist/plugins/action/execute.mjs +145 -0
- package/dist/plugins/action/execute.mjs.map +1 -0
- package/dist/plugins/action/index.d.mts +56 -0
- package/dist/plugins/action/index.mjs +82 -0
- package/dist/plugins/action/index.mjs.map +1 -0
- package/dist/plugins/action/service.d.mts +26 -0
- package/dist/plugins/action/service.mjs +84 -0
- package/dist/plugins/action/service.mjs.map +1 -0
- package/dist/plugins/coin/address-resolution.d.mts +34 -0
- package/dist/plugins/coin/address-resolution.mjs +80 -0
- package/dist/plugins/coin/address-resolution.mjs.map +1 -0
- package/dist/plugins/coin/codegen.d.mts +16 -0
- package/dist/plugins/coin/codegen.mjs +21 -0
- package/dist/plugins/coin/codegen.mjs.map +1 -0
- package/dist/plugins/coin/discovery.d.mts +26 -0
- package/dist/plugins/coin/discovery.mjs +112 -0
- package/dist/plugins/coin/discovery.mjs.map +1 -0
- package/dist/plugins/coin/errors.d.mts +48 -0
- package/dist/plugins/coin/errors.mjs +13 -0
- package/dist/plugins/coin/errors.mjs.map +1 -0
- package/dist/plugins/coin/index.d.mts +95 -0
- package/dist/plugins/coin/index.mjs +172 -0
- package/dist/plugins/coin/index.mjs.map +1 -0
- package/dist/plugins/coin/metadata.d.mts +15 -0
- package/dist/plugins/coin/metadata.mjs +99 -0
- package/dist/plugins/coin/metadata.mjs.map +1 -0
- package/dist/plugins/coin/mint.d.mts +34 -0
- package/dist/plugins/coin/mint.mjs +164 -0
- package/dist/plugins/coin/mint.mjs.map +1 -0
- package/dist/plugins/coin/registry.d.mts +1 -0
- package/dist/plugins/coin/registry.mjs +37 -0
- package/dist/plugins/coin/registry.mjs.map +1 -0
- package/dist/plugins/coin/service.d.mts +47 -0
- package/dist/plugins/coin/service.mjs +51 -0
- package/dist/plugins/coin/service.mjs.map +1 -0
- package/dist/plugins/coin/snapshot.mjs +19 -0
- package/dist/plugins/coin/snapshot.mjs.map +1 -0
- package/dist/plugins/coin/type-strings.mjs +49 -0
- package/dist/plugins/coin/type-strings.mjs.map +1 -0
- package/dist/plugins/deepbook/codegen.d.mts +39 -0
- package/dist/plugins/deepbook/codegen.mjs +15 -0
- package/dist/plugins/deepbook/codegen.mjs.map +1 -0
- package/dist/plugins/deepbook/deploy.mjs +437 -0
- package/dist/plugins/deepbook/deploy.mjs.map +1 -0
- package/dist/plugins/deepbook/errors.d.mts +29 -0
- package/dist/plugins/deepbook/errors.mjs +26 -0
- package/dist/plugins/deepbook/errors.mjs.map +1 -0
- package/dist/plugins/deepbook/faucet-strategy.d.mts +8 -0
- package/dist/plugins/deepbook/faucet-strategy.mjs +81 -0
- package/dist/plugins/deepbook/faucet-strategy.mjs.map +1 -0
- package/dist/plugins/deepbook/index.d.mts +171 -0
- package/dist/plugins/deepbook/index.mjs +359 -0
- package/dist/plugins/deepbook/index.mjs.map +1 -0
- package/dist/plugins/deepbook/plugin-key.mjs +7 -0
- package/dist/plugins/deepbook/plugin-key.mjs.map +1 -0
- package/dist/plugins/deepbook/pyth/index.mjs +226 -0
- package/dist/plugins/deepbook/pyth/index.mjs.map +1 -0
- package/dist/plugins/deepbook/routable.mjs +21 -0
- package/dist/plugins/deepbook/routable.mjs.map +1 -0
- package/dist/plugins/deepbook/snapshot.mjs +49 -0
- package/dist/plugins/deepbook/snapshot.mjs.map +1 -0
- package/dist/plugins/deepbook/types.d.mts +125 -0
- package/dist/plugins/deepbook/types.mjs +12 -0
- package/dist/plugins/deepbook/types.mjs.map +1 -0
- package/dist/plugins/faucet/dispatcher.d.mts +9 -0
- package/dist/plugins/faucet/dispatcher.mjs +13 -0
- package/dist/plugins/faucet/dispatcher.mjs.map +1 -0
- package/dist/plugins/faucet/errors.d.mts +86 -0
- package/dist/plugins/faucet/errors.mjs +19 -0
- package/dist/plugins/faucet/errors.mjs.map +1 -0
- package/dist/plugins/faucet/http.mjs +127 -0
- package/dist/plugins/faucet/http.mjs.map +1 -0
- package/dist/plugins/faucet/index.d.mts +43 -0
- package/dist/plugins/faucet/index.mjs +42 -0
- package/dist/plugins/faucet/index.mjs.map +1 -0
- package/dist/plugins/faucet/service.d.mts +20 -0
- package/dist/plugins/faucet/strategies/sui-local.d.mts +23 -0
- package/dist/plugins/faucet/strategies/sui-local.mjs +29 -0
- package/dist/plugins/faucet/strategies/sui-local.mjs.map +1 -0
- package/dist/plugins/host-service/errors.d.mts +27 -0
- package/dist/plugins/host-service/errors.mjs +14 -0
- package/dist/plugins/host-service/errors.mjs.map +1 -0
- package/dist/plugins/host-service/index.d.mts +10 -0
- package/dist/plugins/host-service/index.mjs +48 -0
- package/dist/plugins/host-service/index.mjs.map +1 -0
- package/dist/plugins/host-service/routable.mjs +24 -0
- package/dist/plugins/host-service/routable.mjs.map +1 -0
- package/dist/plugins/host-service/service.d.mts +49 -0
- package/dist/plugins/host-service/service.mjs +375 -0
- package/dist/plugins/host-service/service.mjs.map +1 -0
- package/dist/plugins/package/build.d.mts +1 -0
- package/dist/plugins/package/build.mjs +24 -0
- package/dist/plugins/package/build.mjs.map +1 -0
- package/dist/plugins/package/codegen.d.mts +19 -0
- package/dist/plugins/package/codegen.mjs +41 -0
- package/dist/plugins/package/codegen.mjs.map +1 -0
- package/dist/plugins/package/dep-resolution.mjs +10 -0
- package/dist/plugins/package/dep-resolution.mjs.map +1 -0
- package/dist/plugins/package/errors.d.mts +34 -0
- package/dist/plugins/package/errors.mjs +13 -0
- package/dist/plugins/package/errors.mjs.map +1 -0
- package/dist/plugins/package/index.d.mts +109 -0
- package/dist/plugins/package/index.mjs +207 -0
- package/dist/plugins/package/index.mjs.map +1 -0
- package/dist/plugins/package/mode-known.mjs +41 -0
- package/dist/plugins/package/mode-known.mjs.map +1 -0
- package/dist/plugins/package/mode-local.d.mts +1 -0
- package/dist/plugins/package/mode-local.mjs +183 -0
- package/dist/plugins/package/mode-local.mjs.map +1 -0
- package/dist/plugins/package/publish-executor.mjs +202 -0
- package/dist/plugins/package/publish-executor.mjs.map +1 -0
- package/dist/plugins/package/publish-output.d.mts +28 -0
- package/dist/plugins/package/publish-output.mjs +45 -0
- package/dist/plugins/package/publish-output.mjs.map +1 -0
- package/dist/plugins/package/registry.d.mts +25 -0
- package/dist/plugins/package/registry.mjs +30 -0
- package/dist/plugins/package/registry.mjs.map +1 -0
- package/dist/plugins/package/service.mjs +20 -0
- package/dist/plugins/package/service.mjs.map +1 -0
- package/dist/plugins/package/snapshot.mjs +25 -0
- package/dist/plugins/package/snapshot.mjs.map +1 -0
- package/dist/plugins/postgres/codegen.mjs +42 -0
- package/dist/plugins/postgres/codegen.mjs.map +1 -0
- package/dist/plugins/postgres/connection.d.mts +33 -0
- package/dist/plugins/postgres/connection.mjs +19 -0
- package/dist/plugins/postgres/connection.mjs.map +1 -0
- package/dist/plugins/postgres/db-ensure.mjs +100 -0
- package/dist/plugins/postgres/db-ensure.mjs.map +1 -0
- package/dist/plugins/postgres/errors.d.mts +55 -0
- package/dist/plugins/postgres/errors.mjs +29 -0
- package/dist/plugins/postgres/errors.mjs.map +1 -0
- package/dist/plugins/postgres/index.d.mts +37 -0
- package/dist/plugins/postgres/index.mjs +75 -0
- package/dist/plugins/postgres/index.mjs.map +1 -0
- package/dist/plugins/postgres/routable.mjs +33 -0
- package/dist/plugins/postgres/routable.mjs.map +1 -0
- package/dist/plugins/postgres/service.d.mts +50 -0
- package/dist/plugins/postgres/service.mjs +145 -0
- package/dist/plugins/postgres/service.mjs.map +1 -0
- package/dist/plugins/postgres/snapshot.d.mts +1 -0
- package/dist/plugins/postgres/snapshot.mjs +32 -0
- package/dist/plugins/postgres/snapshot.mjs.map +1 -0
- package/dist/plugins/router-entrypoints.mjs +21 -0
- package/dist/plugins/router-entrypoints.mjs.map +1 -0
- package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs +59 -0
- package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs.map +1 -0
- package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs +132 -0
- package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs.map +1 -0
- package/dist/plugins/seal/codegen.d.mts +19 -0
- package/dist/plugins/seal/codegen.mjs +16 -0
- package/dist/plugins/seal/codegen.mjs.map +1 -0
- package/dist/plugins/seal/config-render.mjs +82 -0
- package/dist/plugins/seal/config-render.mjs.map +1 -0
- package/dist/plugins/seal/deploy.mjs +198 -0
- package/dist/plugins/seal/deploy.mjs.map +1 -0
- package/dist/plugins/seal/errors.d.mts +52 -0
- package/dist/plugins/seal/errors.mjs +19 -0
- package/dist/plugins/seal/errors.mjs.map +1 -0
- package/dist/plugins/seal/index.d.mts +161 -0
- package/dist/plugins/seal/index.mjs +235 -0
- package/dist/plugins/seal/index.mjs.map +1 -0
- package/dist/plugins/seal/key-manager.d.mts +22 -0
- package/dist/plugins/seal/key-manager.mjs +22 -0
- package/dist/plugins/seal/key-manager.mjs.map +1 -0
- package/dist/plugins/seal/key-server.mjs +175 -0
- package/dist/plugins/seal/key-server.mjs.map +1 -0
- package/dist/plugins/seal/keygen.mjs +96 -0
- package/dist/plugins/seal/keygen.mjs.map +1 -0
- package/dist/plugins/seal/mode/fork-known.d.mts +8 -0
- package/dist/plugins/seal/mode/fork-known.mjs +23 -0
- package/dist/plugins/seal/mode/fork-known.mjs.map +1 -0
- package/dist/plugins/seal/mode/live.d.mts +18 -0
- package/dist/plugins/seal/mode/live.mjs +64 -0
- package/dist/plugins/seal/mode/live.mjs.map +1 -0
- package/dist/plugins/seal/mode/local-keygen.mjs +180 -0
- package/dist/plugins/seal/mode/local-keygen.mjs.map +1 -0
- package/dist/plugins/seal/plugin-key.mjs +7 -0
- package/dist/plugins/seal/plugin-key.mjs.map +1 -0
- package/dist/plugins/seal/registry-publish.d.mts +43 -0
- package/dist/plugins/seal/registry-publish.mjs +9 -0
- package/dist/plugins/seal/registry-publish.mjs.map +1 -0
- package/dist/plugins/seal/routable.mjs +57 -0
- package/dist/plugins/seal/routable.mjs.map +1 -0
- package/dist/plugins/seal/service.mjs +17 -0
- package/dist/plugins/seal/service.mjs.map +1 -0
- package/dist/plugins/seal/snapshot.mjs +51 -0
- package/dist/plugins/seal/snapshot.mjs.map +1 -0
- package/dist/plugins/sui/auto-tick.mjs +45 -0
- package/dist/plugins/sui/auto-tick.mjs.map +1 -0
- package/dist/plugins/sui/chain-build-container.d.mts +1 -0
- package/dist/plugins/sui/chain-probe.d.mts +85 -0
- package/dist/plugins/sui/chain-probe.mjs +104 -0
- package/dist/plugins/sui/chain-probe.mjs.map +1 -0
- package/dist/plugins/sui/codegen.d.mts +14 -0
- package/dist/plugins/sui/codegen.mjs +26 -0
- package/dist/plugins/sui/codegen.mjs.map +1 -0
- package/dist/plugins/sui/errors.d.mts +74 -0
- package/dist/plugins/sui/errors.mjs +28 -0
- package/dist/plugins/sui/errors.mjs.map +1 -0
- package/dist/plugins/sui/fork-orchestration.mjs +24 -0
- package/dist/plugins/sui/fork-orchestration.mjs.map +1 -0
- package/dist/plugins/sui/fork-transaction.mjs +96 -0
- package/dist/plugins/sui/fork-transaction.mjs.map +1 -0
- package/dist/plugins/sui/index.d.mts +318 -0
- package/dist/plugins/sui/index.mjs +182 -0
- package/dist/plugins/sui/index.mjs.map +1 -0
- package/dist/plugins/sui/mode/external.mjs +60 -0
- package/dist/plugins/sui/mode/external.mjs.map +1 -0
- package/dist/plugins/sui/mode/fork.mjs +283 -0
- package/dist/plugins/sui/mode/fork.mjs.map +1 -0
- package/dist/plugins/sui/mode/live.mjs +103 -0
- package/dist/plugins/sui/mode/live.mjs.map +1 -0
- package/dist/plugins/sui/mode/local.mjs +293 -0
- package/dist/plugins/sui/mode/local.mjs.map +1 -0
- package/dist/plugins/sui/mode/shared-boot.mjs +254 -0
- package/dist/plugins/sui/mode/shared-boot.mjs.map +1 -0
- package/dist/plugins/sui/mode/shared.d.mts +103 -0
- package/dist/plugins/sui/mode/shared.mjs +12 -0
- package/dist/plugins/sui/mode/shared.mjs.map +1 -0
- package/dist/plugins/sui/mode/spec.d.mts +94 -0
- package/dist/plugins/sui/network-resolver.d.mts +23 -0
- package/dist/plugins/sui/routable.mjs +88 -0
- package/dist/plugins/sui/routable.mjs.map +1 -0
- package/dist/plugins/sui/seed-objects.d.mts +18 -0
- package/dist/plugins/sui/seed-objects.mjs +25 -0
- package/dist/plugins/sui/seed-objects.mjs.map +1 -0
- package/dist/plugins/sui/service.mjs +38 -0
- package/dist/plugins/sui/service.mjs.map +1 -0
- package/dist/plugins/sui/snapshot.mjs +53 -0
- package/dist/plugins/sui/snapshot.mjs.map +1 -0
- package/dist/plugins/wallet/codegen.d.mts +33 -0
- package/dist/plugins/wallet/codegen.mjs +34 -0
- package/dist/plugins/wallet/codegen.mjs.map +1 -0
- package/dist/plugins/wallet/errors.d.mts +66 -0
- package/dist/plugins/wallet/errors.mjs +16 -0
- package/dist/plugins/wallet/errors.mjs.map +1 -0
- package/dist/plugins/wallet/index.d.mts +63 -0
- package/dist/plugins/wallet/index.mjs +126 -0
- package/dist/plugins/wallet/index.mjs.map +1 -0
- package/dist/plugins/wallet/origin-policy.d.mts +1 -0
- package/dist/plugins/wallet/origin-policy.mjs +65 -0
- package/dist/plugins/wallet/origin-policy.mjs.map +1 -0
- package/dist/plugins/wallet/pairing.d.mts +11 -0
- package/dist/plugins/wallet/pairing.mjs +125 -0
- package/dist/plugins/wallet/pairing.mjs.map +1 -0
- package/dist/plugins/wallet/protocol.d.mts +1 -0
- package/dist/plugins/wallet/protocol.mjs +96 -0
- package/dist/plugins/wallet/protocol.mjs.map +1 -0
- package/dist/plugins/wallet/routable.mjs +32 -0
- package/dist/plugins/wallet/routable.mjs.map +1 -0
- package/dist/plugins/wallet/server.d.mts +12 -0
- package/dist/plugins/wallet/server.mjs +317 -0
- package/dist/plugins/wallet/server.mjs.map +1 -0
- package/dist/plugins/wallet/service.d.mts +68 -0
- package/dist/plugins/wallet/service.mjs +97 -0
- package/dist/plugins/wallet/service.mjs.map +1 -0
- package/dist/plugins/wallet/snapshot.d.mts +1 -0
- package/dist/plugins/wallet/snapshot.mjs +14 -0
- package/dist/plugins/wallet/snapshot.mjs.map +1 -0
- package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs +42 -0
- package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs.map +1 -0
- package/dist/plugins/walrus/codegen.d.mts +38 -0
- package/dist/plugins/walrus/codegen.mjs +34 -0
- package/dist/plugins/walrus/codegen.mjs.map +1 -0
- package/dist/plugins/walrus/deploy-paths.mjs +14 -0
- package/dist/plugins/walrus/deploy-paths.mjs.map +1 -0
- package/dist/plugins/walrus/deploy.d.mts +1 -0
- package/dist/plugins/walrus/deploy.mjs +224 -0
- package/dist/plugins/walrus/deploy.mjs.map +1 -0
- package/dist/plugins/walrus/errors.d.mts +38 -0
- package/dist/plugins/walrus/errors.mjs +26 -0
- package/dist/plugins/walrus/errors.mjs.map +1 -0
- package/dist/plugins/walrus/faucet-strategy.d.mts +12 -0
- package/dist/plugins/walrus/faucet-strategy.mjs +62 -0
- package/dist/plugins/walrus/faucet-strategy.mjs.map +1 -0
- package/dist/plugins/walrus/index.d.mts +177 -0
- package/dist/plugins/walrus/index.mjs +284 -0
- package/dist/plugins/walrus/index.mjs.map +1 -0
- package/dist/plugins/walrus/mode/known-deploy.d.mts +25 -0
- package/dist/plugins/walrus/mode/known-deploy.mjs +71 -0
- package/dist/plugins/walrus/mode/known-deploy.mjs.map +1 -0
- package/dist/plugins/walrus/mode/local-cluster.d.mts +34 -0
- package/dist/plugins/walrus/mode/local-cluster.mjs +153 -0
- package/dist/plugins/walrus/mode/local-cluster.mjs.map +1 -0
- package/dist/plugins/walrus/plugin-key.mjs +7 -0
- package/dist/plugins/walrus/plugin-key.mjs.map +1 -0
- package/dist/plugins/walrus/registry-publish.d.mts +24 -0
- package/dist/plugins/walrus/registry-publish.mjs +7 -0
- package/dist/plugins/walrus/registry-publish.mjs.map +1 -0
- package/dist/plugins/walrus/routable.mjs +99 -0
- package/dist/plugins/walrus/routable.mjs.map +1 -0
- package/dist/plugins/walrus/service.mjs +20 -0
- package/dist/plugins/walrus/service.mjs.map +1 -0
- package/dist/plugins/walrus/snapshot.mjs +53 -0
- package/dist/plugins/walrus/snapshot.mjs.map +1 -0
- package/dist/plugins/walrus/storage-nodes.d.mts +15 -0
- package/dist/plugins/walrus/storage-nodes.mjs +154 -0
- package/dist/plugins/walrus/storage-nodes.mjs.map +1 -0
- package/dist/plugins/walrus/wal-swap.d.mts +2 -0
- package/dist/plugins/walrus/wal-swap.mjs +58 -0
- package/dist/plugins/walrus/wal-swap.mjs.map +1 -0
- package/dist/primitives/artifact-publisher.d.mts +12 -0
- package/dist/primitives/cache.d.mts +1 -0
- package/dist/runtime/built-in-plugin-layers.mjs +49 -0
- package/dist/runtime/built-in-plugin-layers.mjs.map +1 -0
- package/dist/runtime/docker/client.d.mts +2 -0
- package/dist/runtime/docker/client.mjs +54 -0
- package/dist/runtime/docker/client.mjs.map +1 -0
- package/dist/runtime/docker/container.d.mts +1 -0
- package/dist/runtime/docker/container.mjs +562 -0
- package/dist/runtime/docker/container.mjs.map +1 -0
- package/dist/runtime/docker/errors.d.mts +1 -0
- package/dist/runtime/docker/errors.mjs +187 -0
- package/dist/runtime/docker/errors.mjs.map +1 -0
- package/dist/runtime/docker/exec.d.mts +1 -0
- package/dist/runtime/docker/exec.mjs +63 -0
- package/dist/runtime/docker/exec.mjs.map +1 -0
- package/dist/runtime/docker/image.d.mts +1 -0
- package/dist/runtime/docker/image.mjs +278 -0
- package/dist/runtime/docker/image.mjs.map +1 -0
- package/dist/runtime/docker/index.d.mts +1 -0
- package/dist/runtime/docker/inventory.d.mts +1 -0
- package/dist/runtime/docker/inventory.mjs +167 -0
- package/dist/runtime/docker/inventory.mjs.map +1 -0
- package/dist/runtime/docker/labels.d.mts +1 -0
- package/dist/runtime/docker/labels.mjs +97 -0
- package/dist/runtime/docker/labels.mjs.map +1 -0
- package/dist/runtime/docker/logs.d.mts +1 -0
- package/dist/runtime/docker/logs.mjs +34 -0
- package/dist/runtime/docker/logs.mjs.map +1 -0
- package/dist/runtime/docker/network.d.mts +1 -0
- package/dist/runtime/docker/network.mjs +168 -0
- package/dist/runtime/docker/network.mjs.map +1 -0
- package/dist/runtime/docker/service.d.mts +9 -0
- package/dist/runtime/docker/service.mjs +266 -0
- package/dist/runtime/docker/service.mjs.map +1 -0
- package/dist/runtime/docker/sweep.d.mts +1 -0
- package/dist/runtime/docker/sweep.mjs +220 -0
- package/dist/runtime/docker/sweep.mjs.map +1 -0
- package/dist/runtime/docker/volume.d.mts +1 -0
- package/dist/runtime/docker/volume.mjs +24 -0
- package/dist/runtime/docker/volume.mjs.map +1 -0
- package/dist/runtime/docker/wrap.d.mts +1 -0
- package/dist/runtime/docker/wrap.mjs +131 -0
- package/dist/runtime/docker/wrap.mjs.map +1 -0
- package/dist/substrate/brand.d.mts +24 -0
- package/dist/substrate/brand.mjs +14 -0
- package/dist/substrate/brand.mjs.map +1 -0
- package/dist/substrate/cross-process.d.mts +1 -0
- package/dist/substrate/cross-process.mjs +28 -0
- package/dist/substrate/cross-process.mjs.map +1 -0
- package/dist/substrate/events.d.mts +117 -0
- package/dist/substrate/identity.d.mts +13 -0
- package/dist/substrate/lifecycle.d.mts +12 -0
- package/dist/substrate/manifest.d.mts +39 -0
- package/dist/substrate/manifest.mjs +33 -0
- package/dist/substrate/manifest.mjs.map +1 -0
- package/dist/substrate/network.d.mts +34 -0
- package/dist/substrate/options.d.mts +23 -0
- package/dist/substrate/plugin.d.mts +101 -0
- package/dist/substrate/plugin.mjs +61 -0
- package/dist/substrate/plugin.mjs.map +1 -0
- package/dist/substrate/projection.d.mts +100 -0
- package/dist/substrate/runtime/artifact-publisher/index.mjs +76 -0
- package/dist/substrate/runtime/artifact-publisher/index.mjs.map +1 -0
- package/dist/substrate/runtime/atomic-write.mjs +106 -0
- package/dist/substrate/runtime/atomic-write.mjs.map +1 -0
- package/dist/substrate/runtime/cache/index.d.mts +1 -0
- package/dist/substrate/runtime/cache/schema.d.mts +1 -0
- package/dist/substrate/runtime/cache/schema.mjs +22 -0
- package/dist/substrate/runtime/cache/schema.mjs.map +1 -0
- package/dist/substrate/runtime/cache/service.d.mts +1 -0
- package/dist/substrate/runtime/cache/service.mjs +89 -0
- package/dist/substrate/runtime/cache/service.mjs.map +1 -0
- package/dist/substrate/runtime/capability-sinks/index.d.mts +1 -0
- package/dist/substrate/runtime/capability-sinks/layer.d.mts +1 -0
- package/dist/substrate/runtime/capability-sinks/layer.mjs +31 -0
- package/dist/substrate/runtime/capability-sinks/layer.mjs.map +1 -0
- package/dist/substrate/runtime/capability-sinks/service.d.mts +36 -0
- package/dist/substrate/runtime/capability-sinks/service.mjs +74 -0
- package/dist/substrate/runtime/capability-sinks/service.mjs.map +1 -0
- package/dist/substrate/runtime/config-validation.d.mts +38 -0
- package/dist/substrate/runtime/config-validation.mjs +137 -0
- package/dist/substrate/runtime/config-validation.mjs.map +1 -0
- package/dist/substrate/runtime/context-helpers.mjs +32 -0
- package/dist/substrate/runtime/context-helpers.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/command-channel/channel.mjs +128 -0
- package/dist/substrate/runtime/cross-process/command-channel/channel.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/command-channel/file-channel.mjs +136 -0
- package/dist/substrate/runtime/cross-process/command-channel/file-channel.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/command-channel/protocol.mjs +49 -0
- package/dist/substrate/runtime/cross-process/command-channel/protocol.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/command-channel/runtime-control-lock.mjs +9 -0
- package/dist/substrate/runtime/cross-process/command-channel/runtime-control-lock.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/liveness.mjs +119 -0
- package/dist/substrate/runtime/cross-process/liveness.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/roster.mjs +275 -0
- package/dist/substrate/runtime/cross-process/roster.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/snapshot-reservation.d.mts +1 -0
- package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs +117 -0
- package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/stack-lock.d.mts +1 -0
- package/dist/substrate/runtime/cross-process/stack-lock.mjs +142 -0
- package/dist/substrate/runtime/cross-process/stack-lock.mjs.map +1 -0
- package/dist/substrate/runtime/current-plugin.mjs +15 -0
- package/dist/substrate/runtime/current-plugin.mjs.map +1 -0
- package/dist/substrate/runtime/errors.d.mts +1 -0
- package/dist/substrate/runtime/errors.mjs +76 -0
- package/dist/substrate/runtime/errors.mjs.map +1 -0
- package/dist/substrate/runtime/host-tree-tar/index.mjs +364 -0
- package/dist/substrate/runtime/host-tree-tar/index.mjs.map +1 -0
- package/dist/substrate/runtime/http-probe.d.mts +35 -0
- package/dist/substrate/runtime/http-probe.mjs +65 -0
- package/dist/substrate/runtime/http-probe.mjs.map +1 -0
- package/dist/substrate/runtime/lease-broker/index.d.mts +1 -0
- package/dist/substrate/runtime/lease-broker/service.d.mts +64 -0
- package/dist/substrate/runtime/lease-broker/service.mjs +155 -0
- package/dist/substrate/runtime/lease-broker/service.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/dep-graph.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/dep-graph.mjs +138 -0
- package/dist/substrate/runtime/lifecycle/dep-graph.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/index.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/lifecycle-fact.mjs +31 -0
- package/dist/substrate/runtime/lifecycle/lifecycle-fact.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/plugin-registry.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/plugin-registry.mjs +133 -0
- package/dist/substrate/runtime/lifecycle/plugin-registry.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/ready-gate.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/ready-gate.mjs +34 -0
- package/dist/substrate/runtime/lifecycle/ready-gate.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/selective-restart.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/selective-restart.mjs +43 -0
- package/dist/substrate/runtime/lifecycle/selective-restart.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/signals.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/signals.mjs +64 -0
- package/dist/substrate/runtime/lifecycle/signals.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/state-machine.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/state-machine.mjs +38 -0
- package/dist/substrate/runtime/lifecycle/state-machine.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/watch-attribution.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/watch-attribution.mjs +27 -0
- package/dist/substrate/runtime/lifecycle/watch-attribution.mjs.map +1 -0
- package/dist/substrate/runtime/managed-container.d.mts +30 -0
- package/dist/substrate/runtime/managed-container.mjs +32 -0
- package/dist/substrate/runtime/managed-container.mjs.map +1 -0
- package/dist/substrate/runtime/manifest/manifest.mjs +73 -0
- package/dist/substrate/runtime/manifest/manifest.mjs.map +1 -0
- package/dist/substrate/runtime/mode-errors.d.mts +36 -0
- package/dist/substrate/runtime/observability/cascade-formatter.d.mts +1 -0
- package/dist/substrate/runtime/observability/cascade-formatter.mjs +135 -0
- package/dist/substrate/runtime/observability/cascade-formatter.mjs.map +1 -0
- package/dist/substrate/runtime/observability/formatter-registry.d.mts +1 -0
- package/dist/substrate/runtime/observability/formatter-registry.mjs +65 -0
- package/dist/substrate/runtime/observability/formatter-registry.mjs.map +1 -0
- package/dist/substrate/runtime/observability/index.d.mts +3 -0
- package/dist/substrate/runtime/observability/logger.d.mts +58 -0
- package/dist/substrate/runtime/observability/logger.mjs +89 -0
- package/dist/substrate/runtime/observability/logger.mjs.map +1 -0
- package/dist/substrate/runtime/observability/pretty-error.d.mts +1 -0
- package/dist/substrate/runtime/observability/pretty-error.mjs +119 -0
- package/dist/substrate/runtime/observability/pretty-error.mjs.map +1 -0
- package/dist/substrate/runtime/observability/process-lines.d.mts +31 -0
- package/dist/substrate/runtime/observability/process-lines.mjs +40 -0
- package/dist/substrate/runtime/observability/process-lines.mjs.map +1 -0
- package/dist/substrate/runtime/observability/redaction.d.mts +28 -0
- package/dist/substrate/runtime/observability/redaction.mjs +45 -0
- package/dist/substrate/runtime/observability/redaction.mjs.map +1 -0
- package/dist/substrate/runtime/observability/spans.d.mts +1 -0
- package/dist/substrate/runtime/observability/spans.mjs +87 -0
- package/dist/substrate/runtime/observability/spans.mjs.map +1 -0
- package/dist/substrate/runtime/observability/subprocess-capture.d.mts +2 -0
- package/dist/substrate/runtime/observability/subprocess-capture.mjs +82 -0
- package/dist/substrate/runtime/observability/subprocess-capture.mjs.map +1 -0
- package/dist/substrate/runtime/paths.d.mts +17 -0
- package/dist/substrate/runtime/paths.mjs +61 -0
- package/dist/substrate/runtime/paths.mjs.map +1 -0
- package/dist/substrate/runtime/port-broker/index.d.mts +1 -0
- package/dist/substrate/runtime/port-broker/service.d.mts +1 -0
- package/dist/substrate/runtime/port-broker/service.mjs +319 -0
- package/dist/substrate/runtime/port-broker/service.mjs.map +1 -0
- package/dist/substrate/runtime/post-acquire-tasks.d.mts +1 -0
- package/dist/substrate/runtime/post-acquire-tasks.mjs +34 -0
- package/dist/substrate/runtime/post-acquire-tasks.mjs.map +1 -0
- package/dist/substrate/runtime/probes.d.mts +51 -0
- package/dist/substrate/runtime/probes.mjs +84 -0
- package/dist/substrate/runtime/probes.mjs.map +1 -0
- package/dist/substrate/runtime/process-supervisor.d.mts +57 -0
- package/dist/substrate/runtime/process-supervisor.mjs +73 -0
- package/dist/substrate/runtime/process-supervisor.mjs.map +1 -0
- package/dist/substrate/runtime/projection/operational-endpoints.mjs +44 -0
- package/dist/substrate/runtime/projection/operational-endpoints.mjs.map +1 -0
- package/dist/substrate/runtime/projection/persisted.mjs +195 -0
- package/dist/substrate/runtime/projection/persisted.mjs.map +1 -0
- package/dist/substrate/runtime/projection/state-ref.mjs +48 -0
- package/dist/substrate/runtime/projection/state-ref.mjs.map +1 -0
- package/dist/substrate/runtime/projection/update.mjs +200 -0
- package/dist/substrate/runtime/projection/update.mjs.map +1 -0
- package/dist/substrate/runtime/retry-policy.d.mts +18 -0
- package/dist/substrate/runtime/retry-policy.mjs +16 -0
- package/dist/substrate/runtime/retry-policy.mjs.map +1 -0
- package/dist/substrate/runtime/run.mjs +86 -0
- package/dist/substrate/runtime/run.mjs.map +1 -0
- package/dist/substrate/runtime/runtime-decode.d.mts +32 -0
- package/dist/substrate/runtime/runtime-decode.mjs +53 -0
- package/dist/substrate/runtime/runtime-decode.mjs.map +1 -0
- package/dist/substrate/runtime/scoped-http-server.mjs +36 -0
- package/dist/substrate/runtime/scoped-http-server.mjs.map +1 -0
- package/dist/substrate/runtime/scoped-ref-map/service.mjs +83 -0
- package/dist/substrate/runtime/scoped-ref-map/service.mjs.map +1 -0
- package/dist/substrate/runtime/stage-and-swap/index.d.mts +1 -0
- package/dist/substrate/runtime/stage-and-swap/index.mjs +131 -0
- package/dist/substrate/runtime/stage-and-swap/index.mjs.map +1 -0
- package/dist/substrate/runtime/state-store/schema.mjs +36 -0
- package/dist/substrate/runtime/state-store/schema.mjs.map +1 -0
- package/dist/substrate/runtime/strategy-registry/chain-probe-for.d.mts +1 -0
- package/dist/substrate/runtime/strategy-registry/chain-probe-for.mjs +22 -0
- package/dist/substrate/runtime/strategy-registry/chain-probe-for.mjs.map +1 -0
- package/dist/substrate/runtime/strategy-registry/faucet-capability-for.d.mts +1 -0
- package/dist/substrate/runtime/strategy-registry/faucet-capability-for.mjs +30 -0
- package/dist/substrate/runtime/strategy-registry/faucet-capability-for.mjs.map +1 -0
- package/dist/substrate/runtime/strategy-registry/index.d.mts +1 -0
- package/dist/substrate/runtime/strategy-registry/service.d.mts +1 -0
- package/dist/substrate/runtime/strategy-registry/service.mjs +67 -0
- package/dist/substrate/runtime/strategy-registry/service.mjs.map +1 -0
- package/dist/substrate/runtime/sui-execute/index.d.mts +11 -0
- package/dist/substrate/runtime/sui-execute/index.mjs +144 -0
- package/dist/substrate/runtime/sui-execute/index.mjs.map +1 -0
- package/dist/substrate/runtime/sui-move-build/index.d.mts +1 -0
- package/dist/substrate/runtime/sui-move-build/index.mjs +283 -0
- package/dist/substrate/runtime/sui-move-build/index.mjs.map +1 -0
- package/dist/substrate/runtime/supervisor.d.mts +1 -0
- package/dist/substrate/runtime/supervisor.mjs +831 -0
- package/dist/substrate/runtime/supervisor.mjs.map +1 -0
- package/dist/surfaces/cli/command-tree.mjs +276 -0
- package/dist/surfaces/cli/command-tree.mjs.map +1 -0
- package/dist/surfaces/cli/commands/config.mjs +31 -0
- package/dist/surfaces/cli/commands/config.mjs.map +1 -0
- package/dist/surfaces/cli/commands/confirm-node.mjs +26 -0
- package/dist/surfaces/cli/commands/confirm-node.mjs.map +1 -0
- package/dist/surfaces/cli/commands/confirm.mjs +26 -0
- package/dist/surfaces/cli/commands/confirm.mjs.map +1 -0
- package/dist/surfaces/cli/commands/doctor-probes.mjs +452 -0
- package/dist/surfaces/cli/commands/doctor-probes.mjs.map +1 -0
- package/dist/surfaces/cli/commands/doctor.mjs +38 -0
- package/dist/surfaces/cli/commands/doctor.mjs.map +1 -0
- package/dist/surfaces/cli/commands/prune-picker.mjs +347 -0
- package/dist/surfaces/cli/commands/prune-picker.mjs.map +1 -0
- package/dist/surfaces/cli/commands/prune.mjs +178 -0
- package/dist/surfaces/cli/commands/prune.mjs.map +1 -0
- package/dist/surfaces/cli/commands/snapshot.mjs +141 -0
- package/dist/surfaces/cli/commands/snapshot.mjs.map +1 -0
- package/dist/surfaces/cli/commands/status.mjs +95 -0
- package/dist/surfaces/cli/commands/status.mjs.map +1 -0
- package/dist/surfaces/cli/commands/supervisor-presence.mjs +33 -0
- package/dist/surfaces/cli/commands/supervisor-presence.mjs.map +1 -0
- package/dist/surfaces/cli/commands/wipe.mjs +28 -0
- package/dist/surfaces/cli/commands/wipe.mjs.map +1 -0
- package/dist/surfaces/cli/envelope.mjs +43 -0
- package/dist/surfaces/cli/envelope.mjs.map +1 -0
- package/dist/surfaces/cli/errors.mjs +110 -0
- package/dist/surfaces/cli/errors.mjs.map +1 -0
- package/dist/surfaces/cli/flags.mjs +56 -0
- package/dist/surfaces/cli/flags.mjs.map +1 -0
- package/dist/surfaces/cli/index.mjs +418 -0
- package/dist/surfaces/cli/index.mjs.map +1 -0
- package/dist/surfaces/cli/output.mjs +115 -0
- package/dist/surfaces/cli/output.mjs.map +1 -0
- package/dist/surfaces/cli/sysexits.mjs +139 -0
- package/dist/surfaces/cli/sysexits.mjs.map +1 -0
- package/dist/surfaces/tui/app.mjs +104 -0
- package/dist/surfaces/tui/app.mjs.map +1 -0
- package/dist/surfaces/tui/dashboard.mjs +261 -0
- package/dist/surfaces/tui/dashboard.mjs.map +1 -0
- package/dist/surfaces/tui/display-derivation.mjs +395 -0
- package/dist/surfaces/tui/display-derivation.mjs.map +1 -0
- package/dist/surfaces/tui/errors.mjs +11 -0
- package/dist/surfaces/tui/errors.mjs.map +1 -0
- package/dist/surfaces/tui/event-log.mjs +155 -0
- package/dist/surfaces/tui/event-log.mjs.map +1 -0
- package/dist/surfaces/tui/heartbeat.mjs +33 -0
- package/dist/surfaces/tui/heartbeat.mjs.map +1 -0
- package/dist/surfaces/tui/index.mjs +50 -0
- package/dist/surfaces/tui/index.mjs.map +1 -0
- package/dist/surfaces/tui/input.mjs +104 -0
- package/dist/surfaces/tui/input.mjs.map +1 -0
- package/dist/surfaces/tui/mode-detect.mjs +32 -0
- package/dist/surfaces/tui/mode-detect.mjs.map +1 -0
- package/dist/surfaces/tui/mount-ink.mjs +31 -0
- package/dist/surfaces/tui/mount-ink.mjs.map +1 -0
- package/dist/surfaces/tui/plain-renderer.mjs +170 -0
- package/dist/surfaces/tui/plain-renderer.mjs.map +1 -0
- package/dist/surfaces/tui/resource-table.mjs +507 -0
- package/dist/surfaces/tui/resource-table.mjs.map +1 -0
- package/images/_shared/signal-forward.sh +77 -0
- package/images/postgres/Dockerfile +32 -0
- package/images/seal/Dockerfile +68 -0
- package/images/seal/entrypoint.sh +65 -0
- package/images/sui/Dockerfile +73 -0
- package/images/sui/entrypoint.sh +244 -0
- package/images/sui-fork/Dockerfile +53 -0
- package/images/sui-fork/entrypoint.sh +51 -0
- package/images/walrus/Dockerfile +122 -0
- package/images/walrus/deploy-walrus.sh +305 -0
- package/images/walrus/run-walrus.sh +53 -0
- package/package.json +94 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stack-context.mjs","names":["readStackContextRuntime"],"sources":["../../../src/build-integrations/vitest/stack-context.ts"],"sourcesContent":["// Stack-context loader for the vitest integration — thin wrapper\n// over `runtime/readStackContext`.\n//\n// The vitest preset is a passive reader of the supervisor's manifest.\n// Discovery, decode, and version-gate live in `runtime/`; this module\n// only:\n// - resolves the vitest-flavored env contract (`DEVSTACK_RUNTIME_ROOT`\n// plus legacy `DEVSTACK_STATE_DIR` alias),\n// - exposes the manifest plus `endpoint(name)` / `displayEndpoint(name)`\n// convenience accessors test bodies use,\n// - re-shapes the canonical error tags into the vitest-flavored union\n// (`VitestManifestNotFoundError` / `VitestManifestShapeError`) so\n// caller `catchTag` flows stay stable.\n\nimport {\n\tmanifestEnvelopeFromStackContext,\n\tManifestDiscoveryError,\n\tManifestShapeError,\n\treadStackContext as readStackContextRuntime,\n\ttype StackContext as RuntimeStackContext,\n} from '../runtime/index.ts';\nimport type { ManifestEnvelope } from '../../substrate/manifest.ts';\nimport { VITEST_ENV_VARS } from './env.ts';\nimport { VitestManifestNotFoundError, VitestManifestShapeError } from './errors.ts';\n\n/** Read-only projection over the live manifest, scoped to the vitest\n * surface's needs. The full envelope is reconstructed (`manifest`)\n * for the test-side helpers that compare deep shapes; the convenience\n * accessors cover the common case. */\nexport interface StackContext {\n\t/** Absolute path of the manifest file the projection came from. */\n\treadonly manifestPath: string;\n\t/** Reconstructed envelope — same shape downstream consumers had\n\t * pre-consolidation. */\n\treadonly manifest: ManifestEnvelope;\n\t/** Identity tuple shortcut. */\n\treadonly identity: ManifestEnvelope['identity'];\n\t/** Flat endpoint lookup — returns the URL string or `undefined`. */\n\treadonly endpoint: (name: string) => string | undefined;\n\t/** Display URL variant — falls back to `url` when `displayUrl` is\n\t * null (the routed-vs-direct distinction the router decides). */\n\treadonly displayEndpoint: (name: string) => string | undefined;\n}\n\nexport interface LoadStackContextOptions {\n\t/** Starting directory for the walk-up. Defaults to `process.cwd()`. */\n\treadonly cwd?: string;\n\t/** Stack name override. Defaults to `process.env.DEVSTACK_STACK`\n\t * with a final fallback to `'main'`. */\n\treadonly stack?: string;\n\t/** Runtime root override (legacy `.devstack` directory). Defaults\n\t * to `process.env.DEVSTACK_RUNTIME_ROOT` /\n\t * `process.env.DEVSTACK_STATE_DIR` with a final fallback to\n\t * `'.devstack'`. */\n\treadonly runtimeRoot?: string;\n\t/** Explicit absolute manifest path. Bypasses the walk-up but is\n\t * still validated to exist. Lower precedence than the\n\t * `DEVSTACK_MANIFEST_PATH` env var. */\n\treadonly manifestPath?: string;\n\t/** Env bag for the resolver. Defaults to `process.env`. Tests pass\n\t * a fixture. */\n\treadonly env?: Readonly<Record<string, string | undefined>>;\n\t/** When `true`, throw `VitestManifestNotFoundError` on miss instead\n\t * of returning `undefined`. */\n\treadonly required?: boolean;\n}\n\nconst project = (ctx: RuntimeStackContext): StackContext => {\n\tconst envelope: ManifestEnvelope = manifestEnvelopeFromStackContext(ctx);\n\treturn {\n\t\tmanifestPath: ctx.manifestPath,\n\t\tmanifest: envelope,\n\t\tidentity: envelope.identity,\n\t\tendpoint: (name) => ctx.endpoints.byName(name)?.url,\n\t\tdisplayEndpoint: (name) => {\n\t\t\tconst e = ctx.endpoints.byName(name);\n\t\t\tif (e === undefined) return undefined;\n\t\t\treturn e.displayUrl ?? e.url;\n\t\t},\n\t};\n};\n\n/**\n * Read the on-disk manifest, decode against the envelope schema, and\n * return a projection. Returns `undefined` on miss; pass\n * `{ required: true }` to throw `VitestManifestNotFoundError`.\n *\n * Precedence ladder (highest → lowest):\n * 1. `env.DEVSTACK_MANIFEST_PATH`\n * 2. `opts.manifestPath`\n * 3. walk-up from `opts.cwd` looking for\n * `<runtimeRoot>/stacks/<stack>/manifest.json`\n */\nexport const loadStackContext = (opts: LoadStackContextOptions = {}): StackContext | undefined => {\n\tconst env = opts.env ?? (process.env as Readonly<Record<string, string | undefined>>);\n\tconst stack = opts.stack ?? env[VITEST_ENV_VARS.STACK] ?? 'main';\n\tconst runtimeRoot =\n\t\topts.runtimeRoot ??\n\t\tenv[VITEST_ENV_VARS.RUNTIME_ROOT] ??\n\t\tenv[VITEST_ENV_VARS.RUNTIME_ROOT_LEGACY] ??\n\t\t'.devstack';\n\n\ttry {\n\t\tconst ctx = readStackContextRuntime({\n\t\t\t...(opts.cwd !== undefined ? { cwd: opts.cwd } : {}),\n\t\t\tstack,\n\t\t\tstateDir: runtimeRoot,\n\t\t\tenv,\n\t\t\t...(opts.manifestPath !== undefined ? { manifestPath: opts.manifestPath } : {}),\n\t\t});\n\t\treturn project(ctx);\n\t} catch (err) {\n\t\tif (err instanceof ManifestDiscoveryError) {\n\t\t\tif (opts.required === true) {\n\t\t\t\tthrow new VitestManifestNotFoundError({\n\t\t\t\t\tmessage: `no devstack manifest found for stack '${stack}' under '${runtimeRoot}'`,\n\t\t\t\t\tsearchedFrom: opts.cwd ?? process.cwd(),\n\t\t\t\t\tstack,\n\t\t\t\t\tstateDir: runtimeRoot,\n\t\t\t\t\trecovery: `run \\`devstack up\\` (or set DEVSTACK_MANIFEST_PATH to an existing file)`,\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn undefined;\n\t\t}\n\t\tif (err instanceof ManifestShapeError) {\n\t\t\t// The runtime tags both decode-failure and version-mismatch as\n\t\t\t// `phase: 'parse' | 'shape' | 'version'`. The vitest error\n\t\t\t// union exposes `parse` and `shape`; map `version` onto\n\t\t\t// `shape` with a recovery hint that names the version-bump\n\t\t\t// recipe.\n\t\t\tconst phase: 'parse' | 'shape' = err.phase === 'parse' ? 'parse' : 'shape';\n\t\t\tthrow new VitestManifestShapeError({\n\t\t\t\tphase,\n\t\t\t\tpath: err.path,\n\t\t\t\tmessage: err.message,\n\t\t\t\trecovery:\n\t\t\t\t\terr.phase === 'parse'\n\t\t\t\t\t\t? `rm ${err.path} && devstack apply # regenerate from the registries`\n\t\t\t\t\t\t: `rm -rf <runtimeRoot>/stacks/<stack>/manifest.json && devstack apply # regenerate`,\n\t\t\t\tcause: err,\n\t\t\t});\n\t\t}\n\t\tthrow err;\n\t}\n};\n"],"mappings":";;;;;AAmEA,MAAM,WAAW,QAA2C;CAC3D,MAAM,WAA6B,iCAAiC,IAAI;AACxE,QAAO;EACN,cAAc,IAAI;EAClB,UAAU;EACV,UAAU,SAAS;EACnB,WAAW,SAAS,IAAI,UAAU,OAAO,KAAK,EAAE;EAChD,kBAAkB,SAAS;GAC1B,MAAM,IAAI,IAAI,UAAU,OAAO,KAAK;AACpC,OAAI,MAAM,KAAA,EAAW,QAAO,KAAA;AAC5B,UAAO,EAAE,cAAc,EAAE;;EAE1B;;;;;;;;;;;;;AAcF,MAAa,oBAAoB,OAAgC,EAAE,KAA+B;CACjG,MAAM,MAAM,KAAK,OAAQ,QAAQ;CACjC,MAAM,QAAQ,KAAK,SAAS,IAAI,gBAAgB,UAAU;CAC1D,MAAM,cACL,KAAK,eACL,IAAI,gBAAgB,iBACpB,IAAI,gBAAgB,wBACpB;AAED,KAAI;AAQH,SAAO,QAPKA,iBAAwB;GACnC,GAAI,KAAK,QAAQ,KAAA,IAAY,EAAE,KAAK,KAAK,KAAK,GAAG,EAAE;GACnD;GACA,UAAU;GACV;GACA,GAAI,KAAK,iBAAiB,KAAA,IAAY,EAAE,cAAc,KAAK,cAAc,GAAG,EAAE;GAC9E,CACiB,CAAC;UACX,KAAK;AACb,MAAI,eAAe,wBAAwB;AAC1C,OAAI,KAAK,aAAa,KACrB,OAAM,IAAI,4BAA4B;IACrC,SAAS,yCAAyC,MAAM,WAAW,YAAY;IAC/E,cAAc,KAAK,OAAO,QAAQ,KAAK;IACvC;IACA,UAAU;IACV,UAAU;IACV,CAAC;AAEH;;AAED,MAAI,eAAe,mBAOlB,OAAM,IAAI,yBAAyB;GAClC,OAFgC,IAAI,UAAU,UAAU,UAAU;GAGlE,MAAM,IAAI;GACV,SAAS,IAAI;GACb,UACC,IAAI,UAAU,UACX,MAAM,IAAI,KAAK,wDACf;GACJ,OAAO;GACP,CAAC;AAEH,QAAM"}
|
|
@@ -0,0 +1,586 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { StackPathsService } from "../substrate/runtime/paths.mjs";
|
|
3
|
+
import { appName, chainId, stackName } from "../substrate/brand.mjs";
|
|
4
|
+
import { claim, heartbeatFiber, release } from "../substrate/runtime/cross-process/roster.mjs";
|
|
5
|
+
import { readStackEngine } from "../api/define-devstack.mjs";
|
|
6
|
+
import { makeProjectionRef } from "../substrate/runtime/projection/state-ref.mjs";
|
|
7
|
+
import { persistProjectionChanges, readProjectionSnapshot, writeProjectionSnapshot } from "../substrate/runtime/projection/persisted.mjs";
|
|
8
|
+
import { buildSubstrateLayers, superviseStackEffect } from "../substrate/runtime/run.mjs";
|
|
9
|
+
import { commandChannelPaths, makeCommandChannelPublisher, makeCommandChannelSubscriber } from "../substrate/runtime/cross-process/command-channel/channel.mjs";
|
|
10
|
+
import { SnapshotOrchestratorService } from "../orchestrators/snapshot/service.mjs";
|
|
11
|
+
import { buildProductionOrchestratorSinks, buildProductionPostAcquireHook, layerProductionOrchestrators } from "../orchestrators/runtime-composition.mjs";
|
|
12
|
+
import { extendBuiltInPluginContext, layerBuiltInPluginRuntime } from "../runtime/built-in-plugin-layers.mjs";
|
|
13
|
+
import { resolveAppName, resolveStackName } from "../api/inference-network.mjs";
|
|
14
|
+
import { ExitCode } from "../surfaces/cli/sysexits.mjs";
|
|
15
|
+
import { CliConfigInvalidError, CliConfigNotFoundError, CliSupervisorLiveError } from "../surfaces/cli/errors.mjs";
|
|
16
|
+
import { removeRouterDispatchFilesForStack } from "../orchestrators/router/cleanup.mjs";
|
|
17
|
+
import { probeSupervisorPresence } from "../surfaces/cli/commands/supervisor-presence.mjs";
|
|
18
|
+
import { defaultProbes } from "../surfaces/cli/commands/doctor-probes.mjs";
|
|
19
|
+
import { dispatch } from "../surfaces/cli/index.mjs";
|
|
20
|
+
import { nodeConfirmPrompt } from "../surfaces/cli/commands/confirm-node.mjs";
|
|
21
|
+
import { makeTuiSurface } from "../surfaces/tui/index.mjs";
|
|
22
|
+
import { makeSnapshotReader } from "./snapshot-reader.mjs";
|
|
23
|
+
import { makeQueueCommandPublisher, resolveUpRendererMode } from "./up-lifecycle.mjs";
|
|
24
|
+
import { makeDirectPruneDeps } from "./prune-direct.mjs";
|
|
25
|
+
import { Cause, Effect, Exit, FileSystem, Layer, Logger, Queue, Stream, SubscriptionRef } from "effect";
|
|
26
|
+
import { existsSync, realpathSync } from "node:fs";
|
|
27
|
+
import { dirname, isAbsolute, resolve } from "node:path";
|
|
28
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
29
|
+
//#region src/cli/main.ts
|
|
30
|
+
const DEFAULT_CONFIG_PATH = "./devstack.config.ts";
|
|
31
|
+
const LIVE_APPLY_ACK_TIMEOUT_MILLIS = 600 * 1e3;
|
|
32
|
+
const stackRootFor = (runtimeRoot, stack) => resolve(runtimeRoot, "stacks", stack);
|
|
33
|
+
const rosterPathsFor = (stackRoot) => ({
|
|
34
|
+
stackLockFile: resolve(stackRoot, "stack.lock"),
|
|
35
|
+
rosterFile: resolve(stackRoot, "roster.json")
|
|
36
|
+
});
|
|
37
|
+
const ENGINE_COMMAND_TAGS = new Set([
|
|
38
|
+
"stack.start",
|
|
39
|
+
"stack.stop",
|
|
40
|
+
"stack.restart",
|
|
41
|
+
"apply.requested",
|
|
42
|
+
"codegen.requested",
|
|
43
|
+
"snapshot.capture",
|
|
44
|
+
"snapshot.restore",
|
|
45
|
+
"snapshot.list",
|
|
46
|
+
"snapshot.delete",
|
|
47
|
+
"wipe.requested",
|
|
48
|
+
"prune.requested",
|
|
49
|
+
"advance-clock.requested",
|
|
50
|
+
"shutdown.requested",
|
|
51
|
+
"shutdown.hardKillRequested",
|
|
52
|
+
"selective-restart.requested"
|
|
53
|
+
]);
|
|
54
|
+
const hasString = (value, key) => typeof value[key] === "string";
|
|
55
|
+
const isEngineCommand = (value) => {
|
|
56
|
+
if (typeof value !== "object" || value === null) return false;
|
|
57
|
+
const record = value;
|
|
58
|
+
if (typeof record.tag !== "string" || !ENGINE_COMMAND_TAGS.has(record.tag)) return false;
|
|
59
|
+
switch (record.tag) {
|
|
60
|
+
case "snapshot.restore":
|
|
61
|
+
case "snapshot.delete": return hasString(record, "snapshotId");
|
|
62
|
+
case "advance-clock.requested": return typeof record.toMillis === "number";
|
|
63
|
+
case "shutdown.hardKillRequested": return (record.signal === "SIGINT" || record.signal === "SIGTERM") && typeof record.exitCode === "number" && typeof record.at === "number";
|
|
64
|
+
case "selective-restart.requested": return hasString(record, "pluginKey");
|
|
65
|
+
case "apply.requested": return record.pluginKey === void 0 || typeof record.pluginKey === "string";
|
|
66
|
+
case "snapshot.capture": return (record.snapshotId === void 0 || typeof record.snapshotId === "string") && (record.name === void 0 || typeof record.name === "string");
|
|
67
|
+
default: return true;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
const findCliSupervisorLiveError = (cause) => {
|
|
71
|
+
for (const reason of cause.reasons) {
|
|
72
|
+
if (!Cause.isFailReason(reason)) continue;
|
|
73
|
+
const error = reason.error;
|
|
74
|
+
if (error instanceof CliSupervisorLiveError) return error;
|
|
75
|
+
if (typeof error === "object" && error !== null && error._tag === "CliSupervisorLiveError") return error;
|
|
76
|
+
}
|
|
77
|
+
return null;
|
|
78
|
+
};
|
|
79
|
+
const resolveConfigPath = (configPath) => {
|
|
80
|
+
const target = configPath ?? DEFAULT_CONFIG_PATH;
|
|
81
|
+
const explicit = isAbsolute(target) ? target : resolve(process.cwd(), target);
|
|
82
|
+
if (existsSync(explicit)) return explicit;
|
|
83
|
+
if (configPath !== void 0 && configPath !== DEFAULT_CONFIG_PATH) return null;
|
|
84
|
+
let dir = process.cwd();
|
|
85
|
+
for (;;) {
|
|
86
|
+
const candidate = resolve(dir, "devstack.config.ts");
|
|
87
|
+
if (existsSync(candidate)) return candidate;
|
|
88
|
+
const parent = resolve(dir, "..");
|
|
89
|
+
if (parent === dir) return null;
|
|
90
|
+
dir = parent;
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
const validateStackModule = (resolvedConfigPath, mod) => {
|
|
94
|
+
const def = mod.default;
|
|
95
|
+
if (def === null || typeof def !== "object" || def._tag !== "Stack") throw new CliConfigInvalidError({ message: `config at ${resolvedConfigPath} does not default-export a Stack value (got _tag=${String(def?._tag)})` });
|
|
96
|
+
let stack;
|
|
97
|
+
try {
|
|
98
|
+
stack = readStackEngine(def);
|
|
99
|
+
} catch (cause) {
|
|
100
|
+
throw new CliConfigInvalidError({ message: `config at ${resolvedConfigPath} default-exported an invalid Stack handle: ${cause instanceof Error ? cause.message : String(cause)}` });
|
|
101
|
+
}
|
|
102
|
+
return {
|
|
103
|
+
stack,
|
|
104
|
+
resolvedConfigPath
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
const makeConfigLoader = () => ({ load: (configPath) => Effect.gen(function* () {
|
|
108
|
+
const abs = resolveConfigPath(configPath);
|
|
109
|
+
if (abs === null) {
|
|
110
|
+
const attempted = configPath !== void 0 ? resolve(process.cwd(), configPath) : resolve(process.cwd(), DEFAULT_CONFIG_PATH);
|
|
111
|
+
return yield* Effect.fail(new CliConfigNotFoundError({
|
|
112
|
+
message: `devstack config not found at ${attempted}`,
|
|
113
|
+
searchedPaths: [attempted]
|
|
114
|
+
}));
|
|
115
|
+
}
|
|
116
|
+
const url = pathToFileURL(abs).href;
|
|
117
|
+
const mod = yield* Effect.tryPromise({
|
|
118
|
+
try: () => import(url),
|
|
119
|
+
catch: (cause) => new CliConfigInvalidError({
|
|
120
|
+
message: `failed to import ${abs}: ${cause instanceof Error ? cause.message : String(cause)}`,
|
|
121
|
+
cause
|
|
122
|
+
})
|
|
123
|
+
});
|
|
124
|
+
return yield* Effect.try({
|
|
125
|
+
try: () => validateStackModule(abs, mod),
|
|
126
|
+
catch: (cause) => cause instanceof CliConfigInvalidError ? cause : new CliConfigInvalidError({
|
|
127
|
+
message: `invalid config at ${abs}`,
|
|
128
|
+
cause
|
|
129
|
+
})
|
|
130
|
+
});
|
|
131
|
+
}) });
|
|
132
|
+
/** Resolve identity from flags + env. App and stack fall through the
|
|
133
|
+
* shared cwd/package metadata resolver before their defaults. */
|
|
134
|
+
const resolveIdentity = (params) => {
|
|
135
|
+
const cwd = params.cwd ?? process.cwd();
|
|
136
|
+
const app = resolveAppName({
|
|
137
|
+
explicit: params.app,
|
|
138
|
+
cwd
|
|
139
|
+
});
|
|
140
|
+
const runtimeRoot = resolve(params.stateDir ?? process.env.DEVSTACK_STATE_DIR ?? resolve(process.env.HOME ?? process.cwd(), ".devstack"));
|
|
141
|
+
const stacksRoot = resolve(runtimeRoot, "stacks");
|
|
142
|
+
const stack = resolveStackName({
|
|
143
|
+
explicit: params.stack,
|
|
144
|
+
cwd
|
|
145
|
+
});
|
|
146
|
+
const network = params.network ?? process.env.DEVSTACK_NETWORK ?? "sui:local";
|
|
147
|
+
const stackRoot = resolve(stacksRoot, stack);
|
|
148
|
+
return {
|
|
149
|
+
app,
|
|
150
|
+
stack,
|
|
151
|
+
network,
|
|
152
|
+
runtimeRoot,
|
|
153
|
+
stacksRoot,
|
|
154
|
+
stackRoot,
|
|
155
|
+
rosterFile: resolve(stackRoot, "roster.json")
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
const projectionStatusReader = (identity) => ({ readState: (_app, _stack) => Effect.sync(() => readProjectionSnapshot(identity.stackRoot)) });
|
|
159
|
+
const commandResultFromProcess = () => ({ exitCode: typeof process.exitCode === "number" ? process.exitCode : 0 });
|
|
160
|
+
const buildDirectDeps = (identity) => {
|
|
161
|
+
const loader = makeConfigLoader();
|
|
162
|
+
return {
|
|
163
|
+
up: { run: (flags) => runUpLive(flags.configPath, identity, {
|
|
164
|
+
renderer: flags.renderer,
|
|
165
|
+
stdoutIsTty: Boolean(process.stdout.isTTY)
|
|
166
|
+
}).pipe(Effect.map(() => commandResultFromProcess())) },
|
|
167
|
+
apply: { run: (flags) => runApplyLive(flags.configPath, identity).pipe(Effect.map(() => commandResultFromProcess())) },
|
|
168
|
+
status: { reader: projectionStatusReader(identity) },
|
|
169
|
+
snapshot: makeDirectSnapshotDeps(identity),
|
|
170
|
+
prune: makeDirectPruneDeps({ runtimeRoot: identity.runtimeRoot }),
|
|
171
|
+
doctor: { probes: defaultProbes({
|
|
172
|
+
stateDir: identity.runtimeRoot,
|
|
173
|
+
appRoot: identity.stacksRoot
|
|
174
|
+
}) },
|
|
175
|
+
config: { loader },
|
|
176
|
+
wipe: {
|
|
177
|
+
wipe: () => runWipeDirect(identity),
|
|
178
|
+
confirm: nodeConfirmPrompt
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
const makeSnapshotCommandHandler = (params) => {
|
|
183
|
+
const provideFileSystem = (effect) => effect.pipe(Effect.provideService(FileSystem.FileSystem, params.fs));
|
|
184
|
+
return (cmd, handlerCtx) => {
|
|
185
|
+
switch (cmd.tag) {
|
|
186
|
+
case "snapshot.capture": return provideFileSystem(params.snapshot.capture({
|
|
187
|
+
id: cmd.snapshotId,
|
|
188
|
+
label: cmd.name,
|
|
189
|
+
onProgress: (progress) => handlerCtx.publish({
|
|
190
|
+
tag: "snapshot.captureProgress",
|
|
191
|
+
...cmd.snapshotId === void 0 ? {} : { snapshotId: cmd.snapshotId },
|
|
192
|
+
...cmd.name === void 0 ? {} : { name: cmd.name },
|
|
193
|
+
phase: progress.phase,
|
|
194
|
+
...progress.detail === void 0 ? {} : { detail: progress.detail },
|
|
195
|
+
...progress.pausedContainers === void 0 ? {} : { pausedContainers: progress.pausedContainers },
|
|
196
|
+
...progress.totalContainers === void 0 ? {} : { totalContainers: progress.totalContainers },
|
|
197
|
+
at: Date.now()
|
|
198
|
+
})
|
|
199
|
+
})).pipe(Effect.map((meta) => [{
|
|
200
|
+
tag: "snapshot.captured",
|
|
201
|
+
snapshotId: meta.id,
|
|
202
|
+
...meta.label === null ? {} : { name: meta.label },
|
|
203
|
+
at: Date.now()
|
|
204
|
+
}]));
|
|
205
|
+
case "snapshot.restore": return provideFileSystem(params.snapshot.restore({ id: cmd.snapshotId })).pipe(Effect.map((meta) => [{
|
|
206
|
+
tag: "snapshot.restored",
|
|
207
|
+
snapshotId: meta.id,
|
|
208
|
+
at: Date.now()
|
|
209
|
+
}]));
|
|
210
|
+
case "snapshot.list": return provideFileSystem(params.snapshot.list).pipe(Effect.as([]));
|
|
211
|
+
case "snapshot.delete": return provideFileSystem(params.snapshot.delete(cmd.snapshotId)).pipe(Effect.as([]));
|
|
212
|
+
case "wipe.requested": return provideFileSystem(params.snapshot.wipe({})).pipe(Effect.as([]));
|
|
213
|
+
case "prune.requested": return provideFileSystem(params.snapshot.prune({})).pipe(Effect.as([]));
|
|
214
|
+
default: return Effect.succeed([]);
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
const installLiveSupervisorRoster = (params) => Effect.gen(function* () {
|
|
219
|
+
const paths = rosterPathsFor(params.stackRoot);
|
|
220
|
+
if (!(yield* claim(paths)).soleHolder) {
|
|
221
|
+
yield* release(paths).pipe(Effect.catch(() => Effect.void));
|
|
222
|
+
return yield* Effect.fail(new CliSupervisorLiveError({
|
|
223
|
+
app: params.app,
|
|
224
|
+
stack: params.stack,
|
|
225
|
+
hint: "use `devstack apply` from another shell, or choose a different --stack name"
|
|
226
|
+
}));
|
|
227
|
+
}
|
|
228
|
+
yield* Effect.addFinalizer(() => release(paths).pipe(Effect.catch(() => Effect.void)));
|
|
229
|
+
yield* Effect.forkScoped(heartbeatFiber(paths));
|
|
230
|
+
});
|
|
231
|
+
const installCommandChannelBridge = (params) => Effect.gen(function* () {
|
|
232
|
+
const subscriber = yield* makeCommandChannelSubscriber(commandChannelPaths(params.stackRoot), { fromOffset: "current" });
|
|
233
|
+
yield* Effect.forkScoped(subscriber.commands.pipe(Stream.runForEach((record) => Effect.gen(function* () {
|
|
234
|
+
if (!isEngineCommand(record.command)) {
|
|
235
|
+
yield* subscriber.fail(record.id, "invalid command", "command payload did not match EngineCommand").pipe(Effect.catch(() => Effect.void));
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
yield* params.handle.runCommand(record.command).pipe(Effect.andThen(subscriber.ack(record.id)), Effect.catchCause((cause) => subscriber.fail(record.id, "command failed", Cause.pretty(cause)).pipe(Effect.catch(() => Effect.void))));
|
|
239
|
+
})), Effect.catchCause((cause) => Effect.sync(() => {
|
|
240
|
+
process.stderr.write(`command channel failed: ${Cause.pretty(cause)}\n`);
|
|
241
|
+
}))));
|
|
242
|
+
return { publishEvent: (event) => subscriber.publishEvent(event).pipe(Effect.catch(() => Effect.void)) };
|
|
243
|
+
});
|
|
244
|
+
/**
|
|
245
|
+
* Run `devstack up`. Wires the substrate Layer stack, supervisor,
|
|
246
|
+
* attached renderer, and in-process TUI command queue. The Effect runs
|
|
247
|
+
* as the outer Node fiber so SIGINT reaches scope finalizers.
|
|
248
|
+
*/
|
|
249
|
+
const runUpLive = (configPath, identity, options) => {
|
|
250
|
+
const loader = makeConfigLoader();
|
|
251
|
+
return Effect.gen(function* () {
|
|
252
|
+
const loaded = yield* loader.load(configPath).pipe(Effect.catch((err) => Effect.sync(() => {
|
|
253
|
+
process.stderr.write(`error: ${err.message}\n`);
|
|
254
|
+
process.exitCode = err._tag === "CliConfigNotFoundError" ? 66 : 78;
|
|
255
|
+
return null;
|
|
256
|
+
})));
|
|
257
|
+
if (loaded === null) return;
|
|
258
|
+
const stack = loaded.stack;
|
|
259
|
+
const identityValue = {
|
|
260
|
+
app: appName(identity.app),
|
|
261
|
+
stack: stackName(stack.options.stackName ?? identity.stack),
|
|
262
|
+
chain: chainId(identity.network)
|
|
263
|
+
};
|
|
264
|
+
const appRoot = dirname(loaded.resolvedConfigPath);
|
|
265
|
+
const rendererMode = resolveUpRendererMode({
|
|
266
|
+
cliRenderer: options.renderer,
|
|
267
|
+
stackRenderer: stack.options.renderer,
|
|
268
|
+
stdoutIsTty: options.stdoutIsTty
|
|
269
|
+
});
|
|
270
|
+
const substrateLayers = layerProductionOrchestrators({ codegen: {
|
|
271
|
+
appRoot,
|
|
272
|
+
outputDir: stack.options.codegen?.outputDir,
|
|
273
|
+
stackSubdir: stack.options.codegen?.stackSubdir ?? null
|
|
274
|
+
} }).pipe(Layer.provideMerge(buildSubstrateLayers(identityValue, identity.runtimeRoot)));
|
|
275
|
+
yield* Effect.gen(function* () {
|
|
276
|
+
const state = yield* makeProjectionRef();
|
|
277
|
+
const snapshotCommandHandler = makeSnapshotCommandHandler({
|
|
278
|
+
snapshot: yield* SnapshotOrchestratorService,
|
|
279
|
+
fs: yield* FileSystem.FileSystem
|
|
280
|
+
});
|
|
281
|
+
const orchestratorSinks = yield* buildProductionOrchestratorSinks();
|
|
282
|
+
const postAcquireHook = yield* buildProductionPostAcquireHook({ extras: stack.options.extras });
|
|
283
|
+
yield* superviseStackEffect({
|
|
284
|
+
_tag: "Stack",
|
|
285
|
+
members: stack.members,
|
|
286
|
+
options: stack.options
|
|
287
|
+
}, identityValue, state, {
|
|
288
|
+
orchestratorSinks,
|
|
289
|
+
commandHandler: snapshotCommandHandler,
|
|
290
|
+
postAcquireHook,
|
|
291
|
+
extendContext: extendBuiltInPluginContext,
|
|
292
|
+
beforeInitialAcquire: (handle) => Effect.gen(function* () {
|
|
293
|
+
const stackPaths = yield* StackPathsService;
|
|
294
|
+
const commandChannel = yield* installCommandChannelBridge({
|
|
295
|
+
stackRoot: stackPaths.stackRoot,
|
|
296
|
+
handle
|
|
297
|
+
});
|
|
298
|
+
yield* installLiveSupervisorRoster({
|
|
299
|
+
stackRoot: stackPaths.stackRoot,
|
|
300
|
+
app: String(identityValue.app),
|
|
301
|
+
stack: String(identityValue.stack)
|
|
302
|
+
});
|
|
303
|
+
const rendererEvents = yield* Queue.unbounded();
|
|
304
|
+
const renderer = makeTuiSurface({
|
|
305
|
+
mode: rendererMode,
|
|
306
|
+
publishCommand: makeQueueCommandPublisher(handle.commands)
|
|
307
|
+
});
|
|
308
|
+
yield* Effect.addFinalizer(() => renderer.flush.pipe(Effect.catch(() => Effect.void)));
|
|
309
|
+
yield* Effect.forkScoped(renderer.mount(handle.state, Stream.fromQueue(rendererEvents)).pipe(Effect.catch((cause) => Effect.sync(() => {
|
|
310
|
+
process.stderr.write(`renderer failed: ${cause.detail ?? String(cause)}\n`);
|
|
311
|
+
}))));
|
|
312
|
+
yield* Effect.forkScoped(persistProjectionChanges(stackPaths.stackRoot, handle.state));
|
|
313
|
+
yield* Effect.forkScoped(Stream.fromQueue(handle.events).pipe(Stream.runForEach((event) => Effect.gen(function* () {
|
|
314
|
+
yield* Queue.offer(rendererEvents, event);
|
|
315
|
+
yield* commandChannel.publishEvent(event);
|
|
316
|
+
}))));
|
|
317
|
+
})
|
|
318
|
+
}).pipe(Effect.provide(layerBuiltInPluginRuntime(orchestratorSinks)));
|
|
319
|
+
}).pipe(Effect.provide(substrateLayers), Effect.provide(Logger.layer([])), Effect.matchCauseEffect({
|
|
320
|
+
onFailure: (cause) => Effect.sync(() => {
|
|
321
|
+
const live = findCliSupervisorLiveError(cause);
|
|
322
|
+
if (live !== null) {
|
|
323
|
+
process.stderr.write(`error: supervisor live for ${live.app}/${live.stack}\n`);
|
|
324
|
+
if (live.hint !== void 0) process.stderr.write(`hint: ${live.hint}\n`);
|
|
325
|
+
process.exitCode = ExitCode.SUPERVISOR_LIVE;
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
process.stderr.write(`\nerror: stack failed\n${Cause.pretty(cause)}\n`);
|
|
329
|
+
process.exitCode = 1;
|
|
330
|
+
}),
|
|
331
|
+
onSuccess: () => Effect.sync(() => {
|
|
332
|
+
process.exitCode ??= 0;
|
|
333
|
+
})
|
|
334
|
+
}));
|
|
335
|
+
});
|
|
336
|
+
};
|
|
337
|
+
const runApplyAgainstLiveSupervisor = (identity, identityValue) => Effect.gen(function* () {
|
|
338
|
+
const stackRoot = stackRootFor(identity.runtimeRoot, String(identityValue.stack));
|
|
339
|
+
if (!(yield* probeSupervisorPresence(resolve(stackRoot, "roster.json")).pipe(Effect.catch(() => Effect.succeed({
|
|
340
|
+
live: false,
|
|
341
|
+
pid: null,
|
|
342
|
+
hostname: null
|
|
343
|
+
})))).live) return false;
|
|
344
|
+
const exit = yield* Effect.exit(Effect.gen(function* () {
|
|
345
|
+
const publisher = yield* makeCommandChannelPublisher(commandChannelPaths(stackRoot));
|
|
346
|
+
const published = yield* publisher.publish({ tag: "apply.requested" });
|
|
347
|
+
const reply = yield* publisher.awaitCompletion(published.id, { timeoutMillis: LIVE_APPLY_ACK_TIMEOUT_MILLIS });
|
|
348
|
+
if (!reply.ok) return yield* Effect.fail(reply.message);
|
|
349
|
+
}));
|
|
350
|
+
if (Exit.isFailure(exit)) {
|
|
351
|
+
process.stderr.write(`\nerror: live stack apply failed\n${Cause.pretty(exit.cause)}\n`);
|
|
352
|
+
process.exitCode = 1;
|
|
353
|
+
return true;
|
|
354
|
+
}
|
|
355
|
+
process.exitCode ??= 0;
|
|
356
|
+
return true;
|
|
357
|
+
});
|
|
358
|
+
const runApplyLive = (configPath, identity) => {
|
|
359
|
+
const loader = makeConfigLoader();
|
|
360
|
+
return Effect.gen(function* () {
|
|
361
|
+
const loaded = yield* loader.load(configPath).pipe(Effect.matchEffect({
|
|
362
|
+
onFailure: (err) => Effect.gen(function* () {
|
|
363
|
+
process.stderr.write(`error: ${err.message}\n`);
|
|
364
|
+
process.exitCode = err._tag === "CliConfigNotFoundError" ? 66 : 78;
|
|
365
|
+
return yield* Effect.fail("config-load-failed");
|
|
366
|
+
}),
|
|
367
|
+
onSuccess: (v) => Effect.succeed(v)
|
|
368
|
+
}));
|
|
369
|
+
const stack = loaded.stack;
|
|
370
|
+
const identityValue = {
|
|
371
|
+
app: appName(identity.app),
|
|
372
|
+
stack: stackName(stack.options.stackName ?? identity.stack),
|
|
373
|
+
chain: chainId(identity.network)
|
|
374
|
+
};
|
|
375
|
+
if (yield* runApplyAgainstLiveSupervisor(identity, identityValue)) return;
|
|
376
|
+
const substrateLayers = layerProductionOrchestrators({ codegen: {
|
|
377
|
+
appRoot: dirname(loaded.resolvedConfigPath),
|
|
378
|
+
outputDir: stack.options.codegen?.outputDir,
|
|
379
|
+
stackSubdir: stack.options.codegen?.stackSubdir ?? null
|
|
380
|
+
} }).pipe(Layer.provideMerge(buildSubstrateLayers(identityValue, identity.runtimeRoot)));
|
|
381
|
+
yield* Effect.gen(function* () {
|
|
382
|
+
const state = yield* makeProjectionRef();
|
|
383
|
+
const orchestratorSinks = yield* buildProductionOrchestratorSinks();
|
|
384
|
+
const postAcquireHook = yield* buildProductionPostAcquireHook({ extras: stack.options.extras });
|
|
385
|
+
yield* superviseStackEffect({
|
|
386
|
+
_tag: "Stack",
|
|
387
|
+
members: stack.members,
|
|
388
|
+
options: stack.options
|
|
389
|
+
}, identityValue, state, {
|
|
390
|
+
orchestratorSinks,
|
|
391
|
+
postAcquireHook,
|
|
392
|
+
lifetime: "one-shot",
|
|
393
|
+
extendContext: extendBuiltInPluginContext
|
|
394
|
+
}).pipe(Effect.provide(layerBuiltInPluginRuntime(orchestratorSinks)));
|
|
395
|
+
yield* writeProjectionSnapshot((yield* StackPathsService).stackRoot, yield* SubscriptionRef.get(state));
|
|
396
|
+
}).pipe(Effect.provide(substrateLayers), Effect.provide(Logger.layer([Logger.consolePretty()])), Effect.matchCauseEffect({
|
|
397
|
+
onFailure: (cause) => Effect.sync(() => {
|
|
398
|
+
process.stderr.write(`\nerror: stack apply failed\n${Cause.pretty(cause)}\n`);
|
|
399
|
+
process.exitCode = 1;
|
|
400
|
+
}),
|
|
401
|
+
onSuccess: () => Effect.sync(() => {
|
|
402
|
+
process.exitCode ??= 0;
|
|
403
|
+
})
|
|
404
|
+
}));
|
|
405
|
+
}).pipe(Effect.catch(() => Effect.void));
|
|
406
|
+
};
|
|
407
|
+
const snapshotIdentityParticipants = (meta) => Object.entries(meta.identity).map(([plugin, value]) => ({
|
|
408
|
+
plugin,
|
|
409
|
+
liveIdentity: Effect.succeed({ [plugin]: value })
|
|
410
|
+
}));
|
|
411
|
+
const identityValueFor = (identity, stack) => ({
|
|
412
|
+
app: appName(identity.app),
|
|
413
|
+
stack: stackName(stack?.options.stackName ?? identity.stack),
|
|
414
|
+
chain: chainId(identity.network)
|
|
415
|
+
});
|
|
416
|
+
const directSnapshotLayers = (identity) => layerProductionOrchestrators().pipe(Layer.provideMerge(buildSubstrateLayers(identityValueFor(identity), identity.runtimeRoot)));
|
|
417
|
+
const provideFileSystem = (fs, effect) => effect.pipe(Effect.provideService(FileSystem.FileSystem, fs));
|
|
418
|
+
const ensureNoLiveSupervisor = (identity, hint) => Effect.gen(function* () {
|
|
419
|
+
if ((yield* probeSupervisorPresence(identity.rosterFile).pipe(Effect.catch(() => Effect.succeed({
|
|
420
|
+
live: false,
|
|
421
|
+
pid: null,
|
|
422
|
+
hostname: null
|
|
423
|
+
})))).live) return yield* Effect.fail(new CliSupervisorLiveError({
|
|
424
|
+
app: identity.app,
|
|
425
|
+
stack: identity.stack,
|
|
426
|
+
hint
|
|
427
|
+
}));
|
|
428
|
+
});
|
|
429
|
+
const runSnapshotRestoreDirect = (identity, snapshotId) => {
|
|
430
|
+
const restored = Effect.gen(function* () {
|
|
431
|
+
const snapshot = yield* SnapshotOrchestratorService;
|
|
432
|
+
const fs = yield* FileSystem.FileSystem;
|
|
433
|
+
const meta = (yield* provideFileSystem(fs, snapshot.list)).find((entry) => entry.id === snapshotId)?.metadata ?? null;
|
|
434
|
+
const participants = meta === null ? [] : snapshotIdentityParticipants(meta);
|
|
435
|
+
yield* provideFileSystem(fs, snapshot.restore({
|
|
436
|
+
id: snapshotId,
|
|
437
|
+
participants
|
|
438
|
+
}));
|
|
439
|
+
}).pipe(Effect.provide(directSnapshotLayers(identity)), Effect.provide(Logger.layer([Logger.consolePretty()])));
|
|
440
|
+
return ensureNoLiveSupervisor(identity, "shut down the attached `devstack up` session before restoring a snapshot").pipe(Effect.andThen(restored));
|
|
441
|
+
};
|
|
442
|
+
const runSnapshotDeleteDirect = (identity, snapshotId) => {
|
|
443
|
+
return Effect.gen(function* () {
|
|
444
|
+
const snapshot = yield* SnapshotOrchestratorService;
|
|
445
|
+
yield* provideFileSystem(yield* FileSystem.FileSystem, snapshot.delete(snapshotId));
|
|
446
|
+
}).pipe(Effect.provide(directSnapshotLayers(identity)), Effect.provide(Logger.layer([Logger.consolePretty()])));
|
|
447
|
+
};
|
|
448
|
+
const runSnapshotCaptureDirect = (identity, args) => {
|
|
449
|
+
const loader = makeConfigLoader();
|
|
450
|
+
return Effect.gen(function* () {
|
|
451
|
+
const loaded = yield* loader.load(args.configPath);
|
|
452
|
+
const stack = loaded.stack;
|
|
453
|
+
const identityValue = identityValueFor(identity, stack);
|
|
454
|
+
const substrateLayers = layerProductionOrchestrators({ codegen: {
|
|
455
|
+
appRoot: dirname(loaded.resolvedConfigPath),
|
|
456
|
+
outputDir: stack.options.codegen?.outputDir,
|
|
457
|
+
stackSubdir: stack.options.codegen?.stackSubdir ?? null
|
|
458
|
+
} }).pipe(Layer.provideMerge(buildSubstrateLayers(identityValue, identity.runtimeRoot)));
|
|
459
|
+
return yield* Effect.gen(function* () {
|
|
460
|
+
const state = yield* makeProjectionRef();
|
|
461
|
+
const snapshot = yield* SnapshotOrchestratorService;
|
|
462
|
+
const fs = yield* FileSystem.FileSystem;
|
|
463
|
+
const orchestratorSinks = yield* buildProductionOrchestratorSinks();
|
|
464
|
+
const postAcquireHook = yield* buildProductionPostAcquireHook({ extras: stack.options.extras });
|
|
465
|
+
let captureExit = Exit.succeed(void 0);
|
|
466
|
+
const capturedMeta = { current: null };
|
|
467
|
+
yield* superviseStackEffect({
|
|
468
|
+
_tag: "Stack",
|
|
469
|
+
members: stack.members,
|
|
470
|
+
options: stack.options
|
|
471
|
+
}, identityValue, state, {
|
|
472
|
+
orchestratorSinks,
|
|
473
|
+
postAcquireHook,
|
|
474
|
+
lifetime: "one-shot",
|
|
475
|
+
extendContext: extendBuiltInPluginContext,
|
|
476
|
+
withinScope: () => provideFileSystem(fs, snapshot.capture({
|
|
477
|
+
id: args.snapshotId,
|
|
478
|
+
label: args.name
|
|
479
|
+
})).pipe(Effect.tap((meta) => Effect.sync(() => {
|
|
480
|
+
capturedMeta.current = meta;
|
|
481
|
+
})), Effect.asVoid, Effect.exit, Effect.tap((exit) => Effect.sync(() => {
|
|
482
|
+
captureExit = exit;
|
|
483
|
+
})), Effect.asVoid)
|
|
484
|
+
}).pipe(Effect.provide(layerBuiltInPluginRuntime(orchestratorSinks)));
|
|
485
|
+
if (Exit.isFailure(captureExit)) yield* Effect.failCause(captureExit.cause);
|
|
486
|
+
if (capturedMeta.current === null) return yield* Effect.die("snapshot capture completed without metadata");
|
|
487
|
+
const meta = capturedMeta.current;
|
|
488
|
+
yield* writeProjectionSnapshot((yield* StackPathsService).stackRoot, yield* SubscriptionRef.get(state));
|
|
489
|
+
return {
|
|
490
|
+
snapshotId: meta.id,
|
|
491
|
+
name: meta.label ?? meta.id
|
|
492
|
+
};
|
|
493
|
+
}).pipe(Effect.provide(substrateLayers), Effect.provide(Logger.layer([Logger.consolePretty()])));
|
|
494
|
+
});
|
|
495
|
+
};
|
|
496
|
+
const makeDirectSnapshotDeps = (identity) => ({
|
|
497
|
+
reader: makeSnapshotReader(identity),
|
|
498
|
+
capture: (args) => runSnapshotCaptureDirect(identity, args),
|
|
499
|
+
restore: (snapshotId) => runSnapshotRestoreDirect(identity, snapshotId),
|
|
500
|
+
delete: (snapshotId) => runSnapshotDeleteDirect(identity, snapshotId),
|
|
501
|
+
confirm: nodeConfirmPrompt
|
|
502
|
+
});
|
|
503
|
+
const runWipeDirect = (identity) => Effect.gen(function* () {
|
|
504
|
+
yield* ensureNoLiveSupervisor(identity, "shut down the attached `devstack up` session first");
|
|
505
|
+
return yield* Effect.gen(function* () {
|
|
506
|
+
const snapshot = yield* SnapshotOrchestratorService;
|
|
507
|
+
yield* provideFileSystem(yield* FileSystem.FileSystem, snapshot.wipe({}));
|
|
508
|
+
yield* removeRouterDispatchFilesForStack({
|
|
509
|
+
runtimeRoot: identity.runtimeRoot,
|
|
510
|
+
app: identity.app,
|
|
511
|
+
stack: identity.stack
|
|
512
|
+
});
|
|
513
|
+
}).pipe(Effect.provide(directSnapshotLayers(identity)), Effect.provide(Logger.layer([Logger.consolePretty()])));
|
|
514
|
+
});
|
|
515
|
+
const identityInputsFromArgv = (argv, env) => {
|
|
516
|
+
let app = env.DEVSTACK_APP;
|
|
517
|
+
let stack = env.DEVSTACK_STACK;
|
|
518
|
+
let network = env.DEVSTACK_NETWORK;
|
|
519
|
+
let stateDir = env.DEVSTACK_STATE_DIR;
|
|
520
|
+
let configPath = env.DEVSTACK_CONFIG;
|
|
521
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
522
|
+
const token = argv[i];
|
|
523
|
+
const readValue = (name) => {
|
|
524
|
+
if (token.startsWith(`--${name}=`)) return token.slice(name.length + 3);
|
|
525
|
+
if (token === `--${name}`) return argv[i + 1];
|
|
526
|
+
};
|
|
527
|
+
app = readValue("app") ?? app;
|
|
528
|
+
stack = readValue("stack") ?? stack;
|
|
529
|
+
network = readValue("network") ?? network;
|
|
530
|
+
stateDir = readValue("state-dir") ?? stateDir;
|
|
531
|
+
configPath = readValue("config") ?? configPath;
|
|
532
|
+
}
|
|
533
|
+
return {
|
|
534
|
+
app,
|
|
535
|
+
stack,
|
|
536
|
+
network,
|
|
537
|
+
stateDir,
|
|
538
|
+
configPath
|
|
539
|
+
};
|
|
540
|
+
};
|
|
541
|
+
const identityCwdFromConfig = (configPath) => {
|
|
542
|
+
const resolved = resolveConfigPath(configPath);
|
|
543
|
+
return resolved === null ? process.cwd() : dirname(resolved);
|
|
544
|
+
};
|
|
545
|
+
const runCli = async (argv = process.argv.slice(2)) => {
|
|
546
|
+
const stdinIsTty = Boolean(process.stdin.isTTY);
|
|
547
|
+
const env = { ...process.env };
|
|
548
|
+
const identityInputs = identityInputsFromArgv(argv, env);
|
|
549
|
+
const identity = resolveIdentity({
|
|
550
|
+
app: identityInputs.app,
|
|
551
|
+
stack: identityInputs.stack,
|
|
552
|
+
network: identityInputs.network,
|
|
553
|
+
stateDir: identityInputs.stateDir,
|
|
554
|
+
cwd: identityCwdFromConfig(identityInputs.configPath)
|
|
555
|
+
});
|
|
556
|
+
const deps = buildDirectDeps(identity);
|
|
557
|
+
await Effect.runPromise(dispatch(deps, {
|
|
558
|
+
argv,
|
|
559
|
+
env: {
|
|
560
|
+
...env,
|
|
561
|
+
DEVSTACK_APP: identity.app,
|
|
562
|
+
DEVSTACK_STACK: identity.stack,
|
|
563
|
+
DEVSTACK_STATE_DIR: identity.runtimeRoot
|
|
564
|
+
},
|
|
565
|
+
stdinIsTty
|
|
566
|
+
}));
|
|
567
|
+
};
|
|
568
|
+
const isMainEntrypoint = () => {
|
|
569
|
+
const argvPath = process.argv[1];
|
|
570
|
+
if (argvPath === void 0) return false;
|
|
571
|
+
try {
|
|
572
|
+
return realpathSync(argvPath) === realpathSync(fileURLToPath(import.meta.url));
|
|
573
|
+
} catch {
|
|
574
|
+
return import.meta.url === pathToFileURL(argvPath).href;
|
|
575
|
+
}
|
|
576
|
+
};
|
|
577
|
+
if (isMainEntrypoint()) runCli().catch((err) => {
|
|
578
|
+
process.stderr.write(`error: ${err instanceof Error ? err.message : String(err)}\n`);
|
|
579
|
+
process.exitCode = 1;
|
|
580
|
+
}).then(() => {
|
|
581
|
+
process.exit(process.exitCode ?? 0);
|
|
582
|
+
});
|
|
583
|
+
//#endregion
|
|
584
|
+
export { runCli };
|
|
585
|
+
|
|
586
|
+
//# sourceMappingURL=main.mjs.map
|