@mysten-incubation/devstack 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -3
- package/dashboard-ui/assets/grpc-a4usE3Nk.js +3 -0
- package/dashboard-ui/assets/index-B82Bh84P.css +1 -0
- package/dashboard-ui/assets/index-CRYJ4pru.js +1277 -0
- package/dashboard-ui/index.html +2 -2
- package/dist/api/define-capabilities.d.mts +1 -20
- package/dist/api/define-capabilities.mjs +15 -22
- package/dist/api/define-capabilities.mjs.map +1 -1
- package/dist/api/define-devstack-with.d.mts +7 -1
- package/dist/api/define-devstack-with.mjs.map +1 -1
- package/dist/api/define-devstack.mjs.map +1 -1
- package/dist/api/define-plugin.d.mts +2 -1
- package/dist/api/inference-network.d.mts +31 -17
- package/dist/api/inference-network.mjs +40 -43
- package/dist/api/inference-network.mjs.map +1 -1
- package/dist/api/load-config.mjs +88 -0
- package/dist/api/load-config.mjs.map +1 -0
- package/dist/api/mode-narrowed-factory.d.mts +1 -1
- package/dist/api/mode-narrowed-factory.mjs.map +1 -1
- package/dist/api/run-stack-internal.mjs +202 -0
- package/dist/api/run-stack-internal.mjs.map +1 -0
- package/dist/api/run-stack.d.mts +82 -31
- package/dist/api/run-stack.mjs +22 -141
- package/dist/api/run-stack.mjs.map +1 -1
- package/dist/build-integrations/dapp-kit/index.d.mts +61 -0
- package/dist/build-integrations/dapp-kit/index.mjs +58 -0
- package/dist/build-integrations/dapp-kit/index.mjs.map +1 -0
- package/dist/build-integrations/playwright/config.d.mts +1 -30
- package/dist/build-integrations/playwright/config.mjs +1 -27
- package/dist/build-integrations/playwright/config.mjs.map +1 -1
- package/dist/build-integrations/playwright/errors.d.mts +4 -7
- package/dist/build-integrations/playwright/errors.mjs.map +1 -1
- package/dist/build-integrations/playwright/global-setup.d.mts +42 -71
- package/dist/build-integrations/playwright/global-setup.mjs +142 -218
- package/dist/build-integrations/playwright/global-setup.mjs.map +1 -1
- package/dist/build-integrations/playwright/index.d.mts +2 -2
- package/dist/build-integrations/playwright/index.mjs +2 -2
- package/dist/build-integrations/playwright/stack-context.d.mts +3 -1
- package/dist/build-integrations/playwright/stack-context.mjs +4 -2
- package/dist/build-integrations/playwright/stack-context.mjs.map +1 -1
- package/dist/build-integrations/playwright/wallet-context.mjs +44 -19
- package/dist/build-integrations/playwright/wallet-context.mjs.map +1 -1
- package/dist/build-integrations/runtime/cold-start-url.mjs.map +1 -1
- package/dist/build-integrations/runtime/conventional-routes.mjs.map +1 -1
- package/dist/build-integrations/runtime/dapp-kit-slot.mjs.map +1 -1
- package/dist/build-integrations/runtime/discover.d.mts +6 -4
- package/dist/build-integrations/runtime/discover.mjs +15 -4
- package/dist/build-integrations/runtime/discover.mjs.map +1 -1
- package/dist/build-integrations/runtime/endpoint-registry.mjs.map +1 -1
- package/dist/build-integrations/runtime/errors.mjs.map +1 -1
- package/dist/build-integrations/runtime/read-stack-context.mjs +3 -3
- package/dist/build-integrations/runtime/read-stack-context.mjs.map +1 -1
- package/dist/build-integrations/runtime/resolve-discovery-env.d.mts +23 -7
- package/dist/build-integrations/runtime/resolve-discovery-env.mjs +25 -12
- package/dist/build-integrations/runtime/resolve-discovery-env.mjs.map +1 -1
- package/dist/build-integrations/runtime/stack-context.d.mts +2 -2
- package/dist/build-integrations/vite/index.d.mts +84 -19
- package/dist/build-integrations/vite/index.mjs +203 -28
- package/dist/build-integrations/vite/index.mjs.map +1 -1
- package/dist/build-integrations/vitest/config.d.mts +20 -2
- package/dist/build-integrations/vitest/config.mjs +16 -4
- package/dist/build-integrations/vitest/config.mjs.map +1 -1
- package/dist/build-integrations/vitest/env.d.mts +18 -10
- package/dist/build-integrations/vitest/env.mjs +11 -10
- package/dist/build-integrations/vitest/env.mjs.map +1 -1
- package/dist/build-integrations/vitest/errors.d.mts +7 -11
- package/dist/build-integrations/vitest/errors.mjs +3 -4
- package/dist/build-integrations/vitest/errors.mjs.map +1 -1
- package/dist/build-integrations/vitest/global-setup.d.mts +35 -0
- package/dist/build-integrations/vitest/global-setup.mjs +156 -0
- package/dist/build-integrations/vitest/global-setup.mjs.map +1 -0
- package/dist/build-integrations/vitest/index.d.mts +3 -2
- package/dist/build-integrations/vitest/index.mjs +3 -2
- package/dist/build-integrations/vitest/setup.mjs +2 -2
- package/dist/build-integrations/vitest/setup.mjs.map +1 -1
- package/dist/build-integrations/vitest/stack-context.d.mts +5 -3
- package/dist/build-integrations/vitest/stack-context.mjs +3 -2
- package/dist/build-integrations/vitest/stack-context.mjs.map +1 -1
- package/dist/cli/bail.mjs.map +1 -1
- package/dist/cli/doctor-probes.mjs +1 -3
- package/dist/cli/doctor-probes.mjs.map +1 -1
- package/dist/cli/main.d.mts +23 -1
- package/dist/cli/main.mjs +63 -8
- package/dist/cli/main.mjs.map +1 -1
- package/dist/cli/prune-direct.mjs.map +1 -1
- package/dist/cli/snapshot-reader.mjs.map +1 -1
- package/dist/cli/up-lifecycle.mjs.map +1 -1
- package/dist/cli/wirings/apply.mjs +28 -21
- package/dist/cli/wirings/apply.mjs.map +1 -1
- package/dist/cli/wirings/codegen.mjs +108 -0
- package/dist/cli/wirings/codegen.mjs.map +1 -0
- package/dist/cli/wirings/config-loader.mjs +12 -62
- package/dist/cli/wirings/config-loader.mjs.map +1 -1
- package/dist/cli/wirings/dump-ids.mjs +86 -0
- package/dist/cli/wirings/dump-ids.mjs.map +1 -0
- package/dist/cli/wirings/engine-command.mjs +1 -1
- package/dist/cli/wirings/engine-command.mjs.map +1 -1
- package/dist/cli/wirings/identity.mjs +2 -2
- package/dist/cli/wirings/identity.mjs.map +1 -1
- package/dist/cli/wirings/provide-file-system.mjs.map +1 -1
- package/dist/cli/wirings/read-devstack-version.mjs +17 -0
- package/dist/cli/wirings/read-devstack-version.mjs.map +1 -0
- package/dist/cli/wirings/snapshot.mjs +27 -34
- package/dist/cli/wirings/snapshot.mjs.map +1 -1
- package/dist/cli/wirings/up-ipc.mjs +147 -0
- package/dist/cli/wirings/up-ipc.mjs.map +1 -0
- package/dist/cli/wirings/up.mjs +218 -198
- package/dist/cli/wirings/up.mjs.map +1 -1
- package/dist/cli/wirings/wipe.mjs +1 -1
- package/dist/cli/wirings/wipe.mjs.map +1 -1
- package/dist/contracts/chain-probe.d.mts +1 -1
- package/dist/contracts/chain-probe.mjs +1 -1
- package/dist/contracts/chain-probe.mjs.map +1 -1
- package/dist/contracts/codegenable.d.mts +60 -6
- package/dist/contracts/codegenable.mjs +28 -0
- package/dist/contracts/codegenable.mjs.map +1 -0
- package/dist/contracts/config-bindings.mjs +162 -0
- package/dist/contracts/config-bindings.mjs.map +1 -0
- package/dist/contracts/container-runtime.d.mts +23 -17
- package/dist/contracts/plugin-expander.mjs.map +1 -1
- package/dist/contracts/snapshotable.d.mts +5 -7
- package/dist/contracts/wallet-protocol.d.mts +2 -5
- package/dist/contracts/wallet-protocol.mjs +2 -5
- package/dist/contracts/wallet-protocol.mjs.map +1 -1
- package/dist/index.d.mts +21 -26
- package/dist/index.mjs +8 -9
- package/dist/orchestrators/boot.d.mts +28 -0
- package/dist/orchestrators/boot.mjs +440 -0
- package/dist/orchestrators/boot.mjs.map +1 -0
- package/dist/orchestrators/codegen/bindings.d.mts +13 -1
- package/dist/orchestrators/codegen/bindings.mjs +23 -9
- package/dist/orchestrators/codegen/bindings.mjs.map +1 -1
- package/dist/orchestrators/codegen/config-runtime.mjs +208 -0
- package/dist/orchestrators/codegen/config-runtime.mjs.map +1 -0
- package/dist/orchestrators/codegen/emit.mjs +1 -1
- package/dist/orchestrators/codegen/emit.mjs.map +1 -1
- package/dist/orchestrators/codegen/errors.mjs +21 -1
- package/dist/orchestrators/codegen/errors.mjs.map +1 -1
- package/dist/orchestrators/codegen/format.mjs +2 -0
- package/dist/orchestrators/codegen/format.mjs.map +1 -1
- package/dist/orchestrators/codegen/gitignore.mjs +30 -11
- package/dist/orchestrators/codegen/gitignore.mjs.map +1 -1
- package/dist/orchestrators/codegen/id-config.mjs +107 -0
- package/dist/orchestrators/codegen/id-config.mjs.map +1 -0
- package/dist/orchestrators/codegen/output-location.mjs +23 -32
- package/dist/orchestrators/codegen/output-location.mjs.map +1 -1
- package/dist/orchestrators/codegen/paths.mjs +8 -1
- package/dist/orchestrators/codegen/paths.mjs.map +1 -1
- package/dist/orchestrators/codegen/permissions.mjs.map +1 -1
- package/dist/orchestrators/codegen/service.mjs +286 -58
- package/dist/orchestrators/codegen/service.mjs.map +1 -1
- package/dist/orchestrators/layers.mjs +31 -0
- package/dist/orchestrators/layers.mjs.map +1 -0
- package/dist/orchestrators/lifecycle-prune/errors.mjs.map +1 -1
- package/dist/orchestrators/lifecycle-prune/index.mjs +8 -10
- package/dist/orchestrators/lifecycle-prune/index.mjs.map +1 -1
- package/dist/orchestrators/network-options.d.mts +52 -0
- package/dist/orchestrators/network-options.mjs +43 -0
- package/dist/orchestrators/network-options.mjs.map +1 -0
- package/dist/orchestrators/router/cleanup.mjs.map +1 -1
- package/dist/orchestrators/router/cors.mjs.map +1 -1
- package/dist/orchestrators/router/entrypoints.mjs.map +1 -1
- package/dist/orchestrators/router/errors.mjs.map +1 -1
- package/dist/orchestrators/router/file-provider.mjs.map +1 -1
- package/dist/orchestrators/router/hostname.mjs.map +1 -1
- package/dist/orchestrators/router/profile.mjs +1 -1
- package/dist/orchestrators/router/profile.mjs.map +1 -1
- package/dist/orchestrators/router/service.d.mts +2 -2
- package/dist/orchestrators/router/service.mjs +12 -27
- package/dist/orchestrators/router/service.mjs.map +1 -1
- package/dist/orchestrators/router/traefik-container.mjs +1 -1
- package/dist/orchestrators/router/traefik-container.mjs.map +1 -1
- package/dist/orchestrators/snapshot/capture.mjs +171 -195
- package/dist/orchestrators/snapshot/capture.mjs.map +1 -1
- package/dist/orchestrators/snapshot/descriptor.d.mts +1 -1
- package/dist/orchestrators/snapshot/descriptor.mjs +53 -11
- package/dist/orchestrators/snapshot/descriptor.mjs.map +1 -1
- package/dist/orchestrators/snapshot/identity-guard.mjs +3 -5
- package/dist/orchestrators/snapshot/identity-guard.mjs.map +1 -1
- package/dist/orchestrators/snapshot/image-bundle-tags.mjs +32 -101
- package/dist/orchestrators/snapshot/image-bundle-tags.mjs.map +1 -1
- package/dist/orchestrators/snapshot/index.mjs +1 -4
- package/dist/orchestrators/snapshot/integrity.mjs.map +1 -1
- package/dist/orchestrators/snapshot/interrupted-restore.mjs +116 -0
- package/dist/orchestrators/snapshot/interrupted-restore.mjs.map +1 -0
- package/dist/orchestrators/snapshot/phase-error.mjs.map +1 -1
- package/dist/orchestrators/snapshot/prune.mjs +40 -31
- package/dist/orchestrators/snapshot/prune.mjs.map +1 -1
- package/dist/orchestrators/snapshot/restore.mjs +221 -196
- package/dist/orchestrators/snapshot/restore.mjs.map +1 -1
- package/dist/orchestrators/snapshot/service.mjs +72 -62
- package/dist/orchestrators/snapshot/service.mjs.map +1 -1
- package/dist/orchestrators/snapshot/wipe.mjs +67 -56
- package/dist/orchestrators/snapshot/wipe.mjs.map +1 -1
- package/dist/plugins/account/codegen.mjs +3 -0
- package/dist/plugins/account/codegen.mjs.map +1 -1
- package/dist/plugins/account/errors.d.mts +2 -2
- package/dist/plugins/account/errors.mjs +1 -4
- package/dist/plugins/account/errors.mjs.map +1 -1
- package/dist/plugins/account/funding.mjs +3 -27
- package/dist/plugins/account/funding.mjs.map +1 -1
- package/dist/plugins/account/index.d.mts +3 -8
- package/dist/plugins/account/index.mjs +71 -35
- package/dist/plugins/account/index.mjs.map +1 -1
- package/dist/plugins/account/keypair.d.mts +8 -7
- package/dist/plugins/account/keypair.mjs +5 -18
- package/dist/plugins/account/keypair.mjs.map +1 -1
- package/dist/plugins/account/lease.mjs.map +1 -1
- package/dist/plugins/account/registry.d.mts +1 -46
- package/dist/plugins/account/registry.mjs.map +1 -1
- package/dist/plugins/account/service.d.mts +43 -34
- package/dist/plugins/account/service.mjs +9 -54
- package/dist/plugins/account/service.mjs.map +1 -1
- package/dist/plugins/account/snapshot.mjs.map +1 -1
- package/dist/plugins/account/variants/ephemeral.mjs.map +1 -1
- package/dist/plugins/account/variants/impersonate.mjs.map +1 -1
- package/dist/plugins/account/variants/signer.mjs.map +1 -1
- package/dist/plugins/action/discriminator.mjs.map +1 -1
- package/dist/plugins/action/errors.mjs +1 -4
- package/dist/plugins/action/errors.mjs.map +1 -1
- package/dist/plugins/action/execute.mjs +3 -4
- package/dist/plugins/action/execute.mjs.map +1 -1
- package/dist/plugins/action/index.d.mts +2 -2
- package/dist/plugins/action/index.mjs +7 -11
- package/dist/plugins/action/index.mjs.map +1 -1
- package/dist/plugins/action/service.d.mts +5 -7
- package/dist/plugins/action/service.mjs +2 -16
- package/dist/plugins/action/service.mjs.map +1 -1
- package/dist/plugins/coin/address-resolution.mjs.map +1 -1
- package/dist/plugins/coin/codegen.mjs +97 -16
- package/dist/plugins/coin/codegen.mjs.map +1 -1
- package/dist/plugins/coin/discovery.mjs.map +1 -1
- package/dist/plugins/coin/errors.mjs +1 -4
- package/dist/plugins/coin/errors.mjs.map +1 -1
- package/dist/plugins/coin/index.d.mts +4 -34
- package/dist/plugins/coin/index.mjs +47 -28
- package/dist/plugins/coin/index.mjs.map +1 -1
- package/dist/plugins/coin/metadata.d.mts +1 -0
- package/dist/plugins/coin/metadata.mjs +8 -9
- package/dist/plugins/coin/metadata.mjs.map +1 -1
- package/dist/plugins/coin/mint.mjs +7 -21
- package/dist/plugins/coin/mint.mjs.map +1 -1
- package/dist/plugins/coin/registry.mjs +33 -20
- package/dist/plugins/coin/registry.mjs.map +1 -1
- package/dist/plugins/coin/service.d.mts +1 -1
- package/dist/plugins/coin/service.mjs +1 -8
- package/dist/plugins/coin/service.mjs.map +1 -1
- package/dist/plugins/coin/snapshot.mjs.map +1 -1
- package/dist/plugins/coin/type-strings.mjs.map +1 -1
- package/dist/plugins/dashboard/domain.mjs +106 -167
- package/dist/plugins/dashboard/domain.mjs.map +1 -1
- package/dist/plugins/dashboard/index.mjs +13 -13
- package/dist/plugins/dashboard/index.mjs.map +1 -1
- package/dist/plugins/dashboard/origin-policy.mjs +3 -3
- package/dist/plugins/dashboard/origin-policy.mjs.map +1 -1
- package/dist/plugins/dashboard/routable.mjs.map +1 -1
- package/dist/plugins/dashboard/schema/builder.mjs.map +1 -1
- package/dist/plugins/dashboard/schema/enums.mjs.map +1 -1
- package/dist/plugins/dashboard/schema/root.mjs +23 -44
- package/dist/plugins/dashboard/schema/root.mjs.map +1 -1
- package/dist/plugins/dashboard/schema/types.mjs +37 -91
- package/dist/plugins/dashboard/schema/types.mjs.map +1 -1
- package/dist/plugins/dashboard/schema.mjs.map +1 -1
- package/dist/plugins/dashboard/server.mjs.map +1 -1
- package/dist/plugins/deepbook/codegen.d.mts +12 -11
- package/dist/plugins/deepbook/codegen.mjs +108 -11
- package/dist/plugins/deepbook/codegen.mjs.map +1 -1
- package/dist/plugins/deepbook/deploy.mjs +7 -14
- package/dist/plugins/deepbook/deploy.mjs.map +1 -1
- package/dist/plugins/deepbook/errors.mjs +4 -2
- package/dist/plugins/deepbook/errors.mjs.map +1 -1
- package/dist/plugins/deepbook/faucet-strategy.mjs +4 -10
- package/dist/plugins/deepbook/faucet-strategy.mjs.map +1 -1
- package/dist/plugins/deepbook/hash.mjs.map +1 -1
- package/dist/plugins/deepbook/index.d.mts +38 -34
- package/dist/plugins/deepbook/index.mjs +133 -64
- package/dist/plugins/deepbook/index.mjs.map +1 -1
- package/dist/plugins/deepbook/plugin-key.mjs.map +1 -1
- package/dist/plugins/deepbook/pyth/index.mjs +4 -8
- package/dist/plugins/deepbook/pyth/index.mjs.map +1 -1
- package/dist/plugins/deepbook/snapshot.mjs +0 -1
- package/dist/plugins/deepbook/snapshot.mjs.map +1 -1
- package/dist/plugins/deepbook/type-strings.mjs.map +1 -1
- package/dist/plugins/deepbook/types.d.mts +2 -1
- package/dist/plugins/deepbook/types.mjs.map +1 -1
- package/dist/plugins/faucet/dispatcher.d.mts +3 -3
- package/dist/plugins/faucet/dispatcher.mjs.map +1 -1
- package/dist/plugins/faucet/errors.mjs.map +1 -1
- package/dist/plugins/faucet/http.mjs +2 -10
- package/dist/plugins/faucet/http.mjs.map +1 -1
- package/dist/plugins/faucet/index.mjs +0 -1
- package/dist/plugins/faucet/index.mjs.map +1 -1
- package/dist/plugins/host-service/errors.d.mts +1 -3
- package/dist/plugins/host-service/errors.mjs +1 -2
- package/dist/plugins/host-service/errors.mjs.map +1 -1
- package/dist/plugins/host-service/index.d.mts +1 -2
- package/dist/plugins/host-service/index.mjs +11 -11
- package/dist/plugins/host-service/index.mjs.map +1 -1
- package/dist/plugins/host-service/routable.mjs.map +1 -1
- package/dist/plugins/host-service/service.mjs +13 -13
- package/dist/plugins/host-service/service.mjs.map +1 -1
- package/dist/plugins/internal/acquire-on-chain-artifact.mjs.map +1 -1
- package/dist/plugins/internal/codegen-helpers.mjs +2 -0
- package/dist/plugins/internal/codegen-helpers.mjs.map +1 -1
- package/dist/plugins/internal/funding-failure-error.mjs.map +1 -1
- package/dist/plugins/{postgres → internal/postgres-sidecar}/connection.mjs +1 -1
- package/dist/plugins/internal/postgres-sidecar/connection.mjs.map +1 -0
- package/dist/plugins/{postgres → internal/postgres-sidecar}/db-ensure.mjs +30 -16
- package/dist/plugins/internal/postgres-sidecar/db-ensure.mjs.map +1 -0
- package/dist/plugins/internal/postgres-sidecar/errors.mjs +21 -0
- package/dist/plugins/internal/postgres-sidecar/errors.mjs.map +1 -0
- package/dist/{substrate/runtime/scoped-multimap → plugins/internal/postgres-sidecar}/index.mjs +1 -0
- package/dist/plugins/internal/postgres-sidecar/service.mjs +121 -0
- package/dist/plugins/internal/postgres-sidecar/service.mjs.map +1 -0
- package/dist/plugins/package/build.mjs +2 -2
- package/dist/plugins/package/build.mjs.map +1 -1
- package/dist/plugins/package/codegen.d.mts +7 -14
- package/dist/plugins/package/codegen.mjs +187 -59
- package/dist/plugins/package/codegen.mjs.map +1 -1
- package/dist/plugins/package/dep-resolution.mjs +51 -3
- package/dist/plugins/package/dep-resolution.mjs.map +1 -1
- package/dist/plugins/package/errors.mjs +1 -4
- package/dist/plugins/package/errors.mjs.map +1 -1
- package/dist/plugins/package/git-source.d.mts +18 -0
- package/dist/plugins/package/git-source.mjs +119 -0
- package/dist/plugins/package/git-source.mjs.map +1 -0
- package/dist/plugins/package/index.d.mts +28 -19
- package/dist/plugins/package/index.mjs +107 -32
- package/dist/plugins/package/index.mjs.map +1 -1
- package/dist/plugins/package/mode-known.mjs +2 -2
- package/dist/plugins/package/mode-known.mjs.map +1 -1
- package/dist/plugins/package/mode-local.mjs +18 -35
- package/dist/plugins/package/mode-local.mjs.map +1 -1
- package/dist/plugins/package/publish-executor.mjs +13 -8
- package/dist/plugins/package/publish-executor.mjs.map +1 -1
- package/dist/plugins/package/publish-output.d.mts +1 -11
- package/dist/plugins/package/publish-output.mjs +1 -9
- package/dist/plugins/package/publish-output.mjs.map +1 -1
- package/dist/plugins/package/registry.d.mts +1 -1
- package/dist/plugins/package/registry.mjs +26 -14
- package/dist/plugins/package/registry.mjs.map +1 -1
- package/dist/plugins/package/service.mjs.map +1 -1
- package/dist/plugins/package/snapshot.mjs.map +1 -1
- package/dist/plugins/router-entrypoints.mjs +1 -3
- package/dist/plugins/router-entrypoints.mjs.map +1 -1
- package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs +1 -2
- package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs.map +1 -1
- package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs +1 -6
- package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs.map +1 -1
- package/dist/plugins/seal/codegen.d.mts +1 -5
- package/dist/plugins/seal/codegen.mjs +83 -12
- package/dist/plugins/seal/codegen.mjs.map +1 -1
- package/dist/plugins/seal/config-render.mjs +2 -6
- package/dist/plugins/seal/config-render.mjs.map +1 -1
- package/dist/plugins/seal/deploy.mjs +18 -29
- package/dist/plugins/seal/deploy.mjs.map +1 -1
- package/dist/plugins/seal/errors.d.mts +4 -5
- package/dist/plugins/seal/errors.mjs +1 -8
- package/dist/plugins/seal/errors.mjs.map +1 -1
- package/dist/plugins/seal/index.d.mts +7 -28
- package/dist/plugins/seal/index.mjs +69 -47
- package/dist/plugins/seal/index.mjs.map +1 -1
- package/dist/plugins/seal/key-manager.mjs.map +1 -1
- package/dist/plugins/seal/key-server.mjs +1 -6
- package/dist/plugins/seal/key-server.mjs.map +1 -1
- package/dist/plugins/seal/keygen.mjs +2 -3
- package/dist/plugins/seal/keygen.mjs.map +1 -1
- package/dist/plugins/seal/mode/fork-known.mjs.map +1 -1
- package/dist/plugins/seal/mode/live.mjs +1 -1
- package/dist/plugins/seal/mode/live.mjs.map +1 -1
- package/dist/plugins/seal/mode/local-keygen.mjs +4 -10
- package/dist/plugins/seal/mode/local-keygen.mjs.map +1 -1
- package/dist/plugins/seal/plugin-key.mjs.map +1 -1
- package/dist/plugins/seal/registry-publish.mjs.map +1 -1
- package/dist/plugins/seal/routable.mjs.map +1 -1
- package/dist/plugins/seal/service.mjs.map +1 -1
- package/dist/plugins/seal/snapshot.mjs +1 -2
- package/dist/plugins/seal/snapshot.mjs.map +1 -1
- package/dist/plugins/sui/auto-tick.mjs +5 -5
- package/dist/plugins/sui/auto-tick.mjs.map +1 -1
- package/dist/plugins/sui/chain-build-container.mjs +2 -2
- package/dist/plugins/sui/chain-build-container.mjs.map +1 -1
- package/dist/plugins/sui/chain-probe.mjs +4 -4
- package/dist/plugins/sui/chain-probe.mjs.map +1 -1
- package/dist/plugins/sui/codegen.d.mts +9 -7
- package/dist/plugins/sui/codegen.mjs +49 -46
- package/dist/plugins/sui/codegen.mjs.map +1 -1
- package/dist/plugins/sui/errors.d.mts +1 -1
- package/dist/plugins/sui/errors.mjs +1 -9
- package/dist/plugins/sui/errors.mjs.map +1 -1
- package/dist/{substrate/runtime/sui-execute → plugins/sui/exec}/index.d.mts +1 -1
- package/dist/{substrate/runtime/sui-execute → plugins/sui/exec}/index.mjs +3 -7
- package/dist/plugins/sui/exec/index.mjs.map +1 -0
- package/dist/{substrate/runtime/sui-execute → plugins/sui/exec}/sign-and-dispatch.mjs +1 -1
- package/dist/plugins/sui/exec/sign-and-dispatch.mjs.map +1 -0
- package/dist/plugins/sui/fork-faucet-strategy.mjs +2 -6
- package/dist/plugins/sui/fork-faucet-strategy.mjs.map +1 -1
- package/dist/plugins/sui/fork-orchestration.mjs +13 -23
- package/dist/plugins/sui/fork-orchestration.mjs.map +1 -1
- package/dist/plugins/sui/fork-transaction.mjs.map +1 -1
- package/dist/plugins/sui/index.d.mts +34 -83
- package/dist/plugins/sui/index.mjs +200 -68
- package/dist/plugins/sui/index.mjs.map +1 -1
- package/dist/{substrate/runtime/sui-ledger → plugins/sui/ledger}/object-ref.mjs +1 -1
- package/dist/plugins/sui/ledger/object-ref.mjs.map +1 -0
- package/dist/plugins/sui/local-faucet-strategy.mjs +1 -5
- package/dist/plugins/sui/local-faucet-strategy.mjs.map +1 -1
- package/dist/plugins/sui/log-attrs.mjs +11 -0
- package/dist/plugins/sui/log-attrs.mjs.map +1 -0
- package/dist/plugins/sui/mode/external.mjs +4 -12
- package/dist/plugins/sui/mode/external.mjs.map +1 -1
- package/dist/plugins/sui/mode/fork.mjs +19 -16
- package/dist/plugins/sui/mode/fork.mjs.map +1 -1
- package/dist/plugins/sui/mode/live.mjs +4 -17
- package/dist/plugins/sui/mode/live.mjs.map +1 -1
- package/dist/plugins/sui/mode/local.d.mts +1 -0
- package/dist/plugins/sui/mode/local.mjs +203 -61
- package/dist/plugins/sui/mode/local.mjs.map +1 -1
- package/dist/plugins/sui/mode/shared-boot.mjs +18 -23
- package/dist/plugins/sui/mode/shared-boot.mjs.map +1 -1
- package/dist/plugins/sui/mode/shared.d.mts +6 -7
- package/dist/plugins/sui/mode/shared.mjs.map +1 -1
- package/dist/plugins/sui/mode/spec.d.mts +23 -6
- package/dist/{substrate/runtime/sui-move-build → plugins/sui/move}/index.mjs +28 -30
- package/dist/plugins/sui/move/index.mjs.map +1 -0
- package/dist/plugins/sui/move-summary-runner.mjs +8 -4
- package/dist/plugins/sui/move-summary-runner.mjs.map +1 -1
- package/dist/{substrate/network.d.mts → plugins/sui/network-config.d.mts} +11 -10
- package/dist/plugins/sui/network-resolver.d.mts +6 -6
- package/dist/plugins/sui/routable.mjs.map +1 -1
- package/dist/plugins/sui/service.mjs +10 -6
- package/dist/plugins/sui/service.mjs.map +1 -1
- package/dist/plugins/sui/snapshot.mjs +10 -5
- package/dist/plugins/sui/snapshot.mjs.map +1 -1
- package/dist/plugins/wallet/codegen.d.mts +8 -6
- package/dist/plugins/wallet/codegen.mjs +4 -10
- package/dist/plugins/wallet/codegen.mjs.map +1 -1
- package/dist/plugins/wallet/errors.mjs +1 -4
- package/dist/plugins/wallet/errors.mjs.map +1 -1
- package/dist/plugins/wallet/index.d.mts +3 -6
- package/dist/plugins/wallet/index.mjs +16 -21
- package/dist/plugins/wallet/index.mjs.map +1 -1
- package/dist/plugins/wallet/origin-policy.mjs +3 -3
- package/dist/plugins/wallet/origin-policy.mjs.map +1 -1
- package/dist/plugins/wallet/pairing.mjs +6 -24
- package/dist/plugins/wallet/pairing.mjs.map +1 -1
- package/dist/plugins/wallet/protocol.mjs.map +1 -1
- package/dist/plugins/wallet/routable.mjs.map +1 -1
- package/dist/plugins/wallet/server.mjs +17 -24
- package/dist/plugins/wallet/server.mjs.map +1 -1
- package/dist/plugins/wallet/service.d.mts +2 -2
- package/dist/plugins/wallet/service.mjs +4 -15
- package/dist/plugins/wallet/service.mjs.map +1 -1
- package/dist/plugins/wallet/snapshot.mjs.map +1 -1
- package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs +1 -5
- package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs.map +1 -1
- package/dist/plugins/walrus/codegen.d.mts +2 -13
- package/dist/plugins/walrus/codegen.mjs +93 -28
- package/dist/plugins/walrus/codegen.mjs.map +1 -1
- package/dist/plugins/walrus/deploy-paths.mjs +2 -3
- package/dist/plugins/walrus/deploy-paths.mjs.map +1 -1
- package/dist/plugins/walrus/deploy.mjs +26 -19
- package/dist/plugins/walrus/deploy.mjs.map +1 -1
- package/dist/plugins/walrus/errors.mjs +1 -8
- package/dist/plugins/walrus/errors.mjs.map +1 -1
- package/dist/plugins/walrus/faucet-strategy.mjs +15 -1
- package/dist/plugins/walrus/faucet-strategy.mjs.map +1 -1
- package/dist/plugins/walrus/index.d.mts +13 -44
- package/dist/plugins/walrus/index.mjs +119 -122
- package/dist/plugins/walrus/index.mjs.map +1 -1
- package/dist/plugins/walrus/mode/known-deploy.mjs +6 -6
- package/dist/plugins/walrus/mode/known-deploy.mjs.map +1 -1
- package/dist/plugins/walrus/mode/local-cluster.d.mts +2 -2
- package/dist/plugins/walrus/mode/local-cluster.mjs +2 -10
- package/dist/plugins/walrus/mode/local-cluster.mjs.map +1 -1
- package/dist/plugins/walrus/plugin-key.mjs.map +1 -1
- package/dist/plugins/walrus/registry-publish.mjs.map +1 -1
- package/dist/plugins/walrus/routable.mjs.map +1 -1
- package/dist/plugins/walrus/service.mjs.map +1 -1
- package/dist/plugins/walrus/snapshot.mjs +3 -3
- package/dist/plugins/walrus/snapshot.mjs.map +1 -1
- package/dist/plugins/walrus/storage-nodes.mjs +53 -14
- package/dist/plugins/walrus/storage-nodes.mjs.map +1 -1
- package/dist/plugins/walrus/wal-swap.mjs +4 -8
- package/dist/plugins/walrus/wal-swap.mjs.map +1 -1
- package/dist/primitives/artifact-publisher.mjs.map +1 -1
- package/dist/primitives/cache.d.mts +1 -1
- package/dist/runtime/docker/client.mjs +47 -3
- package/dist/runtime/docker/client.mjs.map +1 -1
- package/dist/runtime/docker/container.mjs +37 -57
- package/dist/runtime/docker/container.mjs.map +1 -1
- package/dist/runtime/docker/errors.mjs.map +1 -1
- package/dist/runtime/docker/exec.mjs +2 -2
- package/dist/runtime/docker/exec.mjs.map +1 -1
- package/dist/runtime/docker/image.mjs +10 -11
- package/dist/runtime/docker/image.mjs.map +1 -1
- package/dist/runtime/docker/index.mjs +0 -1
- package/dist/runtime/docker/inspect-and-decode.mjs.map +1 -1
- package/dist/runtime/docker/inventory.mjs +9 -9
- package/dist/runtime/docker/inventory.mjs.map +1 -1
- package/dist/runtime/docker/labels.mjs +12 -1
- package/dist/runtime/docker/labels.mjs.map +1 -1
- package/dist/runtime/docker/network.mjs +6 -6
- package/dist/runtime/docker/network.mjs.map +1 -1
- package/dist/runtime/docker/render-run-args.mjs.map +1 -1
- package/dist/runtime/docker/service.mjs +31 -45
- package/dist/runtime/docker/service.mjs.map +1 -1
- package/dist/runtime/docker/sweep.mjs +14 -64
- package/dist/runtime/docker/sweep.mjs.map +1 -1
- package/dist/runtime/docker/volume.mjs +1 -1
- package/dist/runtime/docker/volume.mjs.map +1 -1
- package/dist/runtime/docker/wrap.mjs +14 -2
- package/dist/runtime/docker/wrap.mjs.map +1 -1
- package/dist/substrate/brand.d.mts +2 -5
- package/dist/substrate/brand.mjs +3 -2
- package/dist/substrate/brand.mjs.map +1 -1
- package/dist/substrate/cross-process.mjs +2 -16
- package/dist/substrate/cross-process.mjs.map +1 -1
- package/dist/substrate/event-time.mjs +0 -2
- package/dist/substrate/event-time.mjs.map +1 -1
- package/dist/substrate/events.d.mts +46 -16
- package/dist/substrate/identity.d.mts +11 -5
- package/dist/substrate/manifest.d.mts +33 -26
- package/dist/substrate/manifest.mjs +8 -3
- package/dist/substrate/manifest.mjs.map +1 -1
- package/dist/substrate/options.d.mts +33 -4
- package/dist/substrate/plugin-ctx.d.mts +70 -0
- package/dist/substrate/plugin-ctx.mjs +66 -0
- package/dist/substrate/plugin-ctx.mjs.map +1 -0
- package/dist/substrate/plugin.d.mts +46 -38
- package/dist/substrate/plugin.mjs +13 -9
- package/dist/substrate/plugin.mjs.map +1 -1
- package/dist/substrate/projection.d.mts +1 -1
- package/dist/substrate/runtime/atomic-write.mjs +3 -4
- package/dist/substrate/runtime/atomic-write.mjs.map +1 -1
- package/dist/substrate/runtime/cache/schema.mjs.map +1 -1
- package/dist/substrate/runtime/cache/service.mjs +50 -20
- package/dist/substrate/runtime/cache/service.mjs.map +1 -1
- package/dist/substrate/runtime/config-validation.mjs.map +1 -1
- package/dist/substrate/runtime/control-plane/domain.mjs +34 -12
- package/dist/substrate/runtime/control-plane/domain.mjs.map +1 -1
- package/dist/substrate/runtime/control-plane/service.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/command-channel/channel.mjs +14 -17
- package/dist/substrate/runtime/cross-process/command-channel/channel.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/command-channel/file-channel.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/command-channel/protocol.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/command-channel/runtime-control-lock.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/index.mjs +0 -2
- package/dist/substrate/runtime/cross-process/live-clock.mjs +1 -1
- package/dist/substrate/runtime/cross-process/live-clock.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/liveness.mjs +11 -18
- package/dist/substrate/runtime/cross-process/liveness.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/reclaim-stale-file.mjs +2 -2
- package/dist/substrate/runtime/cross-process/reclaim-stale-file.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/roster.mjs +17 -127
- package/dist/substrate/runtime/cross-process/roster.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/self-pid.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/stack-lock.mjs +29 -28
- package/dist/substrate/runtime/cross-process/stack-lock.mjs.map +1 -1
- package/dist/substrate/runtime/current-plugin.mjs.map +1 -1
- package/dist/substrate/runtime/errors.mjs +1 -13
- package/dist/substrate/runtime/errors.mjs.map +1 -1
- package/dist/substrate/runtime/format-unknown-error.mjs.map +1 -1
- package/dist/substrate/runtime/host-bind-mount-owner.mjs.map +1 -1
- package/dist/substrate/runtime/host-gateway.mjs.map +1 -1
- package/dist/substrate/runtime/host-tree-tar/index.mjs +15 -163
- package/dist/substrate/runtime/host-tree-tar/index.mjs.map +1 -1
- package/dist/substrate/runtime/http-probe.d.mts +1 -3
- package/dist/substrate/runtime/http-probe.mjs.map +1 -1
- package/dist/substrate/runtime/index.mjs +1 -6
- package/dist/substrate/runtime/lease-broker/service.mjs +5 -23
- package/dist/substrate/runtime/lease-broker/service.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/dep-graph.mjs +3 -3
- package/dist/substrate/runtime/lifecycle/dep-graph.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/graph-input-id.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/graph-input-id.mjs +133 -0
- package/dist/substrate/runtime/lifecycle/graph-input-id.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/index.mjs +2 -2
- package/dist/substrate/runtime/lifecycle/plugin-registry.d.mts +1 -1
- package/dist/substrate/runtime/lifecycle/plugin-registry.mjs +22 -1
- package/dist/substrate/runtime/lifecycle/plugin-registry.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/ready-gate.mjs +2 -15
- package/dist/substrate/runtime/lifecycle/ready-gate.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/selective-restart.mjs +29 -25
- package/dist/substrate/runtime/lifecycle/selective-restart.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/signals.mjs +1 -1
- package/dist/substrate/runtime/lifecycle/signals.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/state-machine.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/watch-attribution.d.mts +1 -1
- package/dist/substrate/runtime/lifecycle/watch-attribution.mjs +0 -1
- package/dist/substrate/runtime/lifecycle/watch-attribution.mjs.map +1 -1
- package/dist/substrate/runtime/managed-container.d.mts +5 -1
- package/dist/substrate/runtime/managed-container.mjs +8 -10
- package/dist/substrate/runtime/managed-container.mjs.map +1 -1
- package/dist/substrate/runtime/manifest/manifest.mjs +8 -30
- package/dist/substrate/runtime/manifest/manifest.mjs.map +1 -1
- package/dist/substrate/runtime/mode-errors.d.mts +1 -2
- package/dist/substrate/runtime/mode-errors.mjs.map +1 -1
- package/dist/substrate/runtime/observability/cascade-formatter.mjs +1 -11
- package/dist/substrate/runtime/observability/cascade-formatter.mjs.map +1 -1
- package/dist/substrate/runtime/observability/ignore-with-log.mjs.map +1 -1
- package/dist/substrate/runtime/observability/index.d.mts +1 -1
- package/dist/substrate/runtime/observability/index.mjs +4 -6
- package/dist/substrate/runtime/observability/log-attrs.mjs +46 -0
- package/dist/substrate/runtime/observability/log-attrs.mjs.map +1 -0
- package/dist/substrate/runtime/observability/log-store.mjs.map +1 -1
- package/dist/substrate/runtime/observability/logger.mjs +3 -3
- package/dist/substrate/runtime/observability/logger.mjs.map +1 -1
- package/dist/substrate/runtime/observability/output-truncate.mjs.map +1 -1
- package/dist/substrate/runtime/observability/pretty-error.mjs.map +1 -1
- package/dist/substrate/runtime/observability/process-lines.mjs.map +1 -1
- package/dist/substrate/runtime/observability/redaction.mjs.map +1 -1
- package/dist/substrate/runtime/observability/subprocess-capture.mjs +2 -2
- package/dist/substrate/runtime/observability/subprocess-capture.mjs.map +1 -1
- package/dist/substrate/runtime/passthrough-or-wrap.mjs.map +1 -1
- package/dist/substrate/runtime/paths.mjs +27 -9
- package/dist/substrate/runtime/paths.mjs.map +1 -1
- package/dist/substrate/runtime/phase-preserving-produce.mjs.map +1 -1
- package/dist/substrate/runtime/port-broker/service.mjs +10 -27
- package/dist/substrate/runtime/port-broker/service.mjs.map +1 -1
- package/dist/substrate/runtime/post-acquire-tasks.mjs.map +1 -1
- package/dist/substrate/runtime/probes.d.mts +2 -3
- package/dist/substrate/runtime/probes.mjs.map +1 -1
- package/dist/substrate/runtime/process-supervisor.mjs.map +1 -1
- package/dist/substrate/runtime/projection/operational-endpoints.mjs.map +1 -1
- package/dist/substrate/runtime/projection/state-ref.mjs.map +1 -1
- package/dist/substrate/runtime/projection/update.mjs +87 -11
- package/dist/substrate/runtime/projection/update.mjs.map +1 -1
- package/dist/substrate/runtime/random-suffix.mjs.map +1 -1
- package/dist/substrate/runtime/reconcile/fs-plan.mjs +146 -0
- package/dist/substrate/runtime/reconcile/fs-plan.mjs.map +1 -0
- package/dist/substrate/runtime/reconcile/graph.mjs +19 -0
- package/dist/substrate/runtime/reconcile/graph.mjs.map +1 -0
- package/dist/substrate/runtime/reconcile/index.mjs +5 -0
- package/dist/substrate/runtime/reconcile/label.mjs +41 -0
- package/dist/substrate/runtime/reconcile/label.mjs.map +1 -0
- package/dist/substrate/runtime/reconcile/spec.mjs +15 -0
- package/dist/substrate/runtime/reconcile/spec.mjs.map +1 -0
- package/dist/substrate/runtime/retry-policy.d.mts +2 -3
- package/dist/substrate/runtime/retry-policy.mjs.map +1 -1
- package/dist/substrate/runtime/routed-url.mjs.map +1 -1
- package/dist/substrate/runtime/runtime-decode.mjs.map +1 -1
- package/dist/substrate/runtime/scoped-http-server.mjs.map +1 -1
- package/dist/substrate/runtime/stage-and-swap/index.mjs +49 -12
- package/dist/substrate/runtime/stage-and-swap/index.mjs.map +1 -1
- package/dist/substrate/runtime/strategy-registry/chain-keyed-strategy-for.mjs.map +1 -1
- package/dist/substrate/runtime/strategy-registry/chain-probe-for.mjs.map +1 -1
- package/dist/substrate/runtime/strategy-registry/service.mjs +29 -17
- package/dist/substrate/runtime/strategy-registry/service.mjs.map +1 -1
- package/dist/substrate/runtime/subnet-broker.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/acquire-node.mjs +188 -56
- package/dist/substrate/runtime/supervisor/acquire-node.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/background-tasks.mjs +79 -65
- package/dist/substrate/runtime/supervisor/background-tasks.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/command-loop.mjs +82 -23
- package/dist/substrate/runtime/supervisor/command-loop.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/contribution-dispatcher.mjs +16 -0
- package/dist/substrate/runtime/supervisor/contribution-dispatcher.mjs.map +1 -0
- package/dist/substrate/runtime/supervisor/errors.mjs +11 -2
- package/dist/substrate/runtime/supervisor/errors.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/index.mjs +2 -0
- package/dist/substrate/runtime/supervisor/shutdown.mjs +6 -6
- package/dist/substrate/runtime/supervisor/shutdown.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/start-supervisor.mjs +60 -70
- package/dist/substrate/runtime/supervisor/start-supervisor.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/state.d.mts +1 -1
- package/dist/substrate/runtime/supervisor/state.mjs +1 -1
- package/dist/substrate/runtime/supervisor/state.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/teardown.mjs +10 -9
- package/dist/substrate/runtime/supervisor/teardown.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/wiring.mjs +6 -20
- package/dist/substrate/runtime/supervisor/wiring.mjs.map +1 -1
- package/dist/substrate/runtime/tar/reader.mjs +216 -0
- package/dist/substrate/runtime/tar/reader.mjs.map +1 -0
- package/dist/substrate/runtime/typed-env.mjs.map +1 -1
- package/dist/substrate/versioned-doc-schema.mjs.map +1 -1
- package/dist/substrate/versioned-doc-sync.mjs +5 -5
- package/dist/substrate/versioned-doc-sync.mjs.map +1 -1
- package/dist/surfaces/cli/command-tree.mjs +49 -7
- package/dist/surfaces/cli/command-tree.mjs.map +1 -1
- package/dist/surfaces/cli/commands/config.mjs +1 -1
- package/dist/surfaces/cli/commands/config.mjs.map +1 -1
- package/dist/surfaces/cli/commands/confirm-node.mjs.map +1 -1
- package/dist/surfaces/cli/commands/confirm.mjs.map +1 -1
- package/dist/surfaces/cli/commands/doctor.mjs +1 -1
- package/dist/surfaces/cli/commands/doctor.mjs.map +1 -1
- package/dist/surfaces/cli/commands/prune-picker-entry.mjs.map +1 -1
- package/dist/surfaces/cli/commands/prune-picker.mjs.map +1 -1
- package/dist/surfaces/cli/commands/prune.mjs +1 -1
- package/dist/surfaces/cli/commands/prune.mjs.map +1 -1
- package/dist/surfaces/cli/commands/snapshot.mjs +1 -1
- package/dist/surfaces/cli/commands/snapshot.mjs.map +1 -1
- package/dist/surfaces/cli/commands/status.mjs +1 -1
- package/dist/surfaces/cli/commands/status.mjs.map +1 -1
- package/dist/surfaces/cli/commands/supervisor-presence.mjs.map +1 -1
- package/dist/surfaces/cli/commands/wipe.mjs +3 -4
- package/dist/surfaces/cli/commands/wipe.mjs.map +1 -1
- package/dist/surfaces/cli/envelope.mjs.map +1 -1
- package/dist/surfaces/cli/errors.mjs.map +1 -1
- package/dist/surfaces/cli/flags.mjs.map +1 -1
- package/dist/surfaces/cli/index.mjs +45 -14
- package/dist/surfaces/cli/index.mjs.map +1 -1
- package/dist/surfaces/cli/output.mjs.map +1 -1
- package/dist/surfaces/cli/sysexits.mjs.map +1 -1
- package/dist/surfaces/tui/app.mjs +0 -21
- package/dist/surfaces/tui/app.mjs.map +1 -1
- package/dist/surfaces/tui/dashboard.mjs +0 -48
- package/dist/surfaces/tui/dashboard.mjs.map +1 -1
- package/dist/surfaces/tui/display-derivation.mjs +80 -16
- package/dist/surfaces/tui/display-derivation.mjs.map +1 -1
- package/dist/surfaces/tui/errors.mjs.map +1 -1
- package/dist/surfaces/tui/event-log.mjs +0 -9
- package/dist/surfaces/tui/event-log.mjs.map +1 -1
- package/dist/surfaces/tui/heartbeat.mjs.map +1 -1
- package/dist/surfaces/tui/index.mjs +2 -2
- package/dist/surfaces/tui/index.mjs.map +1 -1
- package/dist/surfaces/tui/input.mjs.map +1 -1
- package/dist/surfaces/tui/mode-detect.mjs.map +1 -1
- package/dist/surfaces/tui/mount-ink.mjs.map +1 -1
- package/dist/surfaces/tui/plain-renderer.mjs +26 -19
- package/dist/surfaces/tui/plain-renderer.mjs.map +1 -1
- package/dist/surfaces/tui/resource-table.mjs +8 -10
- package/dist/surfaces/tui/resource-table.mjs.map +1 -1
- package/images/postgres/Dockerfile +0 -1
- package/images/sui/Dockerfile +27 -54
- package/images/sui/entrypoint.sh +17 -179
- package/package.json +23 -15
- package/dashboard-ui/assets/index-Bmi1UtAg.js +0 -1356
- package/dashboard-ui/assets/index-D5EShVt4.js +0 -3
- package/dashboard-ui/assets/index-Deml9drg.css +0 -1
- package/dist/api/plugin-errors.d.mts +0 -7
- package/dist/api/plugin-errors.mjs +0 -10
- package/dist/api/plugin-errors.mjs.map +0 -1
- package/dist/cli/wirings/build-verb-layers.mjs +0 -42
- package/dist/cli/wirings/build-verb-layers.mjs.map +0 -1
- package/dist/contracts/capability-decl.d.mts +0 -40
- package/dist/orchestrators/built-in-plugin-layers.mjs +0 -54
- package/dist/orchestrators/built-in-plugin-layers.mjs.map +0 -1
- package/dist/orchestrators/run.mjs +0 -91
- package/dist/orchestrators/run.mjs.map +0 -1
- package/dist/orchestrators/runtime-composition.d.mts +0 -10
- package/dist/orchestrators/runtime-composition.mjs +0 -252
- package/dist/orchestrators/runtime-composition.mjs.map +0 -1
- package/dist/orchestrators/snapshot/capture-command.d.mts +0 -1
- package/dist/orchestrators/snapshot/capture-command.mjs +0 -25
- package/dist/orchestrators/snapshot/capture-command.mjs.map +0 -1
- package/dist/orchestrators/snapshot/pending-marker.mjs +0 -99
- package/dist/orchestrators/snapshot/pending-marker.mjs.map +0 -1
- package/dist/orchestrators/snapshot/recover-pending.mjs +0 -223
- package/dist/orchestrators/snapshot/recover-pending.mjs.map +0 -1
- package/dist/orchestrators/snapshot/state-document.d.mts +0 -1
- package/dist/orchestrators/snapshot/state-document.mjs +0 -58
- package/dist/orchestrators/snapshot/state-document.mjs.map +0 -1
- package/dist/plugins/account/spans.mjs +0 -16
- package/dist/plugins/account/spans.mjs.map +0 -1
- package/dist/plugins/account/variants/env.mjs +0 -24
- package/dist/plugins/account/variants/env.mjs.map +0 -1
- package/dist/plugins/account/variants/inline.mjs +0 -13
- package/dist/plugins/account/variants/inline.mjs.map +0 -1
- package/dist/plugins/account/variants/keystore.mjs +0 -91
- package/dist/plugins/account/variants/keystore.mjs.map +0 -1
- package/dist/plugins/action/spans.mjs +0 -11
- package/dist/plugins/action/spans.mjs.map +0 -1
- package/dist/plugins/coin/spans.mjs +0 -20
- package/dist/plugins/coin/spans.mjs.map +0 -1
- package/dist/plugins/deepbook/spans.mjs +0 -18
- package/dist/plugins/deepbook/spans.mjs.map +0 -1
- package/dist/plugins/faucet/spans.mjs +0 -12
- package/dist/plugins/faucet/spans.mjs.map +0 -1
- package/dist/plugins/package/spans.mjs +0 -14
- package/dist/plugins/package/spans.mjs.map +0 -1
- package/dist/plugins/postgres/codegen.mjs +0 -42
- package/dist/plugins/postgres/codegen.mjs.map +0 -1
- package/dist/plugins/postgres/connection.d.mts +0 -33
- package/dist/plugins/postgres/connection.mjs.map +0 -1
- package/dist/plugins/postgres/db-ensure.mjs.map +0 -1
- package/dist/plugins/postgres/errors.d.mts +0 -60
- package/dist/plugins/postgres/errors.mjs +0 -29
- package/dist/plugins/postgres/errors.mjs.map +0 -1
- package/dist/plugins/postgres/index.d.mts +0 -37
- package/dist/plugins/postgres/index.mjs +0 -68
- package/dist/plugins/postgres/index.mjs.map +0 -1
- package/dist/plugins/postgres/routable.mjs +0 -33
- package/dist/plugins/postgres/routable.mjs.map +0 -1
- package/dist/plugins/postgres/service.d.mts +0 -50
- package/dist/plugins/postgres/service.mjs +0 -179
- package/dist/plugins/postgres/service.mjs.map +0 -1
- package/dist/plugins/postgres/snapshot.mjs +0 -32
- package/dist/plugins/postgres/snapshot.mjs.map +0 -1
- package/dist/plugins/postgres/spans.mjs +0 -11
- package/dist/plugins/postgres/spans.mjs.map +0 -1
- package/dist/plugins/seal/spans.mjs +0 -18
- package/dist/plugins/seal/spans.mjs.map +0 -1
- package/dist/plugins/sui/spans.mjs +0 -17
- package/dist/plugins/sui/spans.mjs.map +0 -1
- package/dist/plugins/wallet/spans.mjs +0 -22
- package/dist/plugins/wallet/spans.mjs.map +0 -1
- package/dist/plugins/walrus/registry-publish.d.mts +0 -24
- package/dist/plugins/walrus/spans.mjs +0 -18
- package/dist/plugins/walrus/spans.mjs.map +0 -1
- package/dist/runtime/docker/logs.d.mts +0 -1
- package/dist/runtime/docker/logs.mjs +0 -34
- package/dist/runtime/docker/logs.mjs.map +0 -1
- package/dist/substrate/runtime/artifact-publisher/index.mjs +0 -86
- package/dist/substrate/runtime/artifact-publisher/index.mjs.map +0 -1
- package/dist/substrate/runtime/capability-sinks/index.d.mts +0 -1
- package/dist/substrate/runtime/capability-sinks/index.mjs +0 -3
- package/dist/substrate/runtime/capability-sinks/layer.d.mts +0 -1
- package/dist/substrate/runtime/capability-sinks/layer.mjs +0 -31
- package/dist/substrate/runtime/capability-sinks/layer.mjs.map +0 -1
- package/dist/substrate/runtime/capability-sinks/service.d.mts +0 -95
- package/dist/substrate/runtime/capability-sinks/service.mjs +0 -69
- package/dist/substrate/runtime/capability-sinks/service.mjs.map +0 -1
- package/dist/substrate/runtime/cross-process/lock.d.mts +0 -1
- package/dist/substrate/runtime/cross-process/lock.mjs +0 -23
- package/dist/substrate/runtime/cross-process/lock.mjs.map +0 -1
- package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs +0 -113
- package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs.map +0 -1
- package/dist/substrate/runtime/lifecycle/lifecycle-fact.mjs +0 -31
- package/dist/substrate/runtime/lifecycle/lifecycle-fact.mjs.map +0 -1
- package/dist/substrate/runtime/observability/formatter-registry.d.mts +0 -1
- package/dist/substrate/runtime/observability/formatter-registry.mjs +0 -48
- package/dist/substrate/runtime/observability/formatter-registry.mjs.map +0 -1
- package/dist/substrate/runtime/observability/span-store.d.mts +0 -1
- package/dist/substrate/runtime/observability/span-store.mjs +0 -110
- package/dist/substrate/runtime/observability/span-store.mjs.map +0 -1
- package/dist/substrate/runtime/observability/spans.d.mts +0 -1
- package/dist/substrate/runtime/observability/spans.mjs +0 -87
- package/dist/substrate/runtime/observability/spans.mjs.map +0 -1
- package/dist/substrate/runtime/projection/index.mjs +0 -4
- package/dist/substrate/runtime/projection/persisted.mjs +0 -213
- package/dist/substrate/runtime/projection/persisted.mjs.map +0 -1
- package/dist/substrate/runtime/scoped-multimap/service.mjs +0 -52
- package/dist/substrate/runtime/scoped-multimap/service.mjs.map +0 -1
- package/dist/substrate/runtime/scoped-ref-map/index.mjs +0 -2
- package/dist/substrate/runtime/scoped-ref-map/service.mjs +0 -83
- package/dist/substrate/runtime/scoped-ref-map/service.mjs.map +0 -1
- package/dist/substrate/runtime/state-store/index.mjs +0 -3
- package/dist/substrate/runtime/state-store/schema.d.mts +0 -1
- package/dist/substrate/runtime/state-store/schema.mjs +0 -41
- package/dist/substrate/runtime/state-store/schema.mjs.map +0 -1
- package/dist/substrate/runtime/state-store/service.d.mts +0 -1
- package/dist/substrate/runtime/state-store/service.mjs +0 -145
- package/dist/substrate/runtime/state-store/service.mjs.map +0 -1
- package/dist/substrate/runtime/sui-execute/index.mjs.map +0 -1
- package/dist/substrate/runtime/sui-execute/sign-and-dispatch.mjs.map +0 -1
- package/dist/substrate/runtime/sui-ledger/object-ref.mjs.map +0 -1
- package/dist/substrate/runtime/sui-move-build/index.mjs.map +0 -1
- package/dist/substrate/runtime/supervisor/dispatch-contributions.mjs +0 -151
- package/dist/substrate/runtime/supervisor/dispatch-contributions.mjs.map +0 -1
- package/dist/substrate/state-store.d.mts +0 -1
- /package/dist/orchestrators/{snapshot/pending-marker.d.mts → codegen/id-config.d.mts} +0 -0
- /package/dist/orchestrators/snapshot/{recover-pending.d.mts → interrupted-restore.d.mts} +0 -0
- /package/dist/{substrate/runtime/sui-execute → plugins/sui/exec}/sign-and-dispatch.d.mts +0 -0
- /package/dist/plugins/{postgres/snapshot.d.mts → sui/ledger/object-ref.d.mts} +0 -0
- /package/dist/{substrate/runtime/sui-move-build → plugins/sui/move}/index.d.mts +0 -0
- /package/dist/substrate/runtime/{state-store/index.d.mts → reconcile/graph.d.mts} +0 -0
- /package/dist/substrate/runtime/{cross-process/snapshot-reservation.d.mts → supervisor/contribution-dispatcher.d.mts} +0 -0
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
//#region src/plugins/package/spans.ts
|
|
2
|
-
const PackageSpans = { publish: {
|
|
3
|
-
phase: "package.publish.phase",
|
|
4
|
-
package: "package.publish.package",
|
|
5
|
-
packageName: "package.publish.packageName",
|
|
6
|
-
packageId: "package.publish.packageId",
|
|
7
|
-
sourcePath: "package.publish.sourcePath",
|
|
8
|
-
chainId: "package.publish.chainId",
|
|
9
|
-
publisher: "package.publish.publisher"
|
|
10
|
-
} };
|
|
11
|
-
//#endregion
|
|
12
|
-
export { PackageSpans };
|
|
13
|
-
|
|
14
|
-
//# sourceMappingURL=spans.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spans.mjs","names":[],"sources":["../../../src/plugins/package/spans.ts"],"sourcesContent":["// Package plugin span-attribute vocabulary. Plugin-local — substrate's\n// `SpanAttr` carries only engine-dimensional + http/process generic\n// keys; plugin-domain keys live next to the plugin that owns them.\n//\n// Callsite pattern: `Effect.annotateCurrentSpan({\n// [PackageSpans.publish.phase]: 'build' })`. Free-form string literals\n// are a STYLE_GUIDE §16 violation.\n\nexport const PackageSpans = {\n\tpublish: {\n\t\tphase: 'package.publish.phase',\n\t\tpackage: 'package.publish.package',\n\t\tpackageName: 'package.publish.packageName',\n\t\tpackageId: 'package.publish.packageId',\n\t\tsourcePath: 'package.publish.sourcePath',\n\t\tchainId: 'package.publish.chainId',\n\t\tpublisher: 'package.publish.publisher',\n\t},\n} as const;\n"],"mappings":";AAQA,MAAa,eAAe,EAC3B,SAAS;CACR,OAAO;CACP,SAAS;CACT,aAAa;CACb,WAAW;CACX,YAAY;CACZ,SAAS;CACT,WAAW;CACX,EACD"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { credentialedUrl, plainUrl } from "./connection.mjs";
|
|
2
|
-
import { Effect } from "effect";
|
|
3
|
-
//#region src/plugins/postgres/codegen.ts
|
|
4
|
-
/** Construct the Codegenable contribution. Emit is byte-deterministic
|
|
5
|
-
* on unchanged input (architecture: no mtime churn on no-op cycles).
|
|
6
|
-
*
|
|
7
|
-
* The emitted shape carries both the credentialed URL (for in-app
|
|
8
|
-
* dialers) and the plain URL (for code paths that log or persist the
|
|
9
|
-
* endpoint). */
|
|
10
|
-
const makeCodegenable = (opts) => {
|
|
11
|
-
const parts = {
|
|
12
|
-
user: opts.user,
|
|
13
|
-
password: opts.password,
|
|
14
|
-
host: opts.host,
|
|
15
|
-
port: opts.port
|
|
16
|
-
};
|
|
17
|
-
return {
|
|
18
|
-
kind: "codegenable",
|
|
19
|
-
emitterName: "postgres-connection",
|
|
20
|
-
outputPath: `postgres/${opts.name}.ts`,
|
|
21
|
-
sensitive: true,
|
|
22
|
-
emit: (ctx) => Effect.sync(() => {
|
|
23
|
-
const bindings = {
|
|
24
|
-
name: opts.name,
|
|
25
|
-
host: opts.host,
|
|
26
|
-
port: opts.port,
|
|
27
|
-
user: opts.user,
|
|
28
|
-
password: opts.password,
|
|
29
|
-
databases: opts.databases,
|
|
30
|
-
url: credentialedUrl(parts),
|
|
31
|
-
plainUrl: plainUrl(opts.host, opts.port),
|
|
32
|
-
database: opts.databases[0]
|
|
33
|
-
};
|
|
34
|
-
ctx.exportConst("postgresConnection", bindings);
|
|
35
|
-
return ctx.done();
|
|
36
|
-
})
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
//#endregion
|
|
40
|
-
export { makeCodegenable };
|
|
41
|
-
|
|
42
|
-
//# sourceMappingURL=codegen.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"codegen.mjs","names":[],"sources":["../../../src/plugins/postgres/codegen.ts"],"sourcesContent":["// Postgres plugin — Codegenable contribution.\n//\n// Architecture §6: plugins emit typed `CodegenableDecl`s; the codegen\n// orchestrator stages files into the user's source tree WITHOUT\n// naming the plugin. Postgres's contribution is the connection\n// surface — credentialed URL + parsed parts so downstream user-app\n// code can construct `DATABASE_URL` strings (or feed a typed\n// connection record into a pg client) without re-deriving creds.\n//\n// Sensitive flag: the emitted file carries the password, so the\n// codegen orchestrator marks it 0o600 inside its parent (0o700). The\n// manifest projection (separate from codegen) strips the password\n// via the substrate's secret-redactor pattern.\n\nimport { Effect } from 'effect';\n\nimport type { CodegenableDecl } from '../../contracts/codegenable.ts';\nimport {\n\tcredentialedUrl,\n\tplainUrl,\n\ttype PostgresConnectionBindings,\n\ttype PostgresConnectionParts,\n} from './connection.ts';\n\nexport interface MakeCodegenableOptions {\n\treadonly name: string;\n\treadonly user: string;\n\treadonly password: string;\n\treadonly host: string;\n\treadonly port: number;\n\treadonly databases: ReadonlyArray<string>;\n}\n\n/** Construct the Codegenable contribution. Emit is byte-deterministic\n * on unchanged input (architecture: no mtime churn on no-op cycles).\n *\n * The emitted shape carries both the credentialed URL (for in-app\n * dialers) and the plain URL (for code paths that log or persist the\n * endpoint). */\nexport const makeCodegenable = (\n\topts: MakeCodegenableOptions,\n): CodegenableDecl<'postgres-connection'> => {\n\tconst parts: PostgresConnectionParts = {\n\t\tuser: opts.user,\n\t\tpassword: opts.password,\n\t\thost: opts.host,\n\t\tport: opts.port,\n\t};\n\n\treturn {\n\t\tkind: 'codegenable',\n\t\temitterName: 'postgres-connection',\n\t\t// One file per postgres instance. Multiple postgres()\n\t\t// instances on the same stack would collide here — distilled\n\t\t// doc § Edge cases notes this as a name-collision foot-gun;\n\t\t// the substrate's codegen layer detects the collision and\n\t\t// fails with a typed error before write.\n\t\toutputPath: `postgres/${opts.name}.ts`,\n\t\tsensitive: true,\n\t\temit: (ctx) =>\n\t\t\tEffect.sync(() => {\n\t\t\t\tconst bindings: PostgresConnectionBindings = {\n\t\t\t\t\tname: opts.name,\n\t\t\t\t\thost: opts.host,\n\t\t\t\t\tport: opts.port,\n\t\t\t\t\tuser: opts.user,\n\t\t\t\t\tpassword: opts.password,\n\t\t\t\t\tdatabases: opts.databases,\n\t\t\t\t\turl: credentialedUrl(parts),\n\t\t\t\t\tplainUrl: plainUrl(opts.host, opts.port),\n\t\t\t\t\tdatabase: opts.databases[0]!,\n\t\t\t\t};\n\t\t\t\tctx.exportConst('postgresConnection', bindings);\n\t\t\t\treturn ctx.done();\n\t\t\t}),\n\t};\n};\n"],"mappings":";;;;;;;;;AAuCA,MAAa,mBACZ,SAC4C;CAC5C,MAAM,QAAiC;EACtC,MAAM,KAAK;EACX,UAAU,KAAK;EACf,MAAM,KAAK;EACX,MAAM,KAAK;EACX;AAED,QAAO;EACN,MAAM;EACN,aAAa;EAMb,YAAY,YAAY,KAAK,KAAK;EAClC,WAAW;EACX,OAAO,QACN,OAAO,WAAW;GACjB,MAAM,WAAuC;IAC5C,MAAM,KAAK;IACX,MAAM,KAAK;IACX,MAAM,KAAK;IACX,MAAM,KAAK;IACX,UAAU,KAAK;IACf,WAAW,KAAK;IAChB,KAAK,gBAAgB,MAAM;IAC3B,UAAU,SAAS,KAAK,MAAM,KAAK,KAAK;IACxC,UAAU,KAAK,UAAU;IACzB;AACD,OAAI,YAAY,sBAAsB,SAAS;AAC/C,UAAO,IAAI,MAAM;IAChB;EACH"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
//#region src/plugins/postgres/connection.d.ts
|
|
2
|
-
/** Components of a postgres connection. The plugin keeps these in
|
|
3
|
-
* one record so URL construction is a single function call. */
|
|
4
|
-
interface PostgresConnectionParts {
|
|
5
|
-
readonly user: string;
|
|
6
|
-
readonly password: string;
|
|
7
|
-
readonly host: string;
|
|
8
|
-
readonly port: number;
|
|
9
|
-
}
|
|
10
|
-
/** Public typed shape emitted into codegen.
|
|
11
|
-
*
|
|
12
|
-
* The credentialed URL is INCLUDED so consumers in the same user
|
|
13
|
-
* app process can dial. The manifest projection (substrate-level)
|
|
14
|
-
* strips it via the secret-redactor pattern — codegen and manifest
|
|
15
|
-
* are different artifacts. */
|
|
16
|
-
interface PostgresConnectionBindings {
|
|
17
|
-
readonly name: string;
|
|
18
|
-
readonly host: string;
|
|
19
|
-
readonly port: number;
|
|
20
|
-
readonly user: string;
|
|
21
|
-
/** Sensitive — never crosses to the on-disk manifest. */
|
|
22
|
-
readonly password: string;
|
|
23
|
-
readonly databases: ReadonlyArray<string>;
|
|
24
|
-
/** Cluster-level URL with credentials. */
|
|
25
|
-
readonly url: string;
|
|
26
|
-
/** Cluster-level URL without credentials — manifest-safe. */
|
|
27
|
-
readonly plainUrl: string;
|
|
28
|
-
/** First (bootstrap) database name. Convenience for single-DB apps. */
|
|
29
|
-
readonly database: string;
|
|
30
|
-
}
|
|
31
|
-
//#endregion
|
|
32
|
-
export { PostgresConnectionBindings, PostgresConnectionParts };
|
|
33
|
-
//# sourceMappingURL=connection.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"connection.mjs","names":[],"sources":["../../../src/plugins/postgres/connection.ts"],"sourcesContent":["// Postgres connection-string builders + the public typed shape used\n// by codegen and consumers.\n//\n// Distilled-doc § Postgres-specific concerns: two URL shapes must exit\n// the plugin —\n//\n// 1. CREDENTIALED form (`postgres://<user>:<pw>@<host>:<port>`) for\n// in-process / in-stack dialers that need to issue real queries.\n// 2. PLAIN form (`postgres://<host>:<port>`) for the on-disk manifest\n// and for the flat-endpoint registry. NEVER carries the password.\n//\n// Both shapes can be extended with a database name segment via\n// `withDatabase`. The plain form's existence is the structural cure\n// for the \"credentialed URL leaks via console.log\" foot-gun called\n// out in the distilled doc's learnings — the manifest projection\n// refuses anything but the plain form.\n\n/** Components of a postgres connection. The plugin keeps these in\n * one record so URL construction is a single function call. */\nexport interface PostgresConnectionParts {\n\treadonly user: string;\n\treadonly password: string;\n\treadonly host: string;\n\treadonly port: number;\n}\n\n/** Build the credentialed URL.\n *\n * Caller convention: this URL MUST NOT be logged or persisted to\n * disk. The substrate's observability redactor strips it on best-\n * effort; the structural cure is to use `plainUrl` everywhere the\n * password isn't needed. */\nexport const credentialedUrl = (parts: PostgresConnectionParts): string => {\n\tconst { user, password, host, port } = parts;\n\treturn `postgres://${encodeURIComponent(user)}:${encodeURIComponent(password)}@${host}:${port}`;\n};\n\n/** Build the no-credentials URL. Manifest-safe by construction. */\nexport const plainUrl = (host: string, port: number): string => `postgres://${host}:${port}`;\n\n/** Compose a database segment onto a base URL. */\nexport const withDatabase = (baseUrl: string, db: string): string =>\n\t`${baseUrl}/${encodeURIComponent(db)}`;\n\n/** Public typed shape emitted into codegen.\n *\n * The credentialed URL is INCLUDED so consumers in the same user\n * app process can dial. The manifest projection (substrate-level)\n * strips it via the secret-redactor pattern — codegen and manifest\n * are different artifacts. */\nexport interface PostgresConnectionBindings {\n\treadonly name: string;\n\treadonly host: string;\n\treadonly port: number;\n\treadonly user: string;\n\t/** Sensitive — never crosses to the on-disk manifest. */\n\treadonly password: string;\n\treadonly databases: ReadonlyArray<string>;\n\t/** Cluster-level URL with credentials. */\n\treadonly url: string;\n\t/** Cluster-level URL without credentials — manifest-safe. */\n\treadonly plainUrl: string;\n\t/** First (bootstrap) database name. Convenience for single-DB apps. */\n\treadonly database: string;\n\t/** Per-database credentialed URL composer is NOT included on the\n\t * emitted shape — codegen output is a static record, not a closure.\n\t * Consumers compose `${url}/${db}` themselves, or import the helper\n\t * from the plugin's runtime surface. */\n}\n"],"mappings":";;;;;;;AAgCA,MAAa,mBAAmB,UAA2C;CAC1E,MAAM,EAAE,MAAM,UAAU,MAAM,SAAS;AACvC,QAAO,cAAc,mBAAmB,KAAK,CAAC,GAAG,mBAAmB,SAAS,CAAC,GAAG,KAAK,GAAG;;;AAI1F,MAAa,YAAY,MAAc,SAAyB,cAAc,KAAK,GAAG;;AAGtF,MAAa,gBAAgB,SAAiB,OAC7C,GAAG,QAAQ,GAAG,mBAAmB,GAAG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"db-ensure.mjs","names":[],"sources":["../../../src/plugins/postgres/db-ensure.ts"],"sourcesContent":["// Postgres plugin — idempotent logical-database creation via\n// `docker exec ... psql`.\n//\n// Why exec, not a TS pg client:\n// - Production path keeps a zero-runtime-dep posture (distilled doc\n// § Postgres-specific concerns: \"avoids carrying a TS `pg` runtime\n// dependency in the production path\").\n// - The probe binary already lives inside the image; the dev\n// machine doesn't need a libpq install.\n// - The same machinery serves `pg_isready` (readiness probe) and\n// `psql` (existence check + createdb), so one exec primitive\n// covers both side-channels.\n//\n// Idempotency contract:\n// - The first database is bootstrapped by the upstream image's\n// entrypoint via `POSTGRES_DB`. The plugin's acquire body MUST\n// skip it here — passing it through `ensureDatabase` is harmless\n// (we short-circuit on existence) but wastes a round-trip.\n// - Subsequent databases land via SELECT 1 / createdb. SELECT 1\n// against `pg_database WHERE datname = '<name>'` returns \"1\\n\" on\n// hit; we treat any non-empty trimmed stdout as a hit so a\n// trailing newline doesn't trigger a duplicate-createdb path.\n//\n// The `ContainerExec` capability is consumed via the plugin's service\n// body (`service.ts:containerExec`), which thin-wraps the\n// `ContainerRuntime.exec` contract surface. Daemon-level failures (no\n// such container, daemon unreachable) map to a typed\n// `PostgresPluginError({phase: 'container-start'})` rather than a\n// fabricated non-zero `ExecResult`; `waitForProbe` treats that typed\n// failure as retryable and preserves the underlying cause on the\n// timeout error's `lastError` field.\n\nimport { Effect } from 'effect';\n\nimport {\n\tdatabaseCreateFailed,\n\tpostgresConnectionTimeout,\n\ttype DatabaseCreateFailed,\n\ttype PostgresConnectionTimeout,\n\ttype PostgresPluginError,\n} from './errors.ts';\nimport { PostgresSpans } from './spans.ts';\nimport {\n\tProbeTimeoutError,\n\texitCodeProbeResult,\n\twaitForProbe,\n} from '../../substrate/runtime/probes.ts';\n\n/** One captured exec invocation. Mirrors the shape returned by\n * `docker exec` (stdout + stderr + exit code), without naming docker\n * — any container runtime that supports an exec primitive can\n * satisfy this. */\nexport interface ExecResult {\n\treadonly exitCode: number;\n\treadonly stdout: string;\n\treadonly stderr: string;\n}\n\n/** Exec callable injected by the plugin's service body. Wraps\n * `ContainerRuntime.exec` (see contract) into the local seam shape so\n * the retry / existence-check loops here stay runtime-agnostic.\n *\n * Daemon-level failures surface as `PostgresPluginError`; non-zero\n * exit codes (eg `pg_isready` not ready yet) are returned in the\n * `ExecResult` for the caller to interpret. */\nexport interface ContainerExec {\n\treadonly run: (\n\t\targv: ReadonlyArray<string>,\n\t) => Effect.Effect<ExecResult, PostgresPluginError>;\n}\n\nconst READY_PROBE_INTERVAL_MS = 500;\n\n/** Wait until `pg_isready -U <user> -d <db>` exits zero or the\n * overall deadline elapses.\n *\n * Distilled doc § \"Postgres-specific concerns\" — server-aware probe;\n * TCP-listener readiness alone is insufficient (postgres opens the\n * port before it accepts queries). */\nexport const awaitReady = (\n\texec: ContainerExec,\n\tuser: string,\n\tdatabase: string,\n\ttimeoutMs: number,\n): Effect.Effect<void, PostgresConnectionTimeout> =>\n\tEffect.gen(function* () {\n\t\tlet attempts = 0;\n\t\tlet lastResult: ExecResult | undefined;\n\t\tconst startedAt = Date.now();\n\n\t\treturn yield* waitForProbe({\n\t\t\tlabel: `postgres:${database}`,\n\t\t\ttimeoutMs,\n\t\t\tintervalMs: READY_PROBE_INTERVAL_MS,\n\t\t\tprobe: () =>\n\t\t\t\tEffect.gen(function* () {\n\t\t\t\t\tattempts += 1;\n\t\t\t\t\tconst result = yield* exec.run(['pg_isready', '-U', user, '-d', database]);\n\t\t\t\t\tlastResult = result;\n\t\t\t\t\treturn exitCodeProbeResult(result);\n\t\t\t\t}),\n\t\t}).pipe(\n\t\t\tEffect.mapError((cause) => {\n\t\t\t\tconst lastError =\n\t\t\t\t\tcause instanceof ProbeTimeoutError ? cause.lastError : (cause as unknown);\n\t\t\t\treturn postgresConnectionTimeout({\n\t\t\t\t\tdatabase,\n\t\t\t\t\tattempts: cause instanceof ProbeTimeoutError ? cause.attempts : attempts,\n\t\t\t\t\telapsedMs: Date.now() - startedAt,\n\t\t\t\t\tlastExitCode: lastResult?.exitCode,\n\t\t\t\t\tlastStdout: lastResult?.stdout,\n\t\t\t\t\tlastStderr: lastResult?.stderr,\n\t\t\t\t\t...(lastError === undefined ? {} : { lastError }),\n\t\t\t\t});\n\t\t\t}),\n\t\t\tEffect.withSpan('devstack.plugin.postgres.awaitReady', {\n\t\t\t\tattributes: {\n\t\t\t\t\t[PostgresSpans.database]: database,\n\t\t\t\t\t[PostgresSpans.timeoutMs]: timeoutMs,\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t});\n\n/** Idempotently ensure a logical database exists.\n *\n * Algorithm:\n * 1. `psql -tAc \"SELECT 1 FROM pg_database WHERE datname = '<db>'\"`.\n * Exit 0 + non-empty stdout => exists, return.\n * Exit != 0 => DatabaseCreateFailed(exists-check).\n * 2. `createdb -U <user> <db>`.\n * Exit 0 => done.\n * Exit != 0 => DatabaseCreateFailed(createdb).\n *\n * Identifier quoting note: this implementation passes the database\n * name as a CLI argument (createdb) and as a SQL string literal\n * (the existence query). Postgres folds unquoted identifiers; if\n * the caller passes `MyDB`, postgres stores it as `mydb`. The\n * current plugin contract doesn't quote — distilled doc § Edge\n * cases flags this as a known foot-gun, and the recommended cure\n * is \"use lowercase names\". */\nexport const ensureDatabase = (\n\texec: ContainerExec,\n\tuser: string,\n\tdbName: string,\n): Effect.Effect<void, DatabaseCreateFailed | PostgresPluginError> =>\n\tEffect.gen(function* () {\n\t\t// Quote-escape per SQL literal rules (double single-quotes inside\n\t\t// the literal). The plugin's own contract restricts callers to\n\t\t// lowercase database identifiers (see distilled-doc § Edge cases\n\t\t// above), but the literal interpolation here is still a foot-\n\t\t// gun: a name containing `'` would break the WHERE clause and\n\t\t// either fail the existence check or, worse, alter its\n\t\t// semantics. Escaping locks the wire shape independent of the\n\t\t// upstream contract.\n\t\tconst escapedDbName = dbName.replace(/'/g, \"''\");\n\t\tconst exists = yield* exec.run([\n\t\t\t'psql',\n\t\t\t'-U',\n\t\t\tuser,\n\t\t\t'-tAc',\n\t\t\t`SELECT 1 FROM pg_database WHERE datname = '${escapedDbName}'`,\n\t\t]);\n\t\tif (exists.exitCode !== 0) {\n\t\t\treturn yield* Effect.fail(\n\t\t\t\tdatabaseCreateFailed({\n\t\t\t\t\tdatabase: dbName,\n\t\t\t\t\top: 'exists-check',\n\t\t\t\t\texitCode: exists.exitCode,\n\t\t\t\t\tstdout: exists.stdout,\n\t\t\t\t\tstderr: exists.stderr,\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\t\tif (exists.stdout.trim().length > 0) {\n\t\t\treturn; // already present\n\t\t}\n\n\t\t// The `--` argv separator stops `createdb`'s flag parsing — a\n\t\t// `dbName` starting with `-` (e.g. `--help`) would otherwise be\n\t\t// interpreted as a flag rather than a positional database name.\n\t\t// Argv form already neutralizes shell-metacharacter injection;\n\t\t// the separator closes the remaining flag-shape gap.\n\t\tconst created = yield* exec.run(['createdb', '-U', user, '--', dbName]);\n\t\tif (created.exitCode !== 0) {\n\t\t\treturn yield* Effect.fail(\n\t\t\t\tdatabaseCreateFailed({\n\t\t\t\t\tdatabase: dbName,\n\t\t\t\t\top: 'createdb',\n\t\t\t\t\texitCode: created.exitCode,\n\t\t\t\t\tstdout: created.stdout,\n\t\t\t\t\tstderr: created.stderr,\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\t}).pipe(\n\t\tEffect.withSpan('devstack.plugin.postgres.ensureDatabase', {\n\t\t\tattributes: { [PostgresSpans.database]: dbName },\n\t\t}),\n\t);\n\n/** Sequentially ensure every non-bootstrap database exists. The\n * bootstrap (first entry) is created by `POSTGRES_DB` at image\n * entrypoint and MUST be skipped here. */\nexport const ensureDatabases = (\n\texec: ContainerExec,\n\tuser: string,\n\tdatabases: ReadonlyArray<string>,\n): Effect.Effect<void, DatabaseCreateFailed | PostgresPluginError> =>\n\tEffect.gen(function* () {\n\t\tfor (let i = 1; i < databases.length; i++) {\n\t\t\tyield* ensureDatabase(exec, user, databases[i]!);\n\t\t}\n\t});\n"],"mappings":";;;;;AAuEA,MAAM,0BAA0B;;;;;;;AAQhC,MAAa,cACZ,MACA,MACA,UACA,cAEA,OAAO,IAAI,aAAa;CACvB,IAAI,WAAW;CACf,IAAI;CACJ,MAAM,YAAY,KAAK,KAAK;AAE5B,QAAO,OAAO,aAAa;EAC1B,OAAO,YAAY;EACnB;EACA,YAAY;EACZ,aACC,OAAO,IAAI,aAAa;AACvB,eAAY;GACZ,MAAM,SAAS,OAAO,KAAK,IAAI;IAAC;IAAc;IAAM;IAAM;IAAM;IAAS,CAAC;AAC1E,gBAAa;AACb,UAAO,oBAAoB,OAAO;IACjC;EACH,CAAC,CAAC,KACF,OAAO,UAAU,UAAU;EAC1B,MAAM,YACL,iBAAiB,oBAAoB,MAAM,YAAa;AACzD,SAAO,0BAA0B;GAChC;GACA,UAAU,iBAAiB,oBAAoB,MAAM,WAAW;GAChE,WAAW,KAAK,KAAK,GAAG;GACxB,cAAc,YAAY;GAC1B,YAAY,YAAY;GACxB,YAAY,YAAY;GACxB,GAAI,cAAc,KAAA,IAAY,EAAE,GAAG,EAAE,WAAW;GAChD,CAAC;GACD,EACF,OAAO,SAAS,uCAAuC,EACtD,YAAY;GACV,cAAc,WAAW;GACzB,cAAc,YAAY;EAC3B,EACD,CAAC,CACF;EACA;;;;;;;;;;;;;;;;;;AAmBH,MAAa,kBACZ,MACA,MACA,WAEA,OAAO,IAAI,aAAa;CASvB,MAAM,gBAAgB,OAAO,QAAQ,MAAM,KAAK;CAChD,MAAM,SAAS,OAAO,KAAK,IAAI;EAC9B;EACA;EACA;EACA;EACA,8CAA8C,cAAc;EAC5D,CAAC;AACF,KAAI,OAAO,aAAa,EACvB,QAAO,OAAO,OAAO,KACpB,qBAAqB;EACpB,UAAU;EACV,IAAI;EACJ,UAAU,OAAO;EACjB,QAAQ,OAAO;EACf,QAAQ,OAAO;EACf,CAAC,CACF;AAEF,KAAI,OAAO,OAAO,MAAM,CAAC,SAAS,EACjC;CAQD,MAAM,UAAU,OAAO,KAAK,IAAI;EAAC;EAAY;EAAM;EAAM;EAAM;EAAO,CAAC;AACvE,KAAI,QAAQ,aAAa,EACxB,QAAO,OAAO,OAAO,KACpB,qBAAqB;EACpB,UAAU;EACV,IAAI;EACJ,UAAU,QAAQ;EAClB,QAAQ,QAAQ;EAChB,QAAQ,QAAQ;EAChB,CAAC,CACF;EAED,CAAC,KACF,OAAO,SAAS,2CAA2C,EAC1D,YAAY,GAAG,cAAc,WAAW,QAAQ,EAChD,CAAC,CACF;;;;AAKF,MAAa,mBACZ,MACA,MACA,cAEA,OAAO,IAAI,aAAa;AACvB,MAAK,IAAI,IAAI,GAAG,IAAI,UAAU,QAAQ,IACrC,QAAO,eAAe,MAAM,MAAM,UAAU,GAAI;EAEhD"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { ConfigIssue } from "../../substrate/runtime/config-validation.mjs";
|
|
2
|
-
|
|
3
|
-
//#region src/plugins/postgres/errors.d.ts
|
|
4
|
-
/** Phases for `PostgresPluginError`. Closed sum — additions land in
|
|
5
|
-
* the distilled-doc catalog first. */
|
|
6
|
-
type PostgresPhase = 'network-create' | 'image-build' | 'container-start' | 'ready-probe' | 'db-ensure' | 'unknown';
|
|
7
|
-
/** Generic plugin error. Most failure surfaces collapse onto this
|
|
8
|
-
* shape; specific failure modes that warrant their own catchable
|
|
9
|
-
* tag (timeout, createdb-collision) get their own type below. */
|
|
10
|
-
interface PostgresPluginError {
|
|
11
|
-
readonly _tag: 'PostgresPluginError';
|
|
12
|
-
readonly phase: PostgresPhase;
|
|
13
|
-
readonly message: string;
|
|
14
|
-
readonly cause?: unknown;
|
|
15
|
-
}
|
|
16
|
-
interface PostgresConfigError extends ConfigIssue {
|
|
17
|
-
readonly _tag: 'PostgresConfigError';
|
|
18
|
-
}
|
|
19
|
-
/** `pg_isready` returned non-zero past the deadline. Carries the
|
|
20
|
-
* database name + last exit code + captured streams so the cause
|
|
21
|
-
* walker can render an actionable hint (slow disk, port mismatch,
|
|
22
|
-
* perms on data dir).
|
|
23
|
-
*
|
|
24
|
-
* Distilled-doc § Edge cases: this is the most common "what went
|
|
25
|
-
* wrong" failure during first boot of a freshly-built image; it
|
|
26
|
-
* deserves its own tag so the renderer can show a slow-disk hint
|
|
27
|
-
* before users guess. */
|
|
28
|
-
interface PostgresConnectionTimeout {
|
|
29
|
-
readonly _tag: 'PostgresConnectionTimeout';
|
|
30
|
-
readonly database: string;
|
|
31
|
-
readonly attempts: number;
|
|
32
|
-
readonly elapsedMs: number;
|
|
33
|
-
readonly lastExitCode?: number;
|
|
34
|
-
readonly lastStdout?: string;
|
|
35
|
-
readonly lastStderr?: string;
|
|
36
|
-
/** Underlying typed error from the last probe attempt — populated
|
|
37
|
-
* when the probe itself failed (eg daemon-level container-start
|
|
38
|
-
* error) rather than `pg_isready` returning a non-zero exit. The
|
|
39
|
-
* cause walker reads this to render the actionable hint. */
|
|
40
|
-
readonly lastError?: unknown;
|
|
41
|
-
}
|
|
42
|
-
/** Logical-database creation failed. Distinct from a network /
|
|
43
|
-
* container / probe failure because the typical root cause is
|
|
44
|
-
* case-sensitivity collision in postgres identifier folding —
|
|
45
|
-
* surfaced explicitly via its own tag so consumers can render a
|
|
46
|
-
* "quote the identifier" hint. */
|
|
47
|
-
interface DatabaseCreateFailed {
|
|
48
|
-
readonly _tag: 'DatabaseCreateFailed';
|
|
49
|
-
readonly database: string;
|
|
50
|
-
readonly op: 'exists-check' | 'createdb';
|
|
51
|
-
readonly exitCode?: number;
|
|
52
|
-
readonly stdout?: string;
|
|
53
|
-
readonly stderr?: string;
|
|
54
|
-
readonly cause?: unknown;
|
|
55
|
-
}
|
|
56
|
-
/** Union of every error a Postgres-plugin caller may encounter. */
|
|
57
|
-
type PostgresError = PostgresPluginError | PostgresConfigError | PostgresConnectionTimeout | DatabaseCreateFailed;
|
|
58
|
-
//#endregion
|
|
59
|
-
export { DatabaseCreateFailed, PostgresConfigError, PostgresConnectionTimeout, PostgresError, PostgresPhase, PostgresPluginError };
|
|
60
|
-
//# sourceMappingURL=errors.d.mts.map
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { defineConfigError } from "../../substrate/runtime/config-validation.mjs";
|
|
2
|
-
//#region src/plugins/postgres/errors.ts
|
|
3
|
-
const postgresPluginError = (phase, message, cause) => ({
|
|
4
|
-
_tag: "PostgresPluginError",
|
|
5
|
-
phase,
|
|
6
|
-
message,
|
|
7
|
-
cause
|
|
8
|
-
});
|
|
9
|
-
const postgresConfigError = defineConfigError("PostgresConfigError");
|
|
10
|
-
const postgresConnectionTimeout = (parts) => ({
|
|
11
|
-
_tag: "PostgresConnectionTimeout",
|
|
12
|
-
...parts
|
|
13
|
-
});
|
|
14
|
-
const databaseCreateFailed = (parts) => ({
|
|
15
|
-
_tag: "DatabaseCreateFailed",
|
|
16
|
-
...parts
|
|
17
|
-
});
|
|
18
|
-
/** Error tags this plugin contributes — surfaced to the cause walker
|
|
19
|
-
* via `PluginErrorContribution`. */
|
|
20
|
-
const POSTGRES_ERROR_TAGS = [
|
|
21
|
-
"PostgresPluginError",
|
|
22
|
-
"PostgresConfigError",
|
|
23
|
-
"PostgresConnectionTimeout",
|
|
24
|
-
"DatabaseCreateFailed"
|
|
25
|
-
];
|
|
26
|
-
//#endregion
|
|
27
|
-
export { POSTGRES_ERROR_TAGS, databaseCreateFailed, postgresConfigError, postgresConnectionTimeout, postgresPluginError };
|
|
28
|
-
|
|
29
|
-
//# sourceMappingURL=errors.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.mjs","names":[],"sources":["../../../src/plugins/postgres/errors.ts"],"sourcesContent":["// Postgres plugin — typed errors.\n//\n// Per-plugin tagged errors (architecture § Effect; substrate-redesign\n// directive: errors live with the plugin that raises and consumes\n// them). Postgres is a topological leaf — every raise site AND every\n// consumer is inside `src/plugins/postgres/`, so this file owns the\n// complete error surface.\n//\n// Phase tags mirror the lifecycle states from the distilled doc\n// (10-postgres § Lifecycle states): one phase per failure boundary\n// so the cause walker / TUI / regression tests can pin behaviour by\n// label rather than by message-substring matching.\n//\n// Effect v4: errors are plain interfaces with a `_tag` discriminator.\n// `Effect.catchTag` / `catchTags` match on the `_tag` literal — we do\n// NOT subclass an Effect base class. See architecture § Effect.\n\nimport { defineConfigError, type ConfigIssue } from '../../substrate/runtime/config-validation.ts';\n\n/** Phases for `PostgresPluginError`. Closed sum — additions land in\n * the distilled-doc catalog first. */\nexport type PostgresPhase =\n\t| 'network-create'\n\t| 'image-build'\n\t| 'container-start'\n\t| 'ready-probe'\n\t| 'db-ensure'\n\t| 'unknown';\n\n/** Generic plugin error. Most failure surfaces collapse onto this\n * shape; specific failure modes that warrant their own catchable\n * tag (timeout, createdb-collision) get their own type below. */\nexport interface PostgresPluginError {\n\treadonly _tag: 'PostgresPluginError';\n\treadonly phase: PostgresPhase;\n\treadonly message: string;\n\treadonly cause?: unknown;\n}\n\nexport const postgresPluginError = (\n\tphase: PostgresPhase,\n\tmessage: string,\n\tcause?: unknown,\n): PostgresPluginError => ({ _tag: 'PostgresPluginError', phase, message, cause });\n\nexport interface PostgresConfigError extends ConfigIssue {\n\treadonly _tag: 'PostgresConfigError';\n}\n\nexport const postgresConfigError = defineConfigError('PostgresConfigError');\n\n/** `pg_isready` returned non-zero past the deadline. Carries the\n * database name + last exit code + captured streams so the cause\n * walker can render an actionable hint (slow disk, port mismatch,\n * perms on data dir).\n *\n * Distilled-doc § Edge cases: this is the most common \"what went\n * wrong\" failure during first boot of a freshly-built image; it\n * deserves its own tag so the renderer can show a slow-disk hint\n * before users guess. */\nexport interface PostgresConnectionTimeout {\n\treadonly _tag: 'PostgresConnectionTimeout';\n\treadonly database: string;\n\treadonly attempts: number;\n\treadonly elapsedMs: number;\n\treadonly lastExitCode?: number;\n\treadonly lastStdout?: string;\n\treadonly lastStderr?: string;\n\t/** Underlying typed error from the last probe attempt — populated\n\t * when the probe itself failed (eg daemon-level container-start\n\t * error) rather than `pg_isready` returning a non-zero exit. The\n\t * cause walker reads this to render the actionable hint. */\n\treadonly lastError?: unknown;\n}\n\nexport const postgresConnectionTimeout = (\n\tparts: Omit<PostgresConnectionTimeout, '_tag'>,\n): PostgresConnectionTimeout => ({ _tag: 'PostgresConnectionTimeout', ...parts });\n\n/** Logical-database creation failed. Distinct from a network /\n * container / probe failure because the typical root cause is\n * case-sensitivity collision in postgres identifier folding —\n * surfaced explicitly via its own tag so consumers can render a\n * \"quote the identifier\" hint. */\nexport interface DatabaseCreateFailed {\n\treadonly _tag: 'DatabaseCreateFailed';\n\treadonly database: string;\n\treadonly op: 'exists-check' | 'createdb';\n\treadonly exitCode?: number;\n\treadonly stdout?: string;\n\treadonly stderr?: string;\n\treadonly cause?: unknown;\n}\n\nexport const databaseCreateFailed = (\n\tparts: Omit<DatabaseCreateFailed, '_tag'>,\n): DatabaseCreateFailed => ({ _tag: 'DatabaseCreateFailed', ...parts });\n\n/** Union of every error a Postgres-plugin caller may encounter. */\nexport type PostgresError =\n\t| PostgresPluginError\n\t| PostgresConfigError\n\t| PostgresConnectionTimeout\n\t| DatabaseCreateFailed;\n\n/** Error tags this plugin contributes — surfaced to the cause walker\n * via `PluginErrorContribution`. */\nexport const POSTGRES_ERROR_TAGS: ReadonlyArray<PostgresError['_tag']> = [\n\t'PostgresPluginError',\n\t'PostgresConfigError',\n\t'PostgresConnectionTimeout',\n\t'DatabaseCreateFailed',\n] as const;\n"],"mappings":";;AAuCA,MAAa,uBACZ,OACA,SACA,WAC0B;CAAE,MAAM;CAAuB;CAAO;CAAS;CAAO;AAMjF,MAAa,sBAAsB,kBAAkB,sBAAsB;AA0B3E,MAAa,6BACZ,WACgC;CAAE,MAAM;CAA6B,GAAG;CAAO;AAiBhF,MAAa,wBACZ,WAC2B;CAAE,MAAM;CAAwB,GAAG;CAAO;;;AAWtE,MAAa,sBAA4D;CACxE;CACA;CACA;CACA;CACA"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { CodegenableDecl } from "../../contracts/codegenable.mjs";
|
|
2
|
-
import { RoutableDecl } from "../../contracts/routable.mjs";
|
|
3
|
-
import { SnapshotableDecl } from "../../contracts/snapshotable.mjs";
|
|
4
|
-
import { Plugin } from "../../substrate/plugin.mjs";
|
|
5
|
-
import { DatabaseCreateFailed, PostgresConfigError, PostgresConnectionTimeout, PostgresError, PostgresPhase, PostgresPluginError } from "./errors.mjs";
|
|
6
|
-
import { Postgres, PostgresServiceOptions } from "./service.mjs";
|
|
7
|
-
import { PostgresConnectionBindings, PostgresConnectionParts } from "./connection.mjs";
|
|
8
|
-
//#region src/plugins/postgres/index.d.ts
|
|
9
|
-
type PostgresCapabilities = readonly [SnapshotableDecl, CodegenableDecl<'postgres-connection'>] | readonly [SnapshotableDecl, CodegenableDecl<'postgres-connection'>, RoutableDecl];
|
|
10
|
-
/** User-facing options on top of the service options — currently just
|
|
11
|
-
* the routable opt-in. We split this out so the service body's
|
|
12
|
-
* `PostgresServiceOptions` stays focused on container/boot knobs and
|
|
13
|
-
* the plugin-level surface owns capability gating. */
|
|
14
|
-
interface PostgresPluginOptions extends PostgresServiceOptions {
|
|
15
|
-
/** When `true`, the plugin contributes a `wireProtocol: 'tcp'`
|
|
16
|
-
* Routable decl that fronts the postgres container on the
|
|
17
|
-
* `postgres-tcp` entrypoint (host port 5432 by default). Default
|
|
18
|
-
* `false` — parallel stacks coexist via the in-network DNS alias
|
|
19
|
-
* and the optional `hostPort` mapping, neither of which involves
|
|
20
|
-
* the router.
|
|
21
|
-
*
|
|
22
|
-
* Architecture parallel-stack note: TCP entrypoints serve ONE
|
|
23
|
-
* backend at a time (no Host-header fan-out), so only one stack
|
|
24
|
-
* on the host may set `route: true` at a given moment. The router
|
|
25
|
-
* orchestrator's collision detector fails fast on the second
|
|
26
|
-
* contribution. */
|
|
27
|
-
readonly route?: boolean;
|
|
28
|
-
}
|
|
29
|
-
/** Postgres-as-a-container plugin. One per `(stack, name)` pair.
|
|
30
|
-
*
|
|
31
|
-
* Single-mode: only local container exists today. The plain-endpoint
|
|
32
|
-
* shape anticipates a future "live" mode (Cloud SQL / Neon / RDS)
|
|
33
|
-
* that emits the same endpoint shape without spawning. */
|
|
34
|
-
declare const postgres: (opts?: PostgresPluginOptions) => Plugin<"postgres", Postgres, readonly [], PostgresCapabilities>;
|
|
35
|
-
//#endregion
|
|
36
|
-
export { PostgresPluginOptions, postgres };
|
|
37
|
-
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { definePlugin, resource } from "../../substrate/plugin.mjs";
|
|
2
|
-
import "../../api/define-plugin.mjs";
|
|
3
|
-
import { IdentityContext, StackPathsService } from "../../substrate/runtime/paths.mjs";
|
|
4
|
-
import { ContainerRuntimeService } from "../../runtime/docker/service.mjs";
|
|
5
|
-
import { makePostgresRoutable } from "./routable.mjs";
|
|
6
|
-
import { pluginErrorContributions } from "../../api/plugin-errors.mjs";
|
|
7
|
-
import { passthroughOrWrap } from "../../substrate/runtime/passthrough-or-wrap.mjs";
|
|
8
|
-
import "./connection.mjs";
|
|
9
|
-
import { makeCodegenable } from "./codegen.mjs";
|
|
10
|
-
import { POSTGRES_ERROR_TAGS, postgresPluginError } from "./errors.mjs";
|
|
11
|
-
import "./spans.mjs";
|
|
12
|
-
import { bootPostgresService } from "./service.mjs";
|
|
13
|
-
import { makeSnapshotable } from "./snapshot.mjs";
|
|
14
|
-
import { Effect } from "effect";
|
|
15
|
-
//#region src/plugins/postgres/index.ts
|
|
16
|
-
/** The Postgres plugin's resource identity. */
|
|
17
|
-
const postgresResource = resource("postgres");
|
|
18
|
-
const postgresErrorContributions = pluginErrorContributions(POSTGRES_ERROR_TAGS);
|
|
19
|
-
const buildPlugin = (opts) => {
|
|
20
|
-
const name = opts.name ?? "postgres";
|
|
21
|
-
return definePlugin({
|
|
22
|
-
id: postgresResource.id,
|
|
23
|
-
role: "service",
|
|
24
|
-
section: "service",
|
|
25
|
-
start: () => Effect.gen(function* () {
|
|
26
|
-
const { handle } = yield* bootPostgresService(yield* ContainerRuntimeService, yield* IdentityContext, (yield* StackPathsService).stackRoot, opts);
|
|
27
|
-
return handle;
|
|
28
|
-
}).pipe(passthroughOrWrap.for()(POSTGRES_ERROR_TAGS, (cause) => postgresPluginError("unknown", `postgres(${name}): unknown failure`, cause))),
|
|
29
|
-
errorContributions: postgresErrorContributions,
|
|
30
|
-
capabilities: ({ value, runtime }) => {
|
|
31
|
-
const snap = makeSnapshotable({
|
|
32
|
-
app: runtime.identity.app,
|
|
33
|
-
stack: runtime.identity.stack,
|
|
34
|
-
name,
|
|
35
|
-
databases: value.databases
|
|
36
|
-
});
|
|
37
|
-
const codegen = makeCodegenable({
|
|
38
|
-
name,
|
|
39
|
-
user: value.user,
|
|
40
|
-
password: value.password,
|
|
41
|
-
host: value.networkAlias,
|
|
42
|
-
port: value.port,
|
|
43
|
-
databases: value.databases
|
|
44
|
-
});
|
|
45
|
-
const routable = opts.route ? makePostgresRoutable({
|
|
46
|
-
app: runtime.identity.app,
|
|
47
|
-
stack: runtime.identity.stack,
|
|
48
|
-
name,
|
|
49
|
-
containerName: `${runtime.identity.app}-${runtime.identity.stack}-${name}`
|
|
50
|
-
}) : null;
|
|
51
|
-
return routable === null ? [snap, codegen] : [
|
|
52
|
-
snap,
|
|
53
|
-
codegen,
|
|
54
|
-
routable
|
|
55
|
-
];
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
/** Postgres-as-a-container plugin. One per `(stack, name)` pair.
|
|
60
|
-
*
|
|
61
|
-
* Single-mode: only local container exists today. The plain-endpoint
|
|
62
|
-
* shape anticipates a future "live" mode (Cloud SQL / Neon / RDS)
|
|
63
|
-
* that emits the same endpoint shape without spawning. */
|
|
64
|
-
const postgres = (opts = {}) => buildPlugin(opts);
|
|
65
|
-
//#endregion
|
|
66
|
-
export { postgres };
|
|
67
|
-
|
|
68
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../src/plugins/postgres/index.ts"],"sourcesContent":["// Postgres plugin — barrel + `postgres(opts?)` factory.\n//\n// Architecture: Postgres is a topological leaf (no upstream service\n// dependencies) and a single-mode service (local container only;\n// \"live\" modes — Cloud SQL / Neon / RDS — are a deferred decision in\n// the distilled doc, anticipated by the plain-endpoint shape but not\n// implemented). One factory; no mode-narrowed namespace.\n//\n// Capabilities emitted:\n// 1. Snapshotable — container's writable layer (PGDATA-relocated),\n// identity guard contributes server name + ordered db list.\n// 2. Codegenable — typed connection bindings for user-app code.\n// 3. Routable (TCP, optional) — gated by `opts.route`. When true,\n// the postgres container fronts the `postgres-tcp` Traefik\n// entrypoint (host port 5432 by default). Disabled by default to\n// preserve the existing parallel-stack story (TCP has no Host\n// header, so an entrypoint serves one backend at a time).\n// Stacks that want host-side reachability can set `route: true`\n// OR set `hostPort` directly (the two are mutually exclusive\n// escape hatches — `route: true` is recommended for in-network\n// composition with traefik, `hostPort` for direct host-port\n// publication).\n//\n// Substrate wiring:\n// - `ContainerRuntimeService` yielded in the acquire body for the\n// container + image + exec contract.\n// - `IdentityContext` yielded for the app/stack identity strings.\n// - `errorContributions` declares POSTGRES_ERROR_TAGS so the\n// supervisor's harvest loop registers them with the\n// FormatterRegistry.\n\nimport { Effect } from 'effect';\n\nimport { definePlugin, resource } from '../../api/define-plugin.ts';\nimport { pluginErrorContributions } from '../../api/plugin-errors.ts';\nimport type { CodegenableDecl } from '../../contracts/codegenable.ts';\nimport type { RoutableDecl } from '../../contracts/routable.ts';\nimport type { SnapshotableDecl } from '../../contracts/snapshotable.ts';\nimport { ContainerRuntimeService } from '../../runtime/docker/service.ts';\nimport { passthroughOrWrap } from '../../substrate/runtime/passthrough-or-wrap.ts';\nimport { IdentityContext, StackPathsService } from '../../substrate/runtime/paths.ts';\n\nimport { makeCodegenable } from './codegen.ts';\nimport { POSTGRES_ERROR_TAGS, postgresPluginError, type PostgresError } from './errors.ts';\nimport { makePostgresRoutable } from './routable.ts';\nimport { bootPostgresService, type Postgres, type PostgresServiceOptions } from './service.ts';\nimport { makeSnapshotable } from './snapshot.ts';\n\ntype PostgresCapabilities =\n\t| readonly [SnapshotableDecl, CodegenableDecl<'postgres-connection'>]\n\t| readonly [SnapshotableDecl, CodegenableDecl<'postgres-connection'>, RoutableDecl];\n\n// ---------------------------------------------------------------------------\n// Resource identity\n// ---------------------------------------------------------------------------\n\n/** The Postgres plugin's resource identity. */\nconst postgresResource = resource<'postgres', Postgres>('postgres');\nconst postgresErrorContributions = pluginErrorContributions(POSTGRES_ERROR_TAGS);\n\n// ---------------------------------------------------------------------------\n// Plugin construction\n// ---------------------------------------------------------------------------\n\n/** User-facing options on top of the service options — currently just\n * the routable opt-in. We split this out so the service body's\n * `PostgresServiceOptions` stays focused on container/boot knobs and\n * the plugin-level surface owns capability gating. */\nexport interface PostgresPluginOptions extends PostgresServiceOptions {\n\t/** When `true`, the plugin contributes a `wireProtocol: 'tcp'`\n\t * Routable decl that fronts the postgres container on the\n\t * `postgres-tcp` entrypoint (host port 5432 by default). Default\n\t * `false` — parallel stacks coexist via the in-network DNS alias\n\t * and the optional `hostPort` mapping, neither of which involves\n\t * the router.\n\t *\n\t * Architecture parallel-stack note: TCP entrypoints serve ONE\n\t * backend at a time (no Host-header fan-out), so only one stack\n\t * on the host may set `route: true` at a given moment. The router\n\t * orchestrator's collision detector fails fast on the second\n\t * contribution. */\n\treadonly route?: boolean;\n}\n\nconst buildPlugin = (opts: PostgresPluginOptions) => {\n\tconst name = opts.name ?? 'postgres';\n\t// Validation (databases non-empty) runs inside `bootPostgresService` via\n\t// `resolveOptions`; the resolved bundle's `databases` flows through to\n\t// the snapshot + codegen decls.\n\n\treturn definePlugin({\n\t\tid: postgresResource.id,\n\t\trole: 'service',\n\t\tsection: 'service',\n\t\tstart: () =>\n\t\t\tEffect.gen(function* () {\n\t\t\t\t// Substrate-context plumbing supplies real\n\t\t\t\t// `ContainerRuntime` + `Identity` instances; the\n\t\t\t\t// supervisor's plugin acquisition path provides these\n\t\t\t\t// before this body runs.\n\t\t\t\tconst runtime = yield* ContainerRuntimeService;\n\t\t\t\tconst identity = yield* IdentityContext;\n\t\t\t\tconst paths = yield* StackPathsService;\n\t\t\t\tconst { handle } = yield* bootPostgresService(runtime, identity, paths.stackRoot, opts);\n\t\t\t\treturn handle;\n\t\t\t}).pipe(\n\t\t\t\t// Distilled-doc § Invariants: already-typed errors must\n\t\t\t\t// NOT be re-wrapped by the catch-all unknown handler.\n\t\t\t\t// `passthroughOrWrap` lets the POSTGRES_ERROR_TAGS union\n\t\t\t\t// through unchanged; anything else surfaces as\n\t\t\t\t// `phase: 'unknown'`.\n\t\t\t\tpassthroughOrWrap.for<PostgresError>()(POSTGRES_ERROR_TAGS, (cause) =>\n\t\t\t\t\tpostgresPluginError('unknown', `postgres(${name}): unknown failure`, cause),\n\t\t\t\t),\n\t\t\t),\n\t\terrorContributions: postgresErrorContributions,\n\t\t// Dynamic capability factory: receives the resolved\n\t\t// `Postgres` handle + acquire context. Stamps the REAL\n\t\t// app/stack into the snapshot decl and the per-stack\n\t\t// network alias + derived password into the codegen\n\t\t// bindings.\n\t\t//\n\t\t// Codegen `host` is `value.networkAlias` — the per-stack\n\t\t// alias Docker registers via `--network-alias` on the\n\t\t// container's primary network. Dialing the alias resolves\n\t\t// in-container regardless of which parallel stack the\n\t\t// caller belongs to; the per-stack container name still\n\t\t// resolves too, but is not parallel-stack-portable when\n\t\t// emitted into committed codegen output.\n\t\tcapabilities: ({ value, runtime }): PostgresCapabilities => {\n\t\t\tconst snap = makeSnapshotable({\n\t\t\t\tapp: runtime.identity.app,\n\t\t\t\tstack: runtime.identity.stack,\n\t\t\t\tname,\n\t\t\t\tdatabases: value.databases,\n\t\t\t});\n\t\t\tconst codegen = makeCodegenable({\n\t\t\t\tname,\n\t\t\t\tuser: value.user,\n\t\t\t\tpassword: value.password,\n\t\t\t\thost: value.networkAlias,\n\t\t\t\tport: value.port,\n\t\t\t\tdatabases: value.databases,\n\t\t\t});\n\t\t\tconst routable = opts.route\n\t\t\t\t? makePostgresRoutable({\n\t\t\t\t\t\tapp: runtime.identity.app,\n\t\t\t\t\t\tstack: runtime.identity.stack,\n\t\t\t\t\t\tname,\n\t\t\t\t\t\tcontainerName: `${runtime.identity.app}-${runtime.identity.stack}-${name}`,\n\t\t\t\t\t})\n\t\t\t\t: null;\n\t\t\treturn routable === null ? ([snap, codegen] as const) : ([snap, codegen, routable] as const);\n\t\t},\n\t});\n};\n\n// ---------------------------------------------------------------------------\n// User-facing factory\n// ---------------------------------------------------------------------------\n\n/** Postgres-as-a-container plugin. One per `(stack, name)` pair.\n *\n * Single-mode: only local container exists today. The plain-endpoint\n * shape anticipates a future \"live\" mode (Cloud SQL / Neon / RDS)\n * that emits the same endpoint shape without spawning. */\nexport const postgres = (opts: PostgresPluginOptions = {}) => buildPlugin(opts);\n\n// Re-export the canonical TCP endpoint name for downstream consumers\n// (codegen lookups, doctor / inventory rendering, etc.).\nexport { POSTGRES_TCP_ENDPOINT_NAME } from './routable.ts';\n\n// ---------------------------------------------------------------------------\n// Re-exports for consumers + sibling plugins\n// ---------------------------------------------------------------------------\n\nexport type { Postgres, PostgresServiceOptions } from './service.ts';\nexport type { PostgresConnectionBindings, PostgresConnectionParts } from './connection.ts';\nexport type {\n\tPostgresError,\n\tPostgresPluginError,\n\tPostgresConfigError,\n\tPostgresConnectionTimeout,\n\tDatabaseCreateFailed,\n\tPostgresPhase,\n} from './errors.ts';\nexport { POSTGRES_ERROR_TAGS } from './errors.ts';\nexport type { PostgresIdentityPayload } from './snapshot.ts';\n\n// Connection-string builders — exposed for downstream consumers that\n// need to compose URLs without the resolved handle (e.g. user-app\n// code that reads the codegen output and builds a per-database URL\n// at runtime).\nexport { credentialedUrl, plainUrl, withDatabase } from './connection.ts';\n\nexport { PostgresSpans } from './spans.ts';\n"],"mappings":";;;;;;;;;;;;;;;;AAyDA,MAAM,mBAAmB,SAA+B,WAAW;AACnE,MAAM,6BAA6B,yBAAyB,oBAAoB;AA0BhF,MAAM,eAAe,SAAgC;CACpD,MAAM,OAAO,KAAK,QAAQ;AAK1B,QAAO,aAAa;EACnB,IAAI,iBAAiB;EACrB,MAAM;EACN,SAAS;EACT,aACC,OAAO,IAAI,aAAa;GAQvB,MAAM,EAAE,WAAW,OAAO,oBAAoB,OAHvB,yBAGgC,OAF/B,kBAEyC,OAD5C,mBACkD,WAAW,KAAK;AACvF,UAAO;IACN,CAAC,KAMF,kBAAkB,KAAoB,CAAC,sBAAsB,UAC5D,oBAAoB,WAAW,YAAY,KAAK,qBAAqB,MAAM,CAC3E,CACD;EACF,oBAAoB;EAcpB,eAAe,EAAE,OAAO,cAAoC;GAC3D,MAAM,OAAO,iBAAiB;IAC7B,KAAK,QAAQ,SAAS;IACtB,OAAO,QAAQ,SAAS;IACxB;IACA,WAAW,MAAM;IACjB,CAAC;GACF,MAAM,UAAU,gBAAgB;IAC/B;IACA,MAAM,MAAM;IACZ,UAAU,MAAM;IAChB,MAAM,MAAM;IACZ,MAAM,MAAM;IACZ,WAAW,MAAM;IACjB,CAAC;GACF,MAAM,WAAW,KAAK,QACnB,qBAAqB;IACrB,KAAK,QAAQ,SAAS;IACtB,OAAO,QAAQ,SAAS;IACxB;IACA,eAAe,GAAG,QAAQ,SAAS,IAAI,GAAG,QAAQ,SAAS,MAAM,GAAG;IACpE,CAAC,GACD;AACH,UAAO,aAAa,OAAQ,CAAC,MAAM,QAAQ,GAAc;IAAC;IAAM;IAAS;IAAS;;EAEnF,CAAC;;;;;;;AAYH,MAAa,YAAY,OAA8B,EAAE,KAAK,YAAY,KAAK"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
//#region src/plugins/postgres/routable.ts
|
|
2
|
-
/** Canonical endpoint name — matches this plugin's router entrypoint. */
|
|
3
|
-
const POSTGRES_TCP_ENDPOINT_NAME = "postgres-tcp";
|
|
4
|
-
const POSTGRES_TCP_ENTRYPOINT_PORT = 5432;
|
|
5
|
-
const POSTGRES_ENTRYPOINTS = [{
|
|
6
|
-
name: POSTGRES_TCP_ENDPOINT_NAME,
|
|
7
|
-
port: POSTGRES_TCP_ENTRYPOINT_PORT,
|
|
8
|
-
protocol: "tcp"
|
|
9
|
-
}];
|
|
10
|
-
/** Construct the Postgres TCP Routable decl.
|
|
11
|
-
*
|
|
12
|
-
* The `containerName` is whatever name the postgres `ensureContainer`
|
|
13
|
-
* call uses for its container — the router's upstream resolver maps
|
|
14
|
-
* the key back to the container's shared-network IP at dispatch-file
|
|
15
|
-
* write time. */
|
|
16
|
-
const makePostgresRoutable = (parts) => ({
|
|
17
|
-
kind: "routable",
|
|
18
|
-
endpointName: POSTGRES_TCP_ENDPOINT_NAME,
|
|
19
|
-
dispatchId: {
|
|
20
|
-
serviceKey: `postgres.${parts.app}.${parts.stack}.${parts.name}`,
|
|
21
|
-
role: parts.name
|
|
22
|
-
},
|
|
23
|
-
upstream: {
|
|
24
|
-
type: "container",
|
|
25
|
-
containerName: parts.containerName,
|
|
26
|
-
containerPort: POSTGRES_TCP_ENTRYPOINT_PORT
|
|
27
|
-
},
|
|
28
|
-
wireProtocol: "tcp"
|
|
29
|
-
});
|
|
30
|
-
//#endregion
|
|
31
|
-
export { POSTGRES_ENTRYPOINTS, POSTGRES_TCP_ENDPOINT_NAME, makePostgresRoutable };
|
|
32
|
-
|
|
33
|
-
//# sourceMappingURL=routable.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"routable.mjs","names":[],"sources":["../../../src/plugins/postgres/routable.ts"],"sourcesContent":["// Postgres plugin — optional Routable TCP contribution.\n//\n// Postgres is a raw-TCP service (no HTTP, no virtual-host concept), so\n// it participates in the router via the `wireProtocol: 'tcp'` variant\n// of `RoutableDecl`. Effects:\n//\n// - The router orchestrator writes a TCP file-provider entry that\n// binds the `postgres-tcp` entrypoint port (5432 by default) and\n// forwards raw TCP to the container's shared-network IP+port.\n// - The endpoint shows up in the manifest under `postgres-tcp` so\n// codegen / build-integrations can resolve `127.0.0.1:5432` as\n// the host-side dial address.\n//\n// PARALLEL-STACK NOTE. TCP has no virtual-host equivalent — a TCP\n// entrypoint port can serve exactly ONE backend per Traefik container.\n// Two parallel stacks each contributing a TCP postgres Routable on\n// `postgres-tcp` will fail collision detection at `contributeRoute`\n// time. Stacks that need parallel postgres backends should set\n// `opts.route: false` and dial the container in-network directly\n// (`networkAlias:5432`).\n//\n// CORS is omitted by construction — the TCP variant of `RoutableDecl`\n// doesn't carry a `cors` field.\n\nimport type { EntrypointDecl, RoutableDecl } from '../../contracts/routable.ts';\n\n/** Canonical endpoint name — matches this plugin's router entrypoint. */\nexport const POSTGRES_TCP_ENDPOINT_NAME = 'postgres-tcp' as const;\nexport const POSTGRES_TCP_ENTRYPOINT_PORT = 5432;\n\nexport const POSTGRES_ENTRYPOINTS: ReadonlyArray<EntrypointDecl> = [\n\t{ name: POSTGRES_TCP_ENDPOINT_NAME, port: POSTGRES_TCP_ENTRYPOINT_PORT, protocol: 'tcp' },\n];\n\n/** Construct the Postgres TCP Routable decl.\n *\n * The `containerName` is whatever name the postgres `ensureContainer`\n * call uses for its container — the router's upstream resolver maps\n * the key back to the container's shared-network IP at dispatch-file\n * write time. */\nexport const makePostgresRoutable = (parts: {\n\treadonly app: string;\n\treadonly stack: string;\n\treadonly name: string;\n\treadonly containerName: string;\n}): RoutableDecl => ({\n\tkind: 'routable',\n\tendpointName: POSTGRES_TCP_ENDPOINT_NAME,\n\tdispatchId: {\n\t\t// Include the instance name for readable diagnostics; the router\n\t\t// hashes the full `(app, stack, serviceKey, role)` tuple before\n\t\t// writing the global dispatch file.\n\t\tserviceKey: `postgres.${parts.app}.${parts.stack}.${parts.name}`,\n\t\trole: parts.name,\n\t},\n\tupstream: {\n\t\ttype: 'container',\n\t\tcontainerName: parts.containerName,\n\t\tcontainerPort: POSTGRES_TCP_ENTRYPOINT_PORT,\n\t},\n\twireProtocol: 'tcp',\n});\n"],"mappings":";;AA2BA,MAAa,6BAA6B;AAC1C,MAAa,+BAA+B;AAE5C,MAAa,uBAAsD,CAClE;CAAE,MAAM;CAA4B,MAAM;CAA8B,UAAU;CAAO,CACzF;;;;;;;AAQD,MAAa,wBAAwB,WAKhB;CACpB,MAAM;CACN,cAAc;CACd,YAAY;EAIX,YAAY,YAAY,MAAM,IAAI,GAAG,MAAM,MAAM,GAAG,MAAM;EAC1D,MAAM,MAAM;EACZ;CACD,UAAU;EACT,MAAM;EACN,eAAe,MAAM;EACrB,eAAe;EACf;CACD,cAAc;CACd"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { Duration, Effect, Scope } from "effect";
|
|
2
|
-
|
|
3
|
-
//#region src/plugins/postgres/service.d.ts
|
|
4
|
-
/** Resolved Postgres handle — the tag's resolved value.
|
|
5
|
-
*
|
|
6
|
-
* Distilled doc § Outputs: consumers read this to compose
|
|
7
|
-
* `DATABASE_URL` strings. `url(db)` is the per-database composer;
|
|
8
|
-
* `endpoint` is the cluster-level credentialed URL; `plainEndpoint`
|
|
9
|
-
* is the manifest-safe URL (no password). */
|
|
10
|
-
interface Postgres {
|
|
11
|
-
readonly name: string;
|
|
12
|
-
readonly user: string;
|
|
13
|
-
/** Credential. Held in-memory on the resolved value; manifest
|
|
14
|
-
* projection strips it. Logging convention: never `console.log`
|
|
15
|
-
* the entire handle — log `plainEndpoint` instead. */
|
|
16
|
-
readonly password: string;
|
|
17
|
-
readonly host: string;
|
|
18
|
-
readonly port: number;
|
|
19
|
-
readonly databases: ReadonlyArray<string>;
|
|
20
|
-
/** Cluster-level credentialed URL. */
|
|
21
|
-
readonly endpoint: string;
|
|
22
|
-
/** Cluster-level no-credentials URL. Manifest-safe. */
|
|
23
|
-
readonly plainEndpoint: string;
|
|
24
|
-
/** Per-database credentialed URL composer. */
|
|
25
|
-
readonly url: (db: string) => string;
|
|
26
|
-
/** Per-stack docker network the container is joined to. */
|
|
27
|
-
readonly containerNetwork: string;
|
|
28
|
-
/** In-network DNS alias siblings dial. */
|
|
29
|
-
readonly networkAlias: string;
|
|
30
|
-
}
|
|
31
|
-
/** Service options. Defaults track distilled-doc recommendations:
|
|
32
|
-
* postgres 17-alpine is the latest LTS-stable at the time of writing
|
|
33
|
-
* (one major up from the v3 service's 16-alpine pin). */
|
|
34
|
-
interface PostgresServiceOptions {
|
|
35
|
-
readonly name?: string;
|
|
36
|
-
readonly version?: string;
|
|
37
|
-
readonly user?: string;
|
|
38
|
-
readonly password?: string;
|
|
39
|
-
readonly databases?: ReadonlyArray<string>;
|
|
40
|
-
readonly hostPort?: number;
|
|
41
|
-
readonly extraNetworks?: ReadonlyArray<string>;
|
|
42
|
-
readonly readyTimeoutMs?: number;
|
|
43
|
-
/** WAL-flush budget on `docker stop`. Default 20s (matches the
|
|
44
|
-
* sui-indexer-db sidecar in v3). 10s (docker default) risks
|
|
45
|
-
* SIGKILL on busy DBs → recovery mode on next boot. */
|
|
46
|
-
readonly stopGraceSeconds?: number;
|
|
47
|
-
}
|
|
48
|
-
//#endregion
|
|
49
|
-
export { Postgres, PostgresServiceOptions };
|
|
50
|
-
//# sourceMappingURL=service.d.mts.map
|