@teneo-protocol/sdk 2.2.2 → 3.0.1

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 (231) hide show
  1. package/.github/ISSUE_TEMPLATE/config.yml +1 -1
  2. package/CHANGELOG.md +366 -15
  3. package/CONCEPTS.md +182 -44
  4. package/README.md +524 -94
  5. package/dist/constants.d.ts +3 -1
  6. package/dist/constants.d.ts.map +1 -1
  7. package/dist/constants.js +5 -3
  8. package/dist/constants.js.map +1 -1
  9. package/dist/core/websocket-client.d.ts.map +1 -1
  10. package/dist/core/websocket-client.js +9 -5
  11. package/dist/core/websocket-client.js.map +1 -1
  12. package/dist/formatters/response-formatter.d.ts +6 -6
  13. package/dist/handlers/message-handlers/agent-details-response-handler.d.ts +1080 -756
  14. package/dist/handlers/message-handlers/agent-details-response-handler.d.ts.map +1 -1
  15. package/dist/handlers/message-handlers/agent-details-response-handler.js +2 -2
  16. package/dist/handlers/message-handlers/agent-details-response-handler.js.map +1 -1
  17. package/dist/handlers/message-handlers/agent-error-handler.d.ts +91 -0
  18. package/dist/handlers/message-handlers/agent-error-handler.d.ts.map +1 -0
  19. package/dist/handlers/message-handlers/agent-error-handler.js +44 -0
  20. package/dist/handlers/message-handlers/agent-error-handler.js.map +1 -0
  21. package/dist/handlers/message-handlers/agent-selected-handler.d.ts +6 -0
  22. package/dist/handlers/message-handlers/agent-selected-handler.d.ts.map +1 -1
  23. package/dist/handlers/message-handlers/agent-status-update-handler.d.ts +1080 -756
  24. package/dist/handlers/message-handlers/agent-status-update-handler.d.ts.map +1 -1
  25. package/dist/handlers/message-handlers/agent-status-update-handler.js +2 -7
  26. package/dist/handlers/message-handlers/agent-status-update-handler.js.map +1 -1
  27. package/dist/handlers/message-handlers/all-agents-response-handler.d.ts +135 -54
  28. package/dist/handlers/message-handlers/all-agents-response-handler.d.ts.map +1 -1
  29. package/dist/handlers/message-handlers/all-agents-response-handler.js +2 -2
  30. package/dist/handlers/message-handlers/all-agents-response-handler.js.map +1 -1
  31. package/dist/handlers/message-handlers/auth-error-handler.d.ts +6 -0
  32. package/dist/handlers/message-handlers/auth-error-handler.d.ts.map +1 -1
  33. package/dist/handlers/message-handlers/auth-message-handler.d.ts.map +1 -1
  34. package/dist/handlers/message-handlers/auth-message-handler.js +6 -1
  35. package/dist/handlers/message-handlers/auth-message-handler.js.map +1 -1
  36. package/dist/handlers/message-handlers/auth-required-handler.d.ts +6 -0
  37. package/dist/handlers/message-handlers/auth-required-handler.d.ts.map +1 -1
  38. package/dist/handlers/message-handlers/auth-success-handler.d.ts.map +1 -1
  39. package/dist/handlers/message-handlers/auth-success-handler.js +6 -1
  40. package/dist/handlers/message-handlers/auth-success-handler.js.map +1 -1
  41. package/dist/handlers/message-handlers/base-handler.d.ts +2 -1
  42. package/dist/handlers/message-handlers/base-handler.d.ts.map +1 -1
  43. package/dist/handlers/message-handlers/base-handler.js +24 -4
  44. package/dist/handlers/message-handlers/base-handler.js.map +1 -1
  45. package/dist/handlers/message-handlers/challenge-handler.d.ts +6 -0
  46. package/dist/handlers/message-handlers/challenge-handler.d.ts.map +1 -1
  47. package/dist/handlers/message-handlers/error-message-handler.d.ts +6 -0
  48. package/dist/handlers/message-handlers/error-message-handler.d.ts.map +1 -1
  49. package/dist/handlers/message-handlers/index.d.ts +4 -0
  50. package/dist/handlers/message-handlers/index.d.ts.map +1 -1
  51. package/dist/handlers/message-handlers/index.js +23 -1
  52. package/dist/handlers/message-handlers/index.js.map +1 -1
  53. package/dist/handlers/message-handlers/list-available-agents-handler.d.ts +1116 -756
  54. package/dist/handlers/message-handlers/list-available-agents-handler.d.ts.map +1 -1
  55. package/dist/handlers/message-handlers/list-available-agents-handler.js +23 -10
  56. package/dist/handlers/message-handlers/list-available-agents-handler.js.map +1 -1
  57. package/dist/handlers/message-handlers/list-room-agents-handler.d.ts +1080 -756
  58. package/dist/handlers/message-handlers/list-room-agents-handler.d.ts.map +1 -1
  59. package/dist/handlers/message-handlers/list-room-agents-handler.js +2 -6
  60. package/dist/handlers/message-handlers/list-room-agents-handler.js.map +1 -1
  61. package/dist/handlers/message-handlers/list-rooms-response-handler.d.ts.map +1 -1
  62. package/dist/handlers/message-handlers/list-rooms-response-handler.js +2 -5
  63. package/dist/handlers/message-handlers/list-rooms-response-handler.js.map +1 -1
  64. package/dist/handlers/message-handlers/ping-pong-handler.d.ts +52 -4
  65. package/dist/handlers/message-handlers/ping-pong-handler.d.ts.map +1 -1
  66. package/dist/handlers/message-handlers/ping-pong-handler.js +23 -4
  67. package/dist/handlers/message-handlers/ping-pong-handler.js.map +1 -1
  68. package/dist/handlers/message-handlers/rate-limit-notification-handler.d.ts.map +1 -1
  69. package/dist/handlers/message-handlers/rate-limit-notification-handler.js +3 -2
  70. package/dist/handlers/message-handlers/rate-limit-notification-handler.js.map +1 -1
  71. package/dist/handlers/message-handlers/regular-message-handler.d.ts +6 -0
  72. package/dist/handlers/message-handlers/regular-message-handler.d.ts.map +1 -1
  73. package/dist/handlers/message-handlers/subscribe-response-handler.d.ts +12 -6
  74. package/dist/handlers/message-handlers/subscribe-response-handler.d.ts.map +1 -1
  75. package/dist/handlers/message-handlers/success-handler.d.ts +82 -0
  76. package/dist/handlers/message-handlers/success-handler.d.ts.map +1 -0
  77. package/dist/handlers/message-handlers/success-handler.js +24 -0
  78. package/dist/handlers/message-handlers/success-handler.js.map +1 -0
  79. package/dist/handlers/message-handlers/task-confirmed-handler.d.ts +110 -0
  80. package/dist/handlers/message-handlers/task-confirmed-handler.d.ts.map +1 -0
  81. package/dist/handlers/message-handlers/task-confirmed-handler.js +46 -0
  82. package/dist/handlers/message-handlers/task-confirmed-handler.js.map +1 -0
  83. package/dist/handlers/message-handlers/trigger-wallet-tx-handler.d.ts +244 -0
  84. package/dist/handlers/message-handlers/trigger-wallet-tx-handler.d.ts.map +1 -0
  85. package/dist/handlers/message-handlers/trigger-wallet-tx-handler.js +58 -0
  86. package/dist/handlers/message-handlers/trigger-wallet-tx-handler.js.map +1 -0
  87. package/dist/handlers/message-handlers/unsubscribe-response-handler.d.ts +12 -6
  88. package/dist/handlers/message-handlers/unsubscribe-response-handler.d.ts.map +1 -1
  89. package/dist/handlers/message-handlers/user-authenticated-handler.js +2 -2
  90. package/dist/handlers/message-handlers/user-authenticated-handler.js.map +1 -1
  91. package/dist/handlers/message-handlers/user-count-handler.js +2 -2
  92. package/dist/handlers/message-handlers/user-count-handler.js.map +1 -1
  93. package/dist/index.d.ts +3 -3
  94. package/dist/index.d.ts.map +1 -1
  95. package/dist/index.js +11 -4
  96. package/dist/index.js.map +1 -1
  97. package/dist/managers/admin-manager.d.ts +3 -1
  98. package/dist/managers/admin-manager.d.ts.map +1 -1
  99. package/dist/managers/admin-manager.js +4 -3
  100. package/dist/managers/admin-manager.js.map +1 -1
  101. package/dist/managers/agent-room-manager.d.ts +89 -11
  102. package/dist/managers/agent-room-manager.d.ts.map +1 -1
  103. package/dist/managers/agent-room-manager.js +99 -35
  104. package/dist/managers/agent-room-manager.js.map +1 -1
  105. package/dist/managers/index.d.ts +1 -1
  106. package/dist/managers/index.d.ts.map +1 -1
  107. package/dist/managers/index.js.map +1 -1
  108. package/dist/managers/message-router.d.ts +45 -5
  109. package/dist/managers/message-router.d.ts.map +1 -1
  110. package/dist/managers/message-router.js +96 -24
  111. package/dist/managers/message-router.js.map +1 -1
  112. package/dist/managers/room-manager.d.ts +29 -7
  113. package/dist/managers/room-manager.d.ts.map +1 -1
  114. package/dist/managers/room-manager.js +37 -11
  115. package/dist/managers/room-manager.js.map +1 -1
  116. package/dist/payments/index.d.ts +3 -1
  117. package/dist/payments/index.d.ts.map +1 -1
  118. package/dist/payments/index.js +17 -3
  119. package/dist/payments/index.js.map +1 -1
  120. package/dist/payments/networks.d.ts +59 -0
  121. package/dist/payments/networks.d.ts.map +1 -0
  122. package/dist/payments/networks.js +192 -0
  123. package/dist/payments/networks.js.map +1 -0
  124. package/dist/payments/payment-client.d.ts +55 -10
  125. package/dist/payments/payment-client.d.ts.map +1 -1
  126. package/dist/payments/payment-client.js +172 -51
  127. package/dist/payments/payment-client.js.map +1 -1
  128. package/dist/teneo-sdk.d.ts +215 -41
  129. package/dist/teneo-sdk.d.ts.map +1 -1
  130. package/dist/teneo-sdk.js +361 -84
  131. package/dist/teneo-sdk.js.map +1 -1
  132. package/dist/types/config.d.ts +334 -25
  133. package/dist/types/config.d.ts.map +1 -1
  134. package/dist/types/config.js +114 -22
  135. package/dist/types/config.js.map +1 -1
  136. package/dist/types/events.d.ts +60 -14
  137. package/dist/types/events.d.ts.map +1 -1
  138. package/dist/types/events.js.map +1 -1
  139. package/dist/types/index.d.ts +1 -1
  140. package/dist/types/index.d.ts.map +1 -1
  141. package/dist/types/index.js +11 -4
  142. package/dist/types/index.js.map +1 -1
  143. package/dist/types/messages.d.ts +13110 -7451
  144. package/dist/types/messages.d.ts.map +1 -1
  145. package/dist/types/messages.js +195 -44
  146. package/dist/types/messages.js.map +1 -1
  147. package/dist/utils/pricing-resolver.d.ts +1 -1
  148. package/dist/utils/pricing-resolver.d.ts.map +1 -1
  149. package/dist/utils/pricing-resolver.js +9 -1
  150. package/dist/utils/pricing-resolver.js.map +1 -1
  151. package/examples/agent-room-management-example.ts +5 -5
  152. package/examples/basic-usage.ts +26 -6
  153. package/examples/claude-agent-x-follower/index.ts +1 -1
  154. package/examples/minimal-chat.ts +4 -3
  155. package/examples/n8n-teneo/index.ts +2 -2
  156. package/examples/nestjs-dashboard/README.md +1 -1
  157. package/examples/nestjs-dashboard/src/teneo/agents.controller.ts +3 -3
  158. package/examples/nestjs-dashboard/src/teneo/rooms.controller.ts +5 -5
  159. package/examples/nestjs-dashboard/src/teneo/teneo.service.ts +8 -8
  160. package/examples/openai-teneo/index.ts +1 -1
  161. package/examples/payment-flow.ts +143 -0
  162. package/examples/production-dashboard/README.md +6 -8
  163. package/examples/production-dashboard/server.ts +22 -10
  164. package/examples/room-management-example.ts +2 -2
  165. package/examples/usage/01-connect.ts +0 -3
  166. package/examples/usage/02-list-agents.ts +0 -2
  167. package/examples/usage/03-pick-agent.ts +3 -4
  168. package/examples/usage/04-find-by-capability.ts +10 -12
  169. package/examples/usage/05-webhook-example.ts +2 -4
  170. package/examples/usage/06-simple-api-server.ts +13 -9
  171. package/examples/usage/07-event-listener.ts +1 -13
  172. package/examples/usage/README.md +33 -7
  173. package/examples/webhook-integration.ts +9 -9
  174. package/examples/x-influencer-battle-server.ts +1 -1
  175. package/package.json +1 -1
  176. package/scripts/diagnose-connection.ts +86 -0
  177. package/scripts/investigate-payload.ts +163 -0
  178. package/scripts/list-agents.ts +58 -0
  179. package/scripts/live-multi-network-test.ts +230 -0
  180. package/src/constants.ts +5 -3
  181. package/src/core/websocket-client.ts +10 -9
  182. package/src/handlers/message-handlers/agent-details-response-handler.ts +2 -2
  183. package/src/handlers/message-handlers/agent-error-handler.ts +47 -0
  184. package/src/handlers/message-handlers/agent-status-update-handler.ts +2 -7
  185. package/src/handlers/message-handlers/all-agents-response-handler.ts +2 -2
  186. package/src/handlers/message-handlers/auth-message-handler.ts +7 -1
  187. package/src/handlers/message-handlers/auth-success-handler.ts +7 -1
  188. package/src/handlers/message-handlers/base-handler.ts +24 -4
  189. package/src/handlers/message-handlers/index.ts +24 -0
  190. package/src/handlers/message-handlers/list-available-agents-handler.ts +24 -11
  191. package/src/handlers/message-handlers/list-room-agents-handler.ts +2 -6
  192. package/src/handlers/message-handlers/list-rooms-response-handler.ts +2 -5
  193. package/src/handlers/message-handlers/ping-pong-handler.ts +29 -4
  194. package/src/handlers/message-handlers/rate-limit-notification-handler.ts +3 -2
  195. package/src/handlers/message-handlers/success-handler.ts +26 -0
  196. package/src/handlers/message-handlers/task-confirmed-handler.ts +49 -0
  197. package/src/handlers/message-handlers/trigger-wallet-tx-handler.ts +62 -0
  198. package/src/handlers/message-handlers/user-authenticated-handler.ts +2 -2
  199. package/src/handlers/message-handlers/user-count-handler.ts +2 -2
  200. package/src/index.ts +12 -4
  201. package/src/managers/admin-manager.ts +6 -3
  202. package/src/managers/agent-room-manager.ts +155 -26
  203. package/src/managers/index.ts +6 -1
  204. package/src/managers/message-router.ts +122 -27
  205. package/src/managers/room-manager.ts +39 -11
  206. package/src/payments/index.ts +20 -5
  207. package/src/payments/networks.ts +208 -0
  208. package/src/payments/payment-client.ts +211 -56
  209. package/src/teneo-sdk.ts +402 -71
  210. package/src/types/config.test.ts +24 -4
  211. package/src/types/config.ts +123 -25
  212. package/src/types/events.ts +36 -2
  213. package/src/types/index.ts +16 -3
  214. package/src/types/messages.ts +235 -60
  215. package/src/utils/pricing-resolver.ts +10 -2
  216. package/tests/direct-agent-test.ts +1 -1
  217. package/tests/integration/real-server.test.ts +1 -1
  218. package/tests/integration/websocket.test.ts +3 -3
  219. package/tests/multi-network-payment.test.ts +309 -0
  220. package/tests/multi-network.test.ts +296 -0
  221. package/tests/payment-flow-test.ts +6 -4
  222. package/tests/unit/handlers/agent-error-handler.test.ts +388 -0
  223. package/tests/unit/handlers/agent-room-operation-response-handler.test.ts +9 -6
  224. package/tests/unit/handlers/agent-status-update-handler.test.ts +11 -16
  225. package/tests/unit/handlers/list-available-agents-handler.test.ts +11 -14
  226. package/tests/unit/handlers/list-room-agents-handler.test.ts +11 -15
  227. package/tests/unit/handlers/room-operation-response-handler.test.ts +9 -6
  228. package/tests/unit/handlers/trigger-wallet-tx-handler.test.ts +431 -0
  229. package/tests/unit/managers/admin-manager.test.ts +183 -0
  230. package/tests/unit/managers/agent-room-manager.test.ts +189 -33
  231. package/tests/unit/sdk-new-methods.test.ts +221 -0
