@mysten-incubation/devstack 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +189 -0
- package/README.md +94 -0
- package/dist/_virtual/_rolldown/runtime.mjs +13 -0
- package/dist/api/define-capabilities.d.mts +25 -0
- package/dist/api/define-capabilities.mjs +19 -0
- package/dist/api/define-capabilities.mjs.map +1 -0
- package/dist/api/define-devstack-with.d.mts +41 -0
- package/dist/api/define-devstack-with.mjs +24 -0
- package/dist/api/define-devstack-with.mjs.map +1 -0
- package/dist/api/define-devstack.d.mts +62 -0
- package/dist/api/define-devstack.mjs +108 -0
- package/dist/api/define-devstack.mjs.map +1 -0
- package/dist/api/define-plugin.d.mts +1 -0
- package/dist/api/inference-network.mjs +122 -0
- package/dist/api/inference-network.mjs.map +1 -0
- package/dist/api/mode-narrowed-factory.d.mts +26 -0
- package/dist/api/mode-narrowed-factory.mjs +8 -0
- package/dist/api/mode-narrowed-factory.mjs.map +1 -0
- package/dist/api/plugin-errors.mjs +10 -0
- package/dist/api/plugin-errors.mjs.map +1 -0
- package/dist/api/run-stack.d.mts +82 -0
- package/dist/api/run-stack.mjs +127 -0
- package/dist/api/run-stack.mjs.map +1 -0
- package/dist/build-integrations/playwright/config.d.mts +92 -0
- package/dist/build-integrations/playwright/config.mjs +71 -0
- package/dist/build-integrations/playwright/config.mjs.map +1 -0
- package/dist/build-integrations/playwright/errors.d.mts +82 -0
- package/dist/build-integrations/playwright/errors.mjs +43 -0
- package/dist/build-integrations/playwright/errors.mjs.map +1 -0
- package/dist/build-integrations/playwright/global-setup.d.mts +64 -0
- package/dist/build-integrations/playwright/global-setup.mjs +44 -0
- package/dist/build-integrations/playwright/global-setup.mjs.map +1 -0
- package/dist/build-integrations/playwright/index.d.mts +6 -0
- package/dist/build-integrations/playwright/index.mjs +6 -0
- package/dist/build-integrations/playwright/stack-context.d.mts +95 -0
- package/dist/build-integrations/playwright/stack-context.mjs +277 -0
- package/dist/build-integrations/playwright/stack-context.mjs.map +1 -0
- package/dist/build-integrations/playwright/wallet-context.d.mts +87 -0
- package/dist/build-integrations/playwright/wallet-context.mjs +148 -0
- package/dist/build-integrations/playwright/wallet-context.mjs.map +1 -0
- package/dist/build-integrations/runtime/cold-start-url.d.mts +67 -0
- package/dist/build-integrations/runtime/cold-start-url.mjs +56 -0
- package/dist/build-integrations/runtime/cold-start-url.mjs.map +1 -0
- package/dist/build-integrations/runtime/dapp-kit-slot.mjs +10 -0
- package/dist/build-integrations/runtime/dapp-kit-slot.mjs.map +1 -0
- package/dist/build-integrations/runtime/discover.d.mts +78 -0
- package/dist/build-integrations/runtime/discover.mjs +124 -0
- package/dist/build-integrations/runtime/discover.mjs.map +1 -0
- package/dist/build-integrations/runtime/endpoint-registry.d.mts +26 -0
- package/dist/build-integrations/runtime/endpoint-registry.mjs +41 -0
- package/dist/build-integrations/runtime/endpoint-registry.mjs.map +1 -0
- package/dist/build-integrations/runtime/errors.d.mts +64 -0
- package/dist/build-integrations/runtime/errors.mjs +51 -0
- package/dist/build-integrations/runtime/errors.mjs.map +1 -0
- package/dist/build-integrations/runtime/index.d.mts +7 -0
- package/dist/build-integrations/runtime/index.mjs +6 -0
- package/dist/build-integrations/runtime/read-stack-context.d.mts +38 -0
- package/dist/build-integrations/runtime/read-stack-context.mjs +130 -0
- package/dist/build-integrations/runtime/read-stack-context.mjs.map +1 -0
- package/dist/build-integrations/runtime/stack-context.d.mts +53 -0
- package/dist/build-integrations/vitest/config.d.mts +62 -0
- package/dist/build-integrations/vitest/config.mjs +80 -0
- package/dist/build-integrations/vitest/config.mjs.map +1 -0
- package/dist/build-integrations/vitest/env.d.mts +48 -0
- package/dist/build-integrations/vitest/env.mjs +50 -0
- package/dist/build-integrations/vitest/env.mjs.map +1 -0
- package/dist/build-integrations/vitest/errors.d.mts +44 -0
- package/dist/build-integrations/vitest/errors.mjs +18 -0
- package/dist/build-integrations/vitest/errors.mjs.map +1 -0
- package/dist/build-integrations/vitest/index.d.mts +6 -0
- package/dist/build-integrations/vitest/index.mjs +6 -0
- package/dist/build-integrations/vitest/setup.d.mts +53 -0
- package/dist/build-integrations/vitest/setup.mjs +56 -0
- package/dist/build-integrations/vitest/setup.mjs.map +1 -0
- package/dist/build-integrations/vitest/stack-context.d.mts +58 -0
- package/dist/build-integrations/vitest/stack-context.mjs +67 -0
- package/dist/build-integrations/vitest/stack-context.mjs.map +1 -0
- package/dist/cli/main.d.mts +5 -0
- package/dist/cli/main.mjs +586 -0
- package/dist/cli/main.mjs.map +1 -0
- package/dist/cli/prune-direct.mjs +216 -0
- package/dist/cli/prune-direct.mjs.map +1 -0
- package/dist/cli/snapshot-reader.mjs +73 -0
- package/dist/cli/snapshot-reader.mjs.map +1 -0
- package/dist/cli/up-lifecycle.mjs +28 -0
- package/dist/cli/up-lifecycle.mjs.map +1 -0
- package/dist/contracts/capability-decl.d.mts +42 -0
- package/dist/contracts/chain-probe.d.mts +26 -0
- package/dist/contracts/chain-probe.mjs +8 -0
- package/dist/contracts/chain-probe.mjs.map +1 -0
- package/dist/contracts/codegenable.d.mts +43 -0
- package/dist/contracts/container-runtime.d.mts +245 -0
- package/dist/contracts/liveness-classifier.d.mts +19 -0
- package/dist/contracts/network-resolver.d.mts +15 -0
- package/dist/contracts/network-resolver.mjs +7 -0
- package/dist/contracts/network-resolver.mjs.map +1 -0
- package/dist/contracts/projection.d.mts +15 -0
- package/dist/contracts/routable.d.mts +53 -0
- package/dist/contracts/snapshotable.d.mts +39 -0
- package/dist/contracts/strategy-contributor.d.mts +26 -0
- package/dist/index.d.mts +89 -0
- package/dist/index.mjs +37 -0
- package/dist/orchestrators/codegen/bindings.d.mts +2 -0
- package/dist/orchestrators/codegen/bindings.mjs +340 -0
- package/dist/orchestrators/codegen/bindings.mjs.map +1 -0
- package/dist/orchestrators/codegen/emit.mjs +56 -0
- package/dist/orchestrators/codegen/emit.mjs.map +1 -0
- package/dist/orchestrators/codegen/errors.d.mts +1 -0
- package/dist/orchestrators/codegen/errors.mjs +66 -0
- package/dist/orchestrators/codegen/errors.mjs.map +1 -0
- package/dist/orchestrators/codegen/extras.mjs +16 -0
- package/dist/orchestrators/codegen/extras.mjs.map +1 -0
- package/dist/orchestrators/codegen/format.mjs +109 -0
- package/dist/orchestrators/codegen/format.mjs.map +1 -0
- package/dist/orchestrators/codegen/gitignore.mjs +67 -0
- package/dist/orchestrators/codegen/gitignore.mjs.map +1 -0
- package/dist/orchestrators/codegen/paths.d.mts +1 -0
- package/dist/orchestrators/codegen/paths.mjs +33 -0
- package/dist/orchestrators/codegen/paths.mjs.map +1 -0
- package/dist/orchestrators/codegen/permissions.mjs +6 -0
- package/dist/orchestrators/codegen/permissions.mjs.map +1 -0
- package/dist/orchestrators/codegen/service.d.mts +1 -0
- package/dist/orchestrators/codegen/service.mjs +276 -0
- package/dist/orchestrators/codegen/service.mjs.map +1 -0
- package/dist/orchestrators/router/cleanup.mjs +58 -0
- package/dist/orchestrators/router/cleanup.mjs.map +1 -0
- package/dist/orchestrators/router/cors.mjs +31 -0
- package/dist/orchestrators/router/cors.mjs.map +1 -0
- package/dist/orchestrators/router/entrypoints.d.mts +1 -0
- package/dist/orchestrators/router/entrypoints.mjs +80 -0
- package/dist/orchestrators/router/entrypoints.mjs.map +1 -0
- package/dist/orchestrators/router/errors.d.mts +1 -0
- package/dist/orchestrators/router/errors.mjs +103 -0
- package/dist/orchestrators/router/errors.mjs.map +1 -0
- package/dist/orchestrators/router/file-provider.d.mts +1 -0
- package/dist/orchestrators/router/file-provider.mjs +320 -0
- package/dist/orchestrators/router/file-provider.mjs.map +1 -0
- package/dist/orchestrators/router/hostname.d.mts +1 -0
- package/dist/orchestrators/router/hostname.mjs +107 -0
- package/dist/orchestrators/router/hostname.mjs.map +1 -0
- package/dist/orchestrators/router/index.d.mts +1 -0
- package/dist/orchestrators/router/profile.d.mts +1 -0
- package/dist/orchestrators/router/profile.mjs +109 -0
- package/dist/orchestrators/router/profile.mjs.map +1 -0
- package/dist/orchestrators/router/service.d.mts +3 -0
- package/dist/orchestrators/router/service.mjs +421 -0
- package/dist/orchestrators/router/service.mjs.map +1 -0
- package/dist/orchestrators/router/traefik-container.d.mts +1 -0
- package/dist/orchestrators/router/traefik-container.mjs +229 -0
- package/dist/orchestrators/router/traefik-container.mjs.map +1 -0
- package/dist/orchestrators/runtime-composition.d.mts +10 -0
- package/dist/orchestrators/runtime-composition.mjs +168 -0
- package/dist/orchestrators/runtime-composition.mjs.map +1 -0
- package/dist/orchestrators/snapshot/capture.d.mts +1 -0
- package/dist/orchestrators/snapshot/capture.mjs +350 -0
- package/dist/orchestrators/snapshot/capture.mjs.map +1 -0
- package/dist/orchestrators/snapshot/descriptor.d.mts +1 -0
- package/dist/orchestrators/snapshot/descriptor.mjs +109 -0
- package/dist/orchestrators/snapshot/descriptor.mjs.map +1 -0
- package/dist/orchestrators/snapshot/identity-guard.d.mts +1 -0
- package/dist/orchestrators/snapshot/identity-guard.mjs +132 -0
- package/dist/orchestrators/snapshot/identity-guard.mjs.map +1 -0
- package/dist/orchestrators/snapshot/image-bundle-tags.mjs +207 -0
- package/dist/orchestrators/snapshot/image-bundle-tags.mjs.map +1 -0
- package/dist/orchestrators/snapshot/index.d.mts +1 -0
- package/dist/orchestrators/snapshot/integrity.d.mts +1 -0
- package/dist/orchestrators/snapshot/integrity.mjs +74 -0
- package/dist/orchestrators/snapshot/integrity.mjs.map +1 -0
- package/dist/orchestrators/snapshot/prune.d.mts +1 -0
- package/dist/orchestrators/snapshot/prune.mjs +110 -0
- package/dist/orchestrators/snapshot/prune.mjs.map +1 -0
- package/dist/orchestrators/snapshot/restore.d.mts +1 -0
- package/dist/orchestrators/snapshot/restore.mjs +404 -0
- package/dist/orchestrators/snapshot/restore.mjs.map +1 -0
- package/dist/orchestrators/snapshot/service.d.mts +1 -0
- package/dist/orchestrators/snapshot/service.mjs +296 -0
- package/dist/orchestrators/snapshot/service.mjs.map +1 -0
- package/dist/orchestrators/snapshot/state-document.mjs +18 -0
- package/dist/orchestrators/snapshot/state-document.mjs.map +1 -0
- package/dist/orchestrators/snapshot/wipe.d.mts +1 -0
- package/dist/orchestrators/snapshot/wipe.mjs +59 -0
- package/dist/orchestrators/snapshot/wipe.mjs.map +1 -0
- package/dist/plugins/account/codegen.d.mts +12 -0
- package/dist/plugins/account/codegen.mjs +22 -0
- package/dist/plugins/account/codegen.mjs.map +1 -0
- package/dist/plugins/account/errors.d.mts +44 -0
- package/dist/plugins/account/errors.mjs +16 -0
- package/dist/plugins/account/errors.mjs.map +1 -0
- package/dist/plugins/account/funding.d.mts +94 -0
- package/dist/plugins/account/funding.mjs +199 -0
- package/dist/plugins/account/funding.mjs.map +1 -0
- package/dist/plugins/account/index.d.mts +54 -0
- package/dist/plugins/account/index.mjs +151 -0
- package/dist/plugins/account/index.mjs.map +1 -0
- package/dist/plugins/account/keypair.d.mts +32 -0
- package/dist/plugins/account/keypair.mjs +99 -0
- package/dist/plugins/account/keypair.mjs.map +1 -0
- package/dist/plugins/account/lease.mjs +21 -0
- package/dist/plugins/account/lease.mjs.map +1 -0
- package/dist/plugins/account/registry.d.mts +33 -0
- package/dist/plugins/account/registry.mjs +36 -0
- package/dist/plugins/account/registry.mjs.map +1 -0
- package/dist/plugins/account/service.d.mts +104 -0
- package/dist/plugins/account/service.mjs +405 -0
- package/dist/plugins/account/service.mjs.map +1 -0
- package/dist/plugins/account/snapshot.mjs +33 -0
- package/dist/plugins/account/snapshot.mjs.map +1 -0
- package/dist/plugins/account/variants/env.mjs +24 -0
- package/dist/plugins/account/variants/env.mjs.map +1 -0
- package/dist/plugins/account/variants/ephemeral.mjs +72 -0
- package/dist/plugins/account/variants/ephemeral.mjs.map +1 -0
- package/dist/plugins/account/variants/impersonate.d.mts +16 -0
- package/dist/plugins/account/variants/impersonate.mjs +48 -0
- package/dist/plugins/account/variants/impersonate.mjs.map +1 -0
- package/dist/plugins/account/variants/inline.mjs +13 -0
- package/dist/plugins/account/variants/inline.mjs.map +1 -0
- package/dist/plugins/account/variants/keystore.mjs +93 -0
- package/dist/plugins/account/variants/keystore.mjs.map +1 -0
- package/dist/plugins/account/variants/signer.mjs +31 -0
- package/dist/plugins/account/variants/signer.mjs.map +1 -0
- package/dist/plugins/action/build-context.d.mts +41 -0
- package/dist/plugins/action/discriminator.d.mts +20 -0
- package/dist/plugins/action/discriminator.mjs +13 -0
- package/dist/plugins/action/discriminator.mjs.map +1 -0
- package/dist/plugins/action/errors.d.mts +31 -0
- package/dist/plugins/action/errors.mjs +13 -0
- package/dist/plugins/action/errors.mjs.map +1 -0
- package/dist/plugins/action/execute.d.mts +2 -0
- package/dist/plugins/action/execute.mjs +145 -0
- package/dist/plugins/action/execute.mjs.map +1 -0
- package/dist/plugins/action/index.d.mts +56 -0
- package/dist/plugins/action/index.mjs +82 -0
- package/dist/plugins/action/index.mjs.map +1 -0
- package/dist/plugins/action/service.d.mts +26 -0
- package/dist/plugins/action/service.mjs +84 -0
- package/dist/plugins/action/service.mjs.map +1 -0
- package/dist/plugins/coin/address-resolution.d.mts +34 -0
- package/dist/plugins/coin/address-resolution.mjs +80 -0
- package/dist/plugins/coin/address-resolution.mjs.map +1 -0
- package/dist/plugins/coin/codegen.d.mts +16 -0
- package/dist/plugins/coin/codegen.mjs +21 -0
- package/dist/plugins/coin/codegen.mjs.map +1 -0
- package/dist/plugins/coin/discovery.d.mts +26 -0
- package/dist/plugins/coin/discovery.mjs +112 -0
- package/dist/plugins/coin/discovery.mjs.map +1 -0
- package/dist/plugins/coin/errors.d.mts +48 -0
- package/dist/plugins/coin/errors.mjs +13 -0
- package/dist/plugins/coin/errors.mjs.map +1 -0
- package/dist/plugins/coin/index.d.mts +95 -0
- package/dist/plugins/coin/index.mjs +172 -0
- package/dist/plugins/coin/index.mjs.map +1 -0
- package/dist/plugins/coin/metadata.d.mts +15 -0
- package/dist/plugins/coin/metadata.mjs +99 -0
- package/dist/plugins/coin/metadata.mjs.map +1 -0
- package/dist/plugins/coin/mint.d.mts +34 -0
- package/dist/plugins/coin/mint.mjs +164 -0
- package/dist/plugins/coin/mint.mjs.map +1 -0
- package/dist/plugins/coin/registry.d.mts +1 -0
- package/dist/plugins/coin/registry.mjs +37 -0
- package/dist/plugins/coin/registry.mjs.map +1 -0
- package/dist/plugins/coin/service.d.mts +47 -0
- package/dist/plugins/coin/service.mjs +51 -0
- package/dist/plugins/coin/service.mjs.map +1 -0
- package/dist/plugins/coin/snapshot.mjs +19 -0
- package/dist/plugins/coin/snapshot.mjs.map +1 -0
- package/dist/plugins/coin/type-strings.mjs +49 -0
- package/dist/plugins/coin/type-strings.mjs.map +1 -0
- package/dist/plugins/deepbook/codegen.d.mts +39 -0
- package/dist/plugins/deepbook/codegen.mjs +15 -0
- package/dist/plugins/deepbook/codegen.mjs.map +1 -0
- package/dist/plugins/deepbook/deploy.mjs +437 -0
- package/dist/plugins/deepbook/deploy.mjs.map +1 -0
- package/dist/plugins/deepbook/errors.d.mts +29 -0
- package/dist/plugins/deepbook/errors.mjs +26 -0
- package/dist/plugins/deepbook/errors.mjs.map +1 -0
- package/dist/plugins/deepbook/faucet-strategy.d.mts +8 -0
- package/dist/plugins/deepbook/faucet-strategy.mjs +81 -0
- package/dist/plugins/deepbook/faucet-strategy.mjs.map +1 -0
- package/dist/plugins/deepbook/index.d.mts +171 -0
- package/dist/plugins/deepbook/index.mjs +359 -0
- package/dist/plugins/deepbook/index.mjs.map +1 -0
- package/dist/plugins/deepbook/plugin-key.mjs +7 -0
- package/dist/plugins/deepbook/plugin-key.mjs.map +1 -0
- package/dist/plugins/deepbook/pyth/index.mjs +226 -0
- package/dist/plugins/deepbook/pyth/index.mjs.map +1 -0
- package/dist/plugins/deepbook/routable.mjs +21 -0
- package/dist/plugins/deepbook/routable.mjs.map +1 -0
- package/dist/plugins/deepbook/snapshot.mjs +49 -0
- package/dist/plugins/deepbook/snapshot.mjs.map +1 -0
- package/dist/plugins/deepbook/types.d.mts +125 -0
- package/dist/plugins/deepbook/types.mjs +12 -0
- package/dist/plugins/deepbook/types.mjs.map +1 -0
- package/dist/plugins/faucet/dispatcher.d.mts +9 -0
- package/dist/plugins/faucet/dispatcher.mjs +13 -0
- package/dist/plugins/faucet/dispatcher.mjs.map +1 -0
- package/dist/plugins/faucet/errors.d.mts +86 -0
- package/dist/plugins/faucet/errors.mjs +19 -0
- package/dist/plugins/faucet/errors.mjs.map +1 -0
- package/dist/plugins/faucet/http.mjs +127 -0
- package/dist/plugins/faucet/http.mjs.map +1 -0
- package/dist/plugins/faucet/index.d.mts +43 -0
- package/dist/plugins/faucet/index.mjs +42 -0
- package/dist/plugins/faucet/index.mjs.map +1 -0
- package/dist/plugins/faucet/service.d.mts +20 -0
- package/dist/plugins/faucet/strategies/sui-local.d.mts +23 -0
- package/dist/plugins/faucet/strategies/sui-local.mjs +29 -0
- package/dist/plugins/faucet/strategies/sui-local.mjs.map +1 -0
- package/dist/plugins/host-service/errors.d.mts +27 -0
- package/dist/plugins/host-service/errors.mjs +14 -0
- package/dist/plugins/host-service/errors.mjs.map +1 -0
- package/dist/plugins/host-service/index.d.mts +10 -0
- package/dist/plugins/host-service/index.mjs +48 -0
- package/dist/plugins/host-service/index.mjs.map +1 -0
- package/dist/plugins/host-service/routable.mjs +24 -0
- package/dist/plugins/host-service/routable.mjs.map +1 -0
- package/dist/plugins/host-service/service.d.mts +49 -0
- package/dist/plugins/host-service/service.mjs +375 -0
- package/dist/plugins/host-service/service.mjs.map +1 -0
- package/dist/plugins/package/build.d.mts +1 -0
- package/dist/plugins/package/build.mjs +24 -0
- package/dist/plugins/package/build.mjs.map +1 -0
- package/dist/plugins/package/codegen.d.mts +19 -0
- package/dist/plugins/package/codegen.mjs +41 -0
- package/dist/plugins/package/codegen.mjs.map +1 -0
- package/dist/plugins/package/dep-resolution.mjs +10 -0
- package/dist/plugins/package/dep-resolution.mjs.map +1 -0
- package/dist/plugins/package/errors.d.mts +34 -0
- package/dist/plugins/package/errors.mjs +13 -0
- package/dist/plugins/package/errors.mjs.map +1 -0
- package/dist/plugins/package/index.d.mts +109 -0
- package/dist/plugins/package/index.mjs +207 -0
- package/dist/plugins/package/index.mjs.map +1 -0
- package/dist/plugins/package/mode-known.mjs +41 -0
- package/dist/plugins/package/mode-known.mjs.map +1 -0
- package/dist/plugins/package/mode-local.d.mts +1 -0
- package/dist/plugins/package/mode-local.mjs +183 -0
- package/dist/plugins/package/mode-local.mjs.map +1 -0
- package/dist/plugins/package/publish-executor.mjs +202 -0
- package/dist/plugins/package/publish-executor.mjs.map +1 -0
- package/dist/plugins/package/publish-output.d.mts +28 -0
- package/dist/plugins/package/publish-output.mjs +45 -0
- package/dist/plugins/package/publish-output.mjs.map +1 -0
- package/dist/plugins/package/registry.d.mts +25 -0
- package/dist/plugins/package/registry.mjs +30 -0
- package/dist/plugins/package/registry.mjs.map +1 -0
- package/dist/plugins/package/service.mjs +20 -0
- package/dist/plugins/package/service.mjs.map +1 -0
- package/dist/plugins/package/snapshot.mjs +25 -0
- package/dist/plugins/package/snapshot.mjs.map +1 -0
- package/dist/plugins/postgres/codegen.mjs +42 -0
- package/dist/plugins/postgres/codegen.mjs.map +1 -0
- package/dist/plugins/postgres/connection.d.mts +33 -0
- package/dist/plugins/postgres/connection.mjs +19 -0
- package/dist/plugins/postgres/connection.mjs.map +1 -0
- package/dist/plugins/postgres/db-ensure.mjs +100 -0
- package/dist/plugins/postgres/db-ensure.mjs.map +1 -0
- package/dist/plugins/postgres/errors.d.mts +55 -0
- package/dist/plugins/postgres/errors.mjs +29 -0
- package/dist/plugins/postgres/errors.mjs.map +1 -0
- package/dist/plugins/postgres/index.d.mts +37 -0
- package/dist/plugins/postgres/index.mjs +75 -0
- package/dist/plugins/postgres/index.mjs.map +1 -0
- package/dist/plugins/postgres/routable.mjs +33 -0
- package/dist/plugins/postgres/routable.mjs.map +1 -0
- package/dist/plugins/postgres/service.d.mts +50 -0
- package/dist/plugins/postgres/service.mjs +145 -0
- package/dist/plugins/postgres/service.mjs.map +1 -0
- package/dist/plugins/postgres/snapshot.d.mts +1 -0
- package/dist/plugins/postgres/snapshot.mjs +32 -0
- package/dist/plugins/postgres/snapshot.mjs.map +1 -0
- package/dist/plugins/router-entrypoints.mjs +21 -0
- package/dist/plugins/router-entrypoints.mjs.map +1 -0
- package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs +59 -0
- package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs.map +1 -0
- package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs +132 -0
- package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs.map +1 -0
- package/dist/plugins/seal/codegen.d.mts +19 -0
- package/dist/plugins/seal/codegen.mjs +16 -0
- package/dist/plugins/seal/codegen.mjs.map +1 -0
- package/dist/plugins/seal/config-render.mjs +82 -0
- package/dist/plugins/seal/config-render.mjs.map +1 -0
- package/dist/plugins/seal/deploy.mjs +198 -0
- package/dist/plugins/seal/deploy.mjs.map +1 -0
- package/dist/plugins/seal/errors.d.mts +52 -0
- package/dist/plugins/seal/errors.mjs +19 -0
- package/dist/plugins/seal/errors.mjs.map +1 -0
- package/dist/plugins/seal/index.d.mts +161 -0
- package/dist/plugins/seal/index.mjs +235 -0
- package/dist/plugins/seal/index.mjs.map +1 -0
- package/dist/plugins/seal/key-manager.d.mts +22 -0
- package/dist/plugins/seal/key-manager.mjs +22 -0
- package/dist/plugins/seal/key-manager.mjs.map +1 -0
- package/dist/plugins/seal/key-server.mjs +175 -0
- package/dist/plugins/seal/key-server.mjs.map +1 -0
- package/dist/plugins/seal/keygen.mjs +96 -0
- package/dist/plugins/seal/keygen.mjs.map +1 -0
- package/dist/plugins/seal/mode/fork-known.d.mts +8 -0
- package/dist/plugins/seal/mode/fork-known.mjs +23 -0
- package/dist/plugins/seal/mode/fork-known.mjs.map +1 -0
- package/dist/plugins/seal/mode/live.d.mts +18 -0
- package/dist/plugins/seal/mode/live.mjs +64 -0
- package/dist/plugins/seal/mode/live.mjs.map +1 -0
- package/dist/plugins/seal/mode/local-keygen.mjs +180 -0
- package/dist/plugins/seal/mode/local-keygen.mjs.map +1 -0
- package/dist/plugins/seal/plugin-key.mjs +7 -0
- package/dist/plugins/seal/plugin-key.mjs.map +1 -0
- package/dist/plugins/seal/registry-publish.d.mts +43 -0
- package/dist/plugins/seal/registry-publish.mjs +9 -0
- package/dist/plugins/seal/registry-publish.mjs.map +1 -0
- package/dist/plugins/seal/routable.mjs +57 -0
- package/dist/plugins/seal/routable.mjs.map +1 -0
- package/dist/plugins/seal/service.mjs +17 -0
- package/dist/plugins/seal/service.mjs.map +1 -0
- package/dist/plugins/seal/snapshot.mjs +51 -0
- package/dist/plugins/seal/snapshot.mjs.map +1 -0
- package/dist/plugins/sui/auto-tick.mjs +45 -0
- package/dist/plugins/sui/auto-tick.mjs.map +1 -0
- package/dist/plugins/sui/chain-build-container.d.mts +1 -0
- package/dist/plugins/sui/chain-probe.d.mts +85 -0
- package/dist/plugins/sui/chain-probe.mjs +104 -0
- package/dist/plugins/sui/chain-probe.mjs.map +1 -0
- package/dist/plugins/sui/codegen.d.mts +14 -0
- package/dist/plugins/sui/codegen.mjs +26 -0
- package/dist/plugins/sui/codegen.mjs.map +1 -0
- package/dist/plugins/sui/errors.d.mts +74 -0
- package/dist/plugins/sui/errors.mjs +28 -0
- package/dist/plugins/sui/errors.mjs.map +1 -0
- package/dist/plugins/sui/fork-orchestration.mjs +24 -0
- package/dist/plugins/sui/fork-orchestration.mjs.map +1 -0
- package/dist/plugins/sui/fork-transaction.mjs +96 -0
- package/dist/plugins/sui/fork-transaction.mjs.map +1 -0
- package/dist/plugins/sui/index.d.mts +318 -0
- package/dist/plugins/sui/index.mjs +182 -0
- package/dist/plugins/sui/index.mjs.map +1 -0
- package/dist/plugins/sui/mode/external.mjs +60 -0
- package/dist/plugins/sui/mode/external.mjs.map +1 -0
- package/dist/plugins/sui/mode/fork.mjs +283 -0
- package/dist/plugins/sui/mode/fork.mjs.map +1 -0
- package/dist/plugins/sui/mode/live.mjs +103 -0
- package/dist/plugins/sui/mode/live.mjs.map +1 -0
- package/dist/plugins/sui/mode/local.mjs +293 -0
- package/dist/plugins/sui/mode/local.mjs.map +1 -0
- package/dist/plugins/sui/mode/shared-boot.mjs +254 -0
- package/dist/plugins/sui/mode/shared-boot.mjs.map +1 -0
- package/dist/plugins/sui/mode/shared.d.mts +103 -0
- package/dist/plugins/sui/mode/shared.mjs +12 -0
- package/dist/plugins/sui/mode/shared.mjs.map +1 -0
- package/dist/plugins/sui/mode/spec.d.mts +94 -0
- package/dist/plugins/sui/network-resolver.d.mts +23 -0
- package/dist/plugins/sui/routable.mjs +88 -0
- package/dist/plugins/sui/routable.mjs.map +1 -0
- package/dist/plugins/sui/seed-objects.d.mts +18 -0
- package/dist/plugins/sui/seed-objects.mjs +25 -0
- package/dist/plugins/sui/seed-objects.mjs.map +1 -0
- package/dist/plugins/sui/service.mjs +38 -0
- package/dist/plugins/sui/service.mjs.map +1 -0
- package/dist/plugins/sui/snapshot.mjs +53 -0
- package/dist/plugins/sui/snapshot.mjs.map +1 -0
- package/dist/plugins/wallet/codegen.d.mts +33 -0
- package/dist/plugins/wallet/codegen.mjs +34 -0
- package/dist/plugins/wallet/codegen.mjs.map +1 -0
- package/dist/plugins/wallet/errors.d.mts +66 -0
- package/dist/plugins/wallet/errors.mjs +16 -0
- package/dist/plugins/wallet/errors.mjs.map +1 -0
- package/dist/plugins/wallet/index.d.mts +63 -0
- package/dist/plugins/wallet/index.mjs +126 -0
- package/dist/plugins/wallet/index.mjs.map +1 -0
- package/dist/plugins/wallet/origin-policy.d.mts +1 -0
- package/dist/plugins/wallet/origin-policy.mjs +65 -0
- package/dist/plugins/wallet/origin-policy.mjs.map +1 -0
- package/dist/plugins/wallet/pairing.d.mts +11 -0
- package/dist/plugins/wallet/pairing.mjs +125 -0
- package/dist/plugins/wallet/pairing.mjs.map +1 -0
- package/dist/plugins/wallet/protocol.d.mts +1 -0
- package/dist/plugins/wallet/protocol.mjs +96 -0
- package/dist/plugins/wallet/protocol.mjs.map +1 -0
- package/dist/plugins/wallet/routable.mjs +32 -0
- package/dist/plugins/wallet/routable.mjs.map +1 -0
- package/dist/plugins/wallet/server.d.mts +12 -0
- package/dist/plugins/wallet/server.mjs +317 -0
- package/dist/plugins/wallet/server.mjs.map +1 -0
- package/dist/plugins/wallet/service.d.mts +68 -0
- package/dist/plugins/wallet/service.mjs +97 -0
- package/dist/plugins/wallet/service.mjs.map +1 -0
- package/dist/plugins/wallet/snapshot.d.mts +1 -0
- package/dist/plugins/wallet/snapshot.mjs +14 -0
- package/dist/plugins/wallet/snapshot.mjs.map +1 -0
- package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs +42 -0
- package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs.map +1 -0
- package/dist/plugins/walrus/codegen.d.mts +38 -0
- package/dist/plugins/walrus/codegen.mjs +34 -0
- package/dist/plugins/walrus/codegen.mjs.map +1 -0
- package/dist/plugins/walrus/deploy-paths.mjs +14 -0
- package/dist/plugins/walrus/deploy-paths.mjs.map +1 -0
- package/dist/plugins/walrus/deploy.d.mts +1 -0
- package/dist/plugins/walrus/deploy.mjs +224 -0
- package/dist/plugins/walrus/deploy.mjs.map +1 -0
- package/dist/plugins/walrus/errors.d.mts +38 -0
- package/dist/plugins/walrus/errors.mjs +26 -0
- package/dist/plugins/walrus/errors.mjs.map +1 -0
- package/dist/plugins/walrus/faucet-strategy.d.mts +12 -0
- package/dist/plugins/walrus/faucet-strategy.mjs +62 -0
- package/dist/plugins/walrus/faucet-strategy.mjs.map +1 -0
- package/dist/plugins/walrus/index.d.mts +177 -0
- package/dist/plugins/walrus/index.mjs +284 -0
- package/dist/plugins/walrus/index.mjs.map +1 -0
- package/dist/plugins/walrus/mode/known-deploy.d.mts +25 -0
- package/dist/plugins/walrus/mode/known-deploy.mjs +71 -0
- package/dist/plugins/walrus/mode/known-deploy.mjs.map +1 -0
- package/dist/plugins/walrus/mode/local-cluster.d.mts +34 -0
- package/dist/plugins/walrus/mode/local-cluster.mjs +153 -0
- package/dist/plugins/walrus/mode/local-cluster.mjs.map +1 -0
- package/dist/plugins/walrus/plugin-key.mjs +7 -0
- package/dist/plugins/walrus/plugin-key.mjs.map +1 -0
- package/dist/plugins/walrus/registry-publish.d.mts +24 -0
- package/dist/plugins/walrus/registry-publish.mjs +7 -0
- package/dist/plugins/walrus/registry-publish.mjs.map +1 -0
- package/dist/plugins/walrus/routable.mjs +99 -0
- package/dist/plugins/walrus/routable.mjs.map +1 -0
- package/dist/plugins/walrus/service.mjs +20 -0
- package/dist/plugins/walrus/service.mjs.map +1 -0
- package/dist/plugins/walrus/snapshot.mjs +53 -0
- package/dist/plugins/walrus/snapshot.mjs.map +1 -0
- package/dist/plugins/walrus/storage-nodes.d.mts +15 -0
- package/dist/plugins/walrus/storage-nodes.mjs +154 -0
- package/dist/plugins/walrus/storage-nodes.mjs.map +1 -0
- package/dist/plugins/walrus/wal-swap.d.mts +2 -0
- package/dist/plugins/walrus/wal-swap.mjs +58 -0
- package/dist/plugins/walrus/wal-swap.mjs.map +1 -0
- package/dist/primitives/artifact-publisher.d.mts +12 -0
- package/dist/primitives/cache.d.mts +1 -0
- package/dist/runtime/built-in-plugin-layers.mjs +49 -0
- package/dist/runtime/built-in-plugin-layers.mjs.map +1 -0
- package/dist/runtime/docker/client.d.mts +2 -0
- package/dist/runtime/docker/client.mjs +54 -0
- package/dist/runtime/docker/client.mjs.map +1 -0
- package/dist/runtime/docker/container.d.mts +1 -0
- package/dist/runtime/docker/container.mjs +562 -0
- package/dist/runtime/docker/container.mjs.map +1 -0
- package/dist/runtime/docker/errors.d.mts +1 -0
- package/dist/runtime/docker/errors.mjs +187 -0
- package/dist/runtime/docker/errors.mjs.map +1 -0
- package/dist/runtime/docker/exec.d.mts +1 -0
- package/dist/runtime/docker/exec.mjs +63 -0
- package/dist/runtime/docker/exec.mjs.map +1 -0
- package/dist/runtime/docker/image.d.mts +1 -0
- package/dist/runtime/docker/image.mjs +278 -0
- package/dist/runtime/docker/image.mjs.map +1 -0
- package/dist/runtime/docker/index.d.mts +1 -0
- package/dist/runtime/docker/inventory.d.mts +1 -0
- package/dist/runtime/docker/inventory.mjs +167 -0
- package/dist/runtime/docker/inventory.mjs.map +1 -0
- package/dist/runtime/docker/labels.d.mts +1 -0
- package/dist/runtime/docker/labels.mjs +97 -0
- package/dist/runtime/docker/labels.mjs.map +1 -0
- package/dist/runtime/docker/logs.d.mts +1 -0
- package/dist/runtime/docker/logs.mjs +34 -0
- package/dist/runtime/docker/logs.mjs.map +1 -0
- package/dist/runtime/docker/network.d.mts +1 -0
- package/dist/runtime/docker/network.mjs +168 -0
- package/dist/runtime/docker/network.mjs.map +1 -0
- package/dist/runtime/docker/service.d.mts +9 -0
- package/dist/runtime/docker/service.mjs +266 -0
- package/dist/runtime/docker/service.mjs.map +1 -0
- package/dist/runtime/docker/sweep.d.mts +1 -0
- package/dist/runtime/docker/sweep.mjs +220 -0
- package/dist/runtime/docker/sweep.mjs.map +1 -0
- package/dist/runtime/docker/volume.d.mts +1 -0
- package/dist/runtime/docker/volume.mjs +24 -0
- package/dist/runtime/docker/volume.mjs.map +1 -0
- package/dist/runtime/docker/wrap.d.mts +1 -0
- package/dist/runtime/docker/wrap.mjs +131 -0
- package/dist/runtime/docker/wrap.mjs.map +1 -0
- package/dist/substrate/brand.d.mts +24 -0
- package/dist/substrate/brand.mjs +14 -0
- package/dist/substrate/brand.mjs.map +1 -0
- package/dist/substrate/cross-process.d.mts +1 -0
- package/dist/substrate/cross-process.mjs +28 -0
- package/dist/substrate/cross-process.mjs.map +1 -0
- package/dist/substrate/events.d.mts +117 -0
- package/dist/substrate/identity.d.mts +13 -0
- package/dist/substrate/lifecycle.d.mts +12 -0
- package/dist/substrate/manifest.d.mts +39 -0
- package/dist/substrate/manifest.mjs +33 -0
- package/dist/substrate/manifest.mjs.map +1 -0
- package/dist/substrate/network.d.mts +34 -0
- package/dist/substrate/options.d.mts +23 -0
- package/dist/substrate/plugin.d.mts +101 -0
- package/dist/substrate/plugin.mjs +61 -0
- package/dist/substrate/plugin.mjs.map +1 -0
- package/dist/substrate/projection.d.mts +100 -0
- package/dist/substrate/runtime/artifact-publisher/index.mjs +76 -0
- package/dist/substrate/runtime/artifact-publisher/index.mjs.map +1 -0
- package/dist/substrate/runtime/atomic-write.mjs +106 -0
- package/dist/substrate/runtime/atomic-write.mjs.map +1 -0
- package/dist/substrate/runtime/cache/index.d.mts +1 -0
- package/dist/substrate/runtime/cache/schema.d.mts +1 -0
- package/dist/substrate/runtime/cache/schema.mjs +22 -0
- package/dist/substrate/runtime/cache/schema.mjs.map +1 -0
- package/dist/substrate/runtime/cache/service.d.mts +1 -0
- package/dist/substrate/runtime/cache/service.mjs +89 -0
- package/dist/substrate/runtime/cache/service.mjs.map +1 -0
- package/dist/substrate/runtime/capability-sinks/index.d.mts +1 -0
- package/dist/substrate/runtime/capability-sinks/layer.d.mts +1 -0
- package/dist/substrate/runtime/capability-sinks/layer.mjs +31 -0
- package/dist/substrate/runtime/capability-sinks/layer.mjs.map +1 -0
- package/dist/substrate/runtime/capability-sinks/service.d.mts +36 -0
- package/dist/substrate/runtime/capability-sinks/service.mjs +74 -0
- package/dist/substrate/runtime/capability-sinks/service.mjs.map +1 -0
- package/dist/substrate/runtime/config-validation.d.mts +38 -0
- package/dist/substrate/runtime/config-validation.mjs +137 -0
- package/dist/substrate/runtime/config-validation.mjs.map +1 -0
- package/dist/substrate/runtime/context-helpers.mjs +32 -0
- package/dist/substrate/runtime/context-helpers.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/command-channel/channel.mjs +128 -0
- package/dist/substrate/runtime/cross-process/command-channel/channel.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/command-channel/file-channel.mjs +136 -0
- package/dist/substrate/runtime/cross-process/command-channel/file-channel.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/command-channel/protocol.mjs +49 -0
- package/dist/substrate/runtime/cross-process/command-channel/protocol.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/command-channel/runtime-control-lock.mjs +9 -0
- package/dist/substrate/runtime/cross-process/command-channel/runtime-control-lock.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/liveness.mjs +119 -0
- package/dist/substrate/runtime/cross-process/liveness.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/roster.mjs +275 -0
- package/dist/substrate/runtime/cross-process/roster.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/snapshot-reservation.d.mts +1 -0
- package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs +117 -0
- package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/stack-lock.d.mts +1 -0
- package/dist/substrate/runtime/cross-process/stack-lock.mjs +142 -0
- package/dist/substrate/runtime/cross-process/stack-lock.mjs.map +1 -0
- package/dist/substrate/runtime/current-plugin.mjs +15 -0
- package/dist/substrate/runtime/current-plugin.mjs.map +1 -0
- package/dist/substrate/runtime/errors.d.mts +1 -0
- package/dist/substrate/runtime/errors.mjs +76 -0
- package/dist/substrate/runtime/errors.mjs.map +1 -0
- package/dist/substrate/runtime/host-tree-tar/index.mjs +364 -0
- package/dist/substrate/runtime/host-tree-tar/index.mjs.map +1 -0
- package/dist/substrate/runtime/http-probe.d.mts +35 -0
- package/dist/substrate/runtime/http-probe.mjs +65 -0
- package/dist/substrate/runtime/http-probe.mjs.map +1 -0
- package/dist/substrate/runtime/lease-broker/index.d.mts +1 -0
- package/dist/substrate/runtime/lease-broker/service.d.mts +64 -0
- package/dist/substrate/runtime/lease-broker/service.mjs +155 -0
- package/dist/substrate/runtime/lease-broker/service.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/dep-graph.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/dep-graph.mjs +138 -0
- package/dist/substrate/runtime/lifecycle/dep-graph.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/index.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/lifecycle-fact.mjs +31 -0
- package/dist/substrate/runtime/lifecycle/lifecycle-fact.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/plugin-registry.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/plugin-registry.mjs +133 -0
- package/dist/substrate/runtime/lifecycle/plugin-registry.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/ready-gate.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/ready-gate.mjs +34 -0
- package/dist/substrate/runtime/lifecycle/ready-gate.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/selective-restart.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/selective-restart.mjs +43 -0
- package/dist/substrate/runtime/lifecycle/selective-restart.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/signals.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/signals.mjs +64 -0
- package/dist/substrate/runtime/lifecycle/signals.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/state-machine.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/state-machine.mjs +38 -0
- package/dist/substrate/runtime/lifecycle/state-machine.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/watch-attribution.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/watch-attribution.mjs +27 -0
- package/dist/substrate/runtime/lifecycle/watch-attribution.mjs.map +1 -0
- package/dist/substrate/runtime/managed-container.d.mts +30 -0
- package/dist/substrate/runtime/managed-container.mjs +32 -0
- package/dist/substrate/runtime/managed-container.mjs.map +1 -0
- package/dist/substrate/runtime/manifest/manifest.mjs +73 -0
- package/dist/substrate/runtime/manifest/manifest.mjs.map +1 -0
- package/dist/substrate/runtime/mode-errors.d.mts +36 -0
- package/dist/substrate/runtime/observability/cascade-formatter.d.mts +1 -0
- package/dist/substrate/runtime/observability/cascade-formatter.mjs +135 -0
- package/dist/substrate/runtime/observability/cascade-formatter.mjs.map +1 -0
- package/dist/substrate/runtime/observability/formatter-registry.d.mts +1 -0
- package/dist/substrate/runtime/observability/formatter-registry.mjs +65 -0
- package/dist/substrate/runtime/observability/formatter-registry.mjs.map +1 -0
- package/dist/substrate/runtime/observability/index.d.mts +3 -0
- package/dist/substrate/runtime/observability/logger.d.mts +58 -0
- package/dist/substrate/runtime/observability/logger.mjs +89 -0
- package/dist/substrate/runtime/observability/logger.mjs.map +1 -0
- package/dist/substrate/runtime/observability/pretty-error.d.mts +1 -0
- package/dist/substrate/runtime/observability/pretty-error.mjs +119 -0
- package/dist/substrate/runtime/observability/pretty-error.mjs.map +1 -0
- package/dist/substrate/runtime/observability/process-lines.d.mts +31 -0
- package/dist/substrate/runtime/observability/process-lines.mjs +40 -0
- package/dist/substrate/runtime/observability/process-lines.mjs.map +1 -0
- package/dist/substrate/runtime/observability/redaction.d.mts +28 -0
- package/dist/substrate/runtime/observability/redaction.mjs +45 -0
- package/dist/substrate/runtime/observability/redaction.mjs.map +1 -0
- package/dist/substrate/runtime/observability/spans.d.mts +1 -0
- package/dist/substrate/runtime/observability/spans.mjs +87 -0
- package/dist/substrate/runtime/observability/spans.mjs.map +1 -0
- package/dist/substrate/runtime/observability/subprocess-capture.d.mts +2 -0
- package/dist/substrate/runtime/observability/subprocess-capture.mjs +82 -0
- package/dist/substrate/runtime/observability/subprocess-capture.mjs.map +1 -0
- package/dist/substrate/runtime/paths.d.mts +17 -0
- package/dist/substrate/runtime/paths.mjs +61 -0
- package/dist/substrate/runtime/paths.mjs.map +1 -0
- package/dist/substrate/runtime/port-broker/index.d.mts +1 -0
- package/dist/substrate/runtime/port-broker/service.d.mts +1 -0
- package/dist/substrate/runtime/port-broker/service.mjs +319 -0
- package/dist/substrate/runtime/port-broker/service.mjs.map +1 -0
- package/dist/substrate/runtime/post-acquire-tasks.d.mts +1 -0
- package/dist/substrate/runtime/post-acquire-tasks.mjs +34 -0
- package/dist/substrate/runtime/post-acquire-tasks.mjs.map +1 -0
- package/dist/substrate/runtime/probes.d.mts +51 -0
- package/dist/substrate/runtime/probes.mjs +84 -0
- package/dist/substrate/runtime/probes.mjs.map +1 -0
- package/dist/substrate/runtime/process-supervisor.d.mts +57 -0
- package/dist/substrate/runtime/process-supervisor.mjs +73 -0
- package/dist/substrate/runtime/process-supervisor.mjs.map +1 -0
- package/dist/substrate/runtime/projection/operational-endpoints.mjs +44 -0
- package/dist/substrate/runtime/projection/operational-endpoints.mjs.map +1 -0
- package/dist/substrate/runtime/projection/persisted.mjs +195 -0
- package/dist/substrate/runtime/projection/persisted.mjs.map +1 -0
- package/dist/substrate/runtime/projection/state-ref.mjs +48 -0
- package/dist/substrate/runtime/projection/state-ref.mjs.map +1 -0
- package/dist/substrate/runtime/projection/update.mjs +200 -0
- package/dist/substrate/runtime/projection/update.mjs.map +1 -0
- package/dist/substrate/runtime/retry-policy.d.mts +18 -0
- package/dist/substrate/runtime/retry-policy.mjs +16 -0
- package/dist/substrate/runtime/retry-policy.mjs.map +1 -0
- package/dist/substrate/runtime/run.mjs +86 -0
- package/dist/substrate/runtime/run.mjs.map +1 -0
- package/dist/substrate/runtime/runtime-decode.d.mts +32 -0
- package/dist/substrate/runtime/runtime-decode.mjs +53 -0
- package/dist/substrate/runtime/runtime-decode.mjs.map +1 -0
- package/dist/substrate/runtime/scoped-http-server.mjs +36 -0
- package/dist/substrate/runtime/scoped-http-server.mjs.map +1 -0
- package/dist/substrate/runtime/scoped-ref-map/service.mjs +83 -0
- package/dist/substrate/runtime/scoped-ref-map/service.mjs.map +1 -0
- package/dist/substrate/runtime/stage-and-swap/index.d.mts +1 -0
- package/dist/substrate/runtime/stage-and-swap/index.mjs +131 -0
- package/dist/substrate/runtime/stage-and-swap/index.mjs.map +1 -0
- package/dist/substrate/runtime/state-store/schema.mjs +36 -0
- package/dist/substrate/runtime/state-store/schema.mjs.map +1 -0
- package/dist/substrate/runtime/strategy-registry/chain-probe-for.d.mts +1 -0
- package/dist/substrate/runtime/strategy-registry/chain-probe-for.mjs +22 -0
- package/dist/substrate/runtime/strategy-registry/chain-probe-for.mjs.map +1 -0
- package/dist/substrate/runtime/strategy-registry/faucet-capability-for.d.mts +1 -0
- package/dist/substrate/runtime/strategy-registry/faucet-capability-for.mjs +30 -0
- package/dist/substrate/runtime/strategy-registry/faucet-capability-for.mjs.map +1 -0
- package/dist/substrate/runtime/strategy-registry/index.d.mts +1 -0
- package/dist/substrate/runtime/strategy-registry/service.d.mts +1 -0
- package/dist/substrate/runtime/strategy-registry/service.mjs +67 -0
- package/dist/substrate/runtime/strategy-registry/service.mjs.map +1 -0
- package/dist/substrate/runtime/sui-execute/index.d.mts +11 -0
- package/dist/substrate/runtime/sui-execute/index.mjs +144 -0
- package/dist/substrate/runtime/sui-execute/index.mjs.map +1 -0
- package/dist/substrate/runtime/sui-move-build/index.d.mts +1 -0
- package/dist/substrate/runtime/sui-move-build/index.mjs +283 -0
- package/dist/substrate/runtime/sui-move-build/index.mjs.map +1 -0
- package/dist/substrate/runtime/supervisor.d.mts +1 -0
- package/dist/substrate/runtime/supervisor.mjs +831 -0
- package/dist/substrate/runtime/supervisor.mjs.map +1 -0
- package/dist/surfaces/cli/command-tree.mjs +276 -0
- package/dist/surfaces/cli/command-tree.mjs.map +1 -0
- package/dist/surfaces/cli/commands/config.mjs +31 -0
- package/dist/surfaces/cli/commands/config.mjs.map +1 -0
- package/dist/surfaces/cli/commands/confirm-node.mjs +26 -0
- package/dist/surfaces/cli/commands/confirm-node.mjs.map +1 -0
- package/dist/surfaces/cli/commands/confirm.mjs +26 -0
- package/dist/surfaces/cli/commands/confirm.mjs.map +1 -0
- package/dist/surfaces/cli/commands/doctor-probes.mjs +452 -0
- package/dist/surfaces/cli/commands/doctor-probes.mjs.map +1 -0
- package/dist/surfaces/cli/commands/doctor.mjs +38 -0
- package/dist/surfaces/cli/commands/doctor.mjs.map +1 -0
- package/dist/surfaces/cli/commands/prune-picker.mjs +347 -0
- package/dist/surfaces/cli/commands/prune-picker.mjs.map +1 -0
- package/dist/surfaces/cli/commands/prune.mjs +178 -0
- package/dist/surfaces/cli/commands/prune.mjs.map +1 -0
- package/dist/surfaces/cli/commands/snapshot.mjs +141 -0
- package/dist/surfaces/cli/commands/snapshot.mjs.map +1 -0
- package/dist/surfaces/cli/commands/status.mjs +95 -0
- package/dist/surfaces/cli/commands/status.mjs.map +1 -0
- package/dist/surfaces/cli/commands/supervisor-presence.mjs +33 -0
- package/dist/surfaces/cli/commands/supervisor-presence.mjs.map +1 -0
- package/dist/surfaces/cli/commands/wipe.mjs +28 -0
- package/dist/surfaces/cli/commands/wipe.mjs.map +1 -0
- package/dist/surfaces/cli/envelope.mjs +43 -0
- package/dist/surfaces/cli/envelope.mjs.map +1 -0
- package/dist/surfaces/cli/errors.mjs +110 -0
- package/dist/surfaces/cli/errors.mjs.map +1 -0
- package/dist/surfaces/cli/flags.mjs +56 -0
- package/dist/surfaces/cli/flags.mjs.map +1 -0
- package/dist/surfaces/cli/index.mjs +418 -0
- package/dist/surfaces/cli/index.mjs.map +1 -0
- package/dist/surfaces/cli/output.mjs +115 -0
- package/dist/surfaces/cli/output.mjs.map +1 -0
- package/dist/surfaces/cli/sysexits.mjs +139 -0
- package/dist/surfaces/cli/sysexits.mjs.map +1 -0
- package/dist/surfaces/tui/app.mjs +104 -0
- package/dist/surfaces/tui/app.mjs.map +1 -0
- package/dist/surfaces/tui/dashboard.mjs +261 -0
- package/dist/surfaces/tui/dashboard.mjs.map +1 -0
- package/dist/surfaces/tui/display-derivation.mjs +395 -0
- package/dist/surfaces/tui/display-derivation.mjs.map +1 -0
- package/dist/surfaces/tui/errors.mjs +11 -0
- package/dist/surfaces/tui/errors.mjs.map +1 -0
- package/dist/surfaces/tui/event-log.mjs +155 -0
- package/dist/surfaces/tui/event-log.mjs.map +1 -0
- package/dist/surfaces/tui/heartbeat.mjs +33 -0
- package/dist/surfaces/tui/heartbeat.mjs.map +1 -0
- package/dist/surfaces/tui/index.mjs +50 -0
- package/dist/surfaces/tui/index.mjs.map +1 -0
- package/dist/surfaces/tui/input.mjs +104 -0
- package/dist/surfaces/tui/input.mjs.map +1 -0
- package/dist/surfaces/tui/mode-detect.mjs +32 -0
- package/dist/surfaces/tui/mode-detect.mjs.map +1 -0
- package/dist/surfaces/tui/mount-ink.mjs +31 -0
- package/dist/surfaces/tui/mount-ink.mjs.map +1 -0
- package/dist/surfaces/tui/plain-renderer.mjs +170 -0
- package/dist/surfaces/tui/plain-renderer.mjs.map +1 -0
- package/dist/surfaces/tui/resource-table.mjs +507 -0
- package/dist/surfaces/tui/resource-table.mjs.map +1 -0
- package/images/_shared/signal-forward.sh +77 -0
- package/images/postgres/Dockerfile +32 -0
- package/images/seal/Dockerfile +68 -0
- package/images/seal/entrypoint.sh +65 -0
- package/images/sui/Dockerfile +73 -0
- package/images/sui/entrypoint.sh +244 -0
- package/images/sui-fork/Dockerfile +53 -0
- package/images/sui-fork/entrypoint.sh +51 -0
- package/images/walrus/Dockerfile +122 -0
- package/images/walrus/deploy-walrus.sh +305 -0
- package/images/walrus/run-walrus.sh +53 -0
- package/package.json +94 -0
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { __exportAll } from "../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
import { Effect, Schema } from "effect";
|
|
3
|
+
//#region src/substrate/runtime/config-validation.ts
|
|
4
|
+
var config_validation_exports = /* @__PURE__ */ __exportAll({
|
|
5
|
+
decodeConfig: () => decodeConfig,
|
|
6
|
+
decodeConfigSync: () => decodeConfigSync,
|
|
7
|
+
defineConfigError: () => defineConfigError,
|
|
8
|
+
expectNonEmptyArray: () => expectNonEmptyArray,
|
|
9
|
+
expectNonEmptyString: () => expectNonEmptyString,
|
|
10
|
+
expectOneOf: () => expectOneOf,
|
|
11
|
+
expectOptionalNonEmptyString: () => expectOptionalNonEmptyString,
|
|
12
|
+
expectOptionalPort: () => expectOptionalPort,
|
|
13
|
+
expectOptionalPositiveInteger: () => expectOptionalPositiveInteger,
|
|
14
|
+
expectPattern: () => expectPattern,
|
|
15
|
+
expectPort: () => expectPort,
|
|
16
|
+
expectPositiveFiniteNumber: () => expectPositiveFiniteNumber,
|
|
17
|
+
expectPositiveInteger: () => expectPositiveInteger,
|
|
18
|
+
expectStringRecord: () => expectStringRecord
|
|
19
|
+
});
|
|
20
|
+
const defineConfigError = (tag) => (issue) => ({
|
|
21
|
+
_tag: tag,
|
|
22
|
+
...issue
|
|
23
|
+
});
|
|
24
|
+
const fail = (mkError, issue) => {
|
|
25
|
+
throw mkError(issue);
|
|
26
|
+
};
|
|
27
|
+
const expectNonEmptyString = (value, options) => {
|
|
28
|
+
if (typeof value === "string" && value.length > 0) return value;
|
|
29
|
+
return fail(options.mkError, {
|
|
30
|
+
field: options.field,
|
|
31
|
+
message: options.message ?? "must be a non-empty string",
|
|
32
|
+
...options.hint === void 0 ? {} : { hint: options.hint }
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
const expectOptionalNonEmptyString = (value, options) => {
|
|
36
|
+
if (value === void 0) return void 0;
|
|
37
|
+
return expectNonEmptyString(value, options);
|
|
38
|
+
};
|
|
39
|
+
const expectPositiveInteger = (value, options) => {
|
|
40
|
+
if (typeof value === "number" && Number.isInteger(value) && value > 0) return value;
|
|
41
|
+
return fail(options.mkError, {
|
|
42
|
+
field: options.field,
|
|
43
|
+
message: options.message ?? "must be a positive integer",
|
|
44
|
+
...options.hint === void 0 ? {} : { hint: options.hint }
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
const expectOptionalPositiveInteger = (value, options) => {
|
|
48
|
+
if (value === void 0) return void 0;
|
|
49
|
+
return expectPositiveInteger(value, options);
|
|
50
|
+
};
|
|
51
|
+
const expectPositiveFiniteNumber = (value, options) => {
|
|
52
|
+
if (typeof value === "number" && Number.isFinite(value) && value > 0) return value;
|
|
53
|
+
return fail(options.mkError, {
|
|
54
|
+
field: options.field,
|
|
55
|
+
message: options.message ?? "must be a positive finite number",
|
|
56
|
+
...options.hint === void 0 ? {} : { hint: options.hint }
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
const expectPort = (value, options) => {
|
|
60
|
+
if (typeof value === "number" && Number.isInteger(value) && value > 0 && value <= 65535) return value;
|
|
61
|
+
return fail(options.mkError, {
|
|
62
|
+
field: options.field,
|
|
63
|
+
message: options.message ?? "must be an integer between 1 and 65535",
|
|
64
|
+
...options.hint === void 0 ? {} : { hint: options.hint }
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
const expectOptionalPort = (value, options) => {
|
|
68
|
+
if (value === void 0) return void 0;
|
|
69
|
+
return expectPort(value, options);
|
|
70
|
+
};
|
|
71
|
+
const expectStringRecord = (value, options) => {
|
|
72
|
+
if (value === void 0) return {};
|
|
73
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) return fail(options.mkError, {
|
|
74
|
+
field: options.field,
|
|
75
|
+
message: options.message ?? "must be an object of string values",
|
|
76
|
+
...options.hint === void 0 ? {} : { hint: options.hint }
|
|
77
|
+
});
|
|
78
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
79
|
+
if (key.length === 0) return fail(options.mkError, {
|
|
80
|
+
field: options.field,
|
|
81
|
+
message: "environment variable names must be non-empty",
|
|
82
|
+
...options.hint === void 0 ? {} : { hint: options.hint }
|
|
83
|
+
});
|
|
84
|
+
if (typeof entry !== "string") return fail(options.mkError, {
|
|
85
|
+
field: `${options.field}.${key}`,
|
|
86
|
+
message: "must be a string",
|
|
87
|
+
...options.hint === void 0 ? {} : { hint: options.hint }
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
return value;
|
|
91
|
+
};
|
|
92
|
+
const expectOneOf = (value, values, options) => {
|
|
93
|
+
if (typeof value === "string" && values.includes(value)) return value;
|
|
94
|
+
return fail(options.mkError, {
|
|
95
|
+
field: options.field,
|
|
96
|
+
message: options.message ?? `must be one of ${values.map((v) => `'${v}'`).join(", ")}`,
|
|
97
|
+
...options.hint === void 0 ? {} : { hint: options.hint }
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
const expectNonEmptyArray = (value, options) => {
|
|
101
|
+
if (Array.isArray(value) && value.length > 0) return value;
|
|
102
|
+
return fail(options.mkError, {
|
|
103
|
+
field: options.field,
|
|
104
|
+
message: options.message ?? "must be a non-empty array",
|
|
105
|
+
...options.hint === void 0 ? {} : { hint: options.hint }
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
const expectPattern = (value, pattern, options) => {
|
|
109
|
+
if (pattern.test(value)) return value;
|
|
110
|
+
return fail(options.mkError, {
|
|
111
|
+
field: options.field,
|
|
112
|
+
message: options.message ?? `must match ${pattern.source}`,
|
|
113
|
+
...options.hint === void 0 ? {} : { hint: options.hint }
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
const decodeConfig = (schema, value, options) => Schema.decodeUnknownEffect(schema)(value).pipe(Effect.mapError((cause) => options.mkError({
|
|
117
|
+
field: options.field,
|
|
118
|
+
message: options.message ?? "failed to decode config value",
|
|
119
|
+
...options.hint === void 0 ? {} : { hint: options.hint },
|
|
120
|
+
cause
|
|
121
|
+
})));
|
|
122
|
+
const decodeConfigSync = (schema, value, options) => {
|
|
123
|
+
try {
|
|
124
|
+
return Schema.decodeUnknownSync(schema)(value);
|
|
125
|
+
} catch (cause) {
|
|
126
|
+
return fail(options.mkError, {
|
|
127
|
+
field: options.field,
|
|
128
|
+
message: options.message ?? "failed to decode config value",
|
|
129
|
+
...options.hint === void 0 ? {} : { hint: options.hint },
|
|
130
|
+
cause
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
//#endregion
|
|
135
|
+
export { config_validation_exports, defineConfigError, expectNonEmptyArray, expectNonEmptyString, expectOneOf, expectOptionalNonEmptyString, expectOptionalPort, expectOptionalPositiveInteger, expectPositiveFiniteNumber, expectPositiveInteger, expectStringRecord };
|
|
136
|
+
|
|
137
|
+
//# sourceMappingURL=config-validation.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-validation.mjs","names":[],"sources":["../../../src/substrate/runtime/config-validation.ts"],"sourcesContent":["import { Effect, Schema } from 'effect';\n\nexport interface ConfigIssue {\n\treadonly field: string;\n\treadonly message: string;\n\treadonly hint?: string;\n\treadonly cause?: unknown;\n}\n\nexport type ConfigErrorFactory<E> = (issue: ConfigIssue) => E;\n\nexport const defineConfigError =\n\t<const Tag extends string>(tag: Tag) =>\n\t(issue: ConfigIssue): ConfigIssue & { readonly _tag: Tag } => ({\n\t\t_tag: tag,\n\t\t...issue,\n\t});\n\ninterface ValidatorOptions<E> {\n\treadonly field: string;\n\treadonly mkError: ConfigErrorFactory<E>;\n\treadonly message?: string;\n\treadonly hint?: string;\n}\n\nconst fail = <E>(mkError: ConfigErrorFactory<E>, issue: ConfigIssue): never => {\n\tthrow mkError(issue);\n};\n\nexport const expectNonEmptyString = <E>(value: unknown, options: ValidatorOptions<E>): string => {\n\tif (typeof value === 'string' && value.length > 0) return value;\n\treturn fail(options.mkError, {\n\t\tfield: options.field,\n\t\tmessage: options.message ?? 'must be a non-empty string',\n\t\t...(options.hint === undefined ? {} : { hint: options.hint }),\n\t});\n};\n\nexport const expectOptionalNonEmptyString = <E>(\n\tvalue: unknown,\n\toptions: ValidatorOptions<E>,\n): string | undefined => {\n\tif (value === undefined) return undefined;\n\treturn expectNonEmptyString(value, options);\n};\n\nexport const expectPositiveInteger = <E>(value: unknown, options: ValidatorOptions<E>): number => {\n\tif (typeof value === 'number' && Number.isInteger(value) && value > 0) return value;\n\treturn fail(options.mkError, {\n\t\tfield: options.field,\n\t\tmessage: options.message ?? 'must be a positive integer',\n\t\t...(options.hint === undefined ? {} : { hint: options.hint }),\n\t});\n};\n\nexport const expectOptionalPositiveInteger = <E>(\n\tvalue: unknown,\n\toptions: ValidatorOptions<E>,\n): number | undefined => {\n\tif (value === undefined) return undefined;\n\treturn expectPositiveInteger(value, options);\n};\n\nexport const expectPositiveFiniteNumber = <E>(\n\tvalue: unknown,\n\toptions: ValidatorOptions<E>,\n): number => {\n\tif (typeof value === 'number' && Number.isFinite(value) && value > 0) return value;\n\treturn fail(options.mkError, {\n\t\tfield: options.field,\n\t\tmessage: options.message ?? 'must be a positive finite number',\n\t\t...(options.hint === undefined ? {} : { hint: options.hint }),\n\t});\n};\n\nexport const expectPort = <E>(value: unknown, options: ValidatorOptions<E>): number => {\n\tif (typeof value === 'number' && Number.isInteger(value) && value > 0 && value <= 65_535) {\n\t\treturn value;\n\t}\n\treturn fail(options.mkError, {\n\t\tfield: options.field,\n\t\tmessage: options.message ?? 'must be an integer between 1 and 65535',\n\t\t...(options.hint === undefined ? {} : { hint: options.hint }),\n\t});\n};\n\nexport const expectOptionalPort = <E>(\n\tvalue: unknown,\n\toptions: ValidatorOptions<E>,\n): number | undefined => {\n\tif (value === undefined) return undefined;\n\treturn expectPort(value, options);\n};\n\nexport const expectStringRecord = <E>(\n\tvalue: unknown,\n\toptions: ValidatorOptions<E>,\n): Readonly<Record<string, string>> => {\n\tif (value === undefined) return {};\n\tif (typeof value !== 'object' || value === null || Array.isArray(value)) {\n\t\treturn fail(options.mkError, {\n\t\t\tfield: options.field,\n\t\t\tmessage: options.message ?? 'must be an object of string values',\n\t\t\t...(options.hint === undefined ? {} : { hint: options.hint }),\n\t\t});\n\t}\n\tfor (const [key, entry] of Object.entries(value)) {\n\t\tif (key.length === 0) {\n\t\t\treturn fail(options.mkError, {\n\t\t\t\tfield: options.field,\n\t\t\t\tmessage: 'environment variable names must be non-empty',\n\t\t\t\t...(options.hint === undefined ? {} : { hint: options.hint }),\n\t\t\t});\n\t\t}\n\t\tif (typeof entry !== 'string') {\n\t\t\treturn fail(options.mkError, {\n\t\t\t\tfield: `${options.field}.${key}`,\n\t\t\t\tmessage: 'must be a string',\n\t\t\t\t...(options.hint === undefined ? {} : { hint: options.hint }),\n\t\t\t});\n\t\t}\n\t}\n\treturn value as Readonly<Record<string, string>>;\n};\n\nexport const expectOneOf = <const Values extends ReadonlyArray<string>, E>(\n\tvalue: unknown,\n\tvalues: Values,\n\toptions: ValidatorOptions<E>,\n): Values[number] => {\n\tif (typeof value === 'string' && (values as ReadonlyArray<string>).includes(value)) {\n\t\treturn value as Values[number];\n\t}\n\treturn fail(options.mkError, {\n\t\tfield: options.field,\n\t\tmessage: options.message ?? `must be one of ${values.map((v) => `'${v}'`).join(', ')}`,\n\t\t...(options.hint === undefined ? {} : { hint: options.hint }),\n\t});\n};\n\nexport const expectNonEmptyArray = <T, E>(\n\tvalue: ReadonlyArray<T> | undefined,\n\toptions: ValidatorOptions<E>,\n): ReadonlyArray<T> => {\n\tif (Array.isArray(value) && value.length > 0) return value;\n\treturn fail(options.mkError, {\n\t\tfield: options.field,\n\t\tmessage: options.message ?? 'must be a non-empty array',\n\t\t...(options.hint === undefined ? {} : { hint: options.hint }),\n\t});\n};\n\nexport const expectPattern = <E>(\n\tvalue: string,\n\tpattern: RegExp,\n\toptions: ValidatorOptions<E>,\n): string => {\n\tif (pattern.test(value)) return value;\n\treturn fail(options.mkError, {\n\t\tfield: options.field,\n\t\tmessage: options.message ?? `must match ${pattern.source}`,\n\t\t...(options.hint === undefined ? {} : { hint: options.hint }),\n\t});\n};\n\nexport const decodeConfig = <S extends Schema.Decoder<unknown>, E>(\n\tschema: S,\n\tvalue: unknown,\n\toptions: ValidatorOptions<E>,\n): Effect.Effect<S['Type'], E> =>\n\tSchema.decodeUnknownEffect(schema)(value).pipe(\n\t\tEffect.mapError((cause) =>\n\t\t\toptions.mkError({\n\t\t\t\tfield: options.field,\n\t\t\t\tmessage: options.message ?? 'failed to decode config value',\n\t\t\t\t...(options.hint === undefined ? {} : { hint: options.hint }),\n\t\t\t\tcause,\n\t\t\t}),\n\t\t),\n\t);\n\nexport const decodeConfigSync = <S extends Schema.Decoder<unknown>, E>(\n\tschema: S,\n\tvalue: unknown,\n\toptions: ValidatorOptions<E>,\n): S['Type'] => {\n\ttry {\n\t\treturn Schema.decodeUnknownSync(schema)(value);\n\t} catch (cause) {\n\t\treturn fail(options.mkError, {\n\t\t\tfield: options.field,\n\t\t\tmessage: options.message ?? 'failed to decode config value',\n\t\t\t...(options.hint === undefined ? {} : { hint: options.hint }),\n\t\t\t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@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Context, Effect, Option } from "effect";
|
|
2
|
+
//#region src/substrate/runtime/context-helpers.ts
|
|
3
|
+
/**
|
|
4
|
+
* Read an optional service from a `Context`, or fall back.
|
|
5
|
+
*
|
|
6
|
+
* The `pluginContext` at the supervisor boundary is typed
|
|
7
|
+
* `Context.Context<never>` — the substrate is service-name-blind, so
|
|
8
|
+
* the lookup widens internally to read the optional service.
|
|
9
|
+
*
|
|
10
|
+
* Used at sites where the fallback is a plain value.
|
|
11
|
+
*/
|
|
12
|
+
const getOrDefault = (ctx, tag, fallback) => {
|
|
13
|
+
const opt = Context.getOption(ctx, tag);
|
|
14
|
+
return Option.isSome(opt) ? opt.value : fallback;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Effectful variant of `getOrDefault`. Same lookup; the fallback is
|
|
18
|
+
* an `Effect` so it can build a Layer / acquire a scoped resource
|
|
19
|
+
* only when the optional service isn't present.
|
|
20
|
+
*
|
|
21
|
+
* Used at the CapabilitySinks site — the fallback builds the default
|
|
22
|
+
* sinks Layer; we only want to pay that cost when the caller didn't
|
|
23
|
+
* pre-build one.
|
|
24
|
+
*/
|
|
25
|
+
const getOrDefaultEffect = (ctx, tag, fallback) => {
|
|
26
|
+
const opt = Context.getOption(ctx, tag);
|
|
27
|
+
return Option.isSome(opt) ? Effect.succeed(opt.value) : fallback;
|
|
28
|
+
};
|
|
29
|
+
//#endregion
|
|
30
|
+
export { getOrDefault, getOrDefaultEffect };
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=context-helpers.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-helpers.mjs","names":[],"sources":["../../../src/substrate/runtime/context-helpers.ts"],"sourcesContent":["// Substrate context helpers — tiny utilities over `Context`.\n//\n// Closes one duplication: three sites in `supervisor.ts` open-coded the\n// `Context.getOption(ctx, tag)` + `Option.isSome ? value : fallback`\n// shape (Logger, RuntimeRoot, CapabilitySinks). The shape was always\n// the same — widen the supervisor's name-blind `pluginContext`, look\n// up an optional service, fall back when the caller didn't layer it\n// in. One helper, no drift.\n\nimport { Context, Effect, Option } from 'effect';\n\n/**\n * Read an optional service from a `Context`, or fall back.\n *\n * The `pluginContext` at the supervisor boundary is typed\n * `Context.Context<never>` — the substrate is service-name-blind, so\n * the lookup widens internally to read the optional service.\n *\n * Used at sites where the fallback is a plain value.\n */\nexport const getOrDefault = <S, I>(\n\tctx: Context.Context<never>,\n\ttag: Context.Key<I, S>,\n\tfallback: S,\n): S => {\n\tconst opt = Context.getOption(ctx as Context.Context<I>, tag);\n\treturn Option.isSome(opt) ? opt.value : fallback;\n};\n\n/**\n * Effectful variant of `getOrDefault`. Same lookup; the fallback is\n * an `Effect` so it can build a Layer / acquire a scoped resource\n * only when the optional service isn't present.\n *\n * Used at the CapabilitySinks site — the fallback builds the default\n * sinks Layer; we only want to pay that cost when the caller didn't\n * pre-build one.\n */\nexport const getOrDefaultEffect = <S, I, E, R>(\n\tctx: Context.Context<never>,\n\ttag: Context.Key<I, S>,\n\tfallback: Effect.Effect<S, E, R>,\n): Effect.Effect<S, E, R> => {\n\tconst opt = Context.getOption(ctx as Context.Context<I>, tag);\n\treturn Option.isSome(opt) ? Effect.succeed(opt.value) : fallback;\n};\n"],"mappings":";;;;;;;;;;;AAoBA,MAAa,gBACZ,KACA,KACA,aACO;CACP,MAAM,MAAM,QAAQ,UAAU,KAA2B,IAAI;AAC7D,QAAO,OAAO,OAAO,IAAI,GAAG,IAAI,QAAQ;;;;;;;;;;;AAYzC,MAAa,sBACZ,KACA,KACA,aAC4B;CAC5B,MAAM,MAAM,QAAQ,UAAU,KAA2B,IAAI;AAC7D,QAAO,OAAO,OAAO,IAAI,GAAG,OAAO,QAAQ,IAAI,MAAM,GAAG"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { decodeUnknownSync } from "../../runtime-decode.mjs";
|
|
2
|
+
import { CommandRecordSchema, EventRecordSchema } from "./protocol.mjs";
|
|
3
|
+
import { appendRecord, ensureFile, tailRecords } from "./file-channel.mjs";
|
|
4
|
+
import { Effect, Option, Ref, Stream } from "effect";
|
|
5
|
+
import { randomUUID } from "node:crypto";
|
|
6
|
+
import { hostname } from "node:os";
|
|
7
|
+
//#region src/substrate/runtime/cross-process/command-channel/channel.ts
|
|
8
|
+
const COMMAND_CHANNEL_COMMANDS_FILE_NAME = "commands.ndjson";
|
|
9
|
+
const COMMAND_CHANNEL_EVENTS_FILE_NAME = "events.ndjson";
|
|
10
|
+
/** Build a `command-channel` paths bundle from a stackRoot dir. The
|
|
11
|
+
* files live next to the existing cross-process artifacts. */
|
|
12
|
+
const commandChannelPaths = (stackRoot) => ({
|
|
13
|
+
commandsFile: `${stackRoot}/${COMMAND_CHANNEL_COMMANDS_FILE_NAME}`,
|
|
14
|
+
eventsFile: `${stackRoot}/${COMMAND_CHANNEL_EVENTS_FILE_NAME}`
|
|
15
|
+
});
|
|
16
|
+
const nextSeq = (state) => Ref.modify(state.seq, (n) => [n + 1, n + 1]);
|
|
17
|
+
/**
|
|
18
|
+
* Build the publisher half. The events Stream is scope-bound:
|
|
19
|
+
* pass it through `Stream.runDrain` inside a `Scope.use` or fork it
|
|
20
|
+
* with `Effect.forkScoped` so the tail polling cleans up.
|
|
21
|
+
*/
|
|
22
|
+
const makeCommandChannelPublisher = (paths) => Effect.gen(function* () {
|
|
23
|
+
yield* ensureFile(paths.commandsFile);
|
|
24
|
+
yield* ensureFile(paths.eventsFile);
|
|
25
|
+
const state = { seq: yield* Ref.make(0) };
|
|
26
|
+
const pid = process.pid;
|
|
27
|
+
const host = hostname();
|
|
28
|
+
const publish = (command) => Effect.gen(function* () {
|
|
29
|
+
const seq = yield* nextSeq(state);
|
|
30
|
+
const id = `${pid}-${seq}-${randomUUID().slice(0, 8)}`;
|
|
31
|
+
const record = {
|
|
32
|
+
protocol: 1,
|
|
33
|
+
seq,
|
|
34
|
+
id,
|
|
35
|
+
at: Date.now(),
|
|
36
|
+
publisherPid: pid,
|
|
37
|
+
publisherHostname: host,
|
|
38
|
+
command
|
|
39
|
+
};
|
|
40
|
+
yield* appendRecord(paths.commandsFile, record);
|
|
41
|
+
return { id };
|
|
42
|
+
});
|
|
43
|
+
const decodeEvent = (raw) => decodeUnknownSync(EventRecordSchema, raw, {
|
|
44
|
+
source: "command-channel event",
|
|
45
|
+
mkError: (issue) => issue
|
|
46
|
+
});
|
|
47
|
+
const events = tailRecords(paths.eventsFile, (raw) => decodeEvent(raw), { fromOffset: "current" });
|
|
48
|
+
const findReply = (id) => Stream.runHead(tailRecords(paths.eventsFile, (raw) => decodeEvent(raw), { fromOffset: "start" }).pipe(Stream.filter((rec) => (rec.kind === "ack" || rec.kind === "error") && rec.correlatesTo === id), Stream.take(1)));
|
|
49
|
+
const awaitCompletion = (id, options = {}) => {
|
|
50
|
+
const withScope = Effect.scoped(findReply(id));
|
|
51
|
+
return (options.timeoutMillis !== void 0 ? withScope.pipe(Effect.timeoutOption(`${options.timeoutMillis} millis`), Effect.map((outer) => Option.flatten(outer))) : withScope).pipe(Effect.map((reply) => {
|
|
52
|
+
const inner = Option.getOrNull(reply);
|
|
53
|
+
if (inner === null) return options.timeoutMillis !== void 0 ? {
|
|
54
|
+
ok: false,
|
|
55
|
+
message: "timed out waiting for ack"
|
|
56
|
+
} : {
|
|
57
|
+
ok: false,
|
|
58
|
+
message: "no reply"
|
|
59
|
+
};
|
|
60
|
+
if (inner.kind === "ack") return { ok: true };
|
|
61
|
+
return {
|
|
62
|
+
ok: false,
|
|
63
|
+
message: inner.detail ? `${inner.message}: ${inner.detail}` : inner.message
|
|
64
|
+
};
|
|
65
|
+
}));
|
|
66
|
+
};
|
|
67
|
+
return {
|
|
68
|
+
publish,
|
|
69
|
+
awaitCompletion,
|
|
70
|
+
events
|
|
71
|
+
};
|
|
72
|
+
});
|
|
73
|
+
const nextSubSeq = (state) => Ref.modify(state.seq, (n) => [n + 1, n + 1]);
|
|
74
|
+
/** Build the supervisor half. The commands Stream is scope-bound. */
|
|
75
|
+
const makeCommandChannelSubscriber = (paths, options = {}) => Effect.gen(function* () {
|
|
76
|
+
yield* ensureFile(paths.commandsFile);
|
|
77
|
+
yield* ensureFile(paths.eventsFile);
|
|
78
|
+
const state = { seq: yield* Ref.make(0) };
|
|
79
|
+
const decodeCommand = (raw) => decodeUnknownSync(CommandRecordSchema, raw, {
|
|
80
|
+
source: "command-channel command",
|
|
81
|
+
mkError: (issue) => issue
|
|
82
|
+
});
|
|
83
|
+
const commands = tailRecords(paths.commandsFile, (raw) => decodeCommand(raw), {
|
|
84
|
+
fromOffset: options.fromOffset ?? "current",
|
|
85
|
+
pollMillis: options.pollMillis
|
|
86
|
+
});
|
|
87
|
+
const writeEvent = (record) => appendRecord(paths.eventsFile, record);
|
|
88
|
+
const publishEvent = (event) => Effect.gen(function* () {
|
|
89
|
+
yield* writeEvent({
|
|
90
|
+
protocol: 1,
|
|
91
|
+
seq: yield* nextSubSeq(state),
|
|
92
|
+
at: Date.now(),
|
|
93
|
+
kind: "engine",
|
|
94
|
+
event
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
const ack = (correlatesTo, detail) => Effect.gen(function* () {
|
|
98
|
+
yield* writeEvent({
|
|
99
|
+
protocol: 1,
|
|
100
|
+
seq: yield* nextSubSeq(state),
|
|
101
|
+
at: Date.now(),
|
|
102
|
+
kind: "ack",
|
|
103
|
+
correlatesTo,
|
|
104
|
+
...detail !== void 0 ? { detail } : {}
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
const fail = (correlatesTo, message, detail) => Effect.gen(function* () {
|
|
108
|
+
yield* writeEvent({
|
|
109
|
+
protocol: 1,
|
|
110
|
+
seq: yield* nextSubSeq(state),
|
|
111
|
+
at: Date.now(),
|
|
112
|
+
kind: "error",
|
|
113
|
+
correlatesTo,
|
|
114
|
+
message,
|
|
115
|
+
...detail !== void 0 ? { detail } : {}
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
return {
|
|
119
|
+
commands,
|
|
120
|
+
publishEvent,
|
|
121
|
+
ack,
|
|
122
|
+
fail
|
|
123
|
+
};
|
|
124
|
+
});
|
|
125
|
+
//#endregion
|
|
126
|
+
export { COMMAND_CHANNEL_COMMANDS_FILE_NAME, COMMAND_CHANNEL_EVENTS_FILE_NAME, commandChannelPaths, makeCommandChannelPublisher, makeCommandChannelSubscriber };
|
|
127
|
+
|
|
128
|
+
//# sourceMappingURL=channel.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channel.mjs","names":["nodeHostname"],"sources":["../../../../../src/substrate/runtime/cross-process/command-channel/channel.ts"],"sourcesContent":["// High-level cross-process command channel.\n//\n// Two halves built on the same `commands.ndjson` + `events.ndjson` pair:\n//\n// - Publisher side (CLI / TUI / programmable API caller): appends to\n// `commands.ndjson`; tails `events.ndjson` so it can correlate\n// ack/error replies AND surface incoming engine events (for `logs`\n// and `status --watch`-style verbs).\n//\n// - Supervisor side: tails `commands.ndjson` to receive incoming\n// intents; appends to `events.ndjson` to broadcast engine events\n// and ack/error replies.\n//\n// Both halves are scope-bound — the underlying poll fiber is forked\n// into the surrounding Scope and stops when the Scope closes.\n\nimport { hostname as nodeHostname } from 'node:os';\nimport { randomUUID } from 'node:crypto';\n\nimport { Effect, Option, Ref, Stream, Scope } from 'effect';\n\nimport type { EngineCommand } from '../../../events.ts';\nimport { decodeUnknownSync } from '../../runtime-decode.ts';\nimport { type CommandChannelError, appendRecord, ensureFile, tailRecords } from './file-channel.ts';\nimport {\n\tCOMMAND_CHANNEL_PROTOCOL_VERSION,\n\tCommandRecordSchema,\n\tEventRecordSchema,\n\ttype CommandRecord,\n\ttype EventRecord,\n} from './protocol.ts';\n\nexport interface CommandChannelPaths {\n\treadonly commandsFile: string;\n\treadonly eventsFile: string;\n}\n\nexport const COMMAND_CHANNEL_COMMANDS_FILE_NAME = 'commands.ndjson';\nexport const COMMAND_CHANNEL_EVENTS_FILE_NAME = 'events.ndjson';\n\n/** Build a `command-channel` paths bundle from a stackRoot dir. The\n * files live next to the existing cross-process artifacts. */\nexport const commandChannelPaths = (stackRoot: string): CommandChannelPaths => ({\n\tcommandsFile: `${stackRoot}/${COMMAND_CHANNEL_COMMANDS_FILE_NAME}`,\n\teventsFile: `${stackRoot}/${COMMAND_CHANNEL_EVENTS_FILE_NAME}`,\n});\n\n// -----------------------------------------------------------------------------\n// Publisher side\n// -----------------------------------------------------------------------------\n\nexport interface PublishedCommand {\n\t/** Per-record id used to correlate `ack` / `error` replies. */\n\treadonly id: string;\n}\n\n/**\n * Publisher half: append a typed command, optionally await its\n * corresponding ack/error reply.\n *\n * `publish(cmd)` writes one record and returns the id; the caller can\n * then `awaitCompletion(id)` to block until the supervisor either acks\n * or errors. `awaitCompletion` is a separate seam so verbs that don't\n * need correlation (TUI-style fire-and-forget) skip the wait.\n */\nexport interface CommandChannelPublisher {\n\treadonly publish: (\n\t\tcommand: EngineCommand,\n\t) => Effect.Effect<PublishedCommand, CommandChannelError>;\n\treadonly awaitCompletion: (\n\t\tid: string,\n\t\toptions?: { readonly timeoutMillis?: number },\n\t) => Effect.Effect<\n\t\t{ readonly ok: true } | { readonly ok: false; readonly message: string },\n\t\tCommandChannelError\n\t>;\n\treadonly events: Stream.Stream<EventRecord, CommandChannelError, Scope.Scope>;\n}\n\ninterface PublisherState {\n\treadonly seq: Ref.Ref<number>;\n}\n\nconst nextSeq = (state: PublisherState): Effect.Effect<number> =>\n\tRef.modify(state.seq, (n) => [n + 1, n + 1]);\n\n/**\n * Build the publisher half. The events Stream is scope-bound:\n * pass it through `Stream.runDrain` inside a `Scope.use` or fork it\n * with `Effect.forkScoped` so the tail polling cleans up.\n */\nexport const makeCommandChannelPublisher = (\n\tpaths: CommandChannelPaths,\n): Effect.Effect<CommandChannelPublisher, CommandChannelError> =>\n\tEffect.gen(function* () {\n\t\tyield* ensureFile(paths.commandsFile);\n\t\tyield* ensureFile(paths.eventsFile);\n\t\tconst state: PublisherState = { seq: yield* Ref.make(0) };\n\t\tconst pid = process.pid;\n\t\tconst host = nodeHostname();\n\n\t\tconst publish = (\n\t\t\tcommand: EngineCommand,\n\t\t): Effect.Effect<PublishedCommand, CommandChannelError> =>\n\t\t\tEffect.gen(function* () {\n\t\t\t\tconst seq = yield* nextSeq(state);\n\t\t\t\tconst id = `${pid}-${seq}-${randomUUID().slice(0, 8)}`;\n\t\t\t\tconst record: CommandRecord = {\n\t\t\t\t\tprotocol: COMMAND_CHANNEL_PROTOCOL_VERSION,\n\t\t\t\t\tseq,\n\t\t\t\t\tid,\n\t\t\t\t\tat: Date.now(),\n\t\t\t\t\tpublisherPid: pid,\n\t\t\t\t\tpublisherHostname: host,\n\t\t\t\t\tcommand,\n\t\t\t\t};\n\t\t\t\tyield* appendRecord(paths.commandsFile, record);\n\t\t\t\treturn { id };\n\t\t\t});\n\n\t\tconst decodeEvent = (raw: unknown): EventRecord =>\n\t\t\tdecodeUnknownSync(EventRecordSchema, raw, {\n\t\t\t\tsource: 'command-channel event',\n\t\t\t\tmkError: (issue) => issue,\n\t\t\t});\n\n\t\tconst events: Stream.Stream<EventRecord, CommandChannelError, Scope.Scope> = tailRecords(\n\t\t\tpaths.eventsFile,\n\t\t\t(raw) => decodeEvent(raw),\n\t\t\t{ fromOffset: 'current' },\n\t\t);\n\n\t\tconst findReply = (\n\t\t\tid: string,\n\t\t): Effect.Effect<\n\t\t\tOption.Option<Extract<EventRecord, { kind: 'ack' | 'error' }>>,\n\t\t\tCommandChannelError,\n\t\t\tScope.Scope\n\t\t> =>\n\t\t\t// Start at 'start' so awaitCompletion picks up an ack that\n\t\t\t// landed before the await call attached. The filter by id is\n\t\t\t// the actual correlation; replaying old records is cheap.\n\t\t\tStream.runHead(\n\t\t\t\ttailRecords(paths.eventsFile, (raw) => decodeEvent(raw), {\n\t\t\t\t\tfromOffset: 'start',\n\t\t\t\t}).pipe(\n\t\t\t\t\tStream.filter(\n\t\t\t\t\t\t(rec): rec is Extract<EventRecord, { kind: 'ack' | 'error' }> =>\n\t\t\t\t\t\t\t(rec.kind === 'ack' || rec.kind === 'error') && rec.correlatesTo === id,\n\t\t\t\t\t),\n\t\t\t\t\tStream.take(1),\n\t\t\t\t),\n\t\t\t);\n\n\t\tconst awaitCompletion = (\n\t\t\tid: string,\n\t\t\toptions: { readonly timeoutMillis?: number } = {},\n\t\t): Effect.Effect<\n\t\t\t{ readonly ok: true } | { readonly ok: false; readonly message: string },\n\t\t\tCommandChannelError\n\t\t> => {\n\t\t\tconst withScope = Effect.scoped(findReply(id));\n\t\t\tconst final =\n\t\t\t\toptions.timeoutMillis !== undefined\n\t\t\t\t\t? withScope.pipe(\n\t\t\t\t\t\t\tEffect.timeoutOption(`${options.timeoutMillis} millis`),\n\t\t\t\t\t\t\tEffect.map((outer) => Option.flatten(outer)),\n\t\t\t\t\t\t)\n\t\t\t\t\t: withScope;\n\t\t\treturn final.pipe(\n\t\t\t\tEffect.map((reply) => {\n\t\t\t\t\tconst inner = Option.getOrNull(reply);\n\t\t\t\t\tif (inner === null) {\n\t\t\t\t\t\treturn options.timeoutMillis !== undefined\n\t\t\t\t\t\t\t? { ok: false as const, message: 'timed out waiting for ack' }\n\t\t\t\t\t\t\t: { ok: false as const, message: 'no reply' };\n\t\t\t\t\t}\n\t\t\t\t\tif (inner.kind === 'ack') return { ok: true as const };\n\t\t\t\t\treturn {\n\t\t\t\t\t\tok: false as const,\n\t\t\t\t\t\tmessage: inner.detail ? `${inner.message}: ${inner.detail}` : inner.message,\n\t\t\t\t\t};\n\t\t\t\t}),\n\t\t\t);\n\t\t};\n\n\t\treturn { publish, awaitCompletion, events };\n\t});\n\n// -----------------------------------------------------------------------------\n// Supervisor side\n// -----------------------------------------------------------------------------\n\nexport interface CommandChannelSubscriberOptions {\n\t/** From which offset to start reading commands. Defaults to `current`\n\t * so a freshly-booted supervisor doesn't replay queued intents from\n\t * before it was alive. */\n\treadonly fromOffset?: 'start' | 'current';\n\treadonly pollMillis?: number;\n}\n\n/** Tail incoming commands. The supervisor wires its event hub through\n * `publishEvent` so engine events appear on the events file. */\nexport interface CommandChannelSubscriber {\n\treadonly commands: Stream.Stream<CommandRecord, CommandChannelError, Scope.Scope>;\n\treadonly publishEvent: (event: unknown) => Effect.Effect<void, CommandChannelError>;\n\treadonly ack: (correlatesTo: string, detail?: string) => Effect.Effect<void, CommandChannelError>;\n\treadonly fail: (\n\t\tcorrelatesTo: string,\n\t\tmessage: string,\n\t\tdetail?: string,\n\t) => Effect.Effect<void, CommandChannelError>;\n}\n\ninterface SubscriberState {\n\treadonly seq: Ref.Ref<number>;\n}\n\nconst nextSubSeq = (state: SubscriberState): Effect.Effect<number> =>\n\tRef.modify(state.seq, (n) => [n + 1, n + 1]);\n\n/** Build the supervisor half. The commands Stream is scope-bound. */\nexport const makeCommandChannelSubscriber = (\n\tpaths: CommandChannelPaths,\n\toptions: CommandChannelSubscriberOptions = {},\n): Effect.Effect<CommandChannelSubscriber, CommandChannelError> =>\n\tEffect.gen(function* () {\n\t\tyield* ensureFile(paths.commandsFile);\n\t\tyield* ensureFile(paths.eventsFile);\n\t\tconst state: SubscriberState = { seq: yield* Ref.make(0) };\n\n\t\tconst decodeCommand = (raw: unknown): CommandRecord =>\n\t\t\tdecodeUnknownSync(CommandRecordSchema, raw, {\n\t\t\t\tsource: 'command-channel command',\n\t\t\t\tmkError: (issue) => issue,\n\t\t\t});\n\n\t\tconst commands: Stream.Stream<CommandRecord, CommandChannelError, Scope.Scope> = tailRecords(\n\t\t\tpaths.commandsFile,\n\t\t\t(raw) => decodeCommand(raw),\n\t\t\t{\n\t\t\t\tfromOffset: options.fromOffset ?? 'current',\n\t\t\t\tpollMillis: options.pollMillis,\n\t\t\t},\n\t\t);\n\n\t\tconst writeEvent = (record: EventRecord): Effect.Effect<void, CommandChannelError> =>\n\t\t\tappendRecord(paths.eventsFile, record);\n\n\t\tconst publishEvent = (event: unknown): Effect.Effect<void, CommandChannelError> =>\n\t\t\tEffect.gen(function* () {\n\t\t\t\tconst seq = yield* nextSubSeq(state);\n\t\t\t\tyield* writeEvent({\n\t\t\t\t\tprotocol: COMMAND_CHANNEL_PROTOCOL_VERSION,\n\t\t\t\t\tseq,\n\t\t\t\t\tat: Date.now(),\n\t\t\t\t\tkind: 'engine',\n\t\t\t\t\tevent,\n\t\t\t\t});\n\t\t\t});\n\n\t\tconst ack = (correlatesTo: string, detail?: string): Effect.Effect<void, CommandChannelError> =>\n\t\t\tEffect.gen(function* () {\n\t\t\t\tconst seq = yield* nextSubSeq(state);\n\t\t\t\tyield* writeEvent({\n\t\t\t\t\tprotocol: COMMAND_CHANNEL_PROTOCOL_VERSION,\n\t\t\t\t\tseq,\n\t\t\t\t\tat: Date.now(),\n\t\t\t\t\tkind: 'ack',\n\t\t\t\t\tcorrelatesTo,\n\t\t\t\t\t...(detail !== undefined ? { detail } : {}),\n\t\t\t\t});\n\t\t\t});\n\n\t\tconst fail = (\n\t\t\tcorrelatesTo: string,\n\t\t\tmessage: string,\n\t\t\tdetail?: string,\n\t\t): Effect.Effect<void, CommandChannelError> =>\n\t\t\tEffect.gen(function* () {\n\t\t\t\tconst seq = yield* nextSubSeq(state);\n\t\t\t\tyield* writeEvent({\n\t\t\t\t\tprotocol: COMMAND_CHANNEL_PROTOCOL_VERSION,\n\t\t\t\t\tseq,\n\t\t\t\t\tat: Date.now(),\n\t\t\t\t\tkind: 'error',\n\t\t\t\t\tcorrelatesTo,\n\t\t\t\t\tmessage,\n\t\t\t\t\t...(detail !== undefined ? { detail } : {}),\n\t\t\t\t});\n\t\t\t});\n\n\t\treturn { commands, publishEvent, ack, fail };\n\t});\n"],"mappings":";;;;;;;AAqCA,MAAa,qCAAqC;AAClD,MAAa,mCAAmC;;;AAIhD,MAAa,uBAAuB,eAA4C;CAC/E,cAAc,GAAG,UAAU,GAAG;CAC9B,YAAY,GAAG,UAAU,GAAG;CAC5B;AAsCD,MAAM,WAAW,UAChB,IAAI,OAAO,MAAM,MAAM,MAAM,CAAC,IAAI,GAAG,IAAI,EAA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Y,EAAE,QAAQ,GAAG,EAAE;GAC1C,CAAC;GACD;CAEH,MAAM,QACL,cACA,SACA,WAEA,OAAO,IAAI,aAAa;AAEvB,SAAO,WAAW;GACjB,UAAA;GACA,KAAA,OAHkB,WAAW,MAAM;GAInC,IAAI,KAAK,KAAK;GACd,MAAM;GACN;GACA;GACA,GAAI,WAAW,KAAA,IAAY,EAAE,QAAQ,GAAG,EAAE;GAC1C,CAAC;GACD;AAEH,QAAO;EAAE;EAAU;EAAc;EAAK;EAAM;EAC3C"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { parseJsonText } from "../../runtime-decode.mjs";
|
|
2
|
+
import { acquireStackLock } from "../stack-lock.mjs";
|
|
3
|
+
import { runtimeControlLockPathForChannelFile } from "./runtime-control-lock.mjs";
|
|
4
|
+
import { Data, Effect, Stream } from "effect";
|
|
5
|
+
import { appendFileSync, closeSync, existsSync, mkdirSync, openSync, readSync, statSync, writeFileSync } from "node:fs";
|
|
6
|
+
import { dirname } from "node:path";
|
|
7
|
+
//#region src/substrate/runtime/cross-process/command-channel/file-channel.ts
|
|
8
|
+
/** Tagged failure for any I/O error during append. */
|
|
9
|
+
var CommandChannelIoError = class extends Data.TaggedError("CommandChannelIoError") {};
|
|
10
|
+
/** Tagged failure when a tailed line cannot be decoded against the
|
|
11
|
+
* record schema. The malformed line is preserved so consumers can
|
|
12
|
+
* surface it for debugging without spamming retries. */
|
|
13
|
+
var CommandChannelDecodeError = class extends Data.TaggedError("CommandChannelDecodeError") {};
|
|
14
|
+
const withRuntimeControlLock = (path, stage, effect) => Effect.scoped(Effect.gen(function* () {
|
|
15
|
+
yield* acquireStackLock(runtimeControlLockPathForChannelFile(path)).pipe(Effect.mapError((cause) => new CommandChannelIoError({
|
|
16
|
+
path,
|
|
17
|
+
stage,
|
|
18
|
+
cause
|
|
19
|
+
})));
|
|
20
|
+
return yield* effect;
|
|
21
|
+
}));
|
|
22
|
+
/** Ensure the file exists. Idempotent. Creates parent dir if needed. */
|
|
23
|
+
const ensureFile = (path) => withRuntimeControlLock(path, "init", Effect.try({
|
|
24
|
+
try: () => {
|
|
25
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
26
|
+
if (!existsSync(path)) writeFileSync(path, "", { flag: "a" });
|
|
27
|
+
},
|
|
28
|
+
catch: (cause) => new CommandChannelIoError({
|
|
29
|
+
path,
|
|
30
|
+
stage: "init",
|
|
31
|
+
cause
|
|
32
|
+
})
|
|
33
|
+
}));
|
|
34
|
+
/** Append one record as a single NDJSON line. The trailing newline
|
|
35
|
+
* ensures the next writer's append starts a fresh record. */
|
|
36
|
+
const appendRecord = (path, record) => withRuntimeControlLock(path, "append", Effect.try({
|
|
37
|
+
try: () => {
|
|
38
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
39
|
+
appendFileSync(path, `${JSON.stringify(record)}\n`, { flag: "a" });
|
|
40
|
+
},
|
|
41
|
+
catch: (cause) => new CommandChannelIoError({
|
|
42
|
+
path,
|
|
43
|
+
stage: "append",
|
|
44
|
+
cause
|
|
45
|
+
})
|
|
46
|
+
}));
|
|
47
|
+
const decodeLine = (path, line, decode) => parseJsonText(line, {
|
|
48
|
+
source: path,
|
|
49
|
+
mkError: (issue) => new CommandChannelDecodeError({
|
|
50
|
+
path,
|
|
51
|
+
line,
|
|
52
|
+
cause: issue.cause ?? issue
|
|
53
|
+
})
|
|
54
|
+
}).pipe(Effect.flatMap((parsed) => Effect.try({
|
|
55
|
+
try: () => decode(parsed),
|
|
56
|
+
catch: (cause) => new CommandChannelDecodeError({
|
|
57
|
+
path,
|
|
58
|
+
line,
|
|
59
|
+
cause
|
|
60
|
+
})
|
|
61
|
+
})));
|
|
62
|
+
/** Read newly-appended bytes from `state.offset` to current EOF. Updates
|
|
63
|
+
* `state` in place. Returns the freshly-completed lines. A trailing
|
|
64
|
+
* partial line (no newline yet) is preserved in `state.partial` and
|
|
65
|
+
* prepended on the next poll. */
|
|
66
|
+
const drainNewLines = (path, state) => Effect.try({
|
|
67
|
+
try: () => {
|
|
68
|
+
if (!existsSync(path)) return [];
|
|
69
|
+
const stat = statSync(path);
|
|
70
|
+
if (stat.size <= state.offset) return [];
|
|
71
|
+
const grow = stat.size - state.offset;
|
|
72
|
+
const fd = openSync(path, "r");
|
|
73
|
+
try {
|
|
74
|
+
const buf = Buffer.alloc(grow);
|
|
75
|
+
readSync(fd, buf, 0, grow, state.offset);
|
|
76
|
+
state.offset = stat.size;
|
|
77
|
+
const parts = (state.partial + buf.toString("utf8")).split("\n");
|
|
78
|
+
state.partial = parts.pop() ?? "";
|
|
79
|
+
return parts.filter((l) => l.length > 0);
|
|
80
|
+
} finally {
|
|
81
|
+
closeSync(fd);
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
catch: (cause) => new CommandChannelIoError({
|
|
85
|
+
path,
|
|
86
|
+
stage: "read",
|
|
87
|
+
cause
|
|
88
|
+
})
|
|
89
|
+
});
|
|
90
|
+
/** Tail a file as a Stream of decoded records. The Stream is bound to
|
|
91
|
+
* the surrounding Scope: when the Scope closes, polling stops.
|
|
92
|
+
*
|
|
93
|
+
* - `fromOffset === 'current'` skips existing content; starts at EOF.
|
|
94
|
+
* - `fromOffset === 'start'` replays every existing record then tails.
|
|
95
|
+
* - `fromOffset === number` resumes from a known byte offset.
|
|
96
|
+
*
|
|
97
|
+
* Decode errors are surfaced as Stream failures with the offending
|
|
98
|
+
* line attached so the consumer can pick a retry / skip policy.
|
|
99
|
+
*
|
|
100
|
+
* The poll loop uses `Effect.sleep` between iterations, so cooperative
|
|
101
|
+
* scheduling is preserved (no busy loop).
|
|
102
|
+
*/
|
|
103
|
+
const tailRecords = (path, decode, options = {}) => Stream.unwrap(Effect.gen(function* () {
|
|
104
|
+
const pollMillis = options.pollMillis ?? 50;
|
|
105
|
+
yield* ensureFile(path);
|
|
106
|
+
const state = {
|
|
107
|
+
offset: yield* Effect.try({
|
|
108
|
+
try: () => {
|
|
109
|
+
if (options.fromOffset === "start" || options.fromOffset === void 0) return 0;
|
|
110
|
+
if (options.fromOffset === "current") return existsSync(path) ? statSync(path).size : 0;
|
|
111
|
+
return options.fromOffset;
|
|
112
|
+
},
|
|
113
|
+
catch: (cause) => new CommandChannelIoError({
|
|
114
|
+
path,
|
|
115
|
+
stage: "stat",
|
|
116
|
+
cause
|
|
117
|
+
})
|
|
118
|
+
}),
|
|
119
|
+
partial: ""
|
|
120
|
+
};
|
|
121
|
+
const pollOne = Effect.gen(function* () {
|
|
122
|
+
const lines = yield* drainNewLines(path, state);
|
|
123
|
+
if (lines.length === 0) {
|
|
124
|
+
yield* Effect.sleep(`${pollMillis} millis`);
|
|
125
|
+
return [];
|
|
126
|
+
}
|
|
127
|
+
const decoded = [];
|
|
128
|
+
for (const line of lines) decoded.push(yield* decodeLine(path, line, decode));
|
|
129
|
+
return decoded;
|
|
130
|
+
});
|
|
131
|
+
return Stream.fromEffectRepeat(pollOne).pipe(Stream.flatMap((records) => Stream.fromIterable(records)));
|
|
132
|
+
}));
|
|
133
|
+
//#endregion
|
|
134
|
+
export { appendRecord, ensureFile, tailRecords };
|
|
135
|
+
|
|
136
|
+
//# sourceMappingURL=file-channel.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-channel.mjs","names":[],"sources":["../../../../../src/substrate/runtime/cross-process/command-channel/file-channel.ts"],"sourcesContent":["// Append-only NDJSON channel.\n//\n// One-record-per-line, atomic append via `fs.appendFileSync` with\n// `flag: 'a'` (POSIX guarantees the write is atomic for buffers under\n// PIPE_BUF; one JSON line is comfortably under that on every platform\n// we run). The tail-reader polls via offset bookkeeping — `fs.watch`\n// is unreliable across platforms for \"file grew\" notifications\n// (especially over NFS, which the cross-process protocol must remain\n// safe on per architecture § Cross-process safety protocol).\n//\n// Records are framed by a literal newline. A partial trailing line\n// (writer mid-flight when reader observed) is buffered until the next\n// poll iteration completes the line.\n\nimport {\n\tappendFileSync,\n\tcloseSync,\n\texistsSync,\n\tmkdirSync,\n\topenSync,\n\treadSync,\n\tstatSync,\n\twriteFileSync,\n} from 'node:fs';\nimport { dirname } from 'node:path';\n\nimport { Data, Effect, Scope, Stream } from 'effect';\n\nimport { parseJsonText } from '../../runtime-decode.ts';\nimport { acquireStackLock } from '../stack-lock.ts';\nimport { runtimeControlLockPathForChannelFile } from './runtime-control-lock.ts';\n\n/** Tagged failure for any I/O error during append. */\nexport class CommandChannelIoError extends Data.TaggedError('CommandChannelIoError')<{\n\treadonly path: string;\n\treadonly stage: 'append' | 'open' | 'read' | 'stat' | 'init';\n\treadonly cause: unknown;\n}> {}\n\n/** Tagged failure when a tailed line cannot be decoded against the\n * record schema. The malformed line is preserved so consumers can\n * surface it for debugging without spamming retries. */\nexport class CommandChannelDecodeError extends Data.TaggedError('CommandChannelDecodeError')<{\n\treadonly path: string;\n\treadonly line: string;\n\treadonly cause: unknown;\n}> {}\n\nexport type CommandChannelError = CommandChannelIoError | CommandChannelDecodeError;\n\n/** Default tail poll interval. Chosen to be small enough for\n * interactive CLI responsiveness (a `down` ack returns within ~50ms)\n * while staying out of the way of process schedulers. */\nexport const DEFAULT_TAIL_POLL_MILLIS = 50;\n\nconst withRuntimeControlLock = <A>(\n\tpath: string,\n\tstage: CommandChannelIoError['stage'],\n\teffect: Effect.Effect<A, CommandChannelIoError>,\n): Effect.Effect<A, CommandChannelIoError> =>\n\tEffect.scoped(\n\t\tEffect.gen(function* () {\n\t\t\tyield* acquireStackLock(runtimeControlLockPathForChannelFile(path)).pipe(\n\t\t\t\tEffect.mapError((cause) => new CommandChannelIoError({ path, stage, cause })),\n\t\t\t);\n\t\t\treturn yield* effect;\n\t\t}),\n\t);\n\n/** Ensure the file exists. Idempotent. Creates parent dir if needed. */\nexport const ensureFile = (path: string): Effect.Effect<void, CommandChannelIoError> =>\n\twithRuntimeControlLock(\n\t\tpath,\n\t\t'init',\n\t\tEffect.try({\n\t\t\ttry: () => {\n\t\t\t\tmkdirSync(dirname(path), { recursive: true });\n\t\t\t\tif (!existsSync(path)) {\n\t\t\t\t\twriteFileSync(path, '', { flag: 'a' });\n\t\t\t\t}\n\t\t\t},\n\t\t\tcatch: (cause) => new CommandChannelIoError({ path, stage: 'init', cause }),\n\t\t}),\n\t);\n\n/** Append one record as a single NDJSON line. The trailing newline\n * ensures the next writer's append starts a fresh record. */\nexport const appendRecord = (\n\tpath: string,\n\trecord: unknown,\n): Effect.Effect<void, CommandChannelIoError> =>\n\twithRuntimeControlLock(\n\t\tpath,\n\t\t'append',\n\t\tEffect.try({\n\t\t\ttry: () => {\n\t\t\t\tmkdirSync(dirname(path), { recursive: true });\n\t\t\t\tappendFileSync(path, `${JSON.stringify(record)}\\n`, { flag: 'a' });\n\t\t\t},\n\t\t\tcatch: (cause) => new CommandChannelIoError({ path, stage: 'append', cause }),\n\t\t}),\n\t);\n\n/** A line decoder. The channel I/O layer stays schema-agnostic so\n * callers can pick their own wire schema without this generic\n * carrying a `Schema.Decoder<unknown>` constraint. */\nexport type LineDecoder<A> = (raw: unknown) => A;\n\nconst decodeLine = <A>(\n\tpath: string,\n\tline: string,\n\tdecode: LineDecoder<A>,\n): Effect.Effect<A, CommandChannelDecodeError> =>\n\tparseJsonText(line, {\n\t\tsource: path,\n\t\tmkError: (issue) => new CommandChannelDecodeError({ path, line, cause: issue.cause ?? issue }),\n\t}).pipe(\n\t\tEffect.flatMap((parsed) =>\n\t\t\tEffect.try({\n\t\t\t\ttry: () => decode(parsed),\n\t\t\t\tcatch: (cause) => new CommandChannelDecodeError({ path, line, cause }),\n\t\t\t}),\n\t\t),\n\t);\n\n/** Read the entire current contents into structured records. Useful at\n * startup to backfill state, and as a test seam. */\nexport const readAllRecords = <A>(\n\tpath: string,\n\tdecode: LineDecoder<A>,\n): Effect.Effect<ReadonlyArray<A>, CommandChannelError> =>\n\tEffect.gen(function* () {\n\t\tif (!existsSync(path)) return [];\n\t\tconst raw = yield* Effect.try({\n\t\t\ttry: () => {\n\t\t\t\tconst fd = openSync(path, 'r');\n\t\t\t\ttry {\n\t\t\t\t\tconst { size } = statSync(path);\n\t\t\t\t\tconst buf = Buffer.alloc(size);\n\t\t\t\t\treadSync(fd, buf, 0, size, 0);\n\t\t\t\t\treturn buf.toString('utf8');\n\t\t\t\t} finally {\n\t\t\t\t\tcloseSync(fd);\n\t\t\t\t}\n\t\t\t},\n\t\t\tcatch: (cause) => new CommandChannelIoError({ path, stage: 'read', cause }),\n\t\t});\n\t\tconst lines = raw.split('\\n').filter((l) => l.length > 0);\n\t\tconst out: A[] = [];\n\t\tfor (const line of lines) {\n\t\t\tout.push(yield* decodeLine(path, line, decode));\n\t\t}\n\t\treturn out;\n\t});\n\ninterface TailState {\n\toffset: number;\n\tpartial: string;\n}\n\n/** Read newly-appended bytes from `state.offset` to current EOF. Updates\n * `state` in place. Returns the freshly-completed lines. A trailing\n * partial line (no newline yet) is preserved in `state.partial` and\n * prepended on the next poll. */\nconst drainNewLines = (\n\tpath: string,\n\tstate: TailState,\n): Effect.Effect<ReadonlyArray<string>, CommandChannelIoError> =>\n\tEffect.try({\n\t\ttry: () => {\n\t\t\tif (!existsSync(path)) return [];\n\t\t\tconst stat = statSync(path);\n\t\t\tif (stat.size <= state.offset) return [];\n\t\t\tconst grow = stat.size - state.offset;\n\t\t\tconst fd = openSync(path, 'r');\n\t\t\ttry {\n\t\t\t\tconst buf = Buffer.alloc(grow);\n\t\t\t\treadSync(fd, buf, 0, grow, state.offset);\n\t\t\t\tstate.offset = stat.size;\n\t\t\t\tconst chunk = state.partial + buf.toString('utf8');\n\t\t\t\tconst parts = chunk.split('\\n');\n\t\t\t\tstate.partial = parts.pop() ?? '';\n\t\t\t\treturn parts.filter((l) => l.length > 0);\n\t\t\t} finally {\n\t\t\t\tcloseSync(fd);\n\t\t\t}\n\t\t},\n\t\tcatch: (cause) => new CommandChannelIoError({ path, stage: 'read', cause }),\n\t});\n\n/** Tail a file as a Stream of decoded records. The Stream is bound to\n * the surrounding Scope: when the Scope closes, polling stops.\n *\n * - `fromOffset === 'current'` skips existing content; starts at EOF.\n * - `fromOffset === 'start'` replays every existing record then tails.\n * - `fromOffset === number` resumes from a known byte offset.\n *\n * Decode errors are surfaced as Stream failures with the offending\n * line attached so the consumer can pick a retry / skip policy.\n *\n * The poll loop uses `Effect.sleep` between iterations, so cooperative\n * scheduling is preserved (no busy loop).\n */\nexport const tailRecords = <A>(\n\tpath: string,\n\tdecode: LineDecoder<A>,\n\toptions: {\n\t\treadonly fromOffset?: 'start' | 'current' | number;\n\t\treadonly pollMillis?: number;\n\t} = {},\n): Stream.Stream<A, CommandChannelError, Scope.Scope> =>\n\tStream.unwrap(\n\t\tEffect.gen(function* () {\n\t\t\tconst pollMillis = options.pollMillis ?? DEFAULT_TAIL_POLL_MILLIS;\n\t\t\tyield* ensureFile(path);\n\t\t\tconst initialOffset = yield* Effect.try({\n\t\t\t\ttry: () => {\n\t\t\t\t\tif (options.fromOffset === 'start' || options.fromOffset === undefined) {\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t\tif (options.fromOffset === 'current') {\n\t\t\t\t\t\treturn existsSync(path) ? statSync(path).size : 0;\n\t\t\t\t\t}\n\t\t\t\t\treturn options.fromOffset;\n\t\t\t\t},\n\t\t\t\tcatch: (cause) => new CommandChannelIoError({ path, stage: 'stat', cause }),\n\t\t\t});\n\t\t\tconst state: TailState = { offset: initialOffset, partial: '' };\n\t\t\tconst pollOne: Effect.Effect<ReadonlyArray<A>, CommandChannelError> = Effect.gen(\n\t\t\t\tfunction* () {\n\t\t\t\t\tconst lines = yield* drainNewLines(path, state);\n\t\t\t\t\tif (lines.length === 0) {\n\t\t\t\t\t\tyield* Effect.sleep(`${pollMillis} millis`);\n\t\t\t\t\t\treturn [] as ReadonlyArray<A>;\n\t\t\t\t\t}\n\t\t\t\t\tconst decoded: A[] = [];\n\t\t\t\t\tfor (const line of lines) {\n\t\t\t\t\t\tdecoded.push(yield* decodeLine(path, line, decode));\n\t\t\t\t\t}\n\t\t\t\t\treturn decoded as ReadonlyArray<A>;\n\t\t\t\t},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,SAAS;EAAI;CAC/D,MAAM,UAAgE,OAAO,IAC5E,aAAa;EACZ,MAAM,QAAQ,OAAO,cAAc,MAAM,MAAM;AAC/C,MAAI,MAAM,WAAW,GAAG;AACvB,UAAO,OAAO,MAAM,GAAG,WAAW,SAAS;AAC3C,UAAO,EAAE;;EAEV,MAAM,UAAe,EAAE;AACvB,OAAK,MAAM,QAAQ,MAClB,SAAQ,KAAK,OAAO,WAAW,MAAM,MAAM,OAAO,CAAC;AAEpD,SAAO;GAER;AACD,QAAO,OAAO,iBAAiB,QAAQ,CAAC,KACvC,OAAO,SAAS,YAAY,OAAO,aAAa,QAAQ,CAAC,CACzD;EACA,CACF"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
/** Per-record envelope written to `commands.ndjson`. */
|
|
3
|
+
const CommandRecordSchema = Schema.Struct({
|
|
4
|
+
protocol: Schema.Literal(1),
|
|
5
|
+
seq: Schema.Number,
|
|
6
|
+
id: Schema.String,
|
|
7
|
+
at: Schema.Number,
|
|
8
|
+
publisherPid: Schema.Number,
|
|
9
|
+
publisherHostname: Schema.String,
|
|
10
|
+
command: Schema.Unknown
|
|
11
|
+
});
|
|
12
|
+
/** Per-record envelope written to `events.ndjson`. The supervisor emits
|
|
13
|
+
* one record per `EngineEvent` plus synthetic `ack` / `error`
|
|
14
|
+
* responses when the inner handler reports completion or failure for a
|
|
15
|
+
* correlatable command.
|
|
16
|
+
*
|
|
17
|
+
* `correlatesTo` carries the originating `CommandRecord.id` for `ack`
|
|
18
|
+
* / `error`. Other event kinds (engine events) carry `null`.
|
|
19
|
+
*/
|
|
20
|
+
const EventRecordSchema = Schema.Union([
|
|
21
|
+
Schema.Struct({
|
|
22
|
+
protocol: Schema.Literal(1),
|
|
23
|
+
seq: Schema.Number,
|
|
24
|
+
at: Schema.Number,
|
|
25
|
+
kind: Schema.Literal("engine"),
|
|
26
|
+
event: Schema.Unknown
|
|
27
|
+
}),
|
|
28
|
+
Schema.Struct({
|
|
29
|
+
protocol: Schema.Literal(1),
|
|
30
|
+
seq: Schema.Number,
|
|
31
|
+
at: Schema.Number,
|
|
32
|
+
kind: Schema.Literal("ack"),
|
|
33
|
+
correlatesTo: Schema.String,
|
|
34
|
+
detail: Schema.optional(Schema.String)
|
|
35
|
+
}),
|
|
36
|
+
Schema.Struct({
|
|
37
|
+
protocol: Schema.Literal(1),
|
|
38
|
+
seq: Schema.Number,
|
|
39
|
+
at: Schema.Number,
|
|
40
|
+
kind: Schema.Literal("error"),
|
|
41
|
+
correlatesTo: Schema.String,
|
|
42
|
+
message: Schema.String,
|
|
43
|
+
detail: Schema.optional(Schema.String)
|
|
44
|
+
})
|
|
45
|
+
]);
|
|
46
|
+
//#endregion
|
|
47
|
+
export { CommandRecordSchema, EventRecordSchema };
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=protocol.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.mjs","names":[],"sources":["../../../../../src/substrate/runtime/cross-process/command-channel/protocol.ts"],"sourcesContent":["// Cross-process command channel — wire protocol.\n//\n// Architecture § Cross-process safety protocol § Command channel:\n// The CLI / TUI / programmable API publish typed commands to a\n// running supervisor; the supervisor publishes typed events back. The\n// channel is filesystem-backed (append-only NDJSON) so a peer\n// process can attach without IPC handshakes.\n//\n// Two files live under `<stackRoot>/`:\n// - `commands.ndjson` — caller appends; supervisor tails.\n// - `events.ndjson` — supervisor appends; callers tail.\n//\n// Each record is one JSON object per line, schema-versioned for forward\n// compatibility. Records carry a monotonically increasing sequence\n// number (per file) plus a per-record id that the publisher uses to\n// correlate event replies (e.g. `down` publishes a command, then waits\n// for an `event` carrying `correlatesTo: <same id>`).\n//\n// `EngineCommand` / `EngineEvent` payloads are NOT re-decoded on the\n// wire: the publisher API accepts typed commands, and both payload\n// kinds round-trip faithfully through JSON (closed string-tag-\n// discriminated unions with JSON-safe payloads). The channel validates\n// the envelope (`protocol`, `seq`, `id`, `correlatesTo`) and treats\n// the inner payload as `Schema.Unknown`. A future hardening pass can\n// promote the inner payloads to typed schemas without changing this\n// file's contract.\n\nimport { Schema } from 'effect';\n\n/** Protocol version. Bump on incompatible record-shape changes. */\nexport const COMMAND_CHANNEL_PROTOCOL_VERSION = 1 as const;\n\n/** Per-record envelope written to `commands.ndjson`. */\nexport const CommandRecordSchema = Schema.Struct({\n\tprotocol: Schema.Literal(COMMAND_CHANNEL_PROTOCOL_VERSION),\n\tseq: Schema.Number,\n\tid: Schema.String,\n\tat: Schema.Number,\n\tpublisherPid: Schema.Number,\n\tpublisherHostname: Schema.String,\n\tcommand: Schema.Unknown,\n});\n\nexport type CommandRecord = Schema.Schema.Type<typeof CommandRecordSchema>;\n\n/** Per-record envelope written to `events.ndjson`. The supervisor emits\n * one record per `EngineEvent` plus synthetic `ack` / `error`\n * responses when the inner handler reports completion or failure for a\n * correlatable command.\n *\n * `correlatesTo` carries the originating `CommandRecord.id` for `ack`\n * / `error`. Other event kinds (engine events) carry `null`.\n */\nexport const EventRecordSchema = Schema.Union([\n\tSchema.Struct({\n\t\tprotocol: Schema.Literal(COMMAND_CHANNEL_PROTOCOL_VERSION),\n\t\tseq: Schema.Number,\n\t\tat: Schema.Number,\n\t\tkind: Schema.Literal('engine'),\n\t\tevent: Schema.Unknown,\n\t}),\n\tSchema.Struct({\n\t\tprotocol: Schema.Literal(COMMAND_CHANNEL_PROTOCOL_VERSION),\n\t\tseq: Schema.Number,\n\t\tat: Schema.Number,\n\t\tkind: Schema.Literal('ack'),\n\t\tcorrelatesTo: Schema.String,\n\t\tdetail: Schema.optional(Schema.String),\n\t}),\n\tSchema.Struct({\n\t\tprotocol: Schema.Literal(COMMAND_CHANNEL_PROTOCOL_VERSION),\n\t\tseq: Schema.Number,\n\t\tat: Schema.Number,\n\t\tkind: Schema.Literal('error'),\n\t\tcorrelatesTo: Schema.String,\n\t\tmessage: Schema.String,\n\t\tdetail: Schema.optional(Schema.String),\n\t}),\n]);\n\nexport type EventRecord = Schema.Schema.Type<typeof EventRecordSchema>;\n"],"mappings":";;AAiCA,MAAa,sBAAsB,OAAO,OAAO;CAChD,UAAU,OAAO,QAAA,EAAyC;CAC1D,KAAK,OAAO;CACZ,IAAI,OAAO;CACX,IAAI,OAAO;CACX,cAAc,OAAO;CACrB,mBAAmB,OAAO;CAC1B,SAAS,OAAO;CAChB,CAAC;;;;;;;;;AAYF,MAAa,oBAAoB,OAAO,MAAM;CAC7C,OAAO,OAAO;EACb,UAAU,OAAO,QAAA,EAAyC;EAC1D,KAAK,OAAO;EACZ,IAAI,OAAO;EACX,MAAM,OAAO,QAAQ,SAAS;EAC9B,OAAO,OAAO;EACd,CAAC;CACF,OAAO,OAAO;EACb,UAAU,OAAO,QAAA,EAAyC;EAC1D,KAAK,OAAO;EACZ,IAAI,OAAO;EACX,MAAM,OAAO,QAAQ,MAAM;EAC3B,cAAc,OAAO;EACrB,QAAQ,OAAO,SAAS,OAAO,OAAO;EACtC,CAAC;CACF,OAAO,OAAO;EACb,UAAU,OAAO,QAAA,EAAyC;EAC1D,KAAK,OAAO;EACZ,IAAI,OAAO;EACX,MAAM,OAAO,QAAQ,QAAQ;EAC7B,cAAc,OAAO;EACrB,SAAS,OAAO;EAChB,QAAQ,OAAO,SAAS,OAAO,OAAO;EACtC,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { dirname } from "node:path";
|
|
2
|
+
//#region src/substrate/runtime/cross-process/command-channel/runtime-control-lock.ts
|
|
3
|
+
const RUNTIME_CONTROL_LOCK_FILE_SUFFIX = ".runtime-control.lock";
|
|
4
|
+
const runtimeControlLockPathForStackRoot = (stackRoot) => `${stackRoot}${RUNTIME_CONTROL_LOCK_FILE_SUFFIX}`;
|
|
5
|
+
const runtimeControlLockPathForChannelFile = (path) => runtimeControlLockPathForStackRoot(dirname(path));
|
|
6
|
+
//#endregion
|
|
7
|
+
export { runtimeControlLockPathForChannelFile, runtimeControlLockPathForStackRoot };
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=runtime-control-lock.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-control-lock.mjs","names":[],"sources":["../../../../../src/substrate/runtime/cross-process/command-channel/runtime-control-lock.ts"],"sourcesContent":["import { dirname } from 'node:path';\n\nexport const RUNTIME_CONTROL_LOCK_FILE_SUFFIX = '.runtime-control.lock';\n\nexport const runtimeControlLockPathForStackRoot = (stackRoot: string): string =>\n\t`${stackRoot}${RUNTIME_CONTROL_LOCK_FILE_SUFFIX}`;\n\nexport const runtimeControlLockPathForChannelFile = (path: string): string =>\n\truntimeControlLockPathForStackRoot(dirname(path));\n"],"mappings":";;AAEA,MAAa,mCAAmC;AAEhD,MAAa,sCAAsC,cAClD,GAAG,YAAY;AAEhB,MAAa,wCAAwC,SACpD,mCAAmC,QAAQ,KAAK,CAAC"}
|