@jinn-network/client 0.1.2 → 0.1.3-canary.12cf8b76
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/CHANGELOG.md +20 -0
- package/CONTRIBUTING.md +8 -2
- package/README.md +67 -47
- package/deployments/deployment-jinn-mvi-l1-sepolia-fast.json +36 -0
- package/deployments/deployment-jinn-mvi-l1-sepolia.json +36 -0
- package/deployments/deployment-jinn-mvi-l2-baseSepolia.json +12 -0
- package/deployments/deployment-phase1b-mech-baseSepolia-fast.json +3 -3
- package/deployments/deployment-stolas-l2-baseSepolia-fast.json +1 -1
- package/deployments/deployment-task-coordinator-router-v3-baseSepolia-fast.json +38 -0
- package/dist/adapters/adapter.d.ts +19 -8
- package/dist/adapters/local/adapter.d.ts +10 -9
- package/dist/adapters/local/adapter.js +52 -79
- package/dist/adapters/local/adapter.js.map +1 -1
- package/dist/adapters/mech/adapter.d.ts +33 -15
- package/dist/adapters/mech/adapter.js +471 -353
- package/dist/adapters/mech/adapter.js.map +1 -1
- package/dist/adapters/mech/contracts.d.ts +68 -20
- package/dist/adapters/mech/contracts.js +338 -100
- package/dist/adapters/mech/contracts.js.map +1 -1
- package/dist/adapters/mech/ipfs.d.ts +66 -12
- package/dist/adapters/mech/ipfs.js +165 -30
- package/dist/adapters/mech/ipfs.js.map +1 -1
- package/dist/adapters/mech/safe-revert.d.ts +39 -0
- package/dist/adapters/mech/safe-revert.js +124 -0
- package/dist/adapters/mech/safe-revert.js.map +1 -0
- package/dist/adapters/mech/safe.js +48 -22
- package/dist/adapters/mech/safe.js.map +1 -1
- package/dist/adapters/mech/types.d.ts +245 -84
- package/dist/adapters/mech/types.js +125 -50
- package/dist/adapters/mech/types.js.map +1 -1
- package/dist/agent/agent-ws.d.ts +57 -0
- package/dist/agent/agent-ws.js +301 -0
- package/dist/agent/agent-ws.js.map +1 -0
- package/dist/agent/auto-mode-detect.d.ts +6 -0
- package/dist/agent/auto-mode-detect.js +44 -0
- package/dist/agent/auto-mode-detect.js.map +1 -0
- package/dist/agent/operator-claude.d.ts +22 -0
- package/dist/agent/operator-claude.js +134 -0
- package/dist/agent/operator-claude.js.map +1 -0
- package/dist/api/admin-endpoint.d.ts +12 -0
- package/dist/api/admin-endpoint.js +71 -0
- package/dist/api/admin-endpoint.js.map +1 -0
- package/dist/api/agent-binding-endpoint.d.ts +26 -0
- package/dist/api/agent-binding-endpoint.js +28 -0
- package/dist/api/agent-binding-endpoint.js.map +1 -0
- package/dist/api/bootstrap-endpoint.d.ts +24 -0
- package/dist/api/bootstrap-endpoint.js +103 -0
- package/dist/api/bootstrap-endpoint.js.map +1 -0
- package/dist/api/events-endpoint.d.ts +9 -0
- package/dist/api/events-endpoint.js +46 -0
- package/dist/api/events-endpoint.js.map +1 -0
- package/dist/api/fleet-build.d.ts +1 -1
- package/dist/api/fleet-build.js +17 -8
- package/dist/api/fleet-build.js.map +1 -1
- package/dist/api/gather-status.d.ts +16 -1
- package/dist/api/gather-status.js +163 -3
- package/dist/api/gather-status.js.map +1 -1
- package/dist/api/handshake.d.ts +17 -0
- package/dist/api/handshake.js +28 -0
- package/dist/api/handshake.js.map +1 -0
- package/dist/api/harness-status-endpoint.d.ts +20 -0
- package/dist/api/harness-status-endpoint.js +13 -0
- package/dist/api/harness-status-endpoint.js.map +1 -0
- package/dist/api/history-build.d.ts +2 -2
- package/dist/api/history-build.js +3 -3
- package/dist/api/history-build.js.map +1 -1
- package/dist/api/launcher-endpoints.d.ts +43 -0
- package/dist/api/launcher-endpoints.js +50 -0
- package/dist/api/launcher-endpoints.js.map +1 -0
- package/dist/api/launcher-status.d.ts +92 -0
- package/dist/api/launcher-status.js +82 -0
- package/dist/api/launcher-status.js.map +1 -0
- package/dist/api/launcher-tasks.d.ts +104 -0
- package/dist/api/launcher-tasks.js +83 -0
- package/dist/api/launcher-tasks.js.map +1 -0
- package/dist/api/leaderboard-api.d.ts +20 -0
- package/dist/api/leaderboard-api.js +18 -0
- package/dist/api/leaderboard-api.js.map +1 -0
- package/dist/api/peers.js +21 -6
- package/dist/api/peers.js.map +1 -1
- package/dist/api/portfolio-v0-build.d.ts +16 -10
- package/dist/api/portfolio-v0-build.js +36 -31
- package/dist/api/portfolio-v0-build.js.map +1 -1
- package/dist/api/portfolio-v0-doctor.js +1 -1
- package/dist/api/portfolio-v0-doctor.js.map +1 -1
- package/dist/api/prediction-v1-build.d.ts +65 -0
- package/dist/api/prediction-v1-build.js +73 -0
- package/dist/api/prediction-v1-build.js.map +1 -0
- package/dist/api/rewards-build.js +3 -8
- package/dist/api/rewards-build.js.map +1 -1
- package/dist/api/server.d.ts +97 -1
- package/dist/api/server.js +334 -16
- package/dist/api/server.js.map +1 -1
- package/dist/api/setup-endpoints.d.ts +62 -0
- package/dist/api/setup-endpoints.js +705 -0
- package/dist/api/setup-endpoints.js.map +1 -0
- package/dist/api/solvernets-catalog-build.d.ts +37 -0
- package/dist/api/solvernets-catalog-build.js +19 -0
- package/dist/api/solvernets-catalog-build.js.map +1 -0
- package/dist/api/solvernets-endpoint.d.ts +15 -0
- package/dist/api/solvernets-endpoint.js +5 -0
- package/dist/api/solvernets-endpoint.js.map +1 -0
- package/dist/api/solvernets-endpoints.d.ts +104 -0
- package/dist/api/solvernets-endpoints.js +1023 -0
- package/dist/api/solvernets-endpoints.js.map +1 -0
- package/dist/api/status-build.d.ts +15 -2
- package/dist/api/status-build.js +45 -9
- package/dist/api/status-build.js.map +1 -1
- package/dist/api/status-rollup-build.d.ts +46 -1
- package/dist/api/status-rollup-build.js +168 -5
- package/dist/api/status-rollup-build.js.map +1 -1
- package/dist/api/ui-token.d.ts +5 -0
- package/dist/api/ui-token.js +36 -0
- package/dist/api/ui-token.js.map +1 -0
- package/dist/build-info.d.ts +32 -0
- package/dist/build-info.js +69 -0
- package/dist/build-info.js.map +1 -0
- package/dist/build-info.json +6 -0
- package/dist/build-meta.json +1 -1
- package/dist/cli/command.d.ts +9 -0
- package/dist/cli/commands/auth.js +6 -3
- package/dist/cli/commands/auth.js.map +1 -1
- package/dist/cli/commands/balance.d.ts +7 -0
- package/dist/cli/commands/balance.js +38 -32
- package/dist/cli/commands/balance.js.map +1 -1
- package/dist/cli/commands/bootstrap.d.ts +13 -1
- package/dist/cli/commands/bootstrap.js +150 -133
- package/dist/cli/commands/bootstrap.js.map +1 -1
- package/dist/cli/commands/checkpoint.d.ts +85 -0
- package/dist/cli/commands/checkpoint.js +75 -0
- package/dist/cli/commands/checkpoint.js.map +1 -0
- package/dist/cli/commands/claim-rewards.js +14 -2
- package/dist/cli/commands/claim-rewards.js.map +1 -1
- package/dist/cli/commands/conformance.d.ts +12 -0
- package/dist/cli/commands/conformance.js +140 -0
- package/dist/cli/commands/conformance.js.map +1 -0
- package/dist/cli/commands/create.d.ts +22 -0
- package/dist/cli/commands/create.js +226 -0
- package/dist/cli/commands/create.js.map +1 -0
- package/dist/cli/commands/doctor.d.ts +49 -1
- package/dist/cli/commands/doctor.js +162 -134
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/fleet-scale.d.ts +19 -1
- package/dist/cli/commands/fleet-scale.js +378 -361
- package/dist/cli/commands/fleet-scale.js.map +1 -1
- package/dist/cli/commands/fleet.d.ts +7 -0
- package/dist/cli/commands/fleet.js +39 -33
- package/dist/cli/commands/fleet.js.map +1 -1
- package/dist/cli/commands/fund-requirements.d.ts +14 -1
- package/dist/cli/commands/fund-requirements.js +182 -174
- package/dist/cli/commands/fund-requirements.js.map +1 -1
- package/dist/cli/commands/harnesses.d.ts +38 -0
- package/dist/cli/commands/harnesses.js +305 -0
- package/dist/cli/commands/harnesses.js.map +1 -0
- package/dist/cli/commands/history.d.ts +10 -1
- package/dist/cli/commands/history.js +68 -59
- package/dist/cli/commands/history.js.map +1 -1
- package/dist/cli/commands/init.js +4 -1
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/integrations.d.ts +13 -0
- package/dist/cli/commands/integrations.js +1010 -0
- package/dist/cli/commands/integrations.js.map +1 -0
- package/dist/cli/commands/logs.d.ts +6 -1
- package/dist/cli/commands/logs.js +77 -70
- package/dist/cli/commands/logs.js.map +1 -1
- package/dist/cli/commands/migrate-agent-id.d.ts +26 -0
- package/dist/cli/commands/migrate-agent-id.js +164 -0
- package/dist/cli/commands/migrate-agent-id.js.map +1 -0
- package/dist/cli/commands/prediction-scoreboard.d.ts +10 -0
- package/dist/cli/commands/prediction-scoreboard.js +136 -0
- package/dist/cli/commands/prediction-scoreboard.js.map +1 -0
- package/dist/cli/commands/quickstart.d.ts +51 -1
- package/dist/cli/commands/quickstart.js +514 -296
- package/dist/cli/commands/quickstart.js.map +1 -1
- package/dist/cli/commands/rewards.d.ts +7 -0
- package/dist/cli/commands/rewards.js +46 -40
- package/dist/cli/commands/rewards.js.map +1 -1
- package/dist/cli/commands/run.d.ts +14 -1
- package/dist/cli/commands/run.js +243 -91
- package/dist/cli/commands/run.js.map +1 -1
- package/dist/cli/commands/solver-nets.js +229 -0
- package/dist/cli/commands/solver-nets.js.map +1 -0
- package/dist/cli/commands/solver-plugins.d.ts +9 -0
- package/dist/cli/commands/solver-plugins.js +186 -0
- package/dist/cli/commands/solver-plugins.js.map +1 -0
- package/dist/cli/commands/status.d.ts +13 -0
- package/dist/cli/commands/status.js +105 -34
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/tasks.js +405 -0
- package/dist/cli/commands/tasks.js.map +1 -0
- package/dist/cli/commands/ui.d.ts +3 -0
- package/dist/cli/commands/ui.js +45 -0
- package/dist/cli/commands/ui.js.map +1 -0
- package/dist/cli/commands/update.d.ts +12 -0
- package/dist/cli/commands/update.js +321 -91
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/version.js +3 -2
- package/dist/cli/commands/version.js.map +1 -1
- package/dist/cli/commands/withdraw.d.ts +21 -1
- package/dist/cli/commands/withdraw.js +175 -159
- package/dist/cli/commands/withdraw.js.map +1 -1
- package/dist/cli/deployment-digest.js +0 -5
- package/dist/cli/deployment-digest.js.map +1 -1
- package/dist/cli/execution-context.d.ts +1 -1
- package/dist/cli/execution-context.js +4 -4
- package/dist/cli/execution-context.js.map +1 -1
- package/dist/cli/help.js +8 -1
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/index.d.ts +7 -0
- package/dist/cli/index.js +26 -6
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/introspection-context.js +0 -1
- package/dist/cli/introspection-context.js.map +1 -1
- package/dist/cli/open-browser.d.ts +1 -0
- package/dist/cli/open-browser.js +18 -0
- package/dist/cli/open-browser.js.map +1 -0
- package/dist/cli/password.d.ts +3 -3
- package/dist/cli/password.js +6 -6
- package/dist/cli/password.js.map +1 -1
- package/dist/cli/task-native-readiness.d.ts +27 -0
- package/dist/cli/task-native-readiness.js +170 -0
- package/dist/cli/task-native-readiness.js.map +1 -0
- package/dist/config.d.ts +1771 -57
- package/dist/config.js +527 -31
- package/dist/config.js.map +1 -1
- package/dist/conformance/checks/artifacts.d.ts +37 -0
- package/dist/conformance/checks/artifacts.js +110 -0
- package/dist/conformance/checks/artifacts.js.map +1 -0
- package/dist/conformance/checks/envelope-schema.d.ts +17 -0
- package/dist/conformance/checks/envelope-schema.js +36 -0
- package/dist/conformance/checks/envelope-schema.js.map +1 -0
- package/dist/conformance/checks/hash-signature.d.ts +26 -0
- package/dist/conformance/checks/hash-signature.js +70 -0
- package/dist/conformance/checks/hash-signature.js.map +1 -0
- package/dist/conformance/checks/payload.d.ts +19 -0
- package/dist/conformance/checks/payload.js +52 -0
- package/dist/conformance/checks/payload.js.map +1 -0
- package/dist/conformance/checks/secret-scrub.d.ts +33 -0
- package/dist/conformance/checks/secret-scrub.js +118 -0
- package/dist/conformance/checks/secret-scrub.js.map +1 -0
- package/dist/conformance/checks/source-runtime.d.ts +43 -0
- package/dist/conformance/checks/source-runtime.js +68 -0
- package/dist/conformance/checks/source-runtime.js.map +1 -0
- package/dist/conformance/checks/source-static.d.ts +61 -0
- package/dist/conformance/checks/source-static.js +311 -0
- package/dist/conformance/checks/source-static.js.map +1 -0
- package/dist/conformance/checks/trajectory-chain.d.ts +18 -0
- package/dist/conformance/checks/trajectory-chain.js +51 -0
- package/dist/conformance/checks/trajectory-chain.js.map +1 -0
- package/dist/conformance/checks/trajectory-profile.d.ts +17 -0
- package/dist/conformance/checks/trajectory-profile.js +51 -0
- package/dist/conformance/checks/trajectory-profile.js.map +1 -0
- package/dist/conformance/checks/trajectory-schema.d.ts +20 -0
- package/dist/conformance/checks/trajectory-schema.js +40 -0
- package/dist/conformance/checks/trajectory-schema.js.map +1 -0
- package/dist/conformance/checks/verdict.d.ts +44 -0
- package/dist/conformance/checks/verdict.js +122 -0
- package/dist/conformance/checks/verdict.js.map +1 -0
- package/dist/conformance/harness.d.ts +32 -0
- package/dist/conformance/harness.js +227 -0
- package/dist/conformance/harness.js.map +1 -0
- package/dist/conformance/types.d.ts +88 -0
- package/dist/conformance/types.js +31 -0
- package/dist/conformance/types.js.map +1 -0
- package/dist/corpus/acquire.d.ts +37 -0
- package/dist/corpus/acquire.js +155 -0
- package/dist/corpus/acquire.js.map +1 -0
- package/dist/corpus/cache.d.ts +14 -0
- package/dist/corpus/cache.js +18 -0
- package/dist/corpus/cache.js.map +1 -0
- package/dist/corpus/envelope-projection.d.ts +12 -0
- package/dist/corpus/envelope-projection.js +110 -0
- package/dist/corpus/envelope-projection.js.map +1 -0
- package/dist/corpus/fetch.d.ts +9 -0
- package/dist/corpus/fetch.js +24 -0
- package/dist/corpus/fetch.js.map +1 -0
- package/dist/corpus/index.d.ts +19 -0
- package/dist/corpus/index.js +81 -0
- package/dist/corpus/index.js.map +1 -0
- package/dist/corpus/prediction-brier-scoreboard-report.d.ts +17 -0
- package/dist/corpus/prediction-brier-scoreboard-report.js +148 -0
- package/dist/corpus/prediction-brier-scoreboard-report.js.map +1 -0
- package/dist/corpus/prediction-brier-scoreboard.d.ts +56 -0
- package/dist/corpus/prediction-brier-scoreboard.js +269 -0
- package/dist/corpus/prediction-brier-scoreboard.js.map +1 -0
- package/dist/corpus/prediction-scoreable-verdicts.d.ts +4 -0
- package/dist/corpus/prediction-scoreable-verdicts.js +23 -0
- package/dist/corpus/prediction-scoreable-verdicts.js.map +1 -0
- package/dist/corpus/query.d.ts +17 -0
- package/dist/corpus/query.js +108 -0
- package/dist/corpus/query.js.map +1 -0
- package/dist/corpus/route-resolver.d.ts +16 -0
- package/dist/corpus/route-resolver.js +20 -0
- package/dist/corpus/route-resolver.js.map +1 -0
- package/dist/corpus/types.d.ts +150 -0
- package/dist/corpus/types.js +50 -0
- package/dist/corpus/types.js.map +1 -0
- package/dist/daemon/balance-topup-loop.js +2 -1
- package/dist/daemon/balance-topup-loop.js.map +1 -1
- package/dist/daemon/creator.d.ts +7 -7
- package/dist/daemon/creator.js +11 -14
- package/dist/daemon/creator.js.map +1 -1
- package/dist/daemon/daemon.d.ts +83 -31
- package/dist/daemon/daemon.js +206 -67
- package/dist/daemon/daemon.js.map +1 -1
- package/dist/daemon/delivery-watcher.js +50 -4
- package/dist/daemon/delivery-watcher.js.map +1 -1
- package/dist/daemon/freeze-fence.d.ts +42 -0
- package/dist/daemon/freeze-fence.js +71 -0
- package/dist/daemon/freeze-fence.js.map +1 -0
- package/dist/daemon/jinn-claim-loop-canonical.d.ts +207 -0
- package/dist/daemon/jinn-claim-loop-canonical.js +296 -0
- package/dist/daemon/jinn-claim-loop-canonical.js.map +1 -0
- package/dist/daemon/jinn-claim-loop-mock.d.ts +61 -0
- package/dist/daemon/jinn-claim-loop-mock.js +122 -0
- package/dist/daemon/jinn-claim-loop-mock.js.map +1 -0
- package/dist/daemon/jinn-claim-loop.d.ts +123 -0
- package/dist/daemon/jinn-claim-loop.js +256 -0
- package/dist/daemon/jinn-claim-loop.js.map +1 -0
- package/dist/daemon/reward-claim-loop.d.ts +2 -0
- package/dist/daemon/reward-claim-loop.js +32 -27
- package/dist/daemon/reward-claim-loop.js.map +1 -1
- package/dist/dashboard/assets/index-C4Vp0vkW.js +76 -0
- package/dist/dashboard/assets/index-a0yafmyT.css +32 -0
- package/dist/dashboard/index.html +18 -74
- package/dist/earning/agent-wallet-binding.d.ts +133 -0
- package/dist/earning/agent-wallet-binding.js +202 -0
- package/dist/earning/agent-wallet-binding.js.map +1 -0
- package/dist/earning/bootstrap.d.ts +88 -1
- package/dist/earning/bootstrap.js +409 -56
- package/dist/earning/bootstrap.js.map +1 -1
- package/dist/earning/contracts.d.ts +328 -6
- package/dist/earning/contracts.js +295 -14
- package/dist/earning/contracts.js.map +1 -1
- package/dist/earning/evidence-simhash.d.ts +1 -1
- package/dist/earning/faucet.d.ts +31 -0
- package/dist/earning/faucet.js +37 -0
- package/dist/earning/faucet.js.map +1 -1
- package/dist/earning/funding-plan.d.ts +89 -0
- package/dist/earning/funding-plan.js +202 -0
- package/dist/earning/funding-plan.js.map +1 -0
- package/dist/earning/migrate-agent-id.d.ts +129 -0
- package/dist/earning/migrate-agent-id.js +256 -0
- package/dist/earning/migrate-agent-id.js.map +1 -0
- package/dist/earning/orphan-sweep.d.ts +14 -0
- package/dist/earning/orphan-sweep.js +63 -2
- package/dist/earning/orphan-sweep.js.map +1 -1
- package/dist/earning/reconcile.d.ts +2 -0
- package/dist/earning/reconcile.js +30 -0
- package/dist/earning/reconcile.js.map +1 -1
- package/dist/earning/safe-adapter.js +45 -3
- package/dist/earning/safe-adapter.js.map +1 -1
- package/dist/earning/stolas-claim.d.ts +86 -6
- package/dist/earning/stolas-claim.js +123 -9
- package/dist/earning/stolas-claim.js.map +1 -1
- package/dist/earning/store.d.ts +47 -0
- package/dist/earning/store.js +113 -1
- package/dist/earning/store.js.map +1 -1
- package/dist/earning/testnet-setup-migration.d.ts +32 -0
- package/dist/earning/testnet-setup-migration.js +214 -0
- package/dist/earning/testnet-setup-migration.js.map +1 -0
- package/dist/earning/types.d.ts +57 -9
- package/dist/earning/types.js +51 -2
- package/dist/earning/types.js.map +1 -1
- package/dist/earning/viem-clients.d.ts +20 -0
- package/dist/earning/viem-clients.js +32 -1
- package/dist/earning/viem-clients.js.map +1 -1
- package/dist/erc8004/abis.d.ts +423 -0
- package/dist/erc8004/abis.js +265 -0
- package/dist/erc8004/abis.js.map +1 -0
- package/dist/erc8004/addresses.d.ts +40 -0
- package/dist/erc8004/addresses.js +64 -0
- package/dist/erc8004/addresses.js.map +1 -0
- package/dist/erc8004/identity.d.ts +273 -0
- package/dist/erc8004/identity.js +405 -0
- package/dist/erc8004/identity.js.map +1 -0
- package/dist/erc8004/index.d.ts +13 -0
- package/dist/erc8004/index.js +20 -0
- package/dist/erc8004/index.js.map +1 -0
- package/dist/erc8004/reputation.d.ts +349 -0
- package/dist/erc8004/reputation.js +464 -0
- package/dist/erc8004/reputation.js.map +1 -0
- package/dist/erc8004/subgraph.d.ts +46 -0
- package/dist/erc8004/subgraph.js +37 -0
- package/dist/erc8004/subgraph.js.map +1 -0
- package/dist/erc8004/validation.d.ts +145 -0
- package/dist/erc8004/validation.js +219 -0
- package/dist/erc8004/validation.js.map +1 -0
- package/dist/errors/persisted-bootstrap-error.d.ts +4 -0
- package/dist/errors/persisted-bootstrap-error.js +50 -0
- package/dist/errors/persisted-bootstrap-error.js.map +1 -0
- package/dist/events/emitter.d.ts +12 -0
- package/dist/events/emitter.js +23 -0
- package/dist/events/emitter.js.map +1 -0
- package/dist/events/ring-buffer.d.ts +25 -0
- package/dist/events/ring-buffer.js +46 -0
- package/dist/events/ring-buffer.js.map +1 -0
- package/dist/events/types.d.ts +42 -0
- package/dist/events/types.js +28 -0
- package/dist/events/types.js.map +1 -0
- package/dist/harnesses/capability/index.d.ts +82 -0
- package/dist/harnesses/capability/index.js +12 -0
- package/dist/harnesses/capability/index.js.map +1 -0
- package/dist/harnesses/capability/scoped-rpc.d.ts +12 -0
- package/dist/harnesses/capability/scoped-rpc.js +34 -0
- package/dist/harnesses/capability/scoped-rpc.js.map +1 -0
- package/dist/harnesses/capability/scoped-secrets.d.ts +8 -0
- package/dist/harnesses/capability/scoped-secrets.js +10 -0
- package/dist/harnesses/capability/scoped-secrets.js.map +1 -0
- package/dist/harnesses/capability/scoped-signer.d.ts +46 -0
- package/dist/harnesses/capability/scoped-signer.js +73 -0
- package/dist/harnesses/capability/scoped-signer.js.map +1 -0
- package/dist/harnesses/engine/canonical-json.d.ts +1 -0
- package/dist/harnesses/engine/canonical-json.js +66 -0
- package/dist/harnesses/engine/canonical-json.js.map +1 -0
- package/dist/harnesses/engine/delivery.d.ts +58 -0
- package/dist/harnesses/engine/delivery.js +67 -0
- package/dist/harnesses/engine/delivery.js.map +1 -0
- package/dist/harnesses/engine/engine.d.ts +516 -0
- package/dist/harnesses/engine/engine.js +1544 -0
- package/dist/harnesses/engine/engine.js.map +1 -0
- package/dist/harnesses/engine/envelope-assembly.d.ts +73 -0
- package/dist/harnesses/engine/envelope-assembly.js +60 -0
- package/dist/harnesses/engine/envelope-assembly.js.map +1 -0
- package/dist/harnesses/engine/packaging.d.ts +87 -0
- package/dist/harnesses/engine/packaging.js +376 -0
- package/dist/harnesses/engine/packaging.js.map +1 -0
- package/dist/harnesses/engine/persistence.d.ts +193 -0
- package/dist/harnesses/engine/persistence.js +421 -0
- package/dist/harnesses/engine/persistence.js.map +1 -0
- package/dist/harnesses/engine/recovery.d.ts +22 -0
- package/dist/harnesses/engine/recovery.js +24 -0
- package/dist/harnesses/engine/recovery.js.map +1 -0
- package/dist/harnesses/engine/registry.d.ts +55 -0
- package/dist/harnesses/engine/registry.js +65 -0
- package/dist/harnesses/engine/registry.js.map +1 -0
- package/dist/harnesses/engine/signing.d.ts +30 -0
- package/dist/harnesses/engine/signing.js +39 -0
- package/dist/harnesses/engine/signing.js.map +1 -0
- package/dist/harnesses/engine/state.d.ts +42 -0
- package/dist/harnesses/engine/state.js +87 -0
- package/dist/harnesses/engine/state.js.map +1 -0
- package/dist/harnesses/engine/validate-manifest.d.ts +23 -0
- package/dist/harnesses/engine/validate-manifest.js +49 -0
- package/dist/harnesses/engine/validate-manifest.js.map +1 -0
- package/dist/harnesses/engine/verification-stub.d.ts +18 -0
- package/dist/harnesses/engine/verification-stub.js +18 -0
- package/dist/harnesses/engine/verification-stub.js.map +1 -0
- package/dist/harnesses/external-impls/index.d.ts +3 -0
- package/dist/harnesses/external-impls/index.js +2 -0
- package/dist/harnesses/external-impls/index.js.map +1 -0
- package/dist/harnesses/external-impls/loader.d.ts +50 -0
- package/dist/harnesses/external-impls/loader.js +139 -0
- package/dist/harnesses/external-impls/loader.js.map +1 -0
- package/dist/harnesses/external-impls/package-hash.d.ts +26 -0
- package/dist/harnesses/external-impls/package-hash.js +102 -0
- package/dist/harnesses/external-impls/package-hash.js.map +1 -0
- package/dist/harnesses/external-impls/types.d.ts +42 -0
- package/dist/harnesses/external-impls/types.js +10 -0
- package/dist/harnesses/external-impls/types.js.map +1 -0
- package/dist/harnesses/freeze.d.ts +34 -0
- package/dist/harnesses/freeze.js +60 -0
- package/dist/harnesses/freeze.js.map +1 -0
- package/dist/harnesses/impls/claude-code-learner/adapters/claude-code.d.ts +57 -0
- package/dist/harnesses/impls/claude-code-learner/adapters/claude-code.js +235 -0
- package/dist/harnesses/impls/claude-code-learner/adapters/claude-code.js.map +1 -0
- package/dist/harnesses/impls/claude-code-learner/harness.d.ts +22 -0
- package/dist/harnesses/impls/claude-code-learner/harness.js +56 -0
- package/dist/harnesses/impls/claude-code-learner/harness.js.map +1 -0
- package/dist/harnesses/impls/claude-code-learner/harvest.d.ts +20 -0
- package/dist/harnesses/impls/claude-code-learner/harvest.js +426 -0
- package/dist/harnesses/impls/claude-code-learner/harvest.js.map +1 -0
- package/dist/harnesses/impls/claude-code-learner/index.d.ts +14 -0
- package/dist/harnesses/impls/claude-code-learner/index.js +13 -0
- package/dist/harnesses/impls/claude-code-learner/index.js.map +1 -0
- package/dist/harnesses/impls/claude-code-learner/plugin-path.d.ts +14 -0
- package/dist/harnesses/impls/claude-code-learner/plugin-path.js +30 -0
- package/dist/harnesses/impls/claude-code-learner/plugin-path.js.map +1 -0
- package/dist/harnesses/impls/claude-code-learner/test-utils/fake-plugin-outputs.d.ts +50 -0
- package/dist/harnesses/impls/claude-code-learner/test-utils/fake-plugin-outputs.js +192 -0
- package/dist/harnesses/impls/claude-code-learner/test-utils/fake-plugin-outputs.js.map +1 -0
- package/dist/harnesses/impls/claude-code-learner/test-utils/noop-adapter.d.ts +22 -0
- package/dist/harnesses/impls/claude-code-learner/test-utils/noop-adapter.js +35 -0
- package/dist/harnesses/impls/claude-code-learner/test-utils/noop-adapter.js.map +1 -0
- package/dist/harnesses/impls/claude-code-learner/types.d.ts +112 -0
- package/dist/harnesses/impls/claude-code-learner/types.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-hyperliquid/api-wallet.d.ts +64 -0
- package/dist/harnesses/impls/claude-mcp-hyperliquid/api-wallet.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-hyperliquid/index.d.ts +106 -0
- package/dist/harnesses/impls/claude-mcp-hyperliquid/index.js +723 -0
- package/dist/harnesses/impls/claude-mcp-hyperliquid/index.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-hyperliquid/mcp-tools.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-hyperliquid/safety-rails.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-hyperliquid/session-orchestrator.d.ts +104 -0
- package/dist/harnesses/impls/claude-mcp-hyperliquid/session-orchestrator.js +264 -0
- package/dist/harnesses/impls/claude-mcp-hyperliquid/session-orchestrator.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-prediction/index.d.ts +44 -0
- package/dist/harnesses/impls/claude-mcp-prediction/index.js +250 -0
- package/dist/harnesses/impls/claude-mcp-prediction/index.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-prediction/mcp-tools.js +135 -0
- package/dist/harnesses/impls/claude-mcp-prediction/mcp-tools.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-prediction/prompt.d.ts +8 -0
- package/dist/harnesses/impls/claude-mcp-prediction/prompt.js +54 -0
- package/dist/harnesses/impls/claude-mcp-prediction/prompt.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-prediction/session-orchestrator.d.ts +43 -0
- package/dist/harnesses/impls/claude-mcp-prediction/session-orchestrator.js +21 -0
- package/dist/harnesses/impls/claude-mcp-prediction/session-orchestrator.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-prediction/types.d.ts +84 -0
- package/dist/harnesses/impls/claude-mcp-prediction/types.js +6 -0
- package/dist/harnesses/impls/claude-mcp-prediction/types.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-prediction-apy/index.d.ts +36 -0
- package/dist/harnesses/impls/claude-mcp-prediction-apy/index.js +241 -0
- package/dist/harnesses/impls/claude-mcp-prediction-apy/index.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-prediction-apy/mcp-tools.js +136 -0
- package/dist/harnesses/impls/claude-mcp-prediction-apy/mcp-tools.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-prediction-apy/prompt.d.ts +7 -0
- package/dist/harnesses/impls/claude-mcp-prediction-apy/prompt.js +46 -0
- package/dist/harnesses/impls/claude-mcp-prediction-apy/prompt.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-prediction-apy/session-orchestrator.d.ts +37 -0
- package/dist/harnesses/impls/claude-mcp-prediction-apy/session-orchestrator.js +19 -0
- package/dist/harnesses/impls/claude-mcp-prediction-apy/session-orchestrator.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-prediction-apy/types.d.ts +64 -0
- package/dist/harnesses/impls/claude-mcp-prediction-apy/types.js +6 -0
- package/dist/harnesses/impls/claude-mcp-prediction-apy/types.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-shared/single-session-orchestrator.d.ts +84 -0
- package/dist/harnesses/impls/claude-mcp-shared/single-session-orchestrator.js +206 -0
- package/dist/harnesses/impls/claude-mcp-shared/single-session-orchestrator.js.map +1 -0
- package/dist/harnesses/impls/evaluation-context.d.ts +23 -0
- package/dist/harnesses/impls/evaluation-context.js +25 -0
- package/dist/harnesses/impls/evaluation-context.js.map +1 -0
- package/dist/harnesses/impls/index.d.ts +74 -0
- package/dist/harnesses/impls/index.js +112 -0
- package/dist/harnesses/impls/index.js.map +1 -0
- package/dist/harnesses/impls/legacy-claude/index.d.ts +66 -0
- package/dist/harnesses/impls/legacy-claude/index.js +168 -0
- package/dist/harnesses/impls/legacy-claude/index.js.map +1 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/canonical-metrics.d.ts +68 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/canonical-metrics.js +117 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/canonical-metrics.js.map +1 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/checks/availability.js.map +1 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/checks/consistency.d.ts +78 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/checks/consistency.js +274 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/checks/consistency.js.map +1 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/checks/eligibility.d.ts +23 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/checks/eligibility.js +49 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/checks/eligibility.js.map +1 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/checks/integrity.d.ts +25 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/checks/integrity.js +44 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/checks/integrity.js.map +1 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/checks/spec.d.ts +17 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/checks/spec.js +43 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/checks/spec.js.map +1 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/index.d.ts +44 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/index.js +569 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/index.js.map +1 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/score.js.map +1 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/types.d.ts +34 -0
- package/dist/harnesses/impls/portfolio-v0-evaluator/types.js.map +1 -0
- package/dist/harnesses/impls/prediction-apy-v0-baseline/index.d.ts +42 -0
- package/dist/harnesses/impls/prediction-apy-v0-baseline/index.js +114 -0
- package/dist/harnesses/impls/prediction-apy-v0-baseline/index.js.map +1 -0
- package/dist/harnesses/impls/prediction-apy-v0-baseline/strategy.js.map +1 -0
- package/dist/harnesses/impls/prediction-apy-v0-baseline/types.js.map +1 -0
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/canonical-metrics.d.ts +6 -0
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/canonical-metrics.js +11 -0
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/canonical-metrics.js.map +1 -0
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/index.d.ts +42 -0
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/index.js +346 -0
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/index.js.map +1 -0
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/parse-submission.d.ts +16 -0
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/parse-submission.js +22 -0
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/parse-submission.js.map +1 -0
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/score.js.map +1 -0
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/types.js.map +1 -0
- package/dist/harnesses/impls/prediction-v0-baseline/index.d.ts +33 -0
- package/dist/harnesses/impls/prediction-v0-baseline/index.js +109 -0
- package/dist/harnesses/impls/prediction-v0-baseline/index.js.map +1 -0
- package/dist/harnesses/impls/prediction-v0-baseline/strategy.d.ts +8 -0
- package/dist/harnesses/impls/prediction-v0-baseline/strategy.js +41 -0
- package/dist/harnesses/impls/prediction-v0-baseline/strategy.js.map +1 -0
- package/dist/harnesses/impls/prediction-v0-baseline/types.d.ts +7 -0
- package/dist/harnesses/impls/prediction-v0-baseline/types.js.map +1 -0
- package/dist/harnesses/impls/prediction-v0-evaluator/canonical-metrics.d.ts +20 -0
- package/dist/harnesses/impls/prediction-v0-evaluator/canonical-metrics.js.map +1 -0
- package/dist/harnesses/impls/prediction-v0-evaluator/checks/availability.d.ts +9 -0
- package/dist/harnesses/impls/prediction-v0-evaluator/checks/availability.js.map +1 -0
- package/dist/harnesses/impls/prediction-v0-evaluator/checks/eligibility.d.ts +3 -0
- package/dist/harnesses/impls/prediction-v0-evaluator/checks/eligibility.js.map +1 -0
- package/dist/harnesses/impls/prediction-v0-evaluator/checks/integrity.d.ts +15 -0
- package/dist/harnesses/impls/prediction-v0-evaluator/checks/integrity.js +111 -0
- package/dist/harnesses/impls/prediction-v0-evaluator/checks/integrity.js.map +1 -0
- package/dist/harnesses/impls/prediction-v0-evaluator/checks/spec.d.ts +5 -0
- package/dist/harnesses/impls/prediction-v0-evaluator/checks/spec.js.map +1 -0
- package/dist/harnesses/impls/prediction-v0-evaluator/index.d.ts +36 -0
- package/dist/harnesses/impls/prediction-v0-evaluator/index.js +342 -0
- package/dist/harnesses/impls/prediction-v0-evaluator/index.js.map +1 -0
- package/dist/harnesses/impls/prediction-v0-evaluator/score.js.map +1 -0
- package/dist/harnesses/impls/prediction-v0-evaluator/types.js +2 -0
- package/dist/harnesses/impls/prediction-v0-evaluator/types.js.map +1 -0
- package/dist/harnesses/impls/prediction-v1-baseline/index.d.ts +31 -0
- package/dist/harnesses/impls/prediction-v1-baseline/index.js +79 -0
- package/dist/harnesses/impls/prediction-v1-baseline/index.js.map +1 -0
- package/dist/harnesses/impls/prediction-v1-evaluator/index.d.ts +32 -0
- package/dist/harnesses/impls/prediction-v1-evaluator/index.js +219 -0
- package/dist/harnesses/impls/prediction-v1-evaluator/index.js.map +1 -0
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/eval-runner.d.ts +20 -0
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/eval-runner.js +88 -0
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/eval-runner.js.map +1 -0
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/index.d.ts +56 -0
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/index.js +40 -0
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/index.js.map +1 -0
- package/dist/harnesses/manifest/index.d.ts +3 -0
- package/dist/harnesses/manifest/index.js +3 -0
- package/dist/harnesses/manifest/index.js.map +1 -0
- package/dist/harnesses/manifest/load.d.ts +7 -0
- package/dist/harnesses/manifest/load.js +49 -0
- package/dist/harnesses/manifest/load.js.map +1 -0
- package/dist/harnesses/manifest/types.d.ts +75 -0
- package/dist/harnesses/manifest/types.js +8 -0
- package/dist/harnesses/manifest/types.js.map +1 -0
- package/dist/harnesses/manifest/verify.d.ts +15 -0
- package/dist/harnesses/manifest/verify.js +53 -0
- package/dist/harnesses/manifest/verify.js.map +1 -0
- package/dist/harnesses/mode-state.d.ts +7 -0
- package/dist/harnesses/mode-state.js +43 -0
- package/dist/harnesses/mode-state.js.map +1 -0
- package/dist/harnesses/types.d.ts +274 -0
- package/dist/harnesses/types.js +28 -0
- package/dist/harnesses/types.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/main.d.ts +17 -2
- package/dist/main.js +1257 -127
- package/dist/main.js.map +1 -1
- package/dist/mcp/acquire-artifact.d.ts +39 -0
- package/dist/mcp/acquire-artifact.js +163 -0
- package/dist/mcp/acquire-artifact.js.map +1 -0
- package/dist/mcp/operator-server.d.ts +21 -4
- package/dist/mcp/operator-server.js +505 -30
- package/dist/mcp/operator-server.js.map +1 -1
- package/dist/mcp/search-records.d.ts +92 -0
- package/dist/mcp/search-records.js +393 -0
- package/dist/mcp/search-records.js.map +1 -0
- package/dist/mcp/server.d.ts +4 -4
- package/dist/mcp/server.js +148 -61
- package/dist/mcp/server.js.map +1 -1
- package/dist/observability/emit-event.d.ts +2 -2
- package/dist/observability/emit-event.js +2 -2
- package/dist/observability/emit-event.js.map +1 -1
- package/dist/operator-errors.d.ts +14 -0
- package/dist/operator-errors.js +39 -10
- package/dist/operator-errors.js.map +1 -1
- package/dist/plugins/digest.d.ts +1 -0
- package/dist/plugins/digest.js +28 -0
- package/dist/plugins/digest.js.map +1 -0
- package/dist/plugins/index.d.ts +6 -0
- package/dist/plugins/index.js +6 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/manifest.d.ts +7 -0
- package/dist/plugins/manifest.js +22 -0
- package/dist/plugins/manifest.js.map +1 -0
- package/dist/plugins/registry.d.ts +9 -0
- package/dist/plugins/registry.js +24 -0
- package/dist/plugins/registry.js.map +1 -0
- package/dist/plugins/resolvers.d.ts +2 -0
- package/dist/plugins/resolvers.js +126 -0
- package/dist/plugins/resolvers.js.map +1 -0
- package/dist/plugins/types.d.ts +35 -0
- package/dist/plugins/types.js +2 -0
- package/dist/plugins/types.js.map +1 -0
- package/dist/plugins/validator.d.ts +3 -0
- package/dist/plugins/validator.js +50 -0
- package/dist/plugins/validator.js.map +1 -0
- package/dist/preflight/claude-auth.d.ts +14 -12
- package/dist/preflight/claude-auth.js +23 -37
- package/dist/preflight/claude-auth.js.map +1 -1
- package/dist/runner/claude.d.ts +3 -3
- package/dist/runner/claude.js +62 -26
- package/dist/runner/claude.js.map +1 -1
- package/dist/runner/runner.d.ts +29 -2
- package/dist/runner/simple.d.ts +2 -2
- package/dist/runner/simple.js +2 -2
- package/dist/runner/simple.js.map +1 -1
- package/dist/scripts/fix-node-pty.mjs +62 -0
- package/dist/setup/claude-code-install.d.ts +19 -0
- package/dist/setup/claude-code-install.js +51 -0
- package/dist/setup/claude-code-install.js.map +1 -0
- package/dist/setup-mode.d.ts +34 -0
- package/dist/setup-mode.js +49 -0
- package/dist/setup-mode.js.map +1 -0
- package/dist/solver-nets/contracts.d.ts +2 -0
- package/dist/solver-nets/contracts.js +2 -0
- package/dist/solver-nets/contracts.js.map +1 -0
- package/dist/solver-nets/prediction-operator-ux.d.ts +112 -0
- package/dist/solver-nets/prediction-operator-ux.js +456 -0
- package/dist/solver-nets/prediction-operator-ux.js.map +1 -0
- package/dist/solver-nets/registry.d.ts +50 -0
- package/dist/solver-nets/registry.js +150 -0
- package/dist/solver-nets/registry.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-aggregate.d.ts +31 -0
- package/dist/solver-types/_swe-rebench-v2-aggregate.js +49 -0
- package/dist/solver-types/_swe-rebench-v2-aggregate.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-escrow.d.ts +27 -0
- package/dist/solver-types/_swe-rebench-v2-escrow.js +26 -0
- package/dist/solver-types/_swe-rebench-v2-escrow.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-pool.d.ts +39 -0
- package/dist/solver-types/_swe-rebench-v2-pool.js +66 -0
- package/dist/solver-types/_swe-rebench-v2-pool.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-state.d.ts +24 -0
- package/dist/solver-types/_swe-rebench-v2-state.js +54 -0
- package/dist/solver-types/_swe-rebench-v2-state.js.map +1 -0
- package/dist/solver-types/constants.d.ts +5 -0
- package/dist/solver-types/constants.js +6 -0
- package/dist/solver-types/constants.js.map +1 -0
- package/dist/solver-types/index.d.ts +10 -0
- package/dist/solver-types/index.js +30 -0
- package/dist/solver-types/index.js.map +1 -0
- package/dist/solver-types/learner-loop-test.d.ts +2 -0
- package/dist/solver-types/learner-loop-test.js +39 -0
- package/dist/solver-types/learner-loop-test.js.map +1 -0
- package/dist/solver-types/portfolio-v0.d.ts +2 -0
- package/dist/solver-types/portfolio-v0.js +13 -0
- package/dist/solver-types/portfolio-v0.js.map +1 -0
- package/dist/solver-types/prediction-apy-v0-auto.d.ts +27 -0
- package/dist/solver-types/prediction-apy-v0-auto.js +109 -0
- package/dist/solver-types/prediction-apy-v0-auto.js.map +1 -0
- package/dist/solver-types/prediction-apy-v0-template.d.ts +8 -0
- package/dist/solver-types/prediction-apy-v0-template.js +22 -0
- package/dist/solver-types/prediction-apy-v0-template.js.map +1 -0
- package/dist/solver-types/prediction-apy-v0.d.ts +3 -0
- package/dist/solver-types/prediction-apy-v0.js +25 -0
- package/dist/solver-types/prediction-apy-v0.js.map +1 -0
- package/dist/solver-types/prediction-v0-auto.d.ts +69 -0
- package/dist/solver-types/prediction-v0-auto.js +146 -0
- package/dist/solver-types/prediction-v0-auto.js.map +1 -0
- package/dist/solver-types/prediction-v0-template.d.ts +70 -0
- package/dist/solver-types/prediction-v0-template.js +145 -0
- package/dist/solver-types/prediction-v0-template.js.map +1 -0
- package/dist/solver-types/prediction-v0.d.ts +13 -0
- package/dist/solver-types/prediction-v0.js +31 -0
- package/dist/solver-types/prediction-v0.js.map +1 -0
- package/dist/solver-types/prediction-v1-auto.d.ts +122 -0
- package/dist/solver-types/prediction-v1-auto.js +366 -0
- package/dist/solver-types/prediction-v1-auto.js.map +1 -0
- package/dist/solver-types/prediction-v1.d.ts +11 -0
- package/dist/solver-types/prediction-v1.js +27 -0
- package/dist/solver-types/prediction-v1.js.map +1 -0
- package/dist/solver-types/solver-type.d.ts +53 -0
- package/dist/solver-types/solver-type.js +6 -0
- package/dist/solver-types/solver-type.js.map +1 -0
- package/dist/solver-types/swe-rebench-v2-auto.d.ts +38 -0
- package/dist/solver-types/swe-rebench-v2-auto.js +56 -0
- package/dist/solver-types/swe-rebench-v2-auto.js.map +1 -0
- package/dist/solver-types/swe-rebench-v2.d.ts +24 -0
- package/dist/solver-types/swe-rebench-v2.js +146 -0
- package/dist/solver-types/swe-rebench-v2.js.map +1 -0
- package/dist/solvernets/daemon-init.d.ts +291 -0
- package/dist/solvernets/daemon-init.js +431 -0
- package/dist/solvernets/daemon-init.js.map +1 -0
- package/dist/solvernets/launch-state-machine.d.ts +165 -0
- package/dist/solvernets/launch-state-machine.js +406 -0
- package/dist/solvernets/launch-state-machine.js.map +1 -0
- package/dist/solvernets/lifecycle-transitions.d.ts +183 -0
- package/dist/solvernets/lifecycle-transitions.js +386 -0
- package/dist/solvernets/lifecycle-transitions.js.map +1 -0
- package/dist/solvernets/manifest.d.ts +120 -0
- package/dist/solvernets/manifest.js +166 -0
- package/dist/solvernets/manifest.js.map +1 -0
- package/dist/solvernets/most-recent-wins.d.ts +77 -0
- package/dist/solvernets/most-recent-wins.js +82 -0
- package/dist/solvernets/most-recent-wins.js.map +1 -0
- package/dist/solvernets/registry-client-erc8004.d.ts +239 -0
- package/dist/solvernets/registry-client-erc8004.js +382 -0
- package/dist/solvernets/registry-client-erc8004.js.map +1 -0
- package/dist/solvernets/registry-client.d.ts +121 -0
- package/dist/solvernets/registry-client.js +19 -0
- package/dist/solvernets/registry-client.js.map +1 -0
- package/dist/solvernets/store.d.ts +298 -0
- package/dist/solvernets/store.js +271 -0
- package/dist/solvernets/store.js.map +1 -0
- package/dist/store/store.d.ts +175 -21
- package/dist/store/store.js +711 -46
- package/dist/store/store.js.map +1 -1
- package/dist/tasks/posting-service.d.ts +25 -0
- package/dist/tasks/posting-service.js +149 -0
- package/dist/tasks/posting-service.js.map +1 -0
- package/dist/tasks/signing.d.ts +4 -0
- package/dist/tasks/signing.js +18 -0
- package/dist/tasks/signing.js.map +1 -0
- package/dist/tasks/sources.d.ts +46 -0
- package/dist/tasks/sources.js +45 -0
- package/dist/tasks/sources.js.map +1 -0
- package/dist/templates/harnesses/alternative-harness/README.md.tmpl +44 -0
- package/dist/templates/harnesses/alternative-harness/gitignore.tmpl +3 -0
- package/dist/templates/harnesses/alternative-harness/jinn.manifest.json.tmpl +22 -0
- package/dist/templates/harnesses/alternative-harness/package.json.tmpl +26 -0
- package/dist/templates/harnesses/alternative-harness/src/coordinator.ts.tmpl +50 -0
- package/dist/templates/harnesses/alternative-harness/src/harness.ts.tmpl +31 -0
- package/dist/templates/harnesses/alternative-harness/src/index.ts.tmpl +44 -0
- package/dist/templates/harnesses/alternative-harness/src/mock-harness.ts.tmpl +41 -0
- package/dist/templates/harnesses/alternative-harness/src/phases/debrief.ts.tmpl +28 -0
- package/dist/templates/harnesses/alternative-harness/src/phases/execute.ts.tmpl +33 -0
- package/dist/templates/harnesses/alternative-harness/src/phases/improve.ts.tmpl +31 -0
- package/dist/templates/harnesses/alternative-harness/src/phases/memory.ts.tmpl +31 -0
- package/dist/templates/harnesses/alternative-harness/src/phases/orient.ts.tmpl +21 -0
- package/dist/templates/harnesses/alternative-harness/src/phases/plan.ts.tmpl +25 -0
- package/dist/templates/harnesses/alternative-harness/src/phases/strategize.ts.tmpl +29 -0
- package/dist/templates/harnesses/alternative-harness/test/coordinator.test.ts.tmpl +53 -0
- package/dist/templates/harnesses/alternative-harness/test/unit.test.ts.tmpl +55 -0
- package/dist/templates/harnesses/alternative-harness/tsconfig.json.tmpl +16 -0
- package/dist/templates/harnesses/evaluator/README.md.tmpl +36 -0
- package/dist/templates/harnesses/evaluator/gitignore.tmpl +3 -0
- package/dist/templates/harnesses/evaluator/jinn.manifest.json.tmpl +22 -0
- package/dist/templates/harnesses/evaluator/package.json.tmpl +26 -0
- package/dist/templates/harnesses/evaluator/src/index.ts.tmpl +35 -0
- package/dist/templates/harnesses/evaluator/test/unit.test.ts.tmpl +49 -0
- package/dist/templates/harnesses/evaluator/tsconfig.json.tmpl +16 -0
- package/dist/templates/harnesses/forecaster/README.md.tmpl +25 -0
- package/dist/templates/harnesses/forecaster/gitignore.tmpl +5 -0
- package/dist/templates/harnesses/forecaster/jinn.manifest.json.tmpl +22 -0
- package/dist/templates/harnesses/forecaster/package.json.tmpl +26 -0
- package/dist/templates/harnesses/forecaster/src/index.ts.tmpl +33 -0
- package/dist/templates/harnesses/forecaster/test/unit.test.ts.tmpl +42 -0
- package/dist/templates/harnesses/forecaster/tsconfig.json.tmpl +16 -0
- package/dist/trajectory/collector.d.ts +49 -0
- package/dist/trajectory/collector.js +86 -0
- package/dist/trajectory/collector.js.map +1 -0
- package/dist/trajectory/emit.d.ts +27 -0
- package/dist/trajectory/emit.js +40 -0
- package/dist/trajectory/emit.js.map +1 -0
- package/dist/trajectory/hash-chain.d.ts +18 -0
- package/dist/trajectory/hash-chain.js +23 -0
- package/dist/trajectory/hash-chain.js.map +1 -0
- package/dist/trajectory/index.d.ts +22 -0
- package/dist/trajectory/index.js +23 -0
- package/dist/trajectory/index.js.map +1 -0
- package/dist/trajectory/schema.d.ts +14 -14
- package/dist/trajectory/secret-scrub.d.ts +32 -0
- package/dist/trajectory/secret-scrub.js +51 -0
- package/dist/trajectory/secret-scrub.js.map +1 -0
- package/dist/trajectory/span-profile.d.ts +27 -0
- package/dist/trajectory/span-profile.js +51 -0
- package/dist/trajectory/span-profile.js.map +1 -0
- package/dist/trajectory/wrappers/http.d.ts +37 -0
- package/dist/trajectory/wrappers/http.js +85 -0
- package/dist/trajectory/wrappers/http.js.map +1 -0
- package/dist/trajectory/wrappers/mcp.d.ts +17 -0
- package/dist/trajectory/wrappers/mcp.js +58 -0
- package/dist/trajectory/wrappers/mcp.js.map +1 -0
- package/dist/trajectory/wrappers/subprocess.d.ts +32 -0
- package/dist/trajectory/wrappers/subprocess.js +70 -0
- package/dist/trajectory/wrappers/subprocess.js.map +1 -0
- package/dist/tx-retry.js +34 -9
- package/dist/tx-retry.js.map +1 -1
- package/dist/types/envelope.d.ts +1659 -0
- package/dist/types/envelope.js +133 -0
- package/dist/types/envelope.js.map +1 -0
- package/dist/types/index.d.ts +4 -4
- package/dist/types/index.js +4 -4
- package/dist/types/index.js.map +1 -1
- package/dist/types/payloads/index.d.ts +12 -0
- package/dist/types/payloads/index.js +60 -0
- package/dist/types/payloads/index.js.map +1 -0
- package/dist/types/payloads/portfolio-v0.d.ts +481 -0
- package/dist/types/payloads/portfolio-v0.js +94 -0
- package/dist/types/payloads/portfolio-v0.js.map +1 -0
- package/dist/types/payloads/prediction-apy-v0.d.ts +231 -0
- package/dist/types/payloads/prediction-apy-v0.js +63 -0
- package/dist/types/payloads/prediction-apy-v0.js.map +1 -0
- package/dist/types/payloads/prediction-v0.d.ts +262 -0
- package/dist/types/payloads/prediction-v0.js +73 -0
- package/dist/types/payloads/prediction-v0.js.map +1 -0
- package/dist/types/payloads/prediction-v1.d.ts +2 -0
- package/dist/types/payloads/prediction-v1.js +2 -0
- package/dist/types/payloads/prediction-v1.js.map +1 -0
- package/dist/types/portfolio.d.ts +31 -698
- package/dist/types/portfolio.js +20 -110
- package/dist/types/portfolio.js.map +1 -1
- package/dist/types/prediction-apy.d.ts +26 -366
- package/dist/types/prediction-apy.js +12 -68
- package/dist/types/prediction-apy.js.map +1 -1
- package/dist/types/prediction-v1.d.ts +2 -0
- package/dist/types/prediction-v1.js +2 -0
- package/dist/types/prediction-v1.js.map +1 -0
- package/dist/types/prediction.d.ts +546 -382
- package/dist/types/prediction.js +16 -87
- package/dist/types/prediction.js.map +1 -1
- package/dist/types/task-document.d.ts +1121 -0
- package/dist/types/task-document.js +99 -0
- package/dist/types/task-document.js.map +1 -0
- package/dist/types/task.d.ts +805 -0
- package/dist/types/task.js +88 -0
- package/dist/types/task.js.map +1 -0
- package/dist/types/window.d.ts +12 -0
- package/dist/types/window.js +6 -0
- package/dist/types/window.js.map +1 -0
- package/dist/util/path-safety.d.ts +21 -0
- package/dist/util/path-safety.js +28 -0
- package/dist/util/path-safety.js.map +1 -0
- package/dist/util/redact-rpc-urls.d.ts +5 -0
- package/dist/util/redact-rpc-urls.js +9 -0
- package/dist/util/redact-rpc-urls.js.map +1 -0
- package/dist/vendor/@jinn-network/sdk/README.md +89 -0
- package/dist/vendor/@jinn-network/sdk/dist/capabilities.d.ts +52 -0
- package/dist/vendor/@jinn-network/sdk/dist/capabilities.js +1 -0
- package/dist/vendor/@jinn-network/sdk/dist/checkpoint.d.ts +120 -0
- package/dist/vendor/@jinn-network/sdk/dist/checkpoint.js +39 -0
- package/dist/vendor/@jinn-network/sdk/dist/contracts.d.ts +144 -0
- package/dist/vendor/@jinn-network/sdk/dist/contracts.js +248 -0
- package/dist/vendor/@jinn-network/sdk/dist/harness.d.ts +120 -0
- package/dist/vendor/@jinn-network/sdk/dist/harness.js +31 -0
- package/dist/vendor/@jinn-network/sdk/dist/index.d.ts +2 -0
- package/dist/vendor/@jinn-network/sdk/dist/index.js +5 -0
- package/dist/vendor/@jinn-network/sdk/dist/json-schema.d.ts +32 -0
- package/dist/vendor/@jinn-network/sdk/dist/json-schema.js +131 -0
- package/dist/vendor/@jinn-network/sdk/dist/manifest.d.ts +69 -0
- package/dist/vendor/@jinn-network/sdk/dist/manifest.js +3 -0
- package/dist/vendor/@jinn-network/sdk/dist/payloads/prediction-v1.d.ts +223 -0
- package/dist/vendor/@jinn-network/sdk/dist/payloads/prediction-v1.js +64 -0
- package/dist/vendor/@jinn-network/sdk/dist/payloads/swe-rebench-v2.d.ts +107 -0
- package/dist/vendor/@jinn-network/sdk/dist/payloads/swe-rebench-v2.js +51 -0
- package/dist/vendor/@jinn-network/sdk/dist/plugins.d.ts +36 -0
- package/dist/vendor/@jinn-network/sdk/dist/plugins.js +54 -0
- package/dist/vendor/@jinn-network/sdk/dist/prediction-v1.d.ts +870 -0
- package/dist/vendor/@jinn-network/sdk/dist/prediction-v1.js +80 -0
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/index.d.ts +6 -0
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/index.js +8 -0
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/manifest-schema.d.ts +559 -0
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/manifest-schema.js +126 -0
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/prediction-v1.d.ts +6 -0
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/prediction-v1.js +3 -0
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/swe-rebench-v2.d.ts +4 -0
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/swe-rebench-v2.js +2 -0
- package/dist/vendor/@jinn-network/sdk/dist/swe-rebench-v2.d.ts +66 -0
- package/dist/vendor/@jinn-network/sdk/dist/swe-rebench-v2.js +44 -0
- package/dist/vendor/@jinn-network/sdk/dist/types.d.ts +116 -0
- package/dist/vendor/@jinn-network/sdk/dist/types.js +21 -0
- package/dist/vendor/@jinn-network/sdk/package.json +43 -0
- package/dist/venues/hyperliquid/account-value.d.ts +1 -1
- package/dist/venues/hyperliquid/account-value.js +1 -1
- package/dist/venues/polymarket/client.d.ts +77 -0
- package/dist/venues/polymarket/client.js +309 -0
- package/dist/venues/polymarket/client.js.map +1 -0
- package/dist/withdraw/run-withdraw-plan.js +0 -2
- package/dist/withdraw/run-withdraw-plan.js.map +1 -1
- package/dist/x402/acquire.d.ts +14 -3
- package/dist/x402/acquire.js +28 -11
- package/dist/x402/acquire.js.map +1 -1
- package/dist/x402/handler.d.ts +15 -3
- package/dist/x402/handler.js +67 -24
- package/dist/x402/handler.js.map +1 -1
- package/package.json +46 -15
- package/plugins/claude-code-learner/.claude-plugin/plugin.json +9 -0
- package/plugins/claude-code-learner/AGENTS.md +31 -0
- package/plugins/claude-code-learner/CLAUDE.md +33 -0
- package/plugins/claude-code-learner/README.md +57 -0
- package/plugins/claude-code-learner/hooks/hooks.json +16 -0
- package/plugins/claude-code-learner/hooks/session-start +38 -0
- package/plugins/claude-code-learner/skills/learn/SKILL.md +405 -0
- package/plugins/claude-code-learner/skills/learn/analyst-prompt.md +68 -0
- package/plugins/claude-code-learner/skills/learn/consolidator-prompt.md +94 -0
- package/plugins/claude-code-learner/skills/learn/explorer-prompt.md +53 -0
- package/plugins/claude-code-learner/skills/learn/planner-prompt.md +87 -0
- package/plugins/claude-code-learner/skills/learn/promoter-prompt.md +113 -0
- package/plugins/claude-code-learner/skills/learn/step-worker-prompt.md +47 -0
- package/plugins/claude-code-learner/skills/learn/strategist-prompt.md +85 -0
- package/plugins/jinn-prediction-plugin/.claude-plugin/plugin.json +19 -0
- package/plugins/jinn-prediction-plugin/.mcp.json +8 -0
- package/plugins/jinn-prediction-plugin/GEMINI.md +7 -0
- package/plugins/jinn-prediction-plugin/gemini-extension.json +13 -0
- package/plugins/jinn-prediction-plugin/jinn.plugin.json +26 -0
- package/plugins/jinn-prediction-plugin/mcp/polymarket-server.mjs +322 -0
- package/plugins/jinn-prediction-plugin/schemas/prediction-v0-solution.schema.json +12 -0
- package/plugins/jinn-prediction-plugin/schemas/prediction-v0-task.schema.json +25 -0
- package/plugins/jinn-prediction-plugin/schemas/prediction-v0-verdict.schema.json +11 -0
- package/plugins/jinn-prediction-plugin/schemas/prediction-v1-solution.schema.json +34 -0
- package/plugins/jinn-prediction-plugin/schemas/prediction-v1-task.schema.json +118 -0
- package/plugins/jinn-prediction-plugin/schemas/prediction-v1-verdict.schema.json +84 -0
- package/plugins/jinn-prediction-plugin/skills/base-rate-forecasting/SKILL.md +3 -0
- package/plugins/jinn-prediction-plugin/skills/calibration/SKILL.md +3 -0
- package/plugins/jinn-prediction-plugin/skills/common-biases/SKILL.md +3 -0
- package/plugins/jinn-prediction-plugin/skills/polymarket-task-handling/SKILL.md +5 -0
- package/plugins/jinn-prediction-plugin/skills/prediction-corpus-retrieval/SKILL.md +35 -0
- package/plugins/network-tools/.claude-plugin/plugin.json +12 -0
- package/plugins/network-tools/jinn.plugin.json +29 -0
- package/plugins/network-tools/mcp/jinn-client-server.mjs +110 -0
- package/plugins/swe-rebench-v2-runtime/.claude-plugin/plugin.json +9 -0
- package/plugins/swe-rebench-v2-runtime/README.md +11 -0
- package/plugins/swe-rebench-v2-runtime/jinn.plugin.json +12 -0
- package/plugins/swe-rebench-v2-runtime/skills/orient/SKILL.md +25 -0
- package/plugins/swe-rebench-v2-runtime/skills/plan/SKILL.md +24 -0
- package/skills/jinn-operator/SKILL.md +120 -101
- package/templates/harnesses/alternative-harness/README.md.tmpl +44 -0
- package/templates/harnesses/alternative-harness/gitignore.tmpl +3 -0
- package/templates/harnesses/alternative-harness/jinn.manifest.json.tmpl +22 -0
- package/templates/harnesses/alternative-harness/package.json.tmpl +26 -0
- package/templates/harnesses/alternative-harness/src/coordinator.ts.tmpl +50 -0
- package/templates/harnesses/alternative-harness/src/harness.ts.tmpl +31 -0
- package/templates/harnesses/alternative-harness/src/index.ts.tmpl +44 -0
- package/templates/harnesses/alternative-harness/src/mock-harness.ts.tmpl +41 -0
- package/templates/harnesses/alternative-harness/src/phases/debrief.ts.tmpl +28 -0
- package/templates/harnesses/alternative-harness/src/phases/execute.ts.tmpl +33 -0
- package/templates/harnesses/alternative-harness/src/phases/improve.ts.tmpl +31 -0
- package/templates/harnesses/alternative-harness/src/phases/memory.ts.tmpl +31 -0
- package/templates/harnesses/alternative-harness/src/phases/orient.ts.tmpl +21 -0
- package/templates/harnesses/alternative-harness/src/phases/plan.ts.tmpl +25 -0
- package/templates/harnesses/alternative-harness/src/phases/strategize.ts.tmpl +29 -0
- package/templates/harnesses/alternative-harness/test/coordinator.test.ts.tmpl +53 -0
- package/templates/harnesses/alternative-harness/test/unit.test.ts.tmpl +55 -0
- package/templates/harnesses/alternative-harness/tsconfig.json.tmpl +16 -0
- package/templates/harnesses/evaluator/README.md.tmpl +36 -0
- package/templates/harnesses/evaluator/gitignore.tmpl +3 -0
- package/templates/harnesses/evaluator/jinn.manifest.json.tmpl +22 -0
- package/templates/harnesses/evaluator/package.json.tmpl +26 -0
- package/templates/harnesses/evaluator/src/index.ts.tmpl +35 -0
- package/templates/harnesses/evaluator/test/unit.test.ts.tmpl +49 -0
- package/templates/harnesses/evaluator/tsconfig.json.tmpl +16 -0
- package/templates/harnesses/forecaster/README.md.tmpl +25 -0
- package/templates/harnesses/forecaster/gitignore.tmpl +5 -0
- package/templates/harnesses/forecaster/jinn.manifest.json.tmpl +22 -0
- package/templates/harnesses/forecaster/package.json.tmpl +26 -0
- package/templates/harnesses/forecaster/src/index.ts.tmpl +33 -0
- package/templates/harnesses/forecaster/test/unit.test.ts.tmpl +42 -0
- package/templates/harnesses/forecaster/tsconfig.json.tmpl +16 -0
- package/dist/adapters/claim-registry/abi.d.ts +0 -127
- package/dist/adapters/claim-registry/abi.js +0 -93
- package/dist/adapters/claim-registry/abi.js.map +0 -1
- package/dist/adapters/claim-registry/client.d.ts +0 -89
- package/dist/adapters/claim-registry/client.js +0 -205
- package/dist/adapters/claim-registry/client.js.map +0 -1
- package/dist/adapters/mech/claim-policy.d.ts +0 -40
- package/dist/adapters/mech/claim-policy.js +0 -104
- package/dist/adapters/mech/claim-policy.js.map +0 -1
- package/dist/bin/jinn-mcp.d.ts +0 -2
- package/dist/bin/jinn-mcp.js +0 -10
- package/dist/bin/jinn-mcp.js.map +0 -1
- package/dist/cli/commands/intents.d.ts +0 -17
- package/dist/cli/commands/intents.js +0 -489
- package/dist/cli/commands/intents.js.map +0 -1
- package/dist/cli/commands/plugin-install.js +0 -803
- package/dist/cli/commands/plugin-install.js.map +0 -1
- package/dist/cli/commands/submit-intent.js +0 -245
- package/dist/cli/commands/submit-intent.js.map +0 -1
- package/dist/cli/intent-registry-access.d.ts +0 -62
- package/dist/cli/intent-registry-access.js +0 -165
- package/dist/cli/intent-registry-access.js.map +0 -1
- package/dist/discovery/registry.d.ts +0 -97
- package/dist/discovery/registry.js +0 -177
- package/dist/discovery/registry.js.map +0 -1
- package/dist/discovery/subgraph.d.ts +0 -37
- package/dist/discovery/subgraph.js +0 -87
- package/dist/discovery/subgraph.js.map +0 -1
- package/dist/intents/kinds/constants.d.ts +0 -5
- package/dist/intents/kinds/constants.js +0 -6
- package/dist/intents/kinds/constants.js.map +0 -1
- package/dist/intents/kinds/index.d.ts +0 -28
- package/dist/intents/kinds/index.js +0 -50
- package/dist/intents/kinds/index.js.map +0 -1
- package/dist/intents/kinds/portfolio-v0.d.ts +0 -2
- package/dist/intents/kinds/portfolio-v0.js +0 -13
- package/dist/intents/kinds/portfolio-v0.js.map +0 -1
- package/dist/intents/kinds/prediction-apy-v0.d.ts +0 -3
- package/dist/intents/kinds/prediction-apy-v0.js +0 -21
- package/dist/intents/kinds/prediction-apy-v0.js.map +0 -1
- package/dist/intents/kinds/prediction-v0.d.ts +0 -3
- package/dist/intents/kinds/prediction-v0.js +0 -32
- package/dist/intents/kinds/prediction-v0.js.map +0 -1
- package/dist/intents/kinds/spec-kind.d.ts +0 -38
- package/dist/intents/kinds/spec-kind.js +0 -6
- package/dist/intents/kinds/spec-kind.js.map +0 -1
- package/dist/intents/posting-service.d.ts +0 -26
- package/dist/intents/posting-service.js +0 -218
- package/dist/intents/posting-service.js.map +0 -1
- package/dist/intents/prediction-apy-v0-auto.d.ts +0 -11
- package/dist/intents/prediction-apy-v0-auto.js +0 -46
- package/dist/intents/prediction-apy-v0-auto.js.map +0 -1
- package/dist/intents/prediction-apy-v0-template.d.ts +0 -8
- package/dist/intents/prediction-apy-v0-template.js +0 -22
- package/dist/intents/prediction-apy-v0-template.js.map +0 -1
- package/dist/intents/prediction-v0-auto.d.ts +0 -53
- package/dist/intents/prediction-v0-auto.js +0 -84
- package/dist/intents/prediction-v0-auto.js.map +0 -1
- package/dist/intents/prediction-v0-template.d.ts +0 -70
- package/dist/intents/prediction-v0-template.js +0 -145
- package/dist/intents/prediction-v0-template.js.map +0 -1
- package/dist/intents/sources.d.ts +0 -39
- package/dist/intents/sources.js +0 -42
- package/dist/intents/sources.js.map +0 -1
- package/dist/restorer/engine/canonical-json.d.ts +0 -18
- package/dist/restorer/engine/canonical-json.js +0 -59
- package/dist/restorer/engine/canonical-json.js.map +0 -1
- package/dist/restorer/engine/claim.d.ts +0 -69
- package/dist/restorer/engine/claim.js +0 -104
- package/dist/restorer/engine/claim.js.map +0 -1
- package/dist/restorer/engine/delivery.d.ts +0 -52
- package/dist/restorer/engine/delivery.js +0 -63
- package/dist/restorer/engine/delivery.js.map +0 -1
- package/dist/restorer/engine/engine.d.ts +0 -213
- package/dist/restorer/engine/engine.js +0 -769
- package/dist/restorer/engine/engine.js.map +0 -1
- package/dist/restorer/engine/manifest-assembly.d.ts +0 -67
- package/dist/restorer/engine/manifest-assembly.js +0 -79
- package/dist/restorer/engine/manifest-assembly.js.map +0 -1
- package/dist/restorer/engine/packaging.d.ts +0 -87
- package/dist/restorer/engine/packaging.js +0 -350
- package/dist/restorer/engine/packaging.js.map +0 -1
- package/dist/restorer/engine/persistence.d.ts +0 -170
- package/dist/restorer/engine/persistence.js +0 -381
- package/dist/restorer/engine/persistence.js.map +0 -1
- package/dist/restorer/engine/recovery.d.ts +0 -22
- package/dist/restorer/engine/recovery.js +0 -24
- package/dist/restorer/engine/recovery.js.map +0 -1
- package/dist/restorer/engine/registry.d.ts +0 -62
- package/dist/restorer/engine/registry.js +0 -73
- package/dist/restorer/engine/registry.js.map +0 -1
- package/dist/restorer/engine/signing.d.ts +0 -30
- package/dist/restorer/engine/signing.js +0 -39
- package/dist/restorer/engine/signing.js.map +0 -1
- package/dist/restorer/engine/state.d.ts +0 -42
- package/dist/restorer/engine/state.js +0 -87
- package/dist/restorer/engine/state.js.map +0 -1
- package/dist/restorer/impls/claude-mcp-hyperliquid/api-wallet.d.ts +0 -64
- package/dist/restorer/impls/claude-mcp-hyperliquid/api-wallet.js.map +0 -1
- package/dist/restorer/impls/claude-mcp-hyperliquid/index.d.ts +0 -104
- package/dist/restorer/impls/claude-mcp-hyperliquid/index.js +0 -721
- package/dist/restorer/impls/claude-mcp-hyperliquid/index.js.map +0 -1
- package/dist/restorer/impls/claude-mcp-hyperliquid/mcp-tools.js.map +0 -1
- package/dist/restorer/impls/claude-mcp-hyperliquid/safety-rails.js.map +0 -1
- package/dist/restorer/impls/claude-mcp-hyperliquid/session-orchestrator.d.ts +0 -97
- package/dist/restorer/impls/claude-mcp-hyperliquid/session-orchestrator.js +0 -226
- package/dist/restorer/impls/claude-mcp-hyperliquid/session-orchestrator.js.map +0 -1
- package/dist/restorer/impls/claude-mcp-prediction/index.d.ts +0 -44
- package/dist/restorer/impls/claude-mcp-prediction/index.js +0 -239
- package/dist/restorer/impls/claude-mcp-prediction/index.js.map +0 -1
- package/dist/restorer/impls/claude-mcp-prediction/mcp-tools.js +0 -135
- package/dist/restorer/impls/claude-mcp-prediction/mcp-tools.js.map +0 -1
- package/dist/restorer/impls/claude-mcp-prediction/prompt.d.ts +0 -8
- package/dist/restorer/impls/claude-mcp-prediction/prompt.js +0 -54
- package/dist/restorer/impls/claude-mcp-prediction/prompt.js.map +0 -1
- package/dist/restorer/impls/claude-mcp-prediction/session-orchestrator.d.ts +0 -36
- package/dist/restorer/impls/claude-mcp-prediction/session-orchestrator.js +0 -137
- package/dist/restorer/impls/claude-mcp-prediction/session-orchestrator.js.map +0 -1
- package/dist/restorer/impls/claude-mcp-prediction/types.d.ts +0 -84
- package/dist/restorer/impls/claude-mcp-prediction/types.js +0 -6
- package/dist/restorer/impls/claude-mcp-prediction/types.js.map +0 -1
- package/dist/restorer/impls/claude-mcp-prediction-apy/index.d.ts +0 -34
- package/dist/restorer/impls/claude-mcp-prediction-apy/index.js +0 -233
- package/dist/restorer/impls/claude-mcp-prediction-apy/index.js.map +0 -1
- package/dist/restorer/impls/claude-mcp-prediction-apy/mcp-tools.js +0 -136
- package/dist/restorer/impls/claude-mcp-prediction-apy/mcp-tools.js.map +0 -1
- package/dist/restorer/impls/claude-mcp-prediction-apy/prompt.d.ts +0 -7
- package/dist/restorer/impls/claude-mcp-prediction-apy/prompt.js +0 -46
- package/dist/restorer/impls/claude-mcp-prediction-apy/prompt.js.map +0 -1
- package/dist/restorer/impls/claude-mcp-prediction-apy/session-orchestrator.d.ts +0 -27
- package/dist/restorer/impls/claude-mcp-prediction-apy/session-orchestrator.js +0 -128
- package/dist/restorer/impls/claude-mcp-prediction-apy/session-orchestrator.js.map +0 -1
- package/dist/restorer/impls/claude-mcp-prediction-apy/types.d.ts +0 -64
- package/dist/restorer/impls/claude-mcp-prediction-apy/types.js +0 -6
- package/dist/restorer/impls/claude-mcp-prediction-apy/types.js.map +0 -1
- package/dist/restorer/impls/evaluation-context.d.ts +0 -16
- package/dist/restorer/impls/evaluation-context.js +0 -18
- package/dist/restorer/impls/evaluation-context.js.map +0 -1
- package/dist/restorer/impls/index.d.ts +0 -46
- package/dist/restorer/impls/index.js +0 -88
- package/dist/restorer/impls/index.js.map +0 -1
- package/dist/restorer/impls/legacy-claude/index.d.ts +0 -52
- package/dist/restorer/impls/legacy-claude/index.js +0 -140
- package/dist/restorer/impls/legacy-claude/index.js.map +0 -1
- package/dist/restorer/impls/portfolio-v0-evaluator/canonical-metrics.d.ts +0 -68
- package/dist/restorer/impls/portfolio-v0-evaluator/canonical-metrics.js +0 -117
- package/dist/restorer/impls/portfolio-v0-evaluator/canonical-metrics.js.map +0 -1
- package/dist/restorer/impls/portfolio-v0-evaluator/checks/availability.js.map +0 -1
- package/dist/restorer/impls/portfolio-v0-evaluator/checks/consistency.d.ts +0 -78
- package/dist/restorer/impls/portfolio-v0-evaluator/checks/consistency.js +0 -274
- package/dist/restorer/impls/portfolio-v0-evaluator/checks/consistency.js.map +0 -1
- package/dist/restorer/impls/portfolio-v0-evaluator/checks/eligibility.d.ts +0 -23
- package/dist/restorer/impls/portfolio-v0-evaluator/checks/eligibility.js +0 -49
- package/dist/restorer/impls/portfolio-v0-evaluator/checks/eligibility.js.map +0 -1
- package/dist/restorer/impls/portfolio-v0-evaluator/checks/integrity.d.ts +0 -25
- package/dist/restorer/impls/portfolio-v0-evaluator/checks/integrity.js +0 -44
- package/dist/restorer/impls/portfolio-v0-evaluator/checks/integrity.js.map +0 -1
- package/dist/restorer/impls/portfolio-v0-evaluator/checks/spec.d.ts +0 -17
- package/dist/restorer/impls/portfolio-v0-evaluator/checks/spec.js +0 -43
- package/dist/restorer/impls/portfolio-v0-evaluator/checks/spec.js.map +0 -1
- package/dist/restorer/impls/portfolio-v0-evaluator/index.d.ts +0 -44
- package/dist/restorer/impls/portfolio-v0-evaluator/index.js +0 -440
- package/dist/restorer/impls/portfolio-v0-evaluator/index.js.map +0 -1
- package/dist/restorer/impls/portfolio-v0-evaluator/score.js.map +0 -1
- package/dist/restorer/impls/portfolio-v0-evaluator/types.d.ts +0 -34
- package/dist/restorer/impls/portfolio-v0-evaluator/types.js.map +0 -1
- package/dist/restorer/impls/prediction-apy-v0-baseline/index.d.ts +0 -40
- package/dist/restorer/impls/prediction-apy-v0-baseline/index.js +0 -107
- package/dist/restorer/impls/prediction-apy-v0-baseline/index.js.map +0 -1
- package/dist/restorer/impls/prediction-apy-v0-baseline/strategy.js.map +0 -1
- package/dist/restorer/impls/prediction-apy-v0-baseline/types.js.map +0 -1
- package/dist/restorer/impls/prediction-apy-v0-evaluator/canonical-metrics.d.ts +0 -6
- package/dist/restorer/impls/prediction-apy-v0-evaluator/canonical-metrics.js +0 -11
- package/dist/restorer/impls/prediction-apy-v0-evaluator/canonical-metrics.js.map +0 -1
- package/dist/restorer/impls/prediction-apy-v0-evaluator/index.d.ts +0 -42
- package/dist/restorer/impls/prediction-apy-v0-evaluator/index.js +0 -208
- package/dist/restorer/impls/prediction-apy-v0-evaluator/index.js.map +0 -1
- package/dist/restorer/impls/prediction-apy-v0-evaluator/parse-submission.d.ts +0 -7
- package/dist/restorer/impls/prediction-apy-v0-evaluator/parse-submission.js +0 -29
- package/dist/restorer/impls/prediction-apy-v0-evaluator/parse-submission.js.map +0 -1
- package/dist/restorer/impls/prediction-apy-v0-evaluator/score.js.map +0 -1
- package/dist/restorer/impls/prediction-apy-v0-evaluator/types.js.map +0 -1
- package/dist/restorer/impls/prediction-v0-baseline/index.d.ts +0 -31
- package/dist/restorer/impls/prediction-v0-baseline/index.js +0 -100
- package/dist/restorer/impls/prediction-v0-baseline/index.js.map +0 -1
- package/dist/restorer/impls/prediction-v0-baseline/strategy.d.ts +0 -8
- package/dist/restorer/impls/prediction-v0-baseline/strategy.js +0 -41
- package/dist/restorer/impls/prediction-v0-baseline/strategy.js.map +0 -1
- package/dist/restorer/impls/prediction-v0-baseline/types.d.ts +0 -7
- package/dist/restorer/impls/prediction-v0-baseline/types.js.map +0 -1
- package/dist/restorer/impls/prediction-v0-evaluator/canonical-metrics.d.ts +0 -20
- package/dist/restorer/impls/prediction-v0-evaluator/canonical-metrics.js.map +0 -1
- package/dist/restorer/impls/prediction-v0-evaluator/checks/availability.d.ts +0 -9
- package/dist/restorer/impls/prediction-v0-evaluator/checks/availability.js.map +0 -1
- package/dist/restorer/impls/prediction-v0-evaluator/checks/eligibility.d.ts +0 -3
- package/dist/restorer/impls/prediction-v0-evaluator/checks/eligibility.js.map +0 -1
- package/dist/restorer/impls/prediction-v0-evaluator/checks/integrity.d.ts +0 -13
- package/dist/restorer/impls/prediction-v0-evaluator/checks/integrity.js +0 -111
- package/dist/restorer/impls/prediction-v0-evaluator/checks/integrity.js.map +0 -1
- package/dist/restorer/impls/prediction-v0-evaluator/checks/spec.d.ts +0 -5
- package/dist/restorer/impls/prediction-v0-evaluator/checks/spec.js.map +0 -1
- package/dist/restorer/impls/prediction-v0-evaluator/index.d.ts +0 -36
- package/dist/restorer/impls/prediction-v0-evaluator/index.js +0 -234
- package/dist/restorer/impls/prediction-v0-evaluator/index.js.map +0 -1
- package/dist/restorer/impls/prediction-v0-evaluator/score.js.map +0 -1
- package/dist/restorer/impls/prediction-v0-evaluator/types.js.map +0 -1
- package/dist/restorer/types.d.ts +0 -194
- package/dist/restorer/types.js +0 -28
- package/dist/restorer/types.js.map +0 -1
- package/dist/types/desired-state.d.ts +0 -94
- package/dist/types/desired-state.js +0 -36
- package/dist/types/desired-state.js.map +0 -1
- /package/dist/cli/commands/{plugin-install.d.ts → solver-nets.d.ts} +0 -0
- /package/dist/cli/commands/{submit-intent.d.ts → tasks.d.ts} +0 -0
- /package/dist/{restorer/impls/prediction-apy-v0-baseline → harnesses/impls/claude-code-learner}/types.js +0 -0
- /package/dist/{restorer → harnesses}/impls/claude-mcp-hyperliquid/api-wallet.js +0 -0
- /package/dist/{restorer → harnesses}/impls/claude-mcp-hyperliquid/mcp-tools.d.ts +0 -0
- /package/dist/{restorer → harnesses}/impls/claude-mcp-hyperliquid/mcp-tools.js +0 -0
- /package/dist/{restorer → harnesses}/impls/claude-mcp-hyperliquid/safety-rails.d.ts +0 -0
- /package/dist/{restorer → harnesses}/impls/claude-mcp-hyperliquid/safety-rails.js +0 -0
- /package/dist/{restorer → harnesses}/impls/claude-mcp-prediction/mcp-tools.d.ts +0 -0
- /package/dist/{restorer → harnesses}/impls/claude-mcp-prediction-apy/mcp-tools.d.ts +0 -0
- /package/dist/{restorer → harnesses}/impls/portfolio-v0-evaluator/checks/availability.d.ts +0 -0
- /package/dist/{restorer → harnesses}/impls/portfolio-v0-evaluator/checks/availability.js +0 -0
- /package/dist/{restorer → harnesses}/impls/portfolio-v0-evaluator/score.d.ts +0 -0
- /package/dist/{restorer → harnesses}/impls/portfolio-v0-evaluator/score.js +0 -0
- /package/dist/{restorer → harnesses}/impls/portfolio-v0-evaluator/types.js +0 -0
- /package/dist/{restorer → harnesses}/impls/prediction-apy-v0-baseline/strategy.d.ts +0 -0
- /package/dist/{restorer → harnesses}/impls/prediction-apy-v0-baseline/strategy.js +0 -0
- /package/dist/{restorer → harnesses}/impls/prediction-apy-v0-baseline/types.d.ts +0 -0
- /package/dist/{restorer/impls/prediction-apy-v0-evaluator → harnesses/impls/prediction-apy-v0-baseline}/types.js +0 -0
- /package/dist/{restorer → harnesses}/impls/prediction-apy-v0-evaluator/score.d.ts +0 -0
- /package/dist/{restorer → harnesses}/impls/prediction-apy-v0-evaluator/score.js +0 -0
- /package/dist/{restorer → harnesses}/impls/prediction-apy-v0-evaluator/types.d.ts +0 -0
- /package/dist/{restorer/impls/prediction-v0-baseline → harnesses/impls/prediction-apy-v0-evaluator}/types.js +0 -0
- /package/dist/{restorer/impls/prediction-v0-evaluator → harnesses/impls/prediction-v0-baseline}/types.js +0 -0
- /package/dist/{restorer → harnesses}/impls/prediction-v0-evaluator/canonical-metrics.js +0 -0
- /package/dist/{restorer → harnesses}/impls/prediction-v0-evaluator/checks/availability.js +0 -0
- /package/dist/{restorer → harnesses}/impls/prediction-v0-evaluator/checks/eligibility.js +0 -0
- /package/dist/{restorer → harnesses}/impls/prediction-v0-evaluator/checks/spec.js +0 -0
- /package/dist/{restorer → harnesses}/impls/prediction-v0-evaluator/score.d.ts +0 -0
- /package/dist/{restorer → harnesses}/impls/prediction-v0-evaluator/score.js +0 -0
- /package/dist/{restorer → harnesses}/impls/prediction-v0-evaluator/types.d.ts +0 -0
|
@@ -5,23 +5,26 @@
|
|
|
5
5
|
* Phase 2 (per-service): derive agent → stake → deploy mech
|
|
6
6
|
*/
|
|
7
7
|
import { decodeEventLog, encodeAbiParameters, encodeFunctionData, formatEther, getAddress, zeroAddress, } from 'viem';
|
|
8
|
-
import { ERC20_ABI, EVENT_TOPICS, SERVICE_MANAGER_ABI, SERVICE_REGISTRY_APPROVE_ABI, SERVICE_REGISTRY_L2_ABI, STAKING_ABI, MECH_MARKETPLACE_CREATE_ABI, STOLAS_DISTRIBUTOR_ABI, STOLAS_STAKING_SLOTS_ABI, cidToBytes32, getChainConfig, } from './contracts.js';
|
|
8
|
+
import { ERC20_ABI, EVENT_TOPICS, 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
|
+
import { bindAgentWalletToSafe } from './agent-wallet-binding.js';
|
|
10
11
|
import { FleetStateStore } from './store.js';
|
|
11
12
|
import { generateMnemonic, encryptMnemonic, decryptMnemonic, deriveMasterAddress, deriveMasterSigner, deriveAgentAddress, deriveAgentSigner, walletPrivateKeyAtIndex, } from './wallet.js';
|
|
12
|
-
import { createDefaultServiceState } from './types.js';
|
|
13
|
+
import { createDefaultServiceState, isOperationalServiceStep } from './types.js';
|
|
13
14
|
import { formatBootstrapOperatorMessage, isJinnDebug, } from '../operator-errors.js';
|
|
14
15
|
import { reconcileServiceAgainstChain, } from './reconcile.js';
|
|
15
16
|
import { previousSafeBeingAbandoned, sweepOrphanedServiceFunds, } from './orphan-sweep.js';
|
|
16
|
-
import { requestTestnetFunding } from './faucet.js';
|
|
17
|
+
import { DEFAULT_FAUCET_LOOP_TIMEOUT_MS, computeFaucetDripCap, requestTestnetFunding, } from './faucet.js';
|
|
17
18
|
import { flattenErrorMessage, viemSendTransactionWithRetry, waitForTransactionReceiptWithRetry, } from '../tx-retry.js';
|
|
18
19
|
import { isUnauthorizedAccountError } from '../errors/unauthorized-account.js';
|
|
19
20
|
import { createJinnPublicClient, createJinnWalletClient } from './viem-clients.js';
|
|
20
21
|
import { isTransientEthReadError } from '../chain-read-errors.js';
|
|
21
22
|
import { nextFleetServiceIndex } from './next-service-index.js';
|
|
22
23
|
import { rpcHostForDisplay } from '../preflight/rpc-network.js';
|
|
24
|
+
import { detectDeprecatedTestnetSetup, migrateDeprecatedTestnetSetup, } from './testnet-setup-migration.js';
|
|
23
25
|
const addr = (value) => getAddress(value);
|
|
24
26
|
const SAFE_TOKEN_BOOTSTRAP_MULTIPLIER = 2n;
|
|
27
|
+
const STANDARD_MASTER_BOOTSTRAP_MULTIPLIER = 2n;
|
|
25
28
|
/** Conservative default: ~0.001 ETH/day master gas if not configured. */
|
|
26
29
|
const DEFAULT_MASTER_ETH_DAILY_WEI = 1000000000000000n;
|
|
27
30
|
/** Warn when ETH above the minimum would last fewer than this many days at the daily estimate. */
|
|
@@ -36,6 +39,10 @@ export class FleetBootstrapper {
|
|
|
36
39
|
debug;
|
|
37
40
|
masterEthDailyEstimateWei;
|
|
38
41
|
env;
|
|
42
|
+
requestFunding;
|
|
43
|
+
faucetLoopTimeoutMs;
|
|
44
|
+
now;
|
|
45
|
+
autoTestnetFaucet;
|
|
39
46
|
constructor(options = {}) {
|
|
40
47
|
this.store = new FleetStateStore(options.earningDir);
|
|
41
48
|
this.chain = options.chain ?? 'base';
|
|
@@ -43,17 +50,24 @@ export class FleetBootstrapper {
|
|
|
43
50
|
this.stakingMode = options.stakingMode ?? 'standard';
|
|
44
51
|
this.targetServices = options.targetServices ?? 1;
|
|
45
52
|
this.debug = options.debug ?? isJinnDebug();
|
|
53
|
+
this.requestFunding = options.requestFunding ?? requestTestnetFunding;
|
|
54
|
+
this.faucetLoopTimeoutMs = options.faucetLoopTimeoutMs ?? DEFAULT_FAUCET_LOOP_TIMEOUT_MS;
|
|
55
|
+
this.now = options.now ?? Date.now;
|
|
56
|
+
this.autoTestnetFaucet =
|
|
57
|
+
options.autoTestnetFaucet ?? this.env['JINN_DISABLE_TESTNET_FAUCET'] !== '1';
|
|
46
58
|
const dailyOpt = options.masterEthDailyEstimateWei;
|
|
47
59
|
this.masterEthDailyEstimateWei =
|
|
48
60
|
dailyOpt !== undefined
|
|
49
61
|
? BigInt(dailyOpt)
|
|
50
62
|
: this.estimateMasterDailyGasWei(options.pollIntervalMs);
|
|
51
|
-
this.config = getChainConfig(this.chain, {
|
|
63
|
+
this.config = applyChainGasOverrides(getChainConfig(this.chain, {
|
|
52
64
|
testnetL2DeploymentPath: options.testnetL2DeploymentPath,
|
|
53
65
|
testnetL2TokenDeploymentPath: options.testnetL2TokenDeploymentPath,
|
|
54
66
|
testnetMechDeploymentPath: options.testnetMechDeploymentPath,
|
|
55
67
|
testnetStolasDeploymentPath: options.testnetStolasDeploymentPath,
|
|
56
|
-
|
|
68
|
+
}), {
|
|
69
|
+
minEoaGasWei: options.minEoaGasWei ?? this.env['JINN_MIN_EOA_GAS_WEI'],
|
|
70
|
+
minSafeEthWei: options.minSafeEthWei ?? this.env['JINN_MIN_SAFE_ETH_WEI'],
|
|
57
71
|
});
|
|
58
72
|
if (options.rpcUrl) {
|
|
59
73
|
this.config.rpcUrl = options.rpcUrl;
|
|
@@ -75,6 +89,29 @@ export class FleetBootstrapper {
|
|
|
75
89
|
const fromPoll = BigInt(txsPerDay) * txCostWei;
|
|
76
90
|
return fromPoll > DEFAULT_MASTER_ETH_DAILY_WEI ? fromPoll : DEFAULT_MASTER_ETH_DAILY_WEI;
|
|
77
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* Snapshot of the current persisted fleet state. Reads only — no chain
|
|
94
|
+
* calls. Used by the operator-app endpoint that lists services with an
|
|
95
|
+
* unbound Safe so the SPA can offer a retry affordance.
|
|
96
|
+
*/
|
|
97
|
+
async loadState() {
|
|
98
|
+
return this.store.load(this.chain);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Re-run the ERC-1271 bind step for a single service whose Safe is not
|
|
102
|
+
* yet bound to its agent NFT. The underlying step (`stepRegisterAgent`)
|
|
103
|
+
* is idempotent: if `agent_id` is already set it skips the mint, and if
|
|
104
|
+
* `safe_bound_to_agent` is already true it skips the bind. So calling
|
|
105
|
+
* this against a fully-bound service is a safe no-op.
|
|
106
|
+
*
|
|
107
|
+
* Operator-facing surface: `POST /v1/setup/agent-binding/retry` from the
|
|
108
|
+
* IdentityCard's "binding pending" chip on Overview.
|
|
109
|
+
*/
|
|
110
|
+
async retryAgentBindingFor(serviceIndex, password) {
|
|
111
|
+
const state = await this.store.load(this.chain);
|
|
112
|
+
const mnemonic = await this.loadExistingMnemonic(state, password);
|
|
113
|
+
return this.stepRegisterAgent(state, mnemonic, serviceIndex);
|
|
114
|
+
}
|
|
78
115
|
async bootstrap(password) {
|
|
79
116
|
// Handle legacy keystore migration
|
|
80
117
|
if (!this.store.hasMnemonicKeystore() && this.store.hasLegacyKeystore()) {
|
|
@@ -108,10 +145,23 @@ export class FleetBootstrapper {
|
|
|
108
145
|
}
|
|
109
146
|
}
|
|
110
147
|
}
|
|
148
|
+
const pendingSetupMigration = detectDeprecatedTestnetSetup({
|
|
149
|
+
state,
|
|
150
|
+
chain: this.chain,
|
|
151
|
+
stakingMode: this.stakingMode,
|
|
152
|
+
currentStakingContract: this.config.stakingContract,
|
|
153
|
+
}).services.length > 0;
|
|
154
|
+
const completedCountBeforeFunding = state.services.filter(s => isOperationalServiceStep(s.step)).length;
|
|
155
|
+
const standardFleetAlreadyComplete = this.stakingMode === 'standard' &&
|
|
156
|
+
!pendingSetupMigration &&
|
|
157
|
+
completedCountBeforeFunding >= this.targetServices;
|
|
158
|
+
const standardFleetHasInProgressServices = this.stakingMode === 'standard' && state.services.length > 0;
|
|
111
159
|
const requiredMasterEth = this.stakingMode === 'standard'
|
|
112
|
-
?
|
|
160
|
+
? (standardFleetAlreadyComplete
|
|
161
|
+
? 0n
|
|
162
|
+
: this.config.minEoaGasEth * (standardFleetHasInProgressServices ? 1n : STANDARD_MASTER_BOOTSTRAP_MULTIPLIER))
|
|
113
163
|
: SELF_BOND_ETH_PER_SERVICE * BigInt(this.targetServices);
|
|
114
|
-
const autoFaucetEnabled = this.
|
|
164
|
+
const autoFaucetEnabled = this.autoTestnetFaucet;
|
|
115
165
|
// Re-sum system ETH (master + agent/safe balances for self-bond mode).
|
|
116
166
|
// Hoisted so the drip loop below can refresh cheaply.
|
|
117
167
|
const refreshSystemEth = async () => {
|
|
@@ -134,18 +184,29 @@ export class FleetBootstrapper {
|
|
|
134
184
|
return { system: total, master: m };
|
|
135
185
|
};
|
|
136
186
|
// On testnet, drain the CDP faucet in a loop until master has enough ETH.
|
|
137
|
-
// CDP's drip is tiny (~0.0001 ETH) vs
|
|
138
|
-
// single drip is never enough, and
|
|
139
|
-
//
|
|
140
|
-
//
|
|
187
|
+
// CDP's drip is tiny (~0.0001 ETH) vs a 0.005-0.010 ETH bootstrap floor —
|
|
188
|
+
// a single drip is never enough, and a fixed cap of 60 was below the
|
|
189
|
+
// fresh-fleet target (0.010 ETH on first bootstrap), so onboarding could
|
|
190
|
+
// never auto-complete. The cap is derived from the actual gap, while a
|
|
191
|
+
// wall-clock timeout remains the real runaway safety rail.
|
|
141
192
|
if (systemEth < requiredMasterEth && this.chain === 'base-sepolia' && autoFaucetEnabled) {
|
|
142
|
-
const
|
|
193
|
+
const maxFaucetIters = computeFaucetDripCap({
|
|
194
|
+
targetWei: requiredMasterEth,
|
|
195
|
+
balanceWei: systemEth,
|
|
196
|
+
});
|
|
143
197
|
const INTER_DRIP_PAUSE_MS = 1_000;
|
|
198
|
+
const deadline = this.now() + this.faucetLoopTimeoutMs;
|
|
144
199
|
console.error(`[fleet-bootstrap] Master has ${formatEther(systemEth)} ETH; need ${formatEther(requiredMasterEth)} ETH. ` +
|
|
145
200
|
`Draining CDP faucet on ${this.chain} via ${rpcHostForDisplay(this.config.rpcUrl)} ` +
|
|
146
|
-
`(each drip ≈ 0.0001 ETH, up to ${
|
|
147
|
-
for (let i = 0; i <
|
|
148
|
-
|
|
201
|
+
`(each drip ≈ 0.0001 ETH, up to ${maxFaucetIters} drips or ${Math.round(this.faucetLoopTimeoutMs / 1000)}s, whichever comes first).`);
|
|
202
|
+
for (let i = 0; i < maxFaucetIters; i++) {
|
|
203
|
+
if (this.now() >= deadline) {
|
|
204
|
+
console.error(`[fleet-bootstrap] Faucet drip loop hit ${Math.round(this.faucetLoopTimeoutMs / 1000)}s timeout after ${i} drips ` +
|
|
205
|
+
`(master=${formatEther(masterBalance)} ETH; target=${formatEther(requiredMasterEth)} ETH). ` +
|
|
206
|
+
'Retry later or fund manually.');
|
|
207
|
+
break;
|
|
208
|
+
}
|
|
209
|
+
const faucetResult = await this.requestFunding(masterAddress, 'base-sepolia');
|
|
149
210
|
if (!faucetResult.ok) {
|
|
150
211
|
if (faucetResult.rateLimited) {
|
|
151
212
|
console.error(`[fleet-bootstrap] CDP faucet rate-limited after ${i} drips: ${faucetResult.reason}`);
|
|
@@ -160,7 +221,7 @@ export class FleetBootstrapper {
|
|
|
160
221
|
systemEth = refreshed.system;
|
|
161
222
|
masterBalance = refreshed.master;
|
|
162
223
|
if ((i + 1) % 5 === 0) {
|
|
163
|
-
console.error(`[fleet-bootstrap] drip ${i + 1}/${
|
|
224
|
+
console.error(`[fleet-bootstrap] drip ${i + 1}/${maxFaucetIters} · chain=${this.chain} · rpc=${rpcHostForDisplay(this.config.rpcUrl)} · ` +
|
|
164
225
|
`master=${formatEther(masterBalance)} ETH · target=${formatEther(requiredMasterEth)} ETH`);
|
|
165
226
|
}
|
|
166
227
|
if (systemEth >= requiredMasterEth) {
|
|
@@ -190,20 +251,38 @@ export class FleetBootstrapper {
|
|
|
190
251
|
}
|
|
191
252
|
this.warnMasterEthRunway(masterAddress, masterBalance, requiredMasterEth);
|
|
192
253
|
// Phase 2: Bootstrap services up to target
|
|
193
|
-
const mnemonic = await
|
|
254
|
+
const mnemonic = await this.loadExistingMnemonic(state, password);
|
|
255
|
+
if (pendingSetupMigration) {
|
|
256
|
+
const masterAccount = deriveMasterSigner(mnemonic);
|
|
257
|
+
const masterWallet = createJinnWalletClient(this.config.rpcUrl, this.chain, masterAccount);
|
|
258
|
+
const migration = await migrateDeprecatedTestnetSetup({
|
|
259
|
+
stateStore: this.store,
|
|
260
|
+
state,
|
|
261
|
+
chain: this.chain,
|
|
262
|
+
stakingMode: this.stakingMode,
|
|
263
|
+
currentStakingContract: this.config.stakingContract,
|
|
264
|
+
distributorAddress: this.config.distributorAddress,
|
|
265
|
+
publicClient: this.publicClient,
|
|
266
|
+
masterWallet,
|
|
267
|
+
});
|
|
268
|
+
state = migration.state;
|
|
269
|
+
}
|
|
194
270
|
state = await this.reconcileFleetWithChain(state, mnemonic);
|
|
195
271
|
// Resume all services. For incomplete services, this picks up where they
|
|
196
272
|
// left off. For "complete" services in standard mode, this also runs the
|
|
197
273
|
// eviction recovery check (since on-chain state may have changed since
|
|
198
274
|
// the daemon was last running — e.g., evicted due to inactivity).
|
|
199
275
|
for (const svc of state.services) {
|
|
200
|
-
if (svc.step
|
|
276
|
+
if (!isOperationalServiceStep(svc.step)) {
|
|
201
277
|
console.error(`[fleet-bootstrap] Resuming service ${svc.index} at step '${svc.step}'`);
|
|
202
278
|
}
|
|
279
|
+
else if (svc.step === 'safe_binding_pending') {
|
|
280
|
+
console.error(`[fleet-bootstrap] Resuming service ${svc.index} at step 'safe_binding_pending'`);
|
|
281
|
+
}
|
|
203
282
|
state = await this.resumeService(state, mnemonic, svc.index);
|
|
204
283
|
}
|
|
205
284
|
// Then create new services if needed
|
|
206
|
-
const completedCount = state.services.filter(s => s.step
|
|
285
|
+
const completedCount = state.services.filter(s => isOperationalServiceStep(s.step)).length;
|
|
207
286
|
const needed = this.targetServices - completedCount;
|
|
208
287
|
if (needed > 0) {
|
|
209
288
|
console.error(`[fleet-bootstrap] ${completedCount}/${this.targetServices} services complete, bootstrapping ${needed} more`);
|
|
@@ -215,11 +294,11 @@ export class FleetBootstrapper {
|
|
|
215
294
|
return {
|
|
216
295
|
ok: true,
|
|
217
296
|
fleet_state: state,
|
|
218
|
-
message: `Fleet bootstrap complete. ${state.services.filter(s => s.step
|
|
297
|
+
message: `Fleet bootstrap complete. ${state.services.filter(s => isOperationalServiceStep(s.step)).length}/${this.targetServices} services running.`,
|
|
219
298
|
};
|
|
220
299
|
}
|
|
221
300
|
catch (error) {
|
|
222
|
-
const { summary, hint } = formatBootstrapOperatorMessage(error);
|
|
301
|
+
const { summary, hint, rawMessage } = formatBootstrapOperatorMessage(error);
|
|
223
302
|
const userMessage = hint !== undefined ? `${summary}\nHint: ${hint}` : summary;
|
|
224
303
|
if (this.debug) {
|
|
225
304
|
console.error(`[fleet-bootstrap] Bootstrap failed:`, error);
|
|
@@ -228,11 +307,18 @@ export class FleetBootstrapper {
|
|
|
228
307
|
console.error(`[fleet-bootstrap] ${summary}`);
|
|
229
308
|
if (hint !== undefined)
|
|
230
309
|
console.error(`Hint: ${hint}`);
|
|
310
|
+
// Always log the raw cause once on stderr, even outside JINN_DEBUG.
|
|
311
|
+
// The summary may misclassify; the raw line lets operators and
|
|
312
|
+
// maintainers verify the diagnosis without flipping debug mode.
|
|
313
|
+
if (rawMessage && rawMessage !== summary) {
|
|
314
|
+
console.error(`[fleet-bootstrap] raw: ${rawMessage.split('\n')[0]}`);
|
|
315
|
+
}
|
|
231
316
|
}
|
|
232
317
|
return {
|
|
233
318
|
ok: false,
|
|
234
319
|
fleet_state: state,
|
|
235
320
|
message: userMessage,
|
|
321
|
+
rawErrorMessage: rawMessage,
|
|
236
322
|
};
|
|
237
323
|
}
|
|
238
324
|
}
|
|
@@ -253,13 +339,13 @@ export class FleetBootstrapper {
|
|
|
253
339
|
}
|
|
254
340
|
// ── Phase 1: Master wallet ───────────────────────────────────────────
|
|
255
341
|
async ensureMasterWallet(state, password) {
|
|
256
|
-
if (this.store.hasMnemonicKeystore() && state.master_address) {
|
|
257
|
-
return state;
|
|
258
|
-
}
|
|
259
342
|
// `jinn init` writes the mnemonic keystore but does not patch earning_state.json.
|
|
260
343
|
// Hydrate master_address from the existing keystore instead of generating a new wallet.
|
|
261
344
|
if (this.store.hasMnemonicKeystore()) {
|
|
262
|
-
const mnemonic = await
|
|
345
|
+
const mnemonic = await this.loadExistingMnemonic(state, password);
|
|
346
|
+
if (state.master_address) {
|
|
347
|
+
return state;
|
|
348
|
+
}
|
|
263
349
|
const masterAddress = deriveMasterAddress(mnemonic);
|
|
264
350
|
return this.store.patchFleet({
|
|
265
351
|
master_address: masterAddress,
|
|
@@ -279,6 +365,23 @@ export class FleetBootstrapper {
|
|
|
279
365
|
staking_mode: this.stakingMode,
|
|
280
366
|
});
|
|
281
367
|
}
|
|
368
|
+
async loadExistingMnemonic(state, password) {
|
|
369
|
+
try {
|
|
370
|
+
return await decryptMnemonic(await this.store.loadMnemonicKeystore(), password);
|
|
371
|
+
}
|
|
372
|
+
catch (err) {
|
|
373
|
+
if (state.master_address || state.services.length > 0) {
|
|
374
|
+
throw new Error(`Existing mnemonic keystore could not be decrypted: ${err instanceof Error ? err.message : String(err)}`);
|
|
375
|
+
}
|
|
376
|
+
const archivePath = await this.store.archiveMnemonicKeystore('invalid-before-wallet-init');
|
|
377
|
+
console.error('[fleet-bootstrap] Existing mnemonic keystore was not usable for a fresh fleet; ' +
|
|
378
|
+
`archived it at ${archivePath ?? '(unknown path)'} and generating a new test wallet.`);
|
|
379
|
+
const freshMnemonic = generateMnemonic();
|
|
380
|
+
const encrypted = await encryptMnemonic(freshMnemonic, password);
|
|
381
|
+
await this.store.saveMnemonicKeystore(encrypted);
|
|
382
|
+
return freshMnemonic;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
282
385
|
// ── Phase 2: Per-service bootstrap ───────────────────────────────────
|
|
283
386
|
async bootstrapService(state, mnemonic, index) {
|
|
284
387
|
const agentAddress = deriveAgentAddress(mnemonic, index);
|
|
@@ -292,10 +395,13 @@ export class FleetBootstrapper {
|
|
|
292
395
|
* when local JSON is ahead, behind, or stale (idempotent; safe to repeat).
|
|
293
396
|
*/
|
|
294
397
|
async reconcileFleetWithChain(state, mnemonic) {
|
|
295
|
-
const ctx = { stakingContract: this.config.stakingContract };
|
|
296
398
|
let next = state;
|
|
297
399
|
for (const svc of state.services) {
|
|
298
400
|
const signals = await this.gatherChainSignals(svc);
|
|
401
|
+
const ctx = {
|
|
402
|
+
stakingContract: this.stakingAddressForService(svc),
|
|
403
|
+
preserveExistingSetup: this.shouldPreserveExistingSetup(svc),
|
|
404
|
+
};
|
|
299
405
|
const result = reconcileServiceAgainstChain(this.stakingMode, svc, signals, ctx);
|
|
300
406
|
if (result) {
|
|
301
407
|
const abandoned = previousSafeBeingAbandoned(svc, result.patch);
|
|
@@ -348,7 +454,7 @@ export class FleetBootstrapper {
|
|
|
348
454
|
};
|
|
349
455
|
}
|
|
350
456
|
const id = svc.service_id;
|
|
351
|
-
const stakingAddr = this.
|
|
457
|
+
const stakingAddr = this.stakingAddressForService(svc);
|
|
352
458
|
const registryAddr = this.config.serviceRegistry;
|
|
353
459
|
let stakingState = 0;
|
|
354
460
|
try {
|
|
@@ -412,21 +518,45 @@ export class FleetBootstrapper {
|
|
|
412
518
|
let svc = state.services.find(s => s.index === index);
|
|
413
519
|
if (!svc)
|
|
414
520
|
throw new Error(`Service ${index} not found in state`);
|
|
521
|
+
if (this.stakingMode === 'standard' &&
|
|
522
|
+
svc.error &&
|
|
523
|
+
this.shouldPreserveExistingSetup(svc)) {
|
|
524
|
+
return state;
|
|
525
|
+
}
|
|
415
526
|
// Eviction recovery: even for "complete" services, check if on-chain shows
|
|
416
527
|
// evicted (state=2). If so, unstake and reset to awaiting_stake so the
|
|
417
528
|
// bootstrap restakes fresh. Only applies to standard mode (distributor-managed).
|
|
418
529
|
if (this.stakingMode === 'standard' &&
|
|
419
530
|
svc.service_id !== null &&
|
|
420
|
-
(svc.step
|
|
421
|
-
|
|
531
|
+
(isOperationalServiceStep(svc.step) || svc.step === 'mech_deployed' || svc.step === 'staked')) {
|
|
532
|
+
let onChainState;
|
|
533
|
+
try {
|
|
534
|
+
onChainState = await this.getStakingState(svc.service_id, svc.staking_address);
|
|
535
|
+
}
|
|
536
|
+
catch (error) {
|
|
537
|
+
if (this.shouldPreserveExistingSetup(svc)) {
|
|
538
|
+
console.error(`[jinn-earning] Service ${index}: existing setup staking state could not be checked automatically. Leaving local service id and wallet fields unchanged for recovery/support.`);
|
|
539
|
+
return state;
|
|
540
|
+
}
|
|
541
|
+
throw error;
|
|
542
|
+
}
|
|
422
543
|
if (onChainState === 2) {
|
|
423
544
|
console.error(`[jinn-earning] Noticed service ${svc.service_id} (fleet index ${index}) evicted on-chain; running distributor reStake to restake.`);
|
|
424
545
|
state = await this.recoverEvictedService(state, mnemonic, index);
|
|
425
546
|
svc = state.services.find(s => s.index === index);
|
|
426
547
|
}
|
|
427
548
|
}
|
|
428
|
-
if (svc.step
|
|
549
|
+
if (isOperationalServiceStep(svc.step)) {
|
|
550
|
+
// Identity binding retry: services at `safe_binding_pending` are already
|
|
551
|
+
// staked and operational, but their ERC-8004 Safe→agentId link still
|
|
552
|
+
// needs to be written. Older `complete` services with safe_bound=false
|
|
553
|
+
// are treated the same way so legacy operators self-heal on resume.
|
|
554
|
+
if (svc.agent_id && svc.safe_address && svc.safe_bound_to_agent !== true) {
|
|
555
|
+
console.error(`[fleet-bootstrap] Service ${index}: agent_id=${svc.agent_id} with unbound Safe; running binding step.`);
|
|
556
|
+
state = await this.stepRegisterAgent(state, mnemonic, index);
|
|
557
|
+
}
|
|
429
558
|
return state;
|
|
559
|
+
}
|
|
430
560
|
if (this.stakingMode === 'standard') {
|
|
431
561
|
return this.resumeServiceStandard(state, mnemonic, index);
|
|
432
562
|
}
|
|
@@ -438,11 +568,18 @@ export class FleetBootstrapper {
|
|
|
438
568
|
state = await this.stepStolasStake(state, mnemonic, index);
|
|
439
569
|
}
|
|
440
570
|
// Reload service state after stake
|
|
441
|
-
|
|
571
|
+
let updatedSvc = (await this.store.load(this.chain)).services.find(s => s.index === index);
|
|
442
572
|
if (!updatedSvc)
|
|
443
573
|
throw new Error(`Service ${index} disappeared from state`);
|
|
444
574
|
if (updatedSvc.step === 'staked' || updatedSvc.step === 'mech_deployed') {
|
|
445
575
|
state = await this.stepDeployMech(state, mnemonic, index);
|
|
576
|
+
updatedSvc = (await this.store.load(this.chain)).services.find(s => s.index === index);
|
|
577
|
+
}
|
|
578
|
+
if (updatedSvc.step === 'mech_deployed' ||
|
|
579
|
+
updatedSvc.step === 'agent_registered' ||
|
|
580
|
+
updatedSvc.step === 'safe_binding_pending') {
|
|
581
|
+
state = await this.stepRegisterAgent(state, mnemonic, index);
|
|
582
|
+
updatedSvc = (await this.store.load(this.chain)).services.find(s => s.index === index);
|
|
446
583
|
}
|
|
447
584
|
return this.store.load(this.chain);
|
|
448
585
|
}
|
|
@@ -474,6 +611,11 @@ export class FleetBootstrapper {
|
|
|
474
611
|
}
|
|
475
612
|
if (svc.step === 'staked' || svc.step === 'mech_deployed') {
|
|
476
613
|
state = await this.stepDeployMech(state, mnemonic, index);
|
|
614
|
+
svc = (await this.store.load(this.chain)).services.find(s => s.index === index);
|
|
615
|
+
}
|
|
616
|
+
if (svc.step === 'mech_deployed' || svc.step === 'agent_registered' || svc.step === 'safe_binding_pending') {
|
|
617
|
+
state = await this.stepRegisterAgent(state, mnemonic, index);
|
|
618
|
+
svc = (await this.store.load(this.chain)).services.find(s => s.index === index);
|
|
477
619
|
}
|
|
478
620
|
return this.store.load(this.chain);
|
|
479
621
|
}
|
|
@@ -481,7 +623,7 @@ export class FleetBootstrapper {
|
|
|
481
623
|
const svc = state.services.find(s => s.index === index);
|
|
482
624
|
// Idempotency: if this service already has an id and is already staked, skip
|
|
483
625
|
if (svc.service_id !== null) {
|
|
484
|
-
const stakingState = await this.getStakingState(svc.service_id);
|
|
626
|
+
const stakingState = await this.getStakingState(svc.service_id, svc.staking_address);
|
|
485
627
|
if (stakingState === 1) {
|
|
486
628
|
console.error(`[fleet-bootstrap] Service ${index} already staked, skipping`);
|
|
487
629
|
return this.store.updateService(index, { step: 'staked' });
|
|
@@ -551,17 +693,17 @@ export class FleetBootstrapper {
|
|
|
551
693
|
}
|
|
552
694
|
const svc = state.services.find(s => s.index === index);
|
|
553
695
|
const serviceId = svc.service_id;
|
|
554
|
-
|
|
555
|
-
//
|
|
556
|
-
//
|
|
557
|
-
//
|
|
558
|
-
//
|
|
696
|
+
const stakingAddress = this.stakingAddressForService(svc);
|
|
697
|
+
// `reStake()` is operator-scoped: the master EOA must match the
|
|
698
|
+
// distributor's recorded `mapServiceIdCuratingAgents[serviceId]` entry.
|
|
699
|
+
// If it doesn't, the operator is likely using the wrong earning dir or
|
|
700
|
+
// password, or the service needs owner / managing-agent recovery.
|
|
559
701
|
const masterAccount = deriveMasterSigner(mnemonic);
|
|
560
702
|
const masterWallet = createJinnWalletClient(this.config.rpcUrl, this.chain, masterAccount);
|
|
561
703
|
const reStakeData = encodeFunctionData({
|
|
562
704
|
abi: STOLAS_DISTRIBUTOR_ABI,
|
|
563
705
|
functionName: 'reStake',
|
|
564
|
-
args: [
|
|
706
|
+
args: [stakingAddress, BigInt(serviceId)],
|
|
565
707
|
});
|
|
566
708
|
console.error(`[fleet-bootstrap] Service ${index}: calling distributor.reStake() for evicted service ${serviceId}`);
|
|
567
709
|
let reStakeHash;
|
|
@@ -576,10 +718,9 @@ export class FleetBootstrapper {
|
|
|
576
718
|
catch (err) {
|
|
577
719
|
const message = flattenErrorMessage(err);
|
|
578
720
|
if (isUnauthorizedAccountError(message)) {
|
|
579
|
-
throw new Error(`Service ${index} (service_id ${serviceId}) is evicted on the staking proxy
|
|
580
|
-
`
|
|
581
|
-
`
|
|
582
|
-
`(b) abandon this service and provision a new one (stOLAS bond stays with the old Safe until it's manually swept). ` +
|
|
721
|
+
throw new Error(`Service ${index} (service_id ${serviceId}) is evicted on the staking proxy, but master EOA ${masterAccount.address} is not authorized to reStake it. ` +
|
|
722
|
+
`The distributor only permits the recorded service operator, a managing agent, or the owner. ` +
|
|
723
|
+
`Verify JINN_EARNING_DIR and JINN_PASSWORD derive the original master EOA for this service, then re-run jinn bootstrap; otherwise request owner / managing-agent recovery or abandon-and-rebootstrap. ` +
|
|
583
724
|
`reStake revert: ${message}`);
|
|
584
725
|
}
|
|
585
726
|
throw err;
|
|
@@ -590,16 +731,19 @@ export class FleetBootstrapper {
|
|
|
590
731
|
}
|
|
591
732
|
console.error(`[fleet-bootstrap] Service ${index}: reStake confirmed (tx: ${reStakeHash})`);
|
|
592
733
|
// Service is now Staked again with the same service_id, safe_address, and mech_address.
|
|
593
|
-
//
|
|
734
|
+
// Step back to `mech_deployed` so the resume loop advances through
|
|
735
|
+
// `stepRegisterAgent` (idempotent — short-circuits if `agent_id` is
|
|
736
|
+
// already set; mints if a pre-j07 operator was just re-staked and
|
|
737
|
+
// never had the operator agent NFT). See jinn-mono-jgp.
|
|
594
738
|
return this.store.updateService(index, {
|
|
595
|
-
step: '
|
|
739
|
+
step: 'mech_deployed',
|
|
596
740
|
});
|
|
597
741
|
}
|
|
598
742
|
async stepDeployMech(state, mnemonic, index) {
|
|
599
743
|
const svc = state.services.find(s => s.index === index);
|
|
600
744
|
if (svc.mech_address) {
|
|
601
745
|
console.error(`[fleet-bootstrap] Service ${index}: mech already deployed at ${svc.mech_address}`);
|
|
602
|
-
return this.store.updateService(index, { step: '
|
|
746
|
+
return this.store.updateService(index, { step: 'mech_deployed' });
|
|
603
747
|
}
|
|
604
748
|
const serviceId = svc.service_id;
|
|
605
749
|
const safeAddress = svc.safe_address;
|
|
@@ -623,11 +767,6 @@ export class FleetBootstrapper {
|
|
|
623
767
|
}
|
|
624
768
|
// Deploy mech via the service Safe (agent is Safe owner)
|
|
625
769
|
const agentKey = walletPrivateKeyAtIndex(mnemonic, index);
|
|
626
|
-
const safe = await initDeployedSafe({
|
|
627
|
-
rpcUrl: this.config.rpcUrl,
|
|
628
|
-
signerKey: agentKey,
|
|
629
|
-
safeAddress,
|
|
630
|
-
});
|
|
631
770
|
const payload = encodeAbiParameters([{ type: 'uint256' }], [this.config.mechRequestPrice]);
|
|
632
771
|
const createData = encodeFunctionData({
|
|
633
772
|
abi: MECH_MARKETPLACE_CREATE_ABI,
|
|
@@ -635,9 +774,13 @@ export class FleetBootstrapper {
|
|
|
635
774
|
args: [BigInt(serviceId), this.config.mechFactory, payload],
|
|
636
775
|
});
|
|
637
776
|
console.error(`[fleet-bootstrap] Service ${index}: deploying mech`);
|
|
638
|
-
const result = await
|
|
639
|
-
|
|
640
|
-
|
|
777
|
+
const result = await executeSafeTxDirect({
|
|
778
|
+
rpcUrl: this.config.rpcUrl,
|
|
779
|
+
signerKey: agentKey,
|
|
780
|
+
safeAddress,
|
|
781
|
+
to: this.config.mechMarketplace,
|
|
782
|
+
data: createData,
|
|
783
|
+
});
|
|
641
784
|
const mechReceipt = await waitForTransactionReceiptWithRetry(this.publicClient, result.hash);
|
|
642
785
|
if (mechReceipt.status !== 'success') {
|
|
643
786
|
throw new Error(`Mech deployment tx failed for service ${index}: ${result.hash}`);
|
|
@@ -658,9 +801,173 @@ export class FleetBootstrapper {
|
|
|
658
801
|
console.error(`[fleet-bootstrap] Service ${index}: mech deployed at ${mechAddress}`);
|
|
659
802
|
return this.store.updateService(index, {
|
|
660
803
|
mech_address: mechAddress,
|
|
661
|
-
step: '
|
|
804
|
+
step: 'mech_deployed',
|
|
662
805
|
});
|
|
663
806
|
}
|
|
807
|
+
/**
|
|
808
|
+
* ERC-8004 IdentityRegistry mint + Safe wallet bind (jinn-mono-j07,
|
|
809
|
+
* jinn-mono-aev).
|
|
810
|
+
*
|
|
811
|
+
* Two on-chain effects, gated independently for idempotency:
|
|
812
|
+
*
|
|
813
|
+
* 1. **Mint** (jinn-mono-j07): one operator agent NFT per service Safe;
|
|
814
|
+
* the agent EOA owns the token. Persists `agent_id` (and metadata)
|
|
815
|
+
* to state immediately after the receipt parses, so a crash between
|
|
816
|
+
* register and the subsequent `setAgentWallet` does not lose the
|
|
817
|
+
* token. v0 uses an empty `agentURI` — operators are expected to
|
|
818
|
+
* populate it later via `setAgentURI`. Re-run with `svc.agent_id`
|
|
819
|
+
* already set short-circuits the mint.
|
|
820
|
+
*
|
|
821
|
+
* 2. **Bind** (jinn-mono-aev): `IdentityRegistry.setAgentWallet(agentId,
|
|
822
|
+
* safe, deadline, sig)` from the agent EOA. The contract recovers
|
|
823
|
+
* `sig` against the Safe via ERC-1271; we wrap the EIP-712
|
|
824
|
+
* AgentWalletSet digest in Safe's SafeMessage typed-data and
|
|
825
|
+
* raw-ECDSA-sign with the sole owner (= agent EOA). On success,
|
|
826
|
+
* `safe_bound_to_agent` flips to true. Re-run with
|
|
827
|
+
* `svc.safe_bound_to_agent` already true short-circuits the bind.
|
|
828
|
+
* See `agent-wallet-binding.ts` + spec §4.1.
|
|
829
|
+
*
|
|
830
|
+
* The bind is a discrete operational state (`safe_binding_pending`) because
|
|
831
|
+
* the service is already staked and runnable once the mint exists. A failed
|
|
832
|
+
* binding should be visible and resumable, but should not block the daemon
|
|
833
|
+
* from reaching the running dashboard.
|
|
834
|
+
*/
|
|
835
|
+
async stepRegisterAgent(state, mnemonic, index) {
|
|
836
|
+
void state;
|
|
837
|
+
let svc = (await this.store.load(this.chain)).services.find(s => s.index === index);
|
|
838
|
+
if (!svc)
|
|
839
|
+
throw new Error(`Service ${index} not found in state`);
|
|
840
|
+
const identityRegistry = this.config.identityRegistry
|
|
841
|
+
?? IDENTITY_REGISTRY_ADDRESSES[this.config.chainId];
|
|
842
|
+
if (!identityRegistry) {
|
|
843
|
+
throw new Error(`IdentityRegistry address not configured for chainId=${this.config.chainId}; ` +
|
|
844
|
+
`update IDENTITY_REGISTRY_ADDRESSES in earning/contracts.ts.`);
|
|
845
|
+
}
|
|
846
|
+
const agentSigner = deriveAgentSigner(mnemonic, index);
|
|
847
|
+
const agentWallet = createJinnWalletClient(this.config.rpcUrl, this.chain, agentSigner);
|
|
848
|
+
// ── Sub-step A: mint NFT (skip if agent_id is already set). ─────────
|
|
849
|
+
let agentId;
|
|
850
|
+
if (svc.agent_id) {
|
|
851
|
+
console.error(`[fleet-bootstrap] Service ${index}: ERC-8004 agent already registered ` +
|
|
852
|
+
`(agentId=${svc.agent_id}); skipping mint.`);
|
|
853
|
+
agentId = svc.agent_id;
|
|
854
|
+
svc = await this.firstServiceUpdate(index, {
|
|
855
|
+
identity_registry_address: svc.identity_registry_address ?? getAddress(identityRegistry),
|
|
856
|
+
step: svc.step === 'safe_binding_pending' ? 'safe_binding_pending' : 'agent_registered',
|
|
857
|
+
});
|
|
858
|
+
}
|
|
859
|
+
else {
|
|
860
|
+
// v0: empty agentURI. The richer agent card (per §6 of the spec) is
|
|
861
|
+
// future work — operators may later call `setAgentURI`.
|
|
862
|
+
const agentURI = '';
|
|
863
|
+
const registerData = encodeFunctionData({
|
|
864
|
+
abi: IDENTITY_REGISTRY_ABI,
|
|
865
|
+
functionName: 'register',
|
|
866
|
+
args: [agentURI],
|
|
867
|
+
});
|
|
868
|
+
console.error(`[fleet-bootstrap] Service ${index}: minting ERC-8004 agent NFT ` +
|
|
869
|
+
`(IdentityRegistry=${identityRegistry}, agentEOA=${agentSigner.address})`);
|
|
870
|
+
const mintTxHash = await viemSendTransactionWithRetry(agentWallet, this.publicClient, {
|
|
871
|
+
account: agentSigner,
|
|
872
|
+
to: addr(identityRegistry),
|
|
873
|
+
data: registerData,
|
|
874
|
+
});
|
|
875
|
+
const receipt = await waitForTransactionReceiptWithRetry(this.publicClient, mintTxHash);
|
|
876
|
+
if (receipt.status !== 'success') {
|
|
877
|
+
throw new Error(`IdentityRegistry.register() tx failed for service ${index}: ${mintTxHash}`);
|
|
878
|
+
}
|
|
879
|
+
const parsed = this.parseAgentIdFromReceipt(receipt, identityRegistry);
|
|
880
|
+
if (parsed === null) {
|
|
881
|
+
throw new Error(`IdentityRegistry.register() succeeded but Registered event was not found ` +
|
|
882
|
+
`(service ${index}, tx: ${mintTxHash})`);
|
|
883
|
+
}
|
|
884
|
+
agentId = parsed;
|
|
885
|
+
console.error(`[fleet-bootstrap] Service ${index}: ERC-8004 agent registered ` +
|
|
886
|
+
`(agentId=${agentId}, tx=${mintTxHash})`);
|
|
887
|
+
// Persist agentId IMMEDIATELY so a crash between this write and the
|
|
888
|
+
// setAgentWallet call below does not lose the token.
|
|
889
|
+
svc = await this.firstServiceUpdate(index, {
|
|
890
|
+
agent_id: agentId,
|
|
891
|
+
agent_uri: agentURI,
|
|
892
|
+
identity_registry_address: getAddress(identityRegistry),
|
|
893
|
+
agent_registered_tx: mintTxHash,
|
|
894
|
+
step: 'agent_registered',
|
|
895
|
+
error: null,
|
|
896
|
+
});
|
|
897
|
+
}
|
|
898
|
+
// ── Sub-step B: bind Safe wallet via ERC-1271 (jinn-mono-aev). ──────
|
|
899
|
+
// Idempotent: skip when already bound. Requires safe_address — if the
|
|
900
|
+
// operator is in a topology without a Safe (future), the bind step is
|
|
901
|
+
// simply not applicable and `safe_bound_to_agent` stays false.
|
|
902
|
+
if (svc.safe_bound_to_agent) {
|
|
903
|
+
console.error(`[fleet-bootstrap] Service ${index}: Safe already bound to agentId=${agentId} ` +
|
|
904
|
+
`(safe=${svc.safe_address}); skipping setAgentWallet.`);
|
|
905
|
+
svc = await this.firstServiceUpdate(index, {
|
|
906
|
+
step: 'complete',
|
|
907
|
+
error: null,
|
|
908
|
+
});
|
|
909
|
+
}
|
|
910
|
+
else if (!svc.safe_address) {
|
|
911
|
+
console.error(`[fleet-bootstrap] Service ${index}: no safe_address — cannot bind agent NFT ` +
|
|
912
|
+
`(agentId=${agentId}). Bootstrap will leave safe_bound_to_agent=false; this is ` +
|
|
913
|
+
`unexpected for the standard staking topology.`);
|
|
914
|
+
svc = await this.firstServiceUpdate(index, {
|
|
915
|
+
step: 'safe_binding_pending',
|
|
916
|
+
error: 'safe_address_missing_for_agent_wallet_binding',
|
|
917
|
+
});
|
|
918
|
+
}
|
|
919
|
+
else {
|
|
920
|
+
const safeAddress = svc.safe_address;
|
|
921
|
+
console.error(`[fleet-bootstrap] Service ${index}: binding Safe ${safeAddress} to ` +
|
|
922
|
+
`agentId=${agentId} via setAgentWallet (ERC-1271).`);
|
|
923
|
+
svc = await this.firstServiceUpdate(index, {
|
|
924
|
+
step: 'safe_binding_pending',
|
|
925
|
+
error: null,
|
|
926
|
+
});
|
|
927
|
+
try {
|
|
928
|
+
const result = await bindAgentWalletToSafe({
|
|
929
|
+
identityRegistryAddress: addr(identityRegistry),
|
|
930
|
+
agentId: BigInt(agentId),
|
|
931
|
+
safeAddress: addr(safeAddress),
|
|
932
|
+
agentEoaAccount: agentSigner,
|
|
933
|
+
agentEoaWalletClient: agentWallet,
|
|
934
|
+
publicClient: this.publicClient,
|
|
935
|
+
chainId: this.config.chainId,
|
|
936
|
+
});
|
|
937
|
+
console.error(`[fleet-bootstrap] Service ${index}: setAgentWallet succeeded ` +
|
|
938
|
+
`(tx=${result.txHash}, safe=${safeAddress}).`);
|
|
939
|
+
svc = await this.firstServiceUpdate(index, {
|
|
940
|
+
safe_bound_to_agent: true,
|
|
941
|
+
step: 'complete',
|
|
942
|
+
error: null,
|
|
943
|
+
});
|
|
944
|
+
}
|
|
945
|
+
catch (err) {
|
|
946
|
+
const reason = err instanceof Error ? err.message : String(err);
|
|
947
|
+
console.error(`[fleet-bootstrap] Service ${index}: setAgentWallet failed; continuing with ` +
|
|
948
|
+
`safe_bound_to_agent=false (${reason}).`);
|
|
949
|
+
svc = await this.firstServiceUpdate(index, {
|
|
950
|
+
safe_bound_to_agent: false,
|
|
951
|
+
step: 'safe_binding_pending',
|
|
952
|
+
error: `safe_binding_failed: ${reason}`,
|
|
953
|
+
});
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
return this.store.load(this.chain);
|
|
957
|
+
}
|
|
958
|
+
/**
|
|
959
|
+
* Tiny store wrapper: re-loads the service row after `updateService` so
|
|
960
|
+
* the next sub-step sees the latest persisted shape (including any
|
|
961
|
+
* fields written by sibling code paths since this fn started).
|
|
962
|
+
*/
|
|
963
|
+
async firstServiceUpdate(index, patch) {
|
|
964
|
+
await this.store.updateService(index, patch);
|
|
965
|
+
const fleet = await this.store.load(this.chain);
|
|
966
|
+
const svc = fleet.services.find(s => s.index === index);
|
|
967
|
+
if (!svc)
|
|
968
|
+
throw new Error(`Service ${index} not found after update`);
|
|
969
|
+
return svc;
|
|
970
|
+
}
|
|
664
971
|
// ── Self-bond step handlers ──────────────────────────────────────────
|
|
665
972
|
async stepSelfBondSetup(state, mnemonic, index) {
|
|
666
973
|
const svc = state.services.find(s => s.index === index);
|
|
@@ -1032,9 +1339,22 @@ export class FleetBootstrapper {
|
|
|
1032
1339
|
}
|
|
1033
1340
|
console.error(`[fleet-bootstrap] Preflight passed: ${slotsRemaining} slots remaining`);
|
|
1034
1341
|
}
|
|
1035
|
-
|
|
1342
|
+
stakingAddressForService(svc) {
|
|
1343
|
+
return addr(svc.staking_address ?? this.config.stakingContract);
|
|
1344
|
+
}
|
|
1345
|
+
shouldPreserveExistingSetup(svc) {
|
|
1346
|
+
if (this.stakingMode !== 'standard' || !svc.staking_address)
|
|
1347
|
+
return false;
|
|
1348
|
+
try {
|
|
1349
|
+
return getAddress(svc.staking_address) !== getAddress(this.config.stakingContract);
|
|
1350
|
+
}
|
|
1351
|
+
catch {
|
|
1352
|
+
return true;
|
|
1353
|
+
}
|
|
1354
|
+
}
|
|
1355
|
+
async getStakingState(serviceId, stakingAddress) {
|
|
1036
1356
|
return Number(await this.publicClient.readContract({
|
|
1037
|
-
address: this.config.stakingContract,
|
|
1357
|
+
address: addr(stakingAddress ?? this.config.stakingContract),
|
|
1038
1358
|
abi: STAKING_ABI,
|
|
1039
1359
|
functionName: 'getStakingState',
|
|
1040
1360
|
args: [BigInt(serviceId)],
|
|
@@ -1075,6 +1395,39 @@ export class FleetBootstrapper {
|
|
|
1075
1395
|
}
|
|
1076
1396
|
return null;
|
|
1077
1397
|
}
|
|
1398
|
+
/**
|
|
1399
|
+
* Extract `agentId` from an `IdentityRegistry.Registered` log emitted in
|
|
1400
|
+
* the receipt. Filters by `(address, topic[0])` first to avoid colliding
|
|
1401
|
+
* with any other contract that happens to share the event signature.
|
|
1402
|
+
*
|
|
1403
|
+
* Returns the agentId as a decimal string (uint256) so it round-trips
|
|
1404
|
+
* cleanly through JSON-persisted EarningState.
|
|
1405
|
+
*/
|
|
1406
|
+
parseAgentIdFromReceipt(receipt, identityRegistry) {
|
|
1407
|
+
const topic = EVENT_TOPICS.Registered;
|
|
1408
|
+
const target = identityRegistry.toLowerCase();
|
|
1409
|
+
for (const log of receipt.logs) {
|
|
1410
|
+
if (log.address.toLowerCase() !== target)
|
|
1411
|
+
continue;
|
|
1412
|
+
if (log.topics[0] !== topic)
|
|
1413
|
+
continue;
|
|
1414
|
+
try {
|
|
1415
|
+
const decoded = decodeEventLog({
|
|
1416
|
+
abi: IDENTITY_REGISTRY_ABI,
|
|
1417
|
+
data: log.data,
|
|
1418
|
+
topics: log.topics,
|
|
1419
|
+
strict: false,
|
|
1420
|
+
});
|
|
1421
|
+
if (decoded.eventName === 'Registered' && 'agentId' in decoded.args) {
|
|
1422
|
+
return decoded.args.agentId.toString();
|
|
1423
|
+
}
|
|
1424
|
+
}
|
|
1425
|
+
catch {
|
|
1426
|
+
// Not a matching event
|
|
1427
|
+
}
|
|
1428
|
+
}
|
|
1429
|
+
return null;
|
|
1430
|
+
}
|
|
1078
1431
|
}
|
|
1079
1432
|
/** @deprecated Use FleetBootstrapper */
|
|
1080
1433
|
export const EarningBootstrapper = FleetBootstrapper;
|