@jinn-network/client 0.1.7-canary.d4e4e183 → 0.1.7-canary.e87c1a0d

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.
Files changed (177) hide show
  1. package/README.md +67 -1
  2. package/dist/adapters/mech/adapter.js +27 -3
  3. package/dist/adapters/mech/adapter.js.map +1 -1
  4. package/dist/adapters/mech/safe.d.ts +1 -1
  5. package/dist/adapters/mech/safe.js +5 -3
  6. package/dist/adapters/mech/safe.js.map +1 -1
  7. package/dist/adapters/mech/types.d.ts +6 -1
  8. package/dist/adapters/mech/types.js.map +1 -1
  9. package/dist/api/activity-events-endpoint.d.ts +14 -0
  10. package/dist/api/activity-events-endpoint.js +59 -0
  11. package/dist/api/activity-events-endpoint.js.map +1 -0
  12. package/dist/api/bootstrap-endpoint.d.ts +1 -2
  13. package/dist/api/bootstrap-endpoint.js +42 -24
  14. package/dist/api/bootstrap-endpoint.js.map +1 -1
  15. package/dist/api/codex-doctor-endpoint.d.ts +6 -0
  16. package/dist/api/codex-doctor-endpoint.js +92 -0
  17. package/dist/api/codex-doctor-endpoint.js.map +1 -1
  18. package/dist/api/gather-status.d.ts +26 -0
  19. package/dist/api/gather-status.js +183 -26
  20. package/dist/api/gather-status.js.map +1 -1
  21. package/dist/api/launcher-status.d.ts +4 -1
  22. package/dist/api/launcher-status.js +11 -10
  23. package/dist/api/launcher-status.js.map +1 -1
  24. package/dist/api/launcher-tasks.d.ts +1 -1
  25. package/dist/api/launcher-tasks.js +12 -8
  26. package/dist/api/launcher-tasks.js.map +1 -1
  27. package/dist/api/operator-artifacts-endpoint.js +73 -6
  28. package/dist/api/operator-artifacts-endpoint.js.map +1 -1
  29. package/dist/api/server.js +27 -1
  30. package/dist/api/server.js.map +1 -1
  31. package/dist/api/setup-endpoints.js +11 -131
  32. package/dist/api/setup-endpoints.js.map +1 -1
  33. package/dist/api/solvernets-endpoints.js +28 -17
  34. package/dist/api/solvernets-endpoints.js.map +1 -1
  35. package/dist/api/status-build.d.ts +96 -2
  36. package/dist/api/status-build.js +45 -11
  37. package/dist/api/status-build.js.map +1 -1
  38. package/dist/api/status-harness-rollup.d.ts +35 -0
  39. package/dist/api/status-harness-rollup.js +45 -0
  40. package/dist/api/status-harness-rollup.js.map +1 -0
  41. package/dist/build-info.json +4 -4
  42. package/dist/build-meta.json +1 -1
  43. package/dist/captures/live-publisher.js +24 -4
  44. package/dist/captures/live-publisher.js.map +1 -1
  45. package/dist/captures/publish.d.ts +1 -1
  46. package/dist/cli/commands/solver-nets.js +92 -21
  47. package/dist/cli/commands/solver-nets.js.map +1 -1
  48. package/dist/cli/commands/solver-plugins-block.d.ts +33 -0
  49. package/dist/cli/commands/solver-plugins-block.js +118 -0
  50. package/dist/cli/commands/solver-plugins-block.js.map +1 -0
  51. package/dist/cli/commands/solver-plugins-feedback.d.ts +72 -0
  52. package/dist/cli/commands/solver-plugins-feedback.js +262 -0
  53. package/dist/cli/commands/solver-plugins-feedback.js.map +1 -0
  54. package/dist/cli/commands/solver-plugins-read.d.ts +54 -0
  55. package/dist/cli/commands/solver-plugins-read.js +259 -0
  56. package/dist/cli/commands/solver-plugins-read.js.map +1 -0
  57. package/dist/cli/commands/solver-plugins.d.ts +35 -0
  58. package/dist/cli/commands/solver-plugins.js +399 -2
  59. package/dist/cli/commands/solver-plugins.js.map +1 -1
  60. package/dist/cli/commands/tasks.js +15 -2
  61. package/dist/cli/commands/tasks.js.map +1 -1
  62. package/dist/cli/task-native-readiness.d.ts +7 -0
  63. package/dist/cli/task-native-readiness.js +7 -5
  64. package/dist/cli/task-native-readiness.js.map +1 -1
  65. package/dist/config.d.ts +169 -232
  66. package/dist/config.js +219 -107
  67. package/dist/config.js.map +1 -1
  68. package/dist/daemon/daemon.d.ts +3 -0
  69. package/dist/daemon/daemon.js +88 -22
  70. package/dist/daemon/daemon.js.map +1 -1
  71. package/dist/daemon/gate-logger.d.ts +9 -0
  72. package/dist/daemon/gate-logger.js +2 -0
  73. package/dist/daemon/gate-logger.js.map +1 -0
  74. package/dist/daemon/readiness-gate.d.ts +1 -4
  75. package/dist/daemon/readiness-gate.js.map +1 -1
  76. package/dist/daemon/spend-cap-gate.d.ts +40 -0
  77. package/dist/daemon/spend-cap-gate.js +46 -0
  78. package/dist/daemon/spend-cap-gate.js.map +1 -0
  79. package/dist/dashboard/assets/index-C4huIsUW.css +32 -0
  80. package/dist/dashboard/assets/index-DkTglWXU.js +345 -0
  81. package/dist/dashboard/index.html +2 -2
  82. package/dist/earning/bootstrap.d.ts +8 -3
  83. package/dist/earning/bootstrap.js +18 -11
  84. package/dist/earning/bootstrap.js.map +1 -1
  85. package/dist/earning/safe-adapter.js +23 -11
  86. package/dist/earning/safe-adapter.js.map +1 -1
  87. package/dist/earning/types.d.ts +6 -6
  88. package/dist/earning/viem-clients.d.ts +11 -4
  89. package/dist/earning/viem-clients.js +14 -5
  90. package/dist/earning/viem-clients.js.map +1 -1
  91. package/dist/erc8004/identity.d.ts +19 -3
  92. package/dist/erc8004/identity.js +21 -6
  93. package/dist/erc8004/identity.js.map +1 -1
  94. package/dist/erc8004/index.d.ts +1 -1
  95. package/dist/erc8004/index.js.map +1 -1
  96. package/dist/events/types.d.ts +2 -2
  97. package/dist/harnesses/engine/engine.js +42 -3
  98. package/dist/harnesses/engine/engine.js.map +1 -1
  99. package/dist/harnesses/impls/hermes-agent/prompt.d.ts +6 -6
  100. package/dist/harnesses/impls/hermes-agent/prompt.js +6 -6
  101. package/dist/harnesses/impls/learner/adapters/codex-code.d.ts +9 -0
  102. package/dist/harnesses/impls/learner/adapters/codex-code.js +22 -8
  103. package/dist/harnesses/impls/learner/adapters/codex-code.js.map +1 -1
  104. package/dist/harnesses/impls/swe-rebench-v2-evaluator/hf-fetcher.d.ts +74 -5
  105. package/dist/harnesses/impls/swe-rebench-v2-evaluator/hf-fetcher.js +103 -32
  106. package/dist/harnesses/impls/swe-rebench-v2-evaluator/hf-fetcher.js.map +1 -1
  107. package/dist/harnesses/readiness-registry.d.ts +7 -0
  108. package/dist/harnesses/readiness-registry.js +9 -0
  109. package/dist/harnesses/readiness-registry.js.map +1 -1
  110. package/dist/main.js +49 -31
  111. package/dist/main.js.map +1 -1
  112. package/dist/observability/emit-event.d.ts +3 -2
  113. package/dist/observability/emit-event.js +22 -1
  114. package/dist/observability/emit-event.js.map +1 -1
  115. package/dist/preflight/rpc-network.d.ts +40 -0
  116. package/dist/preflight/rpc-network.js +67 -1
  117. package/dist/preflight/rpc-network.js.map +1 -1
  118. package/dist/rpc/transport.d.ts +109 -0
  119. package/dist/rpc/transport.js +220 -0
  120. package/dist/rpc/transport.js.map +1 -0
  121. package/dist/scripts/donation-consumption-acceptance.js +7 -28
  122. package/dist/scripts/donation-consumption-acceptance.js.map +1 -1
  123. package/dist/solver-nets/prediction-operator-ux.d.ts +1 -2
  124. package/dist/solver-nets/prediction-operator-ux.js +56 -53
  125. package/dist/solver-nets/prediction-operator-ux.js.map +1 -1
  126. package/dist/solver-nets/registry.d.ts +19 -1
  127. package/dist/solver-nets/registry.js +37 -24
  128. package/dist/solver-nets/registry.js.map +1 -1
  129. package/dist/solver-types/_swe-rebench-v2-pool.d.ts +9 -2
  130. package/dist/solver-types/_swe-rebench-v2-pool.js +15 -20
  131. package/dist/solver-types/_swe-rebench-v2-pool.js.map +1 -1
  132. package/dist/solver-types/_swe-rebench-v2-validated-pool.d.ts +29 -1
  133. package/dist/solver-types/_swe-rebench-v2-validated-pool.js +62 -13
  134. package/dist/solver-types/_swe-rebench-v2-validated-pool.js.map +1 -1
  135. package/dist/solver-types/swe-rebench-v2-auto.js +13 -1
  136. package/dist/solver-types/swe-rebench-v2-auto.js.map +1 -1
  137. package/dist/solver-types/swe-rebench-v2.d.ts +3 -0
  138. package/dist/solver-types/swe-rebench-v2.js +44 -6
  139. package/dist/solver-types/swe-rebench-v2.js.map +1 -1
  140. package/dist/solvernets/launched-record-dispatcher.js +9 -0
  141. package/dist/solvernets/launched-record-dispatcher.js.map +1 -1
  142. package/dist/spend/credential.d.ts +8 -0
  143. package/dist/spend/credential.js +30 -0
  144. package/dist/spend/credential.js.map +1 -0
  145. package/dist/spend/daemon-config.d.ts +13 -0
  146. package/dist/spend/daemon-config.js +24 -0
  147. package/dist/spend/daemon-config.js.map +1 -0
  148. package/dist/spend/pricing.d.ts +16 -0
  149. package/dist/spend/pricing.js +26 -0
  150. package/dist/spend/pricing.js.map +1 -0
  151. package/dist/spend/record.d.ts +13 -0
  152. package/dist/spend/record.js +30 -0
  153. package/dist/spend/record.js.map +1 -0
  154. package/dist/spend/usage.d.ts +27 -0
  155. package/dist/spend/usage.js +113 -0
  156. package/dist/spend/usage.js.map +1 -0
  157. package/dist/store/store.d.ts +46 -0
  158. package/dist/store/store.js +184 -4
  159. package/dist/store/store.js.map +1 -1
  160. package/dist/trajectory/transcript-parsers/types.d.ts +8 -8
  161. package/dist/tx-retry.d.ts +15 -0
  162. package/dist/tx-retry.js +30 -6
  163. package/dist/tx-retry.js.map +1 -1
  164. package/package.json +7 -1
  165. package/plugins/swe-rebench-v2-diffmin/README.md +10 -9
  166. package/plugins/swe-rebench-v2-diffmin/jinn.plugin.json +1 -1
  167. package/plugins/swe-rebench-v2-diffmin/skills/diffmin/SKILL.md +15 -10
  168. package/plugins/swe-rebench-v2-diffmin/skills/test-map/SKILL.md +10 -12
  169. package/plugins/swe-rebench-v2-runtime/.claude-plugin/plugin.json +1 -1
  170. package/plugins/swe-rebench-v2-runtime/.codex-plugin/plugin.json +3 -3
  171. package/plugins/swe-rebench-v2-runtime/README.md +6 -6
  172. package/plugins/swe-rebench-v2-runtime/jinn.plugin.json +2 -3
  173. package/plugins/swe-rebench-v2-runtime/skills/task/SKILL.md +69 -0
  174. package/dist/dashboard/assets/index-BUlE8F3Y.js +0 -330
  175. package/dist/dashboard/assets/index-blqc7eqq.css +0 -32
  176. package/plugins/swe-rebench-v2-runtime/skills/orient/SKILL.md +0 -29
  177. package/plugins/swe-rebench-v2-runtime/skills/plan/SKILL.md +0 -53
