@agirails/sdk 2.0.1-beta → 2.0.2

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 (405) hide show
  1. package/LICENSE +190 -0
  2. package/README.md +116 -108
  3. package/bin/actp +10 -0
  4. package/dist/ACTPClient.d.ts +456 -33
  5. package/dist/ACTPClient.d.ts.map +1 -1
  6. package/dist/ACTPClient.js +477 -93
  7. package/dist/ACTPClient.js.map +1 -1
  8. package/dist/abi/AgentRegistry.json +782 -0
  9. package/dist/abi/EscrowVault.json +106 -38
  10. package/dist/abi/IdentityRegistry.json +316 -0
  11. package/dist/adapters/BaseAdapter.d.ts +231 -0
  12. package/dist/adapters/BaseAdapter.d.ts.map +1 -0
  13. package/dist/adapters/BaseAdapter.js +393 -0
  14. package/dist/adapters/BaseAdapter.js.map +1 -0
  15. package/dist/adapters/BeginnerAdapter.d.ts +152 -0
  16. package/dist/adapters/BeginnerAdapter.d.ts.map +1 -0
  17. package/dist/adapters/BeginnerAdapter.js +168 -0
  18. package/dist/adapters/BeginnerAdapter.js.map +1 -0
  19. package/dist/adapters/IntermediateAdapter.d.ts +211 -0
  20. package/dist/adapters/IntermediateAdapter.d.ts.map +1 -0
  21. package/dist/adapters/IntermediateAdapter.js +260 -0
  22. package/dist/adapters/IntermediateAdapter.js.map +1 -0
  23. package/dist/adapters/index.d.ts +15 -0
  24. package/dist/adapters/index.d.ts.map +1 -0
  25. package/dist/adapters/index.js +26 -0
  26. package/dist/adapters/index.js.map +1 -0
  27. package/dist/builders/DeliveryProofBuilder.d.ts +60 -1
  28. package/dist/builders/DeliveryProofBuilder.d.ts.map +1 -1
  29. package/dist/builders/DeliveryProofBuilder.js +81 -5
  30. package/dist/builders/DeliveryProofBuilder.js.map +1 -1
  31. package/dist/builders/QuoteBuilder.d.ts +101 -0
  32. package/dist/builders/QuoteBuilder.d.ts.map +1 -1
  33. package/dist/builders/QuoteBuilder.js +120 -3
  34. package/dist/builders/QuoteBuilder.js.map +1 -1
  35. package/dist/builders/index.d.ts +4 -0
  36. package/dist/builders/index.d.ts.map +1 -1
  37. package/dist/builders/index.js +4 -0
  38. package/dist/builders/index.js.map +1 -1
  39. package/dist/cli/commands/balance.d.ts +13 -0
  40. package/dist/cli/commands/balance.d.ts.map +1 -0
  41. package/dist/cli/commands/balance.js +89 -0
  42. package/dist/cli/commands/balance.js.map +1 -0
  43. package/dist/cli/commands/batch.d.ts +24 -0
  44. package/dist/cli/commands/batch.d.ts.map +1 -0
  45. package/dist/cli/commands/batch.js +424 -0
  46. package/dist/cli/commands/batch.js.map +1 -0
  47. package/dist/cli/commands/config.d.ts +13 -0
  48. package/dist/cli/commands/config.d.ts.map +1 -0
  49. package/dist/cli/commands/config.js +192 -0
  50. package/dist/cli/commands/config.js.map +1 -0
  51. package/dist/cli/commands/init.d.ts +19 -0
  52. package/dist/cli/commands/init.d.ts.map +1 -0
  53. package/dist/cli/commands/init.js +143 -0
  54. package/dist/cli/commands/init.js.map +1 -0
  55. package/dist/cli/commands/mint.d.ts +13 -0
  56. package/dist/cli/commands/mint.d.ts.map +1 -0
  57. package/dist/cli/commands/mint.js +91 -0
  58. package/dist/cli/commands/mint.js.map +1 -0
  59. package/dist/cli/commands/pay.d.ts +18 -0
  60. package/dist/cli/commands/pay.d.ts.map +1 -0
  61. package/dist/cli/commands/pay.js +87 -0
  62. package/dist/cli/commands/pay.js.map +1 -0
  63. package/dist/cli/commands/simulate.d.ts +32 -0
  64. package/dist/cli/commands/simulate.d.ts.map +1 -0
  65. package/dist/cli/commands/simulate.js +290 -0
  66. package/dist/cli/commands/simulate.js.map +1 -0
  67. package/dist/cli/commands/time.d.ts +29 -0
  68. package/dist/cli/commands/time.d.ts.map +1 -0
  69. package/dist/cli/commands/time.js +252 -0
  70. package/dist/cli/commands/time.js.map +1 -0
  71. package/dist/cli/commands/tx.d.ts +16 -0
  72. package/dist/cli/commands/tx.d.ts.map +1 -0
  73. package/dist/cli/commands/tx.js +379 -0
  74. package/dist/cli/commands/tx.js.map +1 -0
  75. package/dist/cli/commands/watch.d.ts +20 -0
  76. package/dist/cli/commands/watch.d.ts.map +1 -0
  77. package/dist/cli/commands/watch.js +160 -0
  78. package/dist/cli/commands/watch.js.map +1 -0
  79. package/dist/cli/index.d.ts +17 -0
  80. package/dist/cli/index.d.ts.map +1 -0
  81. package/dist/cli/index.js +104 -0
  82. package/dist/cli/index.js.map +1 -0
  83. package/dist/cli/utils/client.d.ts +70 -0
  84. package/dist/cli/utils/client.d.ts.map +1 -0
  85. package/dist/cli/utils/client.js +240 -0
  86. package/dist/cli/utils/client.js.map +1 -0
  87. package/dist/cli/utils/config.d.ts +91 -0
  88. package/dist/cli/utils/config.d.ts.map +1 -0
  89. package/dist/cli/utils/config.js +240 -0
  90. package/dist/cli/utils/config.js.map +1 -0
  91. package/dist/cli/utils/output.d.ts +174 -0
  92. package/dist/cli/utils/output.d.ts.map +1 -0
  93. package/dist/cli/utils/output.js +380 -0
  94. package/dist/cli/utils/output.js.map +1 -0
  95. package/dist/config/networks.d.ts +28 -0
  96. package/dist/config/networks.d.ts.map +1 -1
  97. package/dist/config/networks.js +60 -12
  98. package/dist/config/networks.js.map +1 -1
  99. package/dist/errors/index.d.ts +165 -2
  100. package/dist/errors/index.d.ts.map +1 -1
  101. package/dist/errors/index.js +260 -2
  102. package/dist/errors/index.js.map +1 -1
  103. package/dist/index.d.ts +61 -13
  104. package/dist/index.d.ts.map +1 -1
  105. package/dist/index.js +141 -36
  106. package/dist/index.js.map +1 -1
  107. package/dist/level0/Provider.d.ts +106 -0
  108. package/dist/level0/Provider.d.ts.map +1 -0
  109. package/dist/level0/Provider.js +10 -0
  110. package/dist/level0/Provider.js.map +1 -0
  111. package/dist/level0/ServiceDirectory.d.ts +74 -0
  112. package/dist/level0/ServiceDirectory.d.ts.map +1 -0
  113. package/dist/level0/ServiceDirectory.js +122 -0
  114. package/dist/level0/ServiceDirectory.js.map +1 -0
  115. package/dist/level0/index.d.ts +10 -0
  116. package/dist/level0/index.d.ts.map +1 -0
  117. package/dist/level0/index.js +15 -0
  118. package/dist/level0/index.js.map +1 -0
  119. package/dist/level0/provide.d.ts +51 -0
  120. package/dist/level0/provide.d.ts.map +1 -0
  121. package/dist/level0/provide.js +113 -0
  122. package/dist/level0/provide.js.map +1 -0
  123. package/dist/level0/request.d.ts +53 -0
  124. package/dist/level0/request.d.ts.map +1 -0
  125. package/dist/level0/request.js +462 -0
  126. package/dist/level0/request.js.map +1 -0
  127. package/dist/level1/Agent.d.ts +472 -0
  128. package/dist/level1/Agent.d.ts.map +1 -0
  129. package/dist/level1/Agent.js +1091 -0
  130. package/dist/level1/Agent.js.map +1 -0
  131. package/dist/level1/index.d.ts +10 -0
  132. package/dist/level1/index.d.ts.map +1 -0
  133. package/dist/level1/index.js +30 -0
  134. package/dist/level1/index.js.map +1 -0
  135. package/dist/level1/pricing/PriceCalculator.d.ts +62 -0
  136. package/dist/level1/pricing/PriceCalculator.d.ts.map +1 -0
  137. package/dist/level1/pricing/PriceCalculator.js +237 -0
  138. package/dist/level1/pricing/PriceCalculator.js.map +1 -0
  139. package/dist/level1/pricing/PricingStrategy.d.ts +179 -0
  140. package/dist/level1/pricing/PricingStrategy.d.ts.map +1 -0
  141. package/dist/level1/pricing/PricingStrategy.js +11 -0
  142. package/dist/level1/pricing/PricingStrategy.js.map +1 -0
  143. package/dist/level1/types/Job.d.ts +166 -0
  144. package/dist/level1/types/Job.d.ts.map +1 -0
  145. package/dist/level1/types/Job.js +11 -0
  146. package/dist/level1/types/Job.js.map +1 -0
  147. package/dist/level1/types/Options.d.ts +258 -0
  148. package/dist/level1/types/Options.d.ts.map +1 -0
  149. package/dist/level1/types/Options.js +8 -0
  150. package/dist/level1/types/Options.js.map +1 -0
  151. package/dist/level1/types/index.d.ts +8 -0
  152. package/dist/level1/types/index.d.ts.map +1 -0
  153. package/dist/level1/types/index.js +8 -0
  154. package/dist/level1/types/index.js.map +1 -0
  155. package/dist/protocol/ACTPKernel.d.ts +229 -2
  156. package/dist/protocol/ACTPKernel.d.ts.map +1 -1
  157. package/dist/protocol/ACTPKernel.js +367 -33
  158. package/dist/protocol/ACTPKernel.js.map +1 -1
  159. package/dist/protocol/AgentRegistry.d.ts +177 -0
  160. package/dist/protocol/AgentRegistry.d.ts.map +1 -0
  161. package/dist/protocol/AgentRegistry.js +449 -0
  162. package/dist/protocol/AgentRegistry.js.map +1 -0
  163. package/dist/protocol/DIDManager.d.ts +289 -0
  164. package/dist/protocol/DIDManager.d.ts.map +1 -0
  165. package/dist/protocol/DIDManager.js +481 -0
  166. package/dist/protocol/DIDManager.js.map +1 -0
  167. package/dist/protocol/DIDResolver.d.ts +236 -0
  168. package/dist/protocol/DIDResolver.d.ts.map +1 -0
  169. package/dist/protocol/DIDResolver.js +495 -0
  170. package/dist/protocol/DIDResolver.js.map +1 -0
  171. package/dist/protocol/EASHelper.d.ts +57 -2
  172. package/dist/protocol/EASHelper.d.ts.map +1 -1
  173. package/dist/protocol/EASHelper.js +230 -37
  174. package/dist/protocol/EASHelper.js.map +1 -1
  175. package/dist/protocol/EscrowVault.d.ts +93 -2
  176. package/dist/protocol/EscrowVault.d.ts.map +1 -1
  177. package/dist/protocol/EscrowVault.js +122 -33
  178. package/dist/protocol/EscrowVault.js.map +1 -1
  179. package/dist/protocol/EventMonitor.d.ts +45 -1
  180. package/dist/protocol/EventMonitor.d.ts.map +1 -1
  181. package/dist/protocol/EventMonitor.js +64 -8
  182. package/dist/protocol/EventMonitor.js.map +1 -1
  183. package/dist/protocol/MessageSigner.d.ts +116 -2
  184. package/dist/protocol/MessageSigner.d.ts.map +1 -1
  185. package/dist/protocol/MessageSigner.js +215 -9
  186. package/dist/protocol/MessageSigner.js.map +1 -1
  187. package/dist/protocol/ProofGenerator.d.ts +93 -0
  188. package/dist/protocol/ProofGenerator.d.ts.map +1 -1
  189. package/dist/protocol/ProofGenerator.js +194 -9
  190. package/dist/protocol/ProofGenerator.js.map +1 -1
  191. package/dist/protocol/QuoteBuilder.d.ts +8 -0
  192. package/dist/protocol/QuoteBuilder.d.ts.map +1 -1
  193. package/dist/protocol/QuoteBuilder.js +8 -0
  194. package/dist/protocol/QuoteBuilder.js.map +1 -1
  195. package/dist/runtime/BlockchainRuntime.d.ts +360 -0
  196. package/dist/runtime/BlockchainRuntime.d.ts.map +1 -0
  197. package/dist/runtime/BlockchainRuntime.js +767 -0
  198. package/dist/runtime/BlockchainRuntime.js.map +1 -0
  199. package/dist/runtime/IACTPRuntime.d.ts +271 -0
  200. package/dist/runtime/IACTPRuntime.d.ts.map +1 -0
  201. package/dist/runtime/IACTPRuntime.js +15 -0
  202. package/dist/runtime/IACTPRuntime.js.map +1 -0
  203. package/dist/runtime/MockRuntime.d.ts +445 -0
  204. package/dist/runtime/MockRuntime.d.ts.map +1 -0
  205. package/dist/runtime/MockRuntime.js +1065 -0
  206. package/dist/runtime/MockRuntime.js.map +1 -0
  207. package/dist/runtime/MockStateManager.d.ts +233 -0
  208. package/dist/runtime/MockStateManager.d.ts.map +1 -0
  209. package/dist/runtime/MockStateManager.js +533 -0
  210. package/dist/runtime/MockStateManager.js.map +1 -0
  211. package/dist/runtime/index.d.ts +14 -0
  212. package/dist/runtime/index.d.ts.map +1 -0
  213. package/dist/runtime/index.js +42 -0
  214. package/dist/runtime/index.js.map +1 -0
  215. package/dist/runtime/types/MockState.d.ts +167 -0
  216. package/dist/runtime/types/MockState.d.ts.map +1 -0
  217. package/dist/runtime/types/MockState.js +43 -0
  218. package/dist/runtime/types/MockState.js.map +1 -0
  219. package/dist/types/agent.d.ts +76 -0
  220. package/dist/types/agent.d.ts.map +1 -0
  221. package/dist/types/agent.js +8 -0
  222. package/dist/types/agent.js.map +1 -0
  223. package/dist/types/did.d.ts +192 -0
  224. package/dist/types/did.d.ts.map +1 -0
  225. package/dist/types/did.js +38 -0
  226. package/dist/types/did.js.map +1 -0
  227. package/dist/types/eip712.d.ts +34 -0
  228. package/dist/types/eip712.d.ts.map +1 -1
  229. package/dist/types/eip712.js +31 -5
  230. package/dist/types/eip712.js.map +1 -1
  231. package/dist/types/escrow.d.ts +17 -10
  232. package/dist/types/escrow.d.ts.map +1 -1
  233. package/dist/types/index.d.ts +5 -0
  234. package/dist/types/index.d.ts.map +1 -1
  235. package/dist/types/index.js +8 -0
  236. package/dist/types/index.js.map +1 -1
  237. package/dist/types/message.d.ts +32 -0
  238. package/dist/types/message.d.ts.map +1 -1
  239. package/dist/types/message.js +4 -0
  240. package/dist/types/message.js.map +1 -1
  241. package/dist/types/state.d.ts +28 -0
  242. package/dist/types/state.d.ts.map +1 -1
  243. package/dist/types/state.js +37 -6
  244. package/dist/types/state.js.map +1 -1
  245. package/dist/types/transaction.d.ts +17 -0
  246. package/dist/types/transaction.d.ts.map +1 -1
  247. package/dist/utils/ErrorRecoveryGuide.d.ts +125 -0
  248. package/dist/utils/ErrorRecoveryGuide.d.ts.map +1 -0
  249. package/dist/utils/ErrorRecoveryGuide.js +579 -0
  250. package/dist/utils/ErrorRecoveryGuide.js.map +1 -0
  251. package/dist/utils/Helpers.d.ts +453 -0
  252. package/dist/utils/Helpers.d.ts.map +1 -0
  253. package/dist/utils/Helpers.js +623 -0
  254. package/dist/utils/Helpers.js.map +1 -0
  255. package/dist/utils/IPFSClient.d.ts +113 -0
  256. package/dist/utils/IPFSClient.d.ts.map +1 -1
  257. package/dist/utils/IPFSClient.js +128 -7
  258. package/dist/utils/IPFSClient.js.map +1 -1
  259. package/dist/utils/Logger.d.ts +195 -0
  260. package/dist/utils/Logger.d.ts.map +1 -0
  261. package/dist/utils/Logger.js +382 -0
  262. package/dist/utils/Logger.js.map +1 -0
  263. package/dist/utils/NonceManager.d.ts +234 -1
  264. package/dist/utils/NonceManager.d.ts.map +1 -1
  265. package/dist/utils/NonceManager.js +372 -7
  266. package/dist/utils/NonceManager.js.map +1 -1
  267. package/dist/utils/RateLimiter.d.ts +253 -0
  268. package/dist/utils/RateLimiter.d.ts.map +1 -0
  269. package/dist/utils/RateLimiter.js +424 -0
  270. package/dist/utils/RateLimiter.js.map +1 -0
  271. package/dist/utils/ReceivedNonceTracker.d.ts +175 -0
  272. package/dist/utils/ReceivedNonceTracker.d.ts.map +1 -1
  273. package/dist/utils/ReceivedNonceTracker.js +261 -5
  274. package/dist/utils/ReceivedNonceTracker.js.map +1 -1
  275. package/dist/utils/SDKLifecycle.d.ts +156 -0
  276. package/dist/utils/SDKLifecycle.d.ts.map +1 -0
  277. package/dist/utils/SDKLifecycle.js +347 -0
  278. package/dist/utils/SDKLifecycle.js.map +1 -0
  279. package/dist/utils/SecureNonce.d.ts +57 -0
  280. package/dist/utils/SecureNonce.d.ts.map +1 -0
  281. package/dist/utils/SecureNonce.js +80 -0
  282. package/dist/utils/SecureNonce.js.map +1 -0
  283. package/dist/utils/Semaphore.d.ts +123 -0
  284. package/dist/utils/Semaphore.d.ts.map +1 -0
  285. package/dist/utils/Semaphore.js +247 -0
  286. package/dist/utils/Semaphore.js.map +1 -0
  287. package/dist/utils/UsedAttestationTracker.d.ts +167 -0
  288. package/dist/utils/UsedAttestationTracker.d.ts.map +1 -0
  289. package/dist/utils/UsedAttestationTracker.js +309 -0
  290. package/dist/utils/UsedAttestationTracker.js.map +1 -0
  291. package/dist/utils/canonicalJson.d.ts +22 -0
  292. package/dist/utils/canonicalJson.d.ts.map +1 -1
  293. package/dist/utils/canonicalJson.js +26 -3
  294. package/dist/utils/canonicalJson.js.map +1 -1
  295. package/dist/utils/computeTypeHash.d.ts +14 -0
  296. package/dist/utils/computeTypeHash.d.ts.map +1 -1
  297. package/dist/utils/computeTypeHash.js +19 -2
  298. package/dist/utils/computeTypeHash.js.map +1 -1
  299. package/dist/utils/fsSafe.d.ts +14 -0
  300. package/dist/utils/fsSafe.d.ts.map +1 -0
  301. package/dist/utils/fsSafe.js +89 -0
  302. package/dist/utils/fsSafe.js.map +1 -0
  303. package/dist/utils/index.d.ts +15 -0
  304. package/dist/utils/index.d.ts.map +1 -0
  305. package/dist/utils/index.js +51 -0
  306. package/dist/utils/index.js.map +1 -0
  307. package/dist/utils/security.d.ts +147 -0
  308. package/dist/utils/security.d.ts.map +1 -0
  309. package/dist/utils/security.js +391 -0
  310. package/dist/utils/security.js.map +1 -0
  311. package/dist/utils/validation.d.ts +40 -0
  312. package/dist/utils/validation.d.ts.map +1 -1
  313. package/dist/utils/validation.js +184 -7
  314. package/dist/utils/validation.js.map +1 -1
  315. package/package.json +54 -37
  316. package/src/ACTPClient.ts +692 -178
  317. package/src/abi/AgentRegistry.json +782 -0
  318. package/src/abi/EscrowVault.json +106 -38
  319. package/src/abi/IdentityRegistry.json +316 -0
  320. package/src/adapters/BaseAdapter.ts +473 -0
  321. package/src/adapters/BeginnerAdapter.ts +232 -0
  322. package/src/adapters/IntermediateAdapter.ts +316 -0
  323. package/src/adapters/index.ts +25 -0
  324. package/src/builders/DeliveryProofBuilder.ts +3 -2
  325. package/src/cli/commands/balance.ts +110 -0
  326. package/src/cli/commands/batch.ts +487 -0
  327. package/src/cli/commands/config.ts +231 -0
  328. package/src/cli/commands/init.ts +161 -0
  329. package/src/cli/commands/mint.ts +116 -0
  330. package/src/cli/commands/pay.ts +113 -0
  331. package/src/cli/commands/simulate.ts +345 -0
  332. package/src/cli/commands/time.ts +303 -0
  333. package/src/cli/commands/tx.ts +448 -0
  334. package/src/cli/commands/watch.ts +211 -0
  335. package/src/cli/index.ts +116 -0
  336. package/src/cli/utils/client.ts +249 -0
  337. package/src/cli/utils/config.ts +282 -0
  338. package/src/cli/utils/output.ts +465 -0
  339. package/src/config/networks.ts +32 -9
  340. package/src/errors/index.ts +298 -1
  341. package/src/index.ts +207 -71
  342. package/src/level0/Provider.ts +117 -0
  343. package/src/level0/ServiceDirectory.ts +131 -0
  344. package/src/level0/index.ts +10 -0
  345. package/src/level0/provide.ts +131 -0
  346. package/src/level0/request.ts +494 -0
  347. package/src/level1/Agent.ts +1432 -0
  348. package/src/level1/index.ts +10 -0
  349. package/src/level1/pricing/PriceCalculator.ts +255 -0
  350. package/src/level1/pricing/PricingStrategy.ts +198 -0
  351. package/src/level1/types/Job.ts +179 -0
  352. package/src/level1/types/Options.ts +291 -0
  353. package/src/level1/types/index.ts +8 -0
  354. package/src/protocol/ACTPKernel.ts +175 -23
  355. package/src/protocol/AgentRegistry.ts +559 -0
  356. package/src/protocol/DIDManager.ts +629 -0
  357. package/src/protocol/DIDResolver.ts +554 -0
  358. package/src/protocol/EASHelper.ts +230 -46
  359. package/src/protocol/EscrowVault.ts +68 -50
  360. package/src/protocol/EventMonitor.ts +44 -15
  361. package/src/protocol/MessageSigner.ts +193 -13
  362. package/src/protocol/ProofGenerator.ts +223 -4
  363. package/src/runtime/BlockchainRuntime.ts +993 -0
  364. package/src/runtime/IACTPRuntime.ts +284 -0
  365. package/src/runtime/MockRuntime.ts +1244 -0
  366. package/src/runtime/MockStateManager.ts +576 -0
  367. package/src/runtime/index.ts +25 -0
  368. package/src/runtime/types/MockState.ts +227 -0
  369. package/src/types/agent.ts +79 -0
  370. package/src/types/did.ts +223 -0
  371. package/src/types/escrow.ts +12 -11
  372. package/src/types/index.ts +5 -1
  373. package/src/types/state.ts +12 -3
  374. package/src/types/transaction.ts +4 -1
  375. package/src/utils/ErrorRecoveryGuide.ts +675 -0
  376. package/src/utils/Helpers.ts +688 -0
  377. package/src/utils/IPFSClient.ts +122 -5
  378. package/src/utils/Logger.ts +484 -0
  379. package/src/utils/NonceManager.ts +305 -8
  380. package/src/utils/RateLimiter.ts +534 -0
  381. package/src/utils/ReceivedNonceTracker.ts +170 -0
  382. package/src/utils/SDKLifecycle.ts +416 -0
  383. package/src/utils/SecureNonce.ts +78 -0
  384. package/src/utils/Semaphore.ts +276 -0
  385. package/src/utils/UsedAttestationTracker.ts +387 -0
  386. package/src/utils/fsSafe.ts +75 -0
  387. package/src/utils/index.ts +80 -0
  388. package/src/utils/security.ts +418 -0
  389. package/src/utils/validation.ts +164 -0
  390. package/src/__tests__/ProofGenerator.test.ts +0 -124
  391. package/src/__tests__/QuoteBuilder.test.ts +0 -516
  392. package/src/__tests__/StateMachine.test.ts +0 -82
  393. package/src/__tests__/builders/DeliveryProofBuilder.test.ts +0 -581
  394. package/src/__tests__/integration/ACTPClient.test.ts +0 -263
  395. package/src/__tests__/integration.test.ts +0 -289
  396. package/src/__tests__/protocol/EASHelper.test.ts +0 -472
  397. package/src/__tests__/protocol/EventMonitor.test.ts +0 -382
  398. package/src/__tests__/security/ACTPKernel.security.test.ts +0 -1167
  399. package/src/__tests__/security/EscrowVault.security.test.ts +0 -570
  400. package/src/__tests__/security/MessageSigner.security.test.ts +0 -286
  401. package/src/__tests__/security/NonceReplay.security.test.ts +0 -501
  402. package/src/__tests__/security/validation.security.test.ts +0 -376
  403. package/src/__tests__/utils/IPFSClient.test.ts +0 -262
  404. package/src/__tests__/utils/NonceManager.test.ts +0 -205
  405. package/src/__tests__/utils/canonicalJson.test.ts +0 -153
