project-cpu-mcp 0.10.0 → 0.12.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 (574) hide show
  1. package/README.md +111 -35
  2. package/dist/api/authentication-required.error.d.ts +6 -0
  3. package/dist/api/authentication-required.error.d.ts.map +1 -0
  4. package/dist/api/authentication-required.error.js +9 -0
  5. package/dist/api/authentication-required.error.js.map +1 -0
  6. package/dist/api/client.d.ts +7 -5
  7. package/dist/api/client.d.ts.map +1 -1
  8. package/dist/api/client.js +29 -14
  9. package/dist/api/client.js.map +1 -1
  10. package/dist/api/constants.d.ts +2 -0
  11. package/dist/api/constants.d.ts.map +1 -1
  12. package/dist/api/constants.js +6 -0
  13. package/dist/api/constants.js.map +1 -1
  14. package/dist/api/types.d.ts +189 -220
  15. package/dist/api/types.d.ts.map +1 -1
  16. package/dist/api/types.js +43 -29
  17. package/dist/api/types.js.map +1 -1
  18. package/dist/config/constants.d.ts +6 -2
  19. package/dist/config/constants.d.ts.map +1 -1
  20. package/dist/config/constants.js +6 -2
  21. package/dist/config/constants.js.map +1 -1
  22. package/dist/config/types.js +2 -2
  23. package/dist/config/types.js.map +1 -1
  24. package/dist/contracts/cell.abi.d.ts +26 -2
  25. package/dist/contracts/cell.abi.d.ts.map +1 -1
  26. package/dist/contracts/cell.abi.js +21 -2
  27. package/dist/contracts/cell.abi.js.map +1 -1
  28. package/dist/contracts/erc20.abi.d.ts.map +1 -1
  29. package/dist/contracts/erc20.abi.js +1 -2
  30. package/dist/contracts/erc20.abi.js.map +1 -1
  31. package/dist/contracts/trade.abi.d.ts +341 -0
  32. package/dist/contracts/trade.abi.d.ts.map +1 -1
  33. package/dist/contracts/trade.abi.js +163 -0
  34. package/dist/contracts/trade.abi.js.map +1 -1
  35. package/dist/contracts/trade.types.d.ts +14 -0
  36. package/dist/contracts/trade.types.d.ts.map +1 -0
  37. package/dist/contracts/trade.types.js +15 -0
  38. package/dist/contracts/trade.types.js.map +1 -0
  39. package/dist/contracts/transport.abi.d.ts +4 -0
  40. package/dist/contracts/transport.abi.d.ts.map +1 -1
  41. package/dist/contracts/transport.abi.js +1 -0
  42. package/dist/contracts/transport.abi.js.map +1 -1
  43. package/dist/index.js +40 -3
  44. package/dist/index.js.map +1 -1
  45. package/dist/logger/constants.d.ts +7 -0
  46. package/dist/logger/constants.d.ts.map +1 -1
  47. package/dist/logger/constants.js +11 -0
  48. package/dist/logger/constants.js.map +1 -1
  49. package/dist/logger/file-log.utils.d.ts +4 -0
  50. package/dist/logger/file-log.utils.d.ts.map +1 -0
  51. package/dist/logger/file-log.utils.js +23 -0
  52. package/dist/logger/file-log.utils.js.map +1 -0
  53. package/dist/logger/index.d.ts +1 -1
  54. package/dist/logger/index.d.ts.map +1 -1
  55. package/dist/logger/index.js +5 -3
  56. package/dist/logger/index.js.map +1 -1
  57. package/dist/logger/logger.d.ts +4 -0
  58. package/dist/logger/logger.d.ts.map +1 -1
  59. package/dist/logger/logger.js +48 -3
  60. package/dist/logger/logger.js.map +1 -1
  61. package/dist/logger/redact.utils.d.ts.map +1 -1
  62. package/dist/logger/redact.utils.js +7 -2
  63. package/dist/logger/redact.utils.js.map +1 -1
  64. package/dist/logger/types.d.ts +8 -0
  65. package/dist/logger/types.d.ts.map +1 -1
  66. package/dist/map/attention.utils.d.ts.map +1 -1
  67. package/dist/map/attention.utils.js +1 -0
  68. package/dist/map/attention.utils.js.map +1 -1
  69. package/dist/map/cell-view.utils.d.ts.map +1 -1
  70. package/dist/map/cell-view.utils.js +5 -3
  71. package/dist/map/cell-view.utils.js.map +1 -1
  72. package/dist/map/process-projection.utils.js +2 -2
  73. package/dist/map/process-projection.utils.js.map +1 -1
  74. package/dist/map/reader.utils.d.ts.map +1 -1
  75. package/dist/map/reader.utils.js +3 -2
  76. package/dist/map/reader.utils.js.map +1 -1
  77. package/dist/map/storage.utils.d.ts.map +1 -1
  78. package/dist/map/storage.utils.js +5 -1
  79. package/dist/map/storage.utils.js.map +1 -1
  80. package/dist/map/types.d.ts +21 -0
  81. package/dist/map/types.d.ts.map +1 -1
  82. package/dist/map/types.js +6 -0
  83. package/dist/map/types.js.map +1 -1
  84. package/dist/paybox/auth/authority.d.ts +46 -0
  85. package/dist/paybox/auth/authority.d.ts.map +1 -0
  86. package/dist/paybox/auth/authority.js +410 -0
  87. package/dist/paybox/auth/authority.js.map +1 -0
  88. package/dist/paybox/auth/browser-opener.d.ts +8 -0
  89. package/dist/paybox/auth/browser-opener.d.ts.map +1 -0
  90. package/dist/paybox/auth/browser-opener.js +22 -0
  91. package/dist/paybox/auth/browser-opener.js.map +1 -0
  92. package/dist/paybox/auth/browser-opener.utils.d.ts +2 -0
  93. package/dist/paybox/auth/browser-opener.utils.d.ts.map +1 -0
  94. package/dist/paybox/auth/browser-opener.utils.js +10 -0
  95. package/dist/paybox/auth/browser-opener.utils.js.map +1 -0
  96. package/dist/paybox/auth/constants.d.ts +16 -0
  97. package/dist/paybox/auth/constants.d.ts.map +1 -0
  98. package/dist/paybox/auth/constants.js +16 -0
  99. package/dist/paybox/auth/constants.js.map +1 -0
  100. package/dist/paybox/auth/coordinator.d.ts +21 -0
  101. package/dist/paybox/auth/coordinator.d.ts.map +1 -0
  102. package/dist/paybox/auth/coordinator.factory.d.ts +5 -0
  103. package/dist/paybox/auth/coordinator.factory.d.ts.map +1 -0
  104. package/dist/paybox/auth/coordinator.factory.js +5 -0
  105. package/dist/paybox/auth/coordinator.factory.js.map +1 -0
  106. package/dist/paybox/auth/coordinator.js +87 -0
  107. package/dist/paybox/auth/coordinator.js.map +1 -0
  108. package/dist/paybox/auth/coordinator.utils.d.ts +4 -0
  109. package/dist/paybox/auth/coordinator.utils.d.ts.map +1 -0
  110. package/dist/paybox/auth/coordinator.utils.js +8 -0
  111. package/dist/paybox/auth/coordinator.utils.js.map +1 -0
  112. package/dist/paybox/auth/flow-session.d.ts +24 -0
  113. package/dist/paybox/auth/flow-session.d.ts.map +1 -0
  114. package/dist/paybox/auth/flow-session.js +155 -0
  115. package/dist/paybox/auth/flow-session.js.map +1 -0
  116. package/dist/paybox/auth/loopback-flow.d.ts +49 -0
  117. package/dist/paybox/auth/loopback-flow.d.ts.map +1 -0
  118. package/dist/paybox/auth/loopback-flow.js +381 -0
  119. package/dist/paybox/auth/loopback-flow.js.map +1 -0
  120. package/dist/paybox/auth/loopback-flow.utils.d.ts +7 -0
  121. package/dist/paybox/auth/loopback-flow.utils.d.ts.map +1 -0
  122. package/dist/paybox/auth/loopback-flow.utils.js +47 -0
  123. package/dist/paybox/auth/loopback-flow.utils.js.map +1 -0
  124. package/dist/paybox/auth/loopback-page-fonts.constants.d.ts +3 -0
  125. package/dist/paybox/auth/loopback-page-fonts.constants.d.ts.map +1 -0
  126. package/dist/paybox/auth/loopback-page-fonts.constants.js +228 -0
  127. package/dist/paybox/auth/loopback-page-fonts.constants.js.map +1 -0
  128. package/dist/paybox/auth/loopback-page.utils.d.ts +4 -0
  129. package/dist/paybox/auth/loopback-page.utils.d.ts.map +1 -0
  130. package/dist/paybox/auth/loopback-page.utils.js +261 -0
  131. package/dist/paybox/auth/loopback-page.utils.js.map +1 -0
  132. package/dist/paybox/auth/provisioning.utils.d.ts +3 -0
  133. package/dist/paybox/auth/provisioning.utils.d.ts.map +1 -0
  134. package/dist/paybox/auth/provisioning.utils.js +27 -0
  135. package/dist/paybox/auth/provisioning.utils.js.map +1 -0
  136. package/dist/paybox/auth/signing-key.utils.d.ts +2 -0
  137. package/dist/paybox/auth/signing-key.utils.d.ts.map +1 -0
  138. package/dist/paybox/auth/signing-key.utils.js +14 -0
  139. package/dist/paybox/auth/signing-key.utils.js.map +1 -0
  140. package/dist/paybox/auth/types.d.ts +18 -0
  141. package/dist/paybox/auth/types.d.ts.map +1 -0
  142. package/dist/paybox/auth/types.js +6 -0
  143. package/dist/paybox/auth/types.js.map +1 -0
  144. package/dist/paybox/auth/utils.d.ts +5 -0
  145. package/dist/paybox/auth/utils.d.ts.map +1 -0
  146. package/dist/paybox/auth/utils.js +17 -0
  147. package/dist/paybox/auth/utils.js.map +1 -0
  148. package/dist/paybox/constants.d.ts +11 -0
  149. package/dist/paybox/constants.d.ts.map +1 -0
  150. package/dist/paybox/constants.js +11 -0
  151. package/dist/paybox/constants.js.map +1 -0
  152. package/dist/paybox/errors.d.ts +43 -0
  153. package/dist/paybox/errors.d.ts.map +1 -0
  154. package/dist/paybox/errors.js +141 -0
  155. package/dist/paybox/errors.js.map +1 -0
  156. package/dist/paybox/sdk/adapter.d.ts +16 -0
  157. package/dist/paybox/sdk/adapter.d.ts.map +1 -0
  158. package/dist/paybox/sdk/adapter.js +127 -0
  159. package/dist/paybox/sdk/adapter.js.map +1 -0
  160. package/dist/paybox/sdk/constants.d.ts +14 -0
  161. package/dist/paybox/sdk/constants.d.ts.map +1 -0
  162. package/dist/paybox/sdk/constants.js +23 -0
  163. package/dist/paybox/sdk/constants.js.map +1 -0
  164. package/dist/paybox/sdk/factory.d.ts +4 -0
  165. package/dist/paybox/sdk/factory.d.ts.map +1 -0
  166. package/dist/paybox/sdk/factory.js +24 -0
  167. package/dist/paybox/sdk/factory.js.map +1 -0
  168. package/dist/paybox/sdk/logging.utils.d.ts +4 -0
  169. package/dist/paybox/sdk/logging.utils.d.ts.map +1 -0
  170. package/dist/paybox/sdk/logging.utils.js +19 -0
  171. package/dist/paybox/sdk/logging.utils.js.map +1 -0
  172. package/dist/paybox/sdk/utils.d.ts +7 -0
  173. package/dist/paybox/sdk/utils.d.ts.map +1 -0
  174. package/dist/paybox/sdk/utils.js +182 -0
  175. package/dist/paybox/sdk/utils.js.map +1 -0
  176. package/dist/paybox/storage.d.ts +17 -0
  177. package/dist/paybox/storage.d.ts.map +1 -0
  178. package/dist/paybox/storage.js +87 -0
  179. package/dist/paybox/storage.js.map +1 -0
  180. package/dist/paybox/types.d.ts +481 -0
  181. package/dist/paybox/types.d.ts.map +1 -0
  182. package/dist/paybox/types.js +144 -0
  183. package/dist/paybox/types.js.map +1 -0
  184. package/dist/paybox/wallet/manager.d.ts +22 -0
  185. package/dist/paybox/wallet/manager.d.ts.map +1 -0
  186. package/dist/paybox/wallet/manager.js +111 -0
  187. package/dist/paybox/wallet/manager.js.map +1 -0
  188. package/dist/paybox/wallet/rpc.client.d.ts +16 -0
  189. package/dist/paybox/wallet/rpc.client.d.ts.map +1 -0
  190. package/dist/paybox/wallet/rpc.client.js +53 -0
  191. package/dist/paybox/wallet/rpc.client.js.map +1 -0
  192. package/dist/paybox/wallet/utils.d.ts +5 -0
  193. package/dist/paybox/wallet/utils.d.ts.map +1 -0
  194. package/dist/paybox/wallet/utils.js +82 -0
  195. package/dist/paybox/wallet/utils.js.map +1 -0
  196. package/dist/server.constants.d.ts.map +1 -1
  197. package/dist/server.constants.js +5 -2
  198. package/dist/server.constants.js.map +1 -1
  199. package/dist/server.d.ts.map +1 -1
  200. package/dist/server.js +8 -2
  201. package/dist/server.js.map +1 -1
  202. package/dist/services/app-config.utils.d.ts.map +1 -1
  203. package/dist/services/app-config.utils.js +22 -11
  204. package/dist/services/app-config.utils.js.map +1 -1
  205. package/dist/services/auth.service.d.ts +3 -5
  206. package/dist/services/auth.service.d.ts.map +1 -1
  207. package/dist/services/auth.service.js +20 -77
  208. package/dist/services/auth.service.js.map +1 -1
  209. package/dist/services/cell.client.d.ts.map +1 -1
  210. package/dist/services/cell.client.js +22 -9
  211. package/dist/services/cell.client.js.map +1 -1
  212. package/dist/services/lot-return.constants.d.ts +3 -0
  213. package/dist/services/lot-return.constants.d.ts.map +1 -0
  214. package/dist/services/lot-return.constants.js +35 -0
  215. package/dist/services/lot-return.constants.js.map +1 -0
  216. package/dist/services/lot-return.service.d.ts +25 -0
  217. package/dist/services/lot-return.service.d.ts.map +1 -0
  218. package/dist/services/lot-return.service.js +151 -0
  219. package/dist/services/lot-return.service.js.map +1 -0
  220. package/dist/services/lot-return.types.d.ts +19 -0
  221. package/dist/services/lot-return.types.d.ts.map +1 -0
  222. package/dist/services/lot-return.types.js +2 -0
  223. package/dist/services/lot-return.types.js.map +1 -0
  224. package/dist/services/lot-return.utils.d.ts +33 -0
  225. package/dist/services/lot-return.utils.d.ts.map +1 -0
  226. package/dist/services/lot-return.utils.js +128 -0
  227. package/dist/services/lot-return.utils.js.map +1 -0
  228. package/dist/services/lot-terms.constants.d.ts +4 -0
  229. package/dist/services/lot-terms.constants.d.ts.map +1 -0
  230. package/dist/services/lot-terms.constants.js +5 -0
  231. package/dist/services/lot-terms.constants.js.map +1 -0
  232. package/dist/services/lot-terms.helpers.d.ts +11 -0
  233. package/dist/services/lot-terms.helpers.d.ts.map +1 -0
  234. package/dist/services/lot-terms.helpers.js +45 -0
  235. package/dist/services/lot-terms.helpers.js.map +1 -0
  236. package/dist/services/lot-terms.service.d.ts +20 -0
  237. package/dist/services/lot-terms.service.d.ts.map +1 -0
  238. package/dist/services/lot-terms.service.js +119 -0
  239. package/dist/services/lot-terms.service.js.map +1 -0
  240. package/dist/services/lot-terms.types.d.ts +25 -0
  241. package/dist/services/lot-terms.types.d.ts.map +1 -0
  242. package/dist/services/lot-terms.types.js +2 -0
  243. package/dist/services/lot-terms.types.js.map +1 -0
  244. package/dist/services/reveal-revert.utils.d.ts +1 -0
  245. package/dist/services/reveal-revert.utils.d.ts.map +1 -1
  246. package/dist/services/reveal-revert.utils.js +20 -0
  247. package/dist/services/reveal-revert.utils.js.map +1 -1
  248. package/dist/services/reveal.constants.d.ts +1 -1
  249. package/dist/services/reveal.constants.d.ts.map +1 -1
  250. package/dist/services/reveal.constants.js +1 -1
  251. package/dist/services/reveal.constants.js.map +1 -1
  252. package/dist/services/reveal.service.d.ts +4 -3
  253. package/dist/services/reveal.service.d.ts.map +1 -1
  254. package/dist/services/reveal.service.js +35 -10
  255. package/dist/services/reveal.service.js.map +1 -1
  256. package/dist/services/reveal.utils.d.ts +7 -8
  257. package/dist/services/reveal.utils.d.ts.map +1 -1
  258. package/dist/services/reveal.utils.js +15 -8
  259. package/dist/services/reveal.utils.js.map +1 -1
  260. package/dist/services/route.constants.d.ts +12 -1
  261. package/dist/services/route.constants.d.ts.map +1 -1
  262. package/dist/services/route.constants.js +66 -15
  263. package/dist/services/route.constants.js.map +1 -1
  264. package/dist/services/route.lots.d.ts +18 -0
  265. package/dist/services/route.lots.d.ts.map +1 -0
  266. package/dist/services/route.lots.js +33 -0
  267. package/dist/services/route.lots.js.map +1 -0
  268. package/dist/services/route.service.d.ts +13 -4
  269. package/dist/services/route.service.d.ts.map +1 -1
  270. package/dist/services/route.service.js +95 -13
  271. package/dist/services/route.service.js.map +1 -1
  272. package/dist/services/route.types.d.ts +76 -0
  273. package/dist/services/route.types.d.ts.map +1 -0
  274. package/dist/services/route.types.js +8 -0
  275. package/dist/services/route.types.js.map +1 -0
  276. package/dist/services/route.utils.d.ts +19 -0
  277. package/dist/services/route.utils.d.ts.map +1 -1
  278. package/dist/services/route.utils.js +35 -0
  279. package/dist/services/route.utils.js.map +1 -1
  280. package/dist/services/trade-eviction.constants.d.ts +12 -0
  281. package/dist/services/trade-eviction.constants.d.ts.map +1 -0
  282. package/dist/services/trade-eviction.constants.js +25 -0
  283. package/dist/services/trade-eviction.constants.js.map +1 -0
  284. package/dist/services/trade-eviction.service.d.ts +22 -0
  285. package/dist/services/trade-eviction.service.d.ts.map +1 -0
  286. package/dist/services/trade-eviction.service.js +101 -0
  287. package/dist/services/trade-eviction.service.js.map +1 -0
  288. package/dist/services/trade-eviction.types.d.ts +30 -0
  289. package/dist/services/trade-eviction.types.d.ts.map +1 -0
  290. package/dist/services/trade-eviction.types.js +2 -0
  291. package/dist/services/trade-eviction.types.js.map +1 -0
  292. package/dist/services/trade-eviction.utils.d.ts +9 -0
  293. package/dist/services/trade-eviction.utils.d.ts.map +1 -0
  294. package/dist/services/trade-eviction.utils.js +38 -0
  295. package/dist/services/trade-eviction.utils.js.map +1 -0
  296. package/dist/services/trade-rules.service.d.ts +15 -0
  297. package/dist/services/trade-rules.service.d.ts.map +1 -0
  298. package/dist/services/trade-rules.service.js +45 -0
  299. package/dist/services/trade-rules.service.js.map +1 -0
  300. package/dist/services/trade.client.d.ts +11 -1
  301. package/dist/services/trade.client.d.ts.map +1 -1
  302. package/dist/services/trade.client.js +87 -0
  303. package/dist/services/trade.client.js.map +1 -1
  304. package/dist/services/trade.constants.d.ts +9 -0
  305. package/dist/services/trade.constants.d.ts.map +1 -0
  306. package/dist/services/trade.constants.js +28 -0
  307. package/dist/services/trade.constants.js.map +1 -0
  308. package/dist/services/trade.helpers.d.ts +9 -1
  309. package/dist/services/trade.helpers.d.ts.map +1 -1
  310. package/dist/services/trade.helpers.js +40 -27
  311. package/dist/services/trade.helpers.js.map +1 -1
  312. package/dist/services/transport-revert.utils.d.ts +3 -0
  313. package/dist/services/transport-revert.utils.d.ts.map +1 -0
  314. package/dist/services/transport-revert.utils.js +15 -0
  315. package/dist/services/transport-revert.utils.js.map +1 -0
  316. package/dist/services/transport.client.d.ts.map +1 -1
  317. package/dist/services/transport.client.js +14 -6
  318. package/dist/services/transport.client.js.map +1 -1
  319. package/dist/services/types.d.ts +249 -21
  320. package/dist/services/types.d.ts.map +1 -1
  321. package/dist/services/types.js +25 -0
  322. package/dist/services/types.js.map +1 -1
  323. package/dist/services/warehouse.utils.d.ts +8 -0
  324. package/dist/services/warehouse.utils.d.ts.map +1 -1
  325. package/dist/services/warehouse.utils.js +25 -0
  326. package/dist/services/warehouse.utils.js.map +1 -1
  327. package/dist/session/manager.d.ts +1 -0
  328. package/dist/session/manager.d.ts.map +1 -1
  329. package/dist/session/manager.js +13 -0
  330. package/dist/session/manager.js.map +1 -1
  331. package/dist/session/storage.d.ts +0 -3
  332. package/dist/session/storage.d.ts.map +1 -1
  333. package/dist/session/storage.js +6 -43
  334. package/dist/session/storage.js.map +1 -1
  335. package/dist/session/types.d.ts +4 -98
  336. package/dist/session/types.d.ts.map +1 -1
  337. package/dist/session/types.js +0 -15
  338. package/dist/session/types.js.map +1 -1
  339. package/dist/tools/authenticate.d.ts +1 -1
  340. package/dist/tools/authenticate.d.ts.map +1 -1
  341. package/dist/tools/authenticate.js +19 -45
  342. package/dist/tools/authenticate.js.map +1 -1
  343. package/dist/tools/config/get-game-config/constants.d.ts +3 -0
  344. package/dist/tools/config/get-game-config/constants.d.ts.map +1 -1
  345. package/dist/tools/config/get-game-config/constants.js +13 -2
  346. package/dist/tools/config/get-game-config/constants.js.map +1 -1
  347. package/dist/tools/config/get-game-config/get-game-config.d.ts.map +1 -1
  348. package/dist/tools/config/get-game-config/get-game-config.js +6 -3
  349. package/dist/tools/config/get-game-config/get-game-config.js.map +1 -1
  350. package/dist/tools/config/get-game-config/get-game-config.utils.d.ts +4 -4
  351. package/dist/tools/config/get-game-config/get-game-config.utils.d.ts.map +1 -1
  352. package/dist/tools/config/get-game-config/get-game-config.utils.js +26 -9
  353. package/dist/tools/config/get-game-config/get-game-config.utils.js.map +1 -1
  354. package/dist/tools/config/get-game-config/types.d.ts +6 -2
  355. package/dist/tools/config/get-game-config/types.d.ts.map +1 -1
  356. package/dist/tools/config/resource-lens/resource-lens.utils.d.ts.map +1 -1
  357. package/dist/tools/config/resource-lens/resource-lens.utils.js +5 -4
  358. package/dist/tools/config/resource-lens/resource-lens.utils.js.map +1 -1
  359. package/dist/tools/map/attention/attention.d.ts.map +1 -1
  360. package/dist/tools/map/attention/attention.js +16 -5
  361. package/dist/tools/map/attention/attention.js.map +1 -1
  362. package/dist/tools/map/attention/constants.d.ts +6 -0
  363. package/dist/tools/map/attention/constants.d.ts.map +1 -1
  364. package/dist/tools/map/attention/constants.js +16 -2
  365. package/dist/tools/map/attention/constants.js.map +1 -1
  366. package/dist/tools/map/attention/evicted.service.d.ts +19 -0
  367. package/dist/tools/map/attention/evicted.service.d.ts.map +1 -0
  368. package/dist/tools/map/attention/evicted.service.js +73 -0
  369. package/dist/tools/map/attention/evicted.service.js.map +1 -0
  370. package/dist/tools/map/attention/evicted.utils.d.ts +16 -0
  371. package/dist/tools/map/attention/evicted.utils.d.ts.map +1 -0
  372. package/dist/tools/map/attention/evicted.utils.js +72 -0
  373. package/dist/tools/map/attention/evicted.utils.js.map +1 -0
  374. package/dist/tools/map/attention/panel.utils.d.ts.map +1 -1
  375. package/dist/tools/map/attention/panel.utils.js +1 -0
  376. package/dist/tools/map/attention/panel.utils.js.map +1 -1
  377. package/dist/tools/map/attention/types.d.ts +17 -0
  378. package/dist/tools/map/attention/types.d.ts.map +1 -1
  379. package/dist/tools/map/attention/types.js.map +1 -1
  380. package/dist/tools/map/get-map/constants.d.ts.map +1 -1
  381. package/dist/tools/map/get-map/constants.js +4 -2
  382. package/dist/tools/map/get-map/constants.js.map +1 -1
  383. package/dist/tools/reveal/constants.d.ts.map +1 -1
  384. package/dist/tools/reveal/constants.js +3 -1
  385. package/dist/tools/reveal/constants.js.map +1 -1
  386. package/dist/tools/trade/buy-lot/buy-lot.d.ts.map +1 -1
  387. package/dist/tools/trade/buy-lot/buy-lot.js +2 -0
  388. package/dist/tools/trade/buy-lot/buy-lot.js.map +1 -1
  389. package/dist/tools/trade/buy-lot/constants.d.ts.map +1 -1
  390. package/dist/tools/trade/buy-lot/constants.js +2 -0
  391. package/dist/tools/trade/buy-lot/constants.js.map +1 -1
  392. package/dist/tools/trade/buyer-guard/constants.d.ts +4 -0
  393. package/dist/tools/trade/buyer-guard/constants.d.ts.map +1 -0
  394. package/dist/tools/trade/buyer-guard/constants.js +11 -0
  395. package/dist/tools/trade/buyer-guard/constants.js.map +1 -0
  396. package/dist/tools/trade/buyer-guard/lot-open.guard.d.ts +9 -0
  397. package/dist/tools/trade/buyer-guard/lot-open.guard.d.ts.map +1 -0
  398. package/dist/tools/trade/buyer-guard/lot-open.guard.js +15 -0
  399. package/dist/tools/trade/buyer-guard/lot-open.guard.js.map +1 -0
  400. package/dist/tools/trade/buyer-guard/types.d.ts +6 -0
  401. package/dist/tools/trade/buyer-guard/types.d.ts.map +1 -0
  402. package/dist/tools/trade/buyer-guard/types.js +2 -0
  403. package/dist/tools/trade/buyer-guard/types.js.map +1 -0
  404. package/dist/tools/trade/constants.d.ts +5 -0
  405. package/dist/tools/trade/constants.d.ts.map +1 -0
  406. package/dist/tools/trade/constants.js +14 -0
  407. package/dist/tools/trade/constants.js.map +1 -0
  408. package/dist/tools/trade/create-lot/constants.d.ts.map +1 -1
  409. package/dist/tools/trade/create-lot/constants.js +4 -1
  410. package/dist/tools/trade/create-lot/constants.js.map +1 -1
  411. package/dist/tools/trade/create-lot/create-lot.d.ts +2 -1
  412. package/dist/tools/trade/create-lot/create-lot.d.ts.map +1 -1
  413. package/dist/tools/trade/create-lot/create-lot.js +15 -1
  414. package/dist/tools/trade/create-lot/create-lot.js.map +1 -1
  415. package/dist/tools/trade/evict-lot/constants.d.ts +4 -0
  416. package/dist/tools/trade/evict-lot/constants.d.ts.map +1 -0
  417. package/dist/tools/trade/evict-lot/constants.js +13 -0
  418. package/dist/tools/trade/evict-lot/constants.js.map +1 -0
  419. package/dist/tools/trade/evict-lot/evict-lot.d.ts +6 -0
  420. package/dist/tools/trade/evict-lot/evict-lot.d.ts.map +1 -0
  421. package/dist/tools/trade/evict-lot/evict-lot.js +35 -0
  422. package/dist/tools/trade/evict-lot/evict-lot.js.map +1 -0
  423. package/dist/tools/trade/evict-lot/format.utils.d.ts +5 -0
  424. package/dist/tools/trade/evict-lot/format.utils.d.ts.map +1 -0
  425. package/dist/tools/trade/evict-lot/format.utils.js +10 -0
  426. package/dist/tools/trade/evict-lot/format.utils.js.map +1 -0
  427. package/dist/tools/trade/evict-lot/types.d.ts +5 -0
  428. package/dist/tools/trade/evict-lot/types.d.ts.map +1 -0
  429. package/dist/tools/trade/evict-lot/types.js +8 -0
  430. package/dist/tools/trade/evict-lot/types.js.map +1 -0
  431. package/dist/tools/trade/format.utils.d.ts +2 -4
  432. package/dist/tools/trade/format.utils.d.ts.map +1 -1
  433. package/dist/tools/trade/format.utils.js +11 -13
  434. package/dist/tools/trade/format.utils.js.map +1 -1
  435. package/dist/tools/trade/get-lot/constants.d.ts.map +1 -1
  436. package/dist/tools/trade/get-lot/constants.js +2 -1
  437. package/dist/tools/trade/get-lot/constants.js.map +1 -1
  438. package/dist/tools/trade/list-lots/constants.d.ts +2 -0
  439. package/dist/tools/trade/list-lots/constants.d.ts.map +1 -1
  440. package/dist/tools/trade/list-lots/constants.js +5 -1
  441. package/dist/tools/trade/list-lots/constants.js.map +1 -1
  442. package/dist/tools/trade/list-lots/list-lots.d.ts.map +1 -1
  443. package/dist/tools/trade/list-lots/list-lots.js +2 -1
  444. package/dist/tools/trade/list-lots/list-lots.js.map +1 -1
  445. package/dist/tools/trade/list-lots/list-lots.utils.d.ts +8 -0
  446. package/dist/tools/trade/list-lots/list-lots.utils.d.ts.map +1 -0
  447. package/dist/tools/trade/list-lots/list-lots.utils.js +10 -0
  448. package/dist/tools/trade/list-lots/list-lots.utils.js.map +1 -0
  449. package/dist/tools/trade/list-mine/constants.d.ts.map +1 -1
  450. package/dist/tools/trade/list-mine/constants.js +3 -1
  451. package/dist/tools/trade/list-mine/constants.js.map +1 -1
  452. package/dist/tools/trade/lot-terms/constants.d.ts +5 -0
  453. package/dist/tools/trade/lot-terms/constants.d.ts.map +1 -0
  454. package/dist/tools/trade/lot-terms/constants.js +13 -0
  455. package/dist/tools/trade/lot-terms/constants.js.map +1 -0
  456. package/dist/tools/trade/lot-terms/factory.d.ts +4 -0
  457. package/dist/tools/trade/lot-terms/factory.d.ts.map +1 -0
  458. package/dist/tools/trade/lot-terms/factory.js +14 -0
  459. package/dist/tools/trade/lot-terms/factory.js.map +1 -0
  460. package/dist/tools/trade/lot-terms/format.utils.d.ts +4 -0
  461. package/dist/tools/trade/lot-terms/format.utils.d.ts.map +1 -0
  462. package/dist/tools/trade/lot-terms/format.utils.js +30 -0
  463. package/dist/tools/trade/lot-terms/format.utils.js.map +1 -0
  464. package/dist/tools/trade/lot-terms/lot-terms.d.ts +5 -0
  465. package/dist/tools/trade/lot-terms/lot-terms.d.ts.map +1 -0
  466. package/dist/tools/trade/lot-terms/lot-terms.js +23 -0
  467. package/dist/tools/trade/lot-terms/lot-terms.js.map +1 -0
  468. package/dist/tools/trade/lot-terms/types.d.ts +6 -0
  469. package/dist/tools/trade/lot-terms/types.d.ts.map +1 -0
  470. package/dist/tools/trade/lot-terms/types.js +7 -0
  471. package/dist/tools/trade/lot-terms/types.js.map +1 -0
  472. package/dist/tools/trade/market-index/constants.d.ts.map +1 -1
  473. package/dist/tools/trade/market-index/constants.js +2 -0
  474. package/dist/tools/trade/market-index/constants.js.map +1 -1
  475. package/dist/tools/trade/markets/constants.d.ts.map +1 -1
  476. package/dist/tools/trade/markets/constants.js +2 -1
  477. package/dist/tools/trade/markets/constants.js.map +1 -1
  478. package/dist/tools/trade/quote-buy/constants.d.ts.map +1 -1
  479. package/dist/tools/trade/quote-buy/constants.js +4 -2
  480. package/dist/tools/trade/quote-buy/constants.js.map +1 -1
  481. package/dist/tools/trade/quote-buy/quote-buy.d.ts.map +1 -1
  482. package/dist/tools/trade/quote-buy/quote-buy.js +2 -0
  483. package/dist/tools/trade/quote-buy/quote-buy.js.map +1 -1
  484. package/dist/tools/trade/quote-lot-return/constants.d.ts +2 -0
  485. package/dist/tools/trade/quote-lot-return/constants.d.ts.map +1 -0
  486. package/dist/tools/trade/quote-lot-return/constants.js +11 -0
  487. package/dist/tools/trade/quote-lot-return/constants.js.map +1 -0
  488. package/dist/tools/trade/quote-lot-return/quote-lot-return.d.ts +5 -0
  489. package/dist/tools/trade/quote-lot-return/quote-lot-return.d.ts.map +1 -0
  490. package/dist/tools/trade/quote-lot-return/quote-lot-return.js +20 -0
  491. package/dist/tools/trade/quote-lot-return/quote-lot-return.js.map +1 -0
  492. package/dist/tools/trade/return-lot/constants.d.ts +5 -0
  493. package/dist/tools/trade/return-lot/constants.d.ts.map +1 -0
  494. package/dist/tools/trade/return-lot/constants.js +26 -0
  495. package/dist/tools/trade/return-lot/constants.js.map +1 -0
  496. package/dist/tools/trade/return-lot/factory.d.ts +4 -0
  497. package/dist/tools/trade/return-lot/factory.d.ts.map +1 -0
  498. package/dist/tools/trade/return-lot/factory.js +18 -0
  499. package/dist/tools/trade/return-lot/factory.js.map +1 -0
  500. package/dist/tools/trade/return-lot/format.utils.d.ts +5 -0
  501. package/dist/tools/trade/return-lot/format.utils.d.ts.map +1 -0
  502. package/dist/tools/trade/return-lot/format.utils.js +39 -0
  503. package/dist/tools/trade/return-lot/format.utils.js.map +1 -0
  504. package/dist/tools/trade/return-lot/return-lot.d.ts +5 -0
  505. package/dist/tools/trade/return-lot/return-lot.d.ts.map +1 -0
  506. package/dist/tools/trade/return-lot/return-lot.js +25 -0
  507. package/dist/tools/trade/return-lot/return-lot.js.map +1 -0
  508. package/dist/tools/trade/return-lot/types.d.ts +11 -0
  509. package/dist/tools/trade/return-lot/types.d.ts.map +1 -0
  510. package/dist/tools/trade/return-lot/types.js +21 -0
  511. package/dist/tools/trade/return-lot/types.js.map +1 -0
  512. package/dist/tools/trade/types.d.ts +0 -4
  513. package/dist/tools/trade/types.d.ts.map +1 -1
  514. package/dist/tools/trade/types.js +4 -12
  515. package/dist/tools/trade/types.js.map +1 -1
  516. package/dist/tools/transport/constants.d.ts.map +1 -1
  517. package/dist/tools/transport/constants.js +9 -0
  518. package/dist/tools/transport/constants.js.map +1 -1
  519. package/dist/tools/transport/network/constants.d.ts +2 -0
  520. package/dist/tools/transport/network/constants.d.ts.map +1 -1
  521. package/dist/tools/transport/network/constants.js +2 -0
  522. package/dist/tools/transport/network/constants.js.map +1 -1
  523. package/dist/tools/transport/network/panel.utils.d.ts +2 -2
  524. package/dist/tools/transport/network/panel.utils.d.ts.map +1 -1
  525. package/dist/tools/transport/network/panel.utils.js +20 -0
  526. package/dist/tools/transport/network/panel.utils.js.map +1 -1
  527. package/dist/tools/transport/network/route-network.d.ts.map +1 -1
  528. package/dist/tools/transport/network/route-network.js +1 -1
  529. package/dist/tools/transport/network/route-network.js.map +1 -1
  530. package/dist/tools/transport/next-hops/next-hops.d.ts.map +1 -1
  531. package/dist/tools/transport/next-hops/next-hops.js +13 -3
  532. package/dist/tools/transport/next-hops/next-hops.js.map +1 -1
  533. package/dist/tools/transport/quote/constants.d.ts.map +1 -1
  534. package/dist/tools/transport/quote/constants.js +5 -3
  535. package/dist/tools/transport/quote/constants.js.map +1 -1
  536. package/dist/tools/transport/types.d.ts +2 -0
  537. package/dist/tools/transport/types.d.ts.map +1 -1
  538. package/dist/tools/transport/types.js +16 -0
  539. package/dist/tools/transport/types.js.map +1 -1
  540. package/dist/tools/types.d.ts +7 -1
  541. package/dist/tools/types.d.ts.map +1 -1
  542. package/dist/tools/types.js +16 -1
  543. package/dist/tools/types.js.map +1 -1
  544. package/dist/types.d.ts +3 -1
  545. package/dist/types.d.ts.map +1 -1
  546. package/dist/types.js +1 -1
  547. package/dist/types.js.map +1 -1
  548. package/dist/utils/wei.constants.d.ts +6 -0
  549. package/dist/utils/wei.constants.d.ts.map +1 -0
  550. package/dist/utils/wei.constants.js +6 -0
  551. package/dist/utils/wei.constants.js.map +1 -0
  552. package/dist/wallet/index.d.ts.map +1 -1
  553. package/dist/wallet/index.js +2 -3
  554. package/dist/wallet/index.js.map +1 -1
  555. package/dist/wallet/types.d.ts +0 -9
  556. package/dist/wallet/types.d.ts.map +1 -1
  557. package/dist/wallet/types.js.map +1 -1
  558. package/package.json +2 -2
  559. package/dist/tools/trade/cancel-lot/cancel-lot.d.ts +0 -4
  560. package/dist/tools/trade/cancel-lot/cancel-lot.d.ts.map +0 -1
  561. package/dist/tools/trade/cancel-lot/cancel-lot.js +0 -20
  562. package/dist/tools/trade/cancel-lot/cancel-lot.js.map +0 -1
  563. package/dist/tools/trade/cancel-lot/constants.d.ts +0 -2
  564. package/dist/tools/trade/cancel-lot/constants.d.ts.map +0 -1
  565. package/dist/tools/trade/cancel-lot/constants.js +0 -8
  566. package/dist/tools/trade/cancel-lot/constants.js.map +0 -1
  567. package/dist/wallet/agw.manager.d.ts +0 -20
  568. package/dist/wallet/agw.manager.d.ts.map +0 -1
  569. package/dist/wallet/agw.manager.js +0 -90
  570. package/dist/wallet/agw.manager.js.map +0 -1
  571. package/dist/wallet/agw.provider.d.ts +0 -14
  572. package/dist/wallet/agw.provider.d.ts.map +0 -1
  573. package/dist/wallet/agw.provider.js +0 -48
  574. package/dist/wallet/agw.provider.js.map +0 -1
