@agentsgot/agent-kit 0.0.0-stage → 1.0.0

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 (411) hide show
  1. package/ARCHITECTURE.md +5 -0
  2. package/README.md +13 -2
  3. package/dist/a2a.d.ts +35 -0
  4. package/dist/a2a.d.ts.map +1 -0
  5. package/dist/a2a.js +109 -0
  6. package/dist/a2a.js.map +1 -0
  7. package/dist/cli/binding.d.ts +24 -0
  8. package/dist/cli/binding.d.ts.map +1 -0
  9. package/dist/cli/binding.js +52 -0
  10. package/dist/cli/binding.js.map +1 -0
  11. package/dist/cli/commands.d.ts +18 -0
  12. package/dist/cli/commands.d.ts.map +1 -0
  13. package/dist/cli/commands.js +191 -0
  14. package/dist/cli/commands.js.map +1 -0
  15. package/dist/cli/context.d.ts +61 -0
  16. package/dist/cli/context.d.ts.map +1 -0
  17. package/dist/cli/context.js +147 -0
  18. package/dist/cli/context.js.map +1 -0
  19. package/dist/cli/doctor.d.ts +34 -0
  20. package/dist/cli/doctor.d.ts.map +1 -0
  21. package/dist/cli/doctor.js +109 -0
  22. package/dist/cli/doctor.js.map +1 -0
  23. package/dist/cli/home.d.ts +37 -0
  24. package/dist/cli/home.d.ts.map +1 -0
  25. package/dist/cli/home.js +77 -0
  26. package/dist/cli/home.js.map +1 -0
  27. package/dist/cli/index.d.ts +5 -0
  28. package/dist/cli/index.d.ts.map +1 -0
  29. package/dist/cli/index.js +120 -0
  30. package/dist/cli/index.js.map +1 -0
  31. package/dist/cli/install.d.ts +19 -0
  32. package/dist/cli/install.d.ts.map +1 -0
  33. package/dist/cli/install.js +64 -0
  34. package/dist/cli/install.js.map +1 -0
  35. package/dist/cli/keystore.d.ts +25 -0
  36. package/dist/cli/keystore.d.ts.map +1 -0
  37. package/dist/cli/keystore.js +57 -0
  38. package/dist/cli/keystore.js.map +1 -0
  39. package/dist/cli/mcp.d.ts +7 -0
  40. package/dist/cli/mcp.d.ts.map +1 -0
  41. package/dist/cli/mcp.js +28 -0
  42. package/dist/cli/mcp.js.map +1 -0
  43. package/dist/cli/prompt.d.ts +10 -0
  44. package/dist/cli/prompt.d.ts.map +1 -0
  45. package/dist/cli/prompt.js +71 -0
  46. package/dist/cli/prompt.js.map +1 -0
  47. package/dist/cli/reports.d.ts +42 -0
  48. package/dist/cli/reports.d.ts.map +1 -0
  49. package/dist/cli/reports.js +121 -0
  50. package/dist/cli/reports.js.map +1 -0
  51. package/dist/cli/run.d.ts +21 -0
  52. package/dist/cli/run.d.ts.map +1 -0
  53. package/dist/cli/run.js +125 -0
  54. package/dist/cli/run.js.map +1 -0
  55. package/dist/cli/wallet.d.ts +19 -0
  56. package/dist/cli/wallet.d.ts.map +1 -0
  57. package/dist/cli/wallet.js +58 -0
  58. package/dist/cli/wallet.js.map +1 -0
  59. package/dist/guides.d.ts +7 -0
  60. package/dist/guides.d.ts.map +1 -0
  61. package/dist/guides.js +94 -0
  62. package/dist/guides.js.map +1 -0
  63. package/dist/index.d.ts +20 -0
  64. package/dist/index.d.ts.map +1 -0
  65. package/dist/index.js +23 -0
  66. package/dist/index.js.map +1 -0
  67. package/dist/llm.d.ts +16 -0
  68. package/dist/llm.d.ts.map +1 -0
  69. package/dist/llm.js +30 -0
  70. package/dist/llm.js.map +1 -0
  71. package/dist/mcp/cli.d.ts +3 -0
  72. package/dist/mcp/cli.d.ts.map +1 -0
  73. package/dist/mcp/cli.js +6 -0
  74. package/dist/mcp/cli.js.map +1 -0
  75. package/dist/mcp/server.d.ts +38 -0
  76. package/dist/mcp/server.d.ts.map +1 -0
  77. package/dist/mcp/server.js +693 -0
  78. package/dist/mcp/server.js.map +1 -0
  79. package/dist/ports.d.ts +123 -0
  80. package/dist/ports.d.ts.map +1 -0
  81. package/dist/ports.js +134 -0
  82. package/dist/ports.js.map +1 -0
  83. package/dist/roles.d.ts +16 -0
  84. package/dist/roles.d.ts.map +1 -0
  85. package/dist/roles.js +49 -0
  86. package/dist/roles.js.map +1 -0
  87. package/dist/runner.d.ts +126 -0
  88. package/dist/runner.d.ts.map +1 -0
  89. package/dist/runner.js +292 -0
  90. package/dist/runner.js.map +1 -0
  91. package/dist/schedules.d.ts +34 -0
  92. package/dist/schedules.d.ts.map +1 -0
  93. package/dist/schedules.js +116 -0
  94. package/dist/schedules.js.map +1 -0
  95. package/dist/sdk/base64.d.ts +4 -0
  96. package/dist/sdk/base64.d.ts.map +1 -0
  97. package/dist/sdk/base64.js +15 -0
  98. package/dist/sdk/base64.js.map +1 -0
  99. package/dist/sdk/client.d.ts +198 -0
  100. package/dist/sdk/client.d.ts.map +1 -0
  101. package/dist/sdk/client.js +413 -0
  102. package/dist/sdk/client.js.map +1 -0
  103. package/dist/security.d.ts +10 -0
  104. package/dist/security.d.ts.map +1 -0
  105. package/dist/security.js +24 -0
  106. package/dist/security.js.map +1 -0
  107. package/dist/skills.d.ts +21 -0
  108. package/dist/skills.d.ts.map +1 -0
  109. package/dist/skills.js +93 -0
  110. package/dist/skills.js.map +1 -0
  111. package/dist/workers.d.ts +64 -0
  112. package/dist/workers.d.ts.map +1 -0
  113. package/dist/workers.js +127 -0
  114. package/dist/workers.js.map +1 -0
  115. package/dist/zip.d.ts +8 -0
  116. package/dist/zip.d.ts.map +1 -0
  117. package/dist/zip.js +80 -0
  118. package/dist/zip.js.map +1 -0
  119. package/docs/README.md +25 -0
  120. package/docs/architecture.md +18 -0
  121. package/docs/deployment.md +26 -0
  122. package/docs/reference/01-RULES.md +822 -0
  123. package/docs/reference/02-INTERFACES.md +487 -0
  124. package/docs/reference/03-STAKING-PENALTY-SPEC.md +739 -0
  125. package/docs/updates.md +61 -0
  126. package/docs/verification.md +72 -0
  127. package/package.json +87 -4
  128. package/skills/dist/agent-skills.json +68 -0
  129. package/skills/dist/arbitrator/SKILL.md +186 -0
  130. package/skills/dist/executor/SKILL.md +219 -0
  131. package/skills/dist/publisher/SKILL.md +172 -0
  132. package/skills/dist/tester/SKILL.md +198 -0
  133. package/vendor/shared/ARCHITECTURE.md +97 -0
  134. package/vendor/shared/README.md +5 -0
  135. package/vendor/shared/abi/index.js +2 -0
  136. package/vendor/shared/abi/index.ts +2 -0
  137. package/vendor/shared/abi/protocol/AgentRegistry.js +1623 -0
  138. package/vendor/shared/abi/protocol/AgentRegistry.json +1623 -0
  139. package/vendor/shared/abi/protocol/AgentRegistry.ts +1623 -0
  140. package/vendor/shared/abi/protocol/ArbitrationCaseProofVerifier.js +154 -0
  141. package/vendor/shared/abi/protocol/ArbitrationCaseProofVerifier.json +154 -0
  142. package/vendor/shared/abi/protocol/ArbitrationCaseProofVerifier.ts +154 -0
  143. package/vendor/shared/abi/protocol/ArbitrationCourt.js +1550 -0
  144. package/vendor/shared/abi/protocol/ArbitrationCourt.json +1550 -0
  145. package/vendor/shared/abi/protocol/ArbitrationCourt.ts +1550 -0
  146. package/vendor/shared/abi/protocol/ArbitrationPool.js +509 -0
  147. package/vendor/shared/abi/protocol/ArbitrationPool.json +509 -0
  148. package/vendor/shared/abi/protocol/ArbitrationPool.ts +509 -0
  149. package/vendor/shared/abi/protocol/ArbitrationProgressor.js +44 -0
  150. package/vendor/shared/abi/protocol/ArbitrationProgressor.json +44 -0
  151. package/vendor/shared/abi/protocol/ArbitrationProgressor.ts +44 -0
  152. package/vendor/shared/abi/protocol/ArbitrationSelection.js +1153 -0
  153. package/vendor/shared/abi/protocol/ArbitrationSelection.json +1153 -0
  154. package/vendor/shared/abi/protocol/ArbitrationSelection.ts +1153 -0
  155. package/vendor/shared/abi/protocol/ArbitrationSettlement.js +956 -0
  156. package/vendor/shared/abi/protocol/ArbitrationSettlement.json +956 -0
  157. package/vendor/shared/abi/protocol/ArbitrationSettlement.ts +956 -0
  158. package/vendor/shared/abi/protocol/ArbitrationStream.js +964 -0
  159. package/vendor/shared/abi/protocol/ArbitrationStream.json +964 -0
  160. package/vendor/shared/abi/protocol/ArbitrationStream.ts +964 -0
  161. package/vendor/shared/abi/protocol/EmissionController.js +1436 -0
  162. package/vendor/shared/abi/protocol/EmissionController.json +1436 -0
  163. package/vendor/shared/abi/protocol/EmissionController.ts +1436 -0
  164. package/vendor/shared/abi/protocol/HourlyAnchor.js +611 -0
  165. package/vendor/shared/abi/protocol/HourlyAnchor.json +611 -0
  166. package/vendor/shared/abi/protocol/HourlyAnchor.ts +611 -0
  167. package/vendor/shared/abi/protocol/IncentiveVault.js +480 -0
  168. package/vendor/shared/abi/protocol/IncentiveVault.json +480 -0
  169. package/vendor/shared/abi/protocol/IncentiveVault.ts +480 -0
  170. package/vendor/shared/abi/protocol/ParamRegistry.js +814 -0
  171. package/vendor/shared/abi/protocol/ParamRegistry.json +814 -0
  172. package/vendor/shared/abi/protocol/ParamRegistry.ts +814 -0
  173. package/vendor/shared/abi/protocol/PlatformTreasury.js +553 -0
  174. package/vendor/shared/abi/protocol/PlatformTreasury.json +553 -0
  175. package/vendor/shared/abi/protocol/PlatformTreasury.ts +553 -0
  176. package/vendor/shared/abi/protocol/ProtocolProof.js +1171 -0
  177. package/vendor/shared/abi/protocol/ProtocolProof.json +1171 -0
  178. package/vendor/shared/abi/protocol/ProtocolProof.ts +1171 -0
  179. package/vendor/shared/abi/protocol/PublisherStaking.js +1227 -0
  180. package/vendor/shared/abi/protocol/PublisherStaking.json +1227 -0
  181. package/vendor/shared/abi/protocol/PublisherStaking.ts +1227 -0
  182. package/vendor/shared/abi/protocol/RewardVesting.js +1027 -0
  183. package/vendor/shared/abi/protocol/RewardVesting.json +1027 -0
  184. package/vendor/shared/abi/protocol/RewardVesting.ts +1027 -0
  185. package/vendor/shared/abi/protocol/TaskEscrow.js +2219 -0
  186. package/vendor/shared/abi/protocol/TaskEscrow.json +2219 -0
  187. package/vendor/shared/abi/protocol/TaskEscrow.ts +2219 -0
  188. package/vendor/shared/abi/protocol/TesterAssignment.js +1375 -0
  189. package/vendor/shared/abi/protocol/TesterAssignment.json +1375 -0
  190. package/vendor/shared/abi/protocol/TesterAssignment.ts +1375 -0
  191. package/vendor/shared/abi/protocol/ValidatorStaking.js +1614 -0
  192. package/vendor/shared/abi/protocol/ValidatorStaking.json +1614 -0
  193. package/vendor/shared/abi/protocol/ValidatorStaking.ts +1614 -0
  194. package/vendor/shared/abi/protocol/index.js +19 -0
  195. package/vendor/shared/abi/protocol/index.ts +19 -0
  196. package/vendor/shared/abi/token/AGTToken.js +1018 -0
  197. package/vendor/shared/abi/token/AGTToken.json +1018 -0
  198. package/vendor/shared/abi/token/AGTToken.ts +1018 -0
  199. package/vendor/shared/abi/token/GenesisDistributor.js +242 -0
  200. package/vendor/shared/abi/token/GenesisDistributor.json +242 -0
  201. package/vendor/shared/abi/token/GenesisDistributor.ts +242 -0
  202. package/vendor/shared/abi/token/LPLocker.js +21 -0
  203. package/vendor/shared/abi/token/LPLocker.json +21 -0
  204. package/vendor/shared/abi/token/LPLocker.ts +21 -0
  205. package/vendor/shared/abi/token/LaunchLiquidity.js +335 -0
  206. package/vendor/shared/abi/token/LaunchLiquidity.json +335 -0
  207. package/vendor/shared/abi/token/LaunchLiquidity.ts +335 -0
  208. package/vendor/shared/abi/token/LiquidityAdder.js +228 -0
  209. package/vendor/shared/abi/token/LiquidityAdder.json +228 -0
  210. package/vendor/shared/abi/token/LiquidityAdder.ts +228 -0
  211. package/vendor/shared/abi/token/TaxDistributor.js +235 -0
  212. package/vendor/shared/abi/token/TaxDistributor.json +235 -0
  213. package/vendor/shared/abi/token/TaxDistributor.ts +235 -0
  214. package/vendor/shared/abi/token/TestFaucet.js +214 -0
  215. package/vendor/shared/abi/token/TestFaucet.json +214 -0
  216. package/vendor/shared/abi/token/TestFaucet.ts +214 -0
  217. package/vendor/shared/abi/token/index.js +7 -0
  218. package/vendor/shared/abi/token/index.ts +7 -0
  219. package/vendor/shared/dist/abi/index.d.ts +3 -0
  220. package/vendor/shared/dist/abi/index.d.ts.map +1 -0
  221. package/vendor/shared/dist/abi/index.js +3 -0
  222. package/vendor/shared/dist/abi/index.js.map +1 -0
  223. package/vendor/shared/dist/abi/protocol/AgentRegistry.d.ts +1249 -0
  224. package/vendor/shared/dist/abi/protocol/AgentRegistry.d.ts.map +1 -0
  225. package/vendor/shared/dist/abi/protocol/AgentRegistry.js +1624 -0
  226. package/vendor/shared/dist/abi/protocol/AgentRegistry.js.map +1 -0
  227. package/vendor/shared/dist/abi/protocol/ArbitrationCaseProofVerifier.d.ts +119 -0
  228. package/vendor/shared/dist/abi/protocol/ArbitrationCaseProofVerifier.d.ts.map +1 -0
  229. package/vendor/shared/dist/abi/protocol/ArbitrationCaseProofVerifier.js +155 -0
  230. package/vendor/shared/dist/abi/protocol/ArbitrationCaseProofVerifier.js.map +1 -0
  231. package/vendor/shared/dist/abi/protocol/ArbitrationCourt.d.ts +1205 -0
  232. package/vendor/shared/dist/abi/protocol/ArbitrationCourt.d.ts.map +1 -0
  233. package/vendor/shared/dist/abi/protocol/ArbitrationCourt.js +1551 -0
  234. package/vendor/shared/dist/abi/protocol/ArbitrationCourt.js.map +1 -0
  235. package/vendor/shared/dist/abi/protocol/ArbitrationPool.d.ts +391 -0
  236. package/vendor/shared/dist/abi/protocol/ArbitrationPool.d.ts.map +1 -0
  237. package/vendor/shared/dist/abi/protocol/ArbitrationPool.js +510 -0
  238. package/vendor/shared/dist/abi/protocol/ArbitrationPool.js.map +1 -0
  239. package/vendor/shared/dist/abi/protocol/ArbitrationProgressor.d.ts +34 -0
  240. package/vendor/shared/dist/abi/protocol/ArbitrationProgressor.d.ts.map +1 -0
  241. package/vendor/shared/dist/abi/protocol/ArbitrationProgressor.js +45 -0
  242. package/vendor/shared/dist/abi/protocol/ArbitrationProgressor.js.map +1 -0
  243. package/vendor/shared/dist/abi/protocol/ArbitrationSelection.d.ts +885 -0
  244. package/vendor/shared/dist/abi/protocol/ArbitrationSelection.d.ts.map +1 -0
  245. package/vendor/shared/dist/abi/protocol/ArbitrationSelection.js +1154 -0
  246. package/vendor/shared/dist/abi/protocol/ArbitrationSelection.js.map +1 -0
  247. package/vendor/shared/dist/abi/protocol/ArbitrationSettlement.d.ts +742 -0
  248. package/vendor/shared/dist/abi/protocol/ArbitrationSettlement.d.ts.map +1 -0
  249. package/vendor/shared/dist/abi/protocol/ArbitrationSettlement.js +957 -0
  250. package/vendor/shared/dist/abi/protocol/ArbitrationSettlement.js.map +1 -0
  251. package/vendor/shared/dist/abi/protocol/ArbitrationStream.d.ts +741 -0
  252. package/vendor/shared/dist/abi/protocol/ArbitrationStream.d.ts.map +1 -0
  253. package/vendor/shared/dist/abi/protocol/ArbitrationStream.js +965 -0
  254. package/vendor/shared/dist/abi/protocol/ArbitrationStream.js.map +1 -0
  255. package/vendor/shared/dist/abi/protocol/EmissionController.d.ts +1110 -0
  256. package/vendor/shared/dist/abi/protocol/EmissionController.d.ts.map +1 -0
  257. package/vendor/shared/dist/abi/protocol/EmissionController.js +1437 -0
  258. package/vendor/shared/dist/abi/protocol/EmissionController.js.map +1 -0
  259. package/vendor/shared/dist/abi/protocol/HourlyAnchor.d.ts +467 -0
  260. package/vendor/shared/dist/abi/protocol/HourlyAnchor.d.ts.map +1 -0
  261. package/vendor/shared/dist/abi/protocol/HourlyAnchor.js +612 -0
  262. package/vendor/shared/dist/abi/protocol/HourlyAnchor.js.map +1 -0
  263. package/vendor/shared/dist/abi/protocol/IncentiveVault.d.ts +369 -0
  264. package/vendor/shared/dist/abi/protocol/IncentiveVault.d.ts.map +1 -0
  265. package/vendor/shared/dist/abi/protocol/IncentiveVault.js +481 -0
  266. package/vendor/shared/dist/abi/protocol/IncentiveVault.js.map +1 -0
  267. package/vendor/shared/dist/abi/protocol/ParamRegistry.d.ts +628 -0
  268. package/vendor/shared/dist/abi/protocol/ParamRegistry.d.ts.map +1 -0
  269. package/vendor/shared/dist/abi/protocol/ParamRegistry.js +815 -0
  270. package/vendor/shared/dist/abi/protocol/ParamRegistry.js.map +1 -0
  271. package/vendor/shared/dist/abi/protocol/PlatformTreasury.d.ts +426 -0
  272. package/vendor/shared/dist/abi/protocol/PlatformTreasury.d.ts.map +1 -0
  273. package/vendor/shared/dist/abi/protocol/PlatformTreasury.js +554 -0
  274. package/vendor/shared/dist/abi/protocol/PlatformTreasury.js.map +1 -0
  275. package/vendor/shared/dist/abi/protocol/ProtocolProof.d.ts +903 -0
  276. package/vendor/shared/dist/abi/protocol/ProtocolProof.d.ts.map +1 -0
  277. package/vendor/shared/dist/abi/protocol/ProtocolProof.js +1172 -0
  278. package/vendor/shared/dist/abi/protocol/ProtocolProof.js.map +1 -0
  279. package/vendor/shared/dist/abi/protocol/PublisherStaking.d.ts +947 -0
  280. package/vendor/shared/dist/abi/protocol/PublisherStaking.d.ts.map +1 -0
  281. package/vendor/shared/dist/abi/protocol/PublisherStaking.js +1228 -0
  282. package/vendor/shared/dist/abi/protocol/PublisherStaking.js.map +1 -0
  283. package/vendor/shared/dist/abi/protocol/RewardVesting.d.ts +793 -0
  284. package/vendor/shared/dist/abi/protocol/RewardVesting.d.ts.map +1 -0
  285. package/vendor/shared/dist/abi/protocol/RewardVesting.js +1028 -0
  286. package/vendor/shared/dist/abi/protocol/RewardVesting.js.map +1 -0
  287. package/vendor/shared/dist/abi/protocol/TaskEscrow.d.ts +1725 -0
  288. package/vendor/shared/dist/abi/protocol/TaskEscrow.d.ts.map +1 -0
  289. package/vendor/shared/dist/abi/protocol/TaskEscrow.js +2220 -0
  290. package/vendor/shared/dist/abi/protocol/TaskEscrow.js.map +1 -0
  291. package/vendor/shared/dist/abi/protocol/TesterAssignment.d.ts +1058 -0
  292. package/vendor/shared/dist/abi/protocol/TesterAssignment.d.ts.map +1 -0
  293. package/vendor/shared/dist/abi/protocol/TesterAssignment.js +1376 -0
  294. package/vendor/shared/dist/abi/protocol/TesterAssignment.js.map +1 -0
  295. package/vendor/shared/dist/abi/protocol/ValidatorStaking.d.ts +1236 -0
  296. package/vendor/shared/dist/abi/protocol/ValidatorStaking.d.ts.map +1 -0
  297. package/vendor/shared/dist/abi/protocol/ValidatorStaking.js +1615 -0
  298. package/vendor/shared/dist/abi/protocol/ValidatorStaking.js.map +1 -0
  299. package/vendor/shared/dist/abi/protocol/index.d.ts +20 -0
  300. package/vendor/shared/dist/abi/protocol/index.d.ts.map +1 -0
  301. package/vendor/shared/dist/abi/protocol/index.js +20 -0
  302. package/vendor/shared/dist/abi/protocol/index.js.map +1 -0
  303. package/vendor/shared/dist/abi/token/AGTToken.d.ts +786 -0
  304. package/vendor/shared/dist/abi/token/AGTToken.d.ts.map +1 -0
  305. package/vendor/shared/dist/abi/token/AGTToken.js +1019 -0
  306. package/vendor/shared/dist/abi/token/AGTToken.js.map +1 -0
  307. package/vendor/shared/dist/abi/token/GenesisDistributor.d.ts +187 -0
  308. package/vendor/shared/dist/abi/token/GenesisDistributor.d.ts.map +1 -0
  309. package/vendor/shared/dist/abi/token/GenesisDistributor.js +243 -0
  310. package/vendor/shared/dist/abi/token/GenesisDistributor.js.map +1 -0
  311. package/vendor/shared/dist/abi/token/LPLocker.d.ts +16 -0
  312. package/vendor/shared/dist/abi/token/LPLocker.d.ts.map +1 -0
  313. package/vendor/shared/dist/abi/token/LPLocker.js +22 -0
  314. package/vendor/shared/dist/abi/token/LPLocker.js.map +1 -0
  315. package/vendor/shared/dist/abi/token/LaunchLiquidity.d.ts +260 -0
  316. package/vendor/shared/dist/abi/token/LaunchLiquidity.d.ts.map +1 -0
  317. package/vendor/shared/dist/abi/token/LaunchLiquidity.js +336 -0
  318. package/vendor/shared/dist/abi/token/LaunchLiquidity.js.map +1 -0
  319. package/vendor/shared/dist/abi/token/LiquidityAdder.d.ts +176 -0
  320. package/vendor/shared/dist/abi/token/LiquidityAdder.d.ts.map +1 -0
  321. package/vendor/shared/dist/abi/token/LiquidityAdder.js +229 -0
  322. package/vendor/shared/dist/abi/token/LiquidityAdder.js.map +1 -0
  323. package/vendor/shared/dist/abi/token/TaxDistributor.d.ts +182 -0
  324. package/vendor/shared/dist/abi/token/TaxDistributor.d.ts.map +1 -0
  325. package/vendor/shared/dist/abi/token/TaxDistributor.js +236 -0
  326. package/vendor/shared/dist/abi/token/TaxDistributor.js.map +1 -0
  327. package/vendor/shared/dist/abi/token/TestFaucet.d.ts +164 -0
  328. package/vendor/shared/dist/abi/token/TestFaucet.d.ts.map +1 -0
  329. package/vendor/shared/dist/abi/token/TestFaucet.js +215 -0
  330. package/vendor/shared/dist/abi/token/TestFaucet.js.map +1 -0
  331. package/vendor/shared/dist/abi/token/index.d.ts +8 -0
  332. package/vendor/shared/dist/abi/token/index.d.ts.map +1 -0
  333. package/vendor/shared/dist/abi/token/index.js +8 -0
  334. package/vendor/shared/dist/abi/token/index.js.map +1 -0
  335. package/vendor/shared/dist/emission-schedule.d.ts +51 -0
  336. package/vendor/shared/dist/emission-schedule.d.ts.map +1 -0
  337. package/vendor/shared/dist/emission-schedule.js +116 -0
  338. package/vendor/shared/dist/emission-schedule.js.map +1 -0
  339. package/vendor/shared/dist/index.d.ts +7 -0
  340. package/vendor/shared/dist/index.d.ts.map +1 -0
  341. package/vendor/shared/dist/index.js +7 -0
  342. package/vendor/shared/dist/index.js.map +1 -0
  343. package/vendor/shared/dist/params/index.d.ts +6 -0
  344. package/vendor/shared/dist/params/index.d.ts.map +1 -0
  345. package/vendor/shared/dist/params/index.js +84 -0
  346. package/vendor/shared/dist/params/index.js.map +1 -0
  347. package/vendor/shared/dist/protocol-proofs.d.ts +267 -0
  348. package/vendor/shared/dist/protocol-proofs.d.ts.map +1 -0
  349. package/vendor/shared/dist/protocol-proofs.js +205 -0
  350. package/vendor/shared/dist/protocol-proofs.js.map +1 -0
  351. package/vendor/shared/dist/rules/index.d.ts +204 -0
  352. package/vendor/shared/dist/rules/index.d.ts.map +1 -0
  353. package/vendor/shared/dist/rules/index.js +802 -0
  354. package/vendor/shared/dist/rules/index.js.map +1 -0
  355. package/vendor/shared/dist/rules/spec-content.d.ts +21 -0
  356. package/vendor/shared/dist/rules/spec-content.d.ts.map +1 -0
  357. package/vendor/shared/dist/rules/spec-content.js +90 -0
  358. package/vendor/shared/dist/rules/spec-content.js.map +1 -0
  359. package/vendor/shared/dist/rules/task-risk.d.ts +35 -0
  360. package/vendor/shared/dist/rules/task-risk.d.ts.map +1 -0
  361. package/vendor/shared/dist/rules/task-risk.js +438 -0
  362. package/vendor/shared/dist/rules/task-risk.js.map +1 -0
  363. package/vendor/shared/dist/schemas/domain.d.ts +195 -0
  364. package/vendor/shared/dist/schemas/domain.d.ts.map +1 -0
  365. package/vendor/shared/dist/schemas/domain.js +158 -0
  366. package/vendor/shared/dist/schemas/domain.js.map +1 -0
  367. package/vendor/shared/dist/schemas/draft.d.ts +730 -0
  368. package/vendor/shared/dist/schemas/draft.d.ts.map +1 -0
  369. package/vendor/shared/dist/schemas/draft.js +110 -0
  370. package/vendor/shared/dist/schemas/draft.js.map +1 -0
  371. package/vendor/shared/dist/schemas/enums.d.ts +130 -0
  372. package/vendor/shared/dist/schemas/enums.d.ts.map +1 -0
  373. package/vendor/shared/dist/schemas/enums.js +63 -0
  374. package/vendor/shared/dist/schemas/enums.js.map +1 -0
  375. package/vendor/shared/dist/schemas/index.d.ts +4 -0
  376. package/vendor/shared/dist/schemas/index.d.ts.map +1 -0
  377. package/vendor/shared/dist/schemas/index.js +4 -0
  378. package/vendor/shared/dist/schemas/index.js.map +1 -0
  379. package/vendor/shared/dist/units.d.ts +10 -0
  380. package/vendor/shared/dist/units.d.ts.map +1 -0
  381. package/vendor/shared/dist/units.js +44 -0
  382. package/vendor/shared/dist/units.js.map +1 -0
  383. package/vendor/shared/openapi.json +78754 -0
  384. package/vendor/shared/package.json +43 -0
  385. package/vendor/shared/params/params.json +152 -0
  386. package/vendor/shared/params/ranges.json +574 -0
  387. package/vendor/shared/src/emission-schedule.ts +151 -0
  388. package/vendor/shared/src/index.ts +6 -0
  389. package/vendor/shared/src/params/index.ts +139 -0
  390. package/vendor/shared/src/protocol-proofs.ts +235 -0
  391. package/vendor/shared/src/rules/index.ts +1081 -0
  392. package/vendor/shared/src/rules/spec-content.ts +120 -0
  393. package/vendor/shared/src/rules/task-risk.ts +550 -0
  394. package/vendor/shared/src/schemas/domain.ts +187 -0
  395. package/vendor/shared/src/schemas/draft.ts +141 -0
  396. package/vendor/shared/src/schemas/enums.ts +73 -0
  397. package/vendor/shared/src/schemas/index.ts +3 -0
  398. package/vendor/shared/src/units.ts +43 -0
  399. package/vendor/shared/test/emission-schedule.test.ts +115 -0
  400. package/vendor/shared/test/fixtures/emission-vectors.json +1055 -0
  401. package/vendor/shared/test/fixtures.ts +65 -0
  402. package/vendor/shared/test/params.test.ts +48 -0
  403. package/vendor/shared/test/properties.test.ts +136 -0
  404. package/vendor/shared/test/protocol-proofs.test.ts +88 -0
  405. package/vendor/shared/test/rules.test.ts +474 -0
  406. package/vendor/shared/test/schemas.test.ts +130 -0
  407. package/vendor/shared/test/task-risk.test.ts +489 -0
  408. package/vendor/shared/tsconfig.abi.json +11 -0
  409. package/vendor/shared/tsconfig.json +23 -0
  410. package/vendor/shared/types/api/index.d.ts +303 -0
  411. package/vendor/shared/vitest.config.ts +8 -0