@@ -1,42 +1,190 @@
1
1
  "use strict";
2
+ /**
3
+ * Nonce Manager Implementation
4
+ * Tracks nonces per DID + message type for AIP-4 delivery proofs
5
+ * Reference: AIP-4 §3.2 (nonce field requirement)
6
+ *
7
+ * SECURITY FIXES:
8
+ * - C-2: Added atomic nonce allocation with locking
9
+ * - H-1: Added persistent nonce storage option
10
+ * - H-5: Added nonce upper bound validation
11
+ */
2
12
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DIDScopedNonceManager = exports.InMemoryNonceManager = void 0;
4
- exports.createNonceManager = createNonceManager;
13
+ exports.createNonceManager = exports.FileBasedNonceManager = exports.DIDScopedNonceManager = exports.InMemoryNonceManager = exports.MAX_NONCE_VALUE = void 0;
14
+ const fsSafe_1 = require("./fsSafe");
15
+ /**
16
+ * Maximum allowed nonce value.
17
+ * SECURITY FIX (H-5): Prevents nonce overflow attacks.
18
+ * Using Number.MAX_SAFE_INTEGER (2^53 - 1) to ensure safe JavaScript integer operations.
19
+ */
20
+ exports.MAX_NONCE_VALUE = Number.MAX_SAFE_INTEGER;
21
+ /**
22
+ * In-Memory Nonce Manager
23
+ * Simple implementation using Map for per-message-type nonce tracking
24
+ *
25
+ * SECURITY FIXES:
26
+ * - C-2: Added atomic getAndIncrementNonce() to prevent race conditions
27
+ * - H-5: Added nonce upper bound validation
28
+ *
29
+ * ⚠️ WARNING: Nonces are lost on process restart. For production:
30
+ * - Use persistent storage (Redis, PostgreSQL, etc.)
31
+ * - Implement nonce recovery from blockchain events
32
+ * - Add DID-scoped nonce tracking
33
+ */
5
34
  class InMemoryNonceManager {
35
+ /**
36
+ * Create in-memory nonce manager
37
+ * @param initialNonces - Optional initial nonce values (for recovery)
38
+ */
6
39
  constructor(initialNonces) {
7
40
  this.nonces = new Map();
41
+ // SECURITY FIX (C-2): Mutex for atomic nonce operations
42
+ // Store both the promise and its resolver for proper lock release
43
+ this.locks = new Map();
8
44
  if (initialNonces) {
9
45
  Object.entries(initialNonces).forEach(([messageType, nonce]) => {
46
+ // SECURITY FIX (H-5): Validate initial nonces
47
+ if (nonce > exports.MAX_NONCE_VALUE) {
48
+ throw new Error(`Initial nonce ${nonce} for ${messageType} exceeds maximum allowed value ${exports.MAX_NONCE_VALUE}`);
49
+ }
10
50
  this.nonces.set(messageType, nonce);
11
51
  });
12
52
  }
13
53
  }
54
+ /**
55
+ * SECURITY FIX (C-2 + DEADLOCK-FIX): Acquire lock for message type
56
+ * Ensures atomic nonce operations.
57
+ *
58
+ * FIXED: Previous implementation had a deadlock bug where:
59
+ * - The resolver was stored in a closure but never accessible to releaseLock()
60
+ * - releaseLock() just deleted the entry without resolving waiting Promises
61
+ *
62
+ * New implementation stores both promise AND resolver together.
63
+ */
64
+ async acquireLock(messageType) {
65
+ // Wait for any existing lock to be released
66
+ while (this.locks.has(messageType)) {
67
+ const existingLock = this.locks.get(messageType);
68
+ if (existingLock) {
69
+ await existingLock.promise;
70
+ }
71
+ }
72
+ // Create new lock with stored resolver
73
+ let resolver = () => { };
74
+ const lockPromise = new Promise((resolve) => {
75
+ resolver = resolve;
76
+ });
77
+ this.locks.set(messageType, { promise: lockPromise, resolve: resolver });
78
+ }
79
+ /**
80
+ * SECURITY FIX (C-2 + DEADLOCK-FIX): Release lock for message type
81
+ *
82
+ * FIXED: Now properly resolves the Promise before deleting,
83
+ * so any waiting acquireLock() calls can proceed.
84
+ */
85
+ releaseLock(messageType) {
86
+ const lock = this.locks.get(messageType);
87
+ if (lock) {
88
+ lock.resolve(); // Resolve the promise first
89
+ this.locks.delete(messageType); // Then delete the entry
90
+ }
91
+ }
92
+ /**
93
+ * Get next nonce for message type
94
+ * @param messageType - Message type identifier
95
+ * @returns Monotonically increasing nonce
96
+ */
14
97
  getNextNonce(messageType) {
15
98
  const current = this.nonces.get(messageType) || 0;
16
- return current + 1;
99
+ const next = current + 1;
100
+ // SECURITY FIX (H-5): Check upper bound
101
+ if (next > exports.MAX_NONCE_VALUE) {
102
+ throw new Error(`Nonce overflow: next nonce ${next} exceeds maximum allowed value ${exports.MAX_NONCE_VALUE}. ` +
103
+ `Consider resetting nonces or using a larger storage type.`);
104
+ }
105
+ return next;
106
+ }
107
+ /**
108
+ * SECURITY FIX (C-2): Atomic get-and-increment nonce
109
+ * Returns the next nonce and records it atomically to prevent race conditions.
110
+ *
111
+ * @param messageType - Message type identifier
112
+ * @returns Atomically allocated nonce
113
+ */
114
+ async getAndIncrementNonce(messageType) {
115
+ await this.acquireLock(messageType);
116
+ try {
117
+ const current = this.nonces.get(messageType) || 0;
118
+ const next = current + 1;
119
+ // SECURITY FIX (H-5): Check upper bound
120
+ if (next > exports.MAX_NONCE_VALUE) {
121
+ throw new Error(`Nonce overflow: next nonce ${next} exceeds maximum allowed value ${exports.MAX_NONCE_VALUE}`);
122
+ }
123
+ this.nonces.set(messageType, next);
124
+ return next;
125
+ }
126
+ finally {
127
+ this.releaseLock(messageType);
128
+ }
17
129
  }
130
+ /**
131
+ * Record nonce usage
132
+ * @param messageType - Message type identifier
133
+ * @param nonce - Nonce used
134
+ */
18
135
  recordNonce(messageType, nonce) {
19
136
  const current = this.nonces.get(messageType) || 0;
137
+ // SECURITY FIX (H-5): Check upper bound
138
+ if (nonce > exports.MAX_NONCE_VALUE) {
139
+ throw new Error(`Nonce ${nonce} exceeds maximum allowed value ${exports.MAX_NONCE_VALUE}`);
140
+ }
141
+ // Ensure monotonic increase
20
142
  if (nonce <= current) {
21
143
  throw new Error(`Nonce must be strictly increasing: attempted ${nonce}, current is ${current}`);
22
144
  }
23
145
  this.nonces.set(messageType, nonce);
24
146
  }
147
+ /**
148
+ * Get current nonce (last used)
149
+ * @param messageType - Message type identifier
150
+ * @returns Current nonce or 0 if none used
151
+ */
25
152
  getCurrentNonce(messageType) {
26
153
  return this.nonces.get(messageType) || 0;
27
154
  }
155
+ /**
156
+ * Reset nonce for message type
157
+ * @param messageType - Message type identifier
158
+ */
28
159
  resetNonce(messageType) {
29
160
  this.nonces.delete(messageType);
30
161
  }
162
+ /**
163
+ * Get all nonces (for persistence)
164
+ * @returns Record of all message type nonces
165
+ */
31
166
  getAllNonces() {
32
167
  return Object.fromEntries(this.nonces.entries());
33
168
  }
169
+ /**
170
+ * Clear all nonces
171
+ */
34
172
  clearAll() {
35
173
  this.nonces.clear();
36
174
  }
37
175
  }
