@mysten-incubation/devstack 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -3
- package/dashboard-ui/assets/grpc-a4usE3Nk.js +3 -0
- package/dashboard-ui/assets/index-B82Bh84P.css +1 -0
- package/dashboard-ui/assets/index-CRYJ4pru.js +1277 -0
- package/dashboard-ui/index.html +2 -2
- package/dist/api/define-capabilities.d.mts +1 -20
- package/dist/api/define-capabilities.mjs +15 -22
- package/dist/api/define-capabilities.mjs.map +1 -1
- package/dist/api/define-devstack-with.d.mts +7 -1
- package/dist/api/define-devstack-with.mjs.map +1 -1
- package/dist/api/define-devstack.mjs.map +1 -1
- package/dist/api/define-plugin.d.mts +2 -1
- package/dist/api/inference-network.d.mts +31 -17
- package/dist/api/inference-network.mjs +40 -43
- package/dist/api/inference-network.mjs.map +1 -1
- package/dist/api/load-config.mjs +88 -0
- package/dist/api/load-config.mjs.map +1 -0
- package/dist/api/mode-narrowed-factory.d.mts +1 -1
- package/dist/api/mode-narrowed-factory.mjs.map +1 -1
- package/dist/api/run-stack-internal.mjs +202 -0
- package/dist/api/run-stack-internal.mjs.map +1 -0
- package/dist/api/run-stack.d.mts +82 -31
- package/dist/api/run-stack.mjs +22 -141
- package/dist/api/run-stack.mjs.map +1 -1
- package/dist/build-integrations/dapp-kit/index.d.mts +61 -0
- package/dist/build-integrations/dapp-kit/index.mjs +58 -0
- package/dist/build-integrations/dapp-kit/index.mjs.map +1 -0
- package/dist/build-integrations/playwright/config.d.mts +1 -30
- package/dist/build-integrations/playwright/config.mjs +1 -27
- package/dist/build-integrations/playwright/config.mjs.map +1 -1
- package/dist/build-integrations/playwright/errors.d.mts +4 -7
- package/dist/build-integrations/playwright/errors.mjs.map +1 -1
- package/dist/build-integrations/playwright/global-setup.d.mts +42 -71
- package/dist/build-integrations/playwright/global-setup.mjs +142 -218
- package/dist/build-integrations/playwright/global-setup.mjs.map +1 -1
- package/dist/build-integrations/playwright/index.d.mts +2 -2
- package/dist/build-integrations/playwright/index.mjs +2 -2
- package/dist/build-integrations/playwright/stack-context.d.mts +3 -1
- package/dist/build-integrations/playwright/stack-context.mjs +4 -2
- package/dist/build-integrations/playwright/stack-context.mjs.map +1 -1
- package/dist/build-integrations/playwright/wallet-context.mjs +44 -19
- package/dist/build-integrations/playwright/wallet-context.mjs.map +1 -1
- package/dist/build-integrations/runtime/cold-start-url.mjs.map +1 -1
- package/dist/build-integrations/runtime/conventional-routes.mjs.map +1 -1
- package/dist/build-integrations/runtime/dapp-kit-slot.mjs.map +1 -1
- package/dist/build-integrations/runtime/discover.d.mts +6 -4
- package/dist/build-integrations/runtime/discover.mjs +15 -4
- package/dist/build-integrations/runtime/discover.mjs.map +1 -1
- package/dist/build-integrations/runtime/endpoint-registry.mjs.map +1 -1
- package/dist/build-integrations/runtime/errors.mjs.map +1 -1
- package/dist/build-integrations/runtime/read-stack-context.mjs +3 -3
- package/dist/build-integrations/runtime/read-stack-context.mjs.map +1 -1
- package/dist/build-integrations/runtime/resolve-discovery-env.d.mts +23 -7
- package/dist/build-integrations/runtime/resolve-discovery-env.mjs +25 -12
- package/dist/build-integrations/runtime/resolve-discovery-env.mjs.map +1 -1
- package/dist/build-integrations/runtime/stack-context.d.mts +2 -2
- package/dist/build-integrations/vite/index.d.mts +84 -19
- package/dist/build-integrations/vite/index.mjs +203 -28
- package/dist/build-integrations/vite/index.mjs.map +1 -1
- package/dist/build-integrations/vitest/config.d.mts +20 -2
- package/dist/build-integrations/vitest/config.mjs +16 -4
- package/dist/build-integrations/vitest/config.mjs.map +1 -1
- package/dist/build-integrations/vitest/env.d.mts +18 -10
- package/dist/build-integrations/vitest/env.mjs +11 -10
- package/dist/build-integrations/vitest/env.mjs.map +1 -1
- package/dist/build-integrations/vitest/errors.d.mts +7 -11
- package/dist/build-integrations/vitest/errors.mjs +3 -4
- package/dist/build-integrations/vitest/errors.mjs.map +1 -1
- package/dist/build-integrations/vitest/global-setup.d.mts +35 -0
- package/dist/build-integrations/vitest/global-setup.mjs +156 -0
- package/dist/build-integrations/vitest/global-setup.mjs.map +1 -0
- package/dist/build-integrations/vitest/index.d.mts +3 -2
- package/dist/build-integrations/vitest/index.mjs +3 -2
- package/dist/build-integrations/vitest/setup.mjs +2 -2
- package/dist/build-integrations/vitest/setup.mjs.map +1 -1
- package/dist/build-integrations/vitest/stack-context.d.mts +5 -3
- package/dist/build-integrations/vitest/stack-context.mjs +3 -2
- package/dist/build-integrations/vitest/stack-context.mjs.map +1 -1
- package/dist/cli/bail.mjs.map +1 -1
- package/dist/cli/doctor-probes.mjs +1 -3
- package/dist/cli/doctor-probes.mjs.map +1 -1
- package/dist/cli/main.d.mts +23 -1
- package/dist/cli/main.mjs +63 -8
- package/dist/cli/main.mjs.map +1 -1
- package/dist/cli/prune-direct.mjs.map +1 -1
- package/dist/cli/snapshot-reader.mjs.map +1 -1
- package/dist/cli/up-lifecycle.mjs.map +1 -1
- package/dist/cli/wirings/apply.mjs +28 -21
- package/dist/cli/wirings/apply.mjs.map +1 -1
- package/dist/cli/wirings/codegen.mjs +108 -0
- package/dist/cli/wirings/codegen.mjs.map +1 -0
- package/dist/cli/wirings/config-loader.mjs +12 -62
- package/dist/cli/wirings/config-loader.mjs.map +1 -1
- package/dist/cli/wirings/dump-ids.mjs +86 -0
- package/dist/cli/wirings/dump-ids.mjs.map +1 -0
- package/dist/cli/wirings/engine-command.mjs +1 -1
- package/dist/cli/wirings/engine-command.mjs.map +1 -1
- package/dist/cli/wirings/identity.mjs +2 -2
- package/dist/cli/wirings/identity.mjs.map +1 -1
- package/dist/cli/wirings/provide-file-system.mjs.map +1 -1
- package/dist/cli/wirings/read-devstack-version.mjs +17 -0
- package/dist/cli/wirings/read-devstack-version.mjs.map +1 -0
- package/dist/cli/wirings/snapshot.mjs +27 -34
- package/dist/cli/wirings/snapshot.mjs.map +1 -1
- package/dist/cli/wirings/up-ipc.mjs +147 -0
- package/dist/cli/wirings/up-ipc.mjs.map +1 -0
- package/dist/cli/wirings/up.mjs +218 -198
- package/dist/cli/wirings/up.mjs.map +1 -1
- package/dist/cli/wirings/wipe.mjs +1 -1
- package/dist/cli/wirings/wipe.mjs.map +1 -1
- package/dist/contracts/chain-probe.d.mts +1 -1
- package/dist/contracts/chain-probe.mjs +1 -1
- package/dist/contracts/chain-probe.mjs.map +1 -1
- package/dist/contracts/codegenable.d.mts +60 -6
- package/dist/contracts/codegenable.mjs +28 -0
- package/dist/contracts/codegenable.mjs.map +1 -0
- package/dist/contracts/config-bindings.mjs +162 -0
- package/dist/contracts/config-bindings.mjs.map +1 -0
- package/dist/contracts/container-runtime.d.mts +23 -17
- package/dist/contracts/plugin-expander.mjs.map +1 -1
- package/dist/contracts/snapshotable.d.mts +5 -7
- package/dist/contracts/wallet-protocol.d.mts +2 -5
- package/dist/contracts/wallet-protocol.mjs +2 -5
- package/dist/contracts/wallet-protocol.mjs.map +1 -1
- package/dist/index.d.mts +21 -26
- package/dist/index.mjs +8 -9
- package/dist/orchestrators/boot.d.mts +28 -0
- package/dist/orchestrators/boot.mjs +440 -0
- package/dist/orchestrators/boot.mjs.map +1 -0
- package/dist/orchestrators/codegen/bindings.d.mts +13 -1
- package/dist/orchestrators/codegen/bindings.mjs +23 -9
- package/dist/orchestrators/codegen/bindings.mjs.map +1 -1
- package/dist/orchestrators/codegen/config-runtime.mjs +208 -0
- package/dist/orchestrators/codegen/config-runtime.mjs.map +1 -0
- package/dist/orchestrators/codegen/emit.mjs +1 -1
- package/dist/orchestrators/codegen/emit.mjs.map +1 -1
- package/dist/orchestrators/codegen/errors.mjs +21 -1
- package/dist/orchestrators/codegen/errors.mjs.map +1 -1
- package/dist/orchestrators/codegen/format.mjs +2 -0
- package/dist/orchestrators/codegen/format.mjs.map +1 -1
- package/dist/orchestrators/codegen/gitignore.mjs +30 -11
- package/dist/orchestrators/codegen/gitignore.mjs.map +1 -1
- package/dist/orchestrators/codegen/id-config.mjs +107 -0
- package/dist/orchestrators/codegen/id-config.mjs.map +1 -0
- package/dist/orchestrators/codegen/output-location.mjs +23 -32
- package/dist/orchestrators/codegen/output-location.mjs.map +1 -1
- package/dist/orchestrators/codegen/paths.mjs +8 -1
- package/dist/orchestrators/codegen/paths.mjs.map +1 -1
- package/dist/orchestrators/codegen/permissions.mjs.map +1 -1
- package/dist/orchestrators/codegen/service.mjs +286 -58
- package/dist/orchestrators/codegen/service.mjs.map +1 -1
- package/dist/orchestrators/layers.mjs +31 -0
- package/dist/orchestrators/layers.mjs.map +1 -0
- package/dist/orchestrators/lifecycle-prune/errors.mjs.map +1 -1
- package/dist/orchestrators/lifecycle-prune/index.mjs +8 -10
- package/dist/orchestrators/lifecycle-prune/index.mjs.map +1 -1
- package/dist/orchestrators/network-options.d.mts +52 -0
- package/dist/orchestrators/network-options.mjs +43 -0
- package/dist/orchestrators/network-options.mjs.map +1 -0
- package/dist/orchestrators/router/cleanup.mjs.map +1 -1
- package/dist/orchestrators/router/cors.mjs.map +1 -1
- package/dist/orchestrators/router/entrypoints.mjs.map +1 -1
- package/dist/orchestrators/router/errors.mjs.map +1 -1
- package/dist/orchestrators/router/file-provider.mjs.map +1 -1
- package/dist/orchestrators/router/hostname.mjs.map +1 -1
- package/dist/orchestrators/router/profile.mjs +1 -1
- package/dist/orchestrators/router/profile.mjs.map +1 -1
- package/dist/orchestrators/router/service.d.mts +2 -2
- package/dist/orchestrators/router/service.mjs +12 -27
- package/dist/orchestrators/router/service.mjs.map +1 -1
- package/dist/orchestrators/router/traefik-container.mjs +1 -1
- package/dist/orchestrators/router/traefik-container.mjs.map +1 -1
- package/dist/orchestrators/snapshot/capture.mjs +171 -195
- package/dist/orchestrators/snapshot/capture.mjs.map +1 -1
- package/dist/orchestrators/snapshot/descriptor.d.mts +1 -1
- package/dist/orchestrators/snapshot/descriptor.mjs +53 -11
- package/dist/orchestrators/snapshot/descriptor.mjs.map +1 -1
- package/dist/orchestrators/snapshot/identity-guard.mjs +3 -5
- package/dist/orchestrators/snapshot/identity-guard.mjs.map +1 -1
- package/dist/orchestrators/snapshot/image-bundle-tags.mjs +32 -101
- package/dist/orchestrators/snapshot/image-bundle-tags.mjs.map +1 -1
- package/dist/orchestrators/snapshot/index.mjs +1 -4
- package/dist/orchestrators/snapshot/integrity.mjs.map +1 -1
- package/dist/orchestrators/snapshot/interrupted-restore.mjs +116 -0
- package/dist/orchestrators/snapshot/interrupted-restore.mjs.map +1 -0
- package/dist/orchestrators/snapshot/phase-error.mjs.map +1 -1
- package/dist/orchestrators/snapshot/prune.mjs +40 -31
- package/dist/orchestrators/snapshot/prune.mjs.map +1 -1
- package/dist/orchestrators/snapshot/restore.mjs +221 -196
- package/dist/orchestrators/snapshot/restore.mjs.map +1 -1
- package/dist/orchestrators/snapshot/service.mjs +72 -62
- package/dist/orchestrators/snapshot/service.mjs.map +1 -1
- package/dist/orchestrators/snapshot/wipe.mjs +67 -56
- package/dist/orchestrators/snapshot/wipe.mjs.map +1 -1
- package/dist/plugins/account/codegen.mjs +3 -0
- package/dist/plugins/account/codegen.mjs.map +1 -1
- package/dist/plugins/account/errors.d.mts +2 -2
- package/dist/plugins/account/errors.mjs +1 -4
- package/dist/plugins/account/errors.mjs.map +1 -1
- package/dist/plugins/account/funding.mjs +3 -27
- package/dist/plugins/account/funding.mjs.map +1 -1
- package/dist/plugins/account/index.d.mts +3 -8
- package/dist/plugins/account/index.mjs +71 -35
- package/dist/plugins/account/index.mjs.map +1 -1
- package/dist/plugins/account/keypair.d.mts +8 -7
- package/dist/plugins/account/keypair.mjs +5 -18
- package/dist/plugins/account/keypair.mjs.map +1 -1
- package/dist/plugins/account/lease.mjs.map +1 -1
- package/dist/plugins/account/registry.d.mts +1 -46
- package/dist/plugins/account/registry.mjs.map +1 -1
- package/dist/plugins/account/service.d.mts +43 -34
- package/dist/plugins/account/service.mjs +9 -54
- package/dist/plugins/account/service.mjs.map +1 -1
- package/dist/plugins/account/snapshot.mjs.map +1 -1
- package/dist/plugins/account/variants/ephemeral.mjs.map +1 -1
- package/dist/plugins/account/variants/impersonate.mjs.map +1 -1
- package/dist/plugins/account/variants/signer.mjs.map +1 -1
- package/dist/plugins/action/discriminator.mjs.map +1 -1
- package/dist/plugins/action/errors.mjs +1 -4
- package/dist/plugins/action/errors.mjs.map +1 -1
- package/dist/plugins/action/execute.mjs +3 -4
- package/dist/plugins/action/execute.mjs.map +1 -1
- package/dist/plugins/action/index.d.mts +2 -2
- package/dist/plugins/action/index.mjs +7 -11
- package/dist/plugins/action/index.mjs.map +1 -1
- package/dist/plugins/action/service.d.mts +5 -7
- package/dist/plugins/action/service.mjs +2 -16
- package/dist/plugins/action/service.mjs.map +1 -1
- package/dist/plugins/coin/address-resolution.mjs.map +1 -1
- package/dist/plugins/coin/codegen.mjs +97 -16
- package/dist/plugins/coin/codegen.mjs.map +1 -1
- package/dist/plugins/coin/discovery.mjs.map +1 -1
- package/dist/plugins/coin/errors.mjs +1 -4
- package/dist/plugins/coin/errors.mjs.map +1 -1
- package/dist/plugins/coin/index.d.mts +4 -34
- package/dist/plugins/coin/index.mjs +47 -28
- package/dist/plugins/coin/index.mjs.map +1 -1
- package/dist/plugins/coin/metadata.d.mts +1 -0
- package/dist/plugins/coin/metadata.mjs +8 -9
- package/dist/plugins/coin/metadata.mjs.map +1 -1
- package/dist/plugins/coin/mint.mjs +7 -21
- package/dist/plugins/coin/mint.mjs.map +1 -1
- package/dist/plugins/coin/registry.mjs +33 -20
- package/dist/plugins/coin/registry.mjs.map +1 -1
- package/dist/plugins/coin/service.d.mts +1 -1
- package/dist/plugins/coin/service.mjs +1 -8
- package/dist/plugins/coin/service.mjs.map +1 -1
- package/dist/plugins/coin/snapshot.mjs.map +1 -1
- package/dist/plugins/coin/type-strings.mjs.map +1 -1
- package/dist/plugins/dashboard/domain.mjs +106 -167
- package/dist/plugins/dashboard/domain.mjs.map +1 -1
- package/dist/plugins/dashboard/index.mjs +13 -13
- package/dist/plugins/dashboard/index.mjs.map +1 -1
- package/dist/plugins/dashboard/origin-policy.mjs +3 -3
- package/dist/plugins/dashboard/origin-policy.mjs.map +1 -1
- package/dist/plugins/dashboard/routable.mjs.map +1 -1
- package/dist/plugins/dashboard/schema/builder.mjs.map +1 -1
- package/dist/plugins/dashboard/schema/enums.mjs.map +1 -1
- package/dist/plugins/dashboard/schema/root.mjs +23 -44
- package/dist/plugins/dashboard/schema/root.mjs.map +1 -1
- package/dist/plugins/dashboard/schema/types.mjs +37 -91
- package/dist/plugins/dashboard/schema/types.mjs.map +1 -1
- package/dist/plugins/dashboard/schema.mjs.map +1 -1
- package/dist/plugins/dashboard/server.mjs.map +1 -1
- package/dist/plugins/deepbook/codegen.d.mts +12 -11
- package/dist/plugins/deepbook/codegen.mjs +108 -11
- package/dist/plugins/deepbook/codegen.mjs.map +1 -1
- package/dist/plugins/deepbook/deploy.mjs +7 -14
- package/dist/plugins/deepbook/deploy.mjs.map +1 -1
- package/dist/plugins/deepbook/errors.mjs +4 -2
- package/dist/plugins/deepbook/errors.mjs.map +1 -1
- package/dist/plugins/deepbook/faucet-strategy.mjs +4 -10
- package/dist/plugins/deepbook/faucet-strategy.mjs.map +1 -1
- package/dist/plugins/deepbook/hash.mjs.map +1 -1
- package/dist/plugins/deepbook/index.d.mts +38 -34
- package/dist/plugins/deepbook/index.mjs +133 -64
- package/dist/plugins/deepbook/index.mjs.map +1 -1
- package/dist/plugins/deepbook/plugin-key.mjs.map +1 -1
- package/dist/plugins/deepbook/pyth/index.mjs +4 -8
- package/dist/plugins/deepbook/pyth/index.mjs.map +1 -1
- package/dist/plugins/deepbook/snapshot.mjs +0 -1
- package/dist/plugins/deepbook/snapshot.mjs.map +1 -1
- package/dist/plugins/deepbook/type-strings.mjs.map +1 -1
- package/dist/plugins/deepbook/types.d.mts +2 -1
- package/dist/plugins/deepbook/types.mjs.map +1 -1
- package/dist/plugins/faucet/dispatcher.d.mts +3 -3
- package/dist/plugins/faucet/dispatcher.mjs.map +1 -1
- package/dist/plugins/faucet/errors.mjs.map +1 -1
- package/dist/plugins/faucet/http.mjs +2 -10
- package/dist/plugins/faucet/http.mjs.map +1 -1
- package/dist/plugins/faucet/index.mjs +0 -1
- package/dist/plugins/faucet/index.mjs.map +1 -1
- package/dist/plugins/host-service/errors.d.mts +1 -3
- package/dist/plugins/host-service/errors.mjs +1 -2
- package/dist/plugins/host-service/errors.mjs.map +1 -1
- package/dist/plugins/host-service/index.d.mts +1 -2
- package/dist/plugins/host-service/index.mjs +11 -11
- package/dist/plugins/host-service/index.mjs.map +1 -1
- package/dist/plugins/host-service/routable.mjs.map +1 -1
- package/dist/plugins/host-service/service.mjs +13 -13
- package/dist/plugins/host-service/service.mjs.map +1 -1
- package/dist/plugins/internal/acquire-on-chain-artifact.mjs.map +1 -1
- package/dist/plugins/internal/codegen-helpers.mjs +2 -0
- package/dist/plugins/internal/codegen-helpers.mjs.map +1 -1
- package/dist/plugins/internal/funding-failure-error.mjs.map +1 -1
- package/dist/plugins/{postgres → internal/postgres-sidecar}/connection.mjs +1 -1
- package/dist/plugins/internal/postgres-sidecar/connection.mjs.map +1 -0
- package/dist/plugins/{postgres → internal/postgres-sidecar}/db-ensure.mjs +30 -16
- package/dist/plugins/internal/postgres-sidecar/db-ensure.mjs.map +1 -0
- package/dist/plugins/internal/postgres-sidecar/errors.mjs +21 -0
- package/dist/plugins/internal/postgres-sidecar/errors.mjs.map +1 -0
- package/dist/{substrate/runtime/scoped-multimap → plugins/internal/postgres-sidecar}/index.mjs +1 -0
- package/dist/plugins/internal/postgres-sidecar/service.mjs +121 -0
- package/dist/plugins/internal/postgres-sidecar/service.mjs.map +1 -0
- package/dist/plugins/package/build.mjs +2 -2
- package/dist/plugins/package/build.mjs.map +1 -1
- package/dist/plugins/package/codegen.d.mts +7 -14
- package/dist/plugins/package/codegen.mjs +187 -59
- package/dist/plugins/package/codegen.mjs.map +1 -1
- package/dist/plugins/package/dep-resolution.mjs +51 -3
- package/dist/plugins/package/dep-resolution.mjs.map +1 -1
- package/dist/plugins/package/errors.mjs +1 -4
- package/dist/plugins/package/errors.mjs.map +1 -1
- package/dist/plugins/package/git-source.d.mts +18 -0
- package/dist/plugins/package/git-source.mjs +119 -0
- package/dist/plugins/package/git-source.mjs.map +1 -0
- package/dist/plugins/package/index.d.mts +28 -19
- package/dist/plugins/package/index.mjs +107 -32
- package/dist/plugins/package/index.mjs.map +1 -1
- package/dist/plugins/package/mode-known.mjs +2 -2
- package/dist/plugins/package/mode-known.mjs.map +1 -1
- package/dist/plugins/package/mode-local.mjs +18 -35
- package/dist/plugins/package/mode-local.mjs.map +1 -1
- package/dist/plugins/package/publish-executor.mjs +13 -8
- package/dist/plugins/package/publish-executor.mjs.map +1 -1
- package/dist/plugins/package/publish-output.d.mts +1 -11
- package/dist/plugins/package/publish-output.mjs +1 -9
- package/dist/plugins/package/publish-output.mjs.map +1 -1
- package/dist/plugins/package/registry.d.mts +1 -1
- package/dist/plugins/package/registry.mjs +26 -14
- package/dist/plugins/package/registry.mjs.map +1 -1
- package/dist/plugins/package/service.mjs.map +1 -1
- package/dist/plugins/package/snapshot.mjs.map +1 -1
- package/dist/plugins/router-entrypoints.mjs +1 -3
- package/dist/plugins/router-entrypoints.mjs.map +1 -1
- package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs +1 -2
- package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs.map +1 -1
- package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs +1 -6
- package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs.map +1 -1
- package/dist/plugins/seal/codegen.d.mts +1 -5
- package/dist/plugins/seal/codegen.mjs +83 -12
- package/dist/plugins/seal/codegen.mjs.map +1 -1
- package/dist/plugins/seal/config-render.mjs +2 -6
- package/dist/plugins/seal/config-render.mjs.map +1 -1
- package/dist/plugins/seal/deploy.mjs +18 -29
- package/dist/plugins/seal/deploy.mjs.map +1 -1
- package/dist/plugins/seal/errors.d.mts +4 -5
- package/dist/plugins/seal/errors.mjs +1 -8
- package/dist/plugins/seal/errors.mjs.map +1 -1
- package/dist/plugins/seal/index.d.mts +7 -28
- package/dist/plugins/seal/index.mjs +69 -47
- package/dist/plugins/seal/index.mjs.map +1 -1
- package/dist/plugins/seal/key-manager.mjs.map +1 -1
- package/dist/plugins/seal/key-server.mjs +1 -6
- package/dist/plugins/seal/key-server.mjs.map +1 -1
- package/dist/plugins/seal/keygen.mjs +2 -3
- package/dist/plugins/seal/keygen.mjs.map +1 -1
- package/dist/plugins/seal/mode/fork-known.mjs.map +1 -1
- package/dist/plugins/seal/mode/live.mjs +1 -1
- package/dist/plugins/seal/mode/live.mjs.map +1 -1
- package/dist/plugins/seal/mode/local-keygen.mjs +4 -10
- package/dist/plugins/seal/mode/local-keygen.mjs.map +1 -1
- package/dist/plugins/seal/plugin-key.mjs.map +1 -1
- package/dist/plugins/seal/registry-publish.mjs.map +1 -1
- package/dist/plugins/seal/routable.mjs.map +1 -1
- package/dist/plugins/seal/service.mjs.map +1 -1
- package/dist/plugins/seal/snapshot.mjs +1 -2
- package/dist/plugins/seal/snapshot.mjs.map +1 -1
- package/dist/plugins/sui/auto-tick.mjs +5 -5
- package/dist/plugins/sui/auto-tick.mjs.map +1 -1
- package/dist/plugins/sui/chain-build-container.mjs +2 -2
- package/dist/plugins/sui/chain-build-container.mjs.map +1 -1
- package/dist/plugins/sui/chain-probe.mjs +4 -4
- package/dist/plugins/sui/chain-probe.mjs.map +1 -1
- package/dist/plugins/sui/codegen.d.mts +9 -7
- package/dist/plugins/sui/codegen.mjs +49 -46
- package/dist/plugins/sui/codegen.mjs.map +1 -1
- package/dist/plugins/sui/errors.d.mts +1 -1
- package/dist/plugins/sui/errors.mjs +1 -9
- package/dist/plugins/sui/errors.mjs.map +1 -1
- package/dist/{substrate/runtime/sui-execute → plugins/sui/exec}/index.d.mts +1 -1
- package/dist/{substrate/runtime/sui-execute → plugins/sui/exec}/index.mjs +3 -7
- package/dist/plugins/sui/exec/index.mjs.map +1 -0
- package/dist/{substrate/runtime/sui-execute → plugins/sui/exec}/sign-and-dispatch.mjs +1 -1
- package/dist/plugins/sui/exec/sign-and-dispatch.mjs.map +1 -0
- package/dist/plugins/sui/fork-faucet-strategy.mjs +2 -6
- package/dist/plugins/sui/fork-faucet-strategy.mjs.map +1 -1
- package/dist/plugins/sui/fork-orchestration.mjs +13 -23
- package/dist/plugins/sui/fork-orchestration.mjs.map +1 -1
- package/dist/plugins/sui/fork-transaction.mjs.map +1 -1
- package/dist/plugins/sui/index.d.mts +34 -83
- package/dist/plugins/sui/index.mjs +200 -68
- package/dist/plugins/sui/index.mjs.map +1 -1
- package/dist/{substrate/runtime/sui-ledger → plugins/sui/ledger}/object-ref.mjs +1 -1
- package/dist/plugins/sui/ledger/object-ref.mjs.map +1 -0
- package/dist/plugins/sui/local-faucet-strategy.mjs +1 -5
- package/dist/plugins/sui/local-faucet-strategy.mjs.map +1 -1
- package/dist/plugins/sui/log-attrs.mjs +11 -0
- package/dist/plugins/sui/log-attrs.mjs.map +1 -0
- package/dist/plugins/sui/mode/external.mjs +4 -12
- package/dist/plugins/sui/mode/external.mjs.map +1 -1
- package/dist/plugins/sui/mode/fork.mjs +19 -16
- package/dist/plugins/sui/mode/fork.mjs.map +1 -1
- package/dist/plugins/sui/mode/live.mjs +4 -17
- package/dist/plugins/sui/mode/live.mjs.map +1 -1
- package/dist/plugins/sui/mode/local.d.mts +1 -0
- package/dist/plugins/sui/mode/local.mjs +203 -61
- package/dist/plugins/sui/mode/local.mjs.map +1 -1
- package/dist/plugins/sui/mode/shared-boot.mjs +18 -23
- package/dist/plugins/sui/mode/shared-boot.mjs.map +1 -1
- package/dist/plugins/sui/mode/shared.d.mts +6 -7
- package/dist/plugins/sui/mode/shared.mjs.map +1 -1
- package/dist/plugins/sui/mode/spec.d.mts +23 -6
- package/dist/{substrate/runtime/sui-move-build → plugins/sui/move}/index.mjs +28 -30
- package/dist/plugins/sui/move/index.mjs.map +1 -0
- package/dist/plugins/sui/move-summary-runner.mjs +8 -4
- package/dist/plugins/sui/move-summary-runner.mjs.map +1 -1
- package/dist/{substrate/network.d.mts → plugins/sui/network-config.d.mts} +11 -10
- package/dist/plugins/sui/network-resolver.d.mts +6 -6
- package/dist/plugins/sui/routable.mjs.map +1 -1
- package/dist/plugins/sui/service.mjs +10 -6
- package/dist/plugins/sui/service.mjs.map +1 -1
- package/dist/plugins/sui/snapshot.mjs +10 -5
- package/dist/plugins/sui/snapshot.mjs.map +1 -1
- package/dist/plugins/wallet/codegen.d.mts +8 -6
- package/dist/plugins/wallet/codegen.mjs +4 -10
- package/dist/plugins/wallet/codegen.mjs.map +1 -1
- package/dist/plugins/wallet/errors.mjs +1 -4
- package/dist/plugins/wallet/errors.mjs.map +1 -1
- package/dist/plugins/wallet/index.d.mts +3 -6
- package/dist/plugins/wallet/index.mjs +16 -21
- package/dist/plugins/wallet/index.mjs.map +1 -1
- package/dist/plugins/wallet/origin-policy.mjs +3 -3
- package/dist/plugins/wallet/origin-policy.mjs.map +1 -1
- package/dist/plugins/wallet/pairing.mjs +6 -24
- package/dist/plugins/wallet/pairing.mjs.map +1 -1
- package/dist/plugins/wallet/protocol.mjs.map +1 -1
- package/dist/plugins/wallet/routable.mjs.map +1 -1
- package/dist/plugins/wallet/server.mjs +17 -24
- package/dist/plugins/wallet/server.mjs.map +1 -1
- package/dist/plugins/wallet/service.d.mts +2 -2
- package/dist/plugins/wallet/service.mjs +4 -15
- package/dist/plugins/wallet/service.mjs.map +1 -1
- package/dist/plugins/wallet/snapshot.mjs.map +1 -1
- package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs +1 -5
- package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs.map +1 -1
- package/dist/plugins/walrus/codegen.d.mts +2 -13
- package/dist/plugins/walrus/codegen.mjs +93 -28
- package/dist/plugins/walrus/codegen.mjs.map +1 -1
- package/dist/plugins/walrus/deploy-paths.mjs +2 -3
- package/dist/plugins/walrus/deploy-paths.mjs.map +1 -1
- package/dist/plugins/walrus/deploy.mjs +26 -19
- package/dist/plugins/walrus/deploy.mjs.map +1 -1
- package/dist/plugins/walrus/errors.mjs +1 -8
- package/dist/plugins/walrus/errors.mjs.map +1 -1
- package/dist/plugins/walrus/faucet-strategy.mjs +15 -1
- package/dist/plugins/walrus/faucet-strategy.mjs.map +1 -1
- package/dist/plugins/walrus/index.d.mts +13 -44
- package/dist/plugins/walrus/index.mjs +119 -122
- package/dist/plugins/walrus/index.mjs.map +1 -1
- package/dist/plugins/walrus/mode/known-deploy.mjs +6 -6
- package/dist/plugins/walrus/mode/known-deploy.mjs.map +1 -1
- package/dist/plugins/walrus/mode/local-cluster.d.mts +2 -2
- package/dist/plugins/walrus/mode/local-cluster.mjs +2 -10
- package/dist/plugins/walrus/mode/local-cluster.mjs.map +1 -1
- package/dist/plugins/walrus/plugin-key.mjs.map +1 -1
- package/dist/plugins/walrus/registry-publish.mjs.map +1 -1
- package/dist/plugins/walrus/routable.mjs.map +1 -1
- package/dist/plugins/walrus/service.mjs.map +1 -1
- package/dist/plugins/walrus/snapshot.mjs +3 -3
- package/dist/plugins/walrus/snapshot.mjs.map +1 -1
- package/dist/plugins/walrus/storage-nodes.mjs +53 -14
- package/dist/plugins/walrus/storage-nodes.mjs.map +1 -1
- package/dist/plugins/walrus/wal-swap.mjs +4 -8
- package/dist/plugins/walrus/wal-swap.mjs.map +1 -1
- package/dist/primitives/artifact-publisher.mjs.map +1 -1
- package/dist/primitives/cache.d.mts +1 -1
- package/dist/runtime/docker/client.mjs +47 -3
- package/dist/runtime/docker/client.mjs.map +1 -1
- package/dist/runtime/docker/container.mjs +37 -57
- package/dist/runtime/docker/container.mjs.map +1 -1
- package/dist/runtime/docker/errors.mjs.map +1 -1
- package/dist/runtime/docker/exec.mjs +2 -2
- package/dist/runtime/docker/exec.mjs.map +1 -1
- package/dist/runtime/docker/image.mjs +10 -11
- package/dist/runtime/docker/image.mjs.map +1 -1
- package/dist/runtime/docker/index.mjs +0 -1
- package/dist/runtime/docker/inspect-and-decode.mjs.map +1 -1
- package/dist/runtime/docker/inventory.mjs +9 -9
- package/dist/runtime/docker/inventory.mjs.map +1 -1
- package/dist/runtime/docker/labels.mjs +12 -1
- package/dist/runtime/docker/labels.mjs.map +1 -1
- package/dist/runtime/docker/network.mjs +6 -6
- package/dist/runtime/docker/network.mjs.map +1 -1
- package/dist/runtime/docker/render-run-args.mjs.map +1 -1
- package/dist/runtime/docker/service.mjs +31 -45
- package/dist/runtime/docker/service.mjs.map +1 -1
- package/dist/runtime/docker/sweep.mjs +14 -64
- package/dist/runtime/docker/sweep.mjs.map +1 -1
- package/dist/runtime/docker/volume.mjs +1 -1
- package/dist/runtime/docker/volume.mjs.map +1 -1
- package/dist/runtime/docker/wrap.mjs +14 -2
- package/dist/runtime/docker/wrap.mjs.map +1 -1
- package/dist/substrate/brand.d.mts +2 -5
- package/dist/substrate/brand.mjs +3 -2
- package/dist/substrate/brand.mjs.map +1 -1
- package/dist/substrate/cross-process.mjs +2 -16
- package/dist/substrate/cross-process.mjs.map +1 -1
- package/dist/substrate/event-time.mjs +0 -2
- package/dist/substrate/event-time.mjs.map +1 -1
- package/dist/substrate/events.d.mts +46 -16
- package/dist/substrate/identity.d.mts +11 -5
- package/dist/substrate/manifest.d.mts +33 -26
- package/dist/substrate/manifest.mjs +8 -3
- package/dist/substrate/manifest.mjs.map +1 -1
- package/dist/substrate/options.d.mts +33 -4
- package/dist/substrate/plugin-ctx.d.mts +70 -0
- package/dist/substrate/plugin-ctx.mjs +66 -0
- package/dist/substrate/plugin-ctx.mjs.map +1 -0
- package/dist/substrate/plugin.d.mts +46 -38
- package/dist/substrate/plugin.mjs +13 -9
- package/dist/substrate/plugin.mjs.map +1 -1
- package/dist/substrate/projection.d.mts +1 -1
- package/dist/substrate/runtime/atomic-write.mjs +3 -4
- package/dist/substrate/runtime/atomic-write.mjs.map +1 -1
- package/dist/substrate/runtime/cache/schema.mjs.map +1 -1
- package/dist/substrate/runtime/cache/service.mjs +50 -20
- package/dist/substrate/runtime/cache/service.mjs.map +1 -1
- package/dist/substrate/runtime/config-validation.mjs.map +1 -1
- package/dist/substrate/runtime/control-plane/domain.mjs +34 -12
- package/dist/substrate/runtime/control-plane/domain.mjs.map +1 -1
- package/dist/substrate/runtime/control-plane/service.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/command-channel/channel.mjs +14 -17
- package/dist/substrate/runtime/cross-process/command-channel/channel.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/command-channel/file-channel.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/command-channel/protocol.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/command-channel/runtime-control-lock.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/index.mjs +0 -2
- package/dist/substrate/runtime/cross-process/live-clock.mjs +1 -1
- package/dist/substrate/runtime/cross-process/live-clock.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/liveness.mjs +11 -18
- package/dist/substrate/runtime/cross-process/liveness.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/reclaim-stale-file.mjs +2 -2
- package/dist/substrate/runtime/cross-process/reclaim-stale-file.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/roster.mjs +17 -127
- package/dist/substrate/runtime/cross-process/roster.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/self-pid.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/stack-lock.mjs +29 -28
- package/dist/substrate/runtime/cross-process/stack-lock.mjs.map +1 -1
- package/dist/substrate/runtime/current-plugin.mjs.map +1 -1
- package/dist/substrate/runtime/errors.mjs +1 -13
- package/dist/substrate/runtime/errors.mjs.map +1 -1
- package/dist/substrate/runtime/format-unknown-error.mjs.map +1 -1
- package/dist/substrate/runtime/host-bind-mount-owner.mjs.map +1 -1
- package/dist/substrate/runtime/host-gateway.mjs.map +1 -1
- package/dist/substrate/runtime/host-tree-tar/index.mjs +15 -163
- package/dist/substrate/runtime/host-tree-tar/index.mjs.map +1 -1
- package/dist/substrate/runtime/http-probe.d.mts +1 -3
- package/dist/substrate/runtime/http-probe.mjs.map +1 -1
- package/dist/substrate/runtime/index.mjs +1 -6
- package/dist/substrate/runtime/lease-broker/service.mjs +5 -23
- package/dist/substrate/runtime/lease-broker/service.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/dep-graph.mjs +3 -3
- package/dist/substrate/runtime/lifecycle/dep-graph.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/graph-input-id.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/graph-input-id.mjs +133 -0
- package/dist/substrate/runtime/lifecycle/graph-input-id.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/index.mjs +2 -2
- package/dist/substrate/runtime/lifecycle/plugin-registry.d.mts +1 -1
- package/dist/substrate/runtime/lifecycle/plugin-registry.mjs +22 -1
- package/dist/substrate/runtime/lifecycle/plugin-registry.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/ready-gate.mjs +2 -15
- package/dist/substrate/runtime/lifecycle/ready-gate.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/selective-restart.mjs +29 -25
- package/dist/substrate/runtime/lifecycle/selective-restart.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/signals.mjs +1 -1
- package/dist/substrate/runtime/lifecycle/signals.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/state-machine.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/watch-attribution.d.mts +1 -1
- package/dist/substrate/runtime/lifecycle/watch-attribution.mjs +0 -1
- package/dist/substrate/runtime/lifecycle/watch-attribution.mjs.map +1 -1
- package/dist/substrate/runtime/managed-container.d.mts +5 -1
- package/dist/substrate/runtime/managed-container.mjs +8 -10
- package/dist/substrate/runtime/managed-container.mjs.map +1 -1
- package/dist/substrate/runtime/manifest/manifest.mjs +8 -30
- package/dist/substrate/runtime/manifest/manifest.mjs.map +1 -1
- package/dist/substrate/runtime/mode-errors.d.mts +1 -2
- package/dist/substrate/runtime/mode-errors.mjs.map +1 -1
- package/dist/substrate/runtime/observability/cascade-formatter.mjs +1 -11
- package/dist/substrate/runtime/observability/cascade-formatter.mjs.map +1 -1
- package/dist/substrate/runtime/observability/ignore-with-log.mjs.map +1 -1
- package/dist/substrate/runtime/observability/index.d.mts +1 -1
- package/dist/substrate/runtime/observability/index.mjs +4 -6
- package/dist/substrate/runtime/observability/log-attrs.mjs +46 -0
- package/dist/substrate/runtime/observability/log-attrs.mjs.map +1 -0
- package/dist/substrate/runtime/observability/log-store.mjs.map +1 -1
- package/dist/substrate/runtime/observability/logger.mjs +3 -3
- package/dist/substrate/runtime/observability/logger.mjs.map +1 -1
- package/dist/substrate/runtime/observability/output-truncate.mjs.map +1 -1
- package/dist/substrate/runtime/observability/pretty-error.mjs.map +1 -1
- package/dist/substrate/runtime/observability/process-lines.mjs.map +1 -1
- package/dist/substrate/runtime/observability/redaction.mjs.map +1 -1
- package/dist/substrate/runtime/observability/subprocess-capture.mjs +2 -2
- package/dist/substrate/runtime/observability/subprocess-capture.mjs.map +1 -1
- package/dist/substrate/runtime/passthrough-or-wrap.mjs.map +1 -1
- package/dist/substrate/runtime/paths.mjs +27 -9
- package/dist/substrate/runtime/paths.mjs.map +1 -1
- package/dist/substrate/runtime/phase-preserving-produce.mjs.map +1 -1
- package/dist/substrate/runtime/port-broker/service.mjs +10 -27
- package/dist/substrate/runtime/port-broker/service.mjs.map +1 -1
- package/dist/substrate/runtime/post-acquire-tasks.mjs.map +1 -1
- package/dist/substrate/runtime/probes.d.mts +2 -3
- package/dist/substrate/runtime/probes.mjs.map +1 -1
- package/dist/substrate/runtime/process-supervisor.mjs.map +1 -1
- package/dist/substrate/runtime/projection/operational-endpoints.mjs.map +1 -1
- package/dist/substrate/runtime/projection/state-ref.mjs.map +1 -1
- package/dist/substrate/runtime/projection/update.mjs +87 -11
- package/dist/substrate/runtime/projection/update.mjs.map +1 -1
- package/dist/substrate/runtime/random-suffix.mjs.map +1 -1
- package/dist/substrate/runtime/reconcile/fs-plan.mjs +146 -0
- package/dist/substrate/runtime/reconcile/fs-plan.mjs.map +1 -0
- package/dist/substrate/runtime/reconcile/graph.mjs +19 -0
- package/dist/substrate/runtime/reconcile/graph.mjs.map +1 -0
- package/dist/substrate/runtime/reconcile/index.mjs +5 -0
- package/dist/substrate/runtime/reconcile/label.mjs +41 -0
- package/dist/substrate/runtime/reconcile/label.mjs.map +1 -0
- package/dist/substrate/runtime/reconcile/spec.mjs +15 -0
- package/dist/substrate/runtime/reconcile/spec.mjs.map +1 -0
- package/dist/substrate/runtime/retry-policy.d.mts +2 -3
- package/dist/substrate/runtime/retry-policy.mjs.map +1 -1
- package/dist/substrate/runtime/routed-url.mjs.map +1 -1
- package/dist/substrate/runtime/runtime-decode.mjs.map +1 -1
- package/dist/substrate/runtime/scoped-http-server.mjs.map +1 -1
- package/dist/substrate/runtime/stage-and-swap/index.mjs +49 -12
- package/dist/substrate/runtime/stage-and-swap/index.mjs.map +1 -1
- package/dist/substrate/runtime/strategy-registry/chain-keyed-strategy-for.mjs.map +1 -1
- package/dist/substrate/runtime/strategy-registry/chain-probe-for.mjs.map +1 -1
- package/dist/substrate/runtime/strategy-registry/service.mjs +29 -17
- package/dist/substrate/runtime/strategy-registry/service.mjs.map +1 -1
- package/dist/substrate/runtime/subnet-broker.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/acquire-node.mjs +188 -56
- package/dist/substrate/runtime/supervisor/acquire-node.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/background-tasks.mjs +79 -65
- package/dist/substrate/runtime/supervisor/background-tasks.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/command-loop.mjs +82 -23
- package/dist/substrate/runtime/supervisor/command-loop.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/contribution-dispatcher.mjs +16 -0
- package/dist/substrate/runtime/supervisor/contribution-dispatcher.mjs.map +1 -0
- package/dist/substrate/runtime/supervisor/errors.mjs +11 -2
- package/dist/substrate/runtime/supervisor/errors.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/index.mjs +2 -0
- package/dist/substrate/runtime/supervisor/shutdown.mjs +6 -6
- package/dist/substrate/runtime/supervisor/shutdown.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/start-supervisor.mjs +60 -70
- package/dist/substrate/runtime/supervisor/start-supervisor.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/state.d.mts +1 -1
- package/dist/substrate/runtime/supervisor/state.mjs +1 -1
- package/dist/substrate/runtime/supervisor/state.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/teardown.mjs +10 -9
- package/dist/substrate/runtime/supervisor/teardown.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/wiring.mjs +6 -20
- package/dist/substrate/runtime/supervisor/wiring.mjs.map +1 -1
- package/dist/substrate/runtime/tar/reader.mjs +216 -0
- package/dist/substrate/runtime/tar/reader.mjs.map +1 -0
- package/dist/substrate/runtime/typed-env.mjs.map +1 -1
- package/dist/substrate/versioned-doc-schema.mjs.map +1 -1
- package/dist/substrate/versioned-doc-sync.mjs +5 -5
- package/dist/substrate/versioned-doc-sync.mjs.map +1 -1
- package/dist/surfaces/cli/command-tree.mjs +49 -7
- package/dist/surfaces/cli/command-tree.mjs.map +1 -1
- package/dist/surfaces/cli/commands/config.mjs +1 -1
- package/dist/surfaces/cli/commands/config.mjs.map +1 -1
- package/dist/surfaces/cli/commands/confirm-node.mjs.map +1 -1
- package/dist/surfaces/cli/commands/confirm.mjs.map +1 -1
- package/dist/surfaces/cli/commands/doctor.mjs +1 -1
- package/dist/surfaces/cli/commands/doctor.mjs.map +1 -1
- package/dist/surfaces/cli/commands/prune-picker-entry.mjs.map +1 -1
- package/dist/surfaces/cli/commands/prune-picker.mjs.map +1 -1
- package/dist/surfaces/cli/commands/prune.mjs +1 -1
- package/dist/surfaces/cli/commands/prune.mjs.map +1 -1
- package/dist/surfaces/cli/commands/snapshot.mjs +1 -1
- package/dist/surfaces/cli/commands/snapshot.mjs.map +1 -1
- package/dist/surfaces/cli/commands/status.mjs +1 -1
- package/dist/surfaces/cli/commands/status.mjs.map +1 -1
- package/dist/surfaces/cli/commands/supervisor-presence.mjs.map +1 -1
- package/dist/surfaces/cli/commands/wipe.mjs +3 -4
- package/dist/surfaces/cli/commands/wipe.mjs.map +1 -1
- package/dist/surfaces/cli/envelope.mjs.map +1 -1
- package/dist/surfaces/cli/errors.mjs.map +1 -1
- package/dist/surfaces/cli/flags.mjs.map +1 -1
- package/dist/surfaces/cli/index.mjs +45 -14
- package/dist/surfaces/cli/index.mjs.map +1 -1
- package/dist/surfaces/cli/output.mjs.map +1 -1
- package/dist/surfaces/cli/sysexits.mjs.map +1 -1
- package/dist/surfaces/tui/app.mjs +0 -21
- package/dist/surfaces/tui/app.mjs.map +1 -1
- package/dist/surfaces/tui/dashboard.mjs +0 -48
- package/dist/surfaces/tui/dashboard.mjs.map +1 -1
- package/dist/surfaces/tui/display-derivation.mjs +80 -16
- package/dist/surfaces/tui/display-derivation.mjs.map +1 -1
- package/dist/surfaces/tui/errors.mjs.map +1 -1
- package/dist/surfaces/tui/event-log.mjs +0 -9
- package/dist/surfaces/tui/event-log.mjs.map +1 -1
- package/dist/surfaces/tui/heartbeat.mjs.map +1 -1
- package/dist/surfaces/tui/index.mjs +2 -2
- package/dist/surfaces/tui/index.mjs.map +1 -1
- package/dist/surfaces/tui/input.mjs.map +1 -1
- package/dist/surfaces/tui/mode-detect.mjs.map +1 -1
- package/dist/surfaces/tui/mount-ink.mjs.map +1 -1
- package/dist/surfaces/tui/plain-renderer.mjs +26 -19
- package/dist/surfaces/tui/plain-renderer.mjs.map +1 -1
- package/dist/surfaces/tui/resource-table.mjs +8 -10
- package/dist/surfaces/tui/resource-table.mjs.map +1 -1
- package/images/postgres/Dockerfile +0 -1
- package/images/sui/Dockerfile +27 -54
- package/images/sui/entrypoint.sh +17 -179
- package/package.json +23 -15
- package/dashboard-ui/assets/index-Bmi1UtAg.js +0 -1356
- package/dashboard-ui/assets/index-D5EShVt4.js +0 -3
- package/dashboard-ui/assets/index-Deml9drg.css +0 -1
- package/dist/api/plugin-errors.d.mts +0 -7
- package/dist/api/plugin-errors.mjs +0 -10
- package/dist/api/plugin-errors.mjs.map +0 -1
- package/dist/cli/wirings/build-verb-layers.mjs +0 -42
- package/dist/cli/wirings/build-verb-layers.mjs.map +0 -1
- package/dist/contracts/capability-decl.d.mts +0 -40
- package/dist/orchestrators/built-in-plugin-layers.mjs +0 -54
- package/dist/orchestrators/built-in-plugin-layers.mjs.map +0 -1
- package/dist/orchestrators/run.mjs +0 -91
- package/dist/orchestrators/run.mjs.map +0 -1
- package/dist/orchestrators/runtime-composition.d.mts +0 -10
- package/dist/orchestrators/runtime-composition.mjs +0 -252
- package/dist/orchestrators/runtime-composition.mjs.map +0 -1
- package/dist/orchestrators/snapshot/capture-command.d.mts +0 -1
- package/dist/orchestrators/snapshot/capture-command.mjs +0 -25
- package/dist/orchestrators/snapshot/capture-command.mjs.map +0 -1
- package/dist/orchestrators/snapshot/pending-marker.mjs +0 -99
- package/dist/orchestrators/snapshot/pending-marker.mjs.map +0 -1
- package/dist/orchestrators/snapshot/recover-pending.mjs +0 -223
- package/dist/orchestrators/snapshot/recover-pending.mjs.map +0 -1
- package/dist/orchestrators/snapshot/state-document.d.mts +0 -1
- package/dist/orchestrators/snapshot/state-document.mjs +0 -58
- package/dist/orchestrators/snapshot/state-document.mjs.map +0 -1
- package/dist/plugins/account/spans.mjs +0 -16
- package/dist/plugins/account/spans.mjs.map +0 -1
- package/dist/plugins/account/variants/env.mjs +0 -24
- package/dist/plugins/account/variants/env.mjs.map +0 -1
- package/dist/plugins/account/variants/inline.mjs +0 -13
- package/dist/plugins/account/variants/inline.mjs.map +0 -1
- package/dist/plugins/account/variants/keystore.mjs +0 -91
- package/dist/plugins/account/variants/keystore.mjs.map +0 -1
- package/dist/plugins/action/spans.mjs +0 -11
- package/dist/plugins/action/spans.mjs.map +0 -1
- package/dist/plugins/coin/spans.mjs +0 -20
- package/dist/plugins/coin/spans.mjs.map +0 -1
- package/dist/plugins/deepbook/spans.mjs +0 -18
- package/dist/plugins/deepbook/spans.mjs.map +0 -1
- package/dist/plugins/faucet/spans.mjs +0 -12
- package/dist/plugins/faucet/spans.mjs.map +0 -1
- package/dist/plugins/package/spans.mjs +0 -14
- package/dist/plugins/package/spans.mjs.map +0 -1
- package/dist/plugins/postgres/codegen.mjs +0 -42
- package/dist/plugins/postgres/codegen.mjs.map +0 -1
- package/dist/plugins/postgres/connection.d.mts +0 -33
- package/dist/plugins/postgres/connection.mjs.map +0 -1
- package/dist/plugins/postgres/db-ensure.mjs.map +0 -1
- package/dist/plugins/postgres/errors.d.mts +0 -60
- package/dist/plugins/postgres/errors.mjs +0 -29
- package/dist/plugins/postgres/errors.mjs.map +0 -1
- package/dist/plugins/postgres/index.d.mts +0 -37
- package/dist/plugins/postgres/index.mjs +0 -68
- package/dist/plugins/postgres/index.mjs.map +0 -1
- package/dist/plugins/postgres/routable.mjs +0 -33
- package/dist/plugins/postgres/routable.mjs.map +0 -1
- package/dist/plugins/postgres/service.d.mts +0 -50
- package/dist/plugins/postgres/service.mjs +0 -179
- package/dist/plugins/postgres/service.mjs.map +0 -1
- package/dist/plugins/postgres/snapshot.mjs +0 -32
- package/dist/plugins/postgres/snapshot.mjs.map +0 -1
- package/dist/plugins/postgres/spans.mjs +0 -11
- package/dist/plugins/postgres/spans.mjs.map +0 -1
- package/dist/plugins/seal/spans.mjs +0 -18
- package/dist/plugins/seal/spans.mjs.map +0 -1
- package/dist/plugins/sui/spans.mjs +0 -17
- package/dist/plugins/sui/spans.mjs.map +0 -1
- package/dist/plugins/wallet/spans.mjs +0 -22
- package/dist/plugins/wallet/spans.mjs.map +0 -1
- package/dist/plugins/walrus/registry-publish.d.mts +0 -24
- package/dist/plugins/walrus/spans.mjs +0 -18
- package/dist/plugins/walrus/spans.mjs.map +0 -1
- package/dist/runtime/docker/logs.d.mts +0 -1
- package/dist/runtime/docker/logs.mjs +0 -34
- package/dist/runtime/docker/logs.mjs.map +0 -1
- package/dist/substrate/runtime/artifact-publisher/index.mjs +0 -86
- package/dist/substrate/runtime/artifact-publisher/index.mjs.map +0 -1
- package/dist/substrate/runtime/capability-sinks/index.d.mts +0 -1
- package/dist/substrate/runtime/capability-sinks/index.mjs +0 -3
- package/dist/substrate/runtime/capability-sinks/layer.d.mts +0 -1
- package/dist/substrate/runtime/capability-sinks/layer.mjs +0 -31
- package/dist/substrate/runtime/capability-sinks/layer.mjs.map +0 -1
- package/dist/substrate/runtime/capability-sinks/service.d.mts +0 -95
- package/dist/substrate/runtime/capability-sinks/service.mjs +0 -69
- package/dist/substrate/runtime/capability-sinks/service.mjs.map +0 -1
- package/dist/substrate/runtime/cross-process/lock.d.mts +0 -1
- package/dist/substrate/runtime/cross-process/lock.mjs +0 -23
- package/dist/substrate/runtime/cross-process/lock.mjs.map +0 -1
- package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs +0 -113
- package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs.map +0 -1
- package/dist/substrate/runtime/lifecycle/lifecycle-fact.mjs +0 -31
- package/dist/substrate/runtime/lifecycle/lifecycle-fact.mjs.map +0 -1
- package/dist/substrate/runtime/observability/formatter-registry.d.mts +0 -1
- package/dist/substrate/runtime/observability/formatter-registry.mjs +0 -48
- package/dist/substrate/runtime/observability/formatter-registry.mjs.map +0 -1
- package/dist/substrate/runtime/observability/span-store.d.mts +0 -1
- package/dist/substrate/runtime/observability/span-store.mjs +0 -110
- package/dist/substrate/runtime/observability/span-store.mjs.map +0 -1
- package/dist/substrate/runtime/observability/spans.d.mts +0 -1
- package/dist/substrate/runtime/observability/spans.mjs +0 -87
- package/dist/substrate/runtime/observability/spans.mjs.map +0 -1
- package/dist/substrate/runtime/projection/index.mjs +0 -4
- package/dist/substrate/runtime/projection/persisted.mjs +0 -213
- package/dist/substrate/runtime/projection/persisted.mjs.map +0 -1
- package/dist/substrate/runtime/scoped-multimap/service.mjs +0 -52
- package/dist/substrate/runtime/scoped-multimap/service.mjs.map +0 -1
- package/dist/substrate/runtime/scoped-ref-map/index.mjs +0 -2
- package/dist/substrate/runtime/scoped-ref-map/service.mjs +0 -83
- package/dist/substrate/runtime/scoped-ref-map/service.mjs.map +0 -1
- package/dist/substrate/runtime/state-store/index.mjs +0 -3
- package/dist/substrate/runtime/state-store/schema.d.mts +0 -1
- package/dist/substrate/runtime/state-store/schema.mjs +0 -41
- package/dist/substrate/runtime/state-store/schema.mjs.map +0 -1
- package/dist/substrate/runtime/state-store/service.d.mts +0 -1
- package/dist/substrate/runtime/state-store/service.mjs +0 -145
- package/dist/substrate/runtime/state-store/service.mjs.map +0 -1
- package/dist/substrate/runtime/sui-execute/index.mjs.map +0 -1
- package/dist/substrate/runtime/sui-execute/sign-and-dispatch.mjs.map +0 -1
- package/dist/substrate/runtime/sui-ledger/object-ref.mjs.map +0 -1
- package/dist/substrate/runtime/sui-move-build/index.mjs.map +0 -1
- package/dist/substrate/runtime/supervisor/dispatch-contributions.mjs +0 -151
- package/dist/substrate/runtime/supervisor/dispatch-contributions.mjs.map +0 -1
- package/dist/substrate/state-store.d.mts +0 -1
- /package/dist/orchestrators/{snapshot/pending-marker.d.mts → codegen/id-config.d.mts} +0 -0
- /package/dist/orchestrators/snapshot/{recover-pending.d.mts → interrupted-restore.d.mts} +0 -0
- /package/dist/{substrate/runtime/sui-execute → plugins/sui/exec}/sign-and-dispatch.d.mts +0 -0
- /package/dist/plugins/{postgres/snapshot.d.mts → sui/ledger/object-ref.d.mts} +0 -0
- /package/dist/{substrate/runtime/sui-move-build → plugins/sui/move}/index.d.mts +0 -0
- /package/dist/substrate/runtime/{state-store/index.d.mts → reconcile/graph.d.mts} +0 -0
- /package/dist/substrate/runtime/{cross-process/snapshot-reservation.d.mts → supervisor/contribution-dispatcher.d.mts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply.mjs","names":["resolvePath"],"sources":["../../../src/cli/wirings/apply.ts"],"sourcesContent":["// `devstack apply` verb wiring.\n//\n// Live-aware: if a supervisor owns the selected stack, publish an\n// `apply.requested` command and await its ack. Otherwise run a\n// one-shot supervise that exits when all plugins are ready.\n//\n// Logger layer: `Logger.consolePretty()`. `apply` is the documented\n// one-shot mode (no TUI) — its consumers are CI logs and ad-hoc\n// operator runs that read raw stderr. Structured `Effect.log*` records\n// are the only operator-visible diagnostic for non-TUI surfaces, so we\n// route them through the pretty console layer. The sibling `up` verb\n// silences this layer (see `wirings/up.ts` header) because it owns the\n// TUI and would render duplicate / scrambled output otherwise.\n\nimport { dirname, resolve as resolvePath } from 'node:path';\n\nimport { Cause, Effect, Exit, Logger, SubscriptionRef } from 'effect';\n\nimport type { Identity } from '../../substrate/identity.ts';\nimport { StackPathsService } from '../../substrate/runtime/paths.ts';\nimport {\n\tcommandChannelPaths,\n\tmakeCommandChannelPublisher,\n\tmakeProjectionRef,\n\ttype SupervisedStack,\n\twriteProjectionSnapshot,\n} from '../../substrate/runtime/index.ts';\nimport { superviseStackEffect } from '../../orchestrators/run.ts';\nimport {\n\tbuildProductionOrchestratorSinks,\n\tbuildProductionPostAcquireHook,\n} from '../../orchestrators/runtime-composition.ts';\nimport {\n\textendBuiltInPluginContext,\n\tlayerBuiltInPluginRuntime,\n} from '../../orchestrators/built-in-plugin-layers.ts';\nimport { SnapshotOrchestratorService } from '../../orchestrators/snapshot/index.ts';\nimport { type CliError, CliInternalError } from '../../surfaces/cli/errors.ts';\nimport { type CommandResult, probeSupervisorPresence } from '../../surfaces/cli/commands/index.ts';\nimport { ExitCode } from '../../surfaces/cli/sysexits.ts';\nimport type { LoadedConfig } from '../../surfaces/cli/commands/config-loader.ts';\n\nimport { cliErrorFromConfigExit } from '../bail.ts';\nimport { makeConfigLoader } from './config-loader.ts';\nimport {\n\tidentityValueFor,\n\tresolvedIdentityForStack,\n\tstackRootFor,\n\ttype ResolvedIdentity,\n} from './identity.ts';\nimport { buildVerbLayers } from './build-verb-layers.ts';\n\nconst LIVE_APPLY_ACK_TIMEOUT_MILLIS = 10 * 60 * 1000;\n\n/** Outcome of the live-supervisor probe + dispatch:\n * - `kind: 'direct'` — no supervisor; caller runs the direct path.\n * - `kind: 'live-ok'` — live supervisor acked; verb is done.\n * - `kind: 'live-failed'` — live supervisor refused/timed-out; caller\n * surfaces the typed `CliError` via the dispatcher envelope. */\ntype ApplyDispatch =\n\t| { readonly kind: 'direct' }\n\t| { readonly kind: 'live-ok' }\n\t| { readonly kind: 'live-failed'; readonly error: CliError };\n\n/** Probe the roster file; if a supervisor is live, publish\n * `apply.requested` and await its ack. */\nconst runApplyAgainstLiveSupervisor = (\n\tidentity: ResolvedIdentity,\n\tidentityValue: Identity,\n): Effect.Effect<ApplyDispatch> =>\n\tEffect.gen(function* () {\n\t\tconst stackRoot = stackRootFor(identity.runtimeRoot, String(identityValue.stack));\n\t\tconst presence = yield* probeSupervisorPresence(resolvePath(stackRoot, 'roster.json')).pipe(\n\t\t\tEffect.catch(() => Effect.succeed({ live: false, pid: null, hostname: null })),\n\t\t);\n\t\tif (!presence.live) return { kind: 'direct' as const };\n\n\t\tconst exit = yield* Effect.exit(\n\t\t\tEffect.gen(function* () {\n\t\t\t\tconst publisher = yield* makeCommandChannelPublisher(commandChannelPaths(stackRoot));\n\t\t\t\tconst published = yield* publisher.publish({ tag: 'apply.requested' });\n\t\t\t\tconst reply = yield* publisher.awaitCompletion(published, {\n\t\t\t\t\ttimeoutMillis: LIVE_APPLY_ACK_TIMEOUT_MILLIS,\n\t\t\t\t});\n\t\t\t\tif (!reply.ok) {\n\t\t\t\t\treturn yield* Effect.fail(reply.message);\n\t\t\t\t}\n\t\t\t}),\n\t\t);\n\n\t\tif (Exit.isFailure(exit)) {\n\t\t\treturn {\n\t\t\t\tkind: 'live-failed' as const,\n\t\t\t\terror: new CliInternalError({\n\t\t\t\t\tmessage: 'live stack apply failed',\n\t\t\t\t\tcause: Cause.pretty(exit.cause as Cause.Cause<unknown>),\n\t\t\t\t}),\n\t\t\t};\n\t\t}\n\n\t\treturn { kind: 'live-ok' as const };\n\t});\n\nexport const runApplyLive = (\n\tconfigPath: string | undefined,\n\tidentity: ResolvedIdentity,\n): Effect.Effect<CommandResult, CliError> => {\n\tconst loader = makeConfigLoader();\n\treturn Effect.gen(function* () {\n\t\t// Config-load failures surface as typed `CliError`s; the\n\t\t// dispatcher's outer `emitFailure` renders the envelope.\n\t\tconst loadExit = yield* Effect.exit(loader.load(configPath));\n\t\tif (Exit.isFailure(loadExit)) {\n\t\t\treturn yield* Effect.fail(cliErrorFromConfigExit(loadExit));\n\t\t}\n\t\tconst loaded = loadExit.value;\n\t\tconst stack = (loaded as LoadedConfig & { readonly stack: SupervisedStack }).stack;\n\t\t// Re-derive the identity against the EFFECTIVE stack (explicit\n\t\t// `--stack`/`$DEVSTACK_STACK` > `config.stackName` > inferred) so\n\t\t// the live-supervisor probe + roster paths target the same stack\n\t\t// the operator selected — matching `snapshot.ts`. An explicit\n\t\t// `--stack` must NOT be overridden by `config.stackName`, otherwise\n\t\t// `apply` would probe/boot the wrong stack's supervisor.\n\t\tconst effectiveIdentity = resolvedIdentityForStack(identity, stack);\n\t\tconst identityValue: Identity = identityValueFor(effectiveIdentity);\n\t\tconst dispatch = yield* runApplyAgainstLiveSupervisor(effectiveIdentity, identityValue);\n\t\tif (dispatch.kind === 'live-failed') {\n\t\t\treturn yield* Effect.fail(dispatch.error);\n\t\t}\n\t\tif (dispatch.kind === 'live-ok') {\n\t\t\treturn { exitCode: ExitCode.OK };\n\t\t}\n\t\tconst appRoot = dirname(loaded.resolvedConfigPath);\n\t\tconst substrateLayers = buildVerbLayers({\n\t\t\tidentity: identityValue,\n\t\t\tstack,\n\t\t\tappRoot,\n\t\t\truntimeRoot: effectiveIdentity.runtimeRoot,\n\t\t});\n\n\t\tconst program = Effect.gen(function* () {\n\t\t\tconst state = yield* makeProjectionRef();\n\t\t\tconst orchestratorSinks = yield* buildProductionOrchestratorSinks();\n\t\t\tconst postAcquireHook = yield* buildProductionPostAcquireHook({\n\t\t\t\textras: stack.options.extras,\n\t\t\t});\n\t\t\t// Mirror the up-path recovery: reconcile any half-promoted\n\t\t\t// snapshot restore from a prior supervise BEFORE the one-shot\n\t\t\t// apply starts the stack. Idempotent + no-op when no marker.\n\t\t\tconst snapshot = yield* SnapshotOrchestratorService;\n\t\t\tyield* snapshot.recoverPendingRestore.pipe(\n\t\t\t\tEffect.tapCause((cause) =>\n\t\t\t\t\tEffect.sync(() => {\n\t\t\t\t\t\tprocess.stderr.write(\n\t\t\t\t\t\t\t`snapshot recovery scan failed: ${Cause.pretty(cause as Cause.Cause<unknown>)}\\n`,\n\t\t\t\t\t\t);\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t\tEffect.catch(() => Effect.succeed(null)),\n\t\t\t);\n\t\t\tyield* superviseStackEffect(\n\t\t\t\t{ _tag: 'Stack', members: stack.members, options: stack.options },\n\t\t\t\tidentityValue,\n\t\t\t\tstate,\n\t\t\t\t{\n\t\t\t\t\torchestratorSinks,\n\t\t\t\t\tpostAcquireHook,\n\t\t\t\t\tlifetime: 'one-shot',\n\t\t\t\t\textendContext: extendBuiltInPluginContext,\n\t\t\t\t},\n\t\t\t).pipe(Effect.provide(layerBuiltInPluginRuntime(orchestratorSinks)));\n\t\t\tconst stackPaths = yield* StackPathsService;\n\t\t\tyield* writeProjectionSnapshot(stackPaths.stackRoot, yield* SubscriptionRef.get(state));\n\t\t});\n\n\t\treturn yield* program.pipe(\n\t\t\tEffect.provide(substrateLayers),\n\t\t\tEffect.provide(Logger.layer([Logger.consolePretty()])),\n\t\t\tEffect.matchCauseEffect({\n\t\t\t\tonFailure: (cause): Effect.Effect<CommandResult, CliError> =>\n\t\t\t\t\tEffect.fail(\n\t\t\t\t\t\tnew CliInternalError({\n\t\t\t\t\t\t\tmessage: 'stack apply failed',\n\t\t\t\t\t\t\tcause: Cause.pretty(cause as Cause.Cause<unknown>),\n\t\t\t\t\t\t}),\n\t\t\t\t\t),\n\t\t\t\tonSuccess: (): Effect.Effect<CommandResult, CliError> =>\n\t\t\t\t\tEffect.succeed({ exitCode: ExitCode.OK }),\n\t\t\t}),\n\t\t);\n\t});\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAoDA,MAAM,gCAAgC,MAAU;;;AAchD,MAAM,iCACL,UACA,kBAEA,OAAO,IAAI,aAAa;CACvB,MAAM,YAAY,aAAa,SAAS,aAAa,OAAO,cAAc,MAAM,CAAC;AAIjF,KAAI,EAAC,OAHmB,wBAAwBA,QAAY,WAAW,cAAc,CAAC,CAAC,KACtF,OAAO,YAAY,OAAO,QAAQ;EAAE,MAAM;EAAO,KAAK;EAAM,UAAU;EAAM,CAAC,CAAC,CAC9E,EACa,KAAM,QAAO,EAAE,MAAM,UAAmB;CAEtD,MAAM,OAAO,OAAO,OAAO,KAC1B,OAAO,IAAI,aAAa;EACvB,MAAM,YAAY,OAAO,4BAA4B,oBAAoB,UAAU,CAAC;EACpF,MAAM,YAAY,OAAO,UAAU,QAAQ,EAAE,KAAK,mBAAmB,CAAC;EACtE,MAAM,QAAQ,OAAO,UAAU,gBAAgB,WAAW,EACzD,eAAe,+BACf,CAAC;AACF,MAAI,CAAC,MAAM,GACV,QAAO,OAAO,OAAO,KAAK,MAAM,QAAQ;GAExC,CACF;AAED,KAAI,KAAK,UAAU,KAAK,CACvB,QAAO;EACN,MAAM;EACN,OAAO,IAAI,iBAAiB;GAC3B,SAAS;GACT,OAAO,MAAM,OAAO,KAAK,MAA8B;GACvD,CAAC;EACF;AAGF,QAAO,EAAE,MAAM,WAAoB;EAClC;AAEH,MAAa,gBACZ,YACA,aAC4C;CAC5C,MAAM,SAAS,kBAAkB;AACjC,QAAO,OAAO,IAAI,aAAa;EAG9B,MAAM,WAAW,OAAO,OAAO,KAAK,OAAO,KAAK,WAAW,CAAC;AAC5D,MAAI,KAAK,UAAU,SAAS,CAC3B,QAAO,OAAO,OAAO,KAAK,uBAAuB,SAAS,CAAC;EAE5D,MAAM,SAAS,SAAS;EACxB,MAAM,QAAS,OAA8D;EAO7E,MAAM,oBAAoB,yBAAyB,UAAU,MAAM;EACnE,MAAM,gBAA0B,iBAAiB,kBAAkB;EACnE,MAAM,WAAW,OAAO,8BAA8B,mBAAmB,cAAc;AACvF,MAAI,SAAS,SAAS,cACrB,QAAO,OAAO,OAAO,KAAK,SAAS,MAAM;AAE1C,MAAI,SAAS,SAAS,UACrB,QAAO,EAAE,UAAU,SAAS,IAAI;EAGjC,MAAM,kBAAkB,gBAAgB;GACvC,UAAU;GACV;GACA,SAJe,QAAQ,OAAO,mBAIvB;GACP,aAAa,kBAAkB;GAC/B,CAAC;AAqCF,SAAO,OAnCS,OAAO,IAAI,aAAa;GACvC,MAAM,QAAQ,OAAO,mBAAmB;GACxC,MAAM,oBAAoB,OAAO,kCAAkC;GACnE,MAAM,kBAAkB,OAAO,+BAA+B,EAC7D,QAAQ,MAAM,QAAQ,QACtB,CAAC;AAKF,WAAO,OADiB,6BACR,sBAAsB,KACrC,OAAO,UAAU,UAChB,OAAO,WAAW;AACjB,YAAQ,OAAO,MACd,kCAAkC,MAAM,OAAO,MAA8B,CAAC,IAC9E;KACA,CACF,EACD,OAAO,YAAY,OAAO,QAAQ,KAAK,CAAC,CACxC;AACD,UAAO,qBACN;IAAE,MAAM;IAAS,SAAS,MAAM;IAAS,SAAS,MAAM;IAAS,EACjE,eACA,OACA;IACC;IACA;IACA,UAAU;IACV,eAAe;IACf,CACD,CAAC,KAAK,OAAO,QAAQ,0BAA0B,kBAAkB,CAAC,CAAC;AAEpE,UAAO,yBAAwB,OADL,mBACgB,WAAW,OAAO,gBAAgB,IAAI,MAAM,CAAC;IAGnE,CAAC,KACrB,OAAO,QAAQ,gBAAgB,EAC/B,OAAO,QAAQ,OAAO,MAAM,CAAC,OAAO,eAAe,CAAC,CAAC,CAAC,EACtD,OAAO,iBAAiB;GACvB,YAAY,UACX,OAAO,KACN,IAAI,iBAAiB;IACpB,SAAS;IACT,OAAO,MAAM,OAAO,MAA8B;IAClD,CAAC,CACF;GACF,iBACC,OAAO,QAAQ,EAAE,UAAU,SAAS,IAAI,CAAC;GAC1C,CAAC,CACF;GACA"}
|
|
1
|
+
{"version":3,"file":"apply.mjs","names":["resolvePath"],"sources":["../../../src/cli/wirings/apply.ts"],"sourcesContent":["// `devstack apply` verb wiring.\n//\n// Live-aware: if a supervisor owns the selected stack, publish an\n// `apply.requested` command and await its ack. Otherwise run a\n// one-shot supervise that exits when all plugins are ready.\n//\n// Logger layer: `Logger.consolePretty()`. `apply` is the documented\n// one-shot mode (no TUI) — its consumers are CI logs and ad-hoc\n// operator runs that read raw stderr. Structured `Effect.log*` records\n// are the only operator-visible diagnostic for non-TUI surfaces, so we\n// route them through the pretty console layer. The sibling `up` verb\n// silences this layer (see `wirings/up.ts` header) because it owns the\n// TUI and would render duplicate / scrambled output otherwise.\n\nimport { dirname, resolve as resolvePath } from 'node:path';\n\nimport { Cause, Effect, Exit, Logger } from 'effect';\n\nimport type { Identity } from '../../substrate/identity.ts';\nimport { StackPathsService } from '../../substrate/runtime/paths.ts';\nimport {\n\tcommandChannelPaths,\n\tmakeCommandChannelPublisher,\n\tmakeProjectionRef,\n\ttype SupervisedStack,\n} from '../../substrate/runtime/index.ts';\nimport { superviseStackWithProductionBoot } from '../../orchestrators/boot.ts';\nimport {\n\tcomputeSnapshotGraphInputFromStack,\n\trecoverInterruptedRestore,\n\tSnapshotOrchestratorService,\n} from '../../orchestrators/snapshot/index.ts';\nimport { type CliError, CliInternalError } from '../../surfaces/cli/errors.ts';\nimport { type CommandResult, probeSupervisorPresence } from '../../surfaces/cli/commands/index.ts';\nimport { ExitCode } from '../../surfaces/cli/sysexits.ts';\nimport type { LoadedConfig } from '../../surfaces/cli/commands/config-loader.ts';\n\nimport { cliErrorFromConfigExit } from '../bail.ts';\nimport { makeConfigLoader } from './config-loader.ts';\nimport {\n\tidentityValueFor,\n\tresolvedIdentityForStack,\n\tstackRootFor,\n\ttype ResolvedIdentity,\n} from './identity.ts';\nimport { buildVerbLayers } from '../../orchestrators/layers.ts';\nimport { readDevstackVersion } from './read-devstack-version.ts';\n\nconst LIVE_APPLY_ACK_TIMEOUT_MILLIS = 10 * 60 * 1000;\n\n/** Outcome of the live-supervisor probe + dispatch:\n * - `kind: 'direct'` — no supervisor; caller runs the direct path.\n * - `kind: 'live-ok'` — live supervisor acked; verb is done.\n * - `kind: 'live-failed'` — live supervisor refused/timed-out; caller\n * surfaces the typed `CliError` via the dispatcher envelope. */\ntype ApplyDispatch =\n\t| { readonly kind: 'direct' }\n\t| { readonly kind: 'live-ok' }\n\t| { readonly kind: 'live-failed'; readonly error: CliError };\n\n/** Probe the roster file; if a supervisor is live, publish\n * `apply.requested` and await its ack. */\nconst runApplyAgainstLiveSupervisor = (\n\tidentity: ResolvedIdentity,\n\tidentityValue: Identity,\n): Effect.Effect<ApplyDispatch> =>\n\tEffect.gen(function* () {\n\t\tconst stackRoot = stackRootFor(identity.runtimeRoot, String(identityValue.stack));\n\t\tconst presence = yield* probeSupervisorPresence(resolvePath(stackRoot, 'roster.json')).pipe(\n\t\t\tEffect.catch(() => Effect.succeed({ live: false, pid: null, hostname: null })),\n\t\t);\n\t\tif (!presence.live) return { kind: 'direct' as const };\n\n\t\tconst exit = yield* Effect.exit(\n\t\t\tEffect.gen(function* () {\n\t\t\t\tconst publisher = yield* makeCommandChannelPublisher(commandChannelPaths(stackRoot));\n\t\t\t\tconst published = yield* publisher.publish({ tag: 'apply.requested' });\n\t\t\t\tconst reply = yield* publisher.awaitCompletion(published, {\n\t\t\t\t\ttimeoutMillis: LIVE_APPLY_ACK_TIMEOUT_MILLIS,\n\t\t\t\t});\n\t\t\t\tif (!reply.ok) {\n\t\t\t\t\treturn yield* Effect.fail(reply.message);\n\t\t\t\t}\n\t\t\t}),\n\t\t);\n\n\t\tif (Exit.isFailure(exit)) {\n\t\t\treturn {\n\t\t\t\tkind: 'live-failed' as const,\n\t\t\t\terror: new CliInternalError({\n\t\t\t\t\tmessage: 'live stack apply failed',\n\t\t\t\t\tcause: Cause.pretty(exit.cause as Cause.Cause<unknown>),\n\t\t\t\t}),\n\t\t\t};\n\t\t}\n\n\t\treturn { kind: 'live-ok' as const };\n\t});\n\nexport const runApplyLive = (\n\tconfigPath: string | undefined,\n\tidentity: ResolvedIdentity,\n): Effect.Effect<CommandResult, CliError> => {\n\tconst loader = makeConfigLoader();\n\treturn Effect.gen(function* () {\n\t\t// Config-load failures surface as typed `CliError`s; the\n\t\t// dispatcher's outer `emitFailure` renders the envelope.\n\t\tconst loadExit = yield* Effect.exit(loader.load(configPath));\n\t\tif (Exit.isFailure(loadExit)) {\n\t\t\treturn yield* Effect.fail(cliErrorFromConfigExit(loadExit));\n\t\t}\n\t\tconst loaded = loadExit.value;\n\t\tconst stack = (loaded as LoadedConfig & { readonly engine: SupervisedStack }).engine;\n\t\t// Re-derive the identity against the EFFECTIVE stack (explicit\n\t\t// `--stack`/`$DEVSTACK_STACK` > `config.stackName` > inferred) so\n\t\t// the live-supervisor probe + roster paths target the same stack\n\t\t// the operator selected — matching `snapshot.ts`. An explicit\n\t\t// `--stack` must NOT be overridden by `config.stackName`, otherwise\n\t\t// `apply` would probe/boot the wrong stack's supervisor.\n\t\tconst effectiveIdentity = resolvedIdentityForStack(identity, stack);\n\t\tconst identityValue: Identity = identityValueFor(effectiveIdentity);\n\t\tconst dispatch = yield* runApplyAgainstLiveSupervisor(effectiveIdentity, identityValue);\n\t\tif (dispatch.kind === 'live-failed') {\n\t\t\treturn yield* Effect.fail(dispatch.error);\n\t\t}\n\t\tif (dispatch.kind === 'live-ok') {\n\t\t\treturn { exitCode: ExitCode.OK };\n\t\t}\n\t\tconst appRoot = dirname(loaded.resolvedConfigPath);\n\t\tconst substrateLayers = buildVerbLayers({\n\t\t\tidentity: identityValue,\n\t\t\tstack,\n\t\t\tappRoot,\n\t\t\truntimeRoot: effectiveIdentity.runtimeRoot,\n\t\t});\n\n\t\tconst program = Effect.gen(function* () {\n\t\t\tconst state = yield* makeProjectionRef();\n\t\t\tconst stackPaths = yield* StackPathsService;\n\t\t\tconst computeGraphInput = computeSnapshotGraphInputFromStack({\n\t\t\t\tstack,\n\t\t\t\tdevstackVersion: readDevstackVersion({ fallback: '0.0.0' }),\n\t\t\t});\n\t\t\t// Mirror the up-path recovery: resume any restore interrupted by a\n\t\t\t// hard kill between the atomic swap and the image-promotion handoff\n\t\t\t// completing (the interrupted-restore sentinel rode the swap into the\n\t\t\t// live root and was never cleared) BEFORE the one-shot apply starts\n\t\t\t// the stack. Idempotent + no-op when no sentinel is present.\n\t\t\tconst snapshot = yield* SnapshotOrchestratorService;\n\t\t\tyield* recoverInterruptedRestore({\n\t\t\t\tliveRoot: stackPaths.stackRoot,\n\t\t\t\trestoreSnapshot: (id) =>\n\t\t\t\t\tcomputeGraphInput.pipe(\n\t\t\t\t\t\tEffect.flatMap((currentGraphInput) =>\n\t\t\t\t\t\t\tsnapshot.restore({\n\t\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\t\tcurrentGraphInput,\n\t\t\t\t\t\t\t\tgraphInputMismatchPolicy: 'warn',\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t});\n\t\t\t// The contribution dispatcher + post-acquire hook + built-in\n\t\t\t// plugin-context extension are assembled in ONE place\n\t\t\t// (`orchestrators/boot.ts superviseStackWithProductionBoot`); this\n\t\t\t// one-shot verb supplies only the per-caller inputs (`extras`,\n\t\t\t// `lifetime: 'one-shot'`). Run-to-completion + result semantics are\n\t\t\t// unchanged: the surrounding `matchCauseEffect` below still maps the\n\t\t\t// supervised cause/success onto the `CommandResult`.\n\t\t\tyield* superviseStackWithProductionBoot(\n\t\t\t\t{ _tag: 'Stack', members: stack.members, options: stack.options },\n\t\t\t\tidentityValue,\n\t\t\t\tstate,\n\t\t\t\t{\n\t\t\t\t\textras: stack.options.extras,\n\t\t\t\t\tnetworkOptions: stack.options.networkOptions,\n\t\t\t\t\tlifetime: 'one-shot',\n\t\t\t\t},\n\t\t\t);\n\t\t});\n\n\t\treturn yield* program.pipe(\n\t\t\tEffect.provide(substrateLayers),\n\t\t\tEffect.provide(Logger.layer([Logger.consolePretty()])),\n\t\t\tEffect.matchCauseEffect({\n\t\t\t\tonFailure: (cause): Effect.Effect<CommandResult, CliError> =>\n\t\t\t\t\tEffect.fail(\n\t\t\t\t\t\tnew CliInternalError({\n\t\t\t\t\t\t\tmessage: 'stack apply failed',\n\t\t\t\t\t\t\tcause: Cause.pretty(cause as Cause.Cause<unknown>),\n\t\t\t\t\t\t}),\n\t\t\t\t\t),\n\t\t\t\tonSuccess: (): Effect.Effect<CommandResult, CliError> =>\n\t\t\t\t\tEffect.succeed({ exitCode: ExitCode.OK }),\n\t\t\t}),\n\t\t);\n\t});\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAgDA,MAAM,gCAAgC,MAAU;;;AAchD,MAAM,iCACL,UACA,kBAEA,OAAO,IAAI,aAAa;CACvB,MAAM,YAAY,aAAa,SAAS,aAAa,OAAO,cAAc,KAAK,CAAC;CAIhF,IAAI,EAAC,OAHmB,wBAAwBA,QAAY,WAAW,aAAa,CAAC,CAAC,CAAC,KACtF,OAAO,YAAY,OAAO,QAAQ;EAAE,MAAM;EAAO,KAAK;EAAM,UAAU;CAAK,CAAC,CAAC,CAC9E,EAAA,CACc,MAAM,OAAO,EAAE,MAAM,SAAkB;CAErD,MAAM,OAAO,OAAO,OAAO,KAC1B,OAAO,IAAI,aAAa;EACvB,MAAM,YAAY,OAAO,4BAA4B,oBAAoB,SAAS,CAAC;EACnF,MAAM,YAAY,OAAO,UAAU,QAAQ,EAAE,KAAK,kBAAkB,CAAC;EACrE,MAAM,QAAQ,OAAO,UAAU,gBAAgB,WAAW,EACzD,eAAe,8BAChB,CAAC;EACD,IAAI,CAAC,MAAM,IACV,OAAO,OAAO,OAAO,KAAK,MAAM,OAAO;CAEzC,CAAC,CACF;CAEA,IAAI,KAAK,UAAU,IAAI,GACtB,OAAO;EACN,MAAM;EACN,OAAO,IAAI,iBAAiB;GAC3B,SAAS;GACT,OAAO,MAAM,OAAO,KAAK,KAA6B;EACvD,CAAC;CACF;CAGD,OAAO,EAAE,MAAM,UAAmB;AACnC,CAAC;AAEF,MAAa,gBACZ,YACA,aAC4C;CAC5C,MAAM,SAAS,iBAAiB;CAChC,OAAO,OAAO,IAAI,aAAa;EAG9B,MAAM,WAAW,OAAO,OAAO,KAAK,OAAO,KAAK,UAAU,CAAC;EAC3D,IAAI,KAAK,UAAU,QAAQ,GAC1B,OAAO,OAAO,OAAO,KAAK,uBAAuB,QAAQ,CAAC;EAE3D,MAAM,SAAS,SAAS;EACxB,MAAM,QAAS,OAA+D;EAO9E,MAAM,oBAAoB,yBAAyB,UAAU,KAAK;EAClE,MAAM,gBAA0B,iBAAiB,iBAAiB;EAClE,MAAM,WAAW,OAAO,8BAA8B,mBAAmB,aAAa;EACtF,IAAI,SAAS,SAAS,eACrB,OAAO,OAAO,OAAO,KAAK,SAAS,KAAK;EAEzC,IAAI,SAAS,SAAS,WACrB,OAAO,EAAE,UAAU,SAAS,GAAG;EAGhC,MAAM,kBAAkB,gBAAgB;GACvC,UAAU;GACV;GACA,SAJe,QAAQ,OAAO,kBAIxB;GACN,aAAa,kBAAkB;EAChC,CAAC;EA+CD,OAAO,OA7CS,OAAO,IAAI,aAAa;GACvC,MAAM,QAAQ,OAAO,kBAAkB;GACvC,MAAM,aAAa,OAAO;GAC1B,MAAM,oBAAoB,mCAAmC;IAC5D;IACA,iBAAiB,oBAAoB,EAAE,UAAU,QAAQ,CAAC;GAC3D,CAAC;GAMD,MAAM,WAAW,OAAO;GACxB,OAAO,0BAA0B;IAChC,UAAU,WAAW;IACrB,kBAAkB,OACjB,kBAAkB,KACjB,OAAO,SAAS,sBACf,SAAS,QAAQ;KAChB;KACA;KACA,0BAA0B;IAC3B,CAAC,CACF,CACD;GACF,CAAC;GAQD,OAAO,iCACN;IAAE,MAAM;IAAS,SAAS,MAAM;IAAS,SAAS,MAAM;GAAQ,GAChE,eACA,OACA;IACC,QAAQ,MAAM,QAAQ;IACtB,gBAAgB,MAAM,QAAQ;IAC9B,UAAU;GACX,CACD;EACD,CAEoB,CAAC,CAAC,KACrB,OAAO,QAAQ,eAAe,GAC9B,OAAO,QAAQ,OAAO,MAAM,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,GACrD,OAAO,iBAAiB;GACvB,YAAY,UACX,OAAO,KACN,IAAI,iBAAiB;IACpB,SAAS;IACT,OAAO,MAAM,OAAO,KAA6B;GAClD,CAAC,CACF;GACD,iBACC,OAAO,QAAQ,EAAE,UAAU,SAAS,GAAG,CAAC;EAC1C,CAAC,CACF;CACD,CAAC;AACF"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { layerMystenMoveCodegen } from "../../orchestrators/codegen/bindings.mjs";
|
|
2
|
+
import { layerSuiMoveSummaryRunnerDocker, layerSuiMoveSummaryRunnerHost } from "../../plugins/sui/move-summary-runner.mjs";
|
|
3
|
+
import { layerCodegenPaths, layerCodegenRoot } from "../../orchestrators/codegen/paths.mjs";
|
|
4
|
+
import { runEmitCycle } from "../../orchestrators/codegen/service.mjs";
|
|
5
|
+
import { buildSubstrateLayers } from "../../orchestrators/boot.mjs";
|
|
6
|
+
import { ExitCode } from "../../surfaces/cli/sysexits.mjs";
|
|
7
|
+
import { CliInternalError } from "../../surfaces/cli/errors.mjs";
|
|
8
|
+
import "../../surfaces/cli/commands/index.mjs";
|
|
9
|
+
import { cliErrorFromConfigExit } from "../bail.mjs";
|
|
10
|
+
import { makeConfigLoader } from "./config-loader.mjs";
|
|
11
|
+
import { identityValueFor } from "./identity.mjs";
|
|
12
|
+
import { Cause, Effect, Exit, Layer, Logger } from "effect";
|
|
13
|
+
import { dirname, resolve } from "node:path";
|
|
14
|
+
import { spawnSync } from "node:child_process";
|
|
15
|
+
import * as NodeFileSystem from "@effect/platform-node/NodeFileSystem";
|
|
16
|
+
import * as NodePath from "@effect/platform-node/NodePath";
|
|
17
|
+
import * as NodeChildProcessSpawner from "@effect/platform-node/NodeChildProcessSpawner";
|
|
18
|
+
//#region src/cli/wirings/codegen.ts
|
|
19
|
+
/** Walk the stack members, calling each plugin spec's `staticCodegen`
|
|
20
|
+
* hook (skipping plugins that lack one) to derive the committed-tree
|
|
21
|
+
* contributions from config alone. KNOWN package ids come from the
|
|
22
|
+
* declared `networks` literals; LOCAL ids stay the all-zero sentinel
|
|
23
|
+
* (resolved at app build/dev time through `__DEVSTACK_IDS__`). */
|
|
24
|
+
const deriveContributions = (members) => {
|
|
25
|
+
const decls = [];
|
|
26
|
+
for (const member of members) {
|
|
27
|
+
if (member.staticCodegen === void 0) continue;
|
|
28
|
+
decls.push(...member.staticCodegen());
|
|
29
|
+
}
|
|
30
|
+
return decls;
|
|
31
|
+
};
|
|
32
|
+
/** True if a `sui` binary is resolvable on PATH (cheap `--version` probe). */
|
|
33
|
+
const hostSuiAvailable = () => {
|
|
34
|
+
try {
|
|
35
|
+
return spawnSync("sui", ["--version"], {
|
|
36
|
+
timeout: 5e3,
|
|
37
|
+
stdio: [
|
|
38
|
+
"ignore",
|
|
39
|
+
"ignore",
|
|
40
|
+
"ignore"
|
|
41
|
+
]
|
|
42
|
+
}).status === 0;
|
|
43
|
+
} catch {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
const selectCodegenRunner = () => {
|
|
48
|
+
const requested = process.env["DEVSTACK_CODEGEN_RUNNER"]?.trim().toLowerCase();
|
|
49
|
+
if (requested === "docker" || requested === "host") return requested;
|
|
50
|
+
return hostSuiAvailable() ? "host" : "docker";
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Build the codegen service layer: `CodegenPathsService` +
|
|
54
|
+
* `MoveSummaryRunnerService` + `MoveCodegenService`, with the Node
|
|
55
|
+
* FileSystem / Path / child-process spawner provided UNDER them. Mirrors
|
|
56
|
+
* `apply`'s substrate-layer provision shape — one merged layer providing
|
|
57
|
+
* the services, with `Logger` supplied as a separate outer layer over the
|
|
58
|
+
* program (`consolePretty` needs no FileSystem).
|
|
59
|
+
*
|
|
60
|
+
* The Move-summary runner is selected per `selectCodegenRunner`. The
|
|
61
|
+
* `host` runner only needs a child-process spawner; the `docker` runner
|
|
62
|
+
* needs the full Docker `ContainerRuntimeService`, so it provides the
|
|
63
|
+
* substrate layer stack (`buildSubstrateLayers`) UNDER it. The Docker
|
|
64
|
+
* runner produces byte-identical bindings to the host runner — it runs the
|
|
65
|
+
* SAME `sui move summary` argv, just inside the pinned CLI image — so the
|
|
66
|
+
* committed `src/generated` tree is independent of which runner emitted it.
|
|
67
|
+
*/
|
|
68
|
+
const buildCodegenLayer = (appRoot, runner, identity) => {
|
|
69
|
+
const generatedDir = resolve(appRoot, "src", "generated");
|
|
70
|
+
const platform = Layer.mergeAll(NodeFileSystem.layer, NodePath.layer);
|
|
71
|
+
const codegenPaths = layerCodegenPaths.pipe(Layer.provideMerge(layerCodegenRoot({
|
|
72
|
+
outputDir: generatedDir,
|
|
73
|
+
stackSubdir: null,
|
|
74
|
+
extrasDir: resolve(appRoot, "src", "generated-extras")
|
|
75
|
+
})));
|
|
76
|
+
const moveRunner = runner === "docker" ? layerSuiMoveSummaryRunnerDocker.pipe(Layer.provideMerge(buildSubstrateLayers(identityValueFor(identity), identity.runtimeRoot))) : layerSuiMoveSummaryRunnerHost.pipe(Layer.provideMerge(NodeChildProcessSpawner.layer));
|
|
77
|
+
return Layer.mergeAll(codegenPaths, moveRunner, layerMystenMoveCodegen()).pipe(Layer.provideMerge(platform));
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Run the stack-free codegen verb. `configPath` is the devstack config
|
|
81
|
+
* path. No stack boots; the committed `src/generated` tree is rewritten
|
|
82
|
+
* deterministically from Move source.
|
|
83
|
+
*/
|
|
84
|
+
const runCodegen = (configPath, identity) => {
|
|
85
|
+
const loader = makeConfigLoader();
|
|
86
|
+
return Effect.gen(function* () {
|
|
87
|
+
const loadExit = yield* Effect.exit(loader.load(configPath));
|
|
88
|
+
if (Exit.isFailure(loadExit)) return yield* Effect.fail(cliErrorFromConfigExit(loadExit));
|
|
89
|
+
const loaded = loadExit.value;
|
|
90
|
+
const stack = loaded.engine;
|
|
91
|
+
const appRoot = dirname(loaded.resolvedConfigPath);
|
|
92
|
+
const contributions = deriveContributions(stack.members);
|
|
93
|
+
const runner = selectCodegenRunner();
|
|
94
|
+
const exit = yield* Effect.exit(runEmitCycle({
|
|
95
|
+
contributions,
|
|
96
|
+
trackTree: true
|
|
97
|
+
}).pipe(Effect.provide(buildCodegenLayer(appRoot, runner, identity)), Effect.provide(Logger.layer([Logger.consolePretty()]))));
|
|
98
|
+
if (Exit.isFailure(exit)) return yield* Effect.fail(new CliInternalError({
|
|
99
|
+
message: "codegen failed",
|
|
100
|
+
cause: Cause.pretty(exit.cause)
|
|
101
|
+
}));
|
|
102
|
+
return { exitCode: ExitCode.OK };
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
//#endregion
|
|
106
|
+
export { runCodegen };
|
|
107
|
+
|
|
108
|
+
//# sourceMappingURL=codegen.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codegen.mjs","names":["resolvePath"],"sources":["../../../src/cli/wirings/codegen.ts"],"sourcesContent":["// `devstack codegen` verb wiring.\n//\n// Deterministic, STACK-FREE codegen: `(Move source) → generated`. It\n// boots NO stack — no supervisor, no acquire, no Docker. It loads the\n// config, derives each plugin's codegen contributions from config ALONE\n// (via the plugin spec's `staticCodegen` hook), and runs ONE\n// `runEmitCycle` that writes the committed `src/generated` tree.\n//\n// On-chain ids are LOADED CONFIG DATA, not generated output. The\n// committed tree carries the all-zero sentinel for every LOCAL id (and\n// declared literals for KNOWN packages); the committed `config.ts`\n// resolver throws loudly at runtime if a sentinel id is used. The Vite\n// plugin injects the real ids in dev (live `devstack-ids.json`) and prod\n// (a committed id-config file via the `ids` option / `DEVSTACK_IDS_FILE`).\n// So `git status` shows NO churn under\n// `src/generated` after a `devstack up` — ids land only in the\n// gitignored `.devstack/`.\n//\n// Logger layer: `Logger.consolePretty()` — mirrors `apply.ts` exactly.\n// `consolePretty` needs no FileSystem, so it is provided as a separate\n// OUTER layer over the codegen service layer (which provides the Node\n// FileSystem / Path / child-process spawner UNDER the codegen services).\n// This is the same provision shape `apply` uses and compiles cleanly\n// under the strict tsconfig.\n\nimport { spawnSync } from 'node:child_process';\nimport { dirname, resolve as resolvePath } from 'node:path';\n\nimport { Cause, Effect, Exit, Layer, Logger } from 'effect';\nimport * as NodeChildProcessSpawner from '@effect/platform-node/NodeChildProcessSpawner';\nimport * as NodeFileSystem from '@effect/platform-node/NodeFileSystem';\nimport * as NodePath from '@effect/platform-node/NodePath';\n\nimport type { CodegenableDecl } from '../../contracts/codegenable.ts';\nimport type { AnyPlugin } from '../../substrate/plugin.ts';\nimport type { SupervisedStack } from '../../substrate/runtime/index.ts';\nimport { layerMystenMoveCodegen } from '../../orchestrators/codegen/bindings.ts';\nimport {\n\tlayerSuiMoveSummaryRunnerDocker,\n\tlayerSuiMoveSummaryRunnerHost,\n} from '../../plugins/sui/move-summary-runner.ts';\nimport { buildSubstrateLayers } from '../../orchestrators/boot.ts';\nimport { layerCodegenPaths, layerCodegenRoot } from '../../orchestrators/codegen/paths.ts';\nimport { runEmitCycle } from '../../orchestrators/codegen/service.ts';\nimport { type CliError, CliInternalError } from '../../surfaces/cli/errors.ts';\nimport { type CommandResult } from '../../surfaces/cli/commands/index.ts';\nimport { ExitCode } from '../../surfaces/cli/sysexits.ts';\nimport type { LoadedConfig } from '../../surfaces/cli/commands/config-loader.ts';\n\nimport { cliErrorFromConfigExit } from '../bail.ts';\nimport { makeConfigLoader } from './config-loader.ts';\nimport { identityValueFor, type ResolvedIdentity } from './identity.ts';\n\n/** Walk the stack members, calling each plugin spec's `staticCodegen`\n * hook (skipping plugins that lack one) to derive the committed-tree\n * contributions from config alone. KNOWN package ids come from the\n * declared `networks` literals; LOCAL ids stay the all-zero sentinel\n * (resolved at app build/dev time through `__DEVSTACK_IDS__`). */\nconst deriveContributions = (members: ReadonlyArray<AnyPlugin>): ReadonlyArray<CodegenableDecl> => {\n\tconst decls: Array<CodegenableDecl> = [];\n\tfor (const member of members) {\n\t\tif (member.staticCodegen === undefined) continue;\n\t\tdecls.push(...member.staticCodegen());\n\t}\n\treturn decls;\n};\n\n/** Which Move-summary runner the stack-free codegen verb uses.\n *\n * - `host` — invoke a local `sui` CLI on PATH directly (fast, no Docker).\n * - `docker` — run `sui move summary` inside the pinned Sui CLI image\n * (the same runner `boot.ts` wires for `up`/`apply`). Needs Docker but\n * NO host `sui`, which is what CI has.\n *\n * Selection follows `DEVSTACK_CODEGEN_RUNNER` (`docker`/`host`); when unset,\n * auto-detect: use `host` if a `sui` binary is on PATH, else fall back to\n * `docker`. CI never installs `sui`, so it lands on `docker` automatically;\n * a workflow can still force it with `DEVSTACK_CODEGEN_RUNNER=docker`. */\ntype CodegenRunner = 'host' | 'docker';\n\n/** True if a `sui` binary is resolvable on PATH (cheap `--version` probe). */\nconst hostSuiAvailable = (): boolean => {\n\ttry {\n\t\tconst probe = spawnSync('sui', ['--version'], {\n\t\t\ttimeout: 5_000,\n\t\t\tstdio: ['ignore', 'ignore', 'ignore'],\n\t\t});\n\t\treturn probe.status === 0;\n\t} catch {\n\t\treturn false;\n\t}\n};\n\nconst selectCodegenRunner = (): CodegenRunner => {\n\tconst requested = process.env['DEVSTACK_CODEGEN_RUNNER']?.trim().toLowerCase();\n\tif (requested === 'docker' || requested === 'host') return requested;\n\treturn hostSuiAvailable() ? 'host' : 'docker';\n};\n\n/**\n * Build the codegen service layer: `CodegenPathsService` +\n * `MoveSummaryRunnerService` + `MoveCodegenService`, with the Node\n * FileSystem / Path / child-process spawner provided UNDER them. Mirrors\n * `apply`'s substrate-layer provision shape — one merged layer providing\n * the services, with `Logger` supplied as a separate outer layer over the\n * program (`consolePretty` needs no FileSystem).\n *\n * The Move-summary runner is selected per `selectCodegenRunner`. The\n * `host` runner only needs a child-process spawner; the `docker` runner\n * needs the full Docker `ContainerRuntimeService`, so it provides the\n * substrate layer stack (`buildSubstrateLayers`) UNDER it. The Docker\n * runner produces byte-identical bindings to the host runner — it runs the\n * SAME `sui move summary` argv, just inside the pinned CLI image — so the\n * committed `src/generated` tree is independent of which runner emitted it.\n */\nconst buildCodegenLayer = (appRoot: string, runner: CodegenRunner, identity: ResolvedIdentity) => {\n\tconst generatedDir = resolvePath(appRoot, 'src', 'generated');\n\tconst platform = Layer.mergeAll(NodeFileSystem.layer, NodePath.layer);\n\tconst codegenPaths = layerCodegenPaths.pipe(\n\t\tLayer.provideMerge(\n\t\t\tlayerCodegenRoot({\n\t\t\t\toutputDir: generatedDir,\n\t\t\t\tstackSubdir: null,\n\t\t\t\t// Static contributions never target `generated-extras` (those\n\t\t\t\t// decls are dev-only and carry no `staticCodegen`), so this\n\t\t\t\t// path is declared but never written.\n\t\t\t\textrasDir: resolvePath(appRoot, 'src', 'generated-extras'),\n\t\t\t}),\n\t\t),\n\t);\n\tconst moveRunner =\n\t\trunner === 'docker'\n\t\t\t? layerSuiMoveSummaryRunnerDocker.pipe(\n\t\t\t\t\t// The Docker runner only needs `ContainerRuntimeService`; the\n\t\t\t\t\t// substrate layer stack provides it (along with the rest of L0).\n\t\t\t\t\t// No stack containers are created — only one-shot `sui move\n\t\t\t\t\t// summary` runs against the pinned CLI image.\n\t\t\t\t\tLayer.provideMerge(\n\t\t\t\t\t\tbuildSubstrateLayers(identityValueFor(identity), identity.runtimeRoot),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t: layerSuiMoveSummaryRunnerHost.pipe(Layer.provideMerge(NodeChildProcessSpawner.layer));\n\treturn Layer.mergeAll(codegenPaths, moveRunner, layerMystenMoveCodegen()).pipe(\n\t\tLayer.provideMerge(platform),\n\t);\n};\n\n/**\n * Run the stack-free codegen verb. `configPath` is the devstack config\n * path. No stack boots; the committed `src/generated` tree is rewritten\n * deterministically from Move source.\n */\nexport const runCodegen = (\n\tconfigPath: string | undefined,\n\tidentity: ResolvedIdentity,\n): Effect.Effect<CommandResult, CliError> => {\n\tconst loader = makeConfigLoader();\n\treturn Effect.gen(function* () {\n\t\tconst loadExit = yield* Effect.exit(loader.load(configPath));\n\t\tif (Exit.isFailure(loadExit)) {\n\t\t\treturn yield* Effect.fail(cliErrorFromConfigExit(loadExit));\n\t\t}\n\t\tconst loaded = loadExit.value;\n\t\tconst stack = (loaded as LoadedConfig & { readonly engine: SupervisedStack }).engine;\n\t\tconst appRoot = dirname(loaded.resolvedConfigPath);\n\n\t\tconst contributions = deriveContributions(stack.members);\n\t\tconst runner = selectCodegenRunner();\n\n\t\tconst exit = yield* Effect.exit(\n\t\t\trunEmitCycle({ contributions, trackTree: true }).pipe(\n\t\t\t\tEffect.provide(buildCodegenLayer(appRoot, runner, identity)),\n\t\t\t\tEffect.provide(Logger.layer([Logger.consolePretty()])),\n\t\t\t),\n\t\t);\n\t\tif (Exit.isFailure(exit)) {\n\t\t\treturn yield* Effect.fail(\n\t\t\t\tnew CliInternalError({\n\t\t\t\t\tmessage: 'codegen failed',\n\t\t\t\t\tcause: Cause.pretty(exit.cause as Cause.Cause<unknown>),\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\t\treturn { exitCode: ExitCode.OK };\n\t});\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA0DA,MAAM,uBAAuB,YAAsE;CAClG,MAAM,QAAgC,CAAC;CACvC,KAAK,MAAM,UAAU,SAAS;EAC7B,IAAI,OAAO,kBAAkB,KAAA,GAAW;EACxC,MAAM,KAAK,GAAG,OAAO,cAAc,CAAC;CACrC;CACA,OAAO;AACR;;AAgBA,MAAM,yBAAkC;CACvC,IAAI;EAKH,OAJc,UAAU,OAAO,CAAC,WAAW,GAAG;GAC7C,SAAS;GACT,OAAO;IAAC;IAAU;IAAU;GAAQ;EACrC,CACW,CAAC,CAAC,WAAW;CACzB,QAAQ;EACP,OAAO;CACR;AACD;AAEA,MAAM,4BAA2C;CAChD,MAAM,YAAY,QAAQ,IAAI,0BAA0B,EAAE,KAAK,CAAC,CAAC,YAAY;CAC7E,IAAI,cAAc,YAAY,cAAc,QAAQ,OAAO;CAC3D,OAAO,iBAAiB,IAAI,SAAS;AACtC;;;;;;;;;;;;;;;;;AAkBA,MAAM,qBAAqB,SAAiB,QAAuB,aAA+B;CACjG,MAAM,eAAeA,QAAY,SAAS,OAAO,WAAW;CAC5D,MAAM,WAAW,MAAM,SAAS,eAAe,OAAO,SAAS,KAAK;CACpE,MAAM,eAAe,kBAAkB,KACtC,MAAM,aACL,iBAAiB;EAChB,WAAW;EACX,aAAa;EAIb,WAAWA,QAAY,SAAS,OAAO,kBAAkB;CAC1D,CAAC,CACF,CACD;CACA,MAAM,aACL,WAAW,WACR,gCAAgC,KAKhC,MAAM,aACL,qBAAqB,iBAAiB,QAAQ,GAAG,SAAS,WAAW,CACtE,CACD,IACC,8BAA8B,KAAK,MAAM,aAAa,wBAAwB,KAAK,CAAC;CACxF,OAAO,MAAM,SAAS,cAAc,YAAY,uBAAuB,CAAC,CAAC,CAAC,KACzE,MAAM,aAAa,QAAQ,CAC5B;AACD;;;;;;AAOA,MAAa,cACZ,YACA,aAC4C;CAC5C,MAAM,SAAS,iBAAiB;CAChC,OAAO,OAAO,IAAI,aAAa;EAC9B,MAAM,WAAW,OAAO,OAAO,KAAK,OAAO,KAAK,UAAU,CAAC;EAC3D,IAAI,KAAK,UAAU,QAAQ,GAC1B,OAAO,OAAO,OAAO,KAAK,uBAAuB,QAAQ,CAAC;EAE3D,MAAM,SAAS,SAAS;EACxB,MAAM,QAAS,OAA+D;EAC9E,MAAM,UAAU,QAAQ,OAAO,kBAAkB;EAEjD,MAAM,gBAAgB,oBAAoB,MAAM,OAAO;EACvD,MAAM,SAAS,oBAAoB;EAEnC,MAAM,OAAO,OAAO,OAAO,KAC1B,aAAa;GAAE;GAAe,WAAW;EAAK,CAAC,CAAC,CAAC,KAChD,OAAO,QAAQ,kBAAkB,SAAS,QAAQ,QAAQ,CAAC,GAC3D,OAAO,QAAQ,OAAO,MAAM,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CACtD,CACD;EACA,IAAI,KAAK,UAAU,IAAI,GACtB,OAAO,OAAO,OAAO,KACpB,IAAI,iBAAiB;GACpB,SAAS;GACT,OAAO,MAAM,OAAO,KAAK,KAA6B;EACvD,CAAC,CACF;EAED,OAAO,EAAE,UAAU,SAAS,GAAG;CAChC,CAAC;AACF"}
|
|
@@ -1,69 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { loadDevstackConfig } from "../../api/load-config.mjs";
|
|
2
2
|
import { CliConfigInvalidError, CliConfigNotFoundError } from "../../surfaces/cli/errors.mjs";
|
|
3
3
|
import "../../surfaces/cli/index.mjs";
|
|
4
4
|
import { Effect } from "effect";
|
|
5
|
-
import { existsSync } from "node:fs";
|
|
6
|
-
import { isAbsolute, resolve } from "node:path";
|
|
7
|
-
import { pathToFileURL } from "node:url";
|
|
8
5
|
//#region src/cli/wirings/config-loader.ts
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
for (;;) {
|
|
20
|
-
const candidate = resolve(dir, "devstack.config.ts");
|
|
21
|
-
if (existsSync(candidate)) return candidate;
|
|
22
|
-
const parent = resolve(dir, "..");
|
|
23
|
-
if (parent === dir) return null;
|
|
24
|
-
dir = parent;
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
const validateStackModule = (resolvedConfigPath, mod) => {
|
|
28
|
-
const def = mod.default;
|
|
29
|
-
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)})` });
|
|
30
|
-
let stack;
|
|
31
|
-
try {
|
|
32
|
-
stack = readStackEngine(def);
|
|
33
|
-
} catch (cause) {
|
|
34
|
-
throw new CliConfigInvalidError({ message: `config at ${resolvedConfigPath} default-exported an invalid Stack handle: ${cause instanceof Error ? cause.message : String(cause)}` });
|
|
35
|
-
}
|
|
36
|
-
return {
|
|
37
|
-
stack,
|
|
38
|
-
resolvedConfigPath
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
const makeConfigLoader = () => ({ load: (configPath) => Effect.gen(function* () {
|
|
42
|
-
const abs = resolveConfigPath(configPath);
|
|
43
|
-
if (abs === null) {
|
|
44
|
-
const attempted = configPath !== void 0 ? resolve(process.cwd(), configPath) : resolve(process.cwd(), DEFAULT_CONFIG_PATH);
|
|
45
|
-
return yield* Effect.fail(new CliConfigNotFoundError({
|
|
46
|
-
message: `devstack config not found at ${attempted}`,
|
|
47
|
-
searchedPaths: [attempted]
|
|
48
|
-
}));
|
|
49
|
-
}
|
|
50
|
-
const url = pathToFileURL(abs).href;
|
|
51
|
-
const mod = yield* Effect.tryPromise({
|
|
52
|
-
try: () => import(url),
|
|
53
|
-
catch: (cause) => new CliConfigInvalidError({
|
|
54
|
-
message: `failed to import ${abs}: ${cause instanceof Error ? cause.message : String(cause)}`,
|
|
55
|
-
cause
|
|
56
|
-
})
|
|
57
|
-
});
|
|
58
|
-
return yield* Effect.try({
|
|
59
|
-
try: () => validateStackModule(abs, mod),
|
|
60
|
-
catch: (cause) => cause instanceof CliConfigInvalidError ? cause : new CliConfigInvalidError({
|
|
61
|
-
message: `invalid config at ${abs}`,
|
|
62
|
-
cause
|
|
63
|
-
})
|
|
64
|
-
});
|
|
65
|
-
}) });
|
|
6
|
+
/** Translate the CLI-free loader's failure into the CLI-flavored error
|
|
7
|
+
* union so command exit codes stay stable. */
|
|
8
|
+
const toCliError = (err) => err.kind === "not-found" ? new CliConfigNotFoundError({
|
|
9
|
+
message: err.message,
|
|
10
|
+
searchedPaths: err.searchedPaths ?? []
|
|
11
|
+
}) : new CliConfigInvalidError({
|
|
12
|
+
message: err.message,
|
|
13
|
+
cause: err.cause
|
|
14
|
+
});
|
|
15
|
+
const makeConfigLoader = () => ({ load: (configPath) => loadDevstackConfig(configPath).pipe(Effect.mapError(toCliError)) });
|
|
66
16
|
//#endregion
|
|
67
|
-
export { makeConfigLoader
|
|
17
|
+
export { makeConfigLoader };
|
|
68
18
|
|
|
69
19
|
//# sourceMappingURL=config-loader.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-loader.mjs","names":[
|
|
1
|
+
{"version":3,"file":"config-loader.mjs","names":[],"sources":["../../../src/cli/wirings/config-loader.ts"],"sourcesContent":["// Shared config loader consumed by every verb wiring that imports a\n// `devstack.config.ts`. Returns the public stack handle exactly as the\n// config exported it, plus the validated internal engine stack for CLI\n// paths that need the erased runtime boundary shape.\n\nimport { Effect } from 'effect';\n\nimport {\n\tDEFAULT_CONFIG_PATH,\n\tloadDevstackConfig,\n\tresolveConfigPath,\n\ttype DevstackConfigError,\n} from '../../api/load-config.ts';\nimport type { LoadedConfig } from '../../surfaces/cli/commands/config-loader.ts';\nimport { CliConfigInvalidError, CliConfigNotFoundError } from '../../surfaces/cli/index.ts';\n\n// Re-exported so existing CLI importers (`main.ts`, `snapshot.ts`) keep\n// their `./config-loader` import site. The implementation lives in the\n// CLI-free `api/load-config.ts` facade.\nexport { DEFAULT_CONFIG_PATH, resolveConfigPath };\n\n/** Translate the CLI-free loader's failure into the CLI-flavored error\n * union so command exit codes stay stable. */\nconst toCliError = (err: DevstackConfigError): CliConfigNotFoundError | CliConfigInvalidError =>\n\terr.kind === 'not-found'\n\t\t? new CliConfigNotFoundError({\n\t\t\t\tmessage: err.message,\n\t\t\t\tsearchedPaths: err.searchedPaths ?? [],\n\t\t\t})\n\t\t: new CliConfigInvalidError({ message: err.message, cause: err.cause });\n\nexport interface ConfigLoader {\n\treadonly load: (\n\t\tconfigPath: string | undefined,\n\t) => Effect.Effect<LoadedConfig, CliConfigNotFoundError | CliConfigInvalidError>;\n}\n\nexport const makeConfigLoader = (): ConfigLoader => ({\n\tload: (configPath) =>\n\t\tloadDevstackConfig(configPath).pipe(Effect.mapError(toCliError)) as Effect.Effect<\n\t\t\tLoadedConfig,\n\t\t\tCliConfigNotFoundError | CliConfigInvalidError\n\t\t>,\n});\n"],"mappings":";;;;;;;AAuBA,MAAM,cAAc,QACnB,IAAI,SAAS,cACV,IAAI,uBAAuB;CAC3B,SAAS,IAAI;CACb,eAAe,IAAI,iBAAiB,CAAC;AACtC,CAAC,IACA,IAAI,sBAAsB;CAAE,SAAS,IAAI;CAAS,OAAO,IAAI;AAAM,CAAC;AAQxE,MAAa,0BAAwC,EACpD,OAAO,eACN,mBAAmB,UAAU,CAAC,CAAC,KAAK,OAAO,SAAS,UAAU,CAAC,EAIjE"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { ID_CONFIG_FILENAME, decodeIdConfig } from "../../orchestrators/codegen/id-config.mjs";
|
|
2
|
+
import { ExitCode } from "../../surfaces/cli/sysexits.mjs";
|
|
3
|
+
import { CliInternalError } from "../../surfaces/cli/errors.mjs";
|
|
4
|
+
import { emitSuccess } from "../../surfaces/cli/output.mjs";
|
|
5
|
+
import { probeSupervisorPresence } from "../../surfaces/cli/commands/supervisor-presence.mjs";
|
|
6
|
+
import "../../surfaces/cli/commands/index.mjs";
|
|
7
|
+
import { cliErrorFromConfigExit } from "../bail.mjs";
|
|
8
|
+
import { makeConfigLoader } from "./config-loader.mjs";
|
|
9
|
+
import { resolvedIdentityForStack } from "./identity.mjs";
|
|
10
|
+
import { runApplyLive } from "./apply.mjs";
|
|
11
|
+
import { Effect, Exit } from "effect";
|
|
12
|
+
import { readFileSync, writeFileSync } from "node:fs";
|
|
13
|
+
import { resolve } from "node:path";
|
|
14
|
+
//#region src/cli/wirings/dump-ids.ts
|
|
15
|
+
/** Read the on-disk id-config as raw text. The file is written by boot's
|
|
16
|
+
* post-acquire hook (`writeIdConfig`) at `<stackRoot>/devstack-ids.json`;
|
|
17
|
+
* a miss here means the boot never produced it (or a hand-removal), which
|
|
18
|
+
* is an internal inconsistency the operator can't act on directly. */
|
|
19
|
+
const readIdConfigText = (idsFile) => Effect.try({
|
|
20
|
+
try: () => readFileSync(idsFile, "utf8"),
|
|
21
|
+
catch: (cause) => new CliInternalError({
|
|
22
|
+
message: `failed to read id-config at ${idsFile}`,
|
|
23
|
+
cause
|
|
24
|
+
})
|
|
25
|
+
});
|
|
26
|
+
const writeOutFile = (out, text) => Effect.try({
|
|
27
|
+
try: () => writeFileSync(out, text, "utf8"),
|
|
28
|
+
catch: (cause) => new CliInternalError({
|
|
29
|
+
message: `failed to write id-config to ${out}`,
|
|
30
|
+
cause
|
|
31
|
+
})
|
|
32
|
+
});
|
|
33
|
+
/** Decode the id-config text for the JSON envelope `data`, routed through
|
|
34
|
+
* the shared {@link decodeIdConfig} so the parse-and-validate decision is
|
|
35
|
+
* centralized (same seam the Vite plugin and codegen verb use). A failure
|
|
36
|
+
* here means the on-disk file is corrupt — bad JSON OR a shape that
|
|
37
|
+
* violates `IdConfigSchema` — so surface it rather than emit a bad
|
|
38
|
+
* envelope. (The file is written by `writeIdConfig` from the same schema,
|
|
39
|
+
* so a conforming boot-written file always decodes; only a corrupt or
|
|
40
|
+
* hand-edited file trips the stricter validation.) */
|
|
41
|
+
const parseIdConfig = (text, idsFile) => Effect.try({
|
|
42
|
+
try: () => decodeIdConfig(text),
|
|
43
|
+
catch: (cause) => new CliInternalError({
|
|
44
|
+
message: `id-config at ${idsFile} is not valid JSON`,
|
|
45
|
+
cause
|
|
46
|
+
})
|
|
47
|
+
});
|
|
48
|
+
const runDumpIds = (identity, opts) => {
|
|
49
|
+
const loader = makeConfigLoader();
|
|
50
|
+
return Effect.gen(function* () {
|
|
51
|
+
const started = Date.now();
|
|
52
|
+
const loadExit = yield* Effect.exit(loader.load(opts.configPath));
|
|
53
|
+
if (Exit.isFailure(loadExit)) return yield* Effect.fail(cliErrorFromConfigExit(loadExit));
|
|
54
|
+
const stack = loadExit.value.engine;
|
|
55
|
+
const effectiveIdentity = resolvedIdentityForStack(identity, stack);
|
|
56
|
+
const idsFile = resolve(effectiveIdentity.stackRoot, ID_CONFIG_FILENAME);
|
|
57
|
+
if (!(yield* probeSupervisorPresence(effectiveIdentity.rosterFile).pipe(Effect.catch(() => Effect.succeed({
|
|
58
|
+
live: false,
|
|
59
|
+
pid: null,
|
|
60
|
+
hostname: null
|
|
61
|
+
})))).live) yield* runApplyLive(opts.configPath, identity);
|
|
62
|
+
const text = yield* readIdConfigText(idsFile);
|
|
63
|
+
const data = yield* parseIdConfig(text, idsFile);
|
|
64
|
+
if (opts.out !== void 0) {
|
|
65
|
+
yield* writeOutFile(opts.out, text);
|
|
66
|
+
yield* emitSuccess(opts.io, opts.outputMode, {
|
|
67
|
+
command: "dump-ids",
|
|
68
|
+
elapsedMs: Date.now() - started,
|
|
69
|
+
data,
|
|
70
|
+
humanLines: [`wrote id-config to ${opts.out}`]
|
|
71
|
+
});
|
|
72
|
+
return { exitCode: ExitCode.OK };
|
|
73
|
+
}
|
|
74
|
+
yield* emitSuccess(opts.io, opts.outputMode, {
|
|
75
|
+
command: "dump-ids",
|
|
76
|
+
elapsedMs: Date.now() - started,
|
|
77
|
+
data,
|
|
78
|
+
humanLines: [text.endsWith("\n") ? text.slice(0, -1) : text]
|
|
79
|
+
});
|
|
80
|
+
return { exitCode: ExitCode.OK };
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
//#endregion
|
|
84
|
+
export { runDumpIds };
|
|
85
|
+
|
|
86
|
+
//# sourceMappingURL=dump-ids.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dump-ids.mjs","names":["resolvePath"],"sources":["../../../src/cli/wirings/dump-ids.ts"],"sourcesContent":["// `devstack dump-ids` verb wiring.\n//\n// Emits the stack's `devstack-ids.json` id-config — the single source of\n// on-chain ids (see `orchestrators/codegen/id-config.ts`). This is the\n// supported way to obtain a committed id-config file for a real-network\n// deploy (docs' \"Deploy to a real network / Option A\"), replacing the\n// manual `cp .devstack/stacks/<stack>/devstack-ids.json …`.\n//\n// Live-aware, mirroring `apply.ts` / `snapshot.ts`:\n// - If a supervisor owns the selected stack (roster probe), the\n// id-config already exists on disk — boot's post-acquire hook wrote\n// it (`boot.ts buildProductionPostAcquireHook`). Read + emit it; NO\n// re-boot.\n// - Otherwise, run the SAME one-shot boot `apply` runs when no\n// supervisor is live (`runApplyLive` → `superviseStackWithProductionBoot`\n// with `lifetime: 'one-shot'`). That boots, writes the id-config to\n// `<stackRoot>/devstack-ids.json`, and tears down. We then read the\n// freshly-written file and emit it.\n//\n// The on-disk file is already pretty-printed by `writeIdConfig`\n// (`JSON.stringify(config, null, 2)\\n`), so `--out` copies its bytes\n// verbatim and stdout prints them verbatim — the format matches the\n// boot-written file exactly.\n\nimport { readFileSync, writeFileSync } from 'node:fs';\nimport { resolve as resolvePath } from 'node:path';\n\nimport { Effect, Exit } from 'effect';\n\nimport type { SupervisedStack } from '../../substrate/runtime/index.ts';\nimport { decodeIdConfig, ID_CONFIG_FILENAME } from '../../orchestrators/codegen/id-config.ts';\nimport { type CliError, CliInternalError } from '../../surfaces/cli/errors.ts';\nimport { type CommandResult } from '../../surfaces/cli/commands/index.ts';\nimport { probeSupervisorPresence } from '../../surfaces/cli/commands/index.ts';\nimport { ExitCode } from '../../surfaces/cli/sysexits.ts';\nimport { type CliIO, emitSuccess } from '../../surfaces/cli/output.ts';\nimport type { OutputMode } from '../../surfaces/cli/flags.ts';\nimport type { LoadedConfig } from '../../surfaces/cli/commands/config-loader.ts';\n\nimport { cliErrorFromConfigExit } from '../bail.ts';\nimport { makeConfigLoader } from './config-loader.ts';\nimport { resolvedIdentityForStack, type ResolvedIdentity } from './identity.ts';\nimport { runApplyLive } from './apply.ts';\n\nexport interface DumpIdsOptions {\n\treadonly configPath: string | undefined;\n\t/** Destination for the pretty id-config JSON. When omitted, the JSON\n\t * is printed to stdout. */\n\treadonly out: string | undefined;\n\treadonly io: CliIO;\n\treadonly outputMode: OutputMode;\n}\n\n/** Read the on-disk id-config as raw text. The file is written by boot's\n * post-acquire hook (`writeIdConfig`) at `<stackRoot>/devstack-ids.json`;\n * a miss here means the boot never produced it (or a hand-removal), which\n * is an internal inconsistency the operator can't act on directly. */\nconst readIdConfigText = (idsFile: string): Effect.Effect<string, CliError> =>\n\tEffect.try({\n\t\ttry: () => readFileSync(idsFile, 'utf8'),\n\t\tcatch: (cause) =>\n\t\t\tnew CliInternalError({\n\t\t\t\tmessage: `failed to read id-config at ${idsFile}`,\n\t\t\t\tcause,\n\t\t\t}),\n\t});\n\nconst writeOutFile = (out: string, text: string): Effect.Effect<void, CliError> =>\n\tEffect.try({\n\t\ttry: () => writeFileSync(out, text, 'utf8'),\n\t\tcatch: (cause) =>\n\t\t\tnew CliInternalError({ message: `failed to write id-config to ${out}`, cause }),\n\t});\n\n/** Decode the id-config text for the JSON envelope `data`, routed through\n * the shared {@link decodeIdConfig} so the parse-and-validate decision is\n * centralized (same seam the Vite plugin and codegen verb use). A failure\n * here means the on-disk file is corrupt — bad JSON OR a shape that\n * violates `IdConfigSchema` — so surface it rather than emit a bad\n * envelope. (The file is written by `writeIdConfig` from the same schema,\n * so a conforming boot-written file always decodes; only a corrupt or\n * hand-edited file trips the stricter validation.) */\nconst parseIdConfig = (text: string, idsFile: string): Effect.Effect<unknown, CliError> =>\n\tEffect.try({\n\t\ttry: () => decodeIdConfig(text),\n\t\tcatch: (cause) =>\n\t\t\tnew CliInternalError({ message: `id-config at ${idsFile} is not valid JSON`, cause }),\n\t});\n\nexport const runDumpIds = (\n\tidentity: ResolvedIdentity,\n\topts: DumpIdsOptions,\n): Effect.Effect<CommandResult, CliError> => {\n\tconst loader = makeConfigLoader();\n\treturn Effect.gen(function* () {\n\t\tconst started = Date.now();\n\n\t\t// Resolve identity against the EFFECTIVE stack (explicit\n\t\t// `--stack`/env > `config.stackName` > inferred), matching `apply` /\n\t\t// `snapshot`, so the roster probe + id-config path target the same\n\t\t// stack the operator selected.\n\t\tconst loadExit = yield* Effect.exit(loader.load(opts.configPath));\n\t\tif (Exit.isFailure(loadExit)) {\n\t\t\treturn yield* Effect.fail(cliErrorFromConfigExit(loadExit));\n\t\t}\n\t\tconst stack = (loadExit.value as LoadedConfig & { readonly engine: SupervisedStack }).engine;\n\t\tconst effectiveIdentity = resolvedIdentityForStack(identity, stack);\n\t\tconst idsFile = resolvePath(effectiveIdentity.stackRoot, ID_CONFIG_FILENAME);\n\n\t\t// Live supervisor? The id-config already exists on disk (boot wrote\n\t\t// it). Otherwise run the one-shot boot `apply` runs when nothing is\n\t\t// live — it writes the id-config to `idsFile` and tears down — then\n\t\t// read the file it produced.\n\t\tconst presence = yield* probeSupervisorPresence(effectiveIdentity.rosterFile).pipe(\n\t\t\tEffect.catch(() => Effect.succeed({ live: false, pid: null, hostname: null })),\n\t\t);\n\t\tif (!presence.live) {\n\t\t\t// `runApplyLive` re-probes (sees no live supervisor) and runs the\n\t\t\t// one-shot boot; its config-load / boot failures already surface as\n\t\t\t// typed `CliError`s. We pass the ORIGINAL identity — `runApplyLive`\n\t\t\t// re-derives the effective stack from the same config internally.\n\t\t\tyield* runApplyLive(opts.configPath, identity);\n\t\t}\n\n\t\tconst text = yield* readIdConfigText(idsFile);\n\t\tconst data = yield* parseIdConfig(text, idsFile);\n\n\t\tif (opts.out !== undefined) {\n\t\t\tyield* writeOutFile(opts.out, text);\n\t\t\tyield* emitSuccess(opts.io, opts.outputMode, {\n\t\t\t\tcommand: 'dump-ids',\n\t\t\t\telapsedMs: Date.now() - started,\n\t\t\t\tdata,\n\t\t\t\thumanLines: [`wrote id-config to ${opts.out}`],\n\t\t\t});\n\t\t\treturn { exitCode: ExitCode.OK };\n\t\t}\n\n\t\t// No `--out`: print the id-config JSON to stdout. In human mode the\n\t\t// raw pretty JSON IS the output (trailing newline trimmed by the IO\n\t\t// layer); in JSON mode the same object rides the success envelope's\n\t\t// `data`.\n\t\tyield* emitSuccess(opts.io, opts.outputMode, {\n\t\t\tcommand: 'dump-ids',\n\t\t\telapsedMs: Date.now() - started,\n\t\t\tdata,\n\t\t\thumanLines: [text.endsWith('\\n') ? text.slice(0, -1) : text],\n\t\t});\n\t\treturn { exitCode: ExitCode.OK };\n\t});\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAyDA,MAAM,oBAAoB,YACzB,OAAO,IAAI;CACV,WAAW,aAAa,SAAS,MAAM;CACvC,QAAQ,UACP,IAAI,iBAAiB;EACpB,SAAS,+BAA+B;EACxC;CACD,CAAC;AACH,CAAC;AAEF,MAAM,gBAAgB,KAAa,SAClC,OAAO,IAAI;CACV,WAAW,cAAc,KAAK,MAAM,MAAM;CAC1C,QAAQ,UACP,IAAI,iBAAiB;EAAE,SAAS,gCAAgC;EAAO;CAAM,CAAC;AAChF,CAAC;;;;;;;;;AAUF,MAAM,iBAAiB,MAAc,YACpC,OAAO,IAAI;CACV,WAAW,eAAe,IAAI;CAC9B,QAAQ,UACP,IAAI,iBAAiB;EAAE,SAAS,gBAAgB,QAAQ;EAAqB;CAAM,CAAC;AACtF,CAAC;AAEF,MAAa,cACZ,UACA,SAC4C;CAC5C,MAAM,SAAS,iBAAiB;CAChC,OAAO,OAAO,IAAI,aAAa;EAC9B,MAAM,UAAU,KAAK,IAAI;EAMzB,MAAM,WAAW,OAAO,OAAO,KAAK,OAAO,KAAK,KAAK,UAAU,CAAC;EAChE,IAAI,KAAK,UAAU,QAAQ,GAC1B,OAAO,OAAO,OAAO,KAAK,uBAAuB,QAAQ,CAAC;EAE3D,MAAM,QAAS,SAAS,MAA8D;EACtF,MAAM,oBAAoB,yBAAyB,UAAU,KAAK;EAClE,MAAM,UAAUA,QAAY,kBAAkB,WAAW,kBAAkB;EAS3E,IAAI,EAAC,OAHmB,wBAAwB,kBAAkB,UAAU,CAAC,CAAC,KAC7E,OAAO,YAAY,OAAO,QAAQ;GAAE,MAAM;GAAO,KAAK;GAAM,UAAU;EAAK,CAAC,CAAC,CAC9E,EAAA,CACc,MAKb,OAAO,aAAa,KAAK,YAAY,QAAQ;EAG9C,MAAM,OAAO,OAAO,iBAAiB,OAAO;EAC5C,MAAM,OAAO,OAAO,cAAc,MAAM,OAAO;EAE/C,IAAI,KAAK,QAAQ,KAAA,GAAW;GAC3B,OAAO,aAAa,KAAK,KAAK,IAAI;GAClC,OAAO,YAAY,KAAK,IAAI,KAAK,YAAY;IAC5C,SAAS;IACT,WAAW,KAAK,IAAI,IAAI;IACxB;IACA,YAAY,CAAC,sBAAsB,KAAK,KAAK;GAC9C,CAAC;GACD,OAAO,EAAE,UAAU,SAAS,GAAG;EAChC;EAMA,OAAO,YAAY,KAAK,IAAI,KAAK,YAAY;GAC5C,SAAS;GACT,WAAW,KAAK,IAAI,IAAI;GACxB;GACA,YAAY,CAAC,KAAK,SAAS,IAAI,IAAI,KAAK,MAAM,GAAG,EAAE,IAAI,IAAI;EAC5D,CAAC;EACD,OAAO,EAAE,UAAU,SAAS,GAAG;CAChC,CAAC;AACF"}
|
|
@@ -20,7 +20,7 @@ const isEngineCommand = (value) => {
|
|
|
20
20
|
case "shutdown.hardKillRequested": return (record.signal === "SIGINT" || record.signal === "SIGTERM") && typeof record.exitCode === "number" && typeof record.at === "number";
|
|
21
21
|
case "selective-restart.requested": return hasString(record, "pluginKey");
|
|
22
22
|
case "apply.requested": return record.pluginKey === void 0 || typeof record.pluginKey === "string";
|
|
23
|
-
case "snapshot.capture": return (record.snapshotId === void 0 || typeof record.snapshotId === "string") && (record.name === void 0 || typeof record.name === "string");
|
|
23
|
+
case "snapshot.capture": return (record.snapshotId === void 0 || typeof record.snapshotId === "string") && (record.name === void 0 || typeof record.name === "string") && (record.replaceExisting === void 0 || typeof record.replaceExisting === "boolean");
|
|
24
24
|
default: return false;
|
|
25
25
|
}
|
|
26
26
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine-command.mjs","names":["knownTag"],"sources":["../../../src/cli/wirings/engine-command.ts"],"sourcesContent":["// Type guard for `EngineCommand` records arriving over the\n// cross-process command channel. Exhaustive switch over the union's\n// tag — a new variant added without a corresponding case here fails\n// typecheck on the `_exhaustive: never` proof so we never drift.\n\nimport type { EngineCommand } from '../../substrate/events.ts';\n\nconst hasString = (value: Record<string, unknown>, key: string): boolean =>\n\ttypeof value[key] === 'string';\n\nexport const isEngineCommand = (value: unknown): value is EngineCommand => {\n\tif (typeof value !== 'object' || value === null) return false;\n\tconst record = value as Record<string, unknown>;\n\tconst tag = record.tag;\n\tif (typeof tag !== 'string') return false;\n\tconst knownTag = tag as EngineCommand['tag'];\n\tswitch (knownTag) {\n\t\tcase 'stack.start':\n\t\tcase 'stack.stop':\n\t\tcase 'stack.restart':\n\t\tcase 'codegen.requested':\n\t\tcase 'snapshot.list':\n\t\tcase 'wipe.requested':\n\t\tcase 'prune.requested':\n\t\tcase 'shutdown.requested':\n\t\t\treturn true;\n\t\tcase 'snapshot.restore':\n\t\tcase 'snapshot.delete':\n\t\t\treturn hasString(record, 'snapshotId');\n\t\tcase 'advance-clock.requested':\n\t\t\treturn typeof record.toMillis === 'number';\n\t\tcase 'shutdown.hardKillRequested':\n\t\t\treturn (\n\t\t\t\t(record.signal === 'SIGINT' || record.signal === 'SIGTERM') &&\n\t\t\t\ttypeof record.exitCode === 'number' &&\n\t\t\t\ttypeof record.at === 'number'\n\t\t\t);\n\t\tcase 'selective-restart.requested':\n\t\t\treturn hasString(record, 'pluginKey');\n\t\tcase 'apply.requested':\n\t\t\treturn record.pluginKey === undefined || typeof record.pluginKey === 'string';\n\t\tcase 'snapshot.capture':\n\t\t\treturn (\n\t\t\t\t(record.snapshotId === undefined || typeof record.snapshotId === 'string') &&\n\t\t\t\t(record.name === undefined || typeof record.name === 'string')\n\t\t\t);\n\t\tdefault: {\n\t\t\tconst _exhaustive: never = knownTag;\n\t\t\tvoid _exhaustive;\n\t\t\treturn false;\n\t\t}\n\t}\n};\n"],"mappings":";AAOA,MAAM,aAAa,OAAgC,QAClD,OAAO,MAAM,SAAS;AAEvB,MAAa,mBAAmB,UAA2C;
|
|
1
|
+
{"version":3,"file":"engine-command.mjs","names":["knownTag"],"sources":["../../../src/cli/wirings/engine-command.ts"],"sourcesContent":["// Type guard for `EngineCommand` records arriving over the\n// cross-process command channel. Exhaustive switch over the union's\n// tag — a new variant added without a corresponding case here fails\n// typecheck on the `_exhaustive: never` proof so we never drift.\n\nimport type { EngineCommand } from '../../substrate/events.ts';\n\nconst hasString = (value: Record<string, unknown>, key: string): boolean =>\n\ttypeof value[key] === 'string';\n\nexport const isEngineCommand = (value: unknown): value is EngineCommand => {\n\tif (typeof value !== 'object' || value === null) return false;\n\tconst record = value as Record<string, unknown>;\n\tconst tag = record.tag;\n\tif (typeof tag !== 'string') return false;\n\tconst knownTag = tag as EngineCommand['tag'];\n\tswitch (knownTag) {\n\t\tcase 'stack.start':\n\t\tcase 'stack.stop':\n\t\tcase 'stack.restart':\n\t\tcase 'codegen.requested':\n\t\tcase 'snapshot.list':\n\t\tcase 'wipe.requested':\n\t\tcase 'prune.requested':\n\t\tcase 'shutdown.requested':\n\t\t\treturn true;\n\t\tcase 'snapshot.restore':\n\t\tcase 'snapshot.delete':\n\t\t\treturn hasString(record, 'snapshotId');\n\t\tcase 'advance-clock.requested':\n\t\t\treturn typeof record.toMillis === 'number';\n\t\tcase 'shutdown.hardKillRequested':\n\t\t\treturn (\n\t\t\t\t(record.signal === 'SIGINT' || record.signal === 'SIGTERM') &&\n\t\t\t\ttypeof record.exitCode === 'number' &&\n\t\t\t\ttypeof record.at === 'number'\n\t\t\t);\n\t\tcase 'selective-restart.requested':\n\t\t\treturn hasString(record, 'pluginKey');\n\t\tcase 'apply.requested':\n\t\t\treturn record.pluginKey === undefined || typeof record.pluginKey === 'string';\n\t\tcase 'snapshot.capture':\n\t\t\treturn (\n\t\t\t\t(record.snapshotId === undefined || typeof record.snapshotId === 'string') &&\n\t\t\t\t(record.name === undefined || typeof record.name === 'string') &&\n\t\t\t\t(record.replaceExisting === undefined || typeof record.replaceExisting === 'boolean')\n\t\t\t);\n\t\tdefault: {\n\t\t\tconst _exhaustive: never = knownTag;\n\t\t\tvoid _exhaustive;\n\t\t\treturn false;\n\t\t}\n\t}\n};\n"],"mappings":";AAOA,MAAM,aAAa,OAAgC,QAClD,OAAO,MAAM,SAAS;AAEvB,MAAa,mBAAmB,UAA2C;CAC1E,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO;CACxD,MAAM,SAAS;CACf,MAAM,MAAM,OAAO;CACnB,IAAI,OAAO,QAAQ,UAAU,OAAO;CAEpC,QAAQA,KAAR;EACC,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK,sBACJ,OAAO;EACR,KAAK;EACL,KAAK,mBACJ,OAAO,UAAU,QAAQ,YAAY;EACtC,KAAK,2BACJ,OAAO,OAAO,OAAO,aAAa;EACnC,KAAK,8BACJ,QACE,OAAO,WAAW,YAAY,OAAO,WAAW,cACjD,OAAO,OAAO,aAAa,YAC3B,OAAO,OAAO,OAAO;EAEvB,KAAK,+BACJ,OAAO,UAAU,QAAQ,WAAW;EACrC,KAAK,mBACJ,OAAO,OAAO,cAAc,KAAA,KAAa,OAAO,OAAO,cAAc;EACtE,KAAK,oBACJ,QACE,OAAO,eAAe,KAAA,KAAa,OAAO,OAAO,eAAe,cAChE,OAAO,SAAS,KAAA,KAAa,OAAO,OAAO,SAAS,cACpD,OAAO,oBAAoB,KAAA,KAAa,OAAO,OAAO,oBAAoB;EAE7E,SAGC,OAAO;CAET;AACD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { appName,
|
|
1
|
+
import { appName, stackName } from "../../substrate/brand.mjs";
|
|
2
2
|
import { CliSupervisorLiveError } from "../../surfaces/cli/errors.mjs";
|
|
3
3
|
import { probeSupervisorPresence } from "../../surfaces/cli/commands/supervisor-presence.mjs";
|
|
4
4
|
import "../../surfaces/cli/commands/index.mjs";
|
|
@@ -26,7 +26,7 @@ const effectiveStackName = (identity, stack) => identity.explicitStack ?? stack?
|
|
|
26
26
|
const identityValueFor = (identity, stack) => ({
|
|
27
27
|
app: appName(identity.app),
|
|
28
28
|
stack: stackName(effectiveStackName(identity, stack)),
|
|
29
|
-
|
|
29
|
+
network: identity.network
|
|
30
30
|
});
|
|
31
31
|
/** When a verb loads a config whose `stackName` may differ from the
|
|
32
32
|
* effective stack, re-derive the `ResolvedIdentity` against the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.mjs","names":["resolvePath"],"sources":["../../../src/cli/wirings/identity.ts"],"sourcesContent":["// Shared identity types + helpers consumed by every verb wiring.\n//\n// `ResolvedIdentity` is the flat CLI-internal identity bundle (app /\n// stack / network / runtimeRoot / stackRoot) that the `main.ts` argv\n// pre-parser produces. Wirings consume it directly; they do NOT\n// re-derive identity from process.env.\n\nimport { resolve as resolvePath } from 'node:path';\n\nimport { Cause, Effect } from 'effect';\n\nimport { appName,
|
|
1
|
+
{"version":3,"file":"identity.mjs","names":["resolvePath"],"sources":["../../../src/cli/wirings/identity.ts"],"sourcesContent":["// Shared identity types + helpers consumed by every verb wiring.\n//\n// `ResolvedIdentity` is the flat CLI-internal identity bundle (app /\n// stack / network / runtimeRoot / stackRoot) that the `main.ts` argv\n// pre-parser produces. Wirings consume it directly; they do NOT\n// re-derive identity from process.env.\n\nimport { resolve as resolvePath } from 'node:path';\n\nimport { Cause, Effect } from 'effect';\n\nimport { appName, stackName } from '../../substrate/brand.ts';\nimport type { Identity } from '../../substrate/identity.ts';\nimport type { SupervisedStack } from '../../substrate/runtime/index.ts';\nimport { CliSupervisorLiveError } from '../../surfaces/cli/index.ts';\nimport { probeSupervisorPresence } from '../../surfaces/cli/commands/index.ts';\n\nexport interface ResolvedIdentity {\n\treadonly app: string;\n\treadonly stack: string;\n\treadonly network: string;\n\treadonly runtimeRoot: string;\n\treadonly stacksRoot: string;\n\treadonly stackRoot: string;\n\treadonly rosterFile: string;\n\t/** The stack name the operator supplied EXPLICITLY via the `--stack`\n\t * flag or `$DEVSTACK_STACK` env var — `undefined` when neither was\n\t * given (i.e. `stack` above was cwd/package-inferred). Threaded from\n\t * `main.ts`'s argv pre-parser so the stack-precedence ladder below\n\t * can let an explicit flag/env beat a config-declared `stackName`. */\n\treadonly explicitStack?: string | undefined;\n}\n\nexport const stackRootFor = (runtimeRoot: string, stack: string): string =>\n\tresolvePath(runtimeRoot, 'stacks', stack);\n\n/** Stack-name precedence ladder, mirrored from the state-dir ladder in\n * `main.ts` (`--state-dir` flag > `config.stateDir` > env > default):\n *\n * explicit `--stack` / `$DEVSTACK_STACK` (`identity.explicitStack`)\n * > config's `defineDevstack({ stackName })` (`stack.options.stackName`)\n * > cwd/package inference (already folded into `identity.stack`,\n * default `'main'`).\n *\n * The explicit rung MUST win over a config `stackName` so an operator\n * can run `pnpm dev` (default stack) and `pnpm test:e2e` (a `test`/`e2e`\n * stack via `--stack`/env) against the SAME config concurrently — the\n * two supervisors then claim distinct stack roots instead of colliding\n * on `error: supervisor live for <app>/<stack>` (exit 40). `runStack`\n * (`api/run-stack.ts`) already prefers its explicit option over\n * `stack.options.stackName`; this keeps the CLI consistent with it. */\nconst effectiveStackName = (identity: ResolvedIdentity, stack?: SupervisedStack): string =>\n\tidentity.explicitStack ?? stack?.options.stackName ?? identity.stack;\n\nexport const identityValueFor = (\n\tidentity: ResolvedIdentity,\n\tstack?: SupervisedStack,\n): Identity => ({\n\tapp: appName(identity.app),\n\tstack: stackName(effectiveStackName(identity, stack)),\n\tnetwork: identity.network,\n});\n\n/** When a verb loads a config whose `stackName` may differ from the\n * effective stack, re-derive the `ResolvedIdentity` against the\n * effective stack so the stack-root, roster file, and command channel\n * paths all target the same stack the supervisor uses. The effective\n * stack follows the precedence ladder documented on `effectiveStackName`\n * (explicit flag/env > config `stackName` > inferred), so an explicit\n * `--stack`/`$DEVSTACK_STACK` is NOT overridden by `config.stackName`. */\nexport const resolvedIdentityForStack = (\n\tidentity: ResolvedIdentity,\n\tstack: SupervisedStack,\n): ResolvedIdentity => {\n\tconst stackValue = effectiveStackName(identity, stack);\n\tconst stackRoot = stackRootFor(identity.runtimeRoot, stackValue);\n\treturn {\n\t\t...identity,\n\t\tstack: stackValue,\n\t\tstackRoot,\n\t\trosterFile: resolvePath(stackRoot, 'roster.json'),\n\t};\n};\n\n/** Probe the roster file; if a supervisor is live, refuse the verb\n * with a `CliSupervisorLiveError` carrying the operator hint. */\nexport const ensureNoLiveSupervisor = (\n\tidentity: ResolvedIdentity,\n\thint: string,\n): Effect.Effect<void, CliSupervisorLiveError> =>\n\tEffect.gen(function* () {\n\t\tconst presence = yield* probeSupervisorPresence(identity.rosterFile).pipe(\n\t\t\tEffect.catch(() => Effect.succeed({ live: false, pid: null, hostname: null })),\n\t\t);\n\t\tif (presence.live) {\n\t\t\treturn yield* Effect.fail(\n\t\t\t\tnew CliSupervisorLiveError({\n\t\t\t\t\tapp: identity.app,\n\t\t\t\t\tstack: identity.stack,\n\t\t\t\t\thint,\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\t});\n\nexport const findCliSupervisorLiveError = (\n\tcause: Cause.Cause<unknown>,\n): CliSupervisorLiveError | null => {\n\tfor (const reason of cause.reasons) {\n\t\tif (!Cause.isFailReason(reason)) continue;\n\t\tconst error = reason.error;\n\t\tif (\n\t\t\ttypeof error === 'object' &&\n\t\t\terror !== null &&\n\t\t\t(error as { readonly _tag?: unknown })._tag === 'CliSupervisorLiveError'\n\t\t) {\n\t\t\treturn error as CliSupervisorLiveError;\n\t\t}\n\t}\n\treturn null;\n};\n"],"mappings":";;;;;;;;AAiCA,MAAa,gBAAgB,aAAqB,UACjDA,QAAY,aAAa,UAAU,KAAK;;;;;;;;;;;;;;;;AAiBzC,MAAM,sBAAsB,UAA4B,UACvD,SAAS,iBAAiB,OAAO,QAAQ,aAAa,SAAS;AAEhE,MAAa,oBACZ,UACA,WACe;CACf,KAAK,QAAQ,SAAS,GAAG;CACzB,OAAO,UAAU,mBAAmB,UAAU,KAAK,CAAC;CACpD,SAAS,SAAS;AACnB;;;;;;;;AASA,MAAa,4BACZ,UACA,UACsB;CACtB,MAAM,aAAa,mBAAmB,UAAU,KAAK;CACrD,MAAM,YAAY,aAAa,SAAS,aAAa,UAAU;CAC/D,OAAO;EACN,GAAG;EACH,OAAO;EACP;EACA,YAAYA,QAAY,WAAW,aAAa;CACjD;AACD;;;AAIA,MAAa,0BACZ,UACA,SAEA,OAAO,IAAI,aAAa;CAIvB,KAAI,OAHoB,wBAAwB,SAAS,UAAU,CAAC,CAAC,KACpE,OAAO,YAAY,OAAO,QAAQ;EAAE,MAAM;EAAO,KAAK;EAAM,UAAU;CAAK,CAAC,CAAC,CAC9E,EAAA,CACa,MACZ,OAAO,OAAO,OAAO,KACpB,IAAI,uBAAuB;EAC1B,KAAK,SAAS;EACd,OAAO,SAAS;EAChB;CACD,CAAC,CACF;AAEF,CAAC;AAEF,MAAa,8BACZ,UACmC;CACnC,KAAK,MAAM,UAAU,MAAM,SAAS;EACnC,IAAI,CAAC,MAAM,aAAa,MAAM,GAAG;EACjC,MAAM,QAAQ,OAAO;EACrB,IACC,OAAO,UAAU,YACjB,UAAU,QACT,MAAsC,SAAS,0BAEhD,OAAO;CAET;CACA,OAAO;AACR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provide-file-system.mjs","names":[],"sources":["../../../src/cli/wirings/provide-file-system.ts"],"sourcesContent":["// Shared `provideFileSystem` helper for verb wirings.\n//\n// Several wirings (`up`, `snapshot`, `wipe`) hoist a `FileSystem.FileSystem`\n// out of an enclosing Effect and re-thread it into sub-Effects that depend\n// on it. Factor the one-liner so we don't drift on signature/import (and so\n// later changes — e.g. tagging the call site with a span — happen in one\n// place).\n\nimport { Effect, FileSystem } from 'effect';\n\nexport const provideFileSystem = <A, E, R>(\n\tfs: FileSystem.FileSystem,\n\teffect: Effect.Effect<A, E, R | FileSystem.FileSystem>,\n): Effect.Effect<A, E, Exclude<R, FileSystem.FileSystem>> =>\n\teffect.pipe(Effect.provideService(FileSystem.FileSystem, fs)) as Effect.Effect<\n\t\tA,\n\t\tE,\n\t\tExclude<R, FileSystem.FileSystem>\n\t>;\n"],"mappings":";;AAUA,MAAa,qBACZ,IACA,WAEA,OAAO,KAAK,OAAO,eAAe,WAAW,YAAY,
|
|
1
|
+
{"version":3,"file":"provide-file-system.mjs","names":[],"sources":["../../../src/cli/wirings/provide-file-system.ts"],"sourcesContent":["// Shared `provideFileSystem` helper for verb wirings.\n//\n// Several wirings (`up`, `snapshot`, `wipe`) hoist a `FileSystem.FileSystem`\n// out of an enclosing Effect and re-thread it into sub-Effects that depend\n// on it. Factor the one-liner so we don't drift on signature/import (and so\n// later changes — e.g. tagging the call site with a span — happen in one\n// place).\n\nimport { Effect, FileSystem } from 'effect';\n\nexport const provideFileSystem = <A, E, R>(\n\tfs: FileSystem.FileSystem,\n\teffect: Effect.Effect<A, E, R | FileSystem.FileSystem>,\n): Effect.Effect<A, E, Exclude<R, FileSystem.FileSystem>> =>\n\teffect.pipe(Effect.provideService(FileSystem.FileSystem, fs)) as Effect.Effect<\n\t\tA,\n\t\tE,\n\t\tExclude<R, FileSystem.FileSystem>\n\t>;\n"],"mappings":";;AAUA,MAAa,qBACZ,IACA,WAEA,OAAO,KAAK,OAAO,eAAe,WAAW,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
//#region src/cli/wirings/read-devstack-version.ts
|
|
3
|
+
const readDevstackVersion = (opts) => {
|
|
4
|
+
try {
|
|
5
|
+
const raw = readFileSync(new URL("../../../package.json", import.meta.url), "utf8");
|
|
6
|
+
const pkg = JSON.parse(raw);
|
|
7
|
+
if (typeof pkg.version !== "string") throw new Error("devstack package.json is missing a string version");
|
|
8
|
+
return pkg.version;
|
|
9
|
+
} catch (cause) {
|
|
10
|
+
if (opts?.fallback !== void 0) return opts.fallback;
|
|
11
|
+
throw cause;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { readDevstackVersion };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=read-devstack-version.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-devstack-version.mjs","names":[],"sources":["../../../src/cli/wirings/read-devstack-version.ts"],"sourcesContent":["import { readFileSync } from 'node:fs';\n\nexport const readDevstackVersion = (opts?: { readonly fallback?: string }): string => {\n\ttry {\n\t\tconst raw = readFileSync(new URL('../../../package.json', import.meta.url), 'utf8');\n\t\tconst pkg = JSON.parse(raw) as { readonly version?: unknown };\n\t\tif (typeof pkg.version !== 'string') {\n\t\t\tthrow new Error('devstack package.json is missing a string version');\n\t\t}\n\t\treturn pkg.version;\n\t} catch (cause) {\n\t\tif (opts?.fallback !== undefined) return opts.fallback;\n\t\tthrow cause;\n\t}\n};\n"],"mappings":";;AAEA,MAAa,uBAAuB,SAAkD;CACrF,IAAI;EACH,MAAM,MAAM,aAAa,IAAI,IAAI,yBAAyB,OAAO,KAAK,GAAG,GAAG,MAAM;EAClF,MAAM,MAAM,KAAK,MAAM,GAAG;EAC1B,IAAI,OAAO,IAAI,YAAY,UAC1B,MAAM,IAAI,MAAM,mDAAmD;EAEpE,OAAO,IAAI;CACZ,SAAS,OAAO;EACf,IAAI,MAAM,aAAa,KAAA,GAAW,OAAO,KAAK;EAC9C,MAAM;CACP;AACD"}
|