@mysten-incubation/devstack 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +189 -0
- package/README.md +94 -0
- package/dist/_virtual/_rolldown/runtime.mjs +13 -0
- package/dist/api/define-capabilities.d.mts +25 -0
- package/dist/api/define-capabilities.mjs +19 -0
- package/dist/api/define-capabilities.mjs.map +1 -0
- package/dist/api/define-devstack-with.d.mts +41 -0
- package/dist/api/define-devstack-with.mjs +24 -0
- package/dist/api/define-devstack-with.mjs.map +1 -0
- package/dist/api/define-devstack.d.mts +62 -0
- package/dist/api/define-devstack.mjs +108 -0
- package/dist/api/define-devstack.mjs.map +1 -0
- package/dist/api/define-plugin.d.mts +1 -0
- package/dist/api/inference-network.mjs +122 -0
- package/dist/api/inference-network.mjs.map +1 -0
- package/dist/api/mode-narrowed-factory.d.mts +26 -0
- package/dist/api/mode-narrowed-factory.mjs +8 -0
- package/dist/api/mode-narrowed-factory.mjs.map +1 -0
- package/dist/api/plugin-errors.mjs +10 -0
- package/dist/api/plugin-errors.mjs.map +1 -0
- package/dist/api/run-stack.d.mts +82 -0
- package/dist/api/run-stack.mjs +127 -0
- package/dist/api/run-stack.mjs.map +1 -0
- package/dist/build-integrations/playwright/config.d.mts +92 -0
- package/dist/build-integrations/playwright/config.mjs +71 -0
- package/dist/build-integrations/playwright/config.mjs.map +1 -0
- package/dist/build-integrations/playwright/errors.d.mts +82 -0
- package/dist/build-integrations/playwright/errors.mjs +43 -0
- package/dist/build-integrations/playwright/errors.mjs.map +1 -0
- package/dist/build-integrations/playwright/global-setup.d.mts +64 -0
- package/dist/build-integrations/playwright/global-setup.mjs +44 -0
- package/dist/build-integrations/playwright/global-setup.mjs.map +1 -0
- package/dist/build-integrations/playwright/index.d.mts +6 -0
- package/dist/build-integrations/playwright/index.mjs +6 -0
- package/dist/build-integrations/playwright/stack-context.d.mts +95 -0
- package/dist/build-integrations/playwright/stack-context.mjs +277 -0
- package/dist/build-integrations/playwright/stack-context.mjs.map +1 -0
- package/dist/build-integrations/playwright/wallet-context.d.mts +87 -0
- package/dist/build-integrations/playwright/wallet-context.mjs +148 -0
- package/dist/build-integrations/playwright/wallet-context.mjs.map +1 -0
- package/dist/build-integrations/runtime/cold-start-url.d.mts +67 -0
- package/dist/build-integrations/runtime/cold-start-url.mjs +56 -0
- package/dist/build-integrations/runtime/cold-start-url.mjs.map +1 -0
- package/dist/build-integrations/runtime/dapp-kit-slot.mjs +10 -0
- package/dist/build-integrations/runtime/dapp-kit-slot.mjs.map +1 -0
- package/dist/build-integrations/runtime/discover.d.mts +78 -0
- package/dist/build-integrations/runtime/discover.mjs +124 -0
- package/dist/build-integrations/runtime/discover.mjs.map +1 -0
- package/dist/build-integrations/runtime/endpoint-registry.d.mts +26 -0
- package/dist/build-integrations/runtime/endpoint-registry.mjs +41 -0
- package/dist/build-integrations/runtime/endpoint-registry.mjs.map +1 -0
- package/dist/build-integrations/runtime/errors.d.mts +64 -0
- package/dist/build-integrations/runtime/errors.mjs +51 -0
- package/dist/build-integrations/runtime/errors.mjs.map +1 -0
- package/dist/build-integrations/runtime/index.d.mts +7 -0
- package/dist/build-integrations/runtime/index.mjs +6 -0
- package/dist/build-integrations/runtime/read-stack-context.d.mts +38 -0
- package/dist/build-integrations/runtime/read-stack-context.mjs +130 -0
- package/dist/build-integrations/runtime/read-stack-context.mjs.map +1 -0
- package/dist/build-integrations/runtime/stack-context.d.mts +53 -0
- package/dist/build-integrations/vitest/config.d.mts +62 -0
- package/dist/build-integrations/vitest/config.mjs +80 -0
- package/dist/build-integrations/vitest/config.mjs.map +1 -0
- package/dist/build-integrations/vitest/env.d.mts +48 -0
- package/dist/build-integrations/vitest/env.mjs +50 -0
- package/dist/build-integrations/vitest/env.mjs.map +1 -0
- package/dist/build-integrations/vitest/errors.d.mts +44 -0
- package/dist/build-integrations/vitest/errors.mjs +18 -0
- package/dist/build-integrations/vitest/errors.mjs.map +1 -0
- package/dist/build-integrations/vitest/index.d.mts +6 -0
- package/dist/build-integrations/vitest/index.mjs +6 -0
- package/dist/build-integrations/vitest/setup.d.mts +53 -0
- package/dist/build-integrations/vitest/setup.mjs +56 -0
- package/dist/build-integrations/vitest/setup.mjs.map +1 -0
- package/dist/build-integrations/vitest/stack-context.d.mts +58 -0
- package/dist/build-integrations/vitest/stack-context.mjs +67 -0
- package/dist/build-integrations/vitest/stack-context.mjs.map +1 -0
- package/dist/cli/main.d.mts +5 -0
- package/dist/cli/main.mjs +586 -0
- package/dist/cli/main.mjs.map +1 -0
- package/dist/cli/prune-direct.mjs +216 -0
- package/dist/cli/prune-direct.mjs.map +1 -0
- package/dist/cli/snapshot-reader.mjs +73 -0
- package/dist/cli/snapshot-reader.mjs.map +1 -0
- package/dist/cli/up-lifecycle.mjs +28 -0
- package/dist/cli/up-lifecycle.mjs.map +1 -0
- package/dist/contracts/capability-decl.d.mts +42 -0
- package/dist/contracts/chain-probe.d.mts +26 -0
- package/dist/contracts/chain-probe.mjs +8 -0
- package/dist/contracts/chain-probe.mjs.map +1 -0
- package/dist/contracts/codegenable.d.mts +43 -0
- package/dist/contracts/container-runtime.d.mts +245 -0
- package/dist/contracts/liveness-classifier.d.mts +19 -0
- package/dist/contracts/network-resolver.d.mts +15 -0
- package/dist/contracts/network-resolver.mjs +7 -0
- package/dist/contracts/network-resolver.mjs.map +1 -0
- package/dist/contracts/projection.d.mts +15 -0
- package/dist/contracts/routable.d.mts +53 -0
- package/dist/contracts/snapshotable.d.mts +39 -0
- package/dist/contracts/strategy-contributor.d.mts +26 -0
- package/dist/index.d.mts +89 -0
- package/dist/index.mjs +37 -0
- package/dist/orchestrators/codegen/bindings.d.mts +2 -0
- package/dist/orchestrators/codegen/bindings.mjs +340 -0
- package/dist/orchestrators/codegen/bindings.mjs.map +1 -0
- package/dist/orchestrators/codegen/emit.mjs +56 -0
- package/dist/orchestrators/codegen/emit.mjs.map +1 -0
- package/dist/orchestrators/codegen/errors.d.mts +1 -0
- package/dist/orchestrators/codegen/errors.mjs +66 -0
- package/dist/orchestrators/codegen/errors.mjs.map +1 -0
- package/dist/orchestrators/codegen/extras.mjs +16 -0
- package/dist/orchestrators/codegen/extras.mjs.map +1 -0
- package/dist/orchestrators/codegen/format.mjs +109 -0
- package/dist/orchestrators/codegen/format.mjs.map +1 -0
- package/dist/orchestrators/codegen/gitignore.mjs +67 -0
- package/dist/orchestrators/codegen/gitignore.mjs.map +1 -0
- package/dist/orchestrators/codegen/paths.d.mts +1 -0
- package/dist/orchestrators/codegen/paths.mjs +33 -0
- package/dist/orchestrators/codegen/paths.mjs.map +1 -0
- package/dist/orchestrators/codegen/permissions.mjs +6 -0
- package/dist/orchestrators/codegen/permissions.mjs.map +1 -0
- package/dist/orchestrators/codegen/service.d.mts +1 -0
- package/dist/orchestrators/codegen/service.mjs +276 -0
- package/dist/orchestrators/codegen/service.mjs.map +1 -0
- package/dist/orchestrators/router/cleanup.mjs +58 -0
- package/dist/orchestrators/router/cleanup.mjs.map +1 -0
- package/dist/orchestrators/router/cors.mjs +31 -0
- package/dist/orchestrators/router/cors.mjs.map +1 -0
- package/dist/orchestrators/router/entrypoints.d.mts +1 -0
- package/dist/orchestrators/router/entrypoints.mjs +80 -0
- package/dist/orchestrators/router/entrypoints.mjs.map +1 -0
- package/dist/orchestrators/router/errors.d.mts +1 -0
- package/dist/orchestrators/router/errors.mjs +103 -0
- package/dist/orchestrators/router/errors.mjs.map +1 -0
- package/dist/orchestrators/router/file-provider.d.mts +1 -0
- package/dist/orchestrators/router/file-provider.mjs +320 -0
- package/dist/orchestrators/router/file-provider.mjs.map +1 -0
- package/dist/orchestrators/router/hostname.d.mts +1 -0
- package/dist/orchestrators/router/hostname.mjs +107 -0
- package/dist/orchestrators/router/hostname.mjs.map +1 -0
- package/dist/orchestrators/router/index.d.mts +1 -0
- package/dist/orchestrators/router/profile.d.mts +1 -0
- package/dist/orchestrators/router/profile.mjs +109 -0
- package/dist/orchestrators/router/profile.mjs.map +1 -0
- package/dist/orchestrators/router/service.d.mts +3 -0
- package/dist/orchestrators/router/service.mjs +421 -0
- package/dist/orchestrators/router/service.mjs.map +1 -0
- package/dist/orchestrators/router/traefik-container.d.mts +1 -0
- package/dist/orchestrators/router/traefik-container.mjs +229 -0
- package/dist/orchestrators/router/traefik-container.mjs.map +1 -0
- package/dist/orchestrators/runtime-composition.d.mts +10 -0
- package/dist/orchestrators/runtime-composition.mjs +168 -0
- package/dist/orchestrators/runtime-composition.mjs.map +1 -0
- package/dist/orchestrators/snapshot/capture.d.mts +1 -0
- package/dist/orchestrators/snapshot/capture.mjs +350 -0
- package/dist/orchestrators/snapshot/capture.mjs.map +1 -0
- package/dist/orchestrators/snapshot/descriptor.d.mts +1 -0
- package/dist/orchestrators/snapshot/descriptor.mjs +109 -0
- package/dist/orchestrators/snapshot/descriptor.mjs.map +1 -0
- package/dist/orchestrators/snapshot/identity-guard.d.mts +1 -0
- package/dist/orchestrators/snapshot/identity-guard.mjs +132 -0
- package/dist/orchestrators/snapshot/identity-guard.mjs.map +1 -0
- package/dist/orchestrators/snapshot/image-bundle-tags.mjs +207 -0
- package/dist/orchestrators/snapshot/image-bundle-tags.mjs.map +1 -0
- package/dist/orchestrators/snapshot/index.d.mts +1 -0
- package/dist/orchestrators/snapshot/integrity.d.mts +1 -0
- package/dist/orchestrators/snapshot/integrity.mjs +74 -0
- package/dist/orchestrators/snapshot/integrity.mjs.map +1 -0
- package/dist/orchestrators/snapshot/prune.d.mts +1 -0
- package/dist/orchestrators/snapshot/prune.mjs +110 -0
- package/dist/orchestrators/snapshot/prune.mjs.map +1 -0
- package/dist/orchestrators/snapshot/restore.d.mts +1 -0
- package/dist/orchestrators/snapshot/restore.mjs +404 -0
- package/dist/orchestrators/snapshot/restore.mjs.map +1 -0
- package/dist/orchestrators/snapshot/service.d.mts +1 -0
- package/dist/orchestrators/snapshot/service.mjs +296 -0
- package/dist/orchestrators/snapshot/service.mjs.map +1 -0
- package/dist/orchestrators/snapshot/state-document.mjs +18 -0
- package/dist/orchestrators/snapshot/state-document.mjs.map +1 -0
- package/dist/orchestrators/snapshot/wipe.d.mts +1 -0
- package/dist/orchestrators/snapshot/wipe.mjs +59 -0
- package/dist/orchestrators/snapshot/wipe.mjs.map +1 -0
- package/dist/plugins/account/codegen.d.mts +12 -0
- package/dist/plugins/account/codegen.mjs +22 -0
- package/dist/plugins/account/codegen.mjs.map +1 -0
- package/dist/plugins/account/errors.d.mts +44 -0
- package/dist/plugins/account/errors.mjs +16 -0
- package/dist/plugins/account/errors.mjs.map +1 -0
- package/dist/plugins/account/funding.d.mts +94 -0
- package/dist/plugins/account/funding.mjs +199 -0
- package/dist/plugins/account/funding.mjs.map +1 -0
- package/dist/plugins/account/index.d.mts +54 -0
- package/dist/plugins/account/index.mjs +151 -0
- package/dist/plugins/account/index.mjs.map +1 -0
- package/dist/plugins/account/keypair.d.mts +32 -0
- package/dist/plugins/account/keypair.mjs +99 -0
- package/dist/plugins/account/keypair.mjs.map +1 -0
- package/dist/plugins/account/lease.mjs +21 -0
- package/dist/plugins/account/lease.mjs.map +1 -0
- package/dist/plugins/account/registry.d.mts +33 -0
- package/dist/plugins/account/registry.mjs +36 -0
- package/dist/plugins/account/registry.mjs.map +1 -0
- package/dist/plugins/account/service.d.mts +104 -0
- package/dist/plugins/account/service.mjs +405 -0
- package/dist/plugins/account/service.mjs.map +1 -0
- package/dist/plugins/account/snapshot.mjs +33 -0
- package/dist/plugins/account/snapshot.mjs.map +1 -0
- package/dist/plugins/account/variants/env.mjs +24 -0
- package/dist/plugins/account/variants/env.mjs.map +1 -0
- package/dist/plugins/account/variants/ephemeral.mjs +72 -0
- package/dist/plugins/account/variants/ephemeral.mjs.map +1 -0
- package/dist/plugins/account/variants/impersonate.d.mts +16 -0
- package/dist/plugins/account/variants/impersonate.mjs +48 -0
- package/dist/plugins/account/variants/impersonate.mjs.map +1 -0
- package/dist/plugins/account/variants/inline.mjs +13 -0
- package/dist/plugins/account/variants/inline.mjs.map +1 -0
- package/dist/plugins/account/variants/keystore.mjs +93 -0
- package/dist/plugins/account/variants/keystore.mjs.map +1 -0
- package/dist/plugins/account/variants/signer.mjs +31 -0
- package/dist/plugins/account/variants/signer.mjs.map +1 -0
- package/dist/plugins/action/build-context.d.mts +41 -0
- package/dist/plugins/action/discriminator.d.mts +20 -0
- package/dist/plugins/action/discriminator.mjs +13 -0
- package/dist/plugins/action/discriminator.mjs.map +1 -0
- package/dist/plugins/action/errors.d.mts +31 -0
- package/dist/plugins/action/errors.mjs +13 -0
- package/dist/plugins/action/errors.mjs.map +1 -0
- package/dist/plugins/action/execute.d.mts +2 -0
- package/dist/plugins/action/execute.mjs +145 -0
- package/dist/plugins/action/execute.mjs.map +1 -0
- package/dist/plugins/action/index.d.mts +56 -0
- package/dist/plugins/action/index.mjs +82 -0
- package/dist/plugins/action/index.mjs.map +1 -0
- package/dist/plugins/action/service.d.mts +26 -0
- package/dist/plugins/action/service.mjs +84 -0
- package/dist/plugins/action/service.mjs.map +1 -0
- package/dist/plugins/coin/address-resolution.d.mts +34 -0
- package/dist/plugins/coin/address-resolution.mjs +80 -0
- package/dist/plugins/coin/address-resolution.mjs.map +1 -0
- package/dist/plugins/coin/codegen.d.mts +16 -0
- package/dist/plugins/coin/codegen.mjs +21 -0
- package/dist/plugins/coin/codegen.mjs.map +1 -0
- package/dist/plugins/coin/discovery.d.mts +26 -0
- package/dist/plugins/coin/discovery.mjs +112 -0
- package/dist/plugins/coin/discovery.mjs.map +1 -0
- package/dist/plugins/coin/errors.d.mts +48 -0
- package/dist/plugins/coin/errors.mjs +13 -0
- package/dist/plugins/coin/errors.mjs.map +1 -0
- package/dist/plugins/coin/index.d.mts +95 -0
- package/dist/plugins/coin/index.mjs +172 -0
- package/dist/plugins/coin/index.mjs.map +1 -0
- package/dist/plugins/coin/metadata.d.mts +15 -0
- package/dist/plugins/coin/metadata.mjs +99 -0
- package/dist/plugins/coin/metadata.mjs.map +1 -0
- package/dist/plugins/coin/mint.d.mts +34 -0
- package/dist/plugins/coin/mint.mjs +164 -0
- package/dist/plugins/coin/mint.mjs.map +1 -0
- package/dist/plugins/coin/registry.d.mts +1 -0
- package/dist/plugins/coin/registry.mjs +37 -0
- package/dist/plugins/coin/registry.mjs.map +1 -0
- package/dist/plugins/coin/service.d.mts +47 -0
- package/dist/plugins/coin/service.mjs +51 -0
- package/dist/plugins/coin/service.mjs.map +1 -0
- package/dist/plugins/coin/snapshot.mjs +19 -0
- package/dist/plugins/coin/snapshot.mjs.map +1 -0
- package/dist/plugins/coin/type-strings.mjs +49 -0
- package/dist/plugins/coin/type-strings.mjs.map +1 -0
- package/dist/plugins/deepbook/codegen.d.mts +39 -0
- package/dist/plugins/deepbook/codegen.mjs +15 -0
- package/dist/plugins/deepbook/codegen.mjs.map +1 -0
- package/dist/plugins/deepbook/deploy.mjs +437 -0
- package/dist/plugins/deepbook/deploy.mjs.map +1 -0
- package/dist/plugins/deepbook/errors.d.mts +29 -0
- package/dist/plugins/deepbook/errors.mjs +26 -0
- package/dist/plugins/deepbook/errors.mjs.map +1 -0
- package/dist/plugins/deepbook/faucet-strategy.d.mts +8 -0
- package/dist/plugins/deepbook/faucet-strategy.mjs +81 -0
- package/dist/plugins/deepbook/faucet-strategy.mjs.map +1 -0
- package/dist/plugins/deepbook/index.d.mts +171 -0
- package/dist/plugins/deepbook/index.mjs +359 -0
- package/dist/plugins/deepbook/index.mjs.map +1 -0
- package/dist/plugins/deepbook/plugin-key.mjs +7 -0
- package/dist/plugins/deepbook/plugin-key.mjs.map +1 -0
- package/dist/plugins/deepbook/pyth/index.mjs +226 -0
- package/dist/plugins/deepbook/pyth/index.mjs.map +1 -0
- package/dist/plugins/deepbook/routable.mjs +21 -0
- package/dist/plugins/deepbook/routable.mjs.map +1 -0
- package/dist/plugins/deepbook/snapshot.mjs +49 -0
- package/dist/plugins/deepbook/snapshot.mjs.map +1 -0
- package/dist/plugins/deepbook/types.d.mts +125 -0
- package/dist/plugins/deepbook/types.mjs +12 -0
- package/dist/plugins/deepbook/types.mjs.map +1 -0
- package/dist/plugins/faucet/dispatcher.d.mts +9 -0
- package/dist/plugins/faucet/dispatcher.mjs +13 -0
- package/dist/plugins/faucet/dispatcher.mjs.map +1 -0
- package/dist/plugins/faucet/errors.d.mts +86 -0
- package/dist/plugins/faucet/errors.mjs +19 -0
- package/dist/plugins/faucet/errors.mjs.map +1 -0
- package/dist/plugins/faucet/http.mjs +127 -0
- package/dist/plugins/faucet/http.mjs.map +1 -0
- package/dist/plugins/faucet/index.d.mts +43 -0
- package/dist/plugins/faucet/index.mjs +42 -0
- package/dist/plugins/faucet/index.mjs.map +1 -0
- package/dist/plugins/faucet/service.d.mts +20 -0
- package/dist/plugins/faucet/strategies/sui-local.d.mts +23 -0
- package/dist/plugins/faucet/strategies/sui-local.mjs +29 -0
- package/dist/plugins/faucet/strategies/sui-local.mjs.map +1 -0
- package/dist/plugins/host-service/errors.d.mts +27 -0
- package/dist/plugins/host-service/errors.mjs +14 -0
- package/dist/plugins/host-service/errors.mjs.map +1 -0
- package/dist/plugins/host-service/index.d.mts +10 -0
- package/dist/plugins/host-service/index.mjs +48 -0
- package/dist/plugins/host-service/index.mjs.map +1 -0
- package/dist/plugins/host-service/routable.mjs +24 -0
- package/dist/plugins/host-service/routable.mjs.map +1 -0
- package/dist/plugins/host-service/service.d.mts +49 -0
- package/dist/plugins/host-service/service.mjs +375 -0
- package/dist/plugins/host-service/service.mjs.map +1 -0
- package/dist/plugins/package/build.d.mts +1 -0
- package/dist/plugins/package/build.mjs +24 -0
- package/dist/plugins/package/build.mjs.map +1 -0
- package/dist/plugins/package/codegen.d.mts +19 -0
- package/dist/plugins/package/codegen.mjs +41 -0
- package/dist/plugins/package/codegen.mjs.map +1 -0
- package/dist/plugins/package/dep-resolution.mjs +10 -0
- package/dist/plugins/package/dep-resolution.mjs.map +1 -0
- package/dist/plugins/package/errors.d.mts +34 -0
- package/dist/plugins/package/errors.mjs +13 -0
- package/dist/plugins/package/errors.mjs.map +1 -0
- package/dist/plugins/package/index.d.mts +109 -0
- package/dist/plugins/package/index.mjs +207 -0
- package/dist/plugins/package/index.mjs.map +1 -0
- package/dist/plugins/package/mode-known.mjs +41 -0
- package/dist/plugins/package/mode-known.mjs.map +1 -0
- package/dist/plugins/package/mode-local.d.mts +1 -0
- package/dist/plugins/package/mode-local.mjs +183 -0
- package/dist/plugins/package/mode-local.mjs.map +1 -0
- package/dist/plugins/package/publish-executor.mjs +202 -0
- package/dist/plugins/package/publish-executor.mjs.map +1 -0
- package/dist/plugins/package/publish-output.d.mts +28 -0
- package/dist/plugins/package/publish-output.mjs +45 -0
- package/dist/plugins/package/publish-output.mjs.map +1 -0
- package/dist/plugins/package/registry.d.mts +25 -0
- package/dist/plugins/package/registry.mjs +30 -0
- package/dist/plugins/package/registry.mjs.map +1 -0
- package/dist/plugins/package/service.mjs +20 -0
- package/dist/plugins/package/service.mjs.map +1 -0
- package/dist/plugins/package/snapshot.mjs +25 -0
- package/dist/plugins/package/snapshot.mjs.map +1 -0
- package/dist/plugins/postgres/codegen.mjs +42 -0
- package/dist/plugins/postgres/codegen.mjs.map +1 -0
- package/dist/plugins/postgres/connection.d.mts +33 -0
- package/dist/plugins/postgres/connection.mjs +19 -0
- package/dist/plugins/postgres/connection.mjs.map +1 -0
- package/dist/plugins/postgres/db-ensure.mjs +100 -0
- package/dist/plugins/postgres/db-ensure.mjs.map +1 -0
- package/dist/plugins/postgres/errors.d.mts +55 -0
- package/dist/plugins/postgres/errors.mjs +29 -0
- package/dist/plugins/postgres/errors.mjs.map +1 -0
- package/dist/plugins/postgres/index.d.mts +37 -0
- package/dist/plugins/postgres/index.mjs +75 -0
- package/dist/plugins/postgres/index.mjs.map +1 -0
- package/dist/plugins/postgres/routable.mjs +33 -0
- package/dist/plugins/postgres/routable.mjs.map +1 -0
- package/dist/plugins/postgres/service.d.mts +50 -0
- package/dist/plugins/postgres/service.mjs +145 -0
- package/dist/plugins/postgres/service.mjs.map +1 -0
- package/dist/plugins/postgres/snapshot.d.mts +1 -0
- package/dist/plugins/postgres/snapshot.mjs +32 -0
- package/dist/plugins/postgres/snapshot.mjs.map +1 -0
- package/dist/plugins/router-entrypoints.mjs +21 -0
- package/dist/plugins/router-entrypoints.mjs.map +1 -0
- package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs +59 -0
- package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs.map +1 -0
- package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs +132 -0
- package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs.map +1 -0
- package/dist/plugins/seal/codegen.d.mts +19 -0
- package/dist/plugins/seal/codegen.mjs +16 -0
- package/dist/plugins/seal/codegen.mjs.map +1 -0
- package/dist/plugins/seal/config-render.mjs +82 -0
- package/dist/plugins/seal/config-render.mjs.map +1 -0
- package/dist/plugins/seal/deploy.mjs +198 -0
- package/dist/plugins/seal/deploy.mjs.map +1 -0
- package/dist/plugins/seal/errors.d.mts +52 -0
- package/dist/plugins/seal/errors.mjs +19 -0
- package/dist/plugins/seal/errors.mjs.map +1 -0
- package/dist/plugins/seal/index.d.mts +161 -0
- package/dist/plugins/seal/index.mjs +235 -0
- package/dist/plugins/seal/index.mjs.map +1 -0
- package/dist/plugins/seal/key-manager.d.mts +22 -0
- package/dist/plugins/seal/key-manager.mjs +22 -0
- package/dist/plugins/seal/key-manager.mjs.map +1 -0
- package/dist/plugins/seal/key-server.mjs +175 -0
- package/dist/plugins/seal/key-server.mjs.map +1 -0
- package/dist/plugins/seal/keygen.mjs +96 -0
- package/dist/plugins/seal/keygen.mjs.map +1 -0
- package/dist/plugins/seal/mode/fork-known.d.mts +8 -0
- package/dist/plugins/seal/mode/fork-known.mjs +23 -0
- package/dist/plugins/seal/mode/fork-known.mjs.map +1 -0
- package/dist/plugins/seal/mode/live.d.mts +18 -0
- package/dist/plugins/seal/mode/live.mjs +64 -0
- package/dist/plugins/seal/mode/live.mjs.map +1 -0
- package/dist/plugins/seal/mode/local-keygen.mjs +180 -0
- package/dist/plugins/seal/mode/local-keygen.mjs.map +1 -0
- package/dist/plugins/seal/plugin-key.mjs +7 -0
- package/dist/plugins/seal/plugin-key.mjs.map +1 -0
- package/dist/plugins/seal/registry-publish.d.mts +43 -0
- package/dist/plugins/seal/registry-publish.mjs +9 -0
- package/dist/plugins/seal/registry-publish.mjs.map +1 -0
- package/dist/plugins/seal/routable.mjs +57 -0
- package/dist/plugins/seal/routable.mjs.map +1 -0
- package/dist/plugins/seal/service.mjs +17 -0
- package/dist/plugins/seal/service.mjs.map +1 -0
- package/dist/plugins/seal/snapshot.mjs +51 -0
- package/dist/plugins/seal/snapshot.mjs.map +1 -0
- package/dist/plugins/sui/auto-tick.mjs +45 -0
- package/dist/plugins/sui/auto-tick.mjs.map +1 -0
- package/dist/plugins/sui/chain-build-container.d.mts +1 -0
- package/dist/plugins/sui/chain-probe.d.mts +85 -0
- package/dist/plugins/sui/chain-probe.mjs +104 -0
- package/dist/plugins/sui/chain-probe.mjs.map +1 -0
- package/dist/plugins/sui/codegen.d.mts +14 -0
- package/dist/plugins/sui/codegen.mjs +26 -0
- package/dist/plugins/sui/codegen.mjs.map +1 -0
- package/dist/plugins/sui/errors.d.mts +74 -0
- package/dist/plugins/sui/errors.mjs +28 -0
- package/dist/plugins/sui/errors.mjs.map +1 -0
- package/dist/plugins/sui/fork-orchestration.mjs +24 -0
- package/dist/plugins/sui/fork-orchestration.mjs.map +1 -0
- package/dist/plugins/sui/fork-transaction.mjs +96 -0
- package/dist/plugins/sui/fork-transaction.mjs.map +1 -0
- package/dist/plugins/sui/index.d.mts +318 -0
- package/dist/plugins/sui/index.mjs +182 -0
- package/dist/plugins/sui/index.mjs.map +1 -0
- package/dist/plugins/sui/mode/external.mjs +60 -0
- package/dist/plugins/sui/mode/external.mjs.map +1 -0
- package/dist/plugins/sui/mode/fork.mjs +283 -0
- package/dist/plugins/sui/mode/fork.mjs.map +1 -0
- package/dist/plugins/sui/mode/live.mjs +103 -0
- package/dist/plugins/sui/mode/live.mjs.map +1 -0
- package/dist/plugins/sui/mode/local.mjs +293 -0
- package/dist/plugins/sui/mode/local.mjs.map +1 -0
- package/dist/plugins/sui/mode/shared-boot.mjs +254 -0
- package/dist/plugins/sui/mode/shared-boot.mjs.map +1 -0
- package/dist/plugins/sui/mode/shared.d.mts +103 -0
- package/dist/plugins/sui/mode/shared.mjs +12 -0
- package/dist/plugins/sui/mode/shared.mjs.map +1 -0
- package/dist/plugins/sui/mode/spec.d.mts +94 -0
- package/dist/plugins/sui/network-resolver.d.mts +23 -0
- package/dist/plugins/sui/routable.mjs +88 -0
- package/dist/plugins/sui/routable.mjs.map +1 -0
- package/dist/plugins/sui/seed-objects.d.mts +18 -0
- package/dist/plugins/sui/seed-objects.mjs +25 -0
- package/dist/plugins/sui/seed-objects.mjs.map +1 -0
- package/dist/plugins/sui/service.mjs +38 -0
- package/dist/plugins/sui/service.mjs.map +1 -0
- package/dist/plugins/sui/snapshot.mjs +53 -0
- package/dist/plugins/sui/snapshot.mjs.map +1 -0
- package/dist/plugins/wallet/codegen.d.mts +33 -0
- package/dist/plugins/wallet/codegen.mjs +34 -0
- package/dist/plugins/wallet/codegen.mjs.map +1 -0
- package/dist/plugins/wallet/errors.d.mts +66 -0
- package/dist/plugins/wallet/errors.mjs +16 -0
- package/dist/plugins/wallet/errors.mjs.map +1 -0
- package/dist/plugins/wallet/index.d.mts +63 -0
- package/dist/plugins/wallet/index.mjs +126 -0
- package/dist/plugins/wallet/index.mjs.map +1 -0
- package/dist/plugins/wallet/origin-policy.d.mts +1 -0
- package/dist/plugins/wallet/origin-policy.mjs +65 -0
- package/dist/plugins/wallet/origin-policy.mjs.map +1 -0
- package/dist/plugins/wallet/pairing.d.mts +11 -0
- package/dist/plugins/wallet/pairing.mjs +125 -0
- package/dist/plugins/wallet/pairing.mjs.map +1 -0
- package/dist/plugins/wallet/protocol.d.mts +1 -0
- package/dist/plugins/wallet/protocol.mjs +96 -0
- package/dist/plugins/wallet/protocol.mjs.map +1 -0
- package/dist/plugins/wallet/routable.mjs +32 -0
- package/dist/plugins/wallet/routable.mjs.map +1 -0
- package/dist/plugins/wallet/server.d.mts +12 -0
- package/dist/plugins/wallet/server.mjs +317 -0
- package/dist/plugins/wallet/server.mjs.map +1 -0
- package/dist/plugins/wallet/service.d.mts +68 -0
- package/dist/plugins/wallet/service.mjs +97 -0
- package/dist/plugins/wallet/service.mjs.map +1 -0
- package/dist/plugins/wallet/snapshot.d.mts +1 -0
- package/dist/plugins/wallet/snapshot.mjs +14 -0
- package/dist/plugins/wallet/snapshot.mjs.map +1 -0
- package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs +42 -0
- package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs.map +1 -0
- package/dist/plugins/walrus/codegen.d.mts +38 -0
- package/dist/plugins/walrus/codegen.mjs +34 -0
- package/dist/plugins/walrus/codegen.mjs.map +1 -0
- package/dist/plugins/walrus/deploy-paths.mjs +14 -0
- package/dist/plugins/walrus/deploy-paths.mjs.map +1 -0
- package/dist/plugins/walrus/deploy.d.mts +1 -0
- package/dist/plugins/walrus/deploy.mjs +224 -0
- package/dist/plugins/walrus/deploy.mjs.map +1 -0
- package/dist/plugins/walrus/errors.d.mts +38 -0
- package/dist/plugins/walrus/errors.mjs +26 -0
- package/dist/plugins/walrus/errors.mjs.map +1 -0
- package/dist/plugins/walrus/faucet-strategy.d.mts +12 -0
- package/dist/plugins/walrus/faucet-strategy.mjs +62 -0
- package/dist/plugins/walrus/faucet-strategy.mjs.map +1 -0
- package/dist/plugins/walrus/index.d.mts +177 -0
- package/dist/plugins/walrus/index.mjs +284 -0
- package/dist/plugins/walrus/index.mjs.map +1 -0
- package/dist/plugins/walrus/mode/known-deploy.d.mts +25 -0
- package/dist/plugins/walrus/mode/known-deploy.mjs +71 -0
- package/dist/plugins/walrus/mode/known-deploy.mjs.map +1 -0
- package/dist/plugins/walrus/mode/local-cluster.d.mts +34 -0
- package/dist/plugins/walrus/mode/local-cluster.mjs +153 -0
- package/dist/plugins/walrus/mode/local-cluster.mjs.map +1 -0
- package/dist/plugins/walrus/plugin-key.mjs +7 -0
- package/dist/plugins/walrus/plugin-key.mjs.map +1 -0
- package/dist/plugins/walrus/registry-publish.d.mts +24 -0
- package/dist/plugins/walrus/registry-publish.mjs +7 -0
- package/dist/plugins/walrus/registry-publish.mjs.map +1 -0
- package/dist/plugins/walrus/routable.mjs +99 -0
- package/dist/plugins/walrus/routable.mjs.map +1 -0
- package/dist/plugins/walrus/service.mjs +20 -0
- package/dist/plugins/walrus/service.mjs.map +1 -0
- package/dist/plugins/walrus/snapshot.mjs +53 -0
- package/dist/plugins/walrus/snapshot.mjs.map +1 -0
- package/dist/plugins/walrus/storage-nodes.d.mts +15 -0
- package/dist/plugins/walrus/storage-nodes.mjs +154 -0
- package/dist/plugins/walrus/storage-nodes.mjs.map +1 -0
- package/dist/plugins/walrus/wal-swap.d.mts +2 -0
- package/dist/plugins/walrus/wal-swap.mjs +58 -0
- package/dist/plugins/walrus/wal-swap.mjs.map +1 -0
- package/dist/primitives/artifact-publisher.d.mts +12 -0
- package/dist/primitives/cache.d.mts +1 -0
- package/dist/runtime/built-in-plugin-layers.mjs +49 -0
- package/dist/runtime/built-in-plugin-layers.mjs.map +1 -0
- package/dist/runtime/docker/client.d.mts +2 -0
- package/dist/runtime/docker/client.mjs +54 -0
- package/dist/runtime/docker/client.mjs.map +1 -0
- package/dist/runtime/docker/container.d.mts +1 -0
- package/dist/runtime/docker/container.mjs +562 -0
- package/dist/runtime/docker/container.mjs.map +1 -0
- package/dist/runtime/docker/errors.d.mts +1 -0
- package/dist/runtime/docker/errors.mjs +187 -0
- package/dist/runtime/docker/errors.mjs.map +1 -0
- package/dist/runtime/docker/exec.d.mts +1 -0
- package/dist/runtime/docker/exec.mjs +63 -0
- package/dist/runtime/docker/exec.mjs.map +1 -0
- package/dist/runtime/docker/image.d.mts +1 -0
- package/dist/runtime/docker/image.mjs +278 -0
- package/dist/runtime/docker/image.mjs.map +1 -0
- package/dist/runtime/docker/index.d.mts +1 -0
- package/dist/runtime/docker/inventory.d.mts +1 -0
- package/dist/runtime/docker/inventory.mjs +167 -0
- package/dist/runtime/docker/inventory.mjs.map +1 -0
- package/dist/runtime/docker/labels.d.mts +1 -0
- package/dist/runtime/docker/labels.mjs +97 -0
- package/dist/runtime/docker/labels.mjs.map +1 -0
- package/dist/runtime/docker/logs.d.mts +1 -0
- package/dist/runtime/docker/logs.mjs +34 -0
- package/dist/runtime/docker/logs.mjs.map +1 -0
- package/dist/runtime/docker/network.d.mts +1 -0
- package/dist/runtime/docker/network.mjs +168 -0
- package/dist/runtime/docker/network.mjs.map +1 -0
- package/dist/runtime/docker/service.d.mts +9 -0
- package/dist/runtime/docker/service.mjs +266 -0
- package/dist/runtime/docker/service.mjs.map +1 -0
- package/dist/runtime/docker/sweep.d.mts +1 -0
- package/dist/runtime/docker/sweep.mjs +220 -0
- package/dist/runtime/docker/sweep.mjs.map +1 -0
- package/dist/runtime/docker/volume.d.mts +1 -0
- package/dist/runtime/docker/volume.mjs +24 -0
- package/dist/runtime/docker/volume.mjs.map +1 -0
- package/dist/runtime/docker/wrap.d.mts +1 -0
- package/dist/runtime/docker/wrap.mjs +131 -0
- package/dist/runtime/docker/wrap.mjs.map +1 -0
- package/dist/substrate/brand.d.mts +24 -0
- package/dist/substrate/brand.mjs +14 -0
- package/dist/substrate/brand.mjs.map +1 -0
- package/dist/substrate/cross-process.d.mts +1 -0
- package/dist/substrate/cross-process.mjs +28 -0
- package/dist/substrate/cross-process.mjs.map +1 -0
- package/dist/substrate/events.d.mts +117 -0
- package/dist/substrate/identity.d.mts +13 -0
- package/dist/substrate/lifecycle.d.mts +12 -0
- package/dist/substrate/manifest.d.mts +39 -0
- package/dist/substrate/manifest.mjs +33 -0
- package/dist/substrate/manifest.mjs.map +1 -0
- package/dist/substrate/network.d.mts +34 -0
- package/dist/substrate/options.d.mts +23 -0
- package/dist/substrate/plugin.d.mts +101 -0
- package/dist/substrate/plugin.mjs +61 -0
- package/dist/substrate/plugin.mjs.map +1 -0
- package/dist/substrate/projection.d.mts +100 -0
- package/dist/substrate/runtime/artifact-publisher/index.mjs +76 -0
- package/dist/substrate/runtime/artifact-publisher/index.mjs.map +1 -0
- package/dist/substrate/runtime/atomic-write.mjs +106 -0
- package/dist/substrate/runtime/atomic-write.mjs.map +1 -0
- package/dist/substrate/runtime/cache/index.d.mts +1 -0
- package/dist/substrate/runtime/cache/schema.d.mts +1 -0
- package/dist/substrate/runtime/cache/schema.mjs +22 -0
- package/dist/substrate/runtime/cache/schema.mjs.map +1 -0
- package/dist/substrate/runtime/cache/service.d.mts +1 -0
- package/dist/substrate/runtime/cache/service.mjs +89 -0
- package/dist/substrate/runtime/cache/service.mjs.map +1 -0
- package/dist/substrate/runtime/capability-sinks/index.d.mts +1 -0
- package/dist/substrate/runtime/capability-sinks/layer.d.mts +1 -0
- package/dist/substrate/runtime/capability-sinks/layer.mjs +31 -0
- package/dist/substrate/runtime/capability-sinks/layer.mjs.map +1 -0
- package/dist/substrate/runtime/capability-sinks/service.d.mts +36 -0
- package/dist/substrate/runtime/capability-sinks/service.mjs +74 -0
- package/dist/substrate/runtime/capability-sinks/service.mjs.map +1 -0
- package/dist/substrate/runtime/config-validation.d.mts +38 -0
- package/dist/substrate/runtime/config-validation.mjs +137 -0
- package/dist/substrate/runtime/config-validation.mjs.map +1 -0
- package/dist/substrate/runtime/context-helpers.mjs +32 -0
- package/dist/substrate/runtime/context-helpers.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/command-channel/channel.mjs +128 -0
- package/dist/substrate/runtime/cross-process/command-channel/channel.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/command-channel/file-channel.mjs +136 -0
- package/dist/substrate/runtime/cross-process/command-channel/file-channel.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/command-channel/protocol.mjs +49 -0
- package/dist/substrate/runtime/cross-process/command-channel/protocol.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/command-channel/runtime-control-lock.mjs +9 -0
- package/dist/substrate/runtime/cross-process/command-channel/runtime-control-lock.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/liveness.mjs +119 -0
- package/dist/substrate/runtime/cross-process/liveness.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/roster.mjs +275 -0
- package/dist/substrate/runtime/cross-process/roster.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/snapshot-reservation.d.mts +1 -0
- package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs +117 -0
- package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/stack-lock.d.mts +1 -0
- package/dist/substrate/runtime/cross-process/stack-lock.mjs +142 -0
- package/dist/substrate/runtime/cross-process/stack-lock.mjs.map +1 -0
- package/dist/substrate/runtime/current-plugin.mjs +15 -0
- package/dist/substrate/runtime/current-plugin.mjs.map +1 -0
- package/dist/substrate/runtime/errors.d.mts +1 -0
- package/dist/substrate/runtime/errors.mjs +76 -0
- package/dist/substrate/runtime/errors.mjs.map +1 -0
- package/dist/substrate/runtime/host-tree-tar/index.mjs +364 -0
- package/dist/substrate/runtime/host-tree-tar/index.mjs.map +1 -0
- package/dist/substrate/runtime/http-probe.d.mts +35 -0
- package/dist/substrate/runtime/http-probe.mjs +65 -0
- package/dist/substrate/runtime/http-probe.mjs.map +1 -0
- package/dist/substrate/runtime/lease-broker/index.d.mts +1 -0
- package/dist/substrate/runtime/lease-broker/service.d.mts +64 -0
- package/dist/substrate/runtime/lease-broker/service.mjs +155 -0
- package/dist/substrate/runtime/lease-broker/service.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/dep-graph.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/dep-graph.mjs +138 -0
- package/dist/substrate/runtime/lifecycle/dep-graph.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/index.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/lifecycle-fact.mjs +31 -0
- package/dist/substrate/runtime/lifecycle/lifecycle-fact.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/plugin-registry.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/plugin-registry.mjs +133 -0
- package/dist/substrate/runtime/lifecycle/plugin-registry.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/ready-gate.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/ready-gate.mjs +34 -0
- package/dist/substrate/runtime/lifecycle/ready-gate.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/selective-restart.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/selective-restart.mjs +43 -0
- package/dist/substrate/runtime/lifecycle/selective-restart.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/signals.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/signals.mjs +64 -0
- package/dist/substrate/runtime/lifecycle/signals.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/state-machine.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/state-machine.mjs +38 -0
- package/dist/substrate/runtime/lifecycle/state-machine.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/watch-attribution.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/watch-attribution.mjs +27 -0
- package/dist/substrate/runtime/lifecycle/watch-attribution.mjs.map +1 -0
- package/dist/substrate/runtime/managed-container.d.mts +30 -0
- package/dist/substrate/runtime/managed-container.mjs +32 -0
- package/dist/substrate/runtime/managed-container.mjs.map +1 -0
- package/dist/substrate/runtime/manifest/manifest.mjs +73 -0
- package/dist/substrate/runtime/manifest/manifest.mjs.map +1 -0
- package/dist/substrate/runtime/mode-errors.d.mts +36 -0
- package/dist/substrate/runtime/observability/cascade-formatter.d.mts +1 -0
- package/dist/substrate/runtime/observability/cascade-formatter.mjs +135 -0
- package/dist/substrate/runtime/observability/cascade-formatter.mjs.map +1 -0
- package/dist/substrate/runtime/observability/formatter-registry.d.mts +1 -0
- package/dist/substrate/runtime/observability/formatter-registry.mjs +65 -0
- package/dist/substrate/runtime/observability/formatter-registry.mjs.map +1 -0
- package/dist/substrate/runtime/observability/index.d.mts +3 -0
- package/dist/substrate/runtime/observability/logger.d.mts +58 -0
- package/dist/substrate/runtime/observability/logger.mjs +89 -0
- package/dist/substrate/runtime/observability/logger.mjs.map +1 -0
- package/dist/substrate/runtime/observability/pretty-error.d.mts +1 -0
- package/dist/substrate/runtime/observability/pretty-error.mjs +119 -0
- package/dist/substrate/runtime/observability/pretty-error.mjs.map +1 -0
- package/dist/substrate/runtime/observability/process-lines.d.mts +31 -0
- package/dist/substrate/runtime/observability/process-lines.mjs +40 -0
- package/dist/substrate/runtime/observability/process-lines.mjs.map +1 -0
- package/dist/substrate/runtime/observability/redaction.d.mts +28 -0
- package/dist/substrate/runtime/observability/redaction.mjs +45 -0
- package/dist/substrate/runtime/observability/redaction.mjs.map +1 -0
- package/dist/substrate/runtime/observability/spans.d.mts +1 -0
- package/dist/substrate/runtime/observability/spans.mjs +87 -0
- package/dist/substrate/runtime/observability/spans.mjs.map +1 -0
- package/dist/substrate/runtime/observability/subprocess-capture.d.mts +2 -0
- package/dist/substrate/runtime/observability/subprocess-capture.mjs +82 -0
- package/dist/substrate/runtime/observability/subprocess-capture.mjs.map +1 -0
- package/dist/substrate/runtime/paths.d.mts +17 -0
- package/dist/substrate/runtime/paths.mjs +61 -0
- package/dist/substrate/runtime/paths.mjs.map +1 -0
- package/dist/substrate/runtime/port-broker/index.d.mts +1 -0
- package/dist/substrate/runtime/port-broker/service.d.mts +1 -0
- package/dist/substrate/runtime/port-broker/service.mjs +319 -0
- package/dist/substrate/runtime/port-broker/service.mjs.map +1 -0
- package/dist/substrate/runtime/post-acquire-tasks.d.mts +1 -0
- package/dist/substrate/runtime/post-acquire-tasks.mjs +34 -0
- package/dist/substrate/runtime/post-acquire-tasks.mjs.map +1 -0
- package/dist/substrate/runtime/probes.d.mts +51 -0
- package/dist/substrate/runtime/probes.mjs +84 -0
- package/dist/substrate/runtime/probes.mjs.map +1 -0
- package/dist/substrate/runtime/process-supervisor.d.mts +57 -0
- package/dist/substrate/runtime/process-supervisor.mjs +73 -0
- package/dist/substrate/runtime/process-supervisor.mjs.map +1 -0
- package/dist/substrate/runtime/projection/operational-endpoints.mjs +44 -0
- package/dist/substrate/runtime/projection/operational-endpoints.mjs.map +1 -0
- package/dist/substrate/runtime/projection/persisted.mjs +195 -0
- package/dist/substrate/runtime/projection/persisted.mjs.map +1 -0
- package/dist/substrate/runtime/projection/state-ref.mjs +48 -0
- package/dist/substrate/runtime/projection/state-ref.mjs.map +1 -0
- package/dist/substrate/runtime/projection/update.mjs +200 -0
- package/dist/substrate/runtime/projection/update.mjs.map +1 -0
- package/dist/substrate/runtime/retry-policy.d.mts +18 -0
- package/dist/substrate/runtime/retry-policy.mjs +16 -0
- package/dist/substrate/runtime/retry-policy.mjs.map +1 -0
- package/dist/substrate/runtime/run.mjs +86 -0
- package/dist/substrate/runtime/run.mjs.map +1 -0
- package/dist/substrate/runtime/runtime-decode.d.mts +32 -0
- package/dist/substrate/runtime/runtime-decode.mjs +53 -0
- package/dist/substrate/runtime/runtime-decode.mjs.map +1 -0
- package/dist/substrate/runtime/scoped-http-server.mjs +36 -0
- package/dist/substrate/runtime/scoped-http-server.mjs.map +1 -0
- package/dist/substrate/runtime/scoped-ref-map/service.mjs +83 -0
- package/dist/substrate/runtime/scoped-ref-map/service.mjs.map +1 -0
- package/dist/substrate/runtime/stage-and-swap/index.d.mts +1 -0
- package/dist/substrate/runtime/stage-and-swap/index.mjs +131 -0
- package/dist/substrate/runtime/stage-and-swap/index.mjs.map +1 -0
- package/dist/substrate/runtime/state-store/schema.mjs +36 -0
- package/dist/substrate/runtime/state-store/schema.mjs.map +1 -0
- package/dist/substrate/runtime/strategy-registry/chain-probe-for.d.mts +1 -0
- package/dist/substrate/runtime/strategy-registry/chain-probe-for.mjs +22 -0
- package/dist/substrate/runtime/strategy-registry/chain-probe-for.mjs.map +1 -0
- package/dist/substrate/runtime/strategy-registry/faucet-capability-for.d.mts +1 -0
- package/dist/substrate/runtime/strategy-registry/faucet-capability-for.mjs +30 -0
- package/dist/substrate/runtime/strategy-registry/faucet-capability-for.mjs.map +1 -0
- package/dist/substrate/runtime/strategy-registry/index.d.mts +1 -0
- package/dist/substrate/runtime/strategy-registry/service.d.mts +1 -0
- package/dist/substrate/runtime/strategy-registry/service.mjs +67 -0
- package/dist/substrate/runtime/strategy-registry/service.mjs.map +1 -0
- package/dist/substrate/runtime/sui-execute/index.d.mts +11 -0
- package/dist/substrate/runtime/sui-execute/index.mjs +144 -0
- package/dist/substrate/runtime/sui-execute/index.mjs.map +1 -0
- package/dist/substrate/runtime/sui-move-build/index.d.mts +1 -0
- package/dist/substrate/runtime/sui-move-build/index.mjs +283 -0
- package/dist/substrate/runtime/sui-move-build/index.mjs.map +1 -0
- package/dist/substrate/runtime/supervisor.d.mts +1 -0
- package/dist/substrate/runtime/supervisor.mjs +831 -0
- package/dist/substrate/runtime/supervisor.mjs.map +1 -0
- package/dist/surfaces/cli/command-tree.mjs +276 -0
- package/dist/surfaces/cli/command-tree.mjs.map +1 -0
- package/dist/surfaces/cli/commands/config.mjs +31 -0
- package/dist/surfaces/cli/commands/config.mjs.map +1 -0
- package/dist/surfaces/cli/commands/confirm-node.mjs +26 -0
- package/dist/surfaces/cli/commands/confirm-node.mjs.map +1 -0
- package/dist/surfaces/cli/commands/confirm.mjs +26 -0
- package/dist/surfaces/cli/commands/confirm.mjs.map +1 -0
- package/dist/surfaces/cli/commands/doctor-probes.mjs +452 -0
- package/dist/surfaces/cli/commands/doctor-probes.mjs.map +1 -0
- package/dist/surfaces/cli/commands/doctor.mjs +38 -0
- package/dist/surfaces/cli/commands/doctor.mjs.map +1 -0
- package/dist/surfaces/cli/commands/prune-picker.mjs +347 -0
- package/dist/surfaces/cli/commands/prune-picker.mjs.map +1 -0
- package/dist/surfaces/cli/commands/prune.mjs +178 -0
- package/dist/surfaces/cli/commands/prune.mjs.map +1 -0
- package/dist/surfaces/cli/commands/snapshot.mjs +141 -0
- package/dist/surfaces/cli/commands/snapshot.mjs.map +1 -0
- package/dist/surfaces/cli/commands/status.mjs +95 -0
- package/dist/surfaces/cli/commands/status.mjs.map +1 -0
- package/dist/surfaces/cli/commands/supervisor-presence.mjs +33 -0
- package/dist/surfaces/cli/commands/supervisor-presence.mjs.map +1 -0
- package/dist/surfaces/cli/commands/wipe.mjs +28 -0
- package/dist/surfaces/cli/commands/wipe.mjs.map +1 -0
- package/dist/surfaces/cli/envelope.mjs +43 -0
- package/dist/surfaces/cli/envelope.mjs.map +1 -0
- package/dist/surfaces/cli/errors.mjs +110 -0
- package/dist/surfaces/cli/errors.mjs.map +1 -0
- package/dist/surfaces/cli/flags.mjs +56 -0
- package/dist/surfaces/cli/flags.mjs.map +1 -0
- package/dist/surfaces/cli/index.mjs +418 -0
- package/dist/surfaces/cli/index.mjs.map +1 -0
- package/dist/surfaces/cli/output.mjs +115 -0
- package/dist/surfaces/cli/output.mjs.map +1 -0
- package/dist/surfaces/cli/sysexits.mjs +139 -0
- package/dist/surfaces/cli/sysexits.mjs.map +1 -0
- package/dist/surfaces/tui/app.mjs +104 -0
- package/dist/surfaces/tui/app.mjs.map +1 -0
- package/dist/surfaces/tui/dashboard.mjs +261 -0
- package/dist/surfaces/tui/dashboard.mjs.map +1 -0
- package/dist/surfaces/tui/display-derivation.mjs +395 -0
- package/dist/surfaces/tui/display-derivation.mjs.map +1 -0
- package/dist/surfaces/tui/errors.mjs +11 -0
- package/dist/surfaces/tui/errors.mjs.map +1 -0
- package/dist/surfaces/tui/event-log.mjs +155 -0
- package/dist/surfaces/tui/event-log.mjs.map +1 -0
- package/dist/surfaces/tui/heartbeat.mjs +33 -0
- package/dist/surfaces/tui/heartbeat.mjs.map +1 -0
- package/dist/surfaces/tui/index.mjs +50 -0
- package/dist/surfaces/tui/index.mjs.map +1 -0
- package/dist/surfaces/tui/input.mjs +104 -0
- package/dist/surfaces/tui/input.mjs.map +1 -0
- package/dist/surfaces/tui/mode-detect.mjs +32 -0
- package/dist/surfaces/tui/mode-detect.mjs.map +1 -0
- package/dist/surfaces/tui/mount-ink.mjs +31 -0
- package/dist/surfaces/tui/mount-ink.mjs.map +1 -0
- package/dist/surfaces/tui/plain-renderer.mjs +170 -0
- package/dist/surfaces/tui/plain-renderer.mjs.map +1 -0
- package/dist/surfaces/tui/resource-table.mjs +507 -0
- package/dist/surfaces/tui/resource-table.mjs.map +1 -0
- package/images/_shared/signal-forward.sh +77 -0
- package/images/postgres/Dockerfile +32 -0
- package/images/seal/Dockerfile +68 -0
- package/images/seal/entrypoint.sh +65 -0
- package/images/sui/Dockerfile +73 -0
- package/images/sui/entrypoint.sh +244 -0
- package/images/sui-fork/Dockerfile +53 -0
- package/images/sui-fork/entrypoint.sh +51 -0
- package/images/walrus/Dockerfile +122 -0
- package/images/walrus/deploy-walrus.sh +305 -0
- package/images/walrus/run-walrus.sh +53 -0
- package/package.json +94 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flags.mjs","names":[],"sources":["../../../src/surfaces/cli/flags.ts"],"sourcesContent":["// CLI surface — shared flag types and subcommand helpers.\n//\n// Stricli owns argv parsing in `surfaces/cli/index.ts`. This file\n// keeps the resolved flag shape and the tiny helpers used by nested\n// command implementations that still receive a typed `rest` tail\n// (currently snapshot subcommands).\n\nimport { CliUsageError } from './errors.ts';\n\n// -----------------------------------------------------------------------------\n// Global flag definitions (shared across every verb)\n// -----------------------------------------------------------------------------\n\n/** Output mode resolved from `--json` (or `DEVSTACK_JSON=1`). */\nexport type OutputMode = 'human' | 'json';\n\n/** Renderer selected by the CLI. `tui` maps to the Ink-backed live\n * dashboard; `plain` is line-oriented stderr output; `silent` mounts no\n * visible renderer. */\nexport type CliRendererMode = 'tui' | 'plain' | 'silent';\n\n/** Confirmation policy resolved from `--yes` + `--no-input` + TTY\n * state of stdin. */\nexport interface ConfirmPolicy {\n\treadonly assumeYes: boolean;\n\treadonly forbidPrompt: boolean;\n\treadonly stdinIsTty: boolean;\n}\n\n/** Bundle of command-scoped flags after Stricli parsing plus env\n * fallback resolution. */\nexport interface GlobalFlags {\n\treadonly outputMode: OutputMode;\n\treadonly app: string | undefined;\n\treadonly stack: string | undefined;\n\treadonly stateDir: string | undefined;\n\treadonly configPath: string | undefined;\n\treadonly network: string | undefined;\n\treadonly renderer: CliRendererMode | undefined;\n\treadonly dryRun: boolean;\n\treadonly confirm: ConfirmPolicy;\n\t/** Legacy field kept in the internal shape; schema is now the\n\t * explicit `devstack schema --json` command. */\n\treadonly schemaEmit: boolean;\n\t/** Verbosity bump; primarily affects logger filter. */\n\treadonly verbose: boolean;\n\t/** Print help instead of running. */\n\treadonly help: boolean;\n\t/** Print version one-liner and exit. */\n\treadonly version: boolean;\n\t/** Argv tail after the global-flag pass; subcommand parsers slice\n\t * positional arguments and verb-specific flags out of this. */\n\treadonly rest: ReadonlyArray<string>;\n}\n\n/** Environment-variable names the CLI consults. Centralized so the\n * `schema --json` command can enumerate them. */\nexport const ENV_VARS = {\n\tJSON: 'DEVSTACK_JSON',\n\tNO_INPUT: 'DEVSTACK_NO_INPUT',\n\tAPP: 'DEVSTACK_APP',\n\tSTACK: 'DEVSTACK_STACK',\n\tSTATE_DIR: 'DEVSTACK_STATE_DIR',\n\tCONFIG_PATH: 'DEVSTACK_CONFIG',\n\tNETWORK: 'DEVSTACK_NETWORK',\n\tRENDERER: 'DEVSTACK_RENDERER',\n\tNO_COLOR: 'NO_COLOR',\n} as const;\n\nexport type EnvVarName = (typeof ENV_VARS)[keyof typeof ENV_VARS];\n\n// -----------------------------------------------------------------------------\n// Subcommand-flag helpers\n// -----------------------------------------------------------------------------\n\n/** Pop the next positional argument from `rest`. Returns undefined if\n * none remain. */\nexport const takePositional = (\n\trest: ReadonlyArray<string>,\n): { readonly head: string | undefined; readonly tail: ReadonlyArray<string> } => {\n\tconst idx = rest.findIndex((tok) => !tok.startsWith('-'));\n\tif (idx === -1) return { head: undefined, tail: rest };\n\tconst tail = [...rest.slice(0, idx), ...rest.slice(idx + 1)];\n\treturn { head: rest[idx], tail };\n};\n\n/** Look up a boolean flag in `rest` by name (long form only). Returns\n * the matched flag plus the remaining tokens. */\nexport const takeBoolFlag = (\n\trest: ReadonlyArray<string>,\n\tname: string,\n): { readonly present: boolean; readonly tail: ReadonlyArray<string> } => {\n\tconst flag = `--${name}`;\n\tconst idx = rest.indexOf(flag);\n\tif (idx === -1) return { present: false, tail: rest };\n\tconst tail = [...rest.slice(0, idx), ...rest.slice(idx + 1)];\n\treturn { present: true, tail };\n};\n\n/** Look up a value flag (`--name=val` or `--name val`). */\nexport const takeValueFlag = (\n\trest: ReadonlyArray<string>,\n\tname: string,\n): { readonly value: string | undefined; readonly tail: ReadonlyArray<string> } => {\n\tconst prefix = `--${name}=`;\n\tfor (let i = 0; i < rest.length; i++) {\n\t\tconst tok = rest[i]!;\n\t\tif (tok.startsWith(prefix)) {\n\t\t\treturn {\n\t\t\t\tvalue: tok.slice(prefix.length),\n\t\t\t\ttail: [...rest.slice(0, i), ...rest.slice(i + 1)],\n\t\t\t};\n\t\t}\n\t\tif (tok === `--${name}`) {\n\t\t\tconst next = rest[i + 1];\n\t\t\tif (next === undefined || next.startsWith('-')) {\n\t\t\t\tthrow new CliUsageError({ message: `flag --${name} requires a value` });\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tvalue: next,\n\t\t\t\ttail: [...rest.slice(0, i), ...rest.slice(i + 2)],\n\t\t\t};\n\t\t}\n\t}\n\treturn { value: undefined, tail: rest };\n};\n"],"mappings":";;;;AAyDA,MAAa,WAAW;CACvB,MAAM;CACN,UAAU;CACV,KAAK;CACL,OAAO;CACP,WAAW;CACX,aAAa;CACb,SAAS;CACT,UAAU;CACV,UAAU;CACV;;;AAUD,MAAa,kBACZ,SACiF;CACjF,MAAM,MAAM,KAAK,WAAW,QAAQ,CAAC,IAAI,WAAW,IAAI,CAAC;AACzD,KAAI,QAAQ,GAAI,QAAO;EAAE,MAAM,KAAA;EAAW,MAAM;EAAM;CACtD,MAAM,OAAO,CAAC,GAAG,KAAK,MAAM,GAAG,IAAI,EAAE,GAAG,KAAK,MAAM,MAAM,EAAE,CAAC;AAC5D,QAAO;EAAE,MAAM,KAAK;EAAM;EAAM;;;AAiBjC,MAAa,iBACZ,MACA,SACkF;CAClF,MAAM,SAAS,KAAK,KAAK;AACzB,MAAK,IAAI,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;EACrC,MAAM,MAAM,KAAK;AACjB,MAAI,IAAI,WAAW,OAAO,CACzB,QAAO;GACN,OAAO,IAAI,MAAM,OAAO,OAAO;GAC/B,MAAM,CAAC,GAAG,KAAK,MAAM,GAAG,EAAE,EAAE,GAAG,KAAK,MAAM,IAAI,EAAE,CAAC;GACjD;AAEF,MAAI,QAAQ,KAAK,QAAQ;GACxB,MAAM,OAAO,KAAK,IAAI;AACtB,OAAI,SAAS,KAAA,KAAa,KAAK,WAAW,IAAI,CAC7C,OAAM,IAAI,cAAc,EAAE,SAAS,UAAU,KAAK,oBAAoB,CAAC;AAExE,UAAO;IACN,OAAO;IACP,MAAM,CAAC,GAAG,KAAK,MAAM,GAAG,EAAE,EAAE,GAAG,KAAK,MAAM,IAAI,EAAE,CAAC;IACjD;;;AAGH,QAAO;EAAE,OAAO,KAAA;EAAW,MAAM;EAAM"}
|
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
import { parseDevstackNetworkName } from "../../api/inference-network.mjs";
|
|
2
|
+
import "./sysexits.mjs";
|
|
3
|
+
import { CliInternalError, CliUsageError, exitCodeFor } from "./errors.mjs";
|
|
4
|
+
import { ENV_VARS } from "./flags.mjs";
|
|
5
|
+
import { commandSchema } from "./command-tree.mjs";
|
|
6
|
+
import "./envelope.mjs";
|
|
7
|
+
import { emitFailure, nodeProcessIO } from "./output.mjs";
|
|
8
|
+
import { runConfig } from "./commands/config.mjs";
|
|
9
|
+
import { runDoctor } from "./commands/doctor.mjs";
|
|
10
|
+
import { runPrune } from "./commands/prune.mjs";
|
|
11
|
+
import { runSnapshot } from "./commands/snapshot.mjs";
|
|
12
|
+
import { runStatus } from "./commands/status.mjs";
|
|
13
|
+
import { runWipe } from "./commands/wipe.mjs";
|
|
14
|
+
import { Effect } from "effect";
|
|
15
|
+
import { buildApplication, buildChoiceParser, buildCommand, buildRouteMap, run, text_en } from "@stricli/core";
|
|
16
|
+
//#region src/surfaces/cli/index.ts
|
|
17
|
+
const makeBufferedProcess = (env) => {
|
|
18
|
+
const stdoutBuffer = [];
|
|
19
|
+
const stderrBuffer = [];
|
|
20
|
+
return {
|
|
21
|
+
stdoutBuffer,
|
|
22
|
+
stderrBuffer,
|
|
23
|
+
env,
|
|
24
|
+
stdout: { write: (str) => {
|
|
25
|
+
stdoutBuffer.push(str);
|
|
26
|
+
} },
|
|
27
|
+
stderr: { write: (str) => {
|
|
28
|
+
stderrBuffer.push(str);
|
|
29
|
+
} }
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
const trackIO = (io) => {
|
|
33
|
+
let touched = false;
|
|
34
|
+
let lastExitCode = null;
|
|
35
|
+
return {
|
|
36
|
+
touched: () => touched,
|
|
37
|
+
lastExitCode: () => lastExitCode,
|
|
38
|
+
writeStdout: (line) => io.writeStdout(line).pipe(Effect.tap(() => Effect.sync(() => {
|
|
39
|
+
touched = true;
|
|
40
|
+
}))),
|
|
41
|
+
writeStderr: (line) => io.writeStderr(line).pipe(Effect.tap(() => Effect.sync(() => {
|
|
42
|
+
touched = true;
|
|
43
|
+
}))),
|
|
44
|
+
setExitCode: (code) => io.setExitCode(code).pipe(Effect.tap(() => Effect.sync(() => {
|
|
45
|
+
touched = true;
|
|
46
|
+
lastExitCode = code;
|
|
47
|
+
})))
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
const textParser = (input) => input;
|
|
51
|
+
const stringFlag = (brief, placeholder) => ({
|
|
52
|
+
kind: "parsed",
|
|
53
|
+
parse: textParser,
|
|
54
|
+
optional: true,
|
|
55
|
+
placeholder,
|
|
56
|
+
brief
|
|
57
|
+
});
|
|
58
|
+
const boolFlag = (brief) => ({
|
|
59
|
+
kind: "boolean",
|
|
60
|
+
optional: true,
|
|
61
|
+
brief
|
|
62
|
+
});
|
|
63
|
+
const identityFlagParams = {
|
|
64
|
+
json: boolFlag("Emit JSON envelope output"),
|
|
65
|
+
app: stringFlag("Override app name", "name"),
|
|
66
|
+
stack: stringFlag("Override stack name", "name"),
|
|
67
|
+
stateDir: stringFlag("Override state directory", "path"),
|
|
68
|
+
verbose: boolFlag("Enable more verbose logging")
|
|
69
|
+
};
|
|
70
|
+
const configFlagParams = {
|
|
71
|
+
...identityFlagParams,
|
|
72
|
+
config: stringFlag("Override devstack.config.ts path", "path"),
|
|
73
|
+
network: stringFlag("Override network before config import", "name")
|
|
74
|
+
};
|
|
75
|
+
const destructiveFlagParams = {
|
|
76
|
+
...identityFlagParams,
|
|
77
|
+
dryRun: boolFlag("Skip mutating effects"),
|
|
78
|
+
yes: boolFlag("Assume yes on prompts"),
|
|
79
|
+
noInput: boolFlag("Forbid prompts")
|
|
80
|
+
};
|
|
81
|
+
const globalMaintenanceFlagParams = {
|
|
82
|
+
json: identityFlagParams.json,
|
|
83
|
+
stateDir: identityFlagParams.stateDir,
|
|
84
|
+
verbose: identityFlagParams.verbose
|
|
85
|
+
};
|
|
86
|
+
const confirmFlagParams = {
|
|
87
|
+
...identityFlagParams,
|
|
88
|
+
yes: boolFlag("Assume yes on prompts"),
|
|
89
|
+
noInput: boolFlag("Forbid prompts")
|
|
90
|
+
};
|
|
91
|
+
const pruneFlagParams = {
|
|
92
|
+
...globalMaintenanceFlagParams,
|
|
93
|
+
dryRun: destructiveFlagParams.dryRun,
|
|
94
|
+
yes: destructiveFlagParams.yes,
|
|
95
|
+
noInput: destructiveFlagParams.noInput,
|
|
96
|
+
list: boolFlag("List devstack-labelled Docker resources without pruning"),
|
|
97
|
+
all: boolFlag("Prune every idle non-shared resource group"),
|
|
98
|
+
noContainers: boolFlag("Do not remove containers"),
|
|
99
|
+
noNetworks: boolFlag("Do not remove networks"),
|
|
100
|
+
noVolumes: boolFlag("Do not remove volumes"),
|
|
101
|
+
includeImages: boolFlag("Also remove devstack-labelled images for selected groups")
|
|
102
|
+
};
|
|
103
|
+
const rendererParser = buildChoiceParser([
|
|
104
|
+
"tui",
|
|
105
|
+
"plain",
|
|
106
|
+
"silent"
|
|
107
|
+
]);
|
|
108
|
+
const outputModeFrom = (flags, env) => flags.json === true || env[ENV_VARS.JSON] === "1" ? "json" : "human";
|
|
109
|
+
const pruneResourcesFromFlags = (flags) => ({
|
|
110
|
+
containers: flags.noContainers !== true,
|
|
111
|
+
networks: flags.noNetworks !== true,
|
|
112
|
+
volumes: flags.noVolumes !== true,
|
|
113
|
+
images: flags.includeImages === true
|
|
114
|
+
});
|
|
115
|
+
const optionalEnv = (value, env, key) => value ?? env[key];
|
|
116
|
+
const makeGlobalFlags = (ctx, flags, rest) => {
|
|
117
|
+
const networkRaw = optionalEnv(flags.network, ctx.env, ENV_VARS.NETWORK);
|
|
118
|
+
let network;
|
|
119
|
+
if (networkRaw !== void 0) try {
|
|
120
|
+
network = parseDevstackNetworkName(networkRaw, flags.network === void 0 ? ENV_VARS.NETWORK : "--network");
|
|
121
|
+
} catch (cause) {
|
|
122
|
+
throw cause instanceof Error ? new CliUsageError({ message: cause.message }) : new CliInternalError({
|
|
123
|
+
message: "failed to parse network flag",
|
|
124
|
+
cause
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
return {
|
|
128
|
+
outputMode: outputModeFrom(flags, ctx.env),
|
|
129
|
+
app: optionalEnv(flags.app, ctx.env, ENV_VARS.APP),
|
|
130
|
+
stack: optionalEnv(flags.stack, ctx.env, ENV_VARS.STACK),
|
|
131
|
+
stateDir: optionalEnv(flags.stateDir, ctx.env, ENV_VARS.STATE_DIR),
|
|
132
|
+
configPath: optionalEnv(flags.config, ctx.env, ENV_VARS.CONFIG_PATH),
|
|
133
|
+
network,
|
|
134
|
+
renderer: flags.renderer,
|
|
135
|
+
dryRun: flags.dryRun === true,
|
|
136
|
+
confirm: {
|
|
137
|
+
assumeYes: flags.yes === true,
|
|
138
|
+
forbidPrompt: flags.noInput === true || ctx.env[ENV_VARS.NO_INPUT] === "1",
|
|
139
|
+
stdinIsTty: ctx.stdinIsTty
|
|
140
|
+
},
|
|
141
|
+
schemaEmit: false,
|
|
142
|
+
verbose: flags.verbose === true,
|
|
143
|
+
help: false,
|
|
144
|
+
version: false,
|
|
145
|
+
rest
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
const setNetworkEnv = (flags) => flags.network === void 0 ? Effect.void : Effect.sync(() => {
|
|
149
|
+
process.env[ENV_VARS.NETWORK] = flags.network;
|
|
150
|
+
});
|
|
151
|
+
const runCommandEffect = async (ctx, command, flags, effect) => {
|
|
152
|
+
const program = setNetworkEnv(flags).pipe(Effect.andThen(effect), Effect.catch((error) => emitFailure(ctx.io, flags.outputMode, {
|
|
153
|
+
command,
|
|
154
|
+
elapsedMs: 0,
|
|
155
|
+
error
|
|
156
|
+
}).pipe(Effect.as({ exitCode: exitCodeFor(error) }))), Effect.catchCause((cause) => emitFailure(ctx.io, flags.outputMode, {
|
|
157
|
+
command,
|
|
158
|
+
elapsedMs: 0,
|
|
159
|
+
error: new CliInternalError({ message: "unexpected internal failure" }),
|
|
160
|
+
cause
|
|
161
|
+
}).pipe(Effect.as({ exitCode: 70 }))));
|
|
162
|
+
const result = await Effect.runPromise(program);
|
|
163
|
+
if (ctx.io.lastExitCode() === null) await Effect.runPromise(ctx.io.setExitCode(result.exitCode));
|
|
164
|
+
};
|
|
165
|
+
const runWithFlags = async (ctx, command, rawFlags, rest, effect) => {
|
|
166
|
+
let flags;
|
|
167
|
+
try {
|
|
168
|
+
flags = makeGlobalFlags(ctx, rawFlags, rest);
|
|
169
|
+
} catch (cause) {
|
|
170
|
+
const error = cause instanceof CliUsageError ? cause : new CliInternalError({
|
|
171
|
+
message: "failed to resolve CLI flags",
|
|
172
|
+
cause
|
|
173
|
+
});
|
|
174
|
+
const mode = outputModeFrom(rawFlags, ctx.env);
|
|
175
|
+
await Effect.runPromise(emitFailure(ctx.io, mode, {
|
|
176
|
+
command,
|
|
177
|
+
elapsedMs: 0,
|
|
178
|
+
error
|
|
179
|
+
}));
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
await runCommandEffect(ctx, command, flags, effect(flags));
|
|
183
|
+
};
|
|
184
|
+
const requiredPositional = (placeholder, brief) => ({
|
|
185
|
+
parse: textParser,
|
|
186
|
+
placeholder,
|
|
187
|
+
brief
|
|
188
|
+
});
|
|
189
|
+
const optionalPositional = (placeholder, brief) => ({
|
|
190
|
+
parse: textParser,
|
|
191
|
+
placeholder,
|
|
192
|
+
brief,
|
|
193
|
+
optional: true
|
|
194
|
+
});
|
|
195
|
+
const app = buildApplication(buildRouteMap({
|
|
196
|
+
routes: {
|
|
197
|
+
up: buildCommand({
|
|
198
|
+
parameters: { flags: {
|
|
199
|
+
...configFlagParams,
|
|
200
|
+
renderer: {
|
|
201
|
+
kind: "parsed",
|
|
202
|
+
parse: rendererParser,
|
|
203
|
+
optional: true,
|
|
204
|
+
placeholder: "tui|plain|silent",
|
|
205
|
+
brief: "Select the attached renderer"
|
|
206
|
+
}
|
|
207
|
+
} },
|
|
208
|
+
docs: { brief: "Boot a stack and stay attached until interrupted" },
|
|
209
|
+
func: function(flags) {
|
|
210
|
+
return runWithFlags(this, "up", flags, [], (global) => this.deps.up.run(global));
|
|
211
|
+
}
|
|
212
|
+
}),
|
|
213
|
+
apply: buildCommand({
|
|
214
|
+
parameters: { flags: configFlagParams },
|
|
215
|
+
docs: { brief: "Reconcile a live stack or run one-shot setup" },
|
|
216
|
+
func: function(flags) {
|
|
217
|
+
return runWithFlags(this, "apply", flags, [], (global) => this.deps.apply.run(global));
|
|
218
|
+
}
|
|
219
|
+
}),
|
|
220
|
+
status: buildCommand({
|
|
221
|
+
parameters: { flags: identityFlagParams },
|
|
222
|
+
docs: { brief: "Show the persisted stack projection" },
|
|
223
|
+
func: function(flags) {
|
|
224
|
+
return runWithFlags(this, "status", flags, [], (global) => runStatus(this.deps.status, {
|
|
225
|
+
flags: global,
|
|
226
|
+
io: this.io
|
|
227
|
+
}));
|
|
228
|
+
}
|
|
229
|
+
}),
|
|
230
|
+
doctor: buildCommand({
|
|
231
|
+
parameters: { flags: identityFlagParams },
|
|
232
|
+
docs: { brief: "Run host and stack preflight checks" },
|
|
233
|
+
func: function(flags) {
|
|
234
|
+
return runWithFlags(this, "doctor", flags, [], (global) => runDoctor(this.deps.doctor, {
|
|
235
|
+
flags: global,
|
|
236
|
+
io: this.io
|
|
237
|
+
}));
|
|
238
|
+
}
|
|
239
|
+
}),
|
|
240
|
+
config: buildCommand({
|
|
241
|
+
parameters: { flags: configFlagParams },
|
|
242
|
+
docs: { brief: "Print resolved config inputs" },
|
|
243
|
+
func: function(flags) {
|
|
244
|
+
return runWithFlags(this, "config", flags, [], (global) => runConfig(this.deps.config, {
|
|
245
|
+
flags: global,
|
|
246
|
+
io: this.io
|
|
247
|
+
}));
|
|
248
|
+
}
|
|
249
|
+
}),
|
|
250
|
+
schema: buildCommand({
|
|
251
|
+
parameters: { flags: { json: identityFlagParams.json } },
|
|
252
|
+
docs: { brief: "Emit the CLI schema" },
|
|
253
|
+
func: function(flags) {
|
|
254
|
+
const mode = outputModeFrom(flags, this.env);
|
|
255
|
+
return Effect.runPromise(this.io.writeStdout(JSON.stringify({
|
|
256
|
+
...commandSchema(),
|
|
257
|
+
outputMode: mode
|
|
258
|
+
})).pipe(Effect.andThen(this.io.setExitCode(0))));
|
|
259
|
+
}
|
|
260
|
+
}),
|
|
261
|
+
snapshot: buildRouteMap({
|
|
262
|
+
routes: {
|
|
263
|
+
save: buildCommand({
|
|
264
|
+
parameters: {
|
|
265
|
+
flags: {
|
|
266
|
+
...configFlagParams,
|
|
267
|
+
name: stringFlag("Human-readable snapshot name", "name")
|
|
268
|
+
},
|
|
269
|
+
positional: {
|
|
270
|
+
kind: "tuple",
|
|
271
|
+
parameters: [optionalPositional("name", "snapshot name")]
|
|
272
|
+
}
|
|
273
|
+
},
|
|
274
|
+
docs: { brief: "Capture a snapshot" },
|
|
275
|
+
func: function(flags, snapshotName) {
|
|
276
|
+
const rest = [
|
|
277
|
+
"save",
|
|
278
|
+
...snapshotName === void 0 ? [] : [snapshotName],
|
|
279
|
+
...flags.name === void 0 ? [] : ["--name", flags.name]
|
|
280
|
+
];
|
|
281
|
+
return runWithFlags(this, "snapshot save", flags, rest, (global) => runSnapshot(this.deps.snapshot, {
|
|
282
|
+
flags: global,
|
|
283
|
+
io: this.io
|
|
284
|
+
}));
|
|
285
|
+
}
|
|
286
|
+
}),
|
|
287
|
+
restore: buildCommand({
|
|
288
|
+
parameters: {
|
|
289
|
+
flags: confirmFlagParams,
|
|
290
|
+
positional: {
|
|
291
|
+
kind: "tuple",
|
|
292
|
+
parameters: [requiredPositional("name-or-id", "snapshot name or id")]
|
|
293
|
+
}
|
|
294
|
+
},
|
|
295
|
+
docs: { brief: "Restore a snapshot" },
|
|
296
|
+
func: function(flags, snapshotRef) {
|
|
297
|
+
return runWithFlags(this, "snapshot restore", flags, ["restore", snapshotRef], (global) => runSnapshot(this.deps.snapshot, {
|
|
298
|
+
flags: global,
|
|
299
|
+
io: this.io
|
|
300
|
+
}));
|
|
301
|
+
}
|
|
302
|
+
}),
|
|
303
|
+
list: buildCommand({
|
|
304
|
+
parameters: { flags: identityFlagParams },
|
|
305
|
+
docs: { brief: "List snapshots" },
|
|
306
|
+
func: function(flags) {
|
|
307
|
+
return runWithFlags(this, "snapshot list", flags, ["list"], (global) => runSnapshot(this.deps.snapshot, {
|
|
308
|
+
flags: global,
|
|
309
|
+
io: this.io
|
|
310
|
+
}));
|
|
311
|
+
}
|
|
312
|
+
}),
|
|
313
|
+
delete: buildCommand({
|
|
314
|
+
parameters: {
|
|
315
|
+
flags: confirmFlagParams,
|
|
316
|
+
positional: {
|
|
317
|
+
kind: "tuple",
|
|
318
|
+
parameters: [requiredPositional("name-or-id", "snapshot name or id")]
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
docs: { brief: "Delete a snapshot" },
|
|
322
|
+
func: function(flags, snapshotRef) {
|
|
323
|
+
return runWithFlags(this, "snapshot delete", flags, ["delete", snapshotRef], (global) => runSnapshot(this.deps.snapshot, {
|
|
324
|
+
flags: global,
|
|
325
|
+
io: this.io
|
|
326
|
+
}));
|
|
327
|
+
}
|
|
328
|
+
})
|
|
329
|
+
},
|
|
330
|
+
docs: { brief: "Capture, restore, list, or delete stack snapshots" }
|
|
331
|
+
}),
|
|
332
|
+
prune: buildCommand({
|
|
333
|
+
parameters: { flags: pruneFlagParams },
|
|
334
|
+
docs: { brief: "Inventory and prune devstack-labelled Docker resources" },
|
|
335
|
+
func: function(flags) {
|
|
336
|
+
return runWithFlags(this, "prune", flags, [], (global) => runPrune(this.deps.prune, {
|
|
337
|
+
flags: global,
|
|
338
|
+
io: this.io
|
|
339
|
+
}, {
|
|
340
|
+
mode: flags.list === true ? "list" : flags.all === true ? "all" : "auto",
|
|
341
|
+
resources: pruneResourcesFromFlags(flags)
|
|
342
|
+
}));
|
|
343
|
+
}
|
|
344
|
+
}),
|
|
345
|
+
wipe: buildCommand({
|
|
346
|
+
parameters: { flags: destructiveFlagParams },
|
|
347
|
+
docs: { brief: "Destroy all state for the selected stack" },
|
|
348
|
+
func: function(flags) {
|
|
349
|
+
return runWithFlags(this, "wipe", flags, [], (global) => runWipe(this.deps.wipe, {
|
|
350
|
+
flags: global,
|
|
351
|
+
io: this.io
|
|
352
|
+
}));
|
|
353
|
+
}
|
|
354
|
+
})
|
|
355
|
+
},
|
|
356
|
+
docs: { brief: "Sui development stack CLI" }
|
|
357
|
+
}), {
|
|
358
|
+
name: "devstack",
|
|
359
|
+
versionInfo: { currentVersion: "0.0.0" },
|
|
360
|
+
scanner: { caseStyle: "allow-kebab-for-camel" },
|
|
361
|
+
documentation: {
|
|
362
|
+
caseStyle: "convert-camel-to-kebab",
|
|
363
|
+
disableAnsiColor: true,
|
|
364
|
+
onlyRequiredInUsageLine: true
|
|
365
|
+
},
|
|
366
|
+
localization: { loadText: () => ({
|
|
367
|
+
...text_en,
|
|
368
|
+
exceptionWhileParsingArguments: (error) => error instanceof Error ? error.message : String(error)
|
|
369
|
+
}) }
|
|
370
|
+
});
|
|
371
|
+
const jsonRequested = (argv, env) => env[ENV_VARS.JSON] === "1" || argv.includes("--json");
|
|
372
|
+
const normalizeStricliExitCode = (code) => {
|
|
373
|
+
if (typeof code === "number" && code !== 0) return 64;
|
|
374
|
+
return 0;
|
|
375
|
+
};
|
|
376
|
+
const flushBufferedProcess = (process, io, argv, env) => Effect.gen(function* () {
|
|
377
|
+
const exitCode = normalizeStricliExitCode(process.exitCode);
|
|
378
|
+
const stdout = process.stdoutBuffer.join("");
|
|
379
|
+
const stderr = process.stderrBuffer.join("").trim();
|
|
380
|
+
if (exitCode !== 0 && jsonRequested(argv, env)) {
|
|
381
|
+
yield* emitFailure(io, "json", {
|
|
382
|
+
command: "(parse)",
|
|
383
|
+
elapsedMs: 0,
|
|
384
|
+
error: new CliUsageError({ message: stderr.length > 0 ? stderr : "invalid command line" })
|
|
385
|
+
});
|
|
386
|
+
return;
|
|
387
|
+
}
|
|
388
|
+
if (stdout.length > 0) yield* io.writeStdout(stdout.endsWith("\n") ? stdout.slice(0, -1) : stdout);
|
|
389
|
+
if (stderr.length > 0) yield* io.writeStderr(stderr);
|
|
390
|
+
yield* io.setExitCode(exitCode);
|
|
391
|
+
});
|
|
392
|
+
const dispatch = (deps, dispatchEnv) => Effect.gen(function* () {
|
|
393
|
+
const io = trackIO(dispatchEnv.io ?? nodeProcessIO);
|
|
394
|
+
const process = makeBufferedProcess(dispatchEnv.env);
|
|
395
|
+
const ctx = {
|
|
396
|
+
process,
|
|
397
|
+
deps,
|
|
398
|
+
env: dispatchEnv.env,
|
|
399
|
+
stdinIsTty: dispatchEnv.stdinIsTty,
|
|
400
|
+
io
|
|
401
|
+
};
|
|
402
|
+
yield* Effect.tryPromise({
|
|
403
|
+
try: () => run(app, dispatchEnv.argv, ctx),
|
|
404
|
+
catch: (cause) => new CliInternalError({
|
|
405
|
+
message: "CLI dispatcher failed",
|
|
406
|
+
cause
|
|
407
|
+
})
|
|
408
|
+
}).pipe(Effect.catch((error) => emitFailure(io, jsonRequested(dispatchEnv.argv, dispatchEnv.env) ? "json" : "human", {
|
|
409
|
+
command: "(dispatch)",
|
|
410
|
+
elapsedMs: 0,
|
|
411
|
+
error
|
|
412
|
+
})));
|
|
413
|
+
if (!io.touched()) yield* flushBufferedProcess(process, io, dispatchEnv.argv, dispatchEnv.env);
|
|
414
|
+
});
|
|
415
|
+
//#endregion
|
|
416
|
+
export { dispatch };
|
|
417
|
+
|
|
418
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["runStricli"],"sources":["../../../src/surfaces/cli/index.ts"],"sourcesContent":["// CLI surface — top-level entry point.\n//\n// The public CLI is intentionally small: `up` is the attached operator\n// surface, `apply` is live-aware reconcile (publish to `up` when it is\n// running, one-shot otherwise), and every other command is offline/direct.\n\nimport {\n\tbuildApplication,\n\tbuildChoiceParser,\n\tbuildCommand,\n\tbuildRouteMap,\n\trun as runStricli,\n\ttext_en,\n\ttype CommandContext as StricliCommandContext,\n\ttype StricliProcess,\n} from '@stricli/core';\nimport { Effect } from 'effect';\n\nimport { commandSchema } from './command-tree.ts';\nimport { type CliError, CliInternalError, CliUsageError, exitCodeFor } from './errors.ts';\nimport { type CliRendererMode, ENV_VARS, type GlobalFlags, type OutputMode } from './flags.ts';\nimport { parseDevstackNetworkName } from '../../api/inference-network.ts';\nimport { type CliIO, emitFailure, nodeProcessIO } from './output.ts';\nimport {\n\ttype CommandResult,\n\ttype ConfigDeps,\n\ttype DoctorDeps,\n\ttype PruneDeps,\n\ttype PruneResourceScope,\n\ttype SnapshotDeps,\n\ttype StatusDeps,\n\ttype WipeDeps,\n\trunConfig,\n\trunDoctor,\n\trunPrune,\n\trunSnapshot,\n\trunStatus,\n\trunWipe,\n} from './commands/index.ts';\n\n// -----------------------------------------------------------------------------\n// Deps bundle\n// -----------------------------------------------------------------------------\n\nexport interface LifecycleCommandDeps {\n\treadonly run: (flags: GlobalFlags) => Effect.Effect<CommandResult, CliError>;\n}\n\nexport interface CliDeps {\n\treadonly up: LifecycleCommandDeps;\n\treadonly apply: LifecycleCommandDeps;\n\treadonly status: StatusDeps;\n\treadonly snapshot: SnapshotDeps;\n\treadonly prune: PruneDeps;\n\treadonly doctor: DoctorDeps;\n\treadonly config: ConfigDeps;\n\treadonly wipe: WipeDeps;\n}\n\nexport interface DispatchEnv {\n\treadonly argv: ReadonlyArray<string>;\n\treadonly env: Readonly<Record<string, string | undefined>>;\n\treadonly stdinIsTty: boolean;\n\treadonly io?: CliIO;\n}\n\n// -----------------------------------------------------------------------------\n// Stricli context + buffered process\n// -----------------------------------------------------------------------------\n\ninterface BufferedProcess extends StricliProcess {\n\treadonly stdoutBuffer: Array<string>;\n\treadonly stderrBuffer: Array<string>;\n\texitCode?: number | string | null;\n}\n\ninterface TrackedIO extends CliIO {\n\treadonly touched: () => boolean;\n\treadonly lastExitCode: () => number | null;\n}\n\ninterface DevstackCliContext extends StricliCommandContext {\n\treadonly deps: CliDeps;\n\treadonly env: Readonly<Record<string, string | undefined>>;\n\treadonly stdinIsTty: boolean;\n\treadonly io: TrackedIO;\n\treadonly process: BufferedProcess;\n}\n\nconst makeBufferedProcess = (\n\tenv: Readonly<Record<string, string | undefined>>,\n): BufferedProcess => {\n\tconst stdoutBuffer: Array<string> = [];\n\tconst stderrBuffer: Array<string> = [];\n\treturn {\n\t\tstdoutBuffer,\n\t\tstderrBuffer,\n\t\tenv,\n\t\tstdout: {\n\t\t\twrite: (str) => {\n\t\t\t\tstdoutBuffer.push(str);\n\t\t\t},\n\t\t},\n\t\tstderr: {\n\t\t\twrite: (str) => {\n\t\t\t\tstderrBuffer.push(str);\n\t\t\t},\n\t\t},\n\t};\n};\n\nconst trackIO = (io: CliIO): TrackedIO => {\n\tlet touched = false;\n\tlet lastExitCode: number | null = null;\n\treturn {\n\t\ttouched: () => touched,\n\t\tlastExitCode: () => lastExitCode,\n\t\twriteStdout: (line) =>\n\t\t\tio.writeStdout(line).pipe(\n\t\t\t\tEffect.tap(() =>\n\t\t\t\t\tEffect.sync(() => {\n\t\t\t\t\t\ttouched = true;\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t),\n\t\twriteStderr: (line) =>\n\t\t\tio.writeStderr(line).pipe(\n\t\t\t\tEffect.tap(() =>\n\t\t\t\t\tEffect.sync(() => {\n\t\t\t\t\t\ttouched = true;\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t),\n\t\tsetExitCode: (code) =>\n\t\t\tio.setExitCode(code).pipe(\n\t\t\t\tEffect.tap(() =>\n\t\t\t\t\tEffect.sync(() => {\n\t\t\t\t\t\ttouched = true;\n\t\t\t\t\t\tlastExitCode = code;\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t),\n\t};\n};\n\n// -----------------------------------------------------------------------------\n// Flag models\n// -----------------------------------------------------------------------------\n\ninterface IdentityFlags {\n\treadonly json?: boolean;\n\treadonly app?: string;\n\treadonly stack?: string;\n\treadonly stateDir?: string;\n\treadonly verbose?: boolean;\n}\n\ninterface ConfigFlags extends IdentityFlags {\n\treadonly config?: string;\n\treadonly network?: string;\n}\n\ninterface UpFlags extends ConfigFlags {\n\treadonly renderer?: CliRendererMode;\n}\n\ninterface DestructiveFlags extends IdentityFlags {\n\treadonly dryRun?: boolean;\n\treadonly yes?: boolean;\n\treadonly noInput?: boolean;\n}\n\ninterface ConfirmFlags extends IdentityFlags {\n\treadonly yes?: boolean;\n\treadonly noInput?: boolean;\n}\n\ninterface PruneFlags {\n\treadonly json?: boolean;\n\treadonly stateDir?: string;\n\treadonly verbose?: boolean;\n\treadonly dryRun?: boolean;\n\treadonly yes?: boolean;\n\treadonly noInput?: boolean;\n\treadonly list?: boolean;\n\treadonly all?: boolean;\n\treadonly noContainers?: boolean;\n\treadonly noNetworks?: boolean;\n\treadonly noVolumes?: boolean;\n\treadonly includeImages?: boolean;\n}\n\ninterface SnapshotSaveFlags extends ConfigFlags {\n\treadonly name?: string;\n}\n\nconst textParser = (input: string): string => input;\n\nconst stringFlag = (brief: string, placeholder: string) =>\n\t({\n\t\tkind: 'parsed',\n\t\tparse: textParser,\n\t\toptional: true,\n\t\tplaceholder,\n\t\tbrief,\n\t}) as const;\n\nconst boolFlag = (brief: string) =>\n\t({\n\t\tkind: 'boolean',\n\t\toptional: true,\n\t\tbrief,\n\t}) as const;\n\nconst identityFlagParams = {\n\tjson: boolFlag('Emit JSON envelope output'),\n\tapp: stringFlag('Override app name', 'name'),\n\tstack: stringFlag('Override stack name', 'name'),\n\tstateDir: stringFlag('Override state directory', 'path'),\n\tverbose: boolFlag('Enable more verbose logging'),\n} as const;\n\nconst configFlagParams = {\n\t...identityFlagParams,\n\tconfig: stringFlag('Override devstack.config.ts path', 'path'),\n\tnetwork: stringFlag('Override network before config import', 'name'),\n} as const;\n\nconst destructiveFlagParams = {\n\t...identityFlagParams,\n\tdryRun: boolFlag('Skip mutating effects'),\n\tyes: boolFlag('Assume yes on prompts'),\n\tnoInput: boolFlag('Forbid prompts'),\n} as const;\n\nconst globalMaintenanceFlagParams = {\n\tjson: identityFlagParams.json,\n\tstateDir: identityFlagParams.stateDir,\n\tverbose: identityFlagParams.verbose,\n} as const;\n\nconst confirmFlagParams = {\n\t...identityFlagParams,\n\tyes: boolFlag('Assume yes on prompts'),\n\tnoInput: boolFlag('Forbid prompts'),\n} as const;\n\nconst pruneFlagParams = {\n\t...globalMaintenanceFlagParams,\n\tdryRun: destructiveFlagParams.dryRun,\n\tyes: destructiveFlagParams.yes,\n\tnoInput: destructiveFlagParams.noInput,\n\tlist: boolFlag('List devstack-labelled Docker resources without pruning'),\n\tall: boolFlag('Prune every idle non-shared resource group'),\n\tnoContainers: boolFlag('Do not remove containers'),\n\tnoNetworks: boolFlag('Do not remove networks'),\n\tnoVolumes: boolFlag('Do not remove volumes'),\n\tincludeImages: boolFlag('Also remove devstack-labelled images for selected groups'),\n} as const;\n\nconst rendererParser = buildChoiceParser(['tui', 'plain', 'silent'] as const);\n\nconst outputModeFrom = (\n\tflags: Pick<IdentityFlags, 'json'>,\n\tenv: Readonly<Record<string, string | undefined>>,\n): OutputMode => (flags.json === true || env[ENV_VARS.JSON] === '1' ? 'json' : 'human');\n\nconst pruneResourcesFromFlags = (flags: PruneFlags): PruneResourceScope => ({\n\tcontainers: flags.noContainers !== true,\n\tnetworks: flags.noNetworks !== true,\n\tvolumes: flags.noVolumes !== true,\n\timages: flags.includeImages === true,\n});\n\nconst optionalEnv = (\n\tvalue: string | undefined,\n\tenv: Readonly<Record<string, string | undefined>>,\n\tkey: string,\n): string | undefined => value ?? env[key];\n\nconst makeGlobalFlags = (\n\tctx: DevstackCliContext,\n\tflags: IdentityFlags & Partial<ConfigFlags & UpFlags & DestructiveFlags>,\n\trest: ReadonlyArray<string>,\n): GlobalFlags => {\n\tconst networkRaw = optionalEnv(flags.network, ctx.env, ENV_VARS.NETWORK);\n\tlet network: string | undefined;\n\tif (networkRaw !== undefined) {\n\t\ttry {\n\t\t\tnetwork = parseDevstackNetworkName(\n\t\t\t\tnetworkRaw,\n\t\t\t\tflags.network === undefined ? ENV_VARS.NETWORK : '--network',\n\t\t\t);\n\t\t} catch (cause) {\n\t\t\tthrow cause instanceof Error\n\t\t\t\t? new CliUsageError({ message: cause.message })\n\t\t\t\t: new CliInternalError({ message: 'failed to parse network flag', cause });\n\t\t}\n\t}\n\treturn {\n\t\toutputMode: outputModeFrom(flags, ctx.env),\n\t\tapp: optionalEnv(flags.app, ctx.env, ENV_VARS.APP),\n\t\tstack: optionalEnv(flags.stack, ctx.env, ENV_VARS.STACK),\n\t\tstateDir: optionalEnv(flags.stateDir, ctx.env, ENV_VARS.STATE_DIR),\n\t\tconfigPath: optionalEnv(flags.config, ctx.env, ENV_VARS.CONFIG_PATH),\n\t\tnetwork,\n\t\trenderer: flags.renderer,\n\t\tdryRun: flags.dryRun === true,\n\t\tconfirm: {\n\t\t\tassumeYes: flags.yes === true,\n\t\t\tforbidPrompt: flags.noInput === true || ctx.env[ENV_VARS.NO_INPUT] === '1',\n\t\t\tstdinIsTty: ctx.stdinIsTty,\n\t\t},\n\t\tschemaEmit: false,\n\t\tverbose: flags.verbose === true,\n\t\thelp: false,\n\t\tversion: false,\n\t\trest,\n\t};\n};\n\nconst setNetworkEnv = (flags: GlobalFlags): Effect.Effect<void> =>\n\tflags.network === undefined\n\t\t? Effect.void\n\t\t: Effect.sync(() => {\n\t\t\t\tprocess.env[ENV_VARS.NETWORK] = flags.network;\n\t\t\t});\n\n// -----------------------------------------------------------------------------\n// Command execution helpers\n// -----------------------------------------------------------------------------\n\nconst runCommandEffect = async (\n\tctx: DevstackCliContext,\n\tcommand: string,\n\tflags: GlobalFlags,\n\teffect: Effect.Effect<CommandResult, CliError>,\n): Promise<void> => {\n\tconst program = setNetworkEnv(flags).pipe(\n\t\tEffect.andThen(effect),\n\t\tEffect.catch((error: CliError) =>\n\t\t\temitFailure(ctx.io, flags.outputMode, {\n\t\t\t\tcommand,\n\t\t\t\telapsedMs: 0,\n\t\t\t\terror,\n\t\t\t}).pipe(Effect.as({ exitCode: exitCodeFor(error) })),\n\t\t),\n\t\tEffect.catchCause((cause) =>\n\t\t\temitFailure(ctx.io, flags.outputMode, {\n\t\t\t\tcommand,\n\t\t\t\telapsedMs: 0,\n\t\t\t\terror: new CliInternalError({ message: 'unexpected internal failure' }),\n\t\t\t\tcause,\n\t\t\t}).pipe(Effect.as({ exitCode: 70 })),\n\t\t),\n\t);\n\tconst result = await Effect.runPromise(program);\n\tif (ctx.io.lastExitCode() === null) {\n\t\tawait Effect.runPromise(ctx.io.setExitCode(result.exitCode));\n\t}\n};\n\nconst runWithFlags = async (\n\tctx: DevstackCliContext,\n\tcommand: string,\n\trawFlags: IdentityFlags & Partial<ConfigFlags & UpFlags & DestructiveFlags>,\n\trest: ReadonlyArray<string>,\n\teffect: (flags: GlobalFlags) => Effect.Effect<CommandResult, CliError>,\n): Promise<void> => {\n\tlet flags: GlobalFlags;\n\ttry {\n\t\tflags = makeGlobalFlags(ctx, rawFlags, rest);\n\t} catch (cause) {\n\t\tconst error =\n\t\t\tcause instanceof CliUsageError\n\t\t\t\t? cause\n\t\t\t\t: new CliInternalError({ message: 'failed to resolve CLI flags', cause });\n\t\tconst mode = outputModeFrom(rawFlags, ctx.env);\n\t\tawait Effect.runPromise(\n\t\t\temitFailure(ctx.io, mode, {\n\t\t\t\tcommand,\n\t\t\t\telapsedMs: 0,\n\t\t\t\terror,\n\t\t\t}),\n\t\t);\n\t\treturn;\n\t}\n\tawait runCommandEffect(ctx, command, flags, effect(flags));\n};\n\nconst requiredPositional = (placeholder: string, brief: string) =>\n\t({\n\t\tparse: textParser,\n\t\tplaceholder,\n\t\tbrief,\n\t}) as const;\n\nconst optionalPositional = (placeholder: string, brief: string) =>\n\t({\n\t\tparse: textParser,\n\t\tplaceholder,\n\t\tbrief,\n\t\toptional: true as const,\n\t}) as const;\n\n// -----------------------------------------------------------------------------\n// Commands\n// -----------------------------------------------------------------------------\n\nconst upCommand = buildCommand<UpFlags, [], DevstackCliContext>({\n\tparameters: {\n\t\tflags: {\n\t\t\t...configFlagParams,\n\t\t\trenderer: {\n\t\t\t\tkind: 'parsed',\n\t\t\t\tparse: rendererParser,\n\t\t\t\toptional: true,\n\t\t\t\tplaceholder: 'tui|plain|silent',\n\t\t\t\tbrief: 'Select the attached renderer',\n\t\t\t},\n\t\t},\n\t},\n\tdocs: {\n\t\tbrief: 'Boot a stack and stay attached until interrupted',\n\t},\n\tfunc: function (flags) {\n\t\treturn runWithFlags(this, 'up', flags, [], (global) => this.deps.up.run(global));\n\t},\n});\n\nconst applyCommand = buildCommand<ConfigFlags, [], DevstackCliContext>({\n\tparameters: { flags: configFlagParams },\n\tdocs: {\n\t\tbrief: 'Reconcile a live stack or run one-shot setup',\n\t},\n\tfunc: function (flags) {\n\t\treturn runWithFlags(this, 'apply', flags, [], (global) => this.deps.apply.run(global));\n\t},\n});\n\nconst statusCommand = buildCommand<IdentityFlags, [], DevstackCliContext>({\n\tparameters: { flags: identityFlagParams },\n\tdocs: { brief: 'Show the persisted stack projection' },\n\tfunc: function (flags) {\n\t\treturn runWithFlags(this, 'status', flags, [], (global) =>\n\t\t\trunStatus(this.deps.status, { flags: global, io: this.io }),\n\t\t);\n\t},\n});\n\nconst doctorCommand = buildCommand<IdentityFlags, [], DevstackCliContext>({\n\tparameters: { flags: identityFlagParams },\n\tdocs: { brief: 'Run host and stack preflight checks' },\n\tfunc: function (flags) {\n\t\treturn runWithFlags(this, 'doctor', flags, [], (global) =>\n\t\t\trunDoctor(this.deps.doctor, { flags: global, io: this.io }),\n\t\t);\n\t},\n});\n\nconst configCommand = buildCommand<ConfigFlags, [], DevstackCliContext>({\n\tparameters: { flags: configFlagParams },\n\tdocs: { brief: 'Print resolved config inputs' },\n\tfunc: function (flags) {\n\t\treturn runWithFlags(this, 'config', flags, [], (global) =>\n\t\t\trunConfig(this.deps.config, { flags: global, io: this.io }),\n\t\t);\n\t},\n});\n\nconst schemaCommand = buildCommand<Pick<IdentityFlags, 'json'>, [], DevstackCliContext>({\n\tparameters: { flags: { json: identityFlagParams.json } },\n\tdocs: { brief: 'Emit the CLI schema' },\n\tfunc: function (flags) {\n\t\tconst mode = outputModeFrom(flags, this.env);\n\t\treturn Effect.runPromise(\n\t\t\tthis.io\n\t\t\t\t.writeStdout(JSON.stringify({ ...commandSchema(), outputMode: mode }))\n\t\t\t\t.pipe(Effect.andThen(this.io.setExitCode(0))),\n\t\t);\n\t},\n});\n\nconst snapshotSaveCommand = buildCommand<\n\tSnapshotSaveFlags,\n\t[string | undefined],\n\tDevstackCliContext\n>({\n\tparameters: {\n\t\tflags: {\n\t\t\t...configFlagParams,\n\t\t\tname: stringFlag('Human-readable snapshot name', 'name'),\n\t\t},\n\t\tpositional: { kind: 'tuple', parameters: [optionalPositional('name', 'snapshot name')] },\n\t},\n\tdocs: { brief: 'Capture a snapshot' },\n\tfunc: function (flags, snapshotName) {\n\t\tconst rest = [\n\t\t\t'save',\n\t\t\t...(snapshotName === undefined ? [] : [snapshotName]),\n\t\t\t...(flags.name === undefined ? [] : ['--name', flags.name]),\n\t\t];\n\t\treturn runWithFlags(this, 'snapshot save', flags, rest, (global) =>\n\t\t\trunSnapshot(this.deps.snapshot, { flags: global, io: this.io }),\n\t\t);\n\t},\n});\n\nconst snapshotRestoreCommand = buildCommand<ConfirmFlags, [string], DevstackCliContext>({\n\tparameters: {\n\t\tflags: confirmFlagParams,\n\t\tpositional: {\n\t\t\tkind: 'tuple',\n\t\t\tparameters: [requiredPositional('name-or-id', 'snapshot name or id')],\n\t\t},\n\t},\n\tdocs: { brief: 'Restore a snapshot' },\n\tfunc: function (flags, snapshotRef) {\n\t\treturn runWithFlags(this, 'snapshot restore', flags, ['restore', snapshotRef], (global) =>\n\t\t\trunSnapshot(this.deps.snapshot, { flags: global, io: this.io }),\n\t\t);\n\t},\n});\n\nconst snapshotListCommand = buildCommand<IdentityFlags, [], DevstackCliContext>({\n\tparameters: { flags: identityFlagParams },\n\tdocs: { brief: 'List snapshots' },\n\tfunc: function (flags) {\n\t\treturn runWithFlags(this, 'snapshot list', flags, ['list'], (global) =>\n\t\t\trunSnapshot(this.deps.snapshot, { flags: global, io: this.io }),\n\t\t);\n\t},\n});\n\nconst snapshotDeleteCommand = buildCommand<ConfirmFlags, [string], DevstackCliContext>({\n\tparameters: {\n\t\tflags: confirmFlagParams,\n\t\tpositional: {\n\t\t\tkind: 'tuple',\n\t\t\tparameters: [requiredPositional('name-or-id', 'snapshot name or id')],\n\t\t},\n\t},\n\tdocs: { brief: 'Delete a snapshot' },\n\tfunc: function (flags, snapshotRef) {\n\t\treturn runWithFlags(this, 'snapshot delete', flags, ['delete', snapshotRef], (global) =>\n\t\t\trunSnapshot(this.deps.snapshot, { flags: global, io: this.io }),\n\t\t);\n\t},\n});\n\nconst snapshotCommands = buildRouteMap({\n\troutes: {\n\t\tsave: snapshotSaveCommand,\n\t\trestore: snapshotRestoreCommand,\n\t\tlist: snapshotListCommand,\n\t\tdelete: snapshotDeleteCommand,\n\t},\n\tdocs: { brief: 'Capture, restore, list, or delete stack snapshots' },\n});\n\nconst pruneCommand = buildCommand<PruneFlags, [], DevstackCliContext>({\n\tparameters: { flags: pruneFlagParams },\n\tdocs: { brief: 'Inventory and prune devstack-labelled Docker resources' },\n\tfunc: function (flags) {\n\t\treturn runWithFlags(this, 'prune', flags, [], (global) =>\n\t\t\trunPrune(\n\t\t\t\tthis.deps.prune,\n\t\t\t\t{ flags: global, io: this.io },\n\t\t\t\t{\n\t\t\t\t\tmode: flags.list === true ? 'list' : flags.all === true ? 'all' : 'auto',\n\t\t\t\t\tresources: pruneResourcesFromFlags(flags),\n\t\t\t\t},\n\t\t\t),\n\t\t);\n\t},\n});\n\nconst wipeCommand = buildCommand<DestructiveFlags, [], DevstackCliContext>({\n\tparameters: { flags: destructiveFlagParams },\n\tdocs: { brief: 'Destroy all state for the selected stack' },\n\tfunc: function (flags) {\n\t\treturn runWithFlags(this, 'wipe', flags, [], (global) =>\n\t\t\trunWipe(this.deps.wipe, { flags: global, io: this.io }),\n\t\t);\n\t},\n});\n\nconst root = buildRouteMap({\n\troutes: {\n\t\tup: upCommand,\n\t\tapply: applyCommand,\n\t\tstatus: statusCommand,\n\t\tdoctor: doctorCommand,\n\t\tconfig: configCommand,\n\t\tschema: schemaCommand,\n\t\tsnapshot: snapshotCommands,\n\t\tprune: pruneCommand,\n\t\twipe: wipeCommand,\n\t},\n\tdocs: {\n\t\tbrief: 'Sui development stack CLI',\n\t},\n});\n\nconst app = buildApplication(root, {\n\tname: 'devstack',\n\tversionInfo: { currentVersion: '0.0.0' },\n\tscanner: { caseStyle: 'allow-kebab-for-camel' },\n\tdocumentation: {\n\t\tcaseStyle: 'convert-camel-to-kebab',\n\t\tdisableAnsiColor: true,\n\t\tonlyRequiredInUsageLine: true,\n\t},\n\tlocalization: {\n\t\tloadText: () => ({\n\t\t\t...text_en,\n\t\t\texceptionWhileParsingArguments: (error) =>\n\t\t\t\terror instanceof Error ? error.message : String(error),\n\t\t}),\n\t},\n});\n\nconst jsonRequested = (\n\targv: ReadonlyArray<string>,\n\tenv: Readonly<Record<string, string | undefined>>,\n): boolean => env[ENV_VARS.JSON] === '1' || argv.includes('--json');\n\nconst normalizeStricliExitCode = (code: number | string | null | undefined): number => {\n\tif (typeof code === 'number' && code !== 0) return 64;\n\treturn 0;\n};\n\nconst flushBufferedProcess = (\n\tprocess: BufferedProcess,\n\tio: CliIO,\n\targv: ReadonlyArray<string>,\n\tenv: Readonly<Record<string, string | undefined>>,\n): Effect.Effect<void> =>\n\tEffect.gen(function* () {\n\t\tconst exitCode = normalizeStricliExitCode(process.exitCode);\n\t\tconst stdout = process.stdoutBuffer.join('');\n\t\tconst stderr = process.stderrBuffer.join('').trim();\n\t\tif (exitCode !== 0 && jsonRequested(argv, env)) {\n\t\t\tyield* emitFailure(io, 'json', {\n\t\t\t\tcommand: '(parse)',\n\t\t\t\telapsedMs: 0,\n\t\t\t\terror: new CliUsageError({\n\t\t\t\t\tmessage: stderr.length > 0 ? stderr : 'invalid command line',\n\t\t\t\t}),\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tif (stdout.length > 0)\n\t\t\tyield* io.writeStdout(stdout.endsWith('\\n') ? stdout.slice(0, -1) : stdout);\n\t\tif (stderr.length > 0) yield* io.writeStderr(stderr);\n\t\tyield* io.setExitCode(exitCode);\n\t});\n\nexport const dispatch = (deps: CliDeps, dispatchEnv: DispatchEnv): Effect.Effect<void> =>\n\tEffect.gen(function* () {\n\t\tconst io = trackIO(dispatchEnv.io ?? nodeProcessIO);\n\t\tconst process = makeBufferedProcess(dispatchEnv.env);\n\t\tconst ctx: DevstackCliContext = {\n\t\t\tprocess,\n\t\t\tdeps,\n\t\t\tenv: dispatchEnv.env,\n\t\t\tstdinIsTty: dispatchEnv.stdinIsTty,\n\t\t\tio,\n\t\t};\n\t\tyield* Effect.tryPromise({\n\t\t\ttry: () => runStricli(app, dispatchEnv.argv, ctx),\n\t\t\tcatch: (cause) => new CliInternalError({ message: 'CLI dispatcher failed', cause }),\n\t\t}).pipe(\n\t\t\tEffect.catch((error: CliError) =>\n\t\t\t\temitFailure(io, jsonRequested(dispatchEnv.argv, dispatchEnv.env) ? 'json' : 'human', {\n\t\t\t\t\tcommand: '(dispatch)',\n\t\t\t\t\telapsedMs: 0,\n\t\t\t\t\terror,\n\t\t\t\t}),\n\t\t\t),\n\t\t);\n\t\tif (!io.touched()) {\n\t\t\tyield* flushBufferedProcess(process, io, dispatchEnv.argv, dispatchEnv.env);\n\t\t}\n\t});\n\n// -----------------------------------------------------------------------------\n// Re-exports\n// -----------------------------------------------------------------------------\n\nexport type { CliIO } from './output.ts';\nexport type { GlobalFlags } from './flags.ts';\nexport {\n\tCOMMAND_TREE,\n\tcommandSchema,\n\tformatCommandHelp,\n\tVERBS,\n\ttype Verb,\n} from './command-tree.ts';\nexport type { Envelope, EnvelopeError } from './envelope.ts';\nexport {\n\tENVELOPE_SCHEMA_VERSION,\n\tfailureEnvelope,\n\tstreamingEvent,\n\tsuccessEnvelope,\n\ttype StreamingEvent,\n} from './envelope.ts';\nexport { ExitCode, exitCodeName } from './sysexits.ts';\nexport {\n\ttype CliError,\n\tCliAlreadyReportedError,\n\tCliConfigInvalidError,\n\tCliConfigNotFoundError,\n\tCliConfirmDeclinedError,\n\tCliConfirmRequiredError,\n\tCliInternalError,\n\tCliSnapshotNotFoundError,\n\tCliSupervisorLiveError,\n\tCliUnavailableError,\n\tCliUsageError,\n} from './errors.ts';\n"],"mappings":";;;;;;;;;;;;;;;;AAyFA,MAAM,uBACL,QACqB;CACrB,MAAM,eAA8B,EAAE;CACtC,MAAM,eAA8B,EAAE;AACtC,QAAO;EACN;EACA;EACA;EACA,QA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S,IAAI,SAAS,wBACtC,CAAC;GACF,CAAC;AACF;;AAED,KAAI,OAAO,SAAS,EACnB,QAAO,GAAG,YAAY,OAAO,SAAS,KAAK,GAAG,OAAO,MAAM,GAAG,GAAG,GAAG,OAAO;AAC5E,KAAI,OAAO,SAAS,EAAG,QAAO,GAAG,YAAY,OAAO;AACpD,QAAO,GAAG,YAAY,SAAS;EAC9B;AAEH,MAAa,YAAY,MAAe,gBACvC,OAAO,IAAI,aAAa;CACvB,MAAM,KAAK,QAAQ,YAAY,MAAM,cAAc;CACnD,MAAM,UAAU,oBAAoB,YAAY,IAAI;CACpD,MAAM,MAA0B;EAC/B;EACA;EACA,KAAK,YAAY;EACjB,YAAY,YAAY;EACxB;EACA;AACD,QAAO,OAAO,WAAW;EACxB,WAAWA,IAAW,KAAK,YAAY,MAAM,IAAI;EACjD,QAAQ,UAAU,IAAI,iBAAiB;GAAE,SAAS;GAAyB;GAAO,CAAC;EACnF,CAAC,CAAC,KACF,OAAO,OAAO,UACb,YAAY,IAAI,cAAc,YAAY,MAAM,YAAY,IAAI,GAAG,SAAS,SAAS;EACpF,SAAS;EACT,WAAW;EACX;EACA,CAAC,CACF,CACD;AACD,KAAI,CAAC,GAAG,SAAS,CAChB,QAAO,qBAAqB,SAAS,IAAI,YAAY,MAAM,YAAY,IAAI;EAE3E"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { formatCause, formatValue } from "../../substrate/runtime/observability/cascade-formatter.mjs";
|
|
2
|
+
import { exitCodeFor, hintFor, summaryFor } from "./errors.mjs";
|
|
3
|
+
import { failureEnvelope, successEnvelope } from "./envelope.mjs";
|
|
4
|
+
import { Effect } from "effect";
|
|
5
|
+
//#region src/surfaces/cli/output.ts
|
|
6
|
+
/** Default IO bound to the Node process. */
|
|
7
|
+
const nodeProcessIO = {
|
|
8
|
+
writeStdout: (line) => Effect.sync(() => {
|
|
9
|
+
process.stdout.write(line.endsWith("\n") ? line : `${line}\n`);
|
|
10
|
+
}),
|
|
11
|
+
writeStderr: (line) => Effect.sync(() => {
|
|
12
|
+
process.stderr.write(line.endsWith("\n") ? line : `${line}\n`);
|
|
13
|
+
}),
|
|
14
|
+
setExitCode: (code) => Effect.sync(() => {
|
|
15
|
+
process.exitCode = code;
|
|
16
|
+
})
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* `JSON.stringify` strips `undefined` from objects but NOT from
|
|
20
|
+
* arrays (replaces with `null`). The envelope builders already omit
|
|
21
|
+
* absent keys, but we add a guard so a future builder bug doesn't
|
|
22
|
+
* leak `undefined` into automation output.
|
|
23
|
+
*
|
|
24
|
+
* Architecture: "Absent fields are OMITTED from serialized output (no
|
|
25
|
+
* `undefined`)." This function enforces that promise.
|
|
26
|
+
*/
|
|
27
|
+
const serializeEnvelope = (env) => {
|
|
28
|
+
const cleaned = stripUndefined(env);
|
|
29
|
+
return JSON.stringify(cleaned);
|
|
30
|
+
};
|
|
31
|
+
const stripUndefined = (value) => {
|
|
32
|
+
if (value === void 0) return void 0;
|
|
33
|
+
if (value === null) return null;
|
|
34
|
+
if (Array.isArray(value)) return value.map(stripUndefined);
|
|
35
|
+
if (typeof value !== "object") return value;
|
|
36
|
+
const out = {};
|
|
37
|
+
for (const [k, v] of Object.entries(value)) {
|
|
38
|
+
if (v === void 0) continue;
|
|
39
|
+
out[k] = stripUndefined(v);
|
|
40
|
+
}
|
|
41
|
+
return out;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Emit a success envelope OR a human-mode line block. Sets exit code
|
|
45
|
+
* 0 unless a streaming success path supplies its own process code.
|
|
46
|
+
*
|
|
47
|
+
* In JSON mode: one envelope on stdout, nothing on stderr.
|
|
48
|
+
* In human mode: each `humanLines` entry on stdout; hints rendered
|
|
49
|
+
* after; no envelope.
|
|
50
|
+
*/
|
|
51
|
+
const emitSuccess = (io, mode, params) => Effect.gen(function* () {
|
|
52
|
+
if (mode === "json") {
|
|
53
|
+
const env = successEnvelope({
|
|
54
|
+
command: params.command,
|
|
55
|
+
elapsedMs: params.elapsedMs,
|
|
56
|
+
data: params.data,
|
|
57
|
+
hints: params.hints,
|
|
58
|
+
dryRun: params.dryRun
|
|
59
|
+
});
|
|
60
|
+
yield* io.writeStdout(serializeEnvelope(env));
|
|
61
|
+
} else {
|
|
62
|
+
for (const line of params.humanLines ?? []) yield* io.writeStdout(line);
|
|
63
|
+
for (const hint of params.hints ?? []) yield* io.writeStdout(`hint: ${hint}`);
|
|
64
|
+
}
|
|
65
|
+
yield* io.setExitCode(params.exitCode ?? 0);
|
|
66
|
+
});
|
|
67
|
+
/**
|
|
68
|
+
* Emit a failure for a `CliError`. Threads the sysexit code through
|
|
69
|
+
* to `process.exitCode`. Honors the already-reported sentinel.
|
|
70
|
+
*
|
|
71
|
+
* Architecture invariant: "Top-level error rendering must not
|
|
72
|
+
* double-print when a subcommand already rendered." — we still set the
|
|
73
|
+
* exit code but skip the envelope/stderr write.
|
|
74
|
+
*/
|
|
75
|
+
const emitFailure = (io, mode, params) => Effect.gen(function* () {
|
|
76
|
+
const exitCode = exitCodeFor(params.error);
|
|
77
|
+
if (params.error._tag === "CliAlreadyReportedError") {
|
|
78
|
+
yield* io.setExitCode(exitCode);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
yield* renderFailure(io, mode, {
|
|
82
|
+
command: params.command,
|
|
83
|
+
elapsedMs: params.elapsedMs,
|
|
84
|
+
exitCode,
|
|
85
|
+
summary: summaryFor(params.error),
|
|
86
|
+
hint: hintFor(params.error),
|
|
87
|
+
cause: params.cause,
|
|
88
|
+
errorCause: "cause" in params.error ? params.error.cause : void 0,
|
|
89
|
+
dryRun: params.dryRun
|
|
90
|
+
});
|
|
91
|
+
yield* io.setExitCode(exitCode);
|
|
92
|
+
});
|
|
93
|
+
const renderFailure = (io, mode, p) => Effect.gen(function* () {
|
|
94
|
+
const chain = (p.cause !== void 0 ? formatCause(p.cause) : p.errorCause !== void 0 ? formatValue(p.errorCause) : void 0)?.split("\n").filter((l) => l.length > 0);
|
|
95
|
+
if (mode === "json") {
|
|
96
|
+
const fp = {
|
|
97
|
+
command: p.command,
|
|
98
|
+
elapsedMs: p.elapsedMs,
|
|
99
|
+
exitCode: p.exitCode,
|
|
100
|
+
summary: p.summary,
|
|
101
|
+
hint: p.hint,
|
|
102
|
+
chain,
|
|
103
|
+
dryRun: p.dryRun
|
|
104
|
+
};
|
|
105
|
+
yield* io.writeStdout(serializeEnvelope(failureEnvelope(fp)));
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
yield* io.writeStderr(`error: ${p.summary}`);
|
|
109
|
+
if (p.hint !== void 0) yield* io.writeStderr(`hint: ${p.hint}`);
|
|
110
|
+
if (chain !== void 0 && chain.length > 0) for (const line of chain) yield* io.writeStderr(` ${line}`);
|
|
111
|
+
});
|
|
112
|
+
//#endregion
|
|
113
|
+
export { emitFailure, emitSuccess, nodeProcessIO };
|
|
114
|
+
|
|
115
|
+
//# sourceMappingURL=output.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.mjs","names":[],"sources":["../../../src/surfaces/cli/output.ts"],"sourcesContent":["// CLI surface — output rendering (human / JSON envelope / structured\n// pretty error).\n//\n// Architecture (distilled/20-cli.md § Output formats):\n// - JSON envelope on stdout EXACTLY ONCE per command in `--json`\n// mode; stderr never receives the envelope.\n// - Human text on stdout otherwise.\n// - Pretty error tree on stderr only on failure — and only if the\n// subcommand hasn't already rendered (the `CliAlreadyReportedError`\n// sentinel suppresses).\n//\n// This module owns all stdout/stderr writes for the CLI. Subcommands\n// build envelope params; this module serializes and emits.\n\nimport { Effect } from 'effect';\nimport type { Cause } from 'effect';\n\nimport {\n\tformatCause,\n\tformatValue,\n} from '../../substrate/runtime/observability/cascade-formatter.ts';\nimport {\n\ttype Envelope,\n\tfailureEnvelope,\n\ttype FailureParams,\n\ttype StreamingEvent,\n\tsuccessEnvelope,\n\ttype SuccessParams,\n} from './envelope.ts';\nimport {\n\ttype CliError,\n\tCliAlreadyReportedError,\n\texitCodeFor,\n\thintFor,\n\tsummaryFor,\n} from './errors.ts';\nimport type { OutputMode } from './flags.ts';\nimport { type ExitCode } from './sysexits.ts';\n\n// -----------------------------------------------------------------------------\n// I/O service abstraction\n// -----------------------------------------------------------------------------\n\n/** Surface-level IO. Tests substitute a buffered impl. */\nexport interface CliIO {\n\treadonly writeStdout: (line: string) => Effect.Effect<void>;\n\treadonly writeStderr: (line: string) => Effect.Effect<void>;\n\treadonly setExitCode: (code: number) => Effect.Effect<void>;\n}\n\n/** Default IO bound to the Node process. */\nexport const nodeProcessIO: CliIO = {\n\twriteStdout: (line) =>\n\t\tEffect.sync(() => {\n\t\t\tprocess.stdout.write(line.endsWith('\\n') ? line : `${line}\\n`);\n\t\t}),\n\twriteStderr: (line) =>\n\t\tEffect.sync(() => {\n\t\t\tprocess.stderr.write(line.endsWith('\\n') ? line : `${line}\\n`);\n\t\t}),\n\tsetExitCode: (code) =>\n\t\tEffect.sync(() => {\n\t\t\tprocess.exitCode = code;\n\t\t}),\n};\n\n// -----------------------------------------------------------------------------\n// Stable JSON serialization\n// -----------------------------------------------------------------------------\n\n/**\n * `JSON.stringify` strips `undefined` from objects but NOT from\n * arrays (replaces with `null`). The envelope builders already omit\n * absent keys, but we add a guard so a future builder bug doesn't\n * leak `undefined` into automation output.\n *\n * Architecture: \"Absent fields are OMITTED from serialized output (no\n * `undefined`).\" This function enforces that promise.\n */\nexport const serializeEnvelope = (env: Envelope<unknown> | StreamingEvent<unknown>): string => {\n\tconst cleaned = stripUndefined(env);\n\treturn JSON.stringify(cleaned);\n};\n\nconst stripUndefined = (value: unknown): unknown => {\n\tif (value === undefined) return undefined;\n\tif (value === null) return null;\n\tif (Array.isArray(value)) return value.map(stripUndefined);\n\tif (typeof value !== 'object') return value;\n\tconst out: Record<string, unknown> = {};\n\tfor (const [k, v] of Object.entries(value as Record<string, unknown>)) {\n\t\tif (v === undefined) continue;\n\t\tout[k] = stripUndefined(v);\n\t}\n\treturn out;\n};\n\n// -----------------------------------------------------------------------------\n// Success path\n// -----------------------------------------------------------------------------\n\n/**\n * Emit a success envelope OR a human-mode line block. Sets exit code\n * 0 unless a streaming success path supplies its own process code.\n *\n * In JSON mode: one envelope on stdout, nothing on stderr.\n * In human mode: each `humanLines` entry on stdout; hints rendered\n * after; no envelope.\n */\nexport const emitSuccess = <Data>(\n\tio: CliIO,\n\tmode: OutputMode,\n\tparams: SuccessParams<Data> & {\n\t\treadonly humanLines?: ReadonlyArray<string>;\n\t\t/** Override the OS exit code for commands whose transport\n\t\t * succeeded but whose payload carries a process-style status. */\n\t\treadonly exitCode?: number;\n\t},\n): Effect.Effect<void> =>\n\tEffect.gen(function* () {\n\t\tif (mode === 'json') {\n\t\t\tconst env = successEnvelope({\n\t\t\t\tcommand: params.command,\n\t\t\t\telapsedMs: params.elapsedMs,\n\t\t\t\tdata: params.data,\n\t\t\t\thints: params.hints,\n\t\t\t\tdryRun: params.dryRun,\n\t\t\t});\n\t\t\tyield* io.writeStdout(serializeEnvelope(env));\n\t\t} else {\n\t\t\tfor (const line of params.humanLines ?? []) {\n\t\t\t\tyield* io.writeStdout(line);\n\t\t\t}\n\t\t\tfor (const hint of params.hints ?? []) {\n\t\t\t\tyield* io.writeStdout(`hint: ${hint}`);\n\t\t\t}\n\t\t}\n\t\tyield* io.setExitCode(params.exitCode ?? 0);\n\t});\n\n// -----------------------------------------------------------------------------\n// Failure path\n// -----------------------------------------------------------------------------\n\n/**\n * Emit a failure for a `CliError`. Threads the sysexit code through\n * to `process.exitCode`. Honors the already-reported sentinel.\n *\n * Architecture invariant: \"Top-level error rendering must not\n * double-print when a subcommand already rendered.\" — we still set the\n * exit code but skip the envelope/stderr write.\n */\nexport const emitFailure = (\n\tio: CliIO,\n\tmode: OutputMode,\n\tparams: {\n\t\treadonly command: string;\n\t\treadonly elapsedMs: number;\n\t\treadonly error: CliError;\n\t\treadonly cause?: Cause.Cause<unknown>;\n\t\treadonly dryRun?: boolean;\n\t},\n): Effect.Effect<void> =>\n\tEffect.gen(function* () {\n\t\tconst exitCode = exitCodeFor(params.error);\n\t\tif (params.error._tag === 'CliAlreadyReportedError') {\n\t\t\tyield* io.setExitCode(exitCode);\n\t\t\treturn;\n\t\t}\n\t\tyield* renderFailure(io, mode, {\n\t\t\tcommand: params.command,\n\t\t\telapsedMs: params.elapsedMs,\n\t\t\texitCode,\n\t\t\tsummary: summaryFor(params.error),\n\t\t\thint: hintFor(params.error),\n\t\t\tcause: params.cause,\n\t\t\terrorCause:\n\t\t\t\t'cause' in params.error ? (params.error as { readonly cause?: unknown }).cause : undefined,\n\t\t\tdryRun: params.dryRun,\n\t\t});\n\t\tyield* io.setExitCode(exitCode);\n\t});\n\ninterface RenderFailureParams {\n\treadonly command: string;\n\treadonly elapsedMs: number;\n\treadonly exitCode: ExitCode;\n\treadonly summary: string;\n\treadonly hint?: string;\n\treadonly cause?: Cause.Cause<unknown>;\n\treadonly errorCause?: unknown;\n\treadonly dryRun?: boolean;\n}\n\nconst renderFailure = (io: CliIO, mode: OutputMode, p: RenderFailureParams): Effect.Effect<void> =>\n\tEffect.gen(function* () {\n\t\tconst rawChain =\n\t\t\tp.cause !== undefined\n\t\t\t\t? formatCause(p.cause)\n\t\t\t\t: p.errorCause !== undefined\n\t\t\t\t\t? formatValue(p.errorCause)\n\t\t\t\t\t: undefined;\n\t\tconst chain = rawChain?.split('\\n').filter((l) => l.length > 0);\n\n\t\tif (mode === 'json') {\n\t\t\tconst fp: FailureParams = {\n\t\t\t\tcommand: p.command,\n\t\t\t\telapsedMs: p.elapsedMs,\n\t\t\t\texitCode: p.exitCode,\n\t\t\t\tsummary: p.summary,\n\t\t\t\thint: p.hint,\n\t\t\t\tchain,\n\t\t\t\tdryRun: p.dryRun,\n\t\t\t};\n\t\t\tyield* io.writeStdout(serializeEnvelope(failureEnvelope(fp)));\n\t\t\treturn;\n\t\t}\n\n\t\t// Human mode: one-line summary on stderr, then optional hint and\n\t\t// the cascade chain (if present), all on stderr.\n\t\tyield* io.writeStderr(`error: ${p.summary}`);\n\t\tif (p.hint !== undefined) {\n\t\t\tyield* io.writeStderr(`hint: ${p.hint}`);\n\t\t}\n\t\tif (chain !== undefined && chain.length > 0) {\n\t\t\tfor (const line of chain) {\n\t\t\t\tyield* io.writeStderr(` ${line}`);\n\t\t\t}\n\t\t}\n\t});\n\n// -----------------------------------------------------------------------------\n// Already-reported helper\n// -----------------------------------------------------------------------------\n\n/** A subcommand that pretty-renders its own failure (e.g. an\n * interactive picker that already drew an error panel) returns this\n * sentinel so the top-level renderer skips re-rendering but still\n * propagates the right exit code. */\nexport const alreadyReported = (exitCode: ExitCode): CliAlreadyReportedError =>\n\tnew CliAlreadyReportedError({ exitCode });\n"],"mappings":";;;;;;AAmDA,MAAa,gBAAuB;CACnC,cAAc,SACb,OAAO,WAAW;AACjB,UAAQ,OAAO,MAAM,KAAK,SAAS,KAAK,GAAG,OAAO,GAAG,KAAK,IAAI;GAC7D;CACH,cAAc,SACb,OAAO,WAAW;AACjB,UAAQ,OAAO,MAAM,KAAK,SAAS,KAAK,GAAG,OAAO,GAAG,KAAK,IAAI;GAC7D;CACH,cAAc,SACb,OAAO,WAAW;AACjB,UAAQ,WAAW;GAClB;CACH;;;;;;;;;;AAeD,MAAa,qBAAqB,QAA6D;CAC9F,MAAM,UAAU,eAAe,IAAI;AACnC,QAAO,KAAK,UAAU,QAAQ;;AAG/B,MAAM,kBAAkB,UAA4B;AACnD,KAAI,UAAU,KAAA,EAAW,QAAO,KAAA;AAChC,KAAI,UAAU,KAAM,QAAO;AAC3B,KAAI,MAAM,QAAQ,MAAM,CAAE,QAAO,MAAM,IAAI,eAAe;AAC1D,KAAI,OAAO,UAAU,SAAU,QAAO;CACtC,MAAM,MAA+B,EAAE;AACvC,MAAK,MAAM,CAAC,GAAG,MAAM,OAAO,QAAQ,MAAiC,EAAE;AACtE,MAAI,MAAM,KAAA,EAAW;AACrB,MAAI,KAAK,eAAe,EAAE;;AAE3B,QAAO;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