package/README.md CHANGED
@@ -2,22 +2,81 @@
2
2
 
3
3
  MCP (Model Context Protocol) server for **Project CPU** — a blockchain game on EVM. It lets an
4
4
  AI agent play on your behalf: read the world map, reveal cells, build and mine, craft, move
5
- resources, trade at marketplaces, and cash out to on-chain $CPU. Runs locally over stdio and is distributed via npm, so
5
+ resources, trade resources through the internal Hub market, trade Cell NFTs through OpenSea, and cash out to on-chain $CPU. Runs locally over stdio and is distributed via npm, so
6
6
  you start it with a single `npx` command from any MCP client.
7
7
 
8
8
  ## Installation
9
9
 
10
- Pick your client below and add the server. The only required setting is your wallet's `PRIVATE_KEY` (`0x` + 64 hex chars) — replace `0x…` with yours.
10
+ ### Agent setup
11
+
12
+ **Recommended.** The Project CPU plugin installs both the `operator-cpu` skill and the MCP server. It starts `npx -y project-cpu-mcp@latest` with the default Paybox wallet, so no environment variables or wallet credentials are required.
13
+
14
+ #### Claude Code
15
+
16
+ Add the marketplace, then install the plugin:
17
+
18
+ ```bash
19
+ claude plugin marketplace add projectcpu/project-cpu-mcp
20
+ claude plugin install project-cpu@project-cpu --scope local
21
+ ```
22
+
23
+ Use `--scope local` for this checkout, `--scope project` for the project, or `--scope user` for all projects.
24
+
25
+ #### Codex
26
+
27
+ Add the marketplace, then install the plugin:
28
+
29
+ ```bash
30
+ codex plugin marketplace add https://github.com/projectcpu/project-cpu-mcp
31
+ codex plugin add project-cpu@project-cpu
32
+ ```
33
+
34
+ Codex installs plugins for the current user. Start a new agent session after plugin installation.
35
+
36
+ ### Manual setup
37
+
38
+ For a custom setup, install the skill and MCP server separately. To use both, complete both sections below.
39
+
40
+ #### 1. Install the skill
41
+
42
+ Install `operator-cpu` into the current project:
43
+
44
+ ```bash
45
+ npx skills add projectcpu/project-cpu-mcp --skill operator-cpu
46
+ ```
47
+
48
+ Add `--global` for all projects. The installer detects supported agents; use `--agent codex` or `--agent claude-code` to target one.
49
+
50
+ Update it later with `npx skills update operator-cpu`; add `--global` for a user installation.
51
+
52
+ Restart the agent if the new skill does not appear.
53
+
54
+ #### 2. Install the MCP server
55
+
56
+ Pick your client below and add the server. No environment variables are required. Paybox opens browser authorization on the first `cpu_authenticate` call and returns the URL as a fallback.
57
+
58
+ <details>
59
+ <summary><strong>Codex</strong></summary>
60
+
61
+ Add this to `.codex/config.toml` for the current trusted project or `~/.codex/config.toml` for the current user:
62
+
63
+ ```toml
64
+ [mcp_servers.project-cpu]
65
+ command = "npx"
66
+ args = ["-y", "project-cpu-mcp@latest"]
67
+ ```
68
+
69
+ </details>
11
70
 