@@ -1 +1 @@
1
- {"version":3,"file":"agent-details-response-handler.d.ts","sourceRoot":"","sources":["../../../src/handlers/message-handlers/agent-details-response-handler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,2BAA2B,EAAqC,MAAM,aAAa,CAAC;AAC7F,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iDAAqC;IAEpD,SAAS,CAAC,eAAe,CAAC,OAAO,EAAE,2BAA2B,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI;CA4B/F"}
1
+ {"version":3,"file":"agent-details-response-handler.d.ts","sourceRoot":"","sources":["../../../src/handlers/message-handlers/agent-details-response-handler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,2BAA2B,EAAqC,MAAM,aAAa,CAAC;AAC7F,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,c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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iDAAqC;IAEpD,SAAS,CAAC,eAAe,CAAC,OAAO,EAAE,2BAA2B,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI;CA4B/F"}
@@ -30,8 +30,8 @@ class AgentDetailsResponseHandler extends base_handler_1.BaseMessageHandler {
30
30
  agentName: agent.agent_name,
31
31
  status: agent.status
32
32
  });
33
- // Send webhook
34
- this.sendWebhook(context, "agent_details_response", { agent });
33
+ // Note: This is a query response, not sent via webhook
34
+ // Users can listen to the 'agent:details' event if needed
35
35
  }
