@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
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//#region src/substrate/event-time.ts
|
|
2
|
+
const eventAtOrNull = (event) => {
|
|
3
|
+
switch (event.tag) {
|
|
4
|
+
case "endpoint.registered": return event.endpoint.registeredAt;
|
|
5
|
+
case "error.reported": return event.error.at;
|
|
6
|
+
case "build.statusChanged": return event.entry.startedAt;
|
|
7
|
+
case "lifecycle.statusChanged":
|
|
8
|
+
case "lifecycle.phaseSet":
|
|
9
|
+
case "log.appended":
|
|
10
|
+
case "projection.updated":
|
|
11
|
+
case "endpoint.released":
|
|
12
|
+
case "strategy.registered":
|
|
13
|
+
case "strategy.unregistered":
|
|
14
|
+
case "manifest.flushed":
|
|
15
|
+
case "codegen.emitted":
|
|
16
|
+
case "restart.requested":
|
|
17
|
+
case "restart.completed":
|
|
18
|
+
case "shutdown.escalated":
|
|
19
|
+
case "snapshot.captureStarted":
|
|
20
|
+
case "snapshot.captureProgress":
|
|
21
|
+
case "snapshot.captureSkipped":
|
|
22
|
+
case "snapshot.captureFailed":
|
|
23
|
+
case "snapshot.captured":
|
|
24
|
+
case "snapshot.restored":
|
|
25
|
+
case "engine.orchestrator.dispatchFailed": return event.at;
|
|
26
|
+
default: return null;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
const eventAt = (event) => eventAtOrNull(event) ?? Date.now();
|
|
30
|
+
//#endregion
|
|
31
|
+
export { eventAt, eventAtOrNull };
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=event-time.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-time.mjs","names":[],"sources":["../../src/substrate/event-time.ts"],"sourcesContent":["// Producer-time projection for `EngineEvent`.\n//\n// Every event variant carries an authoritative timestamp either at the\n// top level (`event.at`) or in a domain-specific nested field\n// (`endpoint.registered.endpoint.registeredAt`, `error.reported.error.at`,\n// `build.statusChanged.entry.startedAt`). The switch is intentionally\n// exhaustive so a newly-added variant must declare where its timestamp\n// lives — the compiler enforces it via the `never`-assignment default.\n//\n// Two shapes:\n// - `eventAtOrNull` (substrate-layer consumers): returns `null` when\n// the variant has no inherent timestamp, letting the caller fall\n// back to whatever stale value preserves invariants (e.g. the\n// projection update reducer keeps `state.lastEvent.at` on miss).\n// - `eventAt` (UI consumers): wraps `eventAtOrNull` with a `Date.now()`\n// fallback so log rendering always gets a number. Removing the\n// historical dequeue-time fallback was load-bearing — under\n// back-pressure (a queued event flushed late from the dispatcher)\n// it back-dated or forward-dated the log entry, producing apparent\n// event-time reordering in the rendered log. Pinning to the\n// producer's record preserves the ordering tests assert.\n\nimport type { EngineEvent } from './events.ts';\n\nexport const eventAtOrNull = (event: EngineEvent): number | null => {\n\tswitch (event.tag) {\n\t\tcase 'endpoint.registered':\n\t\t\treturn event.endpoint.registeredAt;\n\t\tcase 'error.reported':\n\t\t\treturn event.error.at;\n\t\tcase 'build.statusChanged':\n\t\t\treturn event.entry.startedAt;\n\t\tcase 'lifecycle.statusChanged':\n\t\tcase 'lifecycle.phaseSet':\n\t\tcase 'log.appended':\n\t\tcase 'projection.updated':\n\t\tcase 'endpoint.released':\n\t\tcase 'strategy.registered':\n\t\tcase 'strategy.unregistered':\n\t\tcase 'manifest.flushed':\n\t\tcase 'codegen.emitted':\n\t\tcase 'restart.requested':\n\t\tcase 'restart.completed':\n\t\tcase 'shutdown.escalated':\n\t\tcase 'snapshot.captureStarted':\n\t\tcase 'snapshot.captureProgress':\n\t\tcase 'snapshot.captureSkipped':\n\t\tcase 'snapshot.captureFailed':\n\t\tcase 'snapshot.captured':\n\t\tcase 'snapshot.restored':\n\t\tcase 'engine.orchestrator.dispatchFailed':\n\t\t\treturn event.at;\n\t\tdefault: {\n\t\t\tconst _exhaustive: never = event;\n\t\t\tvoid _exhaustive;\n\t\t\treturn null;\n\t\t}\n\t}\n};\n\nexport const eventAt = (event: EngineEvent): number => eventAtOrNull(event) ?? Date.now();\n"],"mappings":";AAwBA,MAAa,iBAAiB,UAAsC;AACnE,SAAQ,MAAM,KAAd;EACC,KAAK,sBACJ,QAAO,MAAM,SAAS;EACvB,KAAK,iBACJ,QAAO,MAAM,MAAM;EACpB,KAAK,sBACJ,QAAO,MAAM,MAAM;EACpB,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK,qCACJ,QAAO,MAAM;EACd,QAGC,QAAO;;;AAKV,MAAa,WAAW,UAA+B,cAAc,MAAM,IAAI,KAAK,KAAK"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EndpointKey, PluginKey } from "./brand.mjs";
|
|
2
2
|
import { LifecycleStatus, PhaseNarration } from "./lifecycle.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { BuildEntry, Endpoint, StructuredError } from "./projection.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/substrate/events.d.ts
|
|
6
6
|
type ShutdownSignal = 'SIGINT' | 'SIGTERM';
|
|
@@ -27,12 +27,16 @@ type EngineEvent = {
|
|
|
27
27
|
readonly tag: 'endpoint.registered';
|
|
28
28
|
readonly endpoint: Endpoint;
|
|
29
29
|
} | {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
/** Name-blind projection update. Plugins emit this with a
|
|
31
|
+
* `kind` discriminator the L3 projection orchestrator (today:
|
|
32
|
+
* the reducer in `runtime/projection/update.ts`) decodes
|
|
33
|
+
* per-kind. Substrate stays unaware of which plugins produce
|
|
34
|
+
* which projection shapes — the kind→decoder mapping is owned
|
|
35
|
+
* by the consuming orchestrator. */
|
|
36
|
+
readonly tag: 'projection.updated';
|
|
37
|
+
readonly kind: string;
|
|
38
|
+
readonly key: string;
|
|
39
|
+
readonly payload: unknown;
|
|
36
40
|
readonly at: number;
|
|
37
41
|
} | {
|
|
38
42
|
readonly tag: 'endpoint.released';
|
|
@@ -95,10 +99,12 @@ type EngineEvent = {
|
|
|
95
99
|
} | {
|
|
96
100
|
readonly tag: 'snapshot.captureSkipped';
|
|
97
101
|
readonly reason: 'already-running';
|
|
102
|
+
readonly snapshotId: string;
|
|
103
|
+
readonly name?: string;
|
|
98
104
|
readonly at: number;
|
|
99
105
|
} | {
|
|
100
106
|
readonly tag: 'snapshot.captureFailed';
|
|
101
|
-
readonly snapshotId
|
|
107
|
+
readonly snapshotId: string;
|
|
102
108
|
readonly name?: string;
|
|
103
109
|
readonly summary: string;
|
|
104
110
|
readonly at: number;
|
|
@@ -111,6 +117,20 @@ type EngineEvent = {
|
|
|
111
117
|
readonly tag: 'snapshot.restored';
|
|
112
118
|
readonly snapshotId: string;
|
|
113
119
|
readonly at: number;
|
|
120
|
+
} | {
|
|
121
|
+
readonly tag: 'engine.orchestrator.dispatchFailed';
|
|
122
|
+
readonly pluginKey: PluginKey;
|
|
123
|
+
readonly kind: string;
|
|
124
|
+
readonly message: string;
|
|
125
|
+
/** Underlying-cause discriminator (the failing sink error's
|
|
126
|
+
* `_tag`, e.g. `RouterBootFailed`) when one is recoverable
|
|
127
|
+
* from the wrapped cause. Optional + additive: omitted when
|
|
128
|
+
* the cause carries no tag, so the closed-sum vocabulary is
|
|
129
|
+
* unchanged for consumers that ignore it. Surfaced so an
|
|
130
|
+
* operator can tell WHICH orchestrator sink broke (dead RPC
|
|
131
|
+
* routing vs codegen collision) without parsing the message. */
|
|
132
|
+
readonly causeType?: string;
|
|
133
|
+
readonly at: number;
|
|
114
134
|
};
|
|
115
135
|
//#endregion
|
|
116
136
|
export { EngineEvent };
|
|
@@ -5,7 +5,8 @@ import { AppName, ChainId, StackName } from "./brand.mjs";
|
|
|
5
5
|
interface Identity {
|
|
6
6
|
readonly app: AppName;
|
|
7
7
|
readonly stack: StackName;
|
|
8
|
-
/** Resolved chain identifier from
|
|
8
|
+
/** Resolved chain identifier — threaded through Context from the
|
|
9
|
+
* Sui plugin's resolved mode + `DevstackOptions.network`. */
|
|
9
10
|
readonly chain: ChainId;
|
|
10
11
|
}
|
|
11
12
|
//#endregion
|
|
@@ -1,7 +1,44 @@
|
|
|
1
|
-
import { EndpointKey, PluginKey } from "./brand.mjs";
|
|
2
1
|
import { Effect, Schema } from "effect";
|
|
2
|
+
import * as _$effect_Cause0 from "effect/Cause";
|
|
3
3
|
|
|
4
4
|
//#region src/substrate/manifest.d.ts
|
|
5
|
+
declare const ManifestExtrasInvalid_base: Schema.Class<ManifestExtrasInvalid, Schema.TaggedStruct<"ManifestExtrasInvalid", {
|
|
6
|
+
readonly detail: Schema.String;
|
|
7
|
+
}>, _$effect_Cause0.YieldableError>;
|
|
8
|
+
/** Tagged failure when a plugin's manifest-extras contribution does
|
|
9
|
+
* not resolve to a plain record. STYLE_GUIDE §2.2 — substrate (L0)
|
|
10
|
+
* errors use `Schema.TaggedErrorClass`; downstream classifiers
|
|
11
|
+
* `catchTag('ManifestExtrasInvalid', ...)` instead of sniffing the
|
|
12
|
+
* message. */
|
|
13
|
+
declare class ManifestExtrasInvalid extends ManifestExtrasInvalid_base {}
|
|
14
|
+
declare const ManifestExtrasLookupError_base: Schema.Class<ManifestExtrasLookupError, Schema.TaggedStruct<"ManifestExtrasLookupError", {
|
|
15
|
+
readonly kind: Schema.Literals<readonly ["unknown-resource", "unresolved-resource"]>;
|
|
16
|
+
readonly resourceId: Schema.String;
|
|
17
|
+
}>, _$effect_Cause0.YieldableError>;
|
|
18
|
+
/** Tagged failure when a plugin's `extras` factory references a
|
|
19
|
+
* resource the host cannot resolve — either the resource id is not
|
|
20
|
+
* registered with the supervisor, or it has not produced a value
|
|
21
|
+
* yet at the point the factory ran. Thrown synchronously from the
|
|
22
|
+
* user-supplied `ctx.value(...)` closure; `resolveManifestExtras`
|
|
23
|
+
* catches the throw and surfaces it as a typed failure so callers
|
|
24
|
+
* classify via `catchTag('ManifestExtrasLookupError', ...)` rather
|
|
25
|
+
* than die-cause inspection. */
|
|
26
|
+
declare class ManifestExtrasLookupError extends ManifestExtrasLookupError_base {}
|
|
27
|
+
/** Codegen metadata recorded per stack. The supervisor writes the
|
|
28
|
+
* resolved absolute output dir here at manifest-flush time so the
|
|
29
|
+
* read-side build integrations (the Vite plugin) point an `@generated`
|
|
30
|
+
* alias at the EXACT dir codegen emitted into for THIS stack — read
|
|
31
|
+
* and write share one decision (see
|
|
32
|
+
* `orchestrators/codegen/output-location.ts`). Optional + additive:
|
|
33
|
+
* manifests written before this field existed (and stacks that somehow
|
|
34
|
+
* flush without it) still decode; consumers fall back to
|
|
35
|
+
* `src/generated/`. */
|
|
36
|
+
interface ManifestCodegen {
|
|
37
|
+
/** Absolute path to the directory codegen emitted into for this
|
|
38
|
+
* stack (primary → `<appRoot>/src/generated`; secondary →
|
|
39
|
+
* `<appRoot>/.devstack/stacks/<stack>/generated`). */
|
|
40
|
+
readonly generatedDir: string;
|
|
41
|
+
}
|
|
5
42
|
/** Manifest envelope. The `services` slot is open (`unknown`) at
|
|
6
43
|
* the envelope level; each plugin's Codegenable contribution
|
|
7
44
|
* emits a typed file the consumer imports for the typed shape.
|
|
@@ -16,6 +53,9 @@ interface ManifestEnvelope {
|
|
|
16
53
|
readonly services: Readonly<Record<string, unknown>>;
|
|
17
54
|
readonly endpoints: Readonly<Record<string, EndpointEntry>>;
|
|
18
55
|
readonly extras: Readonly<Record<string, unknown>>;
|
|
56
|
+
/** Per-stack codegen metadata. Optional — absent in older
|
|
57
|
+
* manifests; the reader falls back to `src/generated/`. */
|
|
58
|
+
readonly codegen?: ManifestCodegen;
|
|
19
59
|
}
|
|
20
60
|
type ManifestExtras = Readonly<Record<string, unknown>>;
|
|
21
61
|
interface ManifestExtrasContext {
|
|
@@ -30,10 +70,33 @@ interface EndpointEntry {
|
|
|
30
70
|
readonly name: string;
|
|
31
71
|
readonly url: string;
|
|
32
72
|
readonly displayUrl: string | null;
|
|
33
|
-
readonly wireProtocol: 'http' | 'h2c' |
|
|
34
|
-
readonly pluginKey:
|
|
35
|
-
readonly endpointKey:
|
|
73
|
+
readonly wireProtocol: 'http' | 'h2c' | 'tcp';
|
|
74
|
+
readonly pluginKey: string;
|
|
75
|
+
readonly endpointKey: string;
|
|
36
76
|
}
|
|
77
|
+
/** Schema for runtime validation of an on-disk manifest. Build
|
|
78
|
+
* integrations decode through this on read. */
|
|
79
|
+
declare const ManifestEnvelopeSchema: Schema.Struct<{
|
|
80
|
+
readonly identity: Schema.Struct<{
|
|
81
|
+
readonly app: Schema.String;
|
|
82
|
+
readonly stack: Schema.String;
|
|
83
|
+
readonly chain: Schema.String;
|
|
84
|
+
}>;
|
|
85
|
+
readonly manifestVersion: Schema.Number;
|
|
86
|
+
readonly services: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
87
|
+
readonly endpoints: Schema.$Record<Schema.String, Schema.Struct<{
|
|
88
|
+
readonly name: Schema.String;
|
|
89
|
+
readonly url: Schema.String;
|
|
90
|
+
readonly displayUrl: Schema.NullOr<Schema.String>;
|
|
91
|
+
readonly wireProtocol: Schema.Literals<readonly ["http", "h2c", "tcp"]>;
|
|
92
|
+
readonly pluginKey: Schema.String;
|
|
93
|
+
readonly endpointKey: Schema.String;
|
|
94
|
+
}>>;
|
|
95
|
+
readonly extras: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
96
|
+
readonly codegen: Schema.optional<Schema.Struct<{
|
|
97
|
+
readonly generatedDir: Schema.String;
|
|
98
|
+
}>>;
|
|
99
|
+
}>;
|
|
37
100
|
//#endregion
|
|
38
|
-
export { EndpointEntry, ManifestEnvelope, ManifestExtras, ManifestExtrasContext, ManifestExtrasInput };
|
|
101
|
+
export { EndpointEntry, ManifestEnvelope, ManifestEnvelopeSchema, ManifestExtras, ManifestExtrasContext, ManifestExtrasInput, ManifestExtrasInvalid, ManifestExtrasLookupError };
|
|
39
102
|
//# sourceMappingURL=manifest.d.mts.map
|
|
@@ -1,10 +1,34 @@
|
|
|
1
1
|
import { Effect, Schema } from "effect";
|
|
2
2
|
//#region src/substrate/manifest.ts
|
|
3
|
+
/** Tagged failure when a plugin's manifest-extras contribution does
|
|
4
|
+
* not resolve to a plain record. STYLE_GUIDE §2.2 — substrate (L0)
|
|
5
|
+
* errors use `Schema.TaggedErrorClass`; downstream classifiers
|
|
6
|
+
* `catchTag('ManifestExtrasInvalid', ...)` instead of sniffing the
|
|
7
|
+
* message. */
|
|
8
|
+
var ManifestExtrasInvalid = class extends Schema.TaggedErrorClass()("ManifestExtrasInvalid", { detail: Schema.String }) {};
|
|
9
|
+
/** Tagged failure when a plugin's `extras` factory references a
|
|
10
|
+
* resource the host cannot resolve — either the resource id is not
|
|
11
|
+
* registered with the supervisor, or it has not produced a value
|
|
12
|
+
* yet at the point the factory ran. Thrown synchronously from the
|
|
13
|
+
* user-supplied `ctx.value(...)` closure; `resolveManifestExtras`
|
|
14
|
+
* catches the throw and surfaces it as a typed failure so callers
|
|
15
|
+
* classify via `catchTag('ManifestExtrasLookupError', ...)` rather
|
|
16
|
+
* than die-cause inspection. */
|
|
17
|
+
var ManifestExtrasLookupError = class extends Schema.TaggedErrorClass()("ManifestExtrasLookupError", {
|
|
18
|
+
kind: Schema.Literals(["unknown-resource", "unresolved-resource"]),
|
|
19
|
+
resourceId: Schema.String
|
|
20
|
+
}) {};
|
|
3
21
|
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
4
22
|
const resolveManifestExtras = (input, ctx) => Effect.gen(function* () {
|
|
5
23
|
if (input === void 0) return {};
|
|
6
|
-
const resolved = yield* Effect.isEffect(input) ? input : typeof input === "function" ? Effect.
|
|
7
|
-
|
|
24
|
+
const resolved = yield* Effect.isEffect(input) ? input : typeof input === "function" ? Effect.try({
|
|
25
|
+
try: () => input(ctx),
|
|
26
|
+
catch: (cause) => {
|
|
27
|
+
if (cause instanceof ManifestExtrasLookupError) return cause;
|
|
28
|
+
throw cause;
|
|
29
|
+
}
|
|
30
|
+
}).pipe(Effect.flatMap((value) => Effect.isEffect(value) ? value : Effect.succeed(value))) : Effect.succeed(input);
|
|
31
|
+
if (!isRecord(resolved)) return yield* Effect.fail(new ManifestExtrasInvalid({ detail: "manifest extras must resolve to a plain record" }));
|
|
8
32
|
return resolved;
|
|
9
33
|
});
|
|
10
34
|
/** Schema for runtime validation of an on-disk manifest. Build
|
|
@@ -21,13 +45,18 @@ const ManifestEnvelopeSchema = Schema.Struct({
|
|
|
21
45
|
name: Schema.String,
|
|
22
46
|
url: Schema.String,
|
|
23
47
|
displayUrl: Schema.NullOr(Schema.String),
|
|
24
|
-
wireProtocol: Schema.
|
|
48
|
+
wireProtocol: Schema.Literals([
|
|
49
|
+
"http",
|
|
50
|
+
"h2c",
|
|
51
|
+
"tcp"
|
|
52
|
+
]),
|
|
25
53
|
pluginKey: Schema.String,
|
|
26
54
|
endpointKey: Schema.String
|
|
27
55
|
})),
|
|
28
|
-
extras: Schema.Record(Schema.String, Schema.Unknown)
|
|
56
|
+
extras: Schema.Record(Schema.String, Schema.Unknown),
|
|
57
|
+
codegen: Schema.optional(Schema.Struct({ generatedDir: Schema.String }))
|
|
29
58
|
});
|
|
30
59
|
//#endregion
|
|
31
|
-
export { ManifestEnvelopeSchema, resolveManifestExtras };
|
|
60
|
+
export { ManifestEnvelopeSchema, ManifestExtrasInvalid, ManifestExtrasLookupError, resolveManifestExtras };
|
|
32
61
|
|
|
33
62
|
//# sourceMappingURL=manifest.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.mjs","names":[],"sources":["../../src/substrate/manifest.ts"],"sourcesContent":["// Manifest envelope schema.\n//\n// Architecture § Manifest data model: envelope shape is fixed at L0,\n// per-service projection is each plugin's responsibility (lives in\n// the Codegenable contribution). Build integrations read the\n// envelope; codegen output carries the typed per-service slice.\n//\n// L0 owns:\n// - the envelope (identity tuple, manifestVersion, services slot,\n// endpoints lookup, opaque extras),\n// - the endpoint-declaration shape (decl emitted by Routable; the\n// manifest writer at L3 walks them).\n\nimport { Effect, Schema } from 'effect';\n\
|
|
1
|
+
{"version":3,"file":"manifest.mjs","names":[],"sources":["../../src/substrate/manifest.ts"],"sourcesContent":["// Manifest envelope schema.\n//\n// Architecture § Manifest data model: envelope shape is fixed at L0,\n// per-service projection is each plugin's responsibility (lives in\n// the Codegenable contribution). Build integrations read the\n// envelope; codegen output carries the typed per-service slice.\n//\n// L0 owns:\n// - the envelope (identity tuple, manifestVersion, services slot,\n// endpoints lookup, opaque extras),\n// - the endpoint-declaration shape (decl emitted by Routable; the\n// manifest writer at L3 walks them).\n\nimport { Effect, Schema } from 'effect';\n\n/** Tagged failure when a plugin's manifest-extras contribution does\n * not resolve to a plain record. STYLE_GUIDE §2.2 — substrate (L0)\n * errors use `Schema.TaggedErrorClass`; downstream classifiers\n * `catchTag('ManifestExtrasInvalid', ...)` instead of sniffing the\n * message. */\nexport class ManifestExtrasInvalid extends Schema.TaggedErrorClass<ManifestExtrasInvalid>()(\n\t'ManifestExtrasInvalid',\n\t{\n\t\tdetail: Schema.String,\n\t},\n) {}\n\n/** Tagged failure when a plugin's `extras` factory references a\n * resource the host cannot resolve — either the resource id is not\n * registered with the supervisor, or it has not produced a value\n * yet at the point the factory ran. Thrown synchronously from the\n * user-supplied `ctx.value(...)` closure; `resolveManifestExtras`\n * catches the throw and surfaces it as a typed failure so callers\n * classify via `catchTag('ManifestExtrasLookupError', ...)` rather\n * than die-cause inspection. */\nexport class ManifestExtrasLookupError extends Schema.TaggedErrorClass<ManifestExtrasLookupError>()(\n\t'ManifestExtrasLookupError',\n\t{\n\t\tkind: Schema.Literals(['unknown-resource', 'unresolved-resource']),\n\t\tresourceId: Schema.String,\n\t},\n) {}\n\n/** Codegen metadata recorded per stack. The supervisor writes the\n * resolved absolute output dir here at manifest-flush time so the\n * read-side build integrations (the Vite plugin) point an `@generated`\n * alias at the EXACT dir codegen emitted into for THIS stack — read\n * and write share one decision (see\n * `orchestrators/codegen/output-location.ts`). Optional + additive:\n * manifests written before this field existed (and stacks that somehow\n * flush without it) still decode; consumers fall back to\n * `src/generated/`. */\nexport interface ManifestCodegen {\n\t/** Absolute path to the directory codegen emitted into for this\n\t * stack (primary → `<appRoot>/src/generated`; secondary →\n\t * `<appRoot>/.devstack/stacks/<stack>/generated`). */\n\treadonly generatedDir: string;\n}\n\n/** Manifest envelope. The `services` slot is open (`unknown`) at\n * the envelope level; each plugin's Codegenable contribution\n * emits a typed file the consumer imports for the typed shape.\n */\nexport interface ManifestEnvelope {\n\treadonly identity: {\n\t\treadonly app: string;\n\t\treadonly stack: string;\n\t\treadonly chain: string;\n\t};\n\treadonly manifestVersion: number;\n\treadonly services: Readonly<Record<string, unknown>>;\n\treadonly endpoints: Readonly<Record<string, EndpointEntry>>;\n\treadonly extras: Readonly<Record<string, unknown>>;\n\t/** Per-stack codegen metadata. Optional — absent in older\n\t * manifests; the reader falls back to `src/generated/`. */\n\treadonly codegen?: ManifestCodegen;\n}\n\nexport type ManifestExtras = Readonly<Record<string, unknown>>;\n\nexport interface ManifestExtrasContext {\n\treadonly value: (resource: { readonly id: string }) => unknown;\n}\n\nexport type ManifestExtrasInput =\n\t| ManifestExtras\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t| Effect.Effect<ManifestExtras, any, never>\n\t| ((\n\t\t\tctx: ManifestExtrasContext,\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t ) => ManifestExtras | Effect.Effect<ManifestExtras, any, never>);\n\nconst isRecord = (value: unknown): value is ManifestExtras =>\n\ttypeof value === 'object' && value !== null && !Array.isArray(value);\n\nexport const resolveManifestExtras = (\n\tinput: ManifestExtrasInput | undefined,\n\tctx: ManifestExtrasContext,\n): Effect.Effect<ManifestExtras, ManifestExtrasInvalid | ManifestExtrasLookupError, never> =>\n\tEffect.gen(function* () {\n\t\tif (input === undefined) return {};\n\t\t// The user-supplied `extras` factory invokes `ctx.value(...)`\n\t\t// synchronously; a missing/unresolved resource throws a\n\t\t// `ManifestExtrasLookupError`. `Effect.try` with a typed\n\t\t// `catch` mapper promotes that throw into the typed failure\n\t\t// channel so callers `catchTag` it instead of having to inspect\n\t\t// the die-cause. Any non-tagged throw is rethrown to preserve\n\t\t// the existing defect semantics for genuine programmer errors\n\t\t// inside the factory body.\n\t\tconst resolvedEffect = Effect.isEffect(input)\n\t\t\t? input\n\t\t\t: typeof input === 'function'\n\t\t\t\t? Effect.try({\n\t\t\t\t\t\ttry: () => input(ctx),\n\t\t\t\t\t\tcatch: (cause) => {\n\t\t\t\t\t\t\tif (cause instanceof ManifestExtrasLookupError) return cause;\n\t\t\t\t\t\t\tthrow cause;\n\t\t\t\t\t\t},\n\t\t\t\t\t}).pipe(\n\t\t\t\t\t\tEffect.flatMap((value) => (Effect.isEffect(value) ? value : Effect.succeed(value))),\n\t\t\t\t\t)\n\t\t\t\t: Effect.succeed(input);\n\t\tconst resolved = yield* resolvedEffect;\n\t\tif (!isRecord(resolved)) {\n\t\t\treturn yield* Effect.fail(\n\t\t\t\tnew ManifestExtrasInvalid({\n\t\t\t\t\tdetail: 'manifest extras must resolve to a plain record',\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\t\treturn resolved;\n\t});\n\n/** Flat endpoint entry — the manifest's load-bearing surface for\n * build integrations. */\nexport interface EndpointEntry {\n\treadonly name: string;\n\treadonly url: string;\n\treadonly displayUrl: string | null;\n\treadonly wireProtocol: 'http' | 'h2c' | 'tcp';\n\treadonly pluginKey: string;\n\treadonly endpointKey: string;\n}\n\n/** Schema for runtime validation of an on-disk manifest. Build\n * integrations decode through this on read. */\nexport const ManifestEnvelopeSchema = Schema.Struct({\n\tidentity: Schema.Struct({\n\t\tapp: Schema.String,\n\t\tstack: Schema.String,\n\t\tchain: Schema.String,\n\t}),\n\tmanifestVersion: Schema.Number,\n\tservices: Schema.Record(Schema.String, Schema.Unknown),\n\tendpoints: Schema.Record(\n\t\tSchema.String,\n\t\tSchema.Struct({\n\t\t\tname: Schema.String,\n\t\t\turl: Schema.String,\n\t\t\tdisplayUrl: Schema.NullOr(Schema.String),\n\t\t\twireProtocol: Schema.Literals(['http', 'h2c', 'tcp']),\n\t\t\tpluginKey: Schema.String,\n\t\t\tendpointKey: Schema.String,\n\t\t}),\n\t),\n\textras: Schema.Record(Schema.String, Schema.Unknown),\n\t// Optional + additive — a manifest written before this field\n\t// existed still decodes (the key is simply absent). The Vite plugin\n\t// reads `codegen.generatedDir` to point its `@generated` alias; on a\n\t// miss it falls back to `src/generated/`.\n\tcodegen: Schema.optional(\n\t\tSchema.Struct({\n\t\t\tgeneratedDir: Schema.String,\n\t\t}),\n\t),\n});\n"],"mappings":";;;;;;;AAoBA,IAAa,wBAAb,cAA2C,OAAO,kBAAyC,CAC1F,yBACA,EACC,QAAQ,OAAO,QACf,CACD,CAAC;;;;;;;;;AAUF,IAAa,4BAAb,cAA+C,OAAO,kBAA6C,CAClG,6BACA;CACC,MAAM,OAAO,SAAS,CAAC,oBAAoB,sBAAsB,CAAC;CAClE,YAAY,OAAO;CACnB,CACD,CAAC;AAoDF,MAAM,YAAY,UACjB,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,MAAM;AAErE,MAAa,yBACZ,OACA,QAEA,OAAO,IAAI,aAAa;AACvB,KAAI,UAAU,KAAA,EAAW,QAAO,EAAE;CAsBlC,MAAM,WAAW,OAbM,OAAO,SAAS,MAAM,GAC1C,QACA,OAAO,UAAU,aAChB,OAAO,IAAI;EACX,WAAW,MAAM,IAAI;EACrB,QAAQ,UAAU;AACjB,OAAI,iBAAiB,0BAA2B,QAAO;AACvD,SAAM;;EAEP,CAAC,CAAC,KACF,OAAO,SAAS,UAAW,OAAO,SAAS,MAAM,GAAG,QAAQ,OAAO,QAAQ,MAAM,CAAE,CACnF,GACA,OAAO,QAAQ,MAAM;AAEzB,KAAI,CAAC,SAAS,SAAS,CACtB,QAAO,OAAO,OAAO,KACpB,IAAI,sBAAsB,EACzB,QAAQ,kDACR,CAAC,CACF;AAEF,QAAO;EACN;;;AAeH,MAAa,yBAAyB,OAAO,OAAO;CACnD,UAAU,OAAO,OAAO;EACvB,KAAK,OAAO;EACZ,OAAO,OAAO;EACd,OAAO,OAAO;EACd,CAAC;CACF,iBAAiB,OAAO;CACxB,UAAU,OAAO,OAAO,OAAO,QAAQ,OAAO,QAAQ;CACtD,WAAW,OAAO,OACjB,OAAO,QACP,OAAO,OAAO;EACb,MAAM,OAAO;EACb,KAAK,OAAO;EACZ,YAAY,OAAO,OAAO,OAAO,OAAO;EACxC,cAAc,OAAO,SAAS;GAAC;GAAQ;GAAO;GAAM,CAAC;EACrD,WAAW,OAAO;EAClB,aAAa,OAAO;EACpB,CAAC,CACF;CACD,QAAQ,OAAO,OAAO,OAAO,QAAQ,OAAO,QAAQ;CAKpD,SAAS,OAAO,SACf,OAAO,OAAO,EACb,cAAc,OAAO,QACrB,CAAC,CACF;CACD,CAAC"}
|
|
@@ -17,8 +17,8 @@ interface DevstackNetworkModeRegistry {
|
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
type NetworkMode = keyof DevstackNetworkModeRegistry & string;
|
|
20
|
-
/** Substrate-level network record. Plugins
|
|
21
|
-
*
|
|
20
|
+
/** Substrate-level network record. Plugins read this from the
|
|
21
|
+
* `IdentityContext` projection — one value per acquire. */
|
|
22
22
|
type NetworkConfig<Mode extends NetworkMode = NetworkMode> = Readonly<{
|
|
23
23
|
readonly mode: Mode;
|
|
24
24
|
/** Chain identity the plugin uses for cache-key folding, ChainProbe
|
|
@@ -27,8 +27,6 @@ type NetworkConfig<Mode extends NetworkMode = NetworkMode> = Readonly<{
|
|
|
27
27
|
readonly chain: ChainId; /** Source provenance for renderer display. */
|
|
28
28
|
readonly source?: 'cli' | 'env' | 'config' | 'default';
|
|
29
29
|
} & DevstackNetworkModeRegistry[Mode]>;
|
|
30
|
-
/** Default network shape used when nothing is pinned. */
|
|
31
|
-
type DefaultNetwork = NetworkConfig<'local'>;
|
|
32
30
|
//#endregion
|
|
33
|
-
export {
|
|
31
|
+
export { DevstackNetworkModeRegistry, NetworkConfig, NetworkMode };
|
|
34
32
|
//# sourceMappingURL=network.d.mts.map
|
|
@@ -8,13 +8,11 @@ import { NetworkConfig } from "./network.mjs";
|
|
|
8
8
|
interface DevstackOptions {
|
|
9
9
|
readonly stackName?: string;
|
|
10
10
|
readonly network?: NetworkConfig;
|
|
11
|
-
readonly watchPaths?: ReadonlyArray<string>;
|
|
12
11
|
readonly stateDir?: string;
|
|
13
12
|
readonly codegen?: {
|
|
14
13
|
readonly outputDir?: string;
|
|
15
14
|
readonly stackSubdir?: string | null;
|
|
16
15
|
};
|
|
17
|
-
readonly hotRestart?: boolean;
|
|
18
16
|
readonly renderer?: 'tui' | 'plain' | 'silent';
|
|
19
17
|
readonly extras?: ManifestExtrasInput;
|
|
20
18
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ChainId, PluginKey } from "./brand.mjs";
|
|
2
2
|
import { PluginRole } from "./lifecycle.mjs";
|
|
3
|
+
import { RowSection } from "./projection.mjs";
|
|
3
4
|
import { CapabilityDecl } from "../contracts/capability-decl.mjs";
|
|
4
5
|
import { Identity } from "./identity.mjs";
|
|
5
6
|
import { Effect } from "effect";
|
|
@@ -56,6 +57,16 @@ interface PluginSpecBase<Id extends string, Start extends AnyPluginStart, Caps e
|
|
|
56
57
|
readonly start: Start;
|
|
57
58
|
readonly capabilities?: CapabilitySource<StartValue<Start>, Caps>;
|
|
58
59
|
readonly errorContributions?: ReadonlyArray<PluginErrorContribution>;
|
|
60
|
+
/** Dashboard section bucket the plugin's rows belong to. Required so
|
|
61
|
+
* the renderer never has to pattern-match on plugin name substrings
|
|
62
|
+
* to compute it. The supervisor stamps this onto every row at
|
|
63
|
+
* acquire-time. */
|
|
64
|
+
readonly section: RowSection;
|
|
65
|
+
/** Optional override for rows that own a routed endpoint. When set
|
|
66
|
+
* and the row carries an endpoint, the renderer groups it under
|
|
67
|
+
* `endpointSection` instead of `section`. Use sparingly — the
|
|
68
|
+
* default is for the plugin's normal `section` to apply uniformly. */
|
|
69
|
+
readonly endpointSection?: RowSection;
|
|
59
70
|
}
|
|
60
71
|
type PluginSpec<Id extends string, DependsOn extends DependencyInput | undefined, Start extends AnyPluginStart, Caps extends ReadonlyArray<CapabilityDecl>> = PluginSpecBase<Id, Start, Caps> & {
|
|
61
72
|
readonly dependsOn?: DependsOn;
|
|
@@ -70,6 +81,8 @@ interface Plugin<Id extends string, Value, Needs extends readonly AnyResourceRef
|
|
|
70
81
|
readonly start: (deps: ResolvedDependencies<DependencyInput | undefined>) => Effect.Effect<Value, unknown, unknown>;
|
|
71
82
|
readonly capabilities?: Caps | CapabilitiesFactory<Caps, Value>;
|
|
72
83
|
readonly errorContributions?: ReadonlyArray<PluginErrorContribution>;
|
|
84
|
+
readonly section: RowSection;
|
|
85
|
+
readonly endpointSection?: RowSection;
|
|
73
86
|
}
|
|
74
87
|
type AnyPlugin = Plugin<string, any, readonly AnyResourceRef[], ReadonlyArray<CapabilityDecl>>;
|
|
75
88
|
declare function definePlugin<const Id extends string, const DependsOn extends readonly AnyResourceRef[], const Start extends PluginStart<ResolvedDependencyList<DependsOn>> = PluginStart<ResolvedDependencyList<DependsOn>>, const Caps extends ReadonlyArray<CapabilityDecl> = ReadonlyArray<CapabilityDecl>>(spec: PluginSpecBase<Id, Start, Caps> & {
|
|
@@ -48,14 +48,16 @@ function definePlugin(spec) {
|
|
|
48
48
|
id: spec.id,
|
|
49
49
|
dependsOn,
|
|
50
50
|
role: spec.role,
|
|
51
|
+
section: spec.section,
|
|
51
52
|
start: spec.start,
|
|
52
53
|
...spec.pluginKey === void 0 ? {} : { pluginKey: spec.pluginKey },
|
|
53
54
|
...spec.watch === void 0 ? {} : { watch: spec.watch },
|
|
54
55
|
...capabilities === void 0 ? {} : { capabilities },
|
|
55
|
-
...spec.errorContributions === void 0 ? {} : { errorContributions: spec.errorContributions }
|
|
56
|
+
...spec.errorContributions === void 0 ? {} : { errorContributions: spec.errorContributions },
|
|
57
|
+
...spec.endpointSection === void 0 ? {} : { endpointSection: spec.endpointSection }
|
|
56
58
|
};
|
|
57
59
|
}
|
|
58
60
|
//#endregion
|
|
59
|
-
export { defineId, definePlugin, dependencyList, isPlugin, pluginDependencyRefs, resolveDependencyValues, resolvePluginDependencies, resource, uniqueResourceRefs };
|
|
61
|
+
export { defineId, definePlugin, dependencyList, isPlugin, isResourceRef, pluginDependencyRefs, resolveDependencyValues, resolvePluginDependencies, resource, uniqueResourceRefs };
|
|
60
62
|
|
|
61
63
|
//# sourceMappingURL=plugin.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.mjs","names":[],"sources":["../../src/substrate/plugin.ts"],"sourcesContent":["// Resource-native plugin contract.\n//\n// Public plugin authors use `definePlugin({ id, dependsOn, start })`.\n// The substrate now consumes that same shape directly: resource ids\n// drive scheduling, resolved dependency values are constructed by the\n// supervisor, and plugin bodies run through `start(...)`.\n\nimport type { Effect } from 'effect';\n\nimport type { CapabilityDecl } from '../contracts/capability-decl.ts';\nimport type { ChainId, PluginKey } from './brand.ts';\nimport type { Identity } from './identity.ts';\nimport type { PluginRole } from './lifecycle.ts';\n\nconst resourceBrand: unique symbol = Symbol.for('devstack.resource') as never;\nconst pluginBrand: unique symbol = Symbol.for('devstack.plugin') as never;\nconst resourceValue: unique symbol = Symbol.for('devstack.resource.value') as never;\nconst dependencyInputBrand: unique symbol = Symbol.for('devstack.plugin.dependency-input') as never;\n\nexport interface ResourceRef<Id extends string, Value = unknown> {\n\treadonly id: Id;\n\treadonly [resourceBrand]: true;\n\treadonly [resourceValue]?: () => Value;\n}\n\nexport type AnyResourceRef = ResourceRef<string, unknown>;\n\nexport type ResourceIdOf<R extends AnyResourceRef> = R['id'];\n\nexport type ResourceValueOf<R extends AnyResourceRef> =\n\tR extends ResourceRef<string, infer Value> ? Value : never;\n\nexport const defineId = <const Id extends string>(id: Id): Id => id;\n\nexport const resource = <const Id extends string, Value = unknown>(\n\tid: Id,\n): ResourceRef<Id, Value> =>\n\t({\n\t\tid,\n\t\t[resourceBrand]: true,\n\t}) as ResourceRef<Id, Value>;\n\nexport const isResourceRef = (value: unknown): value is AnyResourceRef =>\n\ttypeof value === 'object' &&\n\tvalue !== null &&\n\t(value as { readonly [resourceBrand]?: true })[resourceBrand] === true;\n\nexport type DependencyInput =\n\t| AnyResourceRef\n\t| readonly AnyResourceRef[]\n\t| Readonly<Record<string, AnyResourceRef>>;\n\nexport type DependencyList<Input> = Input extends readonly AnyResourceRef[]\n\t? Input\n\t: Input extends AnyResourceRef\n\t\t? readonly [Input]\n\t\t: Input extends Readonly<Record<string, AnyResourceRef>>\n\t\t\t? ReadonlyArray<Input[keyof Input]>\n\t\t\t: readonly [];\n\nexport type ResolvedDependencyList<Dependencies extends readonly AnyResourceRef[]> = readonly [\n\t...{\n\t\treadonly [K in keyof Dependencies]: Dependencies[K] extends AnyResourceRef\n\t\t\t? ResourceValueOf<Dependencies[K]>\n\t\t\t: never;\n\t},\n];\n\nexport type ResolvedDependencyObject<\n\tDependencies extends Readonly<Record<string, AnyResourceRef>>,\n> = {\n\treadonly [K in keyof Dependencies]: Dependencies[K] extends AnyResourceRef\n\t\t? ResourceValueOf<Dependencies[K]>\n\t\t: never;\n};\n\nexport type ResolvedDependencies<Input> = Input extends undefined\n\t? undefined\n\t: Input extends readonly AnyResourceRef[]\n\t\t? ResolvedDependencyList<Input>\n\t\t: Input extends AnyResourceRef\n\t\t\t? ResourceValueOf<Input>\n\t\t\t: Input extends Readonly<Record<string, AnyResourceRef>>\n\t\t\t\t? ResolvedDependencyObject<Input>\n\t\t\t\t: never;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AnyPluginStart = (...args: any[]) => Effect.Effect<unknown, unknown, unknown>;\n\ntype PluginStart<Deps> = [Deps] extends [undefined]\n\t? () => Effect.Effect<unknown, unknown, unknown>\n\t: (deps: Deps) => Effect.Effect<unknown, unknown, unknown>;\n\ntype StartValue<Start> = Start extends (\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t...args: any[]\n) => Effect.Effect<infer Value, unknown, unknown>\n\t? Value\n\t: never;\n\nexport interface PluginErrorContribution {\n\treadonly _tag: 'PluginErrorContribution';\n\treadonly errorTags: ReadonlyArray<string>;\n\treadonly formatter?: (\n\t\tvalue: { readonly _tag: string } & Readonly<Record<string, unknown>>,\n\t\trecurse: (inner: unknown) => string,\n\t) => string | null;\n}\n\nexport interface WatchDecl {\n\treadonly paths: ReadonlyArray<string>;\n\treadonly cascade?: boolean;\n}\n\nexport interface AcquireContext {\n\treadonly identity: Identity;\n\treadonly chain: ChainId;\n\treadonly runtimeRoot: string;\n}\n\nexport type CapabilitiesFactory<Caps extends ReadonlyArray<CapabilityDecl>, Resolved> = (\n\tresolved: Resolved,\n\tctx: AcquireContext,\n) => Caps;\n\nexport type CapabilitySource<Value, Caps extends ReadonlyArray<CapabilityDecl>> =\n\t| Caps\n\t| ((ctx: { readonly value: Value; readonly runtime: AcquireContext }) => Caps);\n\ninterface PluginSpecBase<\n\tId extends string,\n\tStart extends AnyPluginStart,\n\tCaps extends ReadonlyArray<CapabilityDecl>,\n> {\n\treadonly id: Id;\n\treadonly role: PluginRole;\n\treadonly pluginKey?: PluginKey | string;\n\treadonly watch?: WatchDecl;\n\treadonly start: Start;\n\treadonly capabilities?: CapabilitySource<StartValue<Start>, Caps>;\n\treadonly errorContributions?: ReadonlyArray<PluginErrorContribution>;\n}\n\nexport type PluginSpec<\n\tId extends string,\n\tDependsOn extends DependencyInput | undefined,\n\tStart extends AnyPluginStart,\n\tCaps extends ReadonlyArray<CapabilityDecl>,\n> = PluginSpecBase<Id, Start, Caps> & {\n\treadonly dependsOn?: DependsOn;\n};\n\nexport interface Plugin<\n\tId extends string,\n\tValue,\n\tNeeds extends readonly AnyResourceRef[],\n\tCaps extends ReadonlyArray<CapabilityDecl>,\n> extends ResourceRef<Id, Value> {\n\treadonly [pluginBrand]: true;\n\treadonly [dependencyInputBrand]: DependencyInput | undefined;\n\treadonly dependsOn: Needs;\n\treadonly role: PluginRole;\n\treadonly pluginKey?: PluginKey | string;\n\treadonly watch?: WatchDecl;\n\treadonly start: (\n\t\tdeps: ResolvedDependencies<DependencyInput | undefined>,\n\t) => Effect.Effect<Value, unknown, unknown>;\n\treadonly capabilities?: Caps | CapabilitiesFactory<Caps, Value>;\n\treadonly errorContributions?: ReadonlyArray<PluginErrorContribution>;\n}\n\nexport type AnyPlugin = Plugin<\n\tstring,\n\t// Erased runtime plugin values must be `any` rather than `unknown`\n\t// so concrete dynamic capability factories remain assignable under\n\t// strict function parameter variance. Precise value types stay on\n\t// concrete `Plugin<Id, Value, ...>` instances.\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tany,\n\treadonly AnyResourceRef[],\n\tReadonlyArray<CapabilityDecl>\n>;\n\nexport const isPlugin = (value: unknown): value is AnyPlugin =>\n\ttypeof value === 'object' &&\n\tvalue !== null &&\n\t(value as { readonly [pluginBrand]?: true })[pluginBrand] === true;\n\nexport const dependencyList = <Input extends DependencyInput | undefined>(\n\tdependsOn: Input,\n): DependencyList<Input> => {\n\tif (dependsOn === undefined) {\n\t\treturn [] as unknown as DependencyList<Input>;\n\t}\n\tif (Array.isArray(dependsOn)) {\n\t\treturn dependsOn as unknown as DependencyList<Input>;\n\t}\n\tif (isResourceRef(dependsOn)) {\n\t\treturn [dependsOn] as unknown as DependencyList<Input>;\n\t}\n\treturn Object.values(dependsOn) as unknown as DependencyList<Input>;\n};\n\nexport const uniqueResourceRefs = (refs: readonly AnyResourceRef[]): readonly AnyResourceRef[] => {\n\tconst seen = new Set<string>();\n\tconst unique: AnyResourceRef[] = [];\n\tfor (const ref of refs) {\n\t\tif (seen.has(ref.id)) continue;\n\t\tseen.add(ref.id);\n\t\tunique.push(ref);\n\t}\n\treturn unique;\n};\n\nexport const resolveDependencyValues = <Input extends DependencyInput | undefined>(\n\tdependsOn: Input,\n\tread: (resource: DependencyList<Input>[number]) => unknown,\n): ResolvedDependencies<Input> => {\n\tconst readAny = (resourceRef: AnyResourceRef) =>\n\t\tread(resourceRef as DependencyList<Input>[number]);\n\n\tif (dependsOn === undefined) {\n\t\treturn undefined as ResolvedDependencies<Input>;\n\t}\n\tif (Array.isArray(dependsOn)) {\n\t\treturn dependsOn.map((resourceRef) => readAny(resourceRef)) as ResolvedDependencies<Input>;\n\t}\n\tif (isResourceRef(dependsOn)) {\n\t\treturn readAny(dependsOn) as ResolvedDependencies<Input>;\n\t}\n\treturn Object.fromEntries(\n\t\tObject.entries(dependsOn).map(([key, resourceRef]) => [key, readAny(resourceRef)]),\n\t) as ResolvedDependencies<Input>;\n};\n\nexport const resolvePluginDependencies = (\n\tplugin: AnyPlugin,\n\tread: (resource: AnyResourceRef) => unknown,\n): ResolvedDependencies<DependencyInput | undefined> =>\n\tresolveDependencyValues(plugin[dependencyInputBrand], (resourceRef) =>\n\t\tread(resourceRef as AnyResourceRef),\n\t);\n\nexport const pluginDependencyRefs = (plugin: AnyPlugin): readonly AnyResourceRef[] =>\n\tdependencyList(plugin[dependencyInputBrand]) as readonly AnyResourceRef[];\n\nexport function definePlugin<\n\tconst Id extends string,\n\tconst DependsOn extends readonly AnyResourceRef[],\n\tconst Start extends PluginStart<ResolvedDependencyList<DependsOn>> = PluginStart<\n\t\tResolvedDependencyList<DependsOn>\n\t>,\n\tconst Caps extends ReadonlyArray<CapabilityDecl> = ReadonlyArray<CapabilityDecl>,\n>(\n\tspec: PluginSpecBase<Id, Start, Caps> & {\n\t\treadonly dependsOn: DependsOn;\n\t},\n): Plugin<Id, StartValue<Start>, DependsOn, Caps>;\nexport function definePlugin<\n\tconst Id extends string,\n\tconst DependsOn extends Readonly<Record<string, AnyResourceRef>>,\n\tconst Start extends PluginStart<ResolvedDependencyObject<DependsOn>> = PluginStart<\n\t\tResolvedDependencyObject<DependsOn>\n\t>,\n\tconst Caps extends ReadonlyArray<CapabilityDecl> = ReadonlyArray<CapabilityDecl>,\n>(\n\tspec: PluginSpecBase<Id, Start, Caps> & {\n\t\treadonly dependsOn: DependsOn;\n\t},\n): Plugin<Id, StartValue<Start>, DependencyList<DependsOn>, Caps>;\nexport function definePlugin<\n\tconst Id extends string,\n\tconst DependsOn extends AnyResourceRef,\n\tconst Start extends PluginStart<ResourceValueOf<DependsOn>> = PluginStart<\n\t\tResourceValueOf<DependsOn>\n\t>,\n\tconst Caps extends ReadonlyArray<CapabilityDecl> = ReadonlyArray<CapabilityDecl>,\n>(\n\tspec: PluginSpecBase<Id, Start, Caps> & {\n\t\treadonly dependsOn: DependsOn;\n\t},\n): Plugin<Id, StartValue<Start>, readonly [DependsOn], Caps>;\nexport function definePlugin<\n\tconst Id extends string,\n\tconst Start extends PluginStart<undefined> = PluginStart<undefined>,\n\tconst Caps extends ReadonlyArray<CapabilityDecl> = ReadonlyArray<CapabilityDecl>,\n>(\n\tspec: PluginSpecBase<Id, Start, Caps> & {\n\t\treadonly dependsOn?: undefined;\n\t},\n): Plugin<Id, StartValue<Start>, readonly [], Caps>;\nexport function definePlugin(\n\tspec: PluginSpecBase<string, AnyPluginStart, ReadonlyArray<CapabilityDecl>> & {\n\t\treadonly dependsOn?: DependencyInput;\n\t},\n): AnyPlugin {\n\tconst dependsOn = uniqueResourceRefs(dependencyList(spec.dependsOn));\n\tconst capabilitiesField = spec.capabilities;\n\tconst capabilities =\n\t\ttypeof capabilitiesField === 'function'\n\t\t\t? (value: unknown, runtime: AcquireContext) => capabilitiesField({ value, runtime })\n\t\t\t: capabilitiesField;\n\n\treturn {\n\t\t[resourceBrand]: true,\n\t\t[pluginBrand]: true,\n\t\t[dependencyInputBrand]: spec.dependsOn,\n\t\tid: spec.id,\n\t\tdependsOn,\n\t\trole: spec.role,\n\t\tstart: spec.start as AnyPlugin['start'],\n\t\t...(spec.pluginKey === undefined ? {} : { pluginKey: spec.pluginKey }),\n\t\t...(spec.watch === undefined ? {} : { watch: spec.watch }),\n\t\t...(capabilities === undefined ? {} : { capabilities }),\n\t\t...(spec.errorContributions === undefined\n\t\t\t? {}\n\t\t\t: { errorContributions: spec.errorContributions }),\n\t} as AnyPlugin;\n}\n\nexport type ProvidedIdsOf<Members> =\n\tMembers extends ReadonlyArray<unknown>\n\t\t? Members[number] extends { readonly id: infer Id extends string }\n\t\t\t? Id\n\t\t\t: never\n\t\t: never;\n\nexport type ConsumedIdsOf<Members> =\n\tMembers extends ReadonlyArray<unknown>\n\t\t? Members[number] extends { readonly dependsOn: infer Dependencies }\n\t\t\t? Dependencies extends ReadonlyArray<infer Dependency>\n\t\t\t\t? Dependency extends { readonly id: infer Id extends string }\n\t\t\t\t\t? Id\n\t\t\t\t\t: never\n\t\t\t\t: never\n\t\t\t: never\n\t\t: never;\n\nexport type MissingProviders<Members> = Exclude<ConsumedIdsOf<Members>, ProvidedIdsOf<Members>>;\n\nexport interface __MissingProvidersError<Missing extends string> {\n\treadonly __missing_providers: Missing;\n}\n"],"mappings":";AAcA,MAAM,gBAA+B,OAAO,IAAI,oBAAoB;AACpE,MAAM,cAA6B,OAAO,IAAI,kBAAkB;AAEhE,MAAM,uBAAsC,OAAO,IAAI,mCAAmC;AAe1F,MAAa,YAAqC,OAAe;AAEjE,MAAa,YACZ,QAEC;CACA;EACC,gBAAgB;CACjB;AAEF,MAAa,iBAAiB,UAC7B,OAAO,UAAU,YACjB,UAAU,QACT,MAA8C,mBAAmB;AA0InE,MAAa,YAAY,UACxB,OAAO,UAAU,YACjB,UAAU,QACT,MAA4C,iBAAiB;AAE/D,MAAa,kBACZ,cAC2B;AAC3B,KAAI,cAAc,KAAA,EACjB,QAAO,EAAE;AAEV,KAAI,MAAM,QAAQ,UAAU,CAC3B,QAAO;AAER,KAAI,cAAc,UAAU,CAC3B,QAAO,CAAC,UAAU;AAEnB,QAAO,OAAO,OAAO,UAAU;;AAGhC,MAAa,sBAAsB,SAA+D;CACjG,MAAM,uBAAO,IAAI,KAAa;CAC9B,MAAM,SAA2B,EAAE;AACnC,MAAK,MAAM,OAAO,MAAM;AACvB,MAAI,KAAK,IAAI,IAAI,GAAG,CAAE;AACtB,OAAK,IAAI,IAAI,GAAG;AAChB,SAAO,KAAK,IAAI;;AAEjB,QAAO;;AAGR,MAAa,2BACZ,WACA,SACiC;CACjC,MAAM,WAAW,gBAChB,KAAK,YAA6C;AAEnD,KAAI,cAAc,KAAA,EACjB;AAED,KAAI,MAAM,QAAQ,UAAU,CAC3B,QAAO,UAAU,KAAK,gBAAgB,QAAQ,YAAY,CAAC;AAE5D,KAAI,cAAc,UAAU,CAC3B,QAAO,QAAQ,UAAU;AAE1B,QAAO,OAAO,YACb,OAAO,QAAQ,UAAU,CAAC,KAAK,CAAC,KAAK,iBAAiB,CAAC,KAAK,QAAQ,YAAY,CAAC,CAAC,CAClF;;AAGF,MAAa,6BACZ,QACA,SAEA,wBAAwB,OAAO,wBAAwB,gBACtD,KAAK,YAA8B,CACnC;AAEF,MAAa,wBAAwB,WACpC,eAAe,OAAO,sBAAsB;AA+C7C,SAAgB,aACf,MAGY;CACZ,MAAM,YAAY,mBAAmB,eAAe,KAAK,UAAU,CAAC;CACpE,MAAM,oBAAoB,KAAK;CAC/B,MAAM,eACL,OAAO,sBAAsB,cACzB,OAAgB,YAA4B,kBAAkB;EAAE;EAAO;EAAS,CAAC,GAClF;AAEJ,QAAO;GACL,gBAAgB;GAChB,cAAc;GACd,uBAAuB,KAAK;EAC7B,IAAI,KAAK;EACT;EACA,MAAM,KAAK;EACX,OAAO,KAAK;EACZ,GAAI,KAAK,cAAc,KAAA,IAAY,EAAE,GAAG,EAAE,WAAW,KAAK,WAAW;EACrE,GAAI,KAAK,UAAU,KAAA,IAAY,EAAE,GAAG,EAAE,OAAO,KAAK,OAAO;EACzD,GAAI,iBAAiB,KAAA,IAAY,EAAE,GAAG,EAAE,cAAc;EACtD,GAAI,KAAK,uBAAuB,KAAA,IAC7B,EAAE,GACF,EAAE,oBAAoB,KAAK,oBAAoB;EAClD"}
|
|
1
|
+
{"version":3,"file":"plugin.mjs","names":[],"sources":["../../src/substrate/plugin.ts"],"sourcesContent":["// Resource-native plugin contract.\n//\n// Public plugin authors use `definePlugin({ id, dependsOn, start })`.\n// The substrate now consumes that same shape directly: resource ids\n// drive scheduling, resolved dependency values are constructed by the\n// supervisor, and plugin bodies run through `start(...)`.\n\nimport type { Effect } from 'effect';\n\nimport type { CapabilityDecl } from '../contracts/capability-decl.ts';\nimport type { ChainId, PluginKey } from './brand.ts';\nimport type { Identity } from './identity.ts';\nimport type { PluginRole } from './lifecycle.ts';\nimport type { RowSection } from './projection.ts';\n\nconst resourceBrand: unique symbol = Symbol.for('devstack.resource') as never;\nconst pluginBrand: unique symbol = Symbol.for('devstack.plugin') as never;\nconst resourceValue: unique symbol = Symbol.for('devstack.resource.value') as never;\nconst dependencyInputBrand: unique symbol = Symbol.for('devstack.plugin.dependency-input') as never;\n\nexport interface ResourceRef<Id extends string, Value = unknown> {\n\treadonly id: Id;\n\treadonly [resourceBrand]: true;\n\treadonly [resourceValue]?: () => Value;\n}\n\nexport type AnyResourceRef = ResourceRef<string, unknown>;\n\nexport type ResourceIdOf<R extends AnyResourceRef> = R['id'];\n\nexport type ResourceValueOf<R extends AnyResourceRef> =\n\tR extends ResourceRef<string, infer Value> ? Value : never;\n\nexport const defineId = <const Id extends string>(id: Id): Id => id;\n\nexport const resource = <const Id extends string, Value = unknown>(\n\tid: Id,\n): ResourceRef<Id, Value> =>\n\t({\n\t\tid,\n\t\t[resourceBrand]: true,\n\t}) as ResourceRef<Id, Value>;\n\nexport const isResourceRef = (value: unknown): value is AnyResourceRef =>\n\ttypeof value === 'object' &&\n\tvalue !== null &&\n\t(value as { readonly [resourceBrand]?: true })[resourceBrand] === true;\n\nexport type DependencyInput =\n\t| AnyResourceRef\n\t| readonly AnyResourceRef[]\n\t| Readonly<Record<string, AnyResourceRef>>;\n\nexport type DependencyList<Input> = Input extends readonly AnyResourceRef[]\n\t? Input\n\t: Input extends AnyResourceRef\n\t\t? readonly [Input]\n\t\t: Input extends Readonly<Record<string, AnyResourceRef>>\n\t\t\t? ReadonlyArray<Input[keyof Input]>\n\t\t\t: readonly [];\n\nexport type ResolvedDependencyList<Dependencies extends readonly AnyResourceRef[]> = readonly [\n\t...{\n\t\treadonly [K in keyof Dependencies]: Dependencies[K] extends AnyResourceRef\n\t\t\t? ResourceValueOf<Dependencies[K]>\n\t\t\t: never;\n\t},\n];\n\nexport type ResolvedDependencyObject<\n\tDependencies extends Readonly<Record<string, AnyResourceRef>>,\n> = {\n\treadonly [K in keyof Dependencies]: Dependencies[K] extends AnyResourceRef\n\t\t? ResourceValueOf<Dependencies[K]>\n\t\t: never;\n};\n\nexport type ResolvedDependencies<Input> = Input extends undefined\n\t? undefined\n\t: Input extends readonly AnyResourceRef[]\n\t\t? ResolvedDependencyList<Input>\n\t\t: Input extends AnyResourceRef\n\t\t\t? ResourceValueOf<Input>\n\t\t\t: Input extends Readonly<Record<string, AnyResourceRef>>\n\t\t\t\t? ResolvedDependencyObject<Input>\n\t\t\t\t: never;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AnyPluginStart = (...args: any[]) => Effect.Effect<unknown, unknown, unknown>;\n\ntype PluginStart<Deps> = [Deps] extends [undefined]\n\t? () => Effect.Effect<unknown, unknown, unknown>\n\t: (deps: Deps) => Effect.Effect<unknown, unknown, unknown>;\n\ntype StartValue<Start> = Start extends (\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t...args: any[]\n) => Effect.Effect<infer Value, unknown, unknown>\n\t? Value\n\t: never;\n\nexport interface PluginErrorContribution {\n\treadonly _tag: 'PluginErrorContribution';\n\treadonly errorTags: ReadonlyArray<string>;\n\treadonly formatter?: (\n\t\tvalue: { readonly _tag: string } & Readonly<Record<string, unknown>>,\n\t\trecurse: (inner: unknown) => string,\n\t) => string | null;\n}\n\nexport interface WatchDecl {\n\treadonly paths: ReadonlyArray<string>;\n\treadonly cascade?: boolean;\n}\n\nexport interface AcquireContext {\n\treadonly identity: Identity;\n\treadonly chain: ChainId;\n\treadonly runtimeRoot: string;\n}\n\nexport type CapabilitiesFactory<Caps extends ReadonlyArray<CapabilityDecl>, Resolved> = (\n\tresolved: Resolved,\n\tctx: AcquireContext,\n) => Caps;\n\nexport type CapabilitySource<Value, Caps extends ReadonlyArray<CapabilityDecl>> =\n\t| Caps\n\t| ((ctx: { readonly value: Value; readonly runtime: AcquireContext }) => Caps);\n\ninterface PluginSpecBase<\n\tId extends string,\n\tStart extends AnyPluginStart,\n\tCaps extends ReadonlyArray<CapabilityDecl>,\n> {\n\treadonly id: Id;\n\treadonly role: PluginRole;\n\treadonly pluginKey?: PluginKey | string;\n\treadonly watch?: WatchDecl;\n\treadonly start: Start;\n\treadonly capabilities?: CapabilitySource<StartValue<Start>, Caps>;\n\treadonly errorContributions?: ReadonlyArray<PluginErrorContribution>;\n\t/** Dashboard section bucket the plugin's rows belong to. Required so\n\t * the renderer never has to pattern-match on plugin name substrings\n\t * to compute it. The supervisor stamps this onto every row at\n\t * acquire-time. */\n\treadonly section: RowSection;\n\t/** Optional override for rows that own a routed endpoint. When set\n\t * and the row carries an endpoint, the renderer groups it under\n\t * `endpointSection` instead of `section`. Use sparingly — the\n\t * default is for the plugin's normal `section` to apply uniformly. */\n\treadonly endpointSection?: RowSection;\n}\n\nexport type PluginSpec<\n\tId extends string,\n\tDependsOn extends DependencyInput | undefined,\n\tStart extends AnyPluginStart,\n\tCaps extends ReadonlyArray<CapabilityDecl>,\n> = PluginSpecBase<Id, Start, Caps> & {\n\treadonly dependsOn?: DependsOn;\n};\n\nexport interface Plugin<\n\tId extends string,\n\tValue,\n\tNeeds extends readonly AnyResourceRef[],\n\tCaps extends ReadonlyArray<CapabilityDecl>,\n> extends ResourceRef<Id, Value> {\n\treadonly [pluginBrand]: true;\n\treadonly [dependencyInputBrand]: DependencyInput | undefined;\n\treadonly dependsOn: Needs;\n\treadonly role: PluginRole;\n\treadonly pluginKey?: PluginKey | string;\n\treadonly watch?: WatchDecl;\n\treadonly start: (\n\t\tdeps: ResolvedDependencies<DependencyInput | undefined>,\n\t) => Effect.Effect<Value, unknown, unknown>;\n\treadonly capabilities?: Caps | CapabilitiesFactory<Caps, Value>;\n\treadonly errorContributions?: ReadonlyArray<PluginErrorContribution>;\n\treadonly section: RowSection;\n\treadonly endpointSection?: RowSection;\n}\n\nexport type AnyPlugin = Plugin<\n\tstring,\n\t// Erased runtime plugin values must be `any` rather than `unknown`\n\t// so concrete dynamic capability factories remain assignable under\n\t// strict function parameter variance. Precise value types stay on\n\t// concrete `Plugin<Id, Value, ...>` instances.\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tany,\n\treadonly AnyResourceRef[],\n\tReadonlyArray<CapabilityDecl>\n>;\n\nexport const isPlugin = (value: unknown): value is AnyPlugin =>\n\ttypeof value === 'object' &&\n\tvalue !== null &&\n\t(value as { readonly [pluginBrand]?: true })[pluginBrand] === true;\n\nexport const dependencyList = <Input extends DependencyInput | undefined>(\n\tdependsOn: Input,\n): DependencyList<Input> => {\n\tif (dependsOn === undefined) {\n\t\treturn [] as unknown as DependencyList<Input>;\n\t}\n\tif (Array.isArray(dependsOn)) {\n\t\treturn dependsOn as unknown as DependencyList<Input>;\n\t}\n\tif (isResourceRef(dependsOn)) {\n\t\treturn [dependsOn] as unknown as DependencyList<Input>;\n\t}\n\treturn Object.values(dependsOn) as unknown as DependencyList<Input>;\n};\n\nexport const uniqueResourceRefs = (refs: readonly AnyResourceRef[]): readonly AnyResourceRef[] => {\n\tconst seen = new Set<string>();\n\tconst unique: AnyResourceRef[] = [];\n\tfor (const ref of refs) {\n\t\tif (seen.has(ref.id)) continue;\n\t\tseen.add(ref.id);\n\t\tunique.push(ref);\n\t}\n\treturn unique;\n};\n\nexport const resolveDependencyValues = <Input extends DependencyInput | undefined>(\n\tdependsOn: Input,\n\tread: (resource: DependencyList<Input>[number]) => unknown,\n): ResolvedDependencies<Input> => {\n\tconst readAny = (resourceRef: AnyResourceRef) =>\n\t\tread(resourceRef as DependencyList<Input>[number]);\n\n\tif (dependsOn === undefined) {\n\t\treturn undefined as ResolvedDependencies<Input>;\n\t}\n\tif (Array.isArray(dependsOn)) {\n\t\treturn dependsOn.map((resourceRef) => readAny(resourceRef)) as ResolvedDependencies<Input>;\n\t}\n\tif (isResourceRef(dependsOn)) {\n\t\treturn readAny(dependsOn) as ResolvedDependencies<Input>;\n\t}\n\treturn Object.fromEntries(\n\t\tObject.entries(dependsOn).map(([key, resourceRef]) => [key, readAny(resourceRef)]),\n\t) as ResolvedDependencies<Input>;\n};\n\nexport const resolvePluginDependencies = (\n\tplugin: AnyPlugin,\n\tread: (resource: AnyResourceRef) => unknown,\n): ResolvedDependencies<DependencyInput | undefined> =>\n\tresolveDependencyValues(plugin[dependencyInputBrand], (resourceRef) =>\n\t\tread(resourceRef as AnyResourceRef),\n\t);\n\nexport const pluginDependencyRefs = (plugin: AnyPlugin): readonly AnyResourceRef[] =>\n\tdependencyList(plugin[dependencyInputBrand]) as readonly AnyResourceRef[];\n\nexport function definePlugin<\n\tconst Id extends string,\n\tconst DependsOn extends readonly AnyResourceRef[],\n\tconst Start extends PluginStart<ResolvedDependencyList<DependsOn>> = PluginStart<\n\t\tResolvedDependencyList<DependsOn>\n\t>,\n\tconst Caps extends ReadonlyArray<CapabilityDecl> = ReadonlyArray<CapabilityDecl>,\n>(\n\tspec: PluginSpecBase<Id, Start, Caps> & {\n\t\treadonly dependsOn: DependsOn;\n\t},\n): Plugin<Id, StartValue<Start>, DependsOn, Caps>;\nexport function definePlugin<\n\tconst Id extends string,\n\tconst DependsOn extends Readonly<Record<string, AnyResourceRef>>,\n\tconst Start extends PluginStart<ResolvedDependencyObject<DependsOn>> = PluginStart<\n\t\tResolvedDependencyObject<DependsOn>\n\t>,\n\tconst Caps extends ReadonlyArray<CapabilityDecl> = ReadonlyArray<CapabilityDecl>,\n>(\n\tspec: PluginSpecBase<Id, Start, Caps> & {\n\t\treadonly dependsOn: DependsOn;\n\t},\n): Plugin<Id, StartValue<Start>, DependencyList<DependsOn>, Caps>;\nexport function definePlugin<\n\tconst Id extends string,\n\tconst DependsOn extends AnyResourceRef,\n\tconst Start extends PluginStart<ResourceValueOf<DependsOn>> = PluginStart<\n\t\tResourceValueOf<DependsOn>\n\t>,\n\tconst Caps extends ReadonlyArray<CapabilityDecl> = ReadonlyArray<CapabilityDecl>,\n>(\n\tspec: PluginSpecBase<Id, Start, Caps> & {\n\t\treadonly dependsOn: DependsOn;\n\t},\n): Plugin<Id, StartValue<Start>, readonly [DependsOn], Caps>;\nexport function definePlugin<\n\tconst Id extends string,\n\tconst Start extends PluginStart<undefined> = PluginStart<undefined>,\n\tconst Caps extends ReadonlyArray<CapabilityDecl> = ReadonlyArray<CapabilityDecl>,\n>(\n\tspec: PluginSpecBase<Id, Start, Caps> & {\n\t\treadonly dependsOn?: undefined;\n\t},\n): Plugin<Id, StartValue<Start>, readonly [], Caps>;\nexport function definePlugin(\n\tspec: PluginSpecBase<string, AnyPluginStart, ReadonlyArray<CapabilityDecl>> & {\n\t\treadonly dependsOn?: DependencyInput;\n\t},\n): AnyPlugin {\n\tconst dependsOn = uniqueResourceRefs(dependencyList(spec.dependsOn));\n\tconst capabilitiesField = spec.capabilities;\n\tconst capabilities =\n\t\ttypeof capabilitiesField === 'function'\n\t\t\t? (value: unknown, runtime: AcquireContext) => capabilitiesField({ value, runtime })\n\t\t\t: capabilitiesField;\n\n\treturn {\n\t\t[resourceBrand]: true,\n\t\t[pluginBrand]: true,\n\t\t[dependencyInputBrand]: spec.dependsOn,\n\t\tid: spec.id,\n\t\tdependsOn,\n\t\trole: spec.role,\n\t\tsection: spec.section,\n\t\tstart: spec.start as AnyPlugin['start'],\n\t\t...(spec.pluginKey === undefined ? {} : { pluginKey: spec.pluginKey }),\n\t\t...(spec.watch === undefined ? {} : { watch: spec.watch }),\n\t\t...(capabilities === undefined ? {} : { capabilities }),\n\t\t...(spec.errorContributions === undefined\n\t\t\t? {}\n\t\t\t: { errorContributions: spec.errorContributions }),\n\t\t...(spec.endpointSection === undefined ? {} : { endpointSection: spec.endpointSection }),\n\t} as AnyPlugin;\n}\n\nexport type ProvidedIdsOf<Members> =\n\tMembers extends ReadonlyArray<unknown>\n\t\t? Members[number] extends { readonly id: infer Id extends string }\n\t\t\t? Id\n\t\t\t: never\n\t\t: never;\n\nexport type ConsumedIdsOf<Members> =\n\tMembers extends ReadonlyArray<unknown>\n\t\t? Members[number] extends { readonly dependsOn: infer Dependencies }\n\t\t\t? Dependencies extends ReadonlyArray<infer Dependency>\n\t\t\t\t? Dependency extends { readonly id: infer Id extends string }\n\t\t\t\t\t? Id\n\t\t\t\t\t: never\n\t\t\t\t: never\n\t\t\t: never\n\t\t: never;\n\nexport type MissingProviders<Members> = Exclude<ConsumedIdsOf<Members>, ProvidedIdsOf<Members>>;\n\nexport interface __MissingProvidersError<Missing extends string> {\n\treadonly __missing_providers: Missing;\n}\n"],"mappings":";AAeA,MAAM,gBAA+B,OAAO,IAAI,oBAAoB;AACpE,MAAM,cAA6B,OAAO,IAAI,kBAAkB;AAEhE,MAAM,uBAAsC,OAAO,IAAI,mCAAmC;AAe1F,MAAa,YAAqC,OAAe;AAEjE,MAAa,YACZ,QAEC;CACA;EACC,gBAAgB;CACjB;AAEF,MAAa,iBAAiB,UAC7B,OAAO,UAAU,YACjB,UAAU,QACT,MAA8C,mBAAmB;AAsJnE,MAAa,YAAY,UACxB,OAAO,UAAU,YACjB,UAAU,QACT,MAA4C,iBAAiB;AAE/D,MAAa,kBACZ,cAC2B;AAC3B,KAAI,cAAc,KAAA,EACjB,QAAO,EAAE;AAEV,KAAI,MAAM,QAAQ,UAAU,CAC3B,QAAO;AAER,KAAI,cAAc,UAAU,CAC3B,QAAO,CAAC,UAAU;AAEnB,QAAO,OAAO,OAAO,UAAU;;AAGhC,MAAa,sBAAsB,SAA+D;CACjG,MAAM,uBAAO,IAAI,KAAa;CAC9B,MAAM,SAA2B,EAAE;AACnC,MAAK,MAAM,OAAO,MAAM;AACvB,MAAI,KAAK,IAAI,IAAI,GAAG,CAAE;AACtB,OAAK,IAAI,IAAI,GAAG;AAChB,SAAO,KAAK,IAAI;;AAEjB,QAAO;;AAGR,MAAa,2BACZ,WACA,SACiC;CACjC,MAAM,WAAW,gBAChB,KAAK,YAA6C;AAEnD,KAAI,cAAc,KAAA,EACjB;AAED,KAAI,MAAM,QAAQ,UAAU,CAC3B,QAAO,UAAU,KAAK,gBAAgB,QAAQ,YAAY,CAAC;AAE5D,KAAI,cAAc,UAAU,CAC3B,QAAO,QAAQ,UAAU;AAE1B,QAAO,OAAO,YACb,OAAO,QAAQ,UAAU,CAAC,KAAK,CAAC,KAAK,iBAAiB,CAAC,KAAK,QAAQ,YAAY,CAAC,CAAC,CAClF;;AAGF,MAAa,6BACZ,QACA,SAEA,wBAAwB,OAAO,wBAAwB,gBACtD,KAAK,YAA8B,CACnC;AAEF,MAAa,wBAAwB,WACpC,eAAe,OAAO,sBAAsB;AA+C7C,SAAgB,aACf,MAGY;CACZ,MAAM,YAAY,mBAAmB,eAAe,KAAK,UAAU,CAAC;CACpE,MAAM,oBAAoB,KAAK;CAC/B,MAAM,eACL,OAAO,sBAAsB,cACzB,OAAgB,YAA4B,kBAAkB;EAAE;EAAO;EAAS,CAAC,GAClF;AAEJ,QAAO;GACL,gBAAgB;GAChB,cAAc;GACd,uBAAuB,KAAK;EAC7B,IAAI,KAAK;EACT;EACA,MAAM,KAAK;EACX,SAAS,KAAK;EACd,OAAO,KAAK;EACZ,GAAI,KAAK,cAAc,KAAA,IAAY,EAAE,GAAG,EAAE,WAAW,KAAK,WAAW;EACrE,GAAI,KAAK,UAAU,KAAA,IAAY,EAAE,GAAG,EAAE,OAAO,KAAK,OAAO;EACzD,GAAI,iBAAiB,KAAA,IAAY,EAAE,GAAG,EAAE,cAAc;EACtD,GAAI,KAAK,uBAAuB,KAAA,IAC7B,EAAE,GACF,EAAE,oBAAoB,KAAK,oBAAoB;EAClD,GAAI,KAAK,oBAAoB,KAAA,IAAY,EAAE,GAAG,EAAE,iBAAiB,KAAK,iBAAiB;EACvF"}
|
|
@@ -25,6 +25,19 @@ interface SubscribableState {
|
|
|
25
25
|
};
|
|
26
26
|
readonly stackBuild: ReadonlyArray<BuildEntry>;
|
|
27
27
|
}
|
|
28
|
+
/** Closed vocabulary of dashboard section buckets a row belongs to.
|
|
29
|
+
*
|
|
30
|
+
* The renderer groups rows by `Row.section` and the event log colors
|
|
31
|
+
* scope chips by it. The vocabulary is intentionally small and
|
|
32
|
+
* plugin-domain-agnostic — each plugin declares its section ONCE at
|
|
33
|
+
* `definePlugin({ ..., section })` time and the supervisor stamps it
|
|
34
|
+
* onto every row it constructs.
|
|
35
|
+
*
|
|
36
|
+
* Adding a section is a substrate revision: the closed list lives
|
|
37
|
+
* here so the TUI's `sectionLabel` / `sectionColor` cases stay
|
|
38
|
+
* exhaustive.
|
|
39
|
+
*/
|
|
40
|
+
type RowSection = 'service' | 'package' | 'account' | 'action' | 'app' | 'other';
|
|
28
41
|
/** One row per visible plugin instance. */
|
|
29
42
|
interface Row {
|
|
30
43
|
readonly key: PluginKey;
|
|
@@ -35,6 +48,17 @@ interface Row {
|
|
|
35
48
|
readonly logTail: LogTail;
|
|
36
49
|
readonly endpoints: ReadonlyArray<EndpointKey>;
|
|
37
50
|
readonly selectiveRestartHighlight: boolean;
|
|
51
|
+
/** Dashboard section bucket the row belongs to. Plugin-declared at
|
|
52
|
+
* `definePlugin({ section })` time; the supervisor stamps the
|
|
53
|
+
* declaration onto the row at acquire. Renderers consume this
|
|
54
|
+
* field directly — they MUST NOT pattern-match on `key` substrings
|
|
55
|
+
* to derive a section. */
|
|
56
|
+
readonly section: RowSection;
|
|
57
|
+
/** Section bucket the row should render in once it owns a routed
|
|
58
|
+
* endpoint. Defaults to `section` (i.e. no override). Plugins set
|
|
59
|
+
* `endpointSection` when an "app"-style row should re-bucket to
|
|
60
|
+
* the services list as soon as its URL is up. */
|
|
61
|
+
readonly endpointSection: RowSection;
|
|
38
62
|
}
|
|
39
63
|
interface LogTail {
|
|
40
64
|
readonly lines: ReadonlyArray<string>;
|
|
@@ -43,10 +67,11 @@ interface LogTail {
|
|
|
43
67
|
}
|
|
44
68
|
interface Endpoint {
|
|
45
69
|
readonly endpointKey: EndpointKey;
|
|
70
|
+
readonly pluginKey: PluginKey;
|
|
46
71
|
readonly name: string;
|
|
47
72
|
readonly url: string;
|
|
48
73
|
readonly displayUrl: string | null;
|
|
49
|
-
readonly wireProtocol: 'http' | 'h2c' |
|
|
74
|
+
readonly wireProtocol: 'http' | 'h2c' | 'tcp';
|
|
50
75
|
readonly registeredAt: number;
|
|
51
76
|
}
|
|
52
77
|
interface AccountProjection {
|
|
@@ -64,7 +89,14 @@ interface AccountProjection {
|
|
|
64
89
|
readonly coin: string;
|
|
65
90
|
readonly fullCoinType: string;
|
|
66
91
|
readonly amount: string;
|
|
67
|
-
|
|
92
|
+
/** `'funded'` — a faucet call satisfied the request.
|
|
93
|
+
* `'already-satisfied'` — the pre-existing balance covered
|
|
94
|
+
* the request (no faucet call needed); semantically a
|
|
95
|
+
* success, surfaced distinctly so renderers can show
|
|
96
|
+
* "✓ cached" vs "✓ funded" if they want to.
|
|
97
|
+
* `'skipped'` — zero-amount no-op, or the funding pass
|
|
98
|
+
* never reached the entry. */
|
|
99
|
+
readonly status: 'funded' | 'already-satisfied' | 'skipped';
|
|
68
100
|
}>;
|
|
69
101
|
};
|
|
70
102
|
readonly walletVisible: boolean;
|
|
@@ -96,5 +128,5 @@ interface BuildEntry {
|
|
|
96
128
|
readonly startedAt: number;
|
|
97
129
|
}
|
|
98
130
|
//#endregion
|
|
99
|
-
export {
|
|
131
|
+
export { BuildEntry, Endpoint, RowSection, StructuredError, SubscribableState };
|
|
100
132
|
//# sourceMappingURL=projection.d.mts.map
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import { SpanAttr } from "../observability/spans.mjs";
|
|
1
2
|
import { parseJsonTextSync } from "../runtime-decode.mjs";
|
|
2
3
|
import { CacheService } from "../cache/service.mjs";
|
|
4
|
+
import "../cache/index.mjs";
|
|
5
|
+
import { setCurrentPluginPhase } from "../current-plugin.mjs";
|
|
3
6
|
import { Context, Effect, Layer } from "effect";
|
|
4
7
|
//#region src/substrate/runtime/artifact-publisher/index.ts
|
|
5
8
|
/**
|
|
@@ -12,7 +15,7 @@ import { Context, Effect, Layer } from "effect";
|
|
|
12
15
|
* stacks isolate by construction — each stack's Layer build is
|
|
13
16
|
* independent.
|
|
14
17
|
*/
|
|
15
|
-
var ArtifactPublisherService = class extends Context.Service()("@devstack
|
|
18
|
+
var ArtifactPublisherService = class extends Context.Service()("@devstack/substrate/ArtifactPublisher") {};
|
|
16
19
|
const encode = (value) => new TextEncoder().encode(JSON.stringify(value));
|
|
17
20
|
const decode = (bytes) => {
|
|
18
21
|
try {
|
|
@@ -26,9 +29,9 @@ const decode = (bytes) => {
|
|
|
26
29
|
};
|
|
27
30
|
const makePublisher = (cache) => ({ publish: (spec) => Effect.gen(function* () {
|
|
28
31
|
yield* Effect.annotateCurrentSpan({
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
[SpanAttr.artifactPublisherNamespace]: spec.namespace,
|
|
33
|
+
[SpanAttr.artifactPublisherChain]: spec.chain,
|
|
34
|
+
[SpanAttr.artifactPublisherContentHash]: spec.contentHash
|
|
32
35
|
});
|
|
33
36
|
const hit = yield* cache.lookup({
|
|
34
37
|
namespace: spec.namespace,
|
|
@@ -39,14 +42,21 @@ const makePublisher = (cache) => ({ publish: (spec) => Effect.gen(function* () {
|
|
|
39
42
|
const cached = decode(hit.bytes);
|
|
40
43
|
if (cached !== null) {
|
|
41
44
|
if ((yield* spec.verify(cached)) !== null) {
|
|
42
|
-
|
|
43
|
-
yield*
|
|
44
|
-
yield* Effect.
|
|
45
|
-
return
|
|
45
|
+
yield* spec.register(cached);
|
|
46
|
+
yield* Effect.annotateCurrentSpan({ [SpanAttr.artifactPublisherPath]: "hit" });
|
|
47
|
+
yield* Effect.logDebug(`artifact-publisher: reusing cached '${spec.namespace}' on chain ${spec.chain} (cache hit; no re-deploy).`);
|
|
48
|
+
return cached;
|
|
46
49
|
}
|
|
47
50
|
}
|
|
48
51
|
}
|
|
49
|
-
|
|
52
|
+
if (hit === null) {
|
|
53
|
+
yield* Effect.annotateCurrentSpan({ [SpanAttr.artifactPublisherPath]: "miss" });
|
|
54
|
+
yield* Effect.logInfo(`artifact-publisher: producing '${spec.namespace}' on chain ${spec.chain} — no cached artifact for this chain + content hash (first deploy on this chain, fresh genesis after a restart, or changed inputs).`);
|
|
55
|
+
} else {
|
|
56
|
+
yield* Effect.annotateCurrentSpan({ [SpanAttr.artifactPublisherPath]: "verify-failed" });
|
|
57
|
+
yield* Effect.logWarning(`artifact-publisher: re-deploying '${spec.namespace}' on chain ${spec.chain} — a cached artifact existed but failed on-chain verification (object missing, or RPC unavailable during restart); a new id will replace the prior deployment.`);
|
|
58
|
+
yield* setCurrentPluginPhase(`re-deploying ${spec.namespace} (cached artifact failed verification on restart)`);
|
|
59
|
+
}
|
|
50
60
|
const produced = yield* spec.produce;
|
|
51
61
|
yield* cache.write({
|
|
52
62
|
namespace: spec.namespace,
|