@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 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/substrate/runtime/stage-and-swap/index.ts"],"sourcesContent":["// Atomic stage-and-swap primitive.\n//\n// Architecture §\"Stage-and-swap rollback discipline is precious and\n// well-tested\": one tempdir, one rename for the whole publish.\n// Lifted to substrate so both snapshot AND codegen (per-cycle outer\n// swap) can consume — see ARCHITECTURE.md substrate roster + style\n// guide §19 (Open slot O14 closes with this lift).\n//\n// Contract:\n// 1. The caller provides a `targetPath` (the directory to publish).\n// 2. The orchestrator runs the build effect with a `stagingPath`\n// (a sibling under the same parent so the rename stays on the\n// same filesystem — POSIX rename atomicity is per-filesystem).\n// 3. If the build effect succeeds AND the rename succeeds, the\n// target now points at the new tree; external watchers never\n// observed a half-written intermediate.\n// 4. Optional `preserveFromTarget` paths are copied from the backed-up\n// target into staging immediately before publish.\n// 5. On any failure the staging directory is removed; the previous\n// target (if any) is restored verbatim from a same-parent\n// backup.\n// 6. Cross-filesystem fallback (`EXDEV` from rename) logs and falls\n// back to copy-then-rm — the architecture's documented exception.\n//\n// Discipline carried verbatim from the legacy `engine/snapshot/stage-\n// and-swap.ts` (distilled §17).\n\nimport { dirname, isAbsolute, join, normalize, sep } from 'node:path';\n\nimport { Effect, FileSystem, Schema } from 'effect';\n\nimport { acquireStackLock } from '../cross-process/stack-lock.ts';\nimport { SpanAttr } from '../observability/spans.ts';\n\n// -----------------------------------------------------------------------------\n// Errors\n// -----------------------------------------------------------------------------\n\n/** Tagged failure during a stage-and-swap step. `stage` discriminates\n * the precise failing step; the caller's underlying tag is preserved\n * via `cause` (the primitive does NOT wrap the user's error). */\nexport class StageAndSwapError extends Schema.TaggedErrorClass<StageAndSwapError>()(\n\t'StageAndSwapError',\n\t{\n\t\tstage: Schema.Literals([\n\t\t\t'mkdir-staging',\n\t\t\t'mkdir-backup',\n\t\t\t'build',\n\t\t\t'acquire-publish-lock',\n\t\t\t'backup-current',\n\t\t\t'preserve-target-paths',\n\t\t\t'rename-into-target',\n\t\t\t'restore-backup',\n\t\t\t'cleanup-staging',\n\t\t\t'cross-filesystem-fallback',\n\t\t]),\n\t\ttargetPath: Schema.String,\n\t\tstagingPath: Schema.String,\n\t\tcause: Schema.optional(Schema.Defect),\n\t},\n) {}\n\n// -----------------------------------------------------------------------------\n// Primitive\n// -----------------------------------------------------------------------------\n\nexport interface StageAndSwapPreservedPath {\n\treadonly relativePath: string;\n\treadonly kind: 'file' | 'directory';\n}\n\nconst failStage =\n\t<S extends StageAndSwapError['stage']>(\n\t\tstage: S,\n\t\ttargetPath: string,\n\t\tstagingPath: string,\n\t): ((cause: unknown) => Effect.Effect<never, StageAndSwapError>) =>\n\t(cause) =>\n\t\tEffect.fail(new StageAndSwapError({ stage, targetPath, stagingPath, cause }));\n\nconst normalizePreservedRelativePath = (relativePath: string): string | null => {\n\tconst normalized = normalize(relativePath);\n\tif (\n\t\trelativePath.length === 0 ||\n\t\tisAbsolute(relativePath) ||\n\t\tnormalized === '.' ||\n\t\tnormalized === '..' ||\n\t\tnormalized.startsWith(`..${sep}`)\n\t) {\n\t\treturn null;\n\t}\n\treturn normalized;\n};\n\nconst preserveTargetPaths = (args: {\n\treadonly backupPath: string;\n\treadonly targetPath: string;\n\treadonly stagingPath: string;\n\treadonly preservedPaths: ReadonlyArray<StageAndSwapPreservedPath>;\n}): Effect.Effect<void, StageAndSwapError, FileSystem.FileSystem> =>\n\tEffect.gen(function* () {\n\t\tconst fs = yield* FileSystem.FileSystem;\n\t\tfor (const preserved of args.preservedPaths) {\n\t\t\tconst relativePath = normalizePreservedRelativePath(preserved.relativePath);\n\t\t\tif (relativePath === null) {\n\t\t\t\treturn yield* failStage(\n\t\t\t\t\t'preserve-target-paths',\n\t\t\t\t\targs.targetPath,\n\t\t\t\t\targs.stagingPath,\n\t\t\t\t)(new Error(`unsafe preserved path: ${preserved.relativePath}`));\n\t\t\t}\n\t\t\tconst source = join(args.backupPath, relativePath);\n\t\t\tconst exists = yield* fs.exists(source).pipe(Effect.catch(() => Effect.succeed(false)));\n\t\t\tif (!exists) continue;\n\t\t\tconst target = join(args.stagingPath, relativePath);\n\t\t\tyield* fs\n\t\t\t\t.makeDirectory(dirname(target), { recursive: true })\n\t\t\t\t.pipe(Effect.catch(failStage('preserve-target-paths', args.targetPath, args.stagingPath)));\n\t\t\tyield* fs\n\t\t\t\t.copy(source, target, { overwrite: true })\n\t\t\t\t.pipe(Effect.catch(failStage('preserve-target-paths', args.targetPath, args.stagingPath)));\n\t\t}\n\t});\n\n/**\n * Build-then-swap. `build` is a user effect that populates `stagingPath`;\n * on success the helper:\n *\n * - backs up the current `targetPath` (if any) to `<targetPath>.bak.<pid>`,\n * - copies any selected `preserveFromTarget` paths from that backup\n * into staging,\n * - renames `stagingPath` → `targetPath`,\n * - removes the backup.\n *\n * On any failure the helper removes `stagingPath` and, if the backup\n * was taken, renames it back to `targetPath` so the world looks\n * exactly as it did at entry.\n *\n * The build effect's error type passes through unchanged — the\n * primitive returns `E | StageAndSwapError`. This is the\n * \"preserve the caller's error tag\" rule from distilled §17.\n *\n * IMPORTANT: stagingPath MUST be on the same filesystem as\n * targetPath. The helper picks it as a sibling under the same parent\n * (caller passes `parentDir`, we mint the names) — this is enforced\n * by the helper's signature shape.\n */\nexport const stageAndSwap = <A, E>(args: {\n\treadonly targetPath: string;\n\treadonly stagingPath: string;\n\treadonly backupPath: string;\n\treadonly build: Effect.Effect<A, E, FileSystem.FileSystem>;\n\treadonly preserveFromTarget?: ReadonlyArray<StageAndSwapPreservedPath>;\n\treadonly publishLockPath?: string;\n}): Effect.Effect<A, E | StageAndSwapError, FileSystem.FileSystem> =>\n\tEffect.gen(function* () {\n\t\tconst fs = yield* FileSystem.FileSystem;\n\t\tconst {\n\t\t\ttargetPath,\n\t\t\tstagingPath,\n\t\t\tbackupPath,\n\t\t\tbuild,\n\t\t\tpreserveFromTarget = [],\n\t\t\tpublishLockPath,\n\t\t} = args;\n\t\tyield* Effect.annotateCurrentSpan({\n\t\t\t'devstack.stage-and-swap.target': targetPath,\n\t\t\t'devstack.stage-and-swap.staging': stagingPath,\n\t\t});\n\n\t\t// 0. Pre-clean the staging slot (a previous crash may have left\n\t\t// a sibling). recursive+force is idempotent.\n\t\tyield* fs.remove(stagingPath, { recursive: true, force: true }).pipe(Effect.ignore);\n\t\tyield* fs\n\t\t\t.makeDirectory(stagingPath, { recursive: true })\n\t\t\t.pipe(Effect.catch(failStage('mkdir-staging', targetPath, stagingPath)));\n\n\t\t// 1. Run the user's build inside the staging directory. On\n\t\t// failure clean up the staging dir (best-effort) BEFORE\n\t\t// re-raising — preserves the caller's error tag (no wrap).\n\t\tconst result = yield* build.pipe(\n\t\t\tEffect.onError(() =>\n\t\t\t\tfs.remove(stagingPath, { recursive: true, force: true }).pipe(Effect.ignore),\n\t\t\t),\n\t\t);\n\n\t\t// 2. Backup the current target and promote staging while holding\n\t\t// an optional caller-supplied lock. Restore uses this to block\n\t\t// command/event writers while the stack root path is absent.\n\t\tconst targetExists = yield* Effect.scoped(\n\t\t\tEffect.gen(function* () {\n\t\t\t\tif (publishLockPath !== undefined) {\n\t\t\t\t\tyield* acquireStackLock(publishLockPath).pipe(\n\t\t\t\t\t\tEffect.catch(failStage('acquire-publish-lock', targetPath, stagingPath)),\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst targetExists = yield* fs\n\t\t\t\t\t.exists(targetPath)\n\t\t\t\t\t.pipe(Effect.catch(() => Effect.succeed(false)));\n\t\t\t\tif (targetExists) {\n\t\t\t\t\t// Move current → backup (atomic rename on same filesystem).\n\t\t\t\t\tyield* fs\n\t\t\t\t\t\t.rename(targetPath, backupPath)\n\t\t\t\t\t\t.pipe(Effect.catch(failStage('backup-current', targetPath, stagingPath)));\n\t\t\t\t\tyield* preserveTargetPaths({\n\t\t\t\t\t\tbackupPath,\n\t\t\t\t\t\ttargetPath,\n\t\t\t\t\t\tstagingPath,\n\t\t\t\t\t\tpreservedPaths: preserveFromTarget,\n\t\t\t\t\t}).pipe(\n\t\t\t\t\t\tEffect.catch((error) =>\n\t\t\t\t\t\t\tEffect.gen(function* () {\n\t\t\t\t\t\t\t\tyield* fs\n\t\t\t\t\t\t\t\t\t.rename(backupPath, targetPath)\n\t\t\t\t\t\t\t\t\t.pipe(Effect.catch(failStage('restore-backup', targetPath, stagingPath)));\n\t\t\t\t\t\t\t\treturn yield* Effect.fail(error);\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// 3. Promote staging → target. This is the atomic publish step.\n\t\t\t\tyield* fs.rename(stagingPath, targetPath).pipe(\n\t\t\t\t\tEffect.catch((cause) => {\n\t\t\t\t\t\tconst code = (cause as NodeJS.ErrnoException).code;\n\t\t\t\t\t\tif (code === 'EXDEV') {\n\t\t\t\t\t\t\t// Cross-filesystem fallback — architecture's documented\n\t\t\t\t\t\t\t// exception. Log loudly; copy then rm. The atomicity\n\t\t\t\t\t\t\t// guarantee is LOST in this branch.\n\t\t\t\t\t\t\treturn Effect.gen(function* () {\n\t\t\t\t\t\t\t\tyield* Effect.logWarning('stage-and-swap cross-filesystem fallback').pipe(\n\t\t\t\t\t\t\t\t\tEffect.annotateLogs({\n\t\t\t\t\t\t\t\t\t\t[SpanAttr.stageAndSwapTargetPath]: targetPath,\n\t\t\t\t\t\t\t\t\t\t[SpanAttr.stageAndSwapStagingPath]: stagingPath,\n\t\t\t\t\t\t\t\t\t\t[SpanAttr.errorCode]: 'EXDEV',\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tyield* fs\n\t\t\t\t\t\t\t\t\t.copy(stagingPath, targetPath, { overwrite: false })\n\t\t\t\t\t\t\t\t\t.pipe(\n\t\t\t\t\t\t\t\t\t\tEffect.catch(failStage('cross-filesystem-fallback', targetPath, stagingPath)),\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tyield* fs.remove(stagingPath, { recursive: true, force: true }).pipe(Effect.ignore);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Same-filesystem rename failed. Restore backup if we took\n\t\t\t\t\t\t// one; surface the original tag.\n\t\t\t\t\t\treturn Effect.gen(function* () {\n\t\t\t\t\t\t\tif (targetExists) {\n\t\t\t\t\t\t\t\tyield* fs\n\t\t\t\t\t\t\t\t\t.rename(backupPath, targetPath)\n\t\t\t\t\t\t\t\t\t.pipe(Effect.catch(failStage('restore-backup', targetPath, stagingPath)));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn yield* failStage('rename-into-target', targetPath, stagingPath)(cause);\n\t\t\t\t\t\t});\n\t\t\t\t\t}),\n\t\t\t\t);\n\n\t\t\t\treturn targetExists;\n\t\t\t}),\n\t\t);\n\n\t\t// 4. Drop the backup. Failure here is observable but non-fatal:\n\t\t// the new target is live; an orphan backup is cosmetic.\n\t\tif (targetExists) {\n\t\t\tyield* fs.remove(backupPath, { recursive: true, force: true }).pipe(Effect.ignore);\n\t\t}\n\n\t\treturn result;\n\t}).pipe(Effect.withSpan('substrate.stage-and-swap'));\n"],"mappings":"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"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
//#region src/substrate/runtime/state-store/schema.ts
|
|
3
|
+
/** Stored value envelope. The phantom-typed `StateKey<V>` reads /
|
|
4
|
+
* writes against the `value` slot opaquely (the substrate doesn't
|
|
5
|
+
* introspect plugin values — it stores the JSON value as `unknown`
|
|
6
|
+
* and re-encodes the document on every set). */
|
|
7
|
+
const StateEntry = Schema.Struct({
|
|
8
|
+
/** Discriminator. `present` carries a value; `tombstone` records
|
|
9
|
+
* that the key was deleted (so reads can distinguish "user
|
|
10
|
+
* removed this" from "user never wrote it"). */
|
|
11
|
+
state: Schema.Literals(["present", "tombstone"]),
|
|
12
|
+
/** Encoded value. For `tombstone` entries this is `null`; the
|
|
13
|
+
* substrate refuses to deliver it on `get`. */
|
|
14
|
+
value: Schema.Unknown,
|
|
15
|
+
/** Timestamp of the last mutation. Renderers may surface it;
|
|
16
|
+
* the substrate uses it only for diagnostics. */
|
|
17
|
+
updatedAt: Schema.Number
|
|
18
|
+
});
|
|
19
|
+
/** Document — one file per stack. Keys are the `StateKey<V>` string
|
|
20
|
+
* form (`<pluginKey>/<suffix>`), values are entries. */
|
|
21
|
+
const StateDocument = Schema.Struct({
|
|
22
|
+
/** Schema version; bump on incompatible changes. v1 is the
|
|
23
|
+
* initial release; bumps are the only way to introduce
|
|
24
|
+
* backward-incompatible shape changes. Schema-decode failure on
|
|
25
|
+
* read with an unknown version surfaces as `corruption`. */
|
|
26
|
+
version: Schema.Literal(1),
|
|
27
|
+
/** Per-plugin namespaces. Key is the plugin-key prefix; nested
|
|
28
|
+
* record is the plugin's own keys (suffix → entry). Two-level
|
|
29
|
+
* structure (vs. flat `pluginKey/suffix → entry`) so `listUnder`
|
|
30
|
+
* is an O(1) lookup and per-plugin wipes are O(1) field deletes. */
|
|
31
|
+
plugins: Schema.Record(Schema.String, Schema.Record(Schema.String, StateEntry))
|
|
32
|
+
});
|
|
33
|
+
//#endregion
|
|
34
|
+
export { StateDocument };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=schema.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.mjs","names":[],"sources":["../../../../src/substrate/runtime/state-store/schema.ts"],"sourcesContent":["// On-disk schema for the per-stack state.json.\n//\n// One file per stack. Plugin-keyed top-level subtrees so two\n// plugins never see each other's keys. Tombstones distinguish\n// \"deleted\" from \"missing\" — see header of `state-store.ts`.\n\nimport { Schema } from 'effect';\n\n/** Stored value envelope. The phantom-typed `StateKey<V>` reads /\n * writes against the `value` slot opaquely (the substrate doesn't\n * introspect plugin values — it stores the JSON value as `unknown`\n * and re-encodes the document on every set). */\nexport const StateEntry = Schema.Struct({\n\t/** Discriminator. `present` carries a value; `tombstone` records\n\t * that the key was deleted (so reads can distinguish \"user\n\t * removed this\" from \"user never wrote it\"). */\n\tstate: Schema.Literals(['present', 'tombstone']),\n\t/** Encoded value. For `tombstone` entries this is `null`; the\n\t * substrate refuses to deliver it on `get`. */\n\tvalue: Schema.Unknown,\n\t/** Timestamp of the last mutation. Renderers may surface it;\n\t * the substrate uses it only for diagnostics. */\n\tupdatedAt: Schema.Number,\n});\nexport type StateEntry = typeof StateEntry.Type;\n\n/** Document — one file per stack. Keys are the `StateKey<V>` string\n * form (`<pluginKey>/<suffix>`), values are entries. */\nexport const StateDocument = Schema.Struct({\n\t/** Schema version; bump on incompatible changes. v1 is the\n\t * initial release; bumps are the only way to introduce\n\t * backward-incompatible shape changes. Schema-decode failure on\n\t * read with an unknown version surfaces as `corruption`. */\n\tversion: Schema.Literal(1),\n\t/** Per-plugin namespaces. Key is the plugin-key prefix; nested\n\t * record is the plugin's own keys (suffix → entry). Two-level\n\t * structure (vs. flat `pluginKey/suffix → entry`) so `listUnder`\n\t * is an O(1) lookup and per-plugin wipes are O(1) field deletes. */\n\tplugins: Schema.Record(Schema.String, Schema.Record(Schema.String, StateEntry)),\n});\nexport type StateDocument = typeof StateDocument.Type;\n\n/** Initial empty document. */\nexport const emptyDocument: StateDocument = { version: 1, plugins: {} };\n"],"mappings":";;;;;;AAYA,MAAa,aAAa,OAAO,OAAO;;;;CAIvC,OAAO,OAAO,SAAS,CAAC,WAAW,YAAY,CAAC;;;CAGhD,OAAO,OAAO;;;CAGd,WAAW,OAAO;CAClB,CAAC;;;AAKF,MAAa,gBAAgB,OAAO,OAAO;;;;;CAK1C,SAAS,OAAO,QAAQ,EAAE;;;;;CAK1B,SAAS,OAAO,OAAO,OAAO,QAAQ,OAAO,OAAO,OAAO,QAAQ,WAAW,CAAC;CAC/E,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { chainProbeCapabilityKey } from "../../../contracts/chain-probe.mjs";
|
|
2
|
+
import { StrategyRegistryService } from "./service.mjs";
|
|
3
|
+
import { Effect } from "effect";
|
|
4
|
+
//#region src/substrate/runtime/strategy-registry/chain-probe-for.ts
|
|
5
|
+
/**
|
|
6
|
+
* Look up the chain-probe contributed by the chain owner (Sui's
|
|
7
|
+
* `acquire` registers one per resolved chain id) and surface it with
|
|
8
|
+
* the caller's expected key shape.
|
|
9
|
+
*
|
|
10
|
+
* `Key` defaults to `unknown` so call sites that don't care about the
|
|
11
|
+
* probe key shape can omit the generic; sites that consume Sui probes
|
|
12
|
+
* pass `SuiProbeKey` explicitly. The cast from the registry's
|
|
13
|
+
* `unknown` payload to `ChainProbe<Key>` is centralised here — call
|
|
14
|
+
* sites stop repeating it.
|
|
15
|
+
*/
|
|
16
|
+
const chainProbeFor = (chain) => Effect.gen(function* () {
|
|
17
|
+
return yield* (yield* StrategyRegistryService).get(chainProbeCapabilityKey(chain));
|
|
18
|
+
});
|
|
19
|
+
//#endregion
|
|
20
|
+
export { chainProbeFor };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=chain-probe-for.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chain-probe-for.mjs","names":[],"sources":["../../../../src/substrate/runtime/strategy-registry/chain-probe-for.ts"],"sourcesContent":["// `chainProbeFor` — strategy-registry sugar for the chain-probe lookup.\n//\n// Every plugin that produces an on-chain artifact (package, coin, seal,\n// walrus, action, ...) repeats the same 4-line dance: yield the\n// StrategyRegistryService, then `registry.get<...>(chainProbeCapabilityKey(chain))`\n// with the same generic args and the same trailing cast. The dance is\n// load-bearing exactly once (the cast threads `SuiProbeKey` through the\n// capability-key's `string` discriminator) — every other site is\n// boilerplate.\n//\n// This helper consolidates the pattern: one Effect, one R-channel\n// (`StrategyRegistryService`), one typed return (`ChainProbe<Key>`).\n// Call sites become a single `yield* chainProbeFor(sui.chain)`.\n\nimport { Effect } from 'effect';\n\nimport { chainProbeCapabilityKey, type ChainProbe } from '../../../contracts/chain-probe.ts';\nimport type { StrategyNotFoundError } from '../../../contracts/strategy-contributor.ts';\nimport type { ChainId } from '../../brand.ts';\nimport { StrategyRegistryService } from './service.ts';\n\n/**\n * Look up the chain-probe contributed by the chain owner (Sui's\n * `acquire` registers one per resolved chain id) and surface it with\n * the caller's expected key shape.\n *\n * `Key` defaults to `unknown` so call sites that don't care about the\n * probe key shape can omit the generic; sites that consume Sui probes\n * pass `SuiProbeKey` explicitly. The cast from the registry's\n * `unknown` payload to `ChainProbe<Key>` is centralised here — call\n * sites stop repeating it.\n */\nexport const chainProbeFor = <Key = unknown>(\n\tchain: ChainId,\n): Effect.Effect<ChainProbe<Key>, StrategyNotFoundError, StrategyRegistryService> =>\n\tEffect.gen(function* () {\n\t\tconst registry = yield* StrategyRegistryService;\n\t\tconst probe = yield* registry.get<`chain-probe:${string}`, ChainProbe<Key>>(\n\t\t\tchainProbeCapabilityKey(chain),\n\t\t);\n\t\treturn probe;\n\t});\n"],"mappings":";;;;;;;;;;;;;;;AAgCA,MAAa,iBACZ,UAEA,OAAO,IAAI,aAAa;AAKvB,QAAO,QAHc,OADG,yBACM,IAC7B,wBAAwB,MAAM,CAC9B;EAEA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { StrategyRegistryService } from "./service.mjs";
|
|
2
|
+
import { Effect } from "effect";
|
|
3
|
+
//#region src/substrate/runtime/strategy-registry/faucet-capability-for.ts
|
|
4
|
+
/** Capability-key prefix for faucet-request strategies. The full key is
|
|
5
|
+
* `faucet:request:<chainId>`. Duplicated from the faucet plugin's
|
|
6
|
+
* `dispatcher.ts` so the substrate helper stays plugin-free; the two
|
|
7
|
+
* constants are checked for agreement by the migrated call sites at
|
|
8
|
+
* typecheck time (they import the helper, not the prefix). */
|
|
9
|
+
const FAUCET_CAPABILITY_KEY_PREFIX = "faucet:request";
|
|
10
|
+
const faucetCapabilityKey = (chainId) => `${FAUCET_CAPABILITY_KEY_PREFIX}:${chainId}`;
|
|
11
|
+
/**
|
|
12
|
+
* Look up the faucet strategy contributed for the given chain id and
|
|
13
|
+
* surface it with the caller's expected shape.
|
|
14
|
+
*
|
|
15
|
+
* The strategy shape `P` is a free generic — the faucet plugin owns
|
|
16
|
+
* the `FaucetStrategy` contract, callers pass it at the call site
|
|
17
|
+
* (`faucetCapabilityFor<FaucetStrategy>(chainId)`). Failure shape is
|
|
18
|
+
* the substrate `StrategyNotFoundError`; callers that want a
|
|
19
|
+
* plugin-flavored error project it via `Effect.catchTag` at the call
|
|
20
|
+
* site.
|
|
21
|
+
*/
|
|
22
|
+
const faucetCapabilityFor = (chainId) => Effect.gen(function* () {
|
|
23
|
+
const registry = yield* StrategyRegistryService;
|
|
24
|
+
const key = faucetCapabilityKey(chainId);
|
|
25
|
+
return yield* registry.get(key);
|
|
26
|
+
});
|
|
27
|
+
//#endregion
|
|
28
|
+
export { faucetCapabilityFor };
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=faucet-capability-for.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"faucet-capability-for.mjs","names":[],"sources":["../../../../src/substrate/runtime/strategy-registry/faucet-capability-for.ts"],"sourcesContent":["// `faucetCapabilityFor` — strategy-registry sugar for the faucet\n// capability lookup. Mirrors `chainProbeFor`.\n//\n// Plugins that fund addresses (account default funding, account\n// cross-cutting funding, the faucet dispatcher itself) repeat the\n// same 4-line dance: yield the StrategyRegistryService, build the\n// `faucet:request:<chainId>` key, then `registry.get<typeof key, P>(key)`\n// with the same trailing cast. Centralised here so call sites stop\n// repeating it.\n//\n// The substrate stays name-blind: the strategy shape `P` is a free\n// generic (the faucet plugin owns the `FaucetStrategy` contract;\n// callers pass it as the type argument). Returned cast threads\n// through the registry's `unknown` payload at one site only.\n\nimport { Effect } from 'effect';\n\nimport type { StrategyNotFoundError } from '../../../contracts/strategy-contributor.ts';\nimport type { ChainId } from '../../brand.ts';\nimport { StrategyRegistryService } from './service.ts';\n\n/** Capability-key prefix for faucet-request strategies. The full key is\n * `faucet:request:<chainId>`. Duplicated from the faucet plugin's\n * `dispatcher.ts` so the substrate helper stays plugin-free; the two\n * constants are checked for agreement by the migrated call sites at\n * typecheck time (they import the helper, not the prefix). */\nconst FAUCET_CAPABILITY_KEY_PREFIX = 'faucet:request' as const;\n\nconst faucetCapabilityKey = (\n\tchainId: ChainId,\n): `${typeof FAUCET_CAPABILITY_KEY_PREFIX}:${string}` =>\n\t`${FAUCET_CAPABILITY_KEY_PREFIX}:${chainId}`;\n\n/**\n * Look up the faucet strategy contributed for the given chain id and\n * surface it with the caller's expected shape.\n *\n * The strategy shape `P` is a free generic — the faucet plugin owns\n * the `FaucetStrategy` contract, callers pass it at the call site\n * (`faucetCapabilityFor<FaucetStrategy>(chainId)`). Failure shape is\n * the substrate `StrategyNotFoundError`; callers that want a\n * plugin-flavored error project it via `Effect.catchTag` at the call\n * site.\n */\nexport const faucetCapabilityFor = <P>(\n\tchainId: ChainId,\n): Effect.Effect<P, StrategyNotFoundError, StrategyRegistryService> =>\n\tEffect.gen(function* () {\n\t\tconst registry = yield* StrategyRegistryService;\n\t\tconst key = faucetCapabilityKey(chainId);\n\t\treturn yield* registry.get<typeof key, P>(key);\n\t});\n"],"mappings":";;;;;;;;AA0BA,MAAM,+BAA+B;AAErC,MAAM,uBACL,YAEA,GAAG,6BAA6B,GAAG;;;;;;;;;;;;AAapC,MAAa,uBACZ,YAEA,OAAO,IAAI,aAAa;CACvB,MAAM,WAAW,OAAO;CACxB,MAAM,MAAM,oBAAoB,QAAQ;AACxC,QAAO,OAAO,SAAS,IAAmB,IAAI;EAC7C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { Context, Layer } from "effect";
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { StrategyNotFoundError } from "../errors.mjs";
|
|
2
|
+
import { Context, Effect, Layer, Ref } from "effect";
|
|
3
|
+
//#region src/substrate/runtime/strategy-registry/service.ts
|
|
4
|
+
var StrategyRegistryService = class extends Context.Service()("@devstack-rewrite/substrate/StrategyRegistry") {};
|
|
5
|
+
/**
|
|
6
|
+
* Layer. Constructed per-scope; the orchestrator hands the registry
|
|
7
|
+
* to each plugin's acquire so contributions land on the right
|
|
8
|
+
* stack's registry, not a global one.
|
|
9
|
+
*/
|
|
10
|
+
const layerStrategyRegistry = Layer.effect(StrategyRegistryService, Effect.gen(function* () {
|
|
11
|
+
const state = yield* Ref.make(/* @__PURE__ */ new Map());
|
|
12
|
+
const seqRef = yield* Ref.make(0);
|
|
13
|
+
const register = (key, strategy, options) => Effect.gen(function* () {
|
|
14
|
+
const seq = yield* Ref.updateAndGet(seqRef, (n) => n + 1);
|
|
15
|
+
const entry = {
|
|
16
|
+
strategy,
|
|
17
|
+
autoMounted: options?.autoMounted ?? false,
|
|
18
|
+
priority: options?.priority ?? 0,
|
|
19
|
+
seq
|
|
20
|
+
};
|
|
21
|
+
yield* Ref.update(state, (current) => {
|
|
22
|
+
const existing = current.get(key) ?? [];
|
|
23
|
+
const next = new Map(current);
|
|
24
|
+
next.set(key, [...existing, entry]);
|
|
25
|
+
return next;
|
|
26
|
+
});
|
|
27
|
+
yield* Effect.addFinalizer((_exit) => Ref.update(state, (current) => {
|
|
28
|
+
const existing = current.get(key);
|
|
29
|
+
if (!existing) return current;
|
|
30
|
+
const filtered = existing.filter((e) => e.seq !== seq);
|
|
31
|
+
const next = new Map(current);
|
|
32
|
+
if (filtered.length === 0) next.delete(key);
|
|
33
|
+
else next.set(key, filtered);
|
|
34
|
+
return next;
|
|
35
|
+
}));
|
|
36
|
+
yield* Effect.annotateCurrentSpan({
|
|
37
|
+
"strategy.key": key,
|
|
38
|
+
"strategy.autoMounted": entry.autoMounted
|
|
39
|
+
});
|
|
40
|
+
}).pipe(Effect.withSpan("substrate.strategyRegistry.register"));
|
|
41
|
+
const get = (key) => Effect.gen(function* () {
|
|
42
|
+
const current = yield* Ref.get(state);
|
|
43
|
+
const entries = current.get(key);
|
|
44
|
+
if (!entries || entries.length === 0) return yield* new StrategyNotFoundError({
|
|
45
|
+
capabilityKey: key,
|
|
46
|
+
registeredKeys: [...current.keys()]
|
|
47
|
+
});
|
|
48
|
+
let best = entries[0];
|
|
49
|
+
for (let i = 1; i < entries.length; i++) {
|
|
50
|
+
const e = entries[i];
|
|
51
|
+
if (e.priority > best.priority || e.priority === best.priority && e.seq > best.seq) best = e;
|
|
52
|
+
}
|
|
53
|
+
return best.strategy;
|
|
54
|
+
}).pipe(Effect.withSpan("substrate.strategyRegistry.get", { attributes: { key } }));
|
|
55
|
+
const list = () => Effect.gen(function* () {
|
|
56
|
+
return [...(yield* Ref.get(state)).keys()];
|
|
57
|
+
});
|
|
58
|
+
return StrategyRegistryService.of({
|
|
59
|
+
get,
|
|
60
|
+
register,
|
|
61
|
+
list
|
|
62
|
+
});
|
|
63
|
+
}));
|
|
64
|
+
//#endregion
|
|
65
|
+
export { StrategyRegistryService, layerStrategyRegistry };
|
|
66
|
+
|
|
67
|
+
//# sourceMappingURL=service.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.mjs","names":[],"sources":["../../../../src/substrate/runtime/strategy-registry/service.ts"],"sourcesContent":["// Strategy registry implementation.\n//\n// Architecture § StrategyContributor — generic capability-keyed\n// pub/sub for plugin-contributed strategies (faucet strategies,\n// network resolvers, account selection, etc.).\n//\n// Per-capability-key LIST of contributing plugins (a registry can\n// hold multiple contributions for the same key). Resolution is\n// ordered by registration time; the selector chooses among them.\n//\n// Scope-local. The registry is created per-stack-scope so parallel\n// stacks isolate. When the stack scope closes, the registry's\n// entries die with it (the architecture's \"scope-local, never\n// module-level\" rule).\n\nimport { Context, Effect, Layer, Ref, Scope } from 'effect';\n\nimport type { StrategyRegistry } from '../../../contracts/strategy-contributor.ts';\nimport { StrategyNotFoundError } from '../errors.ts';\n\n/** One registered strategy under a capability key. */\ninterface Entry {\n\treadonly strategy: unknown;\n\treadonly autoMounted: boolean;\n\treadonly priority: number;\n\t/** Sequence number for stable ordering by registration time. */\n\treadonly seq: number;\n}\n\n/** Per-capability-key contributions. We keep the LIST (not the\n * single winner) because:\n * 1. Renderers want to enumerate \"N contributors registered\".\n * 2. The selector is per-strategy and may inspect all of them.\n * 3. Auto-mounted vs user-supplied is a visibility distinction\n * consumers need to surface separately. */\ntype State = ReadonlyMap<string, ReadonlyArray<Entry>>;\n\nexport class StrategyRegistryService extends Context.Service<\n\tStrategyRegistryService,\n\tStrategyRegistry\n>()('@devstack-rewrite/substrate/StrategyRegistry') {}\n\n/**\n * Layer. Constructed per-scope; the orchestrator hands the registry\n * to each plugin's acquire so contributions land on the right\n * stack's registry, not a global one.\n */\nexport const layerStrategyRegistry: Layer.Layer<StrategyRegistryService> = Layer.effect(\n\tStrategyRegistryService,\n\tEffect.gen(function* () {\n\t\tconst state = yield* Ref.make<State>(new Map());\n\t\tconst seqRef = yield* Ref.make(0);\n\n\t\tconst register: StrategyRegistry['register'] = <Key extends string, S>(\n\t\t\tkey: Key,\n\t\t\tstrategy: S,\n\t\t\toptions?: { readonly autoMounted?: boolean; readonly priority?: number },\n\t\t) =>\n\t\t\tEffect.gen(function* () {\n\t\t\t\tconst seq = yield* Ref.updateAndGet(seqRef, (n) => n + 1);\n\t\t\t\tconst entry: Entry = {\n\t\t\t\t\tstrategy,\n\t\t\t\t\tautoMounted: options?.autoMounted ?? false,\n\t\t\t\t\tpriority: options?.priority ?? 0,\n\t\t\t\t\tseq,\n\t\t\t\t};\n\t\t\t\tyield* Ref.update(state, (current) => {\n\t\t\t\t\tconst existing = current.get(key) ?? [];\n\t\t\t\t\tconst next = new Map(current);\n\t\t\t\t\tnext.set(key, [...existing, entry]);\n\t\t\t\t\treturn next;\n\t\t\t\t});\n\t\t\t\t// Scope finalizer: drop this entry on scope close.\n\t\t\t\t// Sequence-number match makes parallel registrations\n\t\t\t\t// safe — we only drop the entry we added.\n\t\t\t\tyield* Effect.addFinalizer((_exit) =>\n\t\t\t\t\tRef.update(state, (current) => {\n\t\t\t\t\t\tconst existing = current.get(key);\n\t\t\t\t\t\tif (!existing) return current;\n\t\t\t\t\t\tconst filtered = existing.filter((e) => e.seq !== seq);\n\t\t\t\t\t\tconst next = new Map(current);\n\t\t\t\t\t\tif (filtered.length === 0) next.delete(key);\n\t\t\t\t\t\telse next.set(key, filtered);\n\t\t\t\t\t\treturn next;\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t\tyield* Effect.annotateCurrentSpan({\n\t\t\t\t\t'strategy.key': key,\n\t\t\t\t\t'strategy.autoMounted': entry.autoMounted,\n\t\t\t\t});\n\t\t\t}).pipe(Effect.withSpan('substrate.strategyRegistry.register')) as Effect.Effect<\n\t\t\t\tvoid,\n\t\t\t\tnever,\n\t\t\t\tScope.Scope\n\t\t\t>;\n\n\t\tconst get: StrategyRegistry['get'] = <Key extends string, S>(key: Key) =>\n\t\t\tEffect.gen(function* () {\n\t\t\t\tconst current = yield* Ref.get(state);\n\t\t\t\tconst entries = current.get(key);\n\t\t\t\tif (!entries || entries.length === 0) {\n\t\t\t\t\treturn yield* new StrategyNotFoundError({\n\t\t\t\t\t\tcapabilityKey: key,\n\t\t\t\t\t\tregisteredKeys: [...current.keys()],\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t// Resolution policy:\n\t\t\t\t// 1. Higher priority wins.\n\t\t\t\t// 2. Tie on priority → later registration wins\n\t\t\t\t// (last-write-wins for user overrides of\n\t\t\t\t// built-ins — matches architecture § failure\n\t\t\t\t// modes \"two strategies with the same key and\n\t\t\t\t// same priority → last write wins\").\n\t\t\t\tlet best = entries[0]!;\n\t\t\t\tfor (let i = 1; i < entries.length; i++) {\n\t\t\t\t\tconst e = entries[i]!;\n\t\t\t\t\tif (e.priority > best.priority || (e.priority === best.priority && e.seq > best.seq)) {\n\t\t\t\t\t\tbest = e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn best.strategy as S;\n\t\t\t}).pipe(Effect.withSpan('substrate.strategyRegistry.get', { attributes: { key } }));\n\n\t\tconst list: StrategyRegistry['list'] = () =>\n\t\t\tEffect.gen(function* () {\n\t\t\t\tconst current = yield* Ref.get(state);\n\t\t\t\treturn [...current.keys()];\n\t\t\t});\n\n\t\treturn StrategyRegistryService.of({\n\t\t\tget: get as StrategyRegistry['get'],\n\t\t\tregister: register as StrategyRegistry['register'],\n\t\t\tlist,\n\t\t});\n\t}),\n);\n"],"mappings":";;;AAqCA,IAAa,0BAAb,cAA6C,QAAQ,SAGlD,CAAC,+CAA+C,CAAC;;;;;;AAOpD,MAAa,wBAA8D,MAAM,OAChF,yBACA,OAAO,IAAI,aAAa;CACvB,MAAM,QAAQ,OAAO,IAAI,qBAAY,IAAI,KAAK,CAAC;CAC/C,MAAM,SAAS,OAAO,IAAI,KAAK,EAAE;CAEjC,MAAM,YACL,KACA,UACA,YAEA,OAAO,IAAI,aAAa;EACvB,MAAM,MAAM,OAAO,IAAI,aAAa,SAAS,MAAM,IAAI,EAAE;EACzD,MAAM,QAAe;GACpB;GACA,aAAa,SAAS,eAAe;GACrC,UAAU,SAAS,YAAY;GAC/B;GACA;AACD,SAAO,IAAI,OAAO,QAAQ,YAAY;GACrC,MAAM,WAAW,QAAQ,IAAI,IAAI,IAAI,EAAE;GACvC,MAAM,OAAO,IAAI,IAAI,QAAQ;AAC7B,QAAK,IAAI,KAAK,CAAC,GAAG,UAAU,MAAM,CAAC;AACnC,UAAO;IACN;AAIF,SAAO,OAAO,cAAc,UAC3B,IAAI,OAAO,QAAQ,YAAY;GAC9B,MAAM,WAAW,QAAQ,IAAI,IAAI;AACjC,OAAI,CAAC,SAAU,QAAO;GACtB,MAAM,WAAW,SAAS,QAAQ,MAAM,EAAE,QAAQ,IAAI;GACtD,MAAM,OAAO,IAAI,IAAI,QAAQ;AAC7B,OAAI,SAAS,WAAW,EAAG,MAAK,OAAO,IAAI;OACtC,MAAK,IAAI,KAAK,SAAS;AAC5B,UAAO;IACN,CACF;AACD,SAAO,OAAO,oBAAoB;GACjC,gBAAgB;GAChB,wBAAwB,MAAM;GAC9B,CAAC;GACD,CAAC,KAAK,OAAO,SAAS,sCAAsC,CAAC;CAMhE,MAAM,OAAuD,QAC5D,OAAO,IAAI,aAAa;EACvB,MAAM,UAAU,OAAO,IAAI,IAAI,MAAM;EACrC,MAAM,UAAU,QAAQ,IAAI,IAAI;AAChC,MAAI,CAAC,WAAW,QAAQ,WAAW,EAClC,QAAO,OAAO,IAAI,sBAAsB;GACvC,eAAe;GACf,gBAAgB,CAAC,GAAG,QAAQ,MAAM,CAAC;GACnC,CAAC;EASH,IAAI,OAAO,QAAQ;AACnB,OAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;GACxC,MAAM,IAAI,QAAQ;AAClB,OAAI,EAAE,WAAW,KAAK,YAAa,EAAE,aAAa,KAAK,YAAY,EAAE,MAAM,KAAK,IAC/E,QAAO;;AAGT,SAAO,KAAK;GACX,CAAC,KAAK,OAAO,SAAS,kCAAkC,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CAAC;CAEpF,MAAM,aACL,OAAO,IAAI,aAAa;AAEvB,SAAO,CAAC,IAAG,OADY,IAAI,IAAI,MAAM,EAClB,MAAM,CAAC;GACzB;AAEH,QAAO,wBAAwB,GAAG;EAC5B;EACK;EACV;EACA,CAAC;EACD,CACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Effect, Schema, Scope } from "effect";
|
|
2
|
+
//#region src/substrate/runtime/sui-execute/index.d.ts
|
|
3
|
+
interface TransactionSignerScope<SignError = unknown> {
|
|
4
|
+
readonly signTransaction: (tx: Uint8Array) => Effect.Effect<{
|
|
5
|
+
readonly bytes: string;
|
|
6
|
+
readonly signature: string;
|
|
7
|
+
}, SignError>;
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { TransactionSignerScope };
|
|
11
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { Effect, Schema } from "effect";
|
|
2
|
+
//#region src/substrate/runtime/sui-execute/index.ts
|
|
3
|
+
/** Tagged failure during one step of the Sui-tx roundtrip. `phase`
|
|
4
|
+
* discriminates which step failed so callers can map to their
|
|
5
|
+
* plugin's phase taxonomy (publish-tx, sign, parse, …) without
|
|
6
|
+
* losing the original cause. */
|
|
7
|
+
var SuiExecuteError = class extends Schema.TaggedErrorClass()("SuiExecuteError", {
|
|
8
|
+
phase: Schema.Literals([
|
|
9
|
+
"serialize",
|
|
10
|
+
"sign",
|
|
11
|
+
"execute",
|
|
12
|
+
"failed-transaction",
|
|
13
|
+
"no-digest",
|
|
14
|
+
"wait-for-finality"
|
|
15
|
+
]),
|
|
16
|
+
signerName: Schema.String,
|
|
17
|
+
signerAddress: Schema.String,
|
|
18
|
+
message: Schema.String,
|
|
19
|
+
/** Echoed digest when the SDK returned one but a later step
|
|
20
|
+
* failed — surfaces in cause-walker output. */
|
|
21
|
+
digest: Schema.optional(Schema.String),
|
|
22
|
+
cause: Schema.optional(Schema.Defect)
|
|
23
|
+
}) {};
|
|
24
|
+
/** Drive the serialize → sign → execute → wait → project pipeline.
|
|
25
|
+
*
|
|
26
|
+
* The caller passes:
|
|
27
|
+
* - `client`: an opaque SDK client exposing `executeTransaction` +
|
|
28
|
+
* `waitForTransaction` (matches the cast in both existing
|
|
29
|
+
* duplicates).
|
|
30
|
+
* - `signer`: a `ResolvedSigner` slice with an account-owned
|
|
31
|
+
* transaction scope. The build/sign/execute/wait pipeline runs
|
|
32
|
+
* inside that scope so gas/object-version resolution cannot race
|
|
33
|
+
* another transaction from the same address.
|
|
34
|
+
* - `build`: a closure returning the serialised tx bytes (the
|
|
35
|
+
* caller constructed the `Transaction` and resolved gas via
|
|
36
|
+
* `tx.build({ client })`).
|
|
37
|
+
* - `awaitFinality`: opt-out for the `waitForTransaction` step.
|
|
38
|
+
* Defaults to `true`. Some callers (action ready-probe) need it;
|
|
39
|
+
* others (mode-local publish ready probe path) wait separately
|
|
40
|
+
* via `getObject` polling and can pass `false`.
|
|
41
|
+
*
|
|
42
|
+
* All failures surface as `SuiExecuteError` with a `phase`
|
|
43
|
+
* discriminator the caller maps to its plugin's phase taxonomy.
|
|
44
|
+
*/
|
|
45
|
+
const executeSuiTx = (params) => params.signer.withTransactionSigner((lockedSigner) => Effect.gen(function* () {
|
|
46
|
+
const { client, signer, build } = params;
|
|
47
|
+
const awaitFinality = params.awaitFinality ?? true;
|
|
48
|
+
const txBytes = yield* Effect.tryPromise({
|
|
49
|
+
try: () => build(),
|
|
50
|
+
catch: (cause) => new SuiExecuteError({
|
|
51
|
+
phase: "serialize",
|
|
52
|
+
signerName: signer.name,
|
|
53
|
+
signerAddress: signer.address,
|
|
54
|
+
message: `Transaction.build failed for signer '${signer.name}' (address=${signer.address}): ` + (cause instanceof Error ? cause.message : String(cause)),
|
|
55
|
+
cause
|
|
56
|
+
})
|
|
57
|
+
});
|
|
58
|
+
const signed = yield* lockedSigner.signTransaction(txBytes).pipe(Effect.mapError((cause) => new SuiExecuteError({
|
|
59
|
+
phase: "sign",
|
|
60
|
+
signerName: signer.name,
|
|
61
|
+
signerAddress: signer.address,
|
|
62
|
+
message: `signer.signTransaction failed for '${signer.name}' (address=${signer.address}).`,
|
|
63
|
+
cause
|
|
64
|
+
})));
|
|
65
|
+
const raw = yield* Effect.tryPromise({
|
|
66
|
+
try: () => client.executeTransaction({
|
|
67
|
+
transaction: txBytes,
|
|
68
|
+
signatures: [signed.signature],
|
|
69
|
+
include: {
|
|
70
|
+
effects: true,
|
|
71
|
+
objectTypes: true
|
|
72
|
+
}
|
|
73
|
+
}),
|
|
74
|
+
catch: (cause) => new SuiExecuteError({
|
|
75
|
+
phase: "execute",
|
|
76
|
+
signerName: signer.name,
|
|
77
|
+
signerAddress: signer.address,
|
|
78
|
+
message: `executeTransaction rejected for signer '${signer.name}': ` + (cause instanceof Error ? cause.message : String(cause)),
|
|
79
|
+
cause
|
|
80
|
+
})
|
|
81
|
+
});
|
|
82
|
+
const env = raw;
|
|
83
|
+
if (env.$kind === "FailedTransaction") {
|
|
84
|
+
const failedDigest = env.FailedTransaction?.digest;
|
|
85
|
+
if (awaitFinality && failedDigest !== void 0) yield* Effect.tryPromise({
|
|
86
|
+
try: () => client.waitForTransaction({ digest: failedDigest }),
|
|
87
|
+
catch: (cause) => new SuiExecuteError({
|
|
88
|
+
phase: "wait-for-finality",
|
|
89
|
+
signerName: signer.name,
|
|
90
|
+
signerAddress: signer.address,
|
|
91
|
+
digest: failedDigest,
|
|
92
|
+
message: `waitForTransaction(${failedDigest}) failed.`,
|
|
93
|
+
cause
|
|
94
|
+
})
|
|
95
|
+
});
|
|
96
|
+
return yield* Effect.fail(new SuiExecuteError({
|
|
97
|
+
phase: "failed-transaction",
|
|
98
|
+
signerName: signer.name,
|
|
99
|
+
signerAddress: signer.address,
|
|
100
|
+
digest: env.FailedTransaction?.digest,
|
|
101
|
+
message: `executeTransaction returned FailedTransaction (digest=${env.FailedTransaction?.digest ?? "<unknown>"}): ` + (env.FailedTransaction?.status?.error ?? "<no error>")
|
|
102
|
+
}));
|
|
103
|
+
}
|
|
104
|
+
const txOk = env.Transaction;
|
|
105
|
+
if (txOk?.digest === void 0) return yield* Effect.fail(new SuiExecuteError({
|
|
106
|
+
phase: "no-digest",
|
|
107
|
+
signerName: signer.name,
|
|
108
|
+
signerAddress: signer.address,
|
|
109
|
+
message: `executeTransaction returned no digest. Raw=${JSON.stringify(raw).slice(0, 300)}`
|
|
110
|
+
}));
|
|
111
|
+
if (awaitFinality) yield* Effect.tryPromise({
|
|
112
|
+
try: () => client.waitForTransaction({ digest: txOk.digest }),
|
|
113
|
+
catch: (cause) => new SuiExecuteError({
|
|
114
|
+
phase: "wait-for-finality",
|
|
115
|
+
signerName: signer.name,
|
|
116
|
+
signerAddress: signer.address,
|
|
117
|
+
digest: txOk.digest,
|
|
118
|
+
message: `waitForTransaction(${txOk.digest}) failed.`,
|
|
119
|
+
cause
|
|
120
|
+
})
|
|
121
|
+
});
|
|
122
|
+
const objectTypes = txOk.objectTypes ?? {};
|
|
123
|
+
const objectChanges = [];
|
|
124
|
+
for (const ch of txOk.effects?.changedObjects ?? []) {
|
|
125
|
+
if (typeof ch.objectId !== "string") continue;
|
|
126
|
+
const objectType = objectTypes[ch.objectId];
|
|
127
|
+
const entry = { objectId: ch.objectId };
|
|
128
|
+
if (objectType !== void 0) entry.objectType = objectType;
|
|
129
|
+
if (ch.outputState !== void 0) entry.outputState = ch.outputState;
|
|
130
|
+
if (ch.idOperation !== void 0) entry.idOperation = ch.idOperation;
|
|
131
|
+
objectChanges.push(entry);
|
|
132
|
+
}
|
|
133
|
+
return {
|
|
134
|
+
digest: txOk.digest,
|
|
135
|
+
objectChanges
|
|
136
|
+
};
|
|
137
|
+
})).pipe(Effect.withSpan("substrate.sui-execute", { attributes: {
|
|
138
|
+
"sui-execute.signer": params.signer.name,
|
|
139
|
+
"sui-execute.address": params.signer.address
|
|
140
|
+
} }));
|
|
141
|
+
//#endregion
|
|
142
|
+
export { executeSuiTx };
|
|
143
|
+
|
|
144
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/substrate/runtime/sui-execute/index.ts"],"sourcesContent":["// sui-execute — substrate helper for the Sui-SDK transaction\n// roundtrip.\n//\n// ARCHITECTURE NOTE — substrate-name-awareness escape hatch:\n//\n// This module is the ONE blessed substrate-side Sui-aware module.\n// The substrate is otherwise strictly name-blind (see ARCHITECTURE.md\n// §\"Substrate name-blindness\"), but the \"build → sign → execute →\n// wait → project\" roundtrip is duplicated verbatim across\n// `plugins/package/publish-executor.ts` and `plugins/action/execute.ts`\n// — ~80% identical line-for-line — and the same shape is needed for\n// `seal` (deploy + key-server registration), `coin.mint`, `action`,\n// and `deepbook` (publish + pool creation).\n//\n// Lifting the dispatch here gives every Sui-tx plugin one well-tested\n// surface and surfaces the SDK-envelope shape decisions (`include:\n// { effects, objectTypes }`, `$kind` projection, `FailedTransaction`\n// detection) ONCE.\n//\n// Boundary discipline:\n//\n// - This module is L1-adjacent: it lives under `substrate/runtime/`\n// but consumes opaque shapes (`unknown` SDK client; opaque\n// signer closure). It does NOT import from `plugins/sui/*` or\n// `@mysten/sui/*` — the caller passes in the resolved SDK ref\n// and the signer; the substrate just orchestrates the roundtrip.\n// - The return shape (`ExecutedReceipt`) is name-blind: a flat\n// digest + a uniform `objectChanges` array. Callers map to their\n// domain shape (PublishReceipt, ActionReceipt, MintReceipt, …).\n// - Failures route through `SuiExecuteError` whose `phase`\n// discriminates the failing step. Callers map to their plugin's\n// phase taxonomy in the executor closure passed to\n// `compileChainOperation` (see `artifact-publisher/chain-operation.ts`).\n\nimport { Effect, Schema, Scope } from 'effect';\n\n// ---------------------------------------------------------------------------\n// Errors — substrate-style Schema.TaggedErrorClass\n// ---------------------------------------------------------------------------\n\n/** Tagged failure during one step of the Sui-tx roundtrip. `phase`\n * discriminates which step failed so callers can map to their\n * plugin's phase taxonomy (publish-tx, sign, parse, …) without\n * losing the original cause. */\nexport class SuiExecuteError extends Schema.TaggedErrorClass<SuiExecuteError>()('SuiExecuteError', {\n\tphase: Schema.Literals([\n\t\t'serialize',\n\t\t'sign',\n\t\t'execute',\n\t\t'failed-transaction',\n\t\t'no-digest',\n\t\t'wait-for-finality',\n\t]),\n\tsignerName: Schema.String,\n\tsignerAddress: Schema.String,\n\tmessage: Schema.String,\n\t/** Echoed digest when the SDK returned one but a later step\n\t * failed — surfaces in cause-walker output. */\n\tdigest: Schema.optional(Schema.String),\n\tcause: Schema.optional(Schema.Defect),\n}) {}\n\n// ---------------------------------------------------------------------------\n// Inputs / outputs — opaque at the substrate boundary\n// ---------------------------------------------------------------------------\n\n/** The narrow slice of the SDK client this helper drives. Mirrors the\n * shape cast verbatim in `plugins/package/publish-executor.ts` and\n * `plugins/action/execute.ts`. */\nexport interface SuiExecuteClient {\n\treadonly executeTransaction: (args: {\n\t\treadonly transaction: Uint8Array;\n\t\treadonly signatures: ReadonlyArray<string>;\n\t\treadonly include?: {\n\t\t\treadonly effects?: boolean;\n\t\t\treadonly objectTypes?: boolean;\n\t\t};\n\t}) => Promise<unknown>;\n\treadonly waitForTransaction: (args: {\n\t\treadonly digest: string;\n\t\treadonly include?: { readonly effects?: boolean };\n\t\treadonly timeout?: number;\n\t}) => Promise<unknown>;\n}\n\n/** Serialised transaction-build callback. Returns the BCS bytes ready\n * for signing. The caller owns the `Transaction` construction — the\n * substrate does not import `@mysten/sui/transactions` — and resolves\n * it via `Transaction.build({ client })`. */\nexport type SerializedTxBuilder = () => Promise<Uint8Array>;\n\nexport interface TransactionSignerScope<SignError = unknown> {\n\treadonly signTransaction: (\n\t\ttx: Uint8Array,\n\t) => Effect.Effect<{ readonly bytes: string; readonly signature: string }, SignError>;\n}\n\n/** Resolved signer — narrow slice of `AccountValue` (see\n * `artifact-publisher/chain-operation.ts::ResolvedSigner`). */\nexport interface ResolvedSigner {\n\treadonly name: string;\n\treadonly address: string;\n\treadonly signTransaction: (\n\t\ttx: Uint8Array,\n\t) => Effect.Effect<{ readonly bytes: string; readonly signature: string }, unknown>;\n\treadonly withTransactionSigner: <A, E, R>(\n\t\tbody: (signer: TransactionSignerScope) => Effect.Effect<A, E, R>,\n\t) => Effect.Effect<A, E, R>;\n}\n\n/** Flat per-object change record. Mirrors the union of fields that\n * `PublishObjectChange` (package) and `ActionObjectChange` (action)\n * expose so callers can pick whichever subset they surface. */\nexport interface ExecutedObjectChange {\n\treadonly objectId: string;\n\treadonly objectType?: string;\n\treadonly outputState?: string;\n\treadonly idOperation?: string;\n}\n\n/** Result of one successful execute round. Callers map this to their\n * domain shape (PublishReceipt, ActionReceipt, MintReceipt, …). */\nexport interface ExecutedReceipt {\n\treadonly digest: string;\n\treadonly objectChanges: ReadonlyArray<ExecutedObjectChange>;\n}\n\n// ---------------------------------------------------------------------------\n// SDK envelope projection (matches publish-executor + action.execute)\n// ---------------------------------------------------------------------------\n\ninterface RawExecuteEnvelope {\n\treadonly $kind?: 'Transaction' | 'FailedTransaction';\n\treadonly Transaction?: {\n\t\treadonly digest?: string;\n\t\treadonly effects?: {\n\t\t\treadonly changedObjects?: ReadonlyArray<{\n\t\t\t\treadonly objectId?: string;\n\t\t\t\treadonly outputState?: string;\n\t\t\t\treadonly idOperation?: string;\n\t\t\t}>;\n\t\t};\n\t\treadonly objectTypes?: Readonly<Record<string, string>>;\n\t};\n\treadonly FailedTransaction?: {\n\t\treadonly digest?: string;\n\t\treadonly status?: { readonly error?: string };\n\t};\n}\n\n// ---------------------------------------------------------------------------\n// The helper\n// ---------------------------------------------------------------------------\n\n/** Drive the serialize → sign → execute → wait → project pipeline.\n *\n * The caller passes:\n * - `client`: an opaque SDK client exposing `executeTransaction` +\n * `waitForTransaction` (matches the cast in both existing\n * duplicates).\n * - `signer`: a `ResolvedSigner` slice with an account-owned\n * transaction scope. The build/sign/execute/wait pipeline runs\n * inside that scope so gas/object-version resolution cannot race\n * another transaction from the same address.\n * - `build`: a closure returning the serialised tx bytes (the\n * caller constructed the `Transaction` and resolved gas via\n * `tx.build({ client })`).\n * - `awaitFinality`: opt-out for the `waitForTransaction` step.\n * Defaults to `true`. Some callers (action ready-probe) need it;\n * others (mode-local publish ready probe path) wait separately\n * via `getObject` polling and can pass `false`.\n *\n * All failures surface as `SuiExecuteError` with a `phase`\n * discriminator the caller maps to its plugin's phase taxonomy.\n */\nexport const executeSuiTx = (params: {\n\treadonly client: SuiExecuteClient;\n\treadonly signer: ResolvedSigner;\n\treadonly build: SerializedTxBuilder;\n\treadonly awaitFinality?: boolean;\n}): Effect.Effect<ExecutedReceipt, SuiExecuteError, Scope.Scope> =>\n\tparams.signer\n\t\t.withTransactionSigner((lockedSigner) =>\n\t\t\tEffect.gen(function* () {\n\t\t\t\tconst { client, signer, build } = params;\n\t\t\t\tconst awaitFinality = params.awaitFinality ?? true;\n\n\t\t\t\t// 1. Serialise the transaction. Failures inside the build\n\t\t\t\t// closure (e.g. `Transaction.build({ client })` rejection)\n\t\t\t\t// surface as `phase: 'serialize'` so callers can attribute\n\t\t\t\t// them at the call site.\n\t\t\t\tconst txBytes = yield* Effect.tryPromise({\n\t\t\t\t\ttry: () => build(),\n\t\t\t\t\tcatch: (cause) =>\n\t\t\t\t\t\tnew SuiExecuteError({\n\t\t\t\t\t\t\tphase: 'serialize',\n\t\t\t\t\t\t\tsignerName: signer.name,\n\t\t\t\t\t\t\tsignerAddress: signer.address,\n\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t`Transaction.build failed for signer '${signer.name}' ` +\n\t\t\t\t\t\t\t\t`(address=${signer.address}): ` +\n\t\t\t\t\t\t\t\t(cause instanceof Error ? cause.message : String(cause)),\n\t\t\t\t\t\t\tcause,\n\t\t\t\t\t\t}),\n\t\t\t\t});\n\n\t\t\t\t// 2. Sign with the resolved signer. The signer's own typed\n\t\t\t\t// error surfaces in `cause`; we collapse to `phase: 'sign'`\n\t\t\t\t// so the cascade-formatter can walk the cause chain.\n\t\t\t\tconst signed = yield* lockedSigner.signTransaction(txBytes).pipe(\n\t\t\t\t\tEffect.mapError(\n\t\t\t\t\t\t(cause) =>\n\t\t\t\t\t\t\tnew SuiExecuteError({\n\t\t\t\t\t\t\t\tphase: 'sign',\n\t\t\t\t\t\t\t\tsignerName: signer.name,\n\t\t\t\t\t\t\t\tsignerAddress: signer.address,\n\t\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t\t`signer.signTransaction failed for '${signer.name}' ` +\n\t\t\t\t\t\t\t\t\t`(address=${signer.address}).`,\n\t\t\t\t\t\t\t\tcause,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t),\n\t\t\t\t);\n\n\t\t\t\t// 3. Execute via the SDK. We always request `effects: true` and\n\t\t\t\t// `objectTypes: true` because every existing caller needs\n\t\t\t\t// `changedObjects` + types to project to its domain shape.\n\t\t\t\tconst raw = yield* Effect.tryPromise({\n\t\t\t\t\ttry: () =>\n\t\t\t\t\t\tclient.executeTransaction({\n\t\t\t\t\t\t\ttransaction: txBytes,\n\t\t\t\t\t\t\tsignatures: [signed.signature],\n\t\t\t\t\t\t\tinclude: { effects: true, objectTypes: true },\n\t\t\t\t\t\t}),\n\t\t\t\t\tcatch: (cause) =>\n\t\t\t\t\t\tnew SuiExecuteError({\n\t\t\t\t\t\t\tphase: 'execute',\n\t\t\t\t\t\t\tsignerName: signer.name,\n\t\t\t\t\t\t\tsignerAddress: signer.address,\n\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t`executeTransaction rejected for signer '${signer.name}': ` +\n\t\t\t\t\t\t\t\t(cause instanceof Error ? cause.message : String(cause)),\n\t\t\t\t\t\t\tcause,\n\t\t\t\t\t\t}),\n\t\t\t\t});\n\n\t\t\t\t// 4. Project the envelope. `$kind === 'FailedTransaction'`\n\t\t\t\t// surfaces as a discrete phase so callers can distinguish\n\t\t\t\t// transport failures from on-chain rejection.\n\t\t\t\tconst env = raw as RawExecuteEnvelope;\n\t\t\t\tif (env.$kind === 'FailedTransaction') {\n\t\t\t\t\tconst failedDigest = env.FailedTransaction?.digest;\n\t\t\t\t\tif (awaitFinality && failedDigest !== undefined) {\n\t\t\t\t\t\tyield* Effect.tryPromise({\n\t\t\t\t\t\t\ttry: () => client.waitForTransaction({ digest: failedDigest }),\n\t\t\t\t\t\t\tcatch: (cause) =>\n\t\t\t\t\t\t\t\tnew SuiExecuteError({\n\t\t\t\t\t\t\t\t\tphase: 'wait-for-finality',\n\t\t\t\t\t\t\t\t\tsignerName: signer.name,\n\t\t\t\t\t\t\t\t\tsignerAddress: signer.address,\n\t\t\t\t\t\t\t\t\tdigest: failedDigest,\n\t\t\t\t\t\t\t\t\tmessage: `waitForTransaction(${failedDigest}) failed.`,\n\t\t\t\t\t\t\t\t\tcause,\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\treturn yield* Effect.fail(\n\t\t\t\t\t\tnew SuiExecuteError({\n\t\t\t\t\t\t\tphase: 'failed-transaction',\n\t\t\t\t\t\t\tsignerName: signer.name,\n\t\t\t\t\t\t\tsignerAddress: signer.address,\n\t\t\t\t\t\t\tdigest: env.FailedTransaction?.digest,\n\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t`executeTransaction returned FailedTransaction ` +\n\t\t\t\t\t\t\t\t`(digest=${env.FailedTransaction?.digest ?? '<unknown>'}): ` +\n\t\t\t\t\t\t\t\t(env.FailedTransaction?.status?.error ?? '<no error>'),\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tconst txOk = env.Transaction;\n\t\t\t\tif (txOk?.digest === undefined) {\n\t\t\t\t\treturn yield* Effect.fail(\n\t\t\t\t\t\tnew SuiExecuteError({\n\t\t\t\t\t\t\tphase: 'no-digest',\n\t\t\t\t\t\t\tsignerName: signer.name,\n\t\t\t\t\t\t\tsignerAddress: signer.address,\n\t\t\t\t\t\t\tmessage: `executeTransaction returned no digest. Raw=${JSON.stringify(raw).slice(0, 300)}`,\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// 5. Wait for finality (opt-out — some callers wait separately).\n\t\t\t\tif (awaitFinality) {\n\t\t\t\t\tyield* Effect.tryPromise({\n\t\t\t\t\t\ttry: () => client.waitForTransaction({ digest: txOk.digest! }),\n\t\t\t\t\t\tcatch: (cause) =>\n\t\t\t\t\t\t\tnew SuiExecuteError({\n\t\t\t\t\t\t\t\tphase: 'wait-for-finality',\n\t\t\t\t\t\t\t\tsignerName: signer.name,\n\t\t\t\t\t\t\t\tsignerAddress: signer.address,\n\t\t\t\t\t\t\t\tdigest: txOk.digest,\n\t\t\t\t\t\t\t\tmessage: `waitForTransaction(${txOk.digest}) failed.`,\n\t\t\t\t\t\t\t\tcause,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t// 6. Project changedObjects flat. Callers pick which entries\n\t\t\t\t// they care about (published / created / mutated / by-type\n\t\t\t\t// substring).\n\t\t\t\tconst objectTypes = txOk.objectTypes ?? {};\n\t\t\t\tconst objectChanges: Array<ExecutedObjectChange> = [];\n\t\t\t\tfor (const ch of txOk.effects?.changedObjects ?? []) {\n\t\t\t\t\tif (typeof ch.objectId !== 'string') continue;\n\t\t\t\t\tconst objectType = objectTypes[ch.objectId];\n\t\t\t\t\tconst entry: { -readonly [K in keyof ExecutedObjectChange]: ExecutedObjectChange[K] } = {\n\t\t\t\t\t\tobjectId: ch.objectId,\n\t\t\t\t\t};\n\t\t\t\t\tif (objectType !== undefined) entry.objectType = objectType;\n\t\t\t\t\tif (ch.outputState !== undefined) entry.outputState = ch.outputState;\n\t\t\t\t\tif (ch.idOperation !== undefined) entry.idOperation = ch.idOperation;\n\t\t\t\t\tobjectChanges.push(entry);\n\t\t\t\t}\n\n\t\t\t\treturn { digest: txOk.digest, objectChanges };\n\t\t\t}),\n\t\t)\n\t\t.pipe(\n\t\t\tEffect.withSpan('substrate.sui-execute', {\n\t\t\t\tattributes: {\n\t\t\t\t\t'sui-execute.signer': params.signer.name,\n\t\t\t\t\t'sui-execute.address': params.signer.address,\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n"],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { Effect, Schema, Scope } from "effect";
|