@jinn-network/client 0.1.6-canary.fb9c8196 → 0.1.7-canary.d4e4e183
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/deployments/deployment-jinn-mvi-l1-sepolia-fast.json +23 -4
- package/deployments/deployment-jinn-mvi-l1-sepolia.json +23 -4
- package/deployments/deployment-jinn-mvi-l2-baseSepolia.json +5 -4
- package/dist/adapters/mech/adapter.d.ts +38 -1
- package/dist/adapters/mech/adapter.js +241 -54
- package/dist/adapters/mech/adapter.js.map +1 -1
- package/dist/adapters/mech/contracts.d.ts +17 -4
- package/dist/adapters/mech/contracts.js +8 -2
- package/dist/adapters/mech/contracts.js.map +1 -1
- package/dist/adapters/mech/safe-revert.d.ts +20 -0
- package/dist/adapters/mech/safe-revert.js +12 -4
- package/dist/adapters/mech/safe-revert.js.map +1 -1
- package/dist/adapters/mech/safe.d.ts +5 -1
- package/dist/adapters/mech/safe.js +27 -8
- package/dist/adapters/mech/safe.js.map +1 -1
- package/dist/adapters/mech/verdict-code.d.ts +1 -0
- package/dist/adapters/mech/verdict-code.js +18 -0
- package/dist/adapters/mech/verdict-code.js.map +1 -1
- package/dist/api/admin-endpoint.d.ts +15 -3
- package/dist/api/admin-endpoint.js +24 -2
- package/dist/api/admin-endpoint.js.map +1 -1
- package/dist/api/bootstrap-endpoint.js +9 -5
- package/dist/api/bootstrap-endpoint.js.map +1 -1
- package/dist/api/codex-doctor-endpoint.d.ts +73 -0
- package/dist/api/codex-doctor-endpoint.js +177 -0
- package/dist/api/codex-doctor-endpoint.js.map +1 -0
- package/dist/api/discovery-endpoint.d.ts +1 -0
- package/dist/api/discovery-endpoint.js +26 -0
- package/dist/api/discovery-endpoint.js.map +1 -1
- package/dist/api/gather-status.d.ts +11 -0
- package/dist/api/gather-status.js +332 -3
- package/dist/api/gather-status.js.map +1 -1
- package/dist/api/hermes-doctor-endpoint.d.ts +107 -0
- package/dist/api/hermes-doctor-endpoint.js +204 -5
- package/dist/api/hermes-doctor-endpoint.js.map +1 -1
- package/dist/api/launcher-status.d.ts +21 -16
- package/dist/api/launcher-status.js +2 -1
- package/dist/api/launcher-status.js.map +1 -1
- package/dist/api/portfolio-v0-build.d.ts +10 -0
- package/dist/api/portfolio-v0-build.js +24 -5
- package/dist/api/portfolio-v0-build.js.map +1 -1
- package/dist/api/prediction-v1-build.d.ts +10 -0
- package/dist/api/prediction-v1-build.js +7 -1
- package/dist/api/prediction-v1-build.js.map +1 -1
- package/dist/api/server.d.ts +31 -1
- package/dist/api/server.js +68 -1
- package/dist/api/server.js.map +1 -1
- package/dist/api/setup-endpoints.js +50 -4
- package/dist/api/setup-endpoints.js.map +1 -1
- package/dist/api/solvernets-endpoints.d.ts +8 -0
- package/dist/api/solvernets-endpoints.js +71 -43
- package/dist/api/solvernets-endpoints.js.map +1 -1
- package/dist/api/status-build.d.ts +58 -0
- package/dist/api/status-build.js +50 -0
- package/dist/api/status-build.js.map +1 -1
- package/dist/api/task-run-routing.d.ts +7 -0
- package/dist/api/task-run-routing.js +12 -0
- package/dist/api/task-run-routing.js.map +1 -0
- package/dist/api/task-runs-build.d.ts +21 -0
- package/dist/api/task-runs-build.js +14 -1
- package/dist/api/task-runs-build.js.map +1 -1
- package/dist/build-info.json +4 -4
- package/dist/build-meta.json +1 -1
- package/dist/chain-read-errors.d.ts +10 -0
- package/dist/chain-read-errors.js +15 -0
- package/dist/chain-read-errors.js.map +1 -1
- package/dist/cli/commands/auth.js +1 -1
- package/dist/cli/commands/auth.js.map +1 -1
- package/dist/cli/commands/create.js +3 -2
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/doctor.d.ts +2 -0
- package/dist/cli/commands/doctor.js +2 -0
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/rewards.js +11 -7
- package/dist/cli/commands/rewards.js.map +1 -1
- package/dist/cli/commands/status.js +1 -1
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/tasks.js +86 -9
- package/dist/cli/commands/tasks.js.map +1 -1
- package/dist/cli/commands/update.d.ts +10 -0
- package/dist/cli/commands/update.js +36 -0
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/introspection-context.js +5 -0
- package/dist/cli/introspection-context.js.map +1 -1
- package/dist/cli/task-native-readiness.d.ts +3 -1
- package/dist/cli/task-native-readiness.js +28 -6
- package/dist/cli/task-native-readiness.js.map +1 -1
- package/dist/config.d.ts +97 -5
- package/dist/config.js +90 -18
- package/dist/config.js.map +1 -1
- package/dist/daemon/checkpoint-loop.d.ts +48 -0
- package/dist/daemon/checkpoint-loop.js +76 -0
- package/dist/daemon/checkpoint-loop.js.map +1 -0
- package/dist/daemon/creator.d.ts +1 -1
- package/dist/daemon/creator.js +7 -3
- package/dist/daemon/creator.js.map +1 -1
- package/dist/daemon/daemon.d.ts +11 -0
- package/dist/daemon/daemon.js +51 -1
- package/dist/daemon/daemon.js.map +1 -1
- package/dist/daemon/jinn-claim-loop-wiring.d.ts +33 -0
- package/dist/daemon/jinn-claim-loop-wiring.js +40 -0
- package/dist/daemon/jinn-claim-loop-wiring.js.map +1 -0
- package/dist/daemon/jinn-claim-loop.d.ts +24 -17
- package/dist/daemon/jinn-claim-loop.js +77 -23
- package/dist/daemon/jinn-claim-loop.js.map +1 -1
- package/dist/daemon/skip-log-dedup.d.ts +69 -0
- package/dist/daemon/skip-log-dedup.js +106 -0
- package/dist/daemon/skip-log-dedup.js.map +1 -0
- package/dist/dashboard/assets/index-BUlE8F3Y.js +330 -0
- package/dist/dashboard/assets/index-blqc7eqq.css +32 -0
- package/dist/dashboard/index.html +2 -2
- package/dist/discovery/factory.d.ts +17 -5
- package/dist/discovery/factory.js +46 -18
- package/dist/discovery/factory.js.map +1 -1
- package/dist/discovery/http.js +142 -3
- package/dist/discovery/http.js.map +1 -1
- package/dist/discovery/onchain.d.ts +5 -0
- package/dist/discovery/onchain.js +407 -15
- package/dist/discovery/onchain.js.map +1 -1
- package/dist/discovery/types.d.ts +45 -1
- package/dist/discovery/types.js +8 -10
- package/dist/discovery/types.js.map +1 -1
- package/dist/discovery/with-fallback.d.ts +7 -0
- package/dist/discovery/with-fallback.js +10 -0
- package/dist/discovery/with-fallback.js.map +1 -1
- package/dist/earning/bootstrap.d.ts +44 -12
- package/dist/earning/bootstrap.js +88 -46
- package/dist/earning/bootstrap.js.map +1 -1
- package/dist/earning/contracts.d.ts +5 -3
- package/dist/earning/contracts.js +12 -7
- package/dist/earning/contracts.js.map +1 -1
- package/dist/earning/funding-plan.js +27 -18
- package/dist/earning/funding-plan.js.map +1 -1
- package/dist/earning/safe-adapter.d.ts +2 -0
- package/dist/earning/safe-adapter.js +26 -12
- package/dist/earning/safe-adapter.js.map +1 -1
- package/dist/earning/store.d.ts +8 -0
- package/dist/earning/store.js.map +1 -1
- package/dist/earning/testnet-setup-migration.js +10 -0
- package/dist/earning/testnet-setup-migration.js.map +1 -1
- package/dist/erc8004/reputation.d.ts +8 -0
- package/dist/erc8004/reputation.js +22 -3
- package/dist/erc8004/reputation.js.map +1 -1
- package/dist/harnesses/engine/engine.d.ts +72 -0
- package/dist/harnesses/engine/engine.js +105 -8
- package/dist/harnesses/engine/engine.js.map +1 -1
- package/dist/harnesses/engine/persistence.d.ts +51 -1
- package/dist/harnesses/engine/persistence.js +118 -5
- package/dist/harnesses/engine/persistence.js.map +1 -1
- package/dist/harnesses/engine/work-dir-reaper.d.ts +65 -0
- package/dist/harnesses/engine/work-dir-reaper.js +100 -0
- package/dist/harnesses/engine/work-dir-reaper.js.map +1 -0
- package/dist/harnesses/impls/hermes-agent/adapter.js +40 -0
- package/dist/harnesses/impls/hermes-agent/adapter.js.map +1 -1
- package/dist/harnesses/impls/hermes-agent/bootstrap.d.ts +20 -0
- package/dist/harnesses/impls/hermes-agent/bootstrap.js +40 -6
- package/dist/harnesses/impls/hermes-agent/bootstrap.js.map +1 -1
- package/dist/harnesses/impls/hermes-agent/harness.d.ts +37 -1
- package/dist/harnesses/impls/hermes-agent/harness.js +59 -4
- package/dist/harnesses/impls/hermes-agent/harness.js.map +1 -1
- package/dist/harnesses/impls/index.d.ts +5 -0
- package/dist/harnesses/impls/index.js +11 -0
- package/dist/harnesses/impls/index.js.map +1 -1
- package/dist/harnesses/impls/learner/harness.d.ts +38 -4
- package/dist/harnesses/impls/learner/harness.js +96 -2
- package/dist/harnesses/impls/learner/harness.js.map +1 -1
- package/dist/harnesses/impls/learner/plugin-path.d.ts +0 -13
- package/dist/harnesses/impls/learner/plugin-path.js +35 -15
- package/dist/harnesses/impls/learner/plugin-path.js.map +1 -1
- package/dist/harnesses/impls/learner/types.d.ts +11 -0
- package/dist/harnesses/impls/stub.d.ts +58 -0
- package/dist/harnesses/impls/stub.js +89 -0
- package/dist/harnesses/impls/stub.js.map +1 -0
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/eval-runner.d.ts +69 -50
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/eval-runner.js +178 -93
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/eval-runner.js.map +1 -1
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/harness.d.ts +12 -1
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/harness.js +121 -7
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/harness.js.map +1 -1
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/hf-fetcher.d.ts +15 -0
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/hf-fetcher.js +54 -4
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/hf-fetcher.js.map +1 -1
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/index.d.ts +6 -0
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/index.js +1 -1
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/index.js.map +1 -1
- package/dist/harnesses/readiness-registry.js +9 -1
- package/dist/harnesses/readiness-registry.js.map +1 -1
- package/dist/main.js +168 -53
- package/dist/main.js.map +1 -1
- package/dist/observability/emit-event.d.ts +1 -1
- package/dist/observability/emit-event.js.map +1 -1
- package/dist/plugins/learner/.claude-plugin/plugin.json +9 -0
- package/dist/plugins/learner/.codex-plugin/plugin.json +39 -0
- package/dist/plugins/learner/AGENTS.md +40 -0
- package/dist/plugins/learner/CLAUDE.md +33 -0
- package/dist/plugins/learner/README.md +59 -0
- package/dist/plugins/learner/hooks/hooks.json +16 -0
- package/dist/plugins/learner/hooks/session-start +38 -0
- package/dist/plugins/learner/skills/learn/SKILL.md +412 -0
- package/dist/plugins/learner/skills/learn/analyst-prompt.md +68 -0
- package/dist/plugins/learner/skills/learn/consolidator-prompt.md +94 -0
- package/dist/plugins/learner/skills/learn/explorer-prompt.md +53 -0
- package/dist/plugins/learner/skills/learn/planner-prompt.md +87 -0
- package/dist/plugins/learner/skills/learn/promoter-prompt.md +113 -0
- package/dist/plugins/learner/skills/learn/step-worker-prompt.md +47 -0
- package/dist/plugins/learner/skills/learn/strategist-prompt.md +85 -0
- package/dist/restart-daemon.d.ts +29 -10
- package/dist/restart-daemon.js +27 -14
- package/dist/restart-daemon.js.map +1 -1
- package/dist/solver-nets/prediction-operator-ux.js +31 -12
- package/dist/solver-nets/prediction-operator-ux.js.map +1 -1
- package/dist/solver-types/_swe-rebench-v2-pool-cache.d.ts +58 -0
- package/dist/solver-types/_swe-rebench-v2-pool-cache.js +87 -0
- package/dist/solver-types/_swe-rebench-v2-pool-cache.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-substrate.d.ts +1 -0
- package/dist/solver-types/_swe-rebench-v2-substrate.js +10 -0
- package/dist/solver-types/_swe-rebench-v2-substrate.js.map +1 -1
- package/dist/solver-types/_swe-rebench-v2-validated-pool.d.ts +65 -0
- package/dist/solver-types/_swe-rebench-v2-validated-pool.js +243 -26
- package/dist/solver-types/_swe-rebench-v2-validated-pool.js.map +1 -1
- package/dist/solver-types/swe-rebench-v2-auto.d.ts +22 -7
- package/dist/solver-types/swe-rebench-v2-auto.js +45 -20
- package/dist/solver-types/swe-rebench-v2-auto.js.map +1 -1
- package/dist/solver-types/swe-rebench-v2.d.ts +13 -2
- package/dist/solver-types/swe-rebench-v2.js +233 -94
- package/dist/solver-types/swe-rebench-v2.js.map +1 -1
- package/dist/solvernets/daemon-init.d.ts +10 -2
- package/dist/solvernets/daemon-init.js +22 -2
- package/dist/solvernets/daemon-init.js.map +1 -1
- package/dist/solvernets/launched-record-dispatcher.js +35 -7
- package/dist/solvernets/launched-record-dispatcher.js.map +1 -1
- package/dist/solvernets/store.d.ts +5 -0
- package/dist/solvernets/store.js +1 -0
- package/dist/solvernets/store.js.map +1 -1
- package/dist/store/store.d.ts +15 -0
- package/dist/store/store.js +118 -3
- package/dist/store/store.js.map +1 -1
- package/dist/tasks/sources.d.ts +18 -1
- package/dist/tasks/sources.js +33 -5
- package/dist/tasks/sources.js.map +1 -1
- package/dist/tx-retry.d.ts +151 -19
- package/dist/tx-retry.js +286 -32
- package/dist/tx-retry.js.map +1 -1
- package/dist/types/payloads/prediction-apy-v0.d.ts +5 -5
- package/dist/types/payloads/prediction-v0.d.ts +5 -5
- package/dist/types/task-document.d.ts +392 -0
- package/dist/types/task-document.js +10 -0
- package/dist/types/task-document.js.map +1 -1
- package/dist/types/task.d.ts +28 -0
- package/dist/util/extract-tx-hash.d.ts +14 -0
- package/dist/util/extract-tx-hash.js +19 -0
- package/dist/util/extract-tx-hash.js.map +1 -0
- package/dist/vendor/@jinn-network/sdk/dist/contracts.js +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/manifest-schema.d.ts +3 -0
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/manifest-schema.js +1 -0
- package/package.json +29 -12
- package/dist/dashboard/assets/index-C_QnE4YV.js +0 -140
- package/dist/dashboard/assets/index-CarzUepP.css +0 -32
package/dist/main.js
CHANGED
|
@@ -26,7 +26,8 @@ import { dirname, join } from 'node:path';
|
|
|
26
26
|
import { fileURLToPath } from 'node:url';
|
|
27
27
|
import { loadConfig, getConfigPathFromArgs, DEFAULT_CONFIG_PATH } from './config.js';
|
|
28
28
|
import { Store } from './store/store.js';
|
|
29
|
-
import { startApiServer } from './api/server.js';
|
|
29
|
+
import { startApiServer, isEmbeddedAgentEnabled } from './api/server.js';
|
|
30
|
+
import { setDefaultTxSubmissionLedger } from './tx-retry.js';
|
|
30
31
|
// addHarnessReadinessRoutes is wired through startApiServer's holder ref now
|
|
31
32
|
// (jinn-mono-u34i). No direct import needed.
|
|
32
33
|
import { CapturePublishUnavailableError } from './api/captures.js';
|
|
@@ -49,6 +50,7 @@ import { decryptMnemonic, deriveMasterSigner, walletPrivateKeyAtIndex } from './
|
|
|
49
50
|
import { MechAdapter } from './adapters/mech/adapter.js';
|
|
50
51
|
import { ClaudeRunner } from './runner/claude.js';
|
|
51
52
|
import { Daemon } from './daemon/daemon.js';
|
|
53
|
+
import { buildJinnClaimLoopConfig, shouldWireJinnClaimL1Signer, } from './daemon/jinn-claim-loop-wiring.js';
|
|
52
54
|
import { createJinnPublicClient, createJinnWalletClient, createJinnL1PublicClient, createJinnL1WalletClient } from './earning/viem-clients.js';
|
|
53
55
|
import { privateKeyToAccount } from 'viem/accounts';
|
|
54
56
|
import { getAddress } from 'viem';
|
|
@@ -57,6 +59,7 @@ import { joinedSolverNetsViewFromConfig } from './harnesses/engine/engine.js';
|
|
|
57
59
|
import { buildHarnesses } from './harnesses/impls/index.js';
|
|
58
60
|
import { loadExternalImpl } from './harnesses/external-impls/index.js';
|
|
59
61
|
import { CLAUDE_CODE_HARNESS, CODEX_HARNESS, HERMES_AGENT_HARNESS, harnessStateDirName } from './harnesses/names.js';
|
|
62
|
+
import { resolveContractFromSolverNetId } from './solvernets/launched-record-dispatcher.js';
|
|
60
63
|
import { HarnessReadinessRegistry } from './harnesses/readiness-registry.js';
|
|
61
64
|
import { createClients } from './adapters/mech/safe.js';
|
|
62
65
|
import { loadSolverNets } from './solver-nets/registry.js';
|
|
@@ -77,7 +80,7 @@ import { GeminiSessionParser } from './trajectory/transcript-parsers/gemini-sess
|
|
|
77
80
|
import { CursorSqliteParser } from './trajectory/transcript-parsers/cursor-sqlite.js';
|
|
78
81
|
import { buildInfo } from './build-info.js';
|
|
79
82
|
import { BASE_FEEDS } from './venues/chainlink/feeds.js';
|
|
80
|
-
import { GeneratedTaskSource, StaticConfiguredTaskSource } from './tasks/sources.js';
|
|
83
|
+
import { GeneratedTaskSource, StaticConfiguredTaskSource, filterBindableTasks } from './tasks/sources.js';
|
|
81
84
|
import { checkRpcNetwork, logRpcLocalDevToStderr, rpcNetworkFailureHint } from './preflight/rpc-network.js';
|
|
82
85
|
import { apiPortFailureMessage, checkApiPortAvailable } from './preflight/api-port.js';
|
|
83
86
|
import { openBrowser } from './cli/open-browser.js';
|
|
@@ -134,8 +137,19 @@ const config = loadConfig(CONFIG_PATH);
|
|
|
134
137
|
if (config.network === 'mainnet' && process.env['JINN_ENABLE_MAINNET'] !== '1') {
|
|
135
138
|
console.warn('[main] Mainnet is disabled before launch; using testnet defaults.');
|
|
136
139
|
config.network = 'testnet';
|
|
137
|
-
config.rpcUrl = 'https://base-sepolia.
|
|
140
|
+
config.rpcUrl = 'https://base-sepolia-rpc.publicnode.com';
|
|
138
141
|
}
|
|
142
|
+
// Issue #326: the embedded Claude agent chat surface (right rail + onboarding
|
|
143
|
+
// "Ask Claude" panel + /api/agent/ws bridge) is hidden by default while its
|
|
144
|
+
// action-authority / plugin-scope shape is still in design. Set
|
|
145
|
+
// `JINN_ENABLE_EMBEDDED_AGENT=1` to re-enable it for development. This does
|
|
146
|
+
// NOT affect Claude-Code-as-a-solver-harness — that path is independent.
|
|
147
|
+
//
|
|
148
|
+
// Issue #367: the SPA reads this flag via the injected `window.__JINN_FEATURES__`
|
|
149
|
+
// (`resolveFeatureFlags` in api/server.ts) like every other operator-app flag.
|
|
150
|
+
// This `embeddedAgentEnabled` const is the daemon-side consumer only — it gates
|
|
151
|
+
// whether the `/api/agent/ws` bridge is mounted below.
|
|
152
|
+
const embeddedAgentEnabled = isEmbeddedAgentEnabled();
|
|
139
153
|
let activeClaudePath = config.claudePath ?? 'claude';
|
|
140
154
|
const selectClaudePath = (claudePath) => {
|
|
141
155
|
activeClaudePath = claudePath;
|
|
@@ -695,6 +709,7 @@ export async function main() {
|
|
|
695
709
|
// /v1/bootstrap + /v1/events + /v1/status here. The same Store instance is
|
|
696
710
|
// later passed into Daemon so we don't double-open the SQLite file.
|
|
697
711
|
const sharedStore = new Store(config.dbPath);
|
|
712
|
+
setDefaultTxSubmissionLedger(sharedStore);
|
|
698
713
|
const capturesStore = new CapturesStore(sharedStore);
|
|
699
714
|
let captureReceiver;
|
|
700
715
|
try {
|
|
@@ -800,13 +815,32 @@ export async function main() {
|
|
|
800
815
|
hermesPath: config.hermesPath,
|
|
801
816
|
hermesDoctorTimeoutMs: config.hermesDoctorTimeoutMs,
|
|
802
817
|
},
|
|
818
|
+
codexDoctor: {
|
|
819
|
+
codexPath: config.codexPath,
|
|
820
|
+
codexDoctorTimeoutMs: config.codexDoctorTimeoutMs,
|
|
821
|
+
},
|
|
803
822
|
admin: {
|
|
804
823
|
// jinn-mono #289: in interactive mode (the dashboard SPA case),
|
|
805
824
|
// spawn a detached replacement before exiting so the panel reconnects
|
|
806
825
|
// to a live daemon instead of seeing a 502 + terminal prompt. In
|
|
807
826
|
// headless mode (`JINN_NO_UI=1`), exit without respawning so the
|
|
808
827
|
// supervisor / systemd / docker entrypoint decides what to do.
|
|
809
|
-
|
|
828
|
+
// Stop: pure exit, never respawn. The operator clicked Stop; they
|
|
829
|
+
// want the daemon down until they explicitly start it again.
|
|
830
|
+
onStopRequested: () => process.exit(0),
|
|
831
|
+
onRestartRequested: (opts) => requestDaemonRestart({
|
|
832
|
+
forceRespawn: opts.forceRespawn,
|
|
833
|
+
// jinn-mono #561: close the API + OTLP listeners before the
|
|
834
|
+
// replacement spawns, so the child binds without an
|
|
835
|
+
// EADDRINUSE race. Errors are swallowed inside
|
|
836
|
+
// requestDaemonRestart so the operator is never stranded.
|
|
837
|
+
preSpawnCleanup: async () => {
|
|
838
|
+
await setupApiServer.close().catch(() => undefined);
|
|
839
|
+
if (captureReceiver) {
|
|
840
|
+
await captureReceiver.shutdown().catch(() => undefined);
|
|
841
|
+
}
|
|
842
|
+
},
|
|
843
|
+
}),
|
|
810
844
|
},
|
|
811
845
|
harnessStatus: {
|
|
812
846
|
getStatus: async () => {
|
|
@@ -1020,6 +1054,12 @@ export async function main() {
|
|
|
1020
1054
|
status: {
|
|
1021
1055
|
earningDir: config.earningDir,
|
|
1022
1056
|
rpcUrl: config.rpcUrl,
|
|
1057
|
+
// tJINN identity comes from the bundled JINN MVI L1 artifact
|
|
1058
|
+
// (`JINN_MVI_CONFIG`) — one source of truth. The Sepolia RPC endpoint
|
|
1059
|
+
// is read from `config.ethereumRpcUrl` via the threaded `config`.
|
|
1060
|
+
tjinnTokenAddress: JINN_MVI_CONFIG.jinn,
|
|
1061
|
+
tjinnChainId: JINN_MVI_CONFIG.l1ChainId,
|
|
1062
|
+
tjinnDistributorAddress: JINN_MVI_CONFIG.distributor,
|
|
1023
1063
|
network: config.network,
|
|
1024
1064
|
pollIntervalMs: config.pollIntervalMs,
|
|
1025
1065
|
masterEthDailyEstimateWei: config.masterEthDailyEstimateWei,
|
|
@@ -1168,30 +1208,41 @@ export async function main() {
|
|
|
1168
1208
|
// can attach to a long-lived embedded `claude` subprocess. The embedded
|
|
1169
1209
|
// session reads MCP config we materialise to disk so it can reach the
|
|
1170
1210
|
// operator MCP server (`jinn mcp`) for tool calls.
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1211
|
+
//
|
|
1212
|
+
// Issue #326: the embedded agent chat surface is hidden by default. The WS
|
|
1213
|
+
// bridge mounts only when `JINN_ENABLE_EMBEDDED_AGENT=1` so the dev-time
|
|
1214
|
+
// path stays end-to-end; with the flag off there is no /api/agent/ws route
|
|
1215
|
+
// and the SPA never renders the chat panel. Claude-Code-as-solver-harness
|
|
1216
|
+
// is independent of this bridge and unaffected.
|
|
1217
|
+
if (embeddedAgentEnabled) {
|
|
1218
|
+
const operatorMcpConfigPath = join(homedir(), '.jinn-client', 'operator-mcp-config.json');
|
|
1219
|
+
try {
|
|
1220
|
+
mkdirSync(dirname(operatorMcpConfigPath), { recursive: true });
|
|
1221
|
+
writeFileSyncMain(operatorMcpConfigPath, JSON.stringify({
|
|
1222
|
+
mcpServers: {
|
|
1223
|
+
'jinn-operator': {
|
|
1224
|
+
command: 'jinn',
|
|
1225
|
+
args: ['mcp'],
|
|
1226
|
+
},
|
|
1179
1227
|
},
|
|
1180
|
-
},
|
|
1181
|
-
}
|
|
1228
|
+
}, null, 2));
|
|
1229
|
+
}
|
|
1230
|
+
catch (err) {
|
|
1231
|
+
console.warn(`[main] Failed to write operator MCP config at ${operatorMcpConfigPath}: ` +
|
|
1232
|
+
(err instanceof Error ? err.message : String(err)));
|
|
1233
|
+
}
|
|
1234
|
+
attachAgentWs({
|
|
1235
|
+
httpServer: setupApiServer.server,
|
|
1236
|
+
uiToken,
|
|
1237
|
+
claudePath: activeClaudePath,
|
|
1238
|
+
cwd: process.cwd(),
|
|
1239
|
+
mcpConfigPath: operatorMcpConfigPath,
|
|
1240
|
+
});
|
|
1241
|
+
console.log(`[main] Agent WS bridge mounted at ws://127.0.0.1:${setupApiServer.port}/api/agent/ws`);
|
|
1182
1242
|
}
|
|
1183
|
-
|
|
1184
|
-
console.
|
|
1185
|
-
(err instanceof Error ? err.message : String(err)));
|
|
1243
|
+
else {
|
|
1244
|
+
console.log('[main] Embedded agent surface disabled (set JINN_ENABLE_EMBEDDED_AGENT=1 to enable).');
|
|
1186
1245
|
}
|
|
1187
|
-
attachAgentWs({
|
|
1188
|
-
httpServer: setupApiServer.server,
|
|
1189
|
-
uiToken,
|
|
1190
|
-
claudePath: activeClaudePath,
|
|
1191
|
-
cwd: process.cwd(),
|
|
1192
|
-
mcpConfigPath: operatorMcpConfigPath,
|
|
1193
|
-
});
|
|
1194
|
-
console.log(`[main] Agent WS bridge mounted at ws://127.0.0.1:${setupApiServer.port}/api/agent/ws`);
|
|
1195
1246
|
// ── Init-if-missing ──────────────────────────────────────────────────────
|
|
1196
1247
|
// If the keystore is missing but we have a password, run `jinn init` now so
|
|
1197
1248
|
// bootstrap has something to decrypt. Idempotent: init is a no-op when the
|
|
@@ -1507,19 +1558,45 @@ export async function main() {
|
|
|
1507
1558
|
// ── L1 (Sepolia / Ethereum mainnet) clients for cross-chain JINN claim loop ──
|
|
1508
1559
|
// Uses the agent EOA because MockMessenger.owner is the agent on testnet.
|
|
1509
1560
|
// Same key as L2; only the chain differs.
|
|
1510
|
-
const
|
|
1561
|
+
const shouldWireJinnClaimL1 = shouldWireJinnClaimL1Signer({
|
|
1562
|
+
enabled: config.jinnClaimLoopEnabled,
|
|
1563
|
+
intervalMs: config.jinnClaimLoopIntervalMs,
|
|
1564
|
+
submissionMode: config.jinnClaimSubmissionMode,
|
|
1565
|
+
distributorAddress: JINN_MVI_CONFIG.distributor,
|
|
1566
|
+
ethereumRpcUrl: config.ethereumRpcUrl,
|
|
1567
|
+
});
|
|
1568
|
+
const l1ClientsForJinnClaim = shouldWireJinnClaimL1 && config.ethereumRpcUrl
|
|
1511
1569
|
? {
|
|
1512
1570
|
public: createJinnL1PublicClient(config.ethereumRpcUrl, config.jinnL1Network),
|
|
1513
1571
|
wallet: createJinnL1WalletClient(config.ethereumRpcUrl, config.jinnL1Network, privateKeyToAccount(agentPrivateKey)),
|
|
1514
1572
|
}
|
|
1515
1573
|
: undefined;
|
|
1516
|
-
|
|
1517
|
-
|
|
1574
|
+
const jinnClaimLoopConfig = buildJinnClaimLoopConfig({
|
|
1575
|
+
enabled: config.jinnClaimLoopEnabled,
|
|
1576
|
+
intervalMs: config.jinnClaimLoopIntervalMs,
|
|
1577
|
+
submissionMode: config.jinnClaimSubmissionMode,
|
|
1578
|
+
messengerMode: JINN_CLAIM_MESSENGER_MODE,
|
|
1579
|
+
mvi: JINN_MVI_CONFIG,
|
|
1580
|
+
l2Client: agentClients.publicClient,
|
|
1581
|
+
l2ProofClient,
|
|
1582
|
+
l2Wallet: agentClients.walletClient,
|
|
1583
|
+
l1Clients: l1ClientsForJinnClaim,
|
|
1584
|
+
store: earningStore,
|
|
1585
|
+
chain: NETWORK_CHAIN,
|
|
1586
|
+
optimismPortalAddress,
|
|
1587
|
+
disputeGameFactoryAddress,
|
|
1588
|
+
});
|
|
1589
|
+
if (jinnClaimLoopConfig) {
|
|
1590
|
+
console.log(`[main] JinnClaimLoop: enabled (submission=${config.jinnClaimSubmissionMode}, ` +
|
|
1591
|
+
`mode=${JINN_CLAIM_MESSENGER_MODE}, ` +
|
|
1518
1592
|
`interval=${config.jinnClaimLoopIntervalMs}ms, distributor=${JINN_MVI_CONFIG.distributor}, ` +
|
|
1519
1593
|
`emitter=${JINN_MVI_CONFIG.claimEmitter})`);
|
|
1520
1594
|
}
|
|
1595
|
+
else if (!config.jinnClaimLoopEnabled) {
|
|
1596
|
+
console.log('[main] JinnClaimLoop: disabled (jinnClaimLoopEnabled=false)');
|
|
1597
|
+
}
|
|
1521
1598
|
else {
|
|
1522
|
-
console.log(`[main] JinnClaimLoop: disabled (
|
|
1599
|
+
console.log(`[main] JinnClaimLoop: disabled (missing claim-loop artifacts, interval disabled, or L1 submit wiring)`);
|
|
1523
1600
|
}
|
|
1524
1601
|
// ── Harness registry ─────────────────────────────────────────────────────────
|
|
1525
1602
|
const solverNetRegistry = await loadSolverNets(config);
|
|
@@ -1612,6 +1689,8 @@ export async function main() {
|
|
|
1612
1689
|
hermesModel: config.hermesModel,
|
|
1613
1690
|
hermesProvider: config.hermesProvider,
|
|
1614
1691
|
hermesDoctorTimeoutMs: config.hermesDoctorTimeoutMs,
|
|
1692
|
+
codexPath: config.codexPath,
|
|
1693
|
+
codexDoctorTimeoutMs: config.codexDoctorTimeoutMs,
|
|
1615
1694
|
})) {
|
|
1616
1695
|
implRegistry.register(impl);
|
|
1617
1696
|
}
|
|
@@ -1881,11 +1960,19 @@ export async function main() {
|
|
|
1881
1960
|
if (!safeAddressForLauncher) {
|
|
1882
1961
|
throw new Error('[main] safeAddressForLauncher missing at SolverNet endpoints registration');
|
|
1883
1962
|
}
|
|
1963
|
+
const getGeneratorState = (solverNetId) => {
|
|
1964
|
+
const entry = pendingGeneratorsRef.current.find((g) => g.recordRef.current.solverNetId === solverNetId);
|
|
1965
|
+
const resolved = resolveContractFromSolverNetId(entry?.recordRef.current.solverNetId ?? solverNetId);
|
|
1966
|
+
if (!resolved)
|
|
1967
|
+
return undefined;
|
|
1968
|
+
return launchedGeneratorStateBySolverType.get(resolved.solverType)?.();
|
|
1969
|
+
};
|
|
1884
1970
|
solverNetEndpointsDepsHolder.current = {
|
|
1885
1971
|
store: solverNetStore,
|
|
1886
1972
|
launch: {
|
|
1887
1973
|
launchAction,
|
|
1888
1974
|
lifecycleTransition,
|
|
1975
|
+
getGeneratorState,
|
|
1889
1976
|
pendingGenerators: pendingGeneratorsRef,
|
|
1890
1977
|
signer: launcherSigner,
|
|
1891
1978
|
network: 'base-sepolia',
|
|
@@ -1960,9 +2047,23 @@ export async function main() {
|
|
|
1960
2047
|
if (config.network === 'mainnet' && !autoTasksDisabled && BASE_FEEDS['ETH / USD']) {
|
|
1961
2048
|
// Mainnet auto-task opt-in only; default is OFF. Reserved for a future flag.
|
|
1962
2049
|
}
|
|
2050
|
+
// filterBindableTasks (issue #415): drop config-level tasks[] entries without
|
|
2051
|
+
// solverNetManifestCid before they enter the creator loop. Such entries would
|
|
2052
|
+
// throw a PermanentError on every attempt and retry every 30 min indefinitely.
|
|
2053
|
+
const bindableConfigTasks = filterBindableTasks(config.tasks);
|
|
1963
2054
|
const taskSources = [
|
|
1964
|
-
new StaticConfiguredTaskSource(
|
|
1965
|
-
...launchedRecordGenerators.map(({ solverType, generator }, idx) => new GeneratedTaskSource(`launched:${solverType}:${idx}`, generator
|
|
2055
|
+
new StaticConfiguredTaskSource(bindableConfigTasks),
|
|
2056
|
+
...launchedRecordGenerators.map(({ solverType, generator }, idx) => new GeneratedTaskSource(`launched:${solverType}:${idx}`, generator, {
|
|
2057
|
+
bucketKeyForTask: (task) => {
|
|
2058
|
+
if (task.solverType !== 'swe-rebench-v2.v1')
|
|
2059
|
+
return undefined;
|
|
2060
|
+
const instanceId = task.spec?.['instance_id'];
|
|
2061
|
+
const postedCount = task.eligibility?.['posted_count_after_record'];
|
|
2062
|
+
if (typeof instanceId !== 'string' || typeof postedCount !== 'number')
|
|
2063
|
+
return undefined;
|
|
2064
|
+
return `swe-rebench-v2:${instanceId}:${postedCount}`;
|
|
2065
|
+
},
|
|
2066
|
+
})),
|
|
1966
2067
|
];
|
|
1967
2068
|
// ── Corpus (daemon-side, jinn-mono-vy37.1.6) ─────────────────────────────
|
|
1968
2069
|
//
|
|
@@ -2014,6 +2115,12 @@ export async function main() {
|
|
|
2014
2115
|
status: {
|
|
2015
2116
|
earningDir: config.earningDir,
|
|
2016
2117
|
rpcUrl: config.rpcUrl,
|
|
2118
|
+
// tJINN identity comes from the bundled JINN MVI L1 artifact
|
|
2119
|
+
// (`JINN_MVI_CONFIG`) — one source of truth. The Sepolia RPC endpoint
|
|
2120
|
+
// is read from `config.ethereumRpcUrl` via the threaded `config`.
|
|
2121
|
+
tjinnTokenAddress: JINN_MVI_CONFIG.jinn,
|
|
2122
|
+
tjinnChainId: JINN_MVI_CONFIG.l1ChainId,
|
|
2123
|
+
tjinnDistributorAddress: JINN_MVI_CONFIG.distributor,
|
|
2017
2124
|
network: config.network,
|
|
2018
2125
|
pollIntervalMs: config.pollIntervalMs,
|
|
2019
2126
|
masterEthDailyEstimateWei: config.masterEthDailyEstimateWei,
|
|
@@ -2036,28 +2143,7 @@ export async function main() {
|
|
|
2036
2143
|
distributorAddress: CHAIN_CONFIG.distributorAddress,
|
|
2037
2144
|
}
|
|
2038
2145
|
: undefined,
|
|
2039
|
-
jinnClaim:
|
|
2040
|
-
JINN_MVI_CONFIG.claimEmitter &&
|
|
2041
|
-
JINN_MVI_CONFIG.messenger &&
|
|
2042
|
-
JINN_MVI_CONFIG.distributor &&
|
|
2043
|
-
config.jinnClaimLoopIntervalMs > 0
|
|
2044
|
-
? {
|
|
2045
|
-
intervalMs: config.jinnClaimLoopIntervalMs,
|
|
2046
|
-
l2Client: agentClients.publicClient,
|
|
2047
|
-
l2ProofClient,
|
|
2048
|
-
l2Wallet: agentClients.walletClient,
|
|
2049
|
-
l1Client: l1ClientsForJinnClaim.public,
|
|
2050
|
-
l1Wallet: l1ClientsForJinnClaim.wallet,
|
|
2051
|
-
store: earningStore,
|
|
2052
|
-
chain: NETWORK_CHAIN,
|
|
2053
|
-
claimEmitterAddress: JINN_MVI_CONFIG.claimEmitter,
|
|
2054
|
-
distributorAddress: JINN_MVI_CONFIG.distributor,
|
|
2055
|
-
messengerAddress: JINN_MVI_CONFIG.messenger,
|
|
2056
|
-
messengerMode: JINN_CLAIM_MESSENGER_MODE,
|
|
2057
|
-
optimismPortalAddress,
|
|
2058
|
-
disputeGameFactoryAddress,
|
|
2059
|
-
}
|
|
2060
|
-
: undefined,
|
|
2146
|
+
jinnClaim: jinnClaimLoopConfig,
|
|
2061
2147
|
restorationEngine: {
|
|
2062
2148
|
paths: {
|
|
2063
2149
|
workingDirRoot: config.engine.workingDirRoot,
|
|
@@ -2128,6 +2214,35 @@ export async function main() {
|
|
|
2128
2214
|
},
|
|
2129
2215
|
}
|
|
2130
2216
|
: undefined,
|
|
2217
|
+
// Checkpoint loop — proactively advances `tsCheckpoint` on each staked
|
|
2218
|
+
// proxy so the activity-rate window stays narrow (issue #505).
|
|
2219
|
+
// `checkpoint()` is permissionless; master EOA pays gas. No-op for
|
|
2220
|
+
// non-standard staking modes.
|
|
2221
|
+
checkpoint: config.checkpointIntervalMs > 0 && config.stakingMode === 'standard'
|
|
2222
|
+
? {
|
|
2223
|
+
intervalMs: config.checkpointIntervalMs,
|
|
2224
|
+
store: earningStore,
|
|
2225
|
+
chain: NETWORK_CHAIN,
|
|
2226
|
+
writeCheckpoint: async ({ stakingProxy }) => {
|
|
2227
|
+
const txHash = await masterWallet.writeContract({
|
|
2228
|
+
address: stakingProxy,
|
|
2229
|
+
abi: [
|
|
2230
|
+
{
|
|
2231
|
+
type: 'function',
|
|
2232
|
+
name: 'checkpoint',
|
|
2233
|
+
stateMutability: 'nonpayable',
|
|
2234
|
+
inputs: [],
|
|
2235
|
+
outputs: [],
|
|
2236
|
+
},
|
|
2237
|
+
],
|
|
2238
|
+
functionName: 'checkpoint',
|
|
2239
|
+
account: masterAccount,
|
|
2240
|
+
chain: null,
|
|
2241
|
+
});
|
|
2242
|
+
return { txHash };
|
|
2243
|
+
},
|
|
2244
|
+
}
|
|
2245
|
+
: undefined,
|
|
2131
2246
|
});
|
|
2132
2247
|
// Write pidfile so `jinn stop` can find us.
|
|
2133
2248
|
const pidPath = join(config.earningDir, 'daemon.pid');
|