@mysten-incubation/devstack 0.0.1 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -4
- package/dashboard-ui/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
- package/dashboard-ui/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
- package/dashboard-ui/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
- package/dashboard-ui/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
- package/dashboard-ui/assets/geist-mono-cyrillic-ext-wght-normal-I4S5GZfc.woff2 +0 -0
- package/dashboard-ui/assets/geist-mono-cyrillic-wght-normal-BmXc_FBt.woff2 +0 -0
- package/dashboard-ui/assets/geist-mono-latin-ext-wght-normal-DrnZ1wKl.woff2 +0 -0
- package/dashboard-ui/assets/geist-mono-latin-wght-normal-B_7UjwxQ.woff2 +0 -0
- package/dashboard-ui/assets/geist-mono-symbols2-wght-normal-GZpp1pK2.woff2 +0 -0
- package/dashboard-ui/assets/geist-mono-vietnamese-wght-normal-D8KDMBhC.woff2 +0 -0
- package/dashboard-ui/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
- package/dashboard-ui/assets/index-Bmi1UtAg.js +1356 -0
- package/dashboard-ui/assets/index-D5EShVt4.js +3 -0
- package/dashboard-ui/assets/index-Deml9drg.css +1 -0
- package/dashboard-ui/index.html +13 -0
- package/dist/api/define-capabilities.d.mts +14 -3
- package/dist/api/define-capabilities.mjs +18 -1
- package/dist/api/define-capabilities.mjs.map +1 -1
- package/dist/api/define-devstack.d.mts +1 -1
- package/dist/api/define-devstack.mjs +6 -26
- package/dist/api/define-devstack.mjs.map +1 -1
- package/dist/api/define-plugin.d.mts +1 -0
- package/dist/api/define-plugin.mjs +2 -0
- package/dist/api/inference-network.d.mts +132 -0
- package/dist/api/inference-network.mjs +105 -16
- package/dist/api/inference-network.mjs.map +1 -1
- package/dist/api/plugin-errors.d.mts +7 -0
- package/dist/api/run-stack.d.mts +20 -9
- package/dist/api/run-stack.mjs +56 -29
- package/dist/api/run-stack.mjs.map +1 -1
- package/dist/build-integrations/playwright/config.d.mts +6 -4
- package/dist/build-integrations/playwright/config.mjs +5 -3
- package/dist/build-integrations/playwright/config.mjs.map +1 -1
- package/dist/build-integrations/playwright/errors.d.mts +1 -1
- package/dist/build-integrations/playwright/global-setup.d.mts +43 -17
- package/dist/build-integrations/playwright/global-setup.mjs +250 -13
- package/dist/build-integrations/playwright/global-setup.mjs.map +1 -1
- package/dist/build-integrations/playwright/index.d.mts +5 -3
- package/dist/build-integrations/playwright/index.mjs +4 -2
- package/dist/build-integrations/playwright/stack-context.d.mts +0 -1
- package/dist/build-integrations/playwright/stack-context.mjs +24 -63
- package/dist/build-integrations/playwright/stack-context.mjs.map +1 -1
- package/dist/build-integrations/playwright/wallet-context.d.mts +7 -10
- package/dist/build-integrations/playwright/wallet-context.mjs +8 -13
- package/dist/build-integrations/playwright/wallet-context.mjs.map +1 -1
- package/dist/build-integrations/runtime/cold-start-url.d.mts +5 -0
- package/dist/build-integrations/runtime/cold-start-url.mjs +4 -3
- package/dist/build-integrations/runtime/cold-start-url.mjs.map +1 -1
- package/dist/build-integrations/runtime/conventional-routes.d.mts +51 -0
- package/dist/build-integrations/runtime/conventional-routes.mjs +92 -0
- package/dist/build-integrations/runtime/conventional-routes.mjs.map +1 -0
- package/dist/build-integrations/runtime/discover.d.mts +38 -30
- package/dist/build-integrations/runtime/discover.mjs +73 -70
- package/dist/build-integrations/runtime/discover.mjs.map +1 -1
- package/dist/build-integrations/runtime/endpoint-registry.d.mts +3 -1
- package/dist/build-integrations/runtime/endpoint-registry.mjs +3 -1
- package/dist/build-integrations/runtime/endpoint-registry.mjs.map +1 -1
- package/dist/build-integrations/runtime/index.d.mts +7 -2
- package/dist/build-integrations/runtime/index.mjs +9 -2
- package/dist/build-integrations/runtime/manifest-types.d.mts +2 -0
- package/dist/build-integrations/runtime/manifest-types.mjs +3 -0
- package/dist/build-integrations/runtime/playwright-stack-context-slot.d.mts +29 -0
- package/dist/build-integrations/runtime/playwright-stack-context-slot.mjs +10 -0
- package/dist/build-integrations/runtime/playwright-stack-context-slot.mjs.map +1 -0
- package/dist/build-integrations/runtime/read-stack-context.d.mts +1 -1
- package/dist/build-integrations/runtime/read-stack-context.mjs +10 -4
- package/dist/build-integrations/runtime/read-stack-context.mjs.map +1 -1
- package/dist/build-integrations/runtime/resolve-discovery-env.d.mts +48 -0
- package/dist/build-integrations/runtime/resolve-discovery-env.mjs +42 -0
- package/dist/build-integrations/runtime/resolve-discovery-env.mjs.map +1 -0
- package/dist/build-integrations/runtime/stack-context.d.mts +1 -1
- package/dist/build-integrations/runtime/wallet-paths.mjs +2 -0
- package/dist/build-integrations/vite/index.d.mts +51 -0
- package/dist/build-integrations/vite/index.mjs +73 -0
- package/dist/build-integrations/vite/index.mjs.map +1 -0
- package/dist/build-integrations/vitest/env.d.mts +4 -3
- package/dist/build-integrations/vitest/env.mjs +6 -4
- package/dist/build-integrations/vitest/env.mjs.map +1 -1
- package/dist/build-integrations/vitest/errors.d.mts +25 -4
- package/dist/build-integrations/vitest/errors.mjs +15 -2
- package/dist/build-integrations/vitest/errors.mjs.map +1 -1
- package/dist/build-integrations/vitest/index.d.mts +2 -2
- package/dist/build-integrations/vitest/index.mjs +3 -3
- package/dist/build-integrations/vitest/setup.d.mts +4 -2
- package/dist/build-integrations/vitest/setup.mjs +2 -2
- package/dist/build-integrations/vitest/setup.mjs.map +1 -1
- package/dist/build-integrations/vitest/stack-context.d.mts +0 -1
- package/dist/build-integrations/vitest/stack-context.mjs +33 -13
- package/dist/build-integrations/vitest/stack-context.mjs.map +1 -1
- package/dist/cli/bail.mjs +23 -0
- package/dist/cli/bail.mjs.map +1 -0
- package/dist/{surfaces/cli/commands → cli}/doctor-probes.mjs +26 -16
- package/dist/cli/doctor-probes.mjs.map +1 -0
- package/dist/cli/main.d.mts +15 -1
- package/dist/cli/main.mjs +166 -482
- package/dist/cli/main.mjs.map +1 -1
- package/dist/cli/prune-direct.mjs +31 -201
- package/dist/cli/prune-direct.mjs.map +1 -1
- package/dist/cli/snapshot-reader.mjs +14 -11
- package/dist/cli/snapshot-reader.mjs.map +1 -1
- package/dist/cli/up-lifecycle.mjs +4 -1
- package/dist/cli/up-lifecycle.mjs.map +1 -1
- package/dist/cli/wirings/apply.mjs +95 -0
- package/dist/cli/wirings/apply.mjs.map +1 -0
- package/dist/cli/wirings/build-verb-layers.mjs +42 -0
- package/dist/cli/wirings/build-verb-layers.mjs.map +1 -0
- package/dist/cli/wirings/config-loader.mjs +69 -0
- package/dist/cli/wirings/config-loader.mjs.map +1 -0
- package/dist/cli/wirings/engine-command.mjs +30 -0
- package/dist/cli/wirings/engine-command.mjs.map +1 -0
- package/dist/cli/wirings/identity.mjs +72 -0
- package/dist/cli/wirings/identity.mjs.map +1 -0
- package/dist/cli/wirings/provide-file-system.mjs +7 -0
- package/dist/cli/wirings/provide-file-system.mjs.map +1 -0
- package/dist/cli/wirings/snapshot.mjs +177 -0
- package/dist/cli/wirings/snapshot.mjs.map +1 -0
- package/dist/cli/wirings/up.mjs +287 -0
- package/dist/cli/wirings/up.mjs.map +1 -0
- package/dist/cli/wirings/wipe.mjs +40 -0
- package/dist/cli/wirings/wipe.mjs.map +1 -0
- package/dist/contracts/capability-decl.d.mts +0 -2
- package/dist/contracts/codegenable.d.mts +43 -0
- package/dist/contracts/container-runtime.d.mts +26 -1
- package/dist/contracts/faucet-strategy.d.mts +25 -0
- package/dist/contracts/funding-strategy.d.mts +42 -0
- package/dist/contracts/plugin-expander.mjs +60 -0
- package/dist/contracts/plugin-expander.mjs.map +1 -0
- package/dist/contracts/projection.d.mts +5 -3
- package/dist/contracts/renderer.d.mts +23 -0
- package/dist/contracts/routable.d.mts +14 -1
- package/dist/contracts/snapshotable.d.mts +25 -3
- package/dist/contracts/wallet-protocol.d.mts +52 -0
- package/dist/contracts/wallet-protocol.mjs +52 -0
- package/dist/contracts/wallet-protocol.mjs.map +1 -0
- package/dist/index.d.mts +26 -25
- package/dist/index.mjs +20 -13
- package/dist/{runtime → orchestrators}/built-in-plugin-layers.mjs +10 -5
- package/dist/orchestrators/built-in-plugin-layers.mjs.map +1 -0
- package/dist/orchestrators/codegen/bindings.d.mts +1 -2
- package/dist/orchestrators/codegen/bindings.mjs +52 -186
- package/dist/orchestrators/codegen/bindings.mjs.map +1 -1
- package/dist/orchestrators/codegen/emit.mjs +19 -1
- package/dist/orchestrators/codegen/emit.mjs.map +1 -1
- package/dist/orchestrators/codegen/errors.mjs +8 -3
- package/dist/orchestrators/codegen/errors.mjs.map +1 -1
- package/dist/orchestrators/codegen/format.mjs +47 -39
- package/dist/orchestrators/codegen/format.mjs.map +1 -1
- package/dist/orchestrators/codegen/gitignore.mjs +3 -1
- package/dist/orchestrators/codegen/gitignore.mjs.map +1 -1
- package/dist/orchestrators/codegen/output-location.mjs +41 -0
- package/dist/orchestrators/codegen/output-location.mjs.map +1 -0
- package/dist/orchestrators/codegen/paths.d.mts +1 -1
- package/dist/orchestrators/codegen/paths.mjs +40 -14
- package/dist/orchestrators/codegen/paths.mjs.map +1 -1
- package/dist/orchestrators/codegen/permissions.mjs +3 -1
- package/dist/orchestrators/codegen/permissions.mjs.map +1 -1
- package/dist/orchestrators/codegen/service.mjs +157 -105
- package/dist/orchestrators/codegen/service.mjs.map +1 -1
- package/dist/orchestrators/lifecycle-prune/errors.mjs +31 -0
- package/dist/orchestrators/lifecycle-prune/errors.mjs.map +1 -0
- package/dist/orchestrators/lifecycle-prune/index.mjs +350 -0
- package/dist/orchestrators/lifecycle-prune/index.mjs.map +1 -0
- package/dist/orchestrators/router/cleanup.mjs +26 -27
- package/dist/orchestrators/router/cleanup.mjs.map +1 -1
- package/dist/orchestrators/router/entrypoints.mjs +2 -2
- package/dist/orchestrators/router/entrypoints.mjs.map +1 -1
- package/dist/orchestrators/router/file-provider.mjs +14 -5
- package/dist/orchestrators/router/file-provider.mjs.map +1 -1
- package/dist/orchestrators/router/hostname.mjs +19 -55
- package/dist/orchestrators/router/hostname.mjs.map +1 -1
- package/dist/orchestrators/router/index.mjs +11 -0
- package/dist/orchestrators/router/profile.mjs +2 -2
- package/dist/orchestrators/router/sentinels.mjs +26 -0
- package/dist/orchestrators/router/sentinels.mjs.map +1 -0
- package/dist/orchestrators/router/service.mjs +40 -37
- package/dist/orchestrators/router/service.mjs.map +1 -1
- package/dist/orchestrators/router/traefik-container.mjs +27 -16
- package/dist/orchestrators/router/traefik-container.mjs.map +1 -1
- package/dist/{substrate/runtime → orchestrators}/run.mjs +26 -21
- package/dist/orchestrators/run.mjs.map +1 -0
- package/dist/orchestrators/runtime-composition.d.mts +1 -1
- package/dist/orchestrators/runtime-composition.mjs +123 -39
- package/dist/orchestrators/runtime-composition.mjs.map +1 -1
- package/dist/orchestrators/snapshot/capture-command.d.mts +1 -0
- package/dist/orchestrators/snapshot/capture-command.mjs +25 -0
- package/dist/orchestrators/snapshot/capture-command.mjs.map +1 -0
- package/dist/orchestrators/snapshot/capture.mjs +42 -28
- package/dist/orchestrators/snapshot/capture.mjs.map +1 -1
- package/dist/orchestrators/snapshot/descriptor.mjs +35 -10
- package/dist/orchestrators/snapshot/descriptor.mjs.map +1 -1
- package/dist/orchestrators/snapshot/identity-guard.mjs +1 -1
- package/dist/orchestrators/snapshot/index.mjs +13 -0
- package/dist/orchestrators/snapshot/integrity.d.mts +1 -1
- package/dist/orchestrators/snapshot/integrity.mjs +73 -17
- package/dist/orchestrators/snapshot/integrity.mjs.map +1 -1
- package/dist/orchestrators/snapshot/pending-marker.d.mts +1 -0
- package/dist/orchestrators/snapshot/pending-marker.mjs +99 -0
- package/dist/orchestrators/snapshot/pending-marker.mjs.map +1 -0
- package/dist/orchestrators/snapshot/phase-error.mjs +23 -0
- package/dist/orchestrators/snapshot/phase-error.mjs.map +1 -0
- package/dist/orchestrators/snapshot/prune.mjs +20 -55
- package/dist/orchestrators/snapshot/prune.mjs.map +1 -1
- package/dist/orchestrators/snapshot/recover-pending.d.mts +1 -0
- package/dist/orchestrators/snapshot/recover-pending.mjs +223 -0
- package/dist/orchestrators/snapshot/recover-pending.mjs.map +1 -0
- package/dist/orchestrators/snapshot/restore.mjs +118 -84
- package/dist/orchestrators/snapshot/restore.mjs.map +1 -1
- package/dist/orchestrators/snapshot/service.mjs +53 -56
- package/dist/orchestrators/snapshot/service.mjs.map +1 -1
- package/dist/orchestrators/snapshot/state-document.d.mts +1 -0
- package/dist/orchestrators/snapshot/state-document.mjs +47 -7
- package/dist/orchestrators/snapshot/state-document.mjs.map +1 -1
- package/dist/orchestrators/snapshot/wipe.mjs +67 -10
- package/dist/orchestrators/snapshot/wipe.mjs.map +1 -1
- package/dist/plugins/account/codegen.mjs +9 -8
- package/dist/plugins/account/codegen.mjs.map +1 -1
- package/dist/plugins/account/errors.d.mts +33 -6
- package/dist/plugins/account/errors.mjs.map +1 -1
- package/dist/plugins/account/funding.d.mts +29 -19
- package/dist/plugins/account/funding.mjs +84 -66
- package/dist/plugins/account/funding.mjs.map +1 -1
- package/dist/plugins/account/index.d.mts +2 -4
- package/dist/plugins/account/index.mjs +64 -31
- package/dist/plugins/account/index.mjs.map +1 -1
- package/dist/plugins/account/keypair.mjs +6 -9
- package/dist/plugins/account/keypair.mjs.map +1 -1
- package/dist/plugins/account/lease.mjs +1 -0
- package/dist/plugins/account/lease.mjs.map +1 -1
- package/dist/plugins/account/registry.d.mts +14 -1
- package/dist/plugins/account/registry.mjs +18 -18
- package/dist/plugins/account/registry.mjs.map +1 -1
- package/dist/plugins/account/service.d.mts +23 -4
- package/dist/plugins/account/service.mjs +83 -45
- package/dist/plugins/account/service.mjs.map +1 -1
- package/dist/plugins/account/snapshot.mjs +2 -5
- package/dist/plugins/account/snapshot.mjs.map +1 -1
- package/dist/plugins/account/spans.mjs +16 -0
- package/dist/plugins/account/spans.mjs.map +1 -0
- package/dist/plugins/account/variants/keystore.mjs +6 -8
- package/dist/plugins/account/variants/keystore.mjs.map +1 -1
- package/dist/plugins/action/build-context.d.mts +3 -2
- package/dist/plugins/action/errors.d.mts +16 -12
- package/dist/plugins/action/errors.mjs.map +1 -1
- package/dist/plugins/action/execute.mjs +65 -103
- package/dist/plugins/action/execute.mjs.map +1 -1
- package/dist/plugins/action/index.d.mts +0 -2
- package/dist/plugins/action/index.mjs +17 -13
- package/dist/plugins/action/index.mjs.map +1 -1
- package/dist/plugins/action/service.mjs +38 -35
- package/dist/plugins/action/service.mjs.map +1 -1
- package/dist/plugins/action/spans.mjs +11 -0
- package/dist/plugins/action/spans.mjs.map +1 -0
- package/dist/plugins/coin/codegen.mjs +9 -8
- package/dist/plugins/coin/codegen.mjs.map +1 -1
- package/dist/plugins/coin/discovery.mjs +8 -4
- package/dist/plugins/coin/discovery.mjs.map +1 -1
- package/dist/plugins/coin/index.d.mts +11 -29
- package/dist/plugins/coin/index.mjs +56 -27
- package/dist/plugins/coin/index.mjs.map +1 -1
- package/dist/plugins/coin/metadata.mjs +8 -15
- package/dist/plugins/coin/metadata.mjs.map +1 -1
- package/dist/plugins/coin/mint.d.mts +30 -11
- package/dist/plugins/coin/mint.mjs +78 -74
- package/dist/plugins/coin/mint.mjs.map +1 -1
- package/dist/plugins/coin/registry.mjs +4 -7
- package/dist/plugins/coin/registry.mjs.map +1 -1
- package/dist/plugins/coin/service.d.mts +39 -1
- package/dist/plugins/coin/service.mjs +11 -4
- package/dist/plugins/coin/service.mjs.map +1 -1
- package/dist/plugins/coin/spans.mjs +20 -0
- package/dist/plugins/coin/spans.mjs.map +1 -0
- package/dist/plugins/dashboard/domain.mjs +402 -0
- package/dist/plugins/dashboard/domain.mjs.map +1 -0
- package/dist/plugins/dashboard/index.d.mts +29 -0
- package/dist/plugins/dashboard/index.mjs +91 -0
- package/dist/plugins/dashboard/index.mjs.map +1 -0
- package/dist/plugins/dashboard/origin-policy.mjs +36 -0
- package/dist/plugins/dashboard/origin-policy.mjs.map +1 -0
- package/dist/plugins/dashboard/routable.mjs +27 -0
- package/dist/plugins/dashboard/routable.mjs.map +1 -0
- package/dist/plugins/dashboard/schema/builder.mjs +21 -0
- package/dist/plugins/dashboard/schema/builder.mjs.map +1 -0
- package/dist/plugins/dashboard/schema/enums.mjs +72 -0
- package/dist/plugins/dashboard/schema/enums.mjs.map +1 -0
- package/dist/plugins/dashboard/schema/root.mjs +351 -0
- package/dist/plugins/dashboard/schema/root.mjs.map +1 -0
- package/dist/plugins/dashboard/schema/types.mjs +508 -0
- package/dist/plugins/dashboard/schema/types.mjs.map +1 -0
- package/dist/plugins/dashboard/schema.mjs +11 -0
- package/dist/plugins/dashboard/schema.mjs.map +1 -0
- package/dist/plugins/dashboard/server.mjs +166 -0
- package/dist/plugins/dashboard/server.mjs.map +1 -0
- package/dist/plugins/deepbook/deploy.mjs +53 -115
- package/dist/plugins/deepbook/deploy.mjs.map +1 -1
- package/dist/plugins/deepbook/errors.mjs +1 -0
- package/dist/plugins/deepbook/errors.mjs.map +1 -1
- package/dist/plugins/deepbook/faucet-strategy.mjs +47 -34
- package/dist/plugins/deepbook/faucet-strategy.mjs.map +1 -1
- package/dist/plugins/deepbook/hash.mjs +9 -0
- package/dist/plugins/deepbook/hash.mjs.map +1 -0
- package/dist/plugins/deepbook/index.d.mts +1 -10
- package/dist/plugins/deepbook/index.mjs +25 -22
- package/dist/plugins/deepbook/index.mjs.map +1 -1
- package/dist/plugins/deepbook/pyth/index.mjs +26 -55
- package/dist/plugins/deepbook/pyth/index.mjs.map +1 -1
- package/dist/plugins/deepbook/snapshot.mjs +17 -29
- package/dist/plugins/deepbook/snapshot.mjs.map +1 -1
- package/dist/plugins/deepbook/spans.mjs +18 -0
- package/dist/plugins/deepbook/spans.mjs.map +1 -0
- package/dist/plugins/deepbook/type-strings.mjs +65 -0
- package/dist/plugins/deepbook/type-strings.mjs.map +1 -0
- package/dist/plugins/deepbook/types.d.mts +2 -3
- package/dist/plugins/deepbook/types.mjs.map +1 -1
- package/dist/plugins/faucet/dispatcher.d.mts +21 -2
- package/dist/plugins/faucet/dispatcher.mjs +1 -2
- package/dist/plugins/faucet/dispatcher.mjs.map +1 -1
- package/dist/plugins/faucet/errors.d.mts +11 -24
- package/dist/plugins/faucet/errors.mjs.map +1 -1
- package/dist/plugins/faucet/http.mjs +33 -14
- package/dist/plugins/faucet/http.mjs.map +1 -1
- package/dist/plugins/faucet/index.d.mts +15 -5
- package/dist/plugins/faucet/index.mjs +3 -0
- package/dist/plugins/faucet/index.mjs.map +1 -1
- package/dist/plugins/faucet/spans.mjs +12 -0
- package/dist/plugins/faucet/spans.mjs.map +1 -0
- package/dist/plugins/host-service/errors.d.mts +1 -1
- package/dist/plugins/host-service/index.mjs +34 -8
- package/dist/plugins/host-service/index.mjs.map +1 -1
- package/dist/plugins/host-service/routable.mjs +2 -1
- package/dist/plugins/host-service/routable.mjs.map +1 -1
- package/dist/plugins/host-service/service.d.mts +21 -0
- package/dist/plugins/host-service/service.mjs +136 -81
- package/dist/plugins/host-service/service.mjs.map +1 -1
- package/dist/plugins/internal/acquire-on-chain-artifact.mjs +23 -0
- package/dist/plugins/internal/acquire-on-chain-artifact.mjs.map +1 -0
- package/dist/plugins/internal/codegen-helpers.mjs +18 -0
- package/dist/plugins/internal/codegen-helpers.mjs.map +1 -0
- package/dist/plugins/internal/funding-failure-error.mjs +32 -0
- package/dist/plugins/internal/funding-failure-error.mjs.map +1 -0
- package/dist/plugins/package/build.mjs +1 -1
- package/dist/plugins/package/build.mjs.map +1 -1
- package/dist/plugins/package/codegen.mjs +26 -0
- package/dist/plugins/package/codegen.mjs.map +1 -1
- package/dist/plugins/package/errors.d.mts +16 -6
- package/dist/plugins/package/errors.mjs.map +1 -1
- package/dist/plugins/package/index.d.mts +0 -4
- package/dist/plugins/package/index.mjs +27 -21
- package/dist/plugins/package/index.mjs.map +1 -1
- package/dist/plugins/package/mode-known.mjs +26 -12
- package/dist/plugins/package/mode-known.mjs.map +1 -1
- package/dist/plugins/package/mode-local.mjs +47 -41
- package/dist/plugins/package/mode-local.mjs.map +1 -1
- package/dist/plugins/package/publish-executor.mjs +55 -114
- package/dist/plugins/package/publish-executor.mjs.map +1 -1
- package/dist/plugins/package/registry.mjs +2 -1
- package/dist/plugins/package/registry.mjs.map +1 -1
- package/dist/plugins/package/service.mjs.map +1 -1
- package/dist/plugins/package/spans.mjs +14 -0
- package/dist/plugins/package/spans.mjs.map +1 -0
- package/dist/plugins/postgres/db-ensure.mjs +19 -12
- package/dist/plugins/postgres/db-ensure.mjs.map +1 -1
- package/dist/plugins/postgres/errors.d.mts +5 -0
- package/dist/plugins/postgres/errors.mjs.map +1 -1
- package/dist/plugins/postgres/index.mjs +10 -17
- package/dist/plugins/postgres/index.mjs.map +1 -1
- package/dist/plugins/postgres/service.mjs +58 -24
- package/dist/plugins/postgres/service.mjs.map +1 -1
- package/dist/plugins/postgres/snapshot.mjs.map +1 -1
- package/dist/plugins/postgres/spans.mjs +11 -0
- package/dist/plugins/postgres/spans.mjs.map +1 -0
- package/dist/plugins/router-entrypoints.mjs +4 -4
- package/dist/plugins/router-entrypoints.mjs.map +1 -1
- package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs +15 -13
- package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs.map +1 -1
- package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs +15 -19
- package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs.map +1 -1
- package/dist/plugins/seal/codegen.d.mts +2 -3
- package/dist/plugins/seal/codegen.mjs.map +1 -1
- package/dist/plugins/seal/config-render.mjs +35 -8
- package/dist/plugins/seal/config-render.mjs.map +1 -1
- package/dist/plugins/seal/deploy.mjs +31 -39
- package/dist/plugins/seal/deploy.mjs.map +1 -1
- package/dist/plugins/seal/errors.d.mts +1 -3
- package/dist/plugins/seal/errors.mjs +7 -1
- package/dist/plugins/seal/errors.mjs.map +1 -1
- package/dist/plugins/seal/index.d.mts +1 -6
- package/dist/plugins/seal/index.mjs +40 -14
- package/dist/plugins/seal/index.mjs.map +1 -1
- package/dist/plugins/seal/key-manager.d.mts +1 -9
- package/dist/plugins/seal/key-manager.mjs +2 -18
- package/dist/plugins/seal/key-manager.mjs.map +1 -1
- package/dist/plugins/seal/key-server.mjs +37 -36
- package/dist/plugins/seal/key-server.mjs.map +1 -1
- package/dist/plugins/seal/keygen.mjs +16 -17
- package/dist/plugins/seal/keygen.mjs.map +1 -1
- package/dist/plugins/seal/mode/fork-known.mjs +36 -14
- package/dist/plugins/seal/mode/fork-known.mjs.map +1 -1
- package/dist/plugins/seal/mode/live.d.mts +6 -4
- package/dist/plugins/seal/mode/live.mjs +14 -21
- package/dist/plugins/seal/mode/live.mjs.map +1 -1
- package/dist/plugins/seal/mode/local-keygen.mjs +57 -21
- package/dist/plugins/seal/mode/local-keygen.mjs.map +1 -1
- package/dist/plugins/seal/registry-publish.mjs +1 -0
- package/dist/plugins/seal/registry-publish.mjs.map +1 -1
- package/dist/plugins/seal/routable.mjs.map +1 -1
- package/dist/plugins/seal/service.mjs.map +1 -1
- package/dist/plugins/seal/spans.mjs +18 -0
- package/dist/plugins/seal/spans.mjs.map +1 -0
- package/dist/plugins/sui/auto-tick.mjs +17 -23
- package/dist/plugins/sui/auto-tick.mjs.map +1 -1
- package/dist/plugins/sui/chain-build-container.mjs +18 -0
- package/dist/plugins/sui/chain-build-container.mjs.map +1 -0
- package/dist/plugins/sui/chain-probe.d.mts +5 -5
- package/dist/plugins/sui/chain-probe.mjs +28 -58
- package/dist/plugins/sui/chain-probe.mjs.map +1 -1
- package/dist/plugins/sui/codegen.mjs +26 -0
- package/dist/plugins/sui/codegen.mjs.map +1 -1
- package/dist/plugins/sui/errors.d.mts +2 -29
- package/dist/plugins/sui/errors.mjs +1 -3
- package/dist/plugins/sui/errors.mjs.map +1 -1
- package/dist/plugins/sui/fork-faucet-strategy.d.mts +1 -0
- package/dist/plugins/sui/fork-faucet-strategy.mjs +55 -0
- package/dist/plugins/sui/fork-faucet-strategy.mjs.map +1 -0
- package/dist/plugins/sui/fork-orchestration.d.mts +1 -0
- package/dist/plugins/sui/fork-orchestration.mjs +170 -2
- package/dist/plugins/sui/fork-orchestration.mjs.map +1 -1
- package/dist/plugins/sui/fork-transaction.d.mts +2 -0
- package/dist/plugins/sui/fork-transaction.mjs +92 -28
- package/dist/plugins/sui/fork-transaction.mjs.map +1 -1
- package/dist/plugins/sui/index.d.mts +33 -70
- package/dist/plugins/sui/index.mjs +58 -35
- package/dist/plugins/sui/index.mjs.map +1 -1
- package/dist/plugins/{faucet/strategies/sui-local.mjs → sui/local-faucet-strategy.mjs} +10 -7
- package/dist/plugins/sui/local-faucet-strategy.mjs.map +1 -0
- package/dist/plugins/sui/mode/external.mjs +7 -13
- package/dist/plugins/sui/mode/external.mjs.map +1 -1
- package/dist/plugins/sui/mode/fork.mjs +136 -59
- package/dist/plugins/sui/mode/fork.mjs.map +1 -1
- package/dist/plugins/sui/mode/live.mjs +10 -16
- package/dist/plugins/sui/mode/live.mjs.map +1 -1
- package/dist/plugins/sui/mode/local.mjs +37 -36
- package/dist/plugins/sui/mode/local.mjs.map +1 -1
- package/dist/plugins/sui/mode/shared-boot.mjs +38 -115
- package/dist/plugins/sui/mode/shared-boot.mjs.map +1 -1
- package/dist/plugins/sui/mode/shared.d.mts +1 -5
- package/dist/plugins/sui/mode/shared.mjs.map +1 -1
- package/dist/plugins/sui/mode/spec.d.mts +18 -0
- package/dist/plugins/sui/move-summary-runner.mjs +207 -0
- package/dist/plugins/sui/move-summary-runner.mjs.map +1 -0
- package/dist/plugins/sui/network-resolver.d.mts +4 -3
- package/dist/plugins/sui/service.mjs.map +1 -1
- package/dist/plugins/sui/snapshot.mjs +3 -0
- package/dist/plugins/sui/snapshot.mjs.map +1 -1
- package/dist/plugins/sui/spans.mjs +17 -0
- package/dist/plugins/sui/spans.mjs.map +1 -0
- package/dist/plugins/wallet/codegen.d.mts +0 -1
- package/dist/plugins/wallet/codegen.mjs +8 -9
- package/dist/plugins/wallet/codegen.mjs.map +1 -1
- package/dist/plugins/wallet/index.d.mts +6 -8
- package/dist/plugins/wallet/index.mjs +46 -35
- package/dist/plugins/wallet/index.mjs.map +1 -1
- package/dist/plugins/wallet/origin-policy.mjs +12 -28
- package/dist/plugins/wallet/origin-policy.mjs.map +1 -1
- package/dist/plugins/wallet/pairing.mjs +6 -4
- package/dist/plugins/wallet/pairing.mjs.map +1 -1
- package/dist/plugins/wallet/protocol.d.mts +1 -0
- package/dist/plugins/wallet/protocol.mjs +5 -44
- package/dist/plugins/wallet/protocol.mjs.map +1 -1
- package/dist/plugins/wallet/routable.mjs +2 -8
- package/dist/plugins/wallet/routable.mjs.map +1 -1
- package/dist/plugins/wallet/server.mjs +36 -44
- package/dist/plugins/wallet/server.mjs.map +1 -1
- package/dist/plugins/wallet/service.d.mts +1 -5
- package/dist/plugins/wallet/service.mjs +22 -18
- package/dist/plugins/wallet/service.mjs.map +1 -1
- package/dist/plugins/wallet/spans.mjs +22 -0
- package/dist/plugins/wallet/spans.mjs.map +1 -0
- package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs +33 -8
- package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs.map +1 -1
- package/dist/plugins/walrus/codegen.d.mts +3 -3
- package/dist/plugins/walrus/codegen.mjs.map +1 -1
- package/dist/plugins/walrus/deploy-paths.mjs +21 -5
- package/dist/plugins/walrus/deploy-paths.mjs.map +1 -1
- package/dist/plugins/walrus/deploy.mjs +67 -69
- package/dist/plugins/walrus/deploy.mjs.map +1 -1
- package/dist/plugins/walrus/errors.mjs +1 -0
- package/dist/plugins/walrus/errors.mjs.map +1 -1
- package/dist/plugins/walrus/faucet-strategy.mjs +12 -7
- package/dist/plugins/walrus/faucet-strategy.mjs.map +1 -1
- package/dist/plugins/walrus/index.d.mts +2 -13
- package/dist/plugins/walrus/index.mjs +18 -23
- package/dist/plugins/walrus/index.mjs.map +1 -1
- package/dist/plugins/walrus/mode/known-deploy.mjs +7 -5
- package/dist/plugins/walrus/mode/known-deploy.mjs.map +1 -1
- package/dist/plugins/walrus/mode/local-cluster.mjs +26 -7
- package/dist/plugins/walrus/mode/local-cluster.mjs.map +1 -1
- package/dist/plugins/walrus/registry-publish.mjs.map +1 -1
- package/dist/plugins/walrus/routable.mjs +7 -23
- package/dist/plugins/walrus/routable.mjs.map +1 -1
- package/dist/plugins/walrus/service.mjs.map +1 -1
- package/dist/plugins/walrus/spans.mjs +18 -0
- package/dist/plugins/walrus/spans.mjs.map +1 -0
- package/dist/plugins/walrus/storage-nodes.d.mts +6 -2
- package/dist/plugins/walrus/storage-nodes.mjs +15 -8
- package/dist/plugins/walrus/storage-nodes.mjs.map +1 -1
- package/dist/plugins/walrus/wal-swap.mjs +58 -15
- package/dist/plugins/walrus/wal-swap.mjs.map +1 -1
- package/dist/primitives/artifact-publisher.d.mts +1 -1
- package/dist/primitives/artifact-publisher.mjs +15 -0
- package/dist/primitives/artifact-publisher.mjs.map +1 -0
- package/dist/runtime/docker/client.mjs +17 -4
- package/dist/runtime/docker/client.mjs.map +1 -1
- package/dist/runtime/docker/container.mjs +219 -132
- package/dist/runtime/docker/container.mjs.map +1 -1
- package/dist/runtime/docker/errors.mjs +0 -6
- package/dist/runtime/docker/errors.mjs.map +1 -1
- package/dist/runtime/docker/exec.mjs +21 -18
- package/dist/runtime/docker/exec.mjs.map +1 -1
- package/dist/runtime/docker/image.mjs +36 -13
- package/dist/runtime/docker/image.mjs.map +1 -1
- package/dist/runtime/docker/index.mjs +14 -0
- package/dist/runtime/docker/inspect-and-decode.mjs +51 -0
- package/dist/runtime/docker/inspect-and-decode.mjs.map +1 -0
- package/dist/runtime/docker/inventory.mjs +14 -11
- package/dist/runtime/docker/inventory.mjs.map +1 -1
- package/dist/runtime/docker/labels.mjs +38 -5
- package/dist/runtime/docker/labels.mjs.map +1 -1
- package/dist/runtime/docker/logs.d.mts +1 -1
- package/dist/runtime/docker/logs.mjs.map +1 -1
- package/dist/runtime/docker/network.mjs +83 -47
- package/dist/runtime/docker/network.mjs.map +1 -1
- package/dist/runtime/docker/render-run-args.mjs +82 -0
- package/dist/runtime/docker/render-run-args.mjs.map +1 -0
- package/dist/runtime/docker/service.d.mts +1 -1
- package/dist/runtime/docker/service.mjs +12 -7
- package/dist/runtime/docker/service.mjs.map +1 -1
- package/dist/runtime/docker/sweep.mjs +118 -43
- package/dist/runtime/docker/sweep.mjs.map +1 -1
- package/dist/runtime/docker/volume.mjs +2 -0
- package/dist/runtime/docker/volume.mjs.map +1 -1
- package/dist/runtime/docker/wrap.mjs +30 -1
- package/dist/runtime/docker/wrap.mjs.map +1 -1
- package/dist/substrate/cross-process.mjs +14 -8
- package/dist/substrate/cross-process.mjs.map +1 -1
- package/dist/substrate/event-time.mjs +33 -0
- package/dist/substrate/event-time.mjs.map +1 -0
- package/dist/substrate/events.d.mts +28 -8
- package/dist/substrate/identity.d.mts +2 -1
- package/dist/substrate/manifest.d.mts +68 -5
- package/dist/substrate/manifest.mjs +34 -5
- package/dist/substrate/manifest.mjs.map +1 -1
- package/dist/substrate/network.d.mts +3 -5
- package/dist/substrate/options.d.mts +0 -2
- package/dist/substrate/plugin.d.mts +13 -0
- package/dist/substrate/plugin.mjs +4 -2
- package/dist/substrate/plugin.mjs.map +1 -1
- package/dist/substrate/projection.d.mts +35 -3
- package/dist/substrate/runtime/artifact-publisher/index.mjs +19 -9
- package/dist/substrate/runtime/artifact-publisher/index.mjs.map +1 -1
- package/dist/substrate/runtime/atomic-write.mjs +97 -32
- package/dist/substrate/runtime/atomic-write.mjs.map +1 -1
- package/dist/substrate/runtime/cache/index.mjs +3 -0
- package/dist/substrate/runtime/cache/schema.mjs +2 -2
- package/dist/substrate/runtime/cache/schema.mjs.map +1 -1
- package/dist/substrate/runtime/cache/service.mjs +9 -7
- package/dist/substrate/runtime/cache/service.mjs.map +1 -1
- package/dist/substrate/runtime/capability-sinks/index.d.mts +1 -1
- package/dist/substrate/runtime/capability-sinks/index.mjs +3 -0
- package/dist/substrate/runtime/capability-sinks/layer.mjs +1 -1
- package/dist/substrate/runtime/capability-sinks/service.d.mts +61 -2
- package/dist/substrate/runtime/capability-sinks/service.mjs +21 -26
- package/dist/substrate/runtime/capability-sinks/service.mjs.map +1 -1
- package/dist/substrate/runtime/config-validation.d.mts +1 -13
- package/dist/substrate/runtime/config-validation.mjs +2 -91
- package/dist/substrate/runtime/config-validation.mjs.map +1 -1
- package/dist/substrate/runtime/container-runtime.d.mts +1 -0
- package/dist/substrate/runtime/container-runtime.mjs +2 -0
- package/dist/substrate/runtime/control-plane/domain.mjs +101 -0
- package/dist/substrate/runtime/control-plane/domain.mjs.map +1 -0
- package/dist/substrate/runtime/control-plane/service.mjs +7 -0
- package/dist/substrate/runtime/control-plane/service.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/command-channel/channel.mjs +46 -19
- package/dist/substrate/runtime/cross-process/command-channel/channel.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/command-channel/file-channel.mjs +30 -12
- package/dist/substrate/runtime/cross-process/command-channel/file-channel.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/command-channel/index.mjs +5 -0
- package/dist/substrate/runtime/cross-process/command-channel/protocol.mjs +11 -2
- package/dist/substrate/runtime/cross-process/command-channel/protocol.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/command-channel/runtime-control-lock.mjs +1 -1
- package/dist/substrate/runtime/cross-process/index.mjs +11 -0
- package/dist/substrate/runtime/cross-process/live-clock.mjs +34 -0
- package/dist/substrate/runtime/cross-process/live-clock.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/liveness.mjs +52 -10
- package/dist/substrate/runtime/cross-process/liveness.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/lock.d.mts +1 -0
- package/dist/substrate/runtime/cross-process/lock.mjs +23 -0
- package/dist/substrate/runtime/cross-process/lock.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/reclaim-stale-file.mjs +64 -0
- package/dist/substrate/runtime/cross-process/reclaim-stale-file.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/roster.mjs +97 -83
- package/dist/substrate/runtime/cross-process/roster.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/self-pid.mjs +8 -0
- package/dist/substrate/runtime/cross-process/self-pid.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs +24 -28
- package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/stack-lock.mjs +41 -20
- package/dist/substrate/runtime/cross-process/stack-lock.mjs.map +1 -1
- package/dist/substrate/runtime/current-plugin.mjs +2 -2
- package/dist/substrate/runtime/current-plugin.mjs.map +1 -1
- package/dist/substrate/runtime/errors.mjs +12 -6
- package/dist/substrate/runtime/errors.mjs.map +1 -1
- package/dist/substrate/runtime/format-unknown-error.mjs +30 -0
- package/dist/substrate/runtime/format-unknown-error.mjs.map +1 -0
- package/dist/substrate/runtime/host-bind-mount-owner.mjs +10 -0
- package/dist/substrate/runtime/host-bind-mount-owner.mjs.map +1 -0
- package/dist/substrate/runtime/host-gateway.mjs +20 -0
- package/dist/substrate/runtime/host-gateway.mjs.map +1 -0
- package/dist/substrate/runtime/host-tree-tar/index.mjs +61 -50
- package/dist/substrate/runtime/host-tree-tar/index.mjs.map +1 -1
- package/dist/substrate/runtime/http-probe.d.mts +1 -1
- package/dist/substrate/runtime/index.mjs +14 -0
- package/dist/substrate/runtime/lease-broker/index.d.mts +1 -1
- package/dist/substrate/runtime/lease-broker/index.mjs +2 -0
- package/dist/substrate/runtime/lease-broker/service.d.mts +1 -64
- package/dist/substrate/runtime/lease-broker/service.mjs +1 -1
- package/dist/substrate/runtime/lease-broker/service.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/dep-graph.mjs +22 -3
- package/dist/substrate/runtime/lifecycle/dep-graph.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/index.mjs +9 -0
- package/dist/substrate/runtime/lifecycle/lifecycle-fact.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/plugin-registry.mjs +20 -3
- package/dist/substrate/runtime/lifecycle/plugin-registry.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/selective-restart.mjs +1 -1
- package/dist/substrate/runtime/lifecycle/signals.mjs +5 -5
- package/dist/substrate/runtime/lifecycle/signals.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/state-machine.mjs +1 -1
- package/dist/substrate/runtime/managed-container.d.mts +19 -1
- package/dist/substrate/runtime/managed-container.mjs +20 -1
- package/dist/substrate/runtime/managed-container.mjs.map +1 -1
- package/dist/substrate/runtime/manifest/index.mjs +3 -0
- package/dist/substrate/runtime/manifest/manifest.mjs +15 -11
- package/dist/substrate/runtime/manifest/manifest.mjs.map +1 -1
- package/dist/substrate/runtime/mode-errors.mjs +20 -0
- package/dist/substrate/runtime/mode-errors.mjs.map +1 -0
- package/dist/substrate/runtime/observability/cascade-formatter.mjs +9 -13
- package/dist/substrate/runtime/observability/cascade-formatter.mjs.map +1 -1
- package/dist/substrate/runtime/observability/formatter-registry.mjs +19 -36
- package/dist/substrate/runtime/observability/formatter-registry.mjs.map +1 -1
- package/dist/substrate/runtime/observability/ignore-with-log.d.mts +1 -0
- package/dist/substrate/runtime/observability/ignore-with-log.mjs +17 -0
- package/dist/substrate/runtime/observability/ignore-with-log.mjs.map +1 -0
- package/dist/substrate/runtime/observability/index.d.mts +1 -1
- package/dist/substrate/runtime/observability/index.mjs +13 -0
- package/dist/substrate/runtime/observability/log-store.d.mts +1 -0
- package/dist/substrate/runtime/observability/log-store.mjs +175 -0
- package/dist/substrate/runtime/observability/log-store.mjs.map +1 -0
- package/dist/substrate/runtime/observability/logger.d.mts +2 -1
- package/dist/substrate/runtime/observability/logger.mjs +5 -9
- package/dist/substrate/runtime/observability/logger.mjs.map +1 -1
- package/dist/substrate/runtime/observability/output-truncate.mjs +35 -0
- package/dist/substrate/runtime/observability/output-truncate.mjs.map +1 -0
- package/dist/substrate/runtime/observability/pretty-error.mjs +9 -12
- package/dist/substrate/runtime/observability/pretty-error.mjs.map +1 -1
- package/dist/substrate/runtime/observability/redaction.d.mts +2 -13
- package/dist/substrate/runtime/observability/redaction.mjs +8 -14
- package/dist/substrate/runtime/observability/redaction.mjs.map +1 -1
- package/dist/substrate/runtime/observability/span-store.d.mts +1 -0
- package/dist/substrate/runtime/observability/span-store.mjs +110 -0
- package/dist/substrate/runtime/observability/span-store.mjs.map +1 -0
- package/dist/substrate/runtime/observability/spans.mjs +14 -14
- package/dist/substrate/runtime/observability/spans.mjs.map +1 -1
- package/dist/substrate/runtime/observability/subprocess-capture.mjs +1 -1
- package/dist/substrate/runtime/passthrough-or-wrap.mjs +33 -0
- package/dist/substrate/runtime/passthrough-or-wrap.mjs.map +1 -0
- package/dist/substrate/runtime/paths.d.mts +1 -1
- package/dist/substrate/runtime/paths.mjs +4 -3
- package/dist/substrate/runtime/paths.mjs.map +1 -1
- package/dist/substrate/runtime/phase-preserving-produce.mjs +40 -0
- package/dist/substrate/runtime/phase-preserving-produce.mjs.map +1 -0
- package/dist/substrate/runtime/port-broker/index.mjs +3 -0
- package/dist/substrate/runtime/port-broker/service.mjs +170 -126
- package/dist/substrate/runtime/port-broker/service.mjs.map +1 -1
- package/dist/substrate/runtime/post-acquire-tasks.mjs +1 -1
- package/dist/substrate/runtime/post-acquire-tasks.mjs.map +1 -1
- package/dist/substrate/runtime/probes.d.mts +7 -5
- package/dist/substrate/runtime/probes.mjs +3 -1
- package/dist/substrate/runtime/probes.mjs.map +1 -1
- package/dist/substrate/runtime/projection/index.mjs +4 -0
- package/dist/substrate/runtime/projection/operational-endpoints.mjs +1 -2
- package/dist/substrate/runtime/projection/operational-endpoints.mjs.map +1 -1
- package/dist/substrate/runtime/projection/persisted.mjs +33 -15
- package/dist/substrate/runtime/projection/persisted.mjs.map +1 -1
- package/dist/substrate/runtime/projection/state-ref.mjs +26 -2
- package/dist/substrate/runtime/projection/state-ref.mjs.map +1 -1
- package/dist/substrate/runtime/projection/update.mjs +88 -24
- package/dist/substrate/runtime/projection/update.mjs.map +1 -1
- package/dist/substrate/runtime/random-suffix.mjs +11 -0
- package/dist/substrate/runtime/random-suffix.mjs.map +1 -0
- package/dist/substrate/runtime/retry-policy.d.mts +59 -1
- package/dist/substrate/runtime/retry-policy.mjs +66 -1
- package/dist/substrate/runtime/retry-policy.mjs.map +1 -1
- package/dist/substrate/runtime/routed-url.d.mts +1 -0
- package/dist/substrate/runtime/routed-url.mjs +79 -0
- package/dist/substrate/runtime/routed-url.mjs.map +1 -0
- package/dist/substrate/runtime/runtime-decode.d.mts +1 -1
- package/dist/substrate/runtime/runtime-decode.mjs.map +1 -1
- package/dist/substrate/runtime/scoped-http-server.mjs +2 -3
- package/dist/substrate/runtime/scoped-http-server.mjs.map +1 -1
- package/dist/substrate/runtime/scoped-multimap/index.mjs +2 -0
- package/dist/substrate/runtime/scoped-multimap/service.mjs +52 -0
- package/dist/substrate/runtime/scoped-multimap/service.mjs.map +1 -0
- package/dist/substrate/runtime/scoped-ref-map/index.mjs +2 -0
- package/dist/substrate/runtime/scoped-ref-map/service.mjs +2 -2
- package/dist/substrate/runtime/scoped-ref-map/service.mjs.map +1 -1
- package/dist/substrate/runtime/stage-and-swap/index.mjs +72 -4
- package/dist/substrate/runtime/stage-and-swap/index.mjs.map +1 -1
- package/dist/substrate/runtime/state-store/index.d.mts +1 -0
- package/dist/substrate/runtime/state-store/index.mjs +3 -0
- package/dist/substrate/runtime/state-store/schema.d.mts +1 -0
- package/dist/substrate/runtime/state-store/schema.mjs +19 -14
- package/dist/substrate/runtime/state-store/schema.mjs.map +1 -1
- package/dist/substrate/runtime/state-store/service.d.mts +1 -0
- package/dist/substrate/runtime/state-store/service.mjs +145 -0
- package/dist/substrate/runtime/state-store/service.mjs.map +1 -0
- package/dist/substrate/runtime/strategy-registry/chain-keyed-strategy-for.d.mts +1 -0
- package/dist/substrate/runtime/strategy-registry/chain-keyed-strategy-for.mjs +33 -0
- package/dist/substrate/runtime/strategy-registry/chain-keyed-strategy-for.mjs.map +1 -0
- package/dist/substrate/runtime/strategy-registry/chain-probe-for.mjs +1 -1
- package/dist/substrate/runtime/strategy-registry/chain-probe-for.mjs.map +1 -1
- package/dist/substrate/runtime/strategy-registry/index.mjs +4 -0
- package/dist/substrate/runtime/strategy-registry/service.mjs +19 -33
- package/dist/substrate/runtime/strategy-registry/service.mjs.map +1 -1
- package/dist/substrate/runtime/subnet-broker.mjs +60 -0
- package/dist/substrate/runtime/subnet-broker.mjs.map +1 -0
- package/dist/substrate/runtime/sui-execute/index.d.mts +21 -1
- package/dist/substrate/runtime/sui-execute/index.mjs +84 -20
- package/dist/substrate/runtime/sui-execute/index.mjs.map +1 -1
- package/dist/substrate/runtime/sui-execute/sign-and-dispatch.d.mts +1 -0
- package/dist/substrate/runtime/sui-execute/sign-and-dispatch.mjs +32 -0
- package/dist/substrate/runtime/sui-execute/sign-and-dispatch.mjs.map +1 -0
- package/dist/substrate/runtime/sui-ledger/object-ref.mjs +32 -0
- package/dist/substrate/runtime/sui-ledger/object-ref.mjs.map +1 -0
- package/dist/substrate/runtime/sui-move-build/index.mjs +93 -19
- package/dist/substrate/runtime/sui-move-build/index.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/acquire-node.mjs +181 -0
- package/dist/substrate/runtime/supervisor/acquire-node.mjs.map +1 -0
- package/dist/substrate/runtime/supervisor/background-tasks.mjs +144 -0
- package/dist/substrate/runtime/supervisor/background-tasks.mjs.map +1 -0
- package/dist/substrate/runtime/supervisor/command-loop.mjs +68 -0
- package/dist/substrate/runtime/supervisor/command-loop.mjs.map +1 -0
- package/dist/substrate/runtime/supervisor/dispatch-contributions.mjs +151 -0
- package/dist/substrate/runtime/supervisor/dispatch-contributions.mjs.map +1 -0
- package/dist/substrate/runtime/supervisor/errors.d.mts +1 -0
- package/dist/substrate/runtime/supervisor/errors.mjs +9 -0
- package/dist/substrate/runtime/supervisor/errors.mjs.map +1 -0
- package/dist/substrate/runtime/supervisor/index.d.mts +1 -0
- package/dist/substrate/runtime/supervisor/index.mjs +3 -0
- package/dist/substrate/runtime/supervisor/shutdown.mjs +51 -0
- package/dist/substrate/runtime/supervisor/shutdown.mjs.map +1 -0
- package/dist/substrate/runtime/supervisor/start-supervisor.d.mts +1 -0
- package/dist/substrate/runtime/supervisor/start-supervisor.mjs +250 -0
- package/dist/substrate/runtime/supervisor/start-supervisor.mjs.map +1 -0
- package/dist/substrate/runtime/supervisor/state.d.mts +1 -0
- package/dist/substrate/runtime/supervisor/state.mjs +22 -0
- package/dist/substrate/runtime/supervisor/state.mjs.map +1 -0
- package/dist/substrate/runtime/supervisor/teardown.mjs +57 -0
- package/dist/substrate/runtime/supervisor/teardown.mjs.map +1 -0
- package/dist/substrate/runtime/supervisor/types.d.mts +1 -0
- package/dist/substrate/runtime/supervisor/wiring.mjs +133 -0
- package/dist/substrate/runtime/supervisor/wiring.mjs.map +1 -0
- package/dist/substrate/runtime/typed-env.mjs +8 -0
- package/dist/substrate/runtime/typed-env.mjs.map +1 -0
- package/dist/substrate/state-store.d.mts +1 -0
- package/dist/substrate/versioned-doc-schema.mjs +17 -0
- package/dist/substrate/versioned-doc-schema.mjs.map +1 -0
- package/dist/substrate/versioned-doc-sync.mjs +94 -0
- package/dist/substrate/versioned-doc-sync.mjs.map +1 -0
- package/dist/surfaces/cli/command-tree.mjs.map +1 -1
- package/dist/surfaces/cli/commands/index.mjs +9 -0
- package/dist/surfaces/cli/commands/prune-picker-entry.mjs +13 -0
- package/dist/surfaces/cli/commands/prune-picker-entry.mjs.map +1 -0
- package/dist/surfaces/cli/commands/prune-picker.mjs +3 -2
- package/dist/surfaces/cli/commands/prune-picker.mjs.map +1 -1
- package/dist/surfaces/cli/commands/prune.mjs +34 -17
- package/dist/surfaces/cli/commands/prune.mjs.map +1 -1
- package/dist/surfaces/cli/commands/status.mjs +2 -2
- package/dist/surfaces/cli/commands/status.mjs.map +1 -1
- package/dist/surfaces/cli/commands/supervisor-presence.mjs +5 -3
- package/dist/surfaces/cli/commands/supervisor-presence.mjs.map +1 -1
- package/dist/surfaces/cli/commands/wipe.mjs +38 -4
- package/dist/surfaces/cli/commands/wipe.mjs.map +1 -1
- package/dist/surfaces/cli/errors.mjs +1 -1
- package/dist/surfaces/cli/errors.mjs.map +1 -1
- package/dist/surfaces/cli/flags.mjs +0 -1
- package/dist/surfaces/cli/flags.mjs.map +1 -1
- package/dist/surfaces/cli/index.mjs +98 -18
- package/dist/surfaces/cli/index.mjs.map +1 -1
- package/dist/surfaces/cli/output.mjs +1 -0
- package/dist/surfaces/cli/output.mjs.map +1 -1
- package/dist/surfaces/cli/sysexits.mjs +2 -1
- package/dist/surfaces/cli/sysexits.mjs.map +1 -1
- package/dist/surfaces/tui/app.mjs +25 -3
- package/dist/surfaces/tui/app.mjs.map +1 -1
- package/dist/surfaces/tui/display-derivation.mjs +23 -74
- package/dist/surfaces/tui/display-derivation.mjs.map +1 -1
- package/dist/surfaces/tui/event-log.mjs +35 -23
- package/dist/surfaces/tui/event-log.mjs.map +1 -1
- package/dist/surfaces/tui/input.mjs +5 -1
- package/dist/surfaces/tui/input.mjs.map +1 -1
- package/dist/surfaces/tui/plain-renderer.mjs +70 -34
- package/dist/surfaces/tui/plain-renderer.mjs.map +1 -1
- package/package.json +24 -4
- package/dist/contracts/liveness-classifier.d.mts +0 -19
- package/dist/contracts/network-resolver.d.mts +0 -15
- package/dist/contracts/network-resolver.mjs +0 -7
- package/dist/contracts/network-resolver.mjs.map +0 -1
- package/dist/orchestrators/codegen/extras.mjs +0 -16
- package/dist/orchestrators/codegen/extras.mjs.map +0 -1
- package/dist/plugins/deepbook/routable.mjs +0 -21
- package/dist/plugins/deepbook/routable.mjs.map +0 -1
- package/dist/plugins/faucet/service.d.mts +0 -20
- package/dist/plugins/faucet/strategies/sui-local.d.mts +0 -23
- package/dist/plugins/faucet/strategies/sui-local.mjs.map +0 -1
- package/dist/plugins/sui/seed-objects.d.mts +0 -18
- package/dist/plugins/sui/seed-objects.mjs +0 -25
- package/dist/plugins/sui/seed-objects.mjs.map +0 -1
- package/dist/runtime/built-in-plugin-layers.mjs.map +0 -1
- package/dist/substrate/runtime/context-helpers.mjs +0 -32
- package/dist/substrate/runtime/context-helpers.mjs.map +0 -1
- package/dist/substrate/runtime/run.mjs.map +0 -1
- package/dist/substrate/runtime/strategy-registry/faucet-capability-for.mjs +0 -30
- package/dist/substrate/runtime/strategy-registry/faucet-capability-for.mjs.map +0 -1
- package/dist/substrate/runtime/supervisor.d.mts +0 -1
- package/dist/substrate/runtime/supervisor.mjs +0 -831
- package/dist/substrate/runtime/supervisor.mjs.map +0 -1
- package/dist/surfaces/cli/commands/doctor-probes.mjs.map +0 -1
- /package/dist/{substrate/runtime/strategy-registry/faucet-capability-for.d.mts → plugins/faucet/http.d.mts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cold-start-url.mjs","names":[],"sources":["../../../src/build-integrations/runtime/cold-start-url.ts"],"sourcesContent":["// Cold-start URL — conventional-route fallback for callers that need\n// an endpoint URL BEFORE the supervisor has written the manifest.\n//\n// Playwright's config loader runs ahead of the supervisor (it's the\n// process that spawns `pnpm dev`, which boots the supervisor, which\n// then writes the manifest). For `webServer.url` / `use.baseURL` to\n// be resolvable at config-load time, the build-integration needs a\n// derivation that doesn't require the manifest on disk.\n//\n// The derivation:\n//\n// <service>.<stack-prefix>.<app>.localhost:<port>\n//\n// where:\n// - `<service>` and `<port>` come from the endpoint's Routable\n// declaration (its `conventional` hint, populated by the router\n// plugin).\n// - `<app>` is the un-scoped app name (from cwd's `package.json` or\n// an explicit override).\n// - `<stack-prefix>` comes from an explicit stack, `DEVSTACK_STACK`,\n// or the `main` default. Package metadata is not a stack selector\n// for build integrations; it only supplies the app name.\n// - `<stack-prefix>` is empty for the `main` stack and `.<stack>`\n// otherwise. Matches the router's hostname-minting rule so\n// conventional and post-manifest URLs converge.\n//\n// Architecture § invariants: \"conventional URL convergence\" — the\n// fallback this function returns MUST equal the URL the supervisor's\n// router publishes once the manifest exists. The shared invariant is\n// enforced by deriving both from the same Routable declaration.\n//\n// This module does NOT import any service-specific endpoint names.\n// The conventional-route table is supplied by the caller; the router\n// plugin populates it from `RoutableDecl[].upstream` + a hard-coded\n// conventional-port map. (Architecture: \"engine knows zero service\n// names\" — the table is plugin-emitted.)\n\nimport { basename } from 'node:path';\n\nimport { NoConventionalRouteError } from './errors.ts';\nimport { readAppName, resolveBuildIntegrationStack } from './discover.ts';\n\n/** One row of the conventional-route table. The supervisor's router\n * plugin emits a `Map<endpointName, ConventionalRoute>` from its\n * Routable contributions; cold-start URL resolution keys off it. */\nexport interface ConventionalRoute {\n\t/** `<service>` segment of the hostname — typically the\n\t * routable's `dispatchId.role`. */\n\treadonly service: string;\n\t/** Traefik entrypoint port — the router's public-facing port for\n\t * this endpoint kind. */\n\treadonly port: number;\n\t/** Wire protocol — `http` or `h2c`. Determines the URL scheme. */\n\treadonly wireProtocol: 'http' | 'h2c';\n}\n\nexport interface ColdStartUrlOptions {\n\t/** Conventional-route table to consult. Supplied by the caller\n\t * (build integration), populated from the router plugin's\n\t * `RoutableDecl` contributions. Empty by default — calls that\n\t * don't pass a table will always throw, which is the right\n\t * behavior for \"no router plugin = no fallback\". */\n\treadonly routes: ReadonlyMap<string, ConventionalRoute>;\n\t/** Stack name. Defaults through `$DEVSTACK_STACK`, then `'main'`. */\n\treadonly stack?: string;\n\t/** App name (un-scoped). Defaults to reading `package.json` at\n\t * `cwd` (with the `@scope/` prefix stripped) and finally to\n\t * `basename(cwd)`. Injectable so unit tests don't depend on\n\t * filesystem state. */\n\treadonly app?: string;\n\t/** Starting directory for the app-name lookup. Defaults to\n\t * `process.cwd()`. */\n\treadonly cwd?: string;\n\t/** Host suffix owned by the router. Default: `.localhost`. */\n\treadonly hostSuffix?: string;\n}\n\nexport interface ConventionalRouteHostInput {\n\treadonly service: string;\n\treadonly app: string;\n\treadonly stack: string;\n\treadonly hostSuffix?: string;\n}\n\nexport interface ConventionalRouteUrlInput extends ConventionalRouteHostInput {\n\treadonly route: ConventionalRoute;\n\treadonly scheme?: 'http' | 'https';\n\treadonly trailingSlash?: boolean;\n}\n\nexport interface ConventionalRouteHint {\n\treadonly endpoint: string;\n\treadonly service: string;\n\treadonly wireProtocol?: 'http' | 'h2c';\n}\n\nexport const conventionalRouteHost = (input: ConventionalRouteHostInput): string => {\n\tconst hostSuffix = input.hostSuffix ?? '.localhost';\n\treturn input.stack === 'main'\n\t\t? `${input.service}.${input.app}${hostSuffix}`\n\t\t: `${input.service}.${input.stack}.${input.app}${hostSuffix}`;\n};\n\nexport const conventionalRouteUrl = (input: ConventionalRouteUrlInput): string => {\n\tconst scheme = input.scheme ?? 'http';\n\tconst host = conventionalRouteHost(input);\n\tconst url = `${scheme}://${host}:${input.route.port}`;\n\treturn input.trailingSlash === true ? `${url}/` : url;\n};\n\nexport const conventionalRoutesFromHints = (\n\thints: ReadonlyArray<ConventionalRouteHint>,\n\tport: number,\n): ReadonlyMap<string, ConventionalRoute> =>\n\tnew Map(\n\t\thints.map((hint): [string, ConventionalRoute] => [\n\t\t\thint.endpoint,\n\t\t\t{\n\t\t\t\tservice: hint.service,\n\t\t\t\tport,\n\t\t\t\twireProtocol: hint.wireProtocol ?? 'http',\n\t\t\t},\n\t\t]),\n\t);\n\n/**\n * Compute the conventional URL for `endpoint`. Throws\n * `NoConventionalRouteError` when the endpoint isn't in the supplied\n * `routes` table.\n *\n * Callers that prefer a `undefined`-on-miss surface should catch the\n * error or use `tryColdStartUrl` instead.\n */\nexport const coldStartUrl = (endpoint: string, opts: ColdStartUrlOptions): string => {\n\tconst route = opts.routes.get(endpoint);\n\tif (route === undefined) {\n\t\tconst supported = [...opts.routes.keys()].sort();\n\t\tthrow new NoConventionalRouteError({\n\t\t\tendpoint,\n\t\t\tsupported,\n\t\t\tmessage:\n\t\t\t\t`[devstack] endpoint ${JSON.stringify(endpoint)} has no conventional URL fallback. ` +\n\t\t\t\t`Supported endpoints: ${supported.length === 0 ? '(none)' : supported.join(', ')}. ` +\n\t\t\t\t`Check the endpoint name or write the manifest first via \\`devstack up\\`.`,\n\t\t});\n\t}\n\tconst cwd = opts.cwd ?? process.cwd();\n\tconst stack = resolveBuildIntegrationStack(opts.stack);\n\tconst app = opts.app ?? readAppName(cwd) ?? basename(cwd);\n\treturn conventionalRouteUrl({\n\t\troute,\n\t\tservice: route.service,\n\t\tapp,\n\t\tstack,\n\t\t...(opts.hostSuffix !== undefined ? { hostSuffix: opts.hostSuffix } : {}),\n\t\
|
|
1
|
+
{"version":3,"file":"cold-start-url.mjs","names":[],"sources":["../../../src/build-integrations/runtime/cold-start-url.ts"],"sourcesContent":["// Cold-start URL — conventional-route fallback for callers that need\n// an endpoint URL BEFORE the supervisor has written the manifest.\n//\n// Playwright's config loader runs ahead of the supervisor (it's the\n// process that spawns `pnpm dev`, which boots the supervisor, which\n// then writes the manifest). For `webServer.url` / `use.baseURL` to\n// be resolvable at config-load time, the build-integration needs a\n// derivation that doesn't require the manifest on disk.\n//\n// The derivation:\n//\n// <service>.<stack-prefix>.<app>.localhost:<port>\n//\n// where:\n// - `<service>` and `<port>` come from the endpoint's Routable\n// declaration (its `conventional` hint, populated by the router\n// plugin).\n// - `<app>` is the un-scoped app name (from cwd's `package.json` or\n// an explicit override).\n// - `<stack-prefix>` comes from an explicit stack, `DEVSTACK_STACK`,\n// or the `main` default. Package metadata is not a stack selector\n// for build integrations; it only supplies the app name.\n// - `<stack-prefix>` is empty for the `main` stack and `.<stack>`\n// otherwise. Matches the router's hostname-minting rule so\n// conventional and post-manifest URLs converge.\n//\n// Architecture § invariants: \"conventional URL convergence\" — the\n// fallback this function returns MUST equal the URL the supervisor's\n// router publishes once the manifest exists. The shared invariant is\n// enforced by deriving both from the same Routable declaration.\n//\n// This module does NOT import any service-specific endpoint names.\n// The conventional-route table is supplied by the caller; the router\n// plugin populates it from `RoutableDecl[].upstream` + a hard-coded\n// conventional-port map. (Architecture: \"engine knows zero service\n// names\" — the table is plugin-emitted.)\n\nimport { basename } from 'node:path';\n\nimport { NoConventionalRouteError } from './errors.ts';\nimport { readAppName, resolveBuildIntegrationStack } from './discover.ts';\n\n/** One row of the conventional-route table. The supervisor's router\n * plugin emits a `Map<endpointName, ConventionalRoute>` from its\n * Routable contributions; cold-start URL resolution keys off it. */\nexport interface ConventionalRoute {\n\t/** `<service>` segment of the hostname — typically the\n\t * routable's `dispatchId.role`. */\n\treadonly service: string;\n\t/** Traefik entrypoint port — the router's public-facing port for\n\t * this endpoint kind. */\n\treadonly port: number;\n\t/** Wire protocol — `http` or `h2c`. Determines the URL scheme. */\n\treadonly wireProtocol: 'http' | 'h2c';\n}\n\nexport interface ColdStartUrlOptions {\n\t/** Conventional-route table to consult. Supplied by the caller\n\t * (build integration), populated from the router plugin's\n\t * `RoutableDecl` contributions. Empty by default — calls that\n\t * don't pass a table will always throw, which is the right\n\t * behavior for \"no router plugin = no fallback\". */\n\treadonly routes: ReadonlyMap<string, ConventionalRoute>;\n\t/** Stack name. Defaults through `$DEVSTACK_STACK`, then `'main'`. */\n\treadonly stack?: string;\n\t/** App name (un-scoped). Defaults to reading `package.json` at\n\t * `cwd` (with the `@scope/` prefix stripped) and finally to\n\t * `basename(cwd)`. Injectable so unit tests don't depend on\n\t * filesystem state. */\n\treadonly app?: string;\n\t/** Starting directory for the app-name lookup. Defaults to\n\t * `process.cwd()`. */\n\treadonly cwd?: string;\n\t/** Host suffix owned by the router. Default: `.localhost`. */\n\treadonly hostSuffix?: string;\n\t/** Env bag consulted before falling back to `process.env`. Lets\n\t * callers (build integrations under test) inject a hermetic env\n\t * so `DEVSTACK_STACK` / `DEVSTACK_APP` are read from the bag\n\t * rather than leaking through the ambient environment. */\n\treadonly env?: Readonly<Record<string, string | undefined>>;\n}\n\nexport interface ConventionalRouteHostInput {\n\treadonly service: string;\n\treadonly app: string;\n\treadonly stack: string;\n\treadonly hostSuffix?: string;\n}\n\nexport interface ConventionalRouteUrlInput extends ConventionalRouteHostInput {\n\treadonly route: ConventionalRoute;\n\treadonly scheme?: 'http' | 'https';\n\treadonly trailingSlash?: boolean;\n}\n\nexport interface ConventionalRouteHint {\n\treadonly endpoint: string;\n\treadonly service: string;\n\treadonly wireProtocol?: 'http' | 'h2c';\n}\n\nexport const conventionalRouteHost = (input: ConventionalRouteHostInput): string => {\n\tconst hostSuffix = input.hostSuffix ?? '.localhost';\n\treturn input.stack === 'main'\n\t\t? `${input.service}.${input.app}${hostSuffix}`\n\t\t: `${input.service}.${input.stack}.${input.app}${hostSuffix}`;\n};\n\nexport const conventionalRouteUrl = (input: ConventionalRouteUrlInput): string => {\n\tconst scheme = input.scheme ?? 'http';\n\tconst host = conventionalRouteHost(input);\n\tconst url = `${scheme}://${host}:${input.route.port}`;\n\treturn input.trailingSlash === true ? `${url}/` : url;\n};\n\nexport const conventionalRoutesFromHints = (\n\thints: ReadonlyArray<ConventionalRouteHint>,\n\tport: number,\n): ReadonlyMap<string, ConventionalRoute> =>\n\tnew Map(\n\t\thints.map((hint): [string, ConventionalRoute] => [\n\t\t\thint.endpoint,\n\t\t\t{\n\t\t\t\tservice: hint.service,\n\t\t\t\tport,\n\t\t\t\twireProtocol: hint.wireProtocol ?? 'http',\n\t\t\t},\n\t\t]),\n\t);\n\n/**\n * Compute the conventional URL for `endpoint`. Throws\n * `NoConventionalRouteError` when the endpoint isn't in the supplied\n * `routes` table.\n *\n * Callers that prefer a `undefined`-on-miss surface should catch the\n * error or use `tryColdStartUrl` instead.\n */\nexport const coldStartUrl = (endpoint: string, opts: ColdStartUrlOptions): string => {\n\tconst route = opts.routes.get(endpoint);\n\tif (route === undefined) {\n\t\tconst supported = [...opts.routes.keys()].sort();\n\t\tthrow new NoConventionalRouteError({\n\t\t\tendpoint,\n\t\t\tsupported,\n\t\t\tmessage:\n\t\t\t\t`[devstack] endpoint ${JSON.stringify(endpoint)} has no conventional URL fallback. ` +\n\t\t\t\t`Supported endpoints: ${supported.length === 0 ? '(none)' : supported.join(', ')}. ` +\n\t\t\t\t`Check the endpoint name or write the manifest first via \\`devstack up\\`.`,\n\t\t});\n\t}\n\tconst cwd = opts.cwd ?? process.cwd();\n\tconst env = opts.env ?? (process.env as Readonly<Record<string, string | undefined>>);\n\tconst stack = resolveBuildIntegrationStack(opts.stack, env);\n\t// `DEVSTACK_APP` is the caller-injectable app name; `readAppName(cwd)` is\n\t// the package.json walk-up. The env bag wins so test fixtures don't leak\n\t// the host's package metadata into the cold-start URL.\n\tconst app = opts.app ?? env.DEVSTACK_APP ?? readAppName(cwd) ?? basename(cwd);\n\treturn conventionalRouteUrl({\n\t\troute,\n\t\tservice: route.service,\n\t\tapp,\n\t\tstack,\n\t\t...(opts.hostSuffix !== undefined ? { hostSuffix: opts.hostSuffix } : {}),\n\t\t// h2c shares port 80 with HTTP/1 via Traefik; both wire\n\t\t// protocols expose `http://` URLs at the entrypoint.\n\t\tscheme: 'http',\n\t});\n};\n\n/** `undefined`-on-miss variant. */\nexport const tryColdStartUrl = (\n\tendpoint: string,\n\topts: ColdStartUrlOptions,\n): string | undefined => {\n\tif (!opts.routes.has(endpoint)) return undefined;\n\treturn coldStartUrl(endpoint, opts);\n};\n"],"mappings":";;;;AAqGA,MAAa,yBAAyB,UAA8C;CACnF,MAAM,aAAa,MAAM,cAAc;AACvC,QAAO,MAAM,UAAU,SACpB,GAAG,MAAM,QAAQ,GAAG,MAAM,MAAM,eAChC,GAAG,MAAM,QAAQ,GAAG,MAAM,MAAM,GAAG,MAAM,MAAM;;AAGnD,MAAa,wBAAwB,UAA6C;CAGjF,MAAM,MAAM,GAFG,MAAM,UAAU,OAET,KADT,sBAAsB,MACJ,CAAC,GAAG,MAAM,MAAM;AAC/C,QAAO,MAAM,kBAAkB,OAAO,GAAG,IAAI,KAAK;;AAGnD,MAAa,+BACZ,OACA,SAEA,IAAI,IACH,MAAM,KAAK,SAAsC,CAChD,KAAK,UACL;CACC,SAAS,KAAK;CACd;CACA,cAAc,KAAK,gBAAgB;CACnC,CACD,CAAC,CACF;;;;;;;;;AAUF,MAAa,gBAAgB,UAAkB,SAAsC;CACpF,MAAM,QAAQ,KAAK,OAAO,IAAI,SAAS;AACvC,KAAI,UAAU,KAAA,GAAW;EACxB,MAAM,YAAY,CAAC,GAAG,KAAK,OAAO,MAAM,CAAC,CAAC,MAAM;AAChD,QAAM,IAAI,yBAAyB;GAClC;GACA;GACA,SACC,uBAAuB,KAAK,UAAU,SAAS,CAAC,0DACxB,UAAU,WAAW,IAAI,WAAW,UAAU,KAAK,KAAK,CAAC;GAElF,CAAC;;CAEH,MAAM,MAAM,KAAK,OAAO,QAAQ,KAAK;CACrC,MAAM,MAAM,KAAK,OAAQ,QAAQ;CACjC,MAAM,QAAQ,6BAA6B,KAAK,OAAO,IAAI;CAI3D,MAAM,MAAM,KAAK,OAAO,IAAI,gBAAgB,YAAY,IAAI,IAAI,SAAS,IAAI;AAC7E,QAAO,qBAAqB;EAC3B;EACA,SAAS,MAAM;EACf;EACA;EACA,GAAI,KAAK,eAAe,KAAA,IAAY,EAAE,YAAY,KAAK,YAAY,GAAG,EAAE;EAGxE,QAAQ;EACR,CAAC;;;AAIH,MAAa,mBACZ,UACA,SACwB;AACxB,KAAI,CAAC,KAAK,OAAO,IAAI,SAAS,CAAE,QAAO,KAAA;AACvC,QAAO,aAAa,UAAU,KAAK"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ConventionalRoute, ConventionalRouteHint } from "./cold-start-url.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/build-integrations/runtime/conventional-routes.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* The Traefik entrypoint port the supervisor's router maps every
|
|
6
|
+
* conventional endpoint to. All built-in routes share this single port
|
|
7
|
+
* because Traefik dispatches by Host header, not by port. If a future
|
|
8
|
+
* plugin requires a distinct entrypoint port it would extend
|
|
9
|
+
* `BUILT_IN_CONVENTIONAL_HINTS` AND extend the router profile to add
|
|
10
|
+
* the entrypoint; until then, one port covers every built-in.
|
|
11
|
+
*/
|
|
12
|
+
declare const DEFAULT_ROUTER_ENTRYPOINT_PORT: 5175;
|
|
13
|
+
/**
|
|
14
|
+
* Endpoint-name aliases the conventional-route resolver folds before
|
|
15
|
+
* looking up a row. Lets in-spec helpers reach `endpoint('app')` or
|
|
16
|
+
* `endpoint('wallet')` without knowing the router's canonical
|
|
17
|
+
* spelling (`'dev'` / `'wallet-app'`). Aliases are bidirectional in
|
|
18
|
+
* intent — the table key is the alias users type; the value is the
|
|
19
|
+
* service segment routed in the manifest.
|
|
20
|
+
*
|
|
21
|
+
* The wallet entry sources both sides from the name-blind contract
|
|
22
|
+
* (via the L5 bridge in `wallet-paths.ts`) so there is exactly one
|
|
23
|
+
* source of truth for the alias/canonical pairing — see
|
|
24
|
+
* `WALLET_ENDPOINT_KEY` in `contracts/wallet-protocol.ts`.
|
|
25
|
+
*/
|
|
26
|
+
declare const BUILT_IN_ENDPOINT_ALIASES: {
|
|
27
|
+
readonly app: "dev";
|
|
28
|
+
readonly wallet: "wallet-app";
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Conventional endpoint→service hints for every built-in plugin that
|
|
32
|
+
* publishes a Routable. Build integrations consume this through
|
|
33
|
+
* `builtInConventionalRoutes()` rather than each carrying their own
|
|
34
|
+
* copy. The substrate stays open: callers may extend by passing extra
|
|
35
|
+
* hints to `coldStartUrl` directly.
|
|
36
|
+
*/
|
|
37
|
+
declare const BUILT_IN_CONVENTIONAL_HINTS: ReadonlyArray<ConventionalRouteHint>;
|
|
38
|
+
/**
|
|
39
|
+
* Resolve the built-in conventional route table. `port` overrides the
|
|
40
|
+
* default entrypoint port (set by env / explicit caller option). The
|
|
41
|
+
* resulting `Map` is the shape `coldStartUrl({ routes })` consumes.
|
|
42
|
+
*/
|
|
43
|
+
declare const builtInConventionalRoutes: (port?: number) => ReadonlyMap<string, ConventionalRoute>;
|
|
44
|
+
/**
|
|
45
|
+
* Look up the alias-resolved endpoint key for a user-typed name.
|
|
46
|
+
* Returns the input unchanged when no alias is registered.
|
|
47
|
+
*/
|
|
48
|
+
declare const resolveBuiltInEndpointAlias: (endpointNameOrAlias: string) => string;
|
|
49
|
+
//#endregion
|
|
50
|
+
export { BUILT_IN_CONVENTIONAL_HINTS, BUILT_IN_ENDPOINT_ALIASES, DEFAULT_ROUTER_ENTRYPOINT_PORT, builtInConventionalRoutes, resolveBuiltInEndpointAlias };
|
|
51
|
+
//# sourceMappingURL=conventional-routes.d.mts.map
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { WALLET_ENDPOINT_KEY, WALLET_ENDPOINT_NAME } from "../../contracts/wallet-protocol.mjs";
|
|
2
|
+
import { conventionalRoutesFromHints } from "./cold-start-url.mjs";
|
|
3
|
+
import "./wallet-paths.mjs";
|
|
4
|
+
//#region src/build-integrations/runtime/conventional-routes.ts
|
|
5
|
+
/**
|
|
6
|
+
* The Traefik entrypoint port the supervisor's router maps every
|
|
7
|
+
* conventional endpoint to. All built-in routes share this single port
|
|
8
|
+
* because Traefik dispatches by Host header, not by port. If a future
|
|
9
|
+
* plugin requires a distinct entrypoint port it would extend
|
|
10
|
+
* `BUILT_IN_CONVENTIONAL_HINTS` AND extend the router profile to add
|
|
11
|
+
* the entrypoint; until then, one port covers every built-in.
|
|
12
|
+
*/
|
|
13
|
+
const DEFAULT_ROUTER_ENTRYPOINT_PORT = 5175;
|
|
14
|
+
/**
|
|
15
|
+
* Endpoint-name aliases the conventional-route resolver folds before
|
|
16
|
+
* looking up a row. Lets in-spec helpers reach `endpoint('app')` or
|
|
17
|
+
* `endpoint('wallet')` without knowing the router's canonical
|
|
18
|
+
* spelling (`'dev'` / `'wallet-app'`). Aliases are bidirectional in
|
|
19
|
+
* intent — the table key is the alias users type; the value is the
|
|
20
|
+
* service segment routed in the manifest.
|
|
21
|
+
*
|
|
22
|
+
* The wallet entry sources both sides from the name-blind contract
|
|
23
|
+
* (via the L5 bridge in `wallet-paths.ts`) so there is exactly one
|
|
24
|
+
* source of truth for the alias/canonical pairing — see
|
|
25
|
+
* `WALLET_ENDPOINT_KEY` in `contracts/wallet-protocol.ts`.
|
|
26
|
+
*/
|
|
27
|
+
const BUILT_IN_ENDPOINT_ALIASES = {
|
|
28
|
+
app: "dev",
|
|
29
|
+
[WALLET_ENDPOINT_KEY]: WALLET_ENDPOINT_NAME
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Conventional endpoint→service hints for every built-in plugin that
|
|
33
|
+
* publishes a Routable. Build integrations consume this through
|
|
34
|
+
* `builtInConventionalRoutes()` rather than each carrying their own
|
|
35
|
+
* copy. The substrate stays open: callers may extend by passing extra
|
|
36
|
+
* hints to `coldStartUrl` directly.
|
|
37
|
+
*/
|
|
38
|
+
const BUILT_IN_CONVENTIONAL_HINTS = [
|
|
39
|
+
{
|
|
40
|
+
endpoint: "app",
|
|
41
|
+
service: "dev"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
endpoint: "dev",
|
|
45
|
+
service: "dev"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
endpoint: "sui-rpc",
|
|
49
|
+
service: "sui-rpc"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
endpoint: "sui-faucet",
|
|
53
|
+
service: "sui-faucet"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
endpoint: "walrus-aggregator",
|
|
57
|
+
service: "walrus-aggregator"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
endpoint: "walrus-publisher",
|
|
61
|
+
service: "walrus-publisher"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
endpoint: "seal",
|
|
65
|
+
service: "seal"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
endpoint: WALLET_ENDPOINT_KEY,
|
|
69
|
+
service: "api"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
endpoint: WALLET_ENDPOINT_NAME,
|
|
73
|
+
service: "api"
|
|
74
|
+
}
|
|
75
|
+
];
|
|
76
|
+
/**
|
|
77
|
+
* Resolve the built-in conventional route table. `port` overrides the
|
|
78
|
+
* default entrypoint port (set by env / explicit caller option). The
|
|
79
|
+
* resulting `Map` is the shape `coldStartUrl({ routes })` consumes.
|
|
80
|
+
*/
|
|
81
|
+
const builtInConventionalRoutes = (port = DEFAULT_ROUTER_ENTRYPOINT_PORT) => conventionalRoutesFromHints(BUILT_IN_CONVENTIONAL_HINTS, port);
|
|
82
|
+
/**
|
|
83
|
+
* Look up the alias-resolved endpoint key for a user-typed name.
|
|
84
|
+
* Returns the input unchanged when no alias is registered.
|
|
85
|
+
*/
|
|
86
|
+
const resolveBuiltInEndpointAlias = (endpointNameOrAlias) => {
|
|
87
|
+
return BUILT_IN_ENDPOINT_ALIASES[endpointNameOrAlias] ?? endpointNameOrAlias;
|
|
88
|
+
};
|
|
89
|
+
//#endregion
|
|
90
|
+
export { BUILT_IN_CONVENTIONAL_HINTS, BUILT_IN_ENDPOINT_ALIASES, DEFAULT_ROUTER_ENTRYPOINT_PORT, builtInConventionalRoutes, resolveBuiltInEndpointAlias };
|
|
91
|
+
|
|
92
|
+
//# sourceMappingURL=conventional-routes.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conventional-routes.mjs","names":["aliases"],"sources":["../../../src/build-integrations/runtime/conventional-routes.ts"],"sourcesContent":["// Conventional-routes table — substrate-owned defaults for the\n// \"config-load before manifest\" cold-start path.\n//\n// Build integrations (Playwright, vitest, …) that need an endpoint URL\n// BEFORE the supervisor has written the manifest go through\n// `coldStartUrl(endpoint, { routes, ... })`. The route table itself is\n// a parameter — `runtime/coldStartUrl` deliberately stays\n// service-name-blind. THIS module supplies the conventional table the\n// router plugin would populate at supervise-time, so build integrations\n// don't each carry their own copy.\n//\n// Add a new built-in service: add one entry here AND ship a Routable\n// plugin that publishes the matching `<service>` hostname at the same\n// port. Architecture invariant \"conventional URL convergence\" — the\n// fallback returned by `coldStartUrl({ routes })` MUST equal the URL\n// the router publishes once the manifest exists.\n//\n// This is the L5 cold-start mirror of the router plugin's runtime\n// table. The L5 surface (Playwright / vitest) consults it once; the\n// runtime table wins as soon as the manifest is on disk.\n\nimport {\n\tconventionalRoutesFromHints,\n\ttype ConventionalRoute,\n\ttype ConventionalRouteHint,\n} from './cold-start-url.ts';\nimport { WALLET_ENDPOINT_KEY, WALLET_ENDPOINT_NAME } from './wallet-paths.ts';\n\n/**\n * The Traefik entrypoint port the supervisor's router maps every\n * conventional endpoint to. All built-in routes share this single port\n * because Traefik dispatches by Host header, not by port. If a future\n * plugin requires a distinct entrypoint port it would extend\n * `BUILT_IN_CONVENTIONAL_HINTS` AND extend the router profile to add\n * the entrypoint; until then, one port covers every built-in.\n */\nexport const DEFAULT_ROUTER_ENTRYPOINT_PORT = 5175 as const;\n\n/**\n * Endpoint-name aliases the conventional-route resolver folds before\n * looking up a row. Lets in-spec helpers reach `endpoint('app')` or\n * `endpoint('wallet')` without knowing the router's canonical\n * spelling (`'dev'` / `'wallet-app'`). Aliases are bidirectional in\n * intent — the table key is the alias users type; the value is the\n * service segment routed in the manifest.\n *\n * The wallet entry sources both sides from the name-blind contract\n * (via the L5 bridge in `wallet-paths.ts`) so there is exactly one\n * source of truth for the alias/canonical pairing — see\n * `WALLET_ENDPOINT_KEY` in `contracts/wallet-protocol.ts`.\n */\nexport const BUILT_IN_ENDPOINT_ALIASES = {\n\tapp: 'dev',\n\t[WALLET_ENDPOINT_KEY]: WALLET_ENDPOINT_NAME,\n} as const;\n\n/**\n * Conventional endpoint→service hints for every built-in plugin that\n * publishes a Routable. Build integrations consume this through\n * `builtInConventionalRoutes()` rather than each carrying their own\n * copy. The substrate stays open: callers may extend by passing extra\n * hints to `coldStartUrl` directly.\n */\nexport const BUILT_IN_CONVENTIONAL_HINTS: ReadonlyArray<ConventionalRouteHint> = [\n\t{ endpoint: 'app', service: 'dev' },\n\t{ endpoint: 'dev', service: 'dev' },\n\t{ endpoint: 'sui-rpc', service: 'sui-rpc' },\n\t{ endpoint: 'sui-faucet', service: 'sui-faucet' },\n\t{ endpoint: 'walrus-aggregator', service: 'walrus-aggregator' },\n\t{ endpoint: 'walrus-publisher', service: 'walrus-publisher' },\n\t{ endpoint: 'seal', service: 'seal' },\n\t{ endpoint: WALLET_ENDPOINT_KEY, service: 'api' },\n\t{ endpoint: WALLET_ENDPOINT_NAME, service: 'api' },\n];\n\n/**\n * Resolve the built-in conventional route table. `port` overrides the\n * default entrypoint port (set by env / explicit caller option). The\n * resulting `Map` is the shape `coldStartUrl({ routes })` consumes.\n */\nexport const builtInConventionalRoutes = (\n\tport: number = DEFAULT_ROUTER_ENTRYPOINT_PORT,\n): ReadonlyMap<string, ConventionalRoute> =>\n\tconventionalRoutesFromHints(BUILT_IN_CONVENTIONAL_HINTS, port);\n\n/**\n * Look up the alias-resolved endpoint key for a user-typed name.\n * Returns the input unchanged when no alias is registered.\n */\nexport const resolveBuiltInEndpointAlias = (endpointNameOrAlias: string): string => {\n\tconst aliases: Readonly<Record<string, string>> = BUILT_IN_ENDPOINT_ALIASES;\n\treturn aliases[endpointNameOrAlias] ?? endpointNameOrAlias;\n};\n"],"mappings":";;;;;;;;;;;;AAoCA,MAAa,iCAAiC;;;;;;;;;;;;;;AAe9C,MAAa,4BAA4B;CACxC,KAAK;EACJ,sBAAsB;CACvB;;;;;;;;AASD,MAAa,8BAAoE;CAChF;EAAE,UAAU;EAAO,SAAS;EAAO;CACnC;EAAE,UAAU;EAAO,SAAS;EAAO;CACnC;EAAE,UAAU;EAAW,SAAS;EAAW;CAC3C;EAAE,UAAU;EAAc,SAAS;EAAc;CACjD;EAAE,UAAU;EAAqB,SAAS;EAAqB;CAC/D;EAAE,UAAU;EAAoB,SAAS;EAAoB;CAC7D;EAAE,UAAU;EAAQ,SAAS;EAAQ;CACrC;EAAE,UAAU;EAAqB,SAAS;EAAO;CACjD;EAAE,UAAU;EAAsB,SAAS;EAAO;CAClD;;;;;;AAOD,MAAa,6BACZ,OAAe,mCAEf,4BAA4B,6BAA6B,KAAK;;;;;AAM/D,MAAa,+BAA+B,wBAAwC;AAEnF,QAAOA,0BAAQ,wBAAwB"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
//#region src/build-integrations/runtime/discover.d.ts
|
|
2
2
|
/** Default name of the supervisor's per-user state directory. Mirrors
|
|
3
3
|
* the L0 path resolver. Held here as a literal so the discover walk
|
|
4
|
-
* doesn't reach into the substrate package.
|
|
4
|
+
* doesn't reach into the substrate package. Re-export of the
|
|
5
|
+
* shared-resolver default so this module's public surface is stable. */
|
|
5
6
|
declare const DEFAULT_STATE_DIR = ".devstack";
|
|
6
7
|
/** Default stack name when neither `opts.stack` nor `$DEVSTACK_STACK`
|
|
7
8
|
* yields a useful value. */
|
|
@@ -16,9 +17,10 @@ interface DiscoverManifestPathOptions {
|
|
|
16
17
|
readonly cwd?: string;
|
|
17
18
|
/** Stack name. Defaults through `$DEVSTACK_STACK`, then `'main'`. */
|
|
18
19
|
readonly stack?: string;
|
|
19
|
-
/** State-dir name. Defaults
|
|
20
|
-
*
|
|
21
|
-
*
|
|
20
|
+
/** State-dir name. Defaults through `$DEVSTACK_RUNTIME_ROOT`, then
|
|
21
|
+
* the legacy `$DEVSTACK_STATE_DIR`, then `'.devstack'` (see
|
|
22
|
+
* `resolveDiscoveryEnv`). Absolute paths are honored — the walk-up
|
|
23
|
+
* degenerates into a single existence check in that case. */
|
|
22
24
|
readonly stateDir?: string;
|
|
23
25
|
/** Env bag for the env-precedence step. Defaults to `process.env`.
|
|
24
26
|
* Tests pass a fixture (often `{}`) to suppress leaks from the
|
|
@@ -29,25 +31,6 @@ interface DiscoverManifestPathOptions {
|
|
|
29
31
|
* "no manifest" as cold-start branch cleanly). */
|
|
30
32
|
readonly required?: boolean;
|
|
31
33
|
}
|
|
32
|
-
interface BuildIntegrationIdentity {
|
|
33
|
-
readonly app: string | undefined;
|
|
34
|
-
readonly stack: string;
|
|
35
|
-
readonly stateDir: string;
|
|
36
|
-
readonly manifestPath: string;
|
|
37
|
-
}
|
|
38
|
-
interface DiscoverBuildIntegrationIdentityOptions {
|
|
39
|
-
/** Resolution cwd. Defaults to `process.cwd()`. */
|
|
40
|
-
readonly cwd?: string;
|
|
41
|
-
/** Explicit app name. Overrides env + package.json walk-up. */
|
|
42
|
-
readonly app?: string;
|
|
43
|
-
/** Explicit stack name. Overrides `DEVSTACK_STACK`; otherwise
|
|
44
|
-
* defaults to `main`. */
|
|
45
|
-
readonly stack?: string;
|
|
46
|
-
/** Explicit state-dir name. Overrides `DEVSTACK_STATE_DIR`. */
|
|
47
|
-
readonly stateDir?: string;
|
|
48
|
-
/** Env bag for tests and config loaders. Defaults to `process.env`. */
|
|
49
|
-
readonly env?: Readonly<Record<string, string | undefined>>;
|
|
50
|
-
}
|
|
51
34
|
/** Read `name` out of `<dir>/package.json`, strip the `@scope/`
|
|
52
35
|
* prefix and any leading non-alphanumerics. Returns `undefined`
|
|
53
36
|
* when the file is missing / unreadable / has no name field. */
|
|
@@ -56,12 +39,7 @@ declare const readAppName: (dir: string) => string | undefined;
|
|
|
56
39
|
* its un-scoped `name` field. Returns `undefined` if no package.json
|
|
57
40
|
* is reachable. Bounded to 32 levels — defense against pathological
|
|
58
41
|
* symlink loops. */
|
|
59
|
-
declare const readAppNameWalkup: (cwd
|
|
60
|
-
/** Resolve the framework-neutral identity tuple build integrations
|
|
61
|
-
* need at config-load time. The manifest path is returned even when
|
|
62
|
-
* it does not exist yet so cold-start callers can still compute
|
|
63
|
-
* conventional URLs and watch-ignore paths. */
|
|
64
|
-
declare const discoverBuildIntegrationIdentity: (options?: DiscoverBuildIntegrationIdentityOptions) => BuildIntegrationIdentity;
|
|
42
|
+
declare const readAppNameWalkup: (cwd?: string) => string | undefined;
|
|
65
43
|
/**
|
|
66
44
|
* Locate an existing devstack manifest on disk. Sync — Playwright's
|
|
67
45
|
* config loader and apps' startup paths both depend on this being
|
|
@@ -73,6 +51,36 @@ declare const discoverBuildIntegrationIdentity: (options?: DiscoverBuildIntegrat
|
|
|
73
51
|
* on miss instead.
|
|
74
52
|
*/
|
|
75
53
|
declare function discoverManifestPath(opts?: DiscoverManifestPathOptions): string | undefined;
|
|
54
|
+
interface DiscoverSingleStackManifestPathOptions {
|
|
55
|
+
/** Starting directory for the walk-up. Defaults to `process.cwd()`. */
|
|
56
|
+
readonly cwd?: string;
|
|
57
|
+
/** State-dir name. Defaults to `.devstack`. Absolute paths are
|
|
58
|
+
* honored — the walk-up degenerates into a single existence check
|
|
59
|
+
* in that case. */
|
|
60
|
+
readonly stateDir?: string;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Walks up from `cwd` looking for a `<stateDir>` that contains EXACTLY
|
|
64
|
+
* ONE stack subdirectory; returns that stack's `manifest.json` path.
|
|
65
|
+
* Returns `null` when zero or >1 stacks are found at every ancestor.
|
|
66
|
+
*
|
|
67
|
+
* Used by integrations that need a no-explicit-stack auto-detect mode
|
|
68
|
+
* (Playwright preset; future Vitest cold-start). The contract:
|
|
69
|
+
*
|
|
70
|
+
* - At each ancestor, list `<ancestor>/<stateDir>/stacks/*`.
|
|
71
|
+
* - If exactly one stack dir with a `manifest.json` exists at that
|
|
72
|
+
* level: return its path. Stop walking.
|
|
73
|
+
* - If >1 stacks exist at that level: ambiguous → return `null` (do
|
|
74
|
+
* NOT continue walking past an ambiguous level).
|
|
75
|
+
* - If 0 stacks exist at that level: continue walking up.
|
|
76
|
+
* - If the filesystem root is reached without resolution: return
|
|
77
|
+
* `null`.
|
|
78
|
+
*
|
|
79
|
+
* Pure — does not consult env vars. Callers do their own gating (the
|
|
80
|
+
* Playwright preset only invokes this when no explicit stack was
|
|
81
|
+
* supplied via option or env).
|
|
82
|
+
*/
|
|
83
|
+
declare const discoverSingleStackManifestPath: (options?: DiscoverSingleStackManifestPathOptions) => string | null;
|
|
76
84
|
//#endregion
|
|
77
|
-
export {
|
|
85
|
+
export { DEFAULT_STACK, DEFAULT_STATE_DIR, DiscoverManifestPathOptions, DiscoverSingleStackManifestPathOptions, discoverManifestPath, discoverSingleStackManifestPath, readAppName, readAppNameWalkup };
|
|
78
86
|
//# sourceMappingURL=discover.d.mts.map
|
|
@@ -1,70 +1,27 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DEFAULT_DISCOVERY_STACK, DEFAULT_DISCOVERY_STATE_DIR, resolveDiscoveryEnv } from "./resolve-discovery-env.mjs";
|
|
2
|
+
import { inferPackageNameFromCwd, readPackageName } from "../../api/inference-network.mjs";
|
|
2
3
|
import { ManifestDiscoveryError } from "./errors.mjs";
|
|
3
|
-
import { existsSync,
|
|
4
|
-
import { dirname, join, resolve } from "node:path";
|
|
4
|
+
import { existsSync, readdirSync } from "node:fs";
|
|
5
|
+
import { dirname, isAbsolute, join, resolve } from "node:path";
|
|
5
6
|
//#region src/build-integrations/runtime/discover.ts
|
|
6
7
|
/** Default name of the supervisor's per-user state directory. Mirrors
|
|
7
8
|
* the L0 path resolver. Held here as a literal so the discover walk
|
|
8
|
-
* doesn't reach into the substrate package.
|
|
9
|
-
|
|
9
|
+
* doesn't reach into the substrate package. Re-export of the
|
|
10
|
+
* shared-resolver default so this module's public surface is stable. */
|
|
11
|
+
const DEFAULT_STATE_DIR = DEFAULT_DISCOVERY_STATE_DIR;
|
|
10
12
|
/** Default stack name when neither `opts.stack` nor `$DEVSTACK_STACK`
|
|
11
13
|
* yields a useful value. */
|
|
12
|
-
const DEFAULT_STACK =
|
|
13
|
-
const resolveBuildIntegrationStack = (explicit, env = process.env) => {
|
|
14
|
-
const trimmed = (explicit ?? env.DEVSTACK_STACK)?.trim();
|
|
15
|
-
return trimmed !== void 0 && trimmed.length > 0 ? trimmed : DEFAULT_STACK;
|
|
16
|
-
};
|
|
14
|
+
const DEFAULT_STACK = DEFAULT_DISCOVERY_STACK;
|
|
15
|
+
const resolveBuildIntegrationStack = (explicit, env = process.env) => resolveDiscoveryEnv(env, explicit !== void 0 ? { stack: explicit } : {}).stack;
|
|
17
16
|
/** Read `name` out of `<dir>/package.json`, strip the `@scope/`
|
|
18
17
|
* prefix and any leading non-alphanumerics. Returns `undefined`
|
|
19
18
|
* when the file is missing / unreadable / has no name field. */
|
|
20
|
-
const readAppName =
|
|
21
|
-
try {
|
|
22
|
-
const pkg = JSON.parse(readFileSync(resolve(dir, "package.json"), "utf8"));
|
|
23
|
-
if (typeof pkg.name !== "string") return void 0;
|
|
24
|
-
const stripped = pkg.name.replace(/^@[^/]+\//, "").replace(/^[^a-zA-Z0-9]+/, "");
|
|
25
|
-
return stripped.length > 0 ? stripped : void 0;
|
|
26
|
-
} catch {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
};
|
|
19
|
+
const readAppName = readPackageName;
|
|
30
20
|
/** Walk up from `cwd` to find the closest `package.json` and return
|
|
31
21
|
* its un-scoped `name` field. Returns `undefined` if no package.json
|
|
32
22
|
* is reachable. Bounded to 32 levels — defense against pathological
|
|
33
23
|
* symlink loops. */
|
|
34
|
-
const readAppNameWalkup =
|
|
35
|
-
let dir = resolve(cwd);
|
|
36
|
-
for (let i = 0; i < 32; i += 1) {
|
|
37
|
-
const name = readAppName(dir);
|
|
38
|
-
if (name !== void 0) return name;
|
|
39
|
-
const parent = dirname(dir);
|
|
40
|
-
if (parent === dir) return void 0;
|
|
41
|
-
dir = parent;
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
/** Resolve the framework-neutral identity tuple build integrations
|
|
45
|
-
* need at config-load time. The manifest path is returned even when
|
|
46
|
-
* it does not exist yet so cold-start callers can still compute
|
|
47
|
-
* conventional URLs and watch-ignore paths. */
|
|
48
|
-
const discoverBuildIntegrationIdentity = (options = {}) => {
|
|
49
|
-
const env = options.env ?? process.env;
|
|
50
|
-
const cwd = options.cwd ?? process.cwd();
|
|
51
|
-
const stack = resolveBuildIntegrationStack(options.stack, env);
|
|
52
|
-
const stateDirName = options.stateDir ?? env.DEVSTACK_STATE_DIR ?? ".devstack";
|
|
53
|
-
const discovered = discoverManifestPath({
|
|
54
|
-
cwd,
|
|
55
|
-
stack,
|
|
56
|
-
stateDir: stateDirName,
|
|
57
|
-
env
|
|
58
|
-
});
|
|
59
|
-
const manifestPath = discovered ?? resolve(cwd, stateDirName, "stacks", stack, "manifest.json");
|
|
60
|
-
const stateDir = discovered !== void 0 ? dirname(dirname(dirname(discovered))) : resolve(cwd, stateDirName);
|
|
61
|
-
return {
|
|
62
|
-
app: options.app ?? env.DEVSTACK_APP ?? readAppNameWalkup(cwd),
|
|
63
|
-
stack,
|
|
64
|
-
stateDir,
|
|
65
|
-
manifestPath
|
|
66
|
-
};
|
|
67
|
-
};
|
|
24
|
+
const readAppNameWalkup = inferPackageNameFromCwd;
|
|
68
25
|
/**
|
|
69
26
|
* Locate an existing devstack manifest on disk. Sync — Playwright's
|
|
70
27
|
* config loader and apps' startup paths both depend on this being
|
|
@@ -81,36 +38,39 @@ function discoverManifestPath(opts = {}) {
|
|
|
81
38
|
if (envOverride !== void 0 && envOverride !== "") {
|
|
82
39
|
const resolved = resolve(envOverride);
|
|
83
40
|
if (existsSync(resolved)) return resolved;
|
|
84
|
-
|
|
41
|
+
throw new ManifestDiscoveryError({
|
|
85
42
|
phase: "env-missing",
|
|
86
43
|
path: resolved,
|
|
87
44
|
message: `[devstack] DEVSTACK_MANIFEST_PATH points at ${resolved}, but no file exists there. Unset the env var or run \`devstack up\` to write the manifest.`
|
|
88
45
|
});
|
|
89
|
-
return;
|
|
90
46
|
}
|
|
91
47
|
if (opts.override !== void 0 && opts.override !== "") {
|
|
92
48
|
const resolved = resolve(opts.override);
|
|
93
49
|
if (existsSync(resolved)) return resolved;
|
|
94
|
-
|
|
50
|
+
throw new ManifestDiscoveryError({
|
|
95
51
|
phase: "override-missing",
|
|
96
52
|
path: resolved,
|
|
97
53
|
message: `[devstack] explicit manifest path ${resolved} does not exist. Run \`devstack up\` to write the manifest first.`
|
|
98
54
|
});
|
|
99
|
-
return;
|
|
100
55
|
}
|
|
101
56
|
const startDir = opts.cwd ?? process.cwd();
|
|
102
|
-
const stack =
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
57
|
+
const { stack, stateDir } = resolveDiscoveryEnv(env, {
|
|
58
|
+
...opts.stack !== void 0 ? { stack: opts.stack } : {},
|
|
59
|
+
...opts.stateDir !== void 0 ? { stateDir: opts.stateDir } : {}
|
|
60
|
+
});
|
|
61
|
+
const candidates = isAbsolute(stateDir) ? [join(stateDir, "stacks", stack, "manifest.json")] : (() => {
|
|
62
|
+
const acc = [];
|
|
63
|
+
let dir = resolve(startDir);
|
|
64
|
+
while (true) {
|
|
65
|
+
acc.push(join(dir, stateDir, "stacks", stack, "manifest.json"));
|
|
66
|
+
const parent = dirname(dir);
|
|
67
|
+
if (parent === dir) return acc;
|
|
68
|
+
dir = parent;
|
|
69
|
+
}
|
|
70
|
+
})();
|
|
71
|
+
for (const candidate of candidates) if (existsSync(candidate)) return candidate;
|
|
112
72
|
if (opts.required === true) {
|
|
113
|
-
const expected = resolve(startDir, stateDir, "stacks", stack, "manifest.json");
|
|
73
|
+
const expected = isAbsolute(stateDir) ? join(stateDir, "stacks", stack, "manifest.json") : resolve(startDir, stateDir, "stacks", stack, "manifest.json");
|
|
114
74
|
throw new ManifestDiscoveryError({
|
|
115
75
|
phase: "walk-up",
|
|
116
76
|
path: expected,
|
|
@@ -118,7 +78,50 @@ function discoverManifestPath(opts = {}) {
|
|
|
118
78
|
});
|
|
119
79
|
}
|
|
120
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* Walks up from `cwd` looking for a `<stateDir>` that contains EXACTLY
|
|
83
|
+
* ONE stack subdirectory; returns that stack's `manifest.json` path.
|
|
84
|
+
* Returns `null` when zero or >1 stacks are found at every ancestor.
|
|
85
|
+
*
|
|
86
|
+
* Used by integrations that need a no-explicit-stack auto-detect mode
|
|
87
|
+
* (Playwright preset; future Vitest cold-start). The contract:
|
|
88
|
+
*
|
|
89
|
+
* - At each ancestor, list `<ancestor>/<stateDir>/stacks/*`.
|
|
90
|
+
* - If exactly one stack dir with a `manifest.json` exists at that
|
|
91
|
+
* level: return its path. Stop walking.
|
|
92
|
+
* - If >1 stacks exist at that level: ambiguous → return `null` (do
|
|
93
|
+
* NOT continue walking past an ambiguous level).
|
|
94
|
+
* - If 0 stacks exist at that level: continue walking up.
|
|
95
|
+
* - If the filesystem root is reached without resolution: return
|
|
96
|
+
* `null`.
|
|
97
|
+
*
|
|
98
|
+
* Pure — does not consult env vars. Callers do their own gating (the
|
|
99
|
+
* Playwright preset only invokes this when no explicit stack was
|
|
100
|
+
* supplied via option or env).
|
|
101
|
+
*/
|
|
102
|
+
const discoverSingleStackManifestPath = (options = {}) => {
|
|
103
|
+
const cwd = resolve(options.cwd ?? process.cwd());
|
|
104
|
+
const stateDirName = options.stateDir ?? DEFAULT_STATE_DIR;
|
|
105
|
+
const startDirs = isAbsolute(stateDirName) ? [stateDirName] : (() => {
|
|
106
|
+
const dirs = [];
|
|
107
|
+
let dir = cwd;
|
|
108
|
+
while (true) {
|
|
109
|
+
dirs.push(join(dir, stateDirName));
|
|
110
|
+
const parent = dirname(dir);
|
|
111
|
+
if (parent === dir) return dirs;
|
|
112
|
+
dir = parent;
|
|
113
|
+
}
|
|
114
|
+
})();
|
|
115
|
+
for (const stateDir of startDirs) {
|
|
116
|
+
const stacksDir = join(stateDir, "stacks");
|
|
117
|
+
if (!existsSync(stacksDir)) continue;
|
|
118
|
+
const manifests = readdirSync(stacksDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => join(stacksDir, entry.name, "manifest.json")).filter((path) => existsSync(path)).sort();
|
|
119
|
+
if (manifests.length === 1) return manifests[0];
|
|
120
|
+
if (manifests.length > 1) return null;
|
|
121
|
+
}
|
|
122
|
+
return null;
|
|
123
|
+
};
|
|
121
124
|
//#endregion
|
|
122
|
-
export { DEFAULT_STACK, DEFAULT_STATE_DIR,
|
|
125
|
+
export { DEFAULT_STACK, DEFAULT_STATE_DIR, discoverManifestPath, discoverSingleStackManifestPath, readAppName, readAppNameWalkup, resolveBuildIntegrationStack };
|
|
123
126
|
|
|
124
127
|
//# sourceMappingURL=discover.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discover.mjs","names":[],"sources":["../../../src/build-integrations/runtime/discover.ts"],"sourcesContent":["// Manifest discovery — sync walk-up resolver.\n//\n// Read-side L5 (consumer) bridge between the on-disk manifest the\n// supervisor writes and the apps / build tools that need to find it.\n//\n// Precedence (top to bottom):\n//\n// 1. `DEVSTACK_MANIFEST_PATH` env var — top-level escape hatch. Wins\n// over every other input. If set to a missing file, returns\n// `undefined` (or throws when `required: true`).\n// 2. `override` argument — caller-explicit path. Same precedence\n// semantics as the env var, one rung lower.\n// 3. Walk up from `opts.cwd ?? process.cwd()`. At each directory,\n// check `<stateDir>/stacks/<stack>/manifest.json`. Build\n// integrations resolve `<stack>` from explicit option, then\n// `DEVSTACK_STACK`, then `main`; package metadata is app identity,\n// not an implicit manifest stack selector. The walk stops at the\n// filesystem root.\n//\n// Stack-scoped ONLY. The supervisor writes to\n// `<stateDir>/stacks/<stack>/manifest.json` exclusively; a hit at a\n// flat `<stateDir>/manifest.json` would be stale data from a deleted\n// stack, which would silently steer consumers at the wrong URLs /\n// package ids. Architecture § invariants: \"stack-scoped paths only —\n// a stale flat manifest must NOT be returned.\"\n//\n// Sync because the only host-process that drives this resolver is\n// Playwright config-load, and Playwright's loader API is sync. Cost is\n// a handful of `existsSync` calls — cheap.\n\nimport { existsSync, readFileSync } from 'node:fs';\nimport { dirname, join, resolve } from 'node:path';\n\nimport { ManifestDiscoveryError } from './errors.ts';\nimport { DEFAULT_STACK_NAME } from '../../api/inference-network.ts';\n\n/** Default name of the supervisor's per-user state directory. Mirrors\n * the L0 path resolver. Held here as a literal so the discover walk\n * doesn't reach into the substrate package. */\nexport const DEFAULT_STATE_DIR = '.devstack';\n\n/** Default stack name when neither `opts.stack` nor `$DEVSTACK_STACK`\n * yields a useful value. */\nexport const DEFAULT_STACK = DEFAULT_STACK_NAME;\n\nexport const resolveBuildIntegrationStack = (\n\texplicit: string | undefined,\n\tenv: Readonly<Record<string, string | undefined>> = process.env,\n): string => {\n\tconst selected = explicit ?? env.DEVSTACK_STACK;\n\tconst trimmed = selected?.trim();\n\treturn trimmed !== undefined && trimmed.length > 0 ? trimmed : DEFAULT_STACK;\n};\n\nexport interface DiscoverManifestPathOptions {\n\t/** Caller-supplied override path. Bypasses the walk-up but is still\n\t * existence-checked. Lower precedence than\n\t * `DEVSTACK_MANIFEST_PATH`. */\n\treadonly override?: string;\n\t/** Starting directory for the walk-up. Defaults to\n\t * `process.cwd()`. */\n\treadonly cwd?: string;\n\t/** Stack name. Defaults through `$DEVSTACK_STACK`, then `'main'`. */\n\treadonly stack?: string;\n\t/** State-dir name. Defaults to `$DEVSTACK_STATE_DIR ?? '.devstack'`.\n\t * Absolute paths are honored — the walk-up degenerates into a\n\t * single existence check in that case. */\n\treadonly stateDir?: string;\n\t/** Env bag for the env-precedence step. Defaults to `process.env`.\n\t * Tests pass a fixture (often `{}`) to suppress leaks from the\n\t * ambient environment. */\n\treadonly env?: Readonly<Record<string, string | undefined>>;\n\t/** When `true`, throw `ManifestDiscoveryError` on miss instead of\n\t * returning `undefined`. Default `false` (lets callers that treat\n\t * \"no manifest\" as cold-start branch cleanly). */\n\treadonly required?: boolean;\n}\n\nexport interface BuildIntegrationIdentity {\n\treadonly app: string | undefined;\n\treadonly stack: string;\n\treadonly stateDir: string;\n\treadonly manifestPath: string;\n}\n\nexport interface DiscoverBuildIntegrationIdentityOptions {\n\t/** Resolution cwd. Defaults to `process.cwd()`. */\n\treadonly cwd?: string;\n\t/** Explicit app name. Overrides env + package.json walk-up. */\n\treadonly app?: string;\n\t/** Explicit stack name. Overrides `DEVSTACK_STACK`; otherwise\n\t * defaults to `main`. */\n\treadonly stack?: string;\n\t/** Explicit state-dir name. Overrides `DEVSTACK_STATE_DIR`. */\n\treadonly stateDir?: string;\n\t/** Env bag for tests and config loaders. Defaults to `process.env`. */\n\treadonly env?: Readonly<Record<string, string | undefined>>;\n}\n\n/** Read `name` out of `<dir>/package.json`, strip the `@scope/`\n * prefix and any leading non-alphanumerics. Returns `undefined`\n * when the file is missing / unreadable / has no name field. */\nexport const readAppName = (dir: string): string | undefined => {\n\ttry {\n\t\tconst pkg = JSON.parse(readFileSync(resolve(dir, 'package.json'), 'utf8')) as {\n\t\t\tname?: string;\n\t\t};\n\t\tif (typeof pkg.name !== 'string') return undefined;\n\t\tconst stripped = pkg.name.replace(/^@[^/]+\\//, '').replace(/^[^a-zA-Z0-9]+/, '');\n\t\treturn stripped.length > 0 ? stripped : undefined;\n\t} catch {\n\t\treturn undefined;\n\t}\n};\n\n/** Walk up from `cwd` to find the closest `package.json` and return\n * its un-scoped `name` field. Returns `undefined` if no package.json\n * is reachable. Bounded to 32 levels — defense against pathological\n * symlink loops. */\nexport const readAppNameWalkup = (cwd: string): string | undefined => {\n\tlet dir = resolve(cwd);\n\tfor (let i = 0; i < 32; i += 1) {\n\t\tconst name = readAppName(dir);\n\t\tif (name !== undefined) return name;\n\t\tconst parent = dirname(dir);\n\t\tif (parent === dir) return undefined;\n\t\tdir = parent;\n\t}\n\treturn undefined;\n};\n\n/** Resolve the framework-neutral identity tuple build integrations\n * need at config-load time. The manifest path is returned even when\n * it does not exist yet so cold-start callers can still compute\n * conventional URLs and watch-ignore paths. */\nexport const discoverBuildIntegrationIdentity = (\n\toptions: DiscoverBuildIntegrationIdentityOptions = {},\n): BuildIntegrationIdentity => {\n\tconst env = options.env ?? (process.env as Readonly<Record<string, string | undefined>>);\n\tconst cwd = options.cwd ?? process.cwd();\n\tconst stack = resolveBuildIntegrationStack(options.stack, env);\n\tconst stateDirName = options.stateDir ?? env.DEVSTACK_STATE_DIR ?? DEFAULT_STATE_DIR;\n\n\tconst discovered = discoverManifestPath({ cwd, stack, stateDir: stateDirName, env });\n\tconst manifestPath = discovered ?? resolve(cwd, stateDirName, 'stacks', stack, 'manifest.json');\n\tconst stateDir =\n\t\tdiscovered !== undefined ? dirname(dirname(dirname(discovered))) : resolve(cwd, stateDirName);\n\tconst app = options.app ?? env.DEVSTACK_APP ?? readAppNameWalkup(cwd);\n\n\treturn { app, stack, stateDir, manifestPath };\n};\n\n/**\n * Locate an existing devstack manifest on disk. Sync — Playwright's\n * config loader and apps' startup paths both depend on this being\n * synchronous.\n *\n * Returns the absolute path of the first match per the precedence\n * documented at the top of this module, or `undefined` if no candidate\n * exists. Pass `{ required: true }` to throw `ManifestDiscoveryError`\n * on miss instead.\n */\nexport function discoverManifestPath(opts: DiscoverManifestPathOptions = {}): string | undefined {\n\tconst env = opts.env ?? (process.env as Readonly<Record<string, string | undefined>>);\n\tconst envOverride = env.DEVSTACK_MANIFEST_PATH;\n\tif (envOverride !== undefined && envOverride !== '') {\n\t\tconst resolved = resolve(envOverride);\n\t\tif (existsSync(resolved)) return resolved;\n\t\tif (opts.required === true) {\n\t\t\tthrow new ManifestDiscoveryError({\n\t\t\t\tphase: 'env-missing',\n\t\t\t\tpath: resolved,\n\t\t\t\tmessage:\n\t\t\t\t\t`[devstack] DEVSTACK_MANIFEST_PATH points at ${resolved}, but no file exists there. ` +\n\t\t\t\t\t`Unset the env var or run \\`devstack up\\` to write the manifest.`,\n\t\t\t});\n\t\t}\n\t\treturn undefined;\n\t}\n\tif (opts.override !== undefined && opts.override !== '') {\n\t\tconst resolved = resolve(opts.override);\n\t\tif (existsSync(resolved)) return resolved;\n\t\tif (opts.required === true) {\n\t\t\tthrow new ManifestDiscoveryError({\n\t\t\t\tphase: 'override-missing',\n\t\t\t\tpath: resolved,\n\t\t\t\tmessage:\n\t\t\t\t\t`[devstack] explicit manifest path ${resolved} does not exist. ` +\n\t\t\t\t\t`Run \\`devstack up\\` to write the manifest first.`,\n\t\t\t});\n\t\t}\n\t\treturn undefined;\n\t}\n\tconst startDir = opts.cwd ?? process.cwd();\n\tconst stack = resolveBuildIntegrationStack(opts.stack, env);\n\tconst stateDir = opts.stateDir ?? env.DEVSTACK_STATE_DIR ?? DEFAULT_STATE_DIR;\n\tlet dir = resolve(startDir);\n\twhile (true) {\n\t\tconst candidate = join(dir, stateDir, 'stacks', stack, 'manifest.json');\n\t\tif (existsSync(candidate)) return candidate;\n\t\tconst parent = dirname(dir);\n\t\tif (parent === dir) break;\n\t\tdir = parent;\n\t}\n\tif (opts.required === true) {\n\t\tconst expected = resolve(startDir, stateDir, 'stacks', stack, 'manifest.json');\n\t\tthrow new ManifestDiscoveryError({\n\t\t\tphase: 'walk-up',\n\t\t\tpath: expected,\n\t\t\tmessage:\n\t\t\t\t`[devstack] no manifest.json found walking up from ${startDir} ` +\n\t\t\t\t`(looked for ${stateDir}/stacks/${stack}/manifest.json at each level). ` +\n\t\t\t\t`Run \\`devstack up\\` — it writes the manifest at ${expected}.`,\n\t\t});\n\t}\n\treturn undefined;\n}\n"],"mappings":";;;;;;;;AAuCA,MAAa,oBAAoB;;;AAIjC,MAAa,gBAAgB;AAE7B,MAAa,gCACZ,UACA,MAAoD,QAAQ,QAChD;CAEZ,MAAM,WADW,YAAY,IAAI,iBACP,MAAM;AAChC,QAAO,YAAY,KAAA,KAAa,QAAQ,SAAS,IAAI,UAAU;;;;;AAmDhE,MAAa,eAAe,QAAoC;AAC/D,KAAI;EACH,MAAM,MAAM,KAAK,MAAM,aAAa,QAAQ,KAAK,eAAe,EAAE,OAAO,CAAC;AAG1E,MAAI,OAAO,IAAI,SAAS,SAAU,QAAO,KAAA;EACzC,MAAM,WAAW,IAAI,KAAK,QAAQ,aAAa,GAAG,CAAC,QAAQ,kBAAkB,GAAG;AAChF,SAAO,SAAS,SAAS,IAAI,WAAW,KAAA;SACjC;AACP;;;;;;;AAQF,MAAa,qBAAqB,QAAoC;CACrE,IAAI,MAAM,QAAQ,IAAI;AACtB,MAAK,IAAI,IAAI,GAAG,IAAI,IAAI,KAAK,GAAG;EAC/B,MAAM,OAAO,YAAY,IAAI;AAC7B,MAAI,SAAS,KAAA,EAAW,QAAO;EAC/B,MAAM,SAAS,QAAQ,IAAI;AAC3B,MAAI,WAAW,IAAK,QAAO,KAAA;AAC3B,QAAM;;;;;;;AASR,MAAa,oCACZ,UAAmD,EAAE,KACvB;CAC9B,MAAM,MAAM,QAAQ,OAAQ,QAAQ;CACpC,MAAM,MAAM,QAAQ,OAAO,QAAQ,KAAK;CACxC,MAAM,QAAQ,6BAA6B,QAAQ,OAAO,IAAI;CAC9D,MAAM,eAAe,QAAQ,YAAY,IAAI,sBAAA;CAE7C,MAAM,aAAa,qBAAqB;EAAE;EAAK;EAAO,UAAU;EAAc;EAAK,CAAC;CACpF,MAAM,eAAe,cAAc,QAAQ,KAAK,cAAc,UAAU,OAAO,gBAAgB;CAC/F,MAAM,WACL,eAAe,KAAA,IAAY,QAAQ,QAAQ,QAAQ,WAAW,CAAC,CAAC,GAAG,QAAQ,KAAK,aAAa;AAG9F,QAAO;EAAE,KAFG,QAAQ,OAAO,IAAI,gBAAgB,kBAAkB,IAAI;EAEvD;EAAO;EAAU;EAAc;;;;;;;;;;;;AAa9C,SAAgB,qBAAqB,OAAoC,EAAE,EAAsB;CAChG,MAAM,MAAM,KAAK,OAAQ,QAAQ;CACjC,MAAM,cAAc,IAAI;AACxB,KAAI,gBAAgB,KAAA,KAAa,gBAAgB,IAAI;EACpD,MAAM,WAAW,QAAQ,YAAY;AACrC,MAAI,WAAW,SAAS,CAAE,QAAO;AACjC,MAAI,KAAK,aAAa,KACrB,OAAM,IAAI,uBAAuB;GAChC,OAAO;GACP,MAAM;GACN,SACC,+CAA+C,SAAS;GAEzD,CAAC;AAEH;;AAED,KAAI,KAAK,aAAa,KAAA,KAAa,KAAK,aAAa,IAAI;EACxD,MAAM,WAAW,QAAQ,KAAK,SAAS;AACvC,MAAI,WAAW,SAAS,CAAE,QAAO;AACjC,MAAI,KAAK,aAAa,KACrB,OAAM,IAAI,uBAAuB;GAChC,OAAO;GACP,MAAM;GACN,SACC,qCAAqC,SAAS;GAE/C,CAAC;AAEH;;CAED,MAAM,WAAW,KAAK,OAAO,QAAQ,KAAK;CAC1C,MAAM,QAAQ,6BAA6B,KAAK,OAAO,IAAI;CAC3D,MAAM,WAAW,KAAK,YAAY,IAAI,sBAAA;CACtC,IAAI,MAAM,QAAQ,SAAS;AAC3B,QAAO,MAAM;EACZ,MAAM,YAAY,KAAK,KAAK,UAAU,UAAU,OAAO,gBAAgB;AACvE,MAAI,WAAW,UAAU,CAAE,QAAO;EAClC,MAAM,SAAS,QAAQ,IAAI;AAC3B,MAAI,WAAW,IAAK;AACpB,QAAM;;AAEP,KAAI,KAAK,aAAa,MAAM;EAC3B,MAAM,WAAW,QAAQ,UAAU,UAAU,UAAU,OAAO,gBAAgB;AAC9E,QAAM,IAAI,uBAAuB;GAChC,OAAO;GACP,MAAM;GACN,SACC,qDAAqD,SAAS,eAC/C,SAAS,UAAU,MAAM,iFACW,SAAS;GAC7D,CAAC"}
|
|
1
|
+
{"version":3,"file":"discover.mjs","names":[],"sources":["../../../src/build-integrations/runtime/discover.ts"],"sourcesContent":["// Manifest discovery — sync walk-up resolver.\n//\n// Read-side L5 (consumer) bridge between the on-disk manifest the\n// supervisor writes and the apps / build tools that need to find it.\n//\n// Precedence (top to bottom):\n//\n// 1. `DEVSTACK_MANIFEST_PATH` env var — top-level escape hatch. Wins\n// over every other input. If set to a missing file, returns\n// `undefined` (or throws when `required: true`).\n// 2. `override` argument — caller-explicit path. Same precedence\n// semantics as the env var, one rung lower.\n// 3. Walk up from `opts.cwd ?? process.cwd()`. At each directory,\n// check `<stateDir>/stacks/<stack>/manifest.json`. Build\n// integrations resolve `<stack>` from explicit option, then\n// `DEVSTACK_STACK`, then `main`; package metadata is app identity,\n// not an implicit manifest stack selector. The walk stops at the\n// filesystem root.\n//\n// Stack-scoped ONLY. The supervisor writes to\n// `<stateDir>/stacks/<stack>/manifest.json` exclusively; a hit at a\n// flat `<stateDir>/manifest.json` would be stale data from a deleted\n// stack, which would silently steer consumers at the wrong URLs /\n// package ids. Architecture § invariants: \"stack-scoped paths only —\n// a stale flat manifest must NOT be returned.\"\n//\n// Sync because the only host-process that drives this resolver is\n// Playwright config-load, and Playwright's loader API is sync. Cost is\n// a handful of `existsSync` calls — cheap.\n\nimport { existsSync, readdirSync } from 'node:fs';\nimport { dirname, isAbsolute, join, resolve } from 'node:path';\n\nimport { ManifestDiscoveryError } from './errors.ts';\nimport {\n\tDEFAULT_DISCOVERY_STACK,\n\tDEFAULT_DISCOVERY_STATE_DIR,\n\tresolveDiscoveryEnv,\n} from './resolve-discovery-env.ts';\nimport { inferPackageNameFromCwd, readPackageName } from '../../api/inference-network.ts';\n\n/** Default name of the supervisor's per-user state directory. Mirrors\n * the L0 path resolver. Held here as a literal so the discover walk\n * doesn't reach into the substrate package. Re-export of the\n * shared-resolver default so this module's public surface is stable. */\nexport const DEFAULT_STATE_DIR = DEFAULT_DISCOVERY_STATE_DIR;\n\n/** Default stack name when neither `opts.stack` nor `$DEVSTACK_STACK`\n * yields a useful value. */\nexport const DEFAULT_STACK = DEFAULT_DISCOVERY_STACK;\n\nexport const resolveBuildIntegrationStack = (\n\texplicit: string | undefined,\n\tenv: Readonly<Record<string, string | undefined>> = process.env,\n): string => resolveDiscoveryEnv(env, explicit !== undefined ? { stack: explicit } : {}).stack;\n\nexport interface DiscoverManifestPathOptions {\n\t/** Caller-supplied override path. Bypasses the walk-up but is still\n\t * existence-checked. Lower precedence than\n\t * `DEVSTACK_MANIFEST_PATH`. */\n\treadonly override?: string;\n\t/** Starting directory for the walk-up. Defaults to\n\t * `process.cwd()`. */\n\treadonly cwd?: string;\n\t/** Stack name. Defaults through `$DEVSTACK_STACK`, then `'main'`. */\n\treadonly stack?: string;\n\t/** State-dir name. Defaults through `$DEVSTACK_RUNTIME_ROOT`, then\n\t * the legacy `$DEVSTACK_STATE_DIR`, then `'.devstack'` (see\n\t * `resolveDiscoveryEnv`). Absolute paths are honored — the walk-up\n\t * degenerates into a single existence check in that case. */\n\treadonly stateDir?: string;\n\t/** Env bag for the env-precedence step. Defaults to `process.env`.\n\t * Tests pass a fixture (often `{}`) to suppress leaks from the\n\t * ambient environment. */\n\treadonly env?: Readonly<Record<string, string | undefined>>;\n\t/** When `true`, throw `ManifestDiscoveryError` on miss instead of\n\t * returning `undefined`. Default `false` (lets callers that treat\n\t * \"no manifest\" as cold-start branch cleanly). */\n\treadonly required?: boolean;\n}\n\n/** Read `name` out of `<dir>/package.json`, strip the `@scope/`\n * prefix and any leading non-alphanumerics. Returns `undefined`\n * when the file is missing / unreadable / has no name field. */\nexport const readAppName = readPackageName;\n\n/** Walk up from `cwd` to find the closest `package.json` and return\n * its un-scoped `name` field. Returns `undefined` if no package.json\n * is reachable. Bounded to 32 levels — defense against pathological\n * symlink loops. */\nexport const readAppNameWalkup = inferPackageNameFromCwd;\n\n/**\n * Locate an existing devstack manifest on disk. Sync — Playwright's\n * config loader and apps' startup paths both depend on this being\n * synchronous.\n *\n * Returns the absolute path of the first match per the precedence\n * documented at the top of this module, or `undefined` if no candidate\n * exists. Pass `{ required: true }` to throw `ManifestDiscoveryError`\n * on miss instead.\n */\nexport function discoverManifestPath(opts: DiscoverManifestPathOptions = {}): string | undefined {\n\tconst env = opts.env ?? (process.env as Readonly<Record<string, string | undefined>>);\n\tconst envOverride = env.DEVSTACK_MANIFEST_PATH;\n\t// Env + override misses ALWAYS throw — the `required: false` knob\n\t// only suppresses walk-up-not-found, not \"the user explicitly\n\t// pointed at a missing file.\" Silently falling back to walk-up on\n\t// a typo'd env var would steer callers at a stale ancestor manifest.\n\tif (envOverride !== undefined && envOverride !== '') {\n\t\tconst resolved = resolve(envOverride);\n\t\tif (existsSync(resolved)) return resolved;\n\t\tthrow new ManifestDiscoveryError({\n\t\t\tphase: 'env-missing',\n\t\t\tpath: resolved,\n\t\t\tmessage:\n\t\t\t\t`[devstack] DEVSTACK_MANIFEST_PATH points at ${resolved}, but no file exists there. ` +\n\t\t\t\t`Unset the env var or run \\`devstack up\\` to write the manifest.`,\n\t\t});\n\t}\n\tif (opts.override !== undefined && opts.override !== '') {\n\t\tconst resolved = resolve(opts.override);\n\t\tif (existsSync(resolved)) return resolved;\n\t\tthrow new ManifestDiscoveryError({\n\t\t\tphase: 'override-missing',\n\t\t\tpath: resolved,\n\t\t\tmessage:\n\t\t\t\t`[devstack] explicit manifest path ${resolved} does not exist. ` +\n\t\t\t\t`Run \\`devstack up\\` to write the manifest first.`,\n\t\t});\n\t}\n\tconst startDir = opts.cwd ?? process.cwd();\n\tconst { stack, stateDir } = resolveDiscoveryEnv(env, {\n\t\t...(opts.stack !== undefined ? { stack: opts.stack } : {}),\n\t\t...(opts.stateDir !== undefined ? { stateDir: opts.stateDir } : {}),\n\t});\n\t// An absolute `stateDir` / `DEVSTACK_RUNTIME_ROOT` pins the state\n\t// root, so the cwd walk-up is meaningless — `path.join` would also\n\t// drop the leading `dir` segment and mis-resolve the candidate.\n\t// Degenerate to a single existence check, mirroring\n\t// `discoverSingleStackManifestPath`.\n\tconst candidates = isAbsolute(stateDir)\n\t\t? [join(stateDir, 'stacks', stack, 'manifest.json')]\n\t\t: (() => {\n\t\t\t\tconst acc: string[] = [];\n\t\t\t\tlet dir = resolve(startDir);\n\t\t\t\twhile (true) {\n\t\t\t\t\tacc.push(join(dir, stateDir, 'stacks', stack, 'manifest.json'));\n\t\t\t\t\tconst parent = dirname(dir);\n\t\t\t\t\tif (parent === dir) return acc;\n\t\t\t\t\tdir = parent;\n\t\t\t\t}\n\t\t\t})();\n\tfor (const candidate of candidates) {\n\t\tif (existsSync(candidate)) return candidate;\n\t}\n\tif (opts.required === true) {\n\t\tconst expected = isAbsolute(stateDir)\n\t\t\t? join(stateDir, 'stacks', stack, 'manifest.json')\n\t\t\t: resolve(startDir, stateDir, 'stacks', stack, 'manifest.json');\n\t\tthrow new ManifestDiscoveryError({\n\t\t\tphase: 'walk-up',\n\t\t\tpath: expected,\n\t\t\tmessage:\n\t\t\t\t`[devstack] no manifest.json found walking up from ${startDir} ` +\n\t\t\t\t`(looked for ${stateDir}/stacks/${stack}/manifest.json at each level). ` +\n\t\t\t\t`Run \\`devstack up\\` — it writes the manifest at ${expected}.`,\n\t\t});\n\t}\n\treturn undefined;\n}\n\nexport interface DiscoverSingleStackManifestPathOptions {\n\t/** Starting directory for the walk-up. Defaults to `process.cwd()`. */\n\treadonly cwd?: string;\n\t/** State-dir name. Defaults to `.devstack`. Absolute paths are\n\t * honored — the walk-up degenerates into a single existence check\n\t * in that case. */\n\treadonly stateDir?: string;\n}\n\n/**\n * Walks up from `cwd` looking for a `<stateDir>` that contains EXACTLY\n * ONE stack subdirectory; returns that stack's `manifest.json` path.\n * Returns `null` when zero or >1 stacks are found at every ancestor.\n *\n * Used by integrations that need a no-explicit-stack auto-detect mode\n * (Playwright preset; future Vitest cold-start). The contract:\n *\n * - At each ancestor, list `<ancestor>/<stateDir>/stacks/*`.\n * - If exactly one stack dir with a `manifest.json` exists at that\n * level: return its path. Stop walking.\n * - If >1 stacks exist at that level: ambiguous → return `null` (do\n * NOT continue walking past an ambiguous level).\n * - If 0 stacks exist at that level: continue walking up.\n * - If the filesystem root is reached without resolution: return\n * `null`.\n *\n * Pure — does not consult env vars. Callers do their own gating (the\n * Playwright preset only invokes this when no explicit stack was\n * supplied via option or env).\n */\nexport const discoverSingleStackManifestPath = (\n\toptions: DiscoverSingleStackManifestPathOptions = {},\n): string | null => {\n\tconst cwd = resolve(options.cwd ?? process.cwd());\n\tconst stateDirName = options.stateDir ?? DEFAULT_STATE_DIR;\n\tconst startDirs = isAbsolute(stateDirName)\n\t\t? [stateDirName]\n\t\t: (() => {\n\t\t\t\tconst dirs: string[] = [];\n\t\t\t\tlet dir = cwd;\n\t\t\t\twhile (true) {\n\t\t\t\t\tdirs.push(join(dir, stateDirName));\n\t\t\t\t\tconst parent = dirname(dir);\n\t\t\t\t\tif (parent === dir) return dirs;\n\t\t\t\t\tdir = parent;\n\t\t\t\t}\n\t\t\t})();\n\n\tfor (const stateDir of startDirs) {\n\t\tconst stacksDir = join(stateDir, 'stacks');\n\t\tif (!existsSync(stacksDir)) continue;\n\t\tconst manifests = readdirSync(stacksDir, { withFileTypes: true })\n\t\t\t.filter((entry) => entry.isDirectory())\n\t\t\t.map((entry) => join(stacksDir, entry.name, 'manifest.json'))\n\t\t\t.filter((path) => existsSync(path))\n\t\t\t.sort();\n\t\tif (manifests.length === 1) return manifests[0]!;\n\t\tif (manifests.length > 1) return null;\n\t}\n\treturn null;\n};\n"],"mappings":";;;;;;;;;;AA6CA,MAAa,oBAAoB;;;AAIjC,MAAa,gBAAgB;AAE7B,MAAa,gCACZ,UACA,MAAoD,QAAQ,QAChD,oBAAoB,KAAK,aAAa,KAAA,IAAY,EAAE,OAAO,UAAU,GAAG,EAAE,CAAC,CAAC;;;;AA8BzF,MAAa,cAAc;;;;;AAM3B,MAAa,oBAAoB;;;;;;;;;;;AAYjC,SAAgB,qBAAqB,OAAoC,EAAE,EAAsB;CAChG,MAAM,MAAM,KAAK,OAAQ,QAAQ;CACjC,MAAM,cAAc,IAAI;AAKxB,KAAI,gBAAgB,KAAA,KAAa,gBAAgB,IAAI;EACpD,MAAM,WAAW,QAAQ,YAAY;AACrC,MAAI,WAAW,SAAS,CAAE,QAAO;AACjC,QAAM,IAAI,uBAAuB;GAChC,OAAO;GACP,MAAM;GACN,SACC,+CAA+C,SAAS;GAEzD,CAAC;;AAEH,KAAI,KAAK,aAAa,KAAA,KAAa,KAAK,aAAa,IAAI;EACxD,MAAM,WAAW,QAAQ,KAAK,SAAS;AACvC,MAAI,WAAW,SAAS,CAAE,QAAO;AACjC,QAAM,IAAI,uBAAuB;GAChC,OAAO;GACP,MAAM;GACN,SACC,qCAAqC,SAAS;GAE/C,CAAC;;CAEH,MAAM,WAAW,KAAK,OAAO,QAAQ,KAAK;CAC1C,MAAM,EAAE,OAAO,aAAa,oBAAoB,KAAK;EACpD,GAAI,KAAK,UAAU,KAAA,IAAY,EAAE,OAAO,KAAK,OAAO,GAAG,EAAE;EACzD,GAAI,KAAK,aAAa,KAAA,IAAY,EAAE,UAAU,KAAK,UAAU,GAAG,EAAE;EAClE,CAAC;CAMF,MAAM,aAAa,WAAW,SAAS,GACpC,CAAC,KAAK,UAAU,UAAU,OAAO,gBAAgB,CAAC,UAC3C;EACP,MAAM,MAAgB,EAAE;EACxB,IAAI,MAAM,QAAQ,SAAS;AAC3B,SAAO,MAAM;AACZ,OAAI,KAAK,KAAK,KAAK,UAAU,UAAU,OAAO,gBAAgB,CAAC;GAC/D,MAAM,SAAS,QAAQ,IAAI;AAC3B,OAAI,WAAW,IAAK,QAAO;AAC3B,SAAM;;KAEJ;AACN,MAAK,MAAM,aAAa,WACvB,KAAI,WAAW,UAAU,CAAE,QAAO;AAEnC,KAAI,KAAK,aAAa,MAAM;EAC3B,MAAM,WAAW,WAAW,SAAS,GAClC,KAAK,UAAU,UAAU,OAAO,gBAAgB,GAChD,QAAQ,UAAU,UAAU,UAAU,OAAO,gBAAgB;AAChE,QAAM,IAAI,uBAAuB;GAChC,OAAO;GACP,MAAM;GACN,SACC,qDAAqD,SAAS,eAC/C,SAAS,UAAU,MAAM,iFACW,SAAS;GAC7D,CAAC;;;;;;;;;;;;;;;;;;;;;;;;AAmCJ,MAAa,mCACZ,UAAkD,EAAE,KACjC;CACnB,MAAM,MAAM,QAAQ,QAAQ,OAAO,QAAQ,KAAK,CAAC;CACjD,MAAM,eAAe,QAAQ,YAAY;CACzC,MAAM,YAAY,WAAW,aAAa,GACvC,CAAC,aAAa,UACP;EACP,MAAM,OAAiB,EAAE;EACzB,IAAI,MAAM;AACV,SAAO,MAAM;AACZ,QAAK,KAAK,KAAK,KAAK,aAAa,CAAC;GAClC,MAAM,SAAS,QAAQ,IAAI;AAC3B,OAAI,WAAW,IAAK,QAAO;AAC3B,SAAM;;KAEJ;AAEN,MAAK,MAAM,YAAY,WAAW;EACjC,MAAM,YAAY,KAAK,UAAU,SAAS;AAC1C,MAAI,CAAC,WAAW,UAAU,CAAE;EAC5B,MAAM,YAAY,YAAY,WAAW,EAAE,eAAe,MAAM,CAAC,CAC/D,QAAQ,UAAU,MAAM,aAAa,CAAC,CACtC,KAAK,UAAU,KAAK,WAAW,MAAM,MAAM,gBAAgB,CAAC,CAC5D,QAAQ,SAAS,WAAW,KAAK,CAAC,CAClC,MAAM;AACR,MAAI,UAAU,WAAW,EAAG,QAAO,UAAU;AAC7C,MAAI,UAAU,SAAS,EAAG,QAAO;;AAElC,QAAO"}
|
|
@@ -13,7 +13,9 @@ declare class EndpointRegistry {
|
|
|
13
13
|
/** Group endpoints by the plugin that emitted them. Used by the
|
|
14
14
|
* CLI status output. */
|
|
15
15
|
byPluginKey(pluginKey: string): ReadonlyArray<ResolvedEndpoint>;
|
|
16
|
-
/** Filter endpoints by wire protocol
|
|
16
|
+
/** Filter endpoints by wire protocol — currently `'http' | 'h2c' |
|
|
17
|
+
* 'tcp'`. Typed as `string` for forward-compat with plugin-added
|
|
18
|
+
* protocols; mistyped values just return an empty array. */
|
|
17
19
|
byKind(wireProtocol: string): ReadonlyArray<ResolvedEndpoint>;
|
|
18
20
|
/** All endpoints, alphabetical by name. */
|
|
19
21
|
all(): ReadonlyArray<ResolvedEndpoint>;
|
|
@@ -21,7 +21,9 @@ var EndpointRegistry = class {
|
|
|
21
21
|
byPluginKey(pluginKey) {
|
|
22
22
|
return this.entries.filter((e) => e.pluginKey === pluginKey);
|
|
23
23
|
}
|
|
24
|
-
/** Filter endpoints by wire protocol
|
|
24
|
+
/** Filter endpoints by wire protocol — currently `'http' | 'h2c' |
|
|
25
|
+
* 'tcp'`. Typed as `string` for forward-compat with plugin-added
|
|
26
|
+
* protocols; mistyped values just return an empty array. */
|
|
25
27
|
byKind(wireProtocol) {
|
|
26
28
|
return this.entries.filter((e) => e.wireProtocol === wireProtocol);
|
|
27
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoint-registry.mjs","names":[],"sources":["../../../src/build-integrations/runtime/endpoint-registry.ts"],"sourcesContent":["// Typed endpoint lookup.\n//\n// `EndpointRegistry` wraps the manifest's flat `endpoints` map with\n// the small set of queries every consumer asks of it:\n//\n// - `byName(name)`: the load-bearing lookup. Playwright `baseURL`\n// and codegen emitters all key off endpoint name.\n// - `byPluginKey(key)`: group endpoints by the plugin that emitted\n// them. The CLI `status` command uses this to print one block\n// per plugin.\n// - `byKind(kind)`:
|
|
1
|
+
{"version":3,"file":"endpoint-registry.mjs","names":[],"sources":["../../../src/build-integrations/runtime/endpoint-registry.ts"],"sourcesContent":["// Typed endpoint lookup.\n//\n// `EndpointRegistry` wraps the manifest's flat `endpoints` map with\n// the small set of queries every consumer asks of it:\n//\n// - `byName(name)`: the load-bearing lookup. Playwright `baseURL`\n// and codegen emitters all key off endpoint name.\n// - `byPluginKey(key)`: group endpoints by the plugin that emitted\n// them. The CLI `status` command uses this to print one block\n// per plugin.\n// - `byKind(kind)`: filter on `wireProtocol` — currently one of\n// `'http' | 'h2c' | 'tcp'`. Cheap projection; lets callers filter\n// the gRPC or raw-TCP endpoints out of an HTTP-only health check.\n// - `all()`: stable-ordered iteration. Order is alphabetical by\n// endpoint name — the manifest writer emits in input-order, but\n// consumer iteration shouldn't depend on plugin registration\n// order.\n//\n// Plain class — no Effect, no Schema. Callable from any consumer\n// runtime (Node, browser bundle that imported the manifest via the\n// build-integration alias).\n\nimport type { ResolvedEndpoint } from './stack-context.ts';\n\n/** Read-only registry over the manifest's `endpoints` map. */\nexport class EndpointRegistry {\n\tprivate readonly entries: ReadonlyArray<ResolvedEndpoint>;\n\tprivate readonly byNameIndex: ReadonlyMap<string, ResolvedEndpoint>;\n\n\tconstructor(entries: ReadonlyArray<ResolvedEndpoint>) {\n\t\t// Defensive: sort by name so iteration is stable across\n\t\t// supervisor runs even if the writer hashed plugins in a\n\t\t// different order this time.\n\t\tconst sorted = [...entries].sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0));\n\t\tthis.entries = sorted;\n\t\tconst map = new Map<string, ResolvedEndpoint>();\n\t\tfor (const entry of sorted) map.set(entry.name, entry);\n\t\tthis.byNameIndex = map;\n\t}\n\n\t/** Look up an endpoint by its declared name. Returns `undefined`\n\t * when the name isn't in the manifest — callers that want a hard\n\t * fail should `??` to a thrown error. */\n\tbyName(name: string): ResolvedEndpoint | undefined {\n\t\treturn this.byNameIndex.get(name);\n\t}\n\n\t/** Group endpoints by the plugin that emitted them. Used by the\n\t * CLI status output. */\n\tbyPluginKey(pluginKey: string): ReadonlyArray<ResolvedEndpoint> {\n\t\treturn this.entries.filter((e) => e.pluginKey === pluginKey);\n\t}\n\n\t/** Filter endpoints by wire protocol — currently `'http' | 'h2c' |\n\t * 'tcp'`. Typed as `string` for forward-compat with plugin-added\n\t * protocols; mistyped values just return an empty array. */\n\tbyKind(wireProtocol: string): ReadonlyArray<ResolvedEndpoint> {\n\t\treturn this.entries.filter((e) => e.wireProtocol === wireProtocol);\n\t}\n\n\t/** All endpoints, alphabetical by name. */\n\tall(): ReadonlyArray<ResolvedEndpoint> {\n\t\treturn this.entries;\n\t}\n\n\t/** Names of every endpoint, alphabetical. Convenience for error\n\t * messages that want to list \"the supported names are: ...\". */\n\tnames(): ReadonlyArray<string> {\n\t\treturn this.entries.map((e) => e.name);\n\t}\n}\n"],"mappings":";;AAyBA,IAAa,mBAAb,MAA8B;CAC7B;CACA;CAEA,YAAY,SAA0C;EAIrD,MAAM,SAAS,CAAC,GAAG,QAAQ,CAAC,MAAM,GAAG,MAAO,EAAE,OAAO,EAAE,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,IAAI,EAAG;AAC5F,OAAK,UAAU;EACf,MAAM,sBAAM,IAAI,KAA+B;AAC/C,OAAK,MAAM,SAAS,OAAQ,KAAI,IAAI,MAAM,MAAM,MAAM;AACtD,OAAK,cAAc;;;;;CAMpB,OAAO,MAA4C;AAClD,SAAO,KAAK,YAAY,IAAI,KAAK;;;;CAKlC,YAAY,WAAoD;AAC/D,SAAO,KAAK,QAAQ,QAAQ,MAAM,EAAE,cAAc,UAAU;;;;;CAM7D,OAAO,cAAuD;AAC7D,SAAO,KAAK,QAAQ,QAAQ,MAAM,EAAE,iBAAiB,aAAa;;;CAInE,MAAuC;AACtC,SAAO,KAAK;;;;CAKb,QAA+B;AAC9B,SAAO,KAAK,QAAQ,KAAK,MAAM,EAAE,KAAK"}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PLAYWRIGHT_STACK_CONTEXT_SLOT_KEY, PlaywrightStackFixture } from "./playwright-stack-context-slot.mjs";
|
|
2
|
+
import { DEFAULT_STACK, DEFAULT_STATE_DIR, DiscoverManifestPathOptions, DiscoverSingleStackManifestPathOptions, discoverManifestPath, discoverSingleStackManifestPath, readAppName, readAppNameWalkup } from "./discover.mjs";
|
|
3
|
+
import { EndpointEntry, ManifestEnvelope, ManifestEnvelopeSchema } from "../../substrate/manifest.mjs";
|
|
2
4
|
import { EndpointRegistry } from "./endpoint-registry.mjs";
|
|
3
5
|
import { ResolvedEndpoint, StackContext, StackIdentity } from "./stack-context.mjs";
|
|
4
6
|
import { CONSUMER_MANIFEST_VERSION, ReadStackContextOptions, manifestEnvelopeFromStackContext, readStackContext } from "./read-stack-context.mjs";
|
|
7
|
+
import { DEFAULT_DISCOVERY_STACK, DEFAULT_DISCOVERY_STATE_DIR, DISCOVERY_ENV, ResolveDiscoveryEnvOptions, ResolvedDiscoveryEnv, resolveDiscoveryEnv } from "./resolve-discovery-env.mjs";
|
|
5
8
|
import { ColdStartUrlOptions, ConventionalRoute, ConventionalRouteHint, ConventionalRouteHostInput, ConventionalRouteUrlInput, coldStartUrl, conventionalRouteHost, conventionalRouteUrl, conventionalRoutesFromHints, tryColdStartUrl } from "./cold-start-url.mjs";
|
|
9
|
+
import { BUILT_IN_CONVENTIONAL_HINTS, BUILT_IN_ENDPOINT_ALIASES, DEFAULT_ROUTER_ENTRYPOINT_PORT, builtInConventionalRoutes, resolveBuiltInEndpointAlias } from "./conventional-routes.mjs";
|
|
6
10
|
import { ManifestDiscoveryError, ManifestDiscoveryPhase, ManifestShapeError, ManifestShapePhase, NoConventionalRouteError } from "./errors.mjs";
|
|
7
|
-
|
|
11
|
+
import { WALLET_AUTH_HEADER, WALLET_BEARER_PREFIX, WALLET_ENDPOINT_KEY, WALLET_ENDPOINT_NAME, WALLET_PROTOCOL_PREFIX, WALLET_TOKEN_FRAGMENT_KEY, WALLET_TOKEN_HEX_LENGTH, WalletHttpPath, WalletHttpPathValue } from "../../contracts/wallet-protocol.mjs";
|
|
12
|
+
export { BUILT_IN_CONVENTIONAL_HINTS, BUILT_IN_ENDPOINT_ALIASES, CONSUMER_MANIFEST_VERSION, type ColdStartUrlOptions, type ConventionalRoute, type ConventionalRouteHint, type ConventionalRouteHostInput, type ConventionalRouteUrlInput, DEFAULT_DISCOVERY_STACK, DEFAULT_DISCOVERY_STATE_DIR, DEFAULT_ROUTER_ENTRYPOINT_PORT, DEFAULT_STACK, DEFAULT_STATE_DIR, DISCOVERY_ENV, type DiscoverManifestPathOptions, type DiscoverSingleStackManifestPathOptions, type EndpointEntry, EndpointRegistry, ManifestDiscoveryError, type ManifestDiscoveryPhase, type ManifestEnvelope, ManifestEnvelopeSchema, ManifestShapeError, type ManifestShapePhase, NoConventionalRouteError, PLAYWRIGHT_STACK_CONTEXT_SLOT_KEY, type PlaywrightStackFixture, type ReadStackContextOptions, type ResolveDiscoveryEnvOptions, type ResolvedDiscoveryEnv, type ResolvedEndpoint, type StackContext, type StackIdentity, WALLET_AUTH_HEADER, WALLET_BEARER_PREFIX, WALLET_ENDPOINT_KEY, WALLET_ENDPOINT_NAME, WALLET_PROTOCOL_PREFIX, WALLET_TOKEN_FRAGMENT_KEY, WALLET_TOKEN_HEX_LENGTH, WalletHttpPath, type WalletHttpPathValue, builtInConventionalRoutes, coldStartUrl, conventionalRouteHost, conventionalRouteUrl, conventionalRoutesFromHints, discoverManifestPath, discoverSingleStackManifestPath, manifestEnvelopeFromStackContext, readAppName, readAppNameWalkup, readStackContext, resolveBuiltInEndpointAlias, resolveDiscoveryEnv, tryColdStartUrl };
|