@hashgraphonline/standards-sdk 0.1.184 → 0.1.186

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 (452) hide show
  1. package/dist/browser/hcs-25/adapters/acp.d.ts +20 -0
  2. package/dist/browser/hcs-25/adapters/acp.d.ts.map +1 -0
  3. package/dist/browser/hcs-25/adapters/agentverse.d.ts +34 -0
  4. package/dist/browser/hcs-25/adapters/agentverse.d.ts.map +1 -0
  5. package/dist/browser/hcs-25/adapters/availability.d.ts +22 -0
  6. package/dist/browser/hcs-25/adapters/availability.d.ts.map +1 -0
  7. package/dist/browser/hcs-25/adapters/connectivity.d.ts +25 -0
  8. package/dist/browser/hcs-25/adapters/connectivity.d.ts.map +1 -0
  9. package/dist/browser/hcs-25/adapters/erc8004-feedback.d.ts +19 -0
  10. package/dist/browser/hcs-25/adapters/erc8004-feedback.d.ts.map +1 -0
  11. package/dist/browser/hcs-25/adapters/ethos.d.ts +21 -0
  12. package/dist/browser/hcs-25/adapters/ethos.d.ts.map +1 -0
  13. package/dist/browser/hcs-25/adapters/index.d.ts +21 -0
  14. package/dist/browser/hcs-25/adapters/index.d.ts.map +1 -0
  15. package/dist/browser/hcs-25/adapters/model-evals.d.ts +61 -0
  16. package/dist/browser/hcs-25/adapters/model-evals.d.ts.map +1 -0
  17. package/dist/browser/hcs-25/adapters/normalization.d.ts +20 -0
  18. package/dist/browser/hcs-25/adapters/normalization.d.ts.map +1 -0
  19. package/dist/browser/hcs-25/adapters/oss-popularity.d.ts +22 -0
  20. package/dist/browser/hcs-25/adapters/oss-popularity.d.ts.map +1 -0
  21. package/dist/browser/hcs-25/adapters/output-verification.d.ts +27 -0
  22. package/dist/browser/hcs-25/adapters/output-verification.d.ts.map +1 -0
  23. package/dist/browser/hcs-25/adapters/simple-evals.d.ts +14 -0
  24. package/dist/browser/hcs-25/adapters/simple-evals.d.ts.map +1 -0
  25. package/dist/browser/hcs-25/adapters/x402.d.ts +18 -0
  26. package/dist/browser/hcs-25/adapters/x402.d.ts.map +1 -0
  27. package/dist/browser/hcs-25/identifiers.d.ts +24 -0
  28. package/dist/browser/hcs-25/identifiers.d.ts.map +1 -0
  29. package/dist/browser/hcs-25/index.d.ts +6 -0
  30. package/dist/browser/hcs-25/index.d.ts.map +1 -0
  31. package/dist/browser/hcs-25/scoring.d.ts +32 -0
  32. package/dist/browser/hcs-25/scoring.d.ts.map +1 -0
  33. package/dist/browser/hcs-25/signals/index.d.ts +20 -0
  34. package/dist/browser/hcs-25/signals/index.d.ts.map +1 -0
  35. package/dist/browser/hcs-25/signals/marketplace.d.ts +296 -0
  36. package/dist/browser/hcs-25/signals/marketplace.d.ts.map +1 -0
  37. package/dist/browser/hcs-25/signals/metadata.d.ts +40 -0
  38. package/dist/browser/hcs-25/signals/metadata.d.ts.map +1 -0
  39. package/dist/browser/hcs-25/signals/model-evals.d.ts +127 -0
  40. package/dist/browser/hcs-25/signals/model-evals.d.ts.map +1 -0
  41. package/dist/browser/hcs-25/signals/operational.d.ts +757 -0
  42. package/dist/browser/hcs-25/signals/operational.d.ts.map +1 -0
  43. package/dist/browser/hcs-25/signals/simple-evals.d.ts +156 -0
  44. package/dist/browser/hcs-25/signals/simple-evals.d.ts.map +1 -0
  45. package/dist/browser/hcs-25/types.d.ts +363 -0
  46. package/dist/browser/hcs-25/types.d.ts.map +1 -0
  47. package/dist/browser/index.d.ts +1 -0
  48. package/dist/browser/index.d.ts.map +1 -1
  49. package/dist/browser-root/hcs-25/adapters/acp.d.ts +20 -0
  50. package/dist/browser-root/hcs-25/adapters/acp.d.ts.map +1 -0
  51. package/dist/browser-root/hcs-25/adapters/agentverse.d.ts +34 -0
  52. package/dist/browser-root/hcs-25/adapters/agentverse.d.ts.map +1 -0
  53. package/dist/browser-root/hcs-25/adapters/availability.d.ts +22 -0
  54. package/dist/browser-root/hcs-25/adapters/availability.d.ts.map +1 -0
  55. package/dist/browser-root/hcs-25/adapters/connectivity.d.ts +25 -0
  56. package/dist/browser-root/hcs-25/adapters/connectivity.d.ts.map +1 -0
  57. package/dist/browser-root/hcs-25/adapters/erc8004-feedback.d.ts +19 -0
  58. package/dist/browser-root/hcs-25/adapters/erc8004-feedback.d.ts.map +1 -0
  59. package/dist/browser-root/hcs-25/adapters/ethos.d.ts +21 -0
  60. package/dist/browser-root/hcs-25/adapters/ethos.d.ts.map +1 -0
  61. package/dist/browser-root/hcs-25/adapters/index.d.ts +21 -0
  62. package/dist/browser-root/hcs-25/adapters/index.d.ts.map +1 -0
  63. package/dist/browser-root/hcs-25/adapters/model-evals.d.ts +61 -0
  64. package/dist/browser-root/hcs-25/adapters/model-evals.d.ts.map +1 -0
  65. package/dist/browser-root/hcs-25/adapters/normalization.d.ts +20 -0
  66. package/dist/browser-root/hcs-25/adapters/normalization.d.ts.map +1 -0
  67. package/dist/browser-root/hcs-25/adapters/oss-popularity.d.ts +22 -0
  68. package/dist/browser-root/hcs-25/adapters/oss-popularity.d.ts.map +1 -0
  69. package/dist/browser-root/hcs-25/adapters/output-verification.d.ts +27 -0
  70. package/dist/browser-root/hcs-25/adapters/output-verification.d.ts.map +1 -0
  71. package/dist/browser-root/hcs-25/adapters/simple-evals.d.ts +14 -0
  72. package/dist/browser-root/hcs-25/adapters/simple-evals.d.ts.map +1 -0
  73. package/dist/browser-root/hcs-25/adapters/x402.d.ts +18 -0
  74. package/dist/browser-root/hcs-25/adapters/x402.d.ts.map +1 -0
  75. package/dist/browser-root/hcs-25/identifiers.d.ts +24 -0
  76. package/dist/browser-root/hcs-25/identifiers.d.ts.map +1 -0
  77. package/dist/browser-root/hcs-25/index.d.ts +6 -0
  78. package/dist/browser-root/hcs-25/index.d.ts.map +1 -0
  79. package/dist/browser-root/hcs-25/scoring.d.ts +32 -0
  80. package/dist/browser-root/hcs-25/scoring.d.ts.map +1 -0
  81. package/dist/browser-root/hcs-25/signals/index.d.ts +20 -0
  82. package/dist/browser-root/hcs-25/signals/index.d.ts.map +1 -0
  83. package/dist/browser-root/hcs-25/signals/marketplace.d.ts +296 -0
  84. package/dist/browser-root/hcs-25/signals/marketplace.d.ts.map +1 -0
  85. package/dist/browser-root/hcs-25/signals/metadata.d.ts +40 -0
  86. package/dist/browser-root/hcs-25/signals/metadata.d.ts.map +1 -0
  87. package/dist/browser-root/hcs-25/signals/model-evals.d.ts +127 -0
  88. package/dist/browser-root/hcs-25/signals/model-evals.d.ts.map +1 -0
  89. package/dist/browser-root/hcs-25/signals/operational.d.ts +757 -0
  90. package/dist/browser-root/hcs-25/signals/operational.d.ts.map +1 -0
  91. package/dist/browser-root/hcs-25/signals/simple-evals.d.ts +156 -0
  92. package/dist/browser-root/hcs-25/signals/simple-evals.d.ts.map +1 -0
  93. package/dist/browser-root/hcs-25/types.d.ts +363 -0
  94. package/dist/browser-root/hcs-25/types.d.ts.map +1 -0
  95. package/dist/browser-root/index.d.ts +1 -0
  96. package/dist/browser-root/index.d.ts.map +1 -1
  97. package/dist/cjs/hcs-25/adapters/acp.d.ts +20 -0
  98. package/dist/cjs/hcs-25/adapters/acp.d.ts.map +1 -0
  99. package/dist/cjs/hcs-25/adapters/agentverse.d.ts +34 -0
  100. package/dist/cjs/hcs-25/adapters/agentverse.d.ts.map +1 -0
  101. package/dist/cjs/hcs-25/adapters/availability.d.ts +22 -0
  102. package/dist/cjs/hcs-25/adapters/availability.d.ts.map +1 -0
  103. package/dist/cjs/hcs-25/adapters/connectivity.d.ts +25 -0
  104. package/dist/cjs/hcs-25/adapters/connectivity.d.ts.map +1 -0
  105. package/dist/cjs/hcs-25/adapters/erc8004-feedback.d.ts +19 -0
  106. package/dist/cjs/hcs-25/adapters/erc8004-feedback.d.ts.map +1 -0
  107. package/dist/cjs/hcs-25/adapters/ethos.d.ts +21 -0
  108. package/dist/cjs/hcs-25/adapters/ethos.d.ts.map +1 -0
  109. package/dist/cjs/hcs-25/adapters/index.d.ts +21 -0
  110. package/dist/cjs/hcs-25/adapters/index.d.ts.map +1 -0
  111. package/dist/cjs/hcs-25/adapters/model-evals.d.ts +61 -0
  112. package/dist/cjs/hcs-25/adapters/model-evals.d.ts.map +1 -0
  113. package/dist/cjs/hcs-25/adapters/normalization.d.ts +20 -0
  114. package/dist/cjs/hcs-25/adapters/normalization.d.ts.map +1 -0
  115. package/dist/cjs/hcs-25/adapters/oss-popularity.d.ts +22 -0
  116. package/dist/cjs/hcs-25/adapters/oss-popularity.d.ts.map +1 -0
  117. package/dist/cjs/hcs-25/adapters/output-verification.d.ts +27 -0
  118. package/dist/cjs/hcs-25/adapters/output-verification.d.ts.map +1 -0
  119. package/dist/cjs/hcs-25/adapters/simple-evals.d.ts +14 -0
  120. package/dist/cjs/hcs-25/adapters/simple-evals.d.ts.map +1 -0
  121. package/dist/cjs/hcs-25/adapters/x402.d.ts +18 -0
  122. package/dist/cjs/hcs-25/adapters/x402.d.ts.map +1 -0
  123. package/dist/cjs/hcs-25/identifiers.d.ts +24 -0
  124. package/dist/cjs/hcs-25/identifiers.d.ts.map +1 -0
  125. package/dist/cjs/hcs-25/index.d.ts +6 -0
  126. package/dist/cjs/hcs-25/index.d.ts.map +1 -0
  127. package/dist/cjs/hcs-25/scoring.d.ts +32 -0
  128. package/dist/cjs/hcs-25/scoring.d.ts.map +1 -0
  129. package/dist/cjs/hcs-25/signals/index.d.ts +20 -0
  130. package/dist/cjs/hcs-25/signals/index.d.ts.map +1 -0
  131. package/dist/cjs/hcs-25/signals/marketplace.d.ts +296 -0
  132. package/dist/cjs/hcs-25/signals/marketplace.d.ts.map +1 -0
  133. package/dist/cjs/hcs-25/signals/metadata.d.ts +40 -0
  134. package/dist/cjs/hcs-25/signals/metadata.d.ts.map +1 -0
  135. package/dist/cjs/hcs-25/signals/model-evals.d.ts +127 -0
  136. package/dist/cjs/hcs-25/signals/model-evals.d.ts.map +1 -0
  137. package/dist/cjs/hcs-25/signals/operational.d.ts +757 -0
  138. package/dist/cjs/hcs-25/signals/operational.d.ts.map +1 -0
  139. package/dist/cjs/hcs-25/signals/simple-evals.d.ts +156 -0
  140. package/dist/cjs/hcs-25/signals/simple-evals.d.ts.map +1 -0
  141. package/dist/cjs/hcs-25/types.d.ts +363 -0
  142. package/dist/cjs/hcs-25/types.d.ts.map +1 -0
  143. package/dist/cjs/index.d.ts +1 -0
  144. package/dist/cjs/index.d.ts.map +1 -1
  145. package/dist/cjs/standards-sdk.cjs +2 -2
  146. package/dist/cjs/standards-sdk.cjs.map +1 -1
  147. package/dist/es/hcs-25/adapters/acp.d.ts +20 -0
  148. package/dist/es/hcs-25/adapters/acp.d.ts.map +1 -0
  149. package/dist/es/hcs-25/adapters/agentverse.d.ts +34 -0
  150. package/dist/es/hcs-25/adapters/agentverse.d.ts.map +1 -0
  151. package/dist/es/hcs-25/adapters/availability.d.ts +22 -0
  152. package/dist/es/hcs-25/adapters/availability.d.ts.map +1 -0
  153. package/dist/es/hcs-25/adapters/connectivity.d.ts +25 -0
  154. package/dist/es/hcs-25/adapters/connectivity.d.ts.map +1 -0
  155. package/dist/es/hcs-25/adapters/erc8004-feedback.d.ts +19 -0
  156. package/dist/es/hcs-25/adapters/erc8004-feedback.d.ts.map +1 -0
  157. package/dist/es/hcs-25/adapters/ethos.d.ts +21 -0
  158. package/dist/es/hcs-25/adapters/ethos.d.ts.map +1 -0
  159. package/dist/es/hcs-25/adapters/index.d.ts +21 -0
  160. package/dist/es/hcs-25/adapters/index.d.ts.map +1 -0
  161. package/dist/es/hcs-25/adapters/model-evals.d.ts +61 -0
  162. package/dist/es/hcs-25/adapters/model-evals.d.ts.map +1 -0
  163. package/dist/es/hcs-25/adapters/normalization.d.ts +20 -0
  164. package/dist/es/hcs-25/adapters/normalization.d.ts.map +1 -0
  165. package/dist/es/hcs-25/adapters/oss-popularity.d.ts +22 -0
  166. package/dist/es/hcs-25/adapters/oss-popularity.d.ts.map +1 -0
  167. package/dist/es/hcs-25/adapters/output-verification.d.ts +27 -0
  168. package/dist/es/hcs-25/adapters/output-verification.d.ts.map +1 -0
  169. package/dist/es/hcs-25/adapters/simple-evals.d.ts +14 -0
  170. package/dist/es/hcs-25/adapters/simple-evals.d.ts.map +1 -0
  171. package/dist/es/hcs-25/adapters/x402.d.ts +18 -0
  172. package/dist/es/hcs-25/adapters/x402.d.ts.map +1 -0
  173. package/dist/es/hcs-25/identifiers.d.ts +24 -0
  174. package/dist/es/hcs-25/identifiers.d.ts.map +1 -0
  175. package/dist/es/hcs-25/index.d.ts +6 -0
  176. package/dist/es/hcs-25/index.d.ts.map +1 -0
  177. package/dist/es/hcs-25/scoring.d.ts +32 -0
  178. package/dist/es/hcs-25/scoring.d.ts.map +1 -0
  179. package/dist/es/hcs-25/signals/index.d.ts +20 -0
  180. package/dist/es/hcs-25/signals/index.d.ts.map +1 -0
  181. package/dist/es/hcs-25/signals/marketplace.d.ts +296 -0
  182. package/dist/es/hcs-25/signals/marketplace.d.ts.map +1 -0
  183. package/dist/es/hcs-25/signals/metadata.d.ts +40 -0
  184. package/dist/es/hcs-25/signals/metadata.d.ts.map +1 -0
  185. package/dist/es/hcs-25/signals/model-evals.d.ts +127 -0
  186. package/dist/es/hcs-25/signals/model-evals.d.ts.map +1 -0
  187. package/dist/es/hcs-25/signals/operational.d.ts +757 -0
  188. package/dist/es/hcs-25/signals/operational.d.ts.map +1 -0
  189. package/dist/es/hcs-25/signals/simple-evals.d.ts +156 -0
  190. package/dist/es/hcs-25/signals/simple-evals.d.ts.map +1 -0
  191. package/dist/es/hcs-25/types.d.ts +363 -0
  192. package/dist/es/hcs-25/types.d.ts.map +1 -0
  193. package/dist/es/index.d.ts +1 -0
  194. package/dist/es/index.d.ts.map +1 -1
  195. package/dist/es/standards-sdk.es.js +131 -40
  196. package/dist/es/standards-sdk.es.js.map +1 -1
  197. package/dist/es/standards-sdk.es101.js +2 -2
  198. package/dist/es/standards-sdk.es103.js +2 -2
  199. package/dist/es/standards-sdk.es104.js +1 -1
  200. package/dist/es/standards-sdk.es106.js +1 -1
  201. package/dist/es/standards-sdk.es108.js +2 -2
  202. package/dist/es/standards-sdk.es11.js +1 -1
  203. package/dist/es/standards-sdk.es110.js +1 -1
  204. package/dist/es/standards-sdk.es111.js +2 -2
  205. package/dist/es/standards-sdk.es115.js +3 -3
  206. package/dist/es/standards-sdk.es116.js +4 -4
  207. package/dist/es/standards-sdk.es117.js +19 -251
  208. package/dist/es/standards-sdk.es117.js.map +1 -1
  209. package/dist/es/standards-sdk.es118.js +60 -475
  210. package/dist/es/standards-sdk.es118.js.map +1 -1
  211. package/dist/es/standards-sdk.es119.js +218 -86
  212. package/dist/es/standards-sdk.es119.js.map +1 -1
  213. package/dist/es/standards-sdk.es12.js +1 -1
  214. package/dist/es/standards-sdk.es120.js +225 -159
  215. package/dist/es/standards-sdk.es120.js.map +1 -1
  216. package/dist/es/standards-sdk.es121.js +50 -33
  217. package/dist/es/standards-sdk.es121.js.map +1 -1
  218. package/dist/es/standards-sdk.es122.js +250 -10
  219. package/dist/es/standards-sdk.es122.js.map +1 -1
  220. package/dist/es/standards-sdk.es123.js +448 -152
  221. package/dist/es/standards-sdk.es123.js.map +1 -1
  222. package/dist/es/standards-sdk.es124.js +101 -25
  223. package/dist/es/standards-sdk.es124.js.map +1 -1
  224. package/dist/es/standards-sdk.es125.js +155 -17
  225. package/dist/es/standards-sdk.es125.js.map +1 -1
  226. package/dist/es/standards-sdk.es126.js +29 -155
  227. package/dist/es/standards-sdk.es126.js.map +1 -1
  228. package/dist/es/standards-sdk.es127.js +9 -198
  229. package/dist/es/standards-sdk.es127.js.map +1 -1
  230. package/dist/es/standards-sdk.es128.js +146 -754
  231. package/dist/es/standards-sdk.es128.js.map +1 -1
  232. package/dist/es/standards-sdk.es129.js +27 -11
  233. package/dist/es/standards-sdk.es129.js.map +1 -1
  234. package/dist/es/standards-sdk.es13.js +1 -1
  235. package/dist/es/standards-sdk.es130.js +19 -564
  236. package/dist/es/standards-sdk.es130.js.map +1 -1
  237. package/dist/es/standards-sdk.es131.js +140 -606
  238. package/dist/es/standards-sdk.es131.js.map +1 -1
  239. package/dist/es/standards-sdk.es132.js +200 -12
  240. package/dist/es/standards-sdk.es132.js.map +1 -1
  241. package/dist/es/standards-sdk.es133.js +790 -2
  242. package/dist/es/standards-sdk.es133.js.map +1 -1
  243. package/dist/es/standards-sdk.es134.js +10 -84
  244. package/dist/es/standards-sdk.es134.js.map +1 -1
  245. package/dist/es/standards-sdk.es135.js +567 -40
  246. package/dist/es/standards-sdk.es135.js.map +1 -1
  247. package/dist/es/standards-sdk.es136.js +626 -2
  248. package/dist/es/standards-sdk.es136.js.map +1 -1
  249. package/dist/es/standards-sdk.es137.js +12 -234
  250. package/dist/es/standards-sdk.es137.js.map +1 -1
  251. package/dist/es/standards-sdk.es138.js +2 -1140
  252. package/dist/es/standards-sdk.es138.js.map +1 -1
  253. package/dist/es/standards-sdk.es139.js +73 -292
  254. package/dist/es/standards-sdk.es139.js.map +1 -1
  255. package/dist/es/standards-sdk.es14.js +1 -1
  256. package/dist/es/standards-sdk.es140.js +36 -418
  257. package/dist/es/standards-sdk.es140.js.map +1 -1
  258. package/dist/es/standards-sdk.es141.js +2 -355
  259. package/dist/es/standards-sdk.es141.js.map +1 -1
  260. package/dist/es/standards-sdk.es142.js +198 -1085
  261. package/dist/es/standards-sdk.es142.js.map +1 -1
  262. package/dist/es/standards-sdk.es143.js +1107 -175
  263. package/dist/es/standards-sdk.es143.js.map +1 -1
  264. package/dist/es/standards-sdk.es144.js +218 -1479
  265. package/dist/es/standards-sdk.es144.js.map +1 -1
  266. package/dist/es/standards-sdk.es145.js +419 -1154
  267. package/dist/es/standards-sdk.es145.js.map +1 -1
  268. package/dist/es/standards-sdk.es146.js +351 -13
  269. package/dist/es/standards-sdk.es146.js.map +1 -1
  270. package/dist/es/standards-sdk.es147.js +1077 -214
  271. package/dist/es/standards-sdk.es147.js.map +1 -1
  272. package/dist/es/standards-sdk.es148.js +208 -4
  273. package/dist/es/standards-sdk.es148.js.map +1 -1
  274. package/dist/es/standards-sdk.es149.js +1564 -78
  275. package/dist/es/standards-sdk.es149.js.map +1 -1
  276. package/dist/es/standards-sdk.es15.js +1 -1
  277. package/dist/es/standards-sdk.es150.js +1153 -83
  278. package/dist/es/standards-sdk.es150.js.map +1 -1
  279. package/dist/es/standards-sdk.es151.js +15 -58
  280. package/dist/es/standards-sdk.es151.js.map +1 -1
  281. package/dist/es/standards-sdk.es152.js +259 -2547
  282. package/dist/es/standards-sdk.es152.js.map +1 -1
  283. package/dist/es/standards-sdk.es153.js +4 -159
  284. package/dist/es/standards-sdk.es153.js.map +1 -1
  285. package/dist/es/standards-sdk.es154.js +81 -7
  286. package/dist/es/standards-sdk.es154.js.map +1 -1
  287. package/dist/es/standards-sdk.es155.js +79 -78
  288. package/dist/es/standards-sdk.es155.js.map +1 -1
  289. package/dist/es/standards-sdk.es156.js +56 -61
  290. package/dist/es/standards-sdk.es156.js.map +1 -1
  291. package/dist/es/standards-sdk.es157.js +2547 -30
  292. package/dist/es/standards-sdk.es157.js.map +1 -1
  293. package/dist/es/standards-sdk.es158.js +159 -34
  294. package/dist/es/standards-sdk.es158.js.map +1 -1
  295. package/dist/es/standards-sdk.es159.js +7 -48
  296. package/dist/es/standards-sdk.es159.js.map +1 -1
  297. package/dist/es/standards-sdk.es16.js +5 -5
  298. package/dist/es/standards-sdk.es160.js +70 -122
  299. package/dist/es/standards-sdk.es160.js.map +1 -1
  300. package/dist/es/standards-sdk.es161.js +58 -35
  301. package/dist/es/standards-sdk.es161.js.map +1 -1
  302. package/dist/es/standards-sdk.es162.js +190 -12478
  303. package/dist/es/standards-sdk.es162.js.map +1 -1
  304. package/dist/es/standards-sdk.es163.js +22 -52
  305. package/dist/es/standards-sdk.es163.js.map +1 -1
  306. package/dist/es/standards-sdk.es164.js +54 -107
  307. package/dist/es/standards-sdk.es164.js.map +1 -1
  308. package/dist/es/standards-sdk.es165.js +90 -76
  309. package/dist/es/standards-sdk.es165.js.map +1 -1
  310. package/dist/es/standards-sdk.es166.js +46 -197
  311. package/dist/es/standards-sdk.es166.js.map +1 -1
  312. package/dist/es/standards-sdk.es167.js +203 -16
  313. package/dist/es/standards-sdk.es167.js.map +1 -1
  314. package/dist/es/standards-sdk.es168.js +54 -670
  315. package/dist/es/standards-sdk.es168.js.map +1 -1
  316. package/dist/es/standards-sdk.es169.js +44 -167
  317. package/dist/es/standards-sdk.es169.js.map +1 -1
  318. package/dist/es/standards-sdk.es170.js +55 -321
  319. package/dist/es/standards-sdk.es170.js.map +1 -1
  320. package/dist/es/standards-sdk.es171.js +45 -342
  321. package/dist/es/standards-sdk.es171.js.map +1 -1
  322. package/dist/es/standards-sdk.es172.js +115 -446
  323. package/dist/es/standards-sdk.es172.js.map +1 -1
  324. package/dist/es/standards-sdk.es173.js +51 -328
  325. package/dist/es/standards-sdk.es173.js.map +1 -1
  326. package/dist/es/standards-sdk.es174.js +42 -74
  327. package/dist/es/standards-sdk.es174.js.map +1 -1
  328. package/dist/es/standards-sdk.es175.js +72 -73
  329. package/dist/es/standards-sdk.es175.js.map +1 -1
  330. package/dist/es/standards-sdk.es176.js +68 -139
  331. package/dist/es/standards-sdk.es176.js.map +1 -1
  332. package/dist/es/standards-sdk.es177.js +44 -517
  333. package/dist/es/standards-sdk.es177.js.map +1 -1
  334. package/dist/es/standards-sdk.es178.js +33 -256
  335. package/dist/es/standards-sdk.es178.js.map +1 -1
  336. package/dist/es/standards-sdk.es179.js +30 -196
  337. package/dist/es/standards-sdk.es179.js.map +1 -1
  338. package/dist/es/standards-sdk.es18.js +12 -12
  339. package/dist/es/standards-sdk.es180.js +34 -119
  340. package/dist/es/standards-sdk.es180.js.map +1 -1
  341. package/dist/es/standards-sdk.es181.js +48 -152
  342. package/dist/es/standards-sdk.es181.js.map +1 -1
  343. package/dist/es/standards-sdk.es182.js +126 -172
  344. package/dist/es/standards-sdk.es182.js.map +1 -1
  345. package/dist/es/standards-sdk.es183.js +34 -676
  346. package/dist/es/standards-sdk.es183.js.map +1 -1
  347. package/dist/es/standards-sdk.es184.js +12453 -156
  348. package/dist/es/standards-sdk.es184.js.map +1 -1
  349. package/dist/es/standards-sdk.es185.js +14 -232
  350. package/dist/es/standards-sdk.es185.js.map +1 -1
  351. package/dist/es/standards-sdk.es186.js +642 -209
  352. package/dist/es/standards-sdk.es186.js.map +1 -1
  353. package/dist/es/standards-sdk.es187.js +114 -0
  354. package/dist/es/standards-sdk.es187.js.map +1 -0
  355. package/dist/es/standards-sdk.es188.js +76 -0
  356. package/dist/es/standards-sdk.es188.js.map +1 -0
  357. package/dist/es/standards-sdk.es189.js +59 -0
  358. package/dist/es/standards-sdk.es189.js.map +1 -0
  359. package/dist/es/standards-sdk.es19.js +9 -9
  360. package/dist/es/standards-sdk.es190.js +84 -0
  361. package/dist/es/standards-sdk.es190.js.map +1 -0
  362. package/dist/es/standards-sdk.es191.js +203 -0
  363. package/dist/es/standards-sdk.es191.js.map +1 -0
  364. package/dist/es/standards-sdk.es192.js +175 -0
  365. package/dist/es/standards-sdk.es192.js.map +1 -0
  366. package/dist/es/standards-sdk.es193.js +325 -0
  367. package/dist/es/standards-sdk.es193.js.map +1 -0
  368. package/dist/es/standards-sdk.es194.js +349 -0
  369. package/dist/es/standards-sdk.es194.js.map +1 -0
  370. package/dist/es/standards-sdk.es195.js +456 -0
  371. package/dist/es/standards-sdk.es195.js.map +1 -0
  372. package/dist/es/standards-sdk.es196.js +334 -0
  373. package/dist/es/standards-sdk.es196.js.map +1 -0
  374. package/dist/es/standards-sdk.es197.js +79 -0
  375. package/dist/es/standards-sdk.es197.js.map +1 -0
  376. package/dist/es/standards-sdk.es198.js +142 -0
  377. package/dist/es/standards-sdk.es198.js.map +1 -0
  378. package/dist/es/standards-sdk.es199.js +520 -0
  379. package/dist/es/standards-sdk.es199.js.map +1 -0
  380. package/dist/es/standards-sdk.es2.js +2 -2
  381. package/dist/es/standards-sdk.es20.js +1 -1
  382. package/dist/es/standards-sdk.es200.js +262 -0
  383. package/dist/es/standards-sdk.es200.js.map +1 -0
  384. package/dist/es/standards-sdk.es201.js +199 -0
  385. package/dist/es/standards-sdk.es201.js.map +1 -0
  386. package/dist/es/standards-sdk.es202.js +122 -0
  387. package/dist/es/standards-sdk.es202.js.map +1 -0
  388. package/dist/es/standards-sdk.es203.js +155 -0
  389. package/dist/es/standards-sdk.es203.js.map +1 -0
  390. package/dist/es/standards-sdk.es204.js +187 -0
  391. package/dist/es/standards-sdk.es204.js.map +1 -0
  392. package/dist/es/standards-sdk.es205.js +687 -0
  393. package/dist/es/standards-sdk.es205.js.map +1 -0
  394. package/dist/es/standards-sdk.es206.js +188 -0
  395. package/dist/es/standards-sdk.es206.js.map +1 -0
  396. package/dist/es/standards-sdk.es207.js +238 -0
  397. package/dist/es/standards-sdk.es207.js.map +1 -0
  398. package/dist/es/standards-sdk.es208.js +242 -0
  399. package/dist/es/standards-sdk.es208.js.map +1 -0
  400. package/dist/es/standards-sdk.es21.js +1 -1
  401. package/dist/es/standards-sdk.es22.js +1 -1
  402. package/dist/es/standards-sdk.es23.js +1 -1
  403. package/dist/es/standards-sdk.es24.js +1 -1
  404. package/dist/es/standards-sdk.es25.js +1 -1
  405. package/dist/es/standards-sdk.es26.js +1 -1
  406. package/dist/es/standards-sdk.es27.js +12 -12
  407. package/dist/es/standards-sdk.es30.js +2 -2
  408. package/dist/es/standards-sdk.es31.js +4 -4
  409. package/dist/es/standards-sdk.es32.js +1 -1
  410. package/dist/es/standards-sdk.es35.js +6 -6
  411. package/dist/es/standards-sdk.es36.js +4 -4
  412. package/dist/es/standards-sdk.es37.js +2 -2
  413. package/dist/es/standards-sdk.es38.js +2 -2
  414. package/dist/es/standards-sdk.es39.js +1 -1
  415. package/dist/es/standards-sdk.es4.js +2 -2
  416. package/dist/es/standards-sdk.es40.js +1 -1
  417. package/dist/es/standards-sdk.es41.js +2 -2
  418. package/dist/es/standards-sdk.es46.js +1 -1
  419. package/dist/es/standards-sdk.es5.js +2 -2
  420. package/dist/es/standards-sdk.es51.js +1 -1
  421. package/dist/es/standards-sdk.es53.js +1 -1
  422. package/dist/es/standards-sdk.es56.js +2 -2
  423. package/dist/es/standards-sdk.es59.js +1 -1
  424. package/dist/es/standards-sdk.es6.js +2 -2
  425. package/dist/es/standards-sdk.es60.js +1 -1
  426. package/dist/es/standards-sdk.es62.js +1 -1
  427. package/dist/es/standards-sdk.es63.js +2 -2
  428. package/dist/es/standards-sdk.es64.js +1 -1
  429. package/dist/es/standards-sdk.es65.js +1 -1
  430. package/dist/es/standards-sdk.es66.js +1 -1
  431. package/dist/es/standards-sdk.es67.js +7 -7
  432. package/dist/es/standards-sdk.es69.js +1 -1
  433. package/dist/es/standards-sdk.es7.js +1 -1
  434. package/dist/es/standards-sdk.es71.js +2 -2
  435. package/dist/es/standards-sdk.es72.js +3 -3
  436. package/dist/es/standards-sdk.es75.js +5 -5
  437. package/dist/es/standards-sdk.es76.js +3 -3
  438. package/dist/es/standards-sdk.es77.js +2 -2
  439. package/dist/es/standards-sdk.es78.js +1 -1
  440. package/dist/es/standards-sdk.es81.js +2 -2
  441. package/dist/es/standards-sdk.es83.js +2 -2
  442. package/dist/es/standards-sdk.es84.js +4 -4
  443. package/dist/es/standards-sdk.es85.js +1 -1
  444. package/dist/es/standards-sdk.es88.js +1 -1
  445. package/dist/es/standards-sdk.es89.js +2 -2
  446. package/dist/es/standards-sdk.es9.js +2 -2
  447. package/dist/es/standards-sdk.es90.js +4 -4
  448. package/dist/es/standards-sdk.es94.js +3 -3
  449. package/dist/es/standards-sdk.es96.js +2 -2
  450. package/dist/es/standards-sdk.es98.js +1 -1
  451. package/dist/es/standards-sdk.es99.js +3 -3
  452. package/package.json +1 -1
