@jinn-network/client 0.1.2 → 0.1.3-canary.262e5cda

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 (812) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/CONTRIBUTING.md +8 -2
  3. package/README.md +38 -14
  4. package/deployments/deployment-jinn-mvi-l1-sepolia-fast.json +36 -0
  5. package/deployments/deployment-jinn-mvi-l1-sepolia.json +36 -0
  6. package/deployments/deployment-jinn-mvi-l2-baseSepolia.json +12 -0
  7. package/deployments/deployment-phase1b-mech-baseSepolia-fast.json +3 -3
  8. package/deployments/deployment-stolas-l2-baseSepolia-fast.json +1 -1
  9. package/dist/adapters/adapter.d.ts +2 -2
  10. package/dist/adapters/claim-registry/client.d.ts +9 -0
  11. package/dist/adapters/claim-registry/client.js +22 -2
  12. package/dist/adapters/claim-registry/client.js.map +1 -1
  13. package/dist/adapters/local/adapter.d.ts +2 -2
  14. package/dist/adapters/local/adapter.js +8 -8
  15. package/dist/adapters/local/adapter.js.map +1 -1
  16. package/dist/adapters/mech/adapter.d.ts +3 -4
  17. package/dist/adapters/mech/adapter.js +86 -50
  18. package/dist/adapters/mech/adapter.js.map +1 -1
  19. package/dist/adapters/mech/contracts.d.ts +6 -4
  20. package/dist/adapters/mech/contracts.js +118 -14
  21. package/dist/adapters/mech/contracts.js.map +1 -1
  22. package/dist/adapters/mech/ipfs.d.ts +61 -6
  23. package/dist/adapters/mech/ipfs.js +159 -26
  24. package/dist/adapters/mech/ipfs.js.map +1 -1
  25. package/dist/adapters/mech/safe-revert.d.ts +39 -0
  26. package/dist/adapters/mech/safe-revert.js +130 -0
  27. package/dist/adapters/mech/safe-revert.js.map +1 -0
  28. package/dist/adapters/mech/safe.js +47 -21
  29. package/dist/adapters/mech/safe.js.map +1 -1
  30. package/dist/adapters/mech/types.d.ts +8 -0
  31. package/dist/adapters/mech/types.js.map +1 -1
  32. package/dist/agent/agent-ws.d.ts +55 -0
  33. package/dist/agent/agent-ws.js +288 -0
  34. package/dist/agent/agent-ws.js.map +1 -0
  35. package/dist/agent/auto-mode-detect.d.ts +6 -0
  36. package/dist/agent/auto-mode-detect.js +44 -0
  37. package/dist/agent/auto-mode-detect.js.map +1 -0
  38. package/dist/agent/operator-claude.d.ts +22 -0
  39. package/dist/agent/operator-claude.js +130 -0
  40. package/dist/agent/operator-claude.js.map +1 -0
  41. package/dist/api/admin-endpoint.d.ts +12 -0
  42. package/dist/api/admin-endpoint.js +71 -0
  43. package/dist/api/admin-endpoint.js.map +1 -0
  44. package/dist/api/bootstrap-endpoint.d.ts +16 -0
  45. package/dist/api/bootstrap-endpoint.js +78 -0
  46. package/dist/api/bootstrap-endpoint.js.map +1 -0
  47. package/dist/api/events-endpoint.d.ts +9 -0
  48. package/dist/api/events-endpoint.js +46 -0
  49. package/dist/api/events-endpoint.js.map +1 -0
  50. package/dist/api/fleet-build.d.ts +1 -1
  51. package/dist/api/fleet-build.js +17 -8
  52. package/dist/api/fleet-build.js.map +1 -1
  53. package/dist/api/gather-status.js +5 -1
  54. package/dist/api/gather-status.js.map +1 -1
  55. package/dist/api/handshake.d.ts +17 -0
  56. package/dist/api/handshake.js +28 -0
  57. package/dist/api/handshake.js.map +1 -0
  58. package/dist/api/peers.js +20 -5
  59. package/dist/api/peers.js.map +1 -1
  60. package/dist/api/portfolio-v0-build.d.ts +6 -0
  61. package/dist/api/portfolio-v0-build.js +6 -1
  62. package/dist/api/portfolio-v0-build.js.map +1 -1
  63. package/dist/api/rewards-build.js +3 -8
  64. package/dist/api/rewards-build.js.map +1 -1
  65. package/dist/api/server.d.ts +54 -0
  66. package/dist/api/server.js +239 -13
  67. package/dist/api/server.js.map +1 -1
  68. package/dist/api/setup-endpoints.d.ts +34 -0
  69. package/dist/api/setup-endpoints.js +188 -0
  70. package/dist/api/setup-endpoints.js.map +1 -0
  71. package/dist/api/status-build.d.ts +9 -1
  72. package/dist/api/status-build.js +44 -9
  73. package/dist/api/status-build.js.map +1 -1
  74. package/dist/api/status-rollup-build.d.ts +46 -1
  75. package/dist/api/status-rollup-build.js +168 -5
  76. package/dist/api/status-rollup-build.js.map +1 -1
  77. package/dist/api/ui-token.d.ts +5 -0
  78. package/dist/api/ui-token.js +36 -0
  79. package/dist/api/ui-token.js.map +1 -0
  80. package/dist/build-info.d.ts +32 -0
  81. package/dist/build-info.js +69 -0
  82. package/dist/build-info.js.map +1 -0
  83. package/dist/build-info.json +6 -0
  84. package/dist/build-meta.json +1 -1
  85. package/dist/cli/command.d.ts +9 -0
  86. package/dist/cli/commands/balance.d.ts +7 -0
  87. package/dist/cli/commands/balance.js +38 -32
  88. package/dist/cli/commands/balance.js.map +1 -1
  89. package/dist/cli/commands/bootstrap.d.ts +13 -1
  90. package/dist/cli/commands/bootstrap.js +150 -132
  91. package/dist/cli/commands/bootstrap.js.map +1 -1
  92. package/dist/cli/commands/claim-rewards.js +14 -2
  93. package/dist/cli/commands/claim-rewards.js.map +1 -1
  94. package/dist/cli/commands/conformance.d.ts +12 -0
  95. package/dist/cli/commands/conformance.js +140 -0
  96. package/dist/cli/commands/conformance.js.map +1 -0
  97. package/dist/cli/commands/create.d.ts +36 -0
  98. package/dist/cli/commands/create.js +374 -0
  99. package/dist/cli/commands/create.js.map +1 -0
  100. package/dist/cli/commands/doctor.d.ts +34 -1
  101. package/dist/cli/commands/doctor.js +136 -121
  102. package/dist/cli/commands/doctor.js.map +1 -1
  103. package/dist/cli/commands/fleet-scale.d.ts +19 -1
  104. package/dist/cli/commands/fleet-scale.js +379 -361
  105. package/dist/cli/commands/fleet-scale.js.map +1 -1
  106. package/dist/cli/commands/fleet.d.ts +7 -0
  107. package/dist/cli/commands/fleet.js +39 -33
  108. package/dist/cli/commands/fleet.js.map +1 -1
  109. package/dist/cli/commands/fund-requirements.d.ts +14 -1
  110. package/dist/cli/commands/fund-requirements.js +183 -174
  111. package/dist/cli/commands/fund-requirements.js.map +1 -1
  112. package/dist/cli/commands/history.d.ts +10 -1
  113. package/dist/cli/commands/history.js +66 -57
  114. package/dist/cli/commands/history.js.map +1 -1
  115. package/dist/cli/commands/impls.d.ts +18 -0
  116. package/dist/cli/commands/impls.js +208 -0
  117. package/dist/cli/commands/impls.js.map +1 -0
  118. package/dist/cli/commands/init.js +4 -1
  119. package/dist/cli/commands/init.js.map +1 -1
  120. package/dist/cli/commands/intents.js +13 -9
  121. package/dist/cli/commands/intents.js.map +1 -1
  122. package/dist/cli/commands/logs.d.ts +6 -1
  123. package/dist/cli/commands/logs.js +77 -70
  124. package/dist/cli/commands/logs.js.map +1 -1
  125. package/dist/cli/commands/migrate-agent-id.d.ts +26 -0
  126. package/dist/cli/commands/migrate-agent-id.js +165 -0
  127. package/dist/cli/commands/migrate-agent-id.js.map +1 -0
  128. package/dist/cli/commands/plug-ins.d.ts +34 -0
  129. package/dist/cli/commands/plug-ins.js +282 -0
  130. package/dist/cli/commands/plug-ins.js.map +1 -0
  131. package/dist/cli/commands/plugin-install.d.ts +10 -0
  132. package/dist/cli/commands/plugin-install.js +226 -14
  133. package/dist/cli/commands/plugin-install.js.map +1 -1
  134. package/dist/cli/commands/rewards.d.ts +7 -0
  135. package/dist/cli/commands/rewards.js +46 -40
  136. package/dist/cli/commands/rewards.js.map +1 -1
  137. package/dist/cli/commands/run.d.ts +14 -1
  138. package/dist/cli/commands/run.js +232 -90
  139. package/dist/cli/commands/run.js.map +1 -1
  140. package/dist/cli/commands/status.d.ts +10 -0
  141. package/dist/cli/commands/status.js +97 -34
  142. package/dist/cli/commands/status.js.map +1 -1
  143. package/dist/cli/commands/submit-intent.js +33 -6
  144. package/dist/cli/commands/submit-intent.js.map +1 -1
  145. package/dist/cli/commands/ui.js +45 -0
  146. package/dist/cli/commands/ui.js.map +1 -0
  147. package/dist/cli/commands/update.d.ts +5 -0
  148. package/dist/cli/commands/update.js +102 -97
  149. package/dist/cli/commands/update.js.map +1 -1
  150. package/dist/cli/commands/version.js +3 -1
  151. package/dist/cli/commands/version.js.map +1 -1
  152. package/dist/cli/commands/withdraw.d.ts +21 -1
  153. package/dist/cli/commands/withdraw.js +175 -159
  154. package/dist/cli/commands/withdraw.js.map +1 -1
  155. package/dist/cli/execution-context.d.ts +1 -1
  156. package/dist/cli/execution-context.js +2 -1
  157. package/dist/cli/execution-context.js.map +1 -1
  158. package/dist/cli/help.js +7 -0
  159. package/dist/cli/help.js.map +1 -1
  160. package/dist/cli/index.d.ts +7 -0
  161. package/dist/cli/index.js +18 -2
  162. package/dist/cli/index.js.map +1 -1
  163. package/dist/cli/intent-registry-access.d.ts +33 -1
  164. package/dist/cli/intent-registry-access.js +40 -2
  165. package/dist/cli/intent-registry-access.js.map +1 -1
  166. package/dist/cli/open-browser.d.ts +1 -0
  167. package/dist/cli/open-browser.js +18 -0
  168. package/dist/cli/open-browser.js.map +1 -0
  169. package/dist/cli/password.d.ts +3 -3
  170. package/dist/cli/password.js +5 -5
  171. package/dist/cli/password.js.map +1 -1
  172. package/dist/config.d.ts +883 -11
  173. package/dist/config.js +435 -4
  174. package/dist/config.js.map +1 -1
  175. package/dist/conformance/checks/artifacts.d.ts +37 -0
  176. package/dist/conformance/checks/artifacts.js +110 -0
  177. package/dist/conformance/checks/artifacts.js.map +1 -0
  178. package/dist/conformance/checks/envelope-schema.d.ts +17 -0
  179. package/dist/conformance/checks/envelope-schema.js +36 -0
  180. package/dist/conformance/checks/envelope-schema.js.map +1 -0
  181. package/dist/conformance/checks/hash-signature.d.ts +26 -0
  182. package/dist/conformance/checks/hash-signature.js +70 -0
  183. package/dist/conformance/checks/hash-signature.js.map +1 -0
  184. package/dist/conformance/checks/payload.d.ts +19 -0
  185. package/dist/conformance/checks/payload.js +52 -0
  186. package/dist/conformance/checks/payload.js.map +1 -0
  187. package/dist/conformance/checks/secret-scrub.d.ts +33 -0
  188. package/dist/conformance/checks/secret-scrub.js +118 -0
  189. package/dist/conformance/checks/secret-scrub.js.map +1 -0
  190. package/dist/conformance/checks/source-runtime.d.ts +43 -0
  191. package/dist/conformance/checks/source-runtime.js +68 -0
  192. package/dist/conformance/checks/source-runtime.js.map +1 -0
  193. package/dist/conformance/checks/source-static.d.ts +61 -0
  194. package/dist/conformance/checks/source-static.js +311 -0
  195. package/dist/conformance/checks/source-static.js.map +1 -0
  196. package/dist/conformance/checks/trajectory-chain.d.ts +18 -0
  197. package/dist/conformance/checks/trajectory-chain.js +51 -0
  198. package/dist/conformance/checks/trajectory-chain.js.map +1 -0
  199. package/dist/conformance/checks/trajectory-profile.d.ts +17 -0
  200. package/dist/conformance/checks/trajectory-profile.js +51 -0
  201. package/dist/conformance/checks/trajectory-profile.js.map +1 -0
  202. package/dist/conformance/checks/trajectory-schema.d.ts +20 -0
  203. package/dist/conformance/checks/trajectory-schema.js +40 -0
  204. package/dist/conformance/checks/trajectory-schema.js.map +1 -0
  205. package/dist/conformance/checks/verdict.d.ts +44 -0
  206. package/dist/conformance/checks/verdict.js +122 -0
  207. package/dist/conformance/checks/verdict.js.map +1 -0
  208. package/dist/conformance/harness.d.ts +32 -0
  209. package/dist/conformance/harness.js +228 -0
  210. package/dist/conformance/harness.js.map +1 -0
  211. package/dist/conformance/types.d.ts +88 -0
  212. package/dist/conformance/types.js +31 -0
  213. package/dist/conformance/types.js.map +1 -0
  214. package/dist/corpus/acquire.d.ts +37 -0
  215. package/dist/corpus/acquire.js +155 -0
  216. package/dist/corpus/acquire.js.map +1 -0
  217. package/dist/corpus/cache.d.ts +14 -0
  218. package/dist/corpus/cache.js +18 -0
  219. package/dist/corpus/cache.js.map +1 -0
  220. package/dist/corpus/fetch.d.ts +9 -0
  221. package/dist/corpus/fetch.js +24 -0
  222. package/dist/corpus/fetch.js.map +1 -0
  223. package/dist/corpus/index.d.ts +16 -0
  224. package/dist/corpus/index.js +78 -0
  225. package/dist/corpus/index.js.map +1 -0
  226. package/dist/corpus/query.d.ts +17 -0
  227. package/dist/corpus/query.js +108 -0
  228. package/dist/corpus/query.js.map +1 -0
  229. package/dist/corpus/route-resolver.d.ts +16 -0
  230. package/dist/corpus/route-resolver.js +20 -0
  231. package/dist/corpus/route-resolver.js.map +1 -0
  232. package/dist/corpus/types.d.ts +107 -0
  233. package/dist/corpus/types.js +50 -0
  234. package/dist/corpus/types.js.map +1 -0
  235. package/dist/daemon/balance-topup-loop.js +2 -1
  236. package/dist/daemon/balance-topup-loop.js.map +1 -1
  237. package/dist/daemon/creator.d.ts +2 -2
  238. package/dist/daemon/creator.js +2 -2
  239. package/dist/daemon/creator.js.map +1 -1
  240. package/dist/daemon/daemon.d.ts +70 -15
  241. package/dist/daemon/daemon.js +159 -41
  242. package/dist/daemon/daemon.js.map +1 -1
  243. package/dist/daemon/delivery-watcher.js +31 -1
  244. package/dist/daemon/delivery-watcher.js.map +1 -1
  245. package/dist/daemon/jinn-claim-loop-canonical.d.ts +207 -0
  246. package/dist/daemon/jinn-claim-loop-canonical.js +296 -0
  247. package/dist/daemon/jinn-claim-loop-canonical.js.map +1 -0
  248. package/dist/daemon/jinn-claim-loop-mock.d.ts +61 -0
  249. package/dist/daemon/jinn-claim-loop-mock.js +122 -0
  250. package/dist/daemon/jinn-claim-loop-mock.js.map +1 -0
  251. package/dist/daemon/jinn-claim-loop.d.ts +123 -0
  252. package/dist/daemon/jinn-claim-loop.js +256 -0
  253. package/dist/daemon/jinn-claim-loop.js.map +1 -0
  254. package/dist/daemon/reward-claim-loop.d.ts +2 -0
  255. package/dist/daemon/reward-claim-loop.js +32 -27
  256. package/dist/daemon/reward-claim-loop.js.map +1 -1
  257. package/dist/dashboard/assets/index-Bxlk5qpa.js +68 -0
  258. package/dist/dashboard/assets/index-DQ3u_vP5.css +32 -0
  259. package/dist/dashboard/index.html +18 -74
  260. package/dist/earning/agent-wallet-binding.d.ts +133 -0
  261. package/dist/earning/agent-wallet-binding.js +202 -0
  262. package/dist/earning/agent-wallet-binding.js.map +1 -0
  263. package/dist/earning/bootstrap.d.ts +64 -0
  264. package/dist/earning/bootstrap.js +325 -32
  265. package/dist/earning/bootstrap.js.map +1 -1
  266. package/dist/earning/contracts.d.ts +323 -0
  267. package/dist/earning/contracts.js +276 -0
  268. package/dist/earning/contracts.js.map +1 -1
  269. package/dist/earning/funding-plan.d.ts +90 -0
  270. package/dist/earning/funding-plan.js +203 -0
  271. package/dist/earning/funding-plan.js.map +1 -0
  272. package/dist/earning/migrate-agent-id.d.ts +130 -0
  273. package/dist/earning/migrate-agent-id.js +257 -0
  274. package/dist/earning/migrate-agent-id.js.map +1 -0
  275. package/dist/earning/orphan-sweep.d.ts +14 -0
  276. package/dist/earning/orphan-sweep.js +63 -2
  277. package/dist/earning/orphan-sweep.js.map +1 -1
  278. package/dist/earning/reconcile.d.ts +2 -0
  279. package/dist/earning/reconcile.js +30 -0
  280. package/dist/earning/reconcile.js.map +1 -1
  281. package/dist/earning/stolas-claim.d.ts +86 -6
  282. package/dist/earning/stolas-claim.js +123 -9
  283. package/dist/earning/stolas-claim.js.map +1 -1
  284. package/dist/earning/store.d.ts +39 -0
  285. package/dist/earning/store.js +72 -1
  286. package/dist/earning/store.js.map +1 -1
  287. package/dist/earning/testnet-setup-migration.d.ts +32 -0
  288. package/dist/earning/testnet-setup-migration.js +214 -0
  289. package/dist/earning/testnet-setup-migration.js.map +1 -0
  290. package/dist/earning/types.d.ts +53 -9
  291. package/dist/earning/types.js +51 -2
  292. package/dist/earning/types.js.map +1 -1
  293. package/dist/earning/viem-clients.d.ts +20 -0
  294. package/dist/earning/viem-clients.js +32 -1
  295. package/dist/earning/viem-clients.js.map +1 -1
  296. package/dist/erc8004/abis.d.ts +381 -0
  297. package/dist/erc8004/abis.js +238 -0
  298. package/dist/erc8004/abis.js.map +1 -0
  299. package/dist/erc8004/addresses.d.ts +40 -0
  300. package/dist/erc8004/addresses.js +64 -0
  301. package/dist/erc8004/addresses.js.map +1 -0
  302. package/dist/erc8004/identity.d.ts +202 -0
  303. package/dist/erc8004/identity.js +305 -0
  304. package/dist/erc8004/identity.js.map +1 -0
  305. package/dist/erc8004/index.d.ts +13 -0
  306. package/dist/erc8004/index.js +20 -0
  307. package/dist/erc8004/index.js.map +1 -0
  308. package/dist/erc8004/reputation.d.ts +349 -0
  309. package/dist/erc8004/reputation.js +464 -0
  310. package/dist/erc8004/reputation.js.map +1 -0
  311. package/dist/erc8004/subgraph.d.ts +46 -0
  312. package/dist/erc8004/subgraph.js +37 -0
  313. package/dist/erc8004/subgraph.js.map +1 -0
  314. package/dist/erc8004/validation.d.ts +145 -0
  315. package/dist/erc8004/validation.js +219 -0
  316. package/dist/erc8004/validation.js.map +1 -0
  317. package/dist/errors/persisted-bootstrap-error.d.ts +4 -0
  318. package/dist/errors/persisted-bootstrap-error.js +50 -0
  319. package/dist/errors/persisted-bootstrap-error.js.map +1 -0
  320. package/dist/events/emitter.d.ts +12 -0
  321. package/dist/events/emitter.js +23 -0
  322. package/dist/events/emitter.js.map +1 -0
  323. package/dist/events/ring-buffer.d.ts +25 -0
  324. package/dist/events/ring-buffer.js +46 -0
  325. package/dist/events/ring-buffer.js.map +1 -0
  326. package/dist/events/types.d.ts +42 -0
  327. package/dist/events/types.js +28 -0
  328. package/dist/events/types.js.map +1 -0
  329. package/dist/index.d.ts +1 -1
  330. package/dist/intents/kinds/index.d.ts +10 -0
  331. package/dist/intents/kinds/index.js +7 -0
  332. package/dist/intents/kinds/index.js.map +1 -1
  333. package/dist/intents/kinds/learner-loop-test.d.ts +2 -0
  334. package/dist/intents/kinds/learner-loop-test.js +39 -0
  335. package/dist/intents/kinds/learner-loop-test.js.map +1 -0
  336. package/dist/intents/kinds/prediction-apy-v0.js +5 -1
  337. package/dist/intents/kinds/prediction-apy-v0.js.map +1 -1
  338. package/dist/intents/kinds/prediction-v0.js +5 -0
  339. package/dist/intents/kinds/prediction-v0.js.map +1 -1
  340. package/dist/intents/kinds/spec-kind.d.ts +18 -1
  341. package/dist/intents/posting-service.d.ts +3 -5
  342. package/dist/intents/posting-service.js +16 -50
  343. package/dist/intents/posting-service.js.map +1 -1
  344. package/dist/intents/prediction-apy-v0-auto.d.ts +12 -2
  345. package/dist/intents/prediction-apy-v0-auto.js +27 -2
  346. package/dist/intents/prediction-apy-v0-auto.js.map +1 -1
  347. package/dist/intents/prediction-v0-auto.d.ts +14 -4
  348. package/dist/intents/prediction-v0-auto.js +29 -5
  349. package/dist/intents/prediction-v0-auto.js.map +1 -1
  350. package/dist/intents/signing.d.ts +13 -0
  351. package/dist/intents/signing.js +27 -0
  352. package/dist/intents/signing.js.map +1 -0
  353. package/dist/intents/sources.d.ts +12 -5
  354. package/dist/intents/sources.js +11 -11
  355. package/dist/intents/sources.js.map +1 -1
  356. package/dist/main.d.ts +5 -2
  357. package/dist/main.js +792 -66
  358. package/dist/main.js.map +1 -1
  359. package/dist/mcp/acquire-artifact.d.ts +39 -0
  360. package/dist/mcp/acquire-artifact.js +163 -0
  361. package/dist/mcp/acquire-artifact.js.map +1 -0
  362. package/dist/mcp/operator-server.d.ts +20 -3
  363. package/dist/mcp/operator-server.js +500 -25
  364. package/dist/mcp/operator-server.js.map +1 -1
  365. package/dist/mcp/search-artifacts.d.ts +31 -0
  366. package/dist/mcp/search-artifacts.js +40 -0
  367. package/dist/mcp/search-artifacts.js.map +1 -0
  368. package/dist/mcp/server.js +103 -58
  369. package/dist/mcp/server.js.map +1 -1
  370. package/dist/observability/emit-event.d.ts +1 -1
  371. package/dist/observability/emit-event.js.map +1 -1
  372. package/dist/operator-errors.js +4 -5
  373. package/dist/operator-errors.js.map +1 -1
  374. package/dist/preflight/claude-auth.d.ts +11 -11
  375. package/dist/preflight/claude-auth.js +18 -32
  376. package/dist/preflight/claude-auth.js.map +1 -1
  377. package/dist/restorer/capability/index.d.ts +82 -0
  378. package/dist/restorer/capability/index.js +12 -0
  379. package/dist/restorer/capability/index.js.map +1 -0
  380. package/dist/restorer/capability/scoped-rpc.d.ts +12 -0
  381. package/dist/restorer/capability/scoped-rpc.js +34 -0
  382. package/dist/restorer/capability/scoped-rpc.js.map +1 -0
  383. package/dist/restorer/capability/scoped-secrets.d.ts +8 -0
  384. package/dist/restorer/capability/scoped-secrets.js +10 -0
  385. package/dist/restorer/capability/scoped-secrets.js.map +1 -0
  386. package/dist/restorer/capability/scoped-signer.d.ts +46 -0
  387. package/dist/restorer/capability/scoped-signer.js +73 -0
  388. package/dist/restorer/capability/scoped-signer.js.map +1 -0
  389. package/dist/restorer/engine/canonical-json.d.ts +0 -17
  390. package/dist/restorer/engine/canonical-json.js +56 -49
  391. package/dist/restorer/engine/canonical-json.js.map +1 -1
  392. package/dist/restorer/engine/claim.js +8 -1
  393. package/dist/restorer/engine/claim.js.map +1 -1
  394. package/dist/restorer/engine/delivery.d.ts +2 -0
  395. package/dist/restorer/engine/delivery.js +2 -2
  396. package/dist/restorer/engine/delivery.js.map +1 -1
  397. package/dist/restorer/engine/engine.d.ts +143 -26
  398. package/dist/restorer/engine/engine.js +485 -104
  399. package/dist/restorer/engine/engine.js.map +1 -1
  400. package/dist/restorer/engine/envelope-assembly.d.ts +65 -0
  401. package/dist/restorer/engine/envelope-assembly.js +60 -0
  402. package/dist/restorer/engine/envelope-assembly.js.map +1 -0
  403. package/dist/restorer/engine/packaging.d.ts +30 -30
  404. package/dist/restorer/engine/packaging.js +73 -47
  405. package/dist/restorer/engine/packaging.js.map +1 -1
  406. package/dist/restorer/engine/persistence.d.ts +7 -7
  407. package/dist/restorer/engine/persistence.js +4 -4
  408. package/dist/restorer/engine/persistence.js.map +1 -1
  409. package/dist/restorer/engine/registry.d.ts +24 -13
  410. package/dist/restorer/engine/registry.js +16 -13
  411. package/dist/restorer/engine/registry.js.map +1 -1
  412. package/dist/restorer/engine/validate-manifest.d.ts +23 -0
  413. package/dist/restorer/engine/validate-manifest.js +49 -0
  414. package/dist/restorer/engine/validate-manifest.js.map +1 -0
  415. package/dist/restorer/engine/verification-stub.d.ts +18 -0
  416. package/dist/restorer/engine/verification-stub.js +18 -0
  417. package/dist/restorer/engine/verification-stub.js.map +1 -0
  418. package/dist/restorer/external-impls/index.d.ts +3 -0
  419. package/dist/restorer/external-impls/index.js +2 -0
  420. package/dist/restorer/external-impls/index.js.map +1 -0
  421. package/dist/restorer/external-impls/loader.d.ts +49 -0
  422. package/dist/restorer/external-impls/loader.js +138 -0
  423. package/dist/restorer/external-impls/loader.js.map +1 -0
  424. package/dist/restorer/external-impls/package-hash.d.ts +26 -0
  425. package/dist/restorer/external-impls/package-hash.js +102 -0
  426. package/dist/restorer/external-impls/package-hash.js.map +1 -0
  427. package/dist/restorer/external-impls/types.d.ts +42 -0
  428. package/dist/restorer/external-impls/types.js +10 -0
  429. package/dist/restorer/external-impls/types.js.map +1 -0
  430. package/dist/restorer/impls/claude-code-learner/adapters/claude-code.d.ts +38 -0
  431. package/dist/restorer/impls/claude-code-learner/adapters/claude-code.js +200 -0
  432. package/dist/restorer/impls/claude-code-learner/adapters/claude-code.js.map +1 -0
  433. package/dist/restorer/impls/claude-code-learner/harvest.d.ts +19 -0
  434. package/dist/restorer/impls/claude-code-learner/harvest.js +146 -0
  435. package/dist/restorer/impls/claude-code-learner/harvest.js.map +1 -0
  436. package/dist/restorer/impls/claude-code-learner/index.d.ts +15 -0
  437. package/dist/restorer/impls/claude-code-learner/index.js +14 -0
  438. package/dist/restorer/impls/claude-code-learner/index.js.map +1 -0
  439. package/dist/restorer/impls/claude-code-learner/mcp-config.d.ts +48 -0
  440. package/dist/restorer/impls/claude-code-learner/mcp-config.js +52 -0
  441. package/dist/restorer/impls/claude-code-learner/mcp-config.js.map +1 -0
  442. package/dist/restorer/impls/claude-code-learner/plugin-path.d.ts +14 -0
  443. package/dist/restorer/impls/claude-code-learner/plugin-path.js +30 -0
  444. package/dist/restorer/impls/claude-code-learner/plugin-path.js.map +1 -0
  445. package/dist/restorer/impls/claude-code-learner/restorer.d.ts +38 -0
  446. package/dist/restorer/impls/claude-code-learner/restorer.js +73 -0
  447. package/dist/restorer/impls/claude-code-learner/restorer.js.map +1 -0
  448. package/dist/restorer/impls/claude-code-learner/test-utils/fake-plugin-outputs.d.ts +19 -0
  449. package/dist/restorer/impls/claude-code-learner/test-utils/fake-plugin-outputs.js +111 -0
  450. package/dist/restorer/impls/claude-code-learner/test-utils/fake-plugin-outputs.js.map +1 -0
  451. package/dist/restorer/impls/claude-code-learner/test-utils/noop-adapter.d.ts +22 -0
  452. package/dist/restorer/impls/claude-code-learner/test-utils/noop-adapter.js +35 -0
  453. package/dist/restorer/impls/claude-code-learner/test-utils/noop-adapter.js.map +1 -0
  454. package/dist/restorer/impls/claude-code-learner/test-utils/synthetic-session.d.ts +20 -0
  455. package/dist/restorer/impls/claude-code-learner/test-utils/synthetic-session.js +34 -0
  456. package/dist/restorer/impls/claude-code-learner/test-utils/synthetic-session.js.map +1 -0
  457. package/dist/restorer/impls/claude-code-learner/types.d.ts +99 -0
  458. package/dist/restorer/impls/claude-code-learner/types.js +2 -0
  459. package/dist/restorer/impls/claude-code-learner/types.js.map +1 -0
  460. package/dist/restorer/impls/claude-code-learner/wrapper.d.ts +49 -0
  461. package/dist/restorer/impls/claude-code-learner/wrapper.js +144 -0
  462. package/dist/restorer/impls/claude-code-learner/wrapper.js.map +1 -0
  463. package/dist/restorer/impls/claude-mcp-hyperliquid/index.d.ts +2 -2
  464. package/dist/restorer/impls/claude-mcp-hyperliquid/index.js +2 -2
  465. package/dist/restorer/impls/claude-mcp-hyperliquid/index.js.map +1 -1
  466. package/dist/restorer/impls/claude-mcp-hyperliquid/session-orchestrator.d.ts +7 -0
  467. package/dist/restorer/impls/claude-mcp-hyperliquid/session-orchestrator.js +38 -0
  468. package/dist/restorer/impls/claude-mcp-hyperliquid/session-orchestrator.js.map +1 -1
  469. package/dist/restorer/impls/claude-mcp-prediction/index.d.ts +2 -2
  470. package/dist/restorer/impls/claude-mcp-prediction/index.js +12 -2
  471. package/dist/restorer/impls/claude-mcp-prediction/index.js.map +1 -1
  472. package/dist/restorer/impls/claude-mcp-prediction/session-orchestrator.d.ts +9 -2
  473. package/dist/restorer/impls/claude-mcp-prediction/session-orchestrator.js +9 -125
  474. package/dist/restorer/impls/claude-mcp-prediction/session-orchestrator.js.map +1 -1
  475. package/dist/restorer/impls/claude-mcp-prediction-apy/index.d.ts +2 -2
  476. package/dist/restorer/impls/claude-mcp-prediction-apy/index.js +9 -2
  477. package/dist/restorer/impls/claude-mcp-prediction-apy/index.js.map +1 -1
  478. package/dist/restorer/impls/claude-mcp-prediction-apy/session-orchestrator.d.ts +10 -0
  479. package/dist/restorer/impls/claude-mcp-prediction-apy/session-orchestrator.js +10 -119
  480. package/dist/restorer/impls/claude-mcp-prediction-apy/session-orchestrator.js.map +1 -1
  481. package/dist/restorer/impls/claude-mcp-shared/single-session-orchestrator.d.ts +84 -0
  482. package/dist/restorer/impls/claude-mcp-shared/single-session-orchestrator.js +206 -0
  483. package/dist/restorer/impls/claude-mcp-shared/single-session-orchestrator.js.map +1 -0
  484. package/dist/restorer/impls/evaluation-context.d.ts +11 -4
  485. package/dist/restorer/impls/evaluation-context.js +9 -2
  486. package/dist/restorer/impls/evaluation-context.js.map +1 -1
  487. package/dist/restorer/impls/index.d.ts +46 -1
  488. package/dist/restorer/impls/index.js +38 -0
  489. package/dist/restorer/impls/index.js.map +1 -1
  490. package/dist/restorer/impls/legacy-claude/index.d.ts +13 -1
  491. package/dist/restorer/impls/legacy-claude/index.js +2 -0
  492. package/dist/restorer/impls/legacy-claude/index.js.map +1 -1
  493. package/dist/restorer/impls/portfolio-v0-evaluator/index.d.ts +4 -4
  494. package/dist/restorer/impls/portfolio-v0-evaluator/index.js +184 -55
  495. package/dist/restorer/impls/portfolio-v0-evaluator/index.js.map +1 -1
  496. package/dist/restorer/impls/prediction-apy-v0-baseline/index.d.ts +1 -1
  497. package/dist/restorer/impls/prediction-apy-v0-baseline/index.js +8 -1
  498. package/dist/restorer/impls/prediction-apy-v0-baseline/index.js.map +1 -1
  499. package/dist/restorer/impls/prediction-apy-v0-evaluator/index.d.ts +3 -3
  500. package/dist/restorer/impls/prediction-apy-v0-evaluator/index.js +153 -15
  501. package/dist/restorer/impls/prediction-apy-v0-evaluator/index.js.map +1 -1
  502. package/dist/restorer/impls/prediction-apy-v0-evaluator/parse-submission.d.ts +14 -5
  503. package/dist/restorer/impls/prediction-apy-v0-evaluator/parse-submission.js +16 -23
  504. package/dist/restorer/impls/prediction-apy-v0-evaluator/parse-submission.js.map +1 -1
  505. package/dist/restorer/impls/prediction-v0-baseline/index.d.ts +1 -1
  506. package/dist/restorer/impls/prediction-v0-baseline/index.js +16 -7
  507. package/dist/restorer/impls/prediction-v0-baseline/index.js.map +1 -1
  508. package/dist/restorer/impls/prediction-v0-evaluator/checks/integrity.d.ts +5 -3
  509. package/dist/restorer/impls/prediction-v0-evaluator/checks/integrity.js.map +1 -1
  510. package/dist/restorer/impls/prediction-v0-evaluator/index.d.ts +2 -2
  511. package/dist/restorer/impls/prediction-v0-evaluator/index.js +175 -67
  512. package/dist/restorer/impls/prediction-v0-evaluator/index.js.map +1 -1
  513. package/dist/restorer/manifest/index.d.ts +3 -0
  514. package/dist/restorer/manifest/index.js +3 -0
  515. package/dist/restorer/manifest/index.js.map +1 -0
  516. package/dist/restorer/manifest/load.d.ts +7 -0
  517. package/dist/restorer/manifest/load.js +49 -0
  518. package/dist/restorer/manifest/load.js.map +1 -0
  519. package/dist/restorer/manifest/types.d.ts +75 -0
  520. package/dist/restorer/manifest/types.js +8 -0
  521. package/dist/restorer/manifest/types.js.map +1 -0
  522. package/dist/restorer/manifest/verify.d.ts +15 -0
  523. package/dist/restorer/manifest/verify.js +53 -0
  524. package/dist/restorer/manifest/verify.js.map +1 -0
  525. package/dist/restorer/plug-ins/index.d.ts +14 -0
  526. package/dist/restorer/plug-ins/index.js +11 -0
  527. package/dist/restorer/plug-ins/index.js.map +1 -0
  528. package/dist/restorer/plug-ins/loader.d.ts +27 -0
  529. package/dist/restorer/plug-ins/loader.js +101 -0
  530. package/dist/restorer/plug-ins/loader.js.map +1 -0
  531. package/dist/restorer/plug-ins/manifest.d.ts +7 -0
  532. package/dist/restorer/plug-ins/manifest.js +97 -0
  533. package/dist/restorer/plug-ins/manifest.js.map +1 -0
  534. package/dist/restorer/plug-ins/registry.d.ts +24 -0
  535. package/dist/restorer/plug-ins/registry.js +17 -0
  536. package/dist/restorer/plug-ins/registry.js.map +1 -0
  537. package/dist/restorer/plug-ins/serialise.d.ts +29 -0
  538. package/dist/restorer/plug-ins/serialise.js +29 -0
  539. package/dist/restorer/plug-ins/serialise.js.map +1 -0
  540. package/dist/restorer/plug-ins/types.d.ts +77 -0
  541. package/dist/restorer/plug-ins/types.js +10 -0
  542. package/dist/restorer/plug-ins/types.js.map +1 -0
  543. package/dist/restorer/types.d.ts +66 -11
  544. package/dist/restorer/types.js.map +1 -1
  545. package/dist/runner/claude.d.ts +3 -3
  546. package/dist/runner/claude.js +57 -21
  547. package/dist/runner/claude.js.map +1 -1
  548. package/dist/runner/runner.d.ts +29 -2
  549. package/dist/runner/simple.d.ts +2 -2
  550. package/dist/runner/simple.js +2 -2
  551. package/dist/runner/simple.js.map +1 -1
  552. package/dist/scripts/fix-node-pty.mjs +62 -0
  553. package/dist/setup-mode.d.ts +34 -0
  554. package/dist/setup-mode.js +49 -0
  555. package/dist/setup-mode.js.map +1 -0
  556. package/dist/store/store.d.ts +79 -3
  557. package/dist/store/store.js +189 -6
  558. package/dist/store/store.js.map +1 -1
  559. package/dist/templates/plug-in/hook/README.md.tmpl +24 -0
  560. package/dist/templates/plug-in/hook/gitignore.tmpl +3 -0
  561. package/dist/templates/plug-in/hook/hooks/event.sh.tmpl +15 -0
  562. package/dist/templates/plug-in/hook/jinn-plugin.json.tmpl +16 -0
  563. package/dist/templates/plug-in/hook/package.json.tmpl +14 -0
  564. package/dist/templates/plug-in/hook/test/manifest.test.ts.tmpl +21 -0
  565. package/dist/templates/plug-in/mcp-tool/README.md.tmpl +26 -0
  566. package/dist/templates/plug-in/mcp-tool/gitignore.tmpl +4 -0
  567. package/dist/templates/plug-in/mcp-tool/jinn-plugin.json.tmpl +16 -0
  568. package/dist/templates/plug-in/mcp-tool/package.json.tmpl +19 -0
  569. package/dist/templates/plug-in/mcp-tool/src/server.ts.tmpl +17 -0
  570. package/dist/templates/plug-in/mcp-tool/test/server.test.ts.tmpl +18 -0
  571. package/dist/templates/plug-in/memory-backend/README.md.tmpl +33 -0
  572. package/dist/templates/plug-in/memory-backend/gitignore.tmpl +4 -0
  573. package/dist/templates/plug-in/memory-backend/jinn-plugin.json.tmpl +16 -0
  574. package/dist/templates/plug-in/memory-backend/package.json.tmpl +19 -0
  575. package/dist/templates/plug-in/memory-backend/src/server.ts.tmpl +23 -0
  576. package/dist/templates/plug-in/memory-backend/test/server.test.ts.tmpl +17 -0
  577. package/dist/templates/plug-in/phase-agent-override/README.md.tmpl +30 -0
  578. package/dist/templates/plug-in/phase-agent-override/agents/agent.md.tmpl +26 -0
  579. package/dist/templates/plug-in/phase-agent-override/gitignore.tmpl +3 -0
  580. package/dist/templates/plug-in/phase-agent-override/jinn-plugin.json.tmpl +17 -0
  581. package/dist/templates/plug-in/phase-agent-override/package.json.tmpl +14 -0
  582. package/dist/templates/plug-in/phase-agent-override/test/manifest.test.ts.tmpl +24 -0
  583. package/dist/templates/plug-in/skill-bundle/.claude-plugin/plugin.json.tmpl +5 -0
  584. package/dist/templates/plug-in/skill-bundle/README.md.tmpl +28 -0
  585. package/dist/templates/plug-in/skill-bundle/gitignore.tmpl +3 -0
  586. package/dist/templates/plug-in/skill-bundle/jinn-plugin.json.tmpl +15 -0
  587. package/dist/templates/plug-in/skill-bundle/package.json.tmpl +14 -0
  588. package/dist/templates/plug-in/skill-bundle/skills/example/SKILL.md.tmpl +14 -0
  589. package/dist/templates/plug-in/skill-bundle/test/manifest.test.ts.tmpl +21 -0
  590. package/dist/templates/plug-in/topic-explorer/README.md.tmpl +24 -0
  591. package/dist/templates/plug-in/topic-explorer/agents/explorer.md.tmpl +26 -0
  592. package/dist/templates/plug-in/topic-explorer/gitignore.tmpl +3 -0
  593. package/dist/templates/plug-in/topic-explorer/jinn-plugin.json.tmpl +17 -0
  594. package/dist/templates/plug-in/topic-explorer/package.json.tmpl +14 -0
  595. package/dist/templates/plug-in/topic-explorer/test/manifest.test.ts.tmpl +22 -0
  596. package/dist/templates/restorer/alternative-harness/README.md.tmpl +44 -0
  597. package/dist/templates/restorer/alternative-harness/gitignore.tmpl +3 -0
  598. package/dist/templates/restorer/alternative-harness/jinn.manifest.json.tmpl +22 -0
  599. package/dist/templates/restorer/alternative-harness/package.json.tmpl +26 -0
  600. package/dist/templates/restorer/alternative-harness/src/coordinator.ts.tmpl +50 -0
  601. package/dist/templates/restorer/alternative-harness/src/harness.ts.tmpl +31 -0
  602. package/dist/templates/restorer/alternative-harness/src/index.ts.tmpl +44 -0
  603. package/dist/templates/restorer/alternative-harness/src/mock-harness.ts.tmpl +41 -0
  604. package/dist/templates/restorer/alternative-harness/src/phases/debrief.ts.tmpl +28 -0
  605. package/dist/templates/restorer/alternative-harness/src/phases/execute.ts.tmpl +33 -0
  606. package/dist/templates/restorer/alternative-harness/src/phases/improve.ts.tmpl +31 -0
  607. package/dist/templates/restorer/alternative-harness/src/phases/memory.ts.tmpl +31 -0
  608. package/dist/templates/restorer/alternative-harness/src/phases/orient.ts.tmpl +21 -0
  609. package/dist/templates/restorer/alternative-harness/src/phases/plan.ts.tmpl +25 -0
  610. package/dist/templates/restorer/alternative-harness/src/phases/strategize.ts.tmpl +29 -0
  611. package/dist/templates/restorer/alternative-harness/test/coordinator.test.ts.tmpl +52 -0
  612. package/dist/templates/restorer/alternative-harness/test/unit.test.ts.tmpl +54 -0
  613. package/dist/templates/restorer/alternative-harness/tsconfig.json.tmpl +16 -0
  614. package/dist/templates/restorer/evaluator/README.md.tmpl +36 -0
  615. package/dist/templates/restorer/evaluator/gitignore.tmpl +3 -0
  616. package/dist/templates/restorer/evaluator/jinn.manifest.json.tmpl +22 -0
  617. package/dist/templates/restorer/evaluator/package.json.tmpl +26 -0
  618. package/dist/templates/restorer/evaluator/src/index.ts.tmpl +35 -0
  619. package/dist/templates/restorer/evaluator/test/unit.test.ts.tmpl +48 -0
  620. package/dist/templates/restorer/evaluator/tsconfig.json.tmpl +16 -0
  621. package/dist/templates/restorer/forecaster/README.md.tmpl +25 -0
  622. package/dist/templates/restorer/forecaster/gitignore.tmpl +5 -0
  623. package/dist/templates/restorer/forecaster/jinn.manifest.json.tmpl +22 -0
  624. package/dist/templates/restorer/forecaster/package.json.tmpl +26 -0
  625. package/dist/templates/restorer/forecaster/src/index.ts.tmpl +33 -0
  626. package/dist/templates/restorer/forecaster/test/unit.test.ts.tmpl +41 -0
  627. package/dist/templates/restorer/forecaster/tsconfig.json.tmpl +16 -0
  628. package/dist/trajectory/collector.d.ts +49 -0
  629. package/dist/trajectory/collector.js +86 -0
  630. package/dist/trajectory/collector.js.map +1 -0
  631. package/dist/trajectory/emit.d.ts +27 -0
  632. package/dist/trajectory/emit.js +40 -0
  633. package/dist/trajectory/emit.js.map +1 -0
  634. package/dist/trajectory/hash-chain.d.ts +18 -0
  635. package/dist/trajectory/hash-chain.js +23 -0
  636. package/dist/trajectory/hash-chain.js.map +1 -0
  637. package/dist/trajectory/index.d.ts +22 -0
  638. package/dist/trajectory/index.js +23 -0
  639. package/dist/trajectory/index.js.map +1 -0
  640. package/dist/trajectory/schema.d.ts +14 -14
  641. package/dist/trajectory/secret-scrub.d.ts +32 -0
  642. package/dist/trajectory/secret-scrub.js +51 -0
  643. package/dist/trajectory/secret-scrub.js.map +1 -0
  644. package/dist/trajectory/span-profile.d.ts +27 -0
  645. package/dist/trajectory/span-profile.js +51 -0
  646. package/dist/trajectory/span-profile.js.map +1 -0
  647. package/dist/trajectory/wrappers/http.d.ts +37 -0
  648. package/dist/trajectory/wrappers/http.js +85 -0
  649. package/dist/trajectory/wrappers/http.js.map +1 -0
  650. package/dist/trajectory/wrappers/mcp.d.ts +17 -0
  651. package/dist/trajectory/wrappers/mcp.js +58 -0
  652. package/dist/trajectory/wrappers/mcp.js.map +1 -0
  653. package/dist/trajectory/wrappers/subprocess.d.ts +32 -0
  654. package/dist/trajectory/wrappers/subprocess.js +70 -0
  655. package/dist/trajectory/wrappers/subprocess.js.map +1 -0
  656. package/dist/tx-retry.js +23 -9
  657. package/dist/tx-retry.js.map +1 -1
  658. package/dist/types/desired-state.d.ts +211 -21
  659. package/dist/types/desired-state.js +26 -15
  660. package/dist/types/desired-state.js.map +1 -1
  661. package/dist/types/envelope.d.ts +1473 -0
  662. package/dist/types/envelope.js +114 -0
  663. package/dist/types/envelope.js.map +1 -0
  664. package/dist/types/index.d.ts +4 -4
  665. package/dist/types/index.js +4 -4
  666. package/dist/types/index.js.map +1 -1
  667. package/dist/types/intent.d.ts +276 -0
  668. package/dist/types/intent.js +74 -0
  669. package/dist/types/intent.js.map +1 -0
  670. package/dist/types/payloads/index.d.ts +11 -0
  671. package/dist/types/payloads/index.js +46 -0
  672. package/dist/types/payloads/index.js.map +1 -0
  673. package/dist/types/payloads/portfolio-v0.d.ts +481 -0
  674. package/dist/types/payloads/portfolio-v0.js +94 -0
  675. package/dist/types/payloads/portfolio-v0.js.map +1 -0
  676. package/dist/types/payloads/prediction-apy-v0.d.ts +231 -0
  677. package/dist/types/payloads/prediction-apy-v0.js +63 -0
  678. package/dist/types/payloads/prediction-apy-v0.js.map +1 -0
  679. package/dist/types/payloads/prediction-v0.d.ts +262 -0
  680. package/dist/types/payloads/prediction-v0.js +73 -0
  681. package/dist/types/payloads/prediction-v0.js.map +1 -0
  682. package/dist/types/portfolio.d.ts +23 -685
  683. package/dist/types/portfolio.js +16 -106
  684. package/dist/types/portfolio.js.map +1 -1
  685. package/dist/types/prediction-apy.d.ts +9 -344
  686. package/dist/types/prediction-apy.js +9 -65
  687. package/dist/types/prediction-apy.js.map +1 -1
  688. package/dist/types/prediction.d.ts +25 -396
  689. package/dist/types/prediction.js +5 -79
  690. package/dist/types/prediction.js.map +1 -1
  691. package/dist/types/window.d.ts +12 -0
  692. package/dist/types/window.js +6 -0
  693. package/dist/types/window.js.map +1 -0
  694. package/dist/util/path-safety.d.ts +22 -0
  695. package/dist/util/path-safety.js +29 -0
  696. package/dist/util/path-safety.js.map +1 -0
  697. package/dist/util/redact-rpc-urls.d.ts +5 -0
  698. package/dist/util/redact-rpc-urls.js +9 -0
  699. package/dist/util/redact-rpc-urls.js.map +1 -0
  700. package/dist/x402/acquire.d.ts +14 -3
  701. package/dist/x402/acquire.js +28 -11
  702. package/dist/x402/acquire.js.map +1 -1
  703. package/dist/x402/handler.d.ts +15 -3
  704. package/dist/x402/handler.js +67 -24
  705. package/dist/x402/handler.js.map +1 -1
  706. package/package.json +36 -11
  707. package/plugins/claude-code-learner/.claude-plugin/plugin.json +9 -0
  708. package/plugins/claude-code-learner/AGENTS.md +30 -0
  709. package/plugins/claude-code-learner/CLAUDE.md +31 -0
  710. package/plugins/claude-code-learner/README.md +58 -0
  711. package/plugins/claude-code-learner/agents/analyst.md +69 -0
  712. package/plugins/claude-code-learner/agents/consolidator.md +95 -0
  713. package/plugins/claude-code-learner/agents/explorer.md +54 -0
  714. package/plugins/claude-code-learner/agents/planner.md +88 -0
  715. package/plugins/claude-code-learner/agents/promoter.md +114 -0
  716. package/plugins/claude-code-learner/agents/step-worker.md +48 -0
  717. package/plugins/claude-code-learner/agents/strategist.md +86 -0
  718. package/plugins/claude-code-learner/hooks/hooks.json +16 -0
  719. package/plugins/claude-code-learner/hooks/session-start +49 -0
  720. package/plugins/claude-code-learner/skills/coordinator/SKILL.md +131 -0
  721. package/plugins/claude-code-learner/skills/debrief/SKILL.md +71 -0
  722. package/plugins/claude-code-learner/skills/execute/SKILL.md +91 -0
  723. package/plugins/claude-code-learner/skills/improve/SKILL.md +57 -0
  724. package/plugins/claude-code-learner/skills/memory-consolidation/SKILL.md +57 -0
  725. package/plugins/claude-code-learner/skills/orient/SKILL.md +82 -0
  726. package/plugins/claude-code-learner/skills/plan/SKILL.md +54 -0
  727. package/plugins/claude-code-learner/skills/strategize/SKILL.md +63 -0
  728. package/skills/jinn-operator/SKILL.md +84 -35
  729. package/templates/plug-in/hook/README.md.tmpl +24 -0
  730. package/templates/plug-in/hook/gitignore.tmpl +3 -0
  731. package/templates/plug-in/hook/hooks/event.sh.tmpl +15 -0
  732. package/templates/plug-in/hook/jinn-plugin.json.tmpl +16 -0
  733. package/templates/plug-in/hook/package.json.tmpl +14 -0
  734. package/templates/plug-in/hook/test/manifest.test.ts.tmpl +21 -0
  735. package/templates/plug-in/mcp-tool/README.md.tmpl +26 -0
  736. package/templates/plug-in/mcp-tool/gitignore.tmpl +4 -0
  737. package/templates/plug-in/mcp-tool/jinn-plugin.json.tmpl +16 -0
  738. package/templates/plug-in/mcp-tool/package.json.tmpl +19 -0
  739. package/templates/plug-in/mcp-tool/src/server.ts.tmpl +17 -0
  740. package/templates/plug-in/mcp-tool/test/server.test.ts.tmpl +18 -0
  741. package/templates/plug-in/memory-backend/README.md.tmpl +33 -0
  742. package/templates/plug-in/memory-backend/gitignore.tmpl +4 -0
  743. package/templates/plug-in/memory-backend/jinn-plugin.json.tmpl +16 -0
  744. package/templates/plug-in/memory-backend/package.json.tmpl +19 -0
  745. package/templates/plug-in/memory-backend/src/server.ts.tmpl +23 -0
  746. package/templates/plug-in/memory-backend/test/server.test.ts.tmpl +17 -0
  747. package/templates/plug-in/phase-agent-override/README.md.tmpl +30 -0
  748. package/templates/plug-in/phase-agent-override/agents/agent.md.tmpl +26 -0
  749. package/templates/plug-in/phase-agent-override/gitignore.tmpl +3 -0
  750. package/templates/plug-in/phase-agent-override/jinn-plugin.json.tmpl +17 -0
  751. package/templates/plug-in/phase-agent-override/package.json.tmpl +14 -0
  752. package/templates/plug-in/phase-agent-override/test/manifest.test.ts.tmpl +24 -0
  753. package/templates/plug-in/skill-bundle/.claude-plugin/plugin.json.tmpl +5 -0
  754. package/templates/plug-in/skill-bundle/README.md.tmpl +28 -0
  755. package/templates/plug-in/skill-bundle/gitignore.tmpl +3 -0
  756. package/templates/plug-in/skill-bundle/jinn-plugin.json.tmpl +15 -0
  757. package/templates/plug-in/skill-bundle/package.json.tmpl +14 -0
  758. package/templates/plug-in/skill-bundle/skills/example/SKILL.md.tmpl +14 -0
  759. package/templates/plug-in/skill-bundle/test/manifest.test.ts.tmpl +21 -0
  760. package/templates/plug-in/topic-explorer/README.md.tmpl +24 -0
  761. package/templates/plug-in/topic-explorer/agents/explorer.md.tmpl +26 -0
  762. package/templates/plug-in/topic-explorer/gitignore.tmpl +3 -0
  763. package/templates/plug-in/topic-explorer/jinn-plugin.json.tmpl +17 -0
  764. package/templates/plug-in/topic-explorer/package.json.tmpl +14 -0
  765. package/templates/plug-in/topic-explorer/test/manifest.test.ts.tmpl +22 -0
  766. package/templates/restorer/alternative-harness/README.md.tmpl +44 -0
  767. package/templates/restorer/alternative-harness/gitignore.tmpl +3 -0
  768. package/templates/restorer/alternative-harness/jinn.manifest.json.tmpl +22 -0
  769. package/templates/restorer/alternative-harness/package.json.tmpl +26 -0
  770. package/templates/restorer/alternative-harness/src/coordinator.ts.tmpl +50 -0
  771. package/templates/restorer/alternative-harness/src/harness.ts.tmpl +31 -0
  772. package/templates/restorer/alternative-harness/src/index.ts.tmpl +44 -0
  773. package/templates/restorer/alternative-harness/src/mock-harness.ts.tmpl +41 -0
  774. package/templates/restorer/alternative-harness/src/phases/debrief.ts.tmpl +28 -0
  775. package/templates/restorer/alternative-harness/src/phases/execute.ts.tmpl +33 -0
  776. package/templates/restorer/alternative-harness/src/phases/improve.ts.tmpl +31 -0
  777. package/templates/restorer/alternative-harness/src/phases/memory.ts.tmpl +31 -0
  778. package/templates/restorer/alternative-harness/src/phases/orient.ts.tmpl +21 -0
  779. package/templates/restorer/alternative-harness/src/phases/plan.ts.tmpl +25 -0
  780. package/templates/restorer/alternative-harness/src/phases/strategize.ts.tmpl +29 -0
  781. package/templates/restorer/alternative-harness/test/coordinator.test.ts.tmpl +52 -0
  782. package/templates/restorer/alternative-harness/test/unit.test.ts.tmpl +54 -0
  783. package/templates/restorer/alternative-harness/tsconfig.json.tmpl +16 -0
  784. package/templates/restorer/evaluator/README.md.tmpl +36 -0
  785. package/templates/restorer/evaluator/gitignore.tmpl +3 -0
  786. package/templates/restorer/evaluator/jinn.manifest.json.tmpl +22 -0
  787. package/templates/restorer/evaluator/package.json.tmpl +26 -0
  788. package/templates/restorer/evaluator/src/index.ts.tmpl +35 -0
  789. package/templates/restorer/evaluator/test/unit.test.ts.tmpl +48 -0
  790. package/templates/restorer/evaluator/tsconfig.json.tmpl +16 -0
  791. package/templates/restorer/forecaster/README.md.tmpl +25 -0
  792. package/templates/restorer/forecaster/gitignore.tmpl +5 -0
  793. package/templates/restorer/forecaster/jinn.manifest.json.tmpl +22 -0
  794. package/templates/restorer/forecaster/package.json.tmpl +26 -0
  795. package/templates/restorer/forecaster/src/index.ts.tmpl +33 -0
  796. package/templates/restorer/forecaster/test/unit.test.ts.tmpl +41 -0
  797. package/templates/restorer/forecaster/tsconfig.json.tmpl +16 -0
  798. package/dist/bin/jinn-mcp.d.ts +0 -2
  799. package/dist/bin/jinn-mcp.js +0 -10
  800. package/dist/bin/jinn-mcp.js.map +0 -1
  801. package/dist/cli/commands/quickstart.js +0 -330
  802. package/dist/cli/commands/quickstart.js.map +0 -1
  803. package/dist/discovery/registry.d.ts +0 -97
  804. package/dist/discovery/registry.js +0 -177
  805. package/dist/discovery/registry.js.map +0 -1
  806. package/dist/discovery/subgraph.d.ts +0 -37
  807. package/dist/discovery/subgraph.js +0 -87
  808. package/dist/discovery/subgraph.js.map +0 -1
  809. package/dist/restorer/engine/manifest-assembly.d.ts +0 -67
  810. package/dist/restorer/engine/manifest-assembly.js +0 -79
  811. package/dist/restorer/engine/manifest-assembly.js.map +0 -1
  812. /package/dist/cli/commands/{quickstart.d.ts → ui.d.ts} +0 -0
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Copyright (c) 2014 The xterm.js authors. All rights reserved.
3
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
4
+ * https://github.com/chjj/term.js
5
+ * @license MIT
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ *
25
+ * Originally forked from (with the author's permission):
26
+ * Fabrice Bellard's javascript vt100 for jslinux:
27
+ * http://bellard.org/jslinux/
28
+ * Copyright (c) 2011 Fabrice Bellard
29
+ * The original design remains. The terminal itself
30
+ * has been extended to include xterm CSI codes, among
31
+ * other features.
32
+ */.xterm{cursor:text;position:relative;-moz-user-select:none;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{position:absolute;top:0;z-index:5}.xterm .xterm-helper-textarea{padding:0;border:0;margin:0;position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-5;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;right:0;left:0;top:0;bottom:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm .xterm-scroll-area{visibility:hidden}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility,.xterm .xterm-message{position:absolute;left:0;top:0;bottom:0;right:0;z-index:10;color:transparent;pointer-events:none}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{-webkit-text-decoration:double underline;text-decoration:double underline}.xterm-underline-3{-webkit-text-decoration:wavy underline;text-decoration:wavy underline}.xterm-underline-4{-webkit-text-decoration:dotted underline;text-decoration:dotted underline}.xterm-underline-5{-webkit-text-decoration:dashed underline;text-decoration:dashed underline}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:overline underline}.xterm-overline.xterm-underline-2{-webkit-text-decoration:overline double underline;text-decoration:overline double underline}.xterm-overline.xterm-underline-3{-webkit-text-decoration:overline wavy underline;text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{-webkit-text-decoration:overline dotted underline;text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{-webkit-text-decoration:overline dashed underline;text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;position:absolute;top:0;right:0;pointer-events:none}.xterm-decoration-top{z-index:2;position:relative}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.visible{visibility:visible}.collapse{visibility:collapse}.col-span-12{grid-column:span 12 / span 12}.m-3{margin:.75rem}.mx-auto{margin-left:auto;margin-right:auto}.ml-12{margin-left:3rem}.ml-auto{margin-left:auto}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.block{display:block}.inline{display:inline}.flex{display:flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-1\.5{height:.375rem}.h-full{height:100%}.max-h-64{max-height:16rem}.min-h-screen{min-height:100vh}.w-full{width:100%}.max-w-\[1280px\]{max-width:1280px}.max-w-\[1440px\]{max-width:1440px}.max-w-\[34ch\]{max-width:34ch}.max-w-xl{max-width:36rem}.flex-1{flex:1 1 0%}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.resize{resize:both}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-\[3rem_1fr_auto\]{grid-template-columns:3rem 1fr auto}.grid-cols-\[68px_84px_1fr\]{grid-template-columns:68px 84px 1fr}.grid-cols-\[68px_84px_1fr_auto\]{grid-template-columns:68px 84px 1fr auto}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-10{gap:2.5rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.gap-px{gap:1px}.self-start{align-self:flex-start}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.border{border-width:1px}.border-b{border-bottom-width:1px}.px-10{padding-left:2.5rem;padding-right:2.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-5{padding-bottom:1.25rem}.pr-2{padding-right:.5rem}.text-left{text-align:left}.text-center{text-align:center}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-normal{font-weight:400}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}:root{--bg: #0c1628;--bg-elevated: #142340;--bg-sunken: #070d18;--fg: #f2f7fc;--fg-muted: #a4b0c2;--fg-dim: #7d8ba3;--border: #1f3a66;--border-strong: #7aa7dc;--border-accent: #c9a048;--accent-sky: #7aa7dc;--accent-sky-hover: #a8c8ea;--accent-gold: #dcb866;--accent-gold-hover: #ead08e;--vow-green: #6a9b8f;--wane: #b8802f;--break-red: #a85a5a;--seer-violet: #7a6db0;--radius-1: 4px;--radius-2: 6px;--radius-3: 10px;--serif: "Instrument Serif", "Times New Roman", serif;--mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace}html,body{background:var(--bg);color:var(--fg);font-family:var(--mono);font-feature-settings:"ss01" on,"ss02" on,"cv01" on}#root{min-height:100vh}.j-label{font-family:var(--mono);font-size:11px;letter-spacing:.14em;text-transform:uppercase;font-weight:500;color:var(--fg-dim)}.j-display{font-family:var(--serif);font-weight:400;letter-spacing:0;line-height:1.05}.j-mono{font-family:var(--mono)}.j-rule{height:1px;background:var(--border)}.j-card{background:var(--bg-elevated);border:1px solid var(--border);border-radius:var(--radius-2)}.j-card-bare{background:transparent;border:1px solid var(--border);border-radius:var(--radius-2)}button:focus-visible,input:focus-visible,textarea:focus-visible{outline:1px solid var(--accent-sky);outline-offset:2px}.xterm,.xterm-viewport,.xterm-screen{width:100%!important}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-80:hover{opacity:.8}.hover\:opacity-90:hover{opacity:.9}.disabled\:cursor-default:disabled{cursor:default}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}@media (min-width: 768px){.md\:grid-cols-\[140px_1fr_auto\]{grid-template-columns:140px 1fr auto}.md\:gap-4{gap:1rem}}@media (min-width: 1024px){.lg\:col-span-5{grid-column:span 5 / span 5}.lg\:col-span-7{grid-column:span 7 / span 7}}@media (min-width: 1280px){.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}
@@ -1,75 +1,19 @@
1
1
  <!doctype html>
2
- <html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>jinn operator</title>
3
- <style>
4
- body{background:#0b1020;color:#d5def5;font-family:ui-monospace,Menlo,monospace;padding:16px} .grid{display:grid;gap:12px;grid-template-columns:1fr}
5
- @media (min-width:900px){.grid{grid-template-columns:1fr 1fr}.full{grid-column:1/-1}}
6
- .card{border:1px solid #28314e;background:#101933;border-radius:8px;padding:12px}.row{display:flex;justify-content:space-between;gap:8px}.muted{color:#8ea0c9;font-size:12px}
7
- table{width:100%;border-collapse:collapse}th,td{border-bottom:1px solid #28314e;padding:4px 0;text-align:left;font-size:12px}
8
- .badge{border:1px solid #3c4f85;padding:2px 6px;border-radius:10px}.ok{color:#6ee7b7}.err{color:#fca5a5}.toast{position:fixed;right:12px;bottom:12px;background:#1f2b4d;padding:8px 10px;border-radius:6px;display:none}
9
- button{background:#3758c7;color:#fff;border:0;border-radius:6px;padding:6px 8px;cursor:pointer}
10
- </style></head><body>
11
- <div class="row"><h1>jinn operator</h1><div><span id="network" class="badge">network</span> <span id="health">...</span> <button id="refresh">Refresh now</button></div></div>
12
- <div class="muted" id="meta">last poll --</div>
13
- <div class="grid">
14
- <section class="card full"><h3>In-flight intents</h3><div id="inflight"></div></section>
15
- <section class="card full"><h3>Recent verdicts</h3><div id="verdicts"></div></section>
16
- <section class="card"><h3>Earnings</h3><div id="earnings"></div></section>
17
- <section class="card"><h3>Fleet</h3><div id="fleet"></div></section>
18
- <section class="card"><h3>Master gas</h3><div id="gas"></div></section>
19
- <section class="card"><h3>Recent activity</h3><div id="activity"></div></section>
20
- <section class="card full"><h3>Next actions</h3><div id="actions"></div></section>
21
- </div>
22
- <div id="footer" class="muted"></div><div id="toast" class="toast">Copied</div>
23
- <script>
24
- const POLL_MS=5000; let lastPayload=null;
25
- const $=(id)=>document.getElementById(id);
26
- const trunc=(v)=>!v?'--':(v.length<12?v:v.slice(0,6)+'...'+v.slice(-4));
27
- const esc=(s)=>String(s==null?'':s).replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;');
28
- const H=(html)=>({__html:html});
29
- const cell=(c)=>(c&&typeof c==='object'&&typeof c.__html==='string')?c.__html:esc(String(c));
30
- const explorer=(network,kind,val)=>network==='mainnet'?`https://basescan.org/${kind}/${encodeURIComponent(String(val))}`:`https://sepolia.basescan.org/${kind}/${encodeURIComponent(String(val))}`;
31
- function copy(text){navigator.clipboard.writeText(String(text));const t=$('toast');t.style.display='block';setTimeout(()=>t.style.display='none',1500);}
32
- function link(network,kind,val){
33
- if(!val)return esc('--');
34
- const u=explorer(network,kind,val);
35
- const t=esc(trunc(val));
36
- return H(`<a href="${esc(u)}" target="_blank" rel="noopener">${t}</a> <button type="button" class="jinn-copy" data-c="${encodeURIComponent(String(val))}">copy</button>`);
37
- }
38
- function table(headers,rows){
39
- return '<table><thead><tr>'+headers.map(h=>'<th>'+esc(h)+'</th>').join('')+'</tr></thead><tbody>'+
40
- rows.map(r=>'<tr>'+r.map(c=>'<td>'+cell(c)+'</td>').join('')+'</tr>').join('')+'</tbody></table>';
41
- }
42
- function render(d){
43
- lastPayload=d; const net=d.fleet?.chain==='base'?'mainnet':'testnet';
44
- $('network').textContent=net; $('health').textContent=d.rpc?.ok?'healthy':'rpc error'; $('health').className=d.rpc?.ok?'ok':'err';
45
- $('meta').textContent='last poll '+new Date().toISOString()+' | chain '+(d.rpc?.chainId??'-')+' block '+(d.rpc?.blockNumber??'-');
46
- const inflight=(d.portfolioV0?.inFlight??[]).map(i=>[
47
- trunc(i.requestId),i.state,i.implName??'-',
48
- new Date(i.windowStartTs).toISOString().slice(11,19)+'→'+new Date(i.windowEndTs).toISOString().slice(11,19),
49
- new Date(i.stateUpdatedAt).toISOString().slice(11,19),i.lastError??'-'
50
- ]);
51
- $('inflight').innerHTML=inflight.length?table(['requestId','state','impl','window','updated','error'],inflight):'No in-flight intents';
52
- const verdicts=(d.portfolioV0?.verdicts??[]).map(v=>[v.outcome,link(net,'tx',v.deliveryTxHash||''),v.manifestCid??'-']);
53
- $('verdicts').innerHTML=verdicts.length?table(['outcome','delivery tx','manifest'],verdicts):'No verdicts';
54
- const pend=d.rewards?.pendingStakingRewardsWei??'0'; const lc=d.rewards?.lastClaimTickAt??'--';
55
- $('earnings').innerHTML='pending '+esc(pend)+'<br>last claim '+esc(lc);
56
- $('fleet').innerHTML=table(['#','step','serviceId','safe'],(d.fleet?.services??[]).map(s=>[s.index,s.step,s.serviceId??'-',link(net,'address',s.safeAddress||'')]));
57
- const gas=link(net,'address',d.masterGas?.address||'');
58
- $('gas').innerHTML='master '+cell(gas)+'<br>balance '+esc(d.masterGas?.balanceWei??'0')+'<br>runway '+esc(d.masterGas?.runwayDaysExcess??'--')+' days';
59
- const act=(d.activity?.recent??[]).slice(0,20).map(a=>[(a.ts??'').slice(11,19),a.kind,trunc(a.requestId),a.txHash?link(net,'tx',a.txHash):'-']);
60
- $('activity').innerHTML=table(['time','kind','req','tx'],act);
61
- $('actions').innerHTML=(d.nextActions??[]).map(a=>'<div class="row"><span>'+esc(a)+'</span> <button type="button" class="jinn-copy" data-c="'+encodeURIComponent(a)+'">copy</button></div>').join('')||'No actions';
62
- $('footer').textContent='DAEMON '+(d.daemon?.version??'v0.0.0')+' · commit '+(d.daemon?.commit??'unknown');
63
- }
64
- async function poll(){
65
- try{
66
- const r=await fetch('/v1/status'); if(!r.ok) throw new Error(String(r.status));
67
- render(await r.json());
68
- }catch(e){
69
- if(lastPayload) render(lastPayload);
70
- $('health').textContent='fetch error'; $('health').className='err';
71
- }
72
- }
73
- document.addEventListener('click',(e)=>{ const b=e.target && e.target.closest?e.target.closest('button.jinn-copy'):null; if(b){ const x=b.getAttribute('data-c'); if(x) try{ copy(decodeURIComponent(x));}catch{}} );
74
- document.addEventListener('DOMContentLoaded',()=>{ $('refresh').onclick=()=>poll(); poll(); setInterval(poll,POLL_MS); });
75
- </script></body></html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>jinn operator</title>
7
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
8
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
9
+ <link
10
+ href="https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=JetBrains+Mono:wght@400;500;600&display=swap"
11
+ rel="stylesheet"
12
+ />
13
+ <script type="module" crossorigin src="/assets/index-Bxlk5qpa.js"></script>
14
+ <link rel="stylesheet" crossorigin href="/assets/index-DQ3u_vP5.css">
15
+ </head>
16
+ <body>
17
+ <div id="root"></div>
18
+ </body>
19
+ </html>
@@ -0,0 +1,133 @@
1
+ /**
2
+ * ERC-8004 IdentityRegistry → Safe wallet binding (jinn-mono-aev).
3
+ *
4
+ * Calls `IdentityRegistry.setAgentWallet(agentId, safe, deadline, signature)`
5
+ * from the agent EOA (the NFT owner). The contract recovers `signature`
6
+ * against the *new* wallet (the Safe) — which is a smart-contract wallet,
7
+ * so the call falls through ECDSA and lands in the ERC-1271
8
+ * `IERC1271.isValidSignature(digest, signature)` path on the Safe.
9
+ *
10
+ * Signing flow (Safe v1.3+ / 1.4.x, single-owner threshold-1):
11
+ * 1. Build the IdentityRegistry EIP-712 typed-data digest.
12
+ * Domain: ("ERC8004IdentityRegistry", "1", chainId, verifyingContract).
13
+ * Type: AgentWalletSet(uint256 agentId, address newWallet,
14
+ * address owner, uint256 deadline).
15
+ * Mirrors `_hashTypedDataV4(structHash)` in the contract.
16
+ * 2. Wrap that digest in Safe's SafeMessage typed-data.
17
+ * Domain: (chainId, verifyingContract = safeAddress)
18
+ * — Safe v1.3+ uses chainId-only domain (no name/version).
19
+ * Type: SafeMessage(bytes message) with message = digest (bytes32 → bytes).
20
+ * The result is the `safeMessageHash` Safe verifies signatures against.
21
+ * 3. Sign `safeMessageHash` with raw ECDSA (NO eth_sign \x19 prefix —
22
+ * the SafeMessage typed-data wrap *is* the EIP-712 envelope).
23
+ * The agent EOA is the sole owner of the Safe.
24
+ * 4. Pack the 65-byte contract-signature blob: r ‖ s ‖ v with v in {27,28}.
25
+ * Safe's `checkSignatures` accepts this as an "ECDSA owner signature
26
+ * over the SafeMessage hash" path (no `+4` adjustment — that variant
27
+ * is for `eth_sign`-prefixed signatures over the raw safeTxHash, not
28
+ * the EIP-712 SafeMessage path).
29
+ *
30
+ * On-chain effect: `IdentityRegistry.getAgentWallet(agentId) == safeAddress`.
31
+ *
32
+ * Idempotency: the caller (bootstrap) gates this with `safe_bound_to_agent`.
33
+ * If the binding has already happened, do not call again — the contract
34
+ * enforces `MAX_DEADLINE_DELAY = 5 minutes`, so re-running with a stale
35
+ * signature reverts; re-running with a fresh signature is harmless but
36
+ * wasteful.
37
+ *
38
+ * See:
39
+ * - /tmp/erc8004-ref/IdentityRegistryUpgradeable.sol :: setAgentWallet
40
+ * - docs/superpowers/specs/2026-04-27-erc-8004-entity-model-design.md §4.1
41
+ * - jinn-mono-j07 (mint), jinn-mono-aev (this binding)
42
+ */
43
+ import { type Address, type Hex, type PublicClient, type WalletClient } from 'viem';
44
+ import type { PrivateKeyAccount } from 'viem/accounts';
45
+ export interface BindAgentWalletArgs {
46
+ /** ERC-8004 IdentityRegistry contract (vanity 0x8004…). */
47
+ identityRegistryAddress: Address;
48
+ /** The agent NFT id minted by `IdentityRegistry.register()`. */
49
+ agentId: bigint;
50
+ /** The Safe smart-contract wallet to bind as the agent's wallet. */
51
+ safeAddress: Address;
52
+ /**
53
+ * The agent EOA — owner of the NFT and (for our deployment topology)
54
+ * sole owner of `safeAddress`. Used to ECDSA-sign the SafeMessage hash
55
+ * AND to send the on-chain `setAgentWallet` tx (msg.sender must be NFT
56
+ * owner / approved / operator).
57
+ */
58
+ agentEoaAccount: PrivateKeyAccount;
59
+ /** Wallet client bound to `agentEoaAccount` for tx submission. */
60
+ agentEoaWalletClient: WalletClient;
61
+ /** Public client for chain reads + receipt waits. */
62
+ publicClient: PublicClient;
63
+ /** EVM chainId — used in both EIP-712 domains. */
64
+ chainId: number;
65
+ /**
66
+ * Unix-seconds deadline. Default = now + 4 minutes (under the contract's
67
+ * 5-minute cap). The contract requires `block.timestamp <= deadline` AND
68
+ * `deadline <= block.timestamp + 5 minutes`.
69
+ */
70
+ deadline?: bigint;
71
+ }
72
+ export interface BindAgentWalletResult {
73
+ txHash: Hex;
74
+ /** Final EIP-712 digest the IdentityRegistry checks against. */
75
+ identityDigest: Hex;
76
+ /** SafeMessage hash the Safe's `checkSignatures` recovers against. */
77
+ safeMessageHash: Hex;
78
+ /** 65-byte contract-signature blob passed to `setAgentWallet`. */
79
+ signature: Hex;
80
+ /** Deadline actually used. */
81
+ deadline: bigint;
82
+ }
83
+ /**
84
+ * Build the IdentityRegistry EIP-712 digest exactly as the contract's
85
+ * `_hashTypedDataV4(structHash)` would produce it.
86
+ *
87
+ * Exposed for tests + symmetry; the main entry point uses this internally.
88
+ */
89
+ export declare function buildIdentityDigest(args: {
90
+ identityRegistryAddress: Address;
91
+ chainId: number;
92
+ agentId: bigint;
93
+ newWallet: Address;
94
+ owner: Address;
95
+ deadline: bigint;
96
+ }): Hex;
97
+ /**
98
+ * Build the Safe SafeMessage hash that an owner signs to satisfy the
99
+ * Safe's ERC-1271 `isValidSignature(_dataHash, _signature)` for
100
+ * `_dataHash = identityDigest`.
101
+ *
102
+ * Safe v1.3+ uses a chainId-only EIP-712 domain (no name/version):
103
+ * keccak256("EIP712Domain(uint256 chainId,address verifyingContract)")
104
+ * Type:
105
+ * keccak256("SafeMessage(bytes message)")
106
+ * Message bytes:
107
+ * the 32-byte identityDigest, hashed once by the type-encoder
108
+ * (`bytes` is dynamic → keccak256 of contents).
109
+ */
110
+ export declare function buildSafeMessageHash(args: {
111
+ safeAddress: Address;
112
+ chainId: number;
113
+ identityDigest: Hex;
114
+ }): Hex;
115
+ /**
116
+ * Pack the Safe contract-signature blob from a raw ECDSA signature.
117
+ *
118
+ * Safe's `checkSignatures` for an EIP-712 SafeMessage owner signature
119
+ * expects 65 bytes `r ‖ s ‖ v` with `v ∈ {27,28}`. (The `v + 4` adjustment
120
+ * applies to the `eth_sign` variant where the owner signed
121
+ * `\x19Ethereum Signed Message:\n32 ‖ safeTxHash` rather than the EIP-712
122
+ * SafeMessage hash directly. We're on the EIP-712 path here.)
123
+ */
124
+ export declare function packSafeOwnerSignature(rawSig: Hex): Hex;
125
+ /**
126
+ * Bind a Safe wallet to an ERC-8004 agent NFT via `setAgentWallet`.
127
+ *
128
+ * Single-owner Safe assumption: `safeAddress` has exactly one owner —
129
+ * `agentEoaAccount` — with threshold = 1. For multi-owner Safes the
130
+ * signature blob would need to be sorted+concatenated owner sigs; not
131
+ * supported here (out of scope; bootstrap only deploys 1-of-1 Safes).
132
+ */
133
+ export declare function bindAgentWalletToSafe(args: BindAgentWalletArgs): Promise<BindAgentWalletResult>;
@@ -0,0 +1,202 @@
1
+ /**
2
+ * ERC-8004 IdentityRegistry → Safe wallet binding (jinn-mono-aev).
3
+ *
4
+ * Calls `IdentityRegistry.setAgentWallet(agentId, safe, deadline, signature)`
5
+ * from the agent EOA (the NFT owner). The contract recovers `signature`
6
+ * against the *new* wallet (the Safe) — which is a smart-contract wallet,
7
+ * so the call falls through ECDSA and lands in the ERC-1271
8
+ * `IERC1271.isValidSignature(digest, signature)` path on the Safe.
9
+ *
10
+ * Signing flow (Safe v1.3+ / 1.4.x, single-owner threshold-1):
11
+ * 1. Build the IdentityRegistry EIP-712 typed-data digest.
12
+ * Domain: ("ERC8004IdentityRegistry", "1", chainId, verifyingContract).
13
+ * Type: AgentWalletSet(uint256 agentId, address newWallet,
14
+ * address owner, uint256 deadline).
15
+ * Mirrors `_hashTypedDataV4(structHash)` in the contract.
16
+ * 2. Wrap that digest in Safe's SafeMessage typed-data.
17
+ * Domain: (chainId, verifyingContract = safeAddress)
18
+ * — Safe v1.3+ uses chainId-only domain (no name/version).
19
+ * Type: SafeMessage(bytes message) with message = digest (bytes32 → bytes).
20
+ * The result is the `safeMessageHash` Safe verifies signatures against.
21
+ * 3. Sign `safeMessageHash` with raw ECDSA (NO eth_sign \x19 prefix —
22
+ * the SafeMessage typed-data wrap *is* the EIP-712 envelope).
23
+ * The agent EOA is the sole owner of the Safe.
24
+ * 4. Pack the 65-byte contract-signature blob: r ‖ s ‖ v with v in {27,28}.
25
+ * Safe's `checkSignatures` accepts this as an "ECDSA owner signature
26
+ * over the SafeMessage hash" path (no `+4` adjustment — that variant
27
+ * is for `eth_sign`-prefixed signatures over the raw safeTxHash, not
28
+ * the EIP-712 SafeMessage path).
29
+ *
30
+ * On-chain effect: `IdentityRegistry.getAgentWallet(agentId) == safeAddress`.
31
+ *
32
+ * Idempotency: the caller (bootstrap) gates this with `safe_bound_to_agent`.
33
+ * If the binding has already happened, do not call again — the contract
34
+ * enforces `MAX_DEADLINE_DELAY = 5 minutes`, so re-running with a stale
35
+ * signature reverts; re-running with a fresh signature is harmless but
36
+ * wasteful.
37
+ *
38
+ * See:
39
+ * - /tmp/erc8004-ref/IdentityRegistryUpgradeable.sol :: setAgentWallet
40
+ * - docs/superpowers/specs/2026-04-27-erc-8004-entity-model-design.md §4.1
41
+ * - jinn-mono-j07 (mint), jinn-mono-aev (this binding)
42
+ */
43
+ import { encodeFunctionData, hashTypedData, hexToBytes, } from 'viem';
44
+ import { IDENTITY_REGISTRY_ABI } from './contracts.js';
45
+ import { viemSendTransactionWithRetry, waitForTransactionReceiptWithRetry } from '../tx-retry.js';
46
+ /**
47
+ * IdentityRegistry contract enforces this. Default deadline is "now + 4
48
+ * minutes" — well under the cap, leaves wiggle for clock skew + slow RPCs.
49
+ */
50
+ const IDENTITY_MAX_DEADLINE_DELAY_SEC = 5 * 60;
51
+ const DEFAULT_DEADLINE_OFFSET_SEC = 4 * 60;
52
+ /**
53
+ * Build the IdentityRegistry EIP-712 digest exactly as the contract's
54
+ * `_hashTypedDataV4(structHash)` would produce it.
55
+ *
56
+ * Exposed for tests + symmetry; the main entry point uses this internally.
57
+ */
58
+ export function buildIdentityDigest(args) {
59
+ return hashTypedData({
60
+ domain: {
61
+ name: 'ERC8004IdentityRegistry',
62
+ version: '1',
63
+ chainId: args.chainId,
64
+ verifyingContract: args.identityRegistryAddress,
65
+ },
66
+ types: {
67
+ AgentWalletSet: [
68
+ { name: 'agentId', type: 'uint256' },
69
+ { name: 'newWallet', type: 'address' },
70
+ { name: 'owner', type: 'address' },
71
+ { name: 'deadline', type: 'uint256' },
72
+ ],
73
+ },
74
+ primaryType: 'AgentWalletSet',
75
+ message: {
76
+ agentId: args.agentId,
77
+ newWallet: args.newWallet,
78
+ owner: args.owner,
79
+ deadline: args.deadline,
80
+ },
81
+ });
82
+ }
83
+ /**
84
+ * Build the Safe SafeMessage hash that an owner signs to satisfy the
85
+ * Safe's ERC-1271 `isValidSignature(_dataHash, _signature)` for
86
+ * `_dataHash = identityDigest`.
87
+ *
88
+ * Safe v1.3+ uses a chainId-only EIP-712 domain (no name/version):
89
+ * keccak256("EIP712Domain(uint256 chainId,address verifyingContract)")
90
+ * Type:
91
+ * keccak256("SafeMessage(bytes message)")
92
+ * Message bytes:
93
+ * the 32-byte identityDigest, hashed once by the type-encoder
94
+ * (`bytes` is dynamic → keccak256 of contents).
95
+ */
96
+ export function buildSafeMessageHash(args) {
97
+ return hashTypedData({
98
+ domain: {
99
+ chainId: args.chainId,
100
+ verifyingContract: args.safeAddress,
101
+ },
102
+ types: {
103
+ SafeMessage: [{ name: 'message', type: 'bytes' }],
104
+ },
105
+ primaryType: 'SafeMessage',
106
+ message: {
107
+ message: args.identityDigest,
108
+ },
109
+ });
110
+ }
111
+ /**
112
+ * Pack the Safe contract-signature blob from a raw ECDSA signature.
113
+ *
114
+ * Safe's `checkSignatures` for an EIP-712 SafeMessage owner signature
115
+ * expects 65 bytes `r ‖ s ‖ v` with `v ∈ {27,28}`. (The `v + 4` adjustment
116
+ * applies to the `eth_sign` variant where the owner signed
117
+ * `\x19Ethereum Signed Message:\n32 ‖ safeTxHash` rather than the EIP-712
118
+ * SafeMessage hash directly. We're on the EIP-712 path here.)
119
+ */
120
+ export function packSafeOwnerSignature(rawSig) {
121
+ const bytes = hexToBytes(rawSig);
122
+ if (bytes.length !== 65) {
123
+ throw new Error(`Expected 65-byte ECDSA signature, got ${bytes.length} bytes`);
124
+ }
125
+ const v = bytes[64];
126
+ if (v !== 27 && v !== 28) {
127
+ // viem's account.sign returns v ∈ {27,28} for legacy sigs; bail loudly
128
+ // if a yParity-only blob (v ∈ {0,1}) ever leaks through.
129
+ throw new Error(`Unexpected v byte ${v} in ECDSA signature; Safe owner sig requires v in {27,28}`);
130
+ }
131
+ // Already in the right shape — Safe accepts r||s||v as-is.
132
+ return rawSig;
133
+ }
134
+ /**
135
+ * Bind a Safe wallet to an ERC-8004 agent NFT via `setAgentWallet`.
136
+ *
137
+ * Single-owner Safe assumption: `safeAddress` has exactly one owner —
138
+ * `agentEoaAccount` — with threshold = 1. For multi-owner Safes the
139
+ * signature blob would need to be sorted+concatenated owner sigs; not
140
+ * supported here (out of scope; bootstrap only deploys 1-of-1 Safes).
141
+ */
142
+ export async function bindAgentWalletToSafe(args) {
143
+ const { identityRegistryAddress, agentId, safeAddress, agentEoaAccount, agentEoaWalletClient, publicClient, chainId, } = args;
144
+ // 1. Pick a deadline within the contract's 5-minute window. Use chain time
145
+ // rather than wall-clock time so forked/local chains that mine many blocks do
146
+ // not reject otherwise-fresh signatures as expired.
147
+ const latestBlock = await publicClient.getBlock();
148
+ const nowSec = latestBlock.timestamp;
149
+ const deadline = args.deadline ?? nowSec + BigInt(DEFAULT_DEADLINE_OFFSET_SEC);
150
+ const maxDeadline = nowSec + BigInt(IDENTITY_MAX_DEADLINE_DELAY_SEC);
151
+ if (deadline > maxDeadline) {
152
+ throw new Error(`Deadline ${deadline} exceeds IdentityRegistry MAX_DEADLINE_DELAY ` +
153
+ `(now=${nowSec}, max=${maxDeadline}). Pass a deadline ≤ now + 5 minutes.`);
154
+ }
155
+ if (deadline < nowSec) {
156
+ throw new Error(`Deadline ${deadline} is in the past (now=${nowSec})`);
157
+ }
158
+ // 2. Build the IdentityRegistry digest the contract will check against.
159
+ const identityDigest = buildIdentityDigest({
160
+ identityRegistryAddress,
161
+ chainId,
162
+ agentId,
163
+ newWallet: safeAddress,
164
+ owner: agentEoaAccount.address,
165
+ deadline,
166
+ });
167
+ // 3. Wrap in SafeMessage typed-data — this is what the Safe's
168
+ // `isValidSignature` will recover signatures against.
169
+ const safeMessageHash = buildSafeMessageHash({
170
+ safeAddress,
171
+ chainId,
172
+ identityDigest,
173
+ });
174
+ // 4. Raw ECDSA-sign the SafeMessage hash with the agent EOA (sole owner).
175
+ // `account.sign({ hash })` produces a 65-byte sig with v ∈ {27,28} —
176
+ // no eth_sign prefix; the EIP-712 wrap above is the envelope.
177
+ const rawSig = await agentEoaAccount.sign({ hash: safeMessageHash });
178
+ const signature = packSafeOwnerSignature(rawSig);
179
+ // 5. Submit `setAgentWallet` from the agent EOA (NFT owner).
180
+ const data = encodeFunctionData({
181
+ abi: IDENTITY_REGISTRY_ABI,
182
+ functionName: 'setAgentWallet',
183
+ args: [agentId, safeAddress, deadline, signature],
184
+ });
185
+ const txHash = await viemSendTransactionWithRetry(agentEoaWalletClient, publicClient, {
186
+ account: agentEoaAccount,
187
+ to: identityRegistryAddress,
188
+ data,
189
+ });
190
+ const receipt = await waitForTransactionReceiptWithRetry(publicClient, txHash);
191
+ if (receipt.status !== 'success') {
192
+ throw new Error(`IdentityRegistry.setAgentWallet() reverted (agentId=${agentId}, safe=${safeAddress}, tx=${txHash})`);
193
+ }
194
+ return {
195
+ txHash,
196
+ identityDigest,
197
+ safeMessageHash,
198
+ signature,
199
+ deadline,
200
+ };
201
+ }
202
+ //# sourceMappingURL=agent-wallet-binding.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-wallet-binding.js","sourceRoot":"","sources":["../../src/earning/agent-wallet-binding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,UAAU,GAKX,MAAM,MAAM,CAAC;AAEd,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,4BAA4B,EAAE,kCAAkC,EAAE,MAAM,gBAAgB,CAAC;AAElG;;;GAGG;AACH,MAAM,+BAA+B,GAAG,CAAC,GAAG,EAAE,CAAC;AAC/C,MAAM,2BAA2B,GAAG,CAAC,GAAG,EAAE,CAAC;AA0C3C;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAOnC;IACC,OAAO,aAAa,CAAC;QACnB,MAAM,EAAE;YACN,IAAI,EAAE,yBAAyB;YAC/B,OAAO,EAAE,GAAG;YACZ,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,iBAAiB,EAAE,IAAI,CAAC,uBAAuB;SAChD;QACD,KAAK,EAAE;YACL,cAAc,EAAE;gBACd,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;gBACpC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE;gBACtC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE;gBAClC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE;aACtC;SACF;QACD,WAAW,EAAE,gBAAgB;QAC7B,OAAO,EAAE;YACP,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB;KACF,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAIpC;IACC,OAAO,aAAa,CAAC;QACnB,MAAM,EAAE;YACN,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,iBAAiB,EAAE,IAAI,CAAC,WAAW;SACpC;QACD,KAAK,EAAE;YACL,WAAW,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;SAClD;QACD,WAAW,EAAE,aAAa;QAC1B,OAAO,EAAE;YACP,OAAO,EAAE,IAAI,CAAC,cAAc;SAC7B;KACF,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,sBAAsB,CAAC,MAAW;IAChD,MAAM,KAAK,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;IACjC,IAAI,KAAK,CAAC,MAAM,KAAK,EAAE,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,yCAAyC,KAAK,CAAC,MAAM,QAAQ,CAAC,CAAC;IACjF,CAAC;IACD,MAAM,CAAC,GAAG,KAAK,CAAC,EAAE,CAAE,CAAC;IACrB,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC;QACzB,uEAAuE;QACvE,yDAAyD;QACzD,MAAM,IAAI,KAAK,CACb,qBAAqB,CAAC,2DAA2D,CAClF,CAAC;IACJ,CAAC;IACD,2DAA2D;IAC3D,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,IAAyB;IAEzB,MAAM,EACJ,uBAAuB,EACvB,OAAO,EACP,WAAW,EACX,eAAe,EACf,oBAAoB,EACpB,YAAY,EACZ,OAAO,GACR,GAAG,IAAI,CAAC;IAET,2EAA2E;IAC3E,8EAA8E;IAC9E,oDAAoD;IACpD,MAAM,WAAW,GAAG,MAAM,YAAY,CAAC,QAAQ,EAAE,CAAC;IAClD,MAAM,MAAM,GAAG,WAAW,CAAC,SAAS,CAAC;IACrC,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,MAAM,GAAG,MAAM,CAAC,2BAA2B,CAAC,CAAC;IAC/E,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,CAAC,+BAA+B,CAAC,CAAC;IACrE,IAAI,QAAQ,GAAG,WAAW,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CACb,YAAY,QAAQ,+CAA+C;YACnE,QAAQ,MAAM,SAAS,WAAW,uCAAuC,CAC1E,CAAC;IACJ,CAAC;IACD,IAAI,QAAQ,GAAG,MAAM,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,YAAY,QAAQ,wBAAwB,MAAM,GAAG,CAAC,CAAC;IACzE,CAAC;IAED,wEAAwE;IACxE,MAAM,cAAc,GAAG,mBAAmB,CAAC;QACzC,uBAAuB;QACvB,OAAO;QACP,OAAO;QACP,SAAS,EAAE,WAAW;QACtB,KAAK,EAAE,eAAe,CAAC,OAAO;QAC9B,QAAQ;KACT,CAAC,CAAC;IAEH,8DAA8D;IAC9D,yDAAyD;IACzD,MAAM,eAAe,GAAG,oBAAoB,CAAC;QAC3C,WAAW;QACX,OAAO;QACP,cAAc;KACf,CAAC,CAAC;IAEH,0EAA0E;IAC1E,wEAAwE;IACxE,iEAAiE;IACjE,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC,CAAC;IACrE,MAAM,SAAS,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAEjD,6DAA6D;IAC7D,MAAM,IAAI,GAAG,kBAAkB,CAAC;QAC9B,GAAG,EAAE,qBAAqB;QAC1B,YAAY,EAAE,gBAAgB;QAC9B,IAAI,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,CAAC;KAClD,CAAQ,CAAC;IAEV,MAAM,MAAM,GAAG,MAAM,4BAA4B,CAC/C,oBAAoB,EACpB,YAAY,EACZ;QACE,OAAO,EAAE,eAAe;QACxB,EAAE,EAAE,uBAAuB;QAC3B,IAAI;KACL,CACF,CAAC;IAEF,MAAM,OAAO,GAAG,MAAM,kCAAkC,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;IAC/E,IAAI,OAAO,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CACb,uDAAuD,OAAO,UAAU,WAAW,QAAQ,MAAM,GAAG,CACrG,CAAC;IACJ,CAAC;IAED,OAAO;QACL,MAAM;QACN,cAAc;QACd,eAAe;QACf,SAAS;QACT,QAAQ;KACT,CAAC;AACJ,CAAC"}
@@ -5,6 +5,7 @@
5
5
  * Phase 2 (per-service): derive agent → stake → deploy mech
6
6
  */
7
7
  import type { FleetState, FleetBootstrapResult } from './types.js';
8
+ import { requestTestnetFunding } from './faucet.js';
8
9
  export interface FleetBootstrapperOptions {
9
10
  earningDir?: string;
10
11
  chain?: 'base' | 'base-sepolia';
@@ -21,11 +22,26 @@ export interface FleetBootstrapperOptions {
21
22
  debug?: boolean;
22
23
  /** Estimated master gas per day (wei) for runway warnings. */
23
24
  masterEthDailyEstimateWei?: bigint | string;
25
+ /** Optional bootstrap/top-up target override (wei). */
26
+ minEoaGasWei?: string;
27
+ /** Optional Safe ETH target override (wei). */
28
+ minSafeEthWei?: string;
24
29
  /**
25
30
  * When `masterEthDailyEstimateWei` is unset, blends a conservative daily estimate
26
31
  * from poll frequency (config.pollIntervalMs).
27
32
  */
28
33
  pollIntervalMs?: number;
34
+ /**
35
+ * Injectable faucet function — defaults to {@link requestTestnetFunding}.
36
+ * Provided in tests to avoid hitting the real CDP endpoint.
37
+ */
38
+ requestFunding?: typeof requestTestnetFunding;
39
+ /**
40
+ * When true, bootstrap may request Base Sepolia faucet drips before returning
41
+ * an awaiting-funding result. `jinn run` disables this so the panel can make
42
+ * testnet funding an explicit operator action.
43
+ */
44
+ autoTestnetFaucet?: boolean;
29
45
  }
30
46
  export declare class FleetBootstrapper {
31
47
  private readonly store;
@@ -37,6 +53,8 @@ export declare class FleetBootstrapper {
37
53
  private readonly debug;
38
54
  private readonly masterEthDailyEstimateWei;
39
55
  private readonly env;
56
+ private readonly requestFunding;
57
+ private readonly autoTestnetFaucet;
40
58
  constructor(options?: FleetBootstrapperOptions);
41
59
  getStatus(): Promise<FleetState>;
42
60
  /**
@@ -64,6 +82,41 @@ export declare class FleetBootstrapper {
64
82
  private stepStolasStake;
65
83
  private recoverEvictedService;
66
84
  private stepDeployMech;
85
+ /**
86
+ * ERC-8004 IdentityRegistry mint + Safe wallet bind (jinn-mono-j07,
87
+ * jinn-mono-aev).
88
+ *
89
+ * Two on-chain effects, gated independently for idempotency:
90
+ *
91
+ * 1. **Mint** (jinn-mono-j07): one operator agent NFT per service Safe;
92
+ * the agent EOA owns the token. Persists `agent_id` (and metadata)
93
+ * to state immediately after the receipt parses, so a crash between
94
+ * register and the subsequent `setAgentWallet` does not lose the
95
+ * token. v0 uses an empty `agentURI` — operators are expected to
96
+ * populate it later via `setAgentURI`. Re-run with `svc.agent_id`
97
+ * already set short-circuits the mint.
98
+ *
99
+ * 2. **Bind** (jinn-mono-aev): `IdentityRegistry.setAgentWallet(agentId,
100
+ * safe, deadline, sig)` from the agent EOA. The contract recovers
101
+ * `sig` against the Safe via ERC-1271; we wrap the EIP-712
102
+ * AgentWalletSet digest in Safe's SafeMessage typed-data and
103
+ * raw-ECDSA-sign with the sole owner (= agent EOA). On success,
104
+ * `safe_bound_to_agent` flips to true. Re-run with
105
+ * `svc.safe_bound_to_agent` already true short-circuits the bind.
106
+ * See `agent-wallet-binding.ts` + spec §4.1.
107
+ *
108
+ * The bind is a discrete operational state (`safe_binding_pending`) because
109
+ * the service is already staked and runnable once the mint exists. A failed
110
+ * binding should be visible and resumable, but should not block the daemon
111
+ * from reaching the running dashboard.
112
+ */
113
+ private stepRegisterAgent;
114
+ /**
115
+ * Tiny store wrapper: re-loads the service row after `updateService` so
116
+ * the next sub-step sees the latest persisted shape (including any
117
+ * fields written by sibling code paths since this fn started).
118
+ */
119
+ private firstServiceUpdate;
67
120
  private stepSelfBondSetup;
68
121
  private stepSelfBondCreateService;
69
122
  private stepSelfBondActivateService;
@@ -74,9 +127,20 @@ export declare class FleetBootstrapper {
74
127
  private getServiceState;
75
128
  private waitForSuccessfulTx;
76
129
  private stolasPreflightCheck;
130
+ private stakingAddressForService;
131
+ private shouldPreserveExistingSetup;
77
132
  private getStakingState;
78
133
  private parseServiceIdFromReceipt;
79
134
  private parseMultisigFromReceipt;
135
+ /**
136
+ * Extract `agentId` from an `IdentityRegistry.Registered` log emitted in
137
+ * the receipt. Filters by `(address, topic[0])` first to avoid colliding
138
+ * with any other contract that happens to share the event signature.
139
+ *
140
+ * Returns the agentId as a decimal string (uint256) so it round-trips
141
+ * cleanly through JSON-persisted EarningState.
142
+ */
143
+ private parseAgentIdFromReceipt;
80
144
  }
81
145
  /** @deprecated Use FleetBootstrapper */
82
146
  export declare const EarningBootstrapper: typeof FleetBootstrapper;