38
176
  exports.InMemoryNonceManager = InMemoryNonceManager;
177
+ /**
178
+ * DID-Scoped Nonce Manager
179
+ * Tracks nonces per DID + message type combination
180
+ * Recommended for multi-agent scenarios
181
+ */
39
182
  class DIDScopedNonceManager {
183
+ /**
184
+ * Create DID-scoped nonce manager
185
+ * @param did - DID to track nonces for
186
+ * @param initialNonces - Optional initial nonce values
187
+ */
40
188
  constructor(did, initialNonces) {
41
189
  this.nonces = new Map();
42
190
  this.currentDID = did;
@@ -48,18 +196,43 @@ class DIDScopedNonceManager {
48
196
  this.nonces.set(did, didNonces);
49
197
  }
50
198
  }
199
+ /**
200
+ * Get next nonce for message type (current DID)
201
+ * @param messageType - Message type identifier
202
+ * @returns Monotonically increasing nonce
203
+ */
51
204
  getNextNonce(messageType) {
52
205
  return this.getNextNonceForDID(this.currentDID, messageType);
53
206
  }
207
+ /**
208
+ * Record nonce usage (current DID)
209
+ * @param messageType - Message type identifier
210
+ * @param nonce - Nonce used
211
+ */
54
212
  recordNonce(messageType, nonce) {
55
213
  this.recordNonceForDID(this.currentDID, messageType, nonce);
56
214
  }
215
+ /**
216
+ * Get current nonce (current DID)
217
+ * @param messageType - Message type identifier
218
+ * @returns Current nonce or 0 if none used
219
+ */
57
220
  getCurrentNonce(messageType) {
58
221
  return this.getCurrentNonceForDID(this.currentDID, messageType);
59
222
  }
223
+ /**
224
+ * Reset nonce for message type (current DID)
225
+ * @param messageType - Message type identifier
226
+ */
60
227
  resetNonce(messageType) {
61
228
  this.resetNonceForDID(this.currentDID, messageType);
62
229
  }
230
+ /**
231
+ * Get next nonce for specific DID + message type
232
+ * @param did - DID identifier
233
+ * @param messageType - Message type identifier
234
+ * @returns Monotonically increasing nonce
235
+ */
63
236
  getNextNonceForDID(did, messageType) {
64
237
  const didNonces = this.nonces.get(did);
65
238
  if (!didNonces) {
@@ -68,6 +241,12 @@ class DIDScopedNonceManager {
68
241
  const current = didNonces.get(messageType) || 0;
69
242
  return current + 1;
70
243
  }
244
+ /**
245
+ * Record nonce usage for specific DID + message type
246
+ * @param did - DID identifier
247
+ * @param messageType - Message type identifier
248
+ * @param nonce - Nonce used
249
+ */
71
250
  recordNonceForDID(did, messageType, nonce) {
72
251
  let didNonces = this.nonces.get(did);
73
252
  if (!didNonces) {
@@ -75,24 +254,44 @@ class DIDScopedNonceManager {
75
254
  this.nonces.set(did, didNonces);
76
255
  }
77
256
  const current = didNonces.get(messageType) || 0;
257
+ // Ensure monotonic increase
78
258
  if (nonce <= current) {
79
259
  throw new Error(`Nonce must be strictly increasing for ${did}: attempted ${nonce}, current is ${current}`);
80
260
  }
81
261
  didNonces.set(messageType, nonce);
82
262
  }
263
+ /**
264
+ * Get current nonce for specific DID + message type
265
+ * @param did - DID identifier
266
+ * @param messageType - Message type identifier
267
+ * @returns Current nonce or 0 if none used
268
+ */
83
269
  getCurrentNonceForDID(did, messageType) {
84
270
  const didNonces = this.nonces.get(did);
85
271
  return didNonces?.get(messageType) || 0;
86
272
  }
273
+ /**
274
+ * Reset nonce for specific DID + message type
275
+ * @param did - DID identifier
276
+ * @param messageType - Message type identifier
277
+ */
87
278
  resetNonceForDID(did, messageType) {
88
279
  const didNonces = this.nonces.get(did);
89
280
  if (didNonces) {
90
281
  didNonces.delete(messageType);
91
282
  }
92
283
  }
284
+ /**
285
+ * Switch current DID context
286
+ * @param did - New DID to track
287
+ */
93
288
  switchDID(did) {
94
289
  this.currentDID = did;
95
290
  }
291
+ /**
292
+ * Get all nonces for all DIDs (for persistence)
293
+ * @returns Nested record of DID → message type → nonce
294
+ */
96
295
  getAllNonces() {
97
296
  const result = {};
98
297
  this.nonces.forEach((didNonces, did) => {
@@ -100,15 +299,181 @@ class DIDScopedNonceManager {
100
299
  });
101
300
  return result;
102
301
  }
302
+ /**
303
+ * Clear all nonces for all DIDs
304
+ */
103
305
  clearAll() {
104
306
  this.nonces.clear();
105
307
  }
106
308
  }
107
309
  exports.DIDScopedNonceManager = DIDScopedNonceManager;
108
- function createNonceManager(did, initialNonces) {
109
- if (did) {
110
- return new DIDScopedNonceManager(did, initialNonces);
310
+ /**
311
+ * File-based Nonce Manager for Persistent Storage
312
+ *
313
+ * SECURITY FIX (H-1): Persists nonces to disk to survive process restarts.
314
+ * SECURITY FIX (NEW-H-4): File locking to prevent concurrent write corruption.
315
+ * Uses atomic file writes (temp file + rename) for crash safety.
316
+ *
317
+ * @module utils/NonceManager
318
+ */
319
+ class FileBasedNonceManager {
320
+ /**
321
+ * Create file-based nonce manager
322
+ * @param stateDirectory - Directory to store nonces file
323
+ */
324
+ constructor(stateDirectory) {
325
+ this.fs = require('fs');
326
+ this.path = require('path');
327
+ // SECURITY FIX (NEW-H-4): File locking to prevent race conditions
328
+ this.lockfile = require('proper-lockfile');
329
+ // Ensure .actp directory exists
330
+ const actpDir = this.path.join(stateDirectory, '.actp');
331
+ (0, fsSafe_1.ensureSafeDir)(actpDir, 0o755);
332
+ this.filePath = this.path.join(actpDir, 'nonces.json');
333
+ // Load existing nonces
334
+ const initialNonces = this.loadFromFile();
335
+ this.inMemory = new InMemoryNonceManager(initialNonces);
336
+ }
337
+ /**
338
+ * Load nonces from file
339
+ */
340
+ loadFromFile() {
341
+ if (!this.fs.existsSync(this.filePath)) {
342
+ return undefined;
343
+ }
344
+ try {
345
+ // SECURITY: Refuse to read from symlinked nonce files
346
+ (0, fsSafe_1.assertSafeFileForRead)(this.filePath);
347
+ const MAX_NONCE_FILE_SIZE = 5 * 1024 * 1024; // 5MB
348
+ const st = this.fs.statSync(this.filePath);
349
+ if (st.size > MAX_NONCE_FILE_SIZE) {
350
+ throw new Error(`nonces.json exceeds ${MAX_NONCE_FILE_SIZE / 1024 / 1024}MB limit: ${this.filePath}`);
351
+ }
352
+ const data = JSON.parse(this.fs.readFileSync(this.filePath, 'utf-8'));
353
+ return data;
354
+ }
355
+ catch (e) {
356
+ // Fail closed: nonce resets can enable replay.
357
+ throw new Error(`Failed to parse nonces.json (replay protection would be weakened). ` +
358
+ `Fix/delete the file: ${this.filePath}. Error: ${e?.message || String(e)}`);
359
+ }
360
+ }
361
+ /**
362
+ * Save nonces to file atomically with file locking
363
+ *
364
+ * SECURITY FIX (NEW-H-4): File locking prevents concurrent write corruption
365
+ */
366
+ async saveToFile() {
367
+ const data = this.inMemory.getAllNonces();
368
+ const tempPath = `${this.filePath}.tmp`;
369
+ // SECURITY FIX: Ensure file exists before locking (proper-lockfile requirement)
370
+ (0, fsSafe_1.ensureSafeFile)(this.filePath, '{}', 0o644);
371
+ // SECURITY FIX (NEW-H-4): Acquire file lock before writing
372
+ let release = null;
373
+ try {
374
+ release = await this.lockfile.lock(this.filePath, {
375
+ stale: 10000, // Lock expires after 10 seconds if process crashes
376
+ retries: {
377
+ retries: 5,
378
+ minTimeout: 100,
379
+ maxTimeout: 500
380
+ }
381
+ });
382
+ // Atomic write: temp file + rename
383
+ if (this.fs.existsSync(tempPath)) {
384
+ this.fs.unlinkSync(tempPath);
385
+ }
386
+ this.fs.writeFileSync(tempPath, JSON.stringify(data, null, 2), {
387
+ encoding: 'utf-8',
388
+ mode: 0o644,
389
+ flag: 'wx'
390
+ });
391
+ this.fs.renameSync(tempPath, this.filePath);
392
+ }
393
+ catch (error) {
394
+ // Clean up temp file on error
395
+ if (this.fs.existsSync(tempPath)) {
396
+ try {
397
+ this.fs.unlinkSync(tempPath);
398
+ }
399
+ catch {
400
+ // Ignore cleanup errors
401
+ }
402
+ }
403
+ throw error;
404
+ }
405
+ finally {
406
+ if (release) {
407
+ await release();
408
+ }
409
+ }
410
+ }
411
+ getNextNonce(messageType) {
412
+ return this.inMemory.getNextNonce(messageType);
413
+ }
414
+ /**
415
+ * Atomic get and increment with persistence
416
+ */
417
+ async getAndIncrementNonce(messageType) {
418
+ const nonce = await this.inMemory.getAndIncrementNonce(messageType);
419
+ // SECURITY FIX (NEW-H-4): saveToFile is now async
420
+ await this.saveToFile();
421
+ return nonce;
422
+ }
423
+ recordNonce(messageType, nonce) {
424
+ this.inMemory.recordNonce(messageType, nonce);
425
+ // Fire-and-forget to maintain sync interface
426
+ this.saveToFile().catch((err) => {
427
+ console.error('Failed to save nonce manager state:', err);
428
+ });
429
+ }
430
+ getCurrentNonce(messageType) {
431
+ return this.inMemory.getCurrentNonce(messageType);
432
+ }
433
+ resetNonce(messageType) {
434
+ this.inMemory.resetNonce(messageType);
435
+ // Fire-and-forget to maintain sync interface
436
+ this.saveToFile().catch((err) => {
437
+ console.error('Failed to save nonce manager state:', err);
438
+ });
439
+ }
440
+ getAllNonces() {
441
+ return this.inMemory.getAllNonces();
442
+ }
443
+ clearAll() {
444
+ this.inMemory.clearAll();
445
+ if (this.fs.existsSync(this.filePath)) {
446
+ this.fs.unlinkSync(this.filePath);
447
+ }
111
448
  }
112
- return new InMemoryNonceManager(initialNonces);
113
449
  }
450
+ exports.FileBasedNonceManager = FileBasedNonceManager;
451
+ /**
452
+ * Create nonce manager based on environment
453
+ * @param options - Configuration options
454
+ * @returns NonceManager instance
455
+ *
456
+ * @example
457
+ * ```typescript
458
+ * // In-memory (default)
459
+ * const manager = createNonceManager();
460
+ *
461
+ * // DID-scoped
462
+ * const manager = createNonceManager({ did: 'did:ethr:0x...' });
463
+ *
464
+ * // Persistent (survives restarts)
465
+ * const manager = createNonceManager({ stateDirectory: '/path/to/project' });
466
+ * ```
467
+ */
468
+ function createNonceManager(options) {
469
+ // SECURITY FIX (H-1): Support persistent storage
470
+ if (options?.stateDirectory) {
471
+ return new FileBasedNonceManager(options.stateDirectory);
472
+ }
473
+ if (options?.did) {
474
+ return new DIDScopedNonceManager(options.did, options?.initialNonces);
475
+ }
476
+ return new InMemoryNonceManager(options?.initialNonces);
477
+ }
478
+ exports.createNonceManager = createNonceManager;
114
479
  //# sourceMappingURL=NonceManager.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NonceManager.js","sourceRoot":"","sources":["../../src/utils/NonceManager.ts"],"names":[],"mappings":";;;AA4RA,gDAQC;AArPD,MAAa,oBAAoB;IAO/B,YAAY,aAAsC;QAN1C,WAAM,GAAwB,IAAI,GAAG,EAAE,CAAC;QAO9C,IAAI,aAAa,EAAE,CAAC;YAClB,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,EAAE,KAAK,CAAC,EAAE,EAAE;gBAC7D,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;YACtC,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAOD,YAAY,CAAC,WAAmB;QAC9B,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAClD,OAAO,OAAO,GAAG,CAAC,CAAC;IACrB,CAAC;IAOD,WAAW,CAAC,WAAmB,EAAE,KAAa;QAC5C,MAAM,OAAO,GAAG,IAAI,C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