@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
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
//#region src/substrate/runtime/tar/reader.ts
|
|
2
|
+
const TAR_BLOCK_SIZE = 512;
|
|
3
|
+
/** Max bytes a single pax/gnu extended-header record may declare. A
|
|
4
|
+
* larger declared size is rejected so a malicious archive cannot force
|
|
5
|
+
* unbounded in-memory buffering of an "extended path". */
|
|
6
|
+
const MAX_TAR_EXTENDED_PATH_BYTES = 1024 * 1024;
|
|
7
|
+
const bytesToString = (bytes) => {
|
|
8
|
+
const nul = bytes.indexOf(0);
|
|
9
|
+
const end = nul === -1 ? bytes.length : nul;
|
|
10
|
+
return Buffer.from(bytes.subarray(0, end)).toString("utf8");
|
|
11
|
+
};
|
|
12
|
+
const concatBytes = (a, b) => {
|
|
13
|
+
if (a.length === 0) return b;
|
|
14
|
+
if (b.length === 0) return a;
|
|
15
|
+
const out = new Uint8Array(a.length + b.length);
|
|
16
|
+
out.set(a, 0);
|
|
17
|
+
out.set(b, a.length);
|
|
18
|
+
return out;
|
|
19
|
+
};
|
|
20
|
+
const consumeBytes = (buffer, count) => buffer.subarray(count);
|
|
21
|
+
const isZeroBlock = (block) => block.every((byte) => byte === 0);
|
|
22
|
+
const parseTarSize = (header) => {
|
|
23
|
+
const raw = bytesToString(header.subarray(124, 136)).trim();
|
|
24
|
+
if (raw === "") return 0;
|
|
25
|
+
if (!/^[0-7]+$/.test(raw)) return null;
|
|
26
|
+
const parsed = Number.parseInt(raw, 8);
|
|
27
|
+
return Number.isSafeInteger(parsed) && parsed >= 0 ? parsed : null;
|
|
28
|
+
};
|
|
29
|
+
const tarPathFromHeader = (header) => {
|
|
30
|
+
const name = bytesToString(header.subarray(0, 100));
|
|
31
|
+
const prefix = bytesToString(header.subarray(345, 500));
|
|
32
|
+
return prefix === "" ? name : `${prefix}/${name}`;
|
|
33
|
+
};
|
|
34
|
+
const tarLinkPathFromHeader = (header) => bytesToString(header.subarray(157, 257));
|
|
35
|
+
const trimExtendedPath = (bytes) => {
|
|
36
|
+
const value = Buffer.from(bytes).toString("utf8").replace(/\n$/g, "");
|
|
37
|
+
let end = value.length;
|
|
38
|
+
while (end > 0 && value.charCodeAt(end - 1) === 0) end -= 1;
|
|
39
|
+
return value.slice(0, end);
|
|
40
|
+
};
|
|
41
|
+
/** Reject paths that would escape the extraction target: absolute,
|
|
42
|
+
* drive-qualified, NUL- or backslash-bearing, `.`-only, or carrying a
|
|
43
|
+
* `..` segment. Applied producer-side (relPaths) and consumer-side
|
|
44
|
+
* (every resolved entry path + hardlink/symlink target). */
|
|
45
|
+
const isSafeArchivePath = (entryPath) => {
|
|
46
|
+
if (entryPath === "" || entryPath === "." || entryPath.includes("\0") || entryPath.includes("\\") || entryPath.startsWith("/") || /^[A-Za-z]:/.test(entryPath)) return false;
|
|
47
|
+
const meaningfulSegments = entryPath.split("/").filter((segment) => segment !== "" && segment !== ".");
|
|
48
|
+
return meaningfulSegments.length > 0 && !meaningfulSegments.includes("..");
|
|
49
|
+
};
|
|
50
|
+
const parsePaxRecords = (bytes) => {
|
|
51
|
+
const text = Buffer.from(bytes).toString("utf8");
|
|
52
|
+
const records = {};
|
|
53
|
+
let offset = 0;
|
|
54
|
+
while (offset < text.length) {
|
|
55
|
+
const space = text.indexOf(" ", offset);
|
|
56
|
+
if (space === -1) break;
|
|
57
|
+
const lengthText = text.slice(offset, space);
|
|
58
|
+
const recordLength = Number.parseInt(lengthText, 10);
|
|
59
|
+
if (!Number.isSafeInteger(recordLength) || recordLength <= 0) break;
|
|
60
|
+
const record = text.slice(space + 1, offset + recordLength).replace(/\n$/g, "");
|
|
61
|
+
const eq = record.indexOf("=");
|
|
62
|
+
if (eq > 0) records[record.slice(0, eq)] = record.slice(eq + 1);
|
|
63
|
+
offset += recordLength;
|
|
64
|
+
}
|
|
65
|
+
return records;
|
|
66
|
+
};
|
|
67
|
+
const SKIP = { disposition: "skip" };
|
|
68
|
+
const STOP = { disposition: "stop" };
|
|
69
|
+
const skipEntry = () => SKIP;
|
|
70
|
+
const captureEntry = () => ({ disposition: "capture" });
|
|
71
|
+
const stopScan = () => STOP;
|
|
72
|
+
const makeTarReaderState = () => ({
|
|
73
|
+
buffer: new Uint8Array(0),
|
|
74
|
+
skipRemaining: 0,
|
|
75
|
+
content: null,
|
|
76
|
+
pendingPath: null,
|
|
77
|
+
pendingLinkPath: null,
|
|
78
|
+
stopped: false
|
|
79
|
+
});
|
|
80
|
+
const isDirective = (value) => typeof value === "object" && value !== null && "disposition" in value && (value.disposition === "skip" || value.disposition === "capture" || value.disposition === "stop");
|
|
81
|
+
const flattenChunks = (chunks) => chunks.length === 1 ? chunks[0] : Buffer.concat(chunks.map((chunk) => Buffer.from(chunk)));
|
|
82
|
+
const applyExtended = (state, content, hooks) => {
|
|
83
|
+
const bytes = flattenChunks(content.chunks);
|
|
84
|
+
if (content.extendedKind === "gnu-path") {
|
|
85
|
+
state.pendingPath = trimExtendedPath(bytes);
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
if (content.extendedKind === "gnu-link") {
|
|
89
|
+
state.pendingLinkPath = trimExtendedPath(bytes);
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
const records = parsePaxRecords(bytes);
|
|
93
|
+
if (content.extendedKind === "pax-global" && (records.path !== void 0 || records.linkpath !== void 0)) return hooks.onExtendedError("global pax path/linkpath records are not supported");
|
|
94
|
+
if (content.extendedKind === "pax-local") {
|
|
95
|
+
if (records.path !== void 0) state.pendingPath = records.path;
|
|
96
|
+
if (records.linkpath !== void 0) state.pendingLinkPath = records.linkpath;
|
|
97
|
+
}
|
|
98
|
+
return null;
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* Feed one stream chunk to the reader. Resolves as many complete entries
|
|
102
|
+
* as the accumulated buffer allows, invoking `hooks.onEntry` (and
|
|
103
|
+
* `hooks.onContent` for captured bodies). Returns a caller-typed error
|
|
104
|
+
* on the first hook failure or invalid extended record, else `null`.
|
|
105
|
+
*
|
|
106
|
+
* Returns once `state.stopped` is set (a `'stop'` directive) so callers
|
|
107
|
+
* draining via a `takeUntil`-style stream can short-circuit.
|
|
108
|
+
*/
|
|
109
|
+
const processTarChunk = (state, chunk, hooks) => {
|
|
110
|
+
if (state.stopped) return null;
|
|
111
|
+
if (state.content === null && state.skipRemaining >= chunk.length && state.buffer.length === 0) {
|
|
112
|
+
state.skipRemaining -= chunk.length;
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
state.buffer = concatBytes(state.buffer, chunk);
|
|
116
|
+
while (state.buffer.length > 0) {
|
|
117
|
+
if (state.content !== null) {
|
|
118
|
+
const content = state.content;
|
|
119
|
+
const remaining = content.paddedSize - content.totalBytesRead;
|
|
120
|
+
const take = Math.min(remaining, state.buffer.length);
|
|
121
|
+
const contentTake = Math.max(0, Math.min(take, content.size - content.contentBytesRead));
|
|
122
|
+
if (contentTake > 0) content.chunks.push(state.buffer.subarray(0, contentTake));
|
|
123
|
+
state.content = {
|
|
124
|
+
...content,
|
|
125
|
+
contentBytesRead: content.contentBytesRead + contentTake,
|
|
126
|
+
totalBytesRead: content.totalBytesRead + take
|
|
127
|
+
};
|
|
128
|
+
state.buffer = consumeBytes(state.buffer, take);
|
|
129
|
+
if (state.content.totalBytesRead === state.content.paddedSize) {
|
|
130
|
+
const completed = state.content;
|
|
131
|
+
state.content = null;
|
|
132
|
+
if (completed.kind === "extended") {
|
|
133
|
+
const error = applyExtended(state, completed, hooks);
|
|
134
|
+
if (error !== null) return error;
|
|
135
|
+
} else if (hooks.onContent !== void 0 && completed.entry !== null) {
|
|
136
|
+
const error = hooks.onContent(completed.entry, flattenChunks(completed.chunks));
|
|
137
|
+
if (error !== null) return error;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
if (state.skipRemaining > 0) {
|
|
143
|
+
const take = Math.min(state.skipRemaining, state.buffer.length);
|
|
144
|
+
state.skipRemaining -= take;
|
|
145
|
+
state.buffer = consumeBytes(state.buffer, take);
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
if (state.buffer.length < TAR_BLOCK_SIZE) return null;
|
|
149
|
+
const header = state.buffer.subarray(0, TAR_BLOCK_SIZE);
|
|
150
|
+
state.buffer = consumeBytes(state.buffer, TAR_BLOCK_SIZE);
|
|
151
|
+
if (isZeroBlock(header)) continue;
|
|
152
|
+
const size = parseTarSize(header);
|
|
153
|
+
if (size === null) return hooks.onExtendedError("tar entry has an invalid size header");
|
|
154
|
+
const paddedSize = Math.ceil(size / TAR_BLOCK_SIZE) * TAR_BLOCK_SIZE;
|
|
155
|
+
const typeflag = String.fromCharCode(header[156] ?? 0).replace("\0", "");
|
|
156
|
+
if (typeflag === "x" || typeflag === "g" || typeflag === "L" || typeflag === "K") {
|
|
157
|
+
if (size > MAX_TAR_EXTENDED_PATH_BYTES) return hooks.onExtendedError("tar extended path record is too large");
|
|
158
|
+
state.content = {
|
|
159
|
+
kind: "extended",
|
|
160
|
+
extendedKind: typeflag === "x" ? "pax-local" : typeflag === "g" ? "pax-global" : typeflag === "L" ? "gnu-path" : "gnu-link",
|
|
161
|
+
entry: null,
|
|
162
|
+
size,
|
|
163
|
+
paddedSize,
|
|
164
|
+
chunks: [],
|
|
165
|
+
contentBytesRead: 0,
|
|
166
|
+
totalBytesRead: 0
|
|
167
|
+
};
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
const entryPath = state.pendingPath ?? tarPathFromHeader(header);
|
|
171
|
+
state.pendingPath = null;
|
|
172
|
+
const linkPath = state.pendingLinkPath ?? tarLinkPathFromHeader(header);
|
|
173
|
+
state.pendingLinkPath = null;
|
|
174
|
+
const entry = {
|
|
175
|
+
path: entryPath,
|
|
176
|
+
linkPath,
|
|
177
|
+
typeflag,
|
|
178
|
+
size
|
|
179
|
+
};
|
|
180
|
+
const directiveOrError = hooks.onEntry(entry);
|
|
181
|
+
if (!isDirective(directiveOrError)) return directiveOrError;
|
|
182
|
+
if (directiveOrError.disposition === "stop") {
|
|
183
|
+
state.stopped = true;
|
|
184
|
+
return null;
|
|
185
|
+
}
|
|
186
|
+
if (directiveOrError.disposition === "capture") {
|
|
187
|
+
state.content = {
|
|
188
|
+
kind: "captured",
|
|
189
|
+
extendedKind: null,
|
|
190
|
+
entry,
|
|
191
|
+
size,
|
|
192
|
+
paddedSize,
|
|
193
|
+
chunks: [],
|
|
194
|
+
contentBytesRead: 0,
|
|
195
|
+
totalBytesRead: 0
|
|
196
|
+
};
|
|
197
|
+
continue;
|
|
198
|
+
}
|
|
199
|
+
state.skipRemaining = paddedSize;
|
|
200
|
+
}
|
|
201
|
+
return null;
|
|
202
|
+
};
|
|
203
|
+
/** Post-EOF structural check. Returns a caller-typed error if the
|
|
204
|
+
* stream ended mid-extended-header, mid-body, or with a partial header
|
|
205
|
+
* block (a trailing zero block tail is fine). */
|
|
206
|
+
const finishTarReader = (state, mkError) => {
|
|
207
|
+
if (state.stopped) return null;
|
|
208
|
+
if (state.content !== null) return mkError(state.content.kind === "extended" ? "tar ended inside an extended header" : "tar ended inside file content");
|
|
209
|
+
if (state.skipRemaining !== 0) return mkError("tar ended inside file content");
|
|
210
|
+
if (state.buffer.length !== 0 && !isZeroBlock(state.buffer)) return mkError("tar ended with a partial header");
|
|
211
|
+
return null;
|
|
212
|
+
};
|
|
213
|
+
//#endregion
|
|
214
|
+
export { captureEntry, finishTarReader, isSafeArchivePath, makeTarReaderState, processTarChunk, skipEntry, stopScan };
|
|
215
|
+
|
|
216
|
+
//# sourceMappingURL=reader.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reader.mjs","names":[],"sources":["../../../../src/substrate/runtime/tar/reader.ts"],"sourcesContent":["// tar/reader — shared low-level TAR block reader.\n//\n// Two devstack surfaces parse TAR byte streams: the host-tree snapshot\n// validator (`substrate/runtime/host-tree-tar`) and the Docker image\n// bundle tag scanner (`orchestrators/snapshot/image-bundle-tags`). This\n// module is the single source of truth for the block iterator, header\n// parse, pax/gnu extended-header handling, and the `isSafeArchivePath`\n// path-escape guard, so a pax/gnu fix lands on both surfaces at once.\n//\n// Shape:\n// - `processTarChunk` is a stateful, streaming block iterator. The\n// caller feeds chunks; the reader resolves complete entries (after\n// applying any preceding pax `x` / gnu `L`/`K` extended-header that\n// overrides the path / linkpath) and invokes the caller's `onEntry`\n// hook. The hook returns a `TarEntryDirective` that tells the reader\n// whether to CAPTURE the entry body (returned via `onContent`), SKIP\n// it, or STOP the scan early.\n// - The reader owns pax/gnu parsing, body buffering, and the\n// 512-byte block discipline; callers own their domain validation\n// and metadata extraction.\n//\n// Security note: `isSafeArchivePath` rejects absolute paths, `..`\n// segments, backslashes, and NUL — applied to BOTH the entry path and\n// (for hardlink/symlink typeflags) the link target. Symlink targets are\n// NOT canonicalized here; relative targets are caught by `..` rejection,\n// and native `tar -x` refuses escaping paths as a second layer.\n\nconst TAR_BLOCK_SIZE = 512;\n\n/** Max bytes a single pax/gnu extended-header record may declare. A\n * larger declared size is rejected so a malicious archive cannot force\n * unbounded in-memory buffering of an \"extended path\". */\nconst MAX_TAR_EXTENDED_PATH_BYTES = 1024 * 1024;\n\n// ---------------------------------------------------------------------------\n// Byte helpers — shared by both header parse and content buffering.\n// ---------------------------------------------------------------------------\n\nconst bytesToString = (bytes: Uint8Array): string => {\n\tconst nul = bytes.indexOf(0);\n\tconst end = nul === -1 ? bytes.length : nul;\n\treturn Buffer.from(bytes.subarray(0, end)).toString('utf8');\n};\n\nconst concatBytes = (a: Uint8Array, b: Uint8Array): Uint8Array => {\n\tif (a.length === 0) return b;\n\tif (b.length === 0) return a;\n\tconst out = new Uint8Array(a.length + b.length);\n\tout.set(a, 0);\n\tout.set(b, a.length);\n\treturn out;\n};\n\nconst consumeBytes = (buffer: Uint8Array, count: number): Uint8Array => buffer.subarray(count);\n\nconst isZeroBlock = (block: Uint8Array): boolean => block.every((byte) => byte === 0);\n\nconst parseTarSize = (header: Uint8Array): number | null => {\n\tconst raw = bytesToString(header.subarray(124, 136)).trim();\n\tif (raw === '') return 0;\n\tif (!/^[0-7]+$/.test(raw)) return null;\n\tconst parsed = Number.parseInt(raw, 8);\n\treturn Number.isSafeInteger(parsed) && parsed >= 0 ? parsed : null;\n};\n\nconst tarPathFromHeader = (header: Uint8Array): string => {\n\tconst name = bytesToString(header.subarray(0, 100));\n\tconst prefix = bytesToString(header.subarray(345, 500));\n\treturn prefix === '' ? name : `${prefix}/${name}`;\n};\n\nconst tarLinkPathFromHeader = (header: Uint8Array): string =>\n\tbytesToString(header.subarray(157, 257));\n\nconst trimExtendedPath = (bytes: Uint8Array): string => {\n\tconst value = Buffer.from(bytes).toString('utf8').replace(/\\n$/g, '');\n\tlet end = value.length;\n\twhile (end > 0 && value.charCodeAt(end - 1) === 0) end -= 1;\n\treturn value.slice(0, end);\n};\n\n/** Reject paths that would escape the extraction target: absolute,\n * drive-qualified, NUL- or backslash-bearing, `.`-only, or carrying a\n * `..` segment. Applied producer-side (relPaths) and consumer-side\n * (every resolved entry path + hardlink/symlink target). */\nexport const isSafeArchivePath = (entryPath: string): boolean => {\n\tif (\n\t\tentryPath === '' ||\n\t\tentryPath === '.' ||\n\t\tentryPath.includes('\\0') ||\n\t\tentryPath.includes('\\\\') ||\n\t\tentryPath.startsWith('/') ||\n\t\t/^[A-Za-z]:/.test(entryPath)\n\t) {\n\t\treturn false;\n\t}\n\tconst meaningfulSegments = entryPath\n\t\t.split('/')\n\t\t.filter((segment) => segment !== '' && segment !== '.');\n\treturn meaningfulSegments.length > 0 && !meaningfulSegments.includes('..');\n};\n\nconst parsePaxRecords = (bytes: Uint8Array): Record<string, string> => {\n\tconst text = Buffer.from(bytes).toString('utf8');\n\tconst records: Record<string, string> = {};\n\tlet offset = 0;\n\twhile (offset < text.length) {\n\t\tconst space = text.indexOf(' ', offset);\n\t\tif (space === -1) break;\n\t\tconst lengthText = text.slice(offset, space);\n\t\tconst recordLength = Number.parseInt(lengthText, 10);\n\t\tif (!Number.isSafeInteger(recordLength) || recordLength <= 0) break;\n\t\tconst record = text.slice(space + 1, offset + recordLength).replace(/\\n$/g, '');\n\t\tconst eq = record.indexOf('=');\n\t\tif (eq > 0) {\n\t\t\trecords[record.slice(0, eq)] = record.slice(eq + 1);\n\t\t}\n\t\toffset += recordLength;\n\t}\n\treturn records;\n};\n\n// ---------------------------------------------------------------------------\n// Streaming block reader.\n// ---------------------------------------------------------------------------\n\n/** A resolved tar entry, after any pax `x` / gnu `L`/`K`\n * extended-header has been applied to its path and link target. */\nexport interface TarEntry {\n\t/** Effective entry path (pax/gnu-overridden when present). */\n\treadonly path: string;\n\t/** Effective hardlink/symlink target (pax/gnu-overridden when\n\t * present); empty for non-link entries. */\n\treadonly linkPath: string;\n\t/** One-character ustar typeflag (`'0'` regular, `'1'` hardlink,\n\t * `'2'` symlink, `'5'` directory, …). */\n\treadonly typeflag: string;\n\t/** Declared content size in bytes (unpadded). */\n\treadonly size: number;\n}\n\ntype TarEntryDisposition = 'skip' | 'capture' | 'stop';\n\n/** What the reader should do with one resolved entry's body. `'skip'`\n * advances past the (padded) body without buffering; `'capture'`\n * buffers the body and invokes `onContent(entry, body)` when complete;\n * `'stop'` ends the scan immediately (the body is not consumed). */\nexport interface TarEntryDirective {\n\treadonly disposition: TarEntryDisposition;\n}\n\nconst SKIP: TarEntryDirective = { disposition: 'skip' };\nconst STOP: TarEntryDirective = { disposition: 'stop' };\nexport const skipEntry = (): TarEntryDirective => SKIP;\nexport const captureEntry = (): TarEntryDirective => ({ disposition: 'capture' });\nexport const stopScan = (): TarEntryDirective => STOP;\n\ntype ExtendedKind = 'pax-local' | 'pax-global' | 'gnu-path' | 'gnu-link';\n\ninterface BufferingContent {\n\treadonly kind: 'extended' | 'captured';\n\treadonly extendedKind: ExtendedKind | null;\n\treadonly entry: TarEntry | null;\n\treadonly size: number;\n\treadonly paddedSize: number;\n\treadonly chunks: Array<Uint8Array>;\n\treadonly contentBytesRead: number;\n\treadonly totalBytesRead: number;\n}\n\n/** Streaming parser state. Construct once per stream via\n * `makeTarReaderState`, feed every chunk to `processTarChunk`, then\n * call `finishTarReader` after EOF. */\ninterface TarReaderState {\n\tbuffer: Uint8Array;\n\tskipRemaining: number;\n\tcontent: BufferingContent | null;\n\tpendingPath: string | null;\n\tpendingLinkPath: string | null;\n\tstopped: boolean;\n}\n\nexport const makeTarReaderState = (): TarReaderState => ({\n\tbuffer: new Uint8Array(0),\n\tskipRemaining: 0,\n\tcontent: null,\n\tpendingPath: null,\n\tpendingLinkPath: null,\n\tstopped: false,\n});\n\n/** Caller hooks. `onEntry` decides the per-entry directive; `onContent`\n * receives the buffered body for `'capture'` entries. Both may return\n * an error of the caller's `E` type to abort the scan. */\ninterface TarReaderHooks<E> {\n\treadonly onEntry: (entry: TarEntry) => TarEntryDirective | E;\n\treadonly onContent?: (entry: TarEntry, body: Uint8Array) => null | E;\n\t/** Raised when a pax/gnu extended record is invalid (oversized, or a\n\t * global pax path/linkpath which is not honored). Lets the caller\n\t * brand the failure with its own tagged-error type. */\n\treadonly onExtendedError: (detail: string) => E;\n}\n\nconst isDirective = (value: unknown): value is TarEntryDirective =>\n\ttypeof value === 'object' &&\n\tvalue !== null &&\n\t'disposition' in value &&\n\t((value as { disposition: unknown }).disposition === 'skip' ||\n\t\t(value as { disposition: unknown }).disposition === 'capture' ||\n\t\t(value as { disposition: unknown }).disposition === 'stop');\n\nconst flattenChunks = (chunks: ReadonlyArray<Uint8Array>): Uint8Array =>\n\tchunks.length === 1 ? chunks[0]! : Buffer.concat(chunks.map((chunk) => Buffer.from(chunk)));\n\nconst applyExtended = <E>(\n\tstate: TarReaderState,\n\tcontent: BufferingContent,\n\thooks: TarReaderHooks<E>,\n): E | null => {\n\tconst bytes = flattenChunks(content.chunks);\n\tif (content.extendedKind === 'gnu-path') {\n\t\tstate.pendingPath = trimExtendedPath(bytes);\n\t\treturn null;\n\t}\n\tif (content.extendedKind === 'gnu-link') {\n\t\tstate.pendingLinkPath = trimExtendedPath(bytes);\n\t\treturn null;\n\t}\n\tconst records = parsePaxRecords(bytes);\n\tif (\n\t\tcontent.extendedKind === 'pax-global' &&\n\t\t(records.path !== undefined || records.linkpath !== undefined)\n\t) {\n\t\treturn hooks.onExtendedError('global pax path/linkpath records are not supported');\n\t}\n\tif (content.extendedKind === 'pax-local') {\n\t\tif (records.path !== undefined) state.pendingPath = records.path;\n\t\tif (records.linkpath !== undefined) state.pendingLinkPath = records.linkpath;\n\t}\n\treturn null;\n};\n\n/**\n * Feed one stream chunk to the reader. Resolves as many complete entries\n * as the accumulated buffer allows, invoking `hooks.onEntry` (and\n * `hooks.onContent` for captured bodies). Returns a caller-typed error\n * on the first hook failure or invalid extended record, else `null`.\n *\n * Returns once `state.stopped` is set (a `'stop'` directive) so callers\n * draining via a `takeUntil`-style stream can short-circuit.\n */\nexport const processTarChunk = <E>(\n\tstate: TarReaderState,\n\tchunk: Uint8Array,\n\thooks: TarReaderHooks<E>,\n): E | null => {\n\tif (state.stopped) return null;\n\t// Fast path: mid-skip over a large body and this whole chunk is\n\t// consumed by the skip. Avoids O(N²) concat across a multi-MB body\n\t// streamed in small chunks. The buffer must be empty so byte order\n\t// is preserved relative to the parser.\n\tif (state.content === null && state.skipRemaining >= chunk.length && state.buffer.length === 0) {\n\t\tstate.skipRemaining -= chunk.length;\n\t\treturn null;\n\t}\n\tstate.buffer = concatBytes(state.buffer, chunk);\n\twhile (state.buffer.length > 0) {\n\t\tif (state.content !== null) {\n\t\t\tconst content = state.content;\n\t\t\tconst remaining = content.paddedSize - content.totalBytesRead;\n\t\t\tconst take = Math.min(remaining, state.buffer.length);\n\t\t\tconst contentTake = Math.max(0, Math.min(take, content.size - content.contentBytesRead));\n\t\t\tif (contentTake > 0) {\n\t\t\t\tcontent.chunks.push(state.buffer.subarray(0, contentTake));\n\t\t\t}\n\t\t\tstate.content = {\n\t\t\t\t...content,\n\t\t\t\tcontentBytesRead: content.contentBytesRead + contentTake,\n\t\t\t\ttotalBytesRead: content.totalBytesRead + take,\n\t\t\t};\n\t\t\tstate.buffer = consumeBytes(state.buffer, take);\n\t\t\tif (state.content.totalBytesRead === state.content.paddedSize) {\n\t\t\t\tconst completed = state.content;\n\t\t\t\tstate.content = null;\n\t\t\t\tif (completed.kind === 'extended') {\n\t\t\t\t\tconst error = applyExtended(state, completed, hooks);\n\t\t\t\t\tif (error !== null) return error;\n\t\t\t\t} else if (hooks.onContent !== undefined && completed.entry !== null) {\n\t\t\t\t\tconst error = hooks.onContent(completed.entry, flattenChunks(completed.chunks));\n\t\t\t\t\tif (error !== null) return error;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\t\tif (state.skipRemaining > 0) {\n\t\t\tconst take = Math.min(state.skipRemaining, state.buffer.length);\n\t\t\tstate.skipRemaining -= take;\n\t\t\tstate.buffer = consumeBytes(state.buffer, take);\n\t\t\tcontinue;\n\t\t}\n\t\tif (state.buffer.length < TAR_BLOCK_SIZE) return null;\n\t\tconst header = state.buffer.subarray(0, TAR_BLOCK_SIZE);\n\t\tstate.buffer = consumeBytes(state.buffer, TAR_BLOCK_SIZE);\n\t\tif (isZeroBlock(header)) continue;\n\n\t\tconst size = parseTarSize(header);\n\t\tif (size === null) return hooks.onExtendedError('tar entry has an invalid size header');\n\t\tconst paddedSize = Math.ceil(size / TAR_BLOCK_SIZE) * TAR_BLOCK_SIZE;\n\t\tconst typeflag = String.fromCharCode(header[156] ?? 0).replace('\\0', '');\n\t\tif (typeflag === 'x' || typeflag === 'g' || typeflag === 'L' || typeflag === 'K') {\n\t\t\tif (size > MAX_TAR_EXTENDED_PATH_BYTES) {\n\t\t\t\treturn hooks.onExtendedError('tar extended path record is too large');\n\t\t\t}\n\t\t\tstate.content = {\n\t\t\t\tkind: 'extended',\n\t\t\t\textendedKind:\n\t\t\t\t\ttypeflag === 'x'\n\t\t\t\t\t\t? 'pax-local'\n\t\t\t\t\t\t: typeflag === 'g'\n\t\t\t\t\t\t\t? 'pax-global'\n\t\t\t\t\t\t\t: typeflag === 'L'\n\t\t\t\t\t\t\t\t? 'gnu-path'\n\t\t\t\t\t\t\t\t: 'gnu-link',\n\t\t\t\tentry: null,\n\t\t\t\tsize,\n\t\t\t\tpaddedSize,\n\t\t\t\tchunks: [],\n\t\t\t\tcontentBytesRead: 0,\n\t\t\t\ttotalBytesRead: 0,\n\t\t\t};\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst entryPath = state.pendingPath ?? tarPathFromHeader(header);\n\t\tstate.pendingPath = null;\n\t\tconst linkPath = state.pendingLinkPath ?? tarLinkPathFromHeader(header);\n\t\tstate.pendingLinkPath = null;\n\t\tconst entry: TarEntry = { path: entryPath, linkPath, typeflag, size };\n\n\t\tconst directiveOrError = hooks.onEntry(entry);\n\t\tif (!isDirective(directiveOrError)) return directiveOrError;\n\t\tif (directiveOrError.disposition === 'stop') {\n\t\t\tstate.stopped = true;\n\t\t\treturn null;\n\t\t}\n\t\tif (directiveOrError.disposition === 'capture') {\n\t\t\tstate.content = {\n\t\t\t\tkind: 'captured',\n\t\t\t\textendedKind: null,\n\t\t\t\tentry,\n\t\t\t\tsize,\n\t\t\t\tpaddedSize,\n\t\t\t\tchunks: [],\n\t\t\t\tcontentBytesRead: 0,\n\t\t\t\ttotalBytesRead: 0,\n\t\t\t};\n\t\t\tcontinue;\n\t\t}\n\t\tstate.skipRemaining = paddedSize;\n\t}\n\treturn null;\n};\n\n/** Post-EOF structural check. Returns a caller-typed error if the\n * stream ended mid-extended-header, mid-body, or with a partial header\n * block (a trailing zero block tail is fine). */\nexport const finishTarReader = <E>(\n\tstate: TarReaderState,\n\tmkError: (detail: string) => E,\n): E | null => {\n\tif (state.stopped) return null;\n\tif (state.content !== null) {\n\t\treturn mkError(\n\t\t\tstate.content.kind === 'extended'\n\t\t\t\t? 'tar ended inside an extended header'\n\t\t\t\t: 'tar ended inside file content',\n\t\t);\n\t}\n\tif (state.skipRemaining !== 0) return mkError('tar ended inside file content');\n\tif (state.buffer.length !== 0 && !isZeroBlock(state.buffer)) {\n\t\treturn mkError('tar ended with a partial header');\n\t}\n\treturn null;\n};\n"],"mappings":";AA2BA,MAAM,iBAAiB;;;;AAKvB,MAAM,8BAA8B,OAAO;AAM3C,MAAM,iBAAiB,UAA8B;CACpD,MAAM,MAAM,MAAM,QAAQ,CAAC;CAC3B,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/substrate/runtime/typed-env.ts"],"sourcesContent":["// Typed `process.env` accessor.\n//\n// The devstack package is consumed from both Node and browser-like\n// runtimes (Playwright fixtures, vitest browser mode), so we can't\n// reach for `process.env` directly — TypeScript with `\"types\": []`\n// rejects the global.
|
|
1
|
+
{"version":3,"file":"typed-env.mjs","names":[],"sources":["../../../src/substrate/runtime/typed-env.ts"],"sourcesContent":["// Typed `process.env` accessor.\n//\n// The devstack package is consumed from both Node and browser-like\n// runtimes (Playwright fixtures, vitest browser mode), so we can't\n// reach for `process.env` directly — TypeScript with `\"types\": []`\n// rejects the global. This centralises the\n// `globalThis as { process?: { env?: ... } }` cast so the rest of the\n// code reads `readEnv('FOO')` cleanly.\n//\n// Returns `undefined` when the runtime has no `process.env` (browser),\n// or when the env var is unset. Callers treat `undefined` and `''` as\n// equivalent \"absent\" sentinels.\n\nexport const readEnv = (name: string): string | undefined => {\n\tconst process = (globalThis as { process?: { env?: Record<string, string | undefined> } })\n\t\t.process;\n\treturn process?.env?.[name];\n};\n"],"mappings":";AAaA,MAAa,WAAW,SAAqC;CAG5D,OAFiB,WACf,SACc,MAAM;AACvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versioned-doc-schema.mjs","names":[],"sources":["../../src/substrate/versioned-doc-schema.ts"],"sourcesContent":["// Versioned cross-process document schema helper.\n//\n// Centralizes the `{ version: Literal<N>, ...payload }` discriminator\n// shape that every cross-process document the substrate persists shares\n// (roster, container claim,
|
|
1
|
+
{"version":3,"file":"versioned-doc-schema.mjs","names":[],"sources":["../../src/substrate/versioned-doc-schema.ts"],"sourcesContent":["// Versioned cross-process document schema helper.\n//\n// Centralizes the `{ version: Literal<N>, ...payload }` discriminator\n// shape that every cross-process document the substrate persists shares\n// (roster, container claim, port reservation).\n//\n// Future v2 migration becomes mechanical: replace the call with\n// `Schema.Union(versionedDocSchema(1, ...), versionedDocSchema(2, ...))`\n// at exactly one site per document, rather than hand-rolling the\n// discriminator field in each consumer.\n//\n// Lives at substrate L0 (depends only on `effect`'s Schema) so L0\n// declarations such as `substrate/cross-process.ts` can use it without\n// reaching into the L1 runtime tree.\n\nimport { Schema } from 'effect';\n\n/** Construct a versioned cross-process document schema —\n * `{ version: Literal<N>, ...payloadFields }` in one call.\n *\n * The resulting schema is structurally identical to a hand-written\n * `Schema.Struct({ version: Schema.Literal(N), ...payload })`; the\n * `version` field becomes a literal-typed discriminator suitable for\n * forward-compatible `Schema.Union`s. */\nexport const versionedDocSchema = <const V extends number, Fields extends Schema.Struct.Fields>(\n\tversion: V,\n\tpayload: Fields,\n): Schema.Struct<{ readonly version: Schema.Literal<V> } & Fields> =>\n\t// Cast is load-bearing: spreading a generic `Fields` into an object\n\t// literal makes TS infer the resulting `Schema.Struct` over a widened\n\t// field type, not the precise `{ version } & Fields` intersection, so\n\t// the literal-typed `version` discriminator would be lost without it.\n\tSchema.Struct({\n\t\tversion: Schema.Literal(version),\n\t\t...payload,\n\t}) as unknown as Schema.Struct<{ readonly version: Schema.Literal<V> } & Fields>;\n"],"mappings":";;;;;;;;;AAwBA,MAAa,sBACZ,SACA,YAMA,OAAO,OAAO;CACb,SAAS,OAAO,QAAQ,OAAO;CAC/B,GAAG;AACJ,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { atomicWriteJsonSync } from "./runtime/atomic-write.mjs";
|
|
2
1
|
import { decodeJsonText, decodeJsonTextSync } from "./runtime/runtime-decode.mjs";
|
|
2
|
+
import { atomicWriteJsonSync } from "./runtime/atomic-write.mjs";
|
|
3
3
|
import { Effect } from "effect";
|
|
4
4
|
import { existsSync, readFileSync } from "node:fs";
|
|
5
5
|
//#region src/substrate/versioned-doc-sync.ts
|
|
@@ -41,7 +41,7 @@ const readVersionedDocumentSync = (path, schema, errors, whenAbsent) => Effect.g
|
|
|
41
41
|
* Sync parse-or-null variant of `readVersionedDocumentSync`. Decodes a
|
|
42
42
|
* raw JSON body against `schema`; returns `null` on parse or decode
|
|
43
43
|
* failure. Use this when a malformed body should be treated the same as
|
|
44
|
-
* a missing body (e.g. half-written
|
|
44
|
+
* a missing body (e.g. a half-written roster entry by a crashed creator,
|
|
45
45
|
* stack-lock body interrupted mid-write) — the call site swaps a
|
|
46
46
|
* try/catch around `decodeJsonTextSync` for one helper call.
|
|
47
47
|
*
|
|
@@ -65,8 +65,8 @@ const parseVersionedDocumentBodyOrNull = (raw, schema, source) => {
|
|
|
65
65
|
* Write a versioned cross-process document atomically.
|
|
66
66
|
*
|
|
67
67
|
* Routes through the canonical `atomicWriteJsonSync` primitive — the
|
|
68
|
-
*
|
|
69
|
-
* with one owner of the tempfile cleanup. The version stamp lives in
|
|
68
|
+
* crash-atomic mkdir-parent → O_EXCL temp → write → fsync → rename
|
|
69
|
+
* dance with one owner of the tempfile cleanup. The version stamp lives in
|
|
70
70
|
* the caller-supplied `value` (every versioned-doc schema carries a
|
|
71
71
|
* literal `version` field via `versionedDocSchema`); this helper does
|
|
72
72
|
* NOT inject a version — it just ensures the typed write envelope
|
|
@@ -76,7 +76,7 @@ const parseVersionedDocumentBodyOrNull = (raw, schema, source) => {
|
|
|
76
76
|
* cross-process docs are `Schema.Struct` of primitives that round-trip
|
|
77
77
|
* cleanly through plain `JSON.stringify`. The `value` is typed as a
|
|
78
78
|
* generic `D` so the caller's document interface (`RosterDocument`,
|
|
79
|
-
*
|
|
79
|
+
* ...) is what gets serialized.
|
|
80
80
|
*
|
|
81
81
|
* This is the SYNC surface — used by callers that hold `stack.lock`
|
|
82
82
|
* and must keep their critical section non-yielding.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versioned-doc-sync.mjs","names":[],"sources":["../../src/substrate/versioned-doc-sync.ts"],"sourcesContent":["// Versioned cross-process document — read / write envelope helpers.\n//\n//
|
|
1
|
+
{"version":3,"file":"versioned-doc-sync.mjs","names":[],"sources":["../../src/substrate/versioned-doc-sync.ts"],"sourcesContent":["// Versioned cross-process document — read / write envelope helpers.\n//\n// The cross-process modules (`runtime/cross-process/{roster,\n// stack-lock}.ts`) share one `Effect.try(readFileSync) → decodeJsonText →\n// mkIoError|mkCorruptError` read envelope and one\n// `Effect.try(atomicWriteJsonSync) → mkIoError` write envelope, each\n// parameterised by a typed-error pair. This file centralizes both\n// envelopes around the versioned-doc schemas constructed via\n// `versionedDocSchema` (the sibling file). The caller supplies the error\n// constructors so its typed error channel is preserved end-to-end;\n// crash-atomicity, fsync ordering, and version-stamp handling all live\n// in the underlying primitives.\n//\n// Lives at substrate L0+ — depends on `effect`, `node:fs`, the\n// runtime-decode helpers, and the canonical atomic-write primitive.\n// Kept as a sibling of `versioned-doc-schema.ts` rather than absorbed\n// into it so the schema constructor remains pure-Schema (callable from\n// any L0 declaration site such as `substrate/cross-process.ts`); only\n// callers that actually round-trip a versioned doc to disk pay the\n// fs/runtime-decode import cost.\n\nimport { existsSync, readFileSync } from 'node:fs';\n\nimport { Effect, Schema } from 'effect';\n\nimport { atomicWriteJsonSync } from './runtime/atomic-write.ts';\nimport { decodeJsonText, decodeJsonTextSync } from './runtime/runtime-decode.ts';\n\n/** Constructor pair the caller supplies so its typed error channel is\n * preserved through the envelope. `mkIo` wraps any node:fs / disk\n * failure (read OR write); `mkCorrupt` wraps any JSON-parse / Schema-\n * decode failure (read only). Both helpers thread the on-disk `path`\n * and — for `mkCorrupt` — the raw bytes that failed to decode so\n * diagnostics can echo what was actually on disk. */\nexport interface VersionedDocErrors<IoErr, CorruptErr> {\n\treadonly mkIo: (input: { readonly path: string; readonly cause: unknown }) => IoErr;\n\treadonly mkCorrupt: (input: {\n\t\treadonly path: string;\n\t\treadonly raw: string;\n\t\treadonly cause: unknown;\n\t}) => CorruptErr;\n}\n\n/** Constructor for the IO-only case (write path — no decode failure\n * mode). Split into its own interface so `writeVersionedDocumentSync`\n * callers don't have to supply a `mkCorrupt` they would never invoke. */\nexport interface VersionedDocIoError<IoErr> {\n\treadonly mkIo: (input: { readonly path: string; readonly cause: unknown }) => IoErr;\n}\n\n/**\n * Read + decode a versioned cross-process document from disk.\n *\n * - Missing file (`!existsSync`) → returns the caller-supplied\n * `whenAbsent` default. This is the \"no peer has ever written yet\"\n * path; the caller decides whether that's an empty document or a\n * failure.\n * - Read failure (any `node:fs` error other than ENOENT) → `mkIo`.\n * - JSON-parse OR Schema-decode failure → `mkCorrupt` with the raw\n * bytes echoed so callers can log the offending content.\n *\n * The decode runs through `decodeJsonText`, so the on-disk JSON is\n * parsed and Schema-validated in one envelope. No atomicity, fsync, or\n * lock-ordering concerns at the read site — this is pure read-and-\n * validate.\n */\nexport const readVersionedDocumentSync = <S extends Schema.Decoder<unknown>, IoErr, CorruptErr>(\n\tpath: string,\n\tschema: S,\n\terrors: VersionedDocErrors<IoErr, CorruptErr>,\n\twhenAbsent: S['Type'],\n): Effect.Effect<S['Type'], IoErr | CorruptErr> =>\n\tEffect.gen(function* () {\n\t\tif (!existsSync(path)) return whenAbsent;\n\t\tconst raw = yield* Effect.try({\n\t\t\ttry: () => readFileSync(path, 'utf8'),\n\t\t\tcatch: (cause) => errors.mkIo({ path, cause }),\n\t\t});\n\t\treturn yield* decodeJsonText(schema, raw, {\n\t\t\tsource: path,\n\t\t\tmkError: (issue) => errors.mkCorrupt({ path, raw, cause: issue.cause ?? issue }),\n\t\t});\n\t});\n\n/**\n * Sync parse-or-null variant of `readVersionedDocumentSync`. Decodes a\n * raw JSON body against `schema`; returns `null` on parse or decode\n * failure. Use this when a malformed body should be treated the same as\n * a missing body (e.g. a half-written roster entry by a crashed creator,\n * stack-lock body interrupted mid-write) — the call site swaps a\n * try/catch around `decodeJsonTextSync` for one helper call.\n *\n * `source` is purely a diagnostic label for the synthesized error\n * inside `decodeJsonTextSync`'s throw; it is consumed by the catch and\n * discarded along with the error. The caller does not need to thread a\n * typed error constructor — the contract here is \"null means\n * unreadable/malformed; the caller decides what to do next\".\n */\nexport const parseVersionedDocumentBodyOrNull = <S extends Schema.Decoder<unknown>>(\n\traw: string,\n\tschema: S,\n\tsource: string,\n): S['Type'] | null => {\n\ttry {\n\t\treturn decodeJsonTextSync(schema, raw, {\n\t\t\tsource,\n\t\t\tmkError: (issue) => issue,\n\t\t});\n\t} catch {\n\t\treturn null;\n\t}\n};\n\n/**\n * Write a versioned cross-process document atomically.\n *\n * Routes through the canonical `atomicWriteJsonSync` primitive — the\n * crash-atomic mkdir-parent → O_EXCL temp → write → fsync → rename\n * dance with one owner of the tempfile cleanup. The version stamp lives in\n * the caller-supplied `value` (every versioned-doc schema carries a\n * literal `version` field via `versionedDocSchema`); this helper does\n * NOT inject a version — it just ensures the typed write envelope\n * (Effect.try → mkIo) is consistent across cross-process sites.\n *\n * No Schema-encode step here: matching `atomicWriteJsonSync`'s contract,\n * cross-process docs are `Schema.Struct` of primitives that round-trip\n * cleanly through plain `JSON.stringify`. The `value` is typed as a\n * generic `D` so the caller's document interface (`RosterDocument`,\n * ...) is what gets serialized.\n *\n * This is the SYNC surface — used by callers that hold `stack.lock`\n * and must keep their critical section non-yielding.\n */\nexport const writeVersionedDocumentSync = <D, IoErr>(\n\tpath: string,\n\tvalue: D,\n\terrors: VersionedDocIoError<IoErr>,\n): Effect.Effect<void, IoErr> =>\n\tEffect.try({\n\t\ttry: () => atomicWriteJsonSync(path, value),\n\t\tcatch: (cause) => errors.mkIo({ path, cause }),\n\t});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAkEA,MAAa,6BACZ,MACA,QACA,QACA,eAEA,OAAO,IAAI,aAAa;CACvB,IAAI,CAAC,WAAW,IAAI,GAAG,OAAO;CAC9B,MAAM,MAAM,OAAO,OAAO,IAAI;EAC7B,WAAW,aAAa,MAAM,MAAM;EACpC,QAAQ,UAAU,OAAO,KAAK;GAAE;GAAM;EAAM,CAAC;CAC9C,CAAC;CACD,OAAO,OAAO,eAAe,QAAQ,KAAK;EACzC,QAAQ;EACR,UAAU,UAAU,OAAO,UAAU;GAAE;GAAM;GAAK,OAAO,MAAM,SAAS;EAAM,CAAC;CAChF,CAAC;AACF,CAAC;;;;;;;;;;;;;;;AAgBF,MAAa,oCACZ,KACA,QACA,WACsB;CACtB,IAAI;EACH,OAAO,mBAAmB,QAAQ,KAAK;GACtC;GACA,UAAU,UAAU;EACrB,CAAC;CACF,QAAQ;EACP,OAAO;CACR;AACD;;;;;;;;;;;;;;;;;;;;;AAsBA,MAAa,8BACZ,MACA,OACA,WAEA,OAAO,IAAI;CACV,WAAW,oBAAoB,MAAM,KAAK;CAC1C,QAAQ,UAAU,OAAO,KAAK;EAAE;EAAM;CAAM,CAAC;AAC9C,CAAC"}
|
|
@@ -74,24 +74,66 @@ const commands = [
|
|
|
74
74
|
sideEffects: "write",
|
|
75
75
|
requiresDocker: true,
|
|
76
76
|
description: "Starts the supervisor and renders the attached operator surface.",
|
|
77
|
-
options: [
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
77
|
+
options: [
|
|
78
|
+
...configOptions,
|
|
79
|
+
{
|
|
80
|
+
name: "renderer",
|
|
81
|
+
value: "tui|plain|silent",
|
|
82
|
+
description: "Select the attached renderer."
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: "from-snapshot",
|
|
86
|
+
value: "name-or-id",
|
|
87
|
+
description: "Start by restoring a snapshot before the initial acquire."
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: "snapshot-cache",
|
|
91
|
+
value: "name",
|
|
92
|
+
description: "Use a named snapshot as a startup cache and refresh it when stale."
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
name: "snapshot-stale",
|
|
96
|
+
value: "warn|block|clean-start",
|
|
97
|
+
description: "Policy when --from-snapshot inputs differ from the current stack."
|
|
98
|
+
}
|
|
99
|
+
]
|
|
82
100
|
},
|
|
83
101
|
{
|
|
84
102
|
name: "apply",
|
|
85
|
-
summary: "
|
|
103
|
+
summary: "Re-emit the per-stack ids file and dev extras from a live or one-shot stack.",
|
|
86
104
|
usage: "devstack apply [options]",
|
|
87
105
|
lifecycle: "live-aware",
|
|
88
106
|
sideEffects: "write",
|
|
89
107
|
requiresDocker: true,
|
|
90
108
|
options: configOptions
|
|
91
109
|
},
|
|
110
|
+
{
|
|
111
|
+
name: "codegen",
|
|
112
|
+
summary: "Regenerate committed bindings from Move source (no stack boot).",
|
|
113
|
+
usage: "devstack codegen [options]",
|
|
114
|
+
lifecycle: "one-shot",
|
|
115
|
+
sideEffects: "write",
|
|
116
|
+
requiresDocker: false,
|
|
117
|
+
description: "Move-compiles local package sources and emits the committed src/generated tree (type bindings + sentinel-id config stubs) without booting a stack.",
|
|
118
|
+
options: configOptions
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
name: "dump-ids",
|
|
122
|
+
summary: "Emit the stack id-config (devstack-ids.json) for a real-network deploy.",
|
|
123
|
+
usage: "devstack dump-ids [options]",
|
|
124
|
+
lifecycle: "live-aware",
|
|
125
|
+
sideEffects: "write",
|
|
126
|
+
requiresDocker: true,
|
|
127
|
+
description: "Emits the stack devstack-ids.json id-config to --out (or stdout). Reads the existing file when a supervisor is live; otherwise runs a one-shot boot to produce it, then tears down. The supported way to obtain a committed id-config file for a real-network deploy.",
|
|
128
|
+
options: [...configOptions, {
|
|
129
|
+
name: "out",
|
|
130
|
+
value: "path",
|
|
131
|
+
description: "Write the id-config JSON to this file instead of stdout."
|
|
132
|
+
}]
|
|
133
|
+
},
|
|
92
134
|
{
|
|
93
135
|
name: "status",
|
|
94
|
-
summary: "Show the
|
|
136
|
+
summary: "Show the current stack projection (offline: from the manifest).",
|
|
95
137
|
usage: "devstack status [options]",
|
|
96
138
|
lifecycle: "offline",
|
|
97
139
|
sideEffects: "read",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-tree.mjs","names":[],"sources":["../../../src/surfaces/cli/command-tree.ts"],"sourcesContent":["import { ENV_VARS } from './flags.ts';\nimport { exitCodeTable } from './sysexits.ts';\n\nexport type CommandLifecycle = 'attached' | 'live-aware' | 'one-shot' | 'offline';\n\nexport interface CommandOption {\n\treadonly name: string;\n\treadonly value?: string;\n\treadonly description: string;\n}\n\nexport interface CommandNode {\n\treadonly name: string;\n\treadonly summary: string;\n\treadonly usage: string;\n\treadonly lifecycle: CommandLifecycle;\n\treadonly sideEffects: 'none' | 'read' | 'write' | 'destructive';\n\treadonly requiresDocker: boolean;\n\treadonly description?: string;\n\treadonly arguments?: ReadonlyArray<string>;\n\treadonly options?: ReadonlyArray<CommandOption>;\n\treadonly subcommands?: ReadonlyArray<CommandNode>;\n}\n\nconst identityOptions = [\n\t{ name: 'json', description: 'Emit JSON envelope output.' },\n\t{ name: 'app', value: 'name', description: 'Override app name.' },\n\t{ name: 'stack', value: 'name', description: 'Override stack name.' },\n\t{ name: 'state-dir', value: 'path', description: 'Override state directory.' },\n\t{ name: 'verbose', description: 'Enable more verbose logging.' },\n] as const satisfies ReadonlyArray<CommandOption>;\n\nconst configOptions = [\n\t...identityOptions,\n\t{ name: 'config', value: 'path', description: 'Override devstack.config.ts path.' },\n\t{ name: 'network', value: 'name', description: 'Override network before config import.' },\n] as const satisfies ReadonlyArray<CommandOption>;\n\nconst confirmOptions = [\n\t...identityOptions,\n\t{ name: 'yes', description: 'Assume yes on prompts.' },\n\t{ name: 'no-input', description: 'Forbid prompts.' },\n] as const satisfies ReadonlyArray<CommandOption>;\n\nconst globalMaintenanceOptions = [\n\t{ name: 'json', description: 'Emit JSON envelope output.' },\n\t{ name: 'state-dir', value: 'path', description: 'Override state directory.' },\n\t{ name: 'verbose', description: 'Enable more verbose logging.' },\n] as const satisfies ReadonlyArray<CommandOption>;\n\nconst commands = [\n\t{\n\t\tname: 'up',\n\t\tsummary: 'Boot a stack and stay attached until interrupted.',\n\t\tusage: 'devstack up [options]',\n\t\tlifecycle: 'attached',\n\t\tsideEffects: 'write',\n\t\trequiresDocker: true,\n\t\tdescription: 'Starts the supervisor and renders the attached operator surface.',\n\t\toptions: [\n\t\t\t...configOptions,\n\t\t\t{\n\t\t\t\tname: 'renderer',\n\t\t\t\tvalue: 'tui|plain|silent',\n\t\t\t\tdescription: 'Select the attached renderer.',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tname: 'apply',\n\t\tsummary: 'Reconcile through a live supervisor when present; otherwise run one-shot setup.',\n\t\tusage: 'devstack apply [options]',\n\t\tlifecycle: 'live-aware',\n\t\tsideEffects: 'write',\n\t\trequiresDocker: true,\n\t\toptions: configOptions,\n\t},\n\t{\n\t\tname: 'status',\n\t\tsummary: 'Show the persisted stack projection.',\n\t\tusage: 'devstack status [options]',\n\t\tlifecycle: 'offline',\n\t\tsideEffects: 'read',\n\t\trequiresDocker: false,\n\t\toptions: identityOptions,\n\t},\n\t{\n\t\tname: 'doctor',\n\t\tsummary: 'Run host and stack preflight checks.',\n\t\tusage: 'devstack doctor [options]',\n\t\tlifecycle: 'offline',\n\t\tsideEffects: 'read',\n\t\trequiresDocker: true,\n\t\toptions: identityOptions,\n\t},\n\t{\n\t\tname: 'config',\n\t\tsummary: 'Print resolved config inputs.',\n\t\tusage: 'devstack config [options]',\n\t\tlifecycle: 'offline',\n\t\tsideEffects: 'read',\n\t\trequiresDocker: false,\n\t\toptions: configOptions,\n\t},\n\t{\n\t\tname: 'schema',\n\t\tsummary: 'Emit the CLI schema.',\n\t\tusage: 'devstack schema --json',\n\t\tlifecycle: 'offline',\n\t\tsideEffects: 'none',\n\t\trequiresDocker: false,\n\t\toptions: [{ name: 'json', description: 'Emit JSON schema output.' }],\n\t},\n\t{\n\t\tname: 'snapshot',\n\t\tsummary: 'Capture, restore, list, or delete stack snapshots.',\n\t\tusage: 'devstack snapshot <command> [options]',\n\t\tlifecycle: 'offline',\n\t\tsideEffects: 'write',\n\t\trequiresDocker: true,\n\t\tsubcommands: [\n\t\t\t{\n\t\t\t\tname: 'save',\n\t\t\t\tsummary: 'Capture a snapshot through a one-shot stack boot.',\n\t\t\t\tusage: 'devstack snapshot save [name] [options]',\n\t\t\t\tlifecycle: 'one-shot',\n\t\t\t\tsideEffects: 'write',\n\t\t\t\trequiresDocker: true,\n\t\t\t\targuments: ['name'],\n\t\t\t\toptions: [\n\t\t\t\t\t...configOptions,\n\t\t\t\t\t{ name: 'name', value: 'name', description: 'Human-readable snapshot name.' },\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'restore',\n\t\t\t\tsummary: 'Restore a snapshot by name or id.',\n\t\t\t\tusage: 'devstack snapshot restore <name-or-id> [options]',\n\t\t\t\tlifecycle: 'offline',\n\t\t\t\tsideEffects: 'destructive',\n\t\t\t\trequiresDocker: true,\n\t\t\t\targuments: ['name-or-id'],\n\t\t\t\toptions: confirmOptions,\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'list',\n\t\t\t\tsummary: 'List snapshots for the selected stack.',\n\t\t\t\tusage: 'devstack snapshot list [options]',\n\t\t\t\tlifecycle: 'offline',\n\t\t\t\tsideEffects: 'read',\n\t\t\t\trequiresDocker: false,\n\t\t\t\toptions: identityOptions,\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'delete',\n\t\t\t\tsummary: 'Delete a snapshot by name or id.',\n\t\t\t\tusage: 'devstack snapshot delete <name-or-id> [options]',\n\t\t\t\tlifecycle: 'offline',\n\t\t\t\tsideEffects: 'destructive',\n\t\t\t\trequiresDocker: false,\n\t\t\t\targuments: ['name-or-id'],\n\t\t\t\toptions: confirmOptions,\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tname: 'prune',\n\t\tsummary: 'Inventory and prune devstack-labelled Docker resources.',\n\t\tusage: 'devstack prune [--list | --dry-run | --all --yes] [options]',\n\t\tlifecycle: 'offline',\n\t\tsideEffects: 'destructive',\n\t\trequiresDocker: true,\n\t\toptions: [\n\t\t\t...globalMaintenanceOptions,\n\t\t\t{ name: 'list', description: 'List resource groups without pruning.' },\n\t\t\t{ name: 'all', description: 'Prune every idle non-shared resource group.' },\n\t\t\t{ name: 'no-containers', description: 'Do not remove containers.' },\n\t\t\t{ name: 'no-networks', description: 'Do not remove networks.' },\n\t\t\t{ name: 'no-volumes', description: 'Do not remove volumes.' },\n\t\t\t{ name: 'include-images', description: 'Also remove devstack-labelled images.' },\n\t\t\t{ name: 'dry-run', description: 'Skip mutating effects.' },\n\t\t\t{ name: 'yes', description: 'Assume yes on prompts.' },\n\t\t\t{ name: 'no-input', description: 'Forbid prompts.' },\n\t\t],\n\t},\n\t{\n\t\tname: 'wipe',\n\t\tsummary: 'Destroy all state for the selected stack.',\n\t\tusage: 'devstack wipe [--dry-run] [--yes] [options]',\n\t\tlifecycle: 'offline',\n\t\tsideEffects: 'destructive',\n\t\trequiresDocker: true,\n\t\toptions: [\n\t\t\t...identityOptions,\n\t\t\t{ name: 'dry-run', description: 'Skip mutating effects.' },\n\t\t\t{ name: 'yes', description: 'Assume yes on prompts.' },\n\t\t\t{ name: 'no-input', description: 'Forbid prompts.' },\n\t\t],\n\t},\n] as const satisfies ReadonlyArray<CommandNode>;\n\nexport const COMMAND_TREE: CommandNode = {\n\tname: 'devstack',\n\tsummary: 'Sui development stack CLI.',\n\tusage: 'devstack <command> [options]',\n\tlifecycle: 'offline',\n\tsideEffects: 'none',\n\trequiresDocker: false,\n\tdescription: 'Boot, inspect, snapshot, and manage local Sui development stacks.',\n\tsubcommands: commands,\n};\n\nexport type Verb = (typeof commands)[number]['name'];\n\nexport const VERBS: ReadonlyArray<Verb> = commands.map((command) => command.name);\n\nexport const commandSchema = () => ({\n\tschemaVersion: 1,\n\tverbs: VERBS,\n\tcommands: COMMAND_TREE,\n\texitCodes: exitCodeTable,\n\tenvVars: Object.values(ENV_VARS),\n});\n"],"mappings":";;;AAwBA,MAAM,kBAAkB;CACvB;EAAE,MAAM;EAAQ,aAAa;EAA8B;CAC3D;EAAE,MAAM;EAAO,OAAO;EAAQ,aAAa;EAAsB;CACjE;EAAE,MAAM;EAAS,OAAO;EAAQ,aAAa;EAAwB;CACrE;EAAE,MAAM;EAAa,OAAO;EAAQ,aAAa;EAA6B;CAC9E;EAAE,MAAM;EAAW,aAAa;EAAgC;CAChE;AAED,MAAM,gBAAgB;CACrB,G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AAK;AAEjF,MAAa,uBAAuB;CACnC,eAAe;CACf,OAAO;CACP,UAAU;CACV,WAAW;CACX,SAAS,OAAO,OAAO,SAAS;CAChC"}
|
|
1
|
+
{"version":3,"file":"command-tree.mjs","names":[],"sources":["../../../src/surfaces/cli/command-tree.ts"],"sourcesContent":["import { ENV_VARS } from './flags.ts';\nimport { exitCodeTable } from './sysexits.ts';\n\nexport type CommandLifecycle = 'attached' | 'live-aware' | 'one-shot' | 'offline';\n\nexport interface CommandOption {\n\treadonly name: string;\n\treadonly value?: string;\n\treadonly description: string;\n}\n\nexport interface CommandNode {\n\treadonly name: string;\n\treadonly summary: string;\n\treadonly usage: string;\n\treadonly lifecycle: CommandLifecycle;\n\treadonly sideEffects: 'none' | 'read' | 'write' | 'destructive';\n\treadonly requiresDocker: boolean;\n\treadonly description?: string;\n\treadonly arguments?: ReadonlyArray<string>;\n\treadonly options?: ReadonlyArray<CommandOption>;\n\treadonly subcommands?: ReadonlyArray<CommandNode>;\n}\n\nconst identityOptions = [\n\t{ name: 'json', description: 'Emit JSON envelope output.' },\n\t{ name: 'app', value: 'name', description: 'Override app name.' },\n\t{ name: 'stack', value: 'name', description: 'Override stack name.' },\n\t{ name: 'state-dir', value: 'path', description: 'Override state directory.' },\n\t{ name: 'verbose', description: 'Enable more verbose logging.' },\n] as const satisfies ReadonlyArray<CommandOption>;\n\nconst configOptions = [\n\t...identityOptions,\n\t{ name: 'config', value: 'path', description: 'Override devstack.config.ts path.' },\n\t{ name: 'network', value: 'name', description: 'Override network before config import.' },\n] as const satisfies ReadonlyArray<CommandOption>;\n\nconst confirmOptions = [\n\t...identityOptions,\n\t{ name: 'yes', description: 'Assume yes on prompts.' },\n\t{ name: 'no-input', description: 'Forbid prompts.' },\n] as const satisfies ReadonlyArray<CommandOption>;\n\nconst globalMaintenanceOptions = [\n\t{ name: 'json', description: 'Emit JSON envelope output.' },\n\t{ name: 'state-dir', value: 'path', description: 'Override state directory.' },\n\t{ name: 'verbose', description: 'Enable more verbose logging.' },\n] as const satisfies ReadonlyArray<CommandOption>;\n\nconst commands = [\n\t{\n\t\tname: 'up',\n\t\tsummary: 'Boot a stack and stay attached until interrupted.',\n\t\tusage: 'devstack up [options]',\n\t\tlifecycle: 'attached',\n\t\tsideEffects: 'write',\n\t\trequiresDocker: true,\n\t\tdescription: 'Starts the supervisor and renders the attached operator surface.',\n\t\toptions: [\n\t\t\t...configOptions,\n\t\t\t{\n\t\t\t\tname: 'renderer',\n\t\t\t\tvalue: 'tui|plain|silent',\n\t\t\t\tdescription: 'Select the attached renderer.',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'from-snapshot',\n\t\t\t\tvalue: 'name-or-id',\n\t\t\t\tdescription: 'Start by restoring a snapshot before the initial acquire.',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'snapshot-cache',\n\t\t\t\tvalue: 'name',\n\t\t\t\tdescription: 'Use a named snapshot as a startup cache and refresh it when stale.',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'snapshot-stale',\n\t\t\t\tvalue: 'warn|block|clean-start',\n\t\t\t\tdescription: 'Policy when --from-snapshot inputs differ from the current stack.',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tname: 'apply',\n\t\tsummary: 'Re-emit the per-stack ids file and dev extras from a live or one-shot stack.',\n\t\tusage: 'devstack apply [options]',\n\t\tlifecycle: 'live-aware',\n\t\tsideEffects: 'write',\n\t\trequiresDocker: true,\n\t\toptions: configOptions,\n\t},\n\t{\n\t\tname: 'codegen',\n\t\tsummary: 'Regenerate committed bindings from Move source (no stack boot).',\n\t\tusage: 'devstack codegen [options]',\n\t\tlifecycle: 'one-shot',\n\t\tsideEffects: 'write',\n\t\trequiresDocker: false,\n\t\tdescription:\n\t\t\t'Move-compiles local package sources and emits the committed src/generated tree (type bindings + sentinel-id config stubs) without booting a stack.',\n\t\toptions: configOptions,\n\t},\n\t{\n\t\tname: 'dump-ids',\n\t\tsummary: 'Emit the stack id-config (devstack-ids.json) for a real-network deploy.',\n\t\tusage: 'devstack dump-ids [options]',\n\t\tlifecycle: 'live-aware',\n\t\tsideEffects: 'write',\n\t\trequiresDocker: true,\n\t\tdescription:\n\t\t\t'Emits the stack devstack-ids.json id-config to --out (or stdout). Reads the existing file when a supervisor is live; otherwise runs a one-shot boot to produce it, then tears down. The supported way to obtain a committed id-config file for a real-network deploy.',\n\t\toptions: [\n\t\t\t...configOptions,\n\t\t\t{\n\t\t\t\tname: 'out',\n\t\t\t\tvalue: 'path',\n\t\t\t\tdescription: 'Write the id-config JSON to this file instead of stdout.',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tname: 'status',\n\t\tsummary: 'Show the current stack projection (offline: from the manifest).',\n\t\tusage: 'devstack status [options]',\n\t\tlifecycle: 'offline',\n\t\tsideEffects: 'read',\n\t\trequiresDocker: false,\n\t\toptions: identityOptions,\n\t},\n\t{\n\t\tname: 'doctor',\n\t\tsummary: 'Run host and stack preflight checks.',\n\t\tusage: 'devstack doctor [options]',\n\t\tlifecycle: 'offline',\n\t\tsideEffects: 'read',\n\t\trequiresDocker: true,\n\t\toptions: identityOptions,\n\t},\n\t{\n\t\tname: 'config',\n\t\tsummary: 'Print resolved config inputs.',\n\t\tusage: 'devstack config [options]',\n\t\tlifecycle: 'offline',\n\t\tsideEffects: 'read',\n\t\trequiresDocker: false,\n\t\toptions: configOptions,\n\t},\n\t{\n\t\tname: 'schema',\n\t\tsummary: 'Emit the CLI schema.',\n\t\tusage: 'devstack schema --json',\n\t\tlifecycle: 'offline',\n\t\tsideEffects: 'none',\n\t\trequiresDocker: false,\n\t\toptions: [{ name: 'json', description: 'Emit JSON schema output.' }],\n\t},\n\t{\n\t\tname: 'snapshot',\n\t\tsummary: 'Capture, restore, list, or delete stack snapshots.',\n\t\tusage: 'devstack snapshot <command> [options]',\n\t\tlifecycle: 'offline',\n\t\tsideEffects: 'write',\n\t\trequiresDocker: true,\n\t\tsubcommands: [\n\t\t\t{\n\t\t\t\tname: 'save',\n\t\t\t\tsummary: 'Capture a snapshot through a one-shot stack boot.',\n\t\t\t\tusage: 'devstack snapshot save [name] [options]',\n\t\t\t\tlifecycle: 'one-shot',\n\t\t\t\tsideEffects: 'write',\n\t\t\t\trequiresDocker: true,\n\t\t\t\targuments: ['name'],\n\t\t\t\toptions: [\n\t\t\t\t\t...configOptions,\n\t\t\t\t\t{ name: 'name', value: 'name', description: 'Human-readable snapshot name.' },\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'restore',\n\t\t\t\tsummary: 'Restore a snapshot by name or id.',\n\t\t\t\tusage: 'devstack snapshot restore <name-or-id> [options]',\n\t\t\t\tlifecycle: 'offline',\n\t\t\t\tsideEffects: 'destructive',\n\t\t\t\trequiresDocker: true,\n\t\t\t\targuments: ['name-or-id'],\n\t\t\t\toptions: confirmOptions,\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'list',\n\t\t\t\tsummary: 'List snapshots for the selected stack.',\n\t\t\t\tusage: 'devstack snapshot list [options]',\n\t\t\t\tlifecycle: 'offline',\n\t\t\t\tsideEffects: 'read',\n\t\t\t\trequiresDocker: false,\n\t\t\t\toptions: identityOptions,\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'delete',\n\t\t\t\tsummary: 'Delete a snapshot by name or id.',\n\t\t\t\tusage: 'devstack snapshot delete <name-or-id> [options]',\n\t\t\t\tlifecycle: 'offline',\n\t\t\t\tsideEffects: 'destructive',\n\t\t\t\trequiresDocker: false,\n\t\t\t\targuments: ['name-or-id'],\n\t\t\t\toptions: confirmOptions,\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tname: 'prune',\n\t\tsummary: 'Inventory and prune devstack-labelled Docker resources.',\n\t\tusage: 'devstack prune [--list | --dry-run | --all --yes] [options]',\n\t\tlifecycle: 'offline',\n\t\tsideEffects: 'destructive',\n\t\trequiresDocker: true,\n\t\toptions: [\n\t\t\t...globalMaintenanceOptions,\n\t\t\t{ name: 'list', description: 'List resource groups without pruning.' },\n\t\t\t{ name: 'all', description: 'Prune every idle non-shared resource group.' },\n\t\t\t{ name: 'no-containers', description: 'Do not remove containers.' },\n\t\t\t{ name: 'no-networks', description: 'Do not remove networks.' },\n\t\t\t{ name: 'no-volumes', description: 'Do not remove volumes.' },\n\t\t\t{ name: 'include-images', description: 'Also remove devstack-labelled images.' },\n\t\t\t{ name: 'dry-run', description: 'Skip mutating effects.' },\n\t\t\t{ name: 'yes', description: 'Assume yes on prompts.' },\n\t\t\t{ name: 'no-input', description: 'Forbid prompts.' },\n\t\t],\n\t},\n\t{\n\t\tname: 'wipe',\n\t\tsummary: 'Destroy all state for the selected stack.',\n\t\tusage: 'devstack wipe [--dry-run] [--yes] [options]',\n\t\tlifecycle: 'offline',\n\t\tsideEffects: 'destructive',\n\t\trequiresDocker: true,\n\t\toptions: [\n\t\t\t...identityOptions,\n\t\t\t{ name: 'dry-run', description: 'Skip mutating effects.' },\n\t\t\t{ name: 'yes', description: 'Assume yes on prompts.' },\n\t\t\t{ name: 'no-input', description: 'Forbid prompts.' },\n\t\t],\n\t},\n] as const satisfies ReadonlyArray<CommandNode>;\n\nexport const COMMAND_TREE: CommandNode = {\n\tname: 'devstack',\n\tsummary: 'Sui development stack CLI.',\n\tusage: 'devstack <command> [options]',\n\tlifecycle: 'offline',\n\tsideEffects: 'none',\n\trequiresDocker: false,\n\tdescription: 'Boot, inspect, snapshot, and manage local Sui development stacks.',\n\tsubcommands: commands,\n};\n\nexport type Verb = (typeof commands)[number]['name'];\n\nexport const VERBS: ReadonlyArray<Verb> = commands.map((command) => command.name);\n\nexport const commandSchema = () => ({\n\tschemaVersion: 1,\n\tverbs: VERBS,\n\tcommands: COMMAND_TREE,\n\texitCodes: exitCodeTable,\n\tenvVars: Object.values(ENV_VARS),\n});\n"],"mappings":";;;AAwBA,MAAM,kBAAkB;CACvB;EAAE,MAAM;EAAQ,aAAa;CAA6B;CAC1D;EAAE,MAAM;EAAO,OAAO;EAAQ,aAAa;CAAqB;CAChE;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GAAyB;GAC5D;IAAE,MAAM;IAAkB,aAAa;GAAwC;GAC/E;IAAE,MAAM;IAAW,aAAa;GAAyB;GACzD;IAAE,MAAM;IAAO,aAAa;GAAyB;GACrD;IAAE,MAAM;IAAY,aAAa;GAAkB;EACpD;CACD;CACA;EACC,MAAM;EACN,SAAS;EACT,OAAO;EACP,WAAW;EACX,aAAa;EACb,gBAAgB;EAChB,SAAS;GACR,GAAG;GACH;IAAE,MAAM;IAAW,aAAa;GAAyB;GACzD;IAAE,MAAM;IAAO,aAAa;GAAyB;GACrD;IAAE,MAAM;IAAY,aAAa;GAAkB;EACpD;CACD;AACD;AAEA,MAAa,eAA4B;CACxC,MAAM;CACN,SAAS;CACT,OAAO;CACP,WAAW;CACX,aAAa;CACb,gBAAgB;CAChB,aAAa;CACb,aAAa;AACd;AAIA,MAAa,QAA6B,SAAS,KAAK,YAAY,QAAQ,IAAI;AAEhF,MAAa,uBAAuB;CACnC,eAAe;CACf,OAAO;CACP,UAAU;CACV,WAAW;CACX,SAAS,OAAO,OAAO,QAAQ;AAChC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.mjs","names":[],"sources":["../../../../src/surfaces/cli/commands/config.ts"],"sourcesContent":["// CLI verb: `devstack config` — print resolved config.\n//\n// Observational. Loads the user's `devstack.config.ts`, resolves all\n// active overrides (flag > env > active-stack > default), and emits\n// the projection. Never publishes a command.\n//\n// JSON output is canonical: it is the same shape the programmable\n// API exposes for \"what is my config right now?\", so build\n// integrations can pin against it.\n\nimport { Effect } from 'effect';\n\nimport type { ConfigLoader, LoadedConfig } from './config-loader.ts';\nimport type { CliError } from '../errors.ts';\nimport { emitSuccess } from '../output.ts';\nimport type { CommandContext, CommandResult } from './index.ts';\n\nexport interface ConfigDeps {\n\treadonly loader: ConfigLoader;\n}\n\nexport const runConfig = (\n\tdeps: ConfigDeps,\n\tctx: CommandContext,\n): Effect.Effect<CommandResult, CliError> =>\n\tEffect.gen(function* () {\n\t\tconst started = Date.now();\n\t\tconst loaded: LoadedConfig = yield* deps.loader.load(ctx.flags.configPath);\n\t\tconst data = {\n\t\t\tresolvedConfigPath: loaded.resolvedConfigPath,\n\t\t\tapp: ctx.flags.app ?? null,\n\t\t\tstack: ctx.flags.stack ?? null,\n\t\t\tstateDir: ctx.flags.stateDir ?? null,\n\t\t\tnetwork: ctx.flags.network ?? null,\n\t\t};\n\t\tconst humanLines = [\n\t\t\t`config: ${data.resolvedConfigPath}`,\n\t\t\t`app: ${data.app ?? '(default)'}`,\n\t\t\t`stack: ${data.stack ?? '(default)'}`,\n\t\t\t`stateDir: ${data.stateDir ?? '(default)'}`,\n\t\t\t`network: ${data.network ?? '(default)'}`,\n\t\t];\n\t\tyield* emitSuccess(ctx.io, ctx.flags.outputMode, {\n\t\t\tcommand: 'config',\n\t\t\telapsedMs: Date.now() - started,\n\t\t\tdata,\n\t\t\thumanLines,\n\t\t});\n\t\treturn { exitCode: 0 } as CommandResult;\n\t})
|
|
1
|
+
{"version":3,"file":"config.mjs","names":[],"sources":["../../../../src/surfaces/cli/commands/config.ts"],"sourcesContent":["// CLI verb: `devstack config` — print resolved config.\n//\n// Observational. Loads the user's `devstack.config.ts`, resolves all\n// active overrides (flag > env > active-stack > default), and emits\n// the projection. Never publishes a command.\n//\n// JSON output is canonical: it is the same shape the programmable\n// API exposes for \"what is my config right now?\", so build\n// integrations can pin against it.\n\nimport { Effect } from 'effect';\n\nimport type { ConfigLoader, LoadedConfig } from './config-loader.ts';\nimport type { CliError } from '../errors.ts';\nimport { emitSuccess } from '../output.ts';\nimport type { CommandContext, CommandResult } from './index.ts';\n\nexport interface ConfigDeps {\n\treadonly loader: ConfigLoader;\n}\n\nexport const runConfig = (\n\tdeps: ConfigDeps,\n\tctx: CommandContext,\n): Effect.Effect<CommandResult, CliError> =>\n\tEffect.gen(function* () {\n\t\tconst started = Date.now();\n\t\tconst loaded: LoadedConfig = yield* deps.loader.load(ctx.flags.configPath);\n\t\tconst data = {\n\t\t\tresolvedConfigPath: loaded.resolvedConfigPath,\n\t\t\tapp: ctx.flags.app ?? null,\n\t\t\tstack: ctx.flags.stack ?? null,\n\t\t\tstateDir: ctx.flags.stateDir ?? null,\n\t\t\tnetwork: ctx.flags.network ?? null,\n\t\t};\n\t\tconst humanLines = [\n\t\t\t`config: ${data.resolvedConfigPath}`,\n\t\t\t`app: ${data.app ?? '(default)'}`,\n\t\t\t`stack: ${data.stack ?? '(default)'}`,\n\t\t\t`stateDir: ${data.stateDir ?? '(default)'}`,\n\t\t\t`network: ${data.network ?? '(default)'}`,\n\t\t];\n\t\tyield* emitSuccess(ctx.io, ctx.flags.outputMode, {\n\t\t\tcommand: 'config',\n\t\t\telapsedMs: Date.now() - started,\n\t\t\tdata,\n\t\t\thumanLines,\n\t\t});\n\t\treturn { exitCode: 0 } as CommandResult;\n\t});\n"],"mappings":";;;AAqBA,MAAa,aACZ,MACA,QAEA,OAAO,IAAI,aAAa;CACvB,MAAM,UAAU,KAAK,IAAI;CAEzB,MAAM,OAAO;EACZ,qBAAoB,OAFe,KAAK,OAAO,KAAK,IAAI,MAAM,UAAU,EAAA,CAE7C;EAC3B,KAAK,IAAI,MAAM,OAAO;EACtB,OAAO,IAAI,MAAM,SAAS;EAC1B,UAAU,IAAI,MAAM,YAAY;EAChC,SAAS,IAAI,MAAM,WAAW;CAC/B;CACA,MAAM,aAAa;EAClB,cAAc,KAAK;EACnB,cAAc,KAAK,OAAO;EAC1B,cAAc,KAAK,SAAS;EAC5B,cAAc,KAAK,YAAY;EAC/B,cAAc,KAAK,WAAW;CAC/B;CACA,OAAO,YAAY,IAAI,IAAI,IAAI,MAAM,YAAY;EAChD,SAAS;EACT,WAAW,KAAK,IAAI,IAAI;EACxB;EACA;CACD,CAAC;CACD,OAAO,EAAE,UAAU,EAAE;AACtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confirm-node.mjs","names":[],"sources":["../../../../src/surfaces/cli/commands/confirm-node.ts"],"sourcesContent":["import { stderr, stdin } from 'node:process';\nimport { createInterface } from 'node:readline/promises';\n\nimport { Effect } from 'effect';\n\nimport { CliInternalError } from '../errors.ts';\nimport type { ConfirmPrompt } from './confirm.ts';\n\nexport const nodeConfirmPrompt: ConfirmPrompt = (input) =>\n\tEffect.tryPromise({\n\t\ttry: async () => {\n\t\t\tconst rl = createInterface({ input: stdin, output: stderr });\n\t\t\ttry {\n\t\t\t\tconst answer = await rl.question(`${input.prompt} Type y to continue: `);\n\t\t\t\treturn answer.trim().toLowerCase() === 'y';\n\t\t\t} finally {\n\t\t\t\trl.close();\n\t\t\t}\n\t\t},\n\t\tcatch: (cause) =>\n\t\t\tnew CliInternalError({\n\t\t\t\tmessage: `${input.verb} confirmation prompt failed`,\n\t\t\t\tcause,\n\t\t\t}),\n\t});\n"],"mappings":";;;;;AAQA,MAAa,qBAAoC,UAChD,OAAO,WAAW;CACjB,KAAK,YAAY;EAChB,MAAM,KAAK,gBAAgB;GAAE,OAAO;GAAO,QAAQ;
|
|
1
|
+
{"version":3,"file":"confirm-node.mjs","names":[],"sources":["../../../../src/surfaces/cli/commands/confirm-node.ts"],"sourcesContent":["import { stderr, stdin } from 'node:process';\nimport { createInterface } from 'node:readline/promises';\n\nimport { Effect } from 'effect';\n\nimport { CliInternalError } from '../errors.ts';\nimport type { ConfirmPrompt } from './confirm.ts';\n\nexport const nodeConfirmPrompt: ConfirmPrompt = (input) =>\n\tEffect.tryPromise({\n\t\ttry: async () => {\n\t\t\tconst rl = createInterface({ input: stdin, output: stderr });\n\t\t\ttry {\n\t\t\t\tconst answer = await rl.question(`${input.prompt} Type y to continue: `);\n\t\t\t\treturn answer.trim().toLowerCase() === 'y';\n\t\t\t} finally {\n\t\t\t\trl.close();\n\t\t\t}\n\t\t},\n\t\tcatch: (cause) =>\n\t\t\tnew CliInternalError({\n\t\t\t\tmessage: `${input.verb} confirmation prompt failed`,\n\t\t\t\tcause,\n\t\t\t}),\n\t});\n"],"mappings":";;;;;AAQA,MAAa,qBAAoC,UAChD,OAAO,WAAW;CACjB,KAAK,YAAY;EAChB,MAAM,KAAK,gBAAgB;GAAE,OAAO;GAAO,QAAQ;EAAO,CAAC;EAC3D,IAAI;GAEH,QAAO,MADc,GAAG,SAAS,GAAG,MAAM,OAAO,sBAAsB,EAAA,CACzD,KAAK,CAAC,CAAC,YAAY,MAAM;EACxC,UAAU;GACT,GAAG,MAAM;EACV;CACD;CACA,QAAQ,UACP,IAAI,iBAAiB;EACpB,SAAS,GAAG,MAAM,KAAK;EACvB;CACD,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confirm.mjs","names":[],"sources":["../../../../src/surfaces/cli/commands/confirm.ts"],"sourcesContent":["import { Effect } from 'effect';\n\nimport {\n\ttype CliError,\n\tCliConfirmDeclinedError,\n\tCliConfirmRequiredError,\n\tCliInternalError,\n\tisCliError,\n} from '../errors.ts';\nimport type { CommandContext } from './index.ts';\n\nexport interface ConfirmPromptInput {\n\treadonly verb: string;\n\treadonly prompt: string;\n}\n\nexport type ConfirmPrompt = (input: ConfirmPromptInput) => Effect.Effect<boolean, unknown>;\n\nexport const confirmDestructive = (\n\tconfirm: ConfirmPrompt,\n\tctx: CommandContext,\n\tinput: ConfirmPromptInput & { readonly skipWhenDryRun?: boolean },\n): Effect.Effect<void, CliError> =>\n\tEffect.gen(function* () {\n\t\tif (input.skipWhenDryRun !== false && ctx.flags.dryRun) return;\n\t\tconst { assumeYes, forbidPrompt, stdinIsTty } = ctx.flags.confirm;\n\t\tif (assumeYes) return;\n\t\tif (forbidPrompt || !stdinIsTty) {\n\t\t\treturn yield* Effect.fail(\n\t\t\t\tnew CliConfirmRequiredError({\n\t\t\t\t\tverb: input.verb,\n\t\t\t\t\thint: 'rerun with --yes or run in a TTY to confirm interactively',\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\t\tconst confirmed = yield* confirm({ verb: input.verb, prompt: input.prompt }).pipe(\n\t\t\tEffect.catch((cause: unknown) =>\n\t\t\t\tisCliError(cause)\n\t\t\t\t\t? Effect.fail(cause)\n\t\t\t\t\t: Effect.fail(\n\t\t\t\t\t\t\tnew CliInternalError({\n\t\t\t\t\t\t\t\tmessage: `${input.verb} confirmation prompt failed`,\n\t\t\t\t\t\t\t\tcause,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\tif (!confirmed) {\n\t\t\treturn yield* Effect.fail(\n\t\t\t\tnew CliConfirmDeclinedError({\n\t\t\t\t\tverb: input.verb,\n\t\t\t\t\thint: 'rerun with --yes to skip interactive confirmation',\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\t});\n"],"mappings":";;;AAkBA,MAAa,sBACZ,SACA,KACA,UAEA,OAAO,IAAI,aAAa;
|
|
1
|
+
{"version":3,"file":"confirm.mjs","names":[],"sources":["../../../../src/surfaces/cli/commands/confirm.ts"],"sourcesContent":["import { Effect } from 'effect';\n\nimport {\n\ttype CliError,\n\tCliConfirmDeclinedError,\n\tCliConfirmRequiredError,\n\tCliInternalError,\n\tisCliError,\n} from '../errors.ts';\nimport type { CommandContext } from './index.ts';\n\nexport interface ConfirmPromptInput {\n\treadonly verb: string;\n\treadonly prompt: string;\n}\n\nexport type ConfirmPrompt = (input: ConfirmPromptInput) => Effect.Effect<boolean, unknown>;\n\nexport const confirmDestructive = (\n\tconfirm: ConfirmPrompt,\n\tctx: CommandContext,\n\tinput: ConfirmPromptInput & { readonly skipWhenDryRun?: boolean },\n): Effect.Effect<void, CliError> =>\n\tEffect.gen(function* () {\n\t\tif (input.skipWhenDryRun !== false && ctx.flags.dryRun) return;\n\t\tconst { assumeYes, forbidPrompt, stdinIsTty } = ctx.flags.confirm;\n\t\tif (assumeYes) return;\n\t\tif (forbidPrompt || !stdinIsTty) {\n\t\t\treturn yield* Effect.fail(\n\t\t\t\tnew CliConfirmRequiredError({\n\t\t\t\t\tverb: input.verb,\n\t\t\t\t\thint: 'rerun with --yes or run in a TTY to confirm interactively',\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\t\tconst confirmed = yield* confirm({ verb: input.verb, prompt: input.prompt }).pipe(\n\t\t\tEffect.catch((cause: unknown) =>\n\t\t\t\tisCliError(cause)\n\t\t\t\t\t? Effect.fail(cause)\n\t\t\t\t\t: Effect.fail(\n\t\t\t\t\t\t\tnew CliInternalError({\n\t\t\t\t\t\t\t\tmessage: `${input.verb} confirmation prompt failed`,\n\t\t\t\t\t\t\t\tcause,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\tif (!confirmed) {\n\t\t\treturn yield* Effect.fail(\n\t\t\t\tnew CliConfirmDeclinedError({\n\t\t\t\t\tverb: input.verb,\n\t\t\t\t\thint: 'rerun with --yes to skip interactive confirmation',\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\t});\n"],"mappings":";;;AAkBA,MAAa,sBACZ,SACA,KACA,UAEA,OAAO,IAAI,aAAa;CACvB,IAAI,MAAM,mBAAmB,SAAS,IAAI,MAAM,QAAQ;CACxD,MAAM,EAAE,WAAW,cAAc,eAAe,IAAI,MAAM;CAC1D,IAAI,WAAW;CACf,IAAI,gBAAgB,CAAC,YACpB,OAAO,OAAO,OAAO,KACpB,IAAI,wBAAwB;EAC3B,MAAM,MAAM;EACZ,MAAM;CACP,CAAC,CACF;CAcD,IAAI,EAAC,OAZoB,QAAQ;EAAE,MAAM,MAAM;EAAM,QAAQ,MAAM;CAAO,CAAC,CAAC,CAAC,KAC5E,OAAO,OAAO,UACb,WAAW,KAAK,IACb,OAAO,KAAK,KAAK,IACjB,OAAO,KACP,IAAI,iBAAiB;EACpB,SAAS,GAAG,MAAM,KAAK;EACvB;CACD,CAAC,CACF,CACH,CACD,IAEC,OAAO,OAAO,OAAO,KACpB,IAAI,wBAAwB;EAC3B,MAAM,MAAM;EACZ,MAAM;CACP,CAAC,CACF;AAEF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.mjs","names":[],"sources":["../../../../src/surfaces/cli/commands/doctor.ts"],"sourcesContent":["// CLI verb: `devstack doctor` — health check / lint of the user's\n// stack.\n//\n// Architecture (distilled/20-cli.md § Subcommands § Diagnostic):\n// \"doctor — preflight check matrix + environment inventory,\n// optionally cleaning stale locks.\"\n//\n// Doctor runs a fixed set of probes. Each probe returns a typed\n// outcome (ok | warn | fail | unavailable); the verb projects them\n// into the JSON data block / human table. Probes are pluggable —\n// the dispatcher composes the L1 docker probe, the move-build-lock\n// probe, the port-allocator probe, etc. The CLI just orchestrates.\n//\n// Surface invariant (architecture § Learnings): \"Doctor's port probe\n// must mirror the engine.\" — the probes themselves must be wired to\n// the same primitives the engine uses.\n\nimport { Effect } from 'effect';\n\nimport { type CliError, CliUnavailableError } from '../errors.ts';\nimport { emitSuccess } from '../output.ts';\nimport type { CommandContext, CommandResult } from './index.ts';\n\nexport type ProbeOutcome =\n\t| { readonly status: 'ok'; readonly detail?: string }\n\t| { readonly status: 'warn'; readonly detail: string }\n\t| { readonly status: 'fail'; readonly detail: string }\n\t| { readonly status: 'unavailable'; readonly detail: string };\n\nexport interface Probe {\n\treadonly name: string;\n\treadonly description: string;\n\treadonly required: boolean;\n\treadonly run: () => Effect.Effect<ProbeOutcome>;\n}\n\nexport interface ProbeReport {\n\treadonly name: string;\n\treadonly description: string;\n\treadonly required: boolean;\n\treadonly outcome: ProbeOutcome;\n}\n\nexport interface DoctorDeps {\n\treadonly probes: ReadonlyArray<Probe>;\n}\n\nexport const runDoctor = (\n\tdeps: DoctorDeps,\n\tctx: CommandContext,\n): Effect.Effect<CommandResult, CliError> =>\n\tEffect.gen(function* () {\n\t\tconst started = Date.now();\n\t\tconst reports: Array<ProbeReport> = [];\n\t\tfor (const probe of deps.probes) {\n\t\t\tconst outcome = yield* probe.run();\n\t\t\treports.push({\n\t\t\t\tname: probe.name,\n\t\t\t\tdescription: probe.description,\n\t\t\t\trequired: probe.required,\n\t\t\t\toutcome,\n\t\t\t});\n\t\t}\n\t\tconst requiredFailures = reports.filter(\n\t\t\t(\n\t\t\t\tr,\n\t\t\t): r is ProbeReport & {\n\t\t\t\toutcome: Extract<ProbeOutcome, { status: 'fail' | 'unavailable' }>;\n\t\t\t} => r.required && (r.outcome.status === 'fail' || r.outcome.status === 'unavailable'),\n\t\t);\n\t\tif (requiredFailures.length > 0) {\n\t\t\t// Surface the first required-failure as an `Unavailable`\n\t\t\t// error so the exit code is `EX_UNAVAILABLE` (architecture\n\t\t\t// edge-case: \"Docker daemon unreachable → doctor surfaces a\n\t\t\t// required-check failure with the unavailable exit code\").\n\t\t\tconst first = requiredFailures[0]!;\n\t\t\treturn yield* Effect.fail(\n\t\t\t\tnew CliUnavailableError({\n\t\t\t\t\tmessage: first.outcome.detail,\n\t\t\t\t\tservice: first.name,\n\t\t\t\t\thint: first.outcome.detail,\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\t\tconst humanLines = reports.map(\n\t\t\t(r) =>\n\t\t\t\t`${r.outcome.status.padEnd(11, ' ')} ${r.name}${\n\t\t\t\t\tr.outcome.status !== 'ok' && 'detail' in r.outcome ? ` — ${r.outcome.detail ?? ''}` : ''\n\t\t\t\t}`,\n\t\t);\n\t\tyield* emitSuccess(ctx.io, ctx.flags.outputMode, {\n\t\t\tcommand: 'doctor',\n\t\t\telapsedMs: Date.now() - started,\n\t\t\tdata: { reports },\n\t\t\thumanLines,\n\t\t});\n\t\treturn { exitCode: 0 } as CommandResult;\n\t})
|
|
1
|
+
{"version":3,"file":"doctor.mjs","names":[],"sources":["../../../../src/surfaces/cli/commands/doctor.ts"],"sourcesContent":["// CLI verb: `devstack doctor` — health check / lint of the user's\n// stack.\n//\n// Architecture (distilled/20-cli.md § Subcommands § Diagnostic):\n// \"doctor — preflight check matrix + environment inventory,\n// optionally cleaning stale locks.\"\n//\n// Doctor runs a fixed set of probes. Each probe returns a typed\n// outcome (ok | warn | fail | unavailable); the verb projects them\n// into the JSON data block / human table. Probes are pluggable —\n// the dispatcher composes the L1 docker probe, the move-build-lock\n// probe, the port-allocator probe, etc. The CLI just orchestrates.\n//\n// Surface invariant (architecture § Learnings): \"Doctor's port probe\n// must mirror the engine.\" — the probes themselves must be wired to\n// the same primitives the engine uses.\n\nimport { Effect } from 'effect';\n\nimport { type CliError, CliUnavailableError } from '../errors.ts';\nimport { emitSuccess } from '../output.ts';\nimport type { CommandContext, CommandResult } from './index.ts';\n\nexport type ProbeOutcome =\n\t| { readonly status: 'ok'; readonly detail?: string }\n\t| { readonly status: 'warn'; readonly detail: string }\n\t| { readonly status: 'fail'; readonly detail: string }\n\t| { readonly status: 'unavailable'; readonly detail: string };\n\nexport interface Probe {\n\treadonly name: string;\n\treadonly description: string;\n\treadonly required: boolean;\n\treadonly run: () => Effect.Effect<ProbeOutcome>;\n}\n\nexport interface ProbeReport {\n\treadonly name: string;\n\treadonly description: string;\n\treadonly required: boolean;\n\treadonly outcome: ProbeOutcome;\n}\n\nexport interface DoctorDeps {\n\treadonly probes: ReadonlyArray<Probe>;\n}\n\nexport const runDoctor = (\n\tdeps: DoctorDeps,\n\tctx: CommandContext,\n): Effect.Effect<CommandResult, CliError> =>\n\tEffect.gen(function* () {\n\t\tconst started = Date.now();\n\t\tconst reports: Array<ProbeReport> = [];\n\t\tfor (const probe of deps.probes) {\n\t\t\tconst outcome = yield* probe.run();\n\t\t\treports.push({\n\t\t\t\tname: probe.name,\n\t\t\t\tdescription: probe.description,\n\t\t\t\trequired: probe.required,\n\t\t\t\toutcome,\n\t\t\t});\n\t\t}\n\t\tconst requiredFailures = reports.filter(\n\t\t\t(\n\t\t\t\tr,\n\t\t\t): r is ProbeReport & {\n\t\t\t\toutcome: Extract<ProbeOutcome, { status: 'fail' | 'unavailable' }>;\n\t\t\t} => r.required && (r.outcome.status === 'fail' || r.outcome.status === 'unavailable'),\n\t\t);\n\t\tif (requiredFailures.length > 0) {\n\t\t\t// Surface the first required-failure as an `Unavailable`\n\t\t\t// error so the exit code is `EX_UNAVAILABLE` (architecture\n\t\t\t// edge-case: \"Docker daemon unreachable → doctor surfaces a\n\t\t\t// required-check failure with the unavailable exit code\").\n\t\t\tconst first = requiredFailures[0]!;\n\t\t\treturn yield* Effect.fail(\n\t\t\t\tnew CliUnavailableError({\n\t\t\t\t\tmessage: first.outcome.detail,\n\t\t\t\t\tservice: first.name,\n\t\t\t\t\thint: first.outcome.detail,\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\t\tconst humanLines = reports.map(\n\t\t\t(r) =>\n\t\t\t\t`${r.outcome.status.padEnd(11, ' ')} ${r.name}${\n\t\t\t\t\tr.outcome.status !== 'ok' && 'detail' in r.outcome ? ` — ${r.outcome.detail ?? ''}` : ''\n\t\t\t\t}`,\n\t\t);\n\t\tyield* emitSuccess(ctx.io, ctx.flags.outputMode, {\n\t\t\tcommand: 'doctor',\n\t\t\telapsedMs: Date.now() - started,\n\t\t\tdata: { reports },\n\t\t\thumanLines,\n\t\t});\n\t\treturn { exitCode: 0 } as CommandResult;\n\t});\n"],"mappings":";;;;AA+CA,MAAa,aACZ,MACA,QAEA,OAAO,IAAI,aAAa;CACvB,MAAM,UAAU,KAAK,IAAI;CACzB,MAAM,UAA8B,CAAC;CACrC,KAAK,MAAM,SAAS,KAAK,QAAQ;EAChC,MAAM,UAAU,OAAO,MAAM,IAAI;EACjC,QAAQ,KAAK;GACZ,MAAM,MAAM;GACZ,aAAa,MAAM;GACnB,UAAU,MAAM;GAChB;EACD,CAAC;CACF;CACA,MAAM,mBAAmB,QAAQ,QAE/B,MAGI,EAAE,aAAa,EAAE,QAAQ,WAAW,UAAU,EAAE,QAAQ,WAAW,cACzE;CACA,IAAI,iBAAiB,SAAS,GAAG;EAKhC,MAAM,QAAQ,iBAAiB;EAC/B,OAAO,OAAO,OAAO,KACpB,IAAI,oBAAoB;GACvB,SAAS,MAAM,QAAQ;GACvB,SAAS,MAAM;GACf,MAAM,MAAM,QAAQ;EACrB,CAAC,CACF;CACD;CACA,MAAM,aAAa,QAAQ,KACzB,MACA,GAAG,EAAE,QAAQ,OAAO,OAAO,IAAI,GAAG,EAAE,GAAG,EAAE,OACxC,EAAE,QAAQ,WAAW,QAAQ,YAAY,EAAE,UAAU,MAAM,EAAE,QAAQ,UAAU,OAAO,IAEzF;CACA,OAAO,YAAY,IAAI,IAAI,IAAI,MAAM,YAAY;EAChD,SAAS;EACT,WAAW,KAAK,IAAI,IAAI;EACxB,MAAM,EAAE,QAAQ;EAChB;CACD,CAAC;CACD,OAAO,EAAE,UAAU,EAAE;AACtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prune-picker-entry.mjs","names":[],"sources":["../../../../src/surfaces/cli/commands/prune-picker-entry.ts"],"sourcesContent":["// Lazy seam for the ink/react-based prune-picker UI.\n//\n// `cli/prune-direct.ts` is on every `devstack` CLI invocation path, so\n// the picker entry MUST NOT eagerly pull `ink` + `react` (~ several MB\n// of cold-start cost). Mirrors the `surfaces/tui/index.ts:dynamic\n// import('./mount-ink.tsx')` lazy-import pattern.\n\nimport { Effect } from 'effect';\n\nimport type { PruneInventory, PruneResourceScope, PruneTargetSelection } from './prune.ts';\n\nexport const selectPruneTargets = (\n\tinventory: PruneInventory,\n\tresources: PruneResourceScope,\n): Effect.Effect<PruneTargetSelection> => {\n\tif (inventory.groups.length === 0) return Effect.succeed({ groupKeys: [], resources });\n\treturn Effect.promise(() => import('./prune-picker.tsx')).pipe(\n\t\tEffect.flatMap((mod) => mod.selectPruneTargets(inventory, resources)),\n\t);\n};\n"],"mappings":";;AAWA,MAAa,sBACZ,WACA,cACyC;
|
|
1
|
+
{"version":3,"file":"prune-picker-entry.mjs","names":[],"sources":["../../../../src/surfaces/cli/commands/prune-picker-entry.ts"],"sourcesContent":["// Lazy seam for the ink/react-based prune-picker UI.\n//\n// `cli/prune-direct.ts` is on every `devstack` CLI invocation path, so\n// the picker entry MUST NOT eagerly pull `ink` + `react` (~ several MB\n// of cold-start cost). Mirrors the `surfaces/tui/index.ts:dynamic\n// import('./mount-ink.tsx')` lazy-import pattern.\n\nimport { Effect } from 'effect';\n\nimport type { PruneInventory, PruneResourceScope, PruneTargetSelection } from './prune.ts';\n\nexport const selectPruneTargets = (\n\tinventory: PruneInventory,\n\tresources: PruneResourceScope,\n): Effect.Effect<PruneTargetSelection> => {\n\tif (inventory.groups.length === 0) return Effect.succeed({ groupKeys: [], resources });\n\treturn Effect.promise(() => import('./prune-picker.tsx')).pipe(\n\t\tEffect.flatMap((mod) => mod.selectPruneTargets(inventory, resources)),\n\t);\n};\n"],"mappings":";;AAWA,MAAa,sBACZ,WACA,cACyC;CACzC,IAAI,UAAU,OAAO,WAAW,GAAG,OAAO,OAAO,QAAQ;EAAE,WAAW,CAAC;EAAG;CAAU,CAAC;CACrF,OAAO,OAAO,cAAc,OAAO,qBAAqB,CAAC,CAAC,KACzD,OAAO,SAAS,QAAQ,IAAI,mBAAmB,WAAW,SAAS,CAAC,CACrE;AACD"}
|