@jinn-network/client 0.1.1 → 0.1.2-canary.647548b7

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 (353) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/CONTRIBUTING.md +123 -0
  3. package/README.md +213 -37
  4. package/deployments/deployment-claim-registry-baseSepolia.json +13 -0
  5. package/deployments/deployment-jinn-testnet-faucet-baseSepolia-fast.json +15 -0
  6. package/dist/adapters/claim-registry/abi.d.ts +127 -0
  7. package/dist/adapters/claim-registry/abi.js +93 -0
  8. package/dist/adapters/claim-registry/abi.js.map +1 -0
  9. package/dist/adapters/claim-registry/client.d.ts +89 -0
  10. package/dist/adapters/claim-registry/client.js +205 -0
  11. package/dist/adapters/claim-registry/client.js.map +1 -0
  12. package/dist/adapters/mech/adapter.d.ts +1 -0
  13. package/dist/adapters/mech/adapter.js +75 -41
  14. package/dist/adapters/mech/adapter.js.map +1 -1
  15. package/dist/adapters/mech/contracts.d.ts +2 -0
  16. package/dist/adapters/mech/contracts.js +57 -7
  17. package/dist/adapters/mech/contracts.js.map +1 -1
  18. package/dist/adapters/mech/ipfs.d.ts +8 -0
  19. package/dist/adapters/mech/ipfs.js +12 -0
  20. package/dist/adapters/mech/ipfs.js.map +1 -1
  21. package/dist/adapters/mech/types.d.ts +20 -46
  22. package/dist/adapters/mech/types.js +16 -35
  23. package/dist/adapters/mech/types.js.map +1 -1
  24. package/dist/api/balance-build.js +3 -3
  25. package/dist/api/balance-build.js.map +1 -1
  26. package/dist/api/fleet-build.js +35 -40
  27. package/dist/api/fleet-build.js.map +1 -1
  28. package/dist/api/gather-status.d.ts +1 -0
  29. package/dist/api/gather-status.js +185 -4
  30. package/dist/api/gather-status.js.map +1 -1
  31. package/dist/api/history-build.d.ts +5 -1
  32. package/dist/api/history-build.js +51 -26
  33. package/dist/api/history-build.js.map +1 -1
  34. package/dist/api/portfolio-v0-build.d.ts +81 -0
  35. package/dist/api/portfolio-v0-build.js +141 -0
  36. package/dist/api/portfolio-v0-build.js.map +1 -0
  37. package/dist/api/portfolio-v0-doctor.d.ts +37 -0
  38. package/dist/api/portfolio-v0-doctor.js +123 -0
  39. package/dist/api/portfolio-v0-doctor.js.map +1 -0
  40. package/dist/api/rewards-build.js +30 -14
  41. package/dist/api/rewards-build.js.map +1 -1
  42. package/dist/api/status-build.d.ts +37 -6
  43. package/dist/api/status-build.js +1 -0
  44. package/dist/api/status-build.js.map +1 -1
  45. package/dist/api/status-rollup-build.d.ts +2 -0
  46. package/dist/api/status-rollup-build.js +27 -0
  47. package/dist/api/status-rollup-build.js.map +1 -1
  48. package/dist/bin/jinn-mcp.d.ts +0 -12
  49. package/dist/bin/jinn-mcp.js +5 -14
  50. package/dist/bin/jinn-mcp.js.map +1 -1
  51. package/dist/build-meta.json +1 -1
  52. package/dist/cli/commands/auth.js +115 -25
  53. package/dist/cli/commands/auth.js.map +1 -1
  54. package/dist/cli/commands/balance.js +8 -1
  55. package/dist/cli/commands/balance.js.map +1 -1
  56. package/dist/cli/commands/bootstrap.js +1 -0
  57. package/dist/cli/commands/bootstrap.js.map +1 -1
  58. package/dist/cli/commands/doctor.js +130 -14
  59. package/dist/cli/commands/doctor.js.map +1 -1
  60. package/dist/cli/commands/fleet-scale.js +1 -0
  61. package/dist/cli/commands/fleet-scale.js.map +1 -1
  62. package/dist/cli/commands/fleet.js +10 -1
  63. package/dist/cli/commands/fleet.js.map +1 -1
  64. package/dist/cli/commands/fund-requirements.js +2 -0
  65. package/dist/cli/commands/fund-requirements.js.map +1 -1
  66. package/dist/cli/commands/history.js +25 -6
  67. package/dist/cli/commands/history.js.map +1 -1
  68. package/dist/cli/commands/intents.d.ts +17 -0
  69. package/dist/cli/commands/intents.js +489 -0
  70. package/dist/cli/commands/intents.js.map +1 -0
  71. package/dist/cli/commands/keys-backup.js +13 -11
  72. package/dist/cli/commands/keys-backup.js.map +1 -1
  73. package/dist/cli/commands/logs.js +35 -11
  74. package/dist/cli/commands/logs.js.map +1 -1
  75. package/dist/cli/commands/mcp.d.ts +3 -0
  76. package/dist/cli/commands/mcp.js +19 -0
  77. package/dist/cli/commands/mcp.js.map +1 -0
  78. package/dist/cli/commands/plugin-install.js +8 -4
  79. package/dist/cli/commands/plugin-install.js.map +1 -1
  80. package/dist/cli/commands/quickstart.js +60 -4
  81. package/dist/cli/commands/quickstart.js.map +1 -1
  82. package/dist/cli/commands/rewards.js +27 -1
  83. package/dist/cli/commands/rewards.js.map +1 -1
  84. package/dist/cli/commands/status.js +11 -1
  85. package/dist/cli/commands/status.js.map +1 -1
  86. package/dist/cli/commands/submit-intent.js +108 -5
  87. package/dist/cli/commands/submit-intent.js.map +1 -1
  88. package/dist/cli/commands/version.js +1 -0
  89. package/dist/cli/commands/version.js.map +1 -1
  90. package/dist/cli/deployment-digest.js +5 -0
  91. package/dist/cli/deployment-digest.js.map +1 -1
  92. package/dist/cli/execution-context.js +1 -0
  93. package/dist/cli/execution-context.js.map +1 -1
  94. package/dist/cli/index.js +4 -0
  95. package/dist/cli/index.js.map +1 -1
  96. package/dist/cli/intent-registry-access.d.ts +64 -0
  97. package/dist/cli/intent-registry-access.js +187 -0
  98. package/dist/cli/intent-registry-access.js.map +1 -0
  99. package/dist/cli/introspection-context.js +1 -0
  100. package/dist/cli/introspection-context.js.map +1 -1
  101. package/dist/cli/password.d.ts +21 -9
  102. package/dist/cli/password.js +45 -24
  103. package/dist/cli/password.js.map +1 -1
  104. package/dist/config.d.ts +110 -8
  105. package/dist/config.js +41 -12
  106. package/dist/config.js.map +1 -1
  107. package/dist/daemon/balance-topup-loop.js +32 -4
  108. package/dist/daemon/balance-topup-loop.js.map +1 -1
  109. package/dist/daemon/creator.d.ts +7 -1
  110. package/dist/daemon/creator.js +51 -3
  111. package/dist/daemon/creator.js.map +1 -1
  112. package/dist/daemon/daemon.d.ts +43 -0
  113. package/dist/daemon/daemon.js +110 -3
  114. package/dist/daemon/daemon.js.map +1 -1
  115. package/dist/daemon/delivery-watcher.d.ts +3 -1
  116. package/dist/daemon/delivery-watcher.js +19 -1
  117. package/dist/daemon/delivery-watcher.js.map +1 -1
  118. package/dist/daemon/restorer.js +27 -0
  119. package/dist/daemon/restorer.js.map +1 -1
  120. package/dist/daemon/reward-claim-loop.js +38 -1
  121. package/dist/daemon/reward-claim-loop.js.map +1 -1
  122. package/dist/dashboard/index.html +71 -496
  123. package/dist/earning/bootstrap.d.ts +2 -1
  124. package/dist/earning/bootstrap.js +72 -4
  125. package/dist/earning/bootstrap.js.map +1 -1
  126. package/dist/earning/contracts.d.ts +10 -0
  127. package/dist/earning/contracts.js +24 -0
  128. package/dist/earning/contracts.js.map +1 -1
  129. package/dist/earning/jinn-rewards.d.ts +9 -0
  130. package/dist/earning/jinn-rewards.js +7 -0
  131. package/dist/earning/jinn-rewards.js.map +1 -1
  132. package/dist/earning/stolas-claim.d.ts +6 -0
  133. package/dist/earning/stolas-claim.js +7 -0
  134. package/dist/earning/stolas-claim.js.map +1 -1
  135. package/dist/intents/prediction-apy-v0-auto.d.ts +11 -0
  136. package/dist/intents/prediction-apy-v0-auto.js +46 -0
  137. package/dist/intents/prediction-apy-v0-auto.js.map +1 -0
  138. package/dist/intents/prediction-apy-v0-template.d.ts +8 -0
  139. package/dist/intents/prediction-apy-v0-template.js +22 -0
  140. package/dist/intents/prediction-apy-v0-template.js.map +1 -0
  141. package/dist/intents/prediction-v0-auto.d.ts +53 -0
  142. package/dist/intents/prediction-v0-auto.js +84 -0
  143. package/dist/intents/prediction-v0-auto.js.map +1 -0
  144. package/dist/intents/prediction-v0-template.d.ts +65 -0
  145. package/dist/intents/prediction-v0-template.js +125 -0
  146. package/dist/intents/prediction-v0-template.js.map +1 -0
  147. package/dist/main.js +149 -1
  148. package/dist/main.js.map +1 -1
  149. package/dist/mcp/operator-server.d.ts +1 -1
  150. package/dist/mcp/operator-server.js +1 -1
  151. package/dist/observability/emit-event.d.ts +12 -0
  152. package/dist/observability/emit-event.js +27 -0
  153. package/dist/observability/emit-event.js.map +1 -0
  154. package/dist/preflight/claude-auth.d.ts +12 -1
  155. package/dist/preflight/claude-auth.js +21 -3
  156. package/dist/preflight/claude-auth.js.map +1 -1
  157. package/dist/restorer/engine/canonical-json.d.ts +18 -0
  158. package/dist/restorer/engine/canonical-json.js +59 -0
  159. package/dist/restorer/engine/canonical-json.js.map +1 -0
  160. package/dist/restorer/engine/claim.d.ts +69 -0
  161. package/dist/restorer/engine/claim.js +104 -0
  162. package/dist/restorer/engine/claim.js.map +1 -0
  163. package/dist/restorer/engine/delivery.d.ts +52 -0
  164. package/dist/restorer/engine/delivery.js +63 -0
  165. package/dist/restorer/engine/delivery.js.map +1 -0
  166. package/dist/restorer/engine/engine.d.ts +203 -0
  167. package/dist/restorer/engine/engine.js +753 -0
  168. package/dist/restorer/engine/engine.js.map +1 -0
  169. package/dist/restorer/engine/manifest-assembly.d.ts +67 -0
  170. package/dist/restorer/engine/manifest-assembly.js +79 -0
  171. package/dist/restorer/engine/manifest-assembly.js.map +1 -0
  172. package/dist/restorer/engine/packaging.d.ts +87 -0
  173. package/dist/restorer/engine/packaging.js +350 -0
  174. package/dist/restorer/engine/packaging.js.map +1 -0
  175. package/dist/restorer/engine/persistence.d.ts +170 -0
  176. package/dist/restorer/engine/persistence.js +381 -0
  177. package/dist/restorer/engine/persistence.js.map +1 -0
  178. package/dist/restorer/engine/recovery.d.ts +22 -0
  179. package/dist/restorer/engine/recovery.js +24 -0
  180. package/dist/restorer/engine/recovery.js.map +1 -0
  181. package/dist/restorer/engine/registry.d.ts +62 -0
  182. package/dist/restorer/engine/registry.js +73 -0
  183. package/dist/restorer/engine/registry.js.map +1 -0
  184. package/dist/restorer/engine/signing.d.ts +30 -0
  185. package/dist/restorer/engine/signing.js +39 -0
  186. package/dist/restorer/engine/signing.js.map +1 -0
  187. package/dist/restorer/engine/state.d.ts +42 -0
  188. package/dist/restorer/engine/state.js +87 -0
  189. package/dist/restorer/engine/state.js.map +1 -0
  190. package/dist/restorer/impls/claude-mcp-hyperliquid/api-wallet.d.ts +64 -0
  191. package/dist/restorer/impls/claude-mcp-hyperliquid/api-wallet.js +96 -0
  192. package/dist/restorer/impls/claude-mcp-hyperliquid/api-wallet.js.map +1 -0
  193. package/dist/restorer/impls/claude-mcp-hyperliquid/index.d.ts +101 -0
  194. package/dist/restorer/impls/claude-mcp-hyperliquid/index.js +710 -0
  195. package/dist/restorer/impls/claude-mcp-hyperliquid/index.js.map +1 -0
  196. package/dist/restorer/impls/claude-mcp-hyperliquid/mcp-tools.d.ts +137 -0
  197. package/dist/restorer/impls/claude-mcp-hyperliquid/mcp-tools.js +865 -0
  198. package/dist/restorer/impls/claude-mcp-hyperliquid/mcp-tools.js.map +1 -0
  199. package/dist/restorer/impls/claude-mcp-hyperliquid/safety-rails.d.ts +74 -0
  200. package/dist/restorer/impls/claude-mcp-hyperliquid/safety-rails.js +74 -0
  201. package/dist/restorer/impls/claude-mcp-hyperliquid/safety-rails.js.map +1 -0
  202. package/dist/restorer/impls/claude-mcp-hyperliquid/session-orchestrator.d.ts +97 -0
  203. package/dist/restorer/impls/claude-mcp-hyperliquid/session-orchestrator.js +226 -0
  204. package/dist/restorer/impls/claude-mcp-hyperliquid/session-orchestrator.js.map +1 -0
  205. package/dist/restorer/impls/claude-mcp-prediction/index.d.ts +43 -0
  206. package/dist/restorer/impls/claude-mcp-prediction/index.js +230 -0
  207. package/dist/restorer/impls/claude-mcp-prediction/index.js.map +1 -0
  208. package/dist/restorer/impls/claude-mcp-prediction/mcp-tools.d.ts +38 -0
  209. package/dist/restorer/impls/claude-mcp-prediction/mcp-tools.js +135 -0
  210. package/dist/restorer/impls/claude-mcp-prediction/mcp-tools.js.map +1 -0
  211. package/dist/restorer/impls/claude-mcp-prediction/prompt.d.ts +8 -0
  212. package/dist/restorer/impls/claude-mcp-prediction/prompt.js +54 -0
  213. package/dist/restorer/impls/claude-mcp-prediction/prompt.js.map +1 -0
  214. package/dist/restorer/impls/claude-mcp-prediction/session-orchestrator.d.ts +36 -0
  215. package/dist/restorer/impls/claude-mcp-prediction/session-orchestrator.js +137 -0
  216. package/dist/restorer/impls/claude-mcp-prediction/session-orchestrator.js.map +1 -0
  217. package/dist/restorer/impls/claude-mcp-prediction/types.d.ts +82 -0
  218. package/dist/restorer/impls/claude-mcp-prediction/types.js +6 -0
  219. package/dist/restorer/impls/claude-mcp-prediction/types.js.map +1 -0
  220. package/dist/restorer/impls/legacy-claude/index.d.ts +45 -0
  221. package/dist/restorer/impls/legacy-claude/index.js +71 -0
  222. package/dist/restorer/impls/legacy-claude/index.js.map +1 -0
  223. package/dist/restorer/impls/portfolio-v0-evaluator/canonical-metrics.d.ts +68 -0
  224. package/dist/restorer/impls/portfolio-v0-evaluator/canonical-metrics.js +117 -0
  225. package/dist/restorer/impls/portfolio-v0-evaluator/canonical-metrics.js.map +1 -0
  226. package/dist/restorer/impls/portfolio-v0-evaluator/checks/availability.d.ts +49 -0
  227. package/dist/restorer/impls/portfolio-v0-evaluator/checks/availability.js +91 -0
  228. package/dist/restorer/impls/portfolio-v0-evaluator/checks/availability.js.map +1 -0
  229. package/dist/restorer/impls/portfolio-v0-evaluator/checks/consistency.d.ts +78 -0
  230. package/dist/restorer/impls/portfolio-v0-evaluator/checks/consistency.js +274 -0
  231. package/dist/restorer/impls/portfolio-v0-evaluator/checks/consistency.js.map +1 -0
  232. package/dist/restorer/impls/portfolio-v0-evaluator/checks/eligibility.d.ts +23 -0
  233. package/dist/restorer/impls/portfolio-v0-evaluator/checks/eligibility.js +49 -0
  234. package/dist/restorer/impls/portfolio-v0-evaluator/checks/eligibility.js.map +1 -0
  235. package/dist/restorer/impls/portfolio-v0-evaluator/checks/integrity.d.ts +25 -0
  236. package/dist/restorer/impls/portfolio-v0-evaluator/checks/integrity.js +44 -0
  237. package/dist/restorer/impls/portfolio-v0-evaluator/checks/integrity.js.map +1 -0
  238. package/dist/restorer/impls/portfolio-v0-evaluator/checks/spec.d.ts +17 -0
  239. package/dist/restorer/impls/portfolio-v0-evaluator/checks/spec.js +43 -0
  240. package/dist/restorer/impls/portfolio-v0-evaluator/checks/spec.js.map +1 -0
  241. package/dist/restorer/impls/portfolio-v0-evaluator/index.d.ts +43 -0
  242. package/dist/restorer/impls/portfolio-v0-evaluator/index.js +431 -0
  243. package/dist/restorer/impls/portfolio-v0-evaluator/index.js.map +1 -0
  244. package/dist/restorer/impls/portfolio-v0-evaluator/score.d.ts +21 -0
  245. package/dist/restorer/impls/portfolio-v0-evaluator/score.js +32 -0
  246. package/dist/restorer/impls/portfolio-v0-evaluator/score.js.map +1 -0
  247. package/dist/restorer/impls/portfolio-v0-evaluator/types.d.ts +32 -0
  248. package/dist/restorer/impls/portfolio-v0-evaluator/types.js +8 -0
  249. package/dist/restorer/impls/portfolio-v0-evaluator/types.js.map +1 -0
  250. package/dist/restorer/impls/prediction-apy-v0-baseline/index.d.ts +39 -0
  251. package/dist/restorer/impls/prediction-apy-v0-baseline/index.js +98 -0
  252. package/dist/restorer/impls/prediction-apy-v0-baseline/index.js.map +1 -0
  253. package/dist/restorer/impls/prediction-apy-v0-baseline/strategy.d.ts +2 -0
  254. package/dist/restorer/impls/prediction-apy-v0-baseline/strategy.js +7 -0
  255. package/dist/restorer/impls/prediction-apy-v0-baseline/strategy.js.map +1 -0
  256. package/dist/restorer/impls/prediction-apy-v0-baseline/types.d.ts +4 -0
  257. package/dist/restorer/impls/prediction-apy-v0-baseline/types.js +2 -0
  258. package/dist/restorer/impls/prediction-apy-v0-baseline/types.js.map +1 -0
  259. package/dist/restorer/impls/prediction-apy-v0-evaluator/canonical-metrics.d.ts +2 -0
  260. package/dist/restorer/impls/prediction-apy-v0-evaluator/canonical-metrics.js +7 -0
  261. package/dist/restorer/impls/prediction-apy-v0-evaluator/canonical-metrics.js.map +1 -0
  262. package/dist/restorer/impls/prediction-apy-v0-evaluator/index.d.ts +39 -0
  263. package/dist/restorer/impls/prediction-apy-v0-evaluator/index.js +186 -0
  264. package/dist/restorer/impls/prediction-apy-v0-evaluator/index.js.map +1 -0
  265. package/dist/restorer/impls/prediction-apy-v0-evaluator/score.d.ts +9 -0
  266. package/dist/restorer/impls/prediction-apy-v0-evaluator/score.js +20 -0
  267. package/dist/restorer/impls/prediction-apy-v0-evaluator/score.js.map +1 -0
  268. package/dist/restorer/impls/prediction-apy-v0-evaluator/types.d.ts +7 -0
  269. package/dist/restorer/impls/prediction-apy-v0-evaluator/types.js +2 -0
  270. package/dist/restorer/impls/prediction-apy-v0-evaluator/types.js.map +1 -0
  271. package/dist/restorer/impls/prediction-v0-baseline/index.d.ts +29 -0
  272. package/dist/restorer/impls/prediction-v0-baseline/index.js +94 -0
  273. package/dist/restorer/impls/prediction-v0-baseline/index.js.map +1 -0
  274. package/dist/restorer/impls/prediction-v0-baseline/strategy.d.ts +8 -0
  275. package/dist/restorer/impls/prediction-v0-baseline/strategy.js +41 -0
  276. package/dist/restorer/impls/prediction-v0-baseline/strategy.js.map +1 -0
  277. package/dist/restorer/impls/prediction-v0-baseline/types.d.ts +7 -0
  278. package/dist/restorer/impls/prediction-v0-baseline/types.js +2 -0
  279. package/dist/restorer/impls/prediction-v0-baseline/types.js.map +1 -0
  280. package/dist/restorer/impls/prediction-v0-evaluator/canonical-metrics.d.ts +20 -0
  281. package/dist/restorer/impls/prediction-v0-evaluator/canonical-metrics.js +66 -0
  282. package/dist/restorer/impls/prediction-v0-evaluator/canonical-metrics.js.map +1 -0
  283. package/dist/restorer/impls/prediction-v0-evaluator/checks/availability.d.ts +9 -0
  284. package/dist/restorer/impls/prediction-v0-evaluator/checks/availability.js +23 -0
  285. package/dist/restorer/impls/prediction-v0-evaluator/checks/availability.js.map +1 -0
  286. package/dist/restorer/impls/prediction-v0-evaluator/checks/eligibility.d.ts +3 -0
  287. package/dist/restorer/impls/prediction-v0-evaluator/checks/eligibility.js +13 -0
  288. package/dist/restorer/impls/prediction-v0-evaluator/checks/eligibility.js.map +1 -0
  289. package/dist/restorer/impls/prediction-v0-evaluator/checks/integrity.d.ts +7 -0
  290. package/dist/restorer/impls/prediction-v0-evaluator/checks/integrity.js +93 -0
  291. package/dist/restorer/impls/prediction-v0-evaluator/checks/integrity.js.map +1 -0
  292. package/dist/restorer/impls/prediction-v0-evaluator/checks/spec.d.ts +5 -0
  293. package/dist/restorer/impls/prediction-v0-evaluator/checks/spec.js +20 -0
  294. package/dist/restorer/impls/prediction-v0-evaluator/checks/spec.js.map +1 -0
  295. package/dist/restorer/impls/prediction-v0-evaluator/index.d.ts +33 -0
  296. package/dist/restorer/impls/prediction-v0-evaluator/index.js +208 -0
  297. package/dist/restorer/impls/prediction-v0-evaluator/index.js.map +1 -0
  298. package/dist/restorer/impls/prediction-v0-evaluator/score.d.ts +8 -0
  299. package/dist/restorer/impls/prediction-v0-evaluator/score.js +15 -0
  300. package/dist/restorer/impls/prediction-v0-evaluator/score.js.map +1 -0
  301. package/dist/restorer/impls/prediction-v0-evaluator/types.d.ts +7 -0
  302. package/dist/restorer/impls/prediction-v0-evaluator/types.js +2 -0
  303. package/dist/restorer/impls/prediction-v0-evaluator/types.js.map +1 -0
  304. package/dist/restorer/types.d.ts +177 -0
  305. package/dist/restorer/types.js +7 -0
  306. package/dist/restorer/types.js.map +1 -0
  307. package/dist/store/store.d.ts +64 -1
  308. package/dist/store/store.js +226 -4
  309. package/dist/store/store.js.map +1 -1
  310. package/dist/types/desired-state.d.ts +53 -0
  311. package/dist/types/desired-state.js +20 -0
  312. package/dist/types/desired-state.js.map +1 -1
  313. package/dist/types/index.d.ts +4 -1
  314. package/dist/types/index.js +4 -1
  315. package/dist/types/index.js.map +1 -1
  316. package/dist/types/portfolio.d.ts +1000 -0
  317. package/dist/types/portfolio.js +168 -0
  318. package/dist/types/portfolio.js.map +1 -0
  319. package/dist/types/prediction-apy.d.ts +919 -0
  320. package/dist/types/prediction-apy.js +121 -0
  321. package/dist/types/prediction-apy.js.map +1 -0
  322. package/dist/types/prediction.d.ts +925 -0
  323. package/dist/types/prediction.js +140 -0
  324. package/dist/types/prediction.js.map +1 -0
  325. package/dist/venues/aave-v3/addresses.d.ts +6 -0
  326. package/dist/venues/aave-v3/addresses.js +19 -0
  327. package/dist/venues/aave-v3/addresses.js.map +1 -0
  328. package/dist/venues/aave-v3/client.d.ts +81 -0
  329. package/dist/venues/aave-v3/client.js +97 -0
  330. package/dist/venues/aave-v3/client.js.map +1 -0
  331. package/dist/venues/chainlink/client.d.ts +99 -0
  332. package/dist/venues/chainlink/client.js +130 -0
  333. package/dist/venues/chainlink/client.js.map +1 -0
  334. package/dist/venues/chainlink/feeds.d.ts +8 -0
  335. package/dist/venues/chainlink/feeds.js +9 -0
  336. package/dist/venues/chainlink/feeds.js.map +1 -0
  337. package/dist/venues/hyperliquid/account-value.d.ts +30 -0
  338. package/dist/venues/hyperliquid/account-value.js +30 -0
  339. package/dist/venues/hyperliquid/account-value.js.map +1 -0
  340. package/dist/venues/hyperliquid/client.d.ts +63 -0
  341. package/dist/venues/hyperliquid/client.js +135 -0
  342. package/dist/venues/hyperliquid/client.js.map +1 -0
  343. package/dist/venues/hyperliquid/grid.d.ts +36 -0
  344. package/dist/venues/hyperliquid/grid.js +61 -0
  345. package/dist/venues/hyperliquid/grid.js.map +1 -0
  346. package/dist/venues/hyperliquid/types.d.ts +81 -0
  347. package/dist/venues/hyperliquid/types.js +8 -0
  348. package/dist/venues/hyperliquid/types.js.map +1 -0
  349. package/dist/withdraw/run-withdraw-plan.js +2 -0
  350. package/dist/withdraw/run-withdraw-plan.js.map +1 -1
  351. package/docker-compose.yml +44 -0
  352. package/package.json +12 -1
  353. package/skills/jinn-operator/SKILL.md +85 -0
