@jinn-network/client 0.1.8 → 0.1.9-canary.023faefb
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +2 -2
- package/README.md +6 -0
- package/deployments/deployment-phase1b-mech-baseSepolia-fast.json +3 -3
- package/deployments/deployment-stolas-l2-baseSepolia-fast.json +23 -3
- package/deployments/deployment-task-coordinator-router-v3-baseSepolia-fast.json +34 -6
- package/dist/adapters/mech/adapter.d.ts +31 -1
- package/dist/adapters/mech/adapter.js +126 -53
- package/dist/adapters/mech/adapter.js.map +1 -1
- package/dist/adapters/mech/contracts.d.ts +174 -13
- package/dist/adapters/mech/contracts.js +99 -49
- package/dist/adapters/mech/contracts.js.map +1 -1
- package/dist/adapters/mech/safe-revert.d.ts +4 -0
- package/dist/adapters/mech/safe-revert.js +5 -1
- package/dist/adapters/mech/safe-revert.js.map +1 -1
- package/dist/adapters/mech/safe.js +77 -1
- package/dist/adapters/mech/safe.js.map +1 -1
- package/dist/adapters/mech/types.d.ts +5 -130
- package/dist/adapters/mech/types.js +9 -65
- package/dist/adapters/mech/types.js.map +1 -1
- package/dist/adapters/mech/verdict-code.js +1 -1
- package/dist/adapters/mech/verdict-code.js.map +1 -1
- package/dist/api/bootstrap-endpoint.d.ts +19 -3
- package/dist/api/bootstrap-endpoint.js +4 -0
- package/dist/api/bootstrap-endpoint.js.map +1 -1
- package/dist/api/discovery-endpoint.d.ts +1 -0
- package/dist/api/discovery-endpoint.js +24 -0
- package/dist/api/discovery-endpoint.js.map +1 -1
- package/dist/api/fleet-build.d.ts +1 -7
- package/dist/api/fleet-build.js +0 -7
- package/dist/api/fleet-build.js.map +1 -1
- package/dist/api/gather-status.d.ts +26 -17
- package/dist/api/gather-status.js +62 -520
- package/dist/api/gather-status.js.map +1 -1
- package/dist/api/harness-auth-status-endpoint.d.ts +21 -0
- package/dist/api/harness-auth-status-endpoint.js +17 -0
- package/dist/api/harness-auth-status-endpoint.js.map +1 -0
- package/dist/api/launcher-endpoints.js +6 -1
- package/dist/api/launcher-endpoints.js.map +1 -1
- package/dist/api/launcher-status.d.ts +2 -0
- package/dist/api/launcher-status.js.map +1 -1
- package/dist/api/launcher-tasks.d.ts +47 -0
- package/dist/api/launcher-tasks.js +88 -3
- package/dist/api/launcher-tasks.js.map +1 -1
- package/dist/api/loop-completion-build.d.ts +79 -0
- package/dist/api/loop-completion-build.js +154 -0
- package/dist/api/loop-completion-build.js.map +1 -0
- package/dist/api/operator-artifacts-endpoint.js +1 -1
- package/dist/api/operator-artifacts-endpoint.js.map +1 -1
- package/dist/api/portfolio-v0-build.d.ts +2 -1
- package/dist/api/portfolio-v0-build.js +5 -7
- package/dist/api/portfolio-v0-build.js.map +1 -1
- package/dist/api/prediction-v1-build.d.ts +2 -2
- package/dist/api/prediction-v1-build.js +5 -7
- package/dist/api/prediction-v1-build.js.map +1 -1
- package/dist/api/rewards-build.d.ts +8 -1
- package/dist/api/rewards-build.js +32 -4
- package/dist/api/rewards-build.js.map +1 -1
- package/dist/api/rewards-endpoint.d.ts +12 -0
- package/dist/api/rewards-endpoint.js +46 -0
- package/dist/api/rewards-endpoint.js.map +1 -0
- package/dist/api/server.d.ts +6 -16
- package/dist/api/server.js +29 -26
- package/dist/api/server.js.map +1 -1
- package/dist/api/setup-endpoints.d.ts +45 -0
- package/dist/api/setup-endpoints.js +271 -52
- package/dist/api/setup-endpoints.js.map +1 -1
- package/dist/api/solvernets-endpoints.js +4 -1
- package/dist/api/solvernets-endpoints.js.map +1 -1
- package/dist/api/status-build.d.ts +71 -94
- package/dist/api/status-build.js +11 -77
- package/dist/api/status-build.js.map +1 -1
- package/dist/api/status-rollup-build.d.ts +0 -4
- package/dist/api/status-rollup-build.js +0 -4
- package/dist/api/status-rollup-build.js.map +1 -1
- package/dist/api/stop-hook.d.ts +1 -1
- package/dist/api/stop-hook.js +1 -1
- package/dist/api/stop-hook.js.map +1 -1
- package/dist/api/task-run-routing.d.ts +1 -1
- package/dist/api/task-runs-build.d.ts +2 -2
- package/dist/api/task-runs-build.js +5 -7
- package/dist/api/task-runs-build.js.map +1 -1
- package/dist/bin/jinn-distil-mcp.js +813 -0
- package/dist/bin/jinn-layer.js +12568 -0
- package/dist/build-info.json +4 -4
- package/dist/build-meta.json +1 -1
- package/dist/captures/distil-export.d.ts +54 -0
- package/dist/captures/distil-export.js +135 -0
- package/dist/captures/distil-export.js.map +1 -0
- package/dist/captures/ingest.d.ts +21 -0
- package/dist/captures/ingest.js +144 -0
- package/dist/captures/ingest.js.map +1 -0
- package/dist/captures/live-publisher.d.ts +9 -0
- package/dist/captures/live-publisher.js +5 -3
- package/dist/captures/live-publisher.js.map +1 -1
- package/dist/captures/publish.d.ts +15 -0
- package/dist/captures/publish.js +17 -7
- package/dist/captures/publish.js.map +1 -1
- package/dist/cli/commands/codedigest-revert-check.js +6 -2
- package/dist/cli/commands/codedigest-revert-check.js.map +1 -1
- package/dist/cli/commands/doctor.d.ts +3 -0
- package/dist/cli/commands/doctor.js +36 -4
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/eval.d.ts +87 -0
- package/dist/cli/commands/eval.js +481 -0
- package/dist/cli/commands/eval.js.map +1 -0
- package/dist/cli/commands/rewards.d.ts +2 -0
- package/dist/cli/commands/rewards.js +39 -10
- package/dist/cli/commands/rewards.js.map +1 -1
- package/dist/cli/commands/solver-nets.js +68 -0
- package/dist/cli/commands/solver-nets.js.map +1 -1
- package/dist/cli/commands/status.js +0 -1
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/update.js +8 -0
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/version.js +4 -0
- package/dist/cli/commands/version.js.map +1 -1
- package/dist/cli/execution-context.js +2 -1
- package/dist/cli/execution-context.js.map +1 -1
- package/dist/cli/index.js +2 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/introspection-context.js +0 -3
- package/dist/cli/introspection-context.js.map +1 -1
- package/dist/config.d.ts +158 -541
- package/dist/config.js +190 -197
- package/dist/config.js.map +1 -1
- package/dist/contracts/abis.d.ts +100 -0
- package/dist/contracts/abis.js +58 -0
- package/dist/contracts/abis.js.map +1 -0
- package/dist/contracts/addresses.d.ts +36 -0
- package/dist/contracts/addresses.js +60 -0
- package/dist/contracts/addresses.js.map +1 -0
- package/dist/corpus/acquire.d.ts +7 -6
- package/dist/corpus/acquire.js +10 -10
- package/dist/corpus/acquire.js.map +1 -1
- package/dist/corpus/fetch-artifact.d.ts +21 -0
- package/dist/corpus/fetch-artifact.js +33 -0
- package/dist/corpus/fetch-artifact.js.map +1 -0
- package/dist/corpus/index.d.ts +2 -2
- package/dist/corpus/onchain-query.d.ts +0 -1
- package/dist/corpus/onchain-query.js +2 -5
- package/dist/corpus/onchain-query.js.map +1 -1
- package/dist/corpus/route-resolver.d.ts +3 -3
- package/dist/corpus/route-resolver.js +3 -3
- package/dist/daemon/ai-units-gate.d.ts +6 -6
- package/dist/daemon/ai-units-gate.js +11 -10
- package/dist/daemon/ai-units-gate.js.map +1 -1
- package/dist/daemon/balance-topup-loop.js +27 -9
- package/dist/daemon/balance-topup-loop.js.map +1 -1
- package/dist/daemon/checkpoint-loop.js +2 -2
- package/dist/daemon/creator.d.ts +1 -0
- package/dist/daemon/creator.js +39 -25
- package/dist/daemon/creator.js.map +1 -1
- package/dist/daemon/daemon.d.ts +15 -10
- package/dist/daemon/daemon.js +95 -41
- package/dist/daemon/daemon.js.map +1 -1
- package/dist/daemon/delivery-watcher.d.ts +9 -0
- package/dist/daemon/delivery-watcher.js +24 -1
- package/dist/daemon/delivery-watcher.js.map +1 -1
- package/dist/daemon/eviction-loop.d.ts +7 -0
- package/dist/daemon/eviction-loop.js +19 -3
- package/dist/daemon/eviction-loop.js.map +1 -1
- package/dist/daemon/join-applier.d.ts +35 -0
- package/dist/daemon/join-applier.js +49 -0
- package/dist/daemon/join-applier.js.map +1 -0
- package/dist/daemon/loop-heartbeat.d.ts +89 -0
- package/dist/daemon/loop-heartbeat.js +75 -0
- package/dist/daemon/loop-heartbeat.js.map +1 -0
- package/dist/{api/peers.js → daemon/peer-sync.js} +3 -1
- package/dist/daemon/peer-sync.js.map +1 -0
- package/dist/daemon/reward-claim-loop.js +28 -10
- package/dist/daemon/reward-claim-loop.js.map +1 -1
- package/dist/daemon/skip-log-dedup.d.ts +1 -1
- package/dist/daemon/skip-log-dedup.js +3 -0
- package/dist/daemon/skip-log-dedup.js.map +1 -1
- package/dist/daemon/spend-cap-gate.d.ts +0 -6
- package/dist/daemon/spend-cap-gate.js +1 -8
- package/dist/daemon/spend-cap-gate.js.map +1 -1
- package/dist/daemon/watchdog-loop.d.ts +84 -0
- package/dist/daemon/watchdog-loop.js +91 -0
- package/dist/daemon/watchdog-loop.js.map +1 -0
- package/dist/dashboard/assets/index-B_5Cb-ZH.js +161 -0
- package/dist/dashboard/assets/index-D7rvJRNa.css +1 -0
- package/dist/dashboard/index.html +2 -2
- package/dist/discovery/http.d.ts +17 -0
- package/dist/discovery/http.js +378 -26
- package/dist/discovery/http.js.map +1 -1
- package/dist/discovery/onchain.js +174 -10
- package/dist/discovery/onchain.js.map +1 -1
- package/dist/discovery/types.d.ts +149 -0
- package/dist/discovery/types.js +40 -0
- package/dist/discovery/types.js.map +1 -1
- package/dist/discovery/with-fallback.js +24 -0
- package/dist/discovery/with-fallback.js.map +1 -1
- package/dist/earning/bootstrap-run.d.ts +25 -0
- package/dist/earning/bootstrap-run.js +315 -0
- package/dist/earning/bootstrap-run.js.map +1 -0
- package/dist/earning/bootstrap.d.ts +31 -11
- package/dist/earning/bootstrap.js +123 -212
- package/dist/earning/bootstrap.js.map +1 -1
- package/dist/earning/contracts.d.ts +2 -232
- package/dist/earning/contracts.js +16 -205
- package/dist/earning/contracts.js.map +1 -1
- package/dist/earning/faucet-topup-store.d.ts +41 -0
- package/dist/earning/faucet-topup-store.js +89 -0
- package/dist/earning/faucet-topup-store.js.map +1 -0
- package/dist/earning/faucet.d.ts +1 -1
- package/dist/earning/faucet.js +2 -2
- package/dist/earning/faucet.js.map +1 -1
- package/dist/earning/safe-adapter.js +12 -45
- package/dist/earning/safe-adapter.js.map +1 -1
- package/dist/earning/steps/context.d.ts +42 -0
- package/dist/earning/steps/context.js +4 -0
- package/dist/earning/steps/context.js.map +1 -0
- package/dist/earning/steps/fleet-identity-register.d.ts +4 -0
- package/dist/earning/steps/fleet-identity-register.js +65 -0
- package/dist/earning/steps/fleet-identity-register.js.map +1 -0
- package/dist/earning/steps/fleet-safe-deploy.d.ts +4 -0
- package/dist/earning/steps/fleet-safe-deploy.js +62 -0
- package/dist/earning/steps/fleet-safe-deploy.js.map +1 -0
- package/dist/earning/steps/fleet-safe-predict.d.ts +4 -0
- package/dist/earning/steps/fleet-safe-predict.js +18 -0
- package/dist/earning/steps/fleet-safe-predict.js.map +1 -0
- package/dist/earning/steps/receipt-parsing.d.ts +12 -0
- package/dist/earning/steps/receipt-parsing.js +71 -0
- package/dist/earning/steps/receipt-parsing.js.map +1 -0
- package/dist/earning/stolas-claim.js +8 -8
- package/dist/earning/stolas-claim.js.map +1 -1
- package/dist/earning/{jinn-rewards.d.ts → stolas-staking.d.ts} +4 -8
- package/dist/earning/{jinn-rewards.js → stolas-staking.js} +6 -10
- package/dist/earning/stolas-staking.js.map +1 -0
- package/dist/earning/testnet-setup-migration.d.ts +1 -0
- package/dist/earning/testnet-setup-migration.js +7 -2
- package/dist/earning/testnet-setup-migration.js.map +1 -1
- package/dist/earning/types.d.ts +1 -1
- package/dist/earning/types.js +1 -1
- package/dist/earning/types.js.map +1 -1
- package/dist/earning/viem-clients.d.ts +3 -19
- package/dist/earning/viem-clients.js +4 -31
- package/dist/earning/viem-clients.js.map +1 -1
- package/dist/erc8004/addresses.d.ts +6 -5
- package/dist/erc8004/addresses.js +7 -5
- package/dist/erc8004/addresses.js.map +1 -1
- package/dist/erc8004/identity.d.ts +12 -1
- package/dist/erc8004/identity.js +31 -0
- package/dist/erc8004/identity.js.map +1 -1
- package/dist/erc8004/index.d.ts +1 -1
- package/dist/erc8004/index.js +1 -1
- package/dist/erc8004/index.js.map +1 -1
- package/dist/eval/capability-slate.d.ts +54 -0
- package/dist/eval/capability-slate.js +116 -0
- package/dist/eval/capability-slate.js.map +1 -0
- package/dist/eval/capability-stats.d.ts +39 -0
- package/dist/eval/capability-stats.js +123 -0
- package/dist/eval/capability-stats.js.map +1 -0
- package/dist/eval/contested-band.d.ts +18 -0
- package/dist/eval/contested-band.js +19 -0
- package/dist/eval/contested-band.js.map +1 -0
- package/dist/eval/corpus-index.d.ts +21 -0
- package/dist/eval/corpus-index.js +55 -0
- package/dist/eval/corpus-index.js.map +1 -0
- package/dist/eval/disjointness.d.ts +26 -0
- package/dist/eval/disjointness.js +67 -0
- package/dist/eval/disjointness.js.map +1 -0
- package/dist/eval/eval-harness-run.d.ts +63 -0
- package/dist/eval/eval-harness-run.js +123 -0
- package/dist/eval/eval-harness-run.js.map +1 -0
- package/dist/eval/mcnemar-power.d.ts +14 -0
- package/dist/eval/mcnemar-power.js +40 -0
- package/dist/eval/mcnemar-power.js.map +1 -0
- package/dist/eval/orchestrator.d.ts +224 -0
- package/dist/eval/orchestrator.js +250 -0
- package/dist/eval/orchestrator.js.map +1 -0
- package/dist/eval/paired.d.ts +68 -0
- package/dist/eval/paired.js +93 -0
- package/dist/eval/paired.js.map +1 -0
- package/dist/eval/resolve-slate-tasks.d.ts +35 -0
- package/dist/eval/resolve-slate-tasks.js +56 -0
- package/dist/eval/resolve-slate-tasks.js.map +1 -0
- package/dist/eval/screen-discovery.d.ts +22 -0
- package/dist/eval/screen-discovery.js +71 -0
- package/dist/eval/screen-discovery.js.map +1 -0
- package/dist/eval/screen-progress.d.ts +41 -0
- package/dist/eval/screen-progress.js +60 -0
- package/dist/eval/screen-progress.js.map +1 -0
- package/dist/eval/screen-runner.d.ts +30 -0
- package/dist/eval/screen-runner.js +289 -0
- package/dist/eval/screen-runner.js.map +1 -0
- package/dist/eval/screen.d.ts +107 -0
- package/dist/eval/screen.js +159 -0
- package/dist/eval/screen.js.map +1 -0
- package/dist/eval/slope.d.ts +29 -0
- package/dist/eval/slope.js +46 -0
- package/dist/eval/slope.js.map +1 -0
- package/dist/eval/train-sequence.d.ts +35 -0
- package/dist/eval/train-sequence.js +59 -0
- package/dist/eval/train-sequence.js.map +1 -0
- package/dist/eval/wilson.d.ts +45 -0
- package/dist/eval/wilson.js +48 -0
- package/dist/eval/wilson.js.map +1 -0
- package/dist/events/types.d.ts +1 -1
- package/dist/events/types.js +1 -1
- package/dist/events/types.js.map +1 -1
- package/dist/harnesses/auth-source.d.ts +51 -0
- package/dist/harnesses/auth-source.js +155 -0
- package/dist/harnesses/auth-source.js.map +1 -0
- package/dist/harnesses/engine/canonical-json.js +5 -3
- package/dist/harnesses/engine/canonical-json.js.map +1 -1
- package/dist/harnesses/engine/engine.d.ts +34 -1
- package/dist/harnesses/engine/engine.js +91 -11
- package/dist/harnesses/engine/engine.js.map +1 -1
- package/dist/harnesses/engine/packaging.js +5 -5
- package/dist/harnesses/engine/packaging.js.map +1 -1
- package/dist/harnesses/engine/persistence.d.ts +19 -61
- package/dist/harnesses/engine/persistence.js +28 -0
- package/dist/harnesses/engine/persistence.js.map +1 -1
- package/dist/harnesses/impls/_evaluator-base.d.ts +48 -0
- package/dist/harnesses/impls/_evaluator-base.js +35 -0
- package/dist/harnesses/impls/_evaluator-base.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-hyperliquid/mcp-tools.d.ts +1 -1
- package/dist/harnesses/impls/claude-mcp-hyperliquid/mcp-tools.js +1 -1
- package/dist/harnesses/impls/claude-mcp-hyperliquid/mcp-tools.js.map +1 -1
- package/dist/harnesses/impls/claude-mcp-prediction/index.d.ts +2 -3
- package/dist/harnesses/impls/claude-mcp-prediction/index.js +29 -99
- package/dist/harnesses/impls/claude-mcp-prediction/index.js.map +1 -1
- package/dist/harnesses/impls/claude-mcp-prediction/mcp-tools.js +4 -21
- package/dist/harnesses/impls/claude-mcp-prediction/mcp-tools.js.map +1 -1
- package/dist/harnesses/impls/claude-mcp-prediction/session-orchestrator.d.ts +2 -0
- package/dist/harnesses/impls/claude-mcp-prediction/session-orchestrator.js +1 -1
- package/dist/harnesses/impls/claude-mcp-prediction/session-orchestrator.js.map +1 -1
- package/dist/harnesses/impls/claude-mcp-prediction-apy/index.js +30 -79
- package/dist/harnesses/impls/claude-mcp-prediction-apy/index.js.map +1 -1
- package/dist/harnesses/impls/claude-mcp-prediction-apy/mcp-tools.js +4 -19
- package/dist/harnesses/impls/claude-mcp-prediction-apy/mcp-tools.js.map +1 -1
- package/dist/harnesses/impls/claude-mcp-prediction-apy/session-orchestrator.d.ts +2 -0
- package/dist/harnesses/impls/claude-mcp-prediction-apy/session-orchestrator.js +1 -1
- package/dist/harnesses/impls/claude-mcp-prediction-apy/session-orchestrator.js.map +1 -1
- package/dist/harnesses/impls/claude-mcp-shared/mcp-server-script.d.ts +39 -0
- package/dist/harnesses/impls/claude-mcp-shared/mcp-server-script.js +62 -0
- package/dist/harnesses/impls/claude-mcp-shared/mcp-server-script.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-shared/mcp-server.d.ts +40 -0
- package/dist/harnesses/impls/claude-mcp-shared/mcp-server.js +44 -0
- package/dist/harnesses/impls/claude-mcp-shared/mcp-server.js.map +1 -0
- package/dist/harnesses/impls/claude-mcp-shared/single-session-harness.d.ts +56 -0
- package/dist/harnesses/impls/claude-mcp-shared/single-session-harness.js +79 -0
- package/dist/harnesses/impls/claude-mcp-shared/single-session-harness.js.map +1 -0
- package/dist/harnesses/impls/hermes-agent/adapter.d.ts +2 -0
- package/dist/harnesses/impls/hermes-agent/adapter.js +8 -5
- package/dist/harnesses/impls/hermes-agent/adapter.js.map +1 -1
- package/dist/harnesses/impls/hermes-agent/bootstrap.d.ts +1 -0
- package/dist/harnesses/impls/hermes-agent/bootstrap.js +6 -1
- package/dist/harnesses/impls/hermes-agent/bootstrap.js.map +1 -1
- package/dist/harnesses/impls/hermes-agent/harness.d.ts +25 -3
- package/dist/harnesses/impls/hermes-agent/harness.js +89 -5
- package/dist/harnesses/impls/hermes-agent/harness.js.map +1 -1
- package/dist/harnesses/impls/index.d.ts +2 -0
- package/dist/harnesses/impls/index.js +10 -1
- package/dist/harnesses/impls/index.js.map +1 -1
- package/dist/harnesses/impls/jinn-repo-evaluator/eval-runner.d.ts +34 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/eval-runner.js +111 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/eval-runner.js.map +1 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/evaluator.d.ts +24 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/evaluator.js +19 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/evaluator.js.map +1 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/harness.d.ts +64 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/harness.js +125 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/harness.js.map +1 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/repro.d.ts +32 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/repro.js +73 -0
- package/dist/harnesses/impls/jinn-repo-evaluator/repro.js.map +1 -0
- package/dist/harnesses/impls/learner/adapters/claude-code.js +5 -0
- package/dist/harnesses/impls/learner/adapters/claude-code.js.map +1 -1
- package/dist/harnesses/impls/learner/adapters/codex-code.d.ts +11 -1
- package/dist/harnesses/impls/learner/adapters/codex-code.js +130 -15
- package/dist/harnesses/impls/learner/adapters/codex-code.js.map +1 -1
- package/dist/harnesses/impls/learner/harness.d.ts +29 -1
- package/dist/harnesses/impls/learner/harness.js +85 -1
- package/dist/harnesses/impls/learner/harness.js.map +1 -1
- package/dist/harnesses/impls/learner/harvest.d.ts +2 -0
- package/dist/harnesses/impls/learner/harvest.js +51 -1
- package/dist/harnesses/impls/learner/harvest.js.map +1 -1
- package/dist/harnesses/impls/learner/plugin-path.js +1 -0
- package/dist/harnesses/impls/learner/plugin-path.js.map +1 -1
- package/dist/harnesses/impls/portfolio-v0-evaluator/index.d.ts +5 -15
- package/dist/harnesses/impls/portfolio-v0-evaluator/index.js +10 -29
- package/dist/harnesses/impls/portfolio-v0-evaluator/index.js.map +1 -1
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/index.d.ts +5 -15
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/index.js +10 -23
- package/dist/harnesses/impls/prediction-apy-v0-evaluator/index.js.map +1 -1
- package/dist/harnesses/impls/prediction-v0-evaluator/index.d.ts +5 -15
- package/dist/harnesses/impls/prediction-v0-evaluator/index.js +10 -25
- package/dist/harnesses/impls/prediction-v0-evaluator/index.js.map +1 -1
- package/dist/harnesses/impls/stub.d.ts +2 -2
- package/dist/harnesses/impls/stub.js +2 -2
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/eval-runner.js +8 -0
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/eval-runner.js.map +1 -1
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/harness.js +3 -1
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/harness.js.map +1 -1
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/index.d.ts +2 -2
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/index.js +3 -1
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/index.js.map +1 -1
- package/dist/harnesses/readiness-registry.d.ts +16 -0
- package/dist/harnesses/readiness-registry.js +28 -6
- package/dist/harnesses/readiness-registry.js.map +1 -1
- package/dist/harnesses/types.d.ts +26 -0
- package/dist/learner/revert-decision.d.ts +16 -1
- package/dist/learner/revert-decision.js +38 -18
- package/dist/learner/revert-decision.js.map +1 -1
- package/dist/learner/revert-stats.d.ts +14 -0
- package/dist/learner/revert-stats.js +42 -0
- package/dist/learner/revert-stats.js.map +1 -1
- package/dist/learner/verification-gate.d.ts +53 -0
- package/dist/learner/verification-gate.js +80 -0
- package/dist/learner/verification-gate.js.map +1 -0
- package/dist/local-provider-url.d.ts +3 -0
- package/dist/local-provider-url.js +28 -0
- package/dist/local-provider-url.js.map +1 -0
- package/dist/main.js +188 -566
- package/dist/main.js.map +1 -1
- package/dist/mcp/acquire-artifact.d.ts +3 -3
- package/dist/mcp/acquire-artifact.js +3 -3
- package/dist/mcp/operator-server.js +1 -1
- package/dist/mcp/operator-server.js.map +1 -1
- package/dist/mcp/server.js +5 -6
- package/dist/mcp/server.js.map +1 -1
- package/dist/monitoring/net-liveness.d.ts +143 -0
- package/dist/monitoring/net-liveness.js +301 -0
- package/dist/monitoring/net-liveness.js.map +1 -0
- package/dist/observability/emit-event.d.ts +1 -1
- package/dist/observability/emit-event.js +0 -4
- package/dist/observability/emit-event.js.map +1 -1
- package/dist/observability/progress.d.ts +11 -0
- package/dist/observability/progress.js +16 -0
- package/dist/observability/progress.js.map +1 -0
- package/dist/pilot/cost.d.ts +19 -0
- package/dist/pilot/cost.js +31 -0
- package/dist/pilot/cost.js.map +1 -0
- package/dist/pilot/instance.d.ts +20 -0
- package/dist/pilot/instance.js +19 -0
- package/dist/pilot/instance.js.map +1 -0
- package/dist/pilot/repo.d.ts +31 -0
- package/dist/pilot/repo.js +42 -0
- package/dist/pilot/repo.js.map +1 -0
- package/dist/pilot/solve.d.ts +22 -0
- package/dist/pilot/solve.js +37 -0
- package/dist/pilot/solve.js.map +1 -0
- package/dist/pilot/tally.d.ts +35 -0
- package/dist/pilot/tally.js +61 -0
- package/dist/pilot/tally.js.map +1 -0
- package/dist/plugins/learner/.claude-plugin/plugin.json +1 -1
- package/dist/plugins/learner/.codex-plugin/plugin.json +1 -1
- package/dist/plugins/learner/hooks/session-start +30 -1
- package/dist/plugins/learner/skills/learn/consolidator-prompt.md +4 -0
- package/dist/plugins/local-trace-distiller/.claude-plugin/plugin.json +9 -0
- package/dist/plugins/local-trace-distiller/.codex-plugin/plugin.json +41 -0
- package/dist/plugins/local-trace-distiller/.mcp.json +8 -0
- package/dist/plugins/local-trace-distiller/README.md +27 -0
- package/dist/plugins/local-trace-distiller/jinn.plugin.json +36 -0
- package/dist/plugins/local-trace-distiller/skills/distill/SKILL.md +51 -0
- package/dist/preflight/deployment-readiness.d.ts +127 -0
- package/dist/preflight/deployment-readiness.js +308 -0
- package/dist/preflight/deployment-readiness.js.map +1 -0
- package/dist/preflight/pidfile-liveness.d.ts +7 -1
- package/dist/preflight/pidfile-liveness.js +14 -0
- package/dist/preflight/pidfile-liveness.js.map +1 -1
- package/dist/preflight/rpc-network.d.ts +10 -3
- package/dist/preflight/rpc-network.js +46 -13
- package/dist/preflight/rpc-network.js.map +1 -1
- package/dist/preflight/stable-cwd.d.ts +29 -0
- package/dist/preflight/stable-cwd.js +98 -0
- package/dist/preflight/stable-cwd.js.map +1 -0
- package/dist/rpc/transport.d.ts +43 -5
- package/dist/rpc/transport.js +131 -30
- package/dist/rpc/transport.js.map +1 -1
- package/dist/scripts/swe-rebench-v2-seed-pool.json +2 -1
- package/dist/solver-nets/registry.d.ts +19 -0
- package/dist/solver-nets/registry.js +95 -66
- package/dist/solver-nets/registry.js.map +1 -1
- package/dist/solver-types/_jinn-repo-pool.d.ts +27 -0
- package/dist/solver-types/_jinn-repo-pool.js +27 -0
- package/dist/solver-types/_jinn-repo-pool.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-held-out-slate.d.ts +76 -0
- package/dist/solver-types/_swe-rebench-v2-held-out-slate.js +156 -0
- package/dist/solver-types/_swe-rebench-v2-held-out-slate.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-pool-recovery.d.ts +81 -0
- package/dist/solver-types/_swe-rebench-v2-pool-recovery.js +116 -0
- package/dist/solver-types/_swe-rebench-v2-pool-recovery.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-state.d.ts +9 -0
- package/dist/solver-types/_swe-rebench-v2-state.js +14 -0
- package/dist/solver-types/_swe-rebench-v2-state.js.map +1 -1
- package/dist/solver-types/_swe-rebench-v2-validated-pool.d.ts +30 -0
- package/dist/solver-types/_swe-rebench-v2-validated-pool.js +40 -0
- package/dist/solver-types/_swe-rebench-v2-validated-pool.js.map +1 -1
- package/dist/solver-types/index.js +2 -0
- package/dist/solver-types/index.js.map +1 -1
- package/dist/solver-types/jinn-repo-admit.d.ts +17 -0
- package/dist/solver-types/jinn-repo-admit.js +16 -0
- package/dist/solver-types/jinn-repo-admit.js.map +1 -0
- package/dist/solver-types/jinn-repo-auto.d.ts +60 -0
- package/dist/solver-types/jinn-repo-auto.js +163 -0
- package/dist/solver-types/jinn-repo-auto.js.map +1 -0
- package/dist/solver-types/jinn-repo-definition.d.ts +15 -0
- package/dist/solver-types/jinn-repo-definition.js +34 -0
- package/dist/solver-types/jinn-repo-definition.js.map +1 -0
- package/dist/solver-types/jinn-repo-extract.d.ts +16 -0
- package/dist/solver-types/jinn-repo-extract.js +32 -0
- package/dist/solver-types/jinn-repo-extract.js.map +1 -0
- package/dist/solver-types/jinn-repo.d.ts +21 -0
- package/dist/solver-types/jinn-repo.js +23 -0
- package/dist/solver-types/jinn-repo.js.map +1 -0
- package/dist/solver-types/learner-loop-test.js +1 -1
- package/dist/solver-types/learner-loop-test.js.map +1 -1
- package/dist/solver-types/slates/held-out-slate.swe-rebench-v2.v1.json +20 -0
- package/dist/solver-types/slates/held-out-slate.swe-rebench-v2.v2.json +19 -0
- package/dist/solver-types/slates/held-out-slate.swe-rebench-v2.v2.screening-report.json +628 -0
- package/dist/solver-types/solver-type.d.ts +8 -0
- package/dist/solver-types/swe-rebench-v2.d.ts +2 -0
- package/dist/solver-types/swe-rebench-v2.js +115 -10
- package/dist/solver-types/swe-rebench-v2.js.map +1 -1
- package/dist/solvernets/launched-record-dispatcher.d.ts +5 -0
- package/dist/solvernets/launched-record-dispatcher.js +14 -1
- package/dist/solvernets/launched-record-dispatcher.js.map +1 -1
- package/dist/solvernets/registry-client-erc8004.js +29 -37
- package/dist/solvernets/registry-client-erc8004.js.map +1 -1
- package/dist/solvernets/registry-client.d.ts +6 -0
- package/dist/solvernets/store.d.ts +1 -1
- package/dist/solvernets/store.js +8 -3
- package/dist/solvernets/store.js.map +1 -1
- package/dist/spend/ai-units-config.d.ts +10 -0
- package/dist/spend/ai-units-config.js +7 -1
- package/dist/spend/ai-units-config.js.map +1 -1
- package/dist/spend/ai-units.d.ts +51 -0
- package/dist/spend/ai-units.js +73 -0
- package/dist/spend/ai-units.js.map +1 -1
- package/dist/spend/credential.d.ts +2 -2
- package/dist/spend/credential.js +9 -3
- package/dist/spend/credential.js.map +1 -1
- package/dist/spend/record.js +12 -5
- package/dist/spend/record.js.map +1 -1
- package/dist/spend/spend-cap.d.ts +10 -0
- package/dist/spend/spend-cap.js +13 -0
- package/dist/spend/spend-cap.js.map +1 -0
- package/dist/spend/usage.js +39 -3
- package/dist/spend/usage.js.map +1 -1
- package/dist/store/store.d.ts +106 -5
- package/dist/store/store.js +194 -8
- package/dist/store/store.js.map +1 -1
- package/dist/trajectory/emit.d.ts +6 -0
- package/dist/trajectory/emit.js +9 -1
- package/dist/trajectory/emit.js.map +1 -1
- package/dist/trajectory/harness-bundle-schema.d.ts +1 -1
- package/dist/trajectory/harness-bundle-schema.js +1 -1
- package/dist/trajectory/harness-bundle-schema.js.map +1 -1
- package/dist/trajectory/processors/identity-scrub.js +22 -3
- package/dist/trajectory/processors/identity-scrub.js.map +1 -1
- package/dist/trajectory/schema.d.ts +1 -1
- package/dist/trajectory/schema.js +1 -1
- package/dist/trajectory/schema.js.map +1 -1
- package/dist/trajectory/scrub/build.d.ts +46 -0
- package/dist/trajectory/scrub/build.js +76 -0
- package/dist/trajectory/scrub/build.js.map +1 -0
- package/dist/trajectory/scrub/emit-scrub.d.ts +41 -0
- package/dist/trajectory/scrub/emit-scrub.js +88 -0
- package/dist/trajectory/scrub/emit-scrub.js.map +1 -0
- package/dist/trajectory/scrub/key-policy.d.ts +20 -0
- package/dist/trajectory/scrub/key-policy.js +43 -0
- package/dist/trajectory/scrub/key-policy.js.map +1 -0
- package/dist/trajectory/scrub/layer2.d.ts +23 -0
- package/dist/trajectory/scrub/layer2.js +33 -0
- package/dist/trajectory/scrub/layer2.js.map +1 -0
- package/dist/trajectory/scrub/ml-pii-stage.d.ts +24 -0
- package/dist/trajectory/scrub/ml-pii-stage.js +43 -0
- package/dist/trajectory/scrub/ml-pii-stage.js.map +1 -0
- package/dist/trajectory/scrub/openredaction-stage.d.ts +178 -0
- package/dist/trajectory/scrub/openredaction-stage.js +269 -0
- package/dist/trajectory/scrub/openredaction-stage.js.map +1 -0
- package/dist/trajectory/scrub/pii-build.d.ts +31 -0
- package/dist/trajectory/scrub/pii-build.js +64 -0
- package/dist/trajectory/scrub/pii-build.js.map +1 -0
- package/dist/trajectory/scrub/pipeline.d.ts +37 -0
- package/dist/trajectory/scrub/pipeline.js +83 -0
- package/dist/trajectory/scrub/pipeline.js.map +1 -0
- package/dist/trajectory/scrub/plain-patterns-stage.d.ts +31 -0
- package/dist/trajectory/scrub/plain-patterns-stage.js +85 -0
- package/dist/trajectory/scrub/plain-patterns-stage.js.map +1 -0
- package/dist/trajectory/scrub/secretlint-stage.d.ts +35 -0
- package/dist/trajectory/scrub/secretlint-stage.js +250 -0
- package/dist/trajectory/scrub/secretlint-stage.js.map +1 -0
- package/dist/trajectory/scrub/transformers-detector.d.ts +35 -0
- package/dist/trajectory/scrub/transformers-detector.js +68 -0
- package/dist/trajectory/scrub/transformers-detector.js.map +1 -0
- package/dist/trajectory/scrub/types.d.ts +25 -0
- package/dist/trajectory/scrub/types.js +2 -0
- package/dist/trajectory/scrub/types.js.map +1 -0
- package/dist/trajectory/transcript-parsers/types.d.ts +1 -1
- package/dist/trajectory/transcript-parsers/types.js +1 -1
- package/dist/trajectory/transcript-parsers/types.js.map +1 -1
- package/dist/trajectory/transcript-watcher.d.ts +26 -0
- package/dist/trajectory/transcript-watcher.js +33 -0
- package/dist/trajectory/transcript-watcher.js.map +1 -1
- package/dist/tx-retry.d.ts +12 -0
- package/dist/tx-retry.js +41 -12
- package/dist/tx-retry.js.map +1 -1
- package/dist/types/envelope.d.ts +1 -1
- package/dist/types/envelope.js +1 -1
- package/dist/types/envelope.js.map +1 -1
- package/dist/types/payloads/index.d.ts +1 -1
- package/dist/types/payloads/index.js +7 -1
- package/dist/types/payloads/index.js.map +1 -1
- package/dist/types/payloads/portfolio-v0.d.ts +1 -1
- package/dist/types/payloads/portfolio-v0.js +1 -1
- package/dist/types/payloads/portfolio-v0.js.map +1 -1
- package/dist/types/payloads/prediction-apy-v0.d.ts +1 -1
- package/dist/types/payloads/prediction-apy-v0.js +1 -1
- package/dist/types/payloads/prediction-apy-v0.js.map +1 -1
- package/dist/types/payloads/prediction-v0.d.ts +1 -1
- package/dist/types/payloads/prediction-v0.js +1 -1
- package/dist/types/payloads/prediction-v0.js.map +1 -1
- package/dist/types/portfolio.d.ts +1 -1
- package/dist/types/portfolio.js +1 -1
- package/dist/types/portfolio.js.map +1 -1
- package/dist/types/prediction-apy.d.ts +1 -1
- package/dist/types/prediction-apy.js +1 -1
- package/dist/types/prediction-apy.js.map +1 -1
- package/dist/types/prediction.d.ts +1 -1
- package/dist/types/prediction.js +1 -1
- package/dist/types/prediction.js.map +1 -1
- package/dist/types/session-provenance.d.ts +1 -1
- package/dist/types/session-provenance.js +1 -1
- package/dist/types/session-provenance.js.map +1 -1
- package/dist/types/skill-artifact.d.ts +442 -0
- package/dist/types/skill-artifact.js +137 -0
- package/dist/types/skill-artifact.js.map +1 -0
- package/dist/types/task-document.d.ts +315 -1
- package/dist/types/task-document.js +9 -1
- package/dist/types/task-document.js.map +1 -1
- package/dist/types/task-run-read-model.d.ts +21 -0
- package/dist/types/task-run-read-model.js +2 -0
- package/dist/types/task-run-read-model.js.map +1 -0
- package/dist/types/task-run.d.ts +75 -0
- package/dist/types/task-run.js +2 -0
- package/dist/types/task-run.js.map +1 -0
- package/dist/types/task.d.ts +29 -1
- package/dist/types/task.js +1 -1
- package/dist/types/task.js.map +1 -1
- package/dist/types/window.d.ts +1 -1
- package/dist/types/window.js +1 -1
- package/dist/types/window.js.map +1 -1
- package/dist/util/redact-rpc-urls.d.ts +1 -1
- package/dist/util/redact-rpc-urls.js +57 -2
- package/dist/util/redact-rpc-urls.js.map +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/checkpoint.d.ts +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/checkpoint.js +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/contracts.d.ts +3 -2
- package/dist/vendor/@jinn-network/sdk/dist/contracts.js +49 -0
- package/dist/vendor/@jinn-network/sdk/dist/jinn-repo.d.ts +44 -0
- package/dist/vendor/@jinn-network/sdk/dist/jinn-repo.js +25 -0
- package/dist/vendor/@jinn-network/sdk/dist/json-schema.d.ts +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/json-schema.js +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/payloads/jinn-repo.d.ts +38 -0
- package/dist/vendor/@jinn-network/sdk/dist/payloads/jinn-repo.js +22 -0
- package/dist/vendor/@jinn-network/sdk/dist/payloads/prediction-v1.d.ts +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/payloads/prediction-v1.js +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/payloads/session-derived.d.ts +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/payloads/session-derived.js +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/payloads/swe-rebench-v2.d.ts +109 -2
- package/dist/vendor/@jinn-network/sdk/dist/payloads/swe-rebench-v2.js +26 -2
- package/dist/vendor/@jinn-network/sdk/dist/prediction-v1.d.ts +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/prediction-v1.js +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/jinn-repo.d.ts +4 -0
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/jinn-repo.js +2 -0
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/manifest-schema.d.ts +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/manifest-schema.js +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/swe-rebench-v2-held-out-slate.d.ts +65 -0
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/swe-rebench-v2-held-out-slate.js +123 -0
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/swe-rebench-v2.d.ts +2 -2
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/swe-rebench-v2.js +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/swe-rebench-v2.d.ts +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/swe-rebench-v2.js +1 -1
- package/dist/vendor/@jinn-network/sdk/package.json +9 -1
- package/docker-compose.yml +3 -2
- package/package.json +43 -28
- package/plugins/jinn-repo-runtime/.claude-plugin/plugin.json +5 -0
- package/plugins/jinn-repo-runtime/.codex-plugin/plugin.json +39 -0
- package/plugins/jinn-repo-runtime/README.md +27 -0
- package/plugins/jinn-repo-runtime/hooks/hooks.json +16 -0
- package/plugins/jinn-repo-runtime/hooks/session-start +73 -0
- package/plugins/jinn-repo-runtime/jinn.plugin.json +11 -0
- package/plugins/jinn-repo-runtime/skills/task/SKILL.md +92 -0
- package/plugins/learner/.claude-plugin/plugin.json +1 -1
- package/plugins/learner/.codex-plugin/plugin.json +1 -1
- package/plugins/learner/hooks/session-start +30 -1
- package/plugins/learner/skills/learn/consolidator-prompt.md +4 -0
- package/plugins/local-trace-distiller/.claude-plugin/plugin.json +9 -0
- package/plugins/local-trace-distiller/.codex-plugin/plugin.json +41 -0
- package/plugins/local-trace-distiller/.mcp.json +8 -0
- package/plugins/local-trace-distiller/README.md +27 -0
- package/plugins/local-trace-distiller/jinn.plugin.json +36 -0
- package/plugins/local-trace-distiller/skills/distill/SKILL.md +51 -0
- package/plugins/swe-rebench-v2-runtime/hooks/hooks.json +16 -0
- package/plugins/swe-rebench-v2-runtime/hooks/session-start +74 -0
- package/deployments/deployment-jinn-mvi-l1-sepolia-fast.json +0 -55
- package/deployments/deployment-jinn-mvi-l1-sepolia.json +0 -55
- package/deployments/deployment-jinn-mvi-l2-baseSepolia.json +0 -13
- package/deployments/deployment-jinn-testnet-faucet-baseSepolia-fast.json +0 -15
- package/dist/api/peers.js.map +0 -1
- package/dist/daemon/jinn-claim-loop-canonical.d.ts +0 -207
- package/dist/daemon/jinn-claim-loop-canonical.js +0 -296
- package/dist/daemon/jinn-claim-loop-canonical.js.map +0 -1
- package/dist/daemon/jinn-claim-loop-mock.d.ts +0 -61
- package/dist/daemon/jinn-claim-loop-mock.js +0 -122
- package/dist/daemon/jinn-claim-loop-mock.js.map +0 -1
- package/dist/daemon/jinn-claim-loop-wiring.d.ts +0 -33
- package/dist/daemon/jinn-claim-loop-wiring.js +0 -40
- package/dist/daemon/jinn-claim-loop-wiring.js.map +0 -1
- package/dist/daemon/jinn-claim-loop.d.ts +0 -130
- package/dist/daemon/jinn-claim-loop.js +0 -328
- package/dist/daemon/jinn-claim-loop.js.map +0 -1
- package/dist/dashboard/assets/index-CzKxvMcU.css +0 -32
- package/dist/dashboard/assets/index-yVemxHot.js +0 -351
- package/dist/earning/jinn-rewards.js.map +0 -1
- package/dist/scripts/donation-consumption-acceptance.d.ts +0 -85
- package/dist/scripts/donation-consumption-acceptance.js +0 -1382
- package/dist/scripts/donation-consumption-acceptance.js.map +0 -1
- package/dist/x402/acquire.d.ts +0 -17
- package/dist/x402/acquire.js +0 -49
- package/dist/x402/acquire.js.map +0 -1
- package/dist/x402/facilitator.d.ts +0 -11
- package/dist/x402/facilitator.js +0 -52
- package/dist/x402/facilitator.js.map +0 -1
- package/dist/x402/handler.d.ts +0 -27
- package/dist/x402/handler.js +0 -236
- package/dist/x402/handler.js.map +0 -1
- /package/dist/{api/peers.d.ts → daemon/peer-sync.d.ts} +0 -0
package/dist/main.js
CHANGED
|
@@ -24,7 +24,7 @@ import { homedir, hostname, userInfo } from 'node:os';
|
|
|
24
24
|
import { randomBytes as cryptoRandomBytes } from 'node:crypto';
|
|
25
25
|
import { dirname, join } from 'node:path';
|
|
26
26
|
import { fileURLToPath } from 'node:url';
|
|
27
|
-
import { loadConfig, getConfigPathFromArgs, DEFAULT_CONFIG_PATH } from './config.js';
|
|
27
|
+
import { loadConfig, getConfigPathFromArgs, DEFAULT_CONFIG_PATH, DEFAULT_TESTNET_RPC_URLS } from './config.js';
|
|
28
28
|
import { Store } from './store/store.js';
|
|
29
29
|
import { startApiServer, isEmbeddedAgentEnabled } from './api/server.js';
|
|
30
30
|
import { setDefaultTxSubmissionLedger } from './tx-retry.js';
|
|
@@ -34,33 +34,37 @@ import { CapturePublishUnavailableError } from './api/captures.js';
|
|
|
34
34
|
import { invalidatePredictionOperatorStatusCache } from './api/gather-status.js';
|
|
35
35
|
import { ensureUiToken } from './api/ui-token.js';
|
|
36
36
|
import { getFileLogger, closeFileLogger } from './observability/file-logger.js';
|
|
37
|
+
import { emitProgress } from './observability/progress.js';
|
|
37
38
|
import { hashImplStateDir } from './harnesses/freeze.js';
|
|
38
39
|
import { readModeState } from './harnesses/mode-state.js';
|
|
39
40
|
import { attachAgentWs, updateAgentClaudePath } from './agent/agent-ws.js';
|
|
40
41
|
import { createSetupModeController } from './setup-mode.js';
|
|
41
42
|
import { requestDaemonRestart } from './restart-daemon.js';
|
|
42
|
-
import {
|
|
43
|
-
import { clearBootstrapError, persistBootstrapError, } from './errors/persisted-bootstrap-error.js';
|
|
43
|
+
import { emitEnvelope } from './errors/envelope.js';
|
|
44
44
|
import { emitStructured } from './events/emitter.js';
|
|
45
45
|
import { applyPidfileLivenessGate } from './preflight/pidfile-liveness.js';
|
|
46
|
+
import { applyDeploymentReadinessGate } from './preflight/deployment-readiness.js';
|
|
47
|
+
import { ensureStableCwd } from './preflight/stable-cwd.js';
|
|
48
|
+
import { detectAuthContext } from './preflight/claude-auth.js';
|
|
46
49
|
import { FleetBootstrapper, recoverEvictedService as recoverEvictedServiceFn } from './earning/bootstrap.js';
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
50
|
+
import { runFleetBootstrap, SetupBootstrapHalted } from './earning/bootstrap-run.js';
|
|
51
|
+
import { applyChainGasOverrides, getChainConfig } from './earning/contracts.js';
|
|
52
|
+
import { getJinnRouterAddress } from './contracts/addresses.js';
|
|
49
53
|
import { FleetStateStore } from './earning/store.js';
|
|
50
|
-
import { isOperationalServiceStep
|
|
51
|
-
import { decryptMnemonic, deriveMasterSigner
|
|
54
|
+
import { isOperationalServiceStep } from './earning/types.js';
|
|
55
|
+
import { decryptMnemonic, deriveMasterSigner } from './earning/wallet.js';
|
|
52
56
|
import { MechAdapter } from './adapters/mech/adapter.js';
|
|
53
57
|
import { ClaudeRunner } from './runner/claude.js';
|
|
54
58
|
import { Daemon } from './daemon/daemon.js';
|
|
55
59
|
import { buildSpendCapConfig } from './spend/daemon-config.js';
|
|
56
60
|
import { buildAiUnitsConfig } from './spend/ai-units-config.js';
|
|
57
61
|
import { REFERENCE_CEILING } from './spend/ai-units.js';
|
|
58
|
-
import {
|
|
59
|
-
import { createJinnPublicClient, createJinnWalletClient, createJinnL1PublicClient, createJinnL1WalletClient } from './earning/viem-clients.js';
|
|
62
|
+
import { createJinnPublicClient, createJinnWalletClient } from './earning/viem-clients.js';
|
|
60
63
|
import { privateKeyToAccount } from 'viem/accounts';
|
|
61
64
|
import { getAddress } from 'viem';
|
|
62
65
|
import { DEFAULT_DISABLED_HARNESSES, DEFAULT_HARNESS, HarnessRegistry, } from './harnesses/engine/registry.js';
|
|
63
|
-
import {
|
|
66
|
+
import { createMutableJoinedSolverNetsView } from './harnesses/engine/engine.js';
|
|
67
|
+
import { createJoinApplier } from './daemon/join-applier.js';
|
|
64
68
|
import { buildHarnesses } from './harnesses/impls/index.js';
|
|
65
69
|
import { loadExternalImpl } from './harnesses/external-impls/index.js';
|
|
66
70
|
import { CLAUDE_CODE_HARNESS, CODEX_HARNESS, HERMES_AGENT_HARNESS, harnessStateDirName } from './harnesses/names.js';
|
|
@@ -72,17 +76,16 @@ import { createCorpus } from './corpus/index.js';
|
|
|
72
76
|
import { DEFAULT_EXECUTION_DISCOVERY_FROM_BLOCK } from './corpus/onchain-query.js';
|
|
73
77
|
import { CapturesStore } from './store/captures.js';
|
|
74
78
|
import { createLiveCapturePublisher } from './captures/live-publisher.js';
|
|
79
|
+
import { EnsurePendingCaptureProcessor, ensurePendingCapture, ingestStopHookCapture } from './captures/ingest.js';
|
|
75
80
|
import { startReceiver } from './trajectory/receiver.js';
|
|
76
81
|
import { startSyntheticSpanProvider, emitSyntheticSpan } from './trajectory/synthetic-span-builder.js';
|
|
77
82
|
import { CredentialScrubProcessor } from './trajectory/processors/credential-scrub.js';
|
|
78
83
|
import { TranscriptContentScrubProcessor } from './trajectory/processors/transcript-content-scrub.js';
|
|
79
84
|
import { IdentityScrubProcessor } from './trajectory/processors/identity-scrub.js';
|
|
80
85
|
import { PathScrubProcessor } from './trajectory/processors/path-scrub.js';
|
|
86
|
+
import { buildScrubPipeline } from './trajectory/scrub/build.js';
|
|
87
|
+
import { maybeBuildPiiDetector } from './trajectory/scrub/pii-build.js';
|
|
81
88
|
import { SqliteExporterProcessor } from './trajectory/processors/sqlite-exporter.js';
|
|
82
|
-
import { ClaudeCodeJsonlParser } from './trajectory/transcript-parsers/claude-code-jsonl.js';
|
|
83
|
-
import { CodexSessionParser } from './trajectory/transcript-parsers/codex-session.js';
|
|
84
|
-
import { GeminiSessionParser } from './trajectory/transcript-parsers/gemini-session.js';
|
|
85
|
-
import { CursorSqliteParser } from './trajectory/transcript-parsers/cursor-sqlite.js';
|
|
86
89
|
import { startTranscriptWatcher, } from './trajectory/transcript-watcher.js';
|
|
87
90
|
import { defaultTranscriptWatchDirectories } from './trajectory/transcript-session-dirs.js';
|
|
88
91
|
import { buildInfo } from './build-info.js';
|
|
@@ -91,7 +94,6 @@ import { GeneratedTaskSource, StaticConfiguredTaskSource, filterBindableTasks }
|
|
|
91
94
|
import { checkRpcNetwork, logRpcLocalDevToStderr, probeFallbackChain, rpcNetworkFailureHint, summarizeFallbackChain, } from './preflight/rpc-network.js';
|
|
92
95
|
import { apiPortFailureMessage, checkApiPortAvailable } from './preflight/api-port.js';
|
|
93
96
|
import { openBrowser } from './cli/open-browser.js';
|
|
94
|
-
import { keepSetupUiOnBootstrapError } from './setup/halt-mode.js';
|
|
95
97
|
if (process.env['JINN_LOAD_DEV_ENV'] === '1' || process.env['NODE_ENV'] === 'development') {
|
|
96
98
|
dotenvConfig({ path: join(dirname(fileURLToPath(import.meta.url)), '..', '.env') });
|
|
97
99
|
}
|
|
@@ -161,6 +163,11 @@ let activeClaudePath = config.claudePath ?? 'claude';
|
|
|
161
163
|
const selectClaudePath = (claudePath) => {
|
|
162
164
|
activeClaudePath = claudePath;
|
|
163
165
|
config.claudePath = claudePath;
|
|
166
|
+
// Harmless no-op when the embedded agent is disabled
|
|
167
|
+
// (`embeddedAgentEnabled` is false at this point): the agent surface
|
|
168
|
+
// that consumes this path isn't mounted, so the update has nothing to
|
|
169
|
+
// propagate to. Called unconditionally to keep the path in sync
|
|
170
|
+
// whenever the agent IS enabled.
|
|
164
171
|
updateAgentClaudePath(claudePath);
|
|
165
172
|
};
|
|
166
173
|
const NETWORK_CHAIN = config.network === 'testnet' ? 'base-sepolia' : 'base';
|
|
@@ -173,21 +180,18 @@ const CHAIN_CONFIG = applyChainGasOverrides(getChainConfig(NETWORK_CHAIN, {
|
|
|
173
180
|
minEoaGasWei: config.minEoaGasWei,
|
|
174
181
|
minSafeEthWei: config.minSafeEthWei,
|
|
175
182
|
});
|
|
176
|
-
const MESSENGER_MODE_EXPLICIT = process.env['JINN_MESSENGER_MODE'] !== undefined ||
|
|
177
|
-
configFileHasTopLevelKey(CONFIG_PATH, 'jinnMessengerMode');
|
|
178
|
-
const JINN_MVI_CONFIG = loadJinnMviConfig({
|
|
179
|
-
l1ArtifactPath: config.jinnMviL1DeploymentPath ??
|
|
180
|
-
(config.network === 'testnet' ? DEFAULT_TESTNET_ARTIFACTS.jinnMviL1 : undefined),
|
|
181
|
-
l2ArtifactPath: config.jinnMviL2DeploymentPath ??
|
|
182
|
-
(config.network === 'testnet' ? DEFAULT_TESTNET_ARTIFACTS.jinnMviL2 : undefined),
|
|
183
|
-
distributorAddress: config.jinnDistributorAddress,
|
|
184
|
-
messengerAddress: config.jinnMessengerAddress,
|
|
185
|
-
claimEmitterAddress: config.jinnClaimEmitterAddress,
|
|
186
|
-
messengerMode: MESSENGER_MODE_EXPLICIT ? config.jinnMessengerMode : undefined,
|
|
187
|
-
});
|
|
188
|
-
const JINN_CLAIM_MESSENGER_MODE = JINN_MVI_CONFIG.messengerMode ?? config.jinnMessengerMode;
|
|
189
183
|
const MARKETPLACE_ADDRESS = CHAIN_CONFIG.mechMarketplace;
|
|
190
|
-
const ROUTER_ADDRESS = (CHAIN_CONFIG.jinnRouter ??
|
|
184
|
+
const ROUTER_ADDRESS = (CHAIN_CONFIG.jinnRouter ?? getJinnRouterAddress(CHAIN_CONFIG.chainId));
|
|
185
|
+
/** #913: the bundled public RPC fallback chain for the current network. The
|
|
186
|
+
* setup/network endpoint persists `[primary, ...RPC_PUBLIC_DEFAULTS]` so the
|
|
187
|
+
* operator keeps the public backup chain when they set a primary, and the
|
|
188
|
+
* Settings → Network UI renders these as the trailing read-only slots. */
|
|
189
|
+
const RPC_PUBLIC_DEFAULTS = NETWORK_CHAIN === 'base-sepolia' ? DEFAULT_TESTNET_RPC_URLS : [CHAIN_CONFIG.rpcUrl];
|
|
190
|
+
/** #913: last L2 boot-probe result per RPC slot. Captured at boot, surfaced
|
|
191
|
+
* via /v1/bootstrap so Settings → Network can render per-slot health. Hosts
|
|
192
|
+
* are already masked by probeFallbackChain. The RPC chain is restart-required,
|
|
193
|
+
* so this never drifts without a re-probing restart. */
|
|
194
|
+
let lastL2Probe = [];
|
|
191
195
|
function configFileHasTopLevelKey(configPath, key) {
|
|
192
196
|
const filePath = configPath ?? join(process.env['HOME'] ?? '', '.jinn-client', 'config.json');
|
|
193
197
|
if (!filePath || !existsSync(filePath))
|
|
@@ -200,455 +204,17 @@ function configFileHasTopLevelKey(configPath, key) {
|
|
|
200
204
|
return false;
|
|
201
205
|
}
|
|
202
206
|
}
|
|
203
|
-
class EnsurePendingCaptureProcessor {
|
|
204
|
-
captures;
|
|
205
|
-
constructor(captures) {
|
|
206
|
-
this.captures = captures;
|
|
207
|
-
}
|
|
208
|
-
forceFlush() { return Promise.resolve(); }
|
|
209
|
-
shutdown() { return Promise.resolve(); }
|
|
210
|
-
onStart() { }
|
|
211
|
-
onEnd(span) {
|
|
212
|
-
const sessionId = stringAttribute(span.attributes['jinn.session.id']);
|
|
213
|
-
if (!sessionId)
|
|
214
|
-
return;
|
|
215
|
-
ensurePendingCapture(this.captures, {
|
|
216
|
-
sessionId,
|
|
217
|
-
capturedAt: hrTimeToIso(span.startTime),
|
|
218
|
-
tool: inferCaptureTool(span),
|
|
219
|
-
capturePath: inferCapturePath(span),
|
|
220
|
-
...repoMetadataFromSpan(span),
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
function stringAttribute(value) {
|
|
225
|
-
return typeof value === 'string' && value.trim() !== '' ? value : undefined;
|
|
226
|
-
}
|
|
227
|
-
function hrTimeToIso(time) {
|
|
228
|
-
const millis = (time[0] * 1000) + Math.floor(time[1] / 1_000_000);
|
|
229
|
-
return new Date(millis).toISOString();
|
|
230
|
-
}
|
|
231
|
-
function inferCaptureTool(span) {
|
|
232
|
-
return stringAttribute(span.attributes['transcript.tool'])
|
|
233
|
-
?? stringAttribute(span.resource.attributes['service.name'])
|
|
234
|
-
?? 'otel';
|
|
235
|
-
}
|
|
236
|
-
function inferCapturePath(span) {
|
|
237
|
-
if (stringAttribute(span.attributes['transcript.tool']))
|
|
238
|
-
return 'B';
|
|
239
|
-
return 'A';
|
|
240
|
-
}
|
|
241
|
-
function repoMetadataFromSpan(span) {
|
|
242
|
-
const attrs = span.attributes;
|
|
243
|
-
const repoRemoteUrl = stringAttribute(attrs['repo.remote_url'])
|
|
244
|
-
?? stringAttribute(attrs['vcs.repository.url'])
|
|
245
|
-
?? stringAttribute(attrs['git.remote_url']);
|
|
246
|
-
const repoCommitHash = stringAttribute(attrs['repo.commit_hash'])
|
|
247
|
-
?? stringAttribute(attrs['vcs.ref.head.revision'])
|
|
248
|
-
?? stringAttribute(attrs['git.commit']);
|
|
249
|
-
return {
|
|
250
|
-
...(repoRemoteUrl ? { repoRemoteUrl } : {}),
|
|
251
|
-
...(repoCommitHash ? { repoCommitHash } : {}),
|
|
252
|
-
};
|
|
253
|
-
}
|
|
254
|
-
function parserForStopHookTool(tool) {
|
|
255
|
-
switch (tool) {
|
|
256
|
-
case 'claude-code':
|
|
257
|
-
return new ClaudeCodeJsonlParser();
|
|
258
|
-
case 'codex':
|
|
259
|
-
return new CodexSessionParser();
|
|
260
|
-
case 'gemini-cli':
|
|
261
|
-
return new GeminiSessionParser();
|
|
262
|
-
case 'cursor':
|
|
263
|
-
return new CursorSqliteParser();
|
|
264
|
-
default: {
|
|
265
|
-
const exhaustive = tool;
|
|
266
|
-
throw new Error(`No transcript parser for stop-hook tool: ${String(exhaustive)}`);
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
function ensurePendingCapture(captures, params) {
|
|
271
|
-
if (captures.getBySession(params.sessionId))
|
|
272
|
-
return;
|
|
273
|
-
try {
|
|
274
|
-
captures.savePending({
|
|
275
|
-
sessionId: params.sessionId,
|
|
276
|
-
capturedAt: params.capturedAt,
|
|
277
|
-
originatingTool: { name: params.tool },
|
|
278
|
-
capturePath: params.capturePath,
|
|
279
|
-
status: 'pending',
|
|
280
|
-
spanCount: 0,
|
|
281
|
-
durationMs: 0,
|
|
282
|
-
redactedSpanCount: 0,
|
|
283
|
-
...(params.repoRemoteUrl ? { repoRemoteUrl: params.repoRemoteUrl } : {}),
|
|
284
|
-
...(params.repoCommitHash ? { repoCommitHash: params.repoCommitHash } : {}),
|
|
285
|
-
});
|
|
286
|
-
}
|
|
287
|
-
catch (err) {
|
|
288
|
-
if (!captures.getBySession(params.sessionId))
|
|
289
|
-
throw err;
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
async function ingestStopHookCapture(captures, receiver, payload) {
|
|
293
|
-
ensurePendingCapture(captures, {
|
|
294
|
-
sessionId: payload.sessionId,
|
|
295
|
-
capturedAt: payload.stoppedAt,
|
|
296
|
-
tool: payload.tool,
|
|
297
|
-
capturePath: 'D',
|
|
298
|
-
});
|
|
299
|
-
if (!payload.transcriptPath)
|
|
300
|
-
return;
|
|
301
|
-
if (!receiver) {
|
|
302
|
-
console.warn('[main] stop-hook capture received but OTLP receiver is unavailable; pending capture has no transcript spans.');
|
|
303
|
-
return;
|
|
304
|
-
}
|
|
305
|
-
const parser = parserForStopHookTool(payload.tool);
|
|
306
|
-
let events;
|
|
307
|
-
try {
|
|
308
|
-
events = await parser.parseFull({ sessionId: payload.sessionId, path: payload.transcriptPath });
|
|
309
|
-
}
|
|
310
|
-
catch (err) {
|
|
311
|
-
console.warn(`[main] stop-hook transcript import failed for ${payload.transcriptPath}: ` +
|
|
312
|
-
`${err instanceof Error ? err.message : String(err)}`);
|
|
313
|
-
return;
|
|
314
|
-
}
|
|
315
|
-
if (events.length === 0)
|
|
316
|
-
return;
|
|
317
|
-
const provider = startSyntheticSpanProvider({
|
|
318
|
-
otlpHttpEndpoint: `http://127.0.0.1:${receiver.httpPort}/v1/traces`,
|
|
319
|
-
});
|
|
320
|
-
try {
|
|
321
|
-
for (const event of events) {
|
|
322
|
-
emitSyntheticSpan(provider, { tool: parser.tool, sessionId: payload.sessionId, event });
|
|
323
|
-
}
|
|
324
|
-
await provider.flush();
|
|
325
|
-
}
|
|
326
|
-
finally {
|
|
327
|
-
await provider.shutdown();
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
const STANDARD_SERVICE_PROGRESSION = [
|
|
331
|
-
'awaiting_stake',
|
|
332
|
-
'staked',
|
|
333
|
-
'mech_deployed',
|
|
334
|
-
'agent_registered',
|
|
335
|
-
'safe_binding_pending',
|
|
336
|
-
'complete',
|
|
337
|
-
];
|
|
338
|
-
const SELF_BOND_SERVICE_PROGRESSION = [
|
|
339
|
-
'awaiting_stake',
|
|
340
|
-
'service_created',
|
|
341
|
-
'service_activated',
|
|
342
|
-
'agents_registered',
|
|
343
|
-
'service_deployed',
|
|
344
|
-
'service_staked',
|
|
345
|
-
'mech_deployed',
|
|
346
|
-
'agent_registered',
|
|
347
|
-
'safe_binding_pending',
|
|
348
|
-
'complete',
|
|
349
|
-
];
|
|
350
|
-
/** §6.2 `bootstrap_incomplete` — `{ currentStep, nextStep }` from persisted fleet state. */
|
|
351
|
-
function bootstrapIncompleteSteps(state) {
|
|
352
|
-
const progression = state.staking_mode === 'self-bond'
|
|
353
|
-
? SELF_BOND_SERVICE_PROGRESSION
|
|
354
|
-
: STANDARD_SERVICE_PROGRESSION;
|
|
355
|
-
const byIndex = [...state.services].sort((a, b) => a.index - b.index);
|
|
356
|
-
const focus = byIndex.find(s => isOperationalServiceStep(s.step) && !s.safe_address) ??
|
|
357
|
-
byIndex.find(s => !isOperationalServiceStep(s.step)) ??
|
|
358
|
-
byIndex.find(s => s.step === 'safe_binding_pending') ??
|
|
359
|
-
byIndex[0];
|
|
360
|
-
if (!focus) {
|
|
361
|
-
return { currentStep: 'awaiting_service', nextStep: 'awaiting_stake' };
|
|
362
|
-
}
|
|
363
|
-
if (isOperationalServiceStep(focus.step) && !focus.safe_address) {
|
|
364
|
-
return { currentStep: 'complete', nextStep: 'bootstrap' };
|
|
365
|
-
}
|
|
366
|
-
const i = progression.indexOf(focus.step);
|
|
367
|
-
if (i === -1) {
|
|
368
|
-
return { currentStep: focus.step, nextStep: 'bootstrap' };
|
|
369
|
-
}
|
|
370
|
-
if (i < progression.length - 1) {
|
|
371
|
-
return { currentStep: focus.step, nextStep: progression[i + 1] };
|
|
372
|
-
}
|
|
373
|
-
return { currentStep: focus.step, nextStep: 'bootstrap' };
|
|
374
|
-
}
|
|
375
|
-
// ── Bootstrap ───────────────────────────────────────────────────────────────
|
|
376
|
-
async function bootstrap() {
|
|
377
|
-
console.log('[main] Running fleet bootstrap...');
|
|
378
|
-
// A fresh bootstrap attempt clears any stale error breadcrumb. If this run
|
|
379
|
-
// hits the same failure, it'll be re-persisted below; if it succeeds (or
|
|
380
|
-
// proceeds past the previously-failed step), the panel returns to a clean
|
|
381
|
-
// state on the next /v1/bootstrap poll.
|
|
382
|
-
clearBootstrapError(config.earningDir);
|
|
383
|
-
// Persist the envelope to disk before emitEnvelope's process.exit fires,
|
|
384
|
-
// so /v1/bootstrap can surface it to the panel after the daemon has
|
|
385
|
-
// exited (operator restart → panel reload → error visible).
|
|
386
|
-
function failBootstrap(input) {
|
|
387
|
-
const envelope = buildEnvelope(input);
|
|
388
|
-
persistBootstrapError(envelope, config.earningDir);
|
|
389
|
-
if (keepSetupUiOnBootstrapError()) {
|
|
390
|
-
emitStructured({
|
|
391
|
-
kind: 'error',
|
|
392
|
-
message: envelope.message,
|
|
393
|
-
errorCode: envelope.code,
|
|
394
|
-
details: {
|
|
395
|
-
phase: 'bootstrap',
|
|
396
|
-
exitCode: envelope.exitCode,
|
|
397
|
-
...(envelope.details ?? {}),
|
|
398
|
-
},
|
|
399
|
-
});
|
|
400
|
-
console.error(`[main] Bootstrap halted (${envelope.code}); setup UI remains available. ` +
|
|
401
|
-
`Resolve the issue and run jinn run again.`);
|
|
402
|
-
throw new SetupBootstrapHalted(envelope);
|
|
403
|
-
}
|
|
404
|
-
emitEnvelope(input);
|
|
405
|
-
// Unreachable in production (emitEnvelope exits); satisfies `never`.
|
|
406
|
-
throw new Error('unreachable');
|
|
407
|
-
}
|
|
408
|
-
const bootstrapper = new FleetBootstrapper({
|
|
409
|
-
earningDir: config.earningDir,
|
|
410
|
-
chain: NETWORK_CHAIN,
|
|
411
|
-
rpcUrl: config.rpcUrl,
|
|
412
|
-
stakingMode: config.stakingMode,
|
|
413
|
-
targetServices: config.targetServices,
|
|
414
|
-
testnetL2DeploymentPath: config.testnetL2DeploymentPath,
|
|
415
|
-
testnetL2TokenDeploymentPath: config.testnetL2TokenDeploymentPath,
|
|
416
|
-
testnetMechDeploymentPath: config.testnetMechDeploymentPath,
|
|
417
|
-
testnetStolasDeploymentPath: config.testnetStolasDeploymentPath,
|
|
418
|
-
debug: config.debug,
|
|
419
|
-
masterEthDailyEstimateWei: config.masterEthDailyEstimateWei,
|
|
420
|
-
minEoaGasWei: config.minEoaGasWei,
|
|
421
|
-
minSafeEthWei: config.minSafeEthWei,
|
|
422
|
-
pollIntervalMs: config.pollIntervalMs,
|
|
423
|
-
autoTestnetFaucet: process.env['JINN_AUTO_TESTNET_FAUCET'] === '1',
|
|
424
|
-
});
|
|
425
|
-
// Funding poll: stay up while waiting for the operator to fund the wallet.
|
|
426
|
-
// The setup-mode API server is already running; the panel renders the
|
|
427
|
-
// funding card and auto-advances when funds land. Daemon-side, we poll
|
|
428
|
-
// bootstrap on a 15s tick and only escalate (exit) if a non-funding error
|
|
429
|
-
// occurs or the configured timeout elapses. Each tick re-runs the full
|
|
430
|
-
// bootstrap state machine — completed steps are no-ops, so this is safe.
|
|
431
|
-
// Testnet faucet funding is panel-driven: bootstrap reports the funding gate,
|
|
432
|
-
// and the operator clicks the funding action before this loop can advance.
|
|
433
|
-
const FUNDING_POLL_INTERVAL_MS = 15_000;
|
|
434
|
-
const fundingTimeoutMs = (() => {
|
|
435
|
-
const raw = process.env['JINN_FUNDING_TIMEOUT_MS'];
|
|
436
|
-
if (!raw)
|
|
437
|
-
return Number.POSITIVE_INFINITY;
|
|
438
|
-
const n = Number.parseInt(raw, 10);
|
|
439
|
-
return Number.isFinite(n) && n > 0 ? n : Number.POSITIVE_INFINITY;
|
|
440
|
-
})();
|
|
441
|
-
emitProgress({
|
|
442
|
-
type: 'progress',
|
|
443
|
-
phase: 'bootstrap',
|
|
444
|
-
step: 'advance_state_machine',
|
|
445
|
-
estimatedWaitMs: 60_000,
|
|
446
|
-
});
|
|
447
|
-
const fundingStartedAt = Date.now();
|
|
448
|
-
let result;
|
|
449
|
-
let lastFundingMessage = '';
|
|
450
|
-
const fundingGatePath = join(config.earningDir, 'bootstrap-funding.json');
|
|
451
|
-
const persistFundingGate = (funding) => {
|
|
452
|
-
mkdirSync(config.earningDir, { recursive: true, mode: 0o700 });
|
|
453
|
-
writeFileSyncMain(fundingGatePath, `${JSON.stringify({
|
|
454
|
-
schemaVersion: 1,
|
|
455
|
-
generatedAt: new Date().toISOString(),
|
|
456
|
-
...funding,
|
|
457
|
-
}, null, 2)}\n`, { mode: 0o600 });
|
|
458
|
-
};
|
|
459
|
-
const clearFundingGate = () => {
|
|
460
|
-
try {
|
|
461
|
-
unlinkSync(fundingGatePath);
|
|
462
|
-
}
|
|
463
|
-
catch {
|
|
464
|
-
// best-effort: absent/stale funding gate should not affect bootstrap
|
|
465
|
-
}
|
|
466
|
-
};
|
|
467
|
-
// eslint-disable-next-line no-constant-condition
|
|
468
|
-
while (true) {
|
|
469
|
-
result = await bootstrapper.ensureStage1And2(PASSWORD);
|
|
470
|
-
if (!result.funding) {
|
|
471
|
-
clearFundingGate();
|
|
472
|
-
break;
|
|
473
|
-
}
|
|
474
|
-
persistFundingGate(result.funding);
|
|
475
|
-
// Emit a structured event so the panel's Visibility region shows the gate.
|
|
476
|
-
// Dedupe by message to avoid spamming the ring buffer on each poll.
|
|
477
|
-
const fundingMsg = result.message ?? 'awaiting funding';
|
|
478
|
-
if (fundingMsg !== lastFundingMessage) {
|
|
479
|
-
emitStructured({
|
|
480
|
-
kind: 'fleet',
|
|
481
|
-
message: fundingMsg,
|
|
482
|
-
details: {
|
|
483
|
-
phase: 'awaiting_funding',
|
|
484
|
-
role: 'master',
|
|
485
|
-
address: result.funding.master_address,
|
|
486
|
-
asset: 'native',
|
|
487
|
-
needWei: result.funding.eth_required,
|
|
488
|
-
haveWei: result.funding.eth_balance,
|
|
489
|
-
},
|
|
490
|
-
});
|
|
491
|
-
// Mirror the structured event to NDJSON progress for --json-progress
|
|
492
|
-
// consumers (CI, agents). Same dedup gate so we don't spam stdout.
|
|
493
|
-
emitProgress({
|
|
494
|
-
type: 'progress',
|
|
495
|
-
phase: 'bootstrap',
|
|
496
|
-
step: 'awaiting_funding',
|
|
497
|
-
blocking: true,
|
|
498
|
-
nextAction: 'Fund the address shown in addresses.fundingAddress, then wait for automatic retry.',
|
|
499
|
-
addresses: { fundingAddress: result.funding.master_address },
|
|
500
|
-
estimatedWaitMs: 1_800_000,
|
|
501
|
-
});
|
|
502
|
-
lastFundingMessage = fundingMsg;
|
|
503
|
-
}
|
|
504
|
-
const elapsed = Date.now() - fundingStartedAt;
|
|
505
|
-
if (elapsed >= fundingTimeoutMs) {
|
|
506
|
-
failBootstrap({
|
|
507
|
-
code: 'funding_required',
|
|
508
|
-
message: `${result.message} (timeout after ${Math.round(elapsed / 1000)}s)`,
|
|
509
|
-
hint: 'Fund the listed address and re-run this command.',
|
|
510
|
-
exampleCli: 'jinn fund-requirements --json',
|
|
511
|
-
details: {
|
|
512
|
-
// jinn-mono-hjex.6: structured envelope so SPA can render the
|
|
513
|
-
// specific address + amount instead of a prose disjunction.
|
|
514
|
-
category: 'insufficient_funds',
|
|
515
|
-
step: 'awaiting_funding',
|
|
516
|
-
address: result.funding.master_address,
|
|
517
|
-
requiredWei: result.funding.eth_required,
|
|
518
|
-
haveWei: result.funding.eth_balance,
|
|
519
|
-
// Legacy aliases kept for any external consumers that read these.
|
|
520
|
-
role: 'master',
|
|
521
|
-
asset: 'native',
|
|
522
|
-
needWei: result.funding.eth_required,
|
|
523
|
-
},
|
|
524
|
-
});
|
|
525
|
-
}
|
|
526
|
-
console.log(`[main] Awaiting funding... (${Math.round(elapsed / 1000)}s elapsed; ` +
|
|
527
|
-
`will retry in ${FUNDING_POLL_INTERVAL_MS / 1000}s)`);
|
|
528
|
-
await new Promise((r) => setTimeout(r, FUNDING_POLL_INTERVAL_MS));
|
|
529
|
-
}
|
|
530
|
-
if (!result.ok) {
|
|
531
|
-
failBootstrap({
|
|
532
|
-
code: 'fatal',
|
|
533
|
-
message: result.message,
|
|
534
|
-
hint: 'Bootstrap failed before the fleet reached a runnable state.',
|
|
535
|
-
details: {
|
|
536
|
-
cause: result.message,
|
|
537
|
-
// jinn-mono-hjex.6: propagate structured category from the bootstrapper
|
|
538
|
-
// so the SPA can render category-specific UI (e.g. funding shortfall).
|
|
539
|
-
...(result.errorCategory !== undefined ? { category: result.errorCategory } : {}),
|
|
540
|
-
// Preserve the raw underlying error so a misclassified summary can
|
|
541
|
-
// be diagnosed without re-running with JINN_DEBUG. See jinn-mono-jz9f.
|
|
542
|
-
...(result.rawErrorMessage && result.rawErrorMessage !== result.message
|
|
543
|
-
? { rawErrorMessage: result.rawErrorMessage }
|
|
544
|
-
: {}),
|
|
545
|
-
// jinn-mono-hjex reviewer fix: propagate tx hash so the SPA can render
|
|
546
|
-
// a block-explorer link for failed on-chain revert transactions.
|
|
547
|
-
...(result.txHash != null ? { txHash: result.txHash } : {}),
|
|
548
|
-
},
|
|
549
|
-
});
|
|
550
|
-
}
|
|
551
|
-
// Legacy migration (jinn-mono-jgp): backfill `agent_id` on `complete`
|
|
552
|
-
// services that pre-date j07. Idempotent + per-service failure-isolated;
|
|
553
|
-
// a failure here does not abort daemon startup, but we surface counts so
|
|
554
|
-
// operators notice. Disabled via `runLegacyMigrations: false` /
|
|
555
|
-
// JINN_RUN_LEGACY_MIGRATIONS=0 — operators can run `jinn migrate-agent-id`
|
|
556
|
-
// explicitly instead.
|
|
557
|
-
let state = result.fleet_state;
|
|
558
|
-
if (config.runLegacyMigrations) {
|
|
559
|
-
try {
|
|
560
|
-
const migration = await runLegacyAgentIdMigration({
|
|
561
|
-
earningDir: config.earningDir,
|
|
562
|
-
network: NETWORK_CHAIN,
|
|
563
|
-
rpcUrl: config.rpcUrl,
|
|
564
|
-
password: PASSWORD,
|
|
565
|
-
testnetL2DeploymentPath: config.testnetL2DeploymentPath,
|
|
566
|
-
testnetL2TokenDeploymentPath: config.testnetL2TokenDeploymentPath,
|
|
567
|
-
testnetMechDeploymentPath: config.testnetMechDeploymentPath,
|
|
568
|
-
testnetStolasDeploymentPath: config.testnetStolasDeploymentPath,
|
|
569
|
-
});
|
|
570
|
-
if (migration.migrated.length > 0 || migration.failed.length > 0) {
|
|
571
|
-
console.log(`[main] Legacy agent_id migration: migrated=${migration.migrated.length} ` +
|
|
572
|
-
`skipped=${migration.skipped.length} failed=${migration.failed.length}`);
|
|
573
|
-
for (const f of migration.failed) {
|
|
574
|
-
console.log(`[main] service ${f.service.index} (agent ${f.service.agent_address}): ${f.error}`);
|
|
575
|
-
}
|
|
576
|
-
// Reload state so downstream wiring (agent_id, identityRegistry)
|
|
577
|
-
// sees the migrated rows.
|
|
578
|
-
state = await new FleetStateStore(config.earningDir).load(NETWORK_CHAIN);
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
catch (err) {
|
|
582
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
583
|
-
console.error(`[main] Legacy agent_id migration failed (non-fatal): ${message}`);
|
|
584
|
-
}
|
|
585
|
-
}
|
|
586
|
-
// Use the first operational service for the daemon. `safe_binding_pending`
|
|
587
|
-
// means staking/mech are live; only the ERC-8004 Safe→agent metadata bind
|
|
588
|
-
// is still retrying.
|
|
589
|
-
const firstComplete = state.services.find(s => isOperationalServiceStep(s.step));
|
|
590
|
-
if (!firstComplete || !firstComplete.safe_address) {
|
|
591
|
-
failBootstrap({
|
|
592
|
-
code: 'bootstrap_incomplete',
|
|
593
|
-
message: 'Bootstrap completed but no service is ready.',
|
|
594
|
-
hint: 'Re-run to continue the state machine toward a running fleet.',
|
|
595
|
-
exampleCli: 'jinn bootstrap --json',
|
|
596
|
-
details: bootstrapIncompleteSteps(state),
|
|
597
|
-
});
|
|
598
|
-
}
|
|
599
|
-
// Derive agent private key from mnemonic
|
|
600
|
-
const store = new FleetStateStore(config.earningDir);
|
|
601
|
-
const mnemonic = await decryptMnemonic(await store.loadMnemonicKeystore(), PASSWORD);
|
|
602
|
-
const agentPrivateKey = walletPrivateKeyAtIndex(mnemonic, firstComplete.index);
|
|
603
|
-
console.log(`[main] Fleet bootstrap complete.`);
|
|
604
|
-
console.log(` Master: ${state.master_address}`);
|
|
605
|
-
console.log(` Services: ${state.services.filter(s => isOperationalServiceStep(s.step)).length}/${config.targetServices}`);
|
|
606
|
-
console.log(` Active: service ${firstComplete.service_id} (agent ${firstComplete.agent_address})`);
|
|
607
|
-
if (firstComplete.mech_address) {
|
|
608
|
-
console.log(` Mech: ${firstComplete.mech_address}`);
|
|
609
|
-
}
|
|
610
|
-
return {
|
|
611
|
-
masterAddress: state.master_address,
|
|
612
|
-
serviceIndex: firstComplete.index,
|
|
613
|
-
serviceId: firstComplete.service_id ?? null,
|
|
614
|
-
stakingAddress: firstComplete.staking_address ? firstComplete.staking_address : null,
|
|
615
|
-
agentPrivateKey: agentPrivateKey,
|
|
616
|
-
safeAddress: firstComplete.safe_address,
|
|
617
|
-
mechAddress: firstComplete.mech_address ? firstComplete.mech_address : undefined,
|
|
618
|
-
agentId: firstComplete.agent_id ?? null,
|
|
619
|
-
identityRegistryAddress: firstComplete.identity_registry_address
|
|
620
|
-
? firstComplete.identity_registry_address
|
|
621
|
-
: null,
|
|
622
|
-
};
|
|
623
|
-
}
|
|
624
|
-
class SetupBootstrapHalted extends Error {
|
|
625
|
-
envelope;
|
|
626
|
-
constructor(envelope) {
|
|
627
|
-
super(envelope.message);
|
|
628
|
-
this.envelope = envelope;
|
|
629
|
-
this.name = 'SetupBootstrapHalted';
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
207
|
// hjex.6: gate for the halt-and-resume loop. Lives in ./setup/halt-mode.ts
|
|
633
208
|
// so it can be unit-tested without dragging main.ts's top-level side
|
|
634
209
|
// effects (password resolution, config load) into the test.
|
|
635
210
|
// ── Main ────────────────────────────────────────────────────────────────────
|
|
636
|
-
/**
|
|
637
|
-
* --json-progress: emit NDJSON progress envelopes on stdout during long
|
|
638
|
-
* phases (init, bootstrap, daemon startup). The `jinn run --json-progress`
|
|
639
|
-
* flag flips JINN_JSON_PROGRESS=1 in run.ts before calling main(); when
|
|
640
|
-
* unset this is a no-op so tests / non-flag invocations stay silent on
|
|
641
|
-
* stdout.
|
|
642
|
-
*/
|
|
643
|
-
function progressEnabled() {
|
|
644
|
-
return process.env['JINN_JSON_PROGRESS'] === '1';
|
|
645
|
-
}
|
|
646
|
-
function emitProgress(envelope) {
|
|
647
|
-
if (progressEnabled()) {
|
|
648
|
-
process.stdout.write(JSON.stringify(envelope) + '\n');
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
211
|
export async function main() {
|
|
212
|
+
// Issue #909: chdir to a stable directory before spawning any child process.
|
|
213
|
+
// `jinn run` inherits the launch shell's CWD; when daemonised from an
|
|
214
|
+
// ephemeral dir that is later deleted, the CWD becomes a dangling inode and
|
|
215
|
+
// child processes (the `claude` CLI harness probe) crash on getcwd() ENOENT.
|
|
216
|
+
// Must run first — before getFileLogger() and any subprocess spawn.
|
|
217
|
+
ensureStableCwd({ earningDir: config.earningDir });
|
|
652
218
|
console.log(`[main] jinn-client starting on ${NETWORK_CHAIN}`);
|
|
653
219
|
// Issue #420: initialise the rotating daemon file logger early so lifecycle
|
|
654
220
|
// events (tapped in `observability/emit-event.ts`) accumulate durable,
|
|
@@ -698,12 +264,8 @@ export async function main() {
|
|
|
698
264
|
// Boot-time RPC fallback-chain probe (issue #592, AC7 + AC9). Log-only —
|
|
699
265
|
// per-slot 429s/5xx never gate startup. checkRpcNetwork above already
|
|
700
266
|
// fail-loud on chain-id mismatch against the head provider.
|
|
701
|
-
await probeFallbackChain(config.rpcUrls, config.network, 'L2');
|
|
267
|
+
lastL2Probe = await probeFallbackChain(config.rpcUrls, config.network, 'L2');
|
|
702
268
|
console.error(summarizeFallbackChain('L2', config.rpcUrls));
|
|
703
|
-
if (config.jinnClaimLoopEnabled && config.ethereumRpcUrls) {
|
|
704
|
-
await probeFallbackChain(config.ethereumRpcUrls, config.network, 'L1');
|
|
705
|
-
console.error(summarizeFallbackChain('L1', config.ethereumRpcUrls));
|
|
706
|
-
}
|
|
707
269
|
const portPreflight = await checkApiPortAvailable(config.apiPort);
|
|
708
270
|
if (!portPreflight.ok) {
|
|
709
271
|
emitEnvelope({
|
|
@@ -858,6 +420,13 @@ export async function main() {
|
|
|
858
420
|
// builder-artifacts. Holder ref lets the routes register eagerly and
|
|
859
421
|
// start returning real data the moment main.ts assigns holder.current.
|
|
860
422
|
const discoveryApiHolder = { current: undefined };
|
|
423
|
+
// #1037: same eager-register / late-populate pattern for the join applier.
|
|
424
|
+
// The join endpoint registers eagerly inside startApiServer; the applier is
|
|
425
|
+
// built only after the latest join-consuming subsystem (the engine view,
|
|
426
|
+
// wired in the Daemon ctor). The endpoint tolerates an empty holder in the
|
|
427
|
+
// gap between server-start and populate by falling back to
|
|
428
|
+
// restartRequired:true.
|
|
429
|
+
const joinApplierHolder = { current: undefined };
|
|
861
430
|
// hjex.6: retry signal for the bootstrap halt-and-resume loop.
|
|
862
431
|
// When a SetupBootstrapHalted is caught (fatal non-funding error or funding
|
|
863
432
|
// timeout), main() waits on this promise instead of returning, so the setup
|
|
@@ -963,7 +532,27 @@ export async function main() {
|
|
|
963
532
|
configReader: () => ({
|
|
964
533
|
rpcUrl: config.rpcUrl,
|
|
965
534
|
defaultRpcUrl: CHAIN_CONFIG.rpcUrl,
|
|
535
|
+
rpcUrls: config.rpcUrls,
|
|
536
|
+
publicDefaults: RPC_PUBLIC_DEFAULTS,
|
|
537
|
+
rpcSlotHealth: lastL2Probe.map((p) => p.ok
|
|
538
|
+
? {
|
|
539
|
+
ok: true,
|
|
540
|
+
host: p.host,
|
|
541
|
+
latencyMs: p.latencyMs,
|
|
542
|
+
expectedChainId: p.expectedChainId,
|
|
543
|
+
actualChainId: p.actualChainId,
|
|
544
|
+
...(p.localDev ? { localDev: true } : {}),
|
|
545
|
+
}
|
|
546
|
+
: {
|
|
547
|
+
ok: false,
|
|
548
|
+
host: p.host,
|
|
549
|
+
code: p.code,
|
|
550
|
+
reason: p.reason,
|
|
551
|
+
expectedChainId: p.expectedChainId,
|
|
552
|
+
actualChainId: p.actualChainId,
|
|
553
|
+
}),
|
|
966
554
|
joinedSolverNets: config.joinedSolverNets,
|
|
555
|
+
onboardingComplete: config.onboardingComplete,
|
|
967
556
|
}),
|
|
968
557
|
},
|
|
969
558
|
// SolverNet catalog. Stubbed to the bundled `prediction` net for v1.
|
|
@@ -1080,10 +669,15 @@ export async function main() {
|
|
|
1080
669
|
// targetServices DOES need to flow through so the faucet drips enough
|
|
1081
670
|
// ETH to cover ALL services for the operator's chosen targetServices.
|
|
1082
671
|
targetServices: config.targetServices,
|
|
672
|
+
// Issue #560: batched daily-cap top-up knobs — single source of truth
|
|
673
|
+
// in JinnConfig, surfaced to the SPA via GET /v1/setup/drip/quota.
|
|
674
|
+
faucetDailyTopupCap: config.faucetDailyTopupCap,
|
|
675
|
+
faucetTopupCooldownMs: config.faucetTopupCooldownMs,
|
|
1083
676
|
claudePath: activeClaudePath,
|
|
1084
677
|
getClaudePath: () => activeClaudePath,
|
|
1085
678
|
configPath: CONFIG_PATH ?? DEFAULT_CONFIG_PATH,
|
|
1086
679
|
defaultRpcUrlForChain: () => CHAIN_CONFIG.rpcUrl,
|
|
680
|
+
defaultRpcUrlsForChain: () => RPC_PUBLIC_DEFAULTS,
|
|
1087
681
|
onClaudePathSelected: selectClaudePath,
|
|
1088
682
|
// Issue #421 retired the legacy `solverNets` write target. Setup
|
|
1089
683
|
// endpoints no longer call back into the daemon to mutate operator
|
|
@@ -1111,16 +705,21 @@ export async function main() {
|
|
|
1111
705
|
resolve();
|
|
1112
706
|
});
|
|
1113
707
|
},
|
|
708
|
+
// #1037: hot-apply a join to the running daemon. Populated after the
|
|
709
|
+
// join-consuming subsystems are built (see joinApplierHolder). Empty
|
|
710
|
+
// until then → the endpoint returns restartRequired:true.
|
|
711
|
+
joinApplier: joinApplierHolder,
|
|
712
|
+
// #983: mutate the in-memory config so GET /v1/bootstrap reflects the
|
|
713
|
+
// completion flag live (the endpoint persists to disk; this keeps the
|
|
714
|
+
// configReader's in-memory read consistent — same pattern as the
|
|
715
|
+
// join-applier's config write). Cast: JinnConfig has the optional field.
|
|
716
|
+
markOnboardingComplete: () => {
|
|
717
|
+
config.onboardingComplete = true;
|
|
718
|
+
},
|
|
1114
719
|
},
|
|
1115
720
|
status: {
|
|
1116
721
|
earningDir: config.earningDir,
|
|
1117
722
|
rpcUrl: config.rpcUrl,
|
|
1118
|
-
// tJINN identity comes from the bundled JINN MVI L1 artifact
|
|
1119
|
-
// (`JINN_MVI_CONFIG`) — one source of truth. The Sepolia RPC endpoint
|
|
1120
|
-
// is read from `config.ethereumRpcUrl` via the threaded `config`.
|
|
1121
|
-
tjinnTokenAddress: JINN_MVI_CONFIG.jinn,
|
|
1122
|
-
tjinnChainId: JINN_MVI_CONFIG.l1ChainId,
|
|
1123
|
-
tjinnDistributorAddress: JINN_MVI_CONFIG.distributor,
|
|
1124
723
|
network: config.network,
|
|
1125
724
|
pollIntervalMs: config.pollIntervalMs,
|
|
1126
725
|
masterEthDailyEstimateWei: config.masterEthDailyEstimateWei,
|
|
@@ -1132,6 +731,10 @@ export async function main() {
|
|
|
1132
731
|
engine: config.engine,
|
|
1133
732
|
config,
|
|
1134
733
|
configPath: CONFIG_PATH ?? DEFAULT_CONFIG_PATH,
|
|
734
|
+
passwordRotation: {
|
|
735
|
+
source: passwordResolution.source,
|
|
736
|
+
filePath: passwordResolution.filePath,
|
|
737
|
+
},
|
|
1135
738
|
},
|
|
1136
739
|
// Launcher mode (Tasks 6 + 7). Deps are resolved lazily because the
|
|
1137
740
|
// generator and Safe address are constructed after bootstrap, after
|
|
@@ -1224,6 +827,11 @@ export async function main() {
|
|
|
1224
827
|
const rows = sharedStore.listPostedTasksByCreator(opts);
|
|
1225
828
|
return rows.map((r) => ({
|
|
1226
829
|
taskId: r.taskId,
|
|
830
|
+
// On-chain decimal id (#579) — the launcher status chip keys its
|
|
831
|
+
// indexer lookup on this, not the off-chain display taskId. Empty
|
|
832
|
+
// string (no on-chain id recorded) maps to undefined so the
|
|
833
|
+
// gatherer falls back to taskId.
|
|
834
|
+
...(r.protocolTaskId ? { protocolTaskId: r.protocolTaskId } : {}),
|
|
1227
835
|
taskCid: r.taskCid,
|
|
1228
836
|
solverType: r.solverType ?? undefined,
|
|
1229
837
|
postedAt: r.postedAt,
|
|
@@ -1231,6 +839,16 @@ export async function main() {
|
|
|
1231
839
|
...(r.claims ? { claims: r.claims } : {}),
|
|
1232
840
|
}));
|
|
1233
841
|
},
|
|
842
|
+
// #579: on-chain finalized/open/expired status for the Recent posted
|
|
843
|
+
// Tasks chip. discoveryApiHolder is populated post-bootstrap; before
|
|
844
|
+
// that (or with no discovery API) we return an empty Map → all chips
|
|
845
|
+
// render 'unknown', the safe degraded default.
|
|
846
|
+
fetchTaskStatuses: async (manifestCid) => {
|
|
847
|
+
const api = discoveryApiHolder.current;
|
|
848
|
+
if (!api)
|
|
849
|
+
return new Map();
|
|
850
|
+
return api.getTaskStatuses({ manifestCid });
|
|
851
|
+
},
|
|
1234
852
|
},
|
|
1235
853
|
},
|
|
1236
854
|
});
|
|
@@ -1354,7 +972,7 @@ export async function main() {
|
|
|
1354
972
|
// eslint-disable-next-line no-constant-condition
|
|
1355
973
|
while (true) {
|
|
1356
974
|
try {
|
|
1357
|
-
bootstrapResult = await
|
|
975
|
+
bootstrapResult = await runFleetBootstrap({ config, password: PASSWORD, network: NETWORK_CHAIN, emitProgress });
|
|
1358
976
|
break; // success — exit the retry loop
|
|
1359
977
|
}
|
|
1360
978
|
catch (err) {
|
|
@@ -1547,6 +1165,28 @@ export async function main() {
|
|
|
1547
1165
|
// the panel's next refetch. Before this, the routes 404'd forever and
|
|
1548
1166
|
// the /build page rendered "Discovery unavailable" permanently.
|
|
1549
1167
|
discoveryApiHolder.current = sharedDiscoveryApi;
|
|
1168
|
+
// #1037: the live task-discovery descriptor. Always present with a mutable
|
|
1169
|
+
// `solverNetManifestCids` array (`taskDiscoveryManifestCids` is a fresh
|
|
1170
|
+
// `.map` result, safe to push onto). The join applier holds this same object
|
|
1171
|
+
// reference and pushes a newly-joined cid onto it live.
|
|
1172
|
+
const taskDiscovery = {
|
|
1173
|
+
discoveryApi: sharedDiscoveryApi,
|
|
1174
|
+
solverNetManifestCids: taskDiscoveryManifestCids,
|
|
1175
|
+
// No explicit `onchainFromBlock` by default — let `MechAdapter`'s
|
|
1176
|
+
// `DEFAULT_TASK_DISCOVERY_FROM_BLOCK` per-chain default flow through.
|
|
1177
|
+
// Hardcoding here shadowed the adapter's default and re-introduced the
|
|
1178
|
+
// ghost-task floor every release; removing the shadow makes `adapter.ts`
|
|
1179
|
+
// the single source of truth. See gh #300. An operator MAY opt in to a
|
|
1180
|
+
// recent floor via `taskDiscoveryOnchainFromBlock` to bound the canonical
|
|
1181
|
+
// getLogs scan (which otherwise parses a large history on the main thread
|
|
1182
|
+
// and can stall the loop) and lean on the indexer DiscoveryAPI.
|
|
1183
|
+
...(config.taskDiscoveryOnchainFromBlock !== undefined
|
|
1184
|
+
? { onchainFromBlock: config.taskDiscoveryOnchainFromBlock }
|
|
1185
|
+
: {}),
|
|
1186
|
+
...(config.taskDiscoveryAllowedTaskIds?.length
|
|
1187
|
+
? { allowedTaskIds: config.taskDiscoveryAllowedTaskIds }
|
|
1188
|
+
: {}),
|
|
1189
|
+
};
|
|
1550
1190
|
const adapter = new MechAdapter({
|
|
1551
1191
|
rpcUrl: config.rpcUrls,
|
|
1552
1192
|
mechMarketplaceAddress: MARKETPLACE_ADDRESS,
|
|
@@ -1560,27 +1200,7 @@ export async function main() {
|
|
|
1560
1200
|
chainId: config.network === 'testnet' ? 84532 : 8453,
|
|
1561
1201
|
routerClaimDeliveryVariant: CHAIN_CONFIG.routerClaimDeliveryVersion,
|
|
1562
1202
|
evictionRecovery,
|
|
1563
|
-
taskDiscovery
|
|
1564
|
-
? {
|
|
1565
|
-
discoveryApi: sharedDiscoveryApi,
|
|
1566
|
-
solverNetManifestCids: taskDiscoveryManifestCids,
|
|
1567
|
-
// No explicit `onchainFromBlock` by default — let `MechAdapter`'s
|
|
1568
|
-
// `DEFAULT_TASK_DISCOVERY_FROM_BLOCK` per-chain default flow
|
|
1569
|
-
// through. Hardcoding here shadowed the adapter's default and
|
|
1570
|
-
// re-introduced the ghost-task floor every release; removing the
|
|
1571
|
-
// shadow makes `adapter.ts` the single source of truth. See gh
|
|
1572
|
-
// #300. An operator MAY opt in to a recent floor via
|
|
1573
|
-
// `taskDiscoveryOnchainFromBlock` to bound the canonical getLogs
|
|
1574
|
-
// scan (which otherwise parses a large history on the main thread
|
|
1575
|
-
// and can stall the loop) and lean on the indexer DiscoveryAPI.
|
|
1576
|
-
...(config.taskDiscoveryOnchainFromBlock !== undefined
|
|
1577
|
-
? { onchainFromBlock: config.taskDiscoveryOnchainFromBlock }
|
|
1578
|
-
: {}),
|
|
1579
|
-
...(config.taskDiscoveryAllowedTaskIds?.length
|
|
1580
|
-
? { allowedTaskIds: config.taskDiscoveryAllowedTaskIds }
|
|
1581
|
-
: {}),
|
|
1582
|
-
}
|
|
1583
|
-
: undefined,
|
|
1203
|
+
taskDiscovery,
|
|
1584
1204
|
}, sharedStore);
|
|
1585
1205
|
// ── TaskEngine wiring ─────────────────────────────────────────────────
|
|
1586
1206
|
// Build agent viem clients (same creds as MechAdapter uses internally).
|
|
@@ -1588,57 +1208,7 @@ export async function main() {
|
|
|
1588
1208
|
const agentChain = config.network === 'testnet'
|
|
1589
1209
|
? viemChains.baseSepolia
|
|
1590
1210
|
: viemChains.base;
|
|
1591
|
-
const l1Chain = config.jinnL1Network === 'sepolia' ? viemChains.sepolia : viemChains.mainnet;
|
|
1592
|
-
const agentChainContracts = agentChain.contracts;
|
|
1593
|
-
const optimismPortalAddress = agentChainContracts?.portal?.[l1Chain.id]?.address;
|
|
1594
|
-
const disputeGameFactoryAddress = agentChainContracts?.disputeGameFactory?.[l1Chain.id]?.address;
|
|
1595
|
-
const l2ProofClient = config.l2ProofRpcUrls
|
|
1596
|
-
? createJinnPublicClient(config.l2ProofRpcUrls, NETWORK_CHAIN)
|
|
1597
|
-
: undefined;
|
|
1598
1211
|
const agentClients = createClients(config.rpcUrls, agentPrivateKey, agentChain);
|
|
1599
|
-
// ── L1 (Sepolia / Ethereum mainnet) clients for cross-chain JINN claim loop ──
|
|
1600
|
-
// Uses the agent EOA because MockMessenger.owner is the agent on testnet.
|
|
1601
|
-
// Same key as L2; only the chain differs.
|
|
1602
|
-
const shouldWireJinnClaimL1 = shouldWireJinnClaimL1Signer({
|
|
1603
|
-
enabled: config.jinnClaimLoopEnabled,
|
|
1604
|
-
intervalMs: config.jinnClaimLoopIntervalMs,
|
|
1605
|
-
submissionMode: config.jinnClaimSubmissionMode,
|
|
1606
|
-
distributorAddress: JINN_MVI_CONFIG.distributor,
|
|
1607
|
-
ethereumRpcUrl: config.ethereumRpcUrl,
|
|
1608
|
-
});
|
|
1609
|
-
const l1ClientsForJinnClaim = shouldWireJinnClaimL1 && config.ethereumRpcUrls
|
|
1610
|
-
? {
|
|
1611
|
-
public: createJinnL1PublicClient(config.ethereumRpcUrls, config.jinnL1Network),
|
|
1612
|
-
wallet: createJinnL1WalletClient(config.ethereumRpcUrls, config.jinnL1Network, privateKeyToAccount(agentPrivateKey)),
|
|
1613
|
-
}
|
|
1614
|
-
: undefined;
|
|
1615
|
-
const jinnClaimLoopConfig = buildJinnClaimLoopConfig({
|
|
1616
|
-
enabled: config.jinnClaimLoopEnabled,
|
|
1617
|
-
intervalMs: config.jinnClaimLoopIntervalMs,
|
|
1618
|
-
submissionMode: config.jinnClaimSubmissionMode,
|
|
1619
|
-
messengerMode: JINN_CLAIM_MESSENGER_MODE,
|
|
1620
|
-
mvi: JINN_MVI_CONFIG,
|
|
1621
|
-
l2Client: agentClients.publicClient,
|
|
1622
|
-
l2ProofClient,
|
|
1623
|
-
l2Wallet: agentClients.walletClient,
|
|
1624
|
-
l1Clients: l1ClientsForJinnClaim,
|
|
1625
|
-
store: earningStore,
|
|
1626
|
-
chain: NETWORK_CHAIN,
|
|
1627
|
-
optimismPortalAddress,
|
|
1628
|
-
disputeGameFactoryAddress,
|
|
1629
|
-
});
|
|
1630
|
-
if (jinnClaimLoopConfig) {
|
|
1631
|
-
console.log(`[main] JinnClaimLoop: enabled (submission=${config.jinnClaimSubmissionMode}, ` +
|
|
1632
|
-
`mode=${JINN_CLAIM_MESSENGER_MODE}, ` +
|
|
1633
|
-
`interval=${config.jinnClaimLoopIntervalMs}ms, distributor=${JINN_MVI_CONFIG.distributor}, ` +
|
|
1634
|
-
`emitter=${JINN_MVI_CONFIG.claimEmitter})`);
|
|
1635
|
-
}
|
|
1636
|
-
else if (!config.jinnClaimLoopEnabled) {
|
|
1637
|
-
console.log('[main] JinnClaimLoop: disabled (jinnClaimLoopEnabled=false)');
|
|
1638
|
-
}
|
|
1639
|
-
else {
|
|
1640
|
-
console.log(`[main] JinnClaimLoop: disabled (missing claim-loop artifacts, interval disabled, or L1 submit wiring)`);
|
|
1641
|
-
}
|
|
1642
1212
|
// ── Harness registry ─────────────────────────────────────────────────────────
|
|
1643
1213
|
const solverNetRegistry = await loadSolverNets(config);
|
|
1644
1214
|
for (const net of solverNetRegistry.list()) {
|
|
@@ -1729,6 +1299,7 @@ export async function main() {
|
|
|
1729
1299
|
hermesPath: config.hermesPath,
|
|
1730
1300
|
hermesModel: config.hermesModel,
|
|
1731
1301
|
hermesProvider: config.hermesProvider,
|
|
1302
|
+
hermesBaseUrl: config.hermesBaseUrl,
|
|
1732
1303
|
hermesDoctorTimeoutMs: config.hermesDoctorTimeoutMs,
|
|
1733
1304
|
codexPath: config.codexPath,
|
|
1734
1305
|
codexDoctorTimeoutMs: config.codexDoctorTimeoutMs,
|
|
@@ -1762,6 +1333,13 @@ export async function main() {
|
|
|
1762
1333
|
// is no longer needed and would throw on Hono's locked matcher.
|
|
1763
1334
|
harnessReadinessRegistryHolder.current = harnessReadinessRegistry;
|
|
1764
1335
|
console.log('[main] HarnessReadinessRegistry started; /v1/harnesses/readiness routes active.');
|
|
1336
|
+
// #1037: always construct the engine eligibility view (mutable) so a
|
|
1337
|
+
// hot-applied join can inject its cid live. Previously this was wired only
|
|
1338
|
+
// when config.joinedSolverNets was truthy; a zero-join daemon then ran the
|
|
1339
|
+
// legacy solverType gate. With an always-present empty view, a zero-join
|
|
1340
|
+
// daemon rejects cid-bearing tasks (its discovery cid set is empty so it
|
|
1341
|
+
// discovers none) and still passes legacy no-cid tasks. See plan §behaviour-change.
|
|
1342
|
+
const joinedSolverNetsView = createMutableJoinedSolverNetsView(config.joinedSolverNets);
|
|
1765
1343
|
// ── Engine deps ───────────────────────────────────────────────────────────────
|
|
1766
1344
|
// Packaging deps: artifacts are always written to served_artifacts
|
|
1767
1345
|
// (operator-local SQLite). In public-testnet donation mode, scrubbed artifact
|
|
@@ -1848,6 +1426,14 @@ export async function main() {
|
|
|
1848
1426
|
else {
|
|
1849
1427
|
console.log('[main] IdentityPublisher: disabled (no agent_id on active service — re-run bootstrap to mint the operator agent NFT)');
|
|
1850
1428
|
}
|
|
1429
|
+
// ── Seller-side scrub pipeline (publish-time) ─────────────────────────────
|
|
1430
|
+
// One pipeline shared by the task engine and the live capture publisher so
|
|
1431
|
+
// every published trajectory passes through the same maintained scrub stack
|
|
1432
|
+
// (structural key policy → openredaction → secretlint/entropy → optional ML
|
|
1433
|
+
// PII). The OTLP receiver above runs best-effort ingest-time scrubbers; this
|
|
1434
|
+
// is the authoritative final gate before a trajectory becomes public/sellable.
|
|
1435
|
+
const sellerPiiDetector = await maybeBuildPiiDetector(config.captures.piiDetection);
|
|
1436
|
+
const sellerScrubPipeline = buildScrubPipeline(sellerPiiDetector ? { piiDetector: sellerPiiDetector } : {});
|
|
1851
1437
|
const liveCapturePublisher = createLiveCapturePublisher({
|
|
1852
1438
|
store: sharedStore,
|
|
1853
1439
|
captures: capturesStore,
|
|
@@ -1860,6 +1446,7 @@ export async function main() {
|
|
|
1860
1446
|
clientGitSha: buildInfo.clientGitSha,
|
|
1861
1447
|
identityPublisher,
|
|
1862
1448
|
harnessMode: config.harness.mode,
|
|
1449
|
+
scrubPipeline: sellerScrubPipeline,
|
|
1863
1450
|
});
|
|
1864
1451
|
capturePublishRef.current = liveCapturePublisher.publishCapture;
|
|
1865
1452
|
// ── Reputation feedback hook (jinn-mono-yg4) ──────────────────────────────
|
|
@@ -2070,6 +1657,7 @@ export async function main() {
|
|
|
2070
1657
|
agentEoa: agentEoaAddress,
|
|
2071
1658
|
safeAddress,
|
|
2072
1659
|
agentPrivateKey,
|
|
1660
|
+
ipfsGatewayUrl: config.ipfsGatewayUrl,
|
|
2073
1661
|
...(sharedDiscoveryApi ? { discoveryApi: sharedDiscoveryApi } : {}),
|
|
2074
1662
|
},
|
|
2075
1663
|
logger: {
|
|
@@ -2174,12 +1762,6 @@ export async function main() {
|
|
|
2174
1762
|
status: {
|
|
2175
1763
|
earningDir: config.earningDir,
|
|
2176
1764
|
rpcUrl: config.rpcUrl,
|
|
2177
|
-
// tJINN identity comes from the bundled JINN MVI L1 artifact
|
|
2178
|
-
// (`JINN_MVI_CONFIG`) — one source of truth. The Sepolia RPC endpoint
|
|
2179
|
-
// is read from `config.ethereumRpcUrl` via the threaded `config`.
|
|
2180
|
-
tjinnTokenAddress: JINN_MVI_CONFIG.jinn,
|
|
2181
|
-
tjinnChainId: JINN_MVI_CONFIG.l1ChainId,
|
|
2182
|
-
tjinnDistributorAddress: JINN_MVI_CONFIG.distributor,
|
|
2183
1765
|
// stOLAS L2 distributor — mirrors `CHAIN_CONFIG.distributorAddress`
|
|
2184
1766
|
// used to gate the EvictionLoop (issue #651). Threaded through so the
|
|
2185
1767
|
// SPA's autoRestake predicate keys off the same on-chain artifact as
|
|
@@ -2196,6 +1778,10 @@ export async function main() {
|
|
|
2196
1778
|
engine: config.engine,
|
|
2197
1779
|
config,
|
|
2198
1780
|
configPath: CONFIG_PATH ?? DEFAULT_CONFIG_PATH,
|
|
1781
|
+
passwordRotation: {
|
|
1782
|
+
source: passwordResolution.source,
|
|
1783
|
+
filePath: passwordResolution.filePath,
|
|
1784
|
+
},
|
|
2199
1785
|
spendCaps: spendCap?.caps,
|
|
2200
1786
|
aiUnits,
|
|
2201
1787
|
},
|
|
@@ -2209,7 +1795,6 @@ export async function main() {
|
|
|
2209
1795
|
distributorAddress: CHAIN_CONFIG.distributorAddress,
|
|
2210
1796
|
}
|
|
2211
1797
|
: undefined,
|
|
2212
|
-
jinnClaim: jinnClaimLoopConfig,
|
|
2213
1798
|
restorationEngine: {
|
|
2214
1799
|
paths: {
|
|
2215
1800
|
workingDirRoot: config.engine.workingDirRoot,
|
|
@@ -2226,9 +1811,8 @@ export async function main() {
|
|
|
2226
1811
|
// doesn't match a joined entry (plus a role gate). Absent when the
|
|
2227
1812
|
// operator hasn't joined any nets yet — the engine then falls back to
|
|
2228
1813
|
// the legacy solverType-keyed gate.
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
: {}),
|
|
1814
|
+
// #1037: always wire the (mutable) view so a hot-applied join is live.
|
|
1815
|
+
joinedSolverNets: joinedSolverNetsView,
|
|
2232
1816
|
// Spec §14: task validation resolves manifest → contract → schemas.
|
|
2233
1817
|
// Threaded only when the SolverNet registry client was constructed
|
|
2234
1818
|
// (testnet branch above). The engine treats absence as "schema
|
|
@@ -2240,6 +1824,9 @@ export async function main() {
|
|
|
2240
1824
|
reputationFeedback,
|
|
2241
1825
|
operatorConfig,
|
|
2242
1826
|
harnessMode: config.harness.mode,
|
|
1827
|
+
// Share the one maintained scrub pipeline (incl. optional ML PII) so task
|
|
1828
|
+
// trajectories and captures are scrubbed by the same stack before publish.
|
|
1829
|
+
scrubPipeline: sellerScrubPipeline,
|
|
2243
1830
|
},
|
|
2244
1831
|
balanceTopup: config.balanceTopupIntervalMs > 0
|
|
2245
1832
|
? {
|
|
@@ -2262,6 +1849,7 @@ export async function main() {
|
|
|
2262
1849
|
CHAIN_CONFIG.distributorAddress
|
|
2263
1850
|
? {
|
|
2264
1851
|
intervalMs: config.evictionCheckIntervalMs,
|
|
1852
|
+
reStakeThrottleMs: config.checkpointIntervalMs,
|
|
2265
1853
|
store: earningStore,
|
|
2266
1854
|
chain: NETWORK_CHAIN,
|
|
2267
1855
|
readContract: (opts) => publicClient.readContract(opts),
|
|
@@ -2309,13 +1897,47 @@ export async function main() {
|
|
|
2309
1897
|
},
|
|
2310
1898
|
}
|
|
2311
1899
|
: undefined,
|
|
1900
|
+
// #1043 loop watchdog. Always constructed in production so a stale loop is
|
|
1901
|
+
// detected + surfaced; the process-exit recovery is flag-gated (default
|
|
1902
|
+
// OFF) by config.watchdogAutoRestart.
|
|
1903
|
+
watchdog: { autoRestart: config.watchdogAutoRestart },
|
|
1904
|
+
});
|
|
1905
|
+
// #1037: populate the join applier now that all four join-consuming
|
|
1906
|
+
// subsystems exist — the live task-discovery descriptor (`taskDiscovery`),
|
|
1907
|
+
// the mutable engine view (`joinedSolverNetsView`), the readiness registry,
|
|
1908
|
+
// and the SolverNet registry. The join endpoint registered eagerly at
|
|
1909
|
+
// server-start; before this point it returns restartRequired:true.
|
|
1910
|
+
joinApplierHolder.current = createJoinApplier({
|
|
1911
|
+
taskDiscovery,
|
|
1912
|
+
view: joinedSolverNetsView,
|
|
1913
|
+
readiness: harnessReadinessRegistry,
|
|
1914
|
+
registry: solverNetRegistry,
|
|
1915
|
+
config,
|
|
2312
1916
|
});
|
|
1917
|
+
if (config.watchdogAutoRestart) {
|
|
1918
|
+
console.log('[watchdog] auto-restart ENABLED (stale loop → non-zero exit)');
|
|
1919
|
+
}
|
|
2313
1920
|
// Write pidfile so `jinn stop` can find us. First, refuse the run if another
|
|
2314
1921
|
// daemon already owns this earning directory — see issue #649. The gate
|
|
2315
1922
|
// handles all three branches (refuse-and-exit, unlink-stale-and-continue,
|
|
2316
1923
|
// proceed); the writeFileSync below MUST stay outside the helper so the
|
|
2317
1924
|
// "// DO NOT add store mutations above this line — see #649" invariant is
|
|
2318
1925
|
// visible right here at the call site.
|
|
1926
|
+
// Deployment-readiness gate (#958). In a deployment context (JINN_STATE_DIR
|
|
1927
|
+
// set or a container/compose auth context) this fails loud and exits when a
|
|
1928
|
+
// hard check fails (writable-volume, state-on-volume, agent-cli-non-root).
|
|
1929
|
+
// Outside a deployment context it only logs advisories — a plain local
|
|
1930
|
+
// `jinn run` is NEVER newly gated here. Runs before the pidfile gate so an
|
|
1931
|
+
// unfit environment refuses before we touch the pidfile.
|
|
1932
|
+
await applyDeploymentReadinessGate({
|
|
1933
|
+
stateDir: config.stateDir,
|
|
1934
|
+
earningDir: config.earningDir,
|
|
1935
|
+
runtimeMode: config.runtimeMode,
|
|
1936
|
+
}, {
|
|
1937
|
+
env: process.env,
|
|
1938
|
+
getuid: typeof process.getuid === 'function' ? process.getuid.bind(process) : undefined,
|
|
1939
|
+
detectAuthContext,
|
|
1940
|
+
});
|
|
2319
1941
|
const pidPath = join(config.earningDir, 'daemon.pid');
|
|
2320
1942
|
applyPidfileLivenessGate(pidPath);
|
|
2321
1943
|
writeFileSyncMain(pidPath, String(process.pid) + '\n', 'utf-8');
|