12
71
  <details>
13
72
  <summary><strong>Claude Code</strong></summary>
14
73
 
15
74
  ```bash
16
- claude mcp add project-cpu -s user -e PRIVATE_KEY=0x… -- npx -y project-cpu-mcp@latest
75
+ claude mcp add project-cpu -s user -- npx -y project-cpu-mcp@latest
17
76
  ```
18
77
 
19
78
  - `-s user` installs it across all your projects; omit it (or use `-s local`) for the current project only.
20
- - `-e PRIVATE_KEY=…` sets the required env var; `--` separates Claude's flags from the server command.
79
+ - `--` separates Claude's flags from the server command.
21
80
 
22
81
  </details>
23
82
 
@@ -31,8 +90,7 @@ Edit `claude_desktop_config.json` (macOS: `~/Library/Application Support/Claude/
31
90
  "mcpServers": {
32
91
  "project-cpu": {
33
92
  "command": "npx",
34
- "args": ["-y", "project-cpu-mcp@latest"],
35
- "env": { "PRIVATE_KEY": "0x…" }
93
+ "args": ["-y", "project-cpu-mcp@latest"]
36
94
  }
37
95
  }
38
96
  }
@@ -50,8 +108,7 @@ Add to `~/.cursor/mcp.json` (global) or `.cursor/mcp.json` (this project):
50
108
  "mcpServers": {
51
109
  "project-cpu": {
52
110
  "command": "npx",
53
- "args": ["-y", "project-cpu-mcp@latest"],
54
- "env": { "PRIVATE_KEY": "0x…" }
111
+ "args": ["-y", "project-cpu-mcp@latest"]
55
112
  }
56
113
  }
57
114
  }
@@ -62,18 +119,14 @@ Add to `~/.cursor/mcp.json` (global) or `.cursor/mcp.json` (this project):
62
119
  <details>
63
120
  <summary><strong>VS Code (Copilot agent mode)</strong></summary>
64
121
 
65
- Create `.vscode/mcp.json` — VS Code prompts for the key at startup instead of storing it:
122
+ Create `.vscode/mcp.json`:
66
123
 
67
124
  ```json
68
125
  {
69
- "inputs": [
70
- { "type": "promptString", "id": "privateKey", "description": "Project CPU private key", "password": true }
71
- ],
72
126
  "servers": {
73
127
  "project-cpu": {
74
128
  "command": "npx",
75
- "args": ["-y", "project-cpu-mcp@latest"],
76
- "env": { "PRIVATE_KEY": "${input:privateKey}" }
129
+ "args": ["-y", "project-cpu-mcp@latest"]
77
130
  }
78
131
  }
79
132
  }
@@ -93,8 +146,7 @@ Add to `~/.codeium/windsurf/mcp_config.json`, then restart Windsurf:
93
146
  "mcpServers": {
94
147
  "project-cpu": {
95
148
  "command": "npx",
96
- "args": ["-y", "project-cpu-mcp@latest"],
97
- "env": { "PRIVATE_KEY": "0x…" }
149
+ "args": ["-y", "project-cpu-mcp@latest"]
98
150
  }
99
151
  }
100
152
  }
