@teneo-protocol/sdk 2.2.2 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/ISSUE_TEMPLATE/config.yml +1 -1
- package/CHANGELOG.md +366 -15
- package/CONCEPTS.md +182 -44
- package/README.md +524 -94
- package/dist/constants.d.ts +3 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +5 -3
- package/dist/constants.js.map +1 -1
- package/dist/core/websocket-client.d.ts.map +1 -1
- package/dist/core/websocket-client.js +9 -5
- package/dist/core/websocket-client.js.map +1 -1
- package/dist/formatters/response-formatter.d.ts +6 -6
- package/dist/handlers/message-handlers/agent-details-response-handler.d.ts +756 -756
- package/dist/handlers/message-handlers/agent-details-response-handler.js +2 -2
- package/dist/handlers/message-handlers/agent-details-response-handler.js.map +1 -1
- package/dist/handlers/message-handlers/agent-error-handler.d.ts +91 -0
- package/dist/handlers/message-handlers/agent-error-handler.d.ts.map +1 -0
- package/dist/handlers/message-handlers/agent-error-handler.js +44 -0
- package/dist/handlers/message-handlers/agent-error-handler.js.map +1 -0
- package/dist/handlers/message-handlers/agent-selected-handler.d.ts +6 -0
- package/dist/handlers/message-handlers/agent-selected-handler.d.ts.map +1 -1
- package/dist/handlers/message-handlers/agent-status-update-handler.d.ts +756 -756
- package/dist/handlers/message-handlers/agent-status-update-handler.d.ts.map +1 -1
- package/dist/handlers/message-handlers/agent-status-update-handler.js +2 -7
- package/dist/handlers/message-handlers/agent-status-update-handler.js.map +1 -1
- package/dist/handlers/message-handlers/all-agents-response-handler.js +2 -2
- package/dist/handlers/message-handlers/all-agents-response-handler.js.map +1 -1
- package/dist/handlers/message-handlers/auth-error-handler.d.ts +6 -0
- package/dist/handlers/message-handlers/auth-error-handler.d.ts.map +1 -1
- package/dist/handlers/message-handlers/auth-message-handler.d.ts.map +1 -1
- package/dist/handlers/message-handlers/auth-message-handler.js +6 -1
- package/dist/handlers/message-handlers/auth-message-handler.js.map +1 -1
- package/dist/handlers/message-handlers/auth-required-handler.d.ts +6 -0
- package/dist/handlers/message-handlers/auth-required-handler.d.ts.map +1 -1
- package/dist/handlers/message-handlers/auth-success-handler.d.ts.map +1 -1
- package/dist/handlers/message-handlers/auth-success-handler.js +6 -1
- package/dist/handlers/message-handlers/auth-success-handler.js.map +1 -1
- package/dist/handlers/message-handlers/base-handler.d.ts +2 -1
- package/dist/handlers/message-handlers/base-handler.d.ts.map +1 -1
- package/dist/handlers/message-handlers/base-handler.js +24 -4
- package/dist/handlers/message-handlers/base-handler.js.map +1 -1
- package/dist/handlers/message-handlers/challenge-handler.d.ts +6 -0
- package/dist/handlers/message-handlers/challenge-handler.d.ts.map +1 -1
- package/dist/handlers/message-handlers/error-message-handler.d.ts +6 -0
- package/dist/handlers/message-handlers/error-message-handler.d.ts.map +1 -1
- package/dist/handlers/message-handlers/index.d.ts +4 -0
- package/dist/handlers/message-handlers/index.d.ts.map +1 -1
- package/dist/handlers/message-handlers/index.js +23 -1
- package/dist/handlers/message-handlers/index.js.map +1 -1
- package/dist/handlers/message-handlers/list-available-agents-handler.d.ts +792 -756
- package/dist/handlers/message-handlers/list-available-agents-handler.d.ts.map +1 -1
- package/dist/handlers/message-handlers/list-available-agents-handler.js +23 -10
- package/dist/handlers/message-handlers/list-available-agents-handler.js.map +1 -1
- package/dist/handlers/message-handlers/list-room-agents-handler.d.ts +756 -756
- package/dist/handlers/message-handlers/list-room-agents-handler.d.ts.map +1 -1
- package/dist/handlers/message-handlers/list-room-agents-handler.js +2 -6
- package/dist/handlers/message-handlers/list-room-agents-handler.js.map +1 -1
- package/dist/handlers/message-handlers/list-rooms-response-handler.d.ts.map +1 -1
- package/dist/handlers/message-handlers/list-rooms-response-handler.js +2 -5
- package/dist/handlers/message-handlers/list-rooms-response-handler.js.map +1 -1
- package/dist/handlers/message-handlers/ping-pong-handler.d.ts +52 -4
- package/dist/handlers/message-handlers/ping-pong-handler.d.ts.map +1 -1
- package/dist/handlers/message-handlers/ping-pong-handler.js +23 -4
- package/dist/handlers/message-handlers/ping-pong-handler.js.map +1 -1
- package/dist/handlers/message-handlers/rate-limit-notification-handler.d.ts.map +1 -1
- package/dist/handlers/message-handlers/rate-limit-notification-handler.js +3 -2
- package/dist/handlers/message-handlers/rate-limit-notification-handler.js.map +1 -1
- package/dist/handlers/message-handlers/regular-message-handler.d.ts +6 -0
- package/dist/handlers/message-handlers/regular-message-handler.d.ts.map +1 -1
- package/dist/handlers/message-handlers/subscribe-response-handler.d.ts +12 -6
- package/dist/handlers/message-handlers/subscribe-response-handler.d.ts.map +1 -1
- package/dist/handlers/message-handlers/success-handler.d.ts +82 -0
- package/dist/handlers/message-handlers/success-handler.d.ts.map +1 -0
- package/dist/handlers/message-handlers/success-handler.js +24 -0
- package/dist/handlers/message-handlers/success-handler.js.map +1 -0
- package/dist/handlers/message-handlers/task-confirmed-handler.d.ts +110 -0
- package/dist/handlers/message-handlers/task-confirmed-handler.d.ts.map +1 -0
- package/dist/handlers/message-handlers/task-confirmed-handler.js +46 -0
- package/dist/handlers/message-handlers/task-confirmed-handler.js.map +1 -0
- package/dist/handlers/message-handlers/trigger-wallet-tx-handler.d.ts +244 -0
- package/dist/handlers/message-handlers/trigger-wallet-tx-handler.d.ts.map +1 -0
- package/dist/handlers/message-handlers/trigger-wallet-tx-handler.js +58 -0
- package/dist/handlers/message-handlers/trigger-wallet-tx-handler.js.map +1 -0
- package/dist/handlers/message-handlers/unsubscribe-response-handler.d.ts +12 -6
- package/dist/handlers/message-handlers/unsubscribe-response-handler.d.ts.map +1 -1
- package/dist/handlers/message-handlers/user-authenticated-handler.js +2 -2
- package/dist/handlers/message-handlers/user-authenticated-handler.js.map +1 -1
- package/dist/handlers/message-handlers/user-count-handler.js +2 -2
- package/dist/handlers/message-handlers/user-count-handler.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -4
- package/dist/index.js.map +1 -1
- package/dist/managers/admin-manager.d.ts +2 -0
- package/dist/managers/admin-manager.d.ts.map +1 -1
- package/dist/managers/admin-manager.js +3 -2
- package/dist/managers/admin-manager.js.map +1 -1
- package/dist/managers/agent-room-manager.d.ts +89 -11
- package/dist/managers/agent-room-manager.d.ts.map +1 -1
- package/dist/managers/agent-room-manager.js +99 -35
- package/dist/managers/agent-room-manager.js.map +1 -1
- package/dist/managers/index.d.ts +1 -1
- package/dist/managers/index.d.ts.map +1 -1
- package/dist/managers/index.js.map +1 -1
- package/dist/managers/message-router.d.ts +45 -5
- package/dist/managers/message-router.d.ts.map +1 -1
- package/dist/managers/message-router.js +96 -24
- package/dist/managers/message-router.js.map +1 -1
- package/dist/managers/room-manager.d.ts +29 -7
- package/dist/managers/room-manager.d.ts.map +1 -1
- package/dist/managers/room-manager.js +37 -11
- package/dist/managers/room-manager.js.map +1 -1
- package/dist/payments/index.d.ts +3 -1
- package/dist/payments/index.d.ts.map +1 -1
- package/dist/payments/index.js +17 -3
- package/dist/payments/index.js.map +1 -1
- package/dist/payments/networks.d.ts +59 -0
- package/dist/payments/networks.d.ts.map +1 -0
- package/dist/payments/networks.js +192 -0
- package/dist/payments/networks.js.map +1 -0
- package/dist/payments/payment-client.d.ts +55 -10
- package/dist/payments/payment-client.d.ts.map +1 -1
- package/dist/payments/payment-client.js +172 -51
- package/dist/payments/payment-client.js.map +1 -1
- package/dist/teneo-sdk.d.ts +214 -40
- package/dist/teneo-sdk.d.ts.map +1 -1
- package/dist/teneo-sdk.js +360 -83
- package/dist/teneo-sdk.js.map +1 -1
- package/dist/types/config.d.ts +334 -25
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/config.js +114 -22
- package/dist/types/config.js.map +1 -1
- package/dist/types/events.d.ts +60 -14
- package/dist/types/events.d.ts.map +1 -1
- package/dist/types/events.js.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +11 -4
- package/dist/types/index.js.map +1 -1
- package/dist/types/messages.d.ts +9801 -7222
- package/dist/types/messages.d.ts.map +1 -1
- package/dist/types/messages.js +180 -40
- package/dist/types/messages.js.map +1 -1
- package/dist/utils/pricing-resolver.d.ts +1 -1
- package/dist/utils/pricing-resolver.d.ts.map +1 -1
- package/dist/utils/pricing-resolver.js +9 -1
- package/dist/utils/pricing-resolver.js.map +1 -1
- package/examples/agent-room-management-example.ts +5 -5
- package/examples/basic-usage.ts +26 -6
- package/examples/claude-agent-x-follower/index.ts +1 -1
- package/examples/minimal-chat.ts +4 -3
- package/examples/n8n-teneo/index.ts +2 -2
- package/examples/nestjs-dashboard/README.md +1 -1
- package/examples/nestjs-dashboard/src/teneo/agents.controller.ts +3 -3
- package/examples/nestjs-dashboard/src/teneo/rooms.controller.ts +5 -5
- package/examples/nestjs-dashboard/src/teneo/teneo.service.ts +8 -8
- package/examples/openai-teneo/index.ts +1 -1
- package/examples/payment-flow.ts +143 -0
- package/examples/production-dashboard/README.md +6 -8
- package/examples/production-dashboard/server.ts +22 -10
- package/examples/room-management-example.ts +2 -2
- package/examples/usage/01-connect.ts +0 -3
- package/examples/usage/02-list-agents.ts +0 -2
- package/examples/usage/03-pick-agent.ts +3 -4
- package/examples/usage/04-find-by-capability.ts +10 -12
- package/examples/usage/05-webhook-example.ts +2 -4
- package/examples/usage/06-simple-api-server.ts +13 -9
- package/examples/usage/07-event-listener.ts +1 -13
- package/examples/usage/README.md +33 -7
- package/examples/webhook-integration.ts +9 -9
- package/examples/x-influencer-battle-server.ts +1 -1
- package/package.json +1 -1
- package/scripts/diagnose-connection.ts +86 -0
- package/scripts/investigate-payload.ts +163 -0
- package/scripts/list-agents.ts +58 -0
- package/scripts/live-multi-network-test.ts +230 -0
- package/src/constants.ts +5 -3
- package/src/core/websocket-client.ts +10 -9
- package/src/handlers/message-handlers/agent-details-response-handler.ts +2 -2
- package/src/handlers/message-handlers/agent-error-handler.ts +47 -0
- package/src/handlers/message-handlers/agent-status-update-handler.ts +2 -7
- package/src/handlers/message-handlers/all-agents-response-handler.ts +2 -2
- package/src/handlers/message-handlers/auth-message-handler.ts +7 -1
- package/src/handlers/message-handlers/auth-success-handler.ts +7 -1
- package/src/handlers/message-handlers/base-handler.ts +24 -4
- package/src/handlers/message-handlers/index.ts +24 -0
- package/src/handlers/message-handlers/list-available-agents-handler.ts +24 -11
- package/src/handlers/message-handlers/list-room-agents-handler.ts +2 -6
- package/src/handlers/message-handlers/list-rooms-response-handler.ts +2 -5
- package/src/handlers/message-handlers/ping-pong-handler.ts +29 -4
- package/src/handlers/message-handlers/rate-limit-notification-handler.ts +3 -2
- package/src/handlers/message-handlers/success-handler.ts +26 -0
- package/src/handlers/message-handlers/task-confirmed-handler.ts +49 -0
- package/src/handlers/message-handlers/trigger-wallet-tx-handler.ts +62 -0
- package/src/handlers/message-handlers/user-authenticated-handler.ts +2 -2
- package/src/handlers/message-handlers/user-count-handler.ts +2 -2
- package/src/index.ts +12 -4
- package/src/managers/admin-manager.ts +5 -2
- package/src/managers/agent-room-manager.ts +155 -26
- package/src/managers/index.ts +6 -1
- package/src/managers/message-router.ts +122 -27
- package/src/managers/room-manager.ts +39 -11
- package/src/payments/index.ts +20 -5
- package/src/payments/networks.ts +208 -0
- package/src/payments/payment-client.ts +211 -56
- package/src/teneo-sdk.ts +401 -70
- package/src/types/config.test.ts +24 -4
- package/src/types/config.ts +123 -25
- package/src/types/events.ts +36 -2
- package/src/types/index.ts +16 -3
- package/src/types/messages.ts +221 -57
- package/src/utils/pricing-resolver.ts +10 -2
- package/tests/direct-agent-test.ts +1 -1
- package/tests/integration/real-server.test.ts +1 -1
- package/tests/integration/websocket.test.ts +3 -3
- package/tests/multi-network-payment.test.ts +309 -0
- package/tests/multi-network.test.ts +296 -0
- package/tests/payment-flow-test.ts +6 -4
- package/tests/unit/handlers/agent-error-handler.test.ts +388 -0
- package/tests/unit/handlers/agent-room-operation-response-handler.test.ts +9 -6
- package/tests/unit/handlers/agent-status-update-handler.test.ts +11 -16
- package/tests/unit/handlers/list-available-agents-handler.test.ts +11 -14
- package/tests/unit/handlers/list-room-agents-handler.test.ts +11 -15
- package/tests/unit/handlers/room-operation-response-handler.test.ts +9 -6
- package/tests/unit/handlers/trigger-wallet-tx-handler.test.ts +431 -0
- package/tests/unit/managers/admin-manager.test.ts +183 -0
- package/tests/unit/managers/agent-room-manager.test.ts +189 -33
- package/tests/unit/sdk-new-methods.test.ts +221 -0
|
@@ -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
|
-
//
|
|
34
|
-
|
|
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,
|
|
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,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,qBAAa,oBAAqB,SAAQ,kBAAkB,CAAC,oBAAoB,CAAC;IAChF,QAAQ,CAAC,IAAI,EAAG,gBAAgB,CAAU;IAC1C,QAAQ,CAAC,MAAM
|
|
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,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,qBAAa,oBAAqB,SAAQ,kBAAkB,CAAC,oBAAoB,CAAC;IAChF,QAAQ,CAAC,IAAI,EAAG,gBAAgB,CAAU;IAC1C,QAAQ,CAAC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iDAA8B;IAE7C,SAAS,CAAC,eAAe,CAAC,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI;CAyBxF"}
|