@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,147 @@
1
+ import { existsSync, readFileSync } from "node:fs";
2
+ import { join } from "node:path";
3
+ import { createPublicClient, createWalletClient, http } from "viem";
4
+ import { privateKeyToAccount } from "viem/accounts";
5
+ import { createSiweMessage } from "viem/siwe";
6
+ import { FetchHttpAdapter, ViemWalletAdapter } from "../ports.js";
7
+ import { AgentGridClient } from "../sdk/client.js";
8
+ import { keyPrefix, planApiKeyBinding } from "./binding.js";
9
+ import { agentHome, homePaths, loadCredential, saveCredential, writePrivate } from "./home.js";
10
+ import { askHidden, chooseWallet, confirm } from "./prompt.js";
11
+ import { describeWallet, loadPrivateKey } from "./wallet.js";
12
+ export const DEFAULT_API = "https://agentsgot.network/api";
13
+ export function cliContext(env = process.env) {
14
+ return {
15
+ env,
16
+ home: agentHome(env),
17
+ apiBaseUrl: env.AGENTSGOT_API_BASE_URL ?? DEFAULT_API,
18
+ };
19
+ }
20
+ /** Load the wallet; prompts for the keystore password on the user's own terminal if needed. */
21
+ export async function loadAccount(ctx) {
22
+ const source = describeWallet(ctx.env, ctx.home);
23
+ const password = source?.kind === "keystore" && !ctx.env.AGENTSGOT_KEYSTORE_PASSWORD
24
+ ? await askHidden(`Keystore password for ${source.address}: `)
25
+ : undefined;
26
+ return privateKeyToAccount(loadPrivateKey(ctx.env, ctx.home, password));
27
+ }
28
+ export function rpcUrl(ctx) {
29
+ return ctx.env.AGENTSGOT_RPC_URL;
30
+ }
31
+ const resolvedKeys = new Map();
32
+ /** Pick the API key for this process, asking which wallet signs before a key is bound. */
33
+ export function resolveApiKey(ctx, walletAddress) {
34
+ const id = `${ctx.home}|${walletAddress.toLowerCase()}|${ctx.apiBaseUrl}|${ctx.env.AGENTSGOT_API_KEY ?? ""}`;
35
+ const cached = resolvedKeys.get(id);
36
+ if (cached)
37
+ return cached;
38
+ const pending = resolveApiKeyOnce(ctx, walletAddress);
39
+ resolvedKeys.set(id, pending);
40
+ return pending;
41
+ }
42
+ const NEW_WALLET_PAUSE = "Not bound yet. Run `agentsgot wallet create` in this terminal, then run this command again with the same AGENTSGOT_API_KEY. The saved key was left unchanged.";
43
+ async function resolveApiKeyOnce(ctx, walletAddress) {
44
+ const saved = loadCredential(ctx.home);
45
+ const plan = planApiKeyBinding({
46
+ ...(ctx.env.AGENTSGOT_API_KEY ? { envKey: ctx.env.AGENTSGOT_API_KEY } : {}),
47
+ saved,
48
+ walletAddress,
49
+ apiBaseUrl: ctx.apiBaseUrl,
50
+ });
51
+ if (plan.prompt && plan.onAccept === "use-env") {
52
+ const choice = await chooseWallet(plan.prompt);
53
+ if (choice === "new") {
54
+ process.stderr.write(`${NEW_WALLET_PAUSE}\n`);
55
+ const kept = saved?.apiKey;
56
+ return { ...(kept ? { key: kept } : {}), paused: NEW_WALLET_PAUSE };
57
+ }
58
+ const envKey = ctx.env.AGENTSGOT_API_KEY?.trim();
59
+ if (!envKey)
60
+ return { ...(plan.key ? { key: plan.key } : {}) };
61
+ saveCredential({
62
+ apiBaseUrl: ctx.apiBaseUrl,
63
+ address: walletAddress,
64
+ apiKey: envKey,
65
+ savedAt: new Date().toISOString(),
66
+ }, ctx.home);
67
+ process.stderr.write(`Bound ${keyPrefix(envKey)} to the current wallet ${walletAddress}. Rewards stay with the wallet that owns the key.\n`);
68
+ return { key: envKey };
69
+ }
70
+ if (!plan.prompt)
71
+ return { ...(plan.key ? { key: plan.key } : {}) };
72
+ const accepted = await confirm(plan.prompt);
73
+ if (!accepted) {
74
+ process.stderr.write("Kept the saved API key. This machine was not rebound.\n");
75
+ return { ...(plan.key ? { key: plan.key } : {}) };
76
+ }
77
+ process.stderr.write("The saved API key stays on disk until the current wallet registers successfully.\n");
78
+ return {};
79
+ }
80
+ export async function clientFor(ctx, account) {
81
+ const walletClient = createWalletClient({ account, transport: http(rpcUrl(ctx)) });
82
+ const credential = (await resolveApiKey(ctx, account.address)).key;
83
+ const client = new AgentGridClient({
84
+ http: new FetchHttpAdapter(ctx.apiBaseUrl),
85
+ wallet: new ViemWalletAdapter(account, walletClient),
86
+ ...(credential ? { credential } : {}),
87
+ });
88
+ return { client, hasCredential: Boolean(credential) };
89
+ }
90
+ export function siweMessage(ctx, address) {
91
+ const origin = new URL(ctx.apiBaseUrl);
92
+ return ({ nonce }) => createSiweMessage({
93
+ address,
94
+ chainId: Number(ctx.env.AGENTSGOT_CHAIN_ID ?? 97),
95
+ domain: origin.host,
96
+ nonce,
97
+ uri: origin.origin,
98
+ version: "1",
99
+ statement: "Sign in to agentsgot.",
100
+ });
101
+ }
102
+ /** SIWE login + POST /agents/register; stores the one-time API key encrypted, never prints it. */
103
+ export async function loginAndRegister(ctx, client, address) {
104
+ await client.authenticate(siweMessage(ctx, address));
105
+ const registered = await client.registerAgent();
106
+ saveCredential({
107
+ apiBaseUrl: ctx.apiBaseUrl,
108
+ address,
109
+ agentId: registered.agentId,
110
+ apiKey: registered.apiKey.key,
111
+ savedAt: new Date().toISOString(),
112
+ }, ctx.home);
113
+ return { agentId: registered.agentId };
114
+ }
115
+ /** Native (BNB) gas balance; AGT comes from GET /agents/me/eligibility (stake.walletAgtWei). */
116
+ export async function gasBalance(ctx, address) {
117
+ const url = rpcUrl(ctx);
118
+ if (!url)
119
+ return null;
120
+ return createPublicClient({ transport: http(url) })
121
+ .getBalance({ address })
122
+ .catch(() => null);
123
+ }
124
+ /** File-backed checkpoints under ~/.agentsgot/checkpoints/<address>.json (0600). */
125
+ export class FileCheckpointStore {
126
+ path;
127
+ constructor(path) {
128
+ this.path = path;
129
+ }
130
+ read() {
131
+ if (!existsSync(this.path))
132
+ return {};
133
+ return JSON.parse(readFileSync(this.path, "utf8"));
134
+ }
135
+ async get(key) {
136
+ return this.read()[key] ?? null;
137
+ }
138
+ async set(key, value) {
139
+ const all = this.read();
140
+ all[key] = value;
141
+ writePrivate(this.path, `${JSON.stringify(all, null, 2)}\n`);
142
+ }
143
+ }
144
+ export function checkpointStore(ctx, address) {
145
+ return new FileCheckpointStore(join(homePaths(ctx.home).checkpoints, `${address.toLowerCase()}.json`));
146
+ }
147
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/cli/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAE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ACD,KAAK,CAAC,GAAG,CAAI,GAAW,EAAE,KAAQ;QAChC,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QACxB,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACjB,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IAC/D,CAAC;CACF;AAED,MAAM,UAAU,eAAe,CAAC,GAAe,EAAE,OAAe;IAC9D,OAAO,IAAI,mBAAmB,CAC5B,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,GAAG,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,CACvE,CAAC;AACJ,CAAC"}
@@ -0,0 +1,34 @@
1
+ import type { GetAgentEligibilityResponse } from "#shared/api";
2
+ import type { Role } from "../roles.js";
3
+ export interface Check {
4
+ name: string;
5
+ ok: boolean;
6
+ detail: string;
7
+ /** Repair hint shown when `ok` is false. */
8
+ fix?: string;
9
+ }
10
+ export interface DoctorInput {
11
+ roles: readonly Role[];
12
+ wallet: {
13
+ address: string;
14
+ source: string;
15
+ } | null;
16
+ walletError?: string;
17
+ gasWei: bigint | null;
18
+ agtWei: bigint | null;
19
+ apiReachable: boolean;
20
+ apiError?: string;
21
+ loggedIn: boolean;
22
+ /** Replaces the default sign-in hint when registration was skipped on purpose. */
23
+ loginFix?: string;
24
+ registered: boolean;
25
+ registeredFix?: string;
26
+ credentialPath: string;
27
+ online: boolean | null;
28
+ eligibility: GetAgentEligibilityResponse | null;
29
+ }
30
+ export declare function formatAgt(wei: bigint): string;
31
+ /** Build the onboarding checklist shown by `agentsgot doctor` / `agentsgot status`. */
32
+ export declare function buildChecks(input: DoctorInput): Check[];
33
+ export declare function formatChecks(checks: readonly Check[]): string;
34
+ //# sourceMappingURL=doctor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,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18n;
2
+ export function formatAgt(wei) {
3
+ const whole = wei / WEI;
4
+ const fraction = ((wei % WEI) * 10000n) / WEI;
5
+ return fraction === 0n ? whole.toString() : `${whole}.${fraction.toString().padStart(4, "0")}`;
6
+ }
7
+ function shortfall(row) {
8
+ const wei = row.shortfallWei;
9
+ return wei && BigInt(wei) > 0n ? ` (short ${formatAgt(BigInt(wei))} AGT)` : "";
10
+ }
11
+ /** Build the onboarding checklist shown by `agentsgot doctor` / `agentsgot status`. */
12
+ export function buildChecks(input) {
13
+ const checks = [
14
+ input.wallet
15
+ ? { name: "wallet", ok: true, detail: `${input.wallet.address} (${input.wallet.source})` }
16
+ : {
17
+ name: "wallet",
18
+ ok: false,
19
+ detail: input.walletError ?? "no wallet configured",
20
+ fix: "Run `agentsgot wallet create` in your own terminal, or set AGENTSGOT_WALLET_PRIVATE_KEY / AGENTSGOT_KEYSTORE yourself. Never paste keys into chat.",
21
+ },
22
+ input.gasWei === null
23
+ ? { name: "BNB gas", ok: false, detail: "unknown", fix: "Set AGENTSGOT_RPC_URL." }
24
+ : {
25
+ name: "BNB gas",
26
+ ok: input.gasWei > 0n,
27
+ detail: `${formatAgt(input.gasWei)} BNB`,
28
+ ...(input.gasWei > 0n ? {} : { fix: "Send a little BNB to the wallet for gas." }),
29
+ },
30
+ {
31
+ name: "AGT balance",
32
+ ok: input.agtWei !== null,
33
+ detail: input.agtWei === null ? "unknown" : `${formatAgt(input.agtWei)} AGT`,
34
+ ...(input.agtWei === null ? { fix: "Set AGENTSGOT_RPC_URL and a reachable API." } : {}),
35
+ },
36
+ {
37
+ name: "API reachable",
38
+ ok: input.apiReachable,
39
+ detail: input.apiReachable ? "ok" : (input.apiError ?? "unreachable"),
40
+ ...(input.apiReachable ? {} : { fix: "Check AGENTSGOT_API_BASE_URL and network access." }),
41
+ },
42
+ {
43
+ name: "SIWE login",
44
+ ok: input.loggedIn,
45
+ detail: input.loggedIn ? "ok" : "not logged in",
46
+ ...(input.loggedIn
47
+ ? {}
48
+ : {
49
+ fix: input.loginFix ?? "Run `agentsgot doctor --register` to sign in and register.",
50
+ }),
51
+ },
52
+ {
53
+ name: "agent registered",
54
+ ok: input.registered,
55
+ detail: input.registered
56
+ ? `API key saved (encrypted) in ${input.credentialPath}`
57
+ : "no API key",
58
+ ...(input.registered
59
+ ? {}
60
+ : { fix: input.registeredFix ?? "Run `agentsgot doctor --register`." }),
61
+ },
62
+ {
63
+ name: "heartbeat online",
64
+ ok: input.online === true,
65
+ detail: input.online === null ? "unknown" : input.online ? "online" : "offline",
66
+ ...(input.online
67
+ ? {}
68
+ : { fix: "Start `agentsgot run <role>` (presence job) or POST /agents/heartbeat." }),
69
+ },
70
+ ];
71
+ for (const role of input.roles) {
72
+ const row = input.eligibility?.roles[role];
73
+ if (!row) {
74
+ checks.push({
75
+ name: `role: ${role}`,
76
+ ok: false,
77
+ detail: "eligibility unknown",
78
+ fix: "Register first, then GET /agents/me/eligibility.",
79
+ });
80
+ continue;
81
+ }
82
+ const missing = row.missing.map((step) => step.description).join("; ");
83
+ checks.push({
84
+ name: `role: ${role}`,
85
+ ok: row.eligible,
86
+ detail: row.eligible ? "eligible" : `${missing || "not eligible"}${shortfall(row)}`,
87
+ ...(row.eligible
88
+ ? {}
89
+ : {
90
+ fix: row.missing
91
+ .map((step) => step.request ? `${step.request.method} ${step.request.path}` : step.code)
92
+ .join(", "),
93
+ }),
94
+ });
95
+ }
96
+ return checks;
97
+ }
98
+ export function formatChecks(checks) {
99
+ const width = Math.max(...checks.map((check) => check.name.length));
100
+ return checks
101
+ .map((check) => {
102
+ const line = `${check.ok ? "[ok] " : "[FAIL]"} ${check.name.padEnd(width)} ${check.detail}`;
103
+ return check.ok || !check.fix
104
+ ? line
105
+ : `${line}\n ${" ".repeat(width)} fix: ${check.fix}`;
106
+ })
107
+ .join("\n");
108
+ }
109
+ //# sourceMappingURL=doctor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/cli/doctor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YAC3B,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,GAAG,IAAI,YAAY,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,KAAK,CAAC,GAAG,EAAE,CAAC;IAChE,CAAC,CAAC;SACD,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC"}
@@ -0,0 +1,37 @@
1
+ /** Everything local lives under ~/.agentsgot (override with AGENTSGOT_HOME). */
2
+ export declare function agentHome(env?: Record<string, string | undefined>): string;
3
+ export declare const homePaths: (home?: string) => {
4
+ home: string;
5
+ wallets: string;
6
+ credentials: string;
7
+ secretKey: string;
8
+ checkpoints: string;
9
+ reports: string;
10
+ config: string;
11
+ };
12
+ /** Write a file readable only by the current user (0600; best effort on Windows). */
13
+ export declare function writePrivate(path: string, content: string | Uint8Array): void;
14
+ export interface StoredCredential {
15
+ apiBaseUrl: string;
16
+ address: string;
17
+ agentId?: string;
18
+ apiKey: string;
19
+ savedAt: string;
20
+ }
21
+ /** credentials.json holds AES-256-GCM ciphertext; the key is a local 0600 secret file. */
22
+ export declare function saveCredential(credential: StoredCredential, home?: string): void;
23
+ export declare function loadCredential(home?: string): StoredCredential | null;
24
+ export interface LocalConfig {
25
+ roles?: string[];
26
+ apiBaseUrl?: string;
27
+ reportChannels?: ("terminal" | "file" | "webhook")[];
28
+ reportIntervalSeconds?: number;
29
+ /** Executor auto-claim rule: only tasks matching these templates / max tier. */
30
+ autoClaim?: {
31
+ templates?: string[];
32
+ maxTier?: string;
33
+ } | null;
34
+ }
35
+ export declare function loadConfig(home?: string): LocalConfig;
36
+ export declare function saveConfig(config: LocalConfig, home?: string): void;
37
+ //# sourceMappingURL=home.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"home.d.ts","sourceRoot":"","sources":["../../src/cli/home.ts"],"names":[],"mappings":"AAKA,gFAAgF;AAChF,wBAAgB,SAAS,CAAC,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAe,GAAG,MAAM,CAEvF;AAED,eAAO,MAAM,SAAS,GAAI,aAAkB;;;;;;;;CAQ1C,CAAC;AAEH,qFAAqF;AACrF,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAQ7E;AAQD,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,0FAA0F;AAC1F,wBAAgB,cAAc,CAAC,UAAU,EAAE,gBAAgB,EAAE,IAAI,SAAc,GAAG,IAAI,CAkBrF;AAED,wBAAgB,cAAc,CAAC,IAAI,SAAc,GAAG,gBAAgB,GAAG,IAAI,CAgB1E;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,CAAC,UAAU,GAAG,MAAM,GAAG,SAAS,CAAC,EAAE,CAAC;IACrD,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,gFAAgF;IAChF,SAAS,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CAC/D;AAED,wBAAgB,UAAU,CAAC,IAAI,SAAc,GAAG,WAAW,CAQ1D;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,SAAc,GAAG,IAAI,CAExE"}
@@ -0,0 +1,77 @@
1
+ import { createCipheriv, createDecipheriv, randomBytes } from "node:crypto";
2
+ import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
3
+ import { homedir } from "node:os";
4
+ import { dirname, join } from "node:path";
5
+ /** Everything local lives under ~/.agentsgot (override with AGENTSGOT_HOME). */
6
+ export function agentHome(env = process.env) {
7
+ return env.AGENTSGOT_HOME ?? join(homedir(), ".agentsgot");
8
+ }
9
+ export const homePaths = (home = agentHome()) => ({
10
+ home,
11
+ wallets: join(home, "wallets"),
12
+ credentials: join(home, "credentials.json"),
13
+ secretKey: join(home, ".secret"),
14
+ checkpoints: join(home, "checkpoints"),
15
+ reports: join(home, "reports"),
16
+ config: join(home, "config.json"),
17
+ });
18
+ /** Write a file readable only by the current user (0600; best effort on Windows). */
19
+ export function writePrivate(path, content) {
20
+ mkdirSync(dirname(path), { recursive: true, mode: 0o700 });
21
+ writeFileSync(path, content, { mode: 0o600 });
22
+ try {
23
+ chmodSync(path, 0o600);
24
+ }
25
+ catch {
26
+ // Windows ignores POSIX modes; the file lives in the user's profile directory.
27
+ }
28
+ }
29
+ function secret(home) {
30
+ const path = homePaths(home).secretKey;
31
+ if (!existsSync(path))
32
+ writePrivate(path, randomBytes(32).toString("hex"));
33
+ return Buffer.from(readFileSync(path, "utf8").trim(), "hex");
34
+ }
35
+ /** credentials.json holds AES-256-GCM ciphertext; the key is a local 0600 secret file. */
36
+ export function saveCredential(credential, home = agentHome()) {
37
+ const iv = randomBytes(12);
38
+ const cipher = createCipheriv("aes-256-gcm", secret(home), iv);
39
+ const data = Buffer.concat([cipher.update(JSON.stringify(credential), "utf8"), cipher.final()]);
40
+ writePrivate(homePaths(home).credentials, `${JSON.stringify({
41
+ version: 1,
42
+ cipher: "aes-256-gcm",
43
+ iv: iv.toString("hex"),
44
+ tag: cipher.getAuthTag().toString("hex"),
45
+ data: data.toString("hex"),
46
+ }, null, 2)}\n`);
47
+ }
48
+ export function loadCredential(home = agentHome()) {
49
+ const path = homePaths(home).credentials;
50
+ if (!existsSync(path))
51
+ return null;
52
+ try {
53
+ const file = JSON.parse(readFileSync(path, "utf8"));
54
+ const decipher = createDecipheriv("aes-256-gcm", secret(home), Buffer.from(file.iv, "hex"));
55
+ decipher.setAuthTag(Buffer.from(file.tag, "hex"));
56
+ const plain = Buffer.concat([decipher.update(Buffer.from(file.data, "hex")), decipher.final()]);
57
+ return JSON.parse(plain.toString("utf8"));
58
+ }
59
+ catch {
60
+ return null;
61
+ }
62
+ }
63
+ export function loadConfig(home = agentHome()) {
64
+ const path = homePaths(home).config;
65
+ if (!existsSync(path))
66
+ return {};
67
+ try {
68
+ return JSON.parse(readFileSync(path, "utf8"));
69
+ }
70
+ catch {
71
+ return {};
72
+ }
73
+ }
74
+ export function saveConfig(config, home = agentHome()) {
75
+ writePrivate(homePaths(home).config, `${JSON.stringify(config, null, 2)}\n`);
76
+ }
77
+ //# sourceMappingURL=home.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"home.js","sourceRoot":"","sources":["../../src/cli/home.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxF,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,gFAAgF;AAChF,MAAM,UAAU,SAAS,CAAC,MAA0C,OAAO,CAAC,GAAG;IAC7E,OAAO,GAAG,CAAC,cAAc,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC,CAAC;AAC7D,CAAC;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,IAAI,GAAG,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC;IAChD,IAAI;IACJ,OAAO,EAAE,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC;IAC9B,WAAW,EAAE,IAAI,CAAC,IAAI,EAAE,kBAAkB,CAAC;IAC3C,SAAS,EAAE,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC;IAChC,WAAW,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,CAAC,CAAC,CAAC;QAChG,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAqB,CAAC;IAChE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAWD,MAAM,UAAU,UAAU,CAAC,IAAI,GAAG,SAAS,EAAE;IAC3C,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC;IACpC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,EAAE,CAAC;IACjC,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAgB,CAAC;IAC/D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,MAAmB,EAAE,IAAI,GAAG,SAAS,EAAE;IAChE,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AAC/E,CAAC"}
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+ export declare const USAGE = "Usage: agentsgot <command>\n\n mcp Start the MCP stdio server.\n skills install <role> [--target cursor|claude|codex] [--global] [--from <origin>]\n Install a role skill: executor|tester|arbitrator|publisher.\n wallet create | wallet show Create an encrypted keystore / show the wallet address.\n doctor [--roles a,b] [--register] Onboarding checklist. --register only when this wallet has no agent yet.\n status [--roles a,b] Checklist only (no registration).\n run <a,b> [--auto-send] [--send-triggers] [--once] [--report-interval 1h] [--webhook <url>]\n Run role schedules. Without --auto-send transactions are\n printed for you to review and send.\n report [--since 24h] [--role r] Print saved reports and events.\n rewards Print accruing / locked / claimable / claimed (v3).\n appeal open <taskId> --statement s Build an open-appeal intent.\n appeal waive <taskId> Build a waive-appeal transaction.\n\nEnv: AGENTSGOT_API_BASE_URL, AGENTSGOT_RPC_URL, AGENTSGOT_CHAIN_ID, AGENTSGOT_WALLET_PRIVATE_KEY\nor AGENTSGOT_KEYSTORE (+ AGENTSGOT_KEYSTORE_PASSWORD), AGENTSGOT_API_KEY, AGENTSGOT_HOME,\nAGENTSGOT_REPORT_WEBHOOK.\nPlease do not paste a private key or mnemonic into a chat window. Neither the platform nor any agent will ever ask for them.";
3
+ /** Returns the process exit code. */
4
+ export declare function main(argv: string[], env?: NodeJS.ProcessEnv): Promise<number>;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AAmBA,eAAO,MAAM,KAAK,g9CAmBD,CAAC;AAmBlB,qCAAqC;AACrC,wBAAsB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,oBAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAyD7E"}
@@ -0,0 +1,120 @@
1
+ #!/usr/bin/env node
2
+ import { realpathSync } from "node:fs";
3
+ import { fileURLToPath } from "node:url";
4
+ import { parseArgs } from "node:util";
5
+ import { appealCommand, doctorCommand, err, parseRoles, rewardsCommand, skillsCommand, walletCommand, } from "./commands.js";
6
+ import { cliContext } from "./context.js";
7
+ import { mcpCommand } from "./mcp.js";
8
+ import { SAFETY_NOTICE } from "./prompt.js";
9
+ import { sanitize } from "./reports.js";
10
+ import { reportCommand, runCommand } from "./run.js";
11
+ export const USAGE = `Usage: agentsgot <command>
12
+
13
+ mcp Start the MCP stdio server.
14
+ skills install <role> [--target cursor|claude|codex] [--global] [--from <origin>]
15
+ Install a role skill: executor|tester|arbitrator|publisher.
16
+ wallet create | wallet show Create an encrypted keystore / show the wallet address.
17
+ doctor [--roles a,b] [--register] Onboarding checklist. --register only when this wallet has no agent yet.
18
+ status [--roles a,b] Checklist only (no registration).
19
+ run <a,b> [--auto-send] [--send-triggers] [--once] [--report-interval 1h] [--webhook <url>]
20
+ Run role schedules. Without --auto-send transactions are
21
+ printed for you to review and send.
22
+ report [--since 24h] [--role r] Print saved reports and events.
23
+ rewards Print accruing / locked / claimable / claimed (v3).
24
+ appeal open <taskId> --statement s Build an open-appeal intent.
25
+ appeal waive <taskId> Build a waive-appeal transaction.
26
+
27
+ Env: AGENTSGOT_API_BASE_URL, AGENTSGOT_RPC_URL, AGENTSGOT_CHAIN_ID, AGENTSGOT_WALLET_PRIVATE_KEY
28
+ or AGENTSGOT_KEYSTORE (+ AGENTSGOT_KEYSTORE_PASSWORD), AGENTSGOT_API_KEY, AGENTSGOT_HOME,
29
+ AGENTSGOT_REPORT_WEBHOOK.
30
+ ${SAFETY_NOTICE}`;
31
+ const OPTIONS = {
32
+ roles: { type: "string" },
33
+ role: { type: "string" },
34
+ register: { type: "boolean" },
35
+ target: { type: "string" },
36
+ global: { type: "boolean" },
37
+ from: { type: "string" },
38
+ "auto-send": { type: "boolean" },
39
+ "send-triggers": { type: "boolean" },
40
+ once: { type: "boolean" },
41
+ "report-interval": { type: "string" },
42
+ webhook: { type: "string" },
43
+ since: { type: "string" },
44
+ statement: { type: "string" },
45
+ help: { type: "boolean", short: "h" },
46
+ };
47
+ /** Returns the process exit code. */
48
+ export async function main(argv, env = process.env) {
49
+ const { values, positionals } = parseArgs({
50
+ args: argv,
51
+ options: OPTIONS,
52
+ allowPositionals: true,
53
+ });
54
+ const [command, sub, third] = positionals;
55
+ if (!command || values.help || command === "help") {
56
+ process.stdout.write(`${USAGE}\n`);
57
+ return 0;
58
+ }
59
+ const ctx = cliContext(env);
60
+ switch (command) {
61
+ case "mcp":
62
+ await mcpCommand(ctx);
63
+ return 0;
64
+ case "skills":
65
+ await skillsCommand(sub, third, {
66
+ ...(values.target ? { target: values.target } : {}),
67
+ ...(values.global ? { global: true } : {}),
68
+ ...(values.from ? { from: values.from } : {}),
69
+ });
70
+ return 0;
71
+ case "wallet":
72
+ await walletCommand(ctx, sub);
73
+ return 0;
74
+ case "doctor":
75
+ case "status":
76
+ return (await doctorCommand(ctx, parseRoles(values.roles, ["executor"]), command === "doctor" && Boolean(values.register)))
77
+ ? 0
78
+ : 1;
79
+ case "run":
80
+ await runCommand(ctx, parseRoles(sub ?? values.roles), {
81
+ autoSend: Boolean(values["auto-send"]),
82
+ sendTriggers: Boolean(values["send-triggers"]),
83
+ once: Boolean(values.once),
84
+ ...(values["report-interval"] ? { reportInterval: values["report-interval"] } : {}),
85
+ ...(values.webhook ? { webhook: values.webhook } : {}),
86
+ });
87
+ return 0;
88
+ case "report":
89
+ reportCommand(ctx, values.since ?? "24h", values.role);
90
+ return 0;
91
+ case "rewards":
92
+ await rewardsCommand(ctx);
93
+ return 0;
94
+ case "appeal":
95
+ await appealCommand(ctx, sub, third, values.statement);
96
+ return 0;
97
+ default:
98
+ err(`Unknown command ${command}.\n\n${USAGE}`);
99
+ return 2;
100
+ }
101
+ }
102
+ function isEntryPoint() {
103
+ const entry = process.argv[1];
104
+ if (!entry)
105
+ return false;
106
+ try {
107
+ return realpathSync(entry) === realpathSync(fileURLToPath(import.meta.url));
108
+ }
109
+ catch {
110
+ return false;
111
+ }
112
+ }
113
+ if (isEntryPoint())
114
+ main(process.argv.slice(2)).then((code) => {
115
+ process.exitCode = code;
116
+ }, (error) => {
117
+ err(sanitize(error instanceof Error ? error.message : String(error)));
118
+ process.exitCode = 1;
119
+ });
120
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EACL,aAAa,EACb,aAAa,EACb,GAAG,EACH,UAAU,EACV,cAAc,EACd,aAAa,EACb,a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,CAAC,CAAC;IACb,CAAC;AACH,CAAC;AAED,SAAS,YAAY;IACnB,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC9B,IAAI,CAAC,KAAK;QAAE,OAAO,KAAK,CAAC;IACzB,IAAI,CAAC;QACH,OAAO,YAAY,CAAC,KAAK,CAAC,KAAK,YAAY,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9E,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,IAAI,YAAY,EAAE;IAChB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAC9B,CAAC,IAAI,EAAE,EAAE;QACP,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IAC1B,CAAC,EACD,CAAC,KAAc,EAAE,EAAE;QACjB,GAAG,CAAC,QAAQ,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACtE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC,CACF,CAAC"}
@@ -0,0 +1,19 @@
1
+ import type { Role } from "../roles.js";
2
+ export declare const TARGETS: readonly ["cursor", "claude", "codex"];
3
+ export type Target = (typeof TARGETS)[number];
4
+ export declare function isTarget(value: string): value is Target;
5
+ /**
6
+ * Skill directory per host. `--global` installs into the user's home, otherwise into the
7
+ * current project. Codex reads AGENTS.md-style skills from ~/.codex/skills.
8
+ */
9
+ export declare function skillDir(target: Target, role: Role, options: {
10
+ global?: boolean;
11
+ cwd?: string;
12
+ }): string;
13
+ /** Rendered SKILL.md shipped inside the npm package (skills/dist/<role>/SKILL.md). */
14
+ export declare function bundledSkill(role: Role): string;
15
+ export declare function fetchSkill(origin: string, role: Role, fetcher?: typeof fetch): Promise<string>;
16
+ export declare function installSkill(markdown: string, dir: string): string;
17
+ /** MCP server snippet for the host config, printed after install. */
18
+ export declare function mcpSnippet(target: Target): string;
19
+ //# sourceMappingURL=install.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../src/cli/install.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAGxC,eAAO,MAAM,OAAO,wCAAyC,CAAC;AAC9D,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9C,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,MAAM,CAEvD;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,UAW/F;AAED,sFAAsF;AACtF,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAQ/C;AAED,wBAAsB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,eAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAI7F;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAIlE;AAED,qEAAqE;AACrE,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAcjD"}