36
36
  }
37
37
  exports.AgentDetailsResponseHandler = AgentDetailsResponseHandler;
@@ -1 +1 @@
1
- {"version":3,"file":"agent-details-response-handler.js","sourceRoot":"","sources":["../../../src/handlers/message-handlers/agent-details-response-handler.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,uCAA6F;AAC7F,iDAAoD;AAGpD,MAAa,2BAA4B,SAAQ,iCAA+C;IACrF,IAAI,GAAG,wBAAiC,CAAC;IACzC,MAAM,GAAG,yCAAiC,CAAC;IAE1C,eAAe,CAAC,OAAoC,EAAE,OAAuB;QACrF,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;YACzB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,oDAAoD,CAAC,CAAC;YAC1E,OAAO;QACT,CAAC;QAED,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;QAE/B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,iCAAiC,EAAE;YACtD,OAAO,EAAE,KAAK,CAAC,QAAQ;YACvB,SAAS,EAAE,KAAK,CAAC,UAAU;SAC5B,CAAC,CAAC;QAEH,0CAA0C;QAC1C,MAAM,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;QAC5C,IAAI,aAAa,IAAI,OAAO,aAAa,CAAC,kBAAkB,KAAK,UAAU,EAAE,CAAC;YAC5E,aAAa,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;QAC1C,CAAC;QAED,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,wBAAwB,EAAE;YAC5C,OAAO,EAAE,KAAK,CAAC,QAAQ;YACvB,SAAS,EAAE,KAAK,CAAC,UAAU;YAC3B,MAAM,EAAE,KAAK,CAAC,MAAM;SACrB,CAAC,CAAC;QAEH,eAAe;QACf,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,wBAAwB,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IACjE,CAAC;CACF;AAhCD,kEAgCC"}
1
+ {"version":3,"file":"agent-details-response-handler.js","sourceRoot":"","sources":["../../../src/handlers/message-handlers/agent-details-response-handler.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,uCAA6F;AAC7F,iDAAoD;AAGpD,MAAa,2BAA4B,SAAQ,iCAA+C;IACrF,IAAI,GAAG,wBAAiC,CAAC;IACzC,MAAM,GAAG,yCAAiC,CAAC;IAE1C,eAAe,CAAC,OAAoC,EAAE,OAAuB;QACrF,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;YACzB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,oDAAoD,CAAC,CAAC;YAC1E,OAAO;QACT,CAAC;QAED,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;QAE/B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,iCAAiC,EAAE;YACtD,OAAO,EAAE,KAAK,CAAC,QAAQ;YACvB,SAAS,EAAE,KAAK,CAAC,UAAU;SAC5B,CAAC,CAAC;QAEH,0CAA0C;QAC1C,MAAM,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;QAC5C,IAAI,aAAa,IAAI,OAAO,aAAa,CAAC,kBAAkB,KAAK,UAAU,EAAE,CAAC;YAC5E,aAAa,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;QAC1C,CAAC;QAED,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,wBAAwB,EAAE;YAC5C,OAAO,EAAE,KAAK,CAAC,QAAQ;YACvB,SAAS,EAAE,KAAK,CAAC,UAAU;YAC3B,MAAM,EAAE,KAAK,CAAC,MAAM;SACrB,CAAC,CAAC;QAEH,uDAAuD;QACvD,0DAA0D;IAC5D,CAAC;CACF;AAhCD,kEAgCC"}
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Handler for agent_error messages
3
+ * Processes agent failure notifications from the server (no payment charged)
4
+ */
5
+ import { AgentErrorMessage } from "../../types";
6
+ import { BaseMessageHandler } from "./base-handler";
7
+ import { HandlerContext } from "./types";
8
+ export declare class AgentErrorHandler extends BaseMessageHandler<AgentErrorMessage> {
9
+ readonly type: "agent_error";
10
+ readonly schema: import("zod").ZodObject<{
11
+ content_type: import("zod").ZodOptional<import("zod").ZodEnum<["text/plain", "text/markdown", "text/html", "application/json", "image/*", "STRING", "JSON", "MD", "ARRAY"]>>;
12
+ to: import("zod").ZodOptional<import("zod").ZodString>;
13
+ room: import("zod").ZodOptional<import("zod").ZodString>;
14
+ timestamp: import("zod").ZodOptional<import("zod").ZodString>;
15
+ signature: import("zod").ZodOptional<import("zod").ZodString>;
16
+ publicKey: import("zod").ZodOptional<import("zod").ZodString>;
17
+ reasoning: import("zod").ZodOptional<import("zod").ZodString>;
18
+ task_id: import("zod").ZodOptional<import("zod").ZodString>;
19
+ id: import("zod").ZodOptional<import("zod").ZodString>;
20
+ payment: import("zod").ZodOptional<import("zod").ZodString>;
21
+ request_id: import("zod").ZodOptional<import("zod").ZodString>;
22
+ } & {
23
+ type: import("zod").ZodLiteral<"agent_error">;
24
+ content: import("zod").ZodOptional<import("zod").ZodString>;
25
+ from: import("zod").ZodOptional<import("zod").ZodString>;
26
+ data: import("zod").ZodOptional<import("zod").ZodObject<{
27
+ task_id: import("zod").ZodOptional<import("zod").ZodString>;
28
+ client_request_id: import("zod").ZodOptional<import("zod").ZodString>;
29
+ }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
30
+ task_id: import("zod").ZodOptional<import("zod").ZodString>;
31
+ client_request_id: import("zod").ZodOptional<import("zod").ZodString>;
32
+ }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
33
+ task_id: import("zod").ZodOptional<import("zod").ZodString>;
34
+ client_request_id: import("zod").ZodOptional<import("zod").ZodString>;
35
+ }, import("zod").ZodTypeAny, "passthrough">>>;
36
+ }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
37
+ content_type: import("zod").ZodOptional<import("zod").ZodEnum<["text/plain", "text/markdown", "text/html", "application/json", "image/*", "STRING", "JSON", "MD", "ARRAY"]>>;
38
+ to: import("zod").ZodOptional<import("zod").ZodString>;
39
+ room: import("zod").ZodOptional<import("zod").ZodString>;
40
+ timestamp: import("zod").ZodOptional<import("zod").ZodString>;
41
+ signature: import("zod").ZodOptional<import("zod").ZodString>;
42
+ publicKey: import("zod").ZodOptional<import("zod").ZodString>;
43
+ reasoning: import("zod").ZodOptional<import("zod").ZodString>;
44
+ task_id: import("zod").ZodOptional<import("zod").ZodString>;
45
+ id: import("zod").ZodOptional<import("zod").ZodString>;
46
+ payment: import("zod").ZodOptional<import("zod").ZodString>;
47
+ request_id: import("zod").ZodOptional<import("zod").ZodString>;
48
+ } & {
49
+ type: import("zod").ZodLiteral<"agent_error">;
50
+ content: import("zod").ZodOptional<import("zod").ZodString>;
51
+ from: import("zod").ZodOptional<import("zod").ZodString>;
52
+ data: import("zod").ZodOptional<import("zod").ZodObject<{
53
+ task_id: import("zod").ZodOptional<import("zod").ZodString>;
54
+ client_request_id: import("zod").ZodOptional<import("zod").ZodString>;
55
+ }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
56
+ task_id: import("zod").ZodOptional<import("zod").ZodString>;
57
+ client_request_id: import("zod").ZodOptional<import("zod").ZodString>;
58
+ }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
59
+ task_id: import("zod").ZodOptional<import("zod").ZodString>;
60
+ client_request_id: import("zod").ZodOptional<import("zod").ZodString>;
61
+ }, import("zod").ZodTypeAny, "passthrough">>>;
62
+ }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
63
+ content_type: import("zod").ZodOptional<import("zod").ZodEnum<["text/plain", "text/markdown", "text/html", "application/json", "image/*", "STRING", "JSON", "MD", "ARRAY"]>>;
64
+ to: import("zod").ZodOptional<import("zod").ZodString>;
65
+ room: import("zod").ZodOptional<import("zod").ZodString>;
66
+ timestamp: import("zod").ZodOptional<import("zod").ZodString>;
67
+ signature: import("zod").ZodOptional<import("zod").ZodString>;
68
+ publicKey: import("zod").ZodOptional<import("zod").ZodString>;
69
+ reasoning: import("zod").ZodOptional<import("zod").ZodString>;
70
+ task_id: import("zod").ZodOptional<import("zod").ZodString>;
71
+ id: import("zod").ZodOptional<import("zod").ZodString>;
72
+ payment: import("zod").ZodOptional<import("zod").ZodString>;
73
+ request_id: import("zod").ZodOptional<import("zod").ZodString>;
74
+ } & {
75
+ type: import("zod").ZodLiteral<"agent_error">;
76
+ content: import("zod").ZodOptional<import("zod").ZodString>;
77
+ from: import("zod").ZodOptional<import("zod").ZodString>;
78
+ data: import("zod").ZodOptional<import("zod").ZodObject<{
79
+ task_id: import("zod").ZodOptional<import("zod").ZodString>;
80
+ client_request_id: import("zod").ZodOptional<import("zod").ZodString>;
81
+ }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
82
+ task_id: import("zod").ZodOptional<import("zod").ZodString>;
83
+ client_request_id: import("zod").ZodOptional<import("zod").ZodString>;
84
+ }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
85
+ task_id: import("zod").ZodOptional<import("zod").ZodString>;
86
+ client_request_id: import("zod").ZodOptional<import("zod").ZodString>;
87
+ }, import("zod").ZodTypeAny, "passthrough">>>;
88
+ }, import("zod").ZodTypeAny, "passthrough">>;
89
+ protected handleValidated(message: AgentErrorMessage, context: HandlerContext): void;
90
+ }
91
+ //# sourceMappingURL=agent-error-handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-error-handler.d.ts","sourceRoot":"","sources":["../../../src/handlers/message-handlers/agent-error-handler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAA2B,MAAM,aAAa,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,qBAAa,iBAAkB,SAAQ,kBAAkB,CAAC,iBAAiB,CAAC;IAC1E,QAAQ,CAAC,IAAI,EAAG,aAAa,CAAU;IACvC,QAAQ,CAAC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iDAA2B;IAE1C,SAAS,CAAC,eAAe,CAAC,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI;CAiCrF"}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ /**
3
+ * Handler for agent_error messages
4
+ * Processes agent failure notifications from the server (no payment charged)
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.AgentErrorHandler = void 0;
8
+ const types_1 = require("../../types");
9
+ const base_handler_1 = require("./base-handler");
10
+ class AgentErrorHandler extends base_handler_1.BaseMessageHandler {
11
+ type = "agent_error";
12
+ schema = types_1.AgentErrorMessageSchema;
13
+ handleValidated(message, context) {
14
+ const { content, from, data, room } = message;
15
+ context.logger.debug("Handling agent_error", {
16
+ from,
17
+ taskId: data?.task_id,
18
+ content
19
+ });
20
+ context.logger.warn("Agent error received", {
21
+ agentName: from,
22
+ content,
23
+ taskId: data?.task_id
24
+ });
25
+ // Emit agent error event
26
+ this.emit(context, "agent:error", {
27
+ agentName: from,
28
+ content,
29
+ taskId: data?.task_id,
30
+ clientRequestId: data?.client_request_id,
31
+ room
32
+ });
33
+ // Send webhook
34
+ this.sendWebhook(context, "agent_error", {
35
+ agentName: from,
36
+ content,
37
+ taskId: data?.task_id,
38
+ clientRequestId: data?.client_request_id,
39
+ room
40
+ });
41
+ }
42
+ }
43
+ exports.AgentErrorHandler = AgentErrorHandler;
44
+ //# sourceMappingURL=agent-error-handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-error-handler.js","sourceRoot":"","sources":["../../../src/handlers/message-handlers/agent-error-handler.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,uCAAyE;AACzE,iDAAoD;AAGpD,MAAa,iBAAkB,SAAQ,iCAAqC;IACjE,IAAI,GAAG,aAAsB,CAAC;IAC9B,MAAM,GAAG,+BAAuB,CAAC;IAEhC,eAAe,CAAC,OAA0B,EAAE,OAAuB;QAC3E,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;QAE9C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,sBAAsB,EAAE;YAC3C,IAAI;YACJ,MAAM,EAAE,IAAI,EAAE,OAAO;YACrB,OAAO;SACR,CAAC,CAAC;QAEH,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,sBAAsB,EAAE;YAC1C,SAAS,EAAE,IAAI;YACf,OAAO;YACP,MAAM,EAAE,IAAI,EAAE,OAAO;SACtB,CAAC,CAAC;QAEH,yBAAyB;QACzB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,aAAa,EAAE;YAChC,SAAS,EAAE,IAAI;YACf,OAAO;YACP,MAAM,EAAE,IAAI,EAAE,OAAO;YACrB,eAAe,EAAE,IAAI,EAAE,iBAAiB;YACxC,IAAI;SACL,CAAC,CAAC;QAEH,eAAe;QACf,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,aAAa,EAAE;YACvC,SAAS,EAAE,IAAI;YACf,OAAO;YACP,MAAM,EAAE,IAAI,EAAE,OAAO;YACrB,eAAe,EAAE,IAAI,EAAE,iBAAiB;YACxC,IAAI;SACL,CAAC,CAAC;IACL,CAAC;CACF;AArCD,8CAqCC"}
@@ -16,6 +16,8 @@ export declare class AgentSelectedHandler extends BaseMessageHandler<AgentSelect
16
16
  publicKey: import("zod").ZodOptional<import("zod").ZodString>;