@@ -0,0 +1,198 @@
1
+ import type { CommitTesterDrawSeedResponse, ConfigureAgentWebhookResponse, ConfirmArbitrationSeatResponse, CreateArbitrationStreamClaimIntentResponse, CreateArbitrationVoteIntentResponse, CreateExecutorShareClaimIntentResponse, CreateFallbackReportIntentResponse, CreateRewardClaimIntentResponse, CreateSignedTestReportResponse, CreateTaskAppealRequest, CreateTaskAppealResponse, CreateTaskClaimResponse, CreateTaskReviewResponse, CreateTaskSubmissionResponse, CreateTesterSeatClaimIntentResponse, GetAcceptResultIntentResponse, GetAgentEligibilityResponse, GetAgentNextActionsResponse, GetArbitrationStreamPendingResponse, GetArbitratorPoolJoinIntentResponse, GetCancellationCompensationIntentResponse, GetDisputeResponse, GetFinalResultIntentResponse, GetPublisherReadinessResponse, GetRewardsBreakdownResponse, GetTaskResponse, GetTesterPoolJoinIntentResponse, HeartbeatAgentResponse, HeartbeatTaskClaimResponse, ListArbitratorCasesResponse, ListAvailableTriggerActionsResponse, ListExecutorSharesResponse, ListNotificationsResponse, ListRewardTranchesResponse, ListTasksResponse, ListTaskTestReportsResponse, ListTesterSeatsResponse, RegisterAgentOffchainResponse, RevealTesterDrawResponse, SignExecutorDeliveryResponse, VerifySiweResponse, WaiveTaskAppealResponse } from "#shared/api";
2
+ import { type HttpPort, type TransactionRequest, type WalletPort } from "../ports.js";
3
+ export interface JoinTesterPoolInput {
4
+ chainId: number;
5
+ /** TesterAssignment proxy address from the protocol deployment manifest. */
6
+ testerAssignment: string;
7
+ }
8
+ export type JoinTesterPoolIntent = GetTesterPoolJoinIntentResponse;
9
+ export type TaskSpec = NonNullable<ListTasksResponse["items"][number]["specification"]>;
10
+ /** @deprecated Use TaskSpec. The current API accepts V3/V4 specifications. */
11
+ export type TaskSpecV2 = TaskSpec;
12
+ export type DeliveryFileContent = {
13
+ contentType: string;
14
+ size: number;
15
+ encoding: "utf8" | "base64";
16
+ content: string;
17
+ };
18
+ export type TestCriterionResult = {
19
+ criterionId: string;
20
+ passed: boolean;
21
+ note: string;
22
+ };
23
+ export interface AgentGridClientOptions {
24
+ http: HttpPort;
25
+ wallet: WalletPort;
26
+ credential?: string;
27
+ }
28
+ export interface ArbitrationVote {
29
+ satisfied: boolean;
30
+ reason: string;
31
+ }
32
+ /** Cryptographically random bytes32 hex; never derive salts from case data. */
33
+ export declare function randomSalt(): `0x${string}`;
34
+ /** Stable per-delivery idempotency key so retries never double-submit a report. */
35
+ export declare function testReportIdempotencyKey(taskId: string, submissionId: string): string;
36
+ export declare class AgentGridClient {
37
+ private readonly options;
38
+ private credential;
39
+ constructor(options: AgentGridClientOptions);
40
+ setCredential(credential: string): void;
41
+ /**
42
+ * A separate client acting as the local wallet itself via its own SIWE session, leaving this
43
+ * client's credential untouched. Use when the local wallet publishes under its own identity.
44
+ */
45
+ signInAsWallet(buildMessage: (input: {
46
+ nonce: string;
47
+ address: string;
48
+ }) => string): Promise<AgentGridClient>;
49
+ authenticate(buildMessage: (input: {
50
+ nonce: string;
51
+ address: string;
52
+ }) => string): Promise<VerifySiweResponse>;
53
+ registerAgent(): Promise<RegisterAgentOffchainResponse>;
54
+ reportPresence(): Promise<HeartbeatAgentResponse>;
55
+ listTasks(query?: Record<string, string | number | undefined>): Promise<ListTasksResponse>;
56
+ getTask(taskId: string): Promise<GetTaskResponse>;
57
+ claimTask(taskId: string, idempotencyKey: string): Promise<CreateTaskClaimResponse>;
58
+ heartbeatClaim(claimId: string): Promise<HeartbeatTaskClaimResponse>;
59
+ /** Alias for agent presence heartbeat (`POST /agents/heartbeat`). */
60
+ heartbeat(): Promise<HeartbeatAgentResponse>;
61
+ submitWork(input: {
62
+ claimId: string;
63
+ files: readonly {
64
+ name: string;
65
+ content: Blob;
66
+ }[];
67
+ evidence?: string;
68
+ idempotencyKey: string;
69
+ }): Promise<SignExecutorDeliveryResponse>;
70
+ /** Sign an already-uploaded (STORED) delivery; used to resume after a crash between steps. */
71
+ signDelivery(submissionId: string): Promise<SignExecutorDeliveryResponse>;
72
+ get walletAddress(): string;
73
+ commitTesterDraw(taskId: string): Promise<CommitTesterDrawSeedResponse>;
74
+ revealTesterDraw(taskId: string): Promise<RevealTesterDrawResponse>;
75
+ submitTestReport(input: {
76
+ taskId: string;
77
+ submissionId: string;
78
+ executor?: string;
79
+ approved: boolean;
80
+ criteria: readonly TestCriterionResult[];
81
+ summary: string;
82
+ /** Defaults to `test-report:{taskId}:{submissionId}`. */
83
+ idempotencyKey?: string;
84
+ }): Promise<CreateSignedTestReportResponse>;
85
+ getFinalResult(taskId: string): Promise<GetFinalResultIntentResponse>;
86
+ getAcceptResult(taskId: string): Promise<GetAcceptResultIntentResponse>;
87
+ listActions(query?: {
88
+ address?: string;
89
+ subjectId?: string;
90
+ }): Promise<ListAvailableTriggerActionsResponse>;
91
+ listRewards(): Promise<ListRewardTranchesResponse>;
92
+ createRewardClaim(scheduleIds: readonly string[]): Promise<CreateRewardClaimIntentResponse>;
93
+ getRewardsBreakdown(): Promise<GetRewardsBreakdownResponse>;
94
+ /** TaskEscrow.openAppeal intent (appeal → retest → arbitration). */
95
+ openAppeal(taskId: string, input: CreateTaskAppealRequest): Promise<CreateTaskAppealResponse>;
96
+ /** TaskEscrow.waiveAppeal intent for an awarded executor. */
97
+ waiveAppeal(taskId: string): Promise<WaiveTaskAppealResponse>;
98
+ getArbStreamPending(): Promise<GetArbitrationStreamPendingResponse>;
99
+ /** ArbitrationStream.claim intent for this wallet. */
100
+ claimArbStream(): Promise<CreateArbitrationStreamClaimIntentResponse>;
101
+ /** Tester seat mining for this wallet, including partial and fully claimed states. */
102
+ listTesterSeats(): Promise<ListTesterSeatsResponse>;
103
+ /**
104
+ * TaskEscrow.claimTesterSeatsWithProof intent for this wallet's seat mining on a settled task.
105
+ * Only settled hours count. Claims may repeat as later hours settle; the tester sends the tx.
106
+ */
107
+ claimTesterSeat(taskId: string): Promise<CreateTesterSeatClaimIntentResponse>;
108
+ /**
109
+ * One transaction claiming up to 20 seats. Seats with nothing claimable yet are left out of
110
+ * `claims`; the request fails only when none can be claimed.
111
+ */
112
+ claimTesterSeats(taskIds: readonly string[]): Promise<CreateTesterSeatClaimIntentResponse>;
113
+ /** This wallet's leaves in posted executor roots: POSTED, CLAIMABLE (needs vesting) or CLAIMED. */
114
+ listExecutorShares(): Promise<ListExecutorSharesResponse>;
115
+ /**
116
+ * TaskEscrow.claimExecutorShares intent for a settled task (≤ 50 leaves). Creates the vesting
117
+ * schedules that `createRewardClaim` later pays out. Anyone may send it; rewards go to each
118
+ * executor.
119
+ */
120
+ vestExecutorShares(taskId: string, includeOthers?: boolean): Promise<CreateExecutorShareClaimIntentResponse>;
121
+ /**
122
+ * Fetch a caller-paid `TesterAssignment.joinPool()` intent from the API. Resolves the
123
+ * TesterAssignment address from the deployment; does not send the transaction. Check `canJoin`
124
+ * before broadcasting.
125
+ */
126
+ getJoinTesterPoolIntent(): Promise<GetTesterPoolJoinIntentResponse>;
127
+ /**
128
+ * Locally encode `joinPool` when the caller already knows chainId + TesterAssignment. Prefer
129
+ * `getJoinTesterPoolIntent()` so the API supplies the deployment address and eligibility flags.
130
+ */
131
+ prepareJoinTesterPool(input: JoinTesterPoolInput): Pick<JoinTesterPoolIntent, "tx">;
132
+ /**
133
+ * Build and send `TesterAssignment.joinPool()` with the configured wallet. Without `input`,
134
+ * fetches the intent from the API (recommended).
135
+ */
136
+ joinTesterPool(input?: JoinTesterPoolInput): Promise<string>;
137
+ /** Fetch the joinArbitrator intent and send it; throws when not eligible yet. */
138
+ joinArbitratorPool(): Promise<string>;
139
+ getCancellationCompensation(claimId: string): Promise<GetCancellationCompensationIntentResponse>;
140
+ sendTransaction(transaction: TransactionRequest): Promise<string>;
141
+ /**
142
+ * Public on-chain read: can a task be published for `address` now (its stake after reserve, gas)?
143
+ * With `operator`, also reports that wallet's publish grant from `address` and checks the
144
+ * operator's gas instead, since it sends createTaskFor.
145
+ */
146
+ getPublisherReadiness(address: string, reserveWei?: string, operator?: string): Promise<GetPublisherReadinessResponse>;
147
+ listNotifications(query?: {
148
+ cursor?: string;
149
+ limit?: number;
150
+ unread?: boolean;
151
+ }): Promise<ListNotificationsResponse>;
152
+ configureWebhook(agentId: string, url: string, enabled?: boolean): Promise<ConfigureAgentWebhookResponse>;
153
+ listArbitratorCases(): Promise<ListArbitratorCasesResponse>;
154
+ getDispute(caseId: string): Promise<GetDisputeResponse>;
155
+ /** Off-chain build of the caller-paid seat confirmation. Send within arbAcceptWindowHours. */
156
+ confirmArbitrationSeat(caseId: string): Promise<ConfirmArbitrationSeatResponse>;
157
+ /**
158
+ * Build commit + reveal transactions for one vote per criterion. Without `salt` a fresh random
159
+ * 32-byte salt is generated: persist the returned `salt` locally — the reveal must reuse it.
160
+ */
161
+ createArbitrationVoteIntent(caseId: string, votes: readonly ArbitrationVote[], salt?: string): Promise<CreateArbitrationVoteIntentResponse>;
162
+ createFallbackReportIntent(caseId: string, input: {
163
+ approved: boolean;
164
+ criteria: readonly TestCriterionResult[];
165
+ summary: string;
166
+ }): Promise<CreateFallbackReportIntentResponse>;
167
+ /**
168
+ * @deprecated Use confirmArbitrationSeat + createArbitrationVoteIntent and persist the salt.
169
+ * Kept for compatibility; now uses a random salt instead of a derivable one.
170
+ */
171
+ prepareArbitrationVote(caseId: string, reason: string): Promise<TransactionRequest[]>;
172
+ /** Every pending duty for this wallet across roles, sorted by urgency (priority 0 first). */
173
+ getNextActions(): Promise<GetAgentNextActionsResponse>;
174
+ /** Per-role eligibility, stake shortfall (wei) and missing onboarding steps. */
175
+ getEligibility(): Promise<GetAgentEligibilityResponse>;
176
+ /** Caller-paid ArbitrationCourt.joinArbitrator() intent; check canJoin before sending. */
177
+ getJoinArbitratorPoolIntent(): Promise<GetArbitratorPoolJoinIntentResponse>;
178
+ getSubmission(submissionId: string): Promise<CreateTaskSubmissionResponse>;
179
+ /** Raw file bytes of a delivery; only the executor, drawn testers and case jurors may read. */
180
+ /** One delivery file: UTF-8 text when it decodes cleanly, otherwise base64 (zip, images). */
181
+ getSubmissionFile(submissionId: string, index: number): Promise<DeliveryFileContent>;
182
+ listTestReports(taskId: string): Promise<ListTaskTestReportsResponse>;
183
+ /** Publisher review: accept, or reject with a reason and the failed criteria ids. */
184
+ reviewTask(taskId: string, input: {
185
+ accept: boolean;
186
+ reason?: string;
187
+ criteria?: readonly string[];
188
+ }): Promise<CreateTaskReviewResponse>;
189
+ /**
190
+ * Draft, confirm and quote a publish intent for this client's principal. With `operator`, the
191
+ * quote is createTaskFor(principal, …) to be sent by that wallet under its publish grant.
192
+ */
193
+ publishTask(spec: TaskSpec, options?: {
194
+ operator?: string;
195
+ }): Promise<unknown>;
196
+ private request;
197
+ }
198
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/sdk/client.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,4BAA4B,EAC5B,6BAA6B,EAC7B,8BAA8B,EAC9B,0CAA0C,EAC1C,mCAAmC,EACnC,sCAAsC,EACtC,kCAAkC,EAClC,+BAA+B,EAC/B,8BAA8B,E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AE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC;IAM3F,6FAA6F;IAC7F,cAAc,IAAI,OAAO,CAAC,2BAA2B,CAAC;IAItD,gFAAgF;IAChF,cAAc,IAAI,OAAO,CAAC,2BAA2B,CAAC;IAItD,0FAA0F;IAC1F,2BAA2B,IAAI,OAAO,CAAC,mCAAmC,CAAC;IAI3E,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,4BAA4B,CAAC;IAI1E,+FAA+F;IAC/F,6FAA6F;IACvF,iBAAiB,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAuB1F,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAIrE,qFAAqF;IACrF,UAAU,CACR,MAAM,EAAE,MAAM,EACd,KAAK,EAAE;QAAE,MAAM,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;KAAE,GACxE,OAAO,CAAC,wBAAwB,CAAC;IAIpC;;;OAGG;IACG,WAAW,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,GAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAsCxF,OAAO,CAAC,OAAO;CAgBhB"}
@@ -0,0 +1,413 @@
1
+ import { encodeFunctionData, getAddress, keccak256, toBytes } from "viem";
2
+ import { PROTOCOL_PROOF_TYPES } from "#shared";
3
+ import { testerAssignmentAbi } from "#shared/abi";
4
+ import { AgentGridError, } from "../ports.js";
5
+ import { bytesToBase64 } from "./base64.js";
6
+ function canonicalTestReport(input) {
7
+ return JSON.stringify({
8
+ approved: input.approved,
9
+ criteria: input.criteria
10
+ .map((criterion) => ({
11
+ criterionId: criterion.criterionId.normalize("NFC").trim(),
12
+ passed: criterion.passed,
13
+ note: criterion.note.normalize("NFC").trim(),
14
+ }))
15
+ .sort((left, right) => left.criterionId.localeCompare(right.criterionId, "en")),
16
+ summary: input.summary.normalize("NFC").trim(),
17
+ });
18
+ }
19
+ /** Cryptographically random bytes32 hex; never derive salts from case data. */
20
+ export function randomSalt() {
21
+ const bytes = new Uint8Array(32);
22
+ globalThis.crypto.getRandomValues(bytes);
23
+ return `0x${Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0")).join("")}`;
24
+ }
25
+ /** Stable per-delivery idempotency key so retries never double-submit a report. */
26
+ export function testReportIdempotencyKey(taskId, submissionId) {
27
+ return `test-report:${taskId}:${submissionId}`;
28
+ }
29
+ function confirmed(value) {
30
+ return { value, confirmation: "confirmed" };
31
+ }
32
+ export class AgentGridClient {
33
+ options;
34
+ credential;
35
+ constructor(options) {
36
+ this.options = options;
37
+ this.credential = options.credential;
38
+ }
39
+ setCredential(credential) {
40
+ this.credential = credential;
41
+ }
42
+ /**
43
+ * A separate client acting as the local wallet itself via its own SIWE session, leaving this
44
+ * client's credential untouched. Use when the local wallet publishes under its own identity.
45
+ */
46
+ async signInAsWallet(buildMessage) {
47
+ const session = new AgentGridClient({ http: this.options.http, wallet: this.options.wallet });
48
+ await session.authenticate(buildMessage);
49
+ return session;
50
+ }
51
+ async authenticate(buildMessage) {
52
+ const nonce = await this.options.http.request({
53
+ method: "POST",
54
+ path: "/auth/nonce",
55
+ });
56
+ const message = buildMessage({ nonce: nonce.nonce, address: this.options.wallet.address });
57
+ const signature = await this.options.wallet.signMessage(message);
58
+ const verified = await this.options.http.request({
59
+ method: "POST",
60
+ path: "/auth/verify",
61
+ body: { message, signature },
62
+ });
63
+ this.credential = verified.sessionToken;
64
+ return verified;
65
+ }
66
+ async registerAgent() {
67
+ const registered = await this.request("POST", "/agents/register");
68
+ this.credential = registered.apiKey.key;
69
+ return registered;
70
+ }
71
+ reportPresence() {
72
+ return this.request("POST", "/agents/heartbeat");
73
+ }
74
+ listTasks(query = {}) {
75
+ return this.request("GET", "/tasks", undefined, undefined, query);
76
+ }
77
+ getTask(taskId) {
78
+ return this.request("GET", `/tasks/${encodeURIComponent(taskId)}`);
79
+ }
80
+ claimTask(taskId, idempotencyKey) {
81
+ return this.request("POST", `/tasks/${taskId}/claims`, undefined, {
82
+ "idempotency-key": idempotencyKey,
83
+ });
84
+ }
85
+ heartbeatClaim(claimId) {
86
+ return this.request("POST", `/claims/${claimId}/heartbeat`);
87
+ }
88
+ /** Alias for agent presence heartbeat (`POST /agents/heartbeat`). */
89
+ heartbeat() {
90
+ return this.reportPresence();
91
+ }
92
+ async submitWork(input) {
93
+ const form = new FormData();
94
+ for (const file of input.files)
95
+ form.append("file", file.content, file.name);
96
+ if (input.evidence !== undefined)
97
+ form.append("evidence", input.evidence);
98
+ const stored = await this.request("POST", `/claims/${input.claimId}/submissions`, form, { "idempotency-key": input.idempotencyKey });
99
+ const typed = stored.executorTypedData;
100
+ const signature = await this.options.wallet.signTypedData({
101
+ domain: typed.domain,
102
+ types: typed.types,
103
+ primaryType: typed.primaryType,
104
+ message: typed.message,
105
+ });
106
+ return this.request("POST", `/submissions/${stored.id}/signature`, { signature });
107
+ }
108
+ /** Sign an already-uploaded (STORED) delivery; used to resume after a crash between steps. */
109
+ async signDelivery(submissionId) {
110
+ const stored = await this.getSubmission(submissionId);
111
+ const typed = stored.executorTypedData;
112
+ const signature = await this.options.wallet.signTypedData({
113
+ domain: typed.domain,
114
+ types: typed.types,
115
+ primaryType: typed.primaryType,
116
+ message: typed.message,
117
+ });
118
+ return this.request("POST", `/submissions/${submissionId}/signature`, { signature });
119
+ }
120
+ get walletAddress() {
121
+ return this.options.wallet.address;
122
+ }
123
+ commitTesterDraw(taskId) {
124
+ return this.request("POST", `/tasks/${taskId}/tester-draws/commit`);
125
+ }
126
+ revealTesterDraw(taskId) {
127
+ return this.request("POST", `/tasks/${taskId}/tester-draws/reveal`);
128
+ }
129
+ async submitTestReport(input) {
130
+ const submission = await this.request("GET", `/submissions/${input.submissionId}`);
131
+ const conclusionsHash = keccak256(toBytes(canonicalTestReport({
132
+ approved: input.approved,
133
+ criteria: input.criteria,
134
+ summary: input.summary,
135
+ })));
136
+ const typed = submission.executorTypedData;
137
+ const signature = await this.options.wallet.signTypedData({
138
+ domain: typed.domain,
139
+ types: { TestReport: PROTOCOL_PROOF_TYPES.TestReport },
140
+ primaryType: "TestReport",
141
+ message: {
142
+ taskId: input.taskId,
143
+ cidHash: submission.cidHash,
144
+ executor: input.executor ?? (await this.revealTesterDraw(input.taskId)).executor,
145
+ conclusionsHash,
146
+ approved: input.approved,
147
+ },
148
+ });
149
+ return this.request("POST", `/tasks/${input.taskId}/test-reports`, {
150
+ submissionId: input.submissionId,
151
+ approved: input.approved,
152
+ criteria: input.criteria,
153
+ summary: input.summary,
154
+ signature,
155
+ }, {
156
+ "idempotency-key": input.idempotencyKey ?? testReportIdempotencyKey(input.taskId, input.submissionId),
157
+ });
158
+ }
159
+ getFinalResult(taskId) {
160
+ return this.request("GET", `/tasks/${taskId}/final-result-intent`);
161
+ }
162
+ getAcceptResult(taskId) {
163
+ return this.request("GET", `/tasks/${taskId}/accept-result-intent`);
164
+ }
165
+ listActions(query = {}) {
166
+ return this.request("GET", "/actions/available", undefined, undefined, query);
167
+ }
168
+ listRewards() {
169
+ return this.request("GET", "/rewards/tranches");
170
+ }
171
+ createRewardClaim(scheduleIds) {
172
+ return this.request("POST", "/rewards/claim-intents", { scheduleIds });
173
+ }
174
+ getRewardsBreakdown() {
175
+ return this.request("GET", "/rewards/breakdown");
176
+ }
177
+ /** TaskEscrow.openAppeal intent (appeal → retest → arbitration). */
178
+ openAppeal(taskId, input) {
179
+ return this.request("POST", `/tasks/${taskId}/appeals`, input);
180
+ }
181
+ /** TaskEscrow.waiveAppeal intent for an awarded executor. */
182
+ waiveAppeal(taskId) {
183
+ return this.request("POST", `/tasks/${taskId}/waive-appeal`);
184
+ }
185
+ getArbStreamPending() {
186
+ return this.request("GET", "/rewards/arb-stream/pending");
187
+ }
188
+ /** ArbitrationStream.claim intent for this wallet. */
189
+ claimArbStream() {
190
+ return this.request("POST", "/rewards/arbitration-stream-claim-intent");
191
+ }
192
+ /** Tester seat mining for this wallet, including partial and fully claimed states. */
193
+ listTesterSeats() {
194
+ return this.request("GET", "/rewards/tester-seats");
195
+ }
196
+ /**
197
+ * TaskEscrow.claimTesterSeatsWithProof intent for this wallet's seat mining on a settled task.
198
+ * Only settled hours count. Claims may repeat as later hours settle; the tester sends the tx.
199
+ */
200
+ claimTesterSeat(taskId) {
201
+ return this.request("POST", "/rewards/tester-seat-claim-intents", { taskId });
202
+ }
203
+ /**
204
+ * One transaction claiming up to 20 seats. Seats with nothing claimable yet are left out of
205
+ * `claims`; the request fails only when none can be claimed.
206
+ */
207
+ claimTesterSeats(taskIds) {
208
+ return this.request("POST", "/rewards/tester-seat-claim-intents", { taskIds });
209
+ }
210
+ /** This wallet's leaves in posted executor roots: POSTED, CLAIMABLE (needs vesting) or CLAIMED. */
211
+ listExecutorShares() {
212
+ return this.request("GET", "/rewards/executor-shares");
213
+ }
214
+ /**
215
+ * TaskEscrow.claimExecutorShares intent for a settled task (≤ 50 leaves). Creates the vesting
216
+ * schedules that `createRewardClaim` later pays out. Anyone may send it; rewards go to each
217
+ * executor.
218
+ */
219
+ vestExecutorShares(taskId, includeOthers = false) {
220
+ return this.request("POST", "/rewards/executor-share-claim-intents", { taskId, includeOthers });
221
+ }
222
+ /**
223
+ * Fetch a caller-paid `TesterAssignment.joinPool()` intent from the API. Resolves the
224
+ * TesterAssignment address from the deployment; does not send the transaction. Check `canJoin`
225
+ * before broadcasting.
226
+ */
227
+ getJoinTesterPoolIntent() {
228
+ return this.request("GET", "/staking/tester-pool-join-intent");
229
+ }
230
+ /**
231
+ * Locally encode `joinPool` when the caller already knows chainId + TesterAssignment. Prefer
232
+ * `getJoinTesterPoolIntent()` so the API supplies the deployment address and eligibility flags.
233
+ */
234
+ prepareJoinTesterPool(input) {
235
+ if (!Number.isInteger(input.chainId) || input.chainId <= 0) {
236
+ throw new Error("chainId must be a positive integer.");
237
+ }
238
+ const testerAssignment = getAddress(input.testerAssignment);
239
+ return {
240
+ tx: {
241
+ chainId: input.chainId,
242
+ to: testerAssignment,
243
+ data: encodeFunctionData({ abi: testerAssignmentAbi, functionName: "joinPool" }),
244
+ value: "0",
245
+ },
246
+ };
247
+ }
248
+ /**
249
+ * Build and send `TesterAssignment.joinPool()` with the configured wallet. Without `input`,
250
+ * fetches the intent from the API (recommended).
251
+ */
252
+ async joinTesterPool(input) {
253
+ const intent = input ? this.prepareJoinTesterPool(input) : await this.getJoinTesterPoolIntent();
254
+ return this.sendTransaction(intent.tx);
255
+ }
256
+ /** Fetch the joinArbitrator intent and send it; throws when not eligible yet. */
257
+ async joinArbitratorPool() {
258
+ const intent = await this.getJoinArbitratorPoolIntent();
259
+ if (intent.inPool)
260
+ throw new Error("Already in the arbitrator pool.");
261
+ if (!intent.canJoin)
262
+ throw new Error("Stake does not meet arbitratorMinStakeAgt yet; see getEligibility().");
263
+ return this.sendTransaction(intent.tx);
264
+ }
265
+ getCancellationCompensation(claimId) {
266
+ return this.request("GET", `/claims/${claimId}/cancellation-intent`);
267
+ }
268
+ sendTransaction(transaction) {
269
+ const wallet = this.options.wallet.address;
270
+ if (transaction.from && transaction.from.toLowerCase() !== wallet.toLowerCase()) {
271
+ return Promise.reject(new AgentGridError(409, "TX_SENDER_MISMATCH", `This transaction must be sent by ${transaction.from}, but the local wallet is ${wallet}. Sending it from here would act as a different account; ask the owner of ${transaction.from} to sign it in their own wallet.`, false, { from: transaction.from, wallet }));
272
+ }
273
+ return this.options.wallet.sendTransaction(transaction);
274
+ }
275
+ /**
276
+ * Public on-chain read: can a task be published for `address` now (its stake after reserve, gas)?
277
+ * With `operator`, also reports that wallet's publish grant from `address` and checks the
278
+ * operator's gas instead, since it sends createTaskFor.
279
+ */
280
+ getPublisherReadiness(address, reserveWei, operator) {
281
+ return this.request("GET", `/staking/publisher-readiness/${address}`, undefined, undefined, {
282
+ ...(reserveWei === undefined ? {} : { reserveWei }),
283
+ ...(operator === undefined ? {} : { operator }),
284
+ });
285
+ }
286
+ listNotifications(query = {}) {
287
+ return this.request("GET", "/notifications", undefined, undefined, query);
288
+ }
289
+ configureWebhook(agentId, url, enabled = true) {
290
+ return this.request("PUT", `/agents/${agentId}/webhook`, { url, enabled });
291
+ }
292
+ listArbitratorCases() {
293
+ return this.request("GET", "/arbitrator/cases");
294
+ }
295
+ getDispute(caseId) {
296
+ return this.request("GET", `/disputes/${caseId}`);
297
+ }
298
+ /** Off-chain build of the caller-paid seat confirmation. Send within arbAcceptWindowHours. */
299
+ confirmArbitrationSeat(caseId) {
300
+ return this.request("POST", `/disputes/${caseId}/confirm`);
301
+ }
302
+ /**
303
+ * Build commit + reveal transactions for one vote per criterion. Without `salt` a fresh random
304
+ * 32-byte salt is generated: persist the returned `salt` locally — the reveal must reuse it.
305
+ */
306
+ createArbitrationVoteIntent(caseId, votes, salt = randomSalt()) {
307
+ return this.request("POST", `/disputes/${caseId}/vote-intent`, { salt, votes });
308
+ }
309
+ createFallbackReportIntent(caseId, input) {
310
+ return this.request("POST", `/disputes/${caseId}/fallback-report-intent`, input);
311
+ }
312
+ /**
313
+ * @deprecated Use confirmArbitrationSeat + createArbitrationVoteIntent and persist the salt.
314
+ * Kept for compatibility; now uses a random salt instead of a derivable one.
315
+ */
316
+ async prepareArbitrationVote(caseId, reason) {
317
+ const confirmed = await this.confirmArbitrationSeat(caseId);
318
+ const vote = await this.createArbitrationVoteIntent(caseId, [{ satisfied: true, reason }]);
319
+ return [confirmed.tx, vote.commitTx, vote.revealTx];
320
+ }
321
+ /** Every pending duty for this wallet across roles, sorted by urgency (priority 0 first). */
322
+ getNextActions() {
323
+ return this.request("GET", "/agents/me/next-actions");
324
+ }
325
+ /** Per-role eligibility, stake shortfall (wei) and missing onboarding steps. */
326
+ getEligibility() {
327
+ return this.request("GET", "/agents/me/eligibility");
328
+ }
329
+ /** Caller-paid ArbitrationCourt.joinArbitrator() intent; check canJoin before sending. */
330
+ getJoinArbitratorPoolIntent() {
331
+ return this.request("GET", "/staking/arbitrator-pool-join-intent");
332
+ }
333
+ getSubmission(submissionId) {
334
+ return this.request("GET", `/submissions/${submissionId}`);
335
+ }
336
+ /** Raw file bytes of a delivery; only the executor, drawn testers and case jurors may read. */
337
+ /** One delivery file: UTF-8 text when it decodes cleanly, otherwise base64 (zip, images). */
338
+ async getSubmissionFile(submissionId, index) {
339
+ const file = await this.options.http.request({
340
+ method: "GET",
341
+ path: `/submissions/${submissionId}/files/${index}`,
342
+ binary: true,
343
+ ...(this.credential ? { token: this.credential } : {}),
344
+ });
345
+ const size = file.data.length;
346
+ try {
347
+ const text = new TextDecoder("utf-8", { fatal: true }).decode(file.data);
348
+ if (!text.includes("\u0000"))
349
+ return { contentType: file.contentType, size, encoding: "utf8", content: text };
350
+ }
351
+ catch {
352
+ // Not UTF-8: fall through to base64.
353
+ }
354
+ return {
355
+ contentType: file.contentType,
356
+ size,
357
+ encoding: "base64",
358
+ content: bytesToBase64(file.data),
359
+ };
360
+ }
361
+ listTestReports(taskId) {
362
+ return this.request("GET", `/tasks/${taskId}/test-reports`);
363
+ }
364
+ /** Publisher review: accept, or reject with a reason and the failed criteria ids. */
365
+ reviewTask(taskId, input) {
366
+ return this.request("POST", `/tasks/${taskId}/reviews`, input);
367
+ }
368
+ /**
369
+ * Draft, confirm and quote a publish intent for this client's principal. With `operator`, the
370
+ * quote is createTaskFor(principal, …) to be sent by that wallet under its publish grant.
371
+ */
372
+ async publishTask(spec, options = {}) {
373
+ const draft = await this.request("POST", "/drafts");
374
+ const now = new Date().toISOString();
375
+ const fields = {
376
+ title: confirmed(spec.title),
377
+ summary: confirmed(spec.summary),
378
+ template: confirmed(spec.template),
379
+ deliverables: confirmed(spec.deliverables),
380
+ outOfScope: confirmed(spec.outOfScope),
381
+ constraints: confirmed(spec.constraints),
382
+ inputs: confirmed(spec.inputs),
383
+ criteria: confirmed(spec.criteria.map((criterion) => ({
384
+ value: criterion,
385
+ source: "user",
386
+ confirmation: "confirmed",
387
+ updatedAt: now,
388
+ }))),
389
+ estimatedHours: confirmed(spec.estimatedHours),
390
+ startTier: confirmed(spec.startTier),
391
+ maxTier: confirmed(spec.maxTier),
392
+ runDays: confirmed(spec.runDays),
393
+ maxParticipants: confirmed(spec.maxParticipants ?? 9),
394
+ passingThreshold: confirmed(spec.passingThreshold),
395
+ };
396
+ const patched = await this.request("PATCH", `/drafts/${draft.id}`, { fields }, { "if-match": String(draft.version) });
397
+ return this.request("POST", `/drafts/${draft.id}/publish-intent`, {
398
+ version: patched.version,
399
+ ...(options.operator === undefined ? {} : { operator: options.operator }),
400
+ });
401
+ }
402
+ request(method, path, body, headers, query) {
403
+ return this.options.http.request({
404
+ method,
405
+ path,
406
+ ...(this.credential ? { token: this.credential } : {}),
407
+ ...(body === undefined ? {} : { body }),
408
+ ...(headers ? { headers } : {}),
409
+ ...(query ? { query } : {}),
410
+ });
411
+ }
412
+ }
413
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/sdk/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AA6ClD,OAAO,EACL,cAAc,GAKf,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AA8B5C,SAAS,mBAAmB,CAAC,KAI5B;IACC,OAAO,IAAI,CAAC,SAAS,CAAC;QACpB,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,QAAQ,EAAE,KAAK,CAAC,QAAQ;aACrB,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;YACnB,WAAW,EAA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