@mysten-incubation/devstack 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +189 -0
- package/README.md +94 -0
- package/dist/_virtual/_rolldown/runtime.mjs +13 -0
- package/dist/api/define-capabilities.d.mts +25 -0
- package/dist/api/define-capabilities.mjs +19 -0
- package/dist/api/define-capabilities.mjs.map +1 -0
- package/dist/api/define-devstack-with.d.mts +41 -0
- package/dist/api/define-devstack-with.mjs +24 -0
- package/dist/api/define-devstack-with.mjs.map +1 -0
- package/dist/api/define-devstack.d.mts +62 -0
- package/dist/api/define-devstack.mjs +108 -0
- package/dist/api/define-devstack.mjs.map +1 -0
- package/dist/api/define-plugin.d.mts +1 -0
- package/dist/api/inference-network.mjs +122 -0
- package/dist/api/inference-network.mjs.map +1 -0
- package/dist/api/mode-narrowed-factory.d.mts +26 -0
- package/dist/api/mode-narrowed-factory.mjs +8 -0
- package/dist/api/mode-narrowed-factory.mjs.map +1 -0
- package/dist/api/plugin-errors.mjs +10 -0
- package/dist/api/plugin-errors.mjs.map +1 -0
- package/dist/api/run-stack.d.mts +82 -0
- package/dist/api/run-stack.mjs +127 -0
- package/dist/api/run-stack.mjs.map +1 -0
- package/dist/build-integrations/playwright/config.d.mts +92 -0
- package/dist/build-integrations/playwright/config.mjs +71 -0
- package/dist/build-integrations/playwright/config.mjs.map +1 -0
- package/dist/build-integrations/playwright/errors.d.mts +82 -0
- package/dist/build-integrations/playwright/errors.mjs +43 -0
- package/dist/build-integrations/playwright/errors.mjs.map +1 -0
- package/dist/build-integrations/playwright/global-setup.d.mts +64 -0
- package/dist/build-integrations/playwright/global-setup.mjs +44 -0
- package/dist/build-integrations/playwright/global-setup.mjs.map +1 -0
- package/dist/build-integrations/playwright/index.d.mts +6 -0
- package/dist/build-integrations/playwright/index.mjs +6 -0
- package/dist/build-integrations/playwright/stack-context.d.mts +95 -0
- package/dist/build-integrations/playwright/stack-context.mjs +277 -0
- package/dist/build-integrations/playwright/stack-context.mjs.map +1 -0
- package/dist/build-integrations/playwright/wallet-context.d.mts +87 -0
- package/dist/build-integrations/playwright/wallet-context.mjs +148 -0
- package/dist/build-integrations/playwright/wallet-context.mjs.map +1 -0
- package/dist/build-integrations/runtime/cold-start-url.d.mts +67 -0
- package/dist/build-integrations/runtime/cold-start-url.mjs +56 -0
- package/dist/build-integrations/runtime/cold-start-url.mjs.map +1 -0
- package/dist/build-integrations/runtime/dapp-kit-slot.mjs +10 -0
- package/dist/build-integrations/runtime/dapp-kit-slot.mjs.map +1 -0
- package/dist/build-integrations/runtime/discover.d.mts +78 -0
- package/dist/build-integrations/runtime/discover.mjs +124 -0
- package/dist/build-integrations/runtime/discover.mjs.map +1 -0
- package/dist/build-integrations/runtime/endpoint-registry.d.mts +26 -0
- package/dist/build-integrations/runtime/endpoint-registry.mjs +41 -0
- package/dist/build-integrations/runtime/endpoint-registry.mjs.map +1 -0
- package/dist/build-integrations/runtime/errors.d.mts +64 -0
- package/dist/build-integrations/runtime/errors.mjs +51 -0
- package/dist/build-integrations/runtime/errors.mjs.map +1 -0
- package/dist/build-integrations/runtime/index.d.mts +7 -0
- package/dist/build-integrations/runtime/index.mjs +6 -0
- package/dist/build-integrations/runtime/read-stack-context.d.mts +38 -0
- package/dist/build-integrations/runtime/read-stack-context.mjs +130 -0
- package/dist/build-integrations/runtime/read-stack-context.mjs.map +1 -0
- package/dist/build-integrations/runtime/stack-context.d.mts +53 -0
- package/dist/build-integrations/vitest/config.d.mts +62 -0
- package/dist/build-integrations/vitest/config.mjs +80 -0
- package/dist/build-integrations/vitest/config.mjs.map +1 -0
- package/dist/build-integrations/vitest/env.d.mts +48 -0
- package/dist/build-integrations/vitest/env.mjs +50 -0
- package/dist/build-integrations/vitest/env.mjs.map +1 -0
- package/dist/build-integrations/vitest/errors.d.mts +44 -0
- package/dist/build-integrations/vitest/errors.mjs +18 -0
- package/dist/build-integrations/vitest/errors.mjs.map +1 -0
- package/dist/build-integrations/vitest/index.d.mts +6 -0
- package/dist/build-integrations/vitest/index.mjs +6 -0
- package/dist/build-integrations/vitest/setup.d.mts +53 -0
- package/dist/build-integrations/vitest/setup.mjs +56 -0
- package/dist/build-integrations/vitest/setup.mjs.map +1 -0
- package/dist/build-integrations/vitest/stack-context.d.mts +58 -0
- package/dist/build-integrations/vitest/stack-context.mjs +67 -0
- package/dist/build-integrations/vitest/stack-context.mjs.map +1 -0
- package/dist/cli/main.d.mts +5 -0
- package/dist/cli/main.mjs +586 -0
- package/dist/cli/main.mjs.map +1 -0
- package/dist/cli/prune-direct.mjs +216 -0
- package/dist/cli/prune-direct.mjs.map +1 -0
- package/dist/cli/snapshot-reader.mjs +73 -0
- package/dist/cli/snapshot-reader.mjs.map +1 -0
- package/dist/cli/up-lifecycle.mjs +28 -0
- package/dist/cli/up-lifecycle.mjs.map +1 -0
- package/dist/contracts/capability-decl.d.mts +42 -0
- package/dist/contracts/chain-probe.d.mts +26 -0
- package/dist/contracts/chain-probe.mjs +8 -0
- package/dist/contracts/chain-probe.mjs.map +1 -0
- package/dist/contracts/codegenable.d.mts +43 -0
- package/dist/contracts/container-runtime.d.mts +245 -0
- package/dist/contracts/liveness-classifier.d.mts +19 -0
- package/dist/contracts/network-resolver.d.mts +15 -0
- package/dist/contracts/network-resolver.mjs +7 -0
- package/dist/contracts/network-resolver.mjs.map +1 -0
- package/dist/contracts/projection.d.mts +15 -0
- package/dist/contracts/routable.d.mts +53 -0
- package/dist/contracts/snapshotable.d.mts +39 -0
- package/dist/contracts/strategy-contributor.d.mts +26 -0
- package/dist/index.d.mts +89 -0
- package/dist/index.mjs +37 -0
- package/dist/orchestrators/codegen/bindings.d.mts +2 -0
- package/dist/orchestrators/codegen/bindings.mjs +340 -0
- package/dist/orchestrators/codegen/bindings.mjs.map +1 -0
- package/dist/orchestrators/codegen/emit.mjs +56 -0
- package/dist/orchestrators/codegen/emit.mjs.map +1 -0
- package/dist/orchestrators/codegen/errors.d.mts +1 -0
- package/dist/orchestrators/codegen/errors.mjs +66 -0
- package/dist/orchestrators/codegen/errors.mjs.map +1 -0
- package/dist/orchestrators/codegen/extras.mjs +16 -0
- package/dist/orchestrators/codegen/extras.mjs.map +1 -0
- package/dist/orchestrators/codegen/format.mjs +109 -0
- package/dist/orchestrators/codegen/format.mjs.map +1 -0
- package/dist/orchestrators/codegen/gitignore.mjs +67 -0
- package/dist/orchestrators/codegen/gitignore.mjs.map +1 -0
- package/dist/orchestrators/codegen/paths.d.mts +1 -0
- package/dist/orchestrators/codegen/paths.mjs +33 -0
- package/dist/orchestrators/codegen/paths.mjs.map +1 -0
- package/dist/orchestrators/codegen/permissions.mjs +6 -0
- package/dist/orchestrators/codegen/permissions.mjs.map +1 -0
- package/dist/orchestrators/codegen/service.d.mts +1 -0
- package/dist/orchestrators/codegen/service.mjs +276 -0
- package/dist/orchestrators/codegen/service.mjs.map +1 -0
- package/dist/orchestrators/router/cleanup.mjs +58 -0
- package/dist/orchestrators/router/cleanup.mjs.map +1 -0
- package/dist/orchestrators/router/cors.mjs +31 -0
- package/dist/orchestrators/router/cors.mjs.map +1 -0
- package/dist/orchestrators/router/entrypoints.d.mts +1 -0
- package/dist/orchestrators/router/entrypoints.mjs +80 -0
- package/dist/orchestrators/router/entrypoints.mjs.map +1 -0
- package/dist/orchestrators/router/errors.d.mts +1 -0
- package/dist/orchestrators/router/errors.mjs +103 -0
- package/dist/orchestrators/router/errors.mjs.map +1 -0
- package/dist/orchestrators/router/file-provider.d.mts +1 -0
- package/dist/orchestrators/router/file-provider.mjs +320 -0
- package/dist/orchestrators/router/file-provider.mjs.map +1 -0
- package/dist/orchestrators/router/hostname.d.mts +1 -0
- package/dist/orchestrators/router/hostname.mjs +107 -0
- package/dist/orchestrators/router/hostname.mjs.map +1 -0
- package/dist/orchestrators/router/index.d.mts +1 -0
- package/dist/orchestrators/router/profile.d.mts +1 -0
- package/dist/orchestrators/router/profile.mjs +109 -0
- package/dist/orchestrators/router/profile.mjs.map +1 -0
- package/dist/orchestrators/router/service.d.mts +3 -0
- package/dist/orchestrators/router/service.mjs +421 -0
- package/dist/orchestrators/router/service.mjs.map +1 -0
- package/dist/orchestrators/router/traefik-container.d.mts +1 -0
- package/dist/orchestrators/router/traefik-container.mjs +229 -0
- package/dist/orchestrators/router/traefik-container.mjs.map +1 -0
- package/dist/orchestrators/runtime-composition.d.mts +10 -0
- package/dist/orchestrators/runtime-composition.mjs +168 -0
- package/dist/orchestrators/runtime-composition.mjs.map +1 -0
- package/dist/orchestrators/snapshot/capture.d.mts +1 -0
- package/dist/orchestrators/snapshot/capture.mjs +350 -0
- package/dist/orchestrators/snapshot/capture.mjs.map +1 -0
- package/dist/orchestrators/snapshot/descriptor.d.mts +1 -0
- package/dist/orchestrators/snapshot/descriptor.mjs +109 -0
- package/dist/orchestrators/snapshot/descriptor.mjs.map +1 -0
- package/dist/orchestrators/snapshot/identity-guard.d.mts +1 -0
- package/dist/orchestrators/snapshot/identity-guard.mjs +132 -0
- package/dist/orchestrators/snapshot/identity-guard.mjs.map +1 -0
- package/dist/orchestrators/snapshot/image-bundle-tags.mjs +207 -0
- package/dist/orchestrators/snapshot/image-bundle-tags.mjs.map +1 -0
- package/dist/orchestrators/snapshot/index.d.mts +1 -0
- package/dist/orchestrators/snapshot/integrity.d.mts +1 -0
- package/dist/orchestrators/snapshot/integrity.mjs +74 -0
- package/dist/orchestrators/snapshot/integrity.mjs.map +1 -0
- package/dist/orchestrators/snapshot/prune.d.mts +1 -0
- package/dist/orchestrators/snapshot/prune.mjs +110 -0
- package/dist/orchestrators/snapshot/prune.mjs.map +1 -0
- package/dist/orchestrators/snapshot/restore.d.mts +1 -0
- package/dist/orchestrators/snapshot/restore.mjs +404 -0
- package/dist/orchestrators/snapshot/restore.mjs.map +1 -0
- package/dist/orchestrators/snapshot/service.d.mts +1 -0
- package/dist/orchestrators/snapshot/service.mjs +296 -0
- package/dist/orchestrators/snapshot/service.mjs.map +1 -0
- package/dist/orchestrators/snapshot/state-document.mjs +18 -0
- package/dist/orchestrators/snapshot/state-document.mjs.map +1 -0
- package/dist/orchestrators/snapshot/wipe.d.mts +1 -0
- package/dist/orchestrators/snapshot/wipe.mjs +59 -0
- package/dist/orchestrators/snapshot/wipe.mjs.map +1 -0
- package/dist/plugins/account/codegen.d.mts +12 -0
- package/dist/plugins/account/codegen.mjs +22 -0
- package/dist/plugins/account/codegen.mjs.map +1 -0
- package/dist/plugins/account/errors.d.mts +44 -0
- package/dist/plugins/account/errors.mjs +16 -0
- package/dist/plugins/account/errors.mjs.map +1 -0
- package/dist/plugins/account/funding.d.mts +94 -0
- package/dist/plugins/account/funding.mjs +199 -0
- package/dist/plugins/account/funding.mjs.map +1 -0
- package/dist/plugins/account/index.d.mts +54 -0
- package/dist/plugins/account/index.mjs +151 -0
- package/dist/plugins/account/index.mjs.map +1 -0
- package/dist/plugins/account/keypair.d.mts +32 -0
- package/dist/plugins/account/keypair.mjs +99 -0
- package/dist/plugins/account/keypair.mjs.map +1 -0
- package/dist/plugins/account/lease.mjs +21 -0
- package/dist/plugins/account/lease.mjs.map +1 -0
- package/dist/plugins/account/registry.d.mts +33 -0
- package/dist/plugins/account/registry.mjs +36 -0
- package/dist/plugins/account/registry.mjs.map +1 -0
- package/dist/plugins/account/service.d.mts +104 -0
- package/dist/plugins/account/service.mjs +405 -0
- package/dist/plugins/account/service.mjs.map +1 -0
- package/dist/plugins/account/snapshot.mjs +33 -0
- package/dist/plugins/account/snapshot.mjs.map +1 -0
- package/dist/plugins/account/variants/env.mjs +24 -0
- package/dist/plugins/account/variants/env.mjs.map +1 -0
- package/dist/plugins/account/variants/ephemeral.mjs +72 -0
- package/dist/plugins/account/variants/ephemeral.mjs.map +1 -0
- package/dist/plugins/account/variants/impersonate.d.mts +16 -0
- package/dist/plugins/account/variants/impersonate.mjs +48 -0
- package/dist/plugins/account/variants/impersonate.mjs.map +1 -0
- package/dist/plugins/account/variants/inline.mjs +13 -0
- package/dist/plugins/account/variants/inline.mjs.map +1 -0
- package/dist/plugins/account/variants/keystore.mjs +93 -0
- package/dist/plugins/account/variants/keystore.mjs.map +1 -0
- package/dist/plugins/account/variants/signer.mjs +31 -0
- package/dist/plugins/account/variants/signer.mjs.map +1 -0
- package/dist/plugins/action/build-context.d.mts +41 -0
- package/dist/plugins/action/discriminator.d.mts +20 -0
- package/dist/plugins/action/discriminator.mjs +13 -0
- package/dist/plugins/action/discriminator.mjs.map +1 -0
- package/dist/plugins/action/errors.d.mts +31 -0
- package/dist/plugins/action/errors.mjs +13 -0
- package/dist/plugins/action/errors.mjs.map +1 -0
- package/dist/plugins/action/execute.d.mts +2 -0
- package/dist/plugins/action/execute.mjs +145 -0
- package/dist/plugins/action/execute.mjs.map +1 -0
- package/dist/plugins/action/index.d.mts +56 -0
- package/dist/plugins/action/index.mjs +82 -0
- package/dist/plugins/action/index.mjs.map +1 -0
- package/dist/plugins/action/service.d.mts +26 -0
- package/dist/plugins/action/service.mjs +84 -0
- package/dist/plugins/action/service.mjs.map +1 -0
- package/dist/plugins/coin/address-resolution.d.mts +34 -0
- package/dist/plugins/coin/address-resolution.mjs +80 -0
- package/dist/plugins/coin/address-resolution.mjs.map +1 -0
- package/dist/plugins/coin/codegen.d.mts +16 -0
- package/dist/plugins/coin/codegen.mjs +21 -0
- package/dist/plugins/coin/codegen.mjs.map +1 -0
- package/dist/plugins/coin/discovery.d.mts +26 -0
- package/dist/plugins/coin/discovery.mjs +112 -0
- package/dist/plugins/coin/discovery.mjs.map +1 -0
- package/dist/plugins/coin/errors.d.mts +48 -0
- package/dist/plugins/coin/errors.mjs +13 -0
- package/dist/plugins/coin/errors.mjs.map +1 -0
- package/dist/plugins/coin/index.d.mts +95 -0
- package/dist/plugins/coin/index.mjs +172 -0
- package/dist/plugins/coin/index.mjs.map +1 -0
- package/dist/plugins/coin/metadata.d.mts +15 -0
- package/dist/plugins/coin/metadata.mjs +99 -0
- package/dist/plugins/coin/metadata.mjs.map +1 -0
- package/dist/plugins/coin/mint.d.mts +34 -0
- package/dist/plugins/coin/mint.mjs +164 -0
- package/dist/plugins/coin/mint.mjs.map +1 -0
- package/dist/plugins/coin/registry.d.mts +1 -0
- package/dist/plugins/coin/registry.mjs +37 -0
- package/dist/plugins/coin/registry.mjs.map +1 -0
- package/dist/plugins/coin/service.d.mts +47 -0
- package/dist/plugins/coin/service.mjs +51 -0
- package/dist/plugins/coin/service.mjs.map +1 -0
- package/dist/plugins/coin/snapshot.mjs +19 -0
- package/dist/plugins/coin/snapshot.mjs.map +1 -0
- package/dist/plugins/coin/type-strings.mjs +49 -0
- package/dist/plugins/coin/type-strings.mjs.map +1 -0
- package/dist/plugins/deepbook/codegen.d.mts +39 -0
- package/dist/plugins/deepbook/codegen.mjs +15 -0
- package/dist/plugins/deepbook/codegen.mjs.map +1 -0
- package/dist/plugins/deepbook/deploy.mjs +437 -0
- package/dist/plugins/deepbook/deploy.mjs.map +1 -0
- package/dist/plugins/deepbook/errors.d.mts +29 -0
- package/dist/plugins/deepbook/errors.mjs +26 -0
- package/dist/plugins/deepbook/errors.mjs.map +1 -0
- package/dist/plugins/deepbook/faucet-strategy.d.mts +8 -0
- package/dist/plugins/deepbook/faucet-strategy.mjs +81 -0
- package/dist/plugins/deepbook/faucet-strategy.mjs.map +1 -0
- package/dist/plugins/deepbook/index.d.mts +171 -0
- package/dist/plugins/deepbook/index.mjs +359 -0
- package/dist/plugins/deepbook/index.mjs.map +1 -0
- package/dist/plugins/deepbook/plugin-key.mjs +7 -0
- package/dist/plugins/deepbook/plugin-key.mjs.map +1 -0
- package/dist/plugins/deepbook/pyth/index.mjs +226 -0
- package/dist/plugins/deepbook/pyth/index.mjs.map +1 -0
- package/dist/plugins/deepbook/routable.mjs +21 -0
- package/dist/plugins/deepbook/routable.mjs.map +1 -0
- package/dist/plugins/deepbook/snapshot.mjs +49 -0
- package/dist/plugins/deepbook/snapshot.mjs.map +1 -0
- package/dist/plugins/deepbook/types.d.mts +125 -0
- package/dist/plugins/deepbook/types.mjs +12 -0
- package/dist/plugins/deepbook/types.mjs.map +1 -0
- package/dist/plugins/faucet/dispatcher.d.mts +9 -0
- package/dist/plugins/faucet/dispatcher.mjs +13 -0
- package/dist/plugins/faucet/dispatcher.mjs.map +1 -0
- package/dist/plugins/faucet/errors.d.mts +86 -0
- package/dist/plugins/faucet/errors.mjs +19 -0
- package/dist/plugins/faucet/errors.mjs.map +1 -0
- package/dist/plugins/faucet/http.mjs +127 -0
- package/dist/plugins/faucet/http.mjs.map +1 -0
- package/dist/plugins/faucet/index.d.mts +43 -0
- package/dist/plugins/faucet/index.mjs +42 -0
- package/dist/plugins/faucet/index.mjs.map +1 -0
- package/dist/plugins/faucet/service.d.mts +20 -0
- package/dist/plugins/faucet/strategies/sui-local.d.mts +23 -0
- package/dist/plugins/faucet/strategies/sui-local.mjs +29 -0
- package/dist/plugins/faucet/strategies/sui-local.mjs.map +1 -0
- package/dist/plugins/host-service/errors.d.mts +27 -0
- package/dist/plugins/host-service/errors.mjs +14 -0
- package/dist/plugins/host-service/errors.mjs.map +1 -0
- package/dist/plugins/host-service/index.d.mts +10 -0
- package/dist/plugins/host-service/index.mjs +48 -0
- package/dist/plugins/host-service/index.mjs.map +1 -0
- package/dist/plugins/host-service/routable.mjs +24 -0
- package/dist/plugins/host-service/routable.mjs.map +1 -0
- package/dist/plugins/host-service/service.d.mts +49 -0
- package/dist/plugins/host-service/service.mjs +375 -0
- package/dist/plugins/host-service/service.mjs.map +1 -0
- package/dist/plugins/package/build.d.mts +1 -0
- package/dist/plugins/package/build.mjs +24 -0
- package/dist/plugins/package/build.mjs.map +1 -0
- package/dist/plugins/package/codegen.d.mts +19 -0
- package/dist/plugins/package/codegen.mjs +41 -0
- package/dist/plugins/package/codegen.mjs.map +1 -0
- package/dist/plugins/package/dep-resolution.mjs +10 -0
- package/dist/plugins/package/dep-resolution.mjs.map +1 -0
- package/dist/plugins/package/errors.d.mts +34 -0
- package/dist/plugins/package/errors.mjs +13 -0
- package/dist/plugins/package/errors.mjs.map +1 -0
- package/dist/plugins/package/index.d.mts +109 -0
- package/dist/plugins/package/index.mjs +207 -0
- package/dist/plugins/package/index.mjs.map +1 -0
- package/dist/plugins/package/mode-known.mjs +41 -0
- package/dist/plugins/package/mode-known.mjs.map +1 -0
- package/dist/plugins/package/mode-local.d.mts +1 -0
- package/dist/plugins/package/mode-local.mjs +183 -0
- package/dist/plugins/package/mode-local.mjs.map +1 -0
- package/dist/plugins/package/publish-executor.mjs +202 -0
- package/dist/plugins/package/publish-executor.mjs.map +1 -0
- package/dist/plugins/package/publish-output.d.mts +28 -0
- package/dist/plugins/package/publish-output.mjs +45 -0
- package/dist/plugins/package/publish-output.mjs.map +1 -0
- package/dist/plugins/package/registry.d.mts +25 -0
- package/dist/plugins/package/registry.mjs +30 -0
- package/dist/plugins/package/registry.mjs.map +1 -0
- package/dist/plugins/package/service.mjs +20 -0
- package/dist/plugins/package/service.mjs.map +1 -0
- package/dist/plugins/package/snapshot.mjs +25 -0
- package/dist/plugins/package/snapshot.mjs.map +1 -0
- package/dist/plugins/postgres/codegen.mjs +42 -0
- package/dist/plugins/postgres/codegen.mjs.map +1 -0
- package/dist/plugins/postgres/connection.d.mts +33 -0
- package/dist/plugins/postgres/connection.mjs +19 -0
- package/dist/plugins/postgres/connection.mjs.map +1 -0
- package/dist/plugins/postgres/db-ensure.mjs +100 -0
- package/dist/plugins/postgres/db-ensure.mjs.map +1 -0
- package/dist/plugins/postgres/errors.d.mts +55 -0
- package/dist/plugins/postgres/errors.mjs +29 -0
- package/dist/plugins/postgres/errors.mjs.map +1 -0
- package/dist/plugins/postgres/index.d.mts +37 -0
- package/dist/plugins/postgres/index.mjs +75 -0
- package/dist/plugins/postgres/index.mjs.map +1 -0
- package/dist/plugins/postgres/routable.mjs +33 -0
- package/dist/plugins/postgres/routable.mjs.map +1 -0
- package/dist/plugins/postgres/service.d.mts +50 -0
- package/dist/plugins/postgres/service.mjs +145 -0
- package/dist/plugins/postgres/service.mjs.map +1 -0
- package/dist/plugins/postgres/snapshot.d.mts +1 -0
- package/dist/plugins/postgres/snapshot.mjs +32 -0
- package/dist/plugins/postgres/snapshot.mjs.map +1 -0
- package/dist/plugins/router-entrypoints.mjs +21 -0
- package/dist/plugins/router-entrypoints.mjs.map +1 -0
- package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs +59 -0
- package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs.map +1 -0
- package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs +132 -0
- package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs.map +1 -0
- package/dist/plugins/seal/codegen.d.mts +19 -0
- package/dist/plugins/seal/codegen.mjs +16 -0
- package/dist/plugins/seal/codegen.mjs.map +1 -0
- package/dist/plugins/seal/config-render.mjs +82 -0
- package/dist/plugins/seal/config-render.mjs.map +1 -0
- package/dist/plugins/seal/deploy.mjs +198 -0
- package/dist/plugins/seal/deploy.mjs.map +1 -0
- package/dist/plugins/seal/errors.d.mts +52 -0
- package/dist/plugins/seal/errors.mjs +19 -0
- package/dist/plugins/seal/errors.mjs.map +1 -0
- package/dist/plugins/seal/index.d.mts +161 -0
- package/dist/plugins/seal/index.mjs +235 -0
- package/dist/plugins/seal/index.mjs.map +1 -0
- package/dist/plugins/seal/key-manager.d.mts +22 -0
- package/dist/plugins/seal/key-manager.mjs +22 -0
- package/dist/plugins/seal/key-manager.mjs.map +1 -0
- package/dist/plugins/seal/key-server.mjs +175 -0
- package/dist/plugins/seal/key-server.mjs.map +1 -0
- package/dist/plugins/seal/keygen.mjs +96 -0
- package/dist/plugins/seal/keygen.mjs.map +1 -0
- package/dist/plugins/seal/mode/fork-known.d.mts +8 -0
- package/dist/plugins/seal/mode/fork-known.mjs +23 -0
- package/dist/plugins/seal/mode/fork-known.mjs.map +1 -0
- package/dist/plugins/seal/mode/live.d.mts +18 -0
- package/dist/plugins/seal/mode/live.mjs +64 -0
- package/dist/plugins/seal/mode/live.mjs.map +1 -0
- package/dist/plugins/seal/mode/local-keygen.mjs +180 -0
- package/dist/plugins/seal/mode/local-keygen.mjs.map +1 -0
- package/dist/plugins/seal/plugin-key.mjs +7 -0
- package/dist/plugins/seal/plugin-key.mjs.map +1 -0
- package/dist/plugins/seal/registry-publish.d.mts +43 -0
- package/dist/plugins/seal/registry-publish.mjs +9 -0
- package/dist/plugins/seal/registry-publish.mjs.map +1 -0
- package/dist/plugins/seal/routable.mjs +57 -0
- package/dist/plugins/seal/routable.mjs.map +1 -0
- package/dist/plugins/seal/service.mjs +17 -0
- package/dist/plugins/seal/service.mjs.map +1 -0
- package/dist/plugins/seal/snapshot.mjs +51 -0
- package/dist/plugins/seal/snapshot.mjs.map +1 -0
- package/dist/plugins/sui/auto-tick.mjs +45 -0
- package/dist/plugins/sui/auto-tick.mjs.map +1 -0
- package/dist/plugins/sui/chain-build-container.d.mts +1 -0
- package/dist/plugins/sui/chain-probe.d.mts +85 -0
- package/dist/plugins/sui/chain-probe.mjs +104 -0
- package/dist/plugins/sui/chain-probe.mjs.map +1 -0
- package/dist/plugins/sui/codegen.d.mts +14 -0
- package/dist/plugins/sui/codegen.mjs +26 -0
- package/dist/plugins/sui/codegen.mjs.map +1 -0
- package/dist/plugins/sui/errors.d.mts +74 -0
- package/dist/plugins/sui/errors.mjs +28 -0
- package/dist/plugins/sui/errors.mjs.map +1 -0
- package/dist/plugins/sui/fork-orchestration.mjs +24 -0
- package/dist/plugins/sui/fork-orchestration.mjs.map +1 -0
- package/dist/plugins/sui/fork-transaction.mjs +96 -0
- package/dist/plugins/sui/fork-transaction.mjs.map +1 -0
- package/dist/plugins/sui/index.d.mts +318 -0
- package/dist/plugins/sui/index.mjs +182 -0
- package/dist/plugins/sui/index.mjs.map +1 -0
- package/dist/plugins/sui/mode/external.mjs +60 -0
- package/dist/plugins/sui/mode/external.mjs.map +1 -0
- package/dist/plugins/sui/mode/fork.mjs +283 -0
- package/dist/plugins/sui/mode/fork.mjs.map +1 -0
- package/dist/plugins/sui/mode/live.mjs +103 -0
- package/dist/plugins/sui/mode/live.mjs.map +1 -0
- package/dist/plugins/sui/mode/local.mjs +293 -0
- package/dist/plugins/sui/mode/local.mjs.map +1 -0
- package/dist/plugins/sui/mode/shared-boot.mjs +254 -0
- package/dist/plugins/sui/mode/shared-boot.mjs.map +1 -0
- package/dist/plugins/sui/mode/shared.d.mts +103 -0
- package/dist/plugins/sui/mode/shared.mjs +12 -0
- package/dist/plugins/sui/mode/shared.mjs.map +1 -0
- package/dist/plugins/sui/mode/spec.d.mts +94 -0
- package/dist/plugins/sui/network-resolver.d.mts +23 -0
- package/dist/plugins/sui/routable.mjs +88 -0
- package/dist/plugins/sui/routable.mjs.map +1 -0
- package/dist/plugins/sui/seed-objects.d.mts +18 -0
- package/dist/plugins/sui/seed-objects.mjs +25 -0
- package/dist/plugins/sui/seed-objects.mjs.map +1 -0
- package/dist/plugins/sui/service.mjs +38 -0
- package/dist/plugins/sui/service.mjs.map +1 -0
- package/dist/plugins/sui/snapshot.mjs +53 -0
- package/dist/plugins/sui/snapshot.mjs.map +1 -0
- package/dist/plugins/wallet/codegen.d.mts +33 -0
- package/dist/plugins/wallet/codegen.mjs +34 -0
- package/dist/plugins/wallet/codegen.mjs.map +1 -0
- package/dist/plugins/wallet/errors.d.mts +66 -0
- package/dist/plugins/wallet/errors.mjs +16 -0
- package/dist/plugins/wallet/errors.mjs.map +1 -0
- package/dist/plugins/wallet/index.d.mts +63 -0
- package/dist/plugins/wallet/index.mjs +126 -0
- package/dist/plugins/wallet/index.mjs.map +1 -0
- package/dist/plugins/wallet/origin-policy.d.mts +1 -0
- package/dist/plugins/wallet/origin-policy.mjs +65 -0
- package/dist/plugins/wallet/origin-policy.mjs.map +1 -0
- package/dist/plugins/wallet/pairing.d.mts +11 -0
- package/dist/plugins/wallet/pairing.mjs +125 -0
- package/dist/plugins/wallet/pairing.mjs.map +1 -0
- package/dist/plugins/wallet/protocol.d.mts +1 -0
- package/dist/plugins/wallet/protocol.mjs +96 -0
- package/dist/plugins/wallet/protocol.mjs.map +1 -0
- package/dist/plugins/wallet/routable.mjs +32 -0
- package/dist/plugins/wallet/routable.mjs.map +1 -0
- package/dist/plugins/wallet/server.d.mts +12 -0
- package/dist/plugins/wallet/server.mjs +317 -0
- package/dist/plugins/wallet/server.mjs.map +1 -0
- package/dist/plugins/wallet/service.d.mts +68 -0
- package/dist/plugins/wallet/service.mjs +97 -0
- package/dist/plugins/wallet/service.mjs.map +1 -0
- package/dist/plugins/wallet/snapshot.d.mts +1 -0
- package/dist/plugins/wallet/snapshot.mjs +14 -0
- package/dist/plugins/wallet/snapshot.mjs.map +1 -0
- package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs +42 -0
- package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs.map +1 -0
- package/dist/plugins/walrus/codegen.d.mts +38 -0
- package/dist/plugins/walrus/codegen.mjs +34 -0
- package/dist/plugins/walrus/codegen.mjs.map +1 -0
- package/dist/plugins/walrus/deploy-paths.mjs +14 -0
- package/dist/plugins/walrus/deploy-paths.mjs.map +1 -0
- package/dist/plugins/walrus/deploy.d.mts +1 -0
- package/dist/plugins/walrus/deploy.mjs +224 -0
- package/dist/plugins/walrus/deploy.mjs.map +1 -0
- package/dist/plugins/walrus/errors.d.mts +38 -0
- package/dist/plugins/walrus/errors.mjs +26 -0
- package/dist/plugins/walrus/errors.mjs.map +1 -0
- package/dist/plugins/walrus/faucet-strategy.d.mts +12 -0
- package/dist/plugins/walrus/faucet-strategy.mjs +62 -0
- package/dist/plugins/walrus/faucet-strategy.mjs.map +1 -0
- package/dist/plugins/walrus/index.d.mts +177 -0
- package/dist/plugins/walrus/index.mjs +284 -0
- package/dist/plugins/walrus/index.mjs.map +1 -0
- package/dist/plugins/walrus/mode/known-deploy.d.mts +25 -0
- package/dist/plugins/walrus/mode/known-deploy.mjs +71 -0
- package/dist/plugins/walrus/mode/known-deploy.mjs.map +1 -0
- package/dist/plugins/walrus/mode/local-cluster.d.mts +34 -0
- package/dist/plugins/walrus/mode/local-cluster.mjs +153 -0
- package/dist/plugins/walrus/mode/local-cluster.mjs.map +1 -0
- package/dist/plugins/walrus/plugin-key.mjs +7 -0
- package/dist/plugins/walrus/plugin-key.mjs.map +1 -0
- package/dist/plugins/walrus/registry-publish.d.mts +24 -0
- package/dist/plugins/walrus/registry-publish.mjs +7 -0
- package/dist/plugins/walrus/registry-publish.mjs.map +1 -0
- package/dist/plugins/walrus/routable.mjs +99 -0
- package/dist/plugins/walrus/routable.mjs.map +1 -0
- package/dist/plugins/walrus/service.mjs +20 -0
- package/dist/plugins/walrus/service.mjs.map +1 -0
- package/dist/plugins/walrus/snapshot.mjs +53 -0
- package/dist/plugins/walrus/snapshot.mjs.map +1 -0
- package/dist/plugins/walrus/storage-nodes.d.mts +15 -0
- package/dist/plugins/walrus/storage-nodes.mjs +154 -0
- package/dist/plugins/walrus/storage-nodes.mjs.map +1 -0
- package/dist/plugins/walrus/wal-swap.d.mts +2 -0
- package/dist/plugins/walrus/wal-swap.mjs +58 -0
- package/dist/plugins/walrus/wal-swap.mjs.map +1 -0
- package/dist/primitives/artifact-publisher.d.mts +12 -0
- package/dist/primitives/cache.d.mts +1 -0
- package/dist/runtime/built-in-plugin-layers.mjs +49 -0
- package/dist/runtime/built-in-plugin-layers.mjs.map +1 -0
- package/dist/runtime/docker/client.d.mts +2 -0
- package/dist/runtime/docker/client.mjs +54 -0
- package/dist/runtime/docker/client.mjs.map +1 -0
- package/dist/runtime/docker/container.d.mts +1 -0
- package/dist/runtime/docker/container.mjs +562 -0
- package/dist/runtime/docker/container.mjs.map +1 -0
- package/dist/runtime/docker/errors.d.mts +1 -0
- package/dist/runtime/docker/errors.mjs +187 -0
- package/dist/runtime/docker/errors.mjs.map +1 -0
- package/dist/runtime/docker/exec.d.mts +1 -0
- package/dist/runtime/docker/exec.mjs +63 -0
- package/dist/runtime/docker/exec.mjs.map +1 -0
- package/dist/runtime/docker/image.d.mts +1 -0
- package/dist/runtime/docker/image.mjs +278 -0
- package/dist/runtime/docker/image.mjs.map +1 -0
- package/dist/runtime/docker/index.d.mts +1 -0
- package/dist/runtime/docker/inventory.d.mts +1 -0
- package/dist/runtime/docker/inventory.mjs +167 -0
- package/dist/runtime/docker/inventory.mjs.map +1 -0
- package/dist/runtime/docker/labels.d.mts +1 -0
- package/dist/runtime/docker/labels.mjs +97 -0
- package/dist/runtime/docker/labels.mjs.map +1 -0
- package/dist/runtime/docker/logs.d.mts +1 -0
- package/dist/runtime/docker/logs.mjs +34 -0
- package/dist/runtime/docker/logs.mjs.map +1 -0
- package/dist/runtime/docker/network.d.mts +1 -0
- package/dist/runtime/docker/network.mjs +168 -0
- package/dist/runtime/docker/network.mjs.map +1 -0
- package/dist/runtime/docker/service.d.mts +9 -0
- package/dist/runtime/docker/service.mjs +266 -0
- package/dist/runtime/docker/service.mjs.map +1 -0
- package/dist/runtime/docker/sweep.d.mts +1 -0
- package/dist/runtime/docker/sweep.mjs +220 -0
- package/dist/runtime/docker/sweep.mjs.map +1 -0
- package/dist/runtime/docker/volume.d.mts +1 -0
- package/dist/runtime/docker/volume.mjs +24 -0
- package/dist/runtime/docker/volume.mjs.map +1 -0
- package/dist/runtime/docker/wrap.d.mts +1 -0
- package/dist/runtime/docker/wrap.mjs +131 -0
- package/dist/runtime/docker/wrap.mjs.map +1 -0
- package/dist/substrate/brand.d.mts +24 -0
- package/dist/substrate/brand.mjs +14 -0
- package/dist/substrate/brand.mjs.map +1 -0
- package/dist/substrate/cross-process.d.mts +1 -0
- package/dist/substrate/cross-process.mjs +28 -0
- package/dist/substrate/cross-process.mjs.map +1 -0
- package/dist/substrate/events.d.mts +117 -0
- package/dist/substrate/identity.d.mts +13 -0
- package/dist/substrate/lifecycle.d.mts +12 -0
- package/dist/substrate/manifest.d.mts +39 -0
- package/dist/substrate/manifest.mjs +33 -0
- package/dist/substrate/manifest.mjs.map +1 -0
- package/dist/substrate/network.d.mts +34 -0
- package/dist/substrate/options.d.mts +23 -0
- package/dist/substrate/plugin.d.mts +101 -0
- package/dist/substrate/plugin.mjs +61 -0
- package/dist/substrate/plugin.mjs.map +1 -0
- package/dist/substrate/projection.d.mts +100 -0
- package/dist/substrate/runtime/artifact-publisher/index.mjs +76 -0
- package/dist/substrate/runtime/artifact-publisher/index.mjs.map +1 -0
- package/dist/substrate/runtime/atomic-write.mjs +106 -0
- package/dist/substrate/runtime/atomic-write.mjs.map +1 -0
- package/dist/substrate/runtime/cache/index.d.mts +1 -0
- package/dist/substrate/runtime/cache/schema.d.mts +1 -0
- package/dist/substrate/runtime/cache/schema.mjs +22 -0
- package/dist/substrate/runtime/cache/schema.mjs.map +1 -0
- package/dist/substrate/runtime/cache/service.d.mts +1 -0
- package/dist/substrate/runtime/cache/service.mjs +89 -0
- package/dist/substrate/runtime/cache/service.mjs.map +1 -0
- package/dist/substrate/runtime/capability-sinks/index.d.mts +1 -0
- package/dist/substrate/runtime/capability-sinks/layer.d.mts +1 -0
- package/dist/substrate/runtime/capability-sinks/layer.mjs +31 -0
- package/dist/substrate/runtime/capability-sinks/layer.mjs.map +1 -0
- package/dist/substrate/runtime/capability-sinks/service.d.mts +36 -0
- package/dist/substrate/runtime/capability-sinks/service.mjs +74 -0
- package/dist/substrate/runtime/capability-sinks/service.mjs.map +1 -0
- package/dist/substrate/runtime/config-validation.d.mts +38 -0
- package/dist/substrate/runtime/config-validation.mjs +137 -0
- package/dist/substrate/runtime/config-validation.mjs.map +1 -0
- package/dist/substrate/runtime/context-helpers.mjs +32 -0
- package/dist/substrate/runtime/context-helpers.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/command-channel/channel.mjs +128 -0
- package/dist/substrate/runtime/cross-process/command-channel/channel.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/command-channel/file-channel.mjs +136 -0
- package/dist/substrate/runtime/cross-process/command-channel/file-channel.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/command-channel/protocol.mjs +49 -0
- package/dist/substrate/runtime/cross-process/command-channel/protocol.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/command-channel/runtime-control-lock.mjs +9 -0
- package/dist/substrate/runtime/cross-process/command-channel/runtime-control-lock.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/liveness.mjs +119 -0
- package/dist/substrate/runtime/cross-process/liveness.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/roster.mjs +275 -0
- package/dist/substrate/runtime/cross-process/roster.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/snapshot-reservation.d.mts +1 -0
- package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs +117 -0
- package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/stack-lock.d.mts +1 -0
- package/dist/substrate/runtime/cross-process/stack-lock.mjs +142 -0
- package/dist/substrate/runtime/cross-process/stack-lock.mjs.map +1 -0
- package/dist/substrate/runtime/current-plugin.mjs +15 -0
- package/dist/substrate/runtime/current-plugin.mjs.map +1 -0
- package/dist/substrate/runtime/errors.d.mts +1 -0
- package/dist/substrate/runtime/errors.mjs +76 -0
- package/dist/substrate/runtime/errors.mjs.map +1 -0
- package/dist/substrate/runtime/host-tree-tar/index.mjs +364 -0
- package/dist/substrate/runtime/host-tree-tar/index.mjs.map +1 -0
- package/dist/substrate/runtime/http-probe.d.mts +35 -0
- package/dist/substrate/runtime/http-probe.mjs +65 -0
- package/dist/substrate/runtime/http-probe.mjs.map +1 -0
- package/dist/substrate/runtime/lease-broker/index.d.mts +1 -0
- package/dist/substrate/runtime/lease-broker/service.d.mts +64 -0
- package/dist/substrate/runtime/lease-broker/service.mjs +155 -0
- package/dist/substrate/runtime/lease-broker/service.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/dep-graph.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/dep-graph.mjs +138 -0
- package/dist/substrate/runtime/lifecycle/dep-graph.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/index.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/lifecycle-fact.mjs +31 -0
- package/dist/substrate/runtime/lifecycle/lifecycle-fact.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/plugin-registry.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/plugin-registry.mjs +133 -0
- package/dist/substrate/runtime/lifecycle/plugin-registry.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/ready-gate.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/ready-gate.mjs +34 -0
- package/dist/substrate/runtime/lifecycle/ready-gate.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/selective-restart.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/selective-restart.mjs +43 -0
- package/dist/substrate/runtime/lifecycle/selective-restart.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/signals.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/signals.mjs +64 -0
- package/dist/substrate/runtime/lifecycle/signals.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/state-machine.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/state-machine.mjs +38 -0
- package/dist/substrate/runtime/lifecycle/state-machine.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/watch-attribution.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/watch-attribution.mjs +27 -0
- package/dist/substrate/runtime/lifecycle/watch-attribution.mjs.map +1 -0
- package/dist/substrate/runtime/managed-container.d.mts +30 -0
- package/dist/substrate/runtime/managed-container.mjs +32 -0
- package/dist/substrate/runtime/managed-container.mjs.map +1 -0
- package/dist/substrate/runtime/manifest/manifest.mjs +73 -0
- package/dist/substrate/runtime/manifest/manifest.mjs.map +1 -0
- package/dist/substrate/runtime/mode-errors.d.mts +36 -0
- package/dist/substrate/runtime/observability/cascade-formatter.d.mts +1 -0
- package/dist/substrate/runtime/observability/cascade-formatter.mjs +135 -0
- package/dist/substrate/runtime/observability/cascade-formatter.mjs.map +1 -0
- package/dist/substrate/runtime/observability/formatter-registry.d.mts +1 -0
- package/dist/substrate/runtime/observability/formatter-registry.mjs +65 -0
- package/dist/substrate/runtime/observability/formatter-registry.mjs.map +1 -0
- package/dist/substrate/runtime/observability/index.d.mts +3 -0
- package/dist/substrate/runtime/observability/logger.d.mts +58 -0
- package/dist/substrate/runtime/observability/logger.mjs +89 -0
- package/dist/substrate/runtime/observability/logger.mjs.map +1 -0
- package/dist/substrate/runtime/observability/pretty-error.d.mts +1 -0
- package/dist/substrate/runtime/observability/pretty-error.mjs +119 -0
- package/dist/substrate/runtime/observability/pretty-error.mjs.map +1 -0
- package/dist/substrate/runtime/observability/process-lines.d.mts +31 -0
- package/dist/substrate/runtime/observability/process-lines.mjs +40 -0
- package/dist/substrate/runtime/observability/process-lines.mjs.map +1 -0
- package/dist/substrate/runtime/observability/redaction.d.mts +28 -0
- package/dist/substrate/runtime/observability/redaction.mjs +45 -0
- package/dist/substrate/runtime/observability/redaction.mjs.map +1 -0
- package/dist/substrate/runtime/observability/spans.d.mts +1 -0
- package/dist/substrate/runtime/observability/spans.mjs +87 -0
- package/dist/substrate/runtime/observability/spans.mjs.map +1 -0
- package/dist/substrate/runtime/observability/subprocess-capture.d.mts +2 -0
- package/dist/substrate/runtime/observability/subprocess-capture.mjs +82 -0
- package/dist/substrate/runtime/observability/subprocess-capture.mjs.map +1 -0
- package/dist/substrate/runtime/paths.d.mts +17 -0
- package/dist/substrate/runtime/paths.mjs +61 -0
- package/dist/substrate/runtime/paths.mjs.map +1 -0
- package/dist/substrate/runtime/port-broker/index.d.mts +1 -0
- package/dist/substrate/runtime/port-broker/service.d.mts +1 -0
- package/dist/substrate/runtime/port-broker/service.mjs +319 -0
- package/dist/substrate/runtime/port-broker/service.mjs.map +1 -0
- package/dist/substrate/runtime/post-acquire-tasks.d.mts +1 -0
- package/dist/substrate/runtime/post-acquire-tasks.mjs +34 -0
- package/dist/substrate/runtime/post-acquire-tasks.mjs.map +1 -0
- package/dist/substrate/runtime/probes.d.mts +51 -0
- package/dist/substrate/runtime/probes.mjs +84 -0
- package/dist/substrate/runtime/probes.mjs.map +1 -0
- package/dist/substrate/runtime/process-supervisor.d.mts +57 -0
- package/dist/substrate/runtime/process-supervisor.mjs +73 -0
- package/dist/substrate/runtime/process-supervisor.mjs.map +1 -0
- package/dist/substrate/runtime/projection/operational-endpoints.mjs +44 -0
- package/dist/substrate/runtime/projection/operational-endpoints.mjs.map +1 -0
- package/dist/substrate/runtime/projection/persisted.mjs +195 -0
- package/dist/substrate/runtime/projection/persisted.mjs.map +1 -0
- package/dist/substrate/runtime/projection/state-ref.mjs +48 -0
- package/dist/substrate/runtime/projection/state-ref.mjs.map +1 -0
- package/dist/substrate/runtime/projection/update.mjs +200 -0
- package/dist/substrate/runtime/projection/update.mjs.map +1 -0
- package/dist/substrate/runtime/retry-policy.d.mts +18 -0
- package/dist/substrate/runtime/retry-policy.mjs +16 -0
- package/dist/substrate/runtime/retry-policy.mjs.map +1 -0
- package/dist/substrate/runtime/run.mjs +86 -0
- package/dist/substrate/runtime/run.mjs.map +1 -0
- package/dist/substrate/runtime/runtime-decode.d.mts +32 -0
- package/dist/substrate/runtime/runtime-decode.mjs +53 -0
- package/dist/substrate/runtime/runtime-decode.mjs.map +1 -0
- package/dist/substrate/runtime/scoped-http-server.mjs +36 -0
- package/dist/substrate/runtime/scoped-http-server.mjs.map +1 -0
- package/dist/substrate/runtime/scoped-ref-map/service.mjs +83 -0
- package/dist/substrate/runtime/scoped-ref-map/service.mjs.map +1 -0
- package/dist/substrate/runtime/stage-and-swap/index.d.mts +1 -0
- package/dist/substrate/runtime/stage-and-swap/index.mjs +131 -0
- package/dist/substrate/runtime/stage-and-swap/index.mjs.map +1 -0
- package/dist/substrate/runtime/state-store/schema.mjs +36 -0
- package/dist/substrate/runtime/state-store/schema.mjs.map +1 -0
- package/dist/substrate/runtime/strategy-registry/chain-probe-for.d.mts +1 -0
- package/dist/substrate/runtime/strategy-registry/chain-probe-for.mjs +22 -0
- package/dist/substrate/runtime/strategy-registry/chain-probe-for.mjs.map +1 -0
- package/dist/substrate/runtime/strategy-registry/faucet-capability-for.d.mts +1 -0
- package/dist/substrate/runtime/strategy-registry/faucet-capability-for.mjs +30 -0
- package/dist/substrate/runtime/strategy-registry/faucet-capability-for.mjs.map +1 -0
- package/dist/substrate/runtime/strategy-registry/index.d.mts +1 -0
- package/dist/substrate/runtime/strategy-registry/service.d.mts +1 -0
- package/dist/substrate/runtime/strategy-registry/service.mjs +67 -0
- package/dist/substrate/runtime/strategy-registry/service.mjs.map +1 -0
- package/dist/substrate/runtime/sui-execute/index.d.mts +11 -0
- package/dist/substrate/runtime/sui-execute/index.mjs +144 -0
- package/dist/substrate/runtime/sui-execute/index.mjs.map +1 -0
- package/dist/substrate/runtime/sui-move-build/index.d.mts +1 -0
- package/dist/substrate/runtime/sui-move-build/index.mjs +283 -0
- package/dist/substrate/runtime/sui-move-build/index.mjs.map +1 -0
- package/dist/substrate/runtime/supervisor.d.mts +1 -0
- package/dist/substrate/runtime/supervisor.mjs +831 -0
- package/dist/substrate/runtime/supervisor.mjs.map +1 -0
- package/dist/surfaces/cli/command-tree.mjs +276 -0
- package/dist/surfaces/cli/command-tree.mjs.map +1 -0
- package/dist/surfaces/cli/commands/config.mjs +31 -0
- package/dist/surfaces/cli/commands/config.mjs.map +1 -0
- package/dist/surfaces/cli/commands/confirm-node.mjs +26 -0
- package/dist/surfaces/cli/commands/confirm-node.mjs.map +1 -0
- package/dist/surfaces/cli/commands/confirm.mjs +26 -0
- package/dist/surfaces/cli/commands/confirm.mjs.map +1 -0
- package/dist/surfaces/cli/commands/doctor-probes.mjs +452 -0
- package/dist/surfaces/cli/commands/doctor-probes.mjs.map +1 -0
- package/dist/surfaces/cli/commands/doctor.mjs +38 -0
- package/dist/surfaces/cli/commands/doctor.mjs.map +1 -0
- package/dist/surfaces/cli/commands/prune-picker.mjs +347 -0
- package/dist/surfaces/cli/commands/prune-picker.mjs.map +1 -0
- package/dist/surfaces/cli/commands/prune.mjs +178 -0
- package/dist/surfaces/cli/commands/prune.mjs.map +1 -0
- package/dist/surfaces/cli/commands/snapshot.mjs +141 -0
- package/dist/surfaces/cli/commands/snapshot.mjs.map +1 -0
- package/dist/surfaces/cli/commands/status.mjs +95 -0
- package/dist/surfaces/cli/commands/status.mjs.map +1 -0
- package/dist/surfaces/cli/commands/supervisor-presence.mjs +33 -0
- package/dist/surfaces/cli/commands/supervisor-presence.mjs.map +1 -0
- package/dist/surfaces/cli/commands/wipe.mjs +28 -0
- package/dist/surfaces/cli/commands/wipe.mjs.map +1 -0
- package/dist/surfaces/cli/envelope.mjs +43 -0
- package/dist/surfaces/cli/envelope.mjs.map +1 -0
- package/dist/surfaces/cli/errors.mjs +110 -0
- package/dist/surfaces/cli/errors.mjs.map +1 -0
- package/dist/surfaces/cli/flags.mjs +56 -0
- package/dist/surfaces/cli/flags.mjs.map +1 -0
- package/dist/surfaces/cli/index.mjs +418 -0
- package/dist/surfaces/cli/index.mjs.map +1 -0
- package/dist/surfaces/cli/output.mjs +115 -0
- package/dist/surfaces/cli/output.mjs.map +1 -0
- package/dist/surfaces/cli/sysexits.mjs +139 -0
- package/dist/surfaces/cli/sysexits.mjs.map +1 -0
- package/dist/surfaces/tui/app.mjs +104 -0
- package/dist/surfaces/tui/app.mjs.map +1 -0
- package/dist/surfaces/tui/dashboard.mjs +261 -0
- package/dist/surfaces/tui/dashboard.mjs.map +1 -0
- package/dist/surfaces/tui/display-derivation.mjs +395 -0
- package/dist/surfaces/tui/display-derivation.mjs.map +1 -0
- package/dist/surfaces/tui/errors.mjs +11 -0
- package/dist/surfaces/tui/errors.mjs.map +1 -0
- package/dist/surfaces/tui/event-log.mjs +155 -0
- package/dist/surfaces/tui/event-log.mjs.map +1 -0
- package/dist/surfaces/tui/heartbeat.mjs +33 -0
- package/dist/surfaces/tui/heartbeat.mjs.map +1 -0
- package/dist/surfaces/tui/index.mjs +50 -0
- package/dist/surfaces/tui/index.mjs.map +1 -0
- package/dist/surfaces/tui/input.mjs +104 -0
- package/dist/surfaces/tui/input.mjs.map +1 -0
- package/dist/surfaces/tui/mode-detect.mjs +32 -0
- package/dist/surfaces/tui/mode-detect.mjs.map +1 -0
- package/dist/surfaces/tui/mount-ink.mjs +31 -0
- package/dist/surfaces/tui/mount-ink.mjs.map +1 -0
- package/dist/surfaces/tui/plain-renderer.mjs +170 -0
- package/dist/surfaces/tui/plain-renderer.mjs.map +1 -0
- package/dist/surfaces/tui/resource-table.mjs +507 -0
- package/dist/surfaces/tui/resource-table.mjs.map +1 -0
- package/images/_shared/signal-forward.sh +77 -0
- package/images/postgres/Dockerfile +32 -0
- package/images/seal/Dockerfile +68 -0
- package/images/seal/entrypoint.sh +65 -0
- package/images/sui/Dockerfile +73 -0
- package/images/sui/entrypoint.sh +244 -0
- package/images/sui-fork/Dockerfile +53 -0
- package/images/sui-fork/entrypoint.sh +51 -0
- package/images/walrus/Dockerfile +122 -0
- package/images/walrus/deploy-walrus.sh +305 -0
- package/images/walrus/run-walrus.sh +53 -0
- package/package.json +94 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { dispatchFileIdFromFilename, parseDispatchRouteFile } from "./file-provider.mjs";
|
|
2
|
+
import { Effect } from "effect";
|
|
3
|
+
import { existsSync, readFileSync, readdirSync, rmSync, statSync } from "node:fs";
|
|
4
|
+
import { join } from "node:path";
|
|
5
|
+
//#region src/orchestrators/router/cleanup.ts
|
|
6
|
+
const ROUTER_SHARED_APP = "devstack-router";
|
|
7
|
+
const ROUTER_CONTAINER_NAME_PREFIX = "devstack-router-";
|
|
8
|
+
const routerStateRoot = (runtimeRoot) => join(runtimeRoot, "router");
|
|
9
|
+
const safeDirectories = (dir) => {
|
|
10
|
+
try {
|
|
11
|
+
return readdirSync(dir).filter((entry) => statSync(join(dir, entry)).isDirectory());
|
|
12
|
+
} catch {
|
|
13
|
+
return [];
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
const removeRouterDispatchFilesForStack = (inputs) => Effect.sync(() => {
|
|
17
|
+
let removed = 0;
|
|
18
|
+
for (const profileDir of safeDirectories(routerStateRoot(inputs.runtimeRoot))) {
|
|
19
|
+
const dispatchDir = join(routerStateRoot(inputs.runtimeRoot), profileDir, "dispatch");
|
|
20
|
+
if (!existsSync(dispatchDir)) continue;
|
|
21
|
+
for (const filename of readdirSync(dispatchDir)) {
|
|
22
|
+
const dispatchFileId = dispatchFileIdFromFilename(filename);
|
|
23
|
+
if (dispatchFileId === null) continue;
|
|
24
|
+
const file = join(dispatchDir, filename);
|
|
25
|
+
let body;
|
|
26
|
+
try {
|
|
27
|
+
body = readFileSync(file, "utf8");
|
|
28
|
+
} catch {
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
const parsed = parseDispatchRouteFile(body, dispatchFileId);
|
|
32
|
+
if (parsed._tag === "valid" && parsed.route.lease?.app === inputs.app && parsed.route.lease.stack === inputs.stack) {
|
|
33
|
+
rmSync(file, { force: true });
|
|
34
|
+
removed += 1;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return removed;
|
|
39
|
+
});
|
|
40
|
+
const removeRouterProfileStateForDockerStack = (inputs) => Effect.sync(() => {
|
|
41
|
+
if (!inputs.routerStack.startsWith("devstack-router-")) return 0;
|
|
42
|
+
const fingerprint = inputs.routerStack.slice(16);
|
|
43
|
+
if (fingerprint.length === 0) return 0;
|
|
44
|
+
let removed = 0;
|
|
45
|
+
for (const profileDir of safeDirectories(routerStateRoot(inputs.runtimeRoot))) {
|
|
46
|
+
if (!profileDir.endsWith(`-${fingerprint}`)) continue;
|
|
47
|
+
rmSync(join(routerStateRoot(inputs.runtimeRoot), profileDir), {
|
|
48
|
+
recursive: true,
|
|
49
|
+
force: true
|
|
50
|
+
});
|
|
51
|
+
removed += 1;
|
|
52
|
+
}
|
|
53
|
+
return removed;
|
|
54
|
+
});
|
|
55
|
+
//#endregion
|
|
56
|
+
export { ROUTER_CONTAINER_NAME_PREFIX, ROUTER_SHARED_APP, removeRouterDispatchFilesForStack, removeRouterProfileStateForDockerStack };
|
|
57
|
+
|
|
58
|
+
//# sourceMappingURL=cleanup.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cleanup.mjs","names":[],"sources":["../../../src/orchestrators/router/cleanup.ts"],"sourcesContent":["import { existsSync, readdirSync, readFileSync, rmSync, statSync } from 'node:fs';\nimport { join } from 'node:path';\n\nimport { Effect } from 'effect';\n\nimport { dispatchFileIdFromFilename, parseDispatchRouteFile } from './file-provider.ts';\n\nexport const ROUTER_SHARED_APP = 'devstack-router';\nexport const ROUTER_CONTAINER_NAME_PREFIX = 'devstack-router-';\n\nconst routerStateRoot = (runtimeRoot: string): string => join(runtimeRoot, 'router');\n\nconst safeDirectories = (dir: string): ReadonlyArray<string> => {\n\ttry {\n\t\treturn readdirSync(dir).filter((entry) => statSync(join(dir, entry)).isDirectory());\n\t} catch {\n\t\treturn [];\n\t}\n};\n\nexport const removeRouterDispatchFilesForStack = (inputs: {\n\treadonly runtimeRoot: string;\n\treadonly app: string;\n\treadonly stack: string;\n}): Effect.Effect<number> =>\n\tEffect.sync(() => {\n\t\tlet removed = 0;\n\t\tfor (const profileDir of safeDirectories(routerStateRoot(inputs.runtimeRoot))) {\n\t\t\tconst dispatchDir = join(routerStateRoot(inputs.runtimeRoot), profileDir, 'dispatch');\n\t\t\tif (!existsSync(dispatchDir)) continue;\n\t\t\tfor (const filename of readdirSync(dispatchDir)) {\n\t\t\t\tconst dispatchFileId = dispatchFileIdFromFilename(filename);\n\t\t\t\tif (dispatchFileId === null) continue;\n\t\t\t\tconst file = join(dispatchDir, filename);\n\t\t\t\tlet body: string;\n\t\t\t\ttry {\n\t\t\t\t\tbody = readFileSync(file, 'utf8');\n\t\t\t\t} catch {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst parsed = parseDispatchRouteFile(body, dispatchFileId);\n\t\t\t\tif (\n\t\t\t\t\tparsed._tag === 'valid' &&\n\t\t\t\t\tparsed.route.lease?.app === inputs.app &&\n\t\t\t\t\tparsed.route.lease.stack === inputs.stack\n\t\t\t\t) {\n\t\t\t\t\trmSync(file, { force: true });\n\t\t\t\t\tremoved += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn removed;\n\t});\n\nexport const removeRouterProfileStateForDockerStack = (inputs: {\n\treadonly runtimeRoot: string;\n\treadonly routerStack: string;\n}): Effect.Effect<number> =>\n\tEffect.sync(() => {\n\t\tif (!inputs.routerStack.startsWith(ROUTER_CONTAINER_NAME_PREFIX)) return 0;\n\t\tconst fingerprint = inputs.routerStack.slice(ROUTER_CONTAINER_NAME_PREFIX.length);\n\t\tif (fingerprint.length === 0) return 0;\n\n\t\tlet removed = 0;\n\t\tfor (const profileDir of safeDirectories(routerStateRoot(inputs.runtimeRoot))) {\n\t\t\tif (!profileDir.endsWith(`-${fingerprint}`)) continue;\n\t\t\trmSync(join(routerStateRoot(inputs.runtimeRoot), profileDir), {\n\t\t\t\trecursive: true,\n\t\t\t\tforce: true,\n\t\t\t});\n\t\t\tremoved += 1;\n\t\t}\n\t\treturn removed;\n\t});\n"],"mappings":";;;;;AAOA,MAAa,oBAAoB;AACjC,MAAa,+BAA+B;AAE5C,MAAM,mBAAmB,gBAAgC,KAAK,aAAa,SAAS;AAEpF,MAAM,mBAAmB,QAAuC;AAC/D,KAAI;AACH,SAAO,YAAY,IAAI,CAAC,QAAQ,UAAU,SAAS,KAAK,KAAK,MAAM,CAAC,CAAC,aAAa,CAAC;SAC5E;AACP,SAAO,EAAE;;;AAIX,MAAa,qCAAqC,WAKjD,OAAO,WAAW;CACjB,IAAI,UAAU;AACd,MAAK,MAAM,cAAc,gBAAgB,gBAAgB,OAAO,YAAY,CAAC,EAAE;EAC9E,MAAM,cAAc,KAAK,gBAAgB,OAAO,YAAY,EAAE,YAAY,WAAW;AACrF,MAAI,CAAC,WAAW,YAAY,CAAE;AAC9B,OAAK,MAAM,YAAY,YAAY,YAAY,EAAE;GAChD,MAAM,iBAAiB,2BAA2B,SAAS;AAC3D,OAAI,mBAAmB,KAAM;GAC7B,MAAM,OAAO,KAAK,aAAa,SAAS;GACxC,IAAI;AACJ,OAAI;AACH,WAAO,aAAa,MAAM,OAAO;WAC1B;AACP;;GAED,MAAM,SAAS,uBAAuB,MAAM,eAAe;AAC3D,OACC,OAAO,SAAS,WAChB,OAAO,MAAM,OAAO,QAAQ,OAAO,OACnC,OAAO,MAAM,MAAM,UAAU,OAAO,OACnC;AACD,WAAO,MAAM,EAAE,OAAO,MAAM,CAAC;AAC7B,eAAW;;;;AAId,QAAO;EACN;AAEH,MAAa,0CAA0C,WAItD,OAAO,WAAW;AACjB,KAAI,CAAC,OAAO,YAAY,WAAA,mBAAwC,CAAE,QAAO;CACzE,MAAM,cAAc,OAAO,YAAY,MAAM,GAAoC;AACjF,KAAI,YAAY,WAAW,EAAG,QAAO;CAErC,IAAI,UAAU;AACd,MAAK,MAAM,cAAc,gBAAgB,gBAAgB,OAAO,YAAY,CAAC,EAAE;AAC9E,MAAI,CAAC,WAAW,SAAS,IAAI,cAAc,CAAE;AAC7C,SAAO,KAAK,gBAAgB,OAAO,YAAY,EAAE,WAAW,EAAE;GAC7D,WAAW;GACX,OAAO;GACP,CAAC;AACF,aAAW;;AAEZ,QAAO;EACN"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//#region src/orchestrators/router/cors.ts
|
|
2
|
+
const CORS_MIDDLEWARE_NAME = "devstack-cors";
|
|
3
|
+
/** Filename for the shared-middlewares file. The `00-` prefix forces
|
|
4
|
+
* alphabetic-sort ordering ahead of per-backend dispatch files. */
|
|
5
|
+
const CORS_MIDDLEWARE_FILENAME = "00-shared-middlewares.yml";
|
|
6
|
+
/** Render the permissive shared-CORS middleware as a Traefik
|
|
7
|
+
* file-provider YAML body. Backends that set `cors: true` reference
|
|
8
|
+
* this middleware by name (`devstack-cors`) from their per-backend
|
|
9
|
+
* routers section. */
|
|
10
|
+
const renderCorsMiddlewareYaml = () => {
|
|
11
|
+
return [
|
|
12
|
+
`# Devstack shared CORS middleware. Permissive — dev-only.`,
|
|
13
|
+
`# Architecture distilled-doc §"Shared CORS middleware".`,
|
|
14
|
+
`http:`,
|
|
15
|
+
` middlewares:`,
|
|
16
|
+
` ${CORS_MIDDLEWARE_NAME}:`,
|
|
17
|
+
` headers:`,
|
|
18
|
+
` accessControlAllowOriginList: ["*"]`,
|
|
19
|
+
` accessControlAllowMethods: ["GET", "POST", "PUT", "DELETE", "OPTIONS", "PATCH", "HEAD"]`,
|
|
20
|
+
` accessControlAllowHeaders: ["*"]`,
|
|
21
|
+
` accessControlExposeHeaders: ["*"]`,
|
|
22
|
+
` accessControlAllowCredentials: true`,
|
|
23
|
+
` accessControlMaxAge: 86400`,
|
|
24
|
+
` addVaryHeader: true`,
|
|
25
|
+
``
|
|
26
|
+
].join("\n");
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { CORS_MIDDLEWARE_FILENAME, CORS_MIDDLEWARE_NAME, renderCorsMiddlewareYaml };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=cors.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cors.mjs","names":[],"sources":["../../../src/orchestrators/router/cors.ts"],"sourcesContent":["// CORS middleware factory.\n//\n// Architecture distilled-doc §\"Shared CORS middleware\":\n// - ONE shared permissive CORS middleware. Backends opt in by setting\n// `Routable.cors: true`; the orchestrator wires the middleware\n// reference into the dispatch file. Backends never write CORS\n// headers themselves.\n//\n// - The middleware file is rewritten on each router boot, BEFORE any\n// per-backend file references it. It sorts lexicographically\n// ahead of per-backend filenames (we prefix with `00-`) so the\n// file-provider watcher loads it first.\n//\n// - Permissive (`*` allow-origin, very long max-age) — fine for the\n// dev-loop, footgun if copied elsewhere; documented at the call\n// site, not in production-ready posture.\n\n// The Traefik middleware name baked into the file-provider config. We\n// use a constant so the same string flows through `file-provider.ts`'s\n// route renderer.\nexport const CORS_MIDDLEWARE_NAME = 'devstack-cors';\n\n/** Filename for the shared-middlewares file. The `00-` prefix forces\n * alphabetic-sort ordering ahead of per-backend dispatch files. */\nexport const CORS_MIDDLEWARE_FILENAME = '00-shared-middlewares.yml';\n\n/** Render the permissive shared-CORS middleware as a Traefik\n * file-provider YAML body. Backends that set `cors: true` reference\n * this middleware by name (`devstack-cors`) from their per-backend\n * routers section. */\nexport const renderCorsMiddlewareYaml = (): string => {\n\t// The YAML body below is hand-rolled (no yaml lib dep) because:\n\t// - it is a static, fully-controlled string,\n\t// - the values are constants known at compile time,\n\t// - we explicitly want byte-identical output cycle-to-cycle so\n\t// the file-provider watcher doesn't wake on no-op rewrites.\n\treturn [\n\t\t`# Devstack shared CORS middleware. Permissive — dev-only.`,\n\t\t`# Architecture distilled-doc §\"Shared CORS middleware\".`,\n\t\t`http:`,\n\t\t` middlewares:`,\n\t\t` ${CORS_MIDDLEWARE_NAME}:`,\n\t\t` headers:`,\n\t\t` accessControlAllowOriginList: [\"*\"]`,\n\t\t` accessControlAllowMethods: [\"GET\", \"POST\", \"PUT\", \"DELETE\", \"OPTIONS\", \"PATCH\", \"HEAD\"]`,\n\t\t` accessControlAllowHeaders: [\"*\"]`,\n\t\t` accessControlExposeHeaders: [\"*\"]`,\n\t\t` accessControlAllowCredentials: true`,\n\t\t` accessControlMaxAge: 86400`,\n\t\t` addVaryHeader: true`,\n\t\t``, // trailing newline; Traefik tolerates either way\n\t].join('\\n');\n};\n"],"mappings":";AAoBA,MAAa,uBAAuB;;;AAIpC,MAAa,2BAA2B;;;;;AAMxC,MAAa,iCAAyC;AAMrD,QAAO;EACN;EACA;EACA;EACA;EACA,OAAO,qBAAqB;EAC5B;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,CAAC,KAAK,KAAK"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { Context, Effect, Layer } from "effect";
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { EntrypointConflict, UnknownEntrypoint } from "./errors.mjs";
|
|
2
|
+
import { Context, Effect, Layer } from "effect";
|
|
3
|
+
//#region src/orchestrators/router/entrypoints.ts
|
|
4
|
+
var EntrypointRegistry = class extends Context.Service()("@devstack-rewrite/orchestrators/router/EntrypointRegistry") {};
|
|
5
|
+
const entrypointFamily = (protocol) => protocol === "tcp" ? "tcp" : "http";
|
|
6
|
+
/** Build a registry from a literal seed. Idempotent on identical
|
|
7
|
+
* `(name, port, protocol)` triples; throws synchronously on conflict
|
|
8
|
+
* per architecture invariant #6. The reason this is synchronous
|
|
9
|
+
* rather than yielded: registration is module-load wiring, not a
|
|
10
|
+
* runtime effect — the failure mode is "two callers wired the same
|
|
11
|
+
* name to different ports", which is a build-time bug.
|
|
12
|
+
*
|
|
13
|
+
* Traefik cannot bind multiple entrypoints to the same container port.
|
|
14
|
+
* For HTTP-family aliases on one port, keep every declared name
|
|
15
|
+
* lookupable but resolve those aliases to the first listener registered
|
|
16
|
+
* for the port. */
|
|
17
|
+
const makeEntrypointRegistry = (seed) => {
|
|
18
|
+
const declaredByName = /* @__PURE__ */ new Map();
|
|
19
|
+
const lookupByName = /* @__PURE__ */ new Map();
|
|
20
|
+
const listenerByPort = /* @__PURE__ */ new Map();
|
|
21
|
+
for (const e of seed) {
|
|
22
|
+
const existing = declaredByName.get(e.name);
|
|
23
|
+
if (existing) {
|
|
24
|
+
if (existing.port === e.port && existing.protocol === e.protocol) continue;
|
|
25
|
+
throw new EntrypointConflict({
|
|
26
|
+
name: e.name,
|
|
27
|
+
existing: {
|
|
28
|
+
port: existing.port,
|
|
29
|
+
protocol: existing.protocol
|
|
30
|
+
},
|
|
31
|
+
attempted: {
|
|
32
|
+
port: e.port,
|
|
33
|
+
protocol: e.protocol
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
declaredByName.set(e.name, e);
|
|
38
|
+
const listener = listenerByPort.get(e.port);
|
|
39
|
+
if (listener) {
|
|
40
|
+
const listenerFamily = entrypointFamily(listener.protocol);
|
|
41
|
+
const attemptedFamily = entrypointFamily(e.protocol);
|
|
42
|
+
if (listenerFamily === "tcp" || listenerFamily !== attemptedFamily) throw new EntrypointConflict({
|
|
43
|
+
name: e.name,
|
|
44
|
+
existing: {
|
|
45
|
+
port: listener.port,
|
|
46
|
+
protocol: listener.protocol
|
|
47
|
+
},
|
|
48
|
+
attempted: {
|
|
49
|
+
port: e.port,
|
|
50
|
+
protocol: e.protocol
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
lookupByName.set(e.name, listener);
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
listenerByPort.set(e.port, e);
|
|
57
|
+
lookupByName.set(e.name, e);
|
|
58
|
+
}
|
|
59
|
+
const frozenListeners = Array.from(listenerByPort.values());
|
|
60
|
+
const knownNames = Array.from(declaredByName.keys());
|
|
61
|
+
return {
|
|
62
|
+
byName: (name) => {
|
|
63
|
+
const hit = lookupByName.get(name);
|
|
64
|
+
if (hit) return Effect.succeed(hit);
|
|
65
|
+
return Effect.fail(new UnknownEntrypoint({
|
|
66
|
+
name,
|
|
67
|
+
known: knownNames
|
|
68
|
+
}));
|
|
69
|
+
},
|
|
70
|
+
all: () => frozenListeners
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
/** Layer that pins the registry from a literal seed. The orchestrator
|
|
74
|
+
* takes this as a substrate dependency; plugins do NOT mutate the
|
|
75
|
+
* registry — they pick names from it via their Routable contributions. */
|
|
76
|
+
const layerEntrypointRegistry = (seed) => Layer.succeed(EntrypointRegistry)(makeEntrypointRegistry(seed));
|
|
77
|
+
//#endregion
|
|
78
|
+
export { EntrypointRegistry, layerEntrypointRegistry };
|
|
79
|
+
|
|
80
|
+
//# sourceMappingURL=entrypoints.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entrypoints.mjs","names":[],"sources":["../../../src/orchestrators/router/entrypoints.ts"],"sourcesContent":["// Entrypoint registry — a process-global allowlist of named host\n// ports the Traefik container will listen on.\n//\n// Architecture invariants:\n// #6 — Routables select an entrypoint by *name* from a closed set\n// populated at module-load time. The set is read ONCE at\n// router launch.\n// #12 — Every entrypoint is plain HTTP / h2c / TCP; no TLS surface.\n// TCP entrypoints bind a host port and dispatch raw bytes to a\n// single backend (postgres, redis, …); they cannot share the\n// port across parallel stacks because TCP has no virtual-host\n// concept. HTTP/h2c entrypoints DO share ports via Host-header\n// dispatch.\n//\n// The registry is intentionally a typed Context service (Effect v4\n// idiom) rather than a module-mutable map: that lets tests build a\n// fresh registry per scenario, lets the orchestrator carry the\n// registration set forward immutably, and removes the\n// `ATTACHED_FOLLOWERS`-style hidden globals the architecture's\n// \"What's NOT in it\" section forbids.\n//\n// Construction surface:\n// `makeEntrypointRegistry(...)` — pure constructor; throws synchronously\n// on conflict registration (architecture invariant #6 is \"throw at\n// registration time\", not at acquire time).\n//\n// Lookup surface:\n// `EntrypointRegistry.byName(name)` — typed yieldable that fails\n// `UnknownEntrypoint` if the caller spliced an unregistered name.\n\nimport { Context, Effect, Layer } from 'effect';\n\nimport type { EntrypointDecl } from '../../contracts/routable.ts';\nimport { EntrypointConflict, UnknownEntrypoint } from './errors.ts';\n\n/** A named entrypoint — a host port the Traefik container binds and\n * listens on. `http`/`h2c` entrypoints support Host-header dispatch\n * (one port → many backends). `tcp` entrypoints are point-to-point\n * (one port → one backend) — siblings dial them directly. */\nexport type Entrypoint = EntrypointDecl;\n\n/** Registry shape. Closed map from declared name → canonical listener.\n * HTTP-family declarations may share a port; Traefik still needs one\n * listener name for that port, so aliases resolve to the first\n * registered listener. */\nexport interface EntrypointRegistryShape {\n\treadonly byName: (name: string) => Effect.Effect<Entrypoint, UnknownEntrypoint>;\n\treadonly all: () => ReadonlyArray<Entrypoint>;\n}\n\nexport class EntrypointRegistry extends Context.Service<\n\tEntrypointRegistry,\n\tEntrypointRegistryShape\n>()('@devstack-rewrite/orchestrators/router/EntrypointRegistry') {}\n\nconst entrypointFamily = (protocol: Entrypoint['protocol']): 'http' | 'tcp' =>\n\tprotocol === 'tcp' ? 'tcp' : 'http';\n\n/** Build a registry from a literal seed. Idempotent on identical\n * `(name, port, protocol)` triples; throws synchronously on conflict\n * per architecture invariant #6. The reason this is synchronous\n * rather than yielded: registration is module-load wiring, not a\n * runtime effect — the failure mode is \"two callers wired the same\n * name to different ports\", which is a build-time bug.\n *\n * Traefik cannot bind multiple entrypoints to the same container port.\n * For HTTP-family aliases on one port, keep every declared name\n * lookupable but resolve those aliases to the first listener registered\n * for the port. */\nexport const makeEntrypointRegistry = (\n\tseed: ReadonlyArray<Entrypoint>,\n): EntrypointRegistryShape => {\n\tconst declaredByName = new Map<string, Entrypoint>();\n\tconst lookupByName = new Map<string, Entrypoint>();\n\tconst listenerByPort = new Map<number, Entrypoint>();\n\tfor (const e of seed) {\n\t\tconst existing = declaredByName.get(e.name);\n\t\tif (existing) {\n\t\t\tif (existing.port === e.port && existing.protocol === e.protocol) continue;\n\t\t\tthrow new EntrypointConflict({\n\t\t\t\tname: e.name,\n\t\t\t\texisting: { port: existing.port, protocol: existing.protocol },\n\t\t\t\tattempted: { port: e.port, protocol: e.protocol },\n\t\t\t});\n\t\t}\n\t\tdeclaredByName.set(e.name, e);\n\n\t\tconst listener = listenerByPort.get(e.port);\n\t\tif (listener) {\n\t\t\tconst listenerFamily = entrypointFamily(listener.protocol);\n\t\t\tconst attemptedFamily = entrypointFamily(e.protocol);\n\t\t\tif (listenerFamily === 'tcp' || listenerFamily !== attemptedFamily) {\n\t\t\t\tthrow new EntrypointConflict({\n\t\t\t\t\tname: e.name,\n\t\t\t\t\texisting: { port: listener.port, protocol: listener.protocol },\n\t\t\t\t\tattempted: { port: e.port, protocol: e.protocol },\n\t\t\t\t});\n\t\t\t}\n\t\t\tlookupByName.set(e.name, listener);\n\t\t\tcontinue;\n\t\t}\n\n\t\tlistenerByPort.set(e.port, e);\n\t\tlookupByName.set(e.name, e);\n\t}\n\tconst frozenListeners: ReadonlyArray<Entrypoint> = Array.from(listenerByPort.values());\n\tconst knownNames = Array.from(declaredByName.keys());\n\treturn {\n\t\tbyName: (name) => {\n\t\t\tconst hit = lookupByName.get(name);\n\t\t\tif (hit) return Effect.succeed(hit);\n\t\t\treturn Effect.fail(\n\t\t\t\tnew UnknownEntrypoint({\n\t\t\t\t\tname,\n\t\t\t\t\tknown: knownNames,\n\t\t\t\t}),\n\t\t\t);\n\t\t},\n\t\tall: () => frozenListeners,\n\t};\n};\n\n/** Layer that pins the registry from a literal seed. The orchestrator\n * takes this as a substrate dependency; plugins do NOT mutate the\n * registry — they pick names from it via their Routable contributions. */\nexport const layerEntrypointRegistry = (\n\tseed: ReadonlyArray<Entrypoint>,\n): Layer.Layer<EntrypointRegistry> =>\n\tLayer.succeed(EntrypointRegistry)(makeEntrypointRegistry(seed));\n"],"mappings":";;;AAkDA,IAAa,qBAAb,cAAwC,QAAQ,SAG7C,CAAC,4DAA4D,CAAC;AAEjE,MAAM,oBAAoB,aACzB,aAAa,QAAQ,QAAQ;;;;;;;;;;;;AAa9B,MAAa,0BACZ,SAC6B;CAC7B,MAAM,iCAAiB,IAAI,KAAyB;CACpD,MAAM,+BAAe,IAAI,KAAyB;CAClD,MAAM,iCAAiB,IAAI,KAAyB;AACpD,MAAK,MAAM,KAAK,MAAM;EACrB,MAAM,WAAW,eAAe,IAAI,EAAE,KAAK;AAC3C,MAAI,UAAU;AACb,OAAI,SAAS,SAAS,EAAE,QAAQ,SAAS,aAAa,EAAE,SAAU;AAClE,SAAM,IAAI,mBAAmB;IAC5B,MAAM,EAAE;IACR,UAAU;KAAE,MAAM,SAAS;KAAM,UAAU,SAAS;KAAU;IAC9D,WAAW;KAAE,MAAM,EAAE;KAAM,UAAU,EAAE;KAAU;IACjD,CAAC;;AAEH,iBAAe,IAAI,EAAE,MAAM,EAAE;EAE7B,MAAM,WAAW,eAAe,IAAI,EAAE,KAAK;AAC3C,MAAI,UAAU;GACb,MAAM,iBAAiB,iBAAiB,SAAS,SAAS;GAC1D,MAAM,kBAAkB,iBAAiB,EAAE,SAAS;AACpD,OAAI,mBAAmB,SAAS,mBAAmB,gBAClD,OAAM,IAAI,mBAAmB;IAC5B,MAAM,EAAE;IACR,UAAU;KAAE,MAAM,SAAS;KAAM,UAAU,SAAS;KAAU;IAC9D,WAAW;KAAE,MAAM,EAAE;KAAM,UAAU,EAAE;KAAU;IACjD,CAAC;AAEH,gBAAa,IAAI,EAAE,MAAM,SAAS;AAClC;;AAGD,iBAAe,IAAI,EAAE,MAAM,EAAE;AAC7B,eAAa,IAAI,EAAE,MAAM,EAAE;;CAE5B,MAAM,kBAA6C,MAAM,KAAK,eAAe,QAAQ,CAAC;CACtF,MAAM,aAAa,MAAM,KAAK,eAAe,MAAM,CAAC;AACpD,QAAO;EACN,SAAS,SAAS;GACjB,MAAM,MAAM,aAAa,IAAI,KAAK;AAClC,OAAI,IAAK,QAAO,OAAO,QAAQ,IAAI;AACnC,UAAO,OAAO,KACb,IAAI,kBAAkB;IACrB;IACA,OAAO;IACP,CAAC,CACF;;EAEF,WAAW;EACX;;;;;AAMF,MAAa,2BACZ,SAEA,MAAM,QAAQ,mBAAmB,CAAC,uBAAuB,KAAK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
//#region src/orchestrators/router/errors.ts
|
|
3
|
+
/** Caller registered (or referenced) an entrypoint that isn't in the
|
|
4
|
+
* process-global registry. Architecture invariant #6:
|
|
5
|
+
* registrations are read once at router launch; this surface is the
|
|
6
|
+
* programming-error path for callers that splice an unregistered
|
|
7
|
+
* name into a Routable. */
|
|
8
|
+
var UnknownEntrypoint = class extends Schema.TaggedErrorClass()("UnknownEntrypoint", {
|
|
9
|
+
name: Schema.String,
|
|
10
|
+
known: Schema.Array(Schema.String)
|
|
11
|
+
}) {};
|
|
12
|
+
/** Two callers tried to register the same entrypoint *name* with
|
|
13
|
+
* conflicting `(port, protocol)`. Architecture invariant #6:
|
|
14
|
+
* re-registering identically is idempotent; re-registering with a
|
|
15
|
+
* conflict throws synchronously. */
|
|
16
|
+
var EntrypointConflict = class extends Schema.TaggedErrorClass()("EntrypointConflict", {
|
|
17
|
+
name: Schema.String,
|
|
18
|
+
existing: Schema.Struct({
|
|
19
|
+
port: Schema.Number,
|
|
20
|
+
protocol: Schema.String
|
|
21
|
+
}),
|
|
22
|
+
attempted: Schema.Struct({
|
|
23
|
+
port: Schema.Number,
|
|
24
|
+
protocol: Schema.String
|
|
25
|
+
})
|
|
26
|
+
}) {};
|
|
27
|
+
/** A user-influenceable string (dispatch id / hostname / upstream URL
|
|
28
|
+
* / entrypoint name) didn't pass the validator. Architecture
|
|
29
|
+
* invariant #13. Always a programming error in the caller, NOT a
|
|
30
|
+
* transient. */
|
|
31
|
+
var RouterValidationError = class extends Schema.TaggedErrorClass()("RouterValidationError", {
|
|
32
|
+
field: Schema.Literals([
|
|
33
|
+
"hostname",
|
|
34
|
+
"dispatchId",
|
|
35
|
+
"entrypointName",
|
|
36
|
+
"upstreamUrl"
|
|
37
|
+
]),
|
|
38
|
+
value: Schema.String,
|
|
39
|
+
detail: Schema.String
|
|
40
|
+
}) {};
|
|
41
|
+
/** Two `Routable` contributions minted the same `(hostname, entrypoint)`
|
|
42
|
+
* pair — i.e. the dispatch-id contract is violated upstream. Hard
|
|
43
|
+
* failure: routing would be ambiguous. */
|
|
44
|
+
var RouteCollision = class extends Schema.TaggedErrorClass()("RouteCollision", {
|
|
45
|
+
message: Schema.String,
|
|
46
|
+
hostname: Schema.String,
|
|
47
|
+
entrypoint: Schema.String,
|
|
48
|
+
dispatchIds: Schema.Array(Schema.String)
|
|
49
|
+
}) {};
|
|
50
|
+
Schema.TaggedErrorClass()("UpstreamResolveTimeout", {
|
|
51
|
+
dispatchId: Schema.String,
|
|
52
|
+
upstreamKind: Schema.Literals(["container", "host-loopback"]),
|
|
53
|
+
waitedMillis: Schema.Number
|
|
54
|
+
});
|
|
55
|
+
/** The router boot failed (image-pull, network-create, container-run
|
|
56
|
+
* all roll up here). Distinct tag from `UnknownEntrypoint` so callers
|
|
57
|
+
* can `Effect.catchTag('RouterBootFailed', …)` and report proxy
|
|
58
|
+
* infrastructure failures separately from route validation. */
|
|
59
|
+
var RouterBootFailed = class extends Schema.TaggedErrorClass()("RouterBootFailed", {
|
|
60
|
+
stage: Schema.Literals([
|
|
61
|
+
"ensure-network",
|
|
62
|
+
"ensure-container",
|
|
63
|
+
"write-shared-config",
|
|
64
|
+
"inspect"
|
|
65
|
+
]),
|
|
66
|
+
detail: Schema.String,
|
|
67
|
+
cause: Schema.optional(Schema.Defect)
|
|
68
|
+
}) {};
|
|
69
|
+
/** Router opt-out only supports endpoints that are already reachable
|
|
70
|
+
* from the host without Traefik. Container upstreams require the
|
|
71
|
+
* router's Docker network + proxy entrypoint, so disabled mode must
|
|
72
|
+
* fail explicitly instead of fabricating a localhost URL. */
|
|
73
|
+
var RouterDisabledRouteUnsupported = class extends Schema.TaggedErrorClass()("RouterDisabledRouteUnsupported", {
|
|
74
|
+
endpointName: Schema.String,
|
|
75
|
+
upstreamKind: Schema.Literals(["container", "host-loopback"]),
|
|
76
|
+
detail: Schema.String
|
|
77
|
+
}) {};
|
|
78
|
+
/** Writing a per-backend dispatch file failed. Distinct from
|
|
79
|
+
* `RouterBootFailed` so callers can log/skip an individual route
|
|
80
|
+
* without failing boot, per distilled-doc:
|
|
81
|
+
* "the per-primitive route is silently absent; the route's hostname
|
|
82
|
+
* returns Traefik's default 404. Warning is logged…". */
|
|
83
|
+
var DispatchWriteFailed = class extends Schema.TaggedErrorClass()("DispatchWriteFailed", {
|
|
84
|
+
dispatchFileId: Schema.String,
|
|
85
|
+
path: Schema.String,
|
|
86
|
+
detail: Schema.String,
|
|
87
|
+
cause: Schema.optional(Schema.Defect)
|
|
88
|
+
}) {};
|
|
89
|
+
/** The per-backend dispatch file was written, but the public router
|
|
90
|
+
* entrypoint did not start serving that route within the readiness
|
|
91
|
+
* budget. This catches Traefik file-provider reload races before the
|
|
92
|
+
* endpoint is surfaced to users. */
|
|
93
|
+
var RouteReadinessProbeFailed = class extends Schema.TaggedErrorClass()("RouteReadinessProbeFailed", {
|
|
94
|
+
dispatchFileId: Schema.String,
|
|
95
|
+
url: Schema.String,
|
|
96
|
+
timeoutMs: Schema.Number,
|
|
97
|
+
detail: Schema.String,
|
|
98
|
+
cause: Schema.optional(Schema.Defect)
|
|
99
|
+
}) {};
|
|
100
|
+
//#endregion
|
|
101
|
+
export { DispatchWriteFailed, EntrypointConflict, RouteCollision, RouteReadinessProbeFailed, RouterBootFailed, RouterDisabledRouteUnsupported, RouterValidationError, UnknownEntrypoint };
|
|
102
|
+
|
|
103
|
+
//# sourceMappingURL=errors.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.mjs","names":[],"sources":["../../../src/orchestrators/router/errors.ts"],"sourcesContent":["// Typed errors emitted by the router orchestrator.\n//\n// One tagged class per discriminated failure surface; the router is\n// the only producer so the shapes are tight. Effect v4 `Schema.TaggedErrorClass`\n// pattern matches the rest of the substrate (see\n// `substrate/runtime/errors.ts`).\n\nimport { Schema } from 'effect';\n\n/** Caller registered (or referenced) an entrypoint that isn't in the\n * process-global registry. Architecture invariant #6:\n * registrations are read once at router launch; this surface is the\n * programming-error path for callers that splice an unregistered\n * name into a Routable. */\nexport class UnknownEntrypoint extends Schema.TaggedErrorClass<UnknownEntrypoint>()(\n\t'UnknownEntrypoint',\n\t{\n\t\tname: Schema.String,\n\t\tknown: Schema.Array(Schema.String),\n\t},\n) {}\n\n/** Two callers tried to register the same entrypoint *name* with\n * conflicting `(port, protocol)`. Architecture invariant #6:\n * re-registering identically is idempotent; re-registering with a\n * conflict throws synchronously. */\nexport class EntrypointConflict extends Schema.TaggedErrorClass<EntrypointConflict>()(\n\t'EntrypointConflict',\n\t{\n\t\tname: Schema.String,\n\t\texisting: Schema.Struct({\n\t\t\tport: Schema.Number,\n\t\t\tprotocol: Schema.String,\n\t\t}),\n\t\tattempted: Schema.Struct({\n\t\t\tport: Schema.Number,\n\t\t\tprotocol: Schema.String,\n\t\t}),\n\t},\n) {}\n\n/** A user-influenceable string (dispatch id / hostname / upstream URL\n * / entrypoint name) didn't pass the validator. Architecture\n * invariant #13. Always a programming error in the caller, NOT a\n * transient. */\nexport class RouterValidationError extends Schema.TaggedErrorClass<RouterValidationError>()(\n\t'RouterValidationError',\n\t{\n\t\tfield: Schema.Literals(['hostname', 'dispatchId', 'entrypointName', 'upstreamUrl']),\n\t\tvalue: Schema.String,\n\t\tdetail: Schema.String,\n\t},\n) {}\n\n/** Two `Routable` contributions minted the same `(hostname, entrypoint)`\n * pair — i.e. the dispatch-id contract is violated upstream. Hard\n * failure: routing would be ambiguous. */\nexport class RouteCollision extends Schema.TaggedErrorClass<RouteCollision>()('RouteCollision', {\n\tmessage: Schema.String,\n\thostname: Schema.String,\n\tentrypoint: Schema.String,\n\tdispatchIds: Schema.Array(Schema.String),\n}) {}\n\n/** The router upstream URL could not be resolved within the bounded\n * retry budget — for container backends the network-connect's\n * async IP-allocation never settled. Architecture invariant #3. */\nexport class UpstreamResolveTimeout extends Schema.TaggedErrorClass<UpstreamResolveTimeout>()(\n\t'UpstreamResolveTimeout',\n\t{\n\t\tdispatchId: Schema.String,\n\t\tupstreamKind: Schema.Literals(['container', 'host-loopback']),\n\t\twaitedMillis: Schema.Number,\n\t},\n) {}\n\n/** The router boot failed (image-pull, network-create, container-run\n * all roll up here). Distinct tag from `UnknownEntrypoint` so callers\n * can `Effect.catchTag('RouterBootFailed', …)` and report proxy\n * infrastructure failures separately from route validation. */\nexport class RouterBootFailed extends Schema.TaggedErrorClass<RouterBootFailed>()(\n\t'RouterBootFailed',\n\t{\n\t\tstage: Schema.Literals([\n\t\t\t'ensure-network',\n\t\t\t'ensure-container',\n\t\t\t'write-shared-config',\n\t\t\t'inspect',\n\t\t]),\n\t\tdetail: Schema.String,\n\t\tcause: Schema.optional(Schema.Defect),\n\t},\n) {}\n\n/** Router opt-out only supports endpoints that are already reachable\n * from the host without Traefik. Container upstreams require the\n * router's Docker network + proxy entrypoint, so disabled mode must\n * fail explicitly instead of fabricating a localhost URL. */\nexport class RouterDisabledRouteUnsupported extends Schema.TaggedErrorClass<RouterDisabledRouteUnsupported>()(\n\t'RouterDisabledRouteUnsupported',\n\t{\n\t\tendpointName: Schema.String,\n\t\tupstreamKind: Schema.Literals(['container', 'host-loopback']),\n\t\tdetail: Schema.String,\n\t},\n) {}\n\n/** Writing a per-backend dispatch file failed. Distinct from\n * `RouterBootFailed` so callers can log/skip an individual route\n * without failing boot, per distilled-doc:\n * \"the per-primitive route is silently absent; the route's hostname\n * returns Traefik's default 404. Warning is logged…\". */\nexport class DispatchWriteFailed extends Schema.TaggedErrorClass<DispatchWriteFailed>()(\n\t'DispatchWriteFailed',\n\t{\n\t\tdispatchFileId: Schema.String,\n\t\tpath: Schema.String,\n\t\tdetail: Schema.String,\n\t\tcause: Schema.optional(Schema.Defect),\n\t},\n) {}\n\n/** The per-backend dispatch file was written, but the public router\n * entrypoint did not start serving that route within the readiness\n * budget. This catches Traefik file-provider reload races before the\n * endpoint is surfaced to users. */\nexport class RouteReadinessProbeFailed extends Schema.TaggedErrorClass<RouteReadinessProbeFailed>()(\n\t'RouteReadinessProbeFailed',\n\t{\n\t\tdispatchFileId: Schema.String,\n\t\turl: Schema.String,\n\t\ttimeoutMs: Schema.Number,\n\t\tdetail: Schema.String,\n\t\tcause: Schema.optional(Schema.Defect),\n\t},\n) {}\n\nexport type RouterError =\n\t| UnknownEntrypoint\n\t| EntrypointConflict\n\t| RouterValidationError\n\t| RouteCollision\n\t| UpstreamResolveTimeout\n\t| RouterBootFailed\n\t| RouterDisabledRouteUnsupported\n\t| DispatchWriteFailed\n\t| RouteReadinessProbeFailed;\n"],"mappings":";;;;;;;AAcA,IAAa,oBAAb,cAAuC,OAAO,kBAAqC,CAClF,qBACA;CACC,MAAM,OAAO;CACb,OAAO,OAAO,MAAM,OAAO,OAAO;CAClC,CACD,CAAC;;;;;AAMF,IAAa,qBAAb,cAAwC,OAAO,kBAAsC,CACpF,sBACA;CACC,MAAM,OAAO;CACb,UAAU,OAAO,OAAO;EACvB,MAAM,OAAO;EACb,UAAU,OAAO;EACjB,CAAC;CACF,WAAW,OAAO,OAAO;EACxB,MAAM,OAAO;EACb,UAAU,OAAO;EACjB,CAAC;CACF,CACD,CAAC;;;;;AAMF,IAAa,wBAAb,cAA2C,OAAO,kBAAyC,CAC1F,yBACA;CACC,OAAO,OAAO,SAAS;EAAC;EAAY;EAAc;EAAkB;EAAc,CAAC;CACnF,OAAO,OAAO;CACd,QAAQ,OAAO;CACf,CACD,CAAC;;;;AAKF,IAAa,iBAAb,cAAoC,OAAO,kBAAkC,CAAC,kBAAkB;CAC/F,SAAS,OAAO;CAChB,UAAU,OAAO;CACjB,YAAY,OAAO;CACnB,aAAa,OAAO,MAAM,OAAO,OAAO;CACxC,CAAC,CAAC;AAKyC,OAAO,kBAA0C,CAC5F,0BACA;CACC,YAAY,OAAO;CACnB,cAAc,OAAO,SAAS,CAAC,aAAa,gBAAgB,CAAC;CAC7D,cAAc,OAAO;CACrB,CACD;;;;;AAMD,IAAa,mBAAb,cAAsC,OAAO,kBAAoC,CAChF,oBACA;CACC,OAAO,OAAO,SAAS;EACtB;EACA;EACA;EACA;EACA,CAAC;CACF,QAAQ,OAAO;CACf,OAAO,OAAO,SAAS,OAAO,OAAO;CACrC,CACD,CAAC;;;;;AAMF,IAAa,iCAAb,cAAoD,OAAO,kBAAkD,CAC5G,kCACA;CACC,cAAc,OAAO;CACrB,cAAc,OAAO,SAAS,CAAC,aAAa,gBAAgB,CAAC;CAC7D,QAAQ,OAAO;CACf,CACD,CAAC;;;;;;AAOF,IAAa,sBAAb,cAAyC,OAAO,kBAAuC,CACtF,uBACA;CACC,gBAAgB,OAAO;CACvB,MAAM,OAAO;CACb,QAAQ,OAAO;CACf,OAAO,OAAO,SAAS,OAAO,OAAO;CACrC,CACD,CAAC;;;;;AAMF,IAAa,4BAAb,cAA+C,OAAO,kBAA6C,CAClG,6BACA;CACC,gBAAgB,OAAO;CACvB,KAAK,OAAO;CACZ,WAAW,OAAO;CAClB,QAAQ,OAAO;CACf,OAAO,OAAO,SAAS,OAAO,OAAO;CACrC,CACD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
import { RouteCollision, RouterValidationError } from "./errors.mjs";
|
|
2
|
+
import { dispatchFileId, renderUrl, routerHostname } from "./hostname.mjs";
|
|
3
|
+
import { CORS_MIDDLEWARE_NAME } from "./cors.mjs";
|
|
4
|
+
import { Effect } from "effect";
|
|
5
|
+
//#region src/orchestrators/router/file-provider.ts
|
|
6
|
+
const ROUTE_READINESS_HEADER = "X-Devstack-Route-Id";
|
|
7
|
+
/** Filename within the dispatch directory for a given file-id. The
|
|
8
|
+
* `10-` prefix sorts behind the shared CORS middleware (`00-`) so
|
|
9
|
+
* Traefik picks up the middleware before any router referencing it. */
|
|
10
|
+
const dispatchFilename = (fileId) => `10-${fileId}.yml`;
|
|
11
|
+
/** Resolve a single Routable into a ResolvedRoute. Pure-ish: the only
|
|
12
|
+
* effectful bit is the upstream resolver (which talks to docker /
|
|
13
|
+
* the port broker) and the entrypoint lookup.
|
|
14
|
+
*
|
|
15
|
+
* Takes the registry as a parameter rather than yielding the service
|
|
16
|
+
* tag so the calling orchestrator can pre-bind it once at layer-
|
|
17
|
+
* construction time, keeping the per-Routable hot path free of
|
|
18
|
+
* Context lookups. */
|
|
19
|
+
const resolveRoute = (identity, decl, registry, upstreams) => Effect.gen(function* () {
|
|
20
|
+
const entrypoint = yield* registry.byName(decl.endpointName);
|
|
21
|
+
const hostname = yield* routerHostname(identity, decl.dispatchId.role);
|
|
22
|
+
const fileId = yield* dispatchFileId({
|
|
23
|
+
identity,
|
|
24
|
+
dispatch: decl.dispatchId
|
|
25
|
+
});
|
|
26
|
+
const upstream = decl.upstream.type === "container" ? yield* upstreams.resolveContainer({
|
|
27
|
+
containerName: decl.upstream.containerName,
|
|
28
|
+
containerPort: decl.upstream.containerPort
|
|
29
|
+
}) : yield* upstreams.resolveHostLoopback({ port: decl.upstream.port });
|
|
30
|
+
const wireProtocol = decl.wireProtocol === "tcp" ? "tcp" : decl.wireProtocol === "h2c" ? "h2c" : "http";
|
|
31
|
+
if ((wireProtocol === "tcp" ? "tcp" : "http") !== (entrypoint.protocol === "tcp" ? "tcp" : "http")) return yield* Effect.fail(new RouterValidationError({
|
|
32
|
+
field: "entrypointName",
|
|
33
|
+
value: entrypoint.name,
|
|
34
|
+
detail: `wireProtocol family mismatch: decl is '${wireProtocol}' but entrypoint '${entrypoint.name}' is '${entrypoint.protocol}'`
|
|
35
|
+
}));
|
|
36
|
+
const upstreamUrl = renderUrl({
|
|
37
|
+
protocol: wireProtocol === "tcp" ? "tcp" : "http",
|
|
38
|
+
hostname: upstream.host,
|
|
39
|
+
port: upstream.port
|
|
40
|
+
});
|
|
41
|
+
if (!/^(?:http|tcp):\/\/[A-Za-z0-9_.:-]+:\d+$/.test(upstreamUrl)) return yield* Effect.fail(new RouterValidationError({
|
|
42
|
+
field: "upstreamUrl",
|
|
43
|
+
value: upstreamUrl,
|
|
44
|
+
detail: "expected http://<host>:<port> or tcp://<host>:<port>"
|
|
45
|
+
}));
|
|
46
|
+
const cors = decl.wireProtocol === "tcp" ? false : decl.cors;
|
|
47
|
+
return {
|
|
48
|
+
dispatchFileId: fileId,
|
|
49
|
+
hostname,
|
|
50
|
+
entrypointName: entrypoint.name,
|
|
51
|
+
entrypointPort: entrypoint.port,
|
|
52
|
+
upstreamUrl,
|
|
53
|
+
cors,
|
|
54
|
+
wireProtocol
|
|
55
|
+
};
|
|
56
|
+
});
|
|
57
|
+
/** Pull host+port out of an `<scheme>://<host>:<port>` URL. Used by the
|
|
58
|
+
* TCP renderer to write the `address:` field. Safe because
|
|
59
|
+
* `resolveRoute` validates the URL shape before we get here. */
|
|
60
|
+
const splitUpstream = (url) => {
|
|
61
|
+
const stripped = url.replace(/^(?:http|tcp):\/\//, "");
|
|
62
|
+
const lastColon = stripped.lastIndexOf(":");
|
|
63
|
+
return {
|
|
64
|
+
host: stripped.slice(0, lastColon),
|
|
65
|
+
port: stripped.slice(lastColon + 1)
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
const renderLeaseHeader = (lease) => [
|
|
69
|
+
`# routeLeaseVersion: ${lease.version}`,
|
|
70
|
+
`# routerProfileId: ${lease.routerProfileId}`,
|
|
71
|
+
`# ownerApp: ${lease.app}`,
|
|
72
|
+
`# ownerStack: ${lease.stack}`,
|
|
73
|
+
`# ownerPid: ${lease.owner.pid}`,
|
|
74
|
+
`# ownerStartTime: ${lease.owner.startTime}`,
|
|
75
|
+
`# ownerHostname: ${lease.owner.hostname}`,
|
|
76
|
+
`# ownerClaimedAt: ${lease.owner.claimedAt}`,
|
|
77
|
+
`# ownerHeartbeatAt: ${lease.owner.heartbeatAt}`,
|
|
78
|
+
`# ownerIntent: ${lease.owner.intent}`
|
|
79
|
+
];
|
|
80
|
+
/** Render the YAML body for a single resolved route. Hand-rolled
|
|
81
|
+
* (same rationale as `cors.ts`): static, controlled, byte-stable so
|
|
82
|
+
* no-op rewrites don't wake the watcher. */
|
|
83
|
+
const renderRouteYaml = (route, lease) => {
|
|
84
|
+
if (route.wireProtocol === "tcp") return renderTcpRouteYaml(route, lease);
|
|
85
|
+
return renderHttpRouteYaml(route, lease);
|
|
86
|
+
};
|
|
87
|
+
const routeReadinessMiddlewareName = (route) => `${route.dispatchFileId}-route-ready`;
|
|
88
|
+
const renderHttpRouteYaml = (route, lease) => {
|
|
89
|
+
const middlewares = [routeReadinessMiddlewareName(route), ...route.cors ? [CORS_MIDDLEWARE_NAME] : []];
|
|
90
|
+
const schemeHint = route.wireProtocol === "h2c" ? ` # h2c upstream — gRPC-friendly cleartext HTTP/2.\n` : "";
|
|
91
|
+
return [
|
|
92
|
+
`# Auto-generated by devstack router orchestrator. Do not edit by hand.`,
|
|
93
|
+
`# dispatchFileId: ${route.dispatchFileId}`,
|
|
94
|
+
`# wireProtocol: ${route.wireProtocol}`,
|
|
95
|
+
`# entrypointName: ${route.entrypointName}`,
|
|
96
|
+
`# entrypointPort: ${route.entrypointPort}`,
|
|
97
|
+
`# hostname: ${route.hostname}`,
|
|
98
|
+
...renderLeaseHeader(lease),
|
|
99
|
+
`http:`,
|
|
100
|
+
` routers:`,
|
|
101
|
+
` ${route.dispatchFileId}-router:`,
|
|
102
|
+
` rule: "Host(\`${route.hostname}\`)"`,
|
|
103
|
+
` entryPoints: ["${route.entrypointName}"]`,
|
|
104
|
+
` service: "${route.dispatchFileId}-svc"`,
|
|
105
|
+
` middlewares: [${middlewares.map((name) => `"${name}"`).join(", ")}]`,
|
|
106
|
+
` middlewares:`,
|
|
107
|
+
` ${routeReadinessMiddlewareName(route)}:`,
|
|
108
|
+
` headers:`,
|
|
109
|
+
` customResponseHeaders:`,
|
|
110
|
+
` ${ROUTE_READINESS_HEADER}: "${route.dispatchFileId}"`,
|
|
111
|
+
` services:`,
|
|
112
|
+
` ${route.dispatchFileId}-svc:`,
|
|
113
|
+
` loadBalancer:`,
|
|
114
|
+
schemeHint.length > 0 ? schemeHint.trimEnd() : null,
|
|
115
|
+
` servers:`,
|
|
116
|
+
` - url: "${route.upstreamUrl}"`,
|
|
117
|
+
``
|
|
118
|
+
].filter((line) => line !== null).join("\n");
|
|
119
|
+
};
|
|
120
|
+
const renderTcpRouteYaml = (route, lease) => {
|
|
121
|
+
const { host, port } = splitUpstream(route.upstreamUrl);
|
|
122
|
+
return [
|
|
123
|
+
`# Auto-generated by devstack router orchestrator. Do not edit by hand.`,
|
|
124
|
+
`# dispatchFileId: ${route.dispatchFileId}`,
|
|
125
|
+
`# wireProtocol: tcp`,
|
|
126
|
+
`# entrypointName: ${route.entrypointName}`,
|
|
127
|
+
`# entrypointPort: ${route.entrypointPort}`,
|
|
128
|
+
`# hostname: ${route.hostname}`,
|
|
129
|
+
`# tcpDispatch: entrypoint-port dispatch; HostSNI wildcard`,
|
|
130
|
+
...renderLeaseHeader(lease),
|
|
131
|
+
`tcp:`,
|
|
132
|
+
` routers:`,
|
|
133
|
+
` ${route.dispatchFileId}-router:`,
|
|
134
|
+
` rule: "HostSNI(\`*\`)"`,
|
|
135
|
+
` entryPoints: ["${route.entrypointName}"]`,
|
|
136
|
+
` service: "${route.dispatchFileId}-svc"`,
|
|
137
|
+
` services:`,
|
|
138
|
+
` ${route.dispatchFileId}-svc:`,
|
|
139
|
+
` loadBalancer:`,
|
|
140
|
+
` servers:`,
|
|
141
|
+
` - address: "${host}:${port}"`,
|
|
142
|
+
``
|
|
143
|
+
].join("\n");
|
|
144
|
+
};
|
|
145
|
+
const dispatchFileIdFromFilename = (filename) => {
|
|
146
|
+
return /^10-(.+)\.yml$/.exec(filename)?.[1] ?? null;
|
|
147
|
+
};
|
|
148
|
+
const commentValue = (body, key) => {
|
|
149
|
+
const escaped = key.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
150
|
+
return new RegExp(`^# ${escaped}: (.*)$`, "m").exec(body)?.[1]?.trim() ?? null;
|
|
151
|
+
};
|
|
152
|
+
const matchValue = (body, pattern) => pattern.exec(body)?.[1]?.trim() ?? null;
|
|
153
|
+
const commentNumber = (body, key) => {
|
|
154
|
+
const raw = commentValue(body, key);
|
|
155
|
+
if (raw === null || !/^\d+$/.test(raw)) return null;
|
|
156
|
+
return Number.parseInt(raw, 10);
|
|
157
|
+
};
|
|
158
|
+
const parseWireProtocol = (body) => {
|
|
159
|
+
const fromComment = commentValue(body, "wireProtocol");
|
|
160
|
+
if (fromComment === "http" || fromComment === "h2c" || fromComment === "tcp") return fromComment;
|
|
161
|
+
if (/^tcp:/m.test(body)) return "tcp";
|
|
162
|
+
if (/^http:/m.test(body)) return "http";
|
|
163
|
+
return null;
|
|
164
|
+
};
|
|
165
|
+
const hasRouteLeaseMetadata = (body) => [
|
|
166
|
+
"routeLeaseVersion",
|
|
167
|
+
"routerProfileId",
|
|
168
|
+
"ownerApp",
|
|
169
|
+
"ownerStack",
|
|
170
|
+
"ownerPid",
|
|
171
|
+
"ownerStartTime",
|
|
172
|
+
"ownerHostname",
|
|
173
|
+
"ownerClaimedAt",
|
|
174
|
+
"ownerHeartbeatAt",
|
|
175
|
+
"ownerIntent"
|
|
176
|
+
].some((key) => commentValue(body, key) !== null);
|
|
177
|
+
const parseRouteLeaseMetadata = (body, dispatchFileId) => {
|
|
178
|
+
if (!hasRouteLeaseMetadata(body)) return {
|
|
179
|
+
lease: null,
|
|
180
|
+
diagnostic: null
|
|
181
|
+
};
|
|
182
|
+
const rawVersion = commentValue(body, "routeLeaseVersion");
|
|
183
|
+
const version = commentNumber(body, "routeLeaseVersion");
|
|
184
|
+
const routerProfileId = commentValue(body, "routerProfileId");
|
|
185
|
+
const app = commentValue(body, "ownerApp");
|
|
186
|
+
const stack = commentValue(body, "ownerStack");
|
|
187
|
+
const pid = commentNumber(body, "ownerPid");
|
|
188
|
+
const startTime = commentNumber(body, "ownerStartTime");
|
|
189
|
+
const hostname = commentValue(body, "ownerHostname");
|
|
190
|
+
const claimedAt = commentNumber(body, "ownerClaimedAt");
|
|
191
|
+
const heartbeatAt = commentNumber(body, "ownerHeartbeatAt");
|
|
192
|
+
const intent = commentValue(body, "ownerIntent");
|
|
193
|
+
if (version !== 1) return {
|
|
194
|
+
lease: null,
|
|
195
|
+
diagnostic: {
|
|
196
|
+
_tag: "DispatchRouteDecodeDiagnostic",
|
|
197
|
+
dispatchFileId,
|
|
198
|
+
reason: "unknown-route-lease-version",
|
|
199
|
+
detail: `expected routeLeaseVersion 1, got ${rawVersion ?? "<missing>"}`
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
if (routerProfileId === null || app === null || stack === null || pid === null || startTime === null || hostname === null || claimedAt === null || heartbeatAt === null || intent !== "normal" && intent !== "snapshot") return {
|
|
203
|
+
lease: null,
|
|
204
|
+
diagnostic: {
|
|
205
|
+
_tag: "DispatchRouteDecodeDiagnostic",
|
|
206
|
+
dispatchFileId,
|
|
207
|
+
reason: "invalid-route-lease-metadata",
|
|
208
|
+
detail: "route lease metadata is incomplete or malformed"
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
return {
|
|
212
|
+
lease: {
|
|
213
|
+
version: 1,
|
|
214
|
+
routerProfileId,
|
|
215
|
+
app,
|
|
216
|
+
stack,
|
|
217
|
+
owner: {
|
|
218
|
+
pid,
|
|
219
|
+
startTime,
|
|
220
|
+
hostname,
|
|
221
|
+
claimedAt,
|
|
222
|
+
heartbeatAt,
|
|
223
|
+
intent
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
diagnostic: null
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
const parseDispatchRouteFile = (body, fallbackDispatchFileId = null) => {
|
|
230
|
+
const dispatchFileId = commentValue(body, "dispatchFileId") ?? fallbackDispatchFileId;
|
|
231
|
+
const wireProtocol = parseWireProtocol(body);
|
|
232
|
+
const entrypointName = commentValue(body, "entrypointName") ?? matchValue(body, /entryPoints: \["([^"]+)"\]/);
|
|
233
|
+
const hostname = commentValue(body, "hostname") ?? matchValue(body, /Host\(`([^`]+)`\)/) ?? (wireProtocol === "tcp" ? "" : null);
|
|
234
|
+
const portRaw = commentValue(body, "entrypointPort");
|
|
235
|
+
const entrypointPort = portRaw === null || !/^\d+$/.test(portRaw) ? null : Number.parseInt(portRaw, 10);
|
|
236
|
+
if (dispatchFileId === null || wireProtocol === null || entrypointName === null || hostname === null) {
|
|
237
|
+
const protectedDispatchFileId = dispatchFileId ?? "<unknown>";
|
|
238
|
+
return {
|
|
239
|
+
_tag: "invalid",
|
|
240
|
+
dispatchFileId: protectedDispatchFileId,
|
|
241
|
+
diagnostics: [{
|
|
242
|
+
_tag: "DispatchRouteDecodeDiagnostic",
|
|
243
|
+
dispatchFileId: protectedDispatchFileId,
|
|
244
|
+
reason: "missing-required-route-metadata",
|
|
245
|
+
detail: "route file is missing dispatchFileId, wireProtocol/http|tcp block, entrypointName, or hostname metadata"
|
|
246
|
+
}]
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
const leaseResult = parseRouteLeaseMetadata(body, dispatchFileId);
|
|
250
|
+
return {
|
|
251
|
+
_tag: "valid",
|
|
252
|
+
route: {
|
|
253
|
+
dispatchFileId,
|
|
254
|
+
hostname,
|
|
255
|
+
entrypointName,
|
|
256
|
+
entrypointPort,
|
|
257
|
+
wireProtocol,
|
|
258
|
+
lease: leaseResult.lease
|
|
259
|
+
},
|
|
260
|
+
diagnostics: leaseResult.diagnostic === null ? [] : [leaseResult.diagnostic]
|
|
261
|
+
};
|
|
262
|
+
};
|
|
263
|
+
/** Assert no two resolved routes share dispatch keys.
|
|
264
|
+
*
|
|
265
|
+
* - HTTP routes collide on `(entrypoint, hostname)` — two HTTP backends
|
|
266
|
+
* on the same entrypoint port can coexist via different Host headers,
|
|
267
|
+
* so the Host *is* part of the key.
|
|
268
|
+
* - TCP routes collide on `entrypoint` alone — TCP has no Host header,
|
|
269
|
+
* so an entrypoint can serve exactly ONE backend. Two TCP decls on
|
|
270
|
+
* the same entrypoint are an unambiguous error (parallel stacks of
|
|
271
|
+
* a TCP service share the host port and would clobber each other).
|
|
272
|
+
*
|
|
273
|
+
* Architecture invariant #7 — distinct identity → distinct dispatch
|
|
274
|
+
* URL. The TCP arm is the new clause; HTTP arm unchanged. */
|
|
275
|
+
const detectCollisions = (routes) => {
|
|
276
|
+
const seen = /* @__PURE__ */ new Map();
|
|
277
|
+
for (const r of routes) {
|
|
278
|
+
const portKey = r.entrypointPort === null ? `entrypoint:${r.entrypointName}` : `port:${r.entrypointPort}`;
|
|
279
|
+
const key = r.wireProtocol === "tcp" ? `tcp@${portKey}` : `http@${portKey}@${r.hostname}`;
|
|
280
|
+
const acc = seen.get(key);
|
|
281
|
+
if (acc) acc.push(r);
|
|
282
|
+
else seen.set(key, [r]);
|
|
283
|
+
}
|
|
284
|
+
for (const [key, colliding] of seen) if (colliding.length > 1) {
|
|
285
|
+
const ids = colliding.map((route) => route.dispatchFileId);
|
|
286
|
+
const first = colliding[0];
|
|
287
|
+
if (key.startsWith("tcp@")) return new RouteCollision({
|
|
288
|
+
message: routeCollisionMessage({
|
|
289
|
+
hostname: "",
|
|
290
|
+
entrypoint: first?.entrypointName ?? "",
|
|
291
|
+
dispatchIds: ids,
|
|
292
|
+
wireProtocol: "tcp"
|
|
293
|
+
}),
|
|
294
|
+
hostname: "",
|
|
295
|
+
entrypoint: first?.entrypointName ?? "",
|
|
296
|
+
dispatchIds: ids
|
|
297
|
+
});
|
|
298
|
+
return new RouteCollision({
|
|
299
|
+
message: routeCollisionMessage({
|
|
300
|
+
hostname: first?.hostname ?? "",
|
|
301
|
+
entrypoint: first?.entrypointName ?? "",
|
|
302
|
+
dispatchIds: ids,
|
|
303
|
+
wireProtocol: "http"
|
|
304
|
+
}),
|
|
305
|
+
hostname: first?.hostname ?? "",
|
|
306
|
+
entrypoint: first?.entrypointName ?? "",
|
|
307
|
+
dispatchIds: ids
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
return null;
|
|
311
|
+
};
|
|
312
|
+
const routeCollisionMessage = (collision) => {
|
|
313
|
+
const ids = collision.dispatchIds.join(", ");
|
|
314
|
+
if (collision.wireProtocol === "tcp") return `router TCP route collision on entrypoint '${collision.entrypoint}' for dispatch ids: ${ids}`;
|
|
315
|
+
return `router route collision on entrypoint '${collision.entrypoint}' and hostname '${collision.hostname}' for dispatch ids: ${ids}`;
|
|
316
|
+
};
|
|
317
|
+
//#endregion
|
|
318
|
+
export { ROUTE_READINESS_HEADER, detectCollisions, dispatchFileIdFromFilename, dispatchFilename, parseDispatchRouteFile, renderRouteYaml, resolveRoute };
|
|
319
|
+
|
|
320
|
+
//# sourceMappingURL=file-provider.mjs.map
|