@mysten-incubation/devstack 0.1.0 → 0.2.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/README.md +7 -4
- package/dashboard-ui/assets/grpc-a4usE3Nk.js +3 -0
- package/dashboard-ui/assets/index-B82Bh84P.css +1 -0
- package/dashboard-ui/assets/index-CRYJ4pru.js +1277 -0
- package/dashboard-ui/index.html +2 -2
- package/dist/api/define-capabilities.d.mts +1 -20
- package/dist/api/define-capabilities.mjs +15 -22
- package/dist/api/define-capabilities.mjs.map +1 -1
- package/dist/api/define-devstack-with.d.mts +7 -1
- package/dist/api/define-devstack-with.mjs.map +1 -1
- package/dist/api/define-devstack.mjs.map +1 -1
- package/dist/api/define-plugin.d.mts +2 -1
- package/dist/api/inference-network.d.mts +31 -17
- package/dist/api/inference-network.mjs +40 -43
- package/dist/api/inference-network.mjs.map +1 -1
- package/dist/api/load-config.mjs +88 -0
- package/dist/api/load-config.mjs.map +1 -0
- package/dist/api/mode-narrowed-factory.d.mts +1 -1
- package/dist/api/mode-narrowed-factory.mjs.map +1 -1
- package/dist/api/run-stack-internal.mjs +202 -0
- package/dist/api/run-stack-internal.mjs.map +1 -0
- package/dist/api/run-stack.d.mts +82 -31
- package/dist/api/run-stack.mjs +22 -141
- package/dist/api/run-stack.mjs.map +1 -1
- package/dist/build-integrations/dapp-kit/index.d.mts +61 -0
- package/dist/build-integrations/dapp-kit/index.mjs +58 -0
- package/dist/build-integrations/dapp-kit/index.mjs.map +1 -0
- package/dist/build-integrations/playwright/config.d.mts +1 -30
- package/dist/build-integrations/playwright/config.mjs +1 -27
- package/dist/build-integrations/playwright/config.mjs.map +1 -1
- package/dist/build-integrations/playwright/errors.d.mts +4 -7
- package/dist/build-integrations/playwright/errors.mjs.map +1 -1
- package/dist/build-integrations/playwright/global-setup.d.mts +42 -71
- package/dist/build-integrations/playwright/global-setup.mjs +142 -218
- package/dist/build-integrations/playwright/global-setup.mjs.map +1 -1
- package/dist/build-integrations/playwright/index.d.mts +2 -2
- package/dist/build-integrations/playwright/index.mjs +2 -2
- package/dist/build-integrations/playwright/stack-context.d.mts +3 -1
- package/dist/build-integrations/playwright/stack-context.mjs +4 -2
- package/dist/build-integrations/playwright/stack-context.mjs.map +1 -1
- package/dist/build-integrations/playwright/wallet-context.mjs +44 -19
- package/dist/build-integrations/playwright/wallet-context.mjs.map +1 -1
- package/dist/build-integrations/runtime/cold-start-url.mjs.map +1 -1
- package/dist/build-integrations/runtime/conventional-routes.mjs.map +1 -1
- package/dist/build-integrations/runtime/dapp-kit-slot.mjs.map +1 -1
- package/dist/build-integrations/runtime/discover.d.mts +6 -4
- package/dist/build-integrations/runtime/discover.mjs +15 -4
- package/dist/build-integrations/runtime/discover.mjs.map +1 -1
- package/dist/build-integrations/runtime/endpoint-registry.mjs.map +1 -1
- package/dist/build-integrations/runtime/errors.mjs.map +1 -1
- package/dist/build-integrations/runtime/read-stack-context.mjs +3 -3
- package/dist/build-integrations/runtime/read-stack-context.mjs.map +1 -1
- package/dist/build-integrations/runtime/resolve-discovery-env.d.mts +23 -7
- package/dist/build-integrations/runtime/resolve-discovery-env.mjs +25 -12
- package/dist/build-integrations/runtime/resolve-discovery-env.mjs.map +1 -1
- package/dist/build-integrations/runtime/stack-context.d.mts +2 -2
- package/dist/build-integrations/vite/index.d.mts +84 -19
- package/dist/build-integrations/vite/index.mjs +203 -28
- package/dist/build-integrations/vite/index.mjs.map +1 -1
- package/dist/build-integrations/vitest/config.d.mts +20 -2
- package/dist/build-integrations/vitest/config.mjs +16 -4
- package/dist/build-integrations/vitest/config.mjs.map +1 -1
- package/dist/build-integrations/vitest/env.d.mts +18 -10
- package/dist/build-integrations/vitest/env.mjs +11 -10
- package/dist/build-integrations/vitest/env.mjs.map +1 -1
- package/dist/build-integrations/vitest/errors.d.mts +7 -11
- package/dist/build-integrations/vitest/errors.mjs +3 -4
- package/dist/build-integrations/vitest/errors.mjs.map +1 -1
- package/dist/build-integrations/vitest/global-setup.d.mts +35 -0
- package/dist/build-integrations/vitest/global-setup.mjs +156 -0
- package/dist/build-integrations/vitest/global-setup.mjs.map +1 -0
- package/dist/build-integrations/vitest/index.d.mts +3 -2
- package/dist/build-integrations/vitest/index.mjs +3 -2
- package/dist/build-integrations/vitest/setup.mjs +2 -2
- package/dist/build-integrations/vitest/setup.mjs.map +1 -1
- package/dist/build-integrations/vitest/stack-context.d.mts +5 -3
- package/dist/build-integrations/vitest/stack-context.mjs +3 -2
- package/dist/build-integrations/vitest/stack-context.mjs.map +1 -1
- package/dist/cli/bail.mjs.map +1 -1
- package/dist/cli/doctor-probes.mjs +1 -3
- package/dist/cli/doctor-probes.mjs.map +1 -1
- package/dist/cli/main.d.mts +23 -1
- package/dist/cli/main.mjs +63 -8
- package/dist/cli/main.mjs.map +1 -1
- package/dist/cli/prune-direct.mjs.map +1 -1
- package/dist/cli/snapshot-reader.mjs.map +1 -1
- package/dist/cli/up-lifecycle.mjs.map +1 -1
- package/dist/cli/wirings/apply.mjs +28 -21
- package/dist/cli/wirings/apply.mjs.map +1 -1
- package/dist/cli/wirings/codegen.mjs +108 -0
- package/dist/cli/wirings/codegen.mjs.map +1 -0
- package/dist/cli/wirings/config-loader.mjs +12 -62
- package/dist/cli/wirings/config-loader.mjs.map +1 -1
- package/dist/cli/wirings/dump-ids.mjs +86 -0
- package/dist/cli/wirings/dump-ids.mjs.map +1 -0
- package/dist/cli/wirings/engine-command.mjs +1 -1
- package/dist/cli/wirings/engine-command.mjs.map +1 -1
- package/dist/cli/wirings/identity.mjs +2 -2
- package/dist/cli/wirings/identity.mjs.map +1 -1
- package/dist/cli/wirings/provide-file-system.mjs.map +1 -1
- package/dist/cli/wirings/read-devstack-version.mjs +17 -0
- package/dist/cli/wirings/read-devstack-version.mjs.map +1 -0
- package/dist/cli/wirings/snapshot.mjs +27 -34
- package/dist/cli/wirings/snapshot.mjs.map +1 -1
- package/dist/cli/wirings/up-ipc.mjs +147 -0
- package/dist/cli/wirings/up-ipc.mjs.map +1 -0
- package/dist/cli/wirings/up.mjs +218 -198
- package/dist/cli/wirings/up.mjs.map +1 -1
- package/dist/cli/wirings/wipe.mjs +1 -1
- package/dist/cli/wirings/wipe.mjs.map +1 -1
- package/dist/contracts/chain-probe.d.mts +1 -1
- package/dist/contracts/chain-probe.mjs +1 -1
- package/dist/contracts/chain-probe.mjs.map +1 -1
- package/dist/contracts/codegenable.d.mts +60 -6
- package/dist/contracts/codegenable.mjs +28 -0
- package/dist/contracts/codegenable.mjs.map +1 -0
- package/dist/contracts/config-bindings.mjs +162 -0
- package/dist/contracts/config-bindings.mjs.map +1 -0
- package/dist/contracts/container-runtime.d.mts +23 -17
- package/dist/contracts/plugin-expander.mjs.map +1 -1
- package/dist/contracts/snapshotable.d.mts +5 -7
- package/dist/contracts/wallet-protocol.d.mts +2 -5
- package/dist/contracts/wallet-protocol.mjs +2 -5
- package/dist/contracts/wallet-protocol.mjs.map +1 -1
- package/dist/index.d.mts +21 -26
- package/dist/index.mjs +8 -9
- package/dist/orchestrators/boot.d.mts +28 -0
- package/dist/orchestrators/boot.mjs +440 -0
- package/dist/orchestrators/boot.mjs.map +1 -0
- package/dist/orchestrators/codegen/bindings.d.mts +13 -1
- package/dist/orchestrators/codegen/bindings.mjs +23 -9
- package/dist/orchestrators/codegen/bindings.mjs.map +1 -1
- package/dist/orchestrators/codegen/config-runtime.mjs +208 -0
- package/dist/orchestrators/codegen/config-runtime.mjs.map +1 -0
- package/dist/orchestrators/codegen/emit.mjs +1 -1
- package/dist/orchestrators/codegen/emit.mjs.map +1 -1
- package/dist/orchestrators/codegen/errors.mjs +21 -1
- package/dist/orchestrators/codegen/errors.mjs.map +1 -1
- package/dist/orchestrators/codegen/format.mjs +2 -0
- package/dist/orchestrators/codegen/format.mjs.map +1 -1
- package/dist/orchestrators/codegen/gitignore.mjs +30 -11
- package/dist/orchestrators/codegen/gitignore.mjs.map +1 -1
- package/dist/orchestrators/codegen/id-config.mjs +107 -0
- package/dist/orchestrators/codegen/id-config.mjs.map +1 -0
- package/dist/orchestrators/codegen/output-location.mjs +23 -31
- package/dist/orchestrators/codegen/output-location.mjs.map +1 -1
- package/dist/orchestrators/codegen/paths.mjs +8 -1
- package/dist/orchestrators/codegen/paths.mjs.map +1 -1
- package/dist/orchestrators/codegen/permissions.mjs.map +1 -1
- package/dist/orchestrators/codegen/service.mjs +286 -58
- package/dist/orchestrators/codegen/service.mjs.map +1 -1
- package/dist/orchestrators/layers.mjs +31 -0
- package/dist/orchestrators/layers.mjs.map +1 -0
- package/dist/orchestrators/lifecycle-prune/errors.mjs.map +1 -1
- package/dist/orchestrators/lifecycle-prune/index.mjs +8 -10
- package/dist/orchestrators/lifecycle-prune/index.mjs.map +1 -1
- package/dist/orchestrators/network-options.d.mts +52 -0
- package/dist/orchestrators/network-options.mjs +43 -0
- package/dist/orchestrators/network-options.mjs.map +1 -0
- package/dist/orchestrators/router/cleanup.mjs.map +1 -1
- package/dist/orchestrators/router/cors.mjs.map +1 -1
- package/dist/orchestrators/router/entrypoints.mjs.map +1 -1
- package/dist/orchestrators/router/errors.mjs.map +1 -1
- package/dist/orchestrators/router/file-provider.mjs.map +1 -1
- package/dist/orchestrators/router/hostname.mjs.map +1 -1
- package/dist/orchestrators/router/profile.mjs +1 -1
- package/dist/orchestrators/router/profile.mjs.map +1 -1
- package/dist/orchestrators/router/service.d.mts +2 -2
- package/dist/orchestrators/router/service.mjs +12 -27
- package/dist/orchestrators/router/service.mjs.map +1 -1
- package/dist/orchestrators/router/traefik-container.mjs +1 -1
- package/dist/orchestrators/router/traefik-container.mjs.map +1 -1
- package/dist/orchestrators/snapshot/capture.mjs +171 -195
- package/dist/orchestrators/snapshot/capture.mjs.map +1 -1
- package/dist/orchestrators/snapshot/descriptor.d.mts +1 -1
- package/dist/orchestrators/snapshot/descriptor.mjs +53 -11
- package/dist/orchestrators/snapshot/descriptor.mjs.map +1 -1
- package/dist/orchestrators/snapshot/identity-guard.mjs +3 -5
- package/dist/orchestrators/snapshot/identity-guard.mjs.map +1 -1
- package/dist/orchestrators/snapshot/image-bundle-tags.mjs +32 -101
- package/dist/orchestrators/snapshot/image-bundle-tags.mjs.map +1 -1
- package/dist/orchestrators/snapshot/index.mjs +1 -4
- package/dist/orchestrators/snapshot/integrity.mjs.map +1 -1
- package/dist/orchestrators/snapshot/interrupted-restore.mjs +116 -0
- package/dist/orchestrators/snapshot/interrupted-restore.mjs.map +1 -0
- package/dist/orchestrators/snapshot/phase-error.mjs.map +1 -1
- package/dist/orchestrators/snapshot/prune.mjs +40 -31
- package/dist/orchestrators/snapshot/prune.mjs.map +1 -1
- package/dist/orchestrators/snapshot/restore.mjs +221 -196
- package/dist/orchestrators/snapshot/restore.mjs.map +1 -1
- package/dist/orchestrators/snapshot/service.mjs +72 -62
- package/dist/orchestrators/snapshot/service.mjs.map +1 -1
- package/dist/orchestrators/snapshot/wipe.mjs +67 -56
- package/dist/orchestrators/snapshot/wipe.mjs.map +1 -1
- package/dist/plugins/account/codegen.mjs +3 -0
- package/dist/plugins/account/codegen.mjs.map +1 -1
- package/dist/plugins/account/errors.d.mts +2 -2
- package/dist/plugins/account/errors.mjs +1 -4
- package/dist/plugins/account/errors.mjs.map +1 -1
- package/dist/plugins/account/funding.mjs +3 -27
- package/dist/plugins/account/funding.mjs.map +1 -1
- package/dist/plugins/account/index.d.mts +3 -8
- package/dist/plugins/account/index.mjs +71 -35
- package/dist/plugins/account/index.mjs.map +1 -1
- package/dist/plugins/account/keypair.d.mts +8 -7
- package/dist/plugins/account/keypair.mjs +5 -18
- package/dist/plugins/account/keypair.mjs.map +1 -1
- package/dist/plugins/account/lease.mjs.map +1 -1
- package/dist/plugins/account/registry.d.mts +1 -46
- package/dist/plugins/account/registry.mjs.map +1 -1
- package/dist/plugins/account/service.d.mts +43 -34
- package/dist/plugins/account/service.mjs +9 -54
- package/dist/plugins/account/service.mjs.map +1 -1
- package/dist/plugins/account/snapshot.mjs.map +1 -1
- package/dist/plugins/account/variants/ephemeral.mjs.map +1 -1
- package/dist/plugins/account/variants/impersonate.mjs.map +1 -1
- package/dist/plugins/account/variants/signer.mjs.map +1 -1
- package/dist/plugins/action/discriminator.mjs.map +1 -1
- package/dist/plugins/action/errors.mjs +1 -4
- package/dist/plugins/action/errors.mjs.map +1 -1
- package/dist/plugins/action/execute.mjs +3 -4
- package/dist/plugins/action/execute.mjs.map +1 -1
- package/dist/plugins/action/index.d.mts +2 -2
- package/dist/plugins/action/index.mjs +7 -11
- package/dist/plugins/action/index.mjs.map +1 -1
- package/dist/plugins/action/service.d.mts +5 -7
- package/dist/plugins/action/service.mjs +2 -16
- package/dist/plugins/action/service.mjs.map +1 -1
- package/dist/plugins/coin/address-resolution.mjs.map +1 -1
- package/dist/plugins/coin/codegen.mjs +97 -16
- package/dist/plugins/coin/codegen.mjs.map +1 -1
- package/dist/plugins/coin/discovery.mjs.map +1 -1
- package/dist/plugins/coin/errors.mjs +1 -4
- package/dist/plugins/coin/errors.mjs.map +1 -1
- package/dist/plugins/coin/index.d.mts +4 -34
- package/dist/plugins/coin/index.mjs +47 -28
- package/dist/plugins/coin/index.mjs.map +1 -1
- package/dist/plugins/coin/metadata.d.mts +1 -0
- package/dist/plugins/coin/metadata.mjs +8 -9
- package/dist/plugins/coin/metadata.mjs.map +1 -1
- package/dist/plugins/coin/mint.mjs +7 -21
- package/dist/plugins/coin/mint.mjs.map +1 -1
- package/dist/plugins/coin/registry.mjs +33 -20
- package/dist/plugins/coin/registry.mjs.map +1 -1
- package/dist/plugins/coin/service.d.mts +1 -1
- package/dist/plugins/coin/service.mjs +1 -8
- package/dist/plugins/coin/service.mjs.map +1 -1
- package/dist/plugins/coin/snapshot.mjs.map +1 -1
- package/dist/plugins/coin/type-strings.mjs.map +1 -1
- package/dist/plugins/dashboard/domain.mjs +106 -167
- package/dist/plugins/dashboard/domain.mjs.map +1 -1
- package/dist/plugins/dashboard/index.mjs +13 -13
- package/dist/plugins/dashboard/index.mjs.map +1 -1
- package/dist/plugins/dashboard/origin-policy.mjs +3 -3
- package/dist/plugins/dashboard/origin-policy.mjs.map +1 -1
- package/dist/plugins/dashboard/routable.mjs.map +1 -1
- package/dist/plugins/dashboard/schema/builder.mjs.map +1 -1
- package/dist/plugins/dashboard/schema/enums.mjs.map +1 -1
- package/dist/plugins/dashboard/schema/root.mjs +23 -44
- package/dist/plugins/dashboard/schema/root.mjs.map +1 -1
- package/dist/plugins/dashboard/schema/types.mjs +37 -91
- package/dist/plugins/dashboard/schema/types.mjs.map +1 -1
- package/dist/plugins/dashboard/schema.mjs.map +1 -1
- package/dist/plugins/dashboard/server.mjs.map +1 -1
- package/dist/plugins/deepbook/codegen.d.mts +12 -11
- package/dist/plugins/deepbook/codegen.mjs +108 -11
- package/dist/plugins/deepbook/codegen.mjs.map +1 -1
- package/dist/plugins/deepbook/deploy.mjs +7 -14
- package/dist/plugins/deepbook/deploy.mjs.map +1 -1
- package/dist/plugins/deepbook/errors.mjs +4 -2
- package/dist/plugins/deepbook/errors.mjs.map +1 -1
- package/dist/plugins/deepbook/faucet-strategy.mjs +4 -10
- package/dist/plugins/deepbook/faucet-strategy.mjs.map +1 -1
- package/dist/plugins/deepbook/hash.mjs.map +1 -1
- package/dist/plugins/deepbook/index.d.mts +38 -34
- package/dist/plugins/deepbook/index.mjs +133 -64
- package/dist/plugins/deepbook/index.mjs.map +1 -1
- package/dist/plugins/deepbook/plugin-key.mjs.map +1 -1
- package/dist/plugins/deepbook/pyth/index.mjs +4 -8
- package/dist/plugins/deepbook/pyth/index.mjs.map +1 -1
- package/dist/plugins/deepbook/snapshot.mjs +0 -1
- package/dist/plugins/deepbook/snapshot.mjs.map +1 -1
- package/dist/plugins/deepbook/type-strings.mjs.map +1 -1
- package/dist/plugins/deepbook/types.d.mts +2 -1
- package/dist/plugins/deepbook/types.mjs.map +1 -1
- package/dist/plugins/faucet/dispatcher.d.mts +3 -3
- package/dist/plugins/faucet/dispatcher.mjs.map +1 -1
- package/dist/plugins/faucet/errors.mjs.map +1 -1
- package/dist/plugins/faucet/http.mjs +2 -10
- package/dist/plugins/faucet/http.mjs.map +1 -1
- package/dist/plugins/faucet/index.mjs +0 -1
- package/dist/plugins/faucet/index.mjs.map +1 -1
- package/dist/plugins/host-service/errors.d.mts +1 -3
- package/dist/plugins/host-service/errors.mjs +1 -2
- package/dist/plugins/host-service/errors.mjs.map +1 -1
- package/dist/plugins/host-service/index.d.mts +1 -2
- package/dist/plugins/host-service/index.mjs +11 -11
- package/dist/plugins/host-service/index.mjs.map +1 -1
- package/dist/plugins/host-service/routable.mjs.map +1 -1
- package/dist/plugins/host-service/service.mjs +13 -13
- package/dist/plugins/host-service/service.mjs.map +1 -1
- package/dist/plugins/internal/acquire-on-chain-artifact.mjs.map +1 -1
- package/dist/plugins/internal/codegen-helpers.mjs +2 -0
- package/dist/plugins/internal/codegen-helpers.mjs.map +1 -1
- package/dist/plugins/internal/funding-failure-error.mjs.map +1 -1
- package/dist/plugins/{postgres → internal/postgres-sidecar}/connection.mjs +1 -1
- package/dist/plugins/internal/postgres-sidecar/connection.mjs.map +1 -0
- package/dist/plugins/{postgres → internal/postgres-sidecar}/db-ensure.mjs +30 -16
- package/dist/plugins/internal/postgres-sidecar/db-ensure.mjs.map +1 -0
- package/dist/plugins/internal/postgres-sidecar/errors.mjs +21 -0
- package/dist/plugins/internal/postgres-sidecar/errors.mjs.map +1 -0
- package/dist/{substrate/runtime/scoped-multimap → plugins/internal/postgres-sidecar}/index.mjs +1 -0
- package/dist/plugins/internal/postgres-sidecar/service.mjs +121 -0
- package/dist/plugins/internal/postgres-sidecar/service.mjs.map +1 -0
- package/dist/plugins/package/build.mjs +2 -2
- package/dist/plugins/package/build.mjs.map +1 -1
- package/dist/plugins/package/codegen.d.mts +7 -14
- package/dist/plugins/package/codegen.mjs +187 -59
- package/dist/plugins/package/codegen.mjs.map +1 -1
- package/dist/plugins/package/dep-resolution.mjs +51 -3
- package/dist/plugins/package/dep-resolution.mjs.map +1 -1
- package/dist/plugins/package/errors.mjs +1 -4
- package/dist/plugins/package/errors.mjs.map +1 -1
- package/dist/plugins/package/git-source.d.mts +18 -0
- package/dist/plugins/package/git-source.mjs +119 -0
- package/dist/plugins/package/git-source.mjs.map +1 -0
- package/dist/plugins/package/index.d.mts +28 -19
- package/dist/plugins/package/index.mjs +107 -32
- package/dist/plugins/package/index.mjs.map +1 -1
- package/dist/plugins/package/mode-known.mjs +2 -2
- package/dist/plugins/package/mode-known.mjs.map +1 -1
- package/dist/plugins/package/mode-local.mjs +18 -35
- package/dist/plugins/package/mode-local.mjs.map +1 -1
- package/dist/plugins/package/publish-executor.mjs +13 -8
- package/dist/plugins/package/publish-executor.mjs.map +1 -1
- package/dist/plugins/package/publish-output.d.mts +1 -11
- package/dist/plugins/package/publish-output.mjs +1 -9
- package/dist/plugins/package/publish-output.mjs.map +1 -1
- package/dist/plugins/package/registry.d.mts +1 -1
- package/dist/plugins/package/registry.mjs +26 -14
- package/dist/plugins/package/registry.mjs.map +1 -1
- package/dist/plugins/package/service.mjs.map +1 -1
- package/dist/plugins/package/snapshot.mjs.map +1 -1
- package/dist/plugins/router-entrypoints.mjs +1 -3
- package/dist/plugins/router-entrypoints.mjs.map +1 -1
- package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs +1 -2
- package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs.map +1 -1
- package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs +1 -6
- package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs.map +1 -1
- package/dist/plugins/seal/codegen.d.mts +1 -5
- package/dist/plugins/seal/codegen.mjs +83 -12
- package/dist/plugins/seal/codegen.mjs.map +1 -1
- package/dist/plugins/seal/config-render.mjs +2 -6
- package/dist/plugins/seal/config-render.mjs.map +1 -1
- package/dist/plugins/seal/deploy.mjs +18 -29
- package/dist/plugins/seal/deploy.mjs.map +1 -1
- package/dist/plugins/seal/errors.d.mts +4 -5
- package/dist/plugins/seal/errors.mjs +1 -8
- package/dist/plugins/seal/errors.mjs.map +1 -1
- package/dist/plugins/seal/index.d.mts +7 -28
- package/dist/plugins/seal/index.mjs +69 -47
- package/dist/plugins/seal/index.mjs.map +1 -1
- package/dist/plugins/seal/key-manager.mjs.map +1 -1
- package/dist/plugins/seal/key-server.mjs +1 -6
- package/dist/plugins/seal/key-server.mjs.map +1 -1
- package/dist/plugins/seal/keygen.mjs +2 -3
- package/dist/plugins/seal/keygen.mjs.map +1 -1
- package/dist/plugins/seal/mode/fork-known.mjs.map +1 -1
- package/dist/plugins/seal/mode/live.mjs +1 -1
- package/dist/plugins/seal/mode/live.mjs.map +1 -1
- package/dist/plugins/seal/mode/local-keygen.mjs +4 -10
- package/dist/plugins/seal/mode/local-keygen.mjs.map +1 -1
- package/dist/plugins/seal/plugin-key.mjs.map +1 -1
- package/dist/plugins/seal/registry-publish.mjs.map +1 -1
- package/dist/plugins/seal/routable.mjs.map +1 -1
- package/dist/plugins/seal/service.mjs.map +1 -1
- package/dist/plugins/seal/snapshot.mjs +1 -2
- package/dist/plugins/seal/snapshot.mjs.map +1 -1
- package/dist/plugins/sui/auto-tick.mjs +5 -5
- package/dist/plugins/sui/auto-tick.mjs.map +1 -1
- package/dist/plugins/sui/chain-build-container.mjs +2 -2
- package/dist/plugins/sui/chain-build-container.mjs.map +1 -1
- package/dist/plugins/sui/chain-probe.mjs +4 -4
- package/dist/plugins/sui/chain-probe.mjs.map +1 -1
- package/dist/plugins/sui/codegen.d.mts +9 -7
- package/dist/plugins/sui/codegen.mjs +49 -46
- package/dist/plugins/sui/codegen.mjs.map +1 -1
- package/dist/plugins/sui/errors.d.mts +1 -1
- package/dist/plugins/sui/errors.mjs +1 -9
- package/dist/plugins/sui/errors.mjs.map +1 -1
- package/dist/{substrate/runtime/sui-execute → plugins/sui/exec}/index.d.mts +1 -1
- package/dist/{substrate/runtime/sui-execute → plugins/sui/exec}/index.mjs +3 -7
- package/dist/plugins/sui/exec/index.mjs.map +1 -0
- package/dist/{substrate/runtime/sui-execute → plugins/sui/exec}/sign-and-dispatch.mjs +1 -1
- package/dist/plugins/sui/exec/sign-and-dispatch.mjs.map +1 -0
- package/dist/plugins/sui/fork-faucet-strategy.mjs +2 -6
- package/dist/plugins/sui/fork-faucet-strategy.mjs.map +1 -1
- package/dist/plugins/sui/fork-orchestration.mjs +13 -23
- package/dist/plugins/sui/fork-orchestration.mjs.map +1 -1
- package/dist/plugins/sui/fork-transaction.mjs.map +1 -1
- package/dist/plugins/sui/index.d.mts +34 -83
- package/dist/plugins/sui/index.mjs +200 -68
- package/dist/plugins/sui/index.mjs.map +1 -1
- package/dist/{substrate/runtime/sui-ledger → plugins/sui/ledger}/object-ref.mjs +1 -1
- package/dist/plugins/sui/ledger/object-ref.mjs.map +1 -0
- package/dist/plugins/sui/local-faucet-strategy.mjs +1 -5
- package/dist/plugins/sui/local-faucet-strategy.mjs.map +1 -1
- package/dist/plugins/sui/log-attrs.mjs +11 -0
- package/dist/plugins/sui/log-attrs.mjs.map +1 -0
- package/dist/plugins/sui/mode/external.mjs +4 -12
- package/dist/plugins/sui/mode/external.mjs.map +1 -1
- package/dist/plugins/sui/mode/fork.mjs +19 -16
- package/dist/plugins/sui/mode/fork.mjs.map +1 -1
- package/dist/plugins/sui/mode/live.mjs +4 -17
- package/dist/plugins/sui/mode/live.mjs.map +1 -1
- package/dist/plugins/sui/mode/local.d.mts +1 -0
- package/dist/plugins/sui/mode/local.mjs +203 -61
- package/dist/plugins/sui/mode/local.mjs.map +1 -1
- package/dist/plugins/sui/mode/shared-boot.mjs +18 -23
- package/dist/plugins/sui/mode/shared-boot.mjs.map +1 -1
- package/dist/plugins/sui/mode/shared.d.mts +6 -7
- package/dist/plugins/sui/mode/shared.mjs.map +1 -1
- package/dist/plugins/sui/mode/spec.d.mts +23 -6
- package/dist/{substrate/runtime/sui-move-build → plugins/sui/move}/index.mjs +28 -30
- package/dist/plugins/sui/move/index.mjs.map +1 -0
- package/dist/plugins/sui/move-summary-runner.mjs +8 -4
- package/dist/plugins/sui/move-summary-runner.mjs.map +1 -1
- package/dist/{substrate/network.d.mts → plugins/sui/network-config.d.mts} +11 -10
- package/dist/plugins/sui/network-resolver.d.mts +6 -6
- package/dist/plugins/sui/routable.mjs.map +1 -1
- package/dist/plugins/sui/service.mjs +10 -6
- package/dist/plugins/sui/service.mjs.map +1 -1
- package/dist/plugins/sui/snapshot.mjs +10 -5
- package/dist/plugins/sui/snapshot.mjs.map +1 -1
- package/dist/plugins/wallet/codegen.d.mts +8 -6
- package/dist/plugins/wallet/codegen.mjs +4 -10
- package/dist/plugins/wallet/codegen.mjs.map +1 -1
- package/dist/plugins/wallet/errors.mjs +1 -4
- package/dist/plugins/wallet/errors.mjs.map +1 -1
- package/dist/plugins/wallet/index.d.mts +3 -6
- package/dist/plugins/wallet/index.mjs +16 -21
- package/dist/plugins/wallet/index.mjs.map +1 -1
- package/dist/plugins/wallet/origin-policy.mjs +3 -3
- package/dist/plugins/wallet/origin-policy.mjs.map +1 -1
- package/dist/plugins/wallet/pairing.mjs +6 -24
- package/dist/plugins/wallet/pairing.mjs.map +1 -1
- package/dist/plugins/wallet/protocol.mjs.map +1 -1
- package/dist/plugins/wallet/routable.mjs.map +1 -1
- package/dist/plugins/wallet/server.mjs +17 -24
- package/dist/plugins/wallet/server.mjs.map +1 -1
- package/dist/plugins/wallet/service.d.mts +2 -2
- package/dist/plugins/wallet/service.mjs +4 -15
- package/dist/plugins/wallet/service.mjs.map +1 -1
- package/dist/plugins/wallet/snapshot.mjs.map +1 -1
- package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs +1 -5
- package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs.map +1 -1
- package/dist/plugins/walrus/codegen.d.mts +2 -13
- package/dist/plugins/walrus/codegen.mjs +93 -28
- package/dist/plugins/walrus/codegen.mjs.map +1 -1
- package/dist/plugins/walrus/deploy-paths.mjs +2 -3
- package/dist/plugins/walrus/deploy-paths.mjs.map +1 -1
- package/dist/plugins/walrus/deploy.mjs +26 -19
- package/dist/plugins/walrus/deploy.mjs.map +1 -1
- package/dist/plugins/walrus/errors.mjs +1 -8
- package/dist/plugins/walrus/errors.mjs.map +1 -1
- package/dist/plugins/walrus/faucet-strategy.mjs +15 -1
- package/dist/plugins/walrus/faucet-strategy.mjs.map +1 -1
- package/dist/plugins/walrus/index.d.mts +13 -44
- package/dist/plugins/walrus/index.mjs +119 -122
- package/dist/plugins/walrus/index.mjs.map +1 -1
- package/dist/plugins/walrus/mode/known-deploy.mjs +6 -6
- package/dist/plugins/walrus/mode/known-deploy.mjs.map +1 -1
- package/dist/plugins/walrus/mode/local-cluster.d.mts +2 -2
- package/dist/plugins/walrus/mode/local-cluster.mjs +2 -10
- package/dist/plugins/walrus/mode/local-cluster.mjs.map +1 -1
- package/dist/plugins/walrus/plugin-key.mjs.map +1 -1
- package/dist/plugins/walrus/registry-publish.mjs.map +1 -1
- package/dist/plugins/walrus/routable.mjs.map +1 -1
- package/dist/plugins/walrus/service.mjs.map +1 -1
- package/dist/plugins/walrus/snapshot.mjs +3 -3
- package/dist/plugins/walrus/snapshot.mjs.map +1 -1
- package/dist/plugins/walrus/storage-nodes.mjs +53 -14
- package/dist/plugins/walrus/storage-nodes.mjs.map +1 -1
- package/dist/plugins/walrus/wal-swap.mjs +4 -8
- package/dist/plugins/walrus/wal-swap.mjs.map +1 -1
- package/dist/primitives/artifact-publisher.mjs.map +1 -1
- package/dist/primitives/cache.d.mts +1 -1
- package/dist/runtime/docker/client.mjs +47 -3
- package/dist/runtime/docker/client.mjs.map +1 -1
- package/dist/runtime/docker/container.mjs +37 -57
- package/dist/runtime/docker/container.mjs.map +1 -1
- package/dist/runtime/docker/errors.mjs.map +1 -1
- package/dist/runtime/docker/exec.mjs +2 -2
- package/dist/runtime/docker/exec.mjs.map +1 -1
- package/dist/runtime/docker/image.mjs +10 -11
- package/dist/runtime/docker/image.mjs.map +1 -1
- package/dist/runtime/docker/index.mjs +0 -1
- package/dist/runtime/docker/inspect-and-decode.mjs.map +1 -1
- package/dist/runtime/docker/inventory.mjs +9 -9
- package/dist/runtime/docker/inventory.mjs.map +1 -1
- package/dist/runtime/docker/labels.mjs +12 -1
- package/dist/runtime/docker/labels.mjs.map +1 -1
- package/dist/runtime/docker/network.mjs +6 -6
- package/dist/runtime/docker/network.mjs.map +1 -1
- package/dist/runtime/docker/render-run-args.mjs.map +1 -1
- package/dist/runtime/docker/service.mjs +31 -45
- package/dist/runtime/docker/service.mjs.map +1 -1
- package/dist/runtime/docker/sweep.mjs +14 -64
- package/dist/runtime/docker/sweep.mjs.map +1 -1
- package/dist/runtime/docker/volume.mjs +1 -1
- package/dist/runtime/docker/volume.mjs.map +1 -1
- package/dist/runtime/docker/wrap.mjs +14 -2
- package/dist/runtime/docker/wrap.mjs.map +1 -1
- package/dist/substrate/brand.d.mts +2 -5
- package/dist/substrate/brand.mjs +3 -2
- package/dist/substrate/brand.mjs.map +1 -1
- package/dist/substrate/cross-process.mjs +2 -16
- package/dist/substrate/cross-process.mjs.map +1 -1
- package/dist/substrate/event-time.mjs +0 -2
- package/dist/substrate/event-time.mjs.map +1 -1
- package/dist/substrate/events.d.mts +46 -16
- package/dist/substrate/identity.d.mts +11 -5
- package/dist/substrate/manifest.d.mts +33 -26
- package/dist/substrate/manifest.mjs +8 -3
- package/dist/substrate/manifest.mjs.map +1 -1
- package/dist/substrate/options.d.mts +33 -4
- package/dist/substrate/plugin-ctx.d.mts +70 -0
- package/dist/substrate/plugin-ctx.mjs +66 -0
- package/dist/substrate/plugin-ctx.mjs.map +1 -0
- package/dist/substrate/plugin.d.mts +46 -38
- package/dist/substrate/plugin.mjs +13 -9
- package/dist/substrate/plugin.mjs.map +1 -1
- package/dist/substrate/projection.d.mts +1 -1
- package/dist/substrate/runtime/atomic-write.mjs +3 -4
- package/dist/substrate/runtime/atomic-write.mjs.map +1 -1
- package/dist/substrate/runtime/cache/schema.mjs.map +1 -1
- package/dist/substrate/runtime/cache/service.mjs +50 -20
- package/dist/substrate/runtime/cache/service.mjs.map +1 -1
- package/dist/substrate/runtime/config-validation.mjs.map +1 -1
- package/dist/substrate/runtime/control-plane/domain.mjs +34 -12
- package/dist/substrate/runtime/control-plane/domain.mjs.map +1 -1
- package/dist/substrate/runtime/control-plane/service.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/command-channel/channel.mjs +14 -17
- package/dist/substrate/runtime/cross-process/command-channel/channel.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/command-channel/file-channel.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/command-channel/protocol.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/command-channel/runtime-control-lock.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/index.mjs +0 -2
- package/dist/substrate/runtime/cross-process/live-clock.mjs +1 -1
- package/dist/substrate/runtime/cross-process/live-clock.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/liveness.mjs +11 -18
- package/dist/substrate/runtime/cross-process/liveness.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/reclaim-stale-file.mjs +2 -2
- package/dist/substrate/runtime/cross-process/reclaim-stale-file.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/roster.mjs +17 -127
- package/dist/substrate/runtime/cross-process/roster.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/self-pid.mjs.map +1 -1
- package/dist/substrate/runtime/cross-process/stack-lock.mjs +29 -28
- package/dist/substrate/runtime/cross-process/stack-lock.mjs.map +1 -1
- package/dist/substrate/runtime/current-plugin.mjs.map +1 -1
- package/dist/substrate/runtime/errors.mjs +1 -13
- package/dist/substrate/runtime/errors.mjs.map +1 -1
- package/dist/substrate/runtime/format-unknown-error.mjs.map +1 -1
- package/dist/substrate/runtime/host-bind-mount-owner.mjs.map +1 -1
- package/dist/substrate/runtime/host-gateway.mjs.map +1 -1
- package/dist/substrate/runtime/host-tree-tar/index.mjs +15 -163
- package/dist/substrate/runtime/host-tree-tar/index.mjs.map +1 -1
- package/dist/substrate/runtime/http-probe.d.mts +1 -3
- package/dist/substrate/runtime/http-probe.mjs.map +1 -1
- package/dist/substrate/runtime/index.mjs +1 -6
- package/dist/substrate/runtime/lease-broker/service.mjs +5 -23
- package/dist/substrate/runtime/lease-broker/service.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/dep-graph.mjs +3 -3
- package/dist/substrate/runtime/lifecycle/dep-graph.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/graph-input-id.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/graph-input-id.mjs +133 -0
- package/dist/substrate/runtime/lifecycle/graph-input-id.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/index.mjs +2 -2
- package/dist/substrate/runtime/lifecycle/plugin-registry.d.mts +1 -1
- package/dist/substrate/runtime/lifecycle/plugin-registry.mjs +22 -1
- package/dist/substrate/runtime/lifecycle/plugin-registry.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/ready-gate.mjs +2 -15
- package/dist/substrate/runtime/lifecycle/ready-gate.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/selective-restart.mjs +29 -25
- package/dist/substrate/runtime/lifecycle/selective-restart.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/signals.mjs +1 -1
- package/dist/substrate/runtime/lifecycle/signals.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/state-machine.mjs.map +1 -1
- package/dist/substrate/runtime/lifecycle/watch-attribution.d.mts +1 -1
- package/dist/substrate/runtime/lifecycle/watch-attribution.mjs +0 -1
- package/dist/substrate/runtime/lifecycle/watch-attribution.mjs.map +1 -1
- package/dist/substrate/runtime/managed-container.d.mts +5 -1
- package/dist/substrate/runtime/managed-container.mjs +8 -10
- package/dist/substrate/runtime/managed-container.mjs.map +1 -1
- package/dist/substrate/runtime/manifest/manifest.mjs +8 -30
- package/dist/substrate/runtime/manifest/manifest.mjs.map +1 -1
- package/dist/substrate/runtime/mode-errors.d.mts +1 -2
- package/dist/substrate/runtime/mode-errors.mjs.map +1 -1
- package/dist/substrate/runtime/observability/cascade-formatter.mjs +1 -11
- package/dist/substrate/runtime/observability/cascade-formatter.mjs.map +1 -1
- package/dist/substrate/runtime/observability/ignore-with-log.mjs.map +1 -1
- package/dist/substrate/runtime/observability/index.d.mts +1 -1
- package/dist/substrate/runtime/observability/index.mjs +4 -6
- package/dist/substrate/runtime/observability/log-attrs.mjs +46 -0
- package/dist/substrate/runtime/observability/log-attrs.mjs.map +1 -0
- package/dist/substrate/runtime/observability/log-store.mjs.map +1 -1
- package/dist/substrate/runtime/observability/logger.mjs +3 -3
- package/dist/substrate/runtime/observability/logger.mjs.map +1 -1
- package/dist/substrate/runtime/observability/output-truncate.mjs.map +1 -1
- package/dist/substrate/runtime/observability/pretty-error.mjs.map +1 -1
- package/dist/substrate/runtime/observability/process-lines.mjs.map +1 -1
- package/dist/substrate/runtime/observability/redaction.mjs.map +1 -1
- package/dist/substrate/runtime/observability/subprocess-capture.mjs +2 -2
- package/dist/substrate/runtime/observability/subprocess-capture.mjs.map +1 -1
- package/dist/substrate/runtime/passthrough-or-wrap.mjs.map +1 -1
- package/dist/substrate/runtime/paths.mjs +27 -9
- package/dist/substrate/runtime/paths.mjs.map +1 -1
- package/dist/substrate/runtime/phase-preserving-produce.mjs.map +1 -1
- package/dist/substrate/runtime/port-broker/service.mjs +10 -27
- package/dist/substrate/runtime/port-broker/service.mjs.map +1 -1
- package/dist/substrate/runtime/post-acquire-tasks.mjs.map +1 -1
- package/dist/substrate/runtime/probes.d.mts +2 -3
- package/dist/substrate/runtime/probes.mjs.map +1 -1
- package/dist/substrate/runtime/process-supervisor.mjs.map +1 -1
- package/dist/substrate/runtime/projection/operational-endpoints.mjs.map +1 -1
- package/dist/substrate/runtime/projection/state-ref.mjs.map +1 -1
- package/dist/substrate/runtime/projection/update.mjs +87 -11
- package/dist/substrate/runtime/projection/update.mjs.map +1 -1
- package/dist/substrate/runtime/random-suffix.mjs.map +1 -1
- package/dist/substrate/runtime/reconcile/fs-plan.mjs +146 -0
- package/dist/substrate/runtime/reconcile/fs-plan.mjs.map +1 -0
- package/dist/substrate/runtime/reconcile/graph.mjs +19 -0
- package/dist/substrate/runtime/reconcile/graph.mjs.map +1 -0
- package/dist/substrate/runtime/reconcile/index.mjs +5 -0
- package/dist/substrate/runtime/reconcile/label.mjs +41 -0
- package/dist/substrate/runtime/reconcile/label.mjs.map +1 -0
- package/dist/substrate/runtime/reconcile/spec.mjs +15 -0
- package/dist/substrate/runtime/reconcile/spec.mjs.map +1 -0
- package/dist/substrate/runtime/retry-policy.d.mts +2 -3
- package/dist/substrate/runtime/retry-policy.mjs.map +1 -1
- package/dist/substrate/runtime/routed-url.mjs.map +1 -1
- package/dist/substrate/runtime/runtime-decode.mjs.map +1 -1
- package/dist/substrate/runtime/scoped-http-server.mjs.map +1 -1
- package/dist/substrate/runtime/stage-and-swap/index.mjs +49 -12
- package/dist/substrate/runtime/stage-and-swap/index.mjs.map +1 -1
- package/dist/substrate/runtime/strategy-registry/chain-keyed-strategy-for.mjs.map +1 -1
- package/dist/substrate/runtime/strategy-registry/chain-probe-for.mjs.map +1 -1
- package/dist/substrate/runtime/strategy-registry/service.mjs +29 -17
- package/dist/substrate/runtime/strategy-registry/service.mjs.map +1 -1
- package/dist/substrate/runtime/subnet-broker.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/acquire-node.mjs +188 -56
- package/dist/substrate/runtime/supervisor/acquire-node.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/background-tasks.mjs +79 -65
- package/dist/substrate/runtime/supervisor/background-tasks.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/command-loop.mjs +82 -23
- package/dist/substrate/runtime/supervisor/command-loop.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/contribution-dispatcher.mjs +16 -0
- package/dist/substrate/runtime/supervisor/contribution-dispatcher.mjs.map +1 -0
- package/dist/substrate/runtime/supervisor/errors.mjs +11 -2
- package/dist/substrate/runtime/supervisor/errors.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/index.mjs +2 -0
- package/dist/substrate/runtime/supervisor/shutdown.mjs +6 -6
- package/dist/substrate/runtime/supervisor/shutdown.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/start-supervisor.mjs +60 -70
- package/dist/substrate/runtime/supervisor/start-supervisor.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/state.d.mts +1 -1
- package/dist/substrate/runtime/supervisor/state.mjs +1 -1
- package/dist/substrate/runtime/supervisor/state.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/teardown.mjs +10 -9
- package/dist/substrate/runtime/supervisor/teardown.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/wiring.mjs +6 -20
- package/dist/substrate/runtime/supervisor/wiring.mjs.map +1 -1
- package/dist/substrate/runtime/tar/reader.mjs +216 -0
- package/dist/substrate/runtime/tar/reader.mjs.map +1 -0
- package/dist/substrate/runtime/typed-env.mjs.map +1 -1
- package/dist/substrate/versioned-doc-schema.mjs.map +1 -1
- package/dist/substrate/versioned-doc-sync.mjs +5 -5
- package/dist/substrate/versioned-doc-sync.mjs.map +1 -1
- package/dist/surfaces/cli/command-tree.mjs +49 -7
- package/dist/surfaces/cli/command-tree.mjs.map +1 -1
- package/dist/surfaces/cli/commands/config.mjs +1 -1
- package/dist/surfaces/cli/commands/config.mjs.map +1 -1
- package/dist/surfaces/cli/commands/confirm-node.mjs.map +1 -1
- package/dist/surfaces/cli/commands/confirm.mjs.map +1 -1
- package/dist/surfaces/cli/commands/doctor.mjs +1 -1
- package/dist/surfaces/cli/commands/doctor.mjs.map +1 -1
- package/dist/surfaces/cli/commands/prune-picker-entry.mjs.map +1 -1
- package/dist/surfaces/cli/commands/prune-picker.mjs.map +1 -1
- package/dist/surfaces/cli/commands/prune.mjs +1 -1
- package/dist/surfaces/cli/commands/prune.mjs.map +1 -1
- package/dist/surfaces/cli/commands/snapshot.mjs +1 -1
- package/dist/surfaces/cli/commands/snapshot.mjs.map +1 -1
- package/dist/surfaces/cli/commands/status.mjs +1 -1
- package/dist/surfaces/cli/commands/status.mjs.map +1 -1
- package/dist/surfaces/cli/commands/supervisor-presence.mjs.map +1 -1
- package/dist/surfaces/cli/commands/wipe.mjs +3 -4
- package/dist/surfaces/cli/commands/wipe.mjs.map +1 -1
- package/dist/surfaces/cli/envelope.mjs.map +1 -1
- package/dist/surfaces/cli/errors.mjs.map +1 -1
- package/dist/surfaces/cli/flags.mjs.map +1 -1
- package/dist/surfaces/cli/index.mjs +45 -14
- package/dist/surfaces/cli/index.mjs.map +1 -1
- package/dist/surfaces/cli/output.mjs.map +1 -1
- package/dist/surfaces/cli/sysexits.mjs.map +1 -1
- package/dist/surfaces/tui/app.mjs +0 -21
- package/dist/surfaces/tui/app.mjs.map +1 -1
- package/dist/surfaces/tui/dashboard.mjs +0 -48
- package/dist/surfaces/tui/dashboard.mjs.map +1 -1
- package/dist/surfaces/tui/display-derivation.mjs +80 -16
- package/dist/surfaces/tui/display-derivation.mjs.map +1 -1
- package/dist/surfaces/tui/errors.mjs.map +1 -1
- package/dist/surfaces/tui/event-log.mjs +0 -9
- package/dist/surfaces/tui/event-log.mjs.map +1 -1
- package/dist/surfaces/tui/heartbeat.mjs.map +1 -1
- package/dist/surfaces/tui/index.mjs +2 -2
- package/dist/surfaces/tui/index.mjs.map +1 -1
- package/dist/surfaces/tui/input.mjs.map +1 -1
- package/dist/surfaces/tui/mode-detect.mjs.map +1 -1
- package/dist/surfaces/tui/mount-ink.mjs.map +1 -1
- package/dist/surfaces/tui/plain-renderer.mjs +26 -19
- package/dist/surfaces/tui/plain-renderer.mjs.map +1 -1
- package/dist/surfaces/tui/resource-table.mjs +8 -10
- package/dist/surfaces/tui/resource-table.mjs.map +1 -1
- package/images/postgres/Dockerfile +0 -1
- package/images/sui/Dockerfile +27 -54
- package/images/sui/entrypoint.sh +17 -179
- package/package.json +23 -15
- package/dashboard-ui/assets/index-Bmi1UtAg.js +0 -1356
- package/dashboard-ui/assets/index-D5EShVt4.js +0 -3
- package/dashboard-ui/assets/index-Deml9drg.css +0 -1
- package/dist/api/plugin-errors.d.mts +0 -7
- package/dist/api/plugin-errors.mjs +0 -10
- package/dist/api/plugin-errors.mjs.map +0 -1
- package/dist/cli/wirings/build-verb-layers.mjs +0 -42
- package/dist/cli/wirings/build-verb-layers.mjs.map +0 -1
- package/dist/contracts/capability-decl.d.mts +0 -40
- package/dist/orchestrators/built-in-plugin-layers.mjs +0 -54
- package/dist/orchestrators/built-in-plugin-layers.mjs.map +0 -1
- package/dist/orchestrators/run.mjs +0 -91
- package/dist/orchestrators/run.mjs.map +0 -1
- package/dist/orchestrators/runtime-composition.d.mts +0 -10
- package/dist/orchestrators/runtime-composition.mjs +0 -252
- package/dist/orchestrators/runtime-composition.mjs.map +0 -1
- package/dist/orchestrators/snapshot/capture-command.d.mts +0 -1
- package/dist/orchestrators/snapshot/capture-command.mjs +0 -25
- package/dist/orchestrators/snapshot/capture-command.mjs.map +0 -1
- package/dist/orchestrators/snapshot/pending-marker.mjs +0 -99
- package/dist/orchestrators/snapshot/pending-marker.mjs.map +0 -1
- package/dist/orchestrators/snapshot/recover-pending.mjs +0 -223
- package/dist/orchestrators/snapshot/recover-pending.mjs.map +0 -1
- package/dist/orchestrators/snapshot/state-document.d.mts +0 -1
- package/dist/orchestrators/snapshot/state-document.mjs +0 -58
- package/dist/orchestrators/snapshot/state-document.mjs.map +0 -1
- package/dist/plugins/account/spans.mjs +0 -16
- package/dist/plugins/account/spans.mjs.map +0 -1
- package/dist/plugins/account/variants/env.mjs +0 -24
- package/dist/plugins/account/variants/env.mjs.map +0 -1
- package/dist/plugins/account/variants/inline.mjs +0 -13
- package/dist/plugins/account/variants/inline.mjs.map +0 -1
- package/dist/plugins/account/variants/keystore.mjs +0 -91
- package/dist/plugins/account/variants/keystore.mjs.map +0 -1
- package/dist/plugins/action/spans.mjs +0 -11
- package/dist/plugins/action/spans.mjs.map +0 -1
- package/dist/plugins/coin/spans.mjs +0 -20
- package/dist/plugins/coin/spans.mjs.map +0 -1
- package/dist/plugins/deepbook/spans.mjs +0 -18
- package/dist/plugins/deepbook/spans.mjs.map +0 -1
- package/dist/plugins/faucet/spans.mjs +0 -12
- package/dist/plugins/faucet/spans.mjs.map +0 -1
- package/dist/plugins/package/spans.mjs +0 -14
- package/dist/plugins/package/spans.mjs.map +0 -1
- package/dist/plugins/postgres/codegen.mjs +0 -42
- package/dist/plugins/postgres/codegen.mjs.map +0 -1
- package/dist/plugins/postgres/connection.d.mts +0 -33
- package/dist/plugins/postgres/connection.mjs.map +0 -1
- package/dist/plugins/postgres/db-ensure.mjs.map +0 -1
- package/dist/plugins/postgres/errors.d.mts +0 -60
- package/dist/plugins/postgres/errors.mjs +0 -29
- package/dist/plugins/postgres/errors.mjs.map +0 -1
- package/dist/plugins/postgres/index.d.mts +0 -37
- package/dist/plugins/postgres/index.mjs +0 -68
- package/dist/plugins/postgres/index.mjs.map +0 -1
- package/dist/plugins/postgres/routable.mjs +0 -33
- package/dist/plugins/postgres/routable.mjs.map +0 -1
- package/dist/plugins/postgres/service.d.mts +0 -50
- package/dist/plugins/postgres/service.mjs +0 -179
- package/dist/plugins/postgres/service.mjs.map +0 -1
- package/dist/plugins/postgres/snapshot.mjs +0 -32
- package/dist/plugins/postgres/snapshot.mjs.map +0 -1
- package/dist/plugins/postgres/spans.mjs +0 -11
- package/dist/plugins/postgres/spans.mjs.map +0 -1
- package/dist/plugins/seal/spans.mjs +0 -18
- package/dist/plugins/seal/spans.mjs.map +0 -1
- package/dist/plugins/sui/spans.mjs +0 -17
- package/dist/plugins/sui/spans.mjs.map +0 -1
- package/dist/plugins/wallet/spans.mjs +0 -22
- package/dist/plugins/wallet/spans.mjs.map +0 -1
- package/dist/plugins/walrus/registry-publish.d.mts +0 -24
- package/dist/plugins/walrus/spans.mjs +0 -18
- package/dist/plugins/walrus/spans.mjs.map +0 -1
- package/dist/runtime/docker/logs.d.mts +0 -1
- package/dist/runtime/docker/logs.mjs +0 -34
- package/dist/runtime/docker/logs.mjs.map +0 -1
- package/dist/substrate/runtime/artifact-publisher/index.mjs +0 -86
- package/dist/substrate/runtime/artifact-publisher/index.mjs.map +0 -1
- package/dist/substrate/runtime/capability-sinks/index.d.mts +0 -1
- package/dist/substrate/runtime/capability-sinks/index.mjs +0 -3
- package/dist/substrate/runtime/capability-sinks/layer.d.mts +0 -1
- package/dist/substrate/runtime/capability-sinks/layer.mjs +0 -31
- package/dist/substrate/runtime/capability-sinks/layer.mjs.map +0 -1
- package/dist/substrate/runtime/capability-sinks/service.d.mts +0 -95
- package/dist/substrate/runtime/capability-sinks/service.mjs +0 -69
- package/dist/substrate/runtime/capability-sinks/service.mjs.map +0 -1
- package/dist/substrate/runtime/cross-process/lock.d.mts +0 -1
- package/dist/substrate/runtime/cross-process/lock.mjs +0 -23
- package/dist/substrate/runtime/cross-process/lock.mjs.map +0 -1
- package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs +0 -113
- package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs.map +0 -1
- package/dist/substrate/runtime/lifecycle/lifecycle-fact.mjs +0 -31
- package/dist/substrate/runtime/lifecycle/lifecycle-fact.mjs.map +0 -1
- package/dist/substrate/runtime/observability/formatter-registry.d.mts +0 -1
- package/dist/substrate/runtime/observability/formatter-registry.mjs +0 -48
- package/dist/substrate/runtime/observability/formatter-registry.mjs.map +0 -1
- package/dist/substrate/runtime/observability/span-store.d.mts +0 -1
- package/dist/substrate/runtime/observability/span-store.mjs +0 -110
- package/dist/substrate/runtime/observability/span-store.mjs.map +0 -1
- package/dist/substrate/runtime/observability/spans.d.mts +0 -1
- package/dist/substrate/runtime/observability/spans.mjs +0 -87
- package/dist/substrate/runtime/observability/spans.mjs.map +0 -1
- package/dist/substrate/runtime/projection/index.mjs +0 -4
- package/dist/substrate/runtime/projection/persisted.mjs +0 -213
- package/dist/substrate/runtime/projection/persisted.mjs.map +0 -1
- package/dist/substrate/runtime/scoped-multimap/service.mjs +0 -52
- package/dist/substrate/runtime/scoped-multimap/service.mjs.map +0 -1
- package/dist/substrate/runtime/scoped-ref-map/index.mjs +0 -2
- package/dist/substrate/runtime/scoped-ref-map/service.mjs +0 -83
- package/dist/substrate/runtime/scoped-ref-map/service.mjs.map +0 -1
- package/dist/substrate/runtime/state-store/index.mjs +0 -3
- package/dist/substrate/runtime/state-store/schema.d.mts +0 -1
- package/dist/substrate/runtime/state-store/schema.mjs +0 -41
- package/dist/substrate/runtime/state-store/schema.mjs.map +0 -1
- package/dist/substrate/runtime/state-store/service.d.mts +0 -1
- package/dist/substrate/runtime/state-store/service.mjs +0 -145
- package/dist/substrate/runtime/state-store/service.mjs.map +0 -1
- package/dist/substrate/runtime/sui-execute/index.mjs.map +0 -1
- package/dist/substrate/runtime/sui-execute/sign-and-dispatch.mjs.map +0 -1
- package/dist/substrate/runtime/sui-ledger/object-ref.mjs.map +0 -1
- package/dist/substrate/runtime/sui-move-build/index.mjs.map +0 -1
- package/dist/substrate/runtime/supervisor/dispatch-contributions.mjs +0 -151
- package/dist/substrate/runtime/supervisor/dispatch-contributions.mjs.map +0 -1
- package/dist/substrate/state-store.d.mts +0 -1
- /package/dist/orchestrators/{snapshot/pending-marker.d.mts → codegen/id-config.d.mts} +0 -0
- /package/dist/orchestrators/snapshot/{recover-pending.d.mts → interrupted-restore.d.mts} +0 -0
- /package/dist/{substrate/runtime/sui-execute → plugins/sui/exec}/sign-and-dispatch.d.mts +0 -0
- /package/dist/plugins/{postgres/snapshot.d.mts → sui/ledger/object-ref.d.mts} +0 -0
- /package/dist/{substrate/runtime/sui-move-build → plugins/sui/move}/index.d.mts +0 -0
- /package/dist/substrate/runtime/{state-store/index.d.mts → reconcile/graph.d.mts} +0 -0
- /package/dist/substrate/runtime/{cross-process/snapshot-reservation.d.mts → supervisor/contribution-dispatcher.d.mts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-key.mjs","names":[],"sources":["../../../src/plugins/seal/plugin-key.ts"],"sourcesContent":["import { pluginKey, type PluginKey } from '../../substrate/brand.ts';\n\nexport const sealPluginKey = (name: string): PluginKey => pluginKey(`seal:${name}`);\n"],"mappings":";;AAEA,MAAa,iBAAiB,SAA4B,UAAU,QAAQ,
|
|
1
|
+
{"version":3,"file":"plugin-key.mjs","names":[],"sources":["../../../src/plugins/seal/plugin-key.ts"],"sourcesContent":["import { pluginKey, type PluginKey } from '../../substrate/brand.ts';\n\nexport const sealPluginKey = (name: string): PluginKey => pluginKey(`seal:${name}`);\n"],"mappings":";;AAEA,MAAa,iBAAiB,SAA4B,UAAU,QAAQ,MAAM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry-publish.mjs","names":[],"sources":["../../../src/plugins/seal/registry-publish.ts"],"sourcesContent":["// Seal plugin — public resolved value.\n//\n// Resource ids:\n//\n// - `seal:<name>` — read-side key-server fields plus the local-only\n// manager handle when the stack owns the master key.\n//\n// The `<name>` suffix lets multiple seal instances coexist in a stack\n// without colliding on the resource registry (distilled doc §Pain Points\n// #7 — multi-instance currently untested but structurally supported).\n\nimport { resource } from '../../api/define-plugin.ts';\nimport type { SealKeyManager } from './key-manager.ts';\n\n// ---------------------------------------------------------------------------\n// Read-side: SealKeyServer\n// ---------------------------------------------------------------------------\n\n/** Structural mirror of `@mysten/seal`'s `KeyServerConfig`.\n *\n * Distilled-doc invariant #9 + #18: peer-dep structural\n * assignability. `@mysten/seal` is a peer dep — we duplicate the\n * shape locally to keep the runtime import off the bundle. A\n * compile-time `_SealKeyServerEntryCheck`\n * guards against drift. */\nexport interface SealKeyServerEntry {\n\treadonly objectId: string;\n\treadonly weight: number;\n\treadonly aggregatorUrl?: string;\n}\n\n/** Read-side resolved value. SDK-ready: pass `serverConfigs` to\n * `new SealClient({serverConfigs, ...})` directly. */\nexport interface SealKeyServer {\n\treadonly serverConfigs: ReadonlyArray<SealKeyServerEntry>;\n\treadonly keyServerUrl: string;\n\treadonly objectId: string;\n}\n\n/** Public Seal resolved value. The key-server fields stay top-level\n * so the direct member ref is immediately SDK-ready; local-keygen\n * additionally exposes `manager`, while known deployments set it to\n * `null` because this stack does not own the master key. */\nexport interface SealResolved extends SealKeyServer {\n\treadonly mode: 'local-keygen' | 'live' | 'fork-known';\n\treadonly manager: SealKeyManager | null;\n}\n\n/** Resource id constructor for the read-side handle. */\nexport type SealResourceId<Name extends string> = `seal:${Name}`;\nexport const sealResourceId = <Name extends string>(name: Name): SealResourceId<Name> =>\n\t`seal:${name}`;\n\n/** Construct the read-side resource. */\nexport const makeSealResource = <Name extends string>(name: Name) =>\n\tresource<SealResourceId<Name>, SealResolved>(sealResourceId(name));\n\n// ---------------------------------------------------------------------------\n// Projection helpers — narrow the plugin's resolved value\n// ---------------------------------------------------------------------------\n\n/** Aggregate resolved value the plugin's acquire body returns.\n * Distilled-doc §\"SealLocalKeygenInternalShape\" — `{keyServer,\n * keyManager, packageId}`. Modes that don't own a manager omit it. */\nexport interface SealLocalKeygenResolved {\n\treadonly keyServer: SealKeyServer;\n\treadonly keyManager: SealKeyManager;\n\treadonly packageId: string;\n}\n\nexport interface SealKnownResolved {\n\treadonly keyServer: SealKeyServer;\n}\n"],"mappings":";;;AAkDA,MAAa,kBAAuC,SACnD,QAAQ;;AAGT,MAAa,oBAAyC,SACrD,SAA6C,eAAe,
|
|
1
|
+
{"version":3,"file":"registry-publish.mjs","names":[],"sources":["../../../src/plugins/seal/registry-publish.ts"],"sourcesContent":["// Seal plugin — public resolved value.\n//\n// Resource ids:\n//\n// - `seal:<name>` — read-side key-server fields plus the local-only\n// manager handle when the stack owns the master key.\n//\n// The `<name>` suffix lets multiple seal instances coexist in a stack\n// without colliding on the resource registry (distilled doc §Pain Points\n// #7 — multi-instance currently untested but structurally supported).\n\nimport { resource } from '../../api/define-plugin.ts';\nimport type { SealKeyManager } from './key-manager.ts';\n\n// ---------------------------------------------------------------------------\n// Read-side: SealKeyServer\n// ---------------------------------------------------------------------------\n\n/** Structural mirror of `@mysten/seal`'s `KeyServerConfig`.\n *\n * Distilled-doc invariant #9 + #18: peer-dep structural\n * assignability. `@mysten/seal` is a peer dep — we duplicate the\n * shape locally to keep the runtime import off the bundle. A\n * compile-time `_SealKeyServerEntryCheck`\n * guards against drift. */\nexport interface SealKeyServerEntry {\n\treadonly objectId: string;\n\treadonly weight: number;\n\treadonly aggregatorUrl?: string;\n}\n\n/** Read-side resolved value. SDK-ready: pass `serverConfigs` to\n * `new SealClient({serverConfigs, ...})` directly. */\nexport interface SealKeyServer {\n\treadonly serverConfigs: ReadonlyArray<SealKeyServerEntry>;\n\treadonly keyServerUrl: string;\n\treadonly objectId: string;\n}\n\n/** Public Seal resolved value. The key-server fields stay top-level\n * so the direct member ref is immediately SDK-ready; local-keygen\n * additionally exposes `manager`, while known deployments set it to\n * `null` because this stack does not own the master key. */\nexport interface SealResolved extends SealKeyServer {\n\treadonly mode: 'local-keygen' | 'live' | 'fork-known';\n\treadonly manager: SealKeyManager | null;\n}\n\n/** Resource id constructor for the read-side handle. */\nexport type SealResourceId<Name extends string> = `seal:${Name}`;\nexport const sealResourceId = <Name extends string>(name: Name): SealResourceId<Name> =>\n\t`seal:${name}`;\n\n/** Construct the read-side resource. */\nexport const makeSealResource = <Name extends string>(name: Name) =>\n\tresource<SealResourceId<Name>, SealResolved>(sealResourceId(name));\n\n// ---------------------------------------------------------------------------\n// Projection helpers — narrow the plugin's resolved value\n// ---------------------------------------------------------------------------\n\n/** Aggregate resolved value the plugin's acquire body returns.\n * Distilled-doc §\"SealLocalKeygenInternalShape\" — `{keyServer,\n * keyManager, packageId}`. Modes that don't own a manager omit it. */\nexport interface SealLocalKeygenResolved {\n\treadonly keyServer: SealKeyServer;\n\treadonly keyManager: SealKeyManager;\n\treadonly packageId: string;\n}\n\nexport interface SealKnownResolved {\n\treadonly keyServer: SealKeyServer;\n}\n"],"mappings":";;;AAkDA,MAAa,kBAAuC,SACnD,QAAQ;;AAGT,MAAa,oBAAyC,SACrD,SAA6C,eAAe,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routable.mjs","names":[],"sources":["../../../src/plugins/seal/routable.ts"],"sourcesContent":["// Seal plugin — Routable contribution.\n//\n// Distilled-doc invariant #5: the seal port (2024) is INTENTIONALLY\n// shared across stacks. Traefik dispatches by Host: header from the\n// well-known `seal-key-server` entrypoint. No host-port publish —\n// two stacks of the same app coexist on the same well-known port.\n//\n// The substrate's router (architecture §4) mints the hostname from\n// `(app, stack, dispatch-id)`. We provide:\n//\n// - `endpointName` — the well-known string `'seal-key-server'`.\n// - `dispatchId` — `{serviceKey: 'seal:<name>', role: 'key-server'}`.\n// The service key folds the seal instance\n// name so multi-instance stacks (distilled-doc\n// Open Question #7) don't collide.\n// - `upstream` — container kind; the substrate resolves the\n// container name from the lifecycle row.\n// - `cors: true` — the @mysten/seal SDK's fetch calls require\n// CORS allowance (distilled doc: localnet\n// SDK browser flow).\n//\n// Distilled-doc invariant #1: the URL the router publishes for this\n// routable decl MUST equal the URL we register on chain. The\n// plugin's acquire body reads the router's published URL ONCE\n// and threads the same value into the Move register call.\n\nimport type { DispatchId, EntrypointDecl, RoutableDecl } from '../../contracts/routable.ts';\n\n/** Well-known endpoint name for the seal key-server. Conventional\n * router entrypoint `'seal-key-server'` on port 2024. */\nexport const SEAL_KEY_SERVER_ENDPOINT_NAME = 'seal-key-server' as const;\nexport const SEAL_KEY_SERVER_ROUTE_ROLE = 'key-server' as const;\nexport const DEFAULT_KEY_SERVER_PORT = 2024 as const;\n\nexport const SEAL_ENTRYPOINTS: ReadonlyArray<EntrypointDecl> = [\n\t{ name: SEAL_KEY_SERVER_ENDPOINT_NAME, port: DEFAULT_KEY_SERVER_PORT, protocol: 'http' },\n];\n\nconst DEFAULT_STACK = 'main';\n\nconst normalizeRouteSegment = (raw: string): string => raw.toLowerCase().replace(/\\./g, '-');\n\n/** Build the DispatchId for a seal instance. The service key\n * encodes the instance name so multi-instance seal in the same\n * stack mints distinct dispatch files.\n *\n * Note: distilled-doc Open Question #7 — multi-instance seal is\n * structurally supported but untested. The two routable decls\n * would both claim the `'seal-key-server'` entrypoint and the\n * same `key-server.<stack>.<app>.localhost` hostname. Until v2\n * plans canonicalize multi-instance routing, treat one-seal-per-stack\n * as the safe default. */\nexport const buildSealDispatchId = (name: string): DispatchId => ({\n\tserviceKey: `seal:${name}`,\n\trole: SEAL_KEY_SERVER_ROUTE_ROLE,\n});\n\nexport const buildSealKeyServerPublicRoute = (inputs: {\n\treadonly app: string;\n\treadonly stack: string;\n\treadonly port: number;\n}): { readonly hostname: string; readonly url: string } => {\n\tconst role = normalizeRouteSegment(SEAL_KEY_SERVER_ROUTE_ROLE);\n\tconst app = normalizeRouteSegment(inputs.app);\n\tconst stack = normalizeRouteSegment(inputs.stack);\n\tconst hostname =\n\t\tstack === DEFAULT_STACK ? `${role}.${app}.localhost` : `${role}.${stack}.${app}.localhost`;\n\treturn {\n\t\thostname,\n\t\turl: `http://${hostname}:${inputs.port}`,\n\t};\n};\n\n/** Build the Routable contribution. The substrate's router\n * orchestrator consumes this; the actual hostname / URL minting\n * happens there (architecture: routes-by-key, no hardcoded\n * service hostnames in router code). */\nexport const makeSealRoutable = (inputs: {\n\treadonly name: string;\n\treadonly containerName: string;\n}): RoutableDecl => ({\n\tkind: 'routable',\n\tendpointName: SEAL_KEY_SERVER_ENDPOINT_NAME,\n\tdispatchId: buildSealDispatchId(inputs.name),\n\tupstream: {\n\t\ttype: 'container',\n\t\tcontainerName: inputs.containerName,\n\t\tcontainerPort: DEFAULT_KEY_SERVER_PORT,\n\t},\n\tcors: true,\n\twireProtocol: 'http',\n});\n"],"mappings":";;;AA8BA,MAAa,gCAAgC;AAC7C,MAAa,6BAA6B;AAC1C,MAAa,0BAA0B;AAEvC,MAAa,mBAAkD,CAC9D;CAAE,MAAM;CAA+B,MAAM;CAAyB,UAAU;
|
|
1
|
+
{"version":3,"file":"routable.mjs","names":[],"sources":["../../../src/plugins/seal/routable.ts"],"sourcesContent":["// Seal plugin — Routable contribution.\n//\n// Distilled-doc invariant #5: the seal port (2024) is INTENTIONALLY\n// shared across stacks. Traefik dispatches by Host: header from the\n// well-known `seal-key-server` entrypoint. No host-port publish —\n// two stacks of the same app coexist on the same well-known port.\n//\n// The substrate's router (architecture §4) mints the hostname from\n// `(app, stack, dispatch-id)`. We provide:\n//\n// - `endpointName` — the well-known string `'seal-key-server'`.\n// - `dispatchId` — `{serviceKey: 'seal:<name>', role: 'key-server'}`.\n// The service key folds the seal instance\n// name so multi-instance stacks (distilled-doc\n// Open Question #7) don't collide.\n// - `upstream` — container kind; the substrate resolves the\n// container name from the lifecycle row.\n// - `cors: true` — the @mysten/seal SDK's fetch calls require\n// CORS allowance (distilled doc: localnet\n// SDK browser flow).\n//\n// Distilled-doc invariant #1: the URL the router publishes for this\n// routable decl MUST equal the URL we register on chain. The\n// plugin's acquire body reads the router's published URL ONCE\n// and threads the same value into the Move register call.\n\nimport type { DispatchId, EntrypointDecl, RoutableDecl } from '../../contracts/routable.ts';\n\n/** Well-known endpoint name for the seal key-server. Conventional\n * router entrypoint `'seal-key-server'` on port 2024. */\nexport const SEAL_KEY_SERVER_ENDPOINT_NAME = 'seal-key-server' as const;\nexport const SEAL_KEY_SERVER_ROUTE_ROLE = 'key-server' as const;\nexport const DEFAULT_KEY_SERVER_PORT = 2024 as const;\n\nexport const SEAL_ENTRYPOINTS: ReadonlyArray<EntrypointDecl> = [\n\t{ name: SEAL_KEY_SERVER_ENDPOINT_NAME, port: DEFAULT_KEY_SERVER_PORT, protocol: 'http' },\n];\n\nconst DEFAULT_STACK = 'main';\n\nconst normalizeRouteSegment = (raw: string): string => raw.toLowerCase().replace(/\\./g, '-');\n\n/** Build the DispatchId for a seal instance. The service key\n * encodes the instance name so multi-instance seal in the same\n * stack mints distinct dispatch files.\n *\n * Note: distilled-doc Open Question #7 — multi-instance seal is\n * structurally supported but untested. The two routable decls\n * would both claim the `'seal-key-server'` entrypoint and the\n * same `key-server.<stack>.<app>.localhost` hostname. Until v2\n * plans canonicalize multi-instance routing, treat one-seal-per-stack\n * as the safe default. */\nexport const buildSealDispatchId = (name: string): DispatchId => ({\n\tserviceKey: `seal:${name}`,\n\trole: SEAL_KEY_SERVER_ROUTE_ROLE,\n});\n\nexport const buildSealKeyServerPublicRoute = (inputs: {\n\treadonly app: string;\n\treadonly stack: string;\n\treadonly port: number;\n}): { readonly hostname: string; readonly url: string } => {\n\tconst role = normalizeRouteSegment(SEAL_KEY_SERVER_ROUTE_ROLE);\n\tconst app = normalizeRouteSegment(inputs.app);\n\tconst stack = normalizeRouteSegment(inputs.stack);\n\tconst hostname =\n\t\tstack === DEFAULT_STACK ? `${role}.${app}.localhost` : `${role}.${stack}.${app}.localhost`;\n\treturn {\n\t\thostname,\n\t\turl: `http://${hostname}:${inputs.port}`,\n\t};\n};\n\n/** Build the Routable contribution. The substrate's router\n * orchestrator consumes this; the actual hostname / URL minting\n * happens there (architecture: routes-by-key, no hardcoded\n * service hostnames in router code). */\nexport const makeSealRoutable = (inputs: {\n\treadonly name: string;\n\treadonly containerName: string;\n}): RoutableDecl => ({\n\tkind: 'routable',\n\tendpointName: SEAL_KEY_SERVER_ENDPOINT_NAME,\n\tdispatchId: buildSealDispatchId(inputs.name),\n\tupstream: {\n\t\ttype: 'container',\n\t\tcontainerName: inputs.containerName,\n\t\tcontainerPort: DEFAULT_KEY_SERVER_PORT,\n\t},\n\tcors: true,\n\twireProtocol: 'http',\n});\n"],"mappings":";;;AA8BA,MAAa,gCAAgC;AAC7C,MAAa,6BAA6B;AAC1C,MAAa,0BAA0B;AAEvC,MAAa,mBAAkD,CAC9D;CAAE,MAAM;CAA+B,MAAM;CAAyB,UAAU;AAAO,CACxF;AAEA,MAAM,gBAAgB;AAEtB,MAAM,yBAAyB,QAAwB,IAAI,YAAY,CAAC,CAAC,QAAQ,OAAO,GAAG;;;;;;;;;;;AAY3F,MAAa,uBAAuB,UAA8B;CACjE,YAAY,QAAQ;CACpB,MAAM;AACP;AAEA,MAAa,iCAAiC,WAIa;CAC1D,MAAM,OAAO,sBAAsB,0BAA0B;CAC7D,MAAM,MAAM,sBAAsB,OAAO,GAAG;CAC5C,MAAM,QAAQ,sBAAsB,OAAO,KAAK;CAChD,MAAM,WACL,UAAU,gBAAgB,GAAG,KAAK,GAAG,IAAI,cAAc,GAAG,KAAK,GAAG,MAAM,GAAG,IAAI;CAChF,OAAO;EACN;EACA,KAAK,UAAU,SAAS,GAAG,OAAO;CACnC;AACD;;;;;AAMA,MAAa,oBAAoB,YAGZ;CACpB,MAAM;CACN,cAAc;CACd,YAAY,oBAAoB,OAAO,IAAI;CAC3C,UAAU;EACT,MAAM;EACN,eAAe,OAAO;EACtB,eAAe;CAChB;CACA,MAAM;CACN,cAAc;AACf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.mjs","names":[],"sources":["../../../src/plugins/seal/service.ts"],"sourcesContent":["// Seal plugin — known-mode dispatch (live + fork-known).\n//\n// Local-keygen mode is dispatched directly from the plugin barrel\n// (`index.ts`) via `bootLocalKeygen` because it needs a\n// `LocalKeygenDeps` bundle (ContainerRuntime, paths, identity, …)\n// composed from substrate services. This file only routes the two\n// pure-value-producing modes that need no substrate plumbing.\n\nimport { Effect, type Scope } from 'effect';\n\nimport type {\n\tArtifactPublishError,\n\tArtifactPublisher,\n} from '../../primitives/artifact-publisher.ts';\nimport type { SealAnyError } from './errors.ts';\nimport { acquireForkKnown, type ForkKnownInputs } from './mode/fork-known.ts';\nimport { acquireLive } from './mode/live.ts';\nimport type { SealKnownResolved } from './registry-publish.ts';\n\n/** Known-mode discriminator — live + fork-known only. */\nexport type SealMode =\n\t| {\n\t\t\treadonly mode: 'live';\n\t\t\treadonly name: string;\n\t\t\treadonly resolved: { readonly objectId: string; readonly keyServerUrl: string };\n\t }\n\t| ({ readonly mode: 'fork-known' } & ForkKnownInputs);\n\nexport type SealKnownBootResult = SealKnownResolved;\n\n/** Dispatch on the known-mode discriminator. The publisher argument\n * is unused by the known paths (no on-chain artifact produce); it's\n * accepted for shape uniformity with the local-keygen entry point. */\nexport const bootSealService = (\n\t_publisher: ArtifactPublisher,\n\topts: SealMode,\n): Effect.Effect<SealKnownBootResult, SealAnyError | ArtifactPublishError, Scope.Scope> => {\n\tswitch (opts.mode) {\n\t\tcase 'live':\n\t\t\treturn acquireLive(opts);\n\t\tcase 'fork-known':\n\t\t\treturn acquireForkKnown(opts);\n\t}\n};\n"],"mappings":";;;;;;;AAiCA,MAAa,mBACZ,YACA,SAC0F;
|
|
1
|
+
{"version":3,"file":"service.mjs","names":[],"sources":["../../../src/plugins/seal/service.ts"],"sourcesContent":["// Seal plugin — known-mode dispatch (live + fork-known).\n//\n// Local-keygen mode is dispatched directly from the plugin barrel\n// (`index.ts`) via `bootLocalKeygen` because it needs a\n// `LocalKeygenDeps` bundle (ContainerRuntime, paths, identity, …)\n// composed from substrate services. This file only routes the two\n// pure-value-producing modes that need no substrate plumbing.\n\nimport { Effect, type Scope } from 'effect';\n\nimport type {\n\tArtifactPublishError,\n\tArtifactPublisher,\n} from '../../primitives/artifact-publisher.ts';\nimport type { SealAnyError } from './errors.ts';\nimport { acquireForkKnown, type ForkKnownInputs } from './mode/fork-known.ts';\nimport { acquireLive } from './mode/live.ts';\nimport type { SealKnownResolved } from './registry-publish.ts';\n\n/** Known-mode discriminator — live + fork-known only. */\nexport type SealMode =\n\t| {\n\t\t\treadonly mode: 'live';\n\t\t\treadonly name: string;\n\t\t\treadonly resolved: { readonly objectId: string; readonly keyServerUrl: string };\n\t }\n\t| ({ readonly mode: 'fork-known' } & ForkKnownInputs);\n\nexport type SealKnownBootResult = SealKnownResolved;\n\n/** Dispatch on the known-mode discriminator. The publisher argument\n * is unused by the known paths (no on-chain artifact produce); it's\n * accepted for shape uniformity with the local-keygen entry point. */\nexport const bootSealService = (\n\t_publisher: ArtifactPublisher,\n\topts: SealMode,\n): Effect.Effect<SealKnownBootResult, SealAnyError | ArtifactPublishError, Scope.Scope> => {\n\tswitch (opts.mode) {\n\t\tcase 'live':\n\t\t\treturn acquireLive(opts);\n\t\tcase 'fork-known':\n\t\t\treturn acquireForkKnown(opts);\n\t}\n};\n"],"mappings":";;;;;;;AAiCA,MAAa,mBACZ,YACA,SAC0F;CAC1F,QAAQ,KAAK,MAAb;EACC,KAAK,QACJ,OAAO,YAAY,IAAI;EACxB,KAAK,cACJ,OAAO,iBAAiB,IAAI;CAC9B;AACD"}
|
|
@@ -10,14 +10,13 @@ import { Effect } from "effect";
|
|
|
10
10
|
const makeLocalKeygenSnapshotable = (inputs) => {
|
|
11
11
|
return {
|
|
12
12
|
kind: "snapshotable",
|
|
13
|
-
subtrees: [
|
|
13
|
+
subtrees: ["seal/"],
|
|
14
14
|
managedContainers: [{
|
|
15
15
|
app: inputs.app,
|
|
16
16
|
stack: inputs.stack,
|
|
17
17
|
plugin: "seal",
|
|
18
18
|
role: "key-server"
|
|
19
19
|
}],
|
|
20
|
-
quiesce: Effect.void,
|
|
21
20
|
preRestore: Effect.succeed({
|
|
22
21
|
kind: "seal",
|
|
23
22
|
name: inputs.name
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapshot.mjs","names":[],"sources":["../../../src/plugins/seal/snapshot.ts"],"sourcesContent":["// Seal plugin — Snapshotable contribution.\n//\n// Distilled-doc §\"What survives snapshot\":\n//\n// - `runtime/seal/master-key.env` (0o600 — SECRET MATERIAL)\n// - `runtime/seal/local-keygen-state.v1.json` (public key metadata)\n// - `runtime/seal/key-server-config.yaml`\n// -
|
|
1
|
+
{"version":3,"file":"snapshot.mjs","names":[],"sources":["../../../src/plugins/seal/snapshot.ts"],"sourcesContent":["// Seal plugin — Snapshotable contribution.\n//\n// Distilled-doc §\"What survives snapshot\":\n//\n// - `runtime/seal/master-key.env` (0o600 — SECRET MATERIAL)\n// - `runtime/seal/local-keygen-state.v1.json` (public key metadata)\n// - `runtime/seal/key-server-config.yaml`\n// - Content-addressed cache entries (the keypair the ArtifactPublisher\n// persists under `cache/<namespace>/<chainId>/...`, auto-captured by\n// the substrate's cache subtree — we don't declare a subtree for those).\n// - Managed container — labeled tuple drives the docker commit +\n// save path.\n//\n// Distilled-doc invariant: the master-key file is the LOAD-BEARING\n// piece — losing it on resume means the on-chain `KeyServer.url`'s\n// public key would mismatch a fresh keygen. The substrate's\n// `secretMaterial: true` flag drives the mode-bit round-trip (0o600\n// inside 0o700 parent preserved through the snapshot tar).\n//\n// Architecture: the orchestrator is service-name-blind — it walks\n// the Snapshotable decls, sees `runtime/seal/` as just a subtree\n// path, and treats the secret flag as an opaque mode-bit directive.\n\nimport { Effect } from 'effect';\n\nimport type { ContainerLabelTuple, SnapshotableDecl } from '../../contracts/snapshotable.ts';\n\n/** Build the Snapshotable contribution for the local-keygen mode.\n *\n * Inputs threaded by the barrel from acquire-time substrate\n * identity. Distilled-doc invariant #4: `master-key.env` MUST\n * survive snapshot. `missingTolerance: 'fatal'` because the file's\n * absence on restore would silently re-derive a fresh keypair\n * against a stale on-chain public key. */\nexport const makeLocalKeygenSnapshotable = (inputs: {\n\treadonly name: string;\n\treadonly app: string;\n\treadonly stack: string;\n}): SnapshotableDecl => {\n\tconst labelTuple: ContainerLabelTuple = {\n\t\tapp: inputs.app,\n\t\tstack: inputs.stack,\n\t\tplugin: 'seal',\n\t\trole: 'key-server',\n\t};\n\treturn {\n\t\tkind: 'snapshotable',\n\t\t// Subtree under runtime/. The substrate roots this under the\n\t\t// per-stack runtime-dir; `seal` is plugin-blind from the\n\t\t// orchestrator's POV (just a path segment).\n\t\tsubtrees: ['seal/'],\n\t\tmanagedContainers: [labelTuple],\n\t\t// The key-server's Docker stop grace is owned by key-server.ts; the\n\t\t// capture bounce's graceful stop flushes its state before commit.\n\t\tpreRestore: Effect.succeed({\n\t\t\tkind: 'seal' as const,\n\t\t\tname: inputs.name,\n\t\t}),\n\t\tpostRestore: Effect.void,\n\t\tmissingTolerance: 'fatal',\n\t\t// Distilled-doc §Hard requirements #2 + #4: master-key.env is\n\t\t// secret material (0o600). The substrate's tar handler\n\t\t// preserves the mode bits on round-trip.\n\t\tsecretMaterial: true,\n\t};\n};\n\n/** Build the Snapshotable contribution for the known-deployment\n * modes (live / fork-known). No managed container, no on-disk\n * state — we only need the orchestrator to see the plugin's\n * identity for the manifest sidecar.\n *\n * `missingTolerance: 'fine'` because the known-deployment mode\n * has no host-side state to lose. */\nexport const makeKnownSnapshotable = (inputs: { readonly name: string }): SnapshotableDecl => ({\n\tkind: 'snapshotable',\n\tsubtrees: [],\n\tmissingTolerance: 'fine',\n\tpreRestore: Effect.succeed({ kind: 'seal' as const, name: inputs.name }),\n\tpostRestore: Effect.void,\n\tsecretMaterial: false,\n});\n"],"mappings":";;;;;;;;;AAkCA,MAAa,+BAA+B,WAIpB;CAOvB,OAAO;EACN,MAAM;EAIN,UAAU,CAAC,OAAO;EAClB,mBAAmB,CAAC;GAXpB,KAAK,OAAO;GACZ,OAAO,OAAO;GACd,QAAQ;GACR,MAAM;EAQuB,CAAC;EAG9B,YAAY,OAAO,QAAQ;GAC1B,MAAM;GACN,MAAM,OAAO;EACd,CAAC;EACD,aAAa,OAAO;EACpB,kBAAkB;EAIlB,gBAAgB;CACjB;AACD;;;;;;;;AASA,MAAa,yBAAyB,YAAyD;CAC9F,MAAM;CACN,UAAU,CAAC;CACX,kBAAkB;CAClB,YAAY,OAAO,QAAQ;EAAE,MAAM;EAAiB,MAAM,OAAO;CAAK,CAAC;CACvE,aAAa,OAAO;CACpB,gBAAgB;AACjB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LogAttr } from "../../substrate/runtime/observability/log-attrs.mjs";
|
|
2
2
|
import { suiConfigError } from "./errors.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { SuiLogAttr } from "./log-attrs.mjs";
|
|
4
4
|
import { Effect, Schedule } from "effect";
|
|
5
5
|
//#region src/plugins/sui/auto-tick.ts
|
|
6
6
|
/** Default cadence when caller passes `autoTick: true`. */
|
|
@@ -28,9 +28,9 @@ const resolveAutoTickIntervalMs = (option) => {
|
|
|
28
28
|
*/
|
|
29
29
|
const runAutoTickClock = (advancer, intervalMs) => Effect.gen(function* () {
|
|
30
30
|
yield* advancer.advanceClock(intervalMs).pipe(Effect.catch((err) => Effect.logWarning("sui auto-tick advance failed; next tick will retry").pipe(Effect.annotateLogs({
|
|
31
|
-
[
|
|
32
|
-
[
|
|
33
|
-
[
|
|
31
|
+
[SuiLogAttr.autoTickIntervalMs]: intervalMs,
|
|
32
|
+
[LogAttr.phase]: err.phase,
|
|
33
|
+
[LogAttr.errorMessage]: err.message
|
|
34
34
|
})))).pipe(Effect.repeat(Schedule.spaced(`${intervalMs} millis`)), Effect.forkScoped);
|
|
35
35
|
});
|
|
36
36
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-tick.mjs","names":[],"sources":["../../../src/plugins/sui/auto-tick.ts"],"sourcesContent":["// Auto-tick clock — fork-mode-only.\n//\n// Architecture invariant: \"Auto-tick is fork-mode-only\" — the\n// `autoTick` option lives on `SuiForkOptions` alone, and only the\n// fork boot wires `runAutoTickClock` (against the fork binary's\n// `ForkingService.advanceClock`). Localnet's validator advances its\n// own clock and commits pending txs without prompting, so no\n// equivalent knob exists there.\n//\n// The fiber is `forkScoped` against the plugin's acquire scope:\n// teardown happens automatically on wipe/restart/Ctrl-C. Failure\n// policy is **log-warn-and-continue** — a single advance-clock\n// RPC failure must not break the supervisor.\n\nimport { Effect, Schedule, type Scope } from 'effect';\n\nimport {
|
|
1
|
+
{"version":3,"file":"auto-tick.mjs","names":[],"sources":["../../../src/plugins/sui/auto-tick.ts"],"sourcesContent":["// Auto-tick clock — fork-mode-only.\n//\n// Architecture invariant: \"Auto-tick is fork-mode-only\" — the\n// `autoTick` option lives on `SuiForkOptions` alone, and only the\n// fork boot wires `runAutoTickClock` (against the fork binary's\n// `ForkingService.advanceClock`). Localnet's validator advances its\n// own clock and commits pending txs without prompting, so no\n// equivalent knob exists there.\n//\n// The fiber is `forkScoped` against the plugin's acquire scope:\n// teardown happens automatically on wipe/restart/Ctrl-C. Failure\n// policy is **log-warn-and-continue** — a single advance-clock\n// RPC failure must not break the supervisor.\n\nimport { Effect, Schedule, type Scope } from 'effect';\n\nimport { LogAttr } from '../../substrate/runtime/observability/log-attrs.ts';\nimport { suiConfigError } from './errors.ts';\nimport type { SuiConfigError, SuiPluginError } from './errors.ts';\nimport { SuiLogAttr } from './log-attrs.ts';\n\n/** Public knob shape mirroring the user-facing API. */\nexport type AutoTickOption = boolean | { readonly intervalMs: number };\n\n/** Default cadence when caller passes `autoTick: true`. */\nexport const DEFAULT_AUTO_TICK_INTERVAL_MS = 1000;\n\n/** Resolve the public option to a numeric interval. Succeeds with\n * `undefined` when auto-tick is OFF. A misconfigured option (0 /\n * negative / non-finite) fails the effect with a typed\n * `SuiConfigError` so the boot path can `catchTag` it — a synchronous\n * `throw` inside the acquire `Effect.gen` would surface as a defect\n * (STYLE_GUIDE §2: plugin errors must be catchTag-able). */\nexport const resolveAutoTickIntervalMs = (\n\toption?: AutoTickOption,\n): Effect.Effect<number | undefined, SuiConfigError> => {\n\tif (option === undefined || option === false) return Effect.succeed(undefined);\n\tif (option === true) return Effect.succeed(DEFAULT_AUTO_TICK_INTERVAL_MS);\n\tconst { intervalMs } = option;\n\tif (typeof intervalMs === 'number' && Number.isFinite(intervalMs) && intervalMs > 0) {\n\t\treturn Effect.succeed(intervalMs);\n\t}\n\treturn Effect.fail(\n\t\tsuiConfigError({\n\t\t\tfield: 'autoTick.intervalMs',\n\t\t\tmessage: `sui: autoTick.intervalMs must be a positive finite number (got ${String(intervalMs)})`,\n\t\t}),\n\t);\n};\n\n/** Plugin-internal shim — the minimal admin surface the auto-tick\n * fiber needs. Fork-mode wires this to the fork admin surface, whose\n * `advanceClock` calls the binary's `ForkingService.advanceClock`\n * gRPC method (see `makeForkAdminSurface` in `mode/fork.ts`). The\n * `ForkAdminSurface` is structurally a `ClockAdvancer`, so the boot\n * hands it through directly. */\nexport interface ClockAdvancer {\n\treadonly advanceClock: (intervalMs: number) => Effect.Effect<void, SuiPluginError>;\n}\n\n/**\n * Fork a scope-bound fiber that calls `advanceClock(intervalMs)` on\n * a `Schedule.spaced(intervalMs)` cadence. The fiber dies on the\n * surrounding scope's close (wipe / restart / Ctrl-C).\n */\nexport const runAutoTickClock = (\n\tadvancer: ClockAdvancer,\n\tintervalMs: number,\n): Effect.Effect<void, never, Scope.Scope> =>\n\tEffect.gen(function* () {\n\t\tconst tick = advancer.advanceClock(intervalMs).pipe(\n\t\t\tEffect.catch((err) =>\n\t\t\t\tEffect.logWarning('sui auto-tick advance failed; next tick will retry').pipe(\n\t\t\t\t\tEffect.annotateLogs({\n\t\t\t\t\t\t[SuiLogAttr.autoTickIntervalMs]: intervalMs,\n\t\t\t\t\t\t[LogAttr.phase]: err.phase,\n\t\t\t\t\t\t[LogAttr.errorMessage]: err.message,\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\tyield* tick.pipe(Effect.repeat(Schedule.spaced(`${intervalMs} millis`)), Effect.forkScoped);\n\t});\n"],"mappings":";;;;;;AAyBA,MAAa,gCAAgC;;;;;;;AAQ7C,MAAa,6BACZ,WACuD;CACvD,IAAI,WAAW,KAAA,KAAa,WAAW,OAAO,OAAO,OAAO,QAAQ,KAAA,CAAS;CAC7E,IAAI,WAAW,MAAM,OAAO,OAAO,QAAQ,6BAA6B;CACxE,MAAM,EAAE,eAAe;CACvB,IAAI,OAAO,eAAe,YAAY,OAAO,SAAS,UAAU,KAAK,aAAa,GACjF,OAAO,OAAO,QAAQ,UAAU;CAEjC,OAAO,OAAO,KACb,eAAe;EACd,OAAO;EACP,SAAS,kEAAkE,OAAO,UAAU,EAAE;CAC/F,CAAC,CACF;AACD;;;;;;AAiBA,MAAa,oBACZ,UACA,eAEA,OAAO,IAAI,aAAa;CAYvB,OAXa,SAAS,aAAa,UAAU,CAAC,CAAC,KAC9C,OAAO,OAAO,QACb,OAAO,WAAW,oDAAoD,CAAC,CAAC,KACvE,OAAO,aAAa;GAClB,WAAW,qBAAqB;GAChC,QAAQ,QAAQ,IAAI;GACpB,QAAQ,eAAe,IAAI;CAC7B,CAAC,CACF,CACD,CAES,CAAC,CAAC,KAAK,OAAO,OAAO,SAAS,OAAO,GAAG,WAAW,QAAQ,CAAC,GAAG,OAAO,UAAU;AAC3F,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "../../substrate/runtime/cross-process/stack-lock.mjs";
|
|
2
|
-
import "
|
|
2
|
+
import "./move/index.mjs";
|
|
3
3
|
import "../../substrate/runtime/managed-container.mjs";
|
|
4
4
|
import "./errors.mjs";
|
|
5
5
|
import "effect";
|
|
6
|
-
import "node:crypto";
|
|
7
6
|
import "node:path";
|
|
7
|
+
import "node:crypto";
|
|
8
8
|
import "node:os";
|
|
9
9
|
[
|
|
10
10
|
"child=;",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chain-build-container.mjs","names":[],"sources":["../../../src/plugins/sui/chain-build-container.ts"],"sourcesContent":["// Per-app long-lived Move build container.\n//\n// Architecture Decision §5: the build container is PER-APP, NOT\n// per-stack. Two parallel stacks of the same app share the same\n// sleeper container — their concurrent Move builds serialise on\n// docker exec queueing. This is intentional: dep-cache reuse\n// across stacks outweighs the serialisation cost.\n//\n// Adopt-or-create state machine is delegated to the substrate's\n// `ContainerRuntime.ensureContainer` with `recreate: 'never'` —\n// daemon outages must fail loudly, not silently churn (distilled\n// doc S6: \"MUST reject the helper's auto-recreate-on-resume-failed\n// path\").\n//\n// Cross-process safety: the host-wide advisory lock is owned by\n// THIS module. The lock is held inside the build call (NOT at the\n// docker-exec layer), because three distinct execution paths (host\n// CLI, fresh `docker run --rm`, container exec) all need\n// protection. Lock path: `~/.devstack/locks/sui-move-build-<repoHash>.lock`.\n\nimport { createHash } from 'node:crypto';\nimport { homedir } from 'node:os';\nimport { dirname, join, resolve } from 'node:path';\nimport { Effect, type Scope } from 'effect';\n\nimport type {\n\tContainerHandle,\n\tContainerRuntime,\n\tContainerRuntimeError,\n\tEnsureContainerSpec,\n\tImageRef,\n} from '../../contracts/container-runtime.ts';\nimport { acquireStackLock } from '../../substrate/runtime/cross-process/stack-lock.ts';\nimport {\n\tensureManagedContainer,\n\tPER_APP_SHARED_STACK,\n} from '../../substrate/runtime/managed-container.ts';\nimport { containerInnerScript } from '../../substrate/runtime/sui-move-build/index.ts';\nimport { suiCliError, suiPluginError, type SuiCliError, type SuiPluginError } from './errors.ts';\n\n/** Default move-build lock timeout — five minutes, matching the\n * distilled-doc invariant. The lock is held during the build\n * body only; long-running stages never share it. */\nexport const MOVE_BUILD_LOCK_TIMEOUT_MS = 5 * 60_000;\n\nconst BUILD_CONTAINER_STOP_GRACE_SECONDS = 2;\nconst BUILD_CONTAINER_KEEPALIVE_COMMAND = [\n\t'child=;',\n\t'trap \\'[ -z \"$child\" ] || kill \"$child\" 2>/dev/null || true; exit 0\\' INT TERM;',\n\t'sleep infinity & child=$!;',\n\t'wait \"$child\"',\n].join(' ');\n\n/** Per-app container name. The substrate's `pluginKey('sui-build')`\n * + the app discriminator combine to a stable name; the container\n * intentionally omits the stack/network suffix so two stacks of\n * the same app share. */\nexport const containerNameForApp = (app: string): string => `devstack-${app}-build`;\n\nconst expandHome = (path: string): string =>\n\tpath === '~' ? homedir() : path.startsWith('~/') ? join(homedir(), path.slice(2)) : path;\n\nconst repoHashForLock = (appDir: string): string =>\n\tcreateHash('sha256').update(resolve(appDir)).digest('hex').slice(0, 16);\n\nexport const moveBuildLockPathFor = (appDir: string, moveHome: string): string => {\n\tconst moveHomeRoot = dirname(resolve(expandHome(moveHome)));\n\treturn join(moveHomeRoot, '.devstack', 'locks', `sui-move-build-${repoHashForLock(appDir)}.lock`);\n};\n\n/** Build-container handle returned to plugin internals (the\n * cli-driver dispatches into this). */\nexport interface ChainBuildContainer {\n\treadonly handle: ContainerHandle;\n\t/** Translate a host-absolute path into a container-bind path.\n\t * Returns null when the host path escapes the bind-mounted app\n\t * dir — callers MUST fall back to `docker run --rm` in that\n\t * case (distilled-doc: \"Build container path translation MUST\n\t * refuse paths outside the bind-mounted app dir\"). */\n\treadonly toContainerPath: (hostPath: string) => string | null;\n\t/** Run a sui-cli capture inside the container. Acquires the\n\t * host-wide move-build lock before invoking docker-exec. */\n\treadonly runBuild: (\n\t\thostPackagePath: string,\n\t) => Effect.Effect<\n\t\t{ readonly exitCode: number; readonly stdout: string; readonly stderr: string },\n\t\tSuiCliError,\n\t\tScope.Scope\n\t>;\n\t/** Run a codegen-style \"summary\" build inside the container.\n\t * Same wire shape as runBuild; the codegen plugin consumes\n\t * this via the cross-service seam. */\n\treadonly runSummary: (\n\t\thostPackagePath: string,\n\t) => Effect.Effect<\n\t\t{ readonly exitCode: number; readonly stdout: string; readonly stderr: string },\n\t\tSuiCliError,\n\t\tScope.Scope\n\t>;\n}\n\n/** Spec passed to `ContainerRuntime.ensureContainer` for the\n * per-app sleeper. Image is content-hashed; labels carry the\n * app discriminator so `inspectByLabels` finds it across stacks. */\nexport interface ChainBuildContainerSpec {\n\treadonly app: string;\n\treadonly stack: string;\n\treadonly appDir: string;\n\treadonly moveHome: string;\n\treadonly image: ImageRef;\n}\n\n/**\n * Acquire (or adopt) the per-app build container. Returns a\n * `ChainBuildContainer` handle scoped to the caller's Scope.\n *\n * The build call holds the host-wide move-build lock for the docker\n * exec body. The lock uses the substrate's PID + start-time stale\n * holder reclaim path, so a crashed peer cannot wedge future builds.\n */\nexport const acquireChainBuildContainer = (\n\truntime: ContainerRuntime,\n\tspec: ChainBuildContainerSpec,\n): Effect.Effect<ChainBuildContainer, ContainerRuntimeError | SuiPluginError, Scope.Scope> =>\n\tEffect.gen(function* () {\n\t\t// The sleeper shell traps Docker's stop signal so scope-close\n\t\t// does not wait for Docker's default SIGKILL escalation path.\n\t\t// This also overrides the sui image's default `start\n\t\t// --with-faucet=...` entrypoint so the validator binary doesn't\n\t\t// run genesis inside a build container.\n\t\t// The appDir is bind-mounted at `/workspace`, with the user's\n\t\t// `~/.move` bind-mounted at `/root/.move` so the content-addressed\n\t\t// dep cache (`~/.move/git/<repo>@<sha>/…`) persists across builds.\n\t\tconst ensureSpec: EnsureContainerSpec = {\n\t\t\tname: containerNameForApp(spec.app),\n\t\t\timage: spec.image,\n\t\t\tlabels: {\n\t\t\t\tapp: spec.app,\n\t\t\t\t// Intentionally pin stack to a sentinel — see comment\n\t\t\t\t// above; this is per-app, not per-stack.\n\t\t\t\tstack: PER_APP_SHARED_STACK,\n\t\t\t\tplugin: 'sui',\n\t\t\t\trole: 'build',\n\t\t\t},\n\t\t\trecreate: 'never',\n\t\t\tentrypoint: 'sh',\n\t\t\tcommand: ['-c', BUILD_CONTAINER_KEEPALIVE_COMMAND],\n\t\t\tstopGraceSeconds: BUILD_CONTAINER_STOP_GRACE_SECONDS,\n\t\t\tmounts: [\n\t\t\t\t{ source: spec.appDir, target: '/workspace' },\n\t\t\t\t{ source: spec.moveHome, target: '/root/.move' },\n\t\t\t],\n\t\t};\n\t\tconst { labels, ...containerSpec } = ensureSpec;\n\t\tconst handle = yield* ensureManagedContainer({\n\t\t\truntime,\n\t\t\tlabels,\n\t\t\tspec: containerSpec,\n\t\t\tmapError: (cause) => cause,\n\t\t});\n\n\t\tconst toContainerPath = (hostPath: string): string | null => {\n\t\t\t// The runtime adapter bind-mounts `spec.appDir` at\n\t\t\t// `/workspace`. A host path outside that bind is not\n\t\t\t// accessible to the container.\n\t\t\tif (!hostPath.startsWith(spec.appDir)) return null;\n\t\t\tconst rel = hostPath.slice(spec.appDir.length).replace(/^\\/+/, '');\n\t\t\treturn rel === '' ? '/workspace' : `/workspace/${rel}`;\n\t\t};\n\t\tconst moveBuildLockPath = moveBuildLockPathFor(spec.appDir, spec.moveHome);\n\n\t\tconst runInContainer = (\n\t\t\top: 'build' | 'summary',\n\t\t\thostPackagePath: string,\n\t\t): Effect.Effect<\n\t\t\t{ readonly exitCode: number; readonly stdout: string; readonly stderr: string },\n\t\t\tSuiCliError,\n\t\t\tScope.Scope\n\t\t> =>\n\t\t\tEffect.gen(function* () {\n\t\t\t\tconst containerPath = toContainerPath(hostPackagePath);\n\t\t\t\tif (containerPath === null) {\n\t\t\t\t\treturn yield* Effect.fail(\n\t\t\t\t\t\tsuiCliError(op, {\n\t\t\t\t\t\t\tcause: new Error(\n\t\t\t\t\t\t\t\t`chain-build-container: host path ${hostPackagePath} escapes appDir bind (${spec.appDir}); ` +\n\t\t\t\t\t\t\t\t\t`caller MUST fall back to docker run --rm`,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t// The package's container path = `/workspace/<basename>`.\n\t\t\t\t// containerInnerScript copies that subdir into an in-container\n\t\t\t\t// scratch dir and scrubs + builds THERE, so the bind-mounted\n\t\t\t\t// appDir source (`spec.appDir` at `/workspace`) is never\n\t\t\t\t// rewritten by the build.\n\t\t\t\tconst pkgName = containerPath.replace(/^\\/workspace\\//, '').replace(/^\\/+|\\/+$/g, '');\n\t\t\t\tconst inner = containerInnerScript(pkgName);\n\t\t\t\tconst result = yield* Effect.scoped(\n\t\t\t\t\tEffect.gen(function* () {\n\t\t\t\t\t\tyield* acquireStackLock(moveBuildLockPath, MOVE_BUILD_LOCK_TIMEOUT_MS).pipe(\n\t\t\t\t\t\t\tEffect.mapError(\n\t\t\t\t\t\t\t\t(cause): SuiCliError =>\n\t\t\t\t\t\t\t\t\tsuiCliError(op, {\n\t\t\t\t\t\t\t\t\t\tcause: new Error(`move-build lock acquire failed: ${cause._tag}`, { cause }),\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturn yield* runtime.exec(handle, ['sh', '-c', inner]).pipe(\n\t\t\t\t\t\t\tEffect.mapError(\n\t\t\t\t\t\t\t\t(cause): SuiCliError =>\n\t\t\t\t\t\t\t\t\tsuiCliError(op, {\n\t\t\t\t\t\t\t\t\t\tcause: new Error(`runtime.exec failed: ${cause.reason}: ${cause.detail}`),\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t);\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t\treturn result;\n\t\t\t});\n\n\t\tconst runBuild = (hostPackagePath: string) => runInContainer('build', hostPackagePath);\n\t\tconst runSummary = (hostPackagePath: string) => runInContainer('summary', hostPackagePath);\n\n\t\treturn { handle, toContainerPath, runBuild, runSummary };\n\t}).pipe(\n\t\tEffect.mapError((cause) =>\n\t\t\tisContainerRuntimeError(cause)\n\t\t\t\t? cause\n\t\t\t\t: suiPluginError('image-build', 'chain-build-container.acquire failed', cause),\n\t\t),\n\t);\n\nconst isContainerRuntimeError = (e: unknown): e is ContainerRuntimeError =>\n\ttypeof e === 'object' && e !== null && (e as { _tag?: string })._tag === 'ContainerRuntimeError';\n"],"mappings":";;;;;;;;AA8C0C;CACzC;CACA;CACA;CACA;CACA,CAAC,KAAK,IAAI"}
|
|
1
|
+
{"version":3,"file":"chain-build-container.mjs","names":[],"sources":["../../../src/plugins/sui/chain-build-container.ts"],"sourcesContent":["// Per-app long-lived Move build container.\n//\n// Architecture Decision §5: the build container is PER-APP, NOT\n// per-stack. Two parallel stacks of the same app share the same\n// sleeper container — their concurrent Move builds serialise on\n// docker exec queueing. This is intentional: dep-cache reuse\n// across stacks outweighs the serialisation cost.\n//\n// Adopt-or-create state machine is delegated to the substrate's\n// `ContainerRuntime.ensureContainer` with `recreate: 'never'` —\n// daemon outages must fail loudly, not silently churn (distilled\n// doc S6: \"MUST reject the helper's auto-recreate-on-resume-failed\n// path\").\n//\n// Cross-process safety: the host-wide advisory lock is owned by\n// THIS module. The lock is held inside the build call (NOT at the\n// docker-exec layer), because three distinct execution paths (host\n// CLI, fresh `docker run --rm`, container exec) all need\n// protection. Lock path: `~/.devstack/locks/sui-move-build-<repoHash>.lock`.\n\nimport { createHash } from 'node:crypto';\nimport { homedir } from 'node:os';\nimport { dirname, join, resolve } from 'node:path';\nimport { Effect, type Scope } from 'effect';\n\nimport type {\n\tContainerHandle,\n\tContainerRuntime,\n\tContainerRuntimeError,\n\tEnsureContainerSpec,\n\tImageRef,\n} from '../../contracts/container-runtime.ts';\nimport { acquireStackLock } from '../../substrate/runtime/cross-process/stack-lock.ts';\nimport {\n\tensureManagedContainer,\n\tPER_APP_SHARED_STACK,\n} from '../../substrate/runtime/managed-container.ts';\nimport { containerInnerScript } from './move/index.ts';\nimport { suiCliError, suiPluginError, type SuiCliError, type SuiPluginError } from './errors.ts';\n\n/** Default move-build lock timeout — five minutes, matching the\n * distilled-doc invariant. The lock is held during the build\n * body only; long-running stages never share it. */\nexport const MOVE_BUILD_LOCK_TIMEOUT_MS = 5 * 60_000;\n\nconst BUILD_CONTAINER_STOP_GRACE_SECONDS = 2;\nconst BUILD_CONTAINER_KEEPALIVE_COMMAND = [\n\t'child=;',\n\t'trap \\'[ -z \"$child\" ] || kill \"$child\" 2>/dev/null || true; exit 0\\' INT TERM;',\n\t'sleep infinity & child=$!;',\n\t'wait \"$child\"',\n].join(' ');\n\n/** Per-app container name. The substrate's `pluginKey('sui-build')`\n * + the app discriminator combine to a stable name; the container\n * intentionally omits the stack/network suffix so two stacks of\n * the same app share. */\nexport const containerNameForApp = (app: string): string => `devstack-${app}-build`;\n\nconst expandHome = (path: string): string =>\n\tpath === '~' ? homedir() : path.startsWith('~/') ? join(homedir(), path.slice(2)) : path;\n\nconst repoHashForLock = (appDir: string): string =>\n\tcreateHash('sha256').update(resolve(appDir)).digest('hex').slice(0, 16);\n\nexport const moveBuildLockPathFor = (appDir: string, moveHome: string): string => {\n\tconst moveHomeRoot = dirname(resolve(expandHome(moveHome)));\n\treturn join(moveHomeRoot, '.devstack', 'locks', `sui-move-build-${repoHashForLock(appDir)}.lock`);\n};\n\n/** Build-container handle returned to plugin internals (the\n * cli-driver dispatches into this). */\nexport interface ChainBuildContainer {\n\treadonly handle: ContainerHandle;\n\t/** Translate a host-absolute path into a container-bind path.\n\t * Returns null when the host path escapes the bind-mounted app\n\t * dir — callers MUST fall back to `docker run --rm` in that\n\t * case (distilled-doc: \"Build container path translation MUST\n\t * refuse paths outside the bind-mounted app dir\"). */\n\treadonly toContainerPath: (hostPath: string) => string | null;\n\t/** Run a sui-cli capture inside the container. Acquires the\n\t * host-wide move-build lock before invoking docker-exec. */\n\treadonly runBuild: (\n\t\thostPackagePath: string,\n\t) => Effect.Effect<\n\t\t{ readonly exitCode: number; readonly stdout: string; readonly stderr: string },\n\t\tSuiCliError,\n\t\tScope.Scope\n\t>;\n\t/** Run a codegen-style \"summary\" build inside the container.\n\t * Same wire shape as runBuild; the codegen plugin consumes\n\t * this via the cross-service seam. */\n\treadonly runSummary: (\n\t\thostPackagePath: string,\n\t) => Effect.Effect<\n\t\t{ readonly exitCode: number; readonly stdout: string; readonly stderr: string },\n\t\tSuiCliError,\n\t\tScope.Scope\n\t>;\n}\n\n/** Spec passed to `ContainerRuntime.ensureContainer` for the\n * per-app sleeper. Image is content-hashed; labels carry the\n * app discriminator so `inspectByLabels` finds it across stacks. */\nexport interface ChainBuildContainerSpec {\n\treadonly app: string;\n\treadonly stack: string;\n\treadonly appDir: string;\n\treadonly moveHome: string;\n\treadonly image: ImageRef;\n}\n\n/**\n * Acquire (or adopt) the per-app build container. Returns a\n * `ChainBuildContainer` handle scoped to the caller's Scope.\n *\n * The build call holds the host-wide move-build lock for the docker\n * exec body. The lock uses the substrate's PID + start-time stale\n * holder reclaim path, so a crashed peer cannot wedge future builds.\n */\nexport const acquireChainBuildContainer = (\n\truntime: ContainerRuntime,\n\tspec: ChainBuildContainerSpec,\n): Effect.Effect<ChainBuildContainer, ContainerRuntimeError | SuiPluginError, Scope.Scope> =>\n\tEffect.gen(function* () {\n\t\t// The sleeper shell traps Docker's stop signal so scope-close\n\t\t// does not wait for Docker's default SIGKILL escalation path.\n\t\t// This also overrides the sui image's default `start\n\t\t// --with-faucet=...` entrypoint so the validator binary doesn't\n\t\t// run genesis inside a build container.\n\t\t// The appDir is bind-mounted at `/workspace`, with the user's\n\t\t// `~/.move` bind-mounted at `/root/.move` so the content-addressed\n\t\t// dep cache (`~/.move/git/<repo>@<sha>/…`) persists across builds.\n\t\tconst ensureSpec: EnsureContainerSpec = {\n\t\t\tname: containerNameForApp(spec.app),\n\t\t\timage: spec.image,\n\t\t\tlabels: {\n\t\t\t\tapp: spec.app,\n\t\t\t\t// Intentionally pin stack to a sentinel — see comment\n\t\t\t\t// above; this is per-app, not per-stack.\n\t\t\t\tstack: PER_APP_SHARED_STACK,\n\t\t\t\tplugin: 'sui',\n\t\t\t\trole: 'build',\n\t\t\t},\n\t\t\trecreate: 'never',\n\t\t\tentrypoint: 'sh',\n\t\t\tcommand: ['-c', BUILD_CONTAINER_KEEPALIVE_COMMAND],\n\t\t\tstopGraceSeconds: BUILD_CONTAINER_STOP_GRACE_SECONDS,\n\t\t\tmounts: [\n\t\t\t\t{ source: spec.appDir, target: '/workspace' },\n\t\t\t\t{ source: spec.moveHome, target: '/root/.move' },\n\t\t\t],\n\t\t};\n\t\tconst { labels, ...containerSpec } = ensureSpec;\n\t\tconst handle = yield* ensureManagedContainer({\n\t\t\truntime,\n\t\t\tlabels,\n\t\t\tspec: containerSpec,\n\t\t\tmapError: (cause) => cause,\n\t\t});\n\n\t\tconst toContainerPath = (hostPath: string): string | null => {\n\t\t\t// The runtime adapter bind-mounts `spec.appDir` at\n\t\t\t// `/workspace`. A host path outside that bind is not\n\t\t\t// accessible to the container.\n\t\t\tif (!hostPath.startsWith(spec.appDir)) return null;\n\t\t\tconst rel = hostPath.slice(spec.appDir.length).replace(/^\\/+/, '');\n\t\t\treturn rel === '' ? '/workspace' : `/workspace/${rel}`;\n\t\t};\n\t\tconst moveBuildLockPath = moveBuildLockPathFor(spec.appDir, spec.moveHome);\n\n\t\tconst runInContainer = (\n\t\t\top: 'build' | 'summary',\n\t\t\thostPackagePath: string,\n\t\t): Effect.Effect<\n\t\t\t{ readonly exitCode: number; readonly stdout: string; readonly stderr: string },\n\t\t\tSuiCliError,\n\t\t\tScope.Scope\n\t\t> =>\n\t\t\tEffect.gen(function* () {\n\t\t\t\tconst containerPath = toContainerPath(hostPackagePath);\n\t\t\t\tif (containerPath === null) {\n\t\t\t\t\treturn yield* Effect.fail(\n\t\t\t\t\t\tsuiCliError(op, {\n\t\t\t\t\t\t\tcause: new Error(\n\t\t\t\t\t\t\t\t`chain-build-container: host path ${hostPackagePath} escapes appDir bind (${spec.appDir}); ` +\n\t\t\t\t\t\t\t\t\t`caller MUST fall back to docker run --rm`,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t// The package's container path = `/workspace/<basename>`.\n\t\t\t\t// containerInnerScript copies that subdir into an in-container\n\t\t\t\t// scratch dir and scrubs + builds THERE, so the bind-mounted\n\t\t\t\t// appDir source (`spec.appDir` at `/workspace`) is never\n\t\t\t\t// rewritten by the build.\n\t\t\t\tconst pkgName = containerPath.replace(/^\\/workspace\\//, '').replace(/^\\/+|\\/+$/g, '');\n\t\t\t\tconst inner = containerInnerScript(pkgName);\n\t\t\t\tconst result = yield* Effect.scoped(\n\t\t\t\t\tEffect.gen(function* () {\n\t\t\t\t\t\tyield* acquireStackLock(moveBuildLockPath, MOVE_BUILD_LOCK_TIMEOUT_MS).pipe(\n\t\t\t\t\t\t\tEffect.mapError(\n\t\t\t\t\t\t\t\t(cause): SuiCliError =>\n\t\t\t\t\t\t\t\t\tsuiCliError(op, {\n\t\t\t\t\t\t\t\t\t\tcause: new Error(`move-build lock acquire failed: ${cause._tag}`, { cause }),\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturn yield* runtime.exec(handle, ['sh', '-c', inner]).pipe(\n\t\t\t\t\t\t\tEffect.mapError(\n\t\t\t\t\t\t\t\t(cause): SuiCliError =>\n\t\t\t\t\t\t\t\t\tsuiCliError(op, {\n\t\t\t\t\t\t\t\t\t\tcause: new Error(`runtime.exec failed: ${cause.reason}: ${cause.detail}`),\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t);\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t\treturn result;\n\t\t\t});\n\n\t\tconst runBuild = (hostPackagePath: string) => runInContainer('build', hostPackagePath);\n\t\tconst runSummary = (hostPackagePath: string) => runInContainer('summary', hostPackagePath);\n\n\t\treturn { handle, toContainerPath, runBuild, runSummary };\n\t}).pipe(\n\t\tEffect.mapError((cause) =>\n\t\t\tisContainerRuntimeError(cause)\n\t\t\t\t? cause\n\t\t\t\t: suiPluginError('image-build', 'chain-build-container.acquire failed', cause),\n\t\t),\n\t);\n\nconst isContainerRuntimeError = (e: unknown): e is ContainerRuntimeError =>\n\ttypeof e === 'object' && e !== null && (e as { _tag?: string })._tag === 'ContainerRuntimeError';\n"],"mappings":";;;;;;;;AA8C0C;CACzC;CACA;CACA;CACA;AACD,CAAC,CAAC,KAAK,GAAG"}
|
|
@@ -6,13 +6,13 @@ import { Effect } from "effect";
|
|
|
6
6
|
* chain id. The result implements the contract's `ChainProbe<Key>`
|
|
7
7
|
* shape; the Sui plugin emits this via a StrategyContributorDecl
|
|
8
8
|
* keyed by `chain-probe:<chainId>`. */
|
|
9
|
-
const makeSuiChainProbe = (sdk,
|
|
9
|
+
const makeSuiChainProbe = (sdk, chainId) => ({ get: (key, schema, mode) => Effect.gen(function* () {
|
|
10
10
|
const raw = yield* Effect.tryPromise({
|
|
11
11
|
try: () => key.kind === "object" ? sdk.core.getObject({ objectId: key.objectId }) : sdk.core.getTransaction({ digest: key.digest }),
|
|
12
12
|
catch: (cause) => ({
|
|
13
13
|
_tag: "ChainProbeError",
|
|
14
14
|
reason: isNotFound(cause) ? "not-found" : "transient",
|
|
15
|
-
|
|
15
|
+
chainId,
|
|
16
16
|
detail: formatUnknownError(cause)
|
|
17
17
|
})
|
|
18
18
|
}).pipe(Effect.catch((err) => mode === "lenient" && (err.reason === "not-found" || err.reason === "transient") ? Effect.succeed(null) : Effect.fail(err)));
|
|
@@ -20,11 +20,11 @@ const makeSuiChainProbe = (sdk, chain) => ({ get: (key, schema, mode) => Effect.
|
|
|
20
20
|
const payload = projectProbePayload(key, raw);
|
|
21
21
|
if (payload === null) return null;
|
|
22
22
|
return yield* decodeUnknown(schema, payload, {
|
|
23
|
-
source: `chain probe ${
|
|
23
|
+
source: `chain probe ${chainId}`,
|
|
24
24
|
mkError: (issue) => ({
|
|
25
25
|
_tag: "ChainProbeError",
|
|
26
26
|
reason: "decode-failed",
|
|
27
|
-
|
|
27
|
+
chainId,
|
|
28
28
|
detail: formatUnknownError(issue.cause ?? issue)
|
|
29
29
|
})
|
|
30
30
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chain-probe.mjs","names":[],"sources":["../../../src/plugins/sui/chain-probe.ts"],"sourcesContent":["// Sui plugin — ChainProbe capability implementation.\n//\n// Architecture §9: ChainProbe is a contract, NOT a primitive. Sui\n// provides the only in-tree implementation; the substrate dispatches\n// to it via the StrategyContributor registry under\n// `chain-probe:<chainId>`.\n//\n// Lenient mode: returns null for both \"not found\" AND transient RPC\n// failure — verify pipelines re-derive on the next cycle rather than\n// fail boot. Strict mode: distinguishes via tagged error.\n//\n// Why lenient is the default in this plugin's wiring: artifact publisher verify is\n// the dominant consumer; artifact publisher's lenient-retry profile (15 attempts,\n// 90s budget) is calibrated against lenient semantics. A strict\n// surface exists for explicit \"I want to know if the chain is\n// reachable\" callers (the doctor command, debugging).\n\nimport { Effect } from 'effect';\nimport type { ClientWithCoreApi } from '@mysten/sui/client';\n\nimport type {\n\tChainProbe,\n\tChainProbeError,\n\tChainProbeMode,\n\tChainProbeSchema,\n} from '../../contracts/chain-probe.ts';\nimport { decodeUnknown } from '../../substrate/runtime/runtime-decode.ts';\nimport { formatUnknownError } from '../../substrate/runtime/format-unknown-error.ts';\n\n/**\n * Sui's chain-key shape — discriminated so the probe can dispatch\n * between object reads, tx reads, and the (forthcoming) batch\n * variant on one method.\n */\nexport type SuiProbeKey =\n\t| { readonly kind: 'object'; readonly objectId: string }\n\t| { readonly kind: 'transaction'; readonly digest: string };\n\n// Note: this probe decodes against the CALLER-supplied `schema`\n// argument (see `makeSuiChainProbe`), never a local literal. Earlier\n// revisions also exported `SuiObjectShapeSchema` /\n// `SuiGetObjectResponseSchema` to \"document the SDK shape\", but they\n// had zero consumers (the contract's `ChainProbeSchema<Shape>` is what\n// validates), so per STYLE_GUIDE §5 (no orphan exports) they were\n// removed. Re-add a concrete object schema only if a caller actually\n// decodes through it.\n\n/** Plugin-internal SDK shim — the type the plugin's acquire body\n * hands to the probe factory + the account's sign/execute closure.\n * Kept narrow so we don't pull `@mysten/sui` types into the substrate.\n *\n * Exposes the four surfaces consumers actually use:\n *\n * - `getObject` / `getTransaction` — the lenient chain probe.\n * - `executeTransaction` — the account plugin's submit path\n * (txBytes + caller-signed signatures).\n * - `waitForTransaction` — post-submit finality wait.\n *\n * Plus an OPAQUE `client` field — the underlying `SuiGrpcClient`\n * reference. The package plugin's publish-tx builder hands this to\n * `Transaction.build({ client })` (the SDK resolves gas + object\n * versions through it). We type as `unknown` so the substrate stays\n * free of a direct `@mysten/sui/client` type import; the consumer\n * casts at the boundary (mirrors the same opacity decision in the\n * Coin plugin's `MintSdkShim.client`). */\nexport interface SuiSdkShim {\n\treadonly core: {\n\t\treadonly getObject: (args: {\n\t\t\treadonly objectId: string;\n\t\t\treadonly include?: {\n\t\t\t\treadonly content?: boolean;\n\t\t\t\treadonly json?: boolean;\n\t\t\t};\n\t\t}) => Promise<unknown>;\n\t\treadonly getTransaction: (args: { readonly digest: string }) => Promise<unknown>;\n\t\treadonly getBalance: (args: {\n\t\t\treadonly owner: string;\n\t\t\treadonly coinType?: string;\n\t\t}) => Promise<unknown>;\n\t\treadonly listCoins: (args: {\n\t\t\treadonly owner: string;\n\t\t\treadonly coinType?: string;\n\t\t\treadonly limit?: number;\n\t\t\treadonly cursor?: string | null;\n\t\t}) => Promise<{\n\t\t\treadonly objects: ReadonlyArray<{\n\t\t\t\treadonly objectId: string;\n\t\t\t\treadonly version: string;\n\t\t\t\treadonly digest: string;\n\t\t\t\treadonly balance: string;\n\t\t\t}>;\n\t\t\treadonly hasNextPage: boolean;\n\t\t\treadonly cursor: string | null;\n\t\t}>;\n\t\treadonly executeTransaction: (args: {\n\t\t\treadonly transaction: Uint8Array;\n\t\t\treadonly signatures: ReadonlyArray<string>;\n\t\t\treadonly include?: {\n\t\t\t\treadonly effects?: boolean;\n\t\t\t\treadonly objectTypes?: boolean;\n\t\t\t};\n\t\t}) => Promise<unknown>;\n\t\treadonly waitForTransaction: (args: {\n\t\t\treadonly digest: string;\n\t\t\treadonly timeout?: number;\n\t\t}) => Promise<unknown>;\n\t};\n\t/** Client reference for `Transaction.build({ client })` and every\n\t * `client.core.*` call. The Sui barrel wires the resolved\n\t * `SuiGrpcClient` through; consumers cast no further. */\n\treadonly client: ClientWithCoreApi;\n}\n\n/** Construct the chain-probe instance for a resolved Sui client +\n * chain id. The result implements the contract's `ChainProbe<Key>`\n * shape; the Sui plugin emits this via a StrategyContributorDecl\n * keyed by `chain-probe:<chainId>`. */\nexport const makeSuiChainProbe = (sdk: SuiSdkShim, chain: string): ChainProbe<SuiProbeKey> => ({\n\tget: <Shape>(\n\t\tkey: SuiProbeKey,\n\t\tschema: ChainProbeSchema<Shape>,\n\t\tmode: ChainProbeMode,\n\t): Effect.Effect<Shape | null, ChainProbeError> =>\n\t\tEffect.gen(function* () {\n\t\t\tconst raw: unknown = yield* Effect.tryPromise({\n\t\t\t\ttry: () =>\n\t\t\t\t\tkey.kind === 'object'\n\t\t\t\t\t\t? sdk.core.getObject({ objectId: key.objectId })\n\t\t\t\t\t\t: sdk.core.getTransaction({ digest: key.digest }),\n\t\t\t\tcatch: (cause): ChainProbeError => ({\n\t\t\t\t\t_tag: 'ChainProbeError',\n\t\t\t\t\treason: isNotFound(cause) ? 'not-found' : 'transient',\n\t\t\t\t\tchain,\n\t\t\t\t\tdetail: formatUnknownError(cause),\n\t\t\t\t}),\n\t\t\t}).pipe(\n\t\t\t\t// Lenient mode coerces both not-found and transient into a\n\t\t\t\t// null result. Strict mode lets the error propagate.\n\t\t\t\tEffect.catch(\n\t\t\t\t\t(err): Effect.Effect<unknown, ChainProbeError> =>\n\t\t\t\t\t\tmode === 'lenient' && (err.reason === 'not-found' || err.reason === 'transient')\n\t\t\t\t\t\t\t? Effect.succeed(null)\n\t\t\t\t\t\t\t: Effect.fail(err),\n\t\t\t\t),\n\t\t\t);\n\t\t\tif (raw === null) return null;\n\t\t\tconst payload = projectProbePayload(key, raw);\n\t\t\tif (payload === null) return null;\n\n\t\t\t// Decode against the caller-supplied Schema. A decode failure\n\t\t\t// is structured (NOT silent undefined) — this is the\n\t\t\t// load-bearing learning from deepbook.\n\t\t\tconst decoded = yield* decodeUnknown(schema, payload, {\n\t\t\t\tsource: `chain probe ${chain}`,\n\t\t\t\tmkError: (issue): ChainProbeError => ({\n\t\t\t\t\t_tag: 'ChainProbeError',\n\t\t\t\t\treason: 'decode-failed',\n\t\t\t\t\tchain,\n\t\t\t\t\tdetail: formatUnknownError(issue.cause ?? issue),\n\t\t\t\t}),\n\t\t\t});\n\t\t\treturn decoded;\n\t\t}),\n});\n\nconst projectProbePayload = (key: SuiProbeKey, raw: unknown): unknown | null => {\n\tif (key.kind === 'transaction') return projectTransactionPayload(raw);\n\tif (typeof raw !== 'object' || raw === null || !('object' in raw)) return raw;\n\n\treturn (raw as { readonly object?: unknown }).object ?? null;\n};\n\nconst projectTransactionPayload = (raw: unknown): unknown | null => {\n\tif (typeof raw !== 'object' || raw === null) return raw;\n\tconst envelope = raw as {\n\t\treadonly $kind?: 'Transaction' | 'FailedTransaction';\n\t\treadonly Transaction?: unknown;\n\t\treadonly FailedTransaction?: unknown;\n\t};\n\tif (envelope.$kind === 'Transaction') return envelope.Transaction ?? null;\n\tif (envelope.$kind === 'FailedTransaction') return envelope.FailedTransaction ?? null;\n\treturn raw;\n};\n\n/** Heuristic: SDK errors carrying object/transaction-shape \"not found\"\n * markers are treated as terminal not-found; everything else is\n * transient. The substrate's lenient-retry profile re-runs the probe\n * on a transient bucket; not-found is terminal.\n *\n * Limitation: `@mysten/sui` does NOT surface a structured status code\n * on its SDK errors — the substrate only sees an `Error` message. We\n * therefore narrow the substring matches as much as possible to avoid\n * misclassifying network-layer \"endpoint does not exist\" or generic\n * \"not found\" prose as terminal:\n *\n * - We require the matched phrase to refer to the OBJECT or\n * TRANSACTION rather than the endpoint. Concretely we look for the\n * SDK's canonical \"object not found\" / \"object does not exist\" /\n * \"no such object\" wording and the equivalent \"transaction not\n * found\" / \"transaction does not exist\" wording.\n * - We DO NOT match the bare substring \"not found\" alone (that\n * catches \"endpoint does not exist\", DNS prose, etc. — all of\n * which are network-layer transients).\n *\n * If `@mysten/sui` surfaces a structured error class with an\n * `httpStatus` (or equivalent) in the future, swap this for an\n * exact 404 / -32000 check. */\nconst isNotFound = (cause: unknown): boolean => {\n\tconst msg = (cause as { message?: string })?.message?.toLowerCase() ?? '';\n\treturn (\n\t\t// SDK-side `getObject` / `getTransaction` not-found markers.\n\t\t/\\bobject\\b.*\\bnot found\\b/u.test(msg) ||\n\t\t/\\bobject\\b.*\\bdoes not exist\\b/u.test(msg) ||\n\t\t/\\bno such object\\b/u.test(msg) ||\n\t\t// SDK-side `getTransaction` not-found markers — terminal for\n\t\t// this probe (the queried digest will never materialise).\n\t\t/\\btransaction\\b.*\\bnot found\\b/u.test(msg) ||\n\t\t/\\btransaction\\b.*\\bdoes not exist\\b/u.test(msg)\n\t);\n};\n"],"mappings":";;;;;;;;AAqHA,MAAa,qBAAqB,KAAiB,WAA4C,EAC9F,MACC,KACA,QACA,SAEA,OAAO,IAAI,aAAa;CACvB,MAAM,MAAe,OAAO,OAAO,WAAW;EAC7C,WACC,IAAI,SAAS,WACV,IAAI,KAAK,UAAU,EAAE,UAAU,IAAI,UAAU,CAAC,GAC9C,IAAI,KAAK,eAAe,EAAE,QAAQ,IAAI,QAAQ,CAAC;EACnD,QAAQ,WAA4B;GACnC,MAAM;GACN,QAAQ,WAAW,MAAM,GAAG,cAAc;GAC1C;GACA,QAAQ,mBAAmB,MAAM;GACjC;EACD,CAAC,CAAC,KAGF,OAAO,OACL,QACA,SAAS,cAAc,IAAI,WAAW,eAAe,IAAI,WAAW,eACjE,OAAO,QAAQ,KAAK,GACpB,OAAO,KAAK,IAAI,CACpB,CACD;AACD,KAAI,QAAQ,KAAM,QAAO;CACzB,MAAM,UAAU,oBAAoB,KAAK,IAAI;AAC7C,KAAI,YAAY,KAAM,QAAO;AAc7B,QAAO,OATgB,cAAc,QAAQ,SAAS;EACrD,QAAQ,eAAe;EACvB,UAAU,WAA4B;GACrC,MAAM;GACN,QAAQ;GACR;GACA,QAAQ,mBAAmB,MAAM,SAAS,MAAM;GAChD;EACD,CAAC;EAED,EACH;AAED,MAAM,uBAAuB,KAAkB,QAAiC;AAC/E,KAAI,IAAI,SAAS,cAAe,QAAO,0BAA0B,IAAI;AACrE,KAAI,OAAO,QAAQ,YAAY,QAAQ,QAAQ,EAAE,YAAY,KAAM,QAAO;AAE1E,QAAQ,IAAsC,UAAU;;AAGzD,MAAM,6BAA6B,QAAiC;AACnE,KAAI,OAAO,QAAQ,YAAY,QAAQ,KAAM,QAAO;CACpD,MAAM,WAAW;AAKjB,KAAI,SAAS,UAAU,cAAe,QAAO,SAAS,eAAe;AACrE,KAAI,SAAS,UAAU,oBAAqB,QAAO,SAAS,qBAAqB;AACjF,QAAO;;;;;;;;;;;;;;;;;;;;;;;;;AA0BR,MAAM,cAAc,UAA4B;CAC/C,MAAM,MAAO,OAAgC,SAAS,aAAa,IAAI;AACvE,QAEC,6BAA6B,KAAK,IAAI,IACtC,kCAAkC,KAAK,IAAI,IAC3C,sBAAsB,KAAK,IAAI,IAG/B,kCAAkC,KAAK,IAAI,IAC3C,uCAAuC,KAAK,IAAI"}
|
|
1
|
+
{"version":3,"file":"chain-probe.mjs","names":[],"sources":["../../../src/plugins/sui/chain-probe.ts"],"sourcesContent":["// Sui plugin — ChainProbe capability implementation.\n//\n// Architecture §9: ChainProbe is a contract, NOT a primitive. Sui\n// provides the only in-tree implementation; the substrate dispatches\n// to it via the StrategyContributor registry under\n// `chain-probe:<chainId>`.\n//\n// Lenient mode: returns null for both \"not found\" AND transient RPC\n// failure — verify pipelines re-derive on the next cycle rather than\n// fail boot. Strict mode: distinguishes via tagged error.\n//\n// Why lenient is the default in this plugin's wiring: artifact publisher verify is\n// the dominant consumer; artifact publisher's lenient-retry profile (15 attempts,\n// 90s budget) is calibrated against lenient semantics. A strict\n// surface exists for explicit \"I want to know if the chain is\n// reachable\" callers (the doctor command, debugging).\n\nimport { Effect } from 'effect';\nimport type { ClientWithCoreApi } from '@mysten/sui/client';\n\nimport type {\n\tChainProbe,\n\tChainProbeError,\n\tChainProbeMode,\n\tChainProbeSchema,\n} from '../../contracts/chain-probe.ts';\nimport { decodeUnknown } from '../../substrate/runtime/runtime-decode.ts';\nimport { formatUnknownError } from '../../substrate/runtime/format-unknown-error.ts';\n\n/**\n * Sui's chain-key shape — discriminated so the probe can dispatch\n * between object reads, tx reads, and the (forthcoming) batch\n * variant on one method.\n */\nexport type SuiProbeKey =\n\t| { readonly kind: 'object'; readonly objectId: string }\n\t| { readonly kind: 'transaction'; readonly digest: string };\n\n// Note: this probe decodes against the CALLER-supplied `schema`\n// argument (see `makeSuiChainProbe`), never a local literal. Earlier\n// revisions also exported `SuiObjectShapeSchema` /\n// `SuiGetObjectResponseSchema` to \"document the SDK shape\", but they\n// had zero consumers (the contract's `ChainProbeSchema<Shape>` is what\n// validates), so per STYLE_GUIDE §5 (no orphan exports) they were\n// removed. Re-add a concrete object schema only if a caller actually\n// decodes through it.\n\n/** Plugin-internal SDK shim — the type the plugin's acquire body\n * hands to the probe factory + the account's sign/execute closure.\n * Kept narrow so we don't pull `@mysten/sui` types into the substrate.\n *\n * Exposes the four surfaces consumers actually use:\n *\n * - `getObject` / `getTransaction` — the lenient chain probe.\n * - `executeTransaction` — the account plugin's submit path\n * (txBytes + caller-signed signatures).\n * - `waitForTransaction` — post-submit finality wait.\n *\n * Plus an OPAQUE `client` field — the underlying `SuiGrpcClient`\n * reference. The package plugin's publish-tx builder hands this to\n * `Transaction.build({ client })` (the SDK resolves gas + object\n * versions through it). We type as `unknown` so the substrate stays\n * free of a direct `@mysten/sui/client` type import; the consumer\n * casts at the boundary (mirrors the same opacity decision in the\n * Coin plugin's `MintSdkShim.client`). */\nexport interface SuiSdkShim {\n\treadonly core: {\n\t\treadonly getObject: (args: {\n\t\t\treadonly objectId: string;\n\t\t\treadonly include?: {\n\t\t\t\treadonly content?: boolean;\n\t\t\t\treadonly json?: boolean;\n\t\t\t};\n\t\t}) => Promise<unknown>;\n\t\treadonly getTransaction: (args: { readonly digest: string }) => Promise<unknown>;\n\t\treadonly getBalance: (args: {\n\t\t\treadonly owner: string;\n\t\t\treadonly coinType?: string;\n\t\t}) => Promise<unknown>;\n\t\treadonly listCoins: (args: {\n\t\t\treadonly owner: string;\n\t\t\treadonly coinType?: string;\n\t\t\treadonly limit?: number;\n\t\t\treadonly cursor?: string | null;\n\t\t}) => Promise<{\n\t\t\treadonly objects: ReadonlyArray<{\n\t\t\t\treadonly objectId: string;\n\t\t\t\treadonly version: string;\n\t\t\t\treadonly digest: string;\n\t\t\t\treadonly balance: string;\n\t\t\t}>;\n\t\t\treadonly hasNextPage: boolean;\n\t\t\treadonly cursor: string | null;\n\t\t}>;\n\t\treadonly executeTransaction: (args: {\n\t\t\treadonly transaction: Uint8Array;\n\t\t\treadonly signatures: ReadonlyArray<string>;\n\t\t\treadonly include?: {\n\t\t\t\treadonly effects?: boolean;\n\t\t\t\treadonly objectTypes?: boolean;\n\t\t\t};\n\t\t}) => Promise<unknown>;\n\t\treadonly waitForTransaction: (args: {\n\t\t\treadonly digest: string;\n\t\t\treadonly timeout?: number;\n\t\t}) => Promise<unknown>;\n\t};\n\t/** Client reference for `Transaction.build({ client })` and every\n\t * `client.core.*` call. The Sui barrel wires the resolved\n\t * `SuiGrpcClient` through; consumers cast no further. */\n\treadonly client: ClientWithCoreApi;\n}\n\n/** Construct the chain-probe instance for a resolved Sui client +\n * chain id. The result implements the contract's `ChainProbe<Key>`\n * shape; the Sui plugin emits this via a StrategyContributorDecl\n * keyed by `chain-probe:<chainId>`. */\nexport const makeSuiChainProbe = (sdk: SuiSdkShim, chainId: string): ChainProbe<SuiProbeKey> => ({\n\tget: <Shape>(\n\t\tkey: SuiProbeKey,\n\t\tschema: ChainProbeSchema<Shape>,\n\t\tmode: ChainProbeMode,\n\t): Effect.Effect<Shape | null, ChainProbeError> =>\n\t\tEffect.gen(function* () {\n\t\t\tconst raw: unknown = yield* Effect.tryPromise({\n\t\t\t\ttry: () =>\n\t\t\t\t\tkey.kind === 'object'\n\t\t\t\t\t\t? sdk.core.getObject({ objectId: key.objectId })\n\t\t\t\t\t\t: sdk.core.getTransaction({ digest: key.digest }),\n\t\t\t\tcatch: (cause): ChainProbeError => ({\n\t\t\t\t\t_tag: 'ChainProbeError',\n\t\t\t\t\treason: isNotFound(cause) ? 'not-found' : 'transient',\n\t\t\t\t\tchainId,\n\t\t\t\t\tdetail: formatUnknownError(cause),\n\t\t\t\t}),\n\t\t\t}).pipe(\n\t\t\t\t// Lenient mode coerces both not-found and transient into a\n\t\t\t\t// null result. Strict mode lets the error propagate.\n\t\t\t\tEffect.catch(\n\t\t\t\t\t(err): Effect.Effect<unknown, ChainProbeError> =>\n\t\t\t\t\t\tmode === 'lenient' && (err.reason === 'not-found' || err.reason === 'transient')\n\t\t\t\t\t\t\t? Effect.succeed(null)\n\t\t\t\t\t\t\t: Effect.fail(err),\n\t\t\t\t),\n\t\t\t);\n\t\t\tif (raw === null) return null;\n\t\t\tconst payload = projectProbePayload(key, raw);\n\t\t\tif (payload === null) return null;\n\n\t\t\t// Decode against the caller-supplied Schema. A decode failure\n\t\t\t// is structured (NOT silent undefined) — this is the\n\t\t\t// load-bearing learning from deepbook.\n\t\t\tconst decoded = yield* decodeUnknown(schema, payload, {\n\t\t\t\tsource: `chain probe ${chainId}`,\n\t\t\t\tmkError: (issue): ChainProbeError => ({\n\t\t\t\t\t_tag: 'ChainProbeError',\n\t\t\t\t\treason: 'decode-failed',\n\t\t\t\t\tchainId,\n\t\t\t\t\tdetail: formatUnknownError(issue.cause ?? issue),\n\t\t\t\t}),\n\t\t\t});\n\t\t\treturn decoded;\n\t\t}),\n});\n\nconst projectProbePayload = (key: SuiProbeKey, raw: unknown): unknown | null => {\n\tif (key.kind === 'transaction') return projectTransactionPayload(raw);\n\tif (typeof raw !== 'object' || raw === null || !('object' in raw)) return raw;\n\n\treturn (raw as { readonly object?: unknown }).object ?? null;\n};\n\nconst projectTransactionPayload = (raw: unknown): unknown | null => {\n\tif (typeof raw !== 'object' || raw === null) return raw;\n\tconst envelope = raw as {\n\t\treadonly $kind?: 'Transaction' | 'FailedTransaction';\n\t\treadonly Transaction?: unknown;\n\t\treadonly FailedTransaction?: unknown;\n\t};\n\tif (envelope.$kind === 'Transaction') return envelope.Transaction ?? null;\n\tif (envelope.$kind === 'FailedTransaction') return envelope.FailedTransaction ?? null;\n\treturn raw;\n};\n\n/** Heuristic: SDK errors carrying object/transaction-shape \"not found\"\n * markers are treated as terminal not-found; everything else is\n * transient. The substrate's lenient-retry profile re-runs the probe\n * on a transient bucket; not-found is terminal.\n *\n * Limitation: `@mysten/sui` does NOT surface a structured status code\n * on its SDK errors — the substrate only sees an `Error` message. We\n * therefore narrow the substring matches as much as possible to avoid\n * misclassifying network-layer \"endpoint does not exist\" or generic\n * \"not found\" prose as terminal:\n *\n * - We require the matched phrase to refer to the OBJECT or\n * TRANSACTION rather than the endpoint. Concretely we look for the\n * SDK's canonical \"object not found\" / \"object does not exist\" /\n * \"no such object\" wording and the equivalent \"transaction not\n * found\" / \"transaction does not exist\" wording.\n * - We DO NOT match the bare substring \"not found\" alone (that\n * catches \"endpoint does not exist\", DNS prose, etc. — all of\n * which are network-layer transients).\n *\n * If `@mysten/sui` surfaces a structured error class with an\n * `httpStatus` (or equivalent) in the future, swap this for an\n * exact 404 / -32000 check. */\nconst isNotFound = (cause: unknown): boolean => {\n\tconst msg = (cause as { message?: string })?.message?.toLowerCase() ?? '';\n\treturn (\n\t\t// SDK-side `getObject` / `getTransaction` not-found markers.\n\t\t/\\bobject\\b.*\\bnot found\\b/u.test(msg) ||\n\t\t/\\bobject\\b.*\\bdoes not exist\\b/u.test(msg) ||\n\t\t/\\bno such object\\b/u.test(msg) ||\n\t\t// SDK-side `getTransaction` not-found markers — terminal for\n\t\t// this probe (the queried digest will never materialise).\n\t\t/\\btransaction\\b.*\\bnot found\\b/u.test(msg) ||\n\t\t/\\btransaction\\b.*\\bdoes not exist\\b/u.test(msg)\n\t);\n};\n"],"mappings":";;;;;;;;AAqHA,MAAa,qBAAqB,KAAiB,aAA8C,EAChG,MACC,KACA,QACA,SAEA,OAAO,IAAI,aAAa;CACvB,MAAM,MAAe,OAAO,OAAO,WAAW;EAC7C,WACC,IAAI,SAAS,WACV,IAAI,KAAK,UAAU,EAAE,UAAU,IAAI,SAAS,CAAC,IAC7C,IAAI,KAAK,eAAe,EAAE,QAAQ,IAAI,OAAO,CAAC;EAClD,QAAQ,WAA4B;GACnC,MAAM;GACN,QAAQ,WAAW,KAAK,IAAI,cAAc;GAC1C;GACA,QAAQ,mBAAmB,KAAK;EACjC;CACD,CAAC,CAAC,CAAC,KAGF,OAAO,OACL,QACA,SAAS,cAAc,IAAI,WAAW,eAAe,IAAI,WAAW,eACjE,OAAO,QAAQ,IAAI,IACnB,OAAO,KAAK,GAAG,CACpB,CACD;CACA,IAAI,QAAQ,MAAM,OAAO;CACzB,MAAM,UAAU,oBAAoB,KAAK,GAAG;CAC5C,IAAI,YAAY,MAAM,OAAO;CAc7B,OAAO,OATgB,cAAc,QAAQ,SAAS;EACrD,QAAQ,eAAe;EACvB,UAAU,WAA4B;GACrC,MAAM;GACN,QAAQ;GACR;GACA,QAAQ,mBAAmB,MAAM,SAAS,KAAK;EAChD;CACD,CAAC;AAEF,CAAC,EACH;AAEA,MAAM,uBAAuB,KAAkB,QAAiC;CAC/E,IAAI,IAAI,SAAS,eAAe,OAAO,0BAA0B,GAAG;CACpE,IAAI,OAAO,QAAQ,YAAY,QAAQ,QAAQ,EAAE,YAAY,MAAM,OAAO;CAE1E,OAAQ,IAAsC,UAAU;AACzD;AAEA,MAAM,6BAA6B,QAAiC;CACnE,IAAI,OAAO,QAAQ,YAAY,QAAQ,MAAM,OAAO;CACpD,MAAM,WAAW;CAKjB,IAAI,SAAS,UAAU,eAAe,OAAO,SAAS,eAAe;CACrE,IAAI,SAAS,UAAU,qBAAqB,OAAO,SAAS,qBAAqB;CACjF,OAAO;AACR;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAM,cAAc,UAA4B;CAC/C,MAAM,MAAO,OAAgC,SAAS,YAAY,KAAK;CACvE,OAEC,6BAA6B,KAAK,GAAG,KACrC,kCAAkC,KAAK,GAAG,KAC1C,sBAAsB,KAAK,GAAG,KAG9B,kCAAkC,KAAK,GAAG,KAC1C,uCAAuC,KAAK,GAAG;AAEjD"}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
//#region src/plugins/sui/codegen.d.ts
|
|
2
|
-
/** The typed shape
|
|
3
|
-
interface
|
|
4
|
-
|
|
2
|
+
/** The typed shape one `networks.<key>` entry in `config.ts` exports. */
|
|
3
|
+
interface SuiNetworkConfigEntry {
|
|
4
|
+
/** Genesis-digest chain identifier of the running node (not the network
|
|
5
|
+
* name, which is the `networks.<key>` key itself). */
|
|
6
|
+
readonly chainId: string;
|
|
5
7
|
readonly mode: 'local' | 'local-rpc' | 'live' | 'fork';
|
|
6
|
-
readonly
|
|
7
|
-
readonly
|
|
8
|
-
readonly
|
|
8
|
+
readonly rpc: string;
|
|
9
|
+
readonly faucet: string | null;
|
|
10
|
+
readonly graphql: string | null;
|
|
9
11
|
/** Fork-only — upstream identity for known-package lookups. */
|
|
10
12
|
readonly forkUpstream: string | null;
|
|
11
13
|
}
|
|
12
14
|
//#endregion
|
|
13
|
-
export {
|
|
15
|
+
export { SuiNetworkConfigEntry };
|
|
14
16
|
//# sourceMappingURL=codegen.d.mts.map
|
|
@@ -1,52 +1,55 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LOCAL_NETWORK_NAME } from "../../api/inference-network.mjs";
|
|
2
|
+
import { configCodegenable } from "../../contracts/config-bindings.mjs";
|
|
2
3
|
//#region src/plugins/sui/codegen.ts
|
|
3
|
-
/**
|
|
4
|
-
* the
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const stringField = (record, key) => {
|
|
21
|
-
const value = record[key];
|
|
22
|
-
return typeof value === "string" && value.length > 0 ? value : null;
|
|
23
|
-
};
|
|
24
|
-
/** Construct the Codegenable contribution. Emit is byte-deterministic
|
|
25
|
-
* on unchanged input (architecture: no mtime churn on no-op
|
|
26
|
-
* cycles). */
|
|
27
|
-
const makeCodegenable = (resolved) => ({
|
|
28
|
-
kind: "codegenable",
|
|
29
|
-
emitterName: "sui-network",
|
|
30
|
-
outputPath: "sui/network.ts",
|
|
31
|
-
aggregate: {
|
|
4
|
+
/** The sui-plugin's config bindings, declared ONCE. Both the live boot decl
|
|
5
|
+
* and the static committed-tree decl are derived from this set:
|
|
6
|
+
* - `network` — sugar `resolveNetwork()` / live = `"localnet"`.
|
|
7
|
+
* - `networks` — sugar `resolveNetworks()` / live = `{ localnet: entry }`.
|
|
8
|
+
* The network NAME + connection map are environment/live data, so both are
|
|
9
|
+
* RESOLVED bindings (never literals). */
|
|
10
|
+
const suiConfigBindings = () => {
|
|
11
|
+
const entryOf = (r) => ({
|
|
12
|
+
chainId: r.chainId,
|
|
13
|
+
mode: r.mode,
|
|
14
|
+
rpc: r.rpc,
|
|
15
|
+
faucet: r.faucet ?? null,
|
|
16
|
+
graphql: r.graphql ?? null,
|
|
17
|
+
forkUpstream: r.forkUpstream ?? null
|
|
18
|
+
});
|
|
19
|
+
return {
|
|
20
|
+
bucket: "config.ts",
|
|
32
21
|
kind: "sui-network",
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
22
|
+
emitterName: "sui-network",
|
|
23
|
+
bindings: [{
|
|
24
|
+
variant: "resolved",
|
|
25
|
+
configPath: ["network"],
|
|
26
|
+
namespace: "sui",
|
|
27
|
+
key: "network",
|
|
28
|
+
sugar: { kind: "network" },
|
|
29
|
+
live: () => LOCAL_NETWORK_NAME
|
|
30
|
+
}, {
|
|
31
|
+
variant: "resolved",
|
|
32
|
+
configPath: ["networks"],
|
|
33
|
+
namespace: "sui",
|
|
34
|
+
key: "networks",
|
|
35
|
+
sugar: { kind: "networks" },
|
|
36
|
+
live: (r) => ({ [LOCAL_NETWORK_NAME]: entryOf(r) })
|
|
37
|
+
}]
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
/** The LIVE Codegenable contribution. Bakes the resolved network entry into
|
|
41
|
+
* the combined `config.ts` aggregate (chainId/rpc/faucet/graphql) — boot's
|
|
42
|
+
* `assembleIdConfig` slices it back into the loadable id-config. */
|
|
43
|
+
const makeCodegenable = (resolved) => configCodegenable(suiConfigBindings(), {
|
|
44
|
+
mode: "live",
|
|
45
|
+
state: resolved
|
|
48
46
|
});
|
|
47
|
+
/** The STATIC (stack-free) Codegenable contribution for the `codegen` verb.
|
|
48
|
+
* Emits `resolveNetwork()` / `resolveNetworks()` raw expressions — the
|
|
49
|
+
* committed `config.ts` carries no network name and no literal rpc URL. No
|
|
50
|
+
* id-resolver input needed (the values are injected, not config-derived). */
|
|
51
|
+
const makeStaticCodegen = () => () => [configCodegenable(suiConfigBindings(), "static")];
|
|
49
52
|
//#endregion
|
|
50
|
-
export { makeCodegenable };
|
|
53
|
+
export { makeCodegenable, makeStaticCodegen };
|
|
51
54
|
|
|
52
55
|
//# sourceMappingURL=codegen.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codegen.mjs","names":[],"sources":["../../../src/plugins/sui/codegen.ts"],"sourcesContent":["// Sui plugin — Codegenable contribution.\n//\n// Architecture §6: plugins emit typed `CodegenableDecl`s; the\n//
|
|
1
|
+
{"version":3,"file":"codegen.mjs","names":[],"sources":["../../../src/plugins/sui/codegen.ts"],"sourcesContent":["// Sui plugin — Codegenable contribution, via the UNIFIED config-binding\n// declaration.\n//\n// Architecture §6: plugins emit typed `CodegenableDecl`s; the codegen\n// orchestrator stages files into the user's source tree WITHOUT naming the\n// plugin. Sui's contribution is the active network: the active key\n// (`network: \"localnet\"`) plus the `networks.localnet` entry (chainId, mode,\n// rpc, faucet, graphql, forkUpstream).\n//\n// ONE declaration, TWO derivations. Sui declares its `config.ts`\n// contributions ONCE as a `ConfigBindingSet`; the framework derives:\n// - the LIVE (boot) decl — bakes the resolved network entry into the\n// loadable id-config (so `assembleIdConfig` reads it back), AND\n// - the STATIC (committed-tree) decl — emits `resolveNetwork()` /\n// `resolveNetworks()` raw expressions so the committed `config.ts`\n// carries NO network name and NO literal rpc URL (both are\n// environment/live data: a dynamic local rpc port; a real deployment\n// names a different network — resolved at app build/dev time via the\n// injected `__DEVSTACK_IDS__` global).\n//\n// The decl is `aggregateOnly` — it projects directly into the combined\n// `generated/config.ts` (`config.network` + `config.networks.localnet`) and\n// emits NO standalone `sui/network.ts`.\n\nimport { LOCAL_NETWORK_NAME } from '../../api/inference-network.ts';\nimport type { CodegenableDecl } from '../../contracts/codegenable.ts';\nimport { configCodegenable, type ConfigBindingSet } from '../../contracts/config-bindings.ts';\nimport type { JsonValue } from '../../orchestrators/codegen/id-config.ts';\nimport type { ResolvedSuiNetwork } from './network-resolver.ts';\n\n/** The typed shape one `networks.<key>` entry in `config.ts` exports. */\nexport interface SuiNetworkConfigEntry {\n\t/** Genesis-digest chain identifier of the running node (not the network\n\t * name, which is the `networks.<key>` key itself). */\n\treadonly chainId: string;\n\treadonly mode: 'local' | 'local-rpc' | 'live' | 'fork';\n\treadonly rpc: string;\n\treadonly faucet: string | null;\n\treadonly graphql: string | null;\n\t/** Fork-only — upstream identity for known-package lookups. */\n\treadonly forkUpstream: string | null;\n}\n\n/** The sui-plugin's config bindings, declared ONCE. Both the live boot decl\n * and the static committed-tree decl are derived from this set:\n * - `network` — sugar `resolveNetwork()` / live = `\"localnet\"`.\n * - `networks` — sugar `resolveNetworks()` / live = `{ localnet: entry }`.\n * The network NAME + connection map are environment/live data, so both are\n * RESOLVED bindings (never literals). */\nconst suiConfigBindings = (): ConfigBindingSet<ResolvedSuiNetwork> => {\n\tconst entryOf = (r: ResolvedSuiNetwork): JsonValue =>\n\t\t({\n\t\t\tchainId: r.chainId,\n\t\t\tmode: r.mode,\n\t\t\trpc: r.rpc,\n\t\t\tfaucet: r.faucet ?? null,\n\t\t\tgraphql: r.graphql ?? null,\n\t\t\tforkUpstream: r.forkUpstream ?? null,\n\t\t}) satisfies SuiNetworkConfigEntry;\n\n\treturn {\n\t\tbucket: 'config.ts',\n\t\tkind: 'sui-network',\n\t\temitterName: 'sui-network',\n\t\tbindings: [\n\t\t\t{\n\t\t\t\tvariant: 'resolved',\n\t\t\t\tconfigPath: ['network'],\n\t\t\t\tnamespace: 'sui',\n\t\t\t\tkey: 'network',\n\t\t\t\tsugar: { kind: 'network' },\n\t\t\t\tlive: () => LOCAL_NETWORK_NAME,\n\t\t\t},\n\t\t\t{\n\t\t\t\tvariant: 'resolved',\n\t\t\t\tconfigPath: ['networks'],\n\t\t\t\tnamespace: 'sui',\n\t\t\t\tkey: 'networks',\n\t\t\t\tsugar: { kind: 'networks' },\n\t\t\t\tlive: (r) => ({ [LOCAL_NETWORK_NAME]: entryOf(r) }),\n\t\t\t},\n\t\t],\n\t} satisfies ConfigBindingSet<ResolvedSuiNetwork>;\n};\n\n/** The LIVE Codegenable contribution. Bakes the resolved network entry into\n * the combined `config.ts` aggregate (chainId/rpc/faucet/graphql) — boot's\n * `assembleIdConfig` slices it back into the loadable id-config. */\nexport const makeCodegenable = (resolved: ResolvedSuiNetwork): CodegenableDecl =>\n\tconfigCodegenable(suiConfigBindings(), { mode: 'live', state: resolved });\n\n/** The STATIC (stack-free) Codegenable contribution for the `codegen` verb.\n * Emits `resolveNetwork()` / `resolveNetworks()` raw expressions — the\n * committed `config.ts` carries no network name and no literal rpc URL. No\n * id-resolver input needed (the values are injected, not config-derived). */\nexport const makeStaticCodegen = (): (() => ReadonlyArray<CodegenableDecl>) => () => [\n\tconfigCodegenable(suiConfigBindings(), 'static'),\n];\n"],"mappings":";;;;;;;;;AAiDA,MAAM,0BAAgE;CACrE,MAAM,WAAW,OACf;EACA,SAAS,EAAE;EACX,MAAM,EAAE;EACR,KAAK,EAAE;EACP,QAAQ,EAAE,UAAU;EACpB,SAAS,EAAE,WAAW;EACtB,cAAc,EAAE,gBAAgB;CACjC;CAED,OAAO;EACN,QAAQ;EACR,MAAM;EACN,aAAa;EACb,UAAU,CACT;GACC,SAAS;GACT,YAAY,CAAC,SAAS;GACtB,WAAW;GACX,KAAK;GACL,OAAO,EAAE,MAAM,UAAU;GACzB,YAAY;EACb,GACA;GACC,SAAS;GACT,YAAY,CAAC,UAAU;GACvB,WAAW;GACX,KAAK;GACL,OAAO,EAAE,MAAM,WAAW;GAC1B,OAAO,OAAO,GAAG,qBAAqB,QAAQ,CAAC,EAAE;EAClD,CACD;CACD;AACD;;;;AAKA,MAAa,mBAAmB,aAC/B,kBAAkB,kBAAkB,GAAG;CAAE,MAAM;CAAQ,OAAO;AAAS,CAAC;;;;;AAMzE,MAAa,gCAAwE,CACpF,kBAAkB,kBAAkB,GAAG,QAAQ,CAChD"}
|
|
@@ -4,7 +4,7 @@ import { ConfigIssue } from "../../substrate/runtime/config-validation.mjs";
|
|
|
4
4
|
/** Phases for `SuiError`. Closed sum — keeps the cause-walker's
|
|
5
5
|
* display table small. Add a phase only after editing the
|
|
6
6
|
* catalog in the plugin doc. */
|
|
7
|
-
type SuiPhase = 'image-build' | 'port-allocate' | 'container-start' | '
|
|
7
|
+
type SuiPhase = 'image-build' | 'port-allocate' | 'container-start' | 'grpc-probe' | 'faucet-probe' | 'graphql-probe' | 'fork-status-probe' | 'chain-id-fetch' | 'wait-funds-ready' | 'fork-impersonate' | 'fork-advance-clock' | 'fork-advance-checkpoint' | 'fork-lock' | 'fork-data-dir' | 'move-build' | 'move-publish';
|
|
8
8
|
/** Generic Sui plugin error. Raised by the plugin's acquire body
|
|
9
9
|
* and its admin surface (`advanceClock`, `impersonate`, …). */
|
|
10
10
|
interface SuiPluginError {
|
|
@@ -12,15 +12,7 @@ const forkUnsupportedError = (surface, hint) => ({
|
|
|
12
12
|
surface,
|
|
13
13
|
hint
|
|
14
14
|
});
|
|
15
|
-
/** Error tags this plugin contributes — surfaced to the cause
|
|
16
|
-
* walker via `PluginErrorContribution`. */
|
|
17
|
-
const SUI_ERROR_TAGS = [
|
|
18
|
-
"SuiPluginError",
|
|
19
|
-
"SuiCliError",
|
|
20
|
-
"SuiConfigError",
|
|
21
|
-
"ForkUnsupportedError"
|
|
22
|
-
];
|
|
23
15
|
//#endregion
|
|
24
|
-
export {
|
|
16
|
+
export { forkUnsupportedError, suiConfigError, suiPluginError };
|
|
25
17
|
|
|
26
18
|
//# sourceMappingURL=errors.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.mjs","names":[],"sources":["../../../src/plugins/sui/errors.ts"],"sourcesContent":["// Sui plugin — typed errors.\n//\n// Distilled-doc finding: today's codebase centralises EVERY tagged\n// error in one engine file, but consumer boundaries cross service\n// lines. The architecture lets us redistribute: errors raised AND\n// consumed inside the Sui plugin live here. Cross-service errors\n// (`ForkIncompatibleError`) live with the plugin that consumes them\n// — Walrus/Seal/Deepbook own `ForkIncompatibleError`.\n//\n// Effect v4: errors are plain interfaces with a `_tag` discriminator\n// — we don't subclass an Effect base class; `Effect.catchTag` /\n// `catchTags` match on `_tag` literal. See architecture § Effect.\n\nimport { defineConfigError, type ConfigIssue } from '../../substrate/runtime/config-validation.ts';\n\n/** Phases for `SuiError`. Closed sum — keeps the cause-walker's\n * display table small. Add a phase only after editing the\n * catalog in the plugin doc. */\nexport type SuiPhase =\n\t| 'image-build'\n\t| 'port-allocate'\n\t| 'container-start'\n\t| '
|
|
1
|
+
{"version":3,"file":"errors.mjs","names":[],"sources":["../../../src/plugins/sui/errors.ts"],"sourcesContent":["// Sui plugin — typed errors.\n//\n// Distilled-doc finding: today's codebase centralises EVERY tagged\n// error in one engine file, but consumer boundaries cross service\n// lines. The architecture lets us redistribute: errors raised AND\n// consumed inside the Sui plugin live here. Cross-service errors\n// (`ForkIncompatibleError`) live with the plugin that consumes them\n// — Walrus/Seal/Deepbook own `ForkIncompatibleError`.\n//\n// Effect v4: errors are plain interfaces with a `_tag` discriminator\n// — we don't subclass an Effect base class; `Effect.catchTag` /\n// `catchTags` match on `_tag` literal. See architecture § Effect.\n\nimport { defineConfigError, type ConfigIssue } from '../../substrate/runtime/config-validation.ts';\n\n/** Phases for `SuiError`. Closed sum — keeps the cause-walker's\n * display table small. Add a phase only after editing the\n * catalog in the plugin doc. */\nexport type SuiPhase =\n\t| 'image-build'\n\t| 'port-allocate'\n\t| 'container-start'\n\t| 'grpc-probe'\n\t| 'faucet-probe'\n\t| 'graphql-probe'\n\t| 'fork-status-probe'\n\t| 'chain-id-fetch'\n\t| 'wait-funds-ready'\n\t| 'fork-impersonate'\n\t| 'fork-advance-clock'\n\t| 'fork-advance-checkpoint'\n\t| 'fork-lock'\n\t| 'fork-data-dir'\n\t| 'move-build'\n\t| 'move-publish';\n\n/** Generic Sui plugin error. Raised by the plugin's acquire body\n * and its admin surface (`advanceClock`, `impersonate`, …). */\nexport interface SuiPluginError {\n\treadonly _tag: 'SuiPluginError';\n\treadonly phase: SuiPhase;\n\treadonly message: string;\n\treadonly cause?: unknown;\n}\n\nexport const suiPluginError = (\n\tphase: SuiPhase,\n\tmessage: string,\n\tcause?: unknown,\n): SuiPluginError => ({ _tag: 'SuiPluginError', phase, message, cause });\n\nexport interface SuiConfigError extends ConfigIssue {\n\treadonly _tag: 'SuiConfigError';\n}\n\nexport const suiConfigError = defineConfigError('SuiConfigError');\n\n/** Move-build / sui-cli error. Carries the sub-process capture\n * envelope (exit + stderr + stdout). The plugin doc lists 11\n * shell-shaped phases today; we tighten to a much smaller set\n * and use `op` as a free-form column.\n *\n * Stub: the closed-vs-open phase decision is deferred to the\n * cli-driver implementation pass. */\nexport interface SuiCliError {\n\treadonly _tag: 'SuiCliError';\n\treadonly op: 'build' | 'publish' | 'summary' | 'scrub' | 'spawn';\n\treadonly exitCode?: number;\n\treadonly stderr?: string;\n\treadonly stdout?: string;\n\treadonly cause?: unknown;\n}\n\nexport const suiCliError = (\n\top: SuiCliError['op'],\n\tparts: Omit<SuiCliError, '_tag' | 'op'>,\n): SuiCliError => ({ _tag: 'SuiCliError', op, ...parts });\n\n/** Synchronous refusal raised by the fork SDK guard. The guard\n * intercepts at property-access time so the wire call never\n * happens — failing fast lets callers branch on this without\n * awaiting a transport-level reject. */\nexport interface ForkUnsupportedError {\n\treadonly _tag: 'ForkUnsupportedError';\n\treadonly surface: string;\n\treadonly hint: string;\n}\n\nexport const forkUnsupportedError = (surface: string, hint: string): ForkUnsupportedError => ({\n\t_tag: 'ForkUnsupportedError',\n\tsurface,\n\thint,\n});\n\n/** Union of every error a Sui-plugin caller may encounter. */\nexport type SuiError = SuiPluginError | SuiCliError | SuiConfigError | ForkUnsupportedError;\n\n/** The catchable error tags this plugin exposes. Pinned against the\n * user-facing error catalog by the error-catalog-parity test. */\nexport const SUI_ERROR_TAGS: ReadonlyArray<SuiError['_tag']> = [\n\t'SuiPluginError',\n\t'SuiCliError',\n\t'SuiConfigError',\n\t'ForkUnsupportedError',\n] as const;\n"],"mappings":";;AA6CA,MAAa,kBACZ,OACA,SACA,WACqB;CAAE,MAAM;CAAkB;CAAO;CAAS;AAAM;AAMtE,MAAa,iBAAiB,kBAAkB,gBAAgB;AAiChE,MAAa,wBAAwB,SAAiB,UAAwC;CAC7F,MAAM;CACN;CACA;AACD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect, Schema, Scope } from "effect";
|
|
2
2
|
import { ClientWithCoreApi } from "@mysten/sui/client";
|
|
3
3
|
|
|
4
|
-
//#region src/
|
|
4
|
+
//#region src/plugins/sui/exec/index.d.ts
|
|
5
5
|
interface TransactionSignerScope<SignError = unknown> {
|
|
6
6
|
readonly signTransaction: (tx: Uint8Array) => Effect.Effect<{
|
|
7
7
|
readonly bytes: string;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { formatUnknownError } from "
|
|
2
|
-
import "./sign-and-dispatch.mjs";
|
|
1
|
+
import { formatUnknownError } from "../../../substrate/runtime/format-unknown-error.mjs";
|
|
3
2
|
import { Effect, Schema } from "effect";
|
|
4
|
-
//#region src/
|
|
3
|
+
//#region src/plugins/sui/exec/index.ts
|
|
5
4
|
/** Tagged failure during one step of the Sui-tx roundtrip. `phase`
|
|
6
5
|
* discriminates which step failed so callers can map to their
|
|
7
6
|
* plugin's phase taxonomy (publish-tx, sign, parse, …) without
|
|
@@ -176,10 +175,7 @@ const executeSuiTx = (params) => params.signer.withTransactionSigner((lockedSign
|
|
|
176
175
|
objectChanges
|
|
177
176
|
}
|
|
178
177
|
};
|
|
179
|
-
}))
|
|
180
|
-
"sui-execute.signer": params.signer.name,
|
|
181
|
-
"sui-execute.address": params.signer.address
|
|
182
|
-
} }));
|
|
178
|
+
}));
|
|
183
179
|
/** Decode a possibly URI-encoded SDK error message. The Sui SDK
|
|
184
180
|
* emits `decodeURIComponent`-able strings for some error paths
|
|
185
181
|
* (notably stale-object-version reports). Falls back to the raw
|