@mysten-incubation/devstack 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -4
- package/dashboard-ui/assets/grpc-a4usE3Nk.js +3 -0
- package/dashboard-ui/assets/index-B82Bh84P.css +1 -0
- package/dashboard-ui/assets/index-CRYJ4pru.js +1277 -0
- package/dashboard-ui/index.html +2 -2
- package/dist/api/define-capabilities.d.mts +1 -20
- package/dist/api/define-capabilities.mjs +15 -22
- package/dist/api/define-capabilities.mjs.map +1 -1
- package/dist/api/define-devstack-with.d.mts +7 -1
- package/dist/api/define-devstack-with.mjs.map +1 -1
- package/dist/api/define-devstack.mjs.map +1 -1
- package/dist/api/define-plugin.d.mts +2 -1
- package/dist/api/inference-network.d.mts +31 -17
- package/dist/api/inference-network.mjs +40 -43
- package/dist/api/inference-network.mjs.map +1 -1
- package/dist/api/load-config.mjs +88 -0
- package/dist/api/load-config.mjs.map +1 -0
- package/dist/api/mode-narrowed-factory.d.mts +1 -1
- package/dist/api/mode-narrowed-factory.mjs.map +1 -1
- package/dist/api/run-stack-internal.mjs +202 -0
- package/dist/api/run-stack-internal.mjs.map +1 -0
- package/dist/api/run-stack.d.mts +82 -31
- package/dist/api/run-stack.mjs +22 -141
- package/dist/api/run-stack.mjs.map +1 -1
- package/dist/build-integrations/dapp-kit/index.d.mts +61 -0
- package/dist/build-integrations/dapp-kit/index.mjs +58 -0
- package/dist/build-integrations/dapp-kit/index.mjs.map +1 -0
- package/dist/build-integrations/playwright/config.d.mts +1 -30
- package/dist/build-integrations/playwright/config.mjs +1 -27
- package/dist/build-integrations/playwright/config.mjs.map +1 -1
- package/dist/build-integrations/playwright/errors.d.mts +4 -7
- package/dist/build-integrations/playwright/errors.mjs.map +1 -1
- package/dist/build-integrations/playwright/global-setup.d.mts +42 -71
- package/dist/build-integrations/playwright/global-setup.mjs +142 -218
- package/dist/build-integrations/playwright/global-setup.mjs.map +1 -1
- package/dist/build-integrations/playwright/index.d.mts +2 -2
- package/dist/build-integrations/playwright/index.mjs +2 -2
- package/dist/build-integrations/playwright/stack-context.d.mts +3 -1
- package/dist/build-integrations/playwright/stack-context.mjs +4 -2
- package/dist/build-integrations/playwright/stack-context.mjs.map +1 -1
- package/dist/build-integrations/playwright/wallet-context.mjs +44 -19
- package/dist/build-integrations/playwright/wallet-context.mjs.map +1 -1
- package/dist/build-integrations/runtime/cold-start-url.mjs.map +1 -1
- package/dist/build-integrations/runtime/conventional-routes.mjs.map +1 -1
- package/dist/build-integrations/runtime/dapp-kit-slot.mjs.map +1 -1
- package/dist/build-integrations/runtime/discover.d.mts +6 -4
- package/dist/build-integrations/runtime/discover.mjs +15 -4
- package/dist/build-integrations/runtime/discover.mjs.map +1 -1
- package/dist/build-integrations/runtime/endpoint-registry.mjs.map +1 -1
- package/dist/build-integrations/runtime/errors.mjs.map +1 -1
- package/dist/build-integrations/runtime/read-stack-context.mjs +3 -3
- package/dist/build-integrations/runtime/read-stack-context.mjs.map +1 -1
- package/dist/build-integrations/runtime/resolve-discovery-env.d.mts +23 -7
- package/dist/build-integrations/runtime/resolve-discovery-env.mjs +25 -12
- package/dist/build-integrations/runtime/resolve-discovery-env.mjs.map +1 -1
- package/dist/build-integrations/runtime/stack-context.d.mts +2 -2
- package/dist/build-integrations/vite/index.d.mts +84 -19
- package/dist/build-integrations/vite/index.mjs +203 -28
- package/dist/build-integrations/vite/index.mjs.map +1 -1
- package/dist/build-integrations/vitest/config.d.mts +20 -2
- package/dist/build-integrations/vitest/config.mjs +16 -4
- package/dist/build-integrations/vitest/config.mjs.map +1 -1
- package/dist/build-integrations/vitest/env.d.mts +18 -10
- package/dist/build-integrations/vitest/env.mjs +11 -10
- package/dist/build-integrations/vitest/env.mjs.map +1 -1
- package/dist/build-integrations/vitest/errors.d.mts +7 -11
- package/dist/build-integrations/vitest/errors.mjs +3 -4
- package/dist/build-integrations/vitest/errors.mjs.map +1 -1
- package/dist/build-integrations/vitest/global-setup.d.mts +35 -0
- package/dist/build-integrations/vitest/global-setup.mjs +156 -0
- package/dist/build-integrations/vitest/global-setup.mjs.map +1 -0
- package/dist/build-integrations/vitest/index.d.mts +3 -2
- package/dist/build-integrations/vitest/index.mjs +3 -2
- package/dist/build-integrations/vitest/setup.mjs +2 -2
- package/dist/build-integrations/vitest/setup.mjs.map +1 -1
- package/dist/build-integrations/vitest/stack-context.d.mts +5 -3
- package/dist/build-integrations/vitest/stack-context.mjs +3 -2
- package/dist/build-integrations/vitest/stack-context.mjs.map +1 -1
- package/dist/cli/bail.mjs.map +1 -1
- package/dist/cli/doctor-probes.mjs +1 -3
- package/dist/cli/doctor-probes.mjs.map +1 -1
- package/dist/cli/main.d.mts +23 -1
- package/dist/cli/main.mjs +63 -8
- package/dist/cli/main.mjs.map +1 -1
- package/dist/cli/prune-direct.mjs.map +1 -1
- package/dist/cli/snapshot-reader.mjs.map +1 -1
- package/dist/cli/up-lifecycle.mjs.map +1 -1
- package/dist/cli/wirings/apply.mjs +28 -21
- package/dist/cli/wirings/apply.mjs.map +1 -1
- package/dist/cli/wirings/codegen.mjs +108 -0
- package/dist/cli/wirings/codegen.mjs.map +1 -0
- package/dist/cli/wirings/config-loader.mjs +12 -62
- package/dist/cli/wirings/config-loader.mjs.map +1 -1
- package/dist/cli/wirings/dump-ids.mjs +86 -0
- package/dist/cli/wirings/dump-ids.mjs.map +1 -0
- package/dist/cli/wirings/engine-command.mjs +1 -1
- package/dist/cli/wirings/engine-command.mjs.map +1 -1
- package/dist/cli/wirings/identity.mjs +2 -2
- package/dist/cli/wirings/identity.mjs.map +1 -1
- package/dist/cli/wirings/provide-file-system.mjs.map +1 -1
- package/dist/cli/wirings/read-devstack-version.mjs +17 -0
- package/dist/cli/wirings/read-devstack-version.mjs.map +1 -0
- package/dist/cli/wirings/snapshot.mjs +27 -34
- package/dist/cli/wirings/snapshot.mjs.map +1 -1
- package/dist/cli/wirings/up-ipc.mjs +147 -0
- package/dist/cli/wirings/up-ipc.mjs.map +1 -0
- package/dist/cli/wirings/up.mjs +218 -198
- package/dist/cli/wirings/up.mjs.map +1 -1
- package/dist/cli/wirings/wipe.mjs +1 -1
- package/dist/cli/wirings/wipe.mjs.map +1 -1
- package/dist/contracts/chain-probe.d.mts +1 -1
- package/dist/contracts/chain-probe.mjs +1 -1
- package/dist/contracts/chain-probe.mjs.map +1 -1
- package/dist/contracts/codegenable.d.mts +60 -6
- package/dist/contracts/codegenable.mjs +28 -0
- package/dist/contracts/codegenable.mjs.map +1 -0
- package/dist/contracts/config-bindings.mjs +162 -0
- package/dist/contracts/config-bindings.mjs.map +1 -0
- package/dist/contracts/container-runtime.d.mts +23 -17
- package/dist/contracts/plugin-expander.mjs.map +1 -1
- package/dist/contracts/snapshotable.d.mts +5 -7
- package/dist/contracts/wallet-protocol.d.mts +2 -5
- package/dist/contracts/wallet-protocol.mjs +2 -5
- package/dist/contracts/wallet-protocol.mjs.map +1 -1
- package/dist/index.d.mts +21 -26
- package/dist/index.mjs +8 -9
- package/dist/orchestrators/boot.d.mts +28 -0
- package/dist/orchestrators/boot.mjs +440 -0
- package/dist/orchestrators/boot.mjs.map +1 -0
- package/dist/orchestrators/codegen/bindings.d.mts +13 -1
- package/dist/orchestrators/codegen/bindings.mjs +23 -9
- package/dist/orchestrators/codegen/bindings.mjs.map +1 -1
- package/dist/orchestrators/codegen/config-runtime.mjs +208 -0
- package/dist/orchestrators/codegen/config-runtime.mjs.map +1 -0
- package/dist/orchestrators/codegen/emit.mjs +1 -1
- package/dist/orchestrators/codegen/emit.mjs.map +1 -1
- package/dist/orchestrators/codegen/errors.mjs +21 -1
- package/dist/orchestrators/codegen/errors.mjs.map +1 -1
- package/dist/orchestrators/codegen/format.mjs +2 -0
- package/dist/orchestrators/codegen/format.mjs.map +1 -1
- package/dist/orchestrators/codegen/gitignore.mjs +30 -11
- package/dist/orchestrators/codegen/gitignore.mjs.map +1 -1
- package/dist/orchestrators/codegen/id-config.mjs +107 -0
- package/dist/orchestrators/codegen/id-config.mjs.map +1 -0
- package/dist/orchestrators/codegen/output-location.mjs +23 -31
- package/dist/orchestrators/codegen/output-location.mjs.map +1 -1
- package/dist/orchestrators/codegen/paths.mjs +8 -1
- package/dist/orchestrators/codegen/paths.mjs.map +1 -1
- package/dist/orchestrators/codegen/permissions.mjs.map +1 -1
- package/dist/orchestrators/codegen/service.mjs +286 -58
- package/dist/orchestrators/codegen/service.mjs.map +1 -1
- package/dist/orchestrators/layers.mjs +31 -0
- package/dist/orchestrators/layers.mjs.map +1 -0
- package/dist/orchestrators/lifecycle-prune/errors.mjs.map +1 -1
- package/dist/orchestrators/lifecycle-prune/index.mjs +8 -10
- package/dist/orchestrators/lifecycle-prune/index.mjs.map +1 -1
- package/dist/orchestrators/network-options.d.mts +52 -0
- package/dist/orchestrators/network-options.mjs +43 -0
- package/dist/orchestrators/network-options.mjs.map +1 -0
- package/dist/orchestrators/router/cleanup.mjs.map +1 -1
- package/dist/orchestrators/router/cors.mjs.map +1 -1
- package/dist/orchestrators/router/entrypoints.mjs.map +1 -1
- package/dist/orchestrators/router/errors.mjs.map +1 -1
- package/dist/orchestrators/router/file-provider.mjs.map +1 -1
- package/dist/orchestrators/router/hostname.mjs.map +1 -1
- package/dist/orchestrators/router/profile.mjs +1 -1
- package/dist/orchestrators/router/profile.mjs.map +1 -1
- package/dist/orchestrators/router/service.d.mts +2 -2
- package/dist/orchestrators/router/service.mjs +12 -27
- package/dist/orchestrators/router/service.mjs.map +1 -1
- package/dist/orchestrators/router/traefik-container.mjs +1 -1
- package/dist/orchestrators/router/traefik-container.mjs.map +1 -1
- package/dist/orchestrators/snapshot/capture.mjs +171 -195
- package/dist/orchestrators/snapshot/capture.mjs.map +1 -1
- package/dist/orchestrators/snapshot/descriptor.d.mts +1 -1
- package/dist/orchestrators/snapshot/descriptor.mjs +53 -11
- package/dist/orchestrators/snapshot/descriptor.mjs.map +1 -1
- package/dist/orchestrators/snapshot/identity-guard.mjs +3 -5
- package/dist/orchestrators/snapshot/identity-guard.mjs.map +1 -1
- package/dist/orchestrators/snapshot/image-bundle-tags.mjs +32 -101
- package/dist/orchestrators/snapshot/image-bundle-tags.mjs.map +1 -1
- package/dist/orchestrators/snapshot/index.mjs +1 -4
- package/dist/orchestrators/snapshot/integrity.mjs.map +1 -1
- package/dist/orchestrators/snapshot/interrupted-restore.mjs +116 -0
- package/dist/orchestrators/snapshot/interrupted-restore.mjs.map +1 -0
- package/dist/orchestrators/snapshot/phase-error.mjs.map +1 -1
- package/dist/orchestrators/snapshot/prune.mjs +40 -31
- package/dist/orchestrators/snapshot/prune.mjs.map +1 -1
- package/dist/orchestrators/snapshot/restore.mjs +221 -196
- package/dist/orchestrators/snapshot/restore.mjs.map +1 -1
- package/dist/orchestrators/snapshot/service.mjs +72 -62
- package/dist/orchestrators/snapshot/service.mjs.map +1 -1
- package/dist/orchestrators/snapshot/wipe.mjs +67 -56
- package/dist/orchestrators/snapshot/wipe.mjs.map +1 -1
- package/dist/plugins/account/codegen.mjs +3 -0
- package/dist/plugins/account/codegen.mjs.map +1 -1
- package/dist/plugins/account/errors.d.mts +2 -2
- package/dist/plugins/account/errors.mjs +1 -4
- package/dist/plugins/account/errors.mjs.map +1 -1
- package/dist/plugins/account/funding.mjs +3 -27
- package/dist/plugins/account/funding.mjs.map +1 -1
- package/dist/plugins/account/index.d.mts +3 -8
- package/dist/plugins/account/index.mjs +71 -35
- package/dist/plugins/account/index.mjs.map +1 -1
- package/dist/plugins/account/keypair.d.mts +8 -7
- package/dist/plugins/account/keypair.mjs +5 -18
- package/dist/plugins/account/keypair.mjs.map +1 -1
- package/dist/plugins/account/lease.mjs.map +1 -1
- package/dist/plugins/account/registry.d.mts +1 -46
- package/dist/plugins/account/registry.mjs.map +1 -1
- package/dist/plugins/account/service.d.mts +43 -34
- package/dist/plugins/account/service.mjs +9 -54
- package/dist/plugins/account/service.mjs.map +1 -1
- package/dist/plugins/account/snapshot.mjs.map +1 -1
- package/dist/plugins/account/variants/ephemeral.mjs.map +1 -1
- package/dist/plugins/account/variants/impersonate.mjs.map +1 -1
- package/dist/plugins/account/variants/signer.mjs.map +1 -1
- package/dist/plugins/action/discriminator.mjs.map +1 -1
- package/dist/plugins/action/errors.mjs +1 -4
- package/dist/plugins/action/errors.mjs.map +1 -1
- package/dist/plugins/action/execute.mjs +3 -4
- package/dist/plugins/action/execute.mjs.map +1 -1
- package/dist/plugins/action/index.d.mts +2 -2
- package/dist/plugins/action/index.mjs +7 -11
- package/dist/plugins/action/index.mjs.map +1 -1
- package/dist/plugins/action/service.d.mts +5 -7
- package/dist/plugins/action/service.mjs +2 -16
- package/dist/plugins/action/service.mjs.map +1 -1
- package/dist/plugins/coin/address-resolution.mjs.map +1 -1
- package/dist/plugins/coin/codegen.mjs +97 -16
- package/dist/plugins/coin/codegen.mjs.map +1 -1
- package/dist/plugins/coin/discovery.mjs.map +1 -1
- package/dist/plugins/coin/errors.mjs +1 -4
- package/dist/plugins/coin/errors.mjs.map +1 -1
- package/dist/plugins/coin/index.d.mts +4 -34
- package/dist/plugins/coin/index.mjs +47 -28
- package/dist/plugins/coin/index.mjs.map +1 -1
- package/dist/plugins/coin/metadata.d.mts +1 -0
- package/dist/plugins/coin/metadata.mjs +8 -9
- package/dist/plugins/coin/metadata.mjs.map +1 -1
- package/dist/plugins/coin/mint.mjs +7 -21
- package/dist/plugins/coin/mint.mjs.map +1 -1
- package/dist/plugins/coin/registry.mjs +33 -20
- package/dist/plugins/coin/registry.mjs.map +1 -1
- package/dist/plugins/coin/service.d.mts +1 -1
- package/dist/plugins/coin/service.mjs +1 -8
- package/dist/plugins/coin/service.mjs.map +1 -1
- package/dist/plugins/coin/snapshot.mjs.map +1 -1
- package/dist/plugins/coin/type-strings.mjs.map +1 -1
- package/dist/plugins/dashboard/domain.mjs +106 -167
- package/dist/plugins/dashboard/domain.mjs.map +1 -1
- package/dist/plugins/dashboard/index.mjs +13 -13
- package/dist/plugins/dashboard/index.mjs.map +1 -1
- package/dist/plugins/dashboard/origin-policy.mjs +3 -3
- package/dist/plugins/dashboard/origin-policy.mjs.map +1 -1
- package/dist/plugins/dashboard/routable.mjs.map +1 -1
- package/dist/plugins/dashboard/schema/builder.mjs.map +1 -1
- package/dist/plugins/dashboard/schema/enums.mjs.map +1 -1
- package/dist/plugins/dashboard/schema/root.mjs +23 -44
- package/dist/plugins/dashboard/schema/root.mjs.map +1 -1
- package/dist/plugins/dashboard/schema/types.mjs +37 -91
- package/dist/plugins/dashboard/schema/types.mjs.map +1 -1
- package/dist/plugins/dashboard/schema.mjs.map +1 -1
- package/dist/plugins/dashboard/server.mjs.map +1 -1
- package/dist/plugins/deepbook/codegen.d.mts +12 -11
- package/dist/plugins/deepbook/codegen.mjs +108 -11
- package/dist/plugins/deepbook/codegen.mjs.map +1 -1
- package/dist/plugins/deepbook/deploy.mjs +7 -14
- package/dist/plugins/deepbook/deploy.mjs.map +1 -1
- package/dist/plugins/deepbook/errors.mjs +4 -2
- package/dist/plugins/deepbook/errors.mjs.map +1 -1
- package/dist/plugins/deepbook/faucet-strategy.mjs +4 -10
- package/dist/plugins/deepbook/faucet-strategy.mjs.map +1 -1
- package/dist/plugins/deepbook/hash.mjs.map +1 -1
- package/dist/plugins/deepbook/index.d.mts +38 -34
- package/dist/plugins/deepbook/index.mjs +133 -64
- package/dist/plugins/deepbook/index.mjs.map +1 -1
- package/dist/plugins/deepbook/plugin-key.mjs.map +1 -1
- package/dist/plugins/deepbook/pyth/index.mjs +4 -8
- package/dist/plugins/deepbook/pyth/index.mjs.map +1 -1
- package/dist/plugins/deepbook/snapshot.mjs +0 -1
- package/dist/plugins/deepbook/snapshot.mjs.map +1 -1
- package/dist/plugins/deepbook/type-strings.mjs.map +1 -1
- package/dist/plugins/deepbook/types.d.mts +2 -1
- package/dist/plugins/deepbook/types.mjs.map +1 -1
- package/dist/plugins/faucet/dispatcher.d.mts +3 -3
- package/dist/plugins/faucet/dispatcher.mjs.map +1 -1
- package/dist/plugins/faucet/errors.mjs.map +1 -1
- package/dist/plugins/faucet/http.mjs +2 -10
- package/dist/plugins/faucet/http.mjs.map +1 -1
- package/dist/plugins/faucet/index.mjs +0 -1
- package/dist/plugins/faucet/index.mjs.map +1 -1
- package/dist/plugins/host-service/errors.d.mts +1 -3
- package/dist/plugins/host-service/errors.mjs +1 -2
- package/dist/plugins/host-service/errors.mjs.map +1 -1
- package/dist/plugins/host-service/index.d.mts +1 -2
- package/dist/plugins/host-service/index.mjs +11 -11
- package/dist/plugins/host-service/index.mjs.map +1 -1
- package/dist/plugins/host-service/routable.mjs.map +1 -1
- package/dist/plugins/host-service/service.mjs +13 -13
- package/dist/plugins/host-service/service.mjs.map +1 -1
- package/dist/plugins/internal/acquire-on-chain-artifact.mjs.map +1 -1
- package/dist/plugins/internal/codegen-helpers.mjs +2 -0
- package/dist/plugins/internal/codegen-helpers.mjs.map +1 -1
- package/dist/plugins/internal/funding-failure-error.mjs.map +1 -1
- package/dist/plugins/{postgres → internal/postgres-sidecar}/connection.mjs +1 -1
- package/dist/plugins/internal/postgres-sidecar/connection.mjs.map +1 -0
- package/dist/plugins/{postgres → internal/postgres-sidecar}/db-ensure.mjs +30 -16
- package/dist/plugins/internal/postgres-sidecar/db-ensure.mjs.map +1 -0
- package/dist/plugins/internal/postgres-sidecar/errors.mjs +21 -0
- package/dist/plugins/internal/postgres-sidecar/errors.mjs.map +1 -0
- package/dist/{substrate/runtime/scoped-multimap → plugins/internal/postgres-sidecar}/index.mjs +1 -0
- package/dist/plugins/internal/postgres-sidecar/service.mjs +121 -0
- package/dist/plugins/internal/postgres-sidecar/service.mjs.map +1 -0
- package/dist/plugins/package/build.mjs +2 -2
- package/dist/plugins/package/build.mjs.map +1 -1
- package/dist/plugins/package/codegen.d.mts +7 -14
- package/dist/plugins/package/codegen.mjs +187 -59
- package/dist/plugins/package/codegen.mjs.map +1 -1
- package/dist/plugins/package/dep-resolution.mjs +51 -3
- package/dist/plugins/package/dep-resolution.mjs.map +1 -1
- package/dist/plugins/package/errors.mjs +1 -4
- package/dist/plugins/package/errors.mjs.map +1 -1
- package/dist/plugins/package/git-source.d.mts +18 -0
- package/dist/plugins/package/git-source.mjs +119 -0
- package/dist/plugins/package/git-source.mjs.map +1 -0
- package/dist/plugins/package/index.d.mts +28 -19
- package/dist/plugins/package/index.mjs +107 -32
- package/dist/plugins/package/index.mjs.map +1 -1
- package/dist/plugins/package/mode-known.mjs +2 -2
- package/dist/plugins/package/mode-known.mjs.map +1 -1
- package/dist/plugins/package/mode-local.mjs +18 -35
- package/dist/plugins/package/mode-local.mjs.map +1 -1
- package/dist/plugins/package/publish-executor.mjs +13 -8
- package/dist/plugins/package/publish-executor.mjs.map +1 -1
- package/dist/plugins/package/publish-output.d.mts +1 -11
- package/dist/plugins/package/publish-output.mjs +1 -9
- package/dist/plugins/package/publish-output.mjs.map +1 -1
- package/dist/plugins/package/registry.d.mts +1 -1
- package/dist/plugins/package/registry.mjs +26 -14
- package/dist/plugins/package/registry.mjs.map +1 -1
- package/dist/plugins/package/service.mjs.map +1 -1
- package/dist/plugins/package/snapshot.mjs.map +1 -1
- package/dist/plugins/router-entrypoints.mjs +1 -3
- package/dist/plugins/router-entrypoints.mjs.map +1 -1
- package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs +1 -2
- package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs.map +1 -1
- package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs +1 -6
- package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs.map +1 -1
- package/dist/plugins/seal/codegen.d.mts +1 -5
- package/dist/plugins/seal/codegen.mjs +83 -12
- package/dist/plugins/seal/codegen.mjs.map +1 -1
- package/dist/plugins/seal/config-render.mjs +2 -6
- package/dist/plugins/seal/config-render.mjs.map +1 -1
- package/dist/plugins/seal/deploy.mjs +18 -29
- package/dist/plugins/seal/deploy.mjs.map +1 -1
- package/dist/plugins/seal/errors.d.mts +4 -5
- package/dist/plugins/seal/errors.mjs +1 -8
- package/dist/plugins/seal/errors.mjs.map +1 -1
- package/dist/plugins/seal/index.d.mts +7 -28
- package/dist/plugins/seal/index.mjs +69 -47
- package/dist/plugins/seal/index.mjs.map +1 -1
- package/dist/plugins/seal/key-manager.mjs.map +1 -1
- package/dist/plugins/seal/key-server.mjs +1 -6
- package/dist/plugins/seal/key-server.mjs.map +1 -1
- package/dist/plugins/seal/keygen.mjs +2 -3
- package/dist/plugins/seal/keygen.mjs.map +1 -1
- package/dist/plugins/seal/mode/fork-known.mjs.map +1 -1
- package/dist/plugins/seal/mode/live.mjs +1 -1
- package/dist/plugins/seal/mode/live.mjs.map +1 -1
- package/dist/plugins/seal/mode/local-keygen.mjs +4 -10
- package/dist/plugins/seal/mode/local-keygen.mjs.map +1 -1
- package/dist/plugins/seal/plugin-key.mjs.map +1 -1
- package/dist/plugins/seal/registry-publish.mjs.map +1 -1
- package/dist/plugins/seal/routable.mjs.map +1 -1
- package/dist/plugins/seal/service.mjs.map +1 -1
- package/dist/plugins/seal/snapshot.mjs +1 -2
- package/dist/plugins/seal/snapshot.mjs.map +1 -1
- package/dist/plugins/sui/auto-tick.mjs +5 -5
- package/dist/plugins/sui/auto-tick.mjs.map +1 -1
- package/dist/plugins/sui/chain-build-container.mjs +2 -2
- package/dist/plugins/sui/chain-build-container.mjs.map +1 -1
- package/dist/plugins/sui/chain-probe.mjs +4 -4
- package/dist/plugins/sui/chain-probe.mjs.map +1 -1
- package/dist/plugins/sui/codegen.d.mts +9 -7
- package/dist/plugins/sui/codegen.mjs +49 -46
- package/dist/plugins/sui/codegen.mjs.map +1 -1
- package/dist/plugins/sui/errors.d.mts +1 -1
- package/dist/plugins/sui/errors.mjs +1 -9
- package/dist/plugins/sui/errors.mjs.map +1 -1
- package/dist/{substrate/runtime/sui-execute → plugins/sui/exec}/index.d.mts +1 -1
- package/dist/{substrate/runtime/sui-execute → plugins/sui/exec}/index.mjs +3 -7
- package/dist/plugins/sui/exec/index.mjs.map +1 -0
- package/dist/{substrate/runtime/sui-execute → plugins/sui/exec}/sign-and-dispatch.mjs +1 -1
- package/dist/plugins/sui/exec/sign-and-dispatch.mjs.map +1 -0
- package/dist/plugins/sui/fork-faucet-strategy.mjs +2 -6
- package/dist/plugins/sui/fork-faucet-strategy.mjs.map +1 -1
- package/dist/plugins/sui/fork-orchestration.mjs +13 -23
- package/dist/plugins/sui/fork-orchestration.mjs.map +1 -1
- package/dist/plugins/sui/fork-transaction.mjs.map +1 -1
- package/dist/plugins/sui/index.d.mts +34 -83
- package/dist/plugins/sui/index.mjs +200 -68
- package/dist/plugins/sui/index.mjs.map +1 -1
- package/dist/{substrate/runtime/sui-ledger → plugins/sui/ledger}/object-ref.mjs +1 -1
- package/dist/plugins/sui/ledger/object-ref.mjs.map +1 -0
- package/dist/plugins/sui/local-faucet-strategy.mjs +1 -5
- package/dist/plugins/sui/local-faucet-strategy.mjs.map +1 -1
- package/dist/plugins/sui/log-attrs.mjs +11 -0
- package/dist/plugins/sui/log-attrs.mjs.map +1 -0
- package/dist/plugins/sui/mode/external.mjs +4 -12
- package/dist/plugins/sui/mode/external.mjs.map +1 -1
- package/dist/plugins/sui/mode/fork.mjs +19 -16
- package/dist/plugins/sui/mode/fork.mjs.map +1 -1
- package/dist/plugins/sui/mode/live.mjs +4 -17
- package/dist/plugins/sui/mode/live.mjs.map +1 -1
- package/dist/plugins/sui/mode/local.d.mts +1 -0
- package/dist/plugins/sui/mode/local.mjs +203 -61
- package/dist/plugins/sui/mode/local.mjs.map +1 -1
- package/dist/plugins/sui/mode/shared-boot.mjs +18 -23
- package/dist/plugins/sui/mode/shared-boot.mjs.map +1 -1
- package/dist/plugins/sui/mode/shared.d.mts +6 -7
- package/dist/plugins/sui/mode/shared.mjs.map +1 -1
- package/dist/plugins/sui/mode/spec.d.mts +23 -6
- package/dist/{substrate/runtime/sui-move-build → plugins/sui/move}/index.mjs +28 -30
- package/dist/plugins/sui/move/index.mjs.map +1 -0
- package/dist/plugins/sui/move-summary-runner.mjs +8 -4
- package/dist/plugins/sui/move-summary-runner.mjs.map +1 -1
- package/dist/{substrate/network.d.mts → plugins/sui/network-config.d.mts} +11 -10
- package/dist/plugins/sui/network-resolver.d.mts +6 -6
- package/dist/plugins/sui/routable.mjs.map +1 -1
- package/dist/plugins/sui/service.mjs +10 -6
- package/dist/plugins/sui/service.mjs.map +1 -1
- package/dist/plugins/sui/snapshot.mjs +10 -5
- package/dist/plugins/sui/snapshot.mjs.map +1 -1
- package/dist/plugins/wallet/codegen.d.mts +8 -6
- package/dist/plugins/wallet/codegen.mjs +4 -10
- package/dist/plugins/wallet/codegen.mjs.map +1 -1
- package/dist/plugins/wallet/errors.mjs +1 -4
- package/dist/plugins/wallet/errors.mjs.map +1 -1
- package/dist/plugins/wallet/index.d.mts +3 -6
- package/dist/plugins/wallet/index.mjs +16 -21
- package/dist/plugins/wallet/index.mjs.map +1 -1
- package/dist/plugins/wallet/origin-policy.mjs +3 -3
- package/dist/plugins/wallet/origin-policy.mjs.map +1 -1
- package/dist/plugins/wallet/pairing.mjs +6 -24
- package/dist/plugins/wallet/pairing.mjs.map +1 -1
- package/dist/plugins/wallet/protocol.mjs.map +1 -1
- package/dist/plugins/wallet/routable.mjs.map +1 -1
- package/dist/plugins/wallet/server.mjs +17 -24
- package/dist/plugins/wallet/server.mjs.map +1 -1
- package/dist/plugins/wallet/service.d.mts +2 -2
- package/dist/plugins/wallet/service.mjs +4 -15
- package/dist/plugins/wallet/service.mjs.map +1 -1
- package/dist/plugins/wallet/snapshot.mjs.map +1 -1
- package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs +1 -5
- package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs.map +1 -1
- package/dist/plugins/walrus/codegen.d.mts +2 -13
- package/dist/plugins/walrus/codegen.mjs +93 -28
- package/dist/plugins/walrus/codegen.mjs.map +1 -1
- package/dist/plugins/walrus/deploy-paths.mjs +2 -3
- package/dist/plugins/walrus/deploy-paths.mjs.map +1 -1
- package/dist/plugins/walrus/deploy.mjs +26 -19
- package/dist/plugins/walrus/deploy.mjs.map +1 -1
- package/dist/plugins/walrus/errors.mjs +1 -8
- package/dist/plugins/walrus/errors.mjs.map +1 -1
- package/dist/plugins/walrus/faucet-strategy.mjs +15 -1
- package/dist/plugins/walrus/faucet-strategy.mjs.map +1 -1
- package/dist/plugins/walrus/index.d.mts +13 -44
- package/dist/plugins/walrus/index.mjs +119 -122
- package/dist/plugins/walrus/index.mjs.map +1 -1
- package/dist/plugins/walrus/mode/known-deploy.mjs +6 -6
- package/dist/plugins/walrus/mode/known-deploy.mjs.map +1 -1
- package/dist/plugins/walrus/mode/local-cluster.d.mts +2 -2
- package/dist/plugins/walrus/mode/local-cluster.mjs +2 -10
- package/dist/plugins/walrus/mode/local-cluster.mjs.map +1 -1
- package/dist/plugins/walrus/plugin-key.mjs.map +1 -1
- package/dist/plugins/walrus/registry-publish.mjs.map +1 -1
- package/dist/plugins/walrus/routable.mjs.map +1 -1
- package/dist/plugins/walrus/service.mjs.map +1 -1
- package/dist/plugins/walrus/snapshot.mjs +3 -3
- package/dist/plugins/walrus/snapshot.mjs.map +1 -1
- package/dist/plugins/walrus/storage-nodes.mjs +53 -14
- package/dist/plugins/walrus/storage-nodes.mjs.map +1 -1
- package/dist/plugins/walrus/wal-swap.mjs +4 -8
- package/dist/plugins/walrus/wal-swap.mjs.map +1 -1
- package/dist/primitives/artifact-publisher.mjs.map +1 -1
- package/dist/primitives/cache.d.mts +1 -1
- package/dist/runtime/docker/client.mjs +47 -3
- package/dist/runtime/docker/client.mjs.map +1 -1
- package/dist/runtime/docker/container.mjs +37 -57
- package/dist/runtime/docker/container.mjs.map +1 -1
- package/dist/runtime/docker/errors.mjs.map +1 -1
- package/dist/runtime/docker/exec.mjs +2 -2
- package/dist/runtime/docker/exec.mjs.map +1 -1
- package/dist/runtime/docker/image.mjs +10 -11
- package/dist/runtime/docker/image.mjs.map +1 -1
- package/dist/runtime/docker/index.mjs +0 -1
- package/dist/runtime/docker/inspect-and-decode.mjs.map +1 -1
- package/dist/runtime/docker/inventory.mjs +9 -9
- package/dist/runtime/docker/inventory.mjs.map +1 -1
- package/dist/runtime/docker/labels.mjs +12 -1
- package/dist/runtime/docker/labels.mjs.map +1 -1
- package/dist/runtime/docker/network.mjs +6 -6
- package/dist/runtime/docker/network.mjs.map +1 -1
- package/dist/runtime/docker/render-run-args.mjs.map +1 -1
- package/dist/runtime/docker/service.mjs +31 -45
- package/dist/runtime/docker/service.mjs.map +1 -1
- package/dist/runtime/docker/sweep.mjs +14 -64
- package/dist/runtime/docker/sweep.mjs.map +1 -1
- package/dist/runtime/docker/volume.mjs +1 -1
- package/dist/runtime/docker/volume.mjs.map +1 -1
- package/dist/runtime/docker/wrap.mjs +14 -2
- package/dist/runtime/docker/wrap.mjs.map +1 -1
- package/dist/substrate/brand.d.mts +2 -5
- package/dist/substrate/brand.mjs +3 -2
- package/dist/substrate/brand.mjs.map +1 -1
- package/dist/substrate/cross-process.mjs +2 -16
- package/dist/substrate/cross-process.mjs.map +1 -1
- package/dist/substrate/event-time.mjs +0 -2
- package/dist/substrate/event-time.mjs.map +1 -1
- package/dist/substrate/events.d.mts +46 -16
- package/dist/substrate/identity.d.mts +11 -5
- package/dist/substrate/manifest.d.mts +33 -26
- package/dist/substrate/manifest.mjs +8 -3
- package/dist/substrate/manifest.mjs.map +1 -1
- package/dist/substrate/options.d.mts +33 -4
- package/dist/substrate/plugin-ctx.d.mts +70 -0
- package/dist/substrate/plugin-ctx.mjs +66 -0
- package/dist/substrate/plugin-ctx.mjs.map +1 -0
- package/dist/substrate/plugin.d.mts +46 -38
- package/dist/substrate/plugin.mjs +13 -9
- package/dist/substrate/plugin.mjs.map +1 -1
- package/dist/substrate/projection.d.mts +1 -1
- package/dist/substrate/runtime/atomic-write.mjs +3 -4
- package/dist/substrate/runtime/atomic-write.mjs.map +1 -1
- package/dist/substrate/runtime/cache/schema.mjs.map +1 -1
- package/dist/substrate/runtime/cache/service.mjs +50 -20
- package/dist/substrate/runtime/cache/service.mjs.map +1 -1
- package/dist/substrate/runtime/config-validation.mjs.map +1 -1
- package/dist/substrate/runtime/control-plane/domain.mjs +34 -12
- package/dist/substrate/runtime/control-plane/domain.mjs.map +1 -1
- package/dist/substrate/runtime/control-plane/service.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/command-channel/channel.mjs +14 -17
- package/dist/substrate/runtime/cross-process/command-channel/channel.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/command-channel/file-channel.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/command-channel/protocol.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/command-channel/runtime-control-lock.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/index.mjs +0 -2
- package/dist/substrate/runtime/cross-process/live-clock.mjs +1 -1
- package/dist/substrate/runtime/cross-process/live-clock.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/liveness.mjs +11 -18
- package/dist/substrate/runtime/cross-process/liveness.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/reclaim-stale-file.mjs +2 -2
- package/dist/substrate/runtime/cross-process/reclaim-stale-file.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/roster.mjs +17 -127
- package/dist/substrate/runtime/cross-process/roster.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/self-pid.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/stack-lock.mjs +29 -28
- package/dist/substrate/runtime/cross-process/stack-lock.mjs.map +1 -1
- package/dist/substrate/runtime/current-plugin.mjs.map +1 -1
- package/dist/substrate/runtime/errors.mjs +1 -13
- package/dist/substrate/runtime/errors.mjs.map +1 -1
- package/dist/substrate/runtime/format-unknown-error.mjs.map +1 -1
- package/dist/substrate/runtime/host-bind-mount-owner.mjs.map +1 -1
- package/dist/substrate/runtime/host-gateway.mjs.map +1 -1
- package/dist/substrate/runtime/host-tree-tar/index.mjs +15 -163
- package/dist/substrate/runtime/host-tree-tar/index.mjs.map +1 -1
- package/dist/substrate/runtime/http-probe.d.mts +1 -3
- package/dist/substrate/runtime/http-probe.mjs.map +1 -1
- package/dist/substrate/runtime/index.mjs +1 -6
- package/dist/substrate/runtime/lease-broker/service.mjs +5 -23
- package/dist/substrate/runtime/lease-broker/service.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/dep-graph.mjs +3 -3
- package/dist/substrate/runtime/lifecycle/dep-graph.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/graph-input-id.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/graph-input-id.mjs +133 -0
- package/dist/substrate/runtime/lifecycle/graph-input-id.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/index.mjs +2 -2
- package/dist/substrate/runtime/lifecycle/plugin-registry.d.mts +1 -1
- package/dist/substrate/runtime/lifecycle/plugin-registry.mjs +22 -1
- package/dist/substrate/runtime/lifecycle/plugin-registry.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/ready-gate.mjs +2 -15
- package/dist/substrate/runtime/lifecycle/ready-gate.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/selective-restart.mjs +29 -25
- package/dist/substrate/runtime/lifecycle/selective-restart.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/signals.mjs +1 -1
- package/dist/substrate/runtime/lifecycle/signals.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/state-machine.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/watch-attribution.d.mts +1 -1
- package/dist/substrate/runtime/lifecycle/watch-attribution.mjs +0 -1
- package/dist/substrate/runtime/lifecycle/watch-attribution.mjs.map +1 -1
- package/dist/substrate/runtime/managed-container.d.mts +5 -1
- package/dist/substrate/runtime/managed-container.mjs +8 -10
- package/dist/substrate/runtime/managed-container.mjs.map +1 -1
- package/dist/substrate/runtime/manifest/manifest.mjs +8 -30
- package/dist/substrate/runtime/manifest/manifest.mjs.map +1 -1
- package/dist/substrate/runtime/mode-errors.d.mts +1 -2
- package/dist/substrate/runtime/mode-errors.mjs.map +1 -1
- package/dist/substrate/runtime/observability/cascade-formatter.mjs +1 -11
- package/dist/substrate/runtime/observability/cascade-formatter.mjs.map +1 -1
- package/dist/substrate/runtime/observability/ignore-with-log.mjs.map +1 -1
- package/dist/substrate/runtime/observability/index.d.mts +1 -1
- package/dist/substrate/runtime/observability/index.mjs +4 -6
- package/dist/substrate/runtime/observability/log-attrs.mjs +46 -0
- package/dist/substrate/runtime/observability/log-attrs.mjs.map +1 -0
- package/dist/substrate/runtime/observability/log-store.mjs.map +1 -1
- package/dist/substrate/runtime/observability/logger.mjs +3 -3
- package/dist/substrate/runtime/observability/logger.mjs.map +1 -1
- package/dist/substrate/runtime/observability/output-truncate.mjs.map +1 -1
- package/dist/substrate/runtime/observability/pretty-error.mjs.map +1 -1
- package/dist/substrate/runtime/observability/process-lines.mjs.map +1 -1
- package/dist/substrate/runtime/observability/redaction.mjs.map +1 -1
- package/dist/substrate/runtime/observability/subprocess-capture.mjs +2 -2
- package/dist/substrate/runtime/observability/subprocess-capture.mjs.map +1 -1
- package/dist/substrate/runtime/passthrough-or-wrap.mjs.map +1 -1
- package/dist/substrate/runtime/paths.mjs +27 -9
- package/dist/substrate/runtime/paths.mjs.map +1 -1
- package/dist/substrate/runtime/phase-preserving-produce.mjs.map +1 -1
- package/dist/substrate/runtime/port-broker/service.mjs +10 -27
- package/dist/substrate/runtime/port-broker/service.mjs.map +1 -1
- package/dist/substrate/runtime/post-acquire-tasks.mjs.map +1 -1
- package/dist/substrate/runtime/probes.d.mts +2 -3
- package/dist/substrate/runtime/probes.mjs.map +1 -1
- package/dist/substrate/runtime/process-supervisor.mjs.map +1 -1
- package/dist/substrate/runtime/projection/operational-endpoints.mjs.map +1 -1
- package/dist/substrate/runtime/projection/state-ref.mjs.map +1 -1
- package/dist/substrate/runtime/projection/update.mjs +87 -11
- package/dist/substrate/runtime/projection/update.mjs.map +1 -1
- package/dist/substrate/runtime/random-suffix.mjs.map +1 -1
- package/dist/substrate/runtime/reconcile/fs-plan.mjs +146 -0
- package/dist/substrate/runtime/reconcile/fs-plan.mjs.map +1 -0
- package/dist/substrate/runtime/reconcile/graph.mjs +19 -0
- package/dist/substrate/runtime/reconcile/graph.mjs.map +1 -0
- package/dist/substrate/runtime/reconcile/index.mjs +5 -0
- package/dist/substrate/runtime/reconcile/label.mjs +41 -0
- package/dist/substrate/runtime/reconcile/label.mjs.map +1 -0
- package/dist/substrate/runtime/reconcile/spec.mjs +15 -0
- package/dist/substrate/runtime/reconcile/spec.mjs.map +1 -0
- package/dist/substrate/runtime/retry-policy.d.mts +2 -3
- package/dist/substrate/runtime/retry-policy.mjs.map +1 -1
- package/dist/substrate/runtime/routed-url.mjs.map +1 -1
- package/dist/substrate/runtime/runtime-decode.mjs.map +1 -1
- package/dist/substrate/runtime/scoped-http-server.mjs.map +1 -1
- package/dist/substrate/runtime/stage-and-swap/index.mjs +49 -12
- package/dist/substrate/runtime/stage-and-swap/index.mjs.map +1 -1
- package/dist/substrate/runtime/strategy-registry/chain-keyed-strategy-for.mjs.map +1 -1
- package/dist/substrate/runtime/strategy-registry/chain-probe-for.mjs.map +1 -1
- package/dist/substrate/runtime/strategy-registry/service.mjs +29 -17
- package/dist/substrate/runtime/strategy-registry/service.mjs.map +1 -1
- package/dist/substrate/runtime/subnet-broker.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/acquire-node.mjs +188 -56
- package/dist/substrate/runtime/supervisor/acquire-node.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/background-tasks.mjs +79 -65
- package/dist/substrate/runtime/supervisor/background-tasks.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/command-loop.mjs +82 -23
- package/dist/substrate/runtime/supervisor/command-loop.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/contribution-dispatcher.mjs +16 -0
- package/dist/substrate/runtime/supervisor/contribution-dispatcher.mjs.map +1 -0
- package/dist/substrate/runtime/supervisor/errors.mjs +11 -2
- package/dist/substrate/runtime/supervisor/errors.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/index.mjs +2 -0
- package/dist/substrate/runtime/supervisor/shutdown.mjs +6 -6
- package/dist/substrate/runtime/supervisor/shutdown.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/start-supervisor.mjs +60 -70
- package/dist/substrate/runtime/supervisor/start-supervisor.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/state.d.mts +1 -1
- package/dist/substrate/runtime/supervisor/state.mjs +1 -1
- package/dist/substrate/runtime/supervisor/state.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/teardown.mjs +10 -9
- package/dist/substrate/runtime/supervisor/teardown.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/wiring.mjs +6 -20
- package/dist/substrate/runtime/supervisor/wiring.mjs.map +1 -1
- package/dist/substrate/runtime/tar/reader.mjs +216 -0
- package/dist/substrate/runtime/tar/reader.mjs.map +1 -0
- package/dist/substrate/runtime/typed-env.mjs.map +1 -1
- package/dist/substrate/versioned-doc-schema.mjs.map +1 -1
- package/dist/substrate/versioned-doc-sync.mjs +5 -5
- package/dist/substrate/versioned-doc-sync.mjs.map +1 -1
- package/dist/surfaces/cli/command-tree.mjs +49 -7
- package/dist/surfaces/cli/command-tree.mjs.map +1 -1
- package/dist/surfaces/cli/commands/config.mjs +1 -1
- package/dist/surfaces/cli/commands/config.mjs.map +1 -1
- package/dist/surfaces/cli/commands/confirm-node.mjs.map +1 -1
- package/dist/surfaces/cli/commands/confirm.mjs.map +1 -1
- package/dist/surfaces/cli/commands/doctor.mjs +1 -1
- package/dist/surfaces/cli/commands/doctor.mjs.map +1 -1
- package/dist/surfaces/cli/commands/prune-picker-entry.mjs.map +1 -1
- package/dist/surfaces/cli/commands/prune-picker.mjs.map +1 -1
- package/dist/surfaces/cli/commands/prune.mjs +1 -1
- package/dist/surfaces/cli/commands/prune.mjs.map +1 -1
- package/dist/surfaces/cli/commands/snapshot.mjs +1 -1
- package/dist/surfaces/cli/commands/snapshot.mjs.map +1 -1
- package/dist/surfaces/cli/commands/status.mjs +1 -1
- package/dist/surfaces/cli/commands/status.mjs.map +1 -1
- package/dist/surfaces/cli/commands/supervisor-presence.mjs.map +1 -1
- package/dist/surfaces/cli/commands/wipe.mjs +3 -4
- package/dist/surfaces/cli/commands/wipe.mjs.map +1 -1
- package/dist/surfaces/cli/envelope.mjs.map +1 -1
- package/dist/surfaces/cli/errors.mjs.map +1 -1
- package/dist/surfaces/cli/flags.mjs.map +1 -1
- package/dist/surfaces/cli/index.mjs +45 -14
- package/dist/surfaces/cli/index.mjs.map +1 -1
- package/dist/surfaces/cli/output.mjs.map +1 -1
- package/dist/surfaces/cli/sysexits.mjs.map +1 -1
- package/dist/surfaces/tui/app.mjs +0 -21
- package/dist/surfaces/tui/app.mjs.map +1 -1
- package/dist/surfaces/tui/dashboard.mjs +0 -48
- package/dist/surfaces/tui/dashboard.mjs.map +1 -1
- package/dist/surfaces/tui/display-derivation.mjs +80 -16
- package/dist/surfaces/tui/display-derivation.mjs.map +1 -1
- package/dist/surfaces/tui/errors.mjs.map +1 -1
- package/dist/surfaces/tui/event-log.mjs +0 -9
- package/dist/surfaces/tui/event-log.mjs.map +1 -1
- package/dist/surfaces/tui/heartbeat.mjs.map +1 -1
- package/dist/surfaces/tui/index.mjs +2 -2
- package/dist/surfaces/tui/index.mjs.map +1 -1
- package/dist/surfaces/tui/input.mjs.map +1 -1
- package/dist/surfaces/tui/mode-detect.mjs.map +1 -1
- package/dist/surfaces/tui/mount-ink.mjs.map +1 -1
- package/dist/surfaces/tui/plain-renderer.mjs +26 -19
- package/dist/surfaces/tui/plain-renderer.mjs.map +1 -1
- package/dist/surfaces/tui/resource-table.mjs +8 -10
- package/dist/surfaces/tui/resource-table.mjs.map +1 -1
- package/images/postgres/Dockerfile +0 -1
- package/images/sui/Dockerfile +27 -54
- package/images/sui/entrypoint.sh +17 -179
- package/package.json +23 -15
- package/dashboard-ui/assets/index-Bmi1UtAg.js +0 -1356
- package/dashboard-ui/assets/index-D5EShVt4.js +0 -3
- package/dashboard-ui/assets/index-Deml9drg.css +0 -1
- package/dist/api/plugin-errors.d.mts +0 -7
- package/dist/api/plugin-errors.mjs +0 -10
- package/dist/api/plugin-errors.mjs.map +0 -1
- package/dist/cli/wirings/build-verb-layers.mjs +0 -42
- package/dist/cli/wirings/build-verb-layers.mjs.map +0 -1
- package/dist/contracts/capability-decl.d.mts +0 -40
- package/dist/orchestrators/built-in-plugin-layers.mjs +0 -54
- package/dist/orchestrators/built-in-plugin-layers.mjs.map +0 -1
- package/dist/orchestrators/run.mjs +0 -91
- package/dist/orchestrators/run.mjs.map +0 -1
- package/dist/orchestrators/runtime-composition.d.mts +0 -10
- package/dist/orchestrators/runtime-composition.mjs +0 -252
- package/dist/orchestrators/runtime-composition.mjs.map +0 -1
- package/dist/orchestrators/snapshot/capture-command.d.mts +0 -1
- package/dist/orchestrators/snapshot/capture-command.mjs +0 -25
- package/dist/orchestrators/snapshot/capture-command.mjs.map +0 -1
- package/dist/orchestrators/snapshot/pending-marker.mjs +0 -99
- package/dist/orchestrators/snapshot/pending-marker.mjs.map +0 -1
- package/dist/orchestrators/snapshot/recover-pending.mjs +0 -223
- package/dist/orchestrators/snapshot/recover-pending.mjs.map +0 -1
- package/dist/orchestrators/snapshot/state-document.d.mts +0 -1
- package/dist/orchestrators/snapshot/state-document.mjs +0 -58
- package/dist/orchestrators/snapshot/state-document.mjs.map +0 -1
- package/dist/plugins/account/spans.mjs +0 -16
- package/dist/plugins/account/spans.mjs.map +0 -1
- package/dist/plugins/account/variants/env.mjs +0 -24
- package/dist/plugins/account/variants/env.mjs.map +0 -1
- package/dist/plugins/account/variants/inline.mjs +0 -13
- package/dist/plugins/account/variants/inline.mjs.map +0 -1
- package/dist/plugins/account/variants/keystore.mjs +0 -91
- package/dist/plugins/account/variants/keystore.mjs.map +0 -1
- package/dist/plugins/action/spans.mjs +0 -11
- package/dist/plugins/action/spans.mjs.map +0 -1
- package/dist/plugins/coin/spans.mjs +0 -20
- package/dist/plugins/coin/spans.mjs.map +0 -1
- package/dist/plugins/deepbook/spans.mjs +0 -18
- package/dist/plugins/deepbook/spans.mjs.map +0 -1
- package/dist/plugins/faucet/spans.mjs +0 -12
- package/dist/plugins/faucet/spans.mjs.map +0 -1
- package/dist/plugins/package/spans.mjs +0 -14
- package/dist/plugins/package/spans.mjs.map +0 -1
- package/dist/plugins/postgres/codegen.mjs +0 -42
- package/dist/plugins/postgres/codegen.mjs.map +0 -1
- package/dist/plugins/postgres/connection.d.mts +0 -33
- package/dist/plugins/postgres/connection.mjs.map +0 -1
- package/dist/plugins/postgres/db-ensure.mjs.map +0 -1
- package/dist/plugins/postgres/errors.d.mts +0 -60
- package/dist/plugins/postgres/errors.mjs +0 -29
- package/dist/plugins/postgres/errors.mjs.map +0 -1
- package/dist/plugins/postgres/index.d.mts +0 -37
- package/dist/plugins/postgres/index.mjs +0 -68
- package/dist/plugins/postgres/index.mjs.map +0 -1
- package/dist/plugins/postgres/routable.mjs +0 -33
- package/dist/plugins/postgres/routable.mjs.map +0 -1
- package/dist/plugins/postgres/service.d.mts +0 -50
- package/dist/plugins/postgres/service.mjs +0 -179
- package/dist/plugins/postgres/service.mjs.map +0 -1
- package/dist/plugins/postgres/snapshot.mjs +0 -32
- package/dist/plugins/postgres/snapshot.mjs.map +0 -1
- package/dist/plugins/postgres/spans.mjs +0 -11
- package/dist/plugins/postgres/spans.mjs.map +0 -1
- package/dist/plugins/seal/spans.mjs +0 -18
- package/dist/plugins/seal/spans.mjs.map +0 -1
- package/dist/plugins/sui/spans.mjs +0 -17
- package/dist/plugins/sui/spans.mjs.map +0 -1
- package/dist/plugins/wallet/spans.mjs +0 -22
- package/dist/plugins/wallet/spans.mjs.map +0 -1
- package/dist/plugins/walrus/registry-publish.d.mts +0 -24
- package/dist/plugins/walrus/spans.mjs +0 -18
- package/dist/plugins/walrus/spans.mjs.map +0 -1
- package/dist/runtime/docker/logs.d.mts +0 -1
- package/dist/runtime/docker/logs.mjs +0 -34
- package/dist/runtime/docker/logs.mjs.map +0 -1
- package/dist/substrate/runtime/artifact-publisher/index.mjs +0 -86
- package/dist/substrate/runtime/artifact-publisher/index.mjs.map +0 -1
- package/dist/substrate/runtime/capability-sinks/index.d.mts +0 -1
- package/dist/substrate/runtime/capability-sinks/index.mjs +0 -3
- package/dist/substrate/runtime/capability-sinks/layer.d.mts +0 -1
- package/dist/substrate/runtime/capability-sinks/layer.mjs +0 -31
- package/dist/substrate/runtime/capability-sinks/layer.mjs.map +0 -1
- package/dist/substrate/runtime/capability-sinks/service.d.mts +0 -95
- package/dist/substrate/runtime/capability-sinks/service.mjs +0 -69
- package/dist/substrate/runtime/capability-sinks/service.mjs.map +0 -1
- package/dist/substrate/runtime/cross-process/lock.d.mts +0 -1
- package/dist/substrate/runtime/cross-process/lock.mjs +0 -23
- package/dist/substrate/runtime/cross-process/lock.mjs.map +0 -1
- package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs +0 -113
- package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs.map +0 -1
- package/dist/substrate/runtime/lifecycle/lifecycle-fact.mjs +0 -31
- package/dist/substrate/runtime/lifecycle/lifecycle-fact.mjs.map +0 -1
- package/dist/substrate/runtime/observability/formatter-registry.d.mts +0 -1
- package/dist/substrate/runtime/observability/formatter-registry.mjs +0 -48
- package/dist/substrate/runtime/observability/formatter-registry.mjs.map +0 -1
- package/dist/substrate/runtime/observability/span-store.d.mts +0 -1
- package/dist/substrate/runtime/observability/span-store.mjs +0 -110
- package/dist/substrate/runtime/observability/span-store.mjs.map +0 -1
- package/dist/substrate/runtime/observability/spans.d.mts +0 -1
- package/dist/substrate/runtime/observability/spans.mjs +0 -87
- package/dist/substrate/runtime/observability/spans.mjs.map +0 -1
- package/dist/substrate/runtime/projection/index.mjs +0 -4
- package/dist/substrate/runtime/projection/persisted.mjs +0 -213
- package/dist/substrate/runtime/projection/persisted.mjs.map +0 -1
- package/dist/substrate/runtime/scoped-multimap/service.mjs +0 -52
- package/dist/substrate/runtime/scoped-multimap/service.mjs.map +0 -1
- package/dist/substrate/runtime/scoped-ref-map/index.mjs +0 -2
- package/dist/substrate/runtime/scoped-ref-map/service.mjs +0 -83
- package/dist/substrate/runtime/scoped-ref-map/service.mjs.map +0 -1
- package/dist/substrate/runtime/state-store/index.mjs +0 -3
- package/dist/substrate/runtime/state-store/schema.d.mts +0 -1
- package/dist/substrate/runtime/state-store/schema.mjs +0 -41
- package/dist/substrate/runtime/state-store/schema.mjs.map +0 -1
- package/dist/substrate/runtime/state-store/service.d.mts +0 -1
- package/dist/substrate/runtime/state-store/service.mjs +0 -145
- package/dist/substrate/runtime/state-store/service.mjs.map +0 -1
- package/dist/substrate/runtime/sui-execute/index.mjs.map +0 -1
- package/dist/substrate/runtime/sui-execute/sign-and-dispatch.mjs.map +0 -1
- package/dist/substrate/runtime/sui-ledger/object-ref.mjs.map +0 -1
- package/dist/substrate/runtime/sui-move-build/index.mjs.map +0 -1
- package/dist/substrate/runtime/supervisor/dispatch-contributions.mjs +0 -151
- package/dist/substrate/runtime/supervisor/dispatch-contributions.mjs.map +0 -1
- package/dist/substrate/state-store.d.mts +0 -1
- /package/dist/orchestrators/{snapshot/pending-marker.d.mts → codegen/id-config.d.mts} +0 -0
- /package/dist/orchestrators/snapshot/{recover-pending.d.mts → interrupted-restore.d.mts} +0 -0
- /package/dist/{substrate/runtime/sui-execute → plugins/sui/exec}/sign-and-dispatch.d.mts +0 -0
- /package/dist/plugins/{postgres/snapshot.d.mts → sui/ledger/object-ref.d.mts} +0 -0
- /package/dist/{substrate/runtime/sui-move-build → plugins/sui/move}/index.d.mts +0 -0
- /package/dist/substrate/runtime/{state-store/index.d.mts → reconcile/graph.d.mts} +0 -0
- /package/dist/substrate/runtime/{cross-process/snapshot-reservation.d.mts → supervisor/contribution-dispatcher.d.mts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state-machine.mjs","names":[],"sources":["../../../../src/substrate/runtime/lifecycle/state-machine.ts"],"sourcesContent":["// Lifecycle state-machine — runtime guard over `LifecycleTransition`.\n//\n// Architecture § Lifecycle state. The transition table is declared in\n// `substrate/lifecycle.ts`; this file asserts moves against it at runtime\n// so an off-table transition lands as a typed Defect (programmer-error\n// class), not a corrupt projection.\n//\n// The state machine is per-plugin. Callers (the supervisor) hold a\n// `Ref` of `LifecycleStatus` and route every change through\n// `transition`, which:\n// - validates the move,\n// - emits the `lifecycle.statusChanged` typed event,\n// - returns the new status.\n\nimport { Data, Effect } from 'effect';\n\nimport type { LifecycleStatus, LifecycleTransition } from '../../lifecycle.ts';\n\n/** Off-table transition — programmer error. Surfaced as a defect via\n * `Effect.die` so the renderer / cause walker sees the impossible\n * transition rather than silently corrupting the projection. */\nexport class InvalidLifecycleTransition extends Data.TaggedError('InvalidLifecycleTransition')<{\n\treadonly from: LifecycleStatus;\n\treadonly to: LifecycleStatus;\n}> {}\n\n/** Canonical transition table — mirrors the type-level\n * `LifecycleTransition` from `substrate/lifecycle.ts` exactly. Adding\n * a transition requires updating BOTH (the type-level union AND this\n * table). */\nconst ALLOWED: ReadonlyMap<LifecycleStatus, ReadonlySet<LifecycleStatus>> = new Map([\n\t['pending', new Set<LifecycleStatus>(['acquiring', 'failed'])],\n\t['acquiring', new Set<LifecycleStatus>(['ready', 'failed'])],\n\t['ready', new Set<LifecycleStatus>(['stopping', 'failed', 'done'])],\n\t['stopping', new Set<LifecycleStatus>(['stopped', 'failed'])],\n\t['failed', new Set<LifecycleStatus>(['pending'])],\n\t['stopped', new Set<LifecycleStatus>(['pending'])],\n\t['done', new Set<LifecycleStatus>(['pending', 'failed'])],\n] as const);\n\n/** Predicate that the type-table and the runtime table agree. The\n * compiler checks the type-level shape; this conditional verifies the\n * runtime table covers exactly the same `from` set. */\ntype _AllFroms = LifecycleTransition['from'];\ntype _RuntimeFroms = 'pending' | 'acquiring' | 'ready' | 'stopping' | 'failed' | 'stopped' | 'done';\ntype _TableShape = _AllFroms extends _RuntimeFroms\n\t? _RuntimeFroms extends _AllFroms | 'done'\n\t\t? true\n\t\t: false\n\t: false;\n// Force the check by exporting the assertion.\nexport type __LifecycleTableShape = _TableShape extends true ? true : never;\n\n/** Returns true iff `from → to` is on the allowed-transition table. */\nexport const isAllowedTransition = (from: LifecycleStatus, to: LifecycleStatus): boolean =>\n\tALLOWED.get(from)?.has(to) ?? false;\n\n/** Effect-flavored transition assertion. Returns the new status on\n * success; dies with `InvalidLifecycleTransition` otherwise. */\nexport const assertTransition = (\n\tfrom: LifecycleStatus,\n\tto: LifecycleStatus,\n): Effect.Effect<LifecycleStatus> =>\n\tisAllowedTransition(from, to)\n\t\t? Effect.succeed(to)\n\t\t: Effect.die(new InvalidLifecycleTransition({ from, to }));\n\n/**
|
|
1
|
+
{"version":3,"file":"state-machine.mjs","names":[],"sources":["../../../../src/substrate/runtime/lifecycle/state-machine.ts"],"sourcesContent":["// Lifecycle state-machine — runtime guard over `LifecycleTransition`.\n//\n// Architecture § Lifecycle state. The transition table is declared in\n// `substrate/lifecycle.ts`; this file asserts moves against it at runtime\n// so an off-table transition lands as a typed Defect (programmer-error\n// class), not a corrupt projection.\n//\n// The state machine is per-plugin. Callers (the supervisor) hold a\n// `Ref` of `LifecycleStatus` and route every change through\n// `transition`, which:\n// - validates the move,\n// - emits the `lifecycle.statusChanged` typed event,\n// - returns the new status.\n\nimport { Data, Effect } from 'effect';\n\nimport type { LifecycleStatus, LifecycleTransition } from '../../lifecycle.ts';\n\n/** Off-table transition — programmer error. Surfaced as a defect via\n * `Effect.die` so the renderer / cause walker sees the impossible\n * transition rather than silently corrupting the projection. */\nexport class InvalidLifecycleTransition extends Data.TaggedError('InvalidLifecycleTransition')<{\n\treadonly from: LifecycleStatus;\n\treadonly to: LifecycleStatus;\n}> {}\n\n/** Canonical transition table — mirrors the type-level\n * `LifecycleTransition` from `substrate/lifecycle.ts` exactly. Adding\n * a transition requires updating BOTH (the type-level union AND this\n * table). */\nconst ALLOWED: ReadonlyMap<LifecycleStatus, ReadonlySet<LifecycleStatus>> = new Map([\n\t['pending', new Set<LifecycleStatus>(['acquiring', 'failed'])],\n\t['acquiring', new Set<LifecycleStatus>(['ready', 'failed'])],\n\t['ready', new Set<LifecycleStatus>(['stopping', 'failed', 'done'])],\n\t['stopping', new Set<LifecycleStatus>(['stopped', 'failed'])],\n\t['failed', new Set<LifecycleStatus>(['pending'])],\n\t['stopped', new Set<LifecycleStatus>(['pending'])],\n\t['done', new Set<LifecycleStatus>(['pending', 'failed'])],\n] as const);\n\n/** Predicate that the type-table and the runtime table agree. The\n * compiler checks the type-level shape; this conditional verifies the\n * runtime table covers exactly the same `from` set. */\ntype _AllFroms = LifecycleTransition['from'];\ntype _RuntimeFroms = 'pending' | 'acquiring' | 'ready' | 'stopping' | 'failed' | 'stopped' | 'done';\ntype _TableShape = _AllFroms extends _RuntimeFroms\n\t? _RuntimeFroms extends _AllFroms | 'done'\n\t\t? true\n\t\t: false\n\t: false;\n// Force the check by exporting the assertion.\nexport type __LifecycleTableShape = _TableShape extends true ? true : never;\n\n/** Returns true iff `from → to` is on the allowed-transition table. */\nexport const isAllowedTransition = (from: LifecycleStatus, to: LifecycleStatus): boolean =>\n\tALLOWED.get(from)?.has(to) ?? false;\n\n/** Effect-flavored transition assertion. Returns the new status on\n * success; dies with `InvalidLifecycleTransition` otherwise. */\nexport const assertTransition = (\n\tfrom: LifecycleStatus,\n\tto: LifecycleStatus,\n): Effect.Effect<LifecycleStatus> =>\n\tisAllowedTransition(from, to)\n\t\t? Effect.succeed(to)\n\t\t: Effect.die(new InvalidLifecycleTransition({ from, to }));\n\n/** Statuses that count toward \"stack is ready\" — every plugin must be\n * in one of these for the stack to surface `running`. */\nexport const isReadyOrTerminal = (status: LifecycleStatus): boolean =>\n\tstatus === 'ready' || status === 'done';\n"],"mappings":";;;;;AAqBA,IAAa,6BAAb,cAAgD,KAAK,YAAY,4BAA4B,CAAC,CAG3F,CAAC;;;;;AAMJ,MAAM,UAAsE,IAAI,IAAI;CACnF,CAAC,WAAW,IAAI,IAAqB,CAAC,aAAa,QAAQ,CAAC,CAAC;CAC7D,CAAC,aAAa,IAAI,IAAqB,CAAC,SAAS,QAAQ,CAAC,CAAC;CAC3D,CAAC,SAAS,IAAI,IAAqB;EAAC;EAAY;EAAU;CAAM,CAAC,CAAC;CAClE,CAAC,YAAY,IAAI,IAAqB,CAAC,WAAW,QAAQ,CAAC,CAAC;CAC5D,CAAC,UAAU,IAAI,IAAqB,CAAC,SAAS,CAAC,CAAC;CAChD,CAAC,WAAW,IAAI,IAAqB,CAAC,SAAS,CAAC,CAAC;CACjD,CAAC,QAAQ,IAAI,IAAqB,CAAC,WAAW,QAAQ,CAAC,CAAC;AACzD,CAAU;;AAgBV,MAAa,uBAAuB,MAAuB,OAC1D,QAAQ,IAAI,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK;;;AAI/B,MAAa,oBACZ,MACA,OAEA,oBAAoB,MAAM,EAAE,IACzB,OAAO,QAAQ,EAAE,IACjB,OAAO,IAAI,IAAI,2BAA2B;CAAE;CAAM;AAAG,CAAC,CAAC;;;AAI3D,MAAa,qBAAqB,WACjC,WAAW,WAAW,WAAW"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export { };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watch-attribution.mjs","names":[],"sources":["../../../../src/substrate/runtime/lifecycle/watch-attribution.ts"],"sourcesContent":["// Watch-path → owning plugin attribution.\n//\n// Architecture § L3 Watch dispatcher: \"collects all plugin `watch`\n// declarations, receives watcher events from L0 (which already\n// debounced + dedup'd), triggers selective restart through the\n// scheduler's invalidate-with-cascade.\"\n//\n// L0 owns the file watcher (debounce + content-hash dedup). The\n// supervisor's role at watch time is just: given a fired path, which\n// plugin row(s) should be invalidated? This module builds and queries\n// that index. Selective-restart is the supervisor's concern; watch\n// attribution stays pure.\n\nimport
|
|
1
|
+
{"version":3,"file":"watch-attribution.mjs","names":[],"sources":["../../../../src/substrate/runtime/lifecycle/watch-attribution.ts"],"sourcesContent":["// Watch-path → owning plugin attribution.\n//\n// Architecture § L3 Watch dispatcher: \"collects all plugin `watch`\n// declarations, receives watcher events from L0 (which already\n// debounced + dedup'd), triggers selective restart through the\n// scheduler's invalidate-with-cascade.\"\n//\n// L0 owns the file watcher (debounce + content-hash dedup). The\n// supervisor's role at watch time is just: given a fired path, which\n// plugin row(s) should be invalidated? This module builds and queries\n// that index. Selective-restart is the supervisor's concern; watch\n// attribution stays pure.\n\nimport type { PluginKey } from '../../brand.ts';\nimport type { DepNode } from './dep-graph.ts';\n\n/** Per-plugin watch entry — a copy of the plugin's declared `watch`\n * decl with the owning key attached. */\nexport interface WatchEntry {\n\treadonly pluginKey: PluginKey;\n\treadonly paths: ReadonlyArray<string>;\n\t/** Whether downstream consumers should cascade-invalidate when this\n\t * fires. Defaults to true (architecture § WatchDecl). */\n\treadonly cascade: boolean;\n}\n\n/** Build the watch index from a resolved dep-graph's nodes. */\nexport const buildWatchIndex = (\n\tnodes: ReadonlyMap<PluginKey, DepNode>,\n): ReadonlyArray<WatchEntry> => {\n\tconst out: WatchEntry[] = [];\n\tfor (const [key, node] of nodes) {\n\t\tconst watch = node.member.watch;\n\t\tif (watch === undefined || watch.paths.length === 0) continue;\n\t\tout.push({\n\t\t\tpluginKey: key,\n\t\t\tpaths: watch.paths,\n\t\t\tcascade: watch.cascade ?? true,\n\t\t});\n\t}\n\treturn out;\n};\n\n/**\n * Given the firing `firedPath` (already debounced + content-hash dedup'd\n * by L0), return the plugin keys whose declared paths match.\n *\n * Matching is glob-aware via minimatch semantics — the substrate-level\n * attribution here delegates to a supplied `match` predicate to keep\n * this module dependency-free. The supervisor wires the matcher in.\n */\nexport const attribute = (\n\tindex: ReadonlyArray<WatchEntry>,\n\tfiredPath: string,\n\tmatch: (pattern: string, path: string) => boolean,\n): ReadonlySet<PluginKey> => {\n\tconst out = new Set<PluginKey>();\n\tfor (const entry of index) {\n\t\tfor (const pattern of entry.paths) {\n\t\t\tif (match(pattern, firedPath)) {\n\t\t\t\tout.add(entry.pluginKey);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn out;\n};\n\n/**\n * Default fallback matcher — exact-prefix only. Provided so unit\n * tests / single-stack boots without a real minimatch dependency\n * still function. The L0 thick watcher's minimatch is the production\n * matcher.\n */\nexport const exactPrefixMatch = (pattern: string, path: string): boolean =>\n\tpath === pattern || path.startsWith(pattern.replace(/\\*+$/, ''));\n"],"mappings":";;AA2BA,MAAa,mBACZ,UAC+B;CAC/B,MAAM,MAAoB,CAAC;CAC3B,KAAK,MAAM,CAAC,KAAK,SAAS,OAAO;EAChC,MAAM,QAAQ,KAAK,OAAO;EAC1B,IAAI,UAAU,KAAA,KAAa,MAAM,MAAM,WAAW,GAAG;EACrD,IAAI,KAAK;GACR,WAAW;GACX,OAAO,MAAM;GACb,SAAS,MAAM,WAAW;EAC3B,CAAC;CACF;CACA,OAAO;AACR;;;;;;;AAiCA,MAAa,oBAAoB,SAAiB,SACjD,SAAS,WAAW,KAAK,WAAW,QAAQ,QAAQ,QAAQ,EAAE,CAAC"}
|
|
@@ -4,7 +4,7 @@ import { Effect, Scope } from "effect";
|
|
|
4
4
|
|
|
5
5
|
//#region src/substrate/runtime/managed-container.d.ts
|
|
6
6
|
declare namespace managed_container_d_exports {
|
|
7
|
-
export { EnsureManagedContainerOptions, ManagedContainerIdentity, ManagedContainerLabelOptions, PER_APP_SHARED_STACK, ensureManagedContainer, managedContainerLabels };
|
|
7
|
+
export { EnsureManagedContainerOptions, ManagedContainerIdentity, ManagedContainerLabelOptions, PER_APP_SHARED_STACK, ensureManagedContainer, managedContainerLabels, sanitizeAlias };
|
|
8
8
|
}
|
|
9
9
|
/** Sentinel `stack` value for containers / volumes / networks that are
|
|
10
10
|
* shared across a single app's stacks but isolated PER APP — the
|
|
@@ -24,6 +24,10 @@ declare namespace managed_container_d_exports {
|
|
|
24
24
|
* role }` label tuple — managed-container.ts is the canonical
|
|
25
25
|
* owner. */
|
|
26
26
|
declare const PER_APP_SHARED_STACK: "_per-app_";
|
|
27
|
+
/** Coerce a composed string to a Docker network / DNS-alias-safe form
|
|
28
|
+
* (alphanumerics + hyphen). Identity strings are already network-safe;
|
|
29
|
+
* this guards the literal composition (`devstack-${app}-${stack}-…`). */
|
|
30
|
+
declare const sanitizeAlias: (s: string) => string;
|
|
27
31
|
interface ManagedContainerIdentity {
|
|
28
32
|
readonly app: string;
|
|
29
33
|
readonly stack: string;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { __exportAll } from "../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
-
import { SpanAttr } from "./observability/spans.mjs";
|
|
3
2
|
import { Effect } from "effect";
|
|
4
3
|
//#region src/substrate/runtime/managed-container.ts
|
|
5
4
|
var managed_container_exports = /* @__PURE__ */ __exportAll({
|
|
6
5
|
PER_APP_SHARED_STACK: () => PER_APP_SHARED_STACK,
|
|
7
6
|
ensureManagedContainer: () => ensureManagedContainer,
|
|
8
|
-
managedContainerLabels: () => managedContainerLabels
|
|
7
|
+
managedContainerLabels: () => managedContainerLabels,
|
|
8
|
+
sanitizeAlias: () => sanitizeAlias
|
|
9
9
|
});
|
|
10
10
|
/** Sentinel `stack` value for containers / volumes / networks that are
|
|
11
11
|
* shared across a single app's stacks but isolated PER APP — the
|
|
@@ -25,6 +25,10 @@ var managed_container_exports = /* @__PURE__ */ __exportAll({
|
|
|
25
25
|
* role }` label tuple — managed-container.ts is the canonical
|
|
26
26
|
* owner. */
|
|
27
27
|
const PER_APP_SHARED_STACK = "_per-app_";
|
|
28
|
+
/** Coerce a composed string to a Docker network / DNS-alias-safe form
|
|
29
|
+
* (alphanumerics + hyphen). Identity strings are already network-safe;
|
|
30
|
+
* this guards the literal composition (`devstack-${app}-${stack}-…`). */
|
|
31
|
+
const sanitizeAlias = (s) => s.replace(/[^a-zA-Z0-9-]/g, "-");
|
|
28
32
|
const managedContainerLabels = (options) => ({
|
|
29
33
|
app: options.identity.app,
|
|
30
34
|
stack: options.identity.stack,
|
|
@@ -37,15 +41,9 @@ const ensureManagedContainer = (options) => {
|
|
|
37
41
|
return options.runtime.ensureContainer({
|
|
38
42
|
...options.spec,
|
|
39
43
|
labels
|
|
40
|
-
}).pipe(Effect.mapError(options.mapError)
|
|
41
|
-
[SpanAttr.app]: labels.app,
|
|
42
|
-
[SpanAttr.stack]: labels.stack,
|
|
43
|
-
[SpanAttr.plugin]: labels.plugin,
|
|
44
|
-
[SpanAttr.containerRole]: labels.role,
|
|
45
|
-
[SpanAttr.containerName]: options.spec.name
|
|
46
|
-
} }));
|
|
44
|
+
}).pipe(Effect.mapError(options.mapError));
|
|
47
45
|
};
|
|
48
46
|
//#endregion
|
|
49
|
-
export { PER_APP_SHARED_STACK, ensureManagedContainer, managed_container_exports };
|
|
47
|
+
export { PER_APP_SHARED_STACK, ensureManagedContainer, managed_container_exports, sanitizeAlias };
|
|
50
48
|
|
|
51
49
|
//# sourceMappingURL=managed-container.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"managed-container.mjs","names":[],"sources":["../../../src/substrate/runtime/managed-container.ts"],"sourcesContent":["import { Effect, type Scope } from 'effect';\n\nimport type {\n\tContainerHandle,\n\tContainerRuntime,\n\tContainerRuntimeError,\n\tEnsureContainerSpec,\n} from '../../contracts/container-runtime.ts';\nimport type { ContainerLabelTuple } from '../../contracts/snapshotable.ts';\
|
|
1
|
+
{"version":3,"file":"managed-container.mjs","names":[],"sources":["../../../src/substrate/runtime/managed-container.ts"],"sourcesContent":["import { Effect, type Scope } from 'effect';\n\nimport type {\n\tContainerHandle,\n\tContainerRuntime,\n\tContainerRuntimeError,\n\tEnsureContainerSpec,\n} from '../../contracts/container-runtime.ts';\nimport type { ContainerLabelTuple } from '../../contracts/snapshotable.ts';\n\n/** Sentinel `stack` value for containers / volumes / networks that are\n * shared across a single app's stacks but isolated PER APP — the\n * resource lives at app-scope, not stack-scope.\n *\n * Current producer: the per-app sui chain-build container\n * (`plugins/sui/chain-build-container.ts`) reuses one container\n * across multiple stacks of the same app to keep the bind-mounted\n * Move dep cache warm.\n *\n * Lifecycle-prune + the prune CLI compare against this sentinel to\n * decide whether a resource group is shared (pinned while any\n * sibling stack under the same app is live) vs per-stack (pruned\n * with its stack).\n *\n * The vocabulary lives here alongside the `{ app, stack, plugin,\n * role }` label tuple — managed-container.ts is the canonical\n * owner. */\nexport const PER_APP_SHARED_STACK = '_per-app_' as const;\n\n/** Coerce a composed string to a Docker network / DNS-alias-safe form\n * (alphanumerics + hyphen). Identity strings are already network-safe;\n * this guards the literal composition (`devstack-${app}-${stack}-…`). */\nexport const sanitizeAlias = (s: string): string => s.replace(/[^a-zA-Z0-9-]/g, '-');\n\nexport interface ManagedContainerIdentity {\n\treadonly app: string;\n\treadonly stack: string;\n}\n\nexport interface ManagedContainerLabelOptions {\n\treadonly identity: ManagedContainerIdentity;\n\treadonly plugin: string;\n\treadonly role: string;\n}\n\nexport const managedContainerLabels = (\n\toptions: ManagedContainerLabelOptions,\n): ContainerLabelTuple => ({\n\tapp: options.identity.app,\n\tstack: options.identity.stack,\n\tplugin: options.plugin,\n\trole: options.role,\n});\n\ntype ManagedContainerLabelInput =\n\t| { readonly labels: ContainerLabelTuple }\n\t| ManagedContainerLabelOptions;\n\nexport type EnsureManagedContainerOptions<E> = ManagedContainerLabelInput & {\n\treadonly runtime: ContainerRuntime;\n\treadonly spec: Omit<EnsureContainerSpec, 'labels'>;\n\treadonly mapError: (cause: ContainerRuntimeError) => E;\n};\n\nconst labelsFrom = (input: ManagedContainerLabelInput): ContainerLabelTuple =>\n\t'labels' in input ? input.labels : managedContainerLabels(input);\n\nexport const ensureManagedContainer = <E>(\n\toptions: EnsureManagedContainerOptions<E>,\n): Effect.Effect<ContainerHandle, E, Scope.Scope> => {\n\tconst labels = labelsFrom(options);\n\treturn options.runtime\n\t\t.ensureContainer({\n\t\t\t...options.spec,\n\t\t\tlabels,\n\t\t})\n\t\t.pipe(Effect.mapError(options.mapError));\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAa,uBAAuB;;;;AAKpC,MAAa,iBAAiB,MAAsB,EAAE,QAAQ,kBAAkB,GAAG;AAanF,MAAa,0BACZ,aAC0B;CAC1B,KAAK,QAAQ,SAAS;CACtB,OAAO,QAAQ,SAAS;CACxB,QAAQ,QAAQ;CAChB,MAAM,QAAQ;AACf;AAYA,MAAM,cAAc,UACnB,YAAY,QAAQ,MAAM,SAAS,uBAAuB,KAAK;AAEhE,MAAa,0BACZ,YACoD;CACpD,MAAM,SAAS,WAAW,OAAO;CACjC,OAAO,QAAQ,QACb,gBAAgB;EAChB,GAAG,QAAQ;EACX;CACD,CAAC,CAAC,CACD,KAAK,OAAO,SAAS,QAAQ,QAAQ,CAAC;AACzC"}
|
|
@@ -1,54 +1,33 @@
|
|
|
1
|
-
import { atomicWriteFile } from "../atomic-write.mjs";
|
|
2
1
|
import "../runtime-decode.mjs";
|
|
2
|
+
import { atomicWriteFile } from "../atomic-write.mjs";
|
|
3
3
|
import "../../manifest.mjs";
|
|
4
4
|
import { Data, Effect } from "effect";
|
|
5
5
|
/** One error class for every manifest IO failure. */
|
|
6
6
|
var ManifestError = class extends Data.TaggedError("ManifestError") {};
|
|
7
7
|
/**
|
|
8
|
-
* Build the envelope from
|
|
8
|
+
* Build the envelope from endpoint entries + extras. Pure; the writer
|
|
9
9
|
* calls this and then atomically writes the JSON.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* by construction; a duplicate means a substrate bug.
|
|
11
|
+
* Endpoint-key collisions error: every endpoint has a unique
|
|
12
|
+
* `(pluginKey, dispatchId)` digest by construction; a duplicate means
|
|
13
|
+
* a substrate bug.
|
|
15
14
|
*/
|
|
16
15
|
const buildEnvelope = (input) => Effect.gen(function* () {
|
|
17
|
-
const services = {};
|
|
18
16
|
const endpoints = {};
|
|
19
17
|
const extras = { ...input.extras };
|
|
20
18
|
const addEndpoint = (ep) => Effect.gen(function* () {
|
|
21
19
|
const ek = ep.endpointKey;
|
|
22
20
|
if (ek in endpoints) return yield* Effect.fail(new ManifestError({
|
|
23
|
-
reason: "duplicate-
|
|
21
|
+
reason: "duplicate-endpoint",
|
|
24
22
|
path: "(in-memory envelope)",
|
|
25
23
|
detail: `endpointKey ${ek} contributed twice`
|
|
26
24
|
}));
|
|
27
25
|
endpoints[ek] = ep;
|
|
28
26
|
});
|
|
29
|
-
for (const contribution of input.contributions) {
|
|
30
|
-
const key = contribution.pluginKey;
|
|
31
|
-
if (key in services) return yield* Effect.fail(new ManifestError({
|
|
32
|
-
reason: "duplicate-contribution",
|
|
33
|
-
path: "(in-memory envelope)",
|
|
34
|
-
detail: `pluginKey ${key} contributed twice`
|
|
35
|
-
}));
|
|
36
|
-
services[key] = contribution.services;
|
|
37
|
-
if (contribution.extras !== void 0) for (const [extraKey, extraValue] of Object.entries(contribution.extras)) {
|
|
38
|
-
if (extraKey in extras) return yield* Effect.fail(new ManifestError({
|
|
39
|
-
reason: "duplicate-contribution",
|
|
40
|
-
path: "(in-memory envelope)",
|
|
41
|
-
detail: `extras key ${extraKey} contributed twice`
|
|
42
|
-
}));
|
|
43
|
-
extras[extraKey] = extraValue;
|
|
44
|
-
}
|
|
45
|
-
for (const ep of contribution.endpoints) yield* addEndpoint(ep);
|
|
46
|
-
}
|
|
47
27
|
for (const ep of input.endpoints ?? []) yield* addEndpoint(ep);
|
|
48
28
|
return {
|
|
49
29
|
identity: input.identity,
|
|
50
30
|
manifestVersion: 1,
|
|
51
|
-
services,
|
|
52
31
|
endpoints,
|
|
53
32
|
extras,
|
|
54
33
|
...input.codegen !== void 0 ? { codegen: input.codegen } : {}
|
|
@@ -58,8 +37,7 @@ const buildEnvelope = (input) => Effect.gen(function* () {
|
|
|
58
37
|
* Serialize and write the envelope at `path` atomically. Routes
|
|
59
38
|
* through the canonical `atomicWriteFile` primitive (mkdir-parent →
|
|
60
39
|
* O_EXCL temp → write → fsync → rename), so the manifest writer
|
|
61
|
-
* shares ONE owner of the tempfile dance with the
|
|
62
|
-
* cache.
|
|
40
|
+
* shares ONE owner of the tempfile dance with the cache.
|
|
63
41
|
*/
|
|
64
42
|
const writeManifest = (envelope, path) => Effect.gen(function* () {
|
|
65
43
|
const json = serializeEnvelope(envelope);
|
|
@@ -69,7 +47,7 @@ const writeManifest = (envelope, path) => Effect.gen(function* () {
|
|
|
69
47
|
detail: `atomic write failed at stage ${cause.stage}`,
|
|
70
48
|
cause
|
|
71
49
|
})));
|
|
72
|
-
})
|
|
50
|
+
});
|
|
73
51
|
const serializeEnvelope = (envelope) => JSON.stringify(envelope, null, 2);
|
|
74
52
|
//#endregion
|
|
75
53
|
export { ManifestError, buildEnvelope, writeManifest };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.mjs","names":[],"sources":["../../../../src/substrate/runtime/manifest/manifest.ts"],"sourcesContent":["// Manifest emitter — endpoint-keyed envelope, atomic write.\n//\n// Architecture § Manifest data model. The envelope is L0 (`identity`\n// tuple, `manifestVersion`, `services` slot, `endpoints` lookup,\n// `extras`). The per-service projection lives in each plugin's\n// Codegenable contribution and is consumed by codegen output, not by\n// the manifest envelope itself.\n//\n// The emitter:\n// - Accepts per-plugin contributions through a `contribute` Effect.\n// - Walks endpoint contributions to build the flat `endpoints`\n// lookup keyed by `endpointKey`. Entries still carry the declared\n// endpoint `name` for build-integration lookup.\n// - Writes atomically via tempfile + fsync + rename. The atomic-\n// write primitive lives in L0 (per architecture § Collapsed:\n// \"Three tempfile+rename impls → one atomic-write primitive\").\n// - Validates the envelope against `ManifestEnvelopeSchema` on read.\n// - Pins `manifestVersion` so future-proofing migrations have a\n// compatibility seam. The pinned version is `1` for the post-\n// rewrite envelope. (The old devstack used unversioned manifests\n// plus a hash field; the rewrite's clean break is `version 1`.)\n//\n// Discipline: zero service names. The writer iterates `pluginKey`-\n// indexed contributions and copies the bytes through. The schema\n// validates the envelope shape, not the per-plugin contents (which\n// are `Schema.Unknown`).\n\nimport { Effect } from 'effect';\nimport { Data } from 'effect';\nimport { FileSystem } from 'effect';\n\nimport type { EndpointKey, PluginKey } from '../../brand.ts';\nimport {\n\ttype EndpointEntry,\n\ttype ManifestCodegen,\n\ttype ManifestExtras,\n\ttype ManifestEnvelope,\n\tManifestEnvelopeSchema,\n} from '../../manifest.ts';\nimport { atomicWriteFile } from '../atomic-write.ts';\nimport { decodeJsonText } from '../runtime-decode.ts';\n\n// -----------------------------------------------------------------------------\n// Pinned schema version\n// -----------------------------------------------------------------------------\n\n/**\n * Schema version pinned at the envelope level. Bump only on a\n * breaking shape change to the envelope (NOT to a per-plugin service\n * slice — those carry their own version via Codegenable contribution).\n *\n * Reader policy:\n * - Equal version: accept.\n * - Older version: refuse (advise user to re-run `up`).\n * - Newer version: refuse (build integration is out of date).\n */\nexport const CURRENT_MANIFEST_VERSION = 1 as const;\n\n// -----------------------------------------------------------------------------\n// Errors\n// -----------------------------------------------------------------------------\n\n/** One error class for every manifest IO failure. */\nexport class ManifestError extends Data.TaggedError('ManifestError')<{\n\treadonly reason:\n\t\t| 'write-failed'\n\t\t| 'read-failed'\n\t\t| 'decode-failed'\n\t\t| 'version-mismatch'\n\t\t| 'duplicate-contribution';\n\treadonly path: string;\n\treadonly detail?: string;\n\treadonly cause?: unknown;\n}> {}\n\n// -----------------------------------------------------------------------------\n// Contribution shape\n// -----------------------------------------------------------------------------\n\n/**\n * One plugin's contribution to the manifest. Keyed by `pluginKey`\n * (branded), opaque `services` blob, plus a flat list of endpoint\n * entries the plugin owns.\n *\n * The writer copies `services` through to\n * `envelope.services[pluginKey]`. The renderer of the typed shape\n * lives in the plugin's Codegenable contribution — the manifest\n * doesn't decode it.\n */\nexport interface PluginManifestContribution {\n\treadonly pluginKey: PluginKey;\n\t/** Plugin's structured slice — opaque to the writer. */\n\treadonly services: unknown;\n\t/** Endpoints owned by this plugin. The writer indexes these by\n\t * `endpointKey` into the flat top-level lookup. */\n\treadonly endpoints: ReadonlyArray<EndpointEntry>;\n\t/** Optional app-facing extras merged into the top-level extras slot. */\n\treadonly extras?: ManifestExtras;\n}\n\n// -----------------------------------------------------------------------------\n// Public writer interface\n// -----------------------------------------------------------------------------\n\nexport interface WriteManifestInput {\n\treadonly identity: ManifestEnvelope['identity'];\n\treadonly contributions: ReadonlyArray<PluginManifestContribution>;\n\treadonly endpoints?: ReadonlyArray<EndpointEntry>;\n\treadonly extras?: ManifestExtras;\n\t/** Per-stack codegen metadata (the resolved absolute `generatedDir`).\n\t * Optional + additive — omitting it produces an envelope without the\n\t * `codegen` key, identical to a pre-field manifest. */\n\treadonly codegen?: ManifestCodegen;\n}\n\n/**\n * Build the envelope from per-plugin contributions. Pure; the writer\n * calls this and then atomically writes the JSON.\n *\n * `pluginKey` collisions are an error — two contributions for the\n * same plugin would silently overwrite. Endpoint-key collisions also\n * error: every endpoint has a unique `(pluginKey, dispatchId)` digest\n * by construction; a duplicate means a substrate bug.\n */\nexport const buildEnvelope = (\n\tinput: WriteManifestInput,\n): Effect.Effect<ManifestEnvelope, ManifestError> =>\n\tEffect.gen(function* () {\n\t\tconst services: Record<string, unknown> = {};\n\t\tconst endpoints: Record<string, EndpointEntry> = {};\n\t\tconst extras: Record<string, unknown> = { ...input.extras };\n\n\t\tconst addEndpoint = (ep: EndpointEntry): Effect.Effect<void, ManifestError> =>\n\t\t\tEffect.gen(function* () {\n\t\t\t\tconst ek = ep.endpointKey as string;\n\t\t\t\tif (ek in endpoints) {\n\t\t\t\t\treturn yield* Effect.fail(\n\t\t\t\t\t\tnew ManifestError({\n\t\t\t\t\t\t\treason: 'duplicate-contribution',\n\t\t\t\t\t\t\tpath: '(in-memory envelope)',\n\t\t\t\t\t\t\tdetail: `endpointKey ${ek} contributed twice`,\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tendpoints[ek] = ep;\n\t\t\t});\n\n\t\tfor (const contribution of input.contributions) {\n\t\t\tconst key = contribution.pluginKey as string;\n\t\t\tif (key in services) {\n\t\t\t\treturn yield* Effect.fail(\n\t\t\t\t\tnew ManifestError({\n\t\t\t\t\t\treason: 'duplicate-contribution',\n\t\t\t\t\t\tpath: '(in-memory envelope)',\n\t\t\t\t\t\tdetail: `pluginKey ${key} contributed twice`,\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t}\n\t\t\tservices[key] = contribution.services;\n\t\t\tif (contribution.extras !== undefined) {\n\t\t\t\tfor (const [extraKey, extraValue] of Object.entries(contribution.extras)) {\n\t\t\t\t\tif (extraKey in extras) {\n\t\t\t\t\t\treturn yield* Effect.fail(\n\t\t\t\t\t\t\tnew ManifestError({\n\t\t\t\t\t\t\t\treason: 'duplicate-contribution',\n\t\t\t\t\t\t\t\tpath: '(in-memory envelope)',\n\t\t\t\t\t\t\t\tdetail: `extras key ${extraKey} contributed twice`,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\textras[extraKey] = extraValue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const ep of contribution.endpoints) {\n\t\t\t\tyield* addEndpoint(ep);\n\t\t\t}\n\t\t}\n\t\tfor (const ep of input.endpoints ?? []) {\n\t\t\tyield* addEndpoint(ep);\n\t\t}\n\n\t\treturn {\n\t\t\tidentity: input.identity,\n\t\t\tmanifestVersion: CURRENT_MANIFEST_VERSION,\n\t\t\tservices,\n\t\t\tendpoints,\n\t\t\textras,\n\t\t\t// Spread only when present so an omitted `codegen` yields the\n\t\t\t// exact same envelope (and serialized bytes) as a pre-field\n\t\t\t// manifest — additive, no churn for stacks that don't record it.\n\t\t\t...(input.codegen !== undefined ? { codegen: input.codegen } : {}),\n\t\t};\n\t});\n\n// -----------------------------------------------------------------------------\n// Atomic write — delegates to the canonical primitive.\n// -----------------------------------------------------------------------------\n\n/**\n * Serialize and write the envelope at `path` atomically. Routes\n * through the canonical `atomicWriteFile` primitive (mkdir-parent →\n * O_EXCL temp → write → fsync → rename), so the manifest writer\n * shares ONE owner of the tempfile dance with the state-store and\n * cache.\n */\nexport const writeManifest = (\n\tenvelope: ManifestEnvelope,\n\tpath: string,\n): Effect.Effect<void, ManifestError, FileSystem.FileSystem> =>\n\tEffect.gen(function* () {\n\t\tconst json = serializeEnvelope(envelope);\n\t\tconst bytes = new TextEncoder().encode(json);\n\t\tyield* atomicWriteFile(path, bytes).pipe(\n\t\t\tEffect.mapError(\n\t\t\t\t(cause) =>\n\t\t\t\t\tnew ManifestError({\n\t\t\t\t\t\treason: 'write-failed',\n\t\t\t\t\t\tpath,\n\t\t\t\t\t\tdetail: `atomic write failed at stage ${cause.stage}`,\n\t\t\t\t\t\tcause,\n\t\t\t\t\t}),\n\t\t\t),\n\t\t);\n\t}).pipe(\n\t\tEffect.withSpan('Manifest.writeManifest', { attributes: { 'devstack.manifest.path': path } }),\n\t);\n\nconst serializeEnvelope = (envelope: ManifestEnvelope): string =>\n\t// Stable key ordering, deterministic re-emit. `JSON.stringify` with\n\t// 2-space indent is reproducible byte-for-byte given the same\n\t// input object.\n\tJSON.stringify(envelope, null, 2);\n\n// -----------------------------------------------------------------------------\n// Read + decode\n// -----------------------------------------------------------------------------\n\n/**\n * Read and decode the manifest at `path`. Validates against\n * `ManifestEnvelopeSchema` and the pinned `CURRENT_MANIFEST_VERSION`.\n *\n * Used by:\n * - Codegen (architecture §6) — consumes plugin slices off\n * `envelope.services[pluginKey]`.\n * - Build integrations (Vitest, Playwright, generated app code) — consumes\n * `envelope.endpoints` lookup.\n *\n * The reader is read-only; no mutation, no IO beyond the single read.\n */\nexport const readManifest = (\n\tpath: string,\n): Effect.Effect<ManifestEnvelope, ManifestError, FileSystem.FileSystem> =>\n\tEffect.gen(function* () {\n\t\tconst fs = yield* FileSystem.FileSystem;\n\t\tconst text = yield* fs\n\t\t\t.readFileString(path)\n\t\t\t.pipe(Effect.mapError((cause) => new ManifestError({ reason: 'read-failed', path, cause })));\n\t\tconst decoded = yield* decodeJsonText(ManifestEnvelopeSchema, text, {\n\t\t\tsource: path,\n\t\t\tmkError: (issue) =>\n\t\t\t\tnew ManifestError({ reason: 'decode-failed', path, cause: issue.cause ?? issue }),\n\t\t});\n\t\tif (decoded.manifestVersion !== CURRENT_MANIFEST_VERSION) {\n\t\t\treturn yield* Effect.fail(\n\t\t\t\tnew ManifestError({\n\t\t\t\t\treason: 'version-mismatch',\n\t\t\t\t\tpath,\n\t\t\t\t\tdetail: `expected ${CURRENT_MANIFEST_VERSION}, got ${decoded.manifestVersion}`,\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\t\treturn decoded as ManifestEnvelope;\n\t}).pipe(\n\t\tEffect.withSpan('Manifest.readManifest', { attributes: { 'devstack.manifest.path': path } }),\n\t);\n\n// -----------------------------------------------------------------------------\n// Re-export the envelope + endpoint types so downstream substrate\n// modules (codegen, build integrations) don't reach into substrate/\n// directly.\n// -----------------------------------------------------------------------------\n\nexport type { EndpointEntry, EndpointKey, ManifestCodegen, ManifestEnvelope, PluginKey };\nexport { ManifestEnvelopeSchema };\n"],"mappings":";;;;;AA+DA,IAAa,gBAAb,cAAmC,KAAK,YAAY,gBAAgB,CAUjE;;;;;;;;;;AAmDH,MAAa,iBACZ,UAEA,OAAO,IAAI,aAAa;CACvB,MAAM,WAAoC,EAAE;CAC5C,MAAM,YAA2C,EAAE;CACnD,MAAM,SAAkC,EAAE,GAAG,MAAM,QAAQ;CAE3D,MAAM,eAAe,OACpB,OAAO,IAAI,aAAa;EACvB,MAAM,KAAK,GAAG;AACd,MAAI,MAAM,UACT,QAAO,OAAO,OAAO,KACpB,IAAI,cAAc;GACjB,QAAQ;GACR,MAAM;GACN,QAAQ,eAAe,GAAG;GAC1B,CAAC,CACF;AAEF,YAAU,MAAM;GACf;AAEH,MAAK,MAAM,gBAAgB,MAAM,eAAe;EAC/C,MAAM,MAAM,aAAa;AACzB,MAAI,OAAO,SACV,QAAO,OAAO,OAAO,KACpB,IAAI,cAAc;GACjB,QAAQ;GACR,MAAM;GACN,QAAQ,aAAa,IAAI;GACzB,CAAC,CACF;AAEF,WAAS,OAAO,aAAa;AAC7B,MAAI,aAAa,WAAW,KAAA,EAC3B,MAAK,MAAM,CAAC,UAAU,eAAe,OAAO,QAAQ,aAAa,OAAO,EAAE;AACzE,OAAI,YAAY,OACf,QAAO,OAAO,OAAO,KACpB,IAAI,cAAc;IACjB,QAAQ;IACR,MAAM;IACN,QAAQ,cAAc,SAAS;IAC/B,CAAC,CACF;AAEF,UAAO,YAAY;;AAGrB,OAAK,MAAM,MAAM,aAAa,UAC7B,QAAO,YAAY,GAAG;;AAGxB,MAAK,MAAM,MAAM,MAAM,aAAa,EAAE,CACrC,QAAO,YAAY,GAAG;AAGvB,QAAO;EACN,UAAU,MAAM;EAChB,iBAAA;EACA;EACA;EACA;EAIA,GAAI,MAAM,YAAY,KAAA,IAAY,EAAE,SAAS,MAAM,SAAS,GAAG,EAAE;EACjE;EACA;;;;;;;;AAaH,MAAa,iBACZ,UACA,SAEA,OAAO,IAAI,aAAa;CACvB,MAAM,OAAO,kBAAkB,SAAS;AAExC,QAAO,gBAAgB,MADT,IAAI,aAAa,CAAC,OAAO,KACL,CAAC,CAAC,KACnC,OAAO,UACL,UACA,IAAI,cAAc;EACjB,QAAQ;EACR;EACA,QAAQ,gCAAgC,MAAM;EAC9C;EACA,CAAC,CACH,CACD;EACA,CAAC,KACF,OAAO,SAAS,0BAA0B,EAAE,YAAY,EAAE,0BAA0B,MAAM,EAAE,CAAC,CAC7F;AAEF,MAAM,qBAAqB,aAI1B,KAAK,UAAU,UAAU,MAAM,EAAE"}
|
|
1
|
+
{"version":3,"file":"manifest.mjs","names":[],"sources":["../../../../src/substrate/runtime/manifest/manifest.ts"],"sourcesContent":["// Manifest emitter — endpoint-keyed envelope, atomic write.\n//\n// Architecture § Manifest data model. The envelope is L0 (`identity`\n// tuple, `manifestVersion`, `endpoints` lookup, `extras`).\n//\n// The emitter:\n// - Walks endpoint entries to build the flat `endpoints` lookup\n// keyed by `endpointKey`. Entries carry the declared endpoint\n// `name` for build-integration lookup.\n// - Writes atomically via tempfile + fsync + rename. The atomic-\n// write primitive lives in L0 (per architecture § Collapsed:\n// \"Three tempfile+rename impls → one atomic-write primitive\").\n// - Validates the envelope against `ManifestEnvelopeSchema` on read.\n// - Pins `manifestVersion` so future-proofing migrations have a\n// compatibility seam. The pinned version is `1`.\n//\n// Discipline: zero service names. The schema validates the envelope\n// shape, not the per-plugin contents.\n\nimport { Effect } from 'effect';\nimport { Data } from 'effect';\nimport { FileSystem } from 'effect';\n\nimport type { EndpointKey, PluginKey } from '../../brand.ts';\nimport {\n\ttype EndpointEntry,\n\ttype ManifestCodegen,\n\ttype ManifestExtras,\n\ttype ManifestEnvelope,\n\tManifestEnvelopeSchema,\n} from '../../manifest.ts';\nimport { atomicWriteFile } from '../atomic-write.ts';\nimport { decodeJsonText } from '../runtime-decode.ts';\n\n// -----------------------------------------------------------------------------\n// Pinned schema version\n// -----------------------------------------------------------------------------\n\n/**\n * Schema version pinned at the envelope level. Bump only on a\n * breaking shape change to the envelope (NOT to a per-plugin service\n * slice — those carry their own version via Codegenable contribution).\n *\n * Reader policy:\n * - Equal version: accept.\n * - Older version: refuse (advise user to re-run `up`).\n * - Newer version: refuse (build integration is out of date).\n */\nexport const CURRENT_MANIFEST_VERSION = 1 as const;\n\n// -----------------------------------------------------------------------------\n// Errors\n// -----------------------------------------------------------------------------\n\n/** One error class for every manifest IO failure. */\nexport class ManifestError extends Data.TaggedError('ManifestError')<{\n\treadonly reason:\n\t\t| 'write-failed'\n\t\t| 'read-failed'\n\t\t| 'decode-failed'\n\t\t| 'version-mismatch'\n\t\t| 'duplicate-endpoint';\n\treadonly path: string;\n\treadonly detail?: string;\n\treadonly cause?: unknown;\n}> {}\n\n// -----------------------------------------------------------------------------\n// Public writer interface\n// -----------------------------------------------------------------------------\n\nexport interface WriteManifestInput {\n\treadonly identity: ManifestEnvelope['identity'];\n\treadonly endpoints?: ReadonlyArray<EndpointEntry>;\n\treadonly extras?: ManifestExtras;\n\t/** Per-stack codegen metadata (the dev-only `extrasDir` + live\n\t * `idsFile`). Optional + additive — omitting it produces an envelope\n\t * without the `codegen` key, identical to a pre-field manifest. */\n\treadonly codegen?: ManifestCodegen;\n}\n\n/**\n * Build the envelope from endpoint entries + extras. Pure; the writer\n * calls this and then atomically writes the JSON.\n *\n * Endpoint-key collisions error: every endpoint has a unique\n * `(pluginKey, dispatchId)` digest by construction; a duplicate means\n * a substrate bug.\n */\nexport const buildEnvelope = (\n\tinput: WriteManifestInput,\n): Effect.Effect<ManifestEnvelope, ManifestError> =>\n\tEffect.gen(function* () {\n\t\tconst endpoints: Record<string, EndpointEntry> = {};\n\t\tconst extras: Record<string, unknown> = { ...input.extras };\n\n\t\tconst addEndpoint = (ep: EndpointEntry): Effect.Effect<void, ManifestError> =>\n\t\t\tEffect.gen(function* () {\n\t\t\t\tconst ek = ep.endpointKey as string;\n\t\t\t\tif (ek in endpoints) {\n\t\t\t\t\treturn yield* Effect.fail(\n\t\t\t\t\t\tnew ManifestError({\n\t\t\t\t\t\t\treason: 'duplicate-endpoint',\n\t\t\t\t\t\t\tpath: '(in-memory envelope)',\n\t\t\t\t\t\t\tdetail: `endpointKey ${ek} contributed twice`,\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tendpoints[ek] = ep;\n\t\t\t});\n\n\t\tfor (const ep of input.endpoints ?? []) {\n\t\t\tyield* addEndpoint(ep);\n\t\t}\n\n\t\treturn {\n\t\t\tidentity: input.identity,\n\t\t\tmanifestVersion: CURRENT_MANIFEST_VERSION,\n\t\t\tendpoints,\n\t\t\textras,\n\t\t\t// Spread only when present so an omitted `codegen` yields the\n\t\t\t// exact same envelope (and serialized bytes) as a pre-field\n\t\t\t// manifest — additive, no churn for stacks that don't record it.\n\t\t\t...(input.codegen !== undefined ? { codegen: input.codegen } : {}),\n\t\t};\n\t});\n\n// -----------------------------------------------------------------------------\n// Atomic write — delegates to the canonical primitive.\n// -----------------------------------------------------------------------------\n\n/**\n * Serialize and write the envelope at `path` atomically. Routes\n * through the canonical `atomicWriteFile` primitive (mkdir-parent →\n * O_EXCL temp → write → fsync → rename), so the manifest writer\n * shares ONE owner of the tempfile dance with the cache.\n */\nexport const writeManifest = (\n\tenvelope: ManifestEnvelope,\n\tpath: string,\n): Effect.Effect<void, ManifestError, FileSystem.FileSystem> =>\n\tEffect.gen(function* () {\n\t\tconst json = serializeEnvelope(envelope);\n\t\tconst bytes = new TextEncoder().encode(json);\n\t\tyield* atomicWriteFile(path, bytes).pipe(\n\t\t\tEffect.mapError(\n\t\t\t\t(cause) =>\n\t\t\t\t\tnew ManifestError({\n\t\t\t\t\t\treason: 'write-failed',\n\t\t\t\t\t\tpath,\n\t\t\t\t\t\tdetail: `atomic write failed at stage ${cause.stage}`,\n\t\t\t\t\t\tcause,\n\t\t\t\t\t}),\n\t\t\t),\n\t\t);\n\t});\n\nconst serializeEnvelope = (envelope: ManifestEnvelope): string =>\n\t// Stable key ordering, deterministic re-emit. `JSON.stringify` with\n\t// 2-space indent is reproducible byte-for-byte given the same\n\t// input object.\n\tJSON.stringify(envelope, null, 2);\n\n// -----------------------------------------------------------------------------\n// Read + decode\n// -----------------------------------------------------------------------------\n\n/**\n * Read and decode the manifest at `path`. Validates against\n * `ManifestEnvelopeSchema` and the pinned `CURRENT_MANIFEST_VERSION`.\n *\n * Used by:\n * - Build integrations (Vitest, Playwright, generated app code) — consumes\n * `envelope.endpoints` lookup.\n *\n * The reader is read-only; no mutation, no IO beyond the single read.\n */\nexport const readManifest = (\n\tpath: string,\n): Effect.Effect<ManifestEnvelope, ManifestError, FileSystem.FileSystem> =>\n\tEffect.gen(function* () {\n\t\tconst fs = yield* FileSystem.FileSystem;\n\t\tconst text = yield* fs\n\t\t\t.readFileString(path)\n\t\t\t.pipe(Effect.mapError((cause) => new ManifestError({ reason: 'read-failed', path, cause })));\n\t\tconst decoded = yield* decodeJsonText(ManifestEnvelopeSchema, text, {\n\t\t\tsource: path,\n\t\t\tmkError: (issue) =>\n\t\t\t\tnew ManifestError({ reason: 'decode-failed', path, cause: issue.cause ?? issue }),\n\t\t});\n\t\tif (decoded.manifestVersion !== CURRENT_MANIFEST_VERSION) {\n\t\t\treturn yield* Effect.fail(\n\t\t\t\tnew ManifestError({\n\t\t\t\t\treason: 'version-mismatch',\n\t\t\t\t\tpath,\n\t\t\t\t\tdetail: `expected ${CURRENT_MANIFEST_VERSION}, got ${decoded.manifestVersion}`,\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\t\treturn decoded as ManifestEnvelope;\n\t});\n\n// -----------------------------------------------------------------------------\n// Re-export the envelope + endpoint types so downstream substrate\n// modules (codegen, build integrations) don't reach into substrate/\n// directly.\n// -----------------------------------------------------------------------------\n\nexport type { EndpointEntry, EndpointKey, ManifestCodegen, ManifestEnvelope, PluginKey };\nexport { ManifestEnvelopeSchema };\n"],"mappings":";;;;;AAuDA,IAAa,gBAAb,cAAmC,KAAK,YAAY,eAAe,CAAC,CAUjE,CAAC;;;;;;;;;AAwBJ,MAAa,iBACZ,UAEA,OAAO,IAAI,aAAa;CACvB,MAAM,YAA2C,CAAC;CAClD,MAAM,SAAkC,EAAE,GAAG,MAAM,OAAO;CAE1D,MAAM,eAAe,OACpB,OAAO,IAAI,aAAa;EACvB,MAAM,KAAK,GAAG;EACd,IAAI,MAAM,WACT,OAAO,OAAO,OAAO,KACpB,IAAI,cAAc;GACjB,QAAQ;GACR,MAAM;GACN,QAAQ,eAAe,GAAG;EAC3B,CAAC,CACF;EAED,UAAU,MAAM;CACjB,CAAC;CAEF,KAAK,MAAM,MAAM,MAAM,aAAa,CAAC,GACpC,OAAO,YAAY,EAAE;CAGtB,OAAO;EACN,UAAU,MAAM;EAChB,iBAAA;EACA;EACA;EAIA,GAAI,MAAM,YAAY,KAAA,IAAY,EAAE,SAAS,MAAM,QAAQ,IAAI,CAAC;CACjE;AACD,CAAC;;;;;;;AAYF,MAAa,iBACZ,UACA,SAEA,OAAO,IAAI,aAAa;CACvB,MAAM,OAAO,kBAAkB,QAAQ;CAEvC,OAAO,gBAAgB,MADT,IAAI,YAAY,CAAC,CAAC,OAAO,IACN,CAAC,CAAC,CAAC,KACnC,OAAO,UACL,UACA,IAAI,cAAc;EACjB,QAAQ;EACR;EACA,QAAQ,gCAAgC,MAAM;EAC9C;CACD,CAAC,CACH,CACD;AACD,CAAC;AAEF,MAAM,qBAAqB,aAI1B,KAAK,UAAU,UAAU,MAAM,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
import * as _$effect_Cause0 from "effect/Cause";
|
|
3
2
|
|
|
4
3
|
//#region src/substrate/runtime/mode-errors.d.ts
|
|
5
4
|
declare const ForkIncompatibleError_base: Schema.Class<ForkIncompatibleError, Schema.TaggedStruct<"ForkIncompatibleError", {
|
|
@@ -13,7 +12,7 @@ declare const ForkIncompatibleError_base: Schema.Class<ForkIncompatibleError, Sc
|
|
|
13
12
|
/** Optional original cause when the refusal wraps an underlying
|
|
14
13
|
* fault (rare — typical use is a pure factory-time refusal). */
|
|
15
14
|
readonly cause: Schema.optional<Schema.Defect>;
|
|
16
|
-
}>,
|
|
15
|
+
}>, import("effect/Cause").YieldableError>;
|
|
17
16
|
/**
|
|
18
17
|
* Synchronous factory-time refusal raised by a plugin factory
|
|
19
18
|
* variant when composed against a network the variant cannot serve
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mode-errors.mjs","names":[],"sources":["../../../src/substrate/runtime/mode-errors.ts"],"sourcesContent":["// Cross-cutting mode-refusal errors.\n//\n// Reviews finding (cross-cutting.md §\"Error model\"): the\n// `ForkIncompatibleError` tag is defined twice today — once in\n// `plugins/walrus/errors.ts`, once in `plugins/seal/errors.ts` — with\n// conflicting field shapes. Two `_tag` literals with the same name\n// but different shapes violate STYLE_GUIDE §2 (\"One `_tag` literal\n// per logical error type across the whole package\").\n//\n// Lift the canonical shape here. Both plugins import from substrate\n// in PR3; this PR does NOT modify the plugin-side error files (per\n// PR1 scope).\n//\n// Shape decision:\n// - `variant` carries the refusing factory name (e.g.\n// `'walrusLocalCluster'`, `'sealLocalKeygen'`). Lets walrus and\n// seal share the shape without losing the call-site distinction.\n// - `network` carries the resolved `*-fork` network string the\n// user passed.\n// - `message` is the imperative one-liner suitable for stderr.\n// - `hint` is the actionable next step (the known-deployment\n// alternative).\n//\n// Substrate is name-blind on the plugin level — these fields are\n// generic (\"which factory variant refused\" + \"which network it\n// refused under\") and do NOT name walrus / seal.\n\nimport { Schema } from 'effect';\n\n/**\n * Synchronous factory-time refusal raised by a plugin factory\n * variant when composed against a network the variant cannot serve\n * (canonically: a `*-fork` chain that doesn't expose the fullnode\n * surface the variant requires).\n *\n * Architecture (Tension 11): primary refusal is TYPE-LEVEL via\n * mode-narrowed factory namespaces — `walrusFor(forkNet).<mode>` only\n * exposes `.known`. This runtime shape is defense-in-depth for\n * callers that bypass the type-level narrowing (env-driven factories,\n * plugin composition through resolved values).\n *\n * Used by walrus (`local-cluster` variant) and seal (`local-keygen`\n * variant) today; future plugin factories refusing on a network\n * predicate share this single shape.\n */\nexport class ForkIncompatibleError extends Schema.TaggedErrorClass<ForkIncompatibleError>()(\n\t'ForkIncompatibleError',\n\t{\n\t\t/** Refusing factory variant — e.g. `'walrusLocalCluster'`,\n\t\t * `'sealLocalKeygen'`. Lets multiple plugin factories share\n\t\t * this shape without losing the call-site distinction. */\n\t\tvariant: Schema.String,\n\t\t/** Resolved network the composition refused under. */\n\t\tnetwork: Schema.String,\n\t\t/** Imperative one-liner suitable for stderr. */\n\t\tmessage: Schema.String,\n\t\t/** Actionable next step (the known-deployment alternative). */\n\t\thint: Schema.optional(Schema.String),\n\t\t/** Optional original cause when the refusal wraps an underlying\n\t\t * fault (rare — typical use is a pure factory-time refusal). */\n\t\tcause: Schema.optional(Schema.Defect),\n\t},\n) {}\n"],"mappings":";AA6C2C,OAAO,
|
|
1
|
+
{"version":3,"file":"mode-errors.mjs","names":[],"sources":["../../../src/substrate/runtime/mode-errors.ts"],"sourcesContent":["// Cross-cutting mode-refusal errors.\n//\n// Reviews finding (cross-cutting.md §\"Error model\"): the\n// `ForkIncompatibleError` tag is defined twice today — once in\n// `plugins/walrus/errors.ts`, once in `plugins/seal/errors.ts` — with\n// conflicting field shapes. Two `_tag` literals with the same name\n// but different shapes violate STYLE_GUIDE §2 (\"One `_tag` literal\n// per logical error type across the whole package\").\n//\n// Lift the canonical shape here. Both plugins import from substrate\n// in PR3; this PR does NOT modify the plugin-side error files (per\n// PR1 scope).\n//\n// Shape decision:\n// - `variant` carries the refusing factory name (e.g.\n// `'walrusLocalCluster'`, `'sealLocalKeygen'`). Lets walrus and\n// seal share the shape without losing the call-site distinction.\n// - `network` carries the resolved `*-fork` network string the\n// user passed.\n// - `message` is the imperative one-liner suitable for stderr.\n// - `hint` is the actionable next step (the known-deployment\n// alternative).\n//\n// Substrate is name-blind on the plugin level — these fields are\n// generic (\"which factory variant refused\" + \"which network it\n// refused under\") and do NOT name walrus / seal.\n\nimport { Schema } from 'effect';\n\n/**\n * Synchronous factory-time refusal raised by a plugin factory\n * variant when composed against a network the variant cannot serve\n * (canonically: a `*-fork` chain that doesn't expose the fullnode\n * surface the variant requires).\n *\n * Architecture (Tension 11): primary refusal is TYPE-LEVEL via\n * mode-narrowed factory namespaces — `walrusFor(forkNet).<mode>` only\n * exposes `.known`. This runtime shape is defense-in-depth for\n * callers that bypass the type-level narrowing (env-driven factories,\n * plugin composition through resolved values).\n *\n * Used by walrus (`local-cluster` variant) and seal (`local-keygen`\n * variant) today; future plugin factories refusing on a network\n * predicate share this single shape.\n */\nexport class ForkIncompatibleError extends Schema.TaggedErrorClass<ForkIncompatibleError>()(\n\t'ForkIncompatibleError',\n\t{\n\t\t/** Refusing factory variant — e.g. `'walrusLocalCluster'`,\n\t\t * `'sealLocalKeygen'`. Lets multiple plugin factories share\n\t\t * this shape without losing the call-site distinction. */\n\t\tvariant: Schema.String,\n\t\t/** Resolved network the composition refused under. */\n\t\tnetwork: Schema.String,\n\t\t/** Imperative one-liner suitable for stderr. */\n\t\tmessage: Schema.String,\n\t\t/** Actionable next step (the known-deployment alternative). */\n\t\thint: Schema.optional(Schema.String),\n\t\t/** Optional original cause when the refusal wraps an underlying\n\t\t * fault (rare — typical use is a pure factory-time refusal). */\n\t\tcause: Schema.optional(Schema.Defect),\n\t},\n) {}\n"],"mappings":";AA6C2C,OAAO,iBAAwC,CAAC,CAC1F,yBACA;;;;CAIC,SAAS,OAAO;;CAEhB,SAAS,OAAO;;CAEhB,SAAS,OAAO;;CAEhB,MAAM,OAAO,SAAS,OAAO,MAAM;;;CAGnC,OAAO,OAAO,SAAS,OAAO,MAAM;AACrC,CACD"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { redactText, redactValue } from "./redaction.mjs";
|
|
2
2
|
import { Cause } from "effect";
|
|
3
3
|
//#region src/substrate/runtime/observability/cascade-formatter.ts
|
|
4
|
-
/** Empty registry — the formatter falls back to the default
|
|
5
|
-
* rendering for every value. */
|
|
6
|
-
const emptyFormatterRegistry = /* @__PURE__ */ new Map();
|
|
7
4
|
const DEFAULT_FIELD_TRUNCATE = 8192;
|
|
8
5
|
const DEFAULT_MAX_DEPTH = 12;
|
|
9
6
|
const isTaggedError = (value) => typeof value === "object" && value !== null && typeof value._tag === "string";
|
|
@@ -18,7 +15,6 @@ const isTaggedError = (value) => typeof value === "object" && value !== null &&
|
|
|
18
15
|
*/
|
|
19
16
|
const formatCause = (cause, options) => {
|
|
20
17
|
const opts = {
|
|
21
|
-
formatters: options?.formatters ?? emptyFormatterRegistry,
|
|
22
18
|
fieldTruncate: options?.fieldTruncate ?? DEFAULT_FIELD_TRUNCATE,
|
|
23
19
|
maxDepth: options?.maxDepth ?? DEFAULT_MAX_DEPTH,
|
|
24
20
|
redactions: options?.redactions ?? []
|
|
@@ -37,7 +33,6 @@ const formatCause = (cause, options) => {
|
|
|
37
33
|
*/
|
|
38
34
|
const formatValue = (value, options) => {
|
|
39
35
|
return formatAny(value, {
|
|
40
|
-
formatters: options?.formatters ?? emptyFormatterRegistry,
|
|
41
36
|
fieldTruncate: options?.fieldTruncate ?? DEFAULT_FIELD_TRUNCATE,
|
|
42
37
|
maxDepth: options?.maxDepth ?? DEFAULT_MAX_DEPTH,
|
|
43
38
|
redactions: options?.redactions ?? []
|
|
@@ -78,11 +73,6 @@ const formatAny = (value, opts, visited, depth) => {
|
|
|
78
73
|
}
|
|
79
74
|
};
|
|
80
75
|
const formatTagged = (value, opts, visited, depth) => {
|
|
81
|
-
const override = opts.formatters.get(value._tag);
|
|
82
|
-
if (override) {
|
|
83
|
-
const result = override(value, (inner) => formatAny(inner, opts, visited, depth + 1));
|
|
84
|
-
if (result !== null) return result;
|
|
85
|
-
}
|
|
86
76
|
const qualifier = typeof value.phase === "string" ? `(${value.phase})` : typeof value.op === "string" ? `(${value.op})` : "";
|
|
87
77
|
const message = typeof value.message === "string" ? redactText(value.message, opts.redactions) : "";
|
|
88
78
|
const header = qualifier ? `${value._tag} ${qualifier}: ${message}` : `${value._tag}: ${message}`;
|
|
@@ -126,6 +116,6 @@ const safeJson = (value, limit, redactions) => {
|
|
|
126
116
|
}
|
|
127
117
|
};
|
|
128
118
|
//#endregion
|
|
129
|
-
export {
|
|
119
|
+
export { formatCause, formatValue, isTaggedError };
|
|
130
120
|
|
|
131
121
|
//# sourceMappingURL=cascade-formatter.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cascade-formatter.mjs","names":[],"sources":["../../../../src/substrate/runtime/observability/cascade-formatter.ts"],"sourcesContent":["// L0 cascade formatter.\n//\n// Architecture § Substrate violations § \"C2 — relocate cause walker\n// from the renderer\". The cascade formatter walks an Effect `Cause`\n// and returns a stringified cascade of taxonomy-aware lines. Called\n// from CLI, TUI, prune — anywhere a failure surfaces.\n//\n// Hard rules:\n// - PURE. No IO, no Effect, no clocks. Input → string.\n// - No service names: the formatter inspects `_tag` strings and\n// structured fields verbatim, never branches on a specific\n// concrete plugin error class.\n// - Pluggable per-error-class formatters via a `formatters` map\n// keyed by `_tag`. The default formatter handles tagged errors,\n// plain `Error`, defects, and Interrupts.\n//\n// Output shape:\n//\n// <Tag> (<phase?>): <message>\n// exitCode: <n>\n// stderr: <text…[truncated]>\n// <field>: <value>\n// caused by:\n// <recursive render, indented by 2 spaces>\n//\n// Multi-`Fail` causes (parallel failures) render with a `--- (also)`\n// separator. Defects (`Die`) render with `DEFECT (<tag>?)` prefix so\n// the operator can tell programmer errors from typed failures at a\n// glance. Interrupts render as `INTERRUPT[<fiberId>]`.\n\nimport { Cause } from 'effect';\n\nimport { redactText, redactValue, type RedactionRule } from './redaction.ts';\n\n// -----------------------------------------------------------------------------\n// Plug-in formatter API\n// -----------------------------------------------------------------------------\n\n/**\n * Per-tag formatter override. Receives the tagged-error-like value\n * and the default formatter (so a plugin formatter can recurse on a\n * nested `cause` field without re-implementing the walk).\n *\n * Return `null` to fall back to the default rendering.\n *\n * Architecture: the formatter registry is keyed by `_tag` string —\n * the substrate never imports a concrete plugin error class. Plugins\n * register their custom renderer via the supervisor harvest loop over\n * `errorContributions` (see `substrate/plugin.ts:PluginErrorContribution`).\n */\nexport type TagFormatter = (\n\tvalue: TaggedErrorLike,\n\trecurse: (inner: unknown) => string,\n) => string | null;\n\n/** Per-tag formatter map. */\nexport type FormatterRegistry = ReadonlyMap<string, TagFormatter>;\n\n/** Empty registry — the formatter falls back to the default\n * rendering for every value. */\nexport const emptyFormatterRegistry: FormatterRegistry = new Map();\n\n// -----------------------------------------------------------------------------\n// Render budget\n// -----------------------------------------------------------------------------\n\nconst DEFAULT_FIELD_TRUNCATE = 8192;\nconst DEFAULT_MAX_DEPTH = 12;\n\nexport interface FormatOptions {\n\t/** Per-tag override registry. Defaults to the empty registry. */\n\treadonly formatters?: FormatterRegistry;\n\t/** Truncate individual fields (stderr/stdout/detail) past this\n\t * length. Default 8 KiB. */\n\treadonly fieldTruncate?: number;\n\t/** Hard recursion cap. Cyclic graphs are detected separately by\n\t * visit-set; this guards against pathological cause chains.\n\t * Default 12. */\n\treadonly maxDepth?: number;\n\t/** Optional redaction rules applied before rendering string fields. */\n\treadonly redactions?: ReadonlyArray<RedactionRule>;\n}\n\n// -----------------------------------------------------------------------------\n// Type guards (structural — no imports of concrete classes)\n// -----------------------------------------------------------------------------\n\n/** Shape of a `Schema.TaggedError` / `Data.TaggedError` instance.\n * The cascade formatter never imports a concrete class — it dispatches\n * on `_tag`. */\nexport interface TaggedErrorLike {\n\treadonly _tag: string;\n\treadonly message?: unknown;\n\treadonly cause?: unknown;\n\treadonly phase?: unknown;\n\treadonly stderr?: unknown;\n\treadonly stdout?: unknown;\n\treadonly exitCode?: unknown;\n\treadonly [key: string]: unknown;\n\treadonly detail?: unknown;\n\treadonly op?: unknown;\n}\n\nexport const isTaggedError = (value: unknown): value is TaggedErrorLike =>\n\ttypeof value === 'object' &&\n\tvalue !== null &&\n\ttypeof (value as { _tag?: unknown })._tag === 'string';\n\n// -----------------------------------------------------------------------------\n// Public entry points\n// -----------------------------------------------------------------------------\n\n/**\n * Format an Effect `Cause<E>` as a multi-line cascade string. Pure.\n *\n * Multiple `Fail` reasons render as separate blocks joined by\n * `--- (also)` so parallel failures are visible. Defects render with\n * a `DEFECT` prefix. Interrupts render with `INTERRUPT[<fiberId>]`.\n *\n * Cyclic `cause` chains are broken with `…[cycle]`.\n */\nexport const formatCause = <E>(cause: Cause.Cause<E>, options?: FormatOptions): string => {\n\tconst opts: Required<FormatOptions> = {\n\t\tformatters: options?.formatters ?? emptyFormatterRegistry,\n\t\tfieldTruncate: options?.fieldTruncate ?? DEFAULT_FIELD_TRUNCATE,\n\t\tmaxDepth: options?.maxDepth ?? DEFAULT_MAX_DEPTH,\n\t\tredactions: options?.redactions ?? [],\n\t};\n\tconst visited = new WeakSet<object>();\n\tif (cause.reasons.length === 0) return '(empty cause)';\n\tconst rendered = cause.reasons.map((reason) => formatReason(reason, opts, visited, 0));\n\treturn rendered.join('\\n--- (also)\\n');\n};\n\n/**\n * Format an arbitrary value (a `Cause`, a tagged error, a plain\n * `Error`, or anything else) using the cascade rules. Pure.\n *\n * The pretty-error renderer (`pretty-error.ts`) is a thin wrapper\n * over this — it just sets the IO conventions (where to write,\n * what to truncate per-context). The formatting logic lives here.\n */\nexport const formatValue = (value: unknown, options?: FormatOptions): string => {\n\tconst opts: Required<FormatOptions> = {\n\t\tformatters: options?.formatters ?? emptyFormatterRegistry,\n\t\tfieldTruncate: options?.fieldTruncate ?? DEFAULT_FIELD_TRUNCATE,\n\t\tmaxDepth: options?.maxDepth ?? DEFAULT_MAX_DEPTH,\n\t\tredactions: options?.redactions ?? [],\n\t};\n\treturn formatAny(value, opts, new WeakSet(), 0);\n};\n\n// -----------------------------------------------------------------------------\n// Internals\n// -----------------------------------------------------------------------------\n\nconst truncate = (s: string, limit: number, redactions: ReadonlyArray<RedactionRule>): string => {\n\tconst redacted = redactText(s, redactions);\n\treturn redacted.length > limit ? `${redacted.slice(0, limit)}…[truncated]` : redacted;\n};\n\nconst indent = (s: string, prefix: string): string =>\n\ts\n\t\t.split('\\n')\n\t\t.map((line) => `${prefix}${line}`)\n\t\t.join('\\n');\n\nconst formatReason = (\n\treason: Cause.Reason<unknown>,\n\topts: Required<FormatOptions>,\n\tvisited: WeakSet<object>,\n\tdepth: number,\n): string => {\n\tif (Cause.isFailReason(reason)) {\n\t\treturn formatAny(reason.error, opts, visited, depth);\n\t}\n\tif (Cause.isDieReason(reason)) {\n\t\tconst inner = formatAny(reason.defect, opts, visited, depth);\n\t\treturn `DEFECT:\\n${indent(inner, ' ')}`;\n\t}\n\t// Cause.isInterruptReason(reason)\n\treturn `INTERRUPT[${reason.fiberId ?? 'unknown'}]`;\n};\n\nconst formatAny = (\n\tvalue: unknown,\n\topts: Required<FormatOptions>,\n\tvisited: WeakSet<object>,\n\tdepth: number,\n): string => {\n\tif (value === undefined || value === null) return '';\n\tif (depth > opts.maxDepth) return '…[max depth]';\n\tif (typeof value === 'object') {\n\t\tif (visited.has(value as object)) return '…[cycle]';\n\t\tvisited.add(value as object);\n\t}\n\tif (Cause.isCause(value)) {\n\t\tif (value.reasons.length === 0) return '(empty cause)';\n\t\treturn value.reasons.map((r) => formatReason(r, opts, visited, depth)).join('\\n--- (also)\\n');\n\t}\n\tif (isTaggedError(value)) {\n\t\treturn formatTagged(value, opts, visited, depth);\n\t}\n\tif (value instanceof Error) {\n\t\tconst header = `${value.name}: ${value.message}`;\n\t\tif (value.stack && value.stack !== header) return value.stack;\n\t\treturn header;\n\t}\n\tif (typeof value === 'string') return redactText(value, opts.redactions);\n\ttry {\n\t\treturn JSON.stringify(redactValue(value, opts.redactions));\n\t} catch {\n\t\treturn String(value);\n\t}\n};\n\nconst formatTagged = (\n\tvalue: TaggedErrorLike,\n\topts: Required<FormatOptions>,\n\tvisited: WeakSet<object>,\n\tdepth: number,\n): string => {\n\tconst override = opts.formatters.get(value._tag);\n\tif (override) {\n\t\tconst result = override(value, (inner) => formatAny(inner, opts, visited, depth + 1));\n\t\tif (result !== null) return result;\n\t}\n\n\tconst qualifier =\n\t\ttypeof value.phase === 'string'\n\t\t\t? `(${value.phase})`\n\t\t\t: typeof value.op === 'string'\n\t\t\t\t? `(${value.op})`\n\t\t\t\t: '';\n\tconst message =\n\t\ttypeof value.message === 'string' ? redactText(value.message, opts.redactions) : '';\n\tconst header = qualifier ? `${value._tag} ${qualifier}: ${message}` : `${value._tag}: ${message}`;\n\n\tconst lines: Array<string> = [header];\n\tif (typeof value.exitCode === 'number') lines.push(` exitCode: ${value.exitCode}`);\n\tif (typeof value.stderr === 'string' && value.stderr.trim().length > 0) {\n\t\tlines.push(` stderr: ${truncate(value.stderr.trim(), opts.fieldTruncate, opts.redactions)}`);\n\t}\n\tif (typeof value.stdout === 'string' && value.stdout.trim().length > 0) {\n\t\tlines.push(` stdout: ${truncate(value.stdout.trim(), opts.fieldTruncate, opts.redactions)}`);\n\t}\n\tif (typeof value.detail === 'string' && value.detail.trim().length > 0) {\n\t\tlines.push(` detail: ${truncate(value.detail.trim(), opts.fieldTruncate, opts.redactions)}`);\n\t}\n\n\t// Surface any extra plain-data fields the tagged error carries.\n\t// We skip the conventional ones already rendered above plus `_tag`,\n\t// `cause`. This makes the formatter discover-by-shape: a plugin\n\t// adding `path` or `kind` to its error gets it rendered for free.\n\tconst conventional = new Set([\n\t\t'_tag',\n\t\t'message',\n\t\t'cause',\n\t\t'phase',\n\t\t'stderr',\n\t\t'stdout',\n\t\t'exitCode',\n\t\t'detail',\n\t\t'op',\n\t]);\n\tfor (const key of Object.keys(value)) {\n\t\tif (conventional.has(key)) continue;\n\t\tconst v = (value as unknown as Record<string, unknown>)[key];\n\t\tif (v === undefined || v === null) continue;\n\t\tconst rendered =\n\t\t\ttypeof v === 'string'\n\t\t\t\t? truncate(v, opts.fieldTruncate, opts.redactions)\n\t\t\t\t: typeof v === 'number' || typeof v === 'boolean'\n\t\t\t\t\t? String(v)\n\t\t\t\t\t: safeJson(v, opts.fieldTruncate, opts.redactions);\n\t\tlines.push(` ${key}: ${rendered}`);\n\t}\n\n\tif (value.cause !== undefined && value.cause !== null) {\n\t\tconst rendered = formatAny(value.cause, opts, visited, depth + 1);\n\t\tif (rendered.trim().length > 0 && rendered.trim() !== header.trim()) {\n\t\t\tlines.push(' caused by:');\n\t\t\tlines.push(indent(rendered, ' '));\n\t\t}\n\t}\n\treturn lines.join('\\n');\n};\n\nconst safeJson = (\n\tvalue: unknown,\n\tlimit: number,\n\tredactions: ReadonlyArray<RedactionRule>,\n): string => {\n\ttry {\n\t\treturn truncate(JSON.stringify(redactValue(value, redactions)), limit, redactions);\n\t} catch {\n\t\treturn '[unserializable]';\n\t}\n};\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"cascade-formatter.mjs","names":[],"sources":["../../../../src/substrate/runtime/observability/cascade-formatter.ts"],"sourcesContent":["// L0 cascade formatter.\n//\n// Architecture § Substrate violations § \"C2 — relocate cause walker\n// from the renderer\". The cascade formatter walks an Effect `Cause`\n// and returns a stringified cascade of taxonomy-aware lines. Called\n// from CLI, TUI, prune — anywhere a failure surfaces.\n//\n// Hard rules:\n// - PURE. No IO, no Effect, no clocks. Input → string.\n// - No service names: the formatter inspects `_tag` strings and\n// structured fields verbatim, never branches on a specific\n// concrete plugin error class.\n// - Discover-by-shape: the default rendering handles tagged errors,\n// plain `Error`, defects, and Interrupts. A tagged error's extra\n// plain-data fields render automatically (see `formatTagged`).\n//\n// Output shape:\n//\n// <Tag> (<phase?>): <message>\n// exitCode: <n>\n// stderr: <text…[truncated]>\n// <field>: <value>\n// caused by:\n// <recursive render, indented by 2 spaces>\n//\n// Multi-`Fail` causes (parallel failures) render with a `--- (also)`\n// separator. Defects (`Die`) render with `DEFECT (<tag>?)` prefix so\n// the operator can tell programmer errors from typed failures at a\n// glance. Interrupts render as `INTERRUPT[<fiberId>]`.\n\nimport { Cause } from 'effect';\n\nimport { redactText, redactValue, type RedactionRule } from './redaction.ts';\n\n// -----------------------------------------------------------------------------\n// Render budget\n// -----------------------------------------------------------------------------\n\nconst DEFAULT_FIELD_TRUNCATE = 8192;\nconst DEFAULT_MAX_DEPTH = 12;\n\nexport interface FormatOptions {\n\t/** Truncate individual fields (stderr/stdout/detail) past this\n\t * length. Default 8 KiB. */\n\treadonly fieldTruncate?: number;\n\t/** Hard recursion cap. Cyclic graphs are detected separately by\n\t * visit-set; this guards against pathological cause chains.\n\t * Default 12. */\n\treadonly maxDepth?: number;\n\t/** Optional redaction rules applied before rendering string fields. */\n\treadonly redactions?: ReadonlyArray<RedactionRule>;\n}\n\n// -----------------------------------------------------------------------------\n// Type guards (structural — no imports of concrete classes)\n// -----------------------------------------------------------------------------\n\n/** Shape of a `Schema.TaggedError` / `Data.TaggedError` instance.\n * The cascade formatter never imports a concrete class — it dispatches\n * on `_tag`. */\nexport interface TaggedErrorLike {\n\treadonly _tag: string;\n\treadonly message?: unknown;\n\treadonly cause?: unknown;\n\treadonly phase?: unknown;\n\treadonly stderr?: unknown;\n\treadonly stdout?: unknown;\n\treadonly exitCode?: unknown;\n\treadonly [key: string]: unknown;\n\treadonly detail?: unknown;\n\treadonly op?: unknown;\n}\n\nexport const isTaggedError = (value: unknown): value is TaggedErrorLike =>\n\ttypeof value === 'object' &&\n\tvalue !== null &&\n\ttypeof (value as { _tag?: unknown })._tag === 'string';\n\n// -----------------------------------------------------------------------------\n// Public entry points\n// -----------------------------------------------------------------------------\n\n/**\n * Format an Effect `Cause<E>` as a multi-line cascade string. Pure.\n *\n * Multiple `Fail` reasons render as separate blocks joined by\n * `--- (also)` so parallel failures are visible. Defects render with\n * a `DEFECT` prefix. Interrupts render with `INTERRUPT[<fiberId>]`.\n *\n * Cyclic `cause` chains are broken with `…[cycle]`.\n */\nexport const formatCause = <E>(cause: Cause.Cause<E>, options?: FormatOptions): string => {\n\tconst opts: Required<FormatOptions> = {\n\t\tfieldTruncate: options?.fieldTruncate ?? DEFAULT_FIELD_TRUNCATE,\n\t\tmaxDepth: options?.maxDepth ?? DEFAULT_MAX_DEPTH,\n\t\tredactions: options?.redactions ?? [],\n\t};\n\tconst visited = new WeakSet<object>();\n\tif (cause.reasons.length === 0) return '(empty cause)';\n\tconst rendered = cause.reasons.map((reason) => formatReason(reason, opts, visited, 0));\n\treturn rendered.join('\\n--- (also)\\n');\n};\n\n/**\n * Format an arbitrary value (a `Cause`, a tagged error, a plain\n * `Error`, or anything else) using the cascade rules. Pure.\n *\n * The pretty-error renderer (`pretty-error.ts`) is a thin wrapper\n * over this — it just sets the IO conventions (where to write,\n * what to truncate per-context). The formatting logic lives here.\n */\nexport const formatValue = (value: unknown, options?: FormatOptions): string => {\n\tconst opts: Required<FormatOptions> = {\n\t\tfieldTruncate: options?.fieldTruncate ?? DEFAULT_FIELD_TRUNCATE,\n\t\tmaxDepth: options?.maxDepth ?? DEFAULT_MAX_DEPTH,\n\t\tredactions: options?.redactions ?? [],\n\t};\n\treturn formatAny(value, opts, new WeakSet(), 0);\n};\n\n// -----------------------------------------------------------------------------\n// Internals\n// -----------------------------------------------------------------------------\n\nconst truncate = (s: string, limit: number, redactions: ReadonlyArray<RedactionRule>): string => {\n\tconst redacted = redactText(s, redactions);\n\treturn redacted.length > limit ? `${redacted.slice(0, limit)}…[truncated]` : redacted;\n};\n\nconst indent = (s: string, prefix: string): string =>\n\ts\n\t\t.split('\\n')\n\t\t.map((line) => `${prefix}${line}`)\n\t\t.join('\\n');\n\nconst formatReason = (\n\treason: Cause.Reason<unknown>,\n\topts: Required<FormatOptions>,\n\tvisited: WeakSet<object>,\n\tdepth: number,\n): string => {\n\tif (Cause.isFailReason(reason)) {\n\t\treturn formatAny(reason.error, opts, visited, depth);\n\t}\n\tif (Cause.isDieReason(reason)) {\n\t\tconst inner = formatAny(reason.defect, opts, visited, depth);\n\t\treturn `DEFECT:\\n${indent(inner, ' ')}`;\n\t}\n\t// Cause.isInterruptReason(reason)\n\treturn `INTERRUPT[${reason.fiberId ?? 'unknown'}]`;\n};\n\nconst formatAny = (\n\tvalue: unknown,\n\topts: Required<FormatOptions>,\n\tvisited: WeakSet<object>,\n\tdepth: number,\n): string => {\n\tif (value === undefined || value === null) return '';\n\tif (depth > opts.maxDepth) return '…[max depth]';\n\tif (typeof value === 'object') {\n\t\tif (visited.has(value as object)) return '…[cycle]';\n\t\tvisited.add(value as object);\n\t}\n\tif (Cause.isCause(value)) {\n\t\tif (value.reasons.length === 0) return '(empty cause)';\n\t\treturn value.reasons.map((r) => formatReason(r, opts, visited, depth)).join('\\n--- (also)\\n');\n\t}\n\tif (isTaggedError(value)) {\n\t\treturn formatTagged(value, opts, visited, depth);\n\t}\n\tif (value instanceof Error) {\n\t\tconst header = `${value.name}: ${value.message}`;\n\t\tif (value.stack && value.stack !== header) return value.stack;\n\t\treturn header;\n\t}\n\tif (typeof value === 'string') return redactText(value, opts.redactions);\n\ttry {\n\t\treturn JSON.stringify(redactValue(value, opts.redactions));\n\t} catch {\n\t\treturn String(value);\n\t}\n};\n\nconst formatTagged = (\n\tvalue: TaggedErrorLike,\n\topts: Required<FormatOptions>,\n\tvisited: WeakSet<object>,\n\tdepth: number,\n): string => {\n\tconst qualifier =\n\t\ttypeof value.phase === 'string'\n\t\t\t? `(${value.phase})`\n\t\t\t: typeof value.op === 'string'\n\t\t\t\t? `(${value.op})`\n\t\t\t\t: '';\n\tconst message =\n\t\ttypeof value.message === 'string' ? redactText(value.message, opts.redactions) : '';\n\tconst header = qualifier ? `${value._tag} ${qualifier}: ${message}` : `${value._tag}: ${message}`;\n\n\tconst lines: Array<string> = [header];\n\tif (typeof value.exitCode === 'number') lines.push(` exitCode: ${value.exitCode}`);\n\tif (typeof value.stderr === 'string' && value.stderr.trim().length > 0) {\n\t\tlines.push(` stderr: ${truncate(value.stderr.trim(), opts.fieldTruncate, opts.redactions)}`);\n\t}\n\tif (typeof value.stdout === 'string' && value.stdout.trim().length > 0) {\n\t\tlines.push(` stdout: ${truncate(value.stdout.trim(), opts.fieldTruncate, opts.redactions)}`);\n\t}\n\tif (typeof value.detail === 'string' && value.detail.trim().length > 0) {\n\t\tlines.push(` detail: ${truncate(value.detail.trim(), opts.fieldTruncate, opts.redactions)}`);\n\t}\n\n\t// Surface any extra plain-data fields the tagged error carries.\n\t// We skip the conventional ones already rendered above plus `_tag`,\n\t// `cause`. This makes the formatter discover-by-shape: a plugin\n\t// adding `path` or `kind` to its error gets it rendered for free.\n\tconst conventional = new Set([\n\t\t'_tag',\n\t\t'message',\n\t\t'cause',\n\t\t'phase',\n\t\t'stderr',\n\t\t'stdout',\n\t\t'exitCode',\n\t\t'detail',\n\t\t'op',\n\t]);\n\tfor (const key of Object.keys(value)) {\n\t\tif (conventional.has(key)) continue;\n\t\tconst v = (value as unknown as Record<string, unknown>)[key];\n\t\tif (v === undefined || v === null) continue;\n\t\tconst rendered =\n\t\t\ttypeof v === 'string'\n\t\t\t\t? truncate(v, opts.fieldTruncate, opts.redactions)\n\t\t\t\t: typeof v === 'number' || typeof v === 'boolean'\n\t\t\t\t\t? String(v)\n\t\t\t\t\t: safeJson(v, opts.fieldTruncate, opts.redactions);\n\t\tlines.push(` ${key}: ${rendered}`);\n\t}\n\n\tif (value.cause !== undefined && value.cause !== null) {\n\t\tconst rendered = formatAny(value.cause, opts, visited, depth + 1);\n\t\tif (rendered.trim().length > 0 && rendered.trim() !== header.trim()) {\n\t\t\tlines.push(' caused by:');\n\t\t\tlines.push(indent(rendered, ' '));\n\t\t}\n\t}\n\treturn lines.join('\\n');\n};\n\nconst safeJson = (\n\tvalue: unknown,\n\tlimit: number,\n\tredactions: ReadonlyArray<RedactionRule>,\n): string => {\n\ttry {\n\t\treturn truncate(JSON.stringify(redactValue(value, redactions)), limit, redactions);\n\t} catch {\n\t\treturn '[unserializable]';\n\t}\n};\n"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ignore-with-log.mjs","names":[],"sources":["../../../../src/substrate/runtime/observability/ignore-with-log.ts"],"sourcesContent":["// Best-effort with diagnostic breadcrumb — pipe-fn helpers.\n//\n// STYLE_GUIDE §18 calls out the \"best-effort cleanup must still leave\n// a visible breadcrumb\" rule:\n//\n// `.pipe(Effect.ignore)` on a best-effort effect silently swallows\n// the failure. Cleanup paths (router scope-close, lifecycle-prune\n// roster reads, faucet warm-up retries) tolerate the failure but\n// must NOT lose the cause — the cause has to land in the log\n// stream so a leaked dispatch file / stale roster / dead faucet\n// doesn't go silent.\n//\n// Two surfaces:\n//\n// - `logWarningAndIgnore(message, attrs?)` — for failures that\n// COULD indicate a real problem (a scope-close cleanup that\n// could leak a file, contention on a lock we expected to hold)\n// but which the local call site can't act on. Routes the cause\n// through `Effect.logWarning` so it appears in operator output.\n// - `logDebugAndFallback(fallback, message, attrs?)` — for\n// diagnostic-only failures whose downstream call needs a concrete\n// fallback value (e.g. roster read collapses to empty live-pid).\n//\n// Both helpers use `Effect.tapCause` so the full Cause (defects,\n// interruptions, error stacks) is preserved in the `cause` log\n// annotation; the underlying `Effect.ignore` / `Effect.catch` then\n// erases the error channel.\n\nimport { Effect } from 'effect';\n\ntype LogAttrs = Readonly<Record<string, unknown>>;\n\nconst mergeAttrs = (attrs: LogAttrs | undefined, cause: unknown): LogAttrs =>\n\tattrs === undefined ? { cause } : { ...attrs, cause };\n\n/** Tap the cause through `Effect.logWarning`, then collapse to `void`.\n * For best-effort cleanup that COULD indicate a real leak / drop. */\nexport const logWarningAndIgnore =\n\t(message: string, attrs?: LogAttrs) =>\n\t<A, E, R>(self: Effect.Effect<A, E, R>): Effect.Effect<void, never, R> =>\n\t\tself.pipe(\n\t\t\tEffect.tapCause((cause) => Effect.logWarning(message, mergeAttrs(attrs, cause))),\n\t\t\tEffect.ignore,\n\t\t);\n\n/** Tap the cause through `Effect.logDebug`, then catch into a fallback\n * value. For diagnostic-only failures whose downstream call needs a\n * concrete value (e.g. roster read collapses to empty live-pid set). */\nexport const logDebugAndFallback =\n\t<F>(fallback: F, message: string, attrs?: LogAttrs) =>\n\t<A, E, R>(self: Effect.Effect<A, E, R>): Effect.Effect<A | F, never, R> =>\n\t\tself.pipe(\n\t\t\tEffect.tapCause((cause) => Effect.logDebug(message, mergeAttrs(attrs, cause))),\n\t\t\tEffect.catch(() => Effect.succeed(fallback)),\n\t\t);\n"],"mappings":";;AAgCA,MAAM,cAAc,OAA6B,UAChD,UAAU,KAAA,IAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"ignore-with-log.mjs","names":[],"sources":["../../../../src/substrate/runtime/observability/ignore-with-log.ts"],"sourcesContent":["// Best-effort with diagnostic breadcrumb — pipe-fn helpers.\n//\n// STYLE_GUIDE §18 calls out the \"best-effort cleanup must still leave\n// a visible breadcrumb\" rule:\n//\n// `.pipe(Effect.ignore)` on a best-effort effect silently swallows\n// the failure. Cleanup paths (router scope-close, lifecycle-prune\n// roster reads, faucet warm-up retries) tolerate the failure but\n// must NOT lose the cause — the cause has to land in the log\n// stream so a leaked dispatch file / stale roster / dead faucet\n// doesn't go silent.\n//\n// Two surfaces:\n//\n// - `logWarningAndIgnore(message, attrs?)` — for failures that\n// COULD indicate a real problem (a scope-close cleanup that\n// could leak a file, contention on a lock we expected to hold)\n// but which the local call site can't act on. Routes the cause\n// through `Effect.logWarning` so it appears in operator output.\n// - `logDebugAndFallback(fallback, message, attrs?)` — for\n// diagnostic-only failures whose downstream call needs a concrete\n// fallback value (e.g. roster read collapses to empty live-pid).\n//\n// Both helpers use `Effect.tapCause` so the full Cause (defects,\n// interruptions, error stacks) is preserved in the `cause` log\n// annotation; the underlying `Effect.ignore` / `Effect.catch` then\n// erases the error channel.\n\nimport { Effect } from 'effect';\n\ntype LogAttrs = Readonly<Record<string, unknown>>;\n\nconst mergeAttrs = (attrs: LogAttrs | undefined, cause: unknown): LogAttrs =>\n\tattrs === undefined ? { cause } : { ...attrs, cause };\n\n/** Tap the cause through `Effect.logWarning`, then collapse to `void`.\n * For best-effort cleanup that COULD indicate a real leak / drop. */\nexport const logWarningAndIgnore =\n\t(message: string, attrs?: LogAttrs) =>\n\t<A, E, R>(self: Effect.Effect<A, E, R>): Effect.Effect<void, never, R> =>\n\t\tself.pipe(\n\t\t\tEffect.tapCause((cause) => Effect.logWarning(message, mergeAttrs(attrs, cause))),\n\t\t\tEffect.ignore,\n\t\t);\n\n/** Tap the cause through `Effect.logDebug`, then catch into a fallback\n * value. For diagnostic-only failures whose downstream call needs a\n * concrete value (e.g. roster read collapses to empty live-pid set). */\nexport const logDebugAndFallback =\n\t<F>(fallback: F, message: string, attrs?: LogAttrs) =>\n\t<A, E, R>(self: Effect.Effect<A, E, R>): Effect.Effect<A | F, never, R> =>\n\t\tself.pipe(\n\t\t\tEffect.tapCause((cause) => Effect.logDebug(message, mergeAttrs(attrs, cause))),\n\t\t\tEffect.catch(() => Effect.succeed(fallback)),\n\t\t);\n"],"mappings":";;AAgCA,MAAM,cAAc,OAA6B,UAChD,UAAU,KAAA,IAAY,EAAE,MAAM,IAAI;CAAE,GAAG;CAAO;AAAM;;;AAIrD,MAAa,uBACX,SAAiB,WACR,SACT,KAAK,KACJ,OAAO,UAAU,UAAU,OAAO,WAAW,SAAS,WAAW,OAAO,KAAK,CAAC,CAAC,GAC/E,OAAO,MACR;;;;AAKF,MAAa,uBACR,UAAa,SAAiB,WACxB,SACT,KAAK,KACJ,OAAO,UAAU,UAAU,OAAO,SAAS,SAAS,WAAW,OAAO,KAAK,CAAC,CAAC,GAC7E,OAAO,YAAY,OAAO,QAAQ,QAAQ,CAAC,CAC5C"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { RedactionRule, redactText, redactValue } from "./redaction.mjs";
|
|
2
1
|
import { LogLevel, LogLine, LogPayload, Logger, LoggerShape, TagBuffer } from "./logger.mjs";
|
|
2
|
+
import { RedactionRule, redactText, redactValue } from "./redaction.mjs";
|
|
3
3
|
import { ObserveProcessLinesOptions, ObservedProcessLine, ProcessByteStream, ProcessOutputStream, observeProcessLines, readableToByteStream, splitUtf8Lines } from "./process-lines.mjs";
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./redaction.mjs";
|
|
3
|
-
import "./cascade-formatter.mjs";
|
|
4
|
-
import "./formatter-registry.mjs";
|
|
5
|
-
import "./ignore-with-log.mjs";
|
|
1
|
+
import "./log-attrs.mjs";
|
|
6
2
|
import "./logger.mjs";
|
|
7
3
|
import "./log-store.mjs";
|
|
8
|
-
import "./
|
|
4
|
+
import "./redaction.mjs";
|
|
5
|
+
import "./cascade-formatter.mjs";
|
|
9
6
|
import "./pretty-error.mjs";
|
|
10
7
|
import "./process-lines.mjs";
|
|
11
8
|
import "./subprocess-capture.mjs";
|
|
9
|
+
import "./ignore-with-log.mjs";
|
|
12
10
|
import "./output-truncate.mjs";
|
|
13
11
|
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
//#region src/substrate/runtime/observability/log-attrs.ts
|
|
2
|
+
/** Canonical log-attribute keys. Engine-dimensional + http/process generic. */
|
|
3
|
+
const LogAttr = {
|
|
4
|
+
app: "devstack.app",
|
|
5
|
+
stack: "devstack.stack",
|
|
6
|
+
network: "devstack.network",
|
|
7
|
+
plugin: "devstack.plugin",
|
|
8
|
+
role: "devstack.role",
|
|
9
|
+
phase: "devstack.phase",
|
|
10
|
+
containerName: "container.name",
|
|
11
|
+
containerRole: "container.role",
|
|
12
|
+
event: "event.name",
|
|
13
|
+
errorCode: "error.code",
|
|
14
|
+
errorCause: "error.cause",
|
|
15
|
+
errorMessage: "error.message",
|
|
16
|
+
exitCode: "process.exit.code",
|
|
17
|
+
exitSignal: "process.exit.signal",
|
|
18
|
+
exitStatus: "process.exit.status",
|
|
19
|
+
endpointKey: "devstack.endpoint.key",
|
|
20
|
+
httpMethod: "http.method",
|
|
21
|
+
httpPath: "http.path",
|
|
22
|
+
httpUrl: "http.url",
|
|
23
|
+
host: "server.address",
|
|
24
|
+
logTag: "log.tag",
|
|
25
|
+
port: "server.port",
|
|
26
|
+
cycleId: "devstack.cycle.id",
|
|
27
|
+
op: "devstack.op",
|
|
28
|
+
requestId: "devstack.request.id",
|
|
29
|
+
rosterHeartbeatIntervalMs: "roster.heartbeat.intervalMs",
|
|
30
|
+
serviceName: "devstack.service.name",
|
|
31
|
+
stageAndSwapStagingPath: "stageAndSwap.stagingPath",
|
|
32
|
+
stageAndSwapTargetPath: "stageAndSwap.targetPath",
|
|
33
|
+
cacheCorruption: "cache.corruption",
|
|
34
|
+
strategyKey: "strategy.key",
|
|
35
|
+
strategyAutoMounted: "strategy.autoMounted",
|
|
36
|
+
artifactPublisherNamespace: "artifactPublisher.namespace",
|
|
37
|
+
artifactPublisherChain: "artifactPublisher.chain",
|
|
38
|
+
artifactPublisherContentHash: "artifactPublisher.contentHash",
|
|
39
|
+
artifactPublisherPath: "artifactPublisher.path",
|
|
40
|
+
stackLockPath: "devstack.stack-lock.path",
|
|
41
|
+
stackLockTimeoutMillis: "devstack.stack-lock.timeoutMillis"
|
|
42
|
+
};
|
|
43
|
+
//#endregion
|
|
44
|
+
export { LogAttr };
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=log-attrs.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log-attrs.mjs","names":[],"sources":["../../../../src/substrate/runtime/observability/log-attrs.ts"],"sourcesContent":["// Canonical log-attribute keys.\n//\n// Centralises the attribute-key vocabulary so every `Effect.annotateLogs`\n// call uses the same keys — engine-dimensional (`devstack.*`, `error.*`,\n// `process.exit.*`, `container.*`) plus http/process-generic keys\n// (`http.*`, `server.*`). (Span recording was removed; these constants\n// now exist purely as a shared logging vocabulary.)\n\n/** Canonical log-attribute keys. Engine-dimensional + http/process generic. */\nexport const LogAttr = {\n\tapp: 'devstack.app',\n\tstack: 'devstack.stack',\n\tnetwork: 'devstack.network',\n\tplugin: 'devstack.plugin',\n\trole: 'devstack.role',\n\tphase: 'devstack.phase',\n\tcontainerName: 'container.name',\n\tcontainerRole: 'container.role',\n\tevent: 'event.name',\n\terrorCode: 'error.code',\n\terrorCause: 'error.cause',\n\terrorMessage: 'error.message',\n\texitCode: 'process.exit.code',\n\texitSignal: 'process.exit.signal',\n\texitStatus: 'process.exit.status',\n\tendpointKey: 'devstack.endpoint.key',\n\thttpMethod: 'http.method',\n\thttpPath: 'http.path',\n\thttpUrl: 'http.url',\n\thost: 'server.address',\n\tlogTag: 'log.tag',\n\tport: 'server.port',\n\tcycleId: 'devstack.cycle.id',\n\top: 'devstack.op',\n\trequestId: 'devstack.request.id',\n\trosterHeartbeatIntervalMs: 'roster.heartbeat.intervalMs',\n\tserviceName: 'devstack.service.name',\n\tstageAndSwapStagingPath: 'stageAndSwap.stagingPath',\n\tstageAndSwapTargetPath: 'stageAndSwap.targetPath',\n\tcacheCorruption: 'cache.corruption',\n\tstrategyKey: 'strategy.key',\n\tstrategyAutoMounted: 'strategy.autoMounted',\n\tartifactPublisherNamespace: 'artifactPublisher.namespace',\n\tartifactPublisherChain: 'artifactPublisher.chain',\n\tartifactPublisherContentHash: 'artifactPublisher.contentHash',\n\tartifactPublisherPath: 'artifactPublisher.path',\n\tstackLockPath: 'devstack.stack-lock.path',\n\tstackLockTimeoutMillis: 'devstack.stack-lock.timeoutMillis',\n} as const;\n"],"mappings":";;AASA,MAAa,UAAU;CACtB,KAAK;CACL,OAAO;CACP,SAAS;CACT,QAAQ;CACR,MAAM;CACN,OAAO;CACP,eAAe;CACf,eAAe;CACf,OAAO;CACP,WAAW;CACX,YAAY;CACZ,cAAc;CACd,UAAU;CACV,YAAY;CACZ,YAAY;CACZ,aAAa;CACb,YAAY;CACZ,UAAU;CACV,SAAS;CACT,MAAM;CACN,QAAQ;CACR,MAAM;CACN,SAAS;CACT,IAAI;CACJ,WAAW;CACX,2BAA2B;CAC3B,aAAa;CACb,yBAAyB;CACzB,wBAAwB;CACxB,iBAAiB;CACjB,aAAa;CACb,qBAAqB;CACrB,4BAA4B;CAC5B,wBAAwB;CACxB,8BAA8B;CAC9B,uBAAuB;CACvB,eAAe;CACf,wBAAwB;AACzB"}
|