@jinn-network/client 0.1.8 → 0.1.9-canary.023faefb
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/CONTRIBUTING.md +2 -2
- package/README.md +6 -0
- package/deployments/deployment-phase1b-mech-baseSepolia-fast.json +3 -3
- package/deployments/deployment-stolas-l2-baseSepolia-fast.json +23 -3
- package/deployments/deployment-task-coordinator-router-v3-baseSepolia-fast.json +34 -6
- package/dist/adapters/mech/adapter.d.ts +31 -1
- package/dist/adapters/mech/adapter.js +126 -53
- package/dist/adapters/mech/adapter.js.map +1 -1
- package/dist/adapters/mech/contracts.d.ts +174 -13
- package/dist/adapters/mech/contracts.js +99 -49
- package/dist/adapters/mech/contracts.js.map +1 -1
- package/dist/adapters/mech/safe-revert.d.ts +4 -0
- package/dist/adapters/mech/safe-revert.js +5 -1
- package/dist/adapters/mech/safe-revert.js.map +1 -1
- package/dist/adapters/mech/safe.js +77 -1
- package/dist/adapters/mech/safe.js.map +1 -1
- package/dist/adapters/mech/types.d.ts +5 -130
- package/dist/adapters/mech/types.js +9 -65
- package/dist/adapters/mech/types.js.map +1 -1
- package/dist/adapters/mech/verdict-code.js +1 -1
- package/dist/adapters/mech/verdict-code.js.map +1 -1
- package/dist/api/bootstrap-endpoint.d.ts +19 -3
- package/dist/api/bootstrap-endpoint.js +4 -0
- package/dist/api/bootstrap-endpoint.js.map +1 -1
- package/dist/api/discovery-endpoint.d.ts +1 -0
- package/dist/api/discovery-endpoint.js +24 -0
- package/dist/api/discovery-endpoint.js.map +1 -1
- package/dist/api/fleet-build.d.ts +1 -7
- package/dist/api/fleet-build.js +0 -7
- package/dist/api/fleet-build.js.map +1 -1
- package/dist/api/gather-status.d.ts +26 -17
- package/dist/api/gather-status.js +62 -520
- package/dist/api/gather-status.js.map +1 -1
- package/dist/api/harness-auth-status-endpoint.d.ts +21 -0
- package/dist/api/harness-auth-status-endpoint.js +17 -0
- package/dist/api/harness-auth-status-endpoint.js.map +1 -0
- package/dist/api/launcher-endpoints.js +6 -1
- package/dist/api/launcher-endpoints.js.map +1 -1
- package/dist/api/launcher-status.d.ts +2 -0
- package/dist/api/launcher-status.js.map +1 -1
- package/dist/api/launcher-tasks.d.ts +47 -0
- package/dist/api/launcher-tasks.js +88 -3
- package/dist/api/launcher-tasks.js.map +1 -1
- package/dist/api/loop-completion-build.d.ts +79 -0
- package/dist/api/loop-completion-build.js +154 -0
- package/dist/api/loop-completion-build.js.map +1 -0
- package/dist/api/operator-artifacts-endpoint.js +1 -1
- package/dist/api/operator-artifacts-endpoint.js.map +1 -1
- package/dist/api/portfolio-v0-build.d.ts +2 -1
- package/dist/api/portfolio-v0-build.js +5 -7
- package/dist/api/portfolio-v0-build.js.map +1 -1
- package/dist/api/prediction-v1-build.d.ts +2 -2
- package/dist/api/prediction-v1-build.js +5 -7
- package/dist/api/prediction-v1-build.js.map +1 -1
- package/dist/api/rewards-build.d.ts +8 -1
- package/dist/api/rewards-build.js +32 -4
- package/dist/api/rewards-build.js.map +1 -1
- package/dist/api/rewards-endpoint.d.ts +12 -0
- package/dist/api/rewards-endpoint.js +46 -0
- package/dist/api/rewards-endpoint.js.map +1 -0
- package/dist/api/server.d.ts +6 -16
- package/dist/api/server.js +29 -26
- package/dist/api/server.js.map +1 -1
- package/dist/api/setup-endpoints.d.ts +45 -0
- package/dist/api/setup-endpoints.js +271 -52
- package/dist/api/setup-endpoints.js.map +1 -1
- package/dist/api/solvernets-endpoints.js +4 -1
- package/dist/api/solvernets-endpoints.js.map +1 -1
- package/dist/api/status-build.d.ts +71 -94
- package/dist/api/status-build.js +11 -77
- package/dist/api/status-build.js.map +1 -1
- package/dist/api/status-rollup-build.d.ts +0 -4
- package/dist/api/status-rollup-build.js +0 -4
- package/dist/api/status-rollup-build.js.map +1 -1
- package/dist/api/stop-hook.d.ts +1 -1
- package/dist/api/stop-hook.js +1 -1
- package/dist/api/stop-hook.js.map +1 -1
- package/dist/api/task-run-routing.d.ts +1 -1
- package/dist/api/task-runs-build.d.ts +2 -2
- package/dist/api/task-runs-build.js +5 -7
- package/dist/api/task-runs-build.js.map +1 -1
- package/dist/bin/jinn-distil-mcp.js +813 -0
- package/dist/bin/jinn-layer.js +12568 -0
- package/dist/build-info.json +4 -4
- package/dist/build-meta.json +1 -1
- package/dist/captures/distil-export.d.ts +54 -0
- package/dist/captures/distil-export.js +135 -0
- package/dist/captures/distil-export.js.map +1 -0
- package/dist/captures/ingest.d.ts +21 -0
- package/dist/captures/ingest.js +144 -0
- package/dist/captures/ingest.js.map +1 -0
- package/dist/captures/live-publisher.d.ts +9 -0
- package/dist/captures/live-publisher.js +5 -3
- package/dist/captures/live-publisher.js.map +1 -1
- package/dist/captures/publish.d.ts +15 -0
- package/dist/captures/publish.js +17 -7
- package/dist/captures/publish.js.map +1 -1
- package/dist/cli/commands/codedigest-revert-check.js +6 -2
- package/dist/cli/commands/codedigest-revert-check.js.map +1 -1
- package/dist/cli/commands/doctor.d.ts +3 -0
- package/dist/cli/commands/doctor.js +36 -4
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/eval.d.ts +87 -0
- package/dist/cli/commands/eval.js +481 -0
- package/dist/cli/commands/eval.js.map +1 -0
- package/dist/cli/commands/rewards.d.ts +2 -0
- package/dist/cli/commands/rewards.js +39 -10
- package/dist/cli/commands/rewards.js.map +1 -1
- package/dist/cli/commands/solver-nets.js +68 -0
- package/dist/cli/commands/solver-nets.js.map +1 -1
- package/dist/cli/commands/status.js +0 -1
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/update.js +8 -0
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/version.js +4 -0
- package/dist/cli/commands/version.js.map +1 -1
- package/dist/cli/execution-context.js +2 -1
- package/dist/cli/execution-context.js.map +1 -1
- package/dist/cli/index.js +2 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/introspection-context.js +0 -3
- package/dist/cli/introspection-context.js.map +1 -1
- package/dist/config.d.ts +158 -541
- package/dist/config.js +190 -197
- package/dist/config.js.map +1 -1
- package/dist/contracts/abis.d.ts +100 -0
- package/dist/contracts/abis.js +58 -0
- package/dist/contracts/abis.js.map +1 -0
- package/dist/contracts/addresses.d.ts +36 -0
- package/dist/contracts/addresses.js +60 -0
- package/dist/contracts/addresses.js.map +1 -0
- package/dist/corpus/acquire.d.ts +7 -6
- package/dist/corpus/acquire.js +10 -10
- package/dist/corpus/acquire.js.map +1 -1
- package/dist/corpus/fetch-artifact.d.ts +21 -0
- package/dist/corpus/fetch-artifact.js +33 -0
- package/dist/corpus/fetch-artifact.js.map +1 -0
- package/dist/corpus/index.d.ts +2 -2
- package/dist/corpus/onchain-query.d.ts +0 -1
- package/dist/corpus/onchain-query.js +2 -5
- package/dist/corpus/onchain-query.js.map +1 -1
- package/dist/corpus/route-resolver.d.ts +3 -3
- package/dist/corpus/route-resolver.js +3 -3
- package/dist/daemon/ai-units-gate.d.ts +6 -6
- package/dist/daemon/ai-units-gate.js +11 -10
- package/dist/daemon/ai-units-gate.js.map +1 -1
- package/dist/daemon/balance-topup-loop.js +27 -9
- package/dist/daemon/balance-topup-loop.js.map +1 -1
- package/dist/daemon/checkpoint-loop.js +2 -2
- package/dist/daemon/creator.d.ts +1 -0
- package/dist/daemon/creator.js +39 -25
- package/dist/daemon/creator.js.map +1 -1
- package/dist/daemon/daemon.d.ts +15 -10
- package/dist/daemon/daemon.js +95 -41
- package/dist/daemon/daemon.js.map +1 -1
- package/dist/daemon/delivery-watcher.d.ts +9 -0
- package/dist/daemon/delivery-watcher.js +24 -1
- package/dist/daemon/delivery-watcher.js.map +1 -1
- package/dist/daemon/eviction-loop.d.ts +7 -0
- package/dist/daemon/eviction-loop.js +19 -3
- package/dist/daemon/eviction-loop.js.map +1 -1
- package/dist/daemon/join-applier.d.ts +35 -0
- package/dist/daemon/join-applier.js +49 -0
- package/dist/daemon/join-applier.js.map +1 -0
- package/dist/daemon/loop-heartbeat.d.ts +89 -0
- package/dist/daemon/loop-heartbeat.js +75 -0
- package/dist/daemon/loop-heartbeat.js.map +1 -0
- package/dist/{api/peers.js → daemon/peer-sync.js} +3 -1
- package/dist/daemon/peer-sync.js.map +1 -0
- package/dist/daemon/reward-claim-loop.js +28 -10
- package/dist/daemon/reward-claim-loop.js.map +1 -1
- package/dist/daemon/skip-log-dedup.d.ts +1 -1
- package/dist/daemon/skip-log-dedup.js +3 -0
- package/dist/daemon/skip-log-dedup.js.map +1 -1
- package/dist/daemon/spend-cap-gate.d.ts +0 -6
- package/dist/daemon/spend-cap-gate.js +1 -8
- package/dist/daemon/spend-cap-gate.js.map +1 -1
- package/dist/daemon/watchdog-loop.d.ts +84 -0
- package/dist/daemon/watchdog-loop.js +91 -0
- package/dist/daemon/watchdog-loop.js.map +1 -0
- package/dist/dashboard/assets/index-B_5Cb-ZH.js +161 -0
- package/dist/dashboard/assets/index-D7rvJRNa.css +1 -0
- package/dist/dashboard/index.html +2 -2
- package/dist/discovery/http.d.ts +17 -0
- package/dist/discovery/http.js +378 -26
- package/dist/discovery/http.js.map +1 -1
- package/dist/discovery/onchain.js +174 -10
- package/dist/discovery/onchain.js.map +1 -1
- package/dist/discovery/types.d.ts +149 -0
- package/dist/discovery/types.js +40 -0
- package/dist/discovery/types.js.map +1 -1
- package/dist/discovery/with-fallback.js +24 -0
- package/dist/discovery/with-fallback.js.map +1 -1
- package/dist/earning/bootstrap-run.d.ts +25 -0
- package/dist/earning/bootstrap-run.js +315 -0
- package/dist/earning/bootstrap-run.js.map +1 -0
- package/dist/earning/bootstrap.d.ts +31 -11
- package/dist/earning/bootstrap.js +123 -212
- package/dist/earning/bootstrap.js.map +1 -1
- package/dist/earning/contracts.d.ts +2 -232
- package/dist/earning/contracts.js +16 -205
- package/dist/earning/contracts.js.map +1 -1
- package/dist/earning/faucet-topup-store.d.ts +41 -0
- package/dist/earning/faucet-topup-store.js +89 -0
- package/dist/earning/faucet-topup-store.js.map +1 -0
- package/dist/earning/faucet.d.ts +1 -1
- package/dist/earning/faucet.js +2 -2
- package/dist/earning/faucet.js.map +1 -1
- package/dist/earning/safe-adapter.js +12 -45
- package/dist/earning/safe-adapter.js.map +1 -1
- package/dist/earning/steps/context.d.ts +42 -0
- package/dist/earning/steps/context.js +4 -0
- package/dist/earning/steps/context.js.map +1 -0
- package/dist/earning/steps/fleet-identity-register.d.ts +4 -0
- package/dist/earning/steps/fleet-identity-register.js +65 -0
- package/dist/earning/steps/fleet-identity-register.js.map +1 -0
- package/dist/earning/steps/fleet-safe-deploy.d.ts +4 -0
- package/dist/earning/steps/fleet-safe-deploy.js +62 -0
- package/dist/earning/steps/fleet-safe-deploy.js.map +1 -0
- package/dist/earning/steps/fleet-safe-predict.d.ts +4 -0
- package/dist/earning/steps/fleet-safe-predict.js +18 -0
- package/dist/earning/steps/fleet-safe-predict.js.map +1 -0
- package/dist/earning/steps/receipt-parsing.d.ts +12 -0
- package/dist/earning/steps/receipt-parsing.js +71 -0
- package/dist/earning/steps/receipt-parsing.js.map +1 -0
- package/dist/earning/stolas-claim.js +8 -8
- package/dist/earning/stolas-claim.js.map +1 -1
- package/dist/earning/{jinn-rewards.d.ts → stolas-staking.d.ts} +4 -8
- package/dist/earning/{jinn-rewards.js → stolas-staking.js} +6 -10
- package/dist/earning/stolas-staking.js.map +1 -0
- package/dist/earning/testnet-setup-migration.d.ts +1 -0
- package/dist/earning/testnet-setup-migration.js +7 -2
- package/dist/earning/testnet-setup-migration.js.map +1 -1
- package/dist/earning/types.d.ts +1 -1
- package/dist/earning/types.js +1 -1
- package/dist/earning/types.js.map +1 -1
- package/dist/earning/viem-clients.d.ts +3 -19
- package/dist/earning/viem-clients.js +4 -31
- package/dist/earning/viem-clients.js.map +1 -1
- package/dist/erc8004/addresses.d.ts +6 -5
- package/dist/erc8004/addresses.js +7 -5
- package/dist/erc8004/addresses.js.map +1 -1
- package/dist/erc8004/identity.d.ts +12 -1
- package/dist/erc8004/identity.js +31 -0
- package/dist/erc8004/identity.js.map +1 -1
- package/dist/erc8004/index.d.ts +1 -1
- package/dist/erc8004/index.js +1 -1
- package/dist/erc8004/index.js.map +1 -1
- package/dist/eval/capability-slate.d.ts +54 -0
- package/dist/eval/capability-slate.js +116 -0
- package/dist/eval/capability-slate.js.map +1 -0
- package/dist/eval/capability-stats.d.ts +39 -0
- package/dist/eval/capability-stats.js +123 -0
- package/dist/eval/capability-stats.js.map +1 -0
- package/dist/eval/contested-band.d.ts +18 -0
- package/dist/eval/contested-band.js +19 -0
- package/dist/eval/contested-band.js.map +1 -0
- package/dist/eval/corpus-index.d.ts +21 -0
- package/dist/eval/corpus-index.js +55 -0
- package/dist/eval/corpus-index.js.map +1 -0
- package/dist/eval/disjointness.d.ts +26 -0
- package/dist/eval/disjointness.js +67 -0
- package/dist/eval/disjointness.js.map +1 -0
- package/dist/eval/eval-harness-run.d.ts +63 -0
- package/dist/eval/eval-harness-run.js +123 -0
- package/dist/eval/eval-harness-run.js.map +1 -0
- package/dist/eval/mcnemar-power.d.ts +14 -0
- package/dist/eval/mcnemar-power.js +40 -0
- package/dist/eval/mcnemar-power.js.map +1 -0
- package/dist/eval/orchestrator.d.ts +224 -0
- package/dist/eval/orchestrator.js +250 -0
- package/dist/eval/orchestrator.js.map +1 -0
- package/dist/eval/paired.d.ts +68 -0
- package/dist/eval/paired.js +93 -0
- package/dist/eval/paired.js.map +1 -0
- package/dist/eval/resolve-slate-tasks.d.ts +35 -0
- package/dist/eval/resolve-slate-tasks.js +56 -0
- package/dist/eval/resolve-slate-tasks.js.map +1 -0
- package/dist/eval/screen-discovery.d.ts +22 -0
- package/dist/eval/screen-discovery.js +71 -0
- package/dist/eval/screen-discovery.js.map +1 -0
- package/dist/eval/screen-progress.d.ts +41 -0
- package/dist/eval/screen-progress.js +60 -0
- package/dist/eval/screen-progress.js.map +1 -0
- package/dist/eval/screen-runner.d.ts +30 -0
- package/dist/eval/screen-runner.js +289 -0
- package/dist/eval/screen-runner.js.map +1 -0
- package/dist/eval/screen.d.ts +107 -0
- package/dist/eval/screen.js +159 -0
- package/dist/eval/screen.js.map +1 -0
- package/dist/eval/slope.d.ts +29 -0
- package/dist/eval/slope.js +46 -0
- package/dist/eval/slope.js.map +1 -0
- package/dist/eval/train-sequence.d.ts +35 -0
- package/dist/eval/train-sequence.js +59 -0
- package/dist/eval/train-sequence.js.map +1 -0
- package/dist/eval/wilson.d.ts +45 -0
- package/dist/eval/wilson.js +48 -0
- package/dist/eval/wilson.js.map +1 -0
- package/dist/events/types.d.ts +1 -1
- package/dist/events/types.js +1 -1
- package/dist/events/types.js.map +1 -1
- package/dist/harnesses/auth-source.d.ts +51 -0
- package/dist/harnesses/auth-source.js +155 -0
- package/dist/harnesses/auth-source.js.map +1 -0
- package/dist/harnesses/engine/canonical-json.js +5 -3
- package/dist/harnesses/engine/canonical-json.js.map +1 -1
- package/dist/harnesses/engine/engine.d.ts +34 -1
- package/dist/harnesses/engine/engine.js +91 -11
- package/dist/harnesses/engine/engine.js.map +1 -1
- package/dist/harnesses/engine/packaging.js +5 -5
- package/dist/harnesses/engine/packaging.js.map +1 -1
- package/dist/harnesses/engine/persistence.d.ts +19 -61
- package/dist/harnesses/engine/persistence.js +28 -0
- package/dist/harnesses/engine/persistence.js.map +1 -1
- package/dist/harnesses/impls/_evaluator-base.d.ts +48 -0
- package/dist/harnesses/impls/_evaluator-base.js +35 -0
- package/dist/harnesses/impls/_evaluator-base.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-hyperliquid/mcp-tools.d.ts +1 -1
- package/dist/harnesses/impls/claude-mcp-hyperliquid/mcp-tools.js +1 -1
- package/dist/harnesses/impls/claude-mcp-hyperliquid/mcp-tools.js.map +1 -1
- package/dist/harnesses/impls/claude-mcp-prediction/index.d.ts +2 -3
- package/dist/harnesses/impls/claude-mcp-prediction/index.js +29 -99
- package/dist/harnesses/impls/claude-mcp-prediction/index.js.map +1 -1
- package/dist/harnesses/impls/claude-mcp-prediction/mcp-tools.js +4 -21
- package/dist/harnesses/impls/claude-mcp-prediction/mcp-tools.js.map +1 -1
- package/dist/harnesses/impls/claude-mcp-prediction/session-orchestrator.d.ts +2 -0
- package/dist/harnesses/impls/claude-mcp-prediction/session-orchestrator.js +1 -1
- package/dist/harnesses/impls/claude-mcp-prediction/session-orchestrator.js.map +1 -1
- package/dist/harnesses/impls/claude-mcp-prediction-apy/index.js +30 -79
- package/dist/harnesses/impls/claude-mcp-prediction-apy/index.js.map +1 -1
- package/dist/harnesses/impls/claude-mcp-prediction-apy/mcp-tools.js +4 -19
- package/dist/harnesses/impls/claude-mcp-prediction-apy/mcp-tools.js.map +1 -1
- package/dist/harnesses/impls/claude-mcp-prediction-apy/session-orchestrator.d.ts +2 -0
- package/dist/harnesses/impls/claude-mcp-prediction-apy/session-orchestrator.js +1 -1
- package/dist/harnesses/impls/claude-mcp-prediction-apy/session-orchestrator.js.map +1 -1
- package/dist/harnesses/impls/claude-mcp-shared/mcp-server-script.d.ts +39 -0
- package/dist/harnesses/impls/claude-mcp-shared/mcp-server-script.js +62 -0
- package/dist/harnesses/impls/claude-mcp-shared/mcp-server-script.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-shared/mcp-server.d.ts +40 -0
- package/dist/harnesses/impls/claude-mcp-shared/mcp-server.js +44 -0
- package/dist/harnesses/impls/claude-mcp-shared/mcp-server.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-shared/single-session-harness.d.ts +56 -0
- package/dist/harnesses/impls/claude-mcp-shared/single-session-harness.js +79 -0
- package/dist/harnesses/impls/claude-mcp-shared/single-session-harness.js.map +1 -0
- package/dist/harnesses/impls/hermes-agent/adapter.d.ts +2 -0
- package/dist/harnesses/impls/hermes-agent/adapter.js +8 -5
- package/dist/harnesses/impls/hermes-agent/adapter.js.map +1 -1
- package/dist/harnesses/impls/hermes-agent/bootstrap.d.ts +1 -0
- package/dist/harnesses/impls/hermes-agent/bootstrap.js +6 -1
- package/dist/harnesses/impls/hermes-agent/bootstrap.js.map +1 -1
- package/dist/harnesses/impls/hermes-agent/harness.d.ts +25 -3
- package/dist/harnesses/impls/hermes-agent/harness.js +89 -5
- package/dist/harnesses/impls/hermes-agent/harness.js.map +1 -1
- package/dist/harnesses/impls/index.d.ts +2 -0
- package/dist/harnesses/impls/index.js +10 -1
- package/dist/harnesses/impls/index.js.map +1 -1
- package/dist/harnesses/impls/jinn-repo-evaluator/eval-runner.d.ts +34 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/eval-runner.js +111 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/eval-runner.js.map +1 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/evaluator.d.ts +24 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/evaluator.js +19 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/evaluator.js.map +1 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/harness.d.ts +64 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/harness.js +125 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/harness.js.map +1 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/repro.d.ts +32 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/repro.js +73 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/repro.js.map +1 -0
- package/dist/harnesses/impls/learner/adapters/claude-code.js +5 -0
- package/dist/harnesses/impls/learner/adapters/claude-code.js.map +1 -1
- package/dist/harnesses/impls/learner/adapters/codex-code.d.ts +11 -1
- package/dist/harnesses/impls/learner/adapters/codex-code.js +130 -15
- package/dist/harnesses/impls/learner/adapters/codex-code.js.map +1 -1
- package/dist/harnesses/impls/learner/harness.d.ts +29 -1
- package/dist/harnesses/impls/learner/harness.js +85 -1
- package/dist/harnesses/impls/learner/harness.js.map +1 -1
- package/dist/harnesses/impls/learner/harvest.d.ts +2 -0
- package/dist/harnesses/impls/learner/harvest.js +51 -1
- package/dist/harnesses/impls/learner/harvest.js.map +1 -1
- package/dist/harnesses/impls/learner/plugin-path.js +1 -0
- package/dist/harnesses/impls/learner/plugin-path.js.map +1 -1
- package/dist/harnesses/impls/portfolio-v0-evaluator/index.d.ts +5 -15
- package/dist/harnesses/impls/portfolio-v0-evaluator/index.js +10 -29
- package/dist/harnesses/impls/portfolio-v0-evaluator/index.js.map +1 -1
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/index.d.ts +5 -15
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/index.js +10 -23
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/index.js.map +1 -1
- package/dist/harnesses/impls/prediction-v0-evaluator/index.d.ts +5 -15
- package/dist/harnesses/impls/prediction-v0-evaluator/index.js +10 -25
- package/dist/harnesses/impls/prediction-v0-evaluator/index.js.map +1 -1
- package/dist/harnesses/impls/stub.d.ts +2 -2
- package/dist/harnesses/impls/stub.js +2 -2
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/eval-runner.js +8 -0
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/eval-runner.js.map +1 -1
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/harness.js +3 -1
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/harness.js.map +1 -1
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/index.d.ts +2 -2
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/index.js +3 -1
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/index.js.map +1 -1
- package/dist/harnesses/readiness-registry.d.ts +16 -0
- package/dist/harnesses/readiness-registry.js +28 -6
- package/dist/harnesses/readiness-registry.js.map +1 -1
- package/dist/harnesses/types.d.ts +26 -0
- package/dist/learner/revert-decision.d.ts +16 -1
- package/dist/learner/revert-decision.js +38 -18
- package/dist/learner/revert-decision.js.map +1 -1
- package/dist/learner/revert-stats.d.ts +14 -0
- package/dist/learner/revert-stats.js +42 -0
- package/dist/learner/revert-stats.js.map +1 -1
- package/dist/learner/verification-gate.d.ts +53 -0
- package/dist/learner/verification-gate.js +80 -0
- package/dist/learner/verification-gate.js.map +1 -0
- package/dist/local-provider-url.d.ts +3 -0
- package/dist/local-provider-url.js +28 -0
- package/dist/local-provider-url.js.map +1 -0
- package/dist/main.js +188 -566
- package/dist/main.js.map +1 -1
- package/dist/mcp/acquire-artifact.d.ts +3 -3
- package/dist/mcp/acquire-artifact.js +3 -3
- package/dist/mcp/operator-server.js +1 -1
- package/dist/mcp/operator-server.js.map +1 -1
- package/dist/mcp/server.js +5 -6
- package/dist/mcp/server.js.map +1 -1
- package/dist/monitoring/net-liveness.d.ts +143 -0
- package/dist/monitoring/net-liveness.js +301 -0
- package/dist/monitoring/net-liveness.js.map +1 -0
- package/dist/observability/emit-event.d.ts +1 -1
- package/dist/observability/emit-event.js +0 -4
- package/dist/observability/emit-event.js.map +1 -1
- package/dist/observability/progress.d.ts +11 -0
- package/dist/observability/progress.js +16 -0
- package/dist/observability/progress.js.map +1 -0
- package/dist/pilot/cost.d.ts +19 -0
- package/dist/pilot/cost.js +31 -0
- package/dist/pilot/cost.js.map +1 -0
- package/dist/pilot/instance.d.ts +20 -0
- package/dist/pilot/instance.js +19 -0
- package/dist/pilot/instance.js.map +1 -0
- package/dist/pilot/repo.d.ts +31 -0
- package/dist/pilot/repo.js +42 -0
- package/dist/pilot/repo.js.map +1 -0
- package/dist/pilot/solve.d.ts +22 -0
- package/dist/pilot/solve.js +37 -0
- package/dist/pilot/solve.js.map +1 -0
- package/dist/pilot/tally.d.ts +35 -0
- package/dist/pilot/tally.js +61 -0
- package/dist/pilot/tally.js.map +1 -0
- package/dist/plugins/learner/.claude-plugin/plugin.json +1 -1
- package/dist/plugins/learner/.codex-plugin/plugin.json +1 -1
- package/dist/plugins/learner/hooks/session-start +30 -1
- package/dist/plugins/learner/skills/learn/consolidator-prompt.md +4 -0
- package/dist/plugins/local-trace-distiller/.claude-plugin/plugin.json +9 -0
- package/dist/plugins/local-trace-distiller/.codex-plugin/plugin.json +41 -0
- package/dist/plugins/local-trace-distiller/.mcp.json +8 -0
- package/dist/plugins/local-trace-distiller/README.md +27 -0
- package/dist/plugins/local-trace-distiller/jinn.plugin.json +36 -0
- package/dist/plugins/local-trace-distiller/skills/distill/SKILL.md +51 -0
- package/dist/preflight/deployment-readiness.d.ts +127 -0
- package/dist/preflight/deployment-readiness.js +308 -0
- package/dist/preflight/deployment-readiness.js.map +1 -0
- package/dist/preflight/pidfile-liveness.d.ts +7 -1
- package/dist/preflight/pidfile-liveness.js +14 -0
- package/dist/preflight/pidfile-liveness.js.map +1 -1
- package/dist/preflight/rpc-network.d.ts +10 -3
- package/dist/preflight/rpc-network.js +46 -13
- package/dist/preflight/rpc-network.js.map +1 -1
- package/dist/preflight/stable-cwd.d.ts +29 -0
- package/dist/preflight/stable-cwd.js +98 -0
- package/dist/preflight/stable-cwd.js.map +1 -0
- package/dist/rpc/transport.d.ts +43 -5
- package/dist/rpc/transport.js +131 -30
- package/dist/rpc/transport.js.map +1 -1
- package/dist/scripts/swe-rebench-v2-seed-pool.json +2 -1
- package/dist/solver-nets/registry.d.ts +19 -0
- package/dist/solver-nets/registry.js +95 -66
- package/dist/solver-nets/registry.js.map +1 -1
- package/dist/solver-types/_jinn-repo-pool.d.ts +27 -0
- package/dist/solver-types/_jinn-repo-pool.js +27 -0
- package/dist/solver-types/_jinn-repo-pool.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-held-out-slate.d.ts +76 -0
- package/dist/solver-types/_swe-rebench-v2-held-out-slate.js +156 -0
- package/dist/solver-types/_swe-rebench-v2-held-out-slate.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-pool-recovery.d.ts +81 -0
- package/dist/solver-types/_swe-rebench-v2-pool-recovery.js +116 -0
- package/dist/solver-types/_swe-rebench-v2-pool-recovery.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-state.d.ts +9 -0
- package/dist/solver-types/_swe-rebench-v2-state.js +14 -0
- package/dist/solver-types/_swe-rebench-v2-state.js.map +1 -1
- package/dist/solver-types/_swe-rebench-v2-validated-pool.d.ts +30 -0
- package/dist/solver-types/_swe-rebench-v2-validated-pool.js +40 -0
- package/dist/solver-types/_swe-rebench-v2-validated-pool.js.map +1 -1
- package/dist/solver-types/index.js +2 -0
- package/dist/solver-types/index.js.map +1 -1
- package/dist/solver-types/jinn-repo-admit.d.ts +17 -0
- package/dist/solver-types/jinn-repo-admit.js +16 -0
- package/dist/solver-types/jinn-repo-admit.js.map +1 -0
- package/dist/solver-types/jinn-repo-auto.d.ts +60 -0
- package/dist/solver-types/jinn-repo-auto.js +163 -0
- package/dist/solver-types/jinn-repo-auto.js.map +1 -0
- package/dist/solver-types/jinn-repo-definition.d.ts +15 -0
- package/dist/solver-types/jinn-repo-definition.js +34 -0
- package/dist/solver-types/jinn-repo-definition.js.map +1 -0
- package/dist/solver-types/jinn-repo-extract.d.ts +16 -0
- package/dist/solver-types/jinn-repo-extract.js +32 -0
- package/dist/solver-types/jinn-repo-extract.js.map +1 -0
- package/dist/solver-types/jinn-repo.d.ts +21 -0
- package/dist/solver-types/jinn-repo.js +23 -0
- package/dist/solver-types/jinn-repo.js.map +1 -0
- package/dist/solver-types/learner-loop-test.js +1 -1
- package/dist/solver-types/learner-loop-test.js.map +1 -1
- package/dist/solver-types/slates/held-out-slate.swe-rebench-v2.v1.json +20 -0
- package/dist/solver-types/slates/held-out-slate.swe-rebench-v2.v2.json +19 -0
- package/dist/solver-types/slates/held-out-slate.swe-rebench-v2.v2.screening-report.json +628 -0
- package/dist/solver-types/solver-type.d.ts +8 -0
- package/dist/solver-types/swe-rebench-v2.d.ts +2 -0
- package/dist/solver-types/swe-rebench-v2.js +115 -10
- package/dist/solver-types/swe-rebench-v2.js.map +1 -1
- package/dist/solvernets/launched-record-dispatcher.d.ts +5 -0
- package/dist/solvernets/launched-record-dispatcher.js +14 -1
- package/dist/solvernets/launched-record-dispatcher.js.map +1 -1
- package/dist/solvernets/registry-client-erc8004.js +29 -37
- package/dist/solvernets/registry-client-erc8004.js.map +1 -1
- package/dist/solvernets/registry-client.d.ts +6 -0
- package/dist/solvernets/store.d.ts +1 -1
- package/dist/solvernets/store.js +8 -3
- package/dist/solvernets/store.js.map +1 -1
- package/dist/spend/ai-units-config.d.ts +10 -0
- package/dist/spend/ai-units-config.js +7 -1
- package/dist/spend/ai-units-config.js.map +1 -1
- package/dist/spend/ai-units.d.ts +51 -0
- package/dist/spend/ai-units.js +73 -0
- package/dist/spend/ai-units.js.map +1 -1
- package/dist/spend/credential.d.ts +2 -2
- package/dist/spend/credential.js +9 -3
- package/dist/spend/credential.js.map +1 -1
- package/dist/spend/record.js +12 -5
- package/dist/spend/record.js.map +1 -1
- package/dist/spend/spend-cap.d.ts +10 -0
- package/dist/spend/spend-cap.js +13 -0
- package/dist/spend/spend-cap.js.map +1 -0
- package/dist/spend/usage.js +39 -3
- package/dist/spend/usage.js.map +1 -1
- package/dist/store/store.d.ts +106 -5
- package/dist/store/store.js +194 -8
- package/dist/store/store.js.map +1 -1
- package/dist/trajectory/emit.d.ts +6 -0
- package/dist/trajectory/emit.js +9 -1
- package/dist/trajectory/emit.js.map +1 -1
- package/dist/trajectory/harness-bundle-schema.d.ts +1 -1
- package/dist/trajectory/harness-bundle-schema.js +1 -1
- package/dist/trajectory/harness-bundle-schema.js.map +1 -1
- package/dist/trajectory/processors/identity-scrub.js +22 -3
- package/dist/trajectory/processors/identity-scrub.js.map +1 -1
- package/dist/trajectory/schema.d.ts +1 -1
- package/dist/trajectory/schema.js +1 -1
- package/dist/trajectory/schema.js.map +1 -1
- package/dist/trajectory/scrub/build.d.ts +46 -0
- package/dist/trajectory/scrub/build.js +76 -0
- package/dist/trajectory/scrub/build.js.map +1 -0
- package/dist/trajectory/scrub/emit-scrub.d.ts +41 -0
- package/dist/trajectory/scrub/emit-scrub.js +88 -0
- package/dist/trajectory/scrub/emit-scrub.js.map +1 -0
- package/dist/trajectory/scrub/key-policy.d.ts +20 -0
- package/dist/trajectory/scrub/key-policy.js +43 -0
- package/dist/trajectory/scrub/key-policy.js.map +1 -0
- package/dist/trajectory/scrub/layer2.d.ts +23 -0
- package/dist/trajectory/scrub/layer2.js +33 -0
- package/dist/trajectory/scrub/layer2.js.map +1 -0
- package/dist/trajectory/scrub/ml-pii-stage.d.ts +24 -0
- package/dist/trajectory/scrub/ml-pii-stage.js +43 -0
- package/dist/trajectory/scrub/ml-pii-stage.js.map +1 -0
- package/dist/trajectory/scrub/openredaction-stage.d.ts +178 -0
- package/dist/trajectory/scrub/openredaction-stage.js +269 -0
- package/dist/trajectory/scrub/openredaction-stage.js.map +1 -0
- package/dist/trajectory/scrub/pii-build.d.ts +31 -0
- package/dist/trajectory/scrub/pii-build.js +64 -0
- package/dist/trajectory/scrub/pii-build.js.map +1 -0
- package/dist/trajectory/scrub/pipeline.d.ts +37 -0
- package/dist/trajectory/scrub/pipeline.js +83 -0
- package/dist/trajectory/scrub/pipeline.js.map +1 -0
- package/dist/trajectory/scrub/plain-patterns-stage.d.ts +31 -0
- package/dist/trajectory/scrub/plain-patterns-stage.js +85 -0
- package/dist/trajectory/scrub/plain-patterns-stage.js.map +1 -0
- package/dist/trajectory/scrub/secretlint-stage.d.ts +35 -0
- package/dist/trajectory/scrub/secretlint-stage.js +250 -0
- package/dist/trajectory/scrub/secretlint-stage.js.map +1 -0
- package/dist/trajectory/scrub/transformers-detector.d.ts +35 -0
- package/dist/trajectory/scrub/transformers-detector.js +68 -0
- package/dist/trajectory/scrub/transformers-detector.js.map +1 -0
- package/dist/trajectory/scrub/types.d.ts +25 -0
- package/dist/trajectory/scrub/types.js +2 -0
- package/dist/trajectory/scrub/types.js.map +1 -0
- package/dist/trajectory/transcript-parsers/types.d.ts +1 -1
- package/dist/trajectory/transcript-parsers/types.js +1 -1
- package/dist/trajectory/transcript-parsers/types.js.map +1 -1
- package/dist/trajectory/transcript-watcher.d.ts +26 -0
- package/dist/trajectory/transcript-watcher.js +33 -0
- package/dist/trajectory/transcript-watcher.js.map +1 -1
- package/dist/tx-retry.d.ts +12 -0
- package/dist/tx-retry.js +41 -12
- package/dist/tx-retry.js.map +1 -1
- package/dist/types/envelope.d.ts +1 -1
- package/dist/types/envelope.js +1 -1
- package/dist/types/envelope.js.map +1 -1
- package/dist/types/payloads/index.d.ts +1 -1
- package/dist/types/payloads/index.js +7 -1
- package/dist/types/payloads/index.js.map +1 -1
- package/dist/types/payloads/portfolio-v0.d.ts +1 -1
- package/dist/types/payloads/portfolio-v0.js +1 -1
- package/dist/types/payloads/portfolio-v0.js.map +1 -1
- package/dist/types/payloads/prediction-apy-v0.d.ts +1 -1
- package/dist/types/payloads/prediction-apy-v0.js +1 -1
- package/dist/types/payloads/prediction-apy-v0.js.map +1 -1
- package/dist/types/payloads/prediction-v0.d.ts +1 -1
- package/dist/types/payloads/prediction-v0.js +1 -1
- package/dist/types/payloads/prediction-v0.js.map +1 -1
- package/dist/types/portfolio.d.ts +1 -1
- package/dist/types/portfolio.js +1 -1
- package/dist/types/portfolio.js.map +1 -1
- package/dist/types/prediction-apy.d.ts +1 -1
- package/dist/types/prediction-apy.js +1 -1
- package/dist/types/prediction-apy.js.map +1 -1
- package/dist/types/prediction.d.ts +1 -1
- package/dist/types/prediction.js +1 -1
- package/dist/types/prediction.js.map +1 -1
- package/dist/types/session-provenance.d.ts +1 -1
- package/dist/types/session-provenance.js +1 -1
- package/dist/types/session-provenance.js.map +1 -1
- package/dist/types/skill-artifact.d.ts +442 -0
- package/dist/types/skill-artifact.js +137 -0
- package/dist/types/skill-artifact.js.map +1 -0
- package/dist/types/task-document.d.ts +315 -1
- package/dist/types/task-document.js +9 -1
- package/dist/types/task-document.js.map +1 -1
- package/dist/types/task-run-read-model.d.ts +21 -0
- package/dist/types/task-run-read-model.js +2 -0
- package/dist/types/task-run-read-model.js.map +1 -0
- package/dist/types/task-run.d.ts +75 -0
- package/dist/types/task-run.js +2 -0
- package/dist/types/task-run.js.map +1 -0
- package/dist/types/task.d.ts +29 -1
- package/dist/types/task.js +1 -1
- package/dist/types/task.js.map +1 -1
- package/dist/types/window.d.ts +1 -1
- package/dist/types/window.js +1 -1
- package/dist/types/window.js.map +1 -1
- package/dist/util/redact-rpc-urls.d.ts +1 -1
- package/dist/util/redact-rpc-urls.js +57 -2
- package/dist/util/redact-rpc-urls.js.map +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/checkpoint.d.ts +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/checkpoint.js +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/contracts.d.ts +3 -2
- package/dist/vendor/@jinn-network/sdk/dist/contracts.js +49 -0
- package/dist/vendor/@jinn-network/sdk/dist/jinn-repo.d.ts +44 -0
- package/dist/vendor/@jinn-network/sdk/dist/jinn-repo.js +25 -0
- package/dist/vendor/@jinn-network/sdk/dist/json-schema.d.ts +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/json-schema.js +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/payloads/jinn-repo.d.ts +38 -0
- package/dist/vendor/@jinn-network/sdk/dist/payloads/jinn-repo.js +22 -0
- package/dist/vendor/@jinn-network/sdk/dist/payloads/prediction-v1.d.ts +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/payloads/prediction-v1.js +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/payloads/session-derived.d.ts +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/payloads/session-derived.js +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/payloads/swe-rebench-v2.d.ts +109 -2
- package/dist/vendor/@jinn-network/sdk/dist/payloads/swe-rebench-v2.js +26 -2
- package/dist/vendor/@jinn-network/sdk/dist/prediction-v1.d.ts +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/prediction-v1.js +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/jinn-repo.d.ts +4 -0
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/jinn-repo.js +2 -0
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/manifest-schema.d.ts +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/manifest-schema.js +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/swe-rebench-v2-held-out-slate.d.ts +65 -0
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/swe-rebench-v2-held-out-slate.js +123 -0
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/swe-rebench-v2.d.ts +2 -2
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/swe-rebench-v2.js +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/swe-rebench-v2.d.ts +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/swe-rebench-v2.js +1 -1
- package/dist/vendor/@jinn-network/sdk/package.json +9 -1
- package/docker-compose.yml +3 -2
- package/package.json +43 -28
- package/plugins/jinn-repo-runtime/.claude-plugin/plugin.json +5 -0
- package/plugins/jinn-repo-runtime/.codex-plugin/plugin.json +39 -0
- package/plugins/jinn-repo-runtime/README.md +27 -0
- package/plugins/jinn-repo-runtime/hooks/hooks.json +16 -0
- package/plugins/jinn-repo-runtime/hooks/session-start +73 -0
- package/plugins/jinn-repo-runtime/jinn.plugin.json +11 -0
- package/plugins/jinn-repo-runtime/skills/task/SKILL.md +92 -0
- package/plugins/learner/.claude-plugin/plugin.json +1 -1
- package/plugins/learner/.codex-plugin/plugin.json +1 -1
- package/plugins/learner/hooks/session-start +30 -1
- package/plugins/learner/skills/learn/consolidator-prompt.md +4 -0
- package/plugins/local-trace-distiller/.claude-plugin/plugin.json +9 -0
- package/plugins/local-trace-distiller/.codex-plugin/plugin.json +41 -0
- package/plugins/local-trace-distiller/.mcp.json +8 -0
- package/plugins/local-trace-distiller/README.md +27 -0
- package/plugins/local-trace-distiller/jinn.plugin.json +36 -0
- package/plugins/local-trace-distiller/skills/distill/SKILL.md +51 -0
- package/plugins/swe-rebench-v2-runtime/hooks/hooks.json +16 -0
- package/plugins/swe-rebench-v2-runtime/hooks/session-start +74 -0
- package/deployments/deployment-jinn-mvi-l1-sepolia-fast.json +0 -55
- package/deployments/deployment-jinn-mvi-l1-sepolia.json +0 -55
- package/deployments/deployment-jinn-mvi-l2-baseSepolia.json +0 -13
- package/deployments/deployment-jinn-testnet-faucet-baseSepolia-fast.json +0 -15
- package/dist/api/peers.js.map +0 -1
- package/dist/daemon/jinn-claim-loop-canonical.d.ts +0 -207
- package/dist/daemon/jinn-claim-loop-canonical.js +0 -296
- package/dist/daemon/jinn-claim-loop-canonical.js.map +0 -1
- package/dist/daemon/jinn-claim-loop-mock.d.ts +0 -61
- package/dist/daemon/jinn-claim-loop-mock.js +0 -122
- package/dist/daemon/jinn-claim-loop-mock.js.map +0 -1
- package/dist/daemon/jinn-claim-loop-wiring.d.ts +0 -33
- package/dist/daemon/jinn-claim-loop-wiring.js +0 -40
- package/dist/daemon/jinn-claim-loop-wiring.js.map +0 -1
- package/dist/daemon/jinn-claim-loop.d.ts +0 -130
- package/dist/daemon/jinn-claim-loop.js +0 -328
- package/dist/daemon/jinn-claim-loop.js.map +0 -1
- package/dist/dashboard/assets/index-CzKxvMcU.css +0 -32
- package/dist/dashboard/assets/index-yVemxHot.js +0 -351
- package/dist/earning/jinn-rewards.js.map +0 -1
- package/dist/scripts/donation-consumption-acceptance.d.ts +0 -85
- package/dist/scripts/donation-consumption-acceptance.js +0 -1382
- package/dist/scripts/donation-consumption-acceptance.js.map +0 -1
- package/dist/x402/acquire.d.ts +0 -17
- package/dist/x402/acquire.js +0 -49
- package/dist/x402/acquire.js.map +0 -1
- package/dist/x402/facilitator.d.ts +0 -11
- package/dist/x402/facilitator.js +0 -52
- package/dist/x402/facilitator.js.map +0 -1
- package/dist/x402/handler.d.ts +0 -27
- package/dist/x402/handler.js +0 -236
- package/dist/x402/handler.js.map +0 -1
- /package/dist/{api/peers.d.ts → daemon/peer-sync.d.ts} +0 -0
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Phase 1 (master): generate mnemonic → fund master EOA
|
|
5
5
|
* Phase 2 (per-service): derive agent → stake → deploy mech
|
|
6
6
|
*/
|
|
7
|
+
import { type Hex } from 'viem';
|
|
7
8
|
import type { FleetState, FleetBootstrapResult, StakingMode } from './types.js';
|
|
8
9
|
import { requestTestnetFunding } from './faucet.js';
|
|
9
10
|
import { type JinnOnchainNetwork } from './viem-clients.js';
|
|
@@ -162,6 +163,11 @@ export interface FleetBootstrapperOptions {
|
|
|
162
163
|
* (~1.5 Base Sepolia blocks). Tests pass 0 to skip the sleep entirely.
|
|
163
164
|
*/
|
|
164
165
|
safeBindingRetryDelayMs?: number;
|
|
166
|
+
/**
|
|
167
|
+
* Backoff before retrying a transient CDP faucet 429 (issue #984 work unit 1).
|
|
168
|
+
* Defaults to 15000 ms. Tests pass 0 to skip the sleep entirely.
|
|
169
|
+
*/
|
|
170
|
+
faucetRateLimitBackoffMs?: number;
|
|
165
171
|
}
|
|
166
172
|
export declare class FleetBootstrapper {
|
|
167
173
|
private readonly store;
|
|
@@ -179,6 +185,7 @@ export declare class FleetBootstrapper {
|
|
|
179
185
|
private readonly autoTestnetFaucet;
|
|
180
186
|
private readonly safeBindingMaxAttempts;
|
|
181
187
|
private readonly safeBindingRetryDelayMs;
|
|
188
|
+
private readonly faucetRateLimitBackoffMs;
|
|
182
189
|
constructor(options?: FleetBootstrapperOptions);
|
|
183
190
|
getStatus(): Promise<FleetState>;
|
|
184
191
|
/**
|
|
@@ -278,11 +285,8 @@ export declare class FleetBootstrapper {
|
|
|
278
285
|
private warnMasterEthRunway;
|
|
279
286
|
private ensureMasterWallet;
|
|
280
287
|
private loadExistingMnemonic;
|
|
281
|
-
/** Deterministic Safe predict from the HD-index-1 agent EOA. */
|
|
282
288
|
private stepFleetSafePredict;
|
|
283
|
-
/** Deploy the predicted fleet Safe. Funds the agent EOA from master if needed. */
|
|
284
289
|
private stepFleetSafeDeploy;
|
|
285
|
-
/** Mint the fleet agentId + bind Safe via setAgentWallet (ERC-1271). */
|
|
286
290
|
private stepFleetIdentityRegister;
|
|
287
291
|
private bootstrapService;
|
|
288
292
|
/**
|
|
@@ -340,6 +344,12 @@ export declare class FleetBootstrapper {
|
|
|
340
344
|
private stepSelfBondRegisterAgents;
|
|
341
345
|
private stepSelfBondDeployService;
|
|
342
346
|
private stepSelfBondStakeService;
|
|
347
|
+
/**
|
|
348
|
+
* Fresh dependency bag for an extracted step. Rebuilt on every call so a
|
|
349
|
+
* spy installed after construction is honoured; the spied helper arrows
|
|
350
|
+
* dispatch through `this` at call time (see plan Binding rule).
|
|
351
|
+
*/
|
|
352
|
+
private stepContext;
|
|
343
353
|
private getBondTokenBalance;
|
|
344
354
|
private getServiceState;
|
|
345
355
|
private waitForSuccessfulTx;
|
|
@@ -349,14 +359,6 @@ export declare class FleetBootstrapper {
|
|
|
349
359
|
private getStakingState;
|
|
350
360
|
private parseServiceIdFromReceipt;
|
|
351
361
|
private parseMultisigFromReceipt;
|
|
352
|
-
/**
|
|
353
|
-
* Extract `agentId` from an `IdentityRegistry.Registered` log emitted in
|
|
354
|
-
* the receipt. Filters by `(address, topic[0])` first to avoid colliding
|
|
355
|
-
* with any other contract that happens to share the event signature.
|
|
356
|
-
*
|
|
357
|
-
* Returns the agentId as a decimal string (uint256) so it round-trips
|
|
358
|
-
* cleanly through JSON-persisted EarningState.
|
|
359
|
-
*/
|
|
360
362
|
private parseAgentIdFromReceipt;
|
|
361
363
|
}
|
|
362
364
|
/** @deprecated Use FleetBootstrapper */
|
|
@@ -371,6 +373,24 @@ export interface RecoverEvictedServiceOptions {
|
|
|
371
373
|
chain: JinnOnchainNetwork;
|
|
372
374
|
mnemonic: string;
|
|
373
375
|
}
|
|
376
|
+
/**
|
|
377
|
+
* Inspect a mined reStake receipt and log the correct outcome (#916).
|
|
378
|
+
*
|
|
379
|
+
* Pure + I/O-free so it can be unit-tested without a chain client. On a
|
|
380
|
+
* `success` receipt it logs `reStake confirmed` at log level. On a `reverted`
|
|
381
|
+
* receipt it logs `reStake reverted` at debug level (a benign substrate event —
|
|
382
|
+
* the NotEnoughTimeStaked window / stale-RPC race; staking is non-load-bearing,
|
|
383
|
+
* DR-2026-06-04 / #1060) with the decoded reason if the caller could obtain one,
|
|
384
|
+
* and still throws so the recovery attempt re-queues (#916 control flow intact).
|
|
385
|
+
*/
|
|
386
|
+
export declare function handleReStakeReceipt(args: {
|
|
387
|
+
receipt: {
|
|
388
|
+
status: 'success' | 'reverted';
|
|
389
|
+
};
|
|
390
|
+
serviceDisplayIndex: number;
|
|
391
|
+
reStakeHash: Hex;
|
|
392
|
+
revertReason?: string;
|
|
393
|
+
}): void;
|
|
374
394
|
/**
|
|
375
395
|
* Re-stake an evicted service by calling `distributor.reStake(stakingProxy, serviceId)`.
|
|
376
396
|
*
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* Phase 1 (master): generate mnemonic → fund master EOA
|
|
5
5
|
* Phase 2 (per-service): derive agent → stake → deploy mech
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
8
|
-
import { ERC20_ABI,
|
|
7
|
+
import { encodeAbiParameters, encodeFunctionData, formatEther, getAddress, zeroAddress, } from 'viem';
|
|
8
|
+
import { ERC20_ABI, IDENTITY_REGISTRY_ABI, IDENTITY_REGISTRY_ADDRESSES, SERVICE_MANAGER_ABI, SERVICE_REGISTRY_APPROVE_ABI, SERVICE_REGISTRY_L2_ABI, STAKING_ABI, MECH_MARKETPLACE_CREATE_ABI, STOLAS_DISTRIBUTOR_ABI, STOLAS_STAKING_SLOTS_ABI, applyChainGasOverrides, cidToBytes32, getChainConfig, } from './contracts.js';
|
|
9
9
|
import { executeSafeTxBatch, executeSafeTxDirect, initDeployedSafe, initPredictedSafe, } from './safe-adapter.js';
|
|
10
10
|
import { bindAgentWalletToSafe } from './agent-wallet-binding.js';
|
|
11
11
|
import { FleetStateStore } from './store.js';
|
|
@@ -17,12 +17,17 @@ import { previousSafeBeingAbandoned, sweepOrphanedServiceFunds, } from './orphan
|
|
|
17
17
|
import { DEFAULT_FAUCET_LOOP_TIMEOUT_MS, computeFaucetDripCap, requestTestnetFunding, } from './faucet.js';
|
|
18
18
|
import { flattenErrorMessage, sleep, viemSendTransactionWithRetry, waitForContractCode, waitForTransactionReceiptWithRetry, } from '../tx-retry.js';
|
|
19
19
|
import { isUnauthorizedAccountError } from '../errors/unauthorized-account.js';
|
|
20
|
+
import { formatKnownRevert } from '../adapters/mech/safe-revert.js';
|
|
20
21
|
import { createJinnPublicClient, createJinnWalletClient } from './viem-clients.js';
|
|
21
22
|
import { isTransientEthReadError } from '../chain-read-errors.js';
|
|
22
23
|
import { nextFleetServiceIndex } from './next-service-index.js';
|
|
23
24
|
import { displayFleetServiceIndex } from './fleet-display-index.js';
|
|
24
25
|
import { rpcHostForDisplay } from '../preflight/rpc-network.js';
|
|
25
26
|
import { detectDeprecatedTestnetSetup, migrateDeprecatedTestnetSetup, } from './testnet-setup-migration.js';
|
|
27
|
+
import { parseAgentIdFromReceipt as parseAgentIdFromReceiptImpl, parseMultisigFromReceipt as parseMultisigFromReceiptImpl, parseServiceIdFromReceipt as parseServiceIdFromReceiptImpl, } from './steps/receipt-parsing.js';
|
|
28
|
+
import { stepFleetSafePredict as stepFleetSafePredictImpl } from './steps/fleet-safe-predict.js';
|
|
29
|
+
import { stepFleetSafeDeploy as stepFleetSafeDeployImpl } from './steps/fleet-safe-deploy.js';
|
|
30
|
+
import { stepFleetIdentityRegister as stepFleetIdentityRegisterImpl } from './steps/fleet-identity-register.js';
|
|
26
31
|
const addr = (value) => getAddress(value);
|
|
27
32
|
const SAFE_TOKEN_BOOTSTRAP_MULTIPLIER = 2n;
|
|
28
33
|
/**
|
|
@@ -183,6 +188,8 @@ const MASTER_ETH_RUNWAY_WARN_DAYS = 7n;
|
|
|
183
188
|
*/
|
|
184
189
|
const DEFAULT_SAFE_BINDING_MAX_ATTEMPTS = 3;
|
|
185
190
|
const DEFAULT_SAFE_BINDING_RETRY_DELAY_MS = 3_000;
|
|
191
|
+
const FAUCET_RATE_LIMIT_MAX_RETRIES = 3;
|
|
192
|
+
const DEFAULT_FAUCET_RATE_LIMIT_BACKOFF_MS = 15_000;
|
|
186
193
|
export class FleetBootstrapper {
|
|
187
194
|
store;
|
|
188
195
|
config;
|
|
@@ -199,6 +206,7 @@ export class FleetBootstrapper {
|
|
|
199
206
|
autoTestnetFaucet;
|
|
200
207
|
safeBindingMaxAttempts;
|
|
201
208
|
safeBindingRetryDelayMs;
|
|
209
|
+
faucetRateLimitBackoffMs;
|
|
202
210
|
constructor(options = {}) {
|
|
203
211
|
this.store = new FleetStateStore(options.earningDir);
|
|
204
212
|
this.chain = options.chain ?? 'base';
|
|
@@ -215,6 +223,8 @@ export class FleetBootstrapper {
|
|
|
215
223
|
options.safeBindingMaxAttempts ?? DEFAULT_SAFE_BINDING_MAX_ATTEMPTS;
|
|
216
224
|
this.safeBindingRetryDelayMs =
|
|
217
225
|
options.safeBindingRetryDelayMs ?? DEFAULT_SAFE_BINDING_RETRY_DELAY_MS;
|
|
226
|
+
this.faucetRateLimitBackoffMs =
|
|
227
|
+
options.faucetRateLimitBackoffMs ?? DEFAULT_FAUCET_RATE_LIMIT_BACKOFF_MS;
|
|
218
228
|
const dailyOpt = options.masterEthDailyEstimateWei;
|
|
219
229
|
this.masterEthDailyEstimateWei =
|
|
220
230
|
dailyOpt !== undefined
|
|
@@ -550,8 +560,13 @@ export class FleetBootstrapper {
|
|
|
550
560
|
targetWei: requiredMasterEth,
|
|
551
561
|
balanceWei: systemEth,
|
|
552
562
|
});
|
|
553
|
-
const INTER_DRIP_PAUSE_MS = 1_000;
|
|
554
563
|
const deadline = this.now() + this.faucetLoopTimeoutMs;
|
|
564
|
+
// requestFunding returns synchronously with a txHash and there is no
|
|
565
|
+
// on-chain confirmation to wait for between drips, so the happy path
|
|
566
|
+
// carries NO fixed inter-drip sleep (issue #984 work unit 1). A transient
|
|
567
|
+
// CDP 429 backs off and retries within the session instead of ending it
|
|
568
|
+
// on the first throttle; the wall-clock deadline stays the safety rail.
|
|
569
|
+
let rateLimitRetries = 0;
|
|
555
570
|
console.error(`[fleet-bootstrap] Master has ${formatEther(systemEth)} ETH; need ${formatEther(requiredMasterEth)} ETH. ` +
|
|
556
571
|
`Draining CDP faucet on ${this.chain} via ${rpcHostForDisplay(this.config.rpcUrl)} ` +
|
|
557
572
|
`(each drip ≈ 0.0001 ETH, up to ${maxFaucetIters} drips or ${Math.round(this.faucetLoopTimeoutMs / 1000)}s, whichever comes first).`);
|
|
@@ -564,6 +579,13 @@ export class FleetBootstrapper {
|
|
|
564
579
|
}
|
|
565
580
|
const faucetResult = await this.requestFunding(masterAddress, 'base-sepolia');
|
|
566
581
|
if (!faucetResult.ok) {
|
|
582
|
+
if (faucetResult.rateLimited && rateLimitRetries < FAUCET_RATE_LIMIT_MAX_RETRIES) {
|
|
583
|
+
rateLimitRetries++;
|
|
584
|
+
console.error(`[fleet-bootstrap] CDP faucet rate-limited after ${i} drips: ${faucetResult.reason}. ` +
|
|
585
|
+
`Backing off (retry ${rateLimitRetries}/${FAUCET_RATE_LIMIT_MAX_RETRIES}).`);
|
|
586
|
+
await new Promise(r => setTimeout(r, this.faucetRateLimitBackoffMs));
|
|
587
|
+
continue;
|
|
588
|
+
}
|
|
567
589
|
if (faucetResult.rateLimited) {
|
|
568
590
|
console.error(`[fleet-bootstrap] CDP faucet rate-limited after ${i} drips: ${faucetResult.reason}`);
|
|
569
591
|
}
|
|
@@ -572,14 +594,17 @@ export class FleetBootstrapper {
|
|
|
572
594
|
}
|
|
573
595
|
break;
|
|
574
596
|
}
|
|
575
|
-
|
|
597
|
+
// Balance is no longer read once per drip — only every 5th drip and on
|
|
598
|
+
// the final iteration (issue #984 work unit 1). Target/early-exit is
|
|
599
|
+
// only checked on iterations where balance was just refreshed.
|
|
600
|
+
if ((i + 1) % 5 !== 0 && i !== maxFaucetIters - 1) {
|
|
601
|
+
continue;
|
|
602
|
+
}
|
|
576
603
|
const refreshed = await refreshSystemEth();
|
|
577
604
|
systemEth = refreshed.system;
|
|
578
605
|
masterBalance = refreshed.master;
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
`master=${formatEther(masterBalance)} ETH · target=${formatEther(requiredMasterEth)} ETH`);
|
|
582
|
-
}
|
|
606
|
+
console.error(`[fleet-bootstrap] drip ${i + 1}/${maxFaucetIters} · chain=${this.chain} · rpc=${rpcHostForDisplay(this.config.rpcUrl)} · ` +
|
|
607
|
+
`master=${formatEther(masterBalance)} ETH · target=${formatEther(requiredMasterEth)} ETH`);
|
|
583
608
|
if (systemEth >= requiredMasterEth) {
|
|
584
609
|
console.error(`[fleet-bootstrap] Faucet funding sufficient after ${i + 1} drip${i === 0 ? '' : 's'} ` +
|
|
585
610
|
`(master=${formatEther(masterBalance)} ETH). Continuing bootstrap...`);
|
|
@@ -762,131 +787,14 @@ export class FleetBootstrapper {
|
|
|
762
787
|
}
|
|
763
788
|
}
|
|
764
789
|
// ── Stage 1: fleet-level identity steps (nghf) ────────────────────────
|
|
765
|
-
/** Deterministic Safe predict from the HD-index-1 agent EOA. */
|
|
766
790
|
async stepFleetSafePredict(state, mnemonic) {
|
|
767
|
-
|
|
768
|
-
const agentKey = walletPrivateKeyAtIndex(mnemonic, 1);
|
|
769
|
-
console.error(`[fleet-bootstrap] Stage 1: predicting fleet Safe (owner=${agentAddress})`);
|
|
770
|
-
const { address } = await initPredictedSafe({
|
|
771
|
-
rpcUrl: this.config.rpcUrl,
|
|
772
|
-
signerKey: agentKey,
|
|
773
|
-
owners: [agentAddress],
|
|
774
|
-
threshold: 1,
|
|
775
|
-
});
|
|
776
|
-
void state;
|
|
777
|
-
return this.store.patchFleet({ fleet_safe_address: getAddress(address) });
|
|
791
|
+
return stepFleetSafePredictImpl(this.stepContext(), state, mnemonic);
|
|
778
792
|
}
|
|
779
|
-
/** Deploy the predicted fleet Safe. Funds the agent EOA from master if needed. */
|
|
780
793
|
async stepFleetSafeDeploy(state, mnemonic) {
|
|
781
|
-
|
|
782
|
-
const agentKey = walletPrivateKeyAtIndex(mnemonic, 1);
|
|
783
|
-
const agentSigner = deriveAgentSigner(mnemonic, 1);
|
|
784
|
-
const fleetSafe = state.fleet_safe_address;
|
|
785
|
-
// Fund agent EOA so it can pay for Safe deploy + setAgentWallet gas.
|
|
786
|
-
// 0.01 ETH covers Safe deploy (~250k gas) + register (~80k) + setAgentWallet
|
|
787
|
-
// (~200k) at testnet gas prices comfortably. STAGE1_AGENT_ETH is the
|
|
788
|
-
// module-level constant used both here and in `stage1MinMasterEth` so the
|
|
789
|
-
// gate and the transfer agree (jinn-mono-u34i).
|
|
790
|
-
const masterAccount = deriveMasterSigner(mnemonic);
|
|
791
|
-
const masterWallet = createJinnWalletClient(this.config.rpcUrl, this.chain, masterAccount);
|
|
792
|
-
const agentBalance = await this.publicClient.getBalance({
|
|
793
|
-
address: getAddress(agentAddress),
|
|
794
|
-
});
|
|
795
|
-
if (agentBalance < STAGE1_AGENT_ETH) {
|
|
796
|
-
const fundAmount = STAGE1_AGENT_ETH - agentBalance;
|
|
797
|
-
console.error(`[fleet-bootstrap] Stage 1: funding fleet agent EOA with ${fundAmount} wei from master`);
|
|
798
|
-
const fundHash = await viemSendTransactionWithRetry(masterWallet, this.publicClient, {
|
|
799
|
-
account: masterAccount,
|
|
800
|
-
to: addr(agentAddress),
|
|
801
|
-
value: fundAmount,
|
|
802
|
-
});
|
|
803
|
-
await waitForTransactionReceiptWithRetry(this.publicClient, fundHash);
|
|
804
|
-
}
|
|
805
|
-
console.error(`[fleet-bootstrap] Stage 1: deploying fleet Safe at ${fleetSafe}`);
|
|
806
|
-
const { safe } = await initPredictedSafe({
|
|
807
|
-
rpcUrl: this.config.rpcUrl,
|
|
808
|
-
signerKey: agentKey,
|
|
809
|
-
owners: [agentAddress],
|
|
810
|
-
threshold: 1,
|
|
811
|
-
});
|
|
812
|
-
const deployTx = await safe.createSafeDeploymentTransaction();
|
|
813
|
-
const agentWallet = createJinnWalletClient(this.config.rpcUrl, this.chain, agentSigner);
|
|
814
|
-
const deployHash = await viemSendTransactionWithRetry(agentWallet, this.publicClient, {
|
|
815
|
-
account: agentSigner,
|
|
816
|
-
to: deployTx.to,
|
|
817
|
-
value: BigInt(deployTx.value),
|
|
818
|
-
data: deployTx.data,
|
|
819
|
-
});
|
|
820
|
-
const receipt = await waitForTransactionReceiptWithRetry(this.publicClient, deployHash);
|
|
821
|
-
if (receipt.status !== 'success') {
|
|
822
|
-
throw new Error(`Fleet Safe deployment tx failed: ${deployHash}`);
|
|
823
|
-
}
|
|
824
|
-
try {
|
|
825
|
-
await waitForContractCode(this.publicClient, getAddress(fleetSafe));
|
|
826
|
-
}
|
|
827
|
-
catch {
|
|
828
|
-
throw new Error(`Fleet Safe deployment succeeded but no code at ${fleetSafe}`);
|
|
829
|
-
}
|
|
830
|
-
console.error(`[fleet-bootstrap] Stage 1: fleet Safe deployed (tx=${deployHash})`);
|
|
831
|
-
return this.store.load(this.chain);
|
|
794
|
+
return stepFleetSafeDeployImpl(this.stepContext(), state, mnemonic);
|
|
832
795
|
}
|
|
833
|
-
/** Mint the fleet agentId + bind Safe via setAgentWallet (ERC-1271). */
|
|
834
796
|
async stepFleetIdentityRegister(state, mnemonic) {
|
|
835
|
-
|
|
836
|
-
if (!identityRegistry) {
|
|
837
|
-
throw new Error(`IdentityRegistry address not configured for chainId=${this.config.chainId}.`);
|
|
838
|
-
}
|
|
839
|
-
const fleetSafe = state.fleet_safe_address;
|
|
840
|
-
const agentSigner = deriveAgentSigner(mnemonic, 1);
|
|
841
|
-
const agentWallet = createJinnWalletClient(this.config.rpcUrl, this.chain, agentSigner);
|
|
842
|
-
// Mint agentId — empty agent URI for v0 (matches stepRegisterAgent §6.1 in spec).
|
|
843
|
-
const registerData = encodeFunctionData({
|
|
844
|
-
abi: IDENTITY_REGISTRY_ABI,
|
|
845
|
-
functionName: 'register',
|
|
846
|
-
args: [''],
|
|
847
|
-
});
|
|
848
|
-
console.error(`[fleet-bootstrap] Stage 1: minting fleet agentId ` +
|
|
849
|
-
`(IdentityRegistry=${identityRegistry}, agentEOA=${agentSigner.address})`);
|
|
850
|
-
const mintTxHash = await viemSendTransactionWithRetry(agentWallet, this.publicClient, {
|
|
851
|
-
account: agentSigner,
|
|
852
|
-
to: addr(identityRegistry),
|
|
853
|
-
data: registerData,
|
|
854
|
-
});
|
|
855
|
-
const mintReceipt = await waitForTransactionReceiptWithRetry(this.publicClient, mintTxHash);
|
|
856
|
-
if (mintReceipt.status !== 'success') {
|
|
857
|
-
throw new Error(`Fleet IdentityRegistry.register() failed: ${mintTxHash}`);
|
|
858
|
-
}
|
|
859
|
-
const fleetAgentId = this.parseAgentIdFromReceipt(mintReceipt, identityRegistry);
|
|
860
|
-
if (fleetAgentId === null) {
|
|
861
|
-
throw new Error(`Fleet IdentityRegistry.register() succeeded but Registered event missing (tx=${mintTxHash})`);
|
|
862
|
-
}
|
|
863
|
-
// Persist agentId IMMEDIATELY so a crash between mint and bind doesn't lose it.
|
|
864
|
-
await this.store.patchFleet({
|
|
865
|
-
fleet_agent_id: fleetAgentId,
|
|
866
|
-
fleet_identity_registry: getAddress(identityRegistry),
|
|
867
|
-
});
|
|
868
|
-
// Bind the Safe via setAgentWallet (ERC-1271).
|
|
869
|
-
// Wrapped in the freshly-deployed-Safe retry (jinn-mono-k1ng). The
|
|
870
|
-
// pre-k1ng single-attempt version halted bootstrap when the documented
|
|
871
|
-
// race fired on the first attempt — exactly the 2026-05-18 canary's
|
|
872
|
-
// second-time-around failure mode.
|
|
873
|
-
console.error(`[fleet-bootstrap] Stage 1: binding fleet Safe ${fleetSafe} to agentId=${fleetAgentId}`);
|
|
874
|
-
const bindResult = await this.bindAgentWalletWithRetry({
|
|
875
|
-
identityRegistryAddress: addr(identityRegistry),
|
|
876
|
-
agentId: BigInt(fleetAgentId),
|
|
877
|
-
safeAddress: addr(fleetSafe),
|
|
878
|
-
agentEoaAccount: agentSigner,
|
|
879
|
-
agentEoaWalletClient: agentWallet,
|
|
880
|
-
publicClient: this.publicClient,
|
|
881
|
-
chainId: this.config.chainId,
|
|
882
|
-
}, 'Stage 1');
|
|
883
|
-
if (!bindResult.ok) {
|
|
884
|
-
const bindErr = bindResult.error;
|
|
885
|
-
throw new Error(`Fleet setAgentWallet failed after ${this.safeBindingMaxAttempts} attempts: ${bindErr.shortMessage}` +
|
|
886
|
-
(bindErr.revertReason ? ` (revert: ${bindErr.revertReason})` : ''));
|
|
887
|
-
}
|
|
888
|
-
console.error(`[fleet-bootstrap] Stage 1: setAgentWallet succeeded (tx=${bindResult.txHash})`);
|
|
889
|
-
return this.store.patchFleet({ fleet_stage: 'stage1' });
|
|
797
|
+
return stepFleetIdentityRegisterImpl(this.stepContext(), state, mnemonic);
|
|
890
798
|
}
|
|
891
799
|
// ── Phase 2: Per-service bootstrap ───────────────────────────────────
|
|
892
800
|
async bootstrapService(state, mnemonic, index) {
|
|
@@ -1047,25 +955,23 @@ export class FleetBootstrapper {
|
|
|
1047
955
|
throw error;
|
|
1048
956
|
}
|
|
1049
957
|
if (onChainState === 2) {
|
|
1050
|
-
|
|
1051
|
-
//
|
|
1052
|
-
//
|
|
1053
|
-
//
|
|
1054
|
-
//
|
|
1055
|
-
//
|
|
1056
|
-
//
|
|
1057
|
-
//
|
|
1058
|
-
//
|
|
1059
|
-
//
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
`${err instanceof Error ? err.message : String(err)}`);
|
|
1068
|
-
}
|
|
958
|
+
// Do NOT eagerly reStake at startup. Re-staking is orthogonal to the
|
|
959
|
+
// protocol loop and to earning (OLAS staking rewards accrue from
|
|
960
|
+
// delivered-work activity counts, not from re-stake liveness), and an inline reStake
|
|
961
|
+
// here broadcasts from the agent EOA during boot — contending with
|
|
962
|
+
// other agent-EOA work that runs in the same window (e.g. a launch's
|
|
963
|
+
// IdentityRegistry.setMetadata, which then reverts and strands the
|
|
964
|
+
// launch at `launching`). #773 removed the inline reStake from the
|
|
965
|
+
// mech-adapter solve path with exactly this reasoning ("staking is
|
|
966
|
+
// orthogonal to the loop — re-staking is handled out-of-band by the
|
|
967
|
+
// background EvictionLoop"); this completes #773 for the startup-resume
|
|
968
|
+
// path it missed. The throttled EvictionLoop (#917) restakes on its own
|
|
969
|
+
// cadence when enabled; when staking is intentionally dropped
|
|
970
|
+
// (evictionCheckIntervalMs=0) the service simply stays evicted, which
|
|
971
|
+
// does not affect earning (#789).
|
|
972
|
+
console.log(`[jinn-earning] Service ${svc.service_id} (fleet index ${index}) is evicted on-chain; ` +
|
|
973
|
+
`NOT reStaking inline at startup — deferring to the background EvictionLoop ` +
|
|
974
|
+
`(staking is orthogonal to earning; #773/#789/#917). Daemon launch continues.`);
|
|
1069
975
|
}
|
|
1070
976
|
}
|
|
1071
977
|
if (isOperationalServiceStep(svc.step)) {
|
|
@@ -1870,6 +1776,38 @@ export class FleetBootstrapper {
|
|
|
1870
1776
|
return this.store.updateService(index, { step: 'staked' });
|
|
1871
1777
|
}
|
|
1872
1778
|
// ── Helpers ──────────────────────────────────────────────────────────
|
|
1779
|
+
/**
|
|
1780
|
+
* Fresh dependency bag for an extracted step. Rebuilt on every call so a
|
|
1781
|
+
* spy installed after construction is honoured; the spied helper arrows
|
|
1782
|
+
* dispatch through `this` at call time (see plan Binding rule).
|
|
1783
|
+
*/
|
|
1784
|
+
stepContext() {
|
|
1785
|
+
return {
|
|
1786
|
+
store: this.store,
|
|
1787
|
+
config: this.config,
|
|
1788
|
+
publicClient: this.publicClient,
|
|
1789
|
+
chain: this.chain,
|
|
1790
|
+
stakingMode: this.stakingMode,
|
|
1791
|
+
targetServices: this.targetServices,
|
|
1792
|
+
debug: this.debug,
|
|
1793
|
+
env: this.env,
|
|
1794
|
+
safeBindingMaxAttempts: this.safeBindingMaxAttempts,
|
|
1795
|
+
safeBindingRetryDelayMs: this.safeBindingRetryDelayMs,
|
|
1796
|
+
bindAgentWalletWithRetry: (args, label) => this.bindAgentWalletWithRetry(args, label),
|
|
1797
|
+
getServiceState: (serviceId) => this.getServiceState(serviceId),
|
|
1798
|
+
waitForSuccessfulTx: (txHash, label) => this.waitForSuccessfulTx(txHash, label),
|
|
1799
|
+
firstServiceUpdate: (index, patch) => this.firstServiceUpdate(index, patch),
|
|
1800
|
+
stakingAddressForService: (svc) => this.stakingAddressForService(svc),
|
|
1801
|
+
shouldPreserveExistingSetup: (svc) => this.shouldPreserveExistingSetup(svc),
|
|
1802
|
+
parseServiceIdFromReceipt: (receipt) => this.parseServiceIdFromReceipt(receipt),
|
|
1803
|
+
parseMultisigFromReceipt: (receipt) => this.parseMultisigFromReceipt(receipt),
|
|
1804
|
+
getStakingState: (serviceId, stakingAddress) => this.getStakingState(serviceId, stakingAddress),
|
|
1805
|
+
getBondTokenBalance: (address) => this.getBondTokenBalance(address),
|
|
1806
|
+
parseAgentIdFromReceipt: (receipt, identityRegistry) => this.parseAgentIdFromReceipt(receipt, identityRegistry),
|
|
1807
|
+
stolasPreflightCheck: () => this.stolasPreflightCheck(),
|
|
1808
|
+
sweepAbandonedSafeForService: (state, mnemonic, serviceIndex, abandonedSafeAddress) => this.sweepAbandonedSafeForService(state, mnemonic, serviceIndex, abandonedSafeAddress),
|
|
1809
|
+
};
|
|
1810
|
+
}
|
|
1873
1811
|
async getBondTokenBalance(address) {
|
|
1874
1812
|
return this.publicClient.readContract({
|
|
1875
1813
|
address: this.config.olasToken,
|
|
@@ -1944,76 +1882,37 @@ export class FleetBootstrapper {
|
|
|
1944
1882
|
}));
|
|
1945
1883
|
}
|
|
1946
1884
|
async parseServiceIdFromReceipt(receipt) {
|
|
1947
|
-
|
|
1948
|
-
const serviceRegistryAddress = this.config.serviceRegistry.toLowerCase();
|
|
1949
|
-
for (const log of receipt.logs) {
|
|
1950
|
-
if (log.address.toLowerCase() !== serviceRegistryAddress ||
|
|
1951
|
-
log.topics[0] !== createServiceTopic) {
|
|
1952
|
-
continue;
|
|
1953
|
-
}
|
|
1954
|
-
try {
|
|
1955
|
-
const decoded = decodeEventLog({
|
|
1956
|
-
abi: SERVICE_REGISTRY_L2_ABI,
|
|
1957
|
-
data: log.data,
|
|
1958
|
-
topics: log.topics,
|
|
1959
|
-
strict: false,
|
|
1960
|
-
});
|
|
1961
|
-
if (decoded.eventName === 'CreateService' && 'serviceId' in decoded.args) {
|
|
1962
|
-
return Number(decoded.args.serviceId);
|
|
1963
|
-
}
|
|
1964
|
-
}
|
|
1965
|
-
catch {
|
|
1966
|
-
// Not a matching event
|
|
1967
|
-
}
|
|
1968
|
-
}
|
|
1969
|
-
return null;
|
|
1885
|
+
return parseServiceIdFromReceiptImpl(receipt, this.config.serviceRegistry);
|
|
1970
1886
|
}
|
|
1971
1887
|
parseMultisigFromReceipt(receipt) {
|
|
1972
|
-
|
|
1973
|
-
for (const log of receipt.logs) {
|
|
1974
|
-
const t0 = log.topics[0];
|
|
1975
|
-
if (t0 === topic && log.topics.length >= 3) {
|
|
1976
|
-
return getAddress(('0x' + log.topics[2].slice(26)));
|
|
1977
|
-
}
|
|
1978
|
-
}
|
|
1979
|
-
return null;
|
|
1888
|
+
return parseMultisigFromReceiptImpl(receipt);
|
|
1980
1889
|
}
|
|
1981
|
-
/**
|
|
1982
|
-
* Extract `agentId` from an `IdentityRegistry.Registered` log emitted in
|
|
1983
|
-
* the receipt. Filters by `(address, topic[0])` first to avoid colliding
|
|
1984
|
-
* with any other contract that happens to share the event signature.
|
|
1985
|
-
*
|
|
1986
|
-
* Returns the agentId as a decimal string (uint256) so it round-trips
|
|
1987
|
-
* cleanly through JSON-persisted EarningState.
|
|
1988
|
-
*/
|
|
1989
1890
|
parseAgentIdFromReceipt(receipt, identityRegistry) {
|
|
1990
|
-
|
|
1991
|
-
const target = identityRegistry.toLowerCase();
|
|
1992
|
-
for (const log of receipt.logs) {
|
|
1993
|
-
if (log.address.toLowerCase() !== target)
|
|
1994
|
-
continue;
|
|
1995
|
-
if (log.topics[0] !== topic)
|
|
1996
|
-
continue;
|
|
1997
|
-
try {
|
|
1998
|
-
const decoded = decodeEventLog({
|
|
1999
|
-
abi: IDENTITY_REGISTRY_ABI,
|
|
2000
|
-
data: log.data,
|
|
2001
|
-
topics: log.topics,
|
|
2002
|
-
strict: false,
|
|
2003
|
-
});
|
|
2004
|
-
if (decoded.eventName === 'Registered' && 'agentId' in decoded.args) {
|
|
2005
|
-
return decoded.args.agentId.toString();
|
|
2006
|
-
}
|
|
2007
|
-
}
|
|
2008
|
-
catch {
|
|
2009
|
-
// Not a matching event
|
|
2010
|
-
}
|
|
2011
|
-
}
|
|
2012
|
-
return null;
|
|
1891
|
+
return parseAgentIdFromReceiptImpl(receipt, identityRegistry);
|
|
2013
1892
|
}
|
|
2014
1893
|
}
|
|
2015
1894
|
/** @deprecated Use FleetBootstrapper */
|
|
2016
1895
|
export const EarningBootstrapper = FleetBootstrapper;
|
|
1896
|
+
/**
|
|
1897
|
+
* Inspect a mined reStake receipt and log the correct outcome (#916).
|
|
1898
|
+
*
|
|
1899
|
+
* Pure + I/O-free so it can be unit-tested without a chain client. On a
|
|
1900
|
+
* `success` receipt it logs `reStake confirmed` at log level. On a `reverted`
|
|
1901
|
+
* receipt it logs `reStake reverted` at debug level (a benign substrate event —
|
|
1902
|
+
* the NotEnoughTimeStaked window / stale-RPC race; staking is non-load-bearing,
|
|
1903
|
+
* DR-2026-06-04 / #1060) with the decoded reason if the caller could obtain one,
|
|
1904
|
+
* and still throws so the recovery attempt re-queues (#916 control flow intact).
|
|
1905
|
+
*/
|
|
1906
|
+
export function handleReStakeReceipt(args) {
|
|
1907
|
+
const { receipt, serviceDisplayIndex, reStakeHash, revertReason } = args;
|
|
1908
|
+
if (receipt.status === 'success') {
|
|
1909
|
+
console.log(`[eviction-recovery] Service ${serviceDisplayIndex}: reStake confirmed (tx: ${reStakeHash})`);
|
|
1910
|
+
return;
|
|
1911
|
+
}
|
|
1912
|
+
const msg = `[eviction-recovery] Service ${serviceDisplayIndex}: reStake reverted (tx: ${reStakeHash}, reason: ${revertReason ?? 'unavailable'})`;
|
|
1913
|
+
console.debug(msg);
|
|
1914
|
+
throw new Error(msg);
|
|
1915
|
+
}
|
|
2017
1916
|
/**
|
|
2018
1917
|
* Re-stake an evicted service by calling `distributor.reStake(stakingProxy, serviceId)`.
|
|
2019
1918
|
*
|
|
@@ -2034,7 +1933,7 @@ export async function recoverEvictedService(opts) {
|
|
|
2034
1933
|
functionName: 'reStake',
|
|
2035
1934
|
args: [addr(stakingAddress), BigInt(serviceId)],
|
|
2036
1935
|
});
|
|
2037
|
-
console.
|
|
1936
|
+
console.debug(`[eviction-recovery] Service ${serviceDisplayIndex}: calling distributor.reStake() for evicted service ${serviceId}`);
|
|
2038
1937
|
let reStakeHash;
|
|
2039
1938
|
try {
|
|
2040
1939
|
reStakeHash = await viemSendTransactionWithRetry(masterWallet, publicClient, {
|
|
@@ -2055,9 +1954,21 @@ export async function recoverEvictedService(opts) {
|
|
|
2055
1954
|
throw err;
|
|
2056
1955
|
}
|
|
2057
1956
|
const receipt = await waitForTransactionReceiptWithRetry(publicClient, reStakeHash);
|
|
1957
|
+
let revertReason;
|
|
2058
1958
|
if (receipt.status !== 'success') {
|
|
2059
|
-
|
|
1959
|
+
// Best-effort: replay the call at the mined block to decode the revert.
|
|
1960
|
+
try {
|
|
1961
|
+
await publicClient.call({
|
|
1962
|
+
account: masterAccount,
|
|
1963
|
+
to: addr(distributorAddress),
|
|
1964
|
+
data: reStakeData,
|
|
1965
|
+
blockNumber: receipt.blockNumber,
|
|
1966
|
+
});
|
|
1967
|
+
}
|
|
1968
|
+
catch (err) {
|
|
1969
|
+
revertReason = formatKnownRevert(err) ?? flattenErrorMessage(err);
|
|
1970
|
+
}
|
|
2060
1971
|
}
|
|
2061
|
-
|
|
1972
|
+
handleReStakeReceipt({ receipt, serviceDisplayIndex, reStakeHash, revertReason });
|
|
2062
1973
|
}
|
|
2063
1974
|
//# sourceMappingURL=bootstrap.js.map
|