17
17
  task_id: import("zod").ZodOptional<import("zod").ZodString>;
18
18
  id: import("zod").ZodOptional<import("zod").ZodString>;
19
+ payment: import("zod").ZodOptional<import("zod").ZodString>;
20
+ request_id: import("zod").ZodOptional<import("zod").ZodString>;
19
21
  } & {
20
22
  type: import("zod").ZodLiteral<"agent_selected">;
21
23
  content: import("zod").ZodString;
@@ -67,6 +69,8 @@ export declare class AgentSelectedHandler extends BaseMessageHandler<AgentSelect
67
69
  publicKey: import("zod").ZodOptional<import("zod").ZodString>;
68
70
  task_id: import("zod").ZodOptional<import("zod").ZodString>;
69
71
  id: import("zod").ZodOptional<import("zod").ZodString>;
72
+ payment: import("zod").ZodOptional<import("zod").ZodString>;
73
+ request_id: import("zod").ZodOptional<import("zod").ZodString>;
70
74
  } & {
71
75
  type: import("zod").ZodLiteral<"agent_selected">;
72
76
  content: import("zod").ZodString;
@@ -118,6 +122,8 @@ export declare class AgentSelectedHandler extends BaseMessageHandler<AgentSelect
118
122
  publicKey: import("zod").ZodOptional<import("zod").ZodString>;
119
123
  task_id: import("zod").ZodOptional<import("zod").ZodString>;
120
124
  id: import("zod").ZodOptional<import("zod").ZodString>;
125
+ payment: import("zod").ZodOptional<import("zod").ZodString>;
126
+ request_id: import("zod").ZodOptional<import("zod").ZodString>;
121
127
  } & {
122
128
  type: import("zod").ZodLiteral<"agent_selected">;
123
129
  content: import("zod").ZodString;
@@ -1 +1 @@
1
- {"version":3,"file":"agent-selected-handler.d.ts","sourceRoot":"","sources":["../../../src/handlers/message-handlers/agent-selected-handler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,oBAAoB,EAA8B,MAAM,aAAa,CAAC;AAE/E,O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