@chat-lab/ui 0.1.0-beta.43 → 0.1.0-beta.44
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/dist/_virtual/_commonjsHelpers.cjs +0 -26
- package/dist/_virtual/_commonjsHelpers.cjs.map +1 -1
- package/dist/_virtual/_commonjsHelpers.js +1 -26
- package/dist/_virtual/_commonjsHelpers.js.map +1 -1
- package/dist/_virtual/index.cjs +2 -2
- package/dist/_virtual/index.js +2 -2
- package/dist/_virtual/index2.cjs +2 -2
- package/dist/_virtual/index2.js +2 -2
- package/dist/_virtual/index3.cjs +2 -2
- package/dist/_virtual/index3.js +2 -2
- package/dist/_virtual/index4.cjs +2 -5
- package/dist/_virtual/index4.cjs.map +1 -1
- package/dist/_virtual/index4.js +2 -5
- package/dist/_virtual/index4.js.map +1 -1
- package/dist/adk/components/Debug/Trace/store.cjs +5 -5
- package/dist/adk/components/Debug/Trace/store.cjs.map +1 -1
- package/dist/adk/components/Debug/Trace/store.js +2 -2
- package/dist/adk/hooks/useEvents.cjs +5 -5
- package/dist/adk/hooks/useEvents.cjs.map +1 -1
- package/dist/adk/hooks/useEvents.js +2 -2
- package/dist/assets/ThumbDownIcon.cjs +1 -1
- package/dist/assets/ThumbDownIcon.cjs.map +1 -1
- package/dist/assets/ThumbDownIcon.js +1 -1
- package/dist/assets/ThumbDownIcon.js.map +1 -1
- package/dist/components/assistant-ui/thread.cjs +2 -2
- package/dist/components/assistant-ui/thread.cjs.map +1 -1
- package/dist/components/assistant-ui/thread.js +1 -1
- package/dist/components/assistant-ui/tooltip-icon-button.cjs +2 -2
- package/dist/components/assistant-ui/tooltip-icon-button.cjs.map +1 -1
- package/dist/components/assistant-ui/tooltip-icon-button.js +1 -1
- package/dist/components/thread-list.cjs +7 -7
- package/dist/components/thread-list.cjs.map +1 -1
- package/dist/components/thread-list.js +2 -2
- package/dist/components/thread-list.js.map +1 -1
- package/dist/components/ui/button.cjs +2 -2
- package/dist/components/ui/button.cjs.map +1 -1
- package/dist/components/ui/button.js +1 -1
- package/dist/hooks/useADKChat.cjs +33 -5
- package/dist/hooks/useADKChat.cjs.map +1 -1
- package/dist/hooks/useADKChat.d.ts +6 -1
- package/dist/hooks/useADKChat.d.ts.map +1 -1
- package/dist/hooks/useADKChat.js +34 -6
- package/dist/hooks/useADKChat.js.map +1 -1
- package/dist/index.cjs +1 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -2
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/utils.cjs +1 -1
- package/dist/lib/utils.js +1 -1
- package/dist/node_modules/.pnpm/@a2a-js_sdk@0.3.7_express@5.1.0/node_modules/@a2a-js/sdk/dist/chunk-3QDLXHKS.cjs +7 -0
- package/dist/node_modules/.pnpm/@a2a-js_sdk@0.3.7_express@5.1.0/node_modules/@a2a-js/sdk/dist/chunk-3QDLXHKS.cjs.map +1 -0
- package/dist/node_modules/.pnpm/@a2a-js_sdk@0.3.7_express@5.1.0/node_modules/@a2a-js/sdk/dist/chunk-3QDLXHKS.js +5 -0
- package/dist/node_modules/.pnpm/@a2a-js_sdk@0.3.7_express@5.1.0/node_modules/@a2a-js/sdk/dist/chunk-3QDLXHKS.js.map +1 -0
- package/dist/node_modules/.pnpm/@a2a-js_sdk@0.3.7_express@5.1.0/node_modules/@a2a-js/sdk/dist/chunk-SJNAG4AL.cjs +100 -0
- package/dist/node_modules/.pnpm/@a2a-js_sdk@0.3.7_express@5.1.0/node_modules/@a2a-js/sdk/dist/chunk-SJNAG4AL.cjs.map +1 -0
- package/dist/node_modules/.pnpm/@a2a-js_sdk@0.3.7_express@5.1.0/node_modules/@a2a-js/sdk/dist/chunk-SJNAG4AL.js +90 -0
- package/dist/node_modules/.pnpm/@a2a-js_sdk@0.3.7_express@5.1.0/node_modules/@a2a-js/sdk/dist/chunk-SJNAG4AL.js.map +1 -0
- package/dist/node_modules/.pnpm/@a2a-js_sdk@0.3.7_express@5.1.0/node_modules/@a2a-js/sdk/dist/client/index.cjs +975 -0
- package/dist/node_modules/.pnpm/@a2a-js_sdk@0.3.7_express@5.1.0/node_modules/@a2a-js/sdk/dist/client/index.cjs.map +1 -0
- package/dist/node_modules/.pnpm/@a2a-js_sdk@0.3.7_express@5.1.0/node_modules/@a2a-js/sdk/dist/client/index.js +958 -0
- package/dist/node_modules/.pnpm/@a2a-js_sdk@0.3.7_express@5.1.0/node_modules/@a2a-js/sdk/dist/client/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@assistant-ui_react@0.11.37_patch_hash_wncib234fzw2z5h67nrdhchb2a_@types_react-dom@17.0.2_@ty_c64hu5rigivj2gtpzfqjqatr5y/node_modules/@assistant-ui/react/dist/primitives/messagePart/useMessagePartText.cjs.map +1 -1
- package/dist/node_modules/.pnpm/@assistant-ui_react@0.11.37_patch_hash_wncib234fzw2z5h67nrdhchb2a_@types_react-dom@17.0.2_@ty_c64hu5rigivj2gtpzfqjqatr5y/node_modules/@assistant-ui/react/dist/primitives/messagePart/useMessagePartText.js.map +1 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-slot@1.2.4_@types_react@17.0.2_react@17.0.2/node_modules/@radix-ui/react-slot/dist/index.cjs +0 -12
- package/dist/node_modules/.pnpm/@radix-ui_react-slot@1.2.4_@types_react@17.0.2_react@17.0.2/node_modules/@radix-ui/react-slot/dist/index.cjs.map +1 -1
- package/dist/node_modules/.pnpm/@radix-ui_react-slot@1.2.4_@types_react@17.0.2_react@17.0.2/node_modules/@radix-ui/react-slot/dist/index.js +2 -12
- package/dist/node_modules/.pnpm/@radix-ui_react-slot@1.2.4_@types_react@17.0.2_react@17.0.2/node_modules/@radix-ui/react-slot/dist/index.js.map +1 -1
- package/dist/node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@3.29.5_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.cjs +0 -18
- package/dist/node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@3.29.5_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.cjs.map +1 -1
- package/dist/node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@3.29.5_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js +1 -17
- package/dist/node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@3.29.5_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js.map +1 -1
- package/dist/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.cjs +1 -1
- package/dist/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js +1 -1
- package/dist/node_modules/.pnpm/dayjs@1.11.18/node_modules/dayjs/dayjs.min.cjs +1 -4
- package/dist/node_modules/.pnpm/dayjs@1.11.18/node_modules/dayjs/dayjs.min.cjs.map +1 -1
- package/dist/node_modules/.pnpm/dayjs@1.11.18/node_modules/dayjs/dayjs.min.js +1 -1
- package/dist/node_modules/.pnpm/secure-json-parse@4.1.0/node_modules/secure-json-parse/index.cjs +1 -1
- package/dist/node_modules/.pnpm/secure-json-parse@4.1.0/node_modules/secure-json-parse/index.js +1 -1
- package/dist/node_modules/.pnpm/style-to-js@1.1.18/node_modules/style-to-js/cjs/index.cjs +1 -1
- package/dist/node_modules/.pnpm/style-to-js@1.1.18/node_modules/style-to-js/cjs/index.js +1 -1
- package/dist/node_modules/.pnpm/style-to-object@1.0.11/node_modules/style-to-object/cjs/index.cjs +1 -1
- package/dist/node_modules/.pnpm/style-to-object@1.0.11/node_modules/style-to-object/cjs/index.js +1 -1
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@17.0.2_react@17.0.2/node_modules/use-sidecar/dist/es2015/medium.cjs +0 -5
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@17.0.2_react@17.0.2/node_modules/use-sidecar/dist/es2015/medium.cjs.map +1 -1
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@17.0.2_react@17.0.2/node_modules/use-sidecar/dist/es2015/medium.js +1 -5
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@17.0.2_react@17.0.2/node_modules/use-sidecar/dist/es2015/medium.js.map +1 -1
- package/dist/node_modules/.pnpm/use-sync-external-store@1.6.0_react@17.0.2/node_modules/use-sync-external-store/shim/index.cjs +1 -1
- package/dist/node_modules/.pnpm/use-sync-external-store@1.6.0_react@17.0.2/node_modules/use-sync-external-store/shim/index.js +1 -1
- package/dist/node_modules/.pnpm/valtio@2.1.8_patch_hash_boxi3qpsg2dztwe4vz7tsjpr3m_@types_react@17.0.2_react@17.0.2/node_modules/valtio/esm/vanilla.cjs +0 -1
- package/dist/node_modules/.pnpm/valtio@2.1.8_patch_hash_boxi3qpsg2dztwe4vz7tsjpr3m_@types_react@17.0.2_react@17.0.2/node_modules/valtio/esm/vanilla.cjs.map +1 -1
- package/dist/node_modules/.pnpm/valtio@2.1.8_patch_hash_boxi3qpsg2dztwe4vz7tsjpr3m_@types_react@17.0.2_react@17.0.2/node_modules/valtio/esm/vanilla.js +0 -1
- package/dist/node_modules/.pnpm/valtio@2.1.8_patch_hash_boxi3qpsg2dztwe4vz7tsjpr3m_@types_react@17.0.2_react@17.0.2/node_modules/valtio/esm/vanilla.js.map +1 -1
- package/dist/packages/core/dist/index.cjs +171 -27
- package/dist/packages/core/dist/index.cjs.map +1 -1
- package/dist/packages/core/dist/index.js +162 -19
- package/dist/packages/core/dist/index.js.map +1 -1
- package/dist/plugins/adkPlugin.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -12,6 +12,7 @@ import 'react/jsx-runtime';
|
|
|
12
12
|
import 'react';
|
|
13
13
|
import './adk/hooks/useEvents.js';
|
|
14
14
|
import './adk/components/Debug/Trace/store.js';
|
|
15
|
+
import 'clsx';
|
|
15
16
|
import './components/ui/tabs.js';
|
|
16
17
|
import './components/ui/card.js';
|
|
17
18
|
import './node_modules/.pnpm/react-json-view@1.21.3_@types_react@17.0.2_react-dom@17.0.2_react@17.0.2__react@17.0.2/node_modules/react-json-view/dist/main.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
|
package/dist/lib/utils.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var clsx = require('
|
|
3
|
+
var clsx = require('clsx');
|
|
4
4
|
var bundleMjs = require('../node_modules/.pnpm/tailwind-merge@3.3.1/node_modules/tailwind-merge/dist/bundle-mjs.cjs');
|
|
5
5
|
|
|
6
6
|
function cn(...inputs) {
|
package/dist/lib/utils.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-3QDLXHKS.cjs","sources":["../../../../../../../../../../node_modules/.pnpm/@a2a-js+sdk@0.3.7_express@5.1.0/node_modules/@a2a-js/sdk/dist/chunk-3QDLXHKS.js"],"sourcesContent":["// src/constants.ts\nvar AGENT_CARD_PATH = \".well-known/agent-card.json\";\nvar HTTP_EXTENSION_HEADER = \"X-A2A-Extensions\";\n\nexport {\n AGENT_CARD_PATH,\n HTTP_EXTENSION_HEADER\n};\n"],"names":[],"mappings":";;AAAA;AACG,IAAC,eAAe,GAAG;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-3QDLXHKS.js","sources":["../../../../../../../../../../node_modules/.pnpm/@a2a-js+sdk@0.3.7_express@5.1.0/node_modules/@a2a-js/sdk/dist/chunk-3QDLXHKS.js"],"sourcesContent":["// src/constants.ts\nvar AGENT_CARD_PATH = \".well-known/agent-card.json\";\nvar HTTP_EXTENSION_HEADER = \"X-A2A-Extensions\";\n\nexport {\n AGENT_CARD_PATH,\n HTTP_EXTENSION_HEADER\n};\n"],"names":[],"mappings":"AAAA;AACG,IAAC,eAAe,GAAG;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/errors.ts
|
|
4
|
+
var A2A_ERROR_CODE = {
|
|
5
|
+
PARSE_ERROR: -32700,
|
|
6
|
+
INVALID_REQUEST: -32600,
|
|
7
|
+
METHOD_NOT_FOUND: -32601,
|
|
8
|
+
INVALID_PARAMS: -32602,
|
|
9
|
+
INTERNAL_ERROR: -32603,
|
|
10
|
+
TASK_NOT_FOUND: -32001,
|
|
11
|
+
TASK_NOT_CANCELABLE: -32002,
|
|
12
|
+
PUSH_NOTIFICATION_NOT_SUPPORTED: -32003,
|
|
13
|
+
UNSUPPORTED_OPERATION: -32004,
|
|
14
|
+
CONTENT_TYPE_NOT_SUPPORTED: -32005,
|
|
15
|
+
INVALID_AGENT_RESPONSE: -32006,
|
|
16
|
+
AUTHENTICATED_EXTENDED_CARD_NOT_CONFIGURED: -32007
|
|
17
|
+
};
|
|
18
|
+
var TaskNotFoundError = class extends Error {
|
|
19
|
+
constructor(message) {
|
|
20
|
+
super(message ?? "Task not found");
|
|
21
|
+
this.name = "TaskNotFoundError";
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
var TaskNotCancelableError = class extends Error {
|
|
25
|
+
constructor(message) {
|
|
26
|
+
super(message ?? "Task cannot be canceled");
|
|
27
|
+
this.name = "TaskNotCancelableError";
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
var PushNotificationNotSupportedError = class extends Error {
|
|
31
|
+
constructor(message) {
|
|
32
|
+
super(message ?? "Push Notification is not supported");
|
|
33
|
+
this.name = "PushNotificationNotSupportedError";
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
var UnsupportedOperationError = class extends Error {
|
|
37
|
+
constructor(message) {
|
|
38
|
+
super(message ?? "This operation is not supported");
|
|
39
|
+
this.name = "UnsupportedOperationError";
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
var ContentTypeNotSupportedError = class extends Error {
|
|
43
|
+
constructor(message) {
|
|
44
|
+
super(message ?? "Incompatible content types");
|
|
45
|
+
this.name = "ContentTypeNotSupportedError";
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
var InvalidAgentResponseError = class extends Error {
|
|
49
|
+
constructor(message) {
|
|
50
|
+
super(message ?? "Invalid agent response type");
|
|
51
|
+
this.name = "InvalidAgentResponseError";
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
var AuthenticatedExtendedCardNotConfiguredError = class extends Error {
|
|
55
|
+
constructor(message) {
|
|
56
|
+
super(message ?? "Authenticated Extended Card not configured");
|
|
57
|
+
this.name = "AuthenticatedExtendedCardNotConfiguredError";
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
async function* parseSseStream(response) {
|
|
61
|
+
if (!response.body) {
|
|
62
|
+
throw new Error("SSE response body is undefined. Cannot read stream.");
|
|
63
|
+
}
|
|
64
|
+
let buffer = "";
|
|
65
|
+
let eventType = "message";
|
|
66
|
+
let eventData = "";
|
|
67
|
+
for await (const value of response.body.pipeThrough(new TextDecoderStream())) {
|
|
68
|
+
buffer += value;
|
|
69
|
+
let lineEndIndex;
|
|
70
|
+
while ((lineEndIndex = buffer.indexOf("\n")) >= 0) {
|
|
71
|
+
const line = buffer.substring(0, lineEndIndex).trim();
|
|
72
|
+
buffer = buffer.substring(lineEndIndex + 1);
|
|
73
|
+
if (line === "") {
|
|
74
|
+
if (eventData) {
|
|
75
|
+
yield { type: eventType, data: eventData };
|
|
76
|
+
eventData = "";
|
|
77
|
+
eventType = "message";
|
|
78
|
+
}
|
|
79
|
+
} else if (line.startsWith("event:")) {
|
|
80
|
+
eventType = line.substring("event:".length).trim();
|
|
81
|
+
} else if (line.startsWith("data:")) {
|
|
82
|
+
eventData = line.substring("data:".length).trim();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
if (eventData) {
|
|
87
|
+
yield { type: eventType, data: eventData };
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
exports.A2A_ERROR_CODE = A2A_ERROR_CODE;
|
|
92
|
+
exports.AuthenticatedExtendedCardNotConfiguredError = AuthenticatedExtendedCardNotConfiguredError;
|
|
93
|
+
exports.ContentTypeNotSupportedError = ContentTypeNotSupportedError;
|
|
94
|
+
exports.InvalidAgentResponseError = InvalidAgentResponseError;
|
|
95
|
+
exports.PushNotificationNotSupportedError = PushNotificationNotSupportedError;
|
|
96
|
+
exports.TaskNotCancelableError = TaskNotCancelableError;
|
|
97
|
+
exports.TaskNotFoundError = TaskNotFoundError;
|
|
98
|
+
exports.UnsupportedOperationError = UnsupportedOperationError;
|
|
99
|
+
exports.parseSseStream = parseSseStream;
|
|
100
|
+
//# sourceMappingURL=chunk-SJNAG4AL.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-SJNAG4AL.cjs","sources":["../../../../../../../../../../node_modules/.pnpm/@a2a-js+sdk@0.3.7_express@5.1.0/node_modules/@a2a-js/sdk/dist/chunk-SJNAG4AL.js"],"sourcesContent":["// src/errors.ts\nvar A2A_ERROR_CODE = {\n PARSE_ERROR: -32700,\n INVALID_REQUEST: -32600,\n METHOD_NOT_FOUND: -32601,\n INVALID_PARAMS: -32602,\n INTERNAL_ERROR: -32603,\n TASK_NOT_FOUND: -32001,\n TASK_NOT_CANCELABLE: -32002,\n PUSH_NOTIFICATION_NOT_SUPPORTED: -32003,\n UNSUPPORTED_OPERATION: -32004,\n CONTENT_TYPE_NOT_SUPPORTED: -32005,\n INVALID_AGENT_RESPONSE: -32006,\n AUTHENTICATED_EXTENDED_CARD_NOT_CONFIGURED: -32007\n};\nvar TaskNotFoundError = class extends Error {\n constructor(message) {\n super(message ?? \"Task not found\");\n this.name = \"TaskNotFoundError\";\n }\n};\nvar TaskNotCancelableError = class extends Error {\n constructor(message) {\n super(message ?? \"Task cannot be canceled\");\n this.name = \"TaskNotCancelableError\";\n }\n};\nvar PushNotificationNotSupportedError = class extends Error {\n constructor(message) {\n super(message ?? \"Push Notification is not supported\");\n this.name = \"PushNotificationNotSupportedError\";\n }\n};\nvar UnsupportedOperationError = class extends Error {\n constructor(message) {\n super(message ?? \"This operation is not supported\");\n this.name = \"UnsupportedOperationError\";\n }\n};\nvar ContentTypeNotSupportedError = class extends Error {\n constructor(message) {\n super(message ?? \"Incompatible content types\");\n this.name = \"ContentTypeNotSupportedError\";\n }\n};\nvar InvalidAgentResponseError = class extends Error {\n constructor(message) {\n super(message ?? \"Invalid agent response type\");\n this.name = \"InvalidAgentResponseError\";\n }\n};\nvar AuthenticatedExtendedCardNotConfiguredError = class extends Error {\n constructor(message) {\n super(message ?? \"Authenticated Extended Card not configured\");\n this.name = \"AuthenticatedExtendedCardNotConfiguredError\";\n }\n};\n\n// src/sse_utils.ts\nvar SSE_HEADERS = {\n \"Content-Type\": \"text/event-stream\",\n \"Cache-Control\": \"no-cache\",\n Connection: \"keep-alive\",\n \"X-Accel-Buffering\": \"no\"\n // Disable buffering in nginx\n};\nfunction formatSSEEvent(event) {\n return `data: ${JSON.stringify(event)}\n\n`;\n}\nfunction formatSSEErrorEvent(error) {\n return `event: error\ndata: ${JSON.stringify(error)}\n\n`;\n}\nasync function* parseSseStream(response) {\n if (!response.body) {\n throw new Error(\"SSE response body is undefined. Cannot read stream.\");\n }\n let buffer = \"\";\n let eventType = \"message\";\n let eventData = \"\";\n for await (const value of response.body.pipeThrough(new TextDecoderStream())) {\n buffer += value;\n let lineEndIndex;\n while ((lineEndIndex = buffer.indexOf(\"\\n\")) >= 0) {\n const line = buffer.substring(0, lineEndIndex).trim();\n buffer = buffer.substring(lineEndIndex + 1);\n if (line === \"\") {\n if (eventData) {\n yield { type: eventType, data: eventData };\n eventData = \"\";\n eventType = \"message\";\n }\n } else if (line.startsWith(\"event:\")) {\n eventType = line.substring(\"event:\".length).trim();\n } else if (line.startsWith(\"data:\")) {\n eventData = line.substring(\"data:\".length).trim();\n }\n }\n }\n if (eventData) {\n yield { type: eventType, data: eventData };\n }\n}\n\nexport {\n A2A_ERROR_CODE,\n TaskNotFoundError,\n TaskNotCancelableError,\n PushNotificationNotSupportedError,\n UnsupportedOperationError,\n ContentTypeNotSupportedError,\n InvalidAgentResponseError,\n AuthenticatedExtendedCardNotConfiguredError,\n SSE_HEADERS,\n formatSSEEvent,\n formatSSEErrorEvent,\n parseSseStream\n};\n"],"names":[],"mappings":";;AAAA;AACG,IAAC,cAAc,GAAG;AACrB,EAAE,WAAW,EAAE,CAAC,KAAK;AACrB,EAAE,eAAe,EAAE,CAAC,KAAK;AACzB,EAAE,gBAAgB,EAAE,CAAC,KAAK;AAC1B,EAAE,cAAc,EAAE,CAAC,KAAK;AACxB,EAAE,cAAc,EAAE,CAAC,KAAK;AACxB,EAAE,cAAc,EAAE,CAAC,KAAK;AACxB,EAAE,mBAAmB,EAAE,CAAC,KAAK;AAC7B,EAAE,+BAA+B,EAAE,CAAC,KAAK;AACzC,EAAE,qBAAqB,EAAE,CAAC,KAAK;AAC/B,EAAE,0BAA0B,EAAE,CAAC,KAAK;AACpC,EAAE,sBAAsB,EAAE,CAAC,KAAK;AAChC,EAAE,0CAA0C,EAAE,CAAC,KAAK;AACpD,EAAE;AACC,IAAC,iBAAiB,GAAG,cAAc,KAAK,CAAC;AAC5C,EAAE,WAAW,CAAC,OAAO,EAAE;AACvB,IAAI,KAAK,CAAC,OAAO,IAAI,gBAAgB,CAAC,CAAC;AACvC,IAAI,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;AACpC,GAAG;AACH,EAAE;AACC,IAAC,sBAAsB,GAAG,cAAc,KAAK,CAAC;AACjD,EAAE,WAAW,CAAC,OAAO,EAAE;AACvB,IAAI,KAAK,CAAC,OAAO,IAAI,yBAAyB,CAAC,CAAC;AAChD,IAAI,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAC;AACzC,GAAG;AACH,E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AAE,IAAI,EAAE,SAAS,EAAE,CAAC;AAC/C,GAAG;AACH;;;;;;;;;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
// src/errors.ts
|
|
2
|
+
var A2A_ERROR_CODE = {
|
|
3
|
+
PARSE_ERROR: -32700,
|
|
4
|
+
INVALID_REQUEST: -32600,
|
|
5
|
+
METHOD_NOT_FOUND: -32601,
|
|
6
|
+
INVALID_PARAMS: -32602,
|
|
7
|
+
INTERNAL_ERROR: -32603,
|
|
8
|
+
TASK_NOT_FOUND: -32001,
|
|
9
|
+
TASK_NOT_CANCELABLE: -32002,
|
|
10
|
+
PUSH_NOTIFICATION_NOT_SUPPORTED: -32003,
|
|
11
|
+
UNSUPPORTED_OPERATION: -32004,
|
|
12
|
+
CONTENT_TYPE_NOT_SUPPORTED: -32005,
|
|
13
|
+
INVALID_AGENT_RESPONSE: -32006,
|
|
14
|
+
AUTHENTICATED_EXTENDED_CARD_NOT_CONFIGURED: -32007
|
|
15
|
+
};
|
|
16
|
+
var TaskNotFoundError = class extends Error {
|
|
17
|
+
constructor(message) {
|
|
18
|
+
super(message ?? "Task not found");
|
|
19
|
+
this.name = "TaskNotFoundError";
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
var TaskNotCancelableError = class extends Error {
|
|
23
|
+
constructor(message) {
|
|
24
|
+
super(message ?? "Task cannot be canceled");
|
|
25
|
+
this.name = "TaskNotCancelableError";
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
var PushNotificationNotSupportedError = class extends Error {
|
|
29
|
+
constructor(message) {
|
|
30
|
+
super(message ?? "Push Notification is not supported");
|
|
31
|
+
this.name = "PushNotificationNotSupportedError";
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
var UnsupportedOperationError = class extends Error {
|
|
35
|
+
constructor(message) {
|
|
36
|
+
super(message ?? "This operation is not supported");
|
|
37
|
+
this.name = "UnsupportedOperationError";
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
var ContentTypeNotSupportedError = class extends Error {
|
|
41
|
+
constructor(message) {
|
|
42
|
+
super(message ?? "Incompatible content types");
|
|
43
|
+
this.name = "ContentTypeNotSupportedError";
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
var InvalidAgentResponseError = class extends Error {
|
|
47
|
+
constructor(message) {
|
|
48
|
+
super(message ?? "Invalid agent response type");
|
|
49
|
+
this.name = "InvalidAgentResponseError";
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
var AuthenticatedExtendedCardNotConfiguredError = class extends Error {
|
|
53
|
+
constructor(message) {
|
|
54
|
+
super(message ?? "Authenticated Extended Card not configured");
|
|
55
|
+
this.name = "AuthenticatedExtendedCardNotConfiguredError";
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
async function* parseSseStream(response) {
|
|
59
|
+
if (!response.body) {
|
|
60
|
+
throw new Error("SSE response body is undefined. Cannot read stream.");
|
|
61
|
+
}
|
|
62
|
+
let buffer = "";
|
|
63
|
+
let eventType = "message";
|
|
64
|
+
let eventData = "";
|
|
65
|
+
for await (const value of response.body.pipeThrough(new TextDecoderStream())) {
|
|
66
|
+
buffer += value;
|
|
67
|
+
let lineEndIndex;
|
|
68
|
+
while ((lineEndIndex = buffer.indexOf("\n")) >= 0) {
|
|
69
|
+
const line = buffer.substring(0, lineEndIndex).trim();
|
|
70
|
+
buffer = buffer.substring(lineEndIndex + 1);
|
|
71
|
+
if (line === "") {
|
|
72
|
+
if (eventData) {
|
|
73
|
+
yield { type: eventType, data: eventData };
|
|
74
|
+
eventData = "";
|
|
75
|
+
eventType = "message";
|
|
76
|
+
}
|
|
77
|
+
} else if (line.startsWith("event:")) {
|
|
78
|
+
eventType = line.substring("event:".length).trim();
|
|
79
|
+
} else if (line.startsWith("data:")) {
|
|
80
|
+
eventData = line.substring("data:".length).trim();
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
if (eventData) {
|
|
85
|
+
yield { type: eventType, data: eventData };
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export { A2A_ERROR_CODE, AuthenticatedExtendedCardNotConfiguredError, ContentTypeNotSupportedError, InvalidAgentResponseError, PushNotificationNotSupportedError, TaskNotCancelableError, TaskNotFoundError, UnsupportedOperationError, parseSseStream };
|
|
90
|
+
//# sourceMappingURL=chunk-SJNAG4AL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-SJNAG4AL.js","sources":["../../../../../../../../../../node_modules/.pnpm/@a2a-js+sdk@0.3.7_express@5.1.0/node_modules/@a2a-js/sdk/dist/chunk-SJNAG4AL.js"],"sourcesContent":["// src/errors.ts\nvar A2A_ERROR_CODE = {\n PARSE_ERROR: -32700,\n INVALID_REQUEST: -32600,\n METHOD_NOT_FOUND: -32601,\n INVALID_PARAMS: -32602,\n INTERNAL_ERROR: -32603,\n TASK_NOT_FOUND: -32001,\n TASK_NOT_CANCELABLE: -32002,\n PUSH_NOTIFICATION_NOT_SUPPORTED: -32003,\n UNSUPPORTED_OPERATION: -32004,\n CONTENT_TYPE_NOT_SUPPORTED: -32005,\n INVALID_AGENT_RESPONSE: -32006,\n AUTHENTICATED_EXTENDED_CARD_NOT_CONFIGURED: -32007\n};\nvar TaskNotFoundError = class extends Error {\n constructor(message) {\n super(message ?? \"Task not found\");\n this.name = \"TaskNotFoundError\";\n }\n};\nvar TaskNotCancelableError = class extends Error {\n constructor(message) {\n super(message ?? \"Task cannot be canceled\");\n this.name = \"TaskNotCancelableError\";\n }\n};\nvar PushNotificationNotSupportedError = class extends Error {\n constructor(message) {\n super(message ?? \"Push Notification is not supported\");\n this.name = \"PushNotificationNotSupportedError\";\n }\n};\nvar UnsupportedOperationError = class extends Error {\n constructor(message) {\n super(message ?? \"This operation is not supported\");\n this.name = \"UnsupportedOperationError\";\n }\n};\nvar ContentTypeNotSupportedError = class extends Error {\n constructor(message) {\n super(message ?? \"Incompatible content types\");\n this.name = \"ContentTypeNotSupportedError\";\n }\n};\nvar InvalidAgentResponseError = class extends Error {\n constructor(message) {\n super(message ?? \"Invalid agent response type\");\n this.name = \"InvalidAgentResponseError\";\n }\n};\nvar AuthenticatedExtendedCardNotConfiguredError = class extends Error {\n constructor(message) {\n super(message ?? \"Authenticated Extended Card not configured\");\n this.name = \"AuthenticatedExtendedCardNotConfiguredError\";\n }\n};\n\n// src/sse_utils.ts\nvar SSE_HEADERS = {\n \"Content-Type\": \"text/event-stream\",\n \"Cache-Control\": \"no-cache\",\n Connection: \"keep-alive\",\n \"X-Accel-Buffering\": \"no\"\n // Disable buffering in nginx\n};\nfunction formatSSEEvent(event) {\n return `data: ${JSON.stringify(event)}\n\n`;\n}\nfunction formatSSEErrorEvent(error) {\n return `event: error\ndata: ${JSON.stringify(error)}\n\n`;\n}\nasync function* parseSseStream(response) {\n if (!response.body) {\n throw new Error(\"SSE response body is undefined. Cannot read stream.\");\n }\n let buffer = \"\";\n let eventType = \"message\";\n let eventData = \"\";\n for await (const value of response.body.pipeThrough(new TextDecoderStream())) {\n buffer += value;\n let lineEndIndex;\n while ((lineEndIndex = buffer.indexOf(\"\\n\")) >= 0) {\n const line = buffer.substring(0, lineEndIndex).trim();\n buffer = buffer.substring(lineEndIndex + 1);\n if (line === \"\") {\n if (eventData) {\n yield { type: eventType, data: eventData };\n eventData = \"\";\n eventType = \"message\";\n }\n } else if (line.startsWith(\"event:\")) {\n eventType = line.substring(\"event:\".length).trim();\n } else if (line.startsWith(\"data:\")) {\n eventData = line.substring(\"data:\".length).trim();\n }\n }\n }\n if (eventData) {\n yield { type: eventType, data: eventData };\n }\n}\n\nexport {\n A2A_ERROR_CODE,\n TaskNotFoundError,\n TaskNotCancelableError,\n PushNotificationNotSupportedError,\n UnsupportedOperationError,\n ContentTypeNotSupportedError,\n InvalidAgentResponseError,\n AuthenticatedExtendedCardNotConfiguredError,\n SSE_HEADERS,\n formatSSEEvent,\n formatSSEErrorEvent,\n par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