@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":"shared-boot.mjs","names":["brandChainId"],"sources":["../../../../src/plugins/sui/mode/shared-boot.ts"],"sourcesContent":["// Sui plugin — boot helpers shared across local / external / live modes.\n//\n// What lives here (and why):\n//\n// - `fetchChainId(client, opts?)` — bounded chain-id probe. The\n// only readiness sentinel for external + live; local treats it\n// as the chain-id capture step after the multi-probe gate has\n// succeeded.\n// - `buildWaitForTransactionsReady(faucetUrl, opts?)` — memoised\n// funds-ready gate for faucet-bearing networks. `Effect.cached`\n// with a manual-invalidation surface (the distilled-doc\n// opportunity called out in `mode/shared.ts`).\n// - `noopWaitForTransactionsReady` — trivially-succeeding gate for\n// faucet-less networks (live mainnet, fork).\n// - `assembleSuiClient(...)` — collapses the boilerplate that\n// local/local-rpc/live all repeat (sdk shim + chainProbe + the\n// `fork: null` discriminator).\n//\n// Why not jam this into `mode/local.ts`: external + live can't\n// import from `local.ts` without dragging the container-runtime\n// import path along; the helpers below are wire-only and have NO\n// substrate-context dependencies.\n\nimport { Duration, Effect, Ref, type Scope } from 'effect';\n\nimport type { SuiGrpcClient } from '@mysten/sui/grpc';\n\nimport type { ChainProbe } from '../../../contracts/chain-probe.ts';\nimport { chainId as brandChainId } from '../../../substrate/brand.ts';\nimport { waitForHttpEndpoint } from '../../../substrate/runtime/http-probe.ts';\nimport { makeSuiChainProbe, type SuiSdkShim, type SuiProbeKey } from '../chain-probe.ts';\nimport { suiPluginError, type SuiPluginError } from '../errors.ts';\nimport type { ResolvedSuiNetwork } from '../network-resolver.ts';\nimport { toDockerHostGatewayUrl, type SuiClient, type WaitForTransactionsReady } from './shared.ts';\n\n// ---------------------------------------------------------------------------\n// Chain-id fetch — bounded, typed-error\n// ---------------------------------------------------------------------------\n\n/** Default chain-id fetch timeout. The wire latency is the dominant\n * cost on real RPCs; 30 s is the documented ceiling. */\nexport const DEFAULT_CHAIN_ID_TIMEOUT = Duration.seconds(30);\n\n/** Fetch the chain identifier off a constructed grpc client. The\n * result is the bare string that downstream cache layers fold into\n * their state-store keys. */\nexport const fetchChainId = (\n\tsdkClient: SuiGrpcClient,\n\topts?: { readonly timeout?: Duration.Duration; readonly span?: string },\n): Effect.Effect<string, SuiPluginError> => {\n\tconst timeout = opts?.timeout ?? DEFAULT_CHAIN_ID_TIMEOUT;\n\tconst timeoutMs = Duration.toMillis(timeout);\n\treturn Effect.tryPromise({\n\t\ttry: (signal) =>\n\t\t\tsdkClient.ledgerService\n\t\t\t\t.getServiceInfo({}, { abort: signal, timeout: timeoutMs })\n\t\t\t\t.response.then((response) => {\n\t\t\t\t\tif (!response.chainId) {\n\t\t\t\t\t\tthrow new Error('Chain identifier not found in service info');\n\t\t\t\t\t}\n\t\t\t\t\treturn response.chainId;\n\t\t\t\t}),\n\t\tcatch: (cause): SuiPluginError =>\n\t\t\tsuiPluginError(\n\t\t\t\t'chain-id-fetch',\n\t\t\t\t`sui chain-id fetch failed: ${stringifyCause(cause)}`,\n\t\t\t\tcause,\n\t\t\t),\n\t}).pipe(\n\t\tEffect.timeoutOrElse({\n\t\t\tduration: timeout,\n\t\t\torElse: (): Effect.Effect<string, SuiPluginError> =>\n\t\t\t\tEffect.fail(\n\t\t\t\t\tsuiPluginError(\n\t\t\t\t\t\t'chain-id-fetch',\n\t\t\t\t\t\t`sui chain-id fetch did not respond within ${timeoutMs}ms`,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t}),\n\t\tEffect.tap((id: string) => Effect.annotateCurrentSpan({ 'sui.chain': id })),\n\t\tEffect.withSpan(opts?.span ?? 'devstack.plugin.sui.fetchChainId'),\n\t);\n};\n\n// ---------------------------------------------------------------------------\n// waitForTransactionsReady — memoised, with manual invalidation\n// ---------------------------------------------------------------------------\n\n/** Per-attempt and total budget for the `waitForTransactionsReady`\n * retry loop. The 2 s spacing matches the upstream sui-faucet's\n * internal cadence; the 90 s ceiling matches the v3 service's\n * documented wall-clock. */\nconst FUNDS_READY_RETRY_SPACING = Duration.seconds(2);\nconst FUNDS_READY_TIMEOUT = Duration.seconds(90);\n\n/** Per-fetch deadline for the faucet probe POST. Bounded short so\n * the outer retry loop hammers quickly. */\nconst PROBE_FETCH_TIMEOUT_MS = 3000;\n\n/** Probe recipient for the faucet funds-ready check. A literal\n * zero-balance address so the real call doesn't pollute caller wallets;\n * any well-formed address works. */\nconst FAUCET_PROBE_RECIPIENT = '0x0000000000000000000000000000000000000000000000000000000000000001';\n\n/**\n * Build the funds-transferable gate against a real HTTP faucet.\n * Memoised — first successful resolution sticks for the scope; the\n * manual `invalidate` surface clears the memo so long-running\n * supervisors can re-probe without a full restart.\n */\nexport const buildWaitForTransactionsReady = (\n\tfaucetUrl: string,\n\topts?: {\n\t\treadonly retrySpacing?: Duration.Duration;\n\t\treadonly timeout?: Duration.Duration;\n\t},\n): Effect.Effect<WaitForTransactionsReady, never, Scope.Scope> =>\n\tEffect.gen(function* () {\n\t\tconst retrySpacing = opts?.retrySpacing ?? FUNDS_READY_RETRY_SPACING;\n\t\tconst timeout = opts?.timeout ?? FUNDS_READY_TIMEOUT;\n\t\tconst ref = yield* Ref.make<Effect.Effect<void, SuiPluginError> | null>(null);\n\n\t\tconst makeProbe = (): Effect.Effect<void, SuiPluginError> =>\n\t\t\twaitForHttpEndpoint({\n\t\t\t\tendpoint: `${faucetUrl}/v2/gas`,\n\t\t\t\ttimeoutMs: Duration.toMillis(timeout),\n\t\t\t\tintervalMs: Duration.toMillis(retrySpacing),\n\t\t\t\trequestTimeoutMs: PROBE_FETCH_TIMEOUT_MS,\n\t\t\t\trequestInit: {\n\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\theaders: { 'content-type': 'application/json' },\n\t\t\t\t\tbody: JSON.stringify({\n\t\t\t\t\t\tFixedAmountRequest: { recipient: FAUCET_PROBE_RECIPIENT },\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t\tvalidate: async (response) => {\n\t\t\t\t\tif (!response.ok) throw new Error(`faucet HTTP ${response.status}`);\n\t\t\t\t\tconst body = (await response.json()) as { status?: unknown };\n\t\t\t\t\tconst status = body.status;\n\t\t\t\t\tif (typeof status === 'object' && status !== null && 'Failure' in status) {\n\t\t\t\t\t\tconst failure = (status as { Failure: unknown }).Failure;\n\t\t\t\t\t\tthrow new Error(`faucet body: Failure ${JSON.stringify(failure)}`);\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\t},\n\t\t\t}).pipe(\n\t\t\t\tEffect.mapError(\n\t\t\t\t\t(cause): SuiPluginError =>\n\t\t\t\t\t\tsuiPluginError(\n\t\t\t\t\t\t\t'wait-funds-ready',\n\t\t\t\t\t\t\t`sui faucet at ${faucetUrl} did not become funds-transferable within ` +\n\t\t\t\t\t\t\t\t`${Duration.toMillis(timeout)}ms (still returning body-level Failure or 5xx): ` +\n\t\t\t\t\t\t\t\tstringifyCause(cause),\n\t\t\t\t\t\t\tcause,\n\t\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t);\n\n\t\tconst getOrInit: Effect.Effect<Effect.Effect<void, SuiPluginError>> = Effect.gen(function* () {\n\t\t\tconst existing = yield* Ref.get(ref);\n\t\t\tif (existing !== null) return existing;\n\t\t\tconst cached = yield* Effect.cached(makeProbe());\n\t\t\tyield* Ref.set(ref, cached);\n\t\t\treturn cached;\n\t\t});\n\n\t\treturn {\n\t\t\twait: getOrInit.pipe(Effect.flatMap((eff) => eff)),\n\t\t\tinvalidate: Ref.set(ref, null),\n\t\t};\n\t});\n\n/** Trivially-succeeding gate. Used by faucet-less networks (live\n * mainnet, fork — fork funds via impersonation, not HTTP). */\nexport const noopWaitForTransactionsReady: WaitForTransactionsReady = {\n\twait: Effect.void,\n\tinvalidate: Effect.void,\n};\n\nconst SUI_RPC_READ_TIMEOUT_MS = 10_000;\n\nconst postJsonRpc = async <A>(\n\trpcUrl: string,\n\tmethod: string,\n\tparams: ReadonlyArray<unknown>,\n): Promise<A> => {\n\tconst controller = new AbortController();\n\tconst timeout = setTimeout(() => controller.abort(), SUI_RPC_READ_TIMEOUT_MS);\n\ttimeout.unref?.();\n\ttry {\n\t\tconst response = await fetch(rpcUrl, {\n\t\t\tmethod: 'POST',\n\t\t\theaders: { 'content-type': 'application/json' },\n\t\t\tbody: JSON.stringify({ jsonrpc: '2.0', id: 1, method, params }),\n\t\t\tsignal: controller.signal,\n\t\t});\n\t\tif (!response.ok) throw new Error(`Sui RPC HTTP ${response.status}`);\n\t\tconst payload = (await response.json()) as {\n\t\t\treadonly result?: A;\n\t\t\treadonly error?: { readonly message?: string };\n\t\t};\n\t\tif (payload.error !== undefined) {\n\t\t\tthrow new Error(payload.error.message ?? JSON.stringify(payload.error));\n\t\t}\n\t\tif (payload.result === undefined) throw new Error(`Sui RPC ${method} returned no result`);\n\t\treturn payload.result;\n\t} finally {\n\t\tclearTimeout(timeout);\n\t}\n};\n\nconst normalizeJsonOwner = (owner: unknown): unknown => {\n\tif (owner === 'Immutable') return { $kind: 'Immutable', Immutable: true };\n\tif (typeof owner !== 'object' || owner === null) return { $kind: 'Unknown', Unknown: owner };\n\tconst record = owner as {\n\t\treadonly AddressOwner?: unknown;\n\t\treadonly ObjectOwner?: unknown;\n\t\treadonly Shared?: {\n\t\t\treadonly initial_shared_version?: unknown;\n\t\t\treadonly initialSharedVersion?: unknown;\n\t\t};\n\t\treadonly ConsensusAddressOwner?: unknown;\n\t};\n\tif (typeof record.AddressOwner === 'string') {\n\t\treturn { $kind: 'AddressOwner', AddressOwner: record.AddressOwner };\n\t}\n\tif (record.ObjectOwner !== undefined) {\n\t\treturn { $kind: 'Parent', Parent: record.ObjectOwner };\n\t}\n\tif (record.Shared !== undefined) {\n\t\tconst initialSharedVersion =\n\t\t\trecord.Shared.initialSharedVersion ?? record.Shared.initial_shared_version;\n\t\treturn {\n\t\t\t$kind: 'Shared',\n\t\t\tShared: { initialSharedVersion: String(initialSharedVersion) },\n\t\t};\n\t}\n\tif (record.ConsensusAddressOwner !== undefined) {\n\t\treturn { $kind: 'ConsensusAddressOwner', ConsensusAddressOwner: record.ConsensusAddressOwner };\n\t}\n\treturn { $kind: 'Unknown', Unknown: owner };\n};\n\nconst getObjectViaJsonRpc = async (\n\trpcUrl: string,\n\targs: {\n\t\treadonly objectId: string;\n\t\treadonly include?: {\n\t\t\treadonly content?: boolean;\n\t\t\treadonly json?: boolean;\n\t\t};\n\t},\n): Promise<unknown> => {\n\tconst showContent = args.include?.content === true || args.include?.json === true;\n\tconst result = await postJsonRpc<{\n\t\treadonly data?: {\n\t\t\treadonly objectId?: string;\n\t\t\treadonly version?: string | number;\n\t\t\treadonly type?: string;\n\t\t\treadonly owner?: unknown;\n\t\t\treadonly content?: {\n\t\t\t\treadonly fields?: unknown;\n\t\t\t};\n\t\t};\n\t}>('' + rpcUrl, 'sui_getObject', [\n\t\targs.objectId,\n\t\t{ showType: true, showOwner: true, showContent },\n\t]);\n\tconst data = result.data;\n\tif (data?.objectId === undefined) throw new Error(`object ${args.objectId} not found`);\n\tconst object = {\n\t\tobjectId: data.objectId,\n\t\tversion: String(data.version ?? ''),\n\t\ttype: data.type ?? 'unknown',\n\t\towner: normalizeJsonOwner(data.owner),\n\t\t...(args.include?.json === true ? { json: data.content?.fields } : {}),\n\t\t...(args.include?.content === true ? { content: data.content } : {}),\n\t};\n\treturn { ...object, object };\n};\n\n// ---------------------------------------------------------------------------\n// SuiClient assembly — collapses the per-mode boilerplate\n// ---------------------------------------------------------------------------\n\n/** Build the `SuiSdkShim` over a constructed grpc client.\n * Account/Coin/Wallet read through this seam, so we expose\n * `executeTransaction` + `waitForTransaction` in addition to the\n * read methods needed by the chain probe. */\nexport const makeSdkShim = (sdkClient: SuiGrpcClient, rpcUrl: string): SuiSdkShim => ({\n\tcore: {\n\t\tgetObject: (args) => getObjectViaJsonRpc(rpcUrl, args),\n\t\tgetTransaction: (args) => sdkClient.core.getTransaction(args),\n\t\tgetBalance: (args) => sdkClient.core.getBalance(args),\n\t\tlistCoins: (args) => sdkClient.core.listCoins(args),\n\t\t// Extended surfaces — used by the account plugin's sign + execute\n\t\t// closure. Local mode keeps the `sdkClient.executeTransaction` /\n\t\t// `sdkClient.waitForTransaction` instance methods reachable on\n\t\t// the shim so consumers don't have to know about the grpc client\n\t\t// constructor. The SDK accepts a mutable `signatures: string[]`\n\t\t// shape; the shim's readonly signature is widened with a copy at\n\t\t// the boundary.\n\t\texecuteTransaction: (args) =>\n\t\t\tsdkClient.executeTransaction({\n\t\t\t\ttransaction: args.transaction,\n\t\t\t\tsignatures: [...args.signatures],\n\t\t\t\t...(args.include !== undefined ? { include: args.include } : {}),\n\t\t\t}),\n\t\twaitForTransaction: (args) =>\n\t\t\tsdkClient.waitForTransaction({\n\t\t\t\tdigest: args.digest,\n\t\t\t\t...(args.timeout !== undefined ? { timeout: args.timeout } : {}),\n\t\t\t}),\n\t},\n\t// Opaque client passthrough — the Package plugin's publish-tx\n\t// builder hands this to `Transaction.build({ client })`. The shim\n\t// layer doesn't type-narrow it; downstream consumers cast at the\n\t// `tx.build` call site (mirrors coin/mint.ts).\n\tclient: sdkClient,\n});\n\n/** Assemble a `SuiClient` from the per-mode building blocks. The\n * `fork: null` discriminator is invariant for non-fork modes; the\n * fork builder constructs its own client with the admin surface.\n *\n * `chain` is accepted as a bare string and branded to `ChainId` at\n * this single boundary — every consumer downstream reads the\n * branded shape so capability-key constructors (`chainProbe…`,\n * `faucet…`) accept it without a cast. */\nexport const assembleSuiClient = (parts: {\n\treadonly sdkClient: SuiGrpcClient;\n\treadonly chain: string;\n\treadonly rpcUrl: string;\n\treadonly sdkRpcUrl?: string;\n\treadonly faucetUrl?: string;\n\treadonly fundingFaucetUrl?: string;\n\treadonly graphqlUrl?: string;\n\treadonly waitForTransactionsReady: WaitForTransactionsReady;\n\t/** Image ref consumed by package's path (b) (`docker run --rm`)\n\t * build path. `null` for modes that have no in-stack image\n\t * (external + live). */\n\treadonly buildImage?: import('../../../contracts/container-runtime.ts').ImageRef | null;\n\t/** Container-reachable mirrors. Local mode resolves public URLs\n\t * through the router but sibling containers still need direct\n\t * host-gateway URLs during boot. */\n\treadonly hostGateway?: SuiClient['hostGateway'];\n}): {\n\treadonly client: SuiClient;\n\treadonly sdkShim: SuiSdkShim;\n\treadonly chainProbe: ChainProbe<SuiProbeKey>;\n} => {\n\tconst sdkShim = makeSdkShim(parts.sdkClient, parts.sdkRpcUrl ?? parts.rpcUrl);\n\tconst chainProbe = makeSuiChainProbe(sdkShim, parts.chain);\n\tconst client: SuiClient = {\n\t\tsdk: sdkShim,\n\t\trpcUrl: parts.rpcUrl,\n\t\tfaucetUrl: parts.faucetUrl ?? null,\n\t\tfundingFaucetUrl: parts.fundingFaucetUrl ?? parts.faucetUrl ?? null,\n\t\tgraphqlUrl: parts.graphqlUrl ?? null,\n\t\thostGateway: parts.hostGateway ?? {\n\t\t\trpcUrl: toDockerHostGatewayUrl(parts.rpcUrl),\n\t\t\tfaucetUrl: parts.faucetUrl === undefined ? null : toDockerHostGatewayUrl(parts.faucetUrl),\n\t\t\tgraphqlUrl: parts.graphqlUrl === undefined ? null : toDockerHostGatewayUrl(parts.graphqlUrl),\n\t\t},\n\t\tchain: brandChainId(parts.chain),\n\t\twaitForTransactionsReady: parts.waitForTransactionsReady,\n\t\tchainProbe,\n\t\tfork: null,\n\t\tbuildImage: parts.buildImage ?? null,\n\t};\n\treturn { client, sdkShim, chainProbe };\n};\n\n/** Shape the resolved network record the boot builders all hand\n * back. The substrate-network mapping is uniform per mode. Brands\n * the raw chain string at this boundary so consumers downstream\n * (codegen, capabilities, walrus/seal deps) read a `ChainId` and\n * don't re-wrap. */\nexport const makeResolvedNetwork = (parts: {\n\treadonly mode: ResolvedSuiNetwork['mode'];\n\treadonly chain: string;\n\treadonly rpc: string;\n\treadonly faucet?: string;\n\treadonly graphql?: string;\n\treadonly source: ResolvedSuiNetwork['source'];\n\treadonly checkpoint?: string;\n\treadonly forkUpstream?: ResolvedSuiNetwork['forkUpstream'];\n}): ResolvedSuiNetwork => ({\n\tmode: parts.mode,\n\tchain: brandChainId(parts.chain),\n\trpc: parts.rpc,\n\tsource: parts.source,\n\t...(parts.faucet !== undefined ? { faucet: parts.faucet } : {}),\n\t...(parts.graphql !== undefined ? { graphql: parts.graphql } : {}),\n\t...(parts.checkpoint !== undefined ? { checkpoint: parts.checkpoint } : {}),\n\t...(parts.forkUpstream !== undefined ? { forkUpstream: parts.forkUpstream } : {}),\n});\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\nconst stringifyCause = (cause: unknown): string => {\n\tif (cause instanceof Error) return cause.message;\n\tif (typeof cause === 'string') return cause;\n\ttry {\n\t\treturn JSON.stringify(cause);\n\t} catch {\n\t\treturn String(cause);\n\t}\n};\n"],"mappings":"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"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { ChainId } from "../../../substrate/brand.mjs";
|
|
2
|
+
import { ImageRef } from "../../../contracts/container-runtime.mjs";
|
|
3
|
+
import { ChainProbe } from "../../../contracts/chain-probe.mjs";
|
|
4
|
+
import { SuiProbeKey, SuiSdkShim } from "../chain-probe.mjs";
|
|
5
|
+
import { SuiPluginError } from "../errors.mjs";
|
|
6
|
+
import { Effect } from "effect";
|
|
7
|
+
|
|
8
|
+
//#region src/plugins/sui/mode/shared.d.ts
|
|
9
|
+
/** Funds-ready strategy contributed by Sui. Mode-aware:
|
|
10
|
+
*
|
|
11
|
+
* - local container — first call POSTs a real funding tx against
|
|
12
|
+
* the faucet, retrying on body-level {Failure} during the
|
|
13
|
+
* post-RPC / pre-fund window. Memoised after first success.
|
|
14
|
+
* - external w/ faucet — same as local container.
|
|
15
|
+
* - live testnet — same, but no retry needed (the public faucet
|
|
16
|
+
* is rate-limited differently).
|
|
17
|
+
* - live mainnet / faucet-less — trivially-succeeding no-op.
|
|
18
|
+
* (Architecture: "no-faucet network has a trivially-succeeding
|
|
19
|
+
* funds-ready gate" is a first-class property of the mode.)
|
|
20
|
+
* - fork — trivially-succeeding (impersonation funds, not
|
|
21
|
+
* faucet).
|
|
22
|
+
*
|
|
23
|
+
* Distilled-doc opportunity: `Effect.cached` caches the first-call
|
|
24
|
+
* failure for the whole scope; add a manual-invalidation surface
|
|
25
|
+
* so a fork restart can re-probe. The shape below leaves room for
|
|
26
|
+
* that knob. */
|
|
27
|
+
interface WaitForTransactionsReady {
|
|
28
|
+
readonly wait: Effect.Effect<void, SuiPluginError>;
|
|
29
|
+
/** Manual invalidation — clears the memoised result. The default
|
|
30
|
+
* built-in invalidates on plugin restart; this surface lets
|
|
31
|
+
* long-running supervisors invalidate without a full restart. */
|
|
32
|
+
readonly invalidate: Effect.Effect<void>;
|
|
33
|
+
}
|
|
34
|
+
/** Fork admin surface — mode-narrowed. Only the fork-mode factory's
|
|
35
|
+
* resolved value carries this; local/local-rpc/live values have a
|
|
36
|
+
* type-level `null`.
|
|
37
|
+
*
|
|
38
|
+
* Distilled-doc opportunity: today's `Fiber` handle is discarded
|
|
39
|
+
* at the auto-tick call site; the `autoTickHandle` field below
|
|
40
|
+
* preserves it for a future cadence-change surface. */
|
|
41
|
+
interface ForkAdminSurface {
|
|
42
|
+
readonly status: Effect.Effect<{
|
|
43
|
+
readonly checkpoint: string;
|
|
44
|
+
readonly clock: number;
|
|
45
|
+
}, SuiPluginError>;
|
|
46
|
+
readonly advanceClock: (intervalMs: number) => Effect.Effect<void, SuiPluginError>;
|
|
47
|
+
readonly advanceCheckpoint: Effect.Effect<void, SuiPluginError>;
|
|
48
|
+
readonly impersonate: (sender: string, tx: unknown) => Effect.Effect<{
|
|
49
|
+
readonly digest: string;
|
|
50
|
+
readonly success: boolean;
|
|
51
|
+
readonly raw: unknown;
|
|
52
|
+
}, SuiPluginError>;
|
|
53
|
+
}
|
|
54
|
+
/** The resolved value Sui publishes via its resource id. */
|
|
55
|
+
interface SuiClient {
|
|
56
|
+
/** The SDK shim. Fork mode wraps this with the property-access
|
|
57
|
+
* blocklist (`fork-orchestration.wrapWithForkGuard`). */
|
|
58
|
+
readonly sdk: SuiSdkShim;
|
|
59
|
+
/** Host-reachable RPC URL for this resolved network. Local mode
|
|
60
|
+
* surfaces the router-fronted URL; direct boot/probe ports are
|
|
61
|
+
* available through `hostGateway` for sibling containers. */
|
|
62
|
+
readonly rpcUrl: string;
|
|
63
|
+
/** Host-reachable faucet base URL when this network has a faucet. */
|
|
64
|
+
readonly faucetUrl: string | null;
|
|
65
|
+
/** Faucet URL used by account funding strategies. Local mode keeps
|
|
66
|
+
* this on the direct validator port used by the funds-ready gate. */
|
|
67
|
+
readonly fundingFaucetUrl: string | null;
|
|
68
|
+
/** Host-reachable GraphQL URL when the mode exposes one. */
|
|
69
|
+
readonly graphqlUrl: string | null;
|
|
70
|
+
/** Container-reachable mirrors of the host URLs. Loopback hosts are
|
|
71
|
+
* rewritten to `host.docker.internal`; public URLs pass through. */
|
|
72
|
+
readonly hostGateway: {
|
|
73
|
+
readonly rpcUrl: string;
|
|
74
|
+
readonly faucetUrl: string | null;
|
|
75
|
+
readonly graphqlUrl: string | null;
|
|
76
|
+
};
|
|
77
|
+
/** Chain identity — downstream cache primitives fold this into
|
|
78
|
+
* their state-store keys so on-chain artifacts re-derive when
|
|
79
|
+
* the chain is wiped. Branded so consumers can hand it directly
|
|
80
|
+
* to `chainProbeCapabilityKey(chain)` / `faucetCapabilityKey(chain)`
|
|
81
|
+
* without a cast. */
|
|
82
|
+
readonly chain: ChainId;
|
|
83
|
+
/** Mode-aware funds-transferable gate; trivially-succeeding on
|
|
84
|
+
* faucet-less networks. */
|
|
85
|
+
readonly waitForTransactionsReady: WaitForTransactionsReady;
|
|
86
|
+
/** Schema-validated read surface. Folded into every consumer's
|
|
87
|
+
* context via `chain-probe:<chainId>` strategy lookup. */
|
|
88
|
+
readonly chainProbe: ChainProbe<SuiProbeKey>;
|
|
89
|
+
/** Fork-mode-only admin sub-surface. `null` for non-fork
|
|
90
|
+
* modes; the mode-narrowed factory namespace narrows this at
|
|
91
|
+
* the type level so consumers don't have to nullcheck. */
|
|
92
|
+
readonly fork: ForkAdminSurface | null;
|
|
93
|
+
/** Container image ref the Sui plugin built/pulled for its
|
|
94
|
+
* validator. Surfaced so cross-service consumers (Package's
|
|
95
|
+
* Move build, codegen's `summary` invocation) can spawn a
|
|
96
|
+
* one-shot container running the SAME sui binary without
|
|
97
|
+
* re-resolving the image. `null` for modes that have no
|
|
98
|
+
* in-stack container (external + live). */
|
|
99
|
+
readonly buildImage: ImageRef | null;
|
|
100
|
+
}
|
|
101
|
+
//#endregion
|
|
102
|
+
export { ForkAdminSurface, SuiClient, WaitForTransactionsReady };
|
|
103
|
+
//# sourceMappingURL=shared.d.mts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import "effect";
|
|
2
|
+
//#region src/plugins/sui/mode/shared.ts
|
|
3
|
+
const toDockerHostGatewayUrl = (url) => {
|
|
4
|
+
const parsed = new URL(url);
|
|
5
|
+
if (parsed.hostname === "127.0.0.1" || parsed.hostname === "localhost" || parsed.hostname === "0.0.0.0" || parsed.hostname === "::1" || parsed.hostname === "[::1]") parsed.hostname = "host.docker.internal";
|
|
6
|
+
const rendered = parsed.toString();
|
|
7
|
+
return parsed.pathname === "/" && parsed.search === "" && parsed.hash === "" ? rendered.slice(0, -1) : rendered;
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { toDockerHostGatewayUrl };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=shared.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.mjs","names":[],"sources":["../../../../src/plugins/sui/mode/shared.ts"],"sourcesContent":["// Shared shapes across mode builders.\n//\n// `SuiClient` is the resolved-value the plugin's `provides` tag\n// publishes — every consumer (Account, Coin, Wallet, Faucet,\n// Package, Codegen, Walrus/Seal/Deepbook fork variants) reads\n// THIS shape.\n//\n// Why one shape: distilled-doc finding — Sui's factory + builder\n// file is ~2000 LOC because the four per-network builders share\n// boilerplate (publish endpoints + fetch chain id + publish state)\n// but their bodies diverge in mode-specific ways. The redesign\n// bakes the seam in: the resolved value is uniform, the boot path\n// is mode-specific, and the admin surfaces narrow at the type\n// level (fork has `Sui.fork.advanceClock`; live does not).\n\nimport { Effect } from 'effect';\n\nimport type { SuiPluginError } from '../errors.ts';\nimport type { SuiSdkShim } from '../chain-probe.ts';\nimport type { ChainProbe } from '../../../contracts/chain-probe.ts';\nimport type { ImageRef } from '../../../contracts/container-runtime.ts';\nimport type { SuiProbeKey } from '../chain-probe.ts';\nimport type { ChainId } from '../../../substrate/brand.ts';\n\n/** Funds-ready strategy contributed by Sui. Mode-aware:\n *\n * - local container — first call POSTs a real funding tx against\n * the faucet, retrying on body-level {Failure} during the\n * post-RPC / pre-fund window. Memoised after first success.\n * - external w/ faucet — same as local container.\n * - live testnet — same, but no retry needed (the public faucet\n * is rate-limited differently).\n * - live mainnet / faucet-less — trivially-succeeding no-op.\n * (Architecture: \"no-faucet network has a trivially-succeeding\n * funds-ready gate\" is a first-class property of the mode.)\n * - fork — trivially-succeeding (impersonation funds, not\n * faucet).\n *\n * Distilled-doc opportunity: `Effect.cached` caches the first-call\n * failure for the whole scope; add a manual-invalidation surface\n * so a fork restart can re-probe. The shape below leaves room for\n * that knob. */\nexport interface WaitForTransactionsReady {\n\treadonly wait: Effect.Effect<void, SuiPluginError>;\n\t/** Manual invalidation — clears the memoised result. The default\n\t * built-in invalidates on plugin restart; this surface lets\n\t * long-running supervisors invalidate without a full restart. */\n\treadonly invalidate: Effect.Effect<void>;\n}\n\n/** Fork admin surface — mode-narrowed. Only the fork-mode factory's\n * resolved value carries this; local/local-rpc/live values have a\n * type-level `null`.\n *\n * Distilled-doc opportunity: today's `Fiber` handle is discarded\n * at the auto-tick call site; the `autoTickHandle` field below\n * preserves it for a future cadence-change surface. */\nexport interface ForkAdminSurface {\n\treadonly status: Effect.Effect<\n\t\t{ readonly checkpoint: string; readonly clock: number },\n\t\tSuiPluginError\n\t>;\n\treadonly advanceClock: (intervalMs: number) => Effect.Effect<void, SuiPluginError>;\n\treadonly advanceCheckpoint: Effect.Effect<void, SuiPluginError>;\n\treadonly impersonate: (\n\t\tsender: string,\n\t\ttx: unknown,\n\t) => Effect.Effect<\n\t\t{ readonly digest: string; readonly success: boolean; readonly raw: unknown },\n\t\tSuiPluginError\n\t>;\n}\n\n/** The resolved value Sui publishes via its resource id. */\nexport interface SuiClient {\n\t/** The SDK shim. Fork mode wraps this with the property-access\n\t * blocklist (`fork-orchestration.wrapWithForkGuard`). */\n\treadonly sdk: SuiSdkShim;\n\t/** Host-reachable RPC URL for this resolved network. Local mode\n\t * surfaces the router-fronted URL; direct boot/probe ports are\n\t * available through `hostGateway` for sibling containers. */\n\treadonly rpcUrl: string;\n\t/** Host-reachable faucet base URL when this network has a faucet. */\n\treadonly faucetUrl: string | null;\n\t/** Faucet URL used by account funding strategies. Local mode keeps\n\t * this on the direct validator port used by the funds-ready gate. */\n\treadonly fundingFaucetUrl: string | null;\n\t/** Host-reachable GraphQL URL when the mode exposes one. */\n\treadonly graphqlUrl: string | null;\n\t/** Container-reachable mirrors of the host URLs. Loopback hosts are\n\t * rewritten to `host.docker.internal`; public URLs pass through. */\n\treadonly hostGateway: {\n\t\treadonly rpcUrl: string;\n\t\treadonly faucetUrl: string | null;\n\t\treadonly graphqlUrl: string | null;\n\t};\n\t/** Chain identity — downstream cache primitives fold this into\n\t * their state-store keys so on-chain artifacts re-derive when\n\t * the chain is wiped. Branded so consumers can hand it directly\n\t * to `chainProbeCapabilityKey(chain)` / `faucetCapabilityKey(chain)`\n\t * without a cast. */\n\treadonly chain: ChainId;\n\t/** Mode-aware funds-transferable gate; trivially-succeeding on\n\t * faucet-less networks. */\n\treadonly waitForTransactionsReady: WaitForTransactionsReady;\n\t/** Schema-validated read surface. Folded into every consumer's\n\t * context via `chain-probe:<chainId>` strategy lookup. */\n\treadonly chainProbe: ChainProbe<SuiProbeKey>;\n\t/** Fork-mode-only admin sub-surface. `null` for non-fork\n\t * modes; the mode-narrowed factory namespace narrows this at\n\t * the type level so consumers don't have to nullcheck. */\n\treadonly fork: ForkAdminSurface | null;\n\t/** Container image ref the Sui plugin built/pulled for its\n\t * validator. Surfaced so cross-service consumers (Package's\n\t * Move build, codegen's `summary` invocation) can spawn a\n\t * one-shot container running the SAME sui binary without\n\t * re-resolving the image. `null` for modes that have no\n\t * in-stack container (external + live). */\n\treadonly buildImage: ImageRef | null;\n}\n\nexport const toDockerHostGatewayUrl = (url: string): string => {\n\tconst parsed = new URL(url);\n\tif (\n\t\tparsed.hostname === '127.0.0.1' ||\n\t\tparsed.hostname === 'localhost' ||\n\t\tparsed.hostname === '0.0.0.0' ||\n\t\tparsed.hostname === '::1' ||\n\t\tparsed.hostname === '[::1]'\n\t) {\n\t\tparsed.hostname = 'host.docker.internal';\n\t}\n\tconst rendered = parsed.toString();\n\treturn parsed.pathname === '/' && parsed.search === '' && parsed.hash === ''\n\t\t? rendered.slice(0, -1)\n\t\t: rendered;\n};\n"],"mappings":";;AAyHA,MAAa,0BAA0B,QAAwB;CAC9D,MAAM,SAAS,IAAI,IAAI,IAAI;AAC3B,KACC,OAAO,aAAa,eACpB,OAAO,aAAa,eACpB,OAAO,aAAa,aACpB,OAAO,aAAa,SACpB,OAAO,aAAa,QAEpB,QAAO,WAAW;CAEnB,MAAM,WAAW,OAAO,UAAU;AAClC,QAAO,OAAO,aAAa,OAAO,OAAO,WAAW,MAAM,OAAO,SAAS,KACvE,SAAS,MAAM,GAAG,GAAG,GACrB"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { Duration } from "effect";
|
|
2
|
+
|
|
3
|
+
//#region src/plugins/sui/mode/spec.d.ts
|
|
4
|
+
/** Internal mode discriminator. Distinct from the substrate's
|
|
5
|
+
* `NetworkMode` because we surface a degenerate `local-rpc`
|
|
6
|
+
* sub-mode (caller-supplied RPC URL — no container needed) under
|
|
7
|
+
* the substrate-level `'local'` branch. */
|
|
8
|
+
type SuiPluginMode = 'local' | 'local-rpc' | 'live' | 'fork';
|
|
9
|
+
/** Common Sui plugin options. Mode-specific identity pins live on the
|
|
10
|
+
* modes that actually accept caller-supplied endpoints. */
|
|
11
|
+
interface SuiCommonOptions {
|
|
12
|
+
/** Ready-probe timeout. Per-mode defaults are mode-specific. */
|
|
13
|
+
readonly readyTimeout?: Duration.Duration;
|
|
14
|
+
}
|
|
15
|
+
/** Local container mode — in-stack validator + faucet + GraphQL +
|
|
16
|
+
* postgres indexer. */
|
|
17
|
+
interface SuiLocalOptions extends SuiCommonOptions {
|
|
18
|
+
readonly mode: 'local';
|
|
19
|
+
/** Image override — `{pull}` skips the build; `{build}` uses
|
|
20
|
+
* the bundled Dockerfile + a content-hashed tag. */
|
|
21
|
+
readonly image?: {
|
|
22
|
+
readonly pull: string;
|
|
23
|
+
} | {
|
|
24
|
+
readonly build: {
|
|
25
|
+
readonly context: string;
|
|
26
|
+
readonly dockerfile?: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
/** Sui binary version (default in mode/local.ts). */
|
|
30
|
+
readonly version?: string;
|
|
31
|
+
/** Optional direct host port mapping keyed by container port. When
|
|
32
|
+
* supplied, the mapping is exact: Sui does not reassign missing
|
|
33
|
+
* or busy host ports through the PortBroker. Omit this field to
|
|
34
|
+
* use brokered private host-port defaults for RPC/faucet/GraphQL
|
|
35
|
+
* and reassign on collision. Router entrypoints own the public
|
|
36
|
+
* 9000/9123/9125 ports. */
|
|
37
|
+
readonly ports?: Readonly<Record<number, number>>;
|
|
38
|
+
}
|
|
39
|
+
/** Local RPC mode — caller already has a Sui process; we
|
|
40
|
+
* wrap it. NO container, NO postgres sidecar, NO build image. */
|
|
41
|
+
interface SuiLocalRpcOptions extends SuiCommonOptions {
|
|
42
|
+
readonly mode: 'local-rpc';
|
|
43
|
+
readonly rpcUrl: string;
|
|
44
|
+
readonly faucetUrl?: string;
|
|
45
|
+
readonly graphqlUrl?: string;
|
|
46
|
+
/** Optional chain id pin for caller-owned endpoints. Omit to
|
|
47
|
+
* probe the RPC endpoint. */
|
|
48
|
+
readonly chain?: string;
|
|
49
|
+
}
|
|
50
|
+
/** Live testnet / mainnet / custom-RPC mode. */
|
|
51
|
+
interface SuiLiveOptions extends SuiCommonOptions {
|
|
52
|
+
readonly mode: 'live';
|
|
53
|
+
/** Discriminator for known-network defaulting; `custom` requires
|
|
54
|
+
* rpcUrl. */
|
|
55
|
+
readonly network: 'testnet' | 'mainnet' | 'devnet' | 'custom';
|
|
56
|
+
readonly rpcUrl?: string;
|
|
57
|
+
readonly faucetUrl?: string;
|
|
58
|
+
readonly graphqlUrl?: string;
|
|
59
|
+
/** Optional chain id pin for custom/caller-owned live endpoints.
|
|
60
|
+
* Omit to probe the RPC endpoint. */
|
|
61
|
+
readonly chain?: string;
|
|
62
|
+
}
|
|
63
|
+
/** Fork mode — sui-fork binary mirroring a real chain at a
|
|
64
|
+
* checkpoint. */
|
|
65
|
+
interface SuiForkOptions extends SuiCommonOptions {
|
|
66
|
+
readonly mode: 'fork';
|
|
67
|
+
readonly upstream: 'mainnet' | 'testnet' | 'devnet';
|
|
68
|
+
readonly checkpoint?: number;
|
|
69
|
+
readonly image?: {
|
|
70
|
+
readonly pull: string;
|
|
71
|
+
} | {
|
|
72
|
+
readonly build: {
|
|
73
|
+
readonly context: string;
|
|
74
|
+
readonly dockerfile?: string;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
/** Pinned Git revision of the Sui repository used to build `sui-fork`. */
|
|
78
|
+
readonly version?: string;
|
|
79
|
+
/** Optional direct host port mapping keyed by container port. */
|
|
80
|
+
readonly ports?: Readonly<Record<number, number>>;
|
|
81
|
+
readonly seed?: {
|
|
82
|
+
readonly addresses?: ReadonlyArray<string>;
|
|
83
|
+
readonly objects?: ReadonlyArray<string>;
|
|
84
|
+
};
|
|
85
|
+
/** Auto-tick clock cadence (or off). */
|
|
86
|
+
readonly autoTick?: boolean | {
|
|
87
|
+
readonly intervalMs: number;
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
/** The discriminated union of all four mode option records. */
|
|
91
|
+
type SuiOptions = SuiLocalOptions | SuiLocalRpcOptions | SuiLiveOptions | SuiForkOptions;
|
|
92
|
+
//#endregion
|
|
93
|
+
export { SuiForkOptions, SuiLiveOptions, SuiLocalOptions, SuiLocalRpcOptions, SuiOptions, SuiPluginMode };
|
|
94
|
+
//# sourceMappingURL=spec.d.mts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ChainId } from "../../substrate/brand.mjs";
|
|
2
|
+
import { SuiPluginMode } from "./mode/spec.mjs";
|
|
3
|
+
//#region src/plugins/sui/network-resolver.d.ts
|
|
4
|
+
/** Plugin-internal shape — the resolved mode's identity, populated
|
|
5
|
+
* by the mode-specific builder. The resolver below projects this
|
|
6
|
+
* into the substrate's `NetworkConfig`. */
|
|
7
|
+
interface ResolvedSuiNetwork {
|
|
8
|
+
readonly mode: SuiPluginMode;
|
|
9
|
+
/** Branded chain identity — assembled by the mode builders so
|
|
10
|
+
* downstream lookups (chain-probe / faucet capability keys) and
|
|
11
|
+
* the `NetworkConfig` projection both accept it without a re-wrap. */
|
|
12
|
+
readonly chain: ChainId;
|
|
13
|
+
readonly rpc: string;
|
|
14
|
+
readonly faucet?: string;
|
|
15
|
+
readonly graphql?: string;
|
|
16
|
+
readonly source: 'cli' | 'env' | 'config' | 'default';
|
|
17
|
+
/** Fork-only: upstream + checkpoint pin. */
|
|
18
|
+
readonly checkpoint?: string;
|
|
19
|
+
readonly forkUpstream?: 'mainnet' | 'testnet' | 'devnet';
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { ResolvedSuiNetwork };
|
|
23
|
+
//# sourceMappingURL=network-resolver.d.mts.map
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
const SUI_FAUCET_ENDPOINT_NAME = "faucet";
|
|
2
|
+
const SUI_GRAPHQL_ENDPOINT_NAME = "graphql";
|
|
3
|
+
const SUI_RPC_ENTRYPOINT_PORT = 9e3;
|
|
4
|
+
const SUI_FAUCET_ENTRYPOINT_PORT = 9123;
|
|
5
|
+
const SUI_GRAPHQL_ENTRYPOINT_PORT = 9125;
|
|
6
|
+
const SUI_ENTRYPOINTS = [
|
|
7
|
+
{
|
|
8
|
+
name: "rpc",
|
|
9
|
+
port: SUI_RPC_ENTRYPOINT_PORT,
|
|
10
|
+
protocol: "http"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
name: SUI_FAUCET_ENDPOINT_NAME,
|
|
14
|
+
port: SUI_FAUCET_ENTRYPOINT_PORT,
|
|
15
|
+
protocol: "http"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: SUI_GRAPHQL_ENDPOINT_NAME,
|
|
19
|
+
port: SUI_GRAPHQL_ENTRYPOINT_PORT,
|
|
20
|
+
protocol: "http"
|
|
21
|
+
}
|
|
22
|
+
];
|
|
23
|
+
const makeSuiLocalRoutables = (parts) => [
|
|
24
|
+
{
|
|
25
|
+
kind: "routable",
|
|
26
|
+
endpointName: "rpc",
|
|
27
|
+
dispatchId: {
|
|
28
|
+
serviceKey: "sui.local",
|
|
29
|
+
role: "rpc"
|
|
30
|
+
},
|
|
31
|
+
upstream: {
|
|
32
|
+
type: "container",
|
|
33
|
+
containerName: parts.containerName,
|
|
34
|
+
containerPort: SUI_RPC_ENTRYPOINT_PORT
|
|
35
|
+
},
|
|
36
|
+
cors: true,
|
|
37
|
+
wireProtocol: "http"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
kind: "routable",
|
|
41
|
+
endpointName: SUI_FAUCET_ENDPOINT_NAME,
|
|
42
|
+
dispatchId: {
|
|
43
|
+
serviceKey: "sui.local",
|
|
44
|
+
role: SUI_FAUCET_ENDPOINT_NAME
|
|
45
|
+
},
|
|
46
|
+
upstream: {
|
|
47
|
+
type: "container",
|
|
48
|
+
containerName: parts.containerName,
|
|
49
|
+
containerPort: SUI_FAUCET_ENTRYPOINT_PORT
|
|
50
|
+
},
|
|
51
|
+
cors: true,
|
|
52
|
+
wireProtocol: "http"
|
|
53
|
+
},
|
|
54
|
+
...parts.includeGraphql ? [{
|
|
55
|
+
kind: "routable",
|
|
56
|
+
endpointName: SUI_GRAPHQL_ENDPOINT_NAME,
|
|
57
|
+
dispatchId: {
|
|
58
|
+
serviceKey: "sui.local",
|
|
59
|
+
role: SUI_GRAPHQL_ENDPOINT_NAME
|
|
60
|
+
},
|
|
61
|
+
upstream: {
|
|
62
|
+
type: "container",
|
|
63
|
+
containerName: parts.containerName,
|
|
64
|
+
containerPort: SUI_GRAPHQL_ENTRYPOINT_PORT
|
|
65
|
+
},
|
|
66
|
+
cors: true,
|
|
67
|
+
wireProtocol: "http"
|
|
68
|
+
}] : []
|
|
69
|
+
];
|
|
70
|
+
const makeSuiForkRoutables = (parts) => [{
|
|
71
|
+
kind: "routable",
|
|
72
|
+
endpointName: "rpc",
|
|
73
|
+
dispatchId: {
|
|
74
|
+
serviceKey: "sui.fork",
|
|
75
|
+
role: "rpc"
|
|
76
|
+
},
|
|
77
|
+
upstream: {
|
|
78
|
+
type: "container",
|
|
79
|
+
containerName: parts.containerName,
|
|
80
|
+
containerPort: SUI_RPC_ENTRYPOINT_PORT
|
|
81
|
+
},
|
|
82
|
+
cors: true,
|
|
83
|
+
wireProtocol: "http"
|
|
84
|
+
}];
|
|
85
|
+
//#endregion
|
|
86
|
+
export { SUI_ENTRYPOINTS, SUI_FAUCET_ENDPOINT_NAME, SUI_FAUCET_ENTRYPOINT_PORT, SUI_GRAPHQL_ENDPOINT_NAME, SUI_GRAPHQL_ENTRYPOINT_PORT, SUI_RPC_ENTRYPOINT_PORT, makeSuiForkRoutables, makeSuiLocalRoutables };
|
|
87
|
+
|
|
88
|
+
//# sourceMappingURL=routable.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routable.mjs","names":[],"sources":["../../../src/plugins/sui/routable.ts"],"sourcesContent":["import type { EntrypointDecl, RoutableDecl } from '../../contracts/routable.ts';\n\nexport const SUI_RPC_ENDPOINT_NAME = 'rpc' as const;\nexport const SUI_FAUCET_ENDPOINT_NAME = 'faucet' as const;\nexport const SUI_GRAPHQL_ENDPOINT_NAME = 'graphql' as const;\n\nexport const SUI_RPC_ENTRYPOINT_PORT = 9000;\nexport const SUI_FAUCET_ENTRYPOINT_PORT = 9123;\nexport const SUI_GRAPHQL_ENTRYPOINT_PORT = 9125;\n\nexport const SUI_ENTRYPOINTS: ReadonlyArray<EntrypointDecl> = [\n\t{ name: SUI_RPC_ENDPOINT_NAME, port: SUI_RPC_ENTRYPOINT_PORT, protocol: 'http' },\n\t{ name: SUI_FAUCET_ENDPOINT_NAME, port: SUI_FAUCET_ENTRYPOINT_PORT, protocol: 'http' },\n\t{ name: SUI_GRAPHQL_ENDPOINT_NAME, port: SUI_GRAPHQL_ENTRYPOINT_PORT, protocol: 'http' },\n];\n\nexport const makeSuiLocalRoutables = (parts: {\n\treadonly containerName: string;\n\treadonly includeGraphql: boolean;\n}): ReadonlyArray<RoutableDecl> => [\n\t{\n\t\tkind: 'routable',\n\t\tendpointName: SUI_RPC_ENDPOINT_NAME,\n\t\tdispatchId: {\n\t\t\tserviceKey: 'sui.local',\n\t\t\trole: SUI_RPC_ENDPOINT_NAME,\n\t\t},\n\t\tupstream: {\n\t\t\ttype: 'container',\n\t\t\tcontainerName: parts.containerName,\n\t\t\tcontainerPort: SUI_RPC_ENTRYPOINT_PORT,\n\t\t},\n\t\tcors: true,\n\t\twireProtocol: 'http',\n\t},\n\t{\n\t\tkind: 'routable',\n\t\tendpointName: SUI_FAUCET_ENDPOINT_NAME,\n\t\tdispatchId: {\n\t\t\tserviceKey: 'sui.local',\n\t\t\trole: SUI_FAUCET_ENDPOINT_NAME,\n\t\t},\n\t\tupstream: {\n\t\t\ttype: 'container',\n\t\t\tcontainerName: parts.containerName,\n\t\t\tcontainerPort: SUI_FAUCET_ENTRYPOINT_PORT,\n\t\t},\n\t\tcors: true,\n\t\twireProtocol: 'http',\n\t},\n\t...(parts.includeGraphql\n\t\t? [\n\t\t\t\t{\n\t\t\t\t\tkind: 'routable',\n\t\t\t\t\tendpointName: SUI_GRAPHQL_ENDPOINT_NAME,\n\t\t\t\t\tdispatchId: {\n\t\t\t\t\t\tserviceKey: 'sui.local',\n\t\t\t\t\t\trole: SUI_GRAPHQL_ENDPOINT_NAME,\n\t\t\t\t\t},\n\t\t\t\t\tupstream: {\n\t\t\t\t\t\ttype: 'container',\n\t\t\t\t\t\tcontainerName: parts.containerName,\n\t\t\t\t\t\tcontainerPort: SUI_GRAPHQL_ENTRYPOINT_PORT,\n\t\t\t\t\t},\n\t\t\t\t\tcors: true,\n\t\t\t\t\twireProtocol: 'http',\n\t\t\t\t} satisfies RoutableDecl,\n\t\t\t]\n\t\t: []),\n];\n\nexport const makeSuiForkRoutables = (parts: {\n\treadonly containerName: string;\n}): ReadonlyArray<RoutableDecl> => [\n\t{\n\t\tkind: 'routable',\n\t\tendpointName: SUI_RPC_ENDPOINT_NAME,\n\t\tdispatchId: {\n\t\t\tserviceKey: 'sui.fork',\n\t\t\trole: SUI_RPC_ENDPOINT_NAME,\n\t\t},\n\t\tupstream: {\n\t\t\ttype: 'container',\n\t\t\tcontainerName: parts.containerName,\n\t\t\tcontainerPort: SUI_RPC_ENTRYPOINT_PORT,\n\t\t},\n\t\tcors: true,\n\t\twireProtocol: 'http',\n\t},\n];\n"],"mappings":"AAGA,MAAa,2BAA2B;AACxC,MAAa,4BAA4B;AAEzC,MAAa,0BAA0B;AACvC,MAAa,6BAA6B;AAC1C,MAAa,8BAA8B;AAE3C,MAAa,kBAAiD;CAC7D;EAAE,MAAA;EAA6B,MAAM;EAAyB,UAAU;EAAQ;CAChF;EAAE,MAAM;EAA0B,MAAM;EAA4B,UAAU;EAAQ;CACtF;EAAE,MAAM;EAA2B,MAAM;EAA6B,UAAU;EAAQ;CACxF;AAED,MAAa,yBAAyB,UAGH;CAClC;EACC,MAAM;EACN,cAAA;EACA,YAAY;GACX,YAAY;GACZ,MAAA;GACA;EACD,UAAU;GACT,MAAM;GACN,eAAe,MAAM;GACrB,eAAe;GACf;EACD,MAAM;EACN,cAAc;EACd;CACD;EACC,MAAM;EACN,cAAc;EACd,YAAY;GACX,YAAY;GACZ,MAAM;GACN;EACD,UAAU;GACT,MAAM;GACN,eAAe,MAAM;GACrB,eAAe;GACf;EACD,MAAM;EACN,cAAc;EACd;CACD,GAAI,MAAM,iBACP,CACA;EACC,MAAM;EACN,cAAc;EACd,YAAY;GACX,YAAY;GACZ,MAAM;GACN;EACD,UAAU;GACT,MAAM;GACN,eAAe,MAAM;GACrB,eAAe;GACf;EACD,MAAM;EACN,cAAc;EACd,CACD,GACA,EAAE;CACL;AAED,MAAa,wBAAwB,UAEF,CAClC;CACC,MAAM;CACN,cAAA;CACA,YAAY;EACX,YAAY;EACZ,MAAA;EACA;CACD,UAAU;EACT,MAAM;EACN,eAAe,MAAM;EACrB,eAAe;EACf;CACD,MAAM;CACN,cAAc;CACd,CACD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
|
|
3
|
+
//#region src/plugins/sui/seed-objects.d.ts
|
|
4
|
+
/** Plugin-instance-scoped accumulator. Constructed inside the
|
|
5
|
+
* Sui plugin's `acquire` body; the lifetime is the plugin's scope. */
|
|
6
|
+
interface SeedObjectsAccumulator {
|
|
7
|
+
/** Merge a set of seed object ids. KnownPackage declarations
|
|
8
|
+
* call this during their own acquire — Sui's fork builder
|
|
9
|
+
* reads the accumulated set AFTER scheduler ordering puts
|
|
10
|
+
* KnownPackage upstream of the fork container. */
|
|
11
|
+
readonly contribute: (objects: ReadonlyArray<string>) => Effect.Effect<void>;
|
|
12
|
+
/** Snapshot the accumulated set. Called by fork's acquire when
|
|
13
|
+
* composing the `--object` seed flags. */
|
|
14
|
+
readonly snapshot: Effect.Effect<ReadonlyArray<string>>;
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { SeedObjectsAccumulator };
|
|
18
|
+
//# sourceMappingURL=seed-objects.d.mts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Effect, Ref } from "effect";
|
|
2
|
+
//#region src/plugins/sui/seed-objects.ts
|
|
3
|
+
/** Capability key the StrategyContributor registry dispatches on.
|
|
4
|
+
* KnownPackage declarations look this up; Sui's fork mode
|
|
5
|
+
* contributes it from inside acquire. */
|
|
6
|
+
const SEED_OBJECTS_CAPABILITY_KEY = "sui:seed-objects";
|
|
7
|
+
/** Construct a fresh accumulator. Each Sui plugin instance gets
|
|
8
|
+
* one — the substrate's scope-boundary handles isolation across
|
|
9
|
+
* parallel stacks. */
|
|
10
|
+
const makeSeedObjectsAccumulator = () => Effect.gen(function* () {
|
|
11
|
+
const ref = yield* Ref.make([]);
|
|
12
|
+
const contribute = (objects) => Ref.update(ref, (prev) => {
|
|
13
|
+
const set = new Set(prev);
|
|
14
|
+
for (const o of objects) set.add(o.toLowerCase());
|
|
15
|
+
return Array.from(set).sort();
|
|
16
|
+
});
|
|
17
|
+
return {
|
|
18
|
+
contribute,
|
|
19
|
+
snapshot: Ref.get(ref)
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
//#endregion
|
|
23
|
+
export { SEED_OBJECTS_CAPABILITY_KEY, makeSeedObjectsAccumulator };
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=seed-objects.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seed-objects.mjs","names":[],"sources":["../../../src/plugins/sui/seed-objects.ts"],"sourcesContent":["// Fork-mode seed-objects accumulator.\n//\n// Distilled-doc finding (5-sui § Opportunities): today's code uses\n// a module-scope `Set<string>` with an explicit\n// `clearKnownPackageSeedObjects()` contract between composes. That\n// is a foot-gun — tests that compose more than once must remember\n// to clear; the responsibility sits with the user, not the\n// framework.\n//\n// Fix: confine the accumulator to plugin-instance state. Each\n// `sui()` factory call constructs a fresh `SeedObjectsAccumulator`\n// inside its acquire body's scope; KnownPackage declarations\n// elsewhere in the stack discover it via the StrategyContributor\n// registry (`sui:seed-objects`).\n//\n// The substrate-redesign substrate-violations document already\n// flags module-scope mutable state as forbidden; this file is the\n// implementation of the cure.\n\nimport { Effect, Ref } from 'effect';\n\n/** Plugin-instance-scoped accumulator. Constructed inside the\n * Sui plugin's `acquire` body; the lifetime is the plugin's scope. */\nexport interface SeedObjectsAccumulator {\n\t/** Merge a set of seed object ids. KnownPackage declarations\n\t * call this during their own acquire — Sui's fork builder\n\t * reads the accumulated set AFTER scheduler ordering puts\n\t * KnownPackage upstream of the fork container. */\n\treadonly contribute: (objects: ReadonlyArray<string>) => Effect.Effect<void>;\n\t/** Snapshot the accumulated set. Called by fork's acquire when\n\t * composing the `--object` seed flags. */\n\treadonly snapshot: Effect.Effect<ReadonlyArray<string>>;\n}\n\n/** Capability key the StrategyContributor registry dispatches on.\n * KnownPackage declarations look this up; Sui's fork mode\n * contributes it from inside acquire. */\nexport const SEED_OBJECTS_CAPABILITY_KEY = 'sui:seed-objects' as const;\n\n/** Construct a fresh accumulator. Each Sui plugin instance gets\n * one — the substrate's scope-boundary handles isolation across\n * parallel stacks. */\nexport const makeSeedObjectsAccumulator = (): Effect.Effect<SeedObjectsAccumulator> =>\n\tEffect.gen(function* () {\n\t\tconst ref = yield* Ref.make<ReadonlyArray<string>>([]);\n\n\t\tconst contribute = (objects: ReadonlyArray<string>): Effect.Effect<void> =>\n\t\t\tRef.update(ref, (prev) => {\n\t\t\t\t// Stable union — sorted + lowercased so the configHash\n\t\t\t\t// is invariant under contribution order (architecture\n\t\t\t\t// § sui § Invariants).\n\t\t\t\tconst set = new Set(prev);\n\t\t\t\tfor (const o of objects) set.add(o.toLowerCase());\n\t\t\t\treturn Array.from(set).sort();\n\t\t\t});\n\n\t\tconst snapshot = Ref.get(ref);\n\n\t\treturn { contribute, snapshot };\n\t});\n"],"mappings":";;;;;AAqCA,MAAa,8BAA8B;;;;AAK3C,MAAa,mCACZ,OAAO,IAAI,aAAa;CACvB,MAAM,MAAM,OAAO,IAAI,KAA4B,EAAE,CAAC;CAEtD,MAAM,cAAc,YACnB,IAAI,OAAO,MAAM,SAAS;EAIzB,MAAM,MAAM,IAAI,IAAI,KAAK;AACzB,OAAK,MAAM,KAAK,QAAS,KAAI,IAAI,EAAE,aAAa,CAAC;AACjD,SAAO,MAAM,KAAK,IAAI,CAAC,MAAM;GAC5B;AAIH,QAAO;EAAE;EAAY,UAFJ,IAAI,IAAI,IAEI;EAAE;EAC9B"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { bootLocalRpcMode } from "./mode/external.mjs";
|
|
2
|
+
import { bootForkMode } from "./mode/fork.mjs";
|
|
3
|
+
import { bootLiveMode } from "./mode/live.mjs";
|
|
4
|
+
import { bootLocalMode } from "./mode/local.mjs";
|
|
5
|
+
import { Effect } from "effect";
|
|
6
|
+
//#region src/plugins/sui/service.ts
|
|
7
|
+
/** Dispatch on the typed mode and return the mode's boot artifacts.
|
|
8
|
+
*
|
|
9
|
+
* The `ContainerRuntime` is consumed by container-bearing modes
|
|
10
|
+
* only (local + fork); external + live get `null` and a typed
|
|
11
|
+
* refusal would surface if they tried to use it.
|
|
12
|
+
*
|
|
13
|
+
* Stub: the per-mode builders are all stubs; the orchestrator
|
|
14
|
+
* here is the only fully-wired piece. */
|
|
15
|
+
const bootSuiService = (runtime, identity, portBroker, paths, opts) => {
|
|
16
|
+
switch (opts.mode) {
|
|
17
|
+
case "local": return bootLocalMode(runtime, identity, portBroker, opts).pipe(Effect.map(({ resolved, client }) => ({
|
|
18
|
+
resolved,
|
|
19
|
+
client
|
|
20
|
+
})));
|
|
21
|
+
case "local-rpc": return bootLocalRpcMode(opts).pipe(Effect.map(({ resolved, client }) => ({
|
|
22
|
+
resolved,
|
|
23
|
+
client
|
|
24
|
+
})));
|
|
25
|
+
case "live": return bootLiveMode(opts).pipe(Effect.map(({ resolved, client }) => ({
|
|
26
|
+
resolved,
|
|
27
|
+
client
|
|
28
|
+
})));
|
|
29
|
+
case "fork": return bootForkMode(runtime, identity, portBroker, paths, opts).pipe(Effect.map(({ resolved, client }) => ({
|
|
30
|
+
resolved,
|
|
31
|
+
client
|
|
32
|
+
})));
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
//#endregion
|
|
36
|
+
export { bootSuiService };
|
|
37
|
+
|
|
38
|
+
//# sourceMappingURL=service.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.mjs","names":[],"sources":["../../../src/plugins/sui/service.ts"],"sourcesContent":["// Sui plugin — service body.\n//\n// Architecture: the four modes are NOT four separate plugins. They\n// are one plugin with internal mode dispatch. The factory at the\n// barrel (`index.ts`) constructs a `SuiOptions` discriminator from\n// typed options; the `acquire` body below dispatches on `opts.mode`\n// and assembles the mode-appropriate subsystems.\n//\n// What this file does:\n//\n// 1. Receive resolved `SuiOptions`.\n// 2. Dispatch to the right `bootXxxMode` builder.\n// 3. Assemble the mode-aware `SuiClient` (the resolved value).\n//\n// What it does NOT do:\n//\n// - Provision the build container — `chain-build-container.ts`\n// owns that; the plugin acquires it ONLY when needed (Move\n// publish or codegen) via the ArtifactPublisher seam.\n// - Wire the StrategyContributor capabilities — that's the\n// barrel's job; the body just returns the resolved value.\n\nimport { Effect, type Scope } from 'effect';\n\nimport type { SeedManifestMismatchError, SuiPluginError } from './errors.ts';\nimport type { ResolvedSuiNetwork } from './network-resolver.ts';\nimport type { SuiClient } from './mode/shared.ts';\nimport type { SuiOptions } from './mode/spec.ts';\nimport { bootLocalRpcMode } from './mode/external.ts';\nimport { bootForkMode } from './mode/fork.ts';\nimport { bootLiveMode } from './mode/live.ts';\nimport { bootLocalMode } from './mode/local.ts';\nimport type { ContainerRuntime } from '../../contracts/container-runtime.ts';\nimport type { Identity } from '../../substrate/identity.ts';\nimport type { StackPaths } from '../../substrate/runtime/paths.ts';\nimport type { PortBroker } from '../../substrate/runtime/port-broker/index.ts';\n\n/** Bundled result of one acquire — resolved metadata + the user-facing\n * client. The barrel projects this into the Sui resource value; the\n * resolved metadata feeds the Codegenable + NetworkResolver contributions. */\nexport interface SuiBootResult {\n\treadonly resolved: ResolvedSuiNetwork;\n\treadonly client: SuiClient;\n}\n\n/** Dispatch on the typed mode and return the mode's boot artifacts.\n *\n * The `ContainerRuntime` is consumed by container-bearing modes\n * only (local + fork); external + live get `null` and a typed\n * refusal would surface if they tried to use it.\n *\n * Stub: the per-mode builders are all stubs; the orchestrator\n * here is the only fully-wired piece. */\nexport const bootSuiService = (\n\truntime: ContainerRuntime,\n\tidentity: Identity,\n\tportBroker: PortBroker,\n\tpaths: StackPaths,\n\topts: SuiOptions,\n): Effect.Effect<SuiBootResult, SuiPluginError | SeedManifestMismatchError, Scope.Scope> => {\n\tswitch (opts.mode) {\n\t\tcase 'local':\n\t\t\treturn bootLocalMode(runtime, identity, portBroker, opts).pipe(\n\t\t\t\tEffect.map(({ resolved, client }) => ({ resolved, client })),\n\t\t\t);\n\t\tcase 'local-rpc':\n\t\t\treturn bootLocalRpcMode(opts).pipe(\n\t\t\t\tEffect.map(({ resolved, client }) => ({ resolved, client })),\n\t\t\t);\n\t\tcase 'live':\n\t\t\treturn bootLiveMode(opts).pipe(Effect.map(({ resolved, client }) => ({ resolved, client })));\n\t\tcase 'fork':\n\t\t\treturn bootForkMode(runtime, identity, portBroker, paths, opts).pipe(\n\t\t\t\tEffect.map(({ resolved, client }) => ({ resolved, client })),\n\t\t\t);\n\t}\n};\n"],"mappings":";;;;;;;;;;;;;;AAqDA,MAAa,kBACZ,SACA,UACA,YACA,OACA,SAC2F;AAC3F,SAAQ,KAAK,MAAb;EACC,KAAK,QACJ,QAAO,cAAc,SAAS,UAAU,YAAY,KAAK,CAAC,KACzD,OAAO,KAAK,EAAE,UAAU,cAAc;GAAE;GAAU;GAAQ,EAAE,CAC5D;EACF,KAAK,YACJ,QAAO,iBAAiB,KAAK,CAAC,KAC7B,OAAO,KAAK,EAAE,UAAU,cAAc;GAAE;GAAU;GAAQ,EAAE,CAC5D;EACF,KAAK,OACJ,QAAO,aAAa,KAAK,CAAC,KAAK,OAAO,KAAK,EAAE,UAAU,cAAc;GAAE;GAAU;GAAQ,EAAE,CAAC;EAC7F,KAAK,OACJ,QAAO,aAAa,SAAS,UAAU,YAAY,OAAO,KAAK,CAAC,KAC/D,OAAO,KAAK,EAAE,UAAU,cAAc;GAAE;GAAU;GAAQ,EAAE,CAC5D"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
//#region src/plugins/sui/snapshot.ts
|
|
3
|
+
/** Build the Snapshotable contribution for a resolved mode + chain id.
|
|
4
|
+
*
|
|
5
|
+
* Identity guard data lives in `preRestore`: the substrate compares
|
|
6
|
+
* the snapshot's stored chain identity against the resolver's
|
|
7
|
+
* current answer; a mismatch refuses BEFORE any destructive
|
|
8
|
+
* mutation. */
|
|
9
|
+
const makeSnapshotable = (mode, app, stack, chain) => {
|
|
10
|
+
const labels = (role) => ({
|
|
11
|
+
app,
|
|
12
|
+
stack,
|
|
13
|
+
plugin: "sui",
|
|
14
|
+
role
|
|
15
|
+
});
|
|
16
|
+
switch (mode) {
|
|
17
|
+
case "local": return {
|
|
18
|
+
kind: "snapshotable",
|
|
19
|
+
subtrees: [],
|
|
20
|
+
managedContainers: [labels("validator"), labels("postgres")],
|
|
21
|
+
missingTolerance: "fine",
|
|
22
|
+
preRestore: Effect.succeed({
|
|
23
|
+
kind: "sui-chain",
|
|
24
|
+
chain
|
|
25
|
+
}),
|
|
26
|
+
postRestore: Effect.void
|
|
27
|
+
};
|
|
28
|
+
case "local-rpc":
|
|
29
|
+
case "live": return {
|
|
30
|
+
kind: "snapshotable",
|
|
31
|
+
subtrees: [],
|
|
32
|
+
missingTolerance: "fine",
|
|
33
|
+
preRestore: Effect.succeed({
|
|
34
|
+
kind: "sui-chain",
|
|
35
|
+
chain
|
|
36
|
+
})
|
|
37
|
+
};
|
|
38
|
+
case "fork": return {
|
|
39
|
+
kind: "snapshotable",
|
|
40
|
+
subtrees: ["sui-fork/"],
|
|
41
|
+
managedContainers: [labels("fork-validator")],
|
|
42
|
+
missingTolerance: "fine",
|
|
43
|
+
preRestore: Effect.succeed({
|
|
44
|
+
kind: "sui-chain",
|
|
45
|
+
chain
|
|
46
|
+
})
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
//#endregion
|
|
51
|
+
export { makeSnapshotable };
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=snapshot.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshot.mjs","names":[],"sources":["../../../src/plugins/sui/snapshot.ts"],"sourcesContent":["// Sui plugin — Snapshotable contribution.\n//\n// Architecture §3: the snapshot orchestrator captures and restores\n// without naming the plugin. Sui's contribution is mode-aware:\n//\n// - local mode — chain state (localnet validator) MUST live in\n// the writable container layer (NOT a named\n// volume), so `docker commit` captures it. Same\n// for the postgres indexer (PGDATA relocated off\n// the inherited VOLUME path).\n//\n// - external — no container, no snapshot. The `SnapshotableDecl`\n// has `missingTolerance: 'fine'` so restore against\n// a snapshot taken in local mode is a clean no-op.\n//\n// - live — same as external; no snapshot.\n//\n// - fork — data dir is a bind-mount; snapshot capture is\n// handled separately by the snapshot orchestrator.\n// This file emits the bind-mount subtree as the\n// capture descriptor.\n//\n// Chain identity (chainId + per-mode cluster id) is the canonical\n// identity-guard contribution from this plugin. The substrate's\n// pre-restore hook reads it; identity mismatch refuses the restore.\n\nimport { Effect } from 'effect';\n\nimport type { ContainerLabelTuple, SnapshotableDecl } from '../../contracts/snapshotable.ts';\nimport type { SuiPluginMode } from './mode/spec.ts';\n\n/** Build the Snapshotable contribution for a resolved mode + chain id.\n *\n * Identity guard data lives in `preRestore`: the substrate compares\n * the snapshot's stored chain identity against the resolver's\n * current answer; a mismatch refuses BEFORE any destructive\n * mutation. */\nexport const makeSnapshotable = (\n\tmode: SuiPluginMode,\n\tapp: string,\n\tstack: string,\n\tchain: string,\n): SnapshotableDecl => {\n\tconst labels = (role: string): ContainerLabelTuple => ({\n\t\tapp,\n\t\tstack,\n\t\tplugin: 'sui',\n\t\trole,\n\t});\n\n\tswitch (mode) {\n\t\tcase 'local': {\n\t\t\t// Validator's writable layer + postgres indexer's writable\n\t\t\t// layer. The runtime adapter pauses both before commit;\n\t\t\t// architecture default grace is \"pause container\".\n\t\t\treturn {\n\t\t\t\tkind: 'snapshotable',\n\t\t\t\t// Chain state lives in the writable container layer\n\t\t\t\t// — declared via `managedContainers`, not subtrees.\n\t\t\t\tsubtrees: [],\n\t\t\t\tmanagedContainers: [labels('validator'), labels('postgres')],\n\t\t\t\tmissingTolerance: 'fine',\n\t\t\t\tpreRestore: Effect.succeed({ kind: 'sui-chain', chain }),\n\t\t\t\tpostRestore: Effect.void,\n\t\t\t};\n\t\t}\n\t\tcase 'local-rpc':\n\t\tcase 'live': {\n\t\t\t// No container, no capture. The decl still exists so the\n\t\t\t// identity guard fires on restore (e.g. restoring a local\n\t\t\t// snapshot while the resolver says \"live testnet\" — the\n\t\t\t// identity-guard refuses).\n\t\t\treturn {\n\t\t\t\tkind: 'snapshotable',\n\t\t\t\tsubtrees: [],\n\t\t\t\tmissingTolerance: 'fine',\n\t\t\t\tpreRestore: Effect.succeed({ kind: 'sui-chain', chain }),\n\t\t\t};\n\t\t}\n\t\tcase 'fork': {\n\t\t\t// Data dir + meta are bind-mounted host paths; the\n\t\t\t// orchestrator walks the declared subtree. The fork\n\t\t\t// container itself is also captured (writable layer for\n\t\t\t// dep + cache state).\n\t\t\treturn {\n\t\t\t\tkind: 'snapshotable',\n\t\t\t\tsubtrees: ['sui-fork/'],\n\t\t\t\tmanagedContainers: [labels('fork-validator')],\n\t\t\t\tmissingTolerance: 'fine',\n\t\t\t\tpreRestore: Effect.succeed({ kind: 'sui-chain', chain }),\n\t\t\t};\n\t\t}\n\t}\n};\n"],"mappings":";;;;;;;;AAqCA,MAAa,oBACZ,MACA,KACA,OACA,UACsB;CACtB,MAAM,UAAU,UAAuC;EACtD;EACA;EACA,QAAQ;EACR;EACA;AAED,SAAQ,MAAR;EACC,KAAK,QAIJ,QAAO;GACN,MAAM;GAGN,UAAU,EAAE;GACZ,mBAAmB,CAAC,OAAO,YAAY,EAAE,OAAO,WAAW,CAAC;GAC5D,kBAAkB;GAClB,YAAY,OAAO,QAAQ;IAAE,MAAM;IAAa;IAAO,CAAC;GACxD,aAAa,OAAO;GACpB;EAEF,KAAK;EACL,KAAK,OAKJ,QAAO;GACN,MAAM;GACN,UAAU,EAAE;GACZ,kBAAkB;GAClB,YAAY,OAAO,QAAQ;IAAE,MAAM;IAAa;IAAO,CAAC;GACxD;EAEF,KAAK,OAKJ,QAAO;GACN,MAAM;GACN,UAAU,CAAC,YAAY;GACvB,mBAAmB,CAAC,OAAO,iBAAiB,CAAC;GAC7C,kBAAkB;GAClB,YAAY,OAAO,QAAQ;IAAE,MAAM;IAAa;IAAO,CAAC;GACxD"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//#region src/plugins/wallet/codegen.d.ts
|
|
2
|
+
/** The typed shape `dapp-kit/config.ts` exports. Downstream consumers
|
|
3
|
+
* (the user-app's dapp-kit boot code) import and consume this.
|
|
4
|
+
*
|
|
5
|
+
* Field shape mirrors what `DevstackSignerAdapter` needs:
|
|
6
|
+
*
|
|
7
|
+
* - `walletUrl` : the wallet HTTP server's URL (router-fronted
|
|
8
|
+
* host form when available, direct-loopback
|
|
9
|
+
* fallback otherwise).
|
|
10
|
+
* - `pairUrl` : `walletUrl` + `/#token=<32-hex>` (single
|
|
11
|
+
* source of truth for the token).
|
|
12
|
+
* - `protocolPaths` : path constants the adapter reads. Mirrored
|
|
13
|
+
* here so the adapter doesn't depend on a
|
|
14
|
+
* separate import.
|
|
15
|
+
* - `chain` : Sui chain id the wallet's accounts are
|
|
16
|
+
* scoped to. Surfaced so dapp-kit can pin its
|
|
17
|
+
* active chain.
|
|
18
|
+
*/
|
|
19
|
+
interface DappKitConfigBindings {
|
|
20
|
+
readonly walletUrl: string;
|
|
21
|
+
readonly pairUrl: string;
|
|
22
|
+
readonly chain: string;
|
|
23
|
+
readonly protocolPaths: {
|
|
24
|
+
readonly health: string;
|
|
25
|
+
readonly accounts: string;
|
|
26
|
+
readonly signTransaction: string;
|
|
27
|
+
readonly signPersonalMessage: string;
|
|
28
|
+
readonly execute: string;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { DappKitConfigBindings };
|
|
33
|
+
//# sourceMappingURL=codegen.d.mts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { redactToken } from "./pairing.mjs";
|
|
2
|
+
import { Effect } from "effect";
|
|
3
|
+
//#region src/plugins/wallet/codegen.ts
|
|
4
|
+
/**
|
|
5
|
+
* Construct the Codegenable contribution.
|
|
6
|
+
*
|
|
7
|
+
* Emits `dapp-kit/config.ts` with `sensitive: true` → the orchestrator
|
|
8
|
+
* writes the file with `0o600` and gitignores it. The emitted shape
|
|
9
|
+
* carries the unredacted pair URL; the side-channel token file is
|
|
10
|
+
* also `0o600`.
|
|
11
|
+
*
|
|
12
|
+
* The `resolved` arg is supplied AFTER acquire (the substrate's
|
|
13
|
+
* "resolve-once" memo). At factory time the barrel passes a
|
|
14
|
+
* placeholder so the type plumbing works; at codegen time the
|
|
15
|
+
* substrate re-evaluates with the resolved values.
|
|
16
|
+
*/
|
|
17
|
+
const makeWalletCodegen = (resolved) => ({
|
|
18
|
+
kind: "codegenable",
|
|
19
|
+
emitterName: "dapp-kit-config",
|
|
20
|
+
outputPath: "dapp-kit/config.ts",
|
|
21
|
+
sensitive: true,
|
|
22
|
+
emit: (ctx) => Effect.gen(function* () {
|
|
23
|
+
yield* Effect.annotateCurrentSpan({
|
|
24
|
+
"wallet.codegen.pairUrl": redactToken(resolved.pairUrl),
|
|
25
|
+
"wallet.codegen.walletUrl": resolved.walletUrl
|
|
26
|
+
});
|
|
27
|
+
ctx.exportConst("dappKitConfig", resolved);
|
|
28
|
+
return ctx.done();
|
|
29
|
+
})
|
|
30
|
+
});
|
|
31
|
+
//#endregion
|
|
32
|
+
export { makeWalletCodegen };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=codegen.mjs.map
|