@@ -0,0 +1,187 @@
1
+ /**
2
+ * Shared helpers for the `jinn intents` CLI surface.
3
+ *
4
+ * - Builds a RestorerImplRegistry populated with the same impls the daemon
5
+ * registers at boot (minus the ones that need live dependencies like a
6
+ * running master wallet). The generic `intents list/status/enable/disable`
7
+ * verbs use this to dispatch to per-impl onEnable / isReady logic without
8
+ * standing up the full daemon.
9
+ *
10
+ * - Reads/writes the `restorers.disabled[]` list in the operator's config
11
+ * file so `enable` / `disable` can flip per-impl participation.
12
+ */
13
+ import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'node:fs';
14
+ import { dirname, join } from 'node:path';
15
+ import { homedir } from 'node:os';
16
+ import { RestorerImplRegistry } from '../restorer/engine/registry.js';
17
+ import { PredictionV0BaselineImpl } from '../restorer/impls/prediction-v0-baseline/index.js';
18
+ import { PredictionV0Evaluator } from '../restorer/impls/prediction-v0-evaluator/index.js';
19
+ import { PredictionApyV0BaselineImpl } from '../restorer/impls/prediction-apy-v0-baseline/index.js';
20
+ import { PredictionApyV0Evaluator } from '../restorer/impls/prediction-apy-v0-evaluator/index.js';
21
+ import { ClaudeMcpHyperliquidImpl } from '../restorer/impls/claude-mcp-hyperliquid/index.js';
22
+ import { ClaudeMcpPredictionImpl } from '../restorer/impls/claude-mcp-prediction/index.js';
23
+ import { PortfolioV0Evaluator } from '../restorer/impls/portfolio-v0-evaluator/index.js';
24
+ /**
25
+ * Impls that ship default-disabled because they require external dependencies
26
+ * (credentials, exchange approvals, etc.) the operator must opt into. Kept in
27
+ * one place so `main.ts` and the `intents` CLI share a single source of truth.
28
+ */
29
+ export const DEFAULT_DISABLED_IMPLS = ['claude-mcp-hyperliquid'];
30
+ export const DEFAULT_BY_KIND = {
31
+ 'portfolio.v0': 'claude-mcp-hyperliquid',
32
+ 'prediction.v0': 'prediction-v0-baseline',
33
+ 'prediction.apy.v0': 'prediction-apy-v0-baseline',
34
+ };
35
+ const DEFAULT_CONFIG_PATH = join(homedir(), '.jinn-client', 'config.json');
36
+ export function resolveConfigPath(explicit) {
37
+ return explicit ?? DEFAULT_CONFIG_PATH;
38
+ }
39
+ /**
40
+ * Construct the same impl registry main.ts uses, populated with the subset
41
+ * of impls that can answer `isReady` / `onEnable` without live chain/runner
42
+ * dependencies. Evaluators and the legacy-claude impl are omitted because
43
+ * they don't expose enable-level UX (legacy-claude is always-on; evaluators
44
+ * dispatch by type='evaluation' rather than by kind).
45
+ */
46
+ export function buildIntentsCliRegistry(config) {
47
+ const registry = new RestorerImplRegistry({
48
+ byKind: resolveEffectiveByKind(config),
49
+ default: 'legacy-claude',
50
+ disabled: resolveEffectiveDisabled(config),
51
+ });
52
+ registry.register(new PredictionV0BaselineImpl({ rpcUrl: config.rpcUrl }));
53
+ registry.register(new PredictionV0Evaluator({
54
+ evaluatorPk: '0x' + '00'.repeat(32),
55
+ evaluatorSafeAddress: '0x0000000000000000000000000000000000000000',
56
+ rpcUrl: config.rpcUrl,
57
+ }));
58
+ registry.register(new PredictionApyV0BaselineImpl({
59
+ rpcUrl: config.rpcUrl,
60
+ archiveRpcUrl: config.archiveRpcUrl,
61
+ }));
62
+ registry.register(new PredictionApyV0Evaluator({
63
+ evaluatorPk: '0x' + '00'.repeat(32),
64
+ evaluatorSafeAddress: '0x0000000000000000000000000000000000000000',
65
+ rpcUrl: config.rpcUrl,
66
+ archiveRpcUrl: config.archiveRpcUrl,
67
+ }));
68
+ registry.register(new ClaudeMcpHyperliquidImpl({
69
+ claudePath: config.claudePath,
70
+ claudeModel: config.claudeModel,
71
+ }));
72
+ registry.register(new ClaudeMcpPredictionImpl({
73
+ claudePath: config.claudePath,
74
+ claudeModel: config.claudeModel,
75
+ rpcUrl: config.rpcUrl,
76
+ }));
77
+ registry.register(new PortfolioV0Evaluator());
78
+ return registry;
79
+ }
80
+ /**
81
+ * Resolve the effective disabled list, applying the ship-default plus any
82
+ * operator overrides. Semantics match main.ts: user config fully replaces
83
+ * the default, so operators who have already curated a list aren't
84
+ * surprised by new defaults sneaking in.
85
+ */
86
+ export function resolveEffectiveDisabled(config) {
87
+ const userDisabled = config.restorers?.disabled;
88
+ if (userDisabled !== undefined)
89
+ return [...userDisabled];
90
+ return [...DEFAULT_DISABLED_IMPLS];
91
+ }
92
+ /** Resolve effective kind → impl mapping, applying operator overrides over ship defaults. */
93
+ export function resolveEffectiveByKind(config) {
94
+ return {
95
+ ...DEFAULT_BY_KIND,
96
+ ...(config.restorers?.byKind ?? {}),
97
+ };
98
+ }
99
+ /** Is an impl currently disabled in the effective config? */
100
+ export function isImplDisabled(implName, config) {
101
+ return resolveEffectiveDisabled(config).includes(implName);
102
+ }
103
+ /**
104
+ * Patch the user's config file to add/remove an impl from the `restorers.disabled[]`
105
+ * list.
106
+ *
107
+ * Semantics (important): since user config fully replaces the default list,
108
+ * we always rebuild `disabled` from `DEFAULT_DISABLED_IMPLS ∪ user additions`
109
+ * minus the currently-enabled impl, not from whatever list the user last
110
+ * wrote. Concretely: if we later add a new default-disabled impl, an operator
111
+ * who previously enabled X won't silently auto-enable the new one — their
112
+ * written list always reflects "every current default off, minus what I've
113
+ * explicitly enabled." Extra operator-added disables are preserved verbatim.
114
+ *
115
+ * Returns the new disabled list for the caller to surface.
116
+ */
117
+ export function setImplEnabledInConfig(implName, enabled, configPath = DEFAULT_CONFIG_PATH) {
118
+ let current = {};
119
+ if (existsSync(configPath)) {
120
+ try {
121
+ current = JSON.parse(readFileSync(configPath, 'utf-8'));
122
+ }
123
+ catch {
124
+ current = {};
125
+ }
126
+ }
127
+ const restorers = (current['restorers'] ?? {});
128
+ const existing = new Set(restorers.disabled ?? []);
129
+ // Operator-added extras: anything they've explicitly disabled that isn't a ship default.
130
+ const defaults = new Set(DEFAULT_DISABLED_IMPLS);
131
+ const operatorExtras = new Set([...existing].filter((n) => !defaults.has(n)));
132
+ // Rebuild from first principles so future default additions stay disabled
133
+ // unless the operator explicitly enables them too.
134
+ const rebuilt = new Set([...defaults, ...operatorExtras]);
135
+ if (enabled) {
136
+ rebuilt.delete(implName);
137
+ }
138
+ else {
139
+ rebuilt.add(implName);
140
+ }
141
+ const next = [...rebuilt];
142
+ restorers.disabled = next;
143
+ current['restorers'] = restorers;
144
+ mkdirSync(dirname(configPath), { recursive: true });
145
+ writeFileSync(configPath, JSON.stringify(current, null, 2) + '\n', { encoding: 'utf-8' });
146
+ return next;
147
+ }
148
+ /** Persist an explicit impl mapping for a specific intent kind. */
149
+ export function setImplForKindInConfig(kind, implName, configPath = DEFAULT_CONFIG_PATH) {
150
+ let current = {};
151
+ if (existsSync(configPath)) {
152
+ try {
153
+ current = JSON.parse(readFileSync(configPath, 'utf-8'));
154
+ }
155
+ catch {
156
+ current = {};
157
+ }
158
+ }
159
+ const restorers = (current['restorers'] ?? {});
160
+ restorers.byKind = {
161
+ ...(restorers.byKind ?? {}),
162
+ [kind]: implName,
163
+ };
164
+ current['restorers'] = restorers;
165
+ mkdirSync(dirname(configPath), { recursive: true });
166
+ writeFileSync(configPath, JSON.stringify(current, null, 2) + '\n', { encoding: 'utf-8' });
167
+ }
168
+ /** Remove an explicit impl mapping for one kind, reverting to ship default. */
169
+ export function resetImplForKindInConfig(kind, configPath = DEFAULT_CONFIG_PATH) {
170
+ let current = {};
171
+ if (existsSync(configPath)) {
172
+ try {
173
+ current = JSON.parse(readFileSync(configPath, 'utf-8'));
174
+ }
175
+ catch {
176
+ current = {};
177
+ }
178
+ }
179
+ const restorers = (current['restorers'] ?? {});
180
+ const byKind = { ...(restorers.byKind ?? {}) };
181
+ delete byKind[kind];
182
+ restorers.byKind = byKind;
183
+ current['restorers'] = restorers;
184
+ mkdirSync(dirname(configPath), { recursive: true });
185
+ writeFileSync(configPath, JSON.stringify(current, null, 2) + '\n', { encoding: 'utf-8' });
186
+ }
187
+ //# sourceMappingURL=intent-registry-access.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intent-registry-access.js","sourceRoot":"","sources":["../../src/cli/intent-registry-access.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,wBA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AI,EAAE,CAAC,CAAC;IACpD,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;AAC5F,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,wBAAwB,CACtC,IAAY,EACZ,aAAqB,mBAAmB;IAExC,IAAI,OAAO,GAA4B,EAAE,CAAC;IAC1C,IAAI,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC3B,IAAI,CAAC;YACH,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAA4B,CAAC;QACrF,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,GAAG,EAAE,CAAC;QACf,CAAC;IACH,CAAC;IAED,MAAM,SAAS,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,EAAE,CAAmB,CAAC;IACjE,MAAM,MAAM,GAAG,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,IAAI,EAAE,CAAC,EAAE,CAAC;IAC/C,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;IACpB,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC;IAC1B,OAAO,CAAC,WAAW,CAAC,GAAG,SAAS,CAAC;IAEjC,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACpD,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;AAC5F,CAAC"}
@@ -53,6 +53,7 @@ export async function gatherIntrospectionRaw(opts) {
53
53
  testnetL2TokenDeploymentPath: config.testnetL2TokenDeploymentPath,
54
54
  testnetMechDeploymentPath: config.testnetMechDeploymentPath,
55
55
  testnetStolasDeploymentPath: config.testnetStolasDeploymentPath,
56
+ testnetClaimRegistryDeploymentPath: config.testnetClaimRegistryDeploymentPath,
56
57
  };