@@ -1,90 +1,1160 @@
1
- const normalise = (value) => value.trim().toLowerCase();
2
- const HEDERA_NETWORK_ALIASES = /* @__PURE__ */ new Map([
3
- ["hedera:mainnet", { canonical: "hedera:mainnet", hederaNetwork: "mainnet" }],
4
- ["mainnet", { canonical: "hedera:mainnet", hederaNetwork: "mainnet" }],
5
- ["hedera-mainnet", { canonical: "hedera:mainnet", hederaNetwork: "mainnet" }],
6
- ["hedera_mainnet", { canonical: "hedera:mainnet", hederaNetwork: "mainnet" }],
7
- ["hedera:testnet", { canonical: "hedera:testnet", hederaNetwork: "testnet" }],
8
- ["testnet", { canonical: "hedera:testnet", hederaNetwork: "testnet" }],
9
- ["hedera-testnet", { canonical: "hedera:testnet", hederaNetwork: "testnet" }],
10
- ["hedera_testnet", { canonical: "hedera:testnet", hederaNetwork: "testnet" }]
11
- ]);
12
- const EVM_NETWORK_CHAIN_IDS = {
13
- abstract: 2741,
14
- "abstract-testnet": 11124,
15
- base: 8453,
16
- "base-sepolia": 84532,
17
- avalanche: 43114,
18
- "avalanche-fuji": 43113,
19
- iotex: 4689,
20
- sei: 1329,
21
- "sei-testnet": 1328,
22
- polygon: 137,
23
- "polygon-amoy": 80002,
24
- peaq: 3338
25
- };
26
- const CHAIN_ID_TO_ALIAS = new Map(
27
- Object.entries(EVM_NETWORK_CHAIN_IDS).map(([alias, id]) => [id, alias])
28
- );
29
- const parseChainId = (value) => {
30
- if (/^eip155:\d+$/i.test(value)) {
31
- return Number.parseInt(value.split(":")[1], 10);
1
+ import { Buffer } from "buffer";
2
+ import { secp256k1 } from "@noble/curves/secp256k1.js";
3
+ import { ZodError } from "zod";
4
+ import { agentFeedbackResponseSchema, agentFeedbackIndexResponseSchema, agentFeedbackEntriesIndexResponseSchema, agentFeedbackEligibilityResponseSchema, agentFeedbackSubmissionResponseSchema, registerAgentResponseSchema } from "./standards-sdk.es157.js";
5
+ import { fetchHistorySnapshot, attachDecryptedHistory, registerConversationContextForEncryption, resolveDecryptionContext, decryptHistoryEntryFromContext } from "./standards-sdk.es198.js";
6
+ import { createChatApi, createSession, resumeSession, checkChatReadiness, startChat, startConversation, acceptConversation, compactHistory, fetchEncryptionStatus, postEncryptionHandshake, sendMessage, retryMessage, cancelSession, endSession, createPlaintextConversationHandle } from "./standards-sdk.es199.js";
7
+ import { EncryptedChatManager } from "./standards-sdk.es200.js";
8
+ import { generateEncryptionKeyPair, bootstrapEncryptionOptions, createEncryptionApi } from "./standards-sdk.es201.js";
9
+ import { adapters, adaptersDetailed, adapterRegistryCategories, adapterRegistryAdapters, createAdapterRegistryCategory, submitAdapterRegistryAdapter, adapterRegistrySubmissionStatus } from "./standards-sdk.es202.js";
10
+ import { resolveUaid, getRegistrationQuote, updateAgent, getRegistrationProgress, waitForRegistrationCompletion, validateUaid, getUaidConnectionStatus, closeUaidConnection, dashboardStats } from "./standards-sdk.es152.js";
11
+ import { getRegisterStatus, registerOwnedMoltbookAgent, getVerificationStatus, createVerificationChallenge, getVerificationChallenge, verifyVerificationChallenge, getVerificationOwnership, verifySenderOwnership, verifyUaidDnsTxt, getVerificationDnsStatus } from "./standards-sdk.es203.js";
12
+ import { getCreditsBalance, getCreditProviders, createHbarPurchaseIntent, purchaseCreditsWithHbar, getX402Minimums, purchaseCreditsWithX402, buyCreditsWithX402 } from "./standards-sdk.es204.js";
13
+ import { getGuardSession, getGuardEntitlements, getGuardBillingBalance, getGuardFeed, getGuardOverview, getGuardTrustByHash, resolveGuardTrust, getGuardRevocations, fetchGuardAdvisories, fetchGuardPolicy, getGuardInventory, getGuardReceiptHistory, getGuardArtifactTimeline, getGuardInventoryDiff, exportGuardAbom, exportGuardArtifactAbom, exportGuardReceipts, getGuardDevices, getGuardAlertPreferences, updateGuardAlertPreferences, getGuardExceptions, getGuardWatchlist, lookupGuardWatchlist, getGuardPainSignals, getGuardAggregatedPainSignals, getGuardPreInstallVerdict, getGuardPreExecutionVerdict, addGuardWatchlistItem, removeGuardWatchlistItem, addGuardException, requestGuardException, removeGuardException, ingestGuardPainSignals, syncGuardReceipts, syncGuardInventory, submitGuardReceipts, getGuardTeamPolicyPack, updateGuardTeamPolicyPack } from "./standards-sdk.es205.js";
14
+ import { createLedgerChallenge, verifyLedgerChallenge, authenticateWithLedger, authenticateWithLedgerCredentials } from "./standards-sdk.es206.js";
15
+ import { search, delegate, stats, registries, getAdditionalRegistries, popularSearches, listProtocols, detectProtocol, registrySearchByNamespace, vectorSearch, searchStatus, websocketStats, metricsSummary, facets } from "./standards-sdk.es207.js";
16
+ import { skillsConfig, listSkills, getSkillsCatalog, listSkillVersions, listMySkills, getMySkillsList, quoteSkillPublish, quoteSkillPublishPreview, publishSkill, getSkillPublishJob, getSkillOwnership, getRecommendedSkillVersion, setRecommendedSkillVersion, getSkillDeprecations, setSkillDeprecation, getSkillBadge, getSkillStatus, getSkillSecurityBreakdown, getSkillStatusByRepo, getSkillConversionSignalsByRepo, uploadSkillPreviewFromGithubOidc, getSkillPreview, getSkillPreviewByRepo, getSkillPreviewById, getSkillInstall, recordSkillInstallCopy, listSkillTags, listSkillCategories, resolveSkillMarkdown, resolveSkillManifest, getSkillVoteStatus, setSkillVote, requestSkillVerification, getSkillVerificationStatus, createSkillDomainProofChallenge, verifySkillDomainProof } from "./standards-sdk.es186.js";
17
+ import { DEFAULT_BASE_URL, normaliseBaseUrl, normaliseHeaderName, isBrowserRuntime, DEFAULT_USER_AGENT, JSON_CONTENT_TYPE, serialiseAgentRegistrationRequest, MINIMUM_REGISTRATION_AUTO_TOP_UP_CREDITS, createAbortError, isJsonObject, DEFAULT_HISTORY_TOP_UP_HBAR } from "./standards-sdk.es208.js";
18
+ import { RegistryBrokerError, RegistryBrokerParseError } from "./standards-sdk.es151.js";
19
+ import { optionalImportSync } from "./standards-sdk.es187.js";
20
+ class RegistryBrokerClient {
21
+ constructor(options = {}) {
22
+ this.encryptionBootstrapPromise = null;
23
+ this.chatApi = null;
24
+ this.encryptedChatManager = null;
25
+ this.encryptionApi = null;
26
+ this.conversationContexts = /* @__PURE__ */ new Map();
27
+ const {
28
+ baseUrl = DEFAULT_BASE_URL,
29
+ fetchImplementation,
30
+ defaultHeaders,
31
+ apiKey,
32
+ accountId,
33
+ ledgerApiKey,
34
+ registrationAutoTopUp,
35
+ historyAutoTopUp,
36
+ encryption
37
+ } = options;
38
+ this.baseUrl = normaliseBaseUrl(baseUrl);
39
+ const resolvedFetch = fetchImplementation ?? (typeof globalThis.fetch === "function" ? globalThis.fetch : null);
40
+ if (!resolvedFetch) {
41
+ throw new Error(
42
+ "A fetch implementation is required for RegistryBrokerClient"
43
+ );
44
+ }
45
+ this.fetchImpl = resolvedFetch;
46
+ this.defaultHeaders = {
47
+ ...defaultHeaders ?? {}
48
+ };
49
+ Object.entries(this.defaultHeaders).forEach(([key, value]) => {
50
+ const headerName = normaliseHeaderName(key);
51
+ if (headerName !== key) {
52
+ delete this.defaultHeaders[key];
53
+ this.defaultHeaders[headerName] = value;
54
+ }
55
+ });
56
+ const existingLedgerHeader = this.defaultHeaders["x-ledger-api-key"]?.trim();
57
+ if (!this.defaultHeaders["x-api-key"] && existingLedgerHeader) {
58
+ this.defaultHeaders["x-api-key"] = existingLedgerHeader;
59
+ }
60
+ if (apiKey) {
61
+ this.defaultHeaders["x-api-key"] = apiKey;
62
+ }
63
+ if (typeof accountId === "string" && accountId.trim().length > 0) {
64
+ this.defaultHeaders["x-account-id"] = accountId.trim();
65
+ }
66
+ if (ledgerApiKey) {
67
+ if (!this.defaultHeaders["x-api-key"]) {
68
+ this.defaultHeaders["x-api-key"] = ledgerApiKey;
69
+ }
70
+ }
71
+ this.registrationAutoTopUp = registrationAutoTopUp;
72
+ this.historyAutoTopUp = historyAutoTopUp;
73
+ this.encryptionOptions = encryption;
74
+ if (this.encryptionOptions) {
75
+ this.encryptionBootstrapPromise = this.initializeEncryptionBootstrap(
76
+ this.encryptionOptions
77
+ );
78
+ }
32
79
  }
33
- if (/^\d+$/.test(value)) {
34
- return Number.parseInt(value, 10);
80
+ static async initializeAgent(options) {
81
+ const { uaid, ensureEncryptionKey = true, ...clientOptions } = options;
82
+ const client = new RegistryBrokerClient(clientOptions);
83
+ let encryption = null;
84
+ if (ensureEncryptionKey) {
85
+ const ensureOptions = typeof ensureEncryptionKey === "object" ? ensureEncryptionKey : { generateIfMissing: true };
86
+ encryption = await client.encryption.ensureAgentKey({
87
+ uaid,
88
+ ...ensureOptions
89
+ });
90
+ }
91
+ return { client, encryption };
35
92
  }
36
- return void 0;
37
- };
38
- const normaliseEvmNetwork = (value) => {
39
- const trimmed = normalise(value);
40
- let chainId = parseChainId(trimmed);
41
- let alias;
42
- if (chainId === void 0) {
43
- const mapped = EVM_NETWORK_CHAIN_IDS[trimmed];
44
- if (mapped !== void 0) {
45
- chainId = mapped;
46
- alias = trimmed;
47
- }
48
- } else if (CHAIN_ID_TO_ALIAS.has(chainId)) {
49
- alias = CHAIN_ID_TO_ALIAS.get(chainId);
50
- }
51
- if (chainId === void 0) {
52
- throw new Error(
53
- 'Unsupported EVM ledger network. Provide an alias like "base-sepolia" or a canonical eip155:<chainId> string.'
54
- );
55
- }
56
- return {
57
- canonical: `eip155:${chainId}`,
58
- kind: "evm",
59
- chainId,
60
- legacyName: alias
61
- };
62
- };
63
- const normaliseHederaNetwork = (value) => {
64
- const trimmed = normalise(value);
65
- const mapping = HEDERA_NETWORK_ALIASES.get(trimmed);
66
- if (!mapping) {
67
- throw new Error(
68
- 'Unsupported Hedera network. Use hedera:mainnet or hedera:testnet (legacy "mainnet"/"testnet" also accepted).'
69
- );
70
- }
71
- return {
72
- canonical: mapping.canonical,
73
- kind: "hedera",
74
- hederaNetwork: mapping.hederaNetwork
75
- };
76
- };
77
- const canonicalizeLedgerNetwork = (network) => {
78
- if (typeof network !== "string" || network.trim().length === 0) {
79
- throw new Error("Ledger network is required.");
93
+ get chat() {
94
+ if (this.chatApi) {
95
+ return this.chatApi;
96
+ }
97
+ const api = createChatApi(this, this.getEncryptedChatManager());
98
+ this.chatApi = api;
99
+ return api;
80
100
  }
81
- const trimmed = normalise(network);
82
- if (trimmed.startsWith("hedera:") || trimmed.includes("hedera-") || trimmed.includes("hedera_") || trimmed === "mainnet" || trimmed === "testnet") {
83
- return normaliseHederaNetwork(trimmed);
101
+ get encryption() {
102
+ if (this.encryptionApi) {
103
+ return this.encryptionApi;
104
+ }
105
+ const api = createEncryptionApi(this);
106
+ this.encryptionApi = api;
107
+ return api;
84
108
  }
85
- return normaliseEvmNetwork(trimmed);
86
- };
109
+ setApiKey(apiKey) {
110
+ this.setDefaultHeader("x-api-key", apiKey);
111
+ }
112
+ setLedgerApiKey(apiKey) {
113
+ this.setDefaultHeader("x-api-key", apiKey);
114
+ delete this.defaultHeaders["x-ledger-api-key"];
115
+ }
116
+ setDefaultHeader(name, value) {
117
+ if (!name || name.trim().length === 0) {
118
+ return;
119
+ }
120
+ const headerName = normaliseHeaderName(name);
121
+ if (!value || value.trim().length === 0) {
122
+ delete this.defaultHeaders[headerName];
123
+ return;
124
+ }
125
+ this.defaultHeaders[headerName] = value.trim();
126
+ }
127
+ getDefaultHeaders() {
128
+ return { ...this.defaultHeaders };
129
+ }
130
+ async encryptionReady() {
131
+ if (!this.encryptionBootstrapPromise) {
132
+ return;
133
+ }
134
+ await this.encryptionBootstrapPromise;
135
+ }
136
+ buildUrl(path) {
137
+ const normalisedPath = path.startsWith("/") ? path : `/${path}`;
138
+ return `${this.baseUrl}${normalisedPath}`;
139
+ }
140
+ buildRequestInit(config) {
141
+ const headers = new Headers();
142
+ Object.entries(this.defaultHeaders).forEach(([key, value]) => {
143
+ headers.set(key, value);
144
+ });
145
+ if (config.headers) {
146
+ Object.entries(config.headers).forEach(([key, value]) => {
147
+ headers.set(key, value);
148
+ });
149
+ }
150
+ if (!headers.has("accept")) {
151
+ headers.set("accept", "application/json");
152
+ }
153
+ if (!headers.has("user-agent") && !isBrowserRuntime()) {
154
+ headers.set("user-agent", DEFAULT_USER_AGENT);
155
+ }
156
+ const init = {
157
+ method: config.method ?? "GET",
158
+ headers
159
+ };
160
+ if (config.body !== void 0) {
161
+ init.body = JSON.stringify(config.body);
162
+ if (!headers.has("content-type")) {
163
+ headers.set("content-type", "application/json");
164
+ }
165
+ }
166
+ return init;
167
+ }
168
+ async request(path, config) {
169
+ const init = this.buildRequestInit(config);
170
+ const response = await this.fetchImpl(this.buildUrl(path), init);
171
+ if (response.ok) {
172
+ return response;
173
+ }
174
+ const errorBody = await this.extractErrorBody(response);
175
+ throw new RegistryBrokerError("Registry broker request failed", {
176
+ status: response.status,
177
+ statusText: response.statusText,
178
+ body: errorBody
179
+ });
180
+ }
181
+ async requestAbsolute(url, config) {
182
+ const init = this.buildRequestInit(config);
183
+ const response = await this.fetchImpl(url, init);
184
+ if (response.ok) {
185
+ return response;
186
+ }
187
+ const errorBody = await this.extractErrorBody(response);
188
+ throw new RegistryBrokerError("Registry broker request failed", {
189
+ status: response.status,
190
+ statusText: response.statusText,
191
+ body: errorBody
192
+ });
193
+ }
194
+ async requestJson(path, config) {
195
+ const response = await this.request(path, config);
196
+ const contentType = response.headers?.get("content-type") ?? "";
197
+ if (!JSON_CONTENT_TYPE.test(contentType)) {
198
+ const body = await response.text();
199
+ throw new RegistryBrokerParseError(
200
+ "Expected JSON response from registry broker",
201
+ body
202
+ );
203
+ }
204
+ return await response.json();
205
+ }
206
+ async requestAbsoluteJson(url, config) {
207
+ const response = await this.requestAbsolute(url, config);
208
+ const contentType = response.headers?.get("content-type") ?? "";
209
+ if (!JSON_CONTENT_TYPE.test(contentType)) {
210
+ const body = await response.text();
211
+ throw new RegistryBrokerParseError(
212
+ "Expected JSON response from registry broker",
213
+ body
214
+ );
215
+ }
216
+ return await response.json();
217
+ }
218
+ async getAgentFeedback(uaid, options = {}) {
219
+ const normalized = uaid.trim();
220
+ if (!normalized) {
221
+ throw new Error("uaid is required");
222
+ }
223
+ const query = options.includeRevoked === true ? "?includeRevoked=true" : "";
224
+ const raw = await this.requestJson(
225
+ `/agents/${encodeURIComponent(normalized)}/feedback${query}`,
226
+ { method: "GET" }
227
+ );
228
+ return this.parseWithSchema(
229
+ raw,
230
+ agentFeedbackResponseSchema,
231
+ "agent feedback response"
232
+ );
233
+ }
234
+ async listAgentFeedbackIndex(options = {}) {
235
+ const params = new URLSearchParams();
236
+ if (typeof options.page === "number" && Number.isFinite(options.page)) {
237
+ params.set("page", String(Math.trunc(options.page)));
238
+ }
239
+ if (typeof options.limit === "number" && Number.isFinite(options.limit)) {
240
+ params.set("limit", String(Math.trunc(options.limit)));
241
+ }
242
+ if (options.registries?.length) {
243
+ params.set("registry", options.registries.join(","));
244
+ }
245
+ const suffix = params.size > 0 ? `?${params.toString()}` : "";
246
+ const raw = await this.requestJson(`/agents/feedback${suffix}`, {
247
+ method: "GET"
248
+ });
249
+ return this.parseWithSchema(
250
+ raw,
251
+ agentFeedbackIndexResponseSchema,
252
+ "agent feedback index response"
253
+ );
254
+ }
255
+ async listAgentFeedbackEntriesIndex(options = {}) {
256
+ const params = new URLSearchParams();
257
+ if (typeof options.page === "number" && Number.isFinite(options.page)) {
258
+ params.set("page", String(Math.trunc(options.page)));
259
+ }
260
+ if (typeof options.limit === "number" && Number.isFinite(options.limit)) {
261
+ params.set("limit", String(Math.trunc(options.limit)));
262
+ }
263
+ if (options.registries?.length) {
264
+ params.set("registry", options.registries.join(","));
265
+ }
266
+ const suffix = params.size > 0 ? `?${params.toString()}` : "";
267
+ const raw = await this.requestJson(
268
+ `/agents/feedback/entries${suffix}`,
269
+ { method: "GET" }
270
+ );
271
+ return this.parseWithSchema(
272
+ raw,
273
+ agentFeedbackEntriesIndexResponseSchema,
274
+ "agent feedback entries index response"
275
+ );
276
+ }
277
+ async checkAgentFeedbackEligibility(uaid, payload) {
278
+ const normalized = uaid.trim();
279
+ if (!normalized) {
280
+ throw new Error("uaid is required");
281
+ }
282
+ const raw = await this.requestJson(
283
+ `/agents/${encodeURIComponent(normalized)}/feedback/eligibility`,
284
+ {
285
+ method: "POST",
286
+ body: payload,
287
+ headers: { "content-type": "application/json" }
288
+ }
289
+ );
290
+ return this.parseWithSchema(
291
+ raw,
292
+ agentFeedbackEligibilityResponseSchema,
293
+ "agent feedback eligibility response"
294
+ );
295
+ }
296
+ async submitAgentFeedback(uaid, payload) {
297
+ const normalized = uaid.trim();
298
+ if (!normalized) {
299
+ throw new Error("uaid is required");
300
+ }
301
+ const raw = await this.requestJson(
302
+ `/agents/${encodeURIComponent(normalized)}/feedback`,
303
+ {
304
+ method: "POST",
305
+ body: payload,
306
+ headers: { "content-type": "application/json" }
307
+ }
308
+ );
309
+ return this.parseWithSchema(
310
+ raw,
311
+ agentFeedbackSubmissionResponseSchema,
312
+ "agent feedback submission response"
313
+ );
314
+ }
315
+ async search(params = {}) {
316
+ return search(this, params);
317
+ }
318
+ async delegate(request) {
319
+ return delegate(this, request);
320
+ }
321
+ async searchErc8004ByAgentId(params) {
322
+ const chainId = Math.floor(params.chainId);
323
+ if (!Number.isFinite(chainId) || chainId <= 0) {
324
+ throw new Error("chainId must be a positive integer");
325
+ }
326
+ const rawAgentId = typeof params.agentId === "bigint" ? params.agentId.toString() : String(params.agentId);
327
+ const agentId = rawAgentId.trim();
328
+ if (!agentId) {
329
+ throw new Error("agentId is required");
330
+ }
331
+ const nativeId = `${chainId}:${agentId}`;
332
+ return search(this, {
333
+ registries: ["erc-8004"],
334
+ limit: params.limit ?? 1,
335
+ ...typeof params.page === "number" ? { page: params.page } : {},
336
+ ...typeof params.sortBy === "string" ? { sortBy: params.sortBy } : {},
337
+ ...typeof params.sortOrder === "string" ? { sortOrder: params.sortOrder } : {},
338
+ metadata: {
339
+ nativeId: [nativeId],
340
+ networkKey: [`eip155:${chainId}`]
341
+ }
342
+ });
343
+ }
344
+ async stats() {
345
+ return stats(this);
346
+ }
347
+ async registries() {
348
+ return registries(this);
349
+ }
350
+ async getAdditionalRegistries() {
351
+ return getAdditionalRegistries(this);
352
+ }
353
+ async popularSearches() {
354
+ return popularSearches(this);
355
+ }
356
+ async listProtocols() {
357
+ return listProtocols(this);
358
+ }
359
+ async detectProtocol(message) {
360
+ return detectProtocol(this, message);
361
+ }
362
+ async registrySearchByNamespace(registry, query) {
363
+ return registrySearchByNamespace(this, registry, query);
364
+ }
365
+ async vectorSearch(request) {
366
+ return vectorSearch(this, request);
367
+ }
368
+ async searchStatus() {
369
+ return searchStatus(this);
370
+ }
371
+ async websocketStats() {
372
+ return websocketStats(this);
373
+ }
374
+ async metricsSummary() {
375
+ return metricsSummary(this);
376
+ }
377
+ async facets(adapter) {
378
+ return facets(this, adapter);
379
+ }
380
+ async adapters() {
381
+ return adapters(this);
382
+ }
383
+ async skillsConfig() {
384
+ return skillsConfig(this);
385
+ }
386
+ async listSkills(options) {
387
+ return listSkills(this, options);
388
+ }
389
+ async getSkillsCatalog(options) {
390
+ return getSkillsCatalog(this, options);
391
+ }
392
+ async listSkillVersions(params) {
393
+ return listSkillVersions(this, params);
394
+ }
395
+ async listMySkills(params) {
396
+ return listMySkills(this, params);
397
+ }
398
+ async getMySkillsList(params) {
399
+ return getMySkillsList(this, params);
400
+ }
401
+ async quoteSkillPublish(payload) {
402
+ return quoteSkillPublish(this, payload);
403
+ }
404
+ async quoteSkillPublishPreview(payload) {
405
+ return quoteSkillPublishPreview(this, payload);
406
+ }
407
+ async publishSkill(payload) {
408
+ return publishSkill(this, payload);
409
+ }
410
+ async getSkillPublishJob(jobId, params) {
411
+ return getSkillPublishJob(this, jobId, params);
412
+ }
413
+ async getSkillOwnership(params) {
414
+ return getSkillOwnership(this, params);
415
+ }
416
+ async getRecommendedSkillVersion(params) {
417
+ return getRecommendedSkillVersion(this, params);
418
+ }
419
+ async setRecommendedSkillVersion(payload) {
420
+ return setRecommendedSkillVersion(this, payload);
421
+ }
422
+ async getSkillDeprecations(params) {
423
+ return getSkillDeprecations(this, params);
424
+ }
425
+ async setSkillDeprecation(payload) {
426
+ return setSkillDeprecation(this, payload);
427
+ }
428
+ async getSkillBadge(params) {
429
+ return getSkillBadge(this, params);
430
+ }
431
+ async getSkillStatus(params) {
432
+ return getSkillStatus(this, params);
433
+ }
434
+ async getSkillSecurityBreakdown(params) {
435
+ return getSkillSecurityBreakdown(this, params);
436
+ }
437
+ async getSkillStatusByRepo(params) {
438
+ return getSkillStatusByRepo(this, params);
439
+ }
440
+ async getSkillConversionSignalsByRepo(params) {
441
+ return getSkillConversionSignalsByRepo(this, params);
442
+ }
443
+ async uploadSkillPreviewFromGithubOidc(payload) {
444
+ return uploadSkillPreviewFromGithubOidc(this, payload);
445
+ }
446
+ async getSkillPreview(params) {
447
+ return getSkillPreview(this, params);
448
+ }
449
+ async getSkillPreviewByRepo(params) {
450
+ return getSkillPreviewByRepo(this, params);
451
+ }
452
+ async getSkillPreviewById(previewId) {
453
+ return getSkillPreviewById(this, previewId);
454
+ }
455
+ async getSkillInstall(skillRef) {
456
+ return getSkillInstall(this, skillRef);
457
+ }
458
+ async recordSkillInstallCopy(skillRef, payload) {
459
+ return recordSkillInstallCopy(this, skillRef, payload);
460
+ }
461
+ async listSkillTags() {
462
+ return listSkillTags(this);
463
+ }
464
+ async listSkillCategories() {
465
+ return listSkillCategories(this);
466
+ }
467
+ async resolveSkillMarkdown(skillRef) {
468
+ return resolveSkillMarkdown(this, skillRef);
469
+ }
470
+ async resolveSkillManifest(skillRef) {
471
+ return resolveSkillManifest(this, skillRef);
472
+ }
473
+ async getSkillVoteStatus(params) {
474
+ return getSkillVoteStatus(this, params);
475
+ }
476
+ async setSkillVote(payload) {
477
+ return setSkillVote(this, payload);
478
+ }
479
+ async requestSkillVerification(payload) {
480
+ return requestSkillVerification(this, payload);
481
+ }
482
+ async getSkillVerificationStatus(params) {
483
+ return getSkillVerificationStatus(this, params);
484
+ }
485
+ async createSkillDomainProofChallenge(payload) {
486
+ return createSkillDomainProofChallenge(this, payload);
487
+ }
488
+ async verifySkillDomainProof(payload) {
489
+ return verifySkillDomainProof(this, payload);
490
+ }
491
+ async adaptersDetailed() {
492
+ return adaptersDetailed(this);
493
+ }
494
+ async adapterRegistryCategories() {
495
+ return adapterRegistryCategories(this);
496
+ }
497
+ async adapterRegistryAdapters(filters) {
498
+ return adapterRegistryAdapters(this, filters);
499
+ }
500
+ async createAdapterRegistryCategory(payload) {
501
+ return createAdapterRegistryCategory(this, payload);
502
+ }
503
+ async submitAdapterRegistryAdapter(payload) {
504
+ return submitAdapterRegistryAdapter(this, payload);
505
+ }
506
+ async adapterRegistrySubmissionStatus(submissionId) {
507
+ return adapterRegistrySubmissionStatus(this, submissionId);
508
+ }
509
+ async resolveUaid(uaid) {
510
+ return resolveUaid(this, uaid);
511
+ }
512
+ async performRegisterAgent(payload) {
513
+ const raw = await this.requestJson("/register", {
514
+ method: "POST",
515
+ body: serialiseAgentRegistrationRequest(payload),
516
+ headers: { "content-type": "application/json" }
517
+ });
518
+ return this.parseWithSchema(
519
+ raw,
520
+ registerAgentResponseSchema,
521
+ "register agent response"
522
+ );
523
+ }
524
+ calculateHbarAmount(creditsToPurchase, creditsPerHbar) {
525
+ if (creditsPerHbar <= 0) {
526
+ throw new Error("creditsPerHbar must be positive");
527
+ }
528
+ if (creditsToPurchase <= 0) {
529
+ throw new Error("creditsToPurchase must be positive");
530
+ }
531
+ const rawHbar = creditsToPurchase / creditsPerHbar;
532
+ const tinybars = Math.ceil(rawHbar * 1e8);
533
+ return tinybars / 1e8;
534
+ }
535
+ resolveCreditsToPurchase(shortfallCredits) {
536
+ if (!Number.isFinite(shortfallCredits) || shortfallCredits <= 0) {
537
+ return 0;
538
+ }
539
+ return Math.max(
540
+ Math.ceil(shortfallCredits),
541
+ MINIMUM_REGISTRATION_AUTO_TOP_UP_CREDITS
542
+ );
543
+ }
544
+ async ensureCreditsForRegistration(payload, autoTopUp) {
545
+ const details = autoTopUp ?? null;
546
+ if (!details) {
547
+ return;
548
+ }
549
+ if (!details.accountId || !details.accountId.trim()) {
550
+ throw new Error("autoTopUp.accountId is required");
551
+ }
552
+ if (!details.privateKey || !details.privateKey.trim()) {
553
+ throw new Error("autoTopUp.privateKey is required");
554
+ }
555
+ for (let attempt = 0; attempt < 3; attempt += 1) {
556
+ const quote = await this.getRegistrationQuote(payload);
557
+ const shortfall = quote.shortfallCredits ?? 0;
558
+ if (shortfall <= 0) {
559
+ return;
560
+ }
561
+ const creditsToPurchase = this.resolveCreditsToPurchase(shortfall);
562
+ if (creditsToPurchase <= 0) {
563
+ return;
564
+ }
565
+ const creditsPerHbar = quote.creditsPerHbar ?? null;
566
+ if (!creditsPerHbar || creditsPerHbar <= 0) {
567
+ throw new Error("Unable to determine credits per HBAR for auto top-up");
568
+ }
569
+ const hbarAmount = this.calculateHbarAmount(
570
+ creditsToPurchase,
571
+ creditsPerHbar
572
+ );
573
+ await this.purchaseCreditsWithHbar({
574
+ accountId: details.accountId.trim(),
575
+ privateKey: details.privateKey.trim(),
576
+ hbarAmount,
577
+ memo: details.memo ?? "Registry Broker auto top-up",
578
+ metadata: {
579
+ shortfallCredits: shortfall,
580
+ requiredCredits: quote.requiredCredits,
581
+ purchasedCredits: creditsToPurchase
582
+ }
583
+ });
584
+ }
585
+ const finalQuote = await this.getRegistrationQuote(payload);
586
+ if ((finalQuote.shortfallCredits ?? 0) > 0) {
587
+ throw new Error("Unable to purchase sufficient credits for registration");
588
+ }
589
+ }
590
+ async registerAgent(payload, options) {
591
+ const autoTopUp = options?.autoTopUp ?? this.registrationAutoTopUp;
592
+ if (!autoTopUp) {
593
+ return this.performRegisterAgent(payload);
594
+ }
595
+ await this.ensureCreditsForRegistration(payload, autoTopUp);
596
+ let retried = false;
597
+ while (true) {
598
+ try {
599
+ return await this.performRegisterAgent(payload);
600
+ } catch (error) {
601
+ const shortfall = this.extractInsufficientCreditsDetails(error);
602
+ if (shortfall && !retried) {
603
+ await this.ensureCreditsForRegistration(payload, autoTopUp);
604
+ retried = true;
605
+ continue;
606
+ }
607
+ throw error;
608
+ }
609
+ }
610
+ }
611
+ async getRegistrationQuote(payload) {
612
+ return getRegistrationQuote(this, payload);
613
+ }
614
+ async updateAgent(uaid, payload) {
615
+ return updateAgent(this, uaid, payload);
616
+ }
617
+ async getRegisterStatus(uaid) {
618
+ return getRegisterStatus(this, uaid);
619
+ }
620
+ async registerOwnedMoltbookAgent(uaid, payload) {
621
+ return registerOwnedMoltbookAgent(this, uaid, payload);
622
+ }
623
+ async getRegistrationProgress(attemptId) {
624
+ return getRegistrationProgress(this, attemptId);
625
+ }
626
+ async waitForRegistrationCompletion(attemptId, options) {
627
+ return waitForRegistrationCompletion(this, attemptId, options);
628
+ }
629
+ async validateUaid(uaid) {
630
+ return validateUaid(this, uaid);
631
+ }
632
+ async getUaidConnectionStatus(uaid) {
633
+ return getUaidConnectionStatus(this, uaid);
634
+ }
635
+ async closeUaidConnection(uaid) {
636
+ return closeUaidConnection(this, uaid);
637
+ }
638
+ async dashboardStats() {
639
+ return dashboardStats(this);
640
+ }
641
+ async getCreditsBalance(params = {}) {
642
+ return getCreditsBalance(this, params);
643
+ }
644
+ async getCreditProviders() {
645
+ return getCreditProviders(this);
646
+ }
647
+ async getGuardSession() {
648
+ return getGuardSession(this);
649
+ }
650
+ async getGuardEntitlements() {
651
+ return getGuardEntitlements(this);
652
+ }
653
+ async getGuardBillingBalance() {
654
+ return getGuardBillingBalance(this);
655
+ }
656
+ async getGuardFeed(limit) {
657
+ return getGuardFeed(this, limit);
658
+ }
659
+ async getGuardOverview() {
660
+ return getGuardOverview(this);
661
+ }
662
+ async getGuardTrustByHash(sha256) {
663
+ return getGuardTrustByHash(this, sha256);
664
+ }
665
+ async resolveGuardTrust(query) {
666
+ return resolveGuardTrust(this, query);
667
+ }
668
+ async getGuardRevocations() {
669
+ return getGuardRevocations(this);
670
+ }
671
+ async fetchGuardAdvisories() {
672
+ return fetchGuardAdvisories(this);
673
+ }
674
+ async fetchGuardPolicy() {
675
+ return fetchGuardPolicy(this);
676
+ }
677
+ async getGuardInventory() {
678
+ return getGuardInventory(this);
679
+ }
680
+ async getGuardReceiptHistory() {
681
+ return getGuardReceiptHistory(this);
682
+ }
683
+ async getGuardArtifactTimeline(artifactId) {
684
+ return getGuardArtifactTimeline(this, artifactId);
685
+ }
686
+ async getGuardInventoryDiff() {
687
+ return getGuardInventoryDiff(this);
688
+ }
689
+ async exportGuardAbom() {
690
+ return exportGuardAbom(this);
691
+ }
692
+ async exportGuardArtifactAbom(artifactId) {
693
+ return exportGuardArtifactAbom(this, artifactId);
694
+ }
695
+ async exportGuardReceipts() {
696
+ return exportGuardReceipts(this);
697
+ }
698
+ async getGuardDevices() {
699
+ return getGuardDevices(this);
700
+ }
701
+ async getGuardAlertPreferences() {
702
+ return getGuardAlertPreferences(this);
703
+ }
704
+ async updateGuardAlertPreferences(payload) {
705
+ return updateGuardAlertPreferences(this, payload);
706
+ }
707
+ async getGuardExceptions() {
708
+ return getGuardExceptions(this);
709
+ }
710
+ async getGuardWatchlist() {
711
+ return getGuardWatchlist(this);
712
+ }
713
+ async lookupGuardWatchlist(payload) {
714
+ return lookupGuardWatchlist(this, payload);
715
+ }
716
+ async getGuardPainSignals() {
717
+ return getGuardPainSignals(this);
718
+ }
719
+ async getGuardAggregatedPainSignals() {
720
+ return getGuardAggregatedPainSignals(this);
721
+ }
722
+ async getGuardPreInstallVerdict(payload) {
723
+ return getGuardPreInstallVerdict(this, payload);
724
+ }
725
+ async getGuardPreExecutionVerdict(payload) {
726
+ return getGuardPreExecutionVerdict(this, payload);
727
+ }
728
+ async addGuardWatchlistItem(payload) {
729
+ return addGuardWatchlistItem(this, payload);
730
+ }
731
+ async removeGuardWatchlistItem(artifactId) {
732
+ return removeGuardWatchlistItem(this, artifactId);
733
+ }
734
+ async addGuardException(payload) {
735
+ return addGuardException(this, payload);
736
+ }
737
+ async requestGuardException(payload) {
738
+ return requestGuardException(this, payload);
739
+ }
740
+ async removeGuardException(exceptionId) {
741
+ return removeGuardException(this, exceptionId);
742
+ }
743
+ async ingestGuardPainSignals(items) {
744
+ return ingestGuardPainSignals(this, items);
745
+ }
746
+ async syncGuardReceipts(payload) {
747
+ return syncGuardReceipts(this, payload);
748
+ }
749
+ async syncGuardInventory(payload) {
750
+ return syncGuardInventory(this, payload);
751
+ }
752
+ async submitGuardReceipts(payload) {
753
+ return submitGuardReceipts(this, payload);
754
+ }
755
+ async getGuardTeamPolicyPack() {
756
+ return getGuardTeamPolicyPack(this);
757
+ }
758
+ async updateGuardTeamPolicyPack(payload) {
759
+ return updateGuardTeamPolicyPack(this, payload);
760
+ }
761
+ async createHbarPurchaseIntent(payload) {
762
+ return createHbarPurchaseIntent(this, payload);
763
+ }
764
+ async purchaseCreditsWithHbar(params) {
765
+ return purchaseCreditsWithHbar(this, params);
766
+ }
767
+ async getX402Minimums() {
768
+ return getX402Minimums(this);
769
+ }
770
+ async purchaseCreditsWithX402(params) {
771
+ return purchaseCreditsWithX402(this, params);
772
+ }
773
+ async buyCreditsWithX402(params) {
774
+ return buyCreditsWithX402(this, params);
775
+ }
776
+ async generateEncryptionKeyPair(options = {}) {
777
+ return generateEncryptionKeyPair(this, options);
778
+ }
779
+ async createLedgerChallenge(payload) {
780
+ return createLedgerChallenge(this, payload);
781
+ }
782
+ async verifyLedgerChallenge(payload) {
783
+ return verifyLedgerChallenge(this, payload);
784
+ }
785
+ async authenticateWithLedger(options) {
786
+ return authenticateWithLedger(this, options);
787
+ }
788
+ async authenticateWithLedgerCredentials(options) {
789
+ return authenticateWithLedgerCredentials(this, options);
790
+ }
791
+ async getVerificationStatus(uaid) {
792
+ return getVerificationStatus(this, uaid);
793
+ }
794
+ async createVerificationChallenge(uaid) {
795
+ return createVerificationChallenge(this, uaid);
796
+ }
797
+ async getVerificationChallenge(challengeId) {
798
+ return getVerificationChallenge(this, challengeId);
799
+ }
800
+ async verifyVerificationChallenge(params) {
801
+ return verifyVerificationChallenge(this, params);
802
+ }
803
+ async getVerificationOwnership(uaid) {
804
+ return getVerificationOwnership(this, uaid);
805
+ }
806
+ async verifySenderOwnership(uaid) {
807
+ return verifySenderOwnership(this, uaid);
808
+ }
809
+ async verifyUaidDnsTxt(payload) {
810
+ return verifyUaidDnsTxt(this, payload);
811
+ }
812
+ async getVerificationDnsStatus(uaid, query) {
813
+ return getVerificationDnsStatus(this, uaid, query);
814
+ }
815
+ async fetchHistorySnapshot(sessionId, options) {
816
+ return fetchHistorySnapshot(
817
+ this.conversationContexts,
818
+ this,
819
+ sessionId,
820
+ options
821
+ );
822
+ }
823
+ attachDecryptedHistory(sessionId, snapshot, options) {
824
+ return attachDecryptedHistory(
825
+ this.conversationContexts,
826
+ this,
827
+ sessionId,
828
+ snapshot,
829
+ options
830
+ );
831
+ }
832
+ registerConversationContextForEncryption(context) {
833
+ registerConversationContextForEncryption(
834
+ this.conversationContexts,
835
+ context
836
+ );
837
+ }
838
+ resolveDecryptionContext(sessionId, options) {
839
+ return resolveDecryptionContext(
840
+ this.conversationContexts,
841
+ this,
842
+ sessionId,
843
+ options
844
+ );
845
+ }
846
+ decryptHistoryEntryFromContext(_sessionId, entry, context) {
847
+ return decryptHistoryEntryFromContext(this, entry, context);
848
+ }
849
+ async createSession(payload, allowHistoryAutoTopUp = true) {
850
+ return createSession(this, payload, allowHistoryAutoTopUp);
851
+ }
852
+ async resumeSession(sessionId) {
853
+ return resumeSession(this, sessionId);
854
+ }
855
+ async checkChatReadiness(payload) {
856
+ return checkChatReadiness(this, payload);
857
+ }
858
+ async startChat(options) {
859
+ return startChat(this, this.getEncryptedChatManager(), options);
860
+ }
861
+ async startConversation(options) {
862
+ return startConversation(this, this.getEncryptedChatManager(), options);
863
+ }
864
+ async acceptConversation(options) {
865
+ return acceptConversation(
866
+ this,
867
+ this.getEncryptedChatManager(),
868
+ options
869
+ );
870
+ }
871
+ compactHistory(payload) {
872
+ return compactHistory(this, payload);
873
+ }
874
+ fetchEncryptionStatus(sessionId) {
875
+ return fetchEncryptionStatus(this, sessionId);
876
+ }
877
+ postEncryptionHandshake(sessionId, payload) {
878
+ return postEncryptionHandshake(this, sessionId, payload);
879
+ }
880
+ sendMessage(payload) {
881
+ return sendMessage(this, payload);
882
+ }
883
+ retryMessage(messageId, payload) {
884
+ return retryMessage(this, messageId, payload);
885
+ }
886
+ cancelSession(sessionId) {
887
+ return cancelSession(this, sessionId);
888
+ }
889
+ endSession(sessionId) {
890
+ return endSession(this, sessionId);
891
+ }
892
+ createPlaintextConversationHandle(sessionId, summary, defaultAuth, context) {
893
+ return createPlaintextConversationHandle(
894
+ this,
895
+ sessionId,
896
+ summary,
897
+ defaultAuth,
898
+ context
899
+ );
900
+ }
901
+ getEncryptedChatManager() {
902
+ if (this.encryptedChatManager) {
903
+ return this.encryptedChatManager;
904
+ }
905
+ const manager = new EncryptedChatManager(this);
906
+ this.encryptedChatManager = manager;
907
+ return manager;
908
+ }
909
+ async extractErrorBody(response) {
910
+ const contentType = response.headers?.get("content-type") ?? "";
911
+ if (JSON_CONTENT_TYPE.test(contentType)) {
912
+ try {
913
+ return await response.json();
914
+ } catch (error) {
915
+ return { parseError: String(error) };
916
+ }
917
+ }
918
+ try {
919
+ return await response.text();
920
+ } catch (error) {
921
+ return { parseError: String(error) };
922
+ }
923
+ }
924
+ parseWithSchema(value, schema, context) {
925
+ try {
926
+ return schema.parse(value);
927
+ } catch (error) {
928
+ throw new RegistryBrokerParseError(
929
+ `Failed to parse ${context}`,
930
+ error instanceof ZodError || error instanceof Error ? error : String(error),
931
+ value
932
+ );
933
+ }
934
+ }
935
+ async delay(ms, signal) {
936
+ if (ms <= 0) {
937
+ if (signal?.aborted) {
938
+ throw createAbortError();
939
+ }
940
+ return;
941
+ }
942
+ await new Promise((resolve, reject) => {
943
+ const timer = setTimeout(() => {
944
+ if (signal) {
945
+ signal.removeEventListener("abort", onAbort);
946
+ }
947
+ resolve();
948
+ }, ms);
949
+ const onAbort = () => {
950
+ clearTimeout(timer);
951
+ signal?.removeEventListener("abort", onAbort);
952
+ reject(createAbortError());
953
+ };
954
+ if (signal) {
955
+ if (signal.aborted) {
956
+ clearTimeout(timer);
957
+ reject(createAbortError());
958
+ return;
959
+ }
960
+ signal.addEventListener("abort", onAbort, { once: true });
961
+ }
962
+ });
963
+ }
964
+ assertNodeRuntime(feature) {
965
+ if (typeof process === "undefined" || !process.versions?.node) {
966
+ throw new Error(`${feature} is only available in Node.js environments`);
967
+ }
968
+ }
969
+ getNodeCrypto(feature) {
970
+ this.assertNodeRuntime(feature);
971
+ const nodeCrypto = optionalImportSync("node:crypto") ?? optionalImportSync("crypto");
972
+ if (!nodeCrypto) {
973
+ throw new Error(`${feature} requires the Node.js crypto module`);
974
+ }
975
+ return nodeCrypto;
976
+ }
977
+ getSecureRandomBytes(size, feature) {
978
+ const webCrypto = globalThis.crypto;
979
+ if (webCrypto && typeof webCrypto.getRandomValues === "function") {
980
+ const bytes = new Uint8Array(size);
981
+ webCrypto.getRandomValues(bytes);
982
+ return bytes;
983
+ }
984
+ return this.getNodeCrypto(feature).randomBytes(size);
985
+ }
986
+ createEphemeralKeyPair() {
987
+ const privateKeyBytes = this.getSecureRandomBytes(
988
+ 32,
989
+ "generateEphemeralKeyPair"
990
+ );
991
+ const publicKey = secp256k1.getPublicKey(privateKeyBytes, true);
992
+ return {
993
+ privateKey: Buffer.from(privateKeyBytes).toString("hex"),
994
+ publicKey: Buffer.from(publicKey).toString("hex")
995
+ };
996
+ }
997
+ deriveSharedSecret(options) {
998
+ const { createHash } = this.getNodeCrypto("deriveSharedSecret");
999
+ const privateKey = this.hexToBuffer(options.privateKey);
1000
+ const peerPublicKey = this.hexToBuffer(options.peerPublicKey);
1001
+ const shared = secp256k1.getSharedSecret(privateKey, peerPublicKey, true);
1002
+ return createHash("sha256").update(Buffer.from(shared)).digest();
1003
+ }
1004
+ buildCipherEnvelope(options) {
1005
+ const { createCipheriv, randomBytes } = this.getNodeCrypto(
1006
+ "encryptCipherEnvelope"
1007
+ );
1008
+ const sharedSecret = this.normalizeSharedSecret(options.sharedSecret);
1009
+ const iv = randomBytes(12);
1010
+ const cipher = createCipheriv("aes-256-gcm", sharedSecret, iv);
1011
+ const aadSource = options.associatedData ?? options.sessionId;
1012
+ const associatedDataEncoded = aadSource ? Buffer.from(aadSource, "utf8").toString("base64") : void 0;
1013
+ if (aadSource) {
1014
+ cipher.setAAD(Buffer.from(aadSource, "utf8"));
1015
+ }
1016
+ const ciphertext = Buffer.concat([
1017
+ cipher.update(Buffer.from(options.plaintext, "utf8")),
1018
+ cipher.final()
1019
+ ]);
1020
+ const tag = cipher.getAuthTag();
1021
+ const payload = Buffer.concat([ciphertext, tag]);
1022
+ return {
1023
+ algorithm: "aes-256-gcm",
1024
+ ciphertext: payload.toString("base64"),
1025
+ nonce: iv.toString("base64"),
1026
+ associatedData: associatedDataEncoded,
1027
+ keyLocator: {
1028
+ sessionId: options.sessionId,
1029
+ revision: options.revision ?? 1
1030
+ },
1031
+ recipients: options.recipients.map((recipient) => ({
1032
+ ...recipient,
1033
+ encryptedShare: ""
1034
+ }))
1035
+ };
1036
+ }
1037
+ openCipherEnvelope(options) {
1038
+ const { createDecipheriv } = this.getNodeCrypto("decryptCipherEnvelope");
1039
+ const sharedSecret = this.normalizeSharedSecret(options.sharedSecret);
1040
+ const payload = Buffer.from(options.envelope.ciphertext, "base64");
1041
+ const nonce = Buffer.from(options.envelope.nonce, "base64");
1042
+ const ciphertext = payload.slice(0, payload.length - 16);
1043
+ const tag = payload.slice(payload.length - 16);
1044
+ const decipher = createDecipheriv("aes-256-gcm", sharedSecret, nonce);
1045
+ if (options.envelope.associatedData) {
1046
+ decipher.setAAD(Buffer.from(options.envelope.associatedData, "base64"));
1047
+ }
1048
+ decipher.setAuthTag(tag);
1049
+ const plaintext = Buffer.concat([
1050
+ decipher.update(ciphertext),
1051
+ decipher.final()
1052
+ ]);
1053
+ return plaintext.toString(options.encoding ?? "utf8");
1054
+ }
1055
+ normalizeSharedSecret(input) {
1056
+ if (Buffer.isBuffer(input)) {
1057
+ return Buffer.from(input);
1058
+ }
1059
+ if (input instanceof Uint8Array) {
1060
+ return Buffer.from(input);
1061
+ }
1062
+ if (typeof input === "string") {
1063
+ return this.bufferFromString(input);
1064
+ }
1065
+ throw new Error("Unsupported shared secret input");
1066
+ }
1067
+ bufferFromString(value) {
1068
+ const trimmed = value.trim();
1069
+ if (!trimmed) {
1070
+ throw new Error("sharedSecret string cannot be empty");
1071
+ }
1072
+ const normalized = trimmed.startsWith("0x") ? trimmed.slice(2) : trimmed;
1073
+ if (/^[0-9a-fA-F]+$/.test(normalized) && normalized.length % 2 === 0) {
1074
+ return Buffer.from(normalized, "hex");
1075
+ }
1076
+ return Buffer.from(trimmed, "base64");
1077
+ }
1078
+ hexToBuffer(value) {
1079
+ const normalized = value.startsWith("0x") ? value.slice(2) : value;
1080
+ if (!/^[0-9a-fA-F]+$/.test(normalized) || normalized.length % 2 !== 0) {
1081
+ throw new Error("Expected hex-encoded value");
1082
+ }
1083
+ return Buffer.from(normalized, "hex");
1084
+ }
1085
+ extractInsufficientCreditsDetails(error) {
1086
+ if (!(error instanceof RegistryBrokerError) || error.status !== 402) {
1087
+ return null;
1088
+ }
1089
+ const body = error.body;
1090
+ if (!body || typeof body !== "object" || Array.isArray(body)) {
1091
+ return null;
1092
+ }
1093
+ const maybeShortfall = body["shortfallCredits"];
1094
+ if (typeof maybeShortfall !== "number" || maybeShortfall <= 0) {
1095
+ return null;
1096
+ }
1097
+ return { shortfallCredits: maybeShortfall };
1098
+ }
1099
+ extractErrorMessage(body) {
1100
+ if (typeof body === "string") {
1101
+ return body;
1102
+ }
1103
+ if (isJsonObject(body) && typeof body.error === "string") {
1104
+ return body.error;
1105
+ }
1106
+ if (isJsonObject(body) && typeof body.message === "string") {
1107
+ return body.message;
1108
+ }
1109
+ return void 0;
1110
+ }
1111
+ shouldAutoTopUpHistory(payload, error) {
1112
+ if (!this.historyAutoTopUp || payload.historyTtlSeconds === void 0) {
1113
+ return false;
1114
+ }
1115
+ if (!(error instanceof RegistryBrokerError)) {
1116
+ return false;
1117
+ }
1118
+ if (error.status !== 402) {
1119
+ return false;
1120
+ }
1121
+ const message = this.extractErrorMessage(error.body);
1122
+ if (!message) {
1123
+ return true;
1124
+ }
1125
+ const normalised = message.toLowerCase();
1126
+ return normalised.includes("history") || normalised.includes("chat history");
1127
+ }
1128
+ async executeHistoryAutoTopUp(reason) {
1129
+ if (!this.historyAutoTopUp) {
1130
+ return;
1131
+ }
1132
+ const hbarAmount = this.historyAutoTopUp.hbarAmount && this.historyAutoTopUp.hbarAmount > 0 ? this.historyAutoTopUp.hbarAmount : DEFAULT_HISTORY_TOP_UP_HBAR;
1133
+ await this.purchaseCreditsWithHbar({
1134
+ accountId: this.historyAutoTopUp.accountId,
1135
+ privateKey: this.historyAutoTopUp.privateKey,
1136
+ hbarAmount,
1137
+ memo: this.historyAutoTopUp.memo ?? "registry-broker-client:chat-history-topup",
1138
+ metadata: {
1139
+ purpose: "chat-history",
1140
+ reason
1141
+ }
1142
+ });
1143
+ }
1144
+ initializeEncryptionBootstrap(options) {
1145
+ return this.bootstrapEncryptionOptions(options).then(() => void 0);
1146
+ }
1147
+ bootstrapEncryptionOptions(options) {
1148
+ return bootstrapEncryptionOptions(this, options);
1149
+ }
1150
+ }
1151
+ const isPendingRegisterAgentResponse = (response) => response.status === "pending";
1152
+ const isPartialRegisterAgentResponse = (response) => response.status === "partial" && response.success === false;
1153
+ const isSuccessRegisterAgentResponse = (response) => response.success === true && response.status !== "pending";
87
1154
  export {
88
- canonicalizeLedgerNetwork
1155
+ RegistryBrokerClient,
1156
+ isPartialRegisterAgentResponse,
1157
+ isPendingRegisterAgentResponse,
1158
+ isSuccessRegisterAgentResponse
89
1159
  };
90
1160
  //# sourceMappingURL=standards-sdk.es150.js.map