@@ -102,28 +154,38 @@ Add to `~/.codeium/windsurf/mcp_config.json`, then restart Windsurf:
102
154
 
103
155
  </details>
104
156
 
105
- Every command above pins `@latest`, so restarting the server is how you update — `npx` re-resolves the registry on each launch. The server also watches for new releases on its own: a backwards-compatible one is mentioned once in a tool's response, a breaking one blocks every tool until you restart.
157
+ Every MCP command above pins `@latest`, so restarting the server is how you update — `npx` re-resolves the registry on each launch. The server also watches for new releases on its own: a backwards-compatible one is mentioned once in a tool's response, a breaking one blocks every tool until you restart.
106
158
 
107
- ## Environment variables
159
+ ## Authenticate
160
+
161
+ After reloading the harness, call `cpu_persona` first, then `cpu_authenticate`. Paybox opens browser authorization and keeps wallet secrets out of chat and configuration.
108
162
 
109
- **Required** for the default `WALLET_MODE=evm`; not needed in `agw` mode, see below.
163
+ ## Wallet modes
110
164
 
111
- | Variable | Description |
112
- | --- | --- |
113
- | `PRIVATE_KEY` | Your wallet private key `0x` followed by 64 hex chars (32 bytes). |
165
+ The server uses one wallet mode to sign actions for the Operator:
166
+
167
+ - **Paybox (default)** You do not configure a private key. Call `cpu_authenticate`. The server opens
168
+ Paybox in your browser, where you select a wallet and approve access. Paybox signs wallet actions.
169
+ - **EVM** — Set `WALLET_MODE=evm` and `PRIVATE_KEY=0x...` in the MCP server environment. The server uses
170
+ that local EVM wallet and signs actions on your machine. Call `cpu_authenticate` to sign in to the game.
171
+
172
+ Keep `PRIVATE_KEY` secret. Use it only in the MCP server environment. Do not put it in chat messages.
173
+
174
+ ## Environment variables
114
175
 