57
58
  const local = await gatherGatheredStatusRaw(store, status);
58
59
  return tryMergeStatusFromHttp(config, local);
@@ -1 +1 @@
1
- {"version":3,"file":"introspection-context.js","sourceRoot":"","sources":["../../src/cli/introspection-context.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,uBAAuB,EAA2B,MAAM,yBAAyB,CAAC;AAC3F,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C,KAAK,UAAU,sBAAsB,CACnC,MAAqC,EACrC,KAAwB;IAExB,MAAM,GAAG,GAAG,oBAAoB,MAAM,CAAC,OAAO,YAAY,CAAC;IAC3D,MAAM,EAAE,GAAG,IAAI,eAAe,EAAE,CAAC;IACjC,MAAM,CAAC,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE,GAAG,CAAC,CAAC;IAC5C,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC;QACpD,IAAI,CAAC,GAAG,CAAC,EAAE;YAAE,OAAO,KAAK,CAAC;QAC1B,MAAM,MAAM,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAqB,CAAC;QACtD,IAAI,MAAM,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;YACpC,OAAO;gBACL,GAAG,KAAK;gBACR,GAAG,EAAE;oBACH,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE;oBACjB,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,OAAO;oBAC3B,WAAW,EAA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,CAAC,2BAA2B;QAC/D,kCAAkC,EAAE,MAAM,CAAC,kCAAkC;KAC9E,CAAC;IACF,MAAM,KAAK,GAAG,MAAM,uBAAuB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC3D,OAAO,sBAAsB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAC/C,CAAC"}
@@ -1,5 +1,25 @@
1
1
  /**
2
- * CLI password resolution: JINN_PASSWORD env or --password-fd N (reads once, trims).
2
+ * CLI password resolution.
3
+ *
4
+ * Priority order for `resolveCliPassword`:
5
+ * 1. `--password-fd N` (explicit, scripted/CI use)
6
+ * 2. `JINN_PASSWORD` env var (explicit, operator-set)
7
+ * 3. `~/.jinn-client/keystore-password` file (auto-generated by `jinn quickstart`)
8
+ * 4. Error
9
+ *
10
+ * SECURITY TRADE-OFF (known, accepted for Phase 1b testers):
11
+ * When `jinn quickstart` auto-generates a password, it writes the plaintext
12
+ * value to `~/.jinn-client/keystore-password` (mode 0o600) and the encrypted
13
+ * keystore to `~/.jinn-client/earning/master_keystore.json`. An attacker with
14
+ * shell access to the host can read both and decrypt the mnemonic — the
15
+ * encryption provides defense only against casual filesystem snooping,
16
+ * snapshot/backup inclusion policies, and logs. It is NOT protection against
17
+ * a local attacker.
18
+ *
19
+ * The quickstart summary warns operators to treat this wallet as hot and to
20
+ * keep funds to the gas + rewards minimum. The real fix is OS-native secret
21
+ * storage (macOS Keychain, libsecret, Windows Credential Manager) or a
22
+ * hardware-backed signer; tracked as future work.
3
23
  */
4
24
  export declare function parsePasswordFdFromArgv(argv: string[]): number | undefined;
5
25
  export declare function readPasswordFromFd(fd: number): string;
@@ -10,14 +30,6 @@ export declare function resolveCliPassword(argv?: string[], env?: NodeJS.Process
10
30
  ok: false;
11
31
  message: string;
12
32
  };
13
- export declare function resolveCurrentPassword(argv: string[], env: Record<string, string | undefined>): {
14
- ok: true;
15
- password: string;
16
- fromFile: boolean;
17
- } | {
18
- ok: false;
19
- message: string;
20
- };
21
33
  export declare function resolveNewPassword(env: Record<string, string | undefined>): {
22
34
  ok: true;
23
35
  password: string;
@@ -1,5 +1,25 @@
1
1
  /**
2
- * CLI password resolution: JINN_PASSWORD env or --password-fd N (reads once, trims).
2
+ * CLI password resolution.
3
+ *
4
+ * Priority order for `resolveCliPassword`:
5
+ * 1. `--password-fd N` (explicit, scripted/CI use)
6
+ * 2. `JINN_PASSWORD` env var (explicit, operator-set)
7
+ * 3. `~/.jinn-client/keystore-password` file (auto-generated by `jinn quickstart`)
8
+ * 4. Error
9
+ *
10
+ * SECURITY TRADE-OFF (known, accepted for Phase 1b testers):
11
+ * When `jinn quickstart` auto-generates a password, it writes the plaintext
12
+ * value to `~/.jinn-client/keystore-password` (mode 0o600) and the encrypted
13
+ * keystore to `~/.jinn-client/earning/master_keystore.json`. An attacker with
14
+ * shell access to the host can read both and decrypt the mnemonic — the
15
+ * encryption provides defense only against casual filesystem snooping,
16
+ * snapshot/backup inclusion policies, and logs. It is NOT protection against
17
+ * a local attacker.
18
+ *
19
+ * The quickstart summary warns operators to treat this wallet as hot and to
20
+ * keep funds to the gas + rewards minimum. The real fix is OS-native secret
21
+ * storage (macOS Keychain, libsecret, Windows Credential Manager) or a
22
+ * hardware-backed signer; tracked as future work.
3
23
  */
4
24
  import { existsSync, readFileSync } from 'node:fs';
5
25
  import { homedir } from 'node:os';
@@ -23,7 +43,19 @@ function mergeArgv(argv) {
23
43
  const fromProcess = typeof process !== 'undefined' ? process.argv.slice(2) : [];
24
44
  return [...fromVerb, ...fromProcess];
25
45
  }
46
+ function passwordFilePath(env) {
47
+ const home = env['HOME'] ?? homedir();
48
+ return join(home, '.jinn-client', 'keystore-password');
49
+ }
50
+ function readPasswordFile(env) {
51
+ const path = passwordFilePath(env);
52
+ if (!existsSync(path))
53
+ return undefined;
54
+ const value = readFileSync(path, 'utf-8').trim();
55
+ return value.length > 0 ? value : undefined;
56
+ }
26
57
  export function resolveCliPassword(argv, env = process.env) {
58
+ // 1. --password-fd wins (explicit scripted intent).
27
59
  const merged = mergeArgv(argv);
28
60
  const fd = parsePasswordFdFromArgv(merged);
29
61
  if (fd !== undefined) {
@@ -41,29 +73,18 @@ export function resolveCliPassword(argv, env = process.env) {
41
73
  };
42
74
  }
43
75
  }
44
- const p = env['JINN_PASSWORD'];
45
- if (!p) {
46
- return {
47
- ok: false,
48
- message: 'Set JINN_PASSWORD or pass --password-fd N with a readable file descriptor.',
49
- };
50
- }
51
- return { ok: true, password: p };
52
- }
53
- export function resolveCurrentPassword(argv, env) {
54
- // 1. Check keystore-password file
55
- const home = env['HOME'] ?? homedir();
56
- const passwordFilePath = join(home, '.jinn-client', 'keystore-password');
57
- if (existsSync(passwordFilePath)) {
58
- const password = readFileSync(passwordFilePath, 'utf-8').trim();
59
- if (password)
60
- return { ok: true, password, fromFile: true };
61
- }
62
- // 2. Fall through to existing resolveCliPassword
63
- const result = resolveCliPassword(argv, env);
64
- if (result.ok)
65
- return { ok: true, password: result.password, fromFile: false };
66
- return { ok: false, message: result.message };
76
+ // 2. JINN_PASSWORD env (explicit operator-set).
77
+ const envPassword = env['JINN_PASSWORD'];
78
+ if (envPassword)
79
+ return { ok: true, password: envPassword };
80
+ // 3. Auto-generated password file from `jinn quickstart`.
81
+ const filePassword = readPasswordFile(env);
82
+ if (filePassword)
83
+ return { ok: true, password: filePassword };
84
+ return {
85
+ ok: false,
86
+ message: 'No keystore password found. Set JINN_PASSWORD, pass --password-fd N, or run `jinn quickstart` to auto-generate one.',
87
+ };
67
88
  }
68
89
  export function resolveNewPassword(env) {
69
90
  const newPass = env['JINN_NEW_PASSWORD'];
@@ -1 +1 @@
1
- {"version":3,"file":"password.js","sourceRoot":"","sources":["../../src/cli/password.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CA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L,qHAAqH;KACxH,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,kBAAkB,CAChC,GAAuC;IAEvC,MAAM,OAAO,GAAG,GAAG,CAAC,mBAAmB,CAAC,CAAC;IACzC,IAAI,OAAO,IAAI,OAAO,CAAC,MAAM,IAAI,CAAC;QAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;IAC3E,IAAI,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;QAC/B,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,6CAA6C,EAAE,CAAC;IAC/E,OAAO;QACL,EAAE,EAAE,KAAK;QACT,OAAO,EAAE,uFAAuF;KACjG,CAAC;AACJ,CAAC"}
package/dist/config.d.ts CHANGED
@@ -14,6 +14,7 @@
14
14
  * (mainnet V1, testnet V2) for JinnRouter claimDelivery encoding.
15
15
  */
16
16
  import { z } from 'zod';
17
+ import type { DesiredState } from './types/desired-state.js';
17
18
  export declare const JinnConfigSchema: z.ZodObject<{
18
19
  /**
19
20
  * Network to connect to.
@@ -29,6 +30,7 @@ export declare const JinnConfigSchema: z.ZodObject<{
29
30
  * https://sepolia.base.org for 'testnet'. Set explicitly to override.
30
31
  */
31
32
  rpcUrl: z.ZodOptional<z.ZodString>;
33
+ archiveRpcUrl: z.ZodOptional<z.ZodString>;
32
34
  /** Earning state directory */
33
35
  earningDir: z.ZodDefault<z.ZodString>;
34
36
  /** SQLite database path */
@@ -54,25 +56,68 @@ export declare const JinnConfigSchema: z.ZodObject<{
54
56
  claudePath: z.ZodDefault<z.ZodString>;
55
57
  /** Model for restoration/evaluation agent */
56
58
  claudeModel: z.ZodDefault<z.ZodString>;
59
+ /**
60
+ * How the operator runs the daemon. Set once at `jinn auth`, read by every
61
+ * command that probes the Claude CLI or spawns a subprocess. Leaving it
62
+ * unset falls back to filesystem-based detection (docker-compose.yml near
63
+ * cwd, /.dockerenv, etc.) which is error-prone inside a checkout of the
64
+ * repo itself.
65
+ * Env override: JINN_RUNTIME_MODE.
66
+ */
67
+ runtimeMode: z.ZodOptional<z.ZodEnum<["bare", "docker-compose", "container"]>>;
57
68
  /** Comma-separated or array of peer URLs */
58
69
  peers: z.ZodDefault<z.ZodUnion<[z.ZodEffects<z.ZodString, string[], string>, z.ZodArray<z.ZodString, "many">]>>;
59
70
  /** The Graph subgraph URL for artifact discovery */
60
71
  subgraphUrl: z.ZodOptional<z.ZodString>;
61
72
  /** This node's public HTTP endpoint (for 8004 registration) */
62
73
  nodeEndpoint: z.ZodOptional<z.ZodString>;
63
- /** Desired states to create and restore */
74
+ /** Desired states to create and restore. Empty by default; testnet auto-intents fill the loop. */
64
75
  desiredStates: z.ZodDefault<z.ZodArray<z.ZodObject<{
65
- id: z.ZodString;
76
+ id: z.ZodOptional<z.ZodString>;
66
77
  description: z.ZodString;
67
78
  context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
79
+ window: z.ZodOptional<z.ZodObject<{
80
+ startTs: z.ZodNumber;
81
+ endTs: z.ZodNumber;
82
+ }, "strip", z.ZodTypeAny, {
83
+ startTs: number;
84
+ endTs: number;
85
+ }, {
86
+ startTs: number;
87
+ endTs: number;
88
+ }>>;
89
+ spec: z.ZodOptional<z.ZodIntersection<z.ZodObject<{
90
+ kind: z.ZodString;
91
+ }, "strip", z.ZodTypeAny, {
92
+ kind: string;
93
+ }, {
94
+ kind: string;
95
+ }>, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
96
+ eligibility: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
68
97
  }, "strip", z.ZodTypeAny, {
69
- id: string;
70
98
  description: string;
99
+ id?: string | undefined;
71
100
  context?: Record<string, unknown> | undefined;
101
+ window?: {
102
+ startTs: number;
103
+ endTs: number;
104
+ } | undefined;
105
+ spec?: ({
106
+ kind: string;
107
+ } & Record<string, unknown>) | undefined;
108
+ eligibility?: Record<string, unknown> | undefined;
72
109
  }, {
73
- id: string;
74
110
  description: string;
111
+ id?: string | undefined;
75
112
  context?: Record<string, unknown> | undefined;
113
+ window?: {
114
+ startTs: number;
115
+ endTs: number;
116
+ } | undefined;
117
+ spec?: ({
118
+ kind: string;
119
+ } & Record<string, unknown>) | undefined;
120
+ eligibility?: Record<string, unknown> | undefined;
76
121
  }>, "many">>;
77
122
  /** IPFS upload endpoint */
78
123
  ipfsRegistryUrl: z.ZodDefault<z.ZodString>;
@@ -86,6 +131,8 @@ export declare const JinnConfigSchema: z.ZodObject<{
86
131
  testnetMechDeploymentPath: z.ZodOptional<z.ZodString>;
87
132
  /** Optional Base Sepolia stOLAS deployment artifact path */
88
133
  testnetStolasDeploymentPath: z.ZodOptional<z.ZodString>;
134
+ /** Optional Base Sepolia ClaimRegistry deployment artifact path */
135
+ testnetClaimRegistryDeploymentPath: z.ZodOptional<z.ZodString>;
89
136
  /** Staking mode: 'standard' uses stOLAS (no OLAS needed), 'self-bond' uses operator-provided OLAS. */
90
137
  stakingMode: z.ZodDefault<z.ZodEnum<["standard", "self-bond"]>>;
91
138
  /** Number of services to bootstrap and run. */
@@ -100,6 +147,28 @@ export declare const JinnConfigSchema: z.ZodObject<{
100
147
  * Default is applied in bootstrap when unset. Env: JINN_MASTER_ETH_DAILY_WEI
101
148
  */
102
149
  masterEthDailyEstimateWei: z.ZodOptional<z.ZodString>;
150
+ /**
151
+ * Operator-controlled impl dispatch for the restorer engine.
152
+ *
153
+ * Wired by daemon (jinn-mono-bv5); engine consumes via RestorerImplRegistry config.
154
+ *
155
+ * byKind: explicit spec.kind → impl name mapping (highest priority)
156
+ * default: fallback impl name when no kind-specific match is found
157
+ * disabled: impl names to exclude from dispatch entirely
158
+ */
159
+ restorers: z.ZodOptional<z.ZodObject<{
160
+ byKind: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
161
+ default: z.ZodOptional<z.ZodString>;
162
+ disabled: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
163
+ }, "strip", z.ZodTypeAny, {
164
+ byKind?: Record<string, string> | undefined;
165
+ default?: string | undefined;
166
+ disabled?: string[] | undefined;
167
+ }, {
168
+ byKind?: Record<string, string> | undefined;
169
+ default?: string | undefined;
170
+ disabled?: string[] | undefined;
171
+ }>>;
103
172
  }, "strip", z.ZodTypeAny, {
104
173
  network: "testnet" | "mainnet";
105
174
  earningDir: string;
@@ -112,9 +181,17 @@ export declare const JinnConfigSchema: z.ZodObject<{
112
181
  claudeModel: string;
113
182
  peers: string[];
114
183
  desiredStates: {
115
- id: string;
116
184
  description: string;
185
+ id?: string | undefined;
117
186
  context?: Record<string, unknown> | undefined;
187
+ window?: {
188
+ startTs: number;
189
+ endTs: number;
190
+ } | undefined;
191
+ spec?: ({
192
+ kind: string;
193
+ } & Record<string, unknown>) | undefined;
194
+ eligibility?: Record<string, unknown> | undefined;
118
195
  }[];
119
196
  ipfsRegistryUrl: string;
120
197
  ipfsGatewayUrl: string;
@@ -122,16 +199,25 @@ export declare const JinnConfigSchema: z.ZodObject<{
122
199
  targetServices: number;
123
200
  debug: boolean;
124
201
  rpcUrl?: string | undefined;
202
+ archiveRpcUrl?: string | undefined;
203
+ runtimeMode?: "bare" | "docker-compose" | "container" | undefined;
125
204
  subgraphUrl?: string | undefined;
126
205
  nodeEndpoint?: string | undefined;
127
206
  testnetL2DeploymentPath?: string | undefined;
128
207
  testnetL2TokenDeploymentPath?: string | undefined;
129
208
  testnetMechDeploymentPath?: string | undefined;
130
209
  testnetStolasDeploymentPath?: string | undefined;
210
+ testnetClaimRegistryDeploymentPath?: string | undefined;
131
211
  masterEthDailyEstimateWei?: string | undefined;
212
+ restorers?: {
213
+ byKind?: Record<string, string> | undefined;
214
+ default?: string | undefined;
215
+ disabled?: string[] | undefined;
216
+ } | undefined;
132
217
  }, {
133
218
  network?: "testnet" | "mainnet" | undefined;
134
219
  rpcUrl?: string | undefined;
220
+ archiveRpcUrl?: string | undefined;
135
221
  earningDir?: string | undefined;
136
222
  dbPath?: string | undefined;
137
223
  pollIntervalMs?: number | undefined;
@@ -140,13 +226,22 @@ export declare const JinnConfigSchema: z.ZodObject<{
140
226
  apiPort?: number | undefined;
141
227
  claudePath?: string | undefined;
142
228
  claudeModel?: string | undefined;
229
+ runtimeMode?: "bare" | "docker-compose" | "container" | undefined;
143
230
  peers?: string | string[] | undefined;
144
231
  subgraphUrl?: string | undefined;
145
232
  nodeEndpoint?: string | undefined;
146
233
  desiredStates?: {
147
- id: string;
148
234
  description: string;
235
+ id?: string | undefined;
149
236
  context?: Record<string, unknown> | undefined;
237
+ window?: {
238
+ startTs: number;
239
+ endTs: number;
240
+ } | undefined;
241
+ spec?: ({
242
+ kind: string;
243
+ } & Record<string, unknown>) | undefined;
244
+ eligibility?: Record<string, unknown> | undefined;
150
245
  }[] | undefined;
151
246
  ipfsRegistryUrl?: string | undefined;
152
247
  ipfsGatewayUrl?: string | undefined;
@@ -154,14 +249,21 @@ export declare const JinnConfigSchema: z.ZodObject<{
154
249
  testnetL2TokenDeploymentPath?: string | undefined;
155
250
  testnetMechDeploymentPath?: string | undefined;
156
251
  testnetStolasDeploymentPath?: string | undefined;
252
+ testnetClaimRegistryDeploymentPath?: string | undefined;
157
253
  stakingMode?: "standard" | "self-bond" | undefined;
158
254
  targetServices?: number | undefined;
159
255
  debug?: boolean | undefined;
160
256
  masterEthDailyEstimateWei?: string | undefined;
257
+ restorers?: {
258
+ byKind?: Record<string, string> | undefined;
259
+ default?: string | undefined;
260
+ disabled?: string[] | undefined;
261
+ } | undefined;
161
262
  }>;
162
- /** JinnConfig with rpcUrl guaranteed to be resolved (never undefined). */
163
- export type JinnConfig = Omit<z.infer<typeof JinnConfigSchema>, 'rpcUrl'> & {
263
+ /** JinnConfig with rpcUrl guaranteed to be resolved (never undefined) and desiredStates with id always assigned. */
264
+ export type JinnConfig = Omit<z.infer<typeof JinnConfigSchema>, 'rpcUrl' | 'desiredStates'> & {
164
265
  rpcUrl: string;
266
+ desiredStates: DesiredState[];
165
267
  };
166
268
  export type ConfigLoadErrorCode = 'config_file_not_found' | 'config_json_invalid' | 'desired_states_file_not_found' | 'desired_states_json_invalid' | 'config_invalid';
167
269
  export declare class ConfigLoadError extends Error {