@@ -0,0 +1,33 @@
1
+ /**
2
+ * `jinn solver-plugins block <pluginCid> --reason <text>` — dual-effect verb.
3
+ *
4
+ * Network half: submits a `score=0` `giveFeedback({ tag1: 'block', tag2:
5
+ * reason })` against the builder's agentId, mirroring `warnHandler` /
6
+ * `endorseHandler`.
7
+ *
8
+ * Local half: appends `pluginCid` to `cfg.solverPlugins.blockedCids` and
9
+ * writes the operator config file. The daemon reads this list at startup and
10
+ * refuses to load matching plug-ins.
11
+ *
12
+ * Failure-mode policy (see spec/2026-05-26-117-design.md "Failure modes"):
13
+ * - Network publish fails → emit `{ blockedLocal: true, pluginCid,
14
+ * networkPublishError: { code: 'blocked_locally_only', message } }`,
15
+ * exit 0. The local refusal succeeded.
16
+ * - Network publish succeeds AND local write succeeds → emit
17
+ * `{ blockedLocal: true, txHash, pluginCid }`, exit 0.
18
+ * - Local write fails → emit `{ error: { code: 'config_write_failed' } }`,
19
+ * exit 1. This overrides any earlier network outcome (the operator's
20
+ * intent did not land on disk).
21
+ *
22
+ * The password / config / discovery / Stage 1 prologue is the same one the
23
+ * other write verbs use — see `preparePipeline` in
24
+ * `solver-plugins-feedback.ts`.
25
+ */
26
+ import type { CommandContext } from '../command.js';
27
+ import type { SolverPluginsDeps } from './solver-plugins.js';
28
+ export interface BlockOptions {
29
+ pluginCid: string;
30
+ reason: string;
31
+ configPath: string | undefined;
32
+ }
33
+ export declare function blockHandler(ctx: CommandContext, opts: BlockOptions, deps: SolverPluginsDeps): Promise<void>;
@@ -0,0 +1,118 @@
1
+ /**
2
+ * `jinn solver-plugins block <pluginCid> --reason <text>` — dual-effect verb.
3
+ *
4
+ * Network half: submits a `score=0` `giveFeedback({ tag1: 'block', tag2:
5
+ * reason })` against the builder's agentId, mirroring `warnHandler` /
6
+ * `endorseHandler`.
7
+ *
8
+ * Local half: appends `pluginCid` to `cfg.solverPlugins.blockedCids` and
9
+ * writes the operator config file. The daemon reads this list at startup and
10
+ * refuses to load matching plug-ins.
11
+ *
12
+ * Failure-mode policy (see spec/2026-05-26-117-design.md "Failure modes"):
13
+ * - Network publish fails → emit `{ blockedLocal: true, pluginCid,
14
+ * networkPublishError: { code: 'blocked_locally_only', message } }`,
15
+ * exit 0. The local refusal succeeded.
16
+ * - Network publish succeeds AND local write succeeds → emit
17
+ * `{ blockedLocal: true, txHash, pluginCid }`, exit 0.
18
+ * - Local write fails → emit `{ error: { code: 'config_write_failed' } }`,
19
+ * exit 1. This overrides any earlier network outcome (the operator's
20
+ * intent did not land on disk).
21
+ *
22
+ * The password / config / discovery / Stage 1 prologue is the same one the
23
+ * other write verbs use — see `preparePipeline` in
24
+ * `solver-plugins-feedback.ts`.
25
+ */
26
+ import { writeJson } from './solver-plugins.js';
27
+ import { preparePipeline } from './solver-plugins-feedback.js';
28
+ import { DEFAULT_CONFIG_PATH } from '../../config.js';
29
+ export async function blockHandler(ctx, opts, deps) {
30
+ const prep = await preparePipeline(ctx, opts.pluginCid, opts.configPath, deps);
31
+ if (!prep)
32
+ return;
33
+ // Step (a): attempt the network publish. Capture either the txHash or the
34
+ // error; never throw out of this block — the local write must run
35
+ // unconditionally.
36
+ let networkTxHash;
37
+ let networkError;
38
+ const client = deps.reputationClientFactory({
39
+ reputationRegistryAddress: prep.reputationRegistryAddress,
40
+ safeAddress: prep.safeAddress,
41
+ rpcUrl: prep.config.rpcUrl,
42
+ network: prep.config.network === 'testnet' ? 'base-sepolia' : 'base',
43
+ earningDir: prep.config.earningDir,
44
+ password: prep.password,
45
+ });
46
+ try {
47
+ networkTxHash = await client.giveFeedback({
48
+ harnessAgentId: prep.builderAgentId,
49
+ score: 0,
50
+ scoreDecimals: 2,
51
+ manifestRef: prep.manifestRef,
52
+ manifestHash: prep.manifestHash,
53
+ tag1: 'block',
54
+ tag2: opts.reason,
55
+ });
56
+ }
57
+ catch (err) {
58
+ networkError = err instanceof Error ? err : new Error(String(err));
59
+ }
60
+ // Step (b): unconditional local config update. A failure here is fatal —
61
+ // overrides any earlier network outcome.
62
+ const configPath = opts.configPath ?? DEFAULT_CONFIG_PATH;
63
+ try {
64
+ const onDisk = deps.readConfigFile(configPath);
65
+ const existingBlock = typeof onDisk['solverPlugins'] === 'object' && onDisk['solverPlugins'] !== null
66
+ ? onDisk['solverPlugins']
67
+ : {};
68
+ const existingList = Array.isArray(existingBlock['blockedCids'])
69
+ ? existingBlock['blockedCids'].filter((s) => typeof s === 'string')
70
+ : [];
71
+ if (!existingList.includes(opts.pluginCid)) {
72
+ existingList.push(opts.pluginCid);
73
+ }
74
+ const nextConfig = {
75
+ ...onDisk,
76
+ solverPlugins: {
77
+ ...existingBlock,
78
+ blockedCids: existingList,
79
+ },
80
+ };
81
+ deps.writeConfigFile(configPath, nextConfig);
82
+ }
83
+ catch (err) {
84
+ writeJson(ctx, {
85
+ error: {
86
+ code: 'config_write_failed',
87
+ message: err instanceof Error ? err.message : String(err),
88
+ },
89
+ });
90
+ ctx.exit(1);
91
+ return;
92
+ }
93
+ if (networkError) {
94
+ writeJson(ctx, {
95
+ verb: 'solver-plugins block',
96
+ blockedLocal: true,
97
+ pluginCid: opts.pluginCid,
98
+ targetAgentId: prep.builderAgentId.toString(),
99
+ reason: opts.reason,
100
+ networkPublishError: {
101
+ code: 'blocked_locally_only',
102
+ message: networkError.message,
103
+ },
104
+ });
105
+ return;
106
+ }
107
+ writeJson(ctx, {
108
+ verb: 'solver-plugins block',
109
+ blockedLocal: true,
110
+ txHash: networkTxHash,
111
+ pluginCid: opts.pluginCid,
112
+ targetAgentId: prep.builderAgentId.toString(),
113
+ reason: opts.reason,
114
+ reputationRegistry: prep.reputationRegistryAddress,
115
+ safeAddress: prep.safeAddress,
116
+ });
117
+ }
118
+ //# sourceMappingURL=solver-plugins-block.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"solver-plugins-block.js","sourceRoot":"","sources":["../../../src/cli/commands/solver-plugins-block.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAIH,OAAO,EAAE,SAA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AC,MAAM,CAAC,GAAG,CAAC;aAC1D;SACF,CAAC,CAAC;QACH,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACZ,OAAO;IACT,CAAC;IAED,IAAI,YAAY,EAAE,CAAC;QACjB,SAAS,CAAC,GAAG,EAAE;YACb,IAAI,EAAE,sBAAsB;YAC5B,YAAY,EAAE,IAAI;YAClB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,aAAa,EAAE,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE;YAC7C,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,mBAAmB,EAAE;gBACnB,IAAI,EAAE,sBAAsB;gBAC5B,OAAO,EAAE,YAAY,CAAC,OAAO;aAC9B;SACF,CAAC,CAAC;QACH,OAAO;IACT,CAAC;IAED,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,EAAE,sBAAsB;QAC5B,YAAY,EAAE,IAAI;QAClB,MAAM,EAAE,aAAa;QACrB,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,aAAa,EAAE,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE;QAC7C,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,kBAAkB,EAAE,IAAI,CAAC,yBAAyB;QAClD,WAAW,EAAE,IAAI,CAAC,WAAW;KAC9B,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * `jinn solver-plugins {endorse, warn, review, respond}` — write verbs that
3
+ * route ERC-8004 `ReputationRegistry` feedback writes against the agentId of
4
+ * the builder who published the plug-in. The builder's agentId is resolved
5
+ * from `DiscoveryAPI.listPluginPublications`; the on-chain body anchors the
6
+ * feedback to a specific plug-in via `manifestRef = "plugin:<cid>"` and
7
+ * `manifestHash = keccak256(manifestRef)`.
8
+ *
9
+ * The pipeline mirrors `publishHandler`'s shape:
10
+ * 1. resolveCliPassword (env > keystore-password file > prompt-fd)
11
+ * 2. loadConfig
12
+ * 3. discoveryApiFactory(config).listPluginPublications → builderAgentId
13
+ * 4. bootstrapper.ensureStage1(password) — lazy Stage 1 ensure
14
+ * 5. reputationClientFactory(...).giveFeedback(...) / .respondToFeedback(...)
15
+ *
16
+ * Outputs a single-line JSON envelope: `{ verb, txHash, pluginCid,
17
+ * targetAgentId, ... }`. Error codes match the publish surface convention:
18
+ * `keystore_missing`, `config_load_failed`, `ensure_stage1_failed`,
19
+ * `fleet_identity_missing`, `agentid_unresolvable`, `self_feedback_not_allowed`,
20
+ * `discovery_unavailable`, `publish_failed`.
21
+ */
22
+ import { type Address, type Hex } from 'viem';
23
+ import type { CommandContext } from '../command.js';
24
+ import type { SolverPluginsDeps } from './solver-plugins.js';
25
+ export interface EndorseOptions {
26
+ pluginCid: string;
27
+ score: number;
28
+ scoreDecimals: number;
29
+ tag1?: string;
30
+ tag2?: string;
31
+ configPath: string | undefined;
32
+ }
33
+ export interface WarnOptions {
34
+ pluginCid: string;
35
+ reason: string;
36
+ configPath: string | undefined;
37
+ }
38
+ export interface ReviewOptions {
39
+ pluginCid: string;
40
+ score: number;
41
+ scoreDecimals: number;
42
+ tag1?: string;
43
+ tag2?: string;
44
+ configPath: string | undefined;
45
+ }
46
+ export interface RespondOptions {
47
+ pluginCid: string;
48
+ feedbackIndex: bigint;
49
+ client: Address;
50
+ responseUri: string;
51
+ configPath: string | undefined;
52
+ }
53
+ export interface FeedbackPipelineCtx {
54
+ password: string;
55
+ config: ReturnType<SolverPluginsDeps['loadConfig']>;
56
+ builderAgentId: bigint;
57
+ safeAddress: Address;
58
+ reputationRegistryAddress: Address;
59
+ manifestRef: string;
60
+ manifestHash: Hex;
61
+ }
62
+ /**
63
+ * Shared prologue for every write verb (endorse / warn / review / respond /
64
+ * block): password → config → discovery row → Stage 1 ensure. Returns the
65
+ * materialised ids needed for the on-chain write, or null after writing an
66
+ * error envelope and calling ctx.exit.
67
+ */
68
+ export declare function preparePipeline(ctx: CommandContext, pluginCid: string, configPath: string | undefined, deps: SolverPluginsDeps): Promise<FeedbackPipelineCtx | null>;
69
+ export declare function warnHandler(ctx: CommandContext, opts: WarnOptions, deps: SolverPluginsDeps): Promise<void>;
70
+ export declare function endorseHandler(ctx: CommandContext, opts: EndorseOptions, deps: SolverPluginsDeps): Promise<void>;
71
+ export declare function reviewHandler(ctx: CommandContext, opts: ReviewOptions, deps: SolverPluginsDeps): Promise<void>;
72
+ export declare function respondHandler(ctx: CommandContext, opts: RespondOptions, deps: SolverPluginsDeps): Promise<void>;
@@ -0,0 +1,262 @@
1
+ /**
2
+ * `jinn solver-plugins {endorse, warn, review, respond}` — write verbs that
3
+ * route ERC-8004 `ReputationRegistry` feedback writes against the agentId of
4
+ * the builder who published the plug-in. The builder's agentId is resolved
5
+ * from `DiscoveryAPI.listPluginPublications`; the on-chain body anchors the
6
+ * feedback to a specific plug-in via `manifestRef = "plugin:<cid>"` and
7
+ * `manifestHash = keccak256(manifestRef)`.
8
+ *
9
+ * The pipeline mirrors `publishHandler`'s shape:
10
+ * 1. resolveCliPassword (env > keystore-password file > prompt-fd)
11
+ * 2. loadConfig
12
+ * 3. discoveryApiFactory(config).listPluginPublications → builderAgentId
13
+ * 4. bootstrapper.ensureStage1(password) — lazy Stage 1 ensure
14
+ * 5. reputationClientFactory(...).giveFeedback(...) / .respondToFeedback(...)
15
+ *
16
+ * Outputs a single-line JSON envelope: `{ verb, txHash, pluginCid,
17
+ * targetAgentId, ... }`. Error codes match the publish surface convention:
18
+ * `keystore_missing`, `config_load_failed`, `ensure_stage1_failed`,
19
+ * `fleet_identity_missing`, `agentid_unresolvable`, `self_feedback_not_allowed`,
20
+ * `discovery_unavailable`, `publish_failed`.
21
+ */
22
+ import { getAddress, keccak256, toBytes } from 'viem';
23
+ import { writeJson } from './solver-plugins.js';
24
+ import { getReputationRegistryAddress } from '../../erc8004/addresses.js';
25
+ import { DiscoveryUnavailableError } from '../../discovery/types.js';
26
+ /**
27
+ * Shared prologue for every write verb (endorse / warn / review / respond /
28
+ * block): password → config → discovery row → Stage 1 ensure. Returns the
29
+ * materialised ids needed for the on-chain write, or null after writing an
30
+ * error envelope and calling ctx.exit.
31
+ */
32
+ export async function preparePipeline(ctx, pluginCid, configPath, deps) {
33
+ const passwordResult = deps.resolveCliPassword(ctx.argv, ctx.env);
34
+ if (!passwordResult.ok) {
35
+ writeJson(ctx, {
36
+ error: {
37
+ code: 'keystore_missing',
38
+ message: 'Could not resolve password. Set JINN_PASSWORD, write ~/.jinn-client/keystore-password, or pass --password-fd.',
39
+ },
40
+ });
41
+ ctx.exit(1);
42
+ return null;
43
+ }
44
+ const password = passwordResult.password;
45
+ let config;
46
+ try {
47
+ config = deps.loadConfig(configPath);
48
+ }
49
+ catch (err) {
50
+ writeJson(ctx, {
51
+ error: { code: 'config_load_failed', message: err instanceof Error ? err.message : String(err) },
52
+ });
53
+ ctx.exit(1);
54
+ return null;
55
+ }
56
+ // Resolve builderAgentId via discovery first — cheaper to fail here than
57
+ // after Stage 1.
58
+ let builderAgentIdStr;
59
+ try {
60
+ const api = deps.discoveryApiFactory(config);
61
+ const rows = await api.listPluginPublications({});
62
+ const row = rows.find((r) => r.cid === pluginCid);
63
+ builderAgentIdStr = row?.builderAgentId;
64
+ }
65
+ catch (err) {
66
+ if (err instanceof DiscoveryUnavailableError) {
67
+ writeJson(ctx, {
68
+ error: {
69
+ code: 'discovery_unavailable',
70
+ message: `Indexer unavailable (mode=${config.discovery?.mode ?? 'onchain'}${config.discovery?.url ? `, url=${config.discovery.url}` : ''}): ${err.message}`,
71
+ },
72
+ });
73
+ ctx.exit(1);
74
+ return null;
75
+ }
76
+ throw err;
77
+ }
78
+ if (!builderAgentIdStr) {
79
+ writeJson(ctx, {
80
+ error: {
81
+ code: 'agentid_unresolvable',
82
+ message: `No plug-in publication record found for cid ${pluginCid} (discovery mode=${config.discovery?.mode ?? 'onchain'}).`,
83
+ details: { mode: config.discovery?.mode ?? 'onchain' },
84
+ },
85
+ });
86
+ ctx.exit(1);
87
+ return null;
88
+ }
89
+ const bootstrapper = deps.bootstrapperFactory(config);
90
+ const stage1 = await bootstrapper.ensureStage1(password);
91
+ if (!stage1.ok) {
92
+ writeJson(ctx, { error: { code: 'ensure_stage1_failed', message: stage1.message } });
93
+ ctx.exit(1);
94
+ return null;
95
+ }
96
+ const fleet = stage1.fleet_state;
97
+ if (!fleet.fleet_agent_id || !fleet.fleet_safe_address || !fleet.fleet_identity_registry) {
98
+ writeJson(ctx, {
99
+ error: {
100
+ code: 'fleet_identity_missing',
101
+ message: 'Stage 1 completed but fleet identity is empty.',
102
+ },
103
+ });
104
+ ctx.exit(1);
105
+ return null;
106
+ }
107
+ const chainId = config.network === 'testnet' ? 84532 : 8453;
108
+ const reputationRegistryAddress = getReputationRegistryAddress(chainId);
109
+ if (!reputationRegistryAddress) {
110
+ writeJson(ctx, {
111
+ error: {
112
+ code: 'config_load_failed',
113
+ message: `No ReputationRegistry address known for chainId ${chainId}.`,
114
+ },
115
+ });
116
+ ctx.exit(1);
117
+ return null;
118
+ }
119
+ const safeAddress = getAddress(fleet.fleet_safe_address);
120
+ const manifestRef = `plugin:${pluginCid}`;
121
+ const manifestHash = keccak256(toBytes(manifestRef));
122
+ return {
123
+ password,
124
+ config,
125
+ builderAgentId: BigInt(builderAgentIdStr),
126
+ safeAddress,
127
+ reputationRegistryAddress,
128
+ manifestRef,
129
+ manifestHash,
130
+ };
131
+ }
132
+ function emitWriteError(ctx, err) {
133
+ const msg = err instanceof Error ? err.message : String(err);
134
+ if (msg.includes('Self-feedback not allowed')) {
135
+ writeJson(ctx, {
136
+ error: {
137
+ code: 'self_feedback_not_allowed',
138
+ message: 'Reputation registry rejected feedback: caller is the agent owner. Use a different operator agent NFT, or skip endorsement for plug-ins you publish yourself.',
139
+ },
140
+ });
141
+ ctx.exit(1);
142
+ return;
143
+ }
144
+ writeJson(ctx, {
145
+ error: { code: 'publish_failed', message: msg },
146
+ });
147
+ ctx.exit(1);
148
+ }
149
+ // ── Verbs ────────────────────────────────────────────────────────────────────
150
+ /**
151
+ * Shared body for any verb that submits a single `giveFeedback` after the
152
+ * preparePipeline prologue. The caller supplies the verb name (for the
153
+ * envelope) plus the on-chain args; this function emits the success envelope
154
+ * or maps the thrown error to a typed envelope.
155
+ */
156
+ async function submitFeedbackAndEmit(ctx, prep, deps, verb, args, extraEnvelopeFields = {}) {
157
+ const client = deps.reputationClientFactory({
158
+ reputationRegistryAddress: prep.reputationRegistryAddress,
159
+ safeAddress: prep.safeAddress,
160
+ rpcUrl: prep.config.rpcUrl,
161
+ network: prep.config.network === 'testnet' ? 'base-sepolia' : 'base',
162
+ earningDir: prep.config.earningDir,
163
+ password: prep.password,
164
+ });
165
+ try {
166
+ const txHash = await client.giveFeedback({
167
+ harnessAgentId: prep.builderAgentId,
168
+ score: args.score,
169
+ scoreDecimals: args.scoreDecimals,
170
+ manifestRef: prep.manifestRef,
171
+ manifestHash: prep.manifestHash,
172
+ ...(args.tag1 ? { tag1: args.tag1 } : {}),
173
+ ...(args.tag2 ? { tag2: args.tag2 } : {}),
174
+ });
175
+ writeJson(ctx, {
176
+ verb,
177
+ txHash,
178
+ pluginCid: prep.manifestRef.slice('plugin:'.length),
179
+ targetAgentId: prep.builderAgentId.toString(),
180
+ score: args.score,
181
+ scoreDecimals: args.scoreDecimals,
182
+ reputationRegistry: prep.reputationRegistryAddress,
183
+ safeAddress: prep.safeAddress,
184
+ ...extraEnvelopeFields,
185
+ });
186
+ }
187
+ catch (err) {
188
+ emitWriteError(ctx, err);
189
+ }
190
+ }
191
+ export async function warnHandler(ctx, opts, deps) {
192
+ const prep = await preparePipeline(ctx, opts.pluginCid, opts.configPath, deps);
193
+ if (!prep)
194
+ return;
195
+ // The on-chain feedback layout exposes `tag1` (indexed; we use it as the
196
+ // verb's category — 'warning') and `tag2` (free-text). The design note
197
+ // referenced a "feedback URI" for the reason, but tag2 is the available
198
+ // free-text slot on giveFeedback — wire the reason there.
199
+ await submitFeedbackAndEmit(ctx, prep, deps, 'solver-plugins warn', { score: 50, scoreDecimals: 2, tag1: 'warning', tag2: opts.reason }, { reason: opts.reason });
200
+ }
201
+ export async function endorseHandler(ctx, opts, deps) {
202
+ const prep = await preparePipeline(ctx, opts.pluginCid, opts.configPath, deps);
203
+ if (!prep)
204
+ return;
205
+ await submitFeedbackAndEmit(ctx, prep, deps, 'solver-plugins endorse', {
206
+ score: opts.score,
207
+ scoreDecimals: opts.scoreDecimals,
208
+ ...(opts.tag1 ? { tag1: opts.tag1 } : {}),
209
+ ...(opts.tag2 ? { tag2: opts.tag2 } : {}),
210
+ });
211
+ }
212
+ export async function reviewHandler(ctx, opts, deps) {
213
+ const prep = await preparePipeline(ctx, opts.pluginCid, opts.configPath, deps);
214
+ if (!prep)
215
+ return;
216
+ await submitFeedbackAndEmit(ctx, prep, deps, 'solver-plugins review', {
217
+ score: opts.score,
218
+ scoreDecimals: opts.scoreDecimals,
219
+ ...(opts.tag1 ? { tag1: opts.tag1 } : {}),
220
+ ...(opts.tag2 ? { tag2: opts.tag2 } : {}),
221
+ });
222
+ }
223
+ export async function respondHandler(ctx, opts, deps) {
224
+ const prep = await preparePipeline(ctx, opts.pluginCid, opts.configPath, deps);
225
+ if (!prep)
226
+ return;
227
+ const client = deps.reputationClientFactory({
228
+ reputationRegistryAddress: prep.reputationRegistryAddress,
229
+ safeAddress: prep.safeAddress,
230
+ rpcUrl: prep.config.rpcUrl,
231
+ network: prep.config.network === 'testnet' ? 'base-sepolia' : 'base',
232
+ earningDir: prep.config.earningDir,
233
+ password: prep.password,
234
+ });
235
+ try {
236
+ const responseHash = keccak256(toBytes(opts.responseUri));
237
+ const txHash = await client.respondToFeedback({
238
+ feedbackId: {
239
+ agentId: prep.builderAgentId,
240
+ client: opts.client,
241
+ feedbackIndex: opts.feedbackIndex,
242
+ },
243
+ responseURI: opts.responseUri,
244
+ responseHash,
245
+ });
246
+ writeJson(ctx, {
247
+ verb: 'solver-plugins respond',
248
+ txHash,
249
+ pluginCid: opts.pluginCid,
250
+ targetAgentId: prep.builderAgentId.toString(),
251
+ feedbackIndex: opts.feedbackIndex.toString(),
252
+ client: opts.client,
253
+ responseURI: opts.responseUri,
254
+ reputationRegistry: prep.reputationRegistryAddress,
255
+ safeAddress: prep.safeAddress,
256
+ });
257
+ }
258
+ catch (err) {
259
+ emitWriteError(ctx, err);
260
+ }
261
+ }
262
+ //# sourceMappingURL=solver-plugins-feedback.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"solver-plugins-feedback.js","sourceRoot":"","sources":["../../../src/cli/commands/solver-plugins-feedback.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAA0B,MAAM,MAAM,CAAC;AAE9E,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,OAAO,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAgDrE;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,GAAmB,EACnB,SAAiB,EACjB,UAA8B,EAC9B,IAAuB;IAEvB,MAAM,cAAc,GAAG,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;IAClE,IAAI,CAAC,cAAc,CAAC,EAAE,EAAE,CAAC;QACvB,SAAS,CAAC,GAAG,EAAE;YACb,KAAK,EAAE;gBACL,IAAI,EAAE,kBAAkB;gBACxB,OAAO,EACL,+GAA+G;aAClH;SACF,CAAC,CAAC;QACH,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,QAAQ,GAAG,cAAc,CAAC,QAAQ,CAAC;IAEzC,IAAI,MAA0C,CAAC;IAC/C,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IACvC,CAAC;IAAC,OAAO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G,CAAC,CAAC;IAC3B,CAAC;AACH,CAAC"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * `jinn solver-plugins {list-feedback, discover, status}` — read verbs.
3
+ *
4
+ * None of the read verbs resolve the keystore password. They use the same
5
+ * `discoveryApiFactory` the daemon uses, plus a read-only
6
+ * `ReputationRegistryClient` (`password: undefined` → `walletClient`
7
+ * unbuilt → reads work, writes throw).
8
+ *
9
+ * Output envelopes mirror the write-verb convention (`verb` field +
10
+ * structured payload). Failure modes:
11
+ * - `agentid_unresolvable` (list-feedback only — `status` reports
12
+ * `{ status: 'not_published' }` instead, since "no record" is the
13
+ * answer to a status read).
14
+ * - `discovery_unavailable` (factory throws `DiscoveryUnavailableError`).
15
+ * - `config_load_failed`.
16
+ */
17
+ import type { Address } from 'viem';
18
+ import type { CommandContext } from '../command.js';
19
+ import type { SolverPluginsDeps } from './solver-plugins.js';
20
+ export interface StatusOptions {
21
+ pluginCid: string;
22
+ configPath: string | undefined;
23
+ }
24
+ export interface DiscoverOptions {
25
+ solverType: string | undefined;
26
+ builderAgentId: string | undefined;
27
+ includeRevoked: boolean | undefined;
28
+ limit: number | undefined;
29
+ configPath: string | undefined;
30
+ }
31
+ export interface ListFeedbackOptions {
32
+ pluginCid: string;
33
+ client: Address | undefined;
34
+ includeRevoked: boolean;
35
+ configPath: string | undefined;
36
+ }
37
+ /**
38
+ * `discover` lists published plug-in rows directly from the indexer. The
39
+ * `PluginPublication` row already carries name/version/supports/builderAgentId,
40
+ * so no IPFS payload dereference is required — `ipfsFetch` is held on
41
+ * SolverPluginsDeps for symmetry / future use but this handler does not
42
+ * consume it (a plan refinement vs. the design note's "missing IPFS config"
43
+ * failure mode; that mode does not apply because the discovery row is
44
+ * self-describing).
45
+ */
46
+ export declare function discoverHandler(ctx: CommandContext, opts: DiscoverOptions, deps: SolverPluginsDeps): Promise<void>;
47
+ /**
48
+ * `status` composes the publication row (or the absence of one) with the
49
+ * read-only `ReputationRegistry.getSummary` and the operator-local
50
+ * `solverPlugins.blockedCids` flag. A missing publication is a valid answer
51
+ * (`{ status: 'not_published' }`, exit 0), not an error.
52
+ */
53
+ export declare function statusHandler(ctx: CommandContext, opts: StatusOptions, deps: SolverPluginsDeps): Promise<void>;
54
+ export declare function listFeedbackHandler(ctx: CommandContext, opts: ListFeedbackOptions, deps: SolverPluginsDeps): Promise<void>;