115
176
  **Optional** — has a sensible default; normal users can omit it.
116
177
 
117
178
  | Variable | Default | When you need it |
118
179
  | --- | --- | --- |
119
- | `WALLET_MODE` | `evm` | Switch to `agw` to authenticate via a Device Authorization flow instead of a `PRIVATE_KEY` in env. |
120
- | `API_URL` | `https://api.projectcpu.cc` | Point the client at a different game API deployment. |
180
+ | `WALLET_MODE` | `paybox` | Set to `evm` for a local private-key wallet. |
181
+ | `PRIVATE_KEY` | | Required only when `WALLET_MODE=evm`; `0x` followed by 64 hex chars (32 bytes). |
182
+ | `API_URL` | `https://api-dev.projectcpu.cc` | Point the client at a different game API deployment. |
121
183
  | `NETWORK` | `robinhood` | Normally never; Robinhood is the only accepted launch network. |
122
184
  | `RPC_URL` | Robinhood public RPC | A custom RPC endpoint for sending on-chain transactions (e.g. `cpu_reveal`). |
123
185
  | `OPERATOR_PERSONA` | `true` | Set to `false` to disable the `cpu_persona` tool and drop its pointer from the server's instructions. |
124
186
  | `DEBUG` | `false` | Set to `true` for debug-level logging on stderr. |
125
187
 
126
- Session state (JWT / session keys) is persisted to `~/.project-cpu/`.
188
+ Session state is persisted to `~/.project-cpu/`.
127
189
 
128
190
  ## What the agent can do
129
191
 
@@ -142,19 +204,32 @@ Once connected, the server exposes tools grouped by area:
142
204
  turn it off.
143
205
  - **World** — `cpu_get_map`, `cpu_get_cell`, `cpu_get_changes` (react to other players),
144
206
  `cpu_get_attention` (your owner-scoped to-do list).
145
- - **Reveal & build** — `cpu_reveal` (surface a cell's deposits on-chain), `cpu_build` (place a
146
- building), `cpu_demolish`, `cpu_start_mining` (an extractor then mines a batch of the resource each
147
- cycle), `cpu_get_mining_status`, `cpu_claim_mining`.
207
+ - **Reveal & build** — `cpu_reveal` (surface a cell's deposits on-chain), `cpu_fulfill_reveal` (send the
208
+ missing draw yourself where the network's randomness mode leaves delivery to the player), `cpu_build`
209
+ (place a building), `cpu_upgrade` (replace it with a configured successor type), `cpu_demolish`,
210
+ `cpu_start_mining` (an extractor then mines a batch of the resource each cycle), `cpu_get_mining_status`,
211
+ `cpu_claim_mining`.
148
212
  - **Transport** — `cpu_route_network` (exports the route graph for one move to a temporary JSON file: nodes,
149
213
  legal hops, gaps), `cpu_next_hops` (survey the legal waypoints around a cell) — both take the cargo
150
214
  `resourceId` and show the exact per-hub transit fee for it — `cpu_quote_transport`, `cpu_transport`,
151
215
  `cpu_get_transport_status`, `cpu_list_my_transports`, `cpu_finalize_delivery`.
152
216
  - **Crafting** — `cpu_list_recipes`, `cpu_craft`, `cpu_get_craft_status`, `cpu_claim_craft`.
153
- - **Trading** — `cpu_get_markets`, `cpu_list_lots`, `cpu_get_lot`, `cpu_quote_buy`, `cpu_buy_lot`, `cpu_create_lot`,
154
- `cpu_cancel_lot`, `cpu_list_my_lots`, `cpu_set_sale_fee` (a hub owner sets the per-resource sale-fee rate on
155
- their own hub), `cpu_list_fills` (the executed-buy feed, pageable by cursor), and `cpu_get_market_index`
156
- (world 24h VWAP, change, and volume per resource a different question from `cpu_get_markets`'s cheapest
157
- ask right now). See [CONTEXT.md](./CONTEXT.md) for the fee vocabulary.
217
+ - **Internal resource market** — `cpu_get_markets`, `cpu_list_lots`, `cpu_get_lot`, `cpu_quote_buy`, `cpu_buy_lot`,
218
+ `cpu_get_lot_terms` (the live listing window, your live-lot count and any evicted remainder you owe on one
219
+ hub), `cpu_create_lot`, `cpu_list_my_lots`, `cpu_set_sale_fee` (a hub owner sets the per-resource sale-fee
220
+ rate on their own hub), `cpu_list_fills` (the executed-buy feed, pageable by cursor), and
221
+ `cpu_get_market_index` (world 24h VWAP, change, and volume per resource — a different question from
222
+ `cpu_get_markets`'s cheapest ask right now). See [CONTEXT.md](./CONTEXT.md) for the fee vocabulary.
223
+ - **External Cell market** — `cpu_get_cell_market` reads OpenSea orders for one Cell;
224
+ `cpu_get_my_listings`, `cpu_get_my_offers`, and `cpu_get_my_offers_received` read wallet orders;
225
+ `cpu_list_cell`, `cpu_buy_cell`, `cpu_make_cell_offer`, `cpu_accept_cell_offer`, and `cpu_cancel_order`
226
+ create or settle exact orders identified by `orderHash`. The whole Cell NFT and its Cell-bound game state
227
+ change ownership together.
228
+ - **Eviction & lot return** — `cpu_evict_lot` (a hub owner ends somebody else's open lot on their own hub; it
229
+ moves no goods and seizes nothing, and the seller keeps the whole remainder in escrow), and the seller's
230
+ way out: `cpu_quote_lot_return` then `cpu_return_lot`, which ships one lot's whole unsold remainder from
231
+ its hub to one cell you own over a route you choose. It works on an open lot and on an evicted one, one lot
232
+ and one route per call, and the route still owes its transit fees.
158
233
  - **Syndicates** — `cpu_list_syndicates` (browse the registry by name/size, sort, page), `cpu_get_syndicate`
159
234
  (one trusted syndicate card plus a page of its members), `cpu_get_syndicate_membership` (check an address's
160
235
  membership, defaults to your own), `cpu_join_syndicate` (join by id for same-clan discounts; reports your
@@ -167,8 +242,9 @@ Once connected, the server exposes tools grouped by area:
167
242
  server-authored warning tells the agent how to handle them, and returned links stay inert rather than being
168
243
  opened or fetched.
169
244
  See [CONTEXT.md](./CONTEXT.md) for the syndicate vocabulary.
170
- - **Tokens** — `cpu_quote_swap`, `cpu_swap` (trade ETH ↔ $CPU on the token pool), `cpu_withdraw` (cash a
171
- cell's wCPU out to on-chain $CPU, 1:1).
245
+ - **Tokens & land** — `cpu_quote_swap`, `cpu_swap` (trade ETH ↔ $CPU on the token pool), `cpu_withdraw`
246
+ (cash a cell's wCPU out to on-chain $CPU, 1:1), `cpu_quote_mint` and `cpu_mint_cell` (preview and mint new
247
+ land cells on the primary market, priced in native ETH by the public drop itself).
172
248
 
173
249
  Paid routes and on-chain actions are settled automatically; always check `cpu_get_balance` before
174
250
  a paid action.
@@ -0,0 +1,6 @@
1
+ import type { AuthenticationRequiredErrorData } from './types.js';
2
+ export declare class AuthenticationRequiredError extends Error {
3
+ readonly data: AuthenticationRequiredErrorData;
4
+ constructor();
5
+ }
6
+ //# sourceMappingURL=authentication-required.error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authentication-required.error.d.ts","sourceRoot":"","sources":["../../src/api/authentication-required.error.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,YAAY,CAAC;AAElE,qBAAa,2BAA4B,SAAQ,KAAK;IAClD,QAAQ,CAAC,IAAI,EAAE,+BAA+B,CAA2C;;CAM5F"}
@@ -0,0 +1,9 @@
1
+ import { AUTHENTICATION_REQUIRED_RECOVERY } from './constants.js';
2
+ export class AuthenticationRequiredError extends Error {
3
+ data = { ...AUTHENTICATION_REQUIRED_RECOVERY };
4
+ constructor() {
5
+ super(JSON.stringify(AUTHENTICATION_REQUIRED_RECOVERY));
6
+ this.name = 'AuthenticationRequiredError';
7
+ }
8
+ }
9
+ //# sourceMappingURL=authentication-required.error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authentication-required.error.js","sourceRoot":"","sources":["../../src/api/authentication-required.error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,MAAM,gBAAgB,CAAC;AAGlE,MAAM,OAAO,2BAA4B,SAAQ,KAAK;IACzC,IAAI,GAAoC,EAAE,GAAG,gCAAgC,EAAE,CAAC;IAEzF;QACI,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,gCAAgC,CAAC,CAAC,CAAC;QACxD,IAAI,CAAC,IAAI,GAAG,6BAA6B,CAAC;IAC9C,CAAC;CACJ"}
@@ -1,5 +1,5 @@
1
1
  import { type ApiClientOptions, type ApiResponse, type IAuthenticator, type ServerHealthView } from './types.js';
2
- import type { SessionManager } from '../session/manager.js';
2
+ import type { IJwtSession } from '../session/types.js';
3
3
  export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
4
4
  export interface RequestOptions {
5
5
  method: HttpMethod;
@@ -17,7 +17,7 @@ export declare class ApiClient {
17
17
  /**
18
18
  * Low-level request without auth. Use for public endpoints (SIWE nonce/verify, device flow).
19
19
  */
20
- request<T>(path: string, options?: RequestOptions | null): Promise<ApiResponse<T>>;
20
+ request<T>(path: string, options?: RequestOptions | null, signal?: AbortSignal | null): Promise<ApiResponse<T>>;
21
21
  /**
22
22
  * The outcome is kept out of the reachability signal: this may target an endpoint an older server
23
23
  * does not serve at all, which says nothing about the API being up.
@@ -25,14 +25,16 @@ export declare class ApiClient {
25
25
  requestWithTimeout<T>(path: string, timeoutMs: number): Promise<ApiResponse<T>>;
26
26
  /**
27
27
  * Request with a `Authorization: Bearer <jwt>` header. The token is obtained from the
28
- * authenticator (which (re-)logs in when missing/expired). On a 401 the authenticator is
29
- * asked to re-authenticate and the request is retried exactly once.
28
+ * authenticator (which logs in when missing/expired). A 401 clears the game JWT and asks the
29
+ * caller to authenticate explicitly before choosing whether to retry the operation.
30
30
  */
31
31
  authenticatedRequest<T>(path: string, options?: RequestOptions | null): Promise<ApiResponse<T>>;
32
32
  private send;
33
+ private fetchResponse;
34
+ private parseResponse;
33
35
  private setReachable;
34
36
  getServerHealth(): ServerHealthView;
35
37
  getBaseUrl(): string;
36
- getSession(): SessionManager;
38
+ getSession(): IJwtSession;
37
39
  }
38
40
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AACA,OAAO,EAC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AAC;YAsB7F,IAAI;YAcJ,aAAa;YA+Cb,aAAa;IAwB3B,OAAO,CAAC,YAAY;IAapB,eAAe,IAAI,gBAAgB;IAInC,UAAU,IAAI,MAAM;IAIpB,UAAU,IAAI,WAAW;CAG5B"}
@@ -1,3 +1,4 @@
1
+ import { AuthenticationRequiredError } from './authentication-required.error.js';
1
2
  import { parseJsonBody } from './response.utils.js';
2
3
  import { HttpStatus, } from './types.js';
3
4
  import { errorMessage } from '../utils/error.utils.js';
@@ -19,8 +20,8 @@ export class ApiClient {
19
20
  /**
20
21
  * Low-level request without auth. Use for public endpoints (SIWE nonce/verify, device flow).
21
22
  */
22
- async request(path, options = null) {
23
- return this.send(path, options?.method ?? 'GET', options?.body ?? null, null);
23
+ async request(path, options = null, signal = null) {
24
+ return this.send(path, options?.method ?? 'GET', options?.body ?? null, null, null, true, signal);
24
25
  }
25
26
  /**
26
27
  * The outcome is kept out of the reachability signal: this may target an endpoint an older server
@@ -31,8 +32,8 @@ export class ApiClient {
31
32
  }
32
33
  /**
33
34
  * Request with a `Authorization: Bearer <jwt>` header. The token is obtained from the
34
- * authenticator (which (re-)logs in when missing/expired). On a 401 the authenticator is
35
- * asked to re-authenticate and the request is retried exactly once.
35
+ * authenticator (which logs in when missing/expired). A 401 clears the game JWT and asks the
36
+ * caller to authenticate explicitly before choosing whether to retry the operation.
36
37
  */
37
38
  async authenticatedRequest(path, options = null) {
38
39
  if (!this.authenticator) {
@@ -41,24 +42,33 @@ export class ApiClient {
41
42
  const method = options?.method ?? 'GET';
42
43
  const body = options?.body ?? null;
43
44
  const token = await this.authenticator.getAccessToken();
44
- const first = await this.send(path, method, body, { Authorization: `Bearer ${token}` });
45
- if (first.status !== HttpStatus.Unauthorized) {
46
- return first;
45
+ const response = await this.fetchResponse(path, method, body, { Authorization: `Bearer ${token}` });
46
+ if (response.status === HttpStatus.Unauthorized) {
47
+ this.setReachable(true, null);
48
+ this.logger.debug('api response', { method, path, status: response.status });
49
+ this.session.clearJwt();
50
+ this.logger.warn('authenticated request got 401 — game JWT cleared', { path });
51
+ throw new AuthenticationRequiredError();
47
52
  }
48
- this.logger.warn('authenticated request got 401 — re-authenticating and retrying once', { path });
49
- const fresh = await this.authenticator.reauthenticate();
50
- return this.send(path, method, body, { Authorization: `Bearer ${fresh}` });
53
+ return this.parseResponse(response, method, path);
54
+ }
55
+ async send(path, method, body, extraHeaders, timeoutMs = null, trackHealth = true, signal = null) {
56
+ const response = await this.fetchResponse(path, method, body, extraHeaders, timeoutMs, trackHealth, signal);
57
+ return this.parseResponse(response, method, path, trackHealth);
51
58
  }
52
- async send(path, method, body, extraHeaders, timeoutMs = null, trackHealth = true) {
59
+ async fetchResponse(path, method, body, extraHeaders, timeoutMs = null, trackHealth = true, signal = null) {
53
60
  const url = `${this.baseUrl}${path}`;
54
61
  const headers = {
55
62
  'Content-Type': 'application/json',
56
63
  ...(extraHeaders ?? {}),
57
64
  };
58
65
  const init = { method, headers };
59
- if (timeoutMs !== null) {
60
- init.signal = AbortSignal.timeout(timeoutMs);
61
- }
66
+ const timeoutSignal = timeoutMs === null ? null : AbortSignal.timeout(timeoutMs);
67
+ const requestSignal = signal !== null && timeoutSignal !== null
68
+ ? AbortSignal.any([signal, timeoutSignal])
69
+ : (signal ?? timeoutSignal);
70
+ if (requestSignal !== null)
71
+ init.signal = requestSignal;
62
72
  if (body !== undefined && body !== null) {
63
73
  init.body = JSON.stringify(body);
64
74
  }
@@ -68,12 +78,17 @@ export class ApiClient {
68
78
  response = await fetch(url, init);
69
79
  }
70
80
  catch (error) {
81
+ if (signal?.aborted === true)
82
+ signal.throwIfAborted();
71
83
  if (trackHealth) {
72
84
  this.setReachable(false, errorMessage(error));
73
85
  }
74
86
  throw new Error(`Cannot reach the game API at ${this.baseUrl} — the server is likely down or unreachable. ` +
75
87
  `Retry shortly. (${errorMessage(error)})`);
76
88
  }
89
+ return response;
90
+ }
91
+ async parseResponse(response, method, path, trackHealth = true) {
77
92
  let data;
78
93
  try {
79
94
  data = await parseJsonBody(response);
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAGH,UAAU,GAGb,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AASvD,MAAM,OAAO,SAAS;IACD,OAAO,CAAS;IAChB,OAAO,CAAiB;IACxB,MAAM,CAAU;IACzB,aAAa,GAA0B,IAAI,CAAC;IAC5C,eAAe,GAAG,IAAI,CAAC;IACvB,gBAAgB,GAAkB,IAAI,CAAC;IAE/C,YAAY,OAAyB;QACjC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAC/B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAC/B,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IACjC,CAAC;IAED,gBAAgB,CAAC,aAA6B;QAC1C,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACvC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,OAAO,CAAI,IAAY,EAAE,UAAiC,IAAI;QAChE,OAAO,IAAI,CAAC,IAAI,CAAI,IAAI,EAAE,OAAO,EAAE,MAAM,IAAI,KAAK,EAAE,OAAO,EAAE,IAAI,IAAI,IAAI,EAAE,IAAI,CAAC,CAAC;IACrF,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,kBAAkB,CAAI,IAAY,EAAE,SAAiB;QACvD,OAAO,IAAI,CAAC,IAAI,CAAI,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;IACnE,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,oBAAoB,CAAI,IAAY,EAAE,UAAiC,IAAI;QAC7E,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;YACtB,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AAM,EAAE,CAAC,CAAC;YACzD,CAAC;QACL,CAAC;IACL,CAAC;IAED,eAAe;QACX,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,eAAe,EAAE,MAAM,EAAE,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAC9E,CAAC;IAED,UAAU;QACN,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,UAAU;QACN,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;CACJ"}
@@ -1,5 +1,7 @@
1
+ import { type AuthenticationRequiredErrorData } from './types.js';
1
2
  export declare const RESPONSE_BODY_SNIPPET_LENGTH = 200;
2
3
  export declare const HTTP_OK = 200;
3
4
  export declare const HTTP_MULTIPLE_CHOICES = 300;
4
5
  export declare const OPEN_REVEAL_REQUESTS_PATH = "/api/v1/reveal/requests";
6
+ export declare const AUTHENTICATION_REQUIRED_RECOVERY: AuthenticationRequiredErrorData;
5
7
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/api/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAGhD,eAAO,MAAM,OAAO,MAAM,CAAC;AAC3B,eAAO,MAAM,qBAAqB,MAAM,CAAC;AAEzC,eAAO,MAAM,yBAAyB,4BAA4B,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/api/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsD,KAAK,+BAA+B,EAAE,MAAM,YAAY,CAAC;AAItH,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAGhD,eAAO,MAAM,OAAO,MAAM,CAAC;AAC3B,eAAO,MAAM,qBAAqB,MAAM,CAAC;AAEzC,eAAO,MAAM,yBAAyB,4BAA4B,CAAC;AAEnE,eAAO,MAAM,gCAAgC,EAAE,+BAI9C,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { ApiAuthenticationErrorCode, AuthenticationNextTool } from './types.js';
1
2
  // Max characters of a non-JSON response body echoed back in the error message — enough to identify
2
3
  // a gateway/error page without dumping a full HTML document into the agent's context.
3
4
  export const RESPONSE_BODY_SNIPPET_LENGTH = 200;
@@ -5,4 +6,9 @@ export const RESPONSE_BODY_SNIPPET_LENGTH = 200;
5
6
  export const HTTP_OK = 200;
6
7
  export const HTTP_MULTIPLE_CHOICES = 300;
7
8
  export const OPEN_REVEAL_REQUESTS_PATH = '/api/v1/reveal/requests';
9
+ export const AUTHENTICATION_REQUIRED_RECOVERY = {
10
+ code: ApiAuthenticationErrorCode.AuthenticationRequired,
11
+ stateCleared: true,
12
+ nextTool: AuthenticationNextTool.Authenticate,
13
+ };
8
14
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/api/constants.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,sFAAsF;AACtF,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAG,CAAC;AAEhD,qEAAqE;AACrE,MAAM,CAAC,MAAM,OAAO,GAAG,GAAG,CAAC;AAC3B,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAEzC,MAAM,CAAC,MAAM,yBAAyB,GAAG,yBAAyB,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/api/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,sBAAsB,EAAwC,MAAM,YAAY,CAAC;AAEtH,mGAAmG;AACnG,sFAAsF;AACtF,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAG,CAAC;AAEhD,qEAAqE;AACrE,MAAM,CAAC,MAAM,OAAO,GAAG,GAAG,CAAC;AAC3B,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAEzC,MAAM,CAAC,MAAM,yBAAyB,GAAG,yBAAyB,CAAC;AAEnE,MAAM,CAAC,MAAM,gCAAgC,GAAoC;IAC7E,IAAI,EAAE,0BAA0B,CAAC,sBAAsB;IACvD,YAAY,EAAE,IAAI;IAClB,QAAQ,EAAE,sBAAsB,CAAC,YAAY;CAChD,CAAC"}