@assistant-ui/react-a2a 0.2.5 → 0.2.7
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/README.md +47 -1
- package/dist/A2AClient.d.ts +43 -0
- package/dist/A2AClient.d.ts.map +1 -0
- package/dist/A2AClient.js +358 -0
- package/dist/A2AClient.js.map +1 -0
- package/dist/A2AThreadRuntimeCore.d.ts +75 -0
- package/dist/A2AThreadRuntimeCore.d.ts.map +1 -0
- package/dist/A2AThreadRuntimeCore.js +483 -0
- package/dist/A2AThreadRuntimeCore.js.map +1 -0
- package/dist/conversions.d.ts +14 -0
- package/dist/conversions.d.ts.map +1 -0
- package/dist/conversions.js +92 -0
- package/dist/conversions.js.map +1 -0
- package/dist/index.d.ts +7 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -6
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +228 -84
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +4 -9
- package/dist/types.js.map +1 -1
- package/dist/useA2ARuntime.d.ts +35 -48
- package/dist/useA2ARuntime.d.ts.map +1 -1
- package/dist/useA2ARuntime.js +126 -172
- package/dist/useA2ARuntime.js.map +1 -1
- package/package.json +9 -9
- package/src/A2AClient.test.ts +773 -0
- package/src/A2AClient.ts +519 -0
- package/src/A2AThreadRuntimeCore.test.ts +692 -0
- package/src/A2AThreadRuntimeCore.ts +633 -0
- package/src/conversions.test.ts +276 -0
- package/src/conversions.ts +115 -0
- package/src/index.ts +66 -6
- package/src/types.ts +276 -95
- package/src/useA2ARuntime.ts +204 -296
- package/dist/A2AMessageAccumulator.d.ts +0 -16
- package/dist/A2AMessageAccumulator.d.ts.map +0 -1
- package/dist/A2AMessageAccumulator.js +0 -29
- package/dist/A2AMessageAccumulator.js.map +0 -1
- package/dist/appendA2AChunk.d.ts +0 -3
- package/dist/appendA2AChunk.d.ts.map +0 -1
- package/dist/appendA2AChunk.js +0 -110
- package/dist/appendA2AChunk.js.map +0 -1
- package/dist/convertA2AMessages.d.ts +0 -64
- package/dist/convertA2AMessages.d.ts.map +0 -1
- package/dist/convertA2AMessages.js +0 -90
- package/dist/convertA2AMessages.js.map +0 -1
- package/dist/testUtils.d.ts +0 -4
- package/dist/testUtils.d.ts.map +0 -1
- package/dist/testUtils.js +0 -6
- package/dist/testUtils.js.map +0 -1
- package/dist/useA2AMessages.d.ts +0 -25
- package/dist/useA2AMessages.d.ts.map +0 -1
- package/dist/useA2AMessages.js +0 -122
- package/dist/useA2AMessages.js.map +0 -1
- package/src/A2AMessageAccumulator.ts +0 -48
- package/src/appendA2AChunk.ts +0 -121
- package/src/convertA2AMessages.ts +0 -108
- package/src/testUtils.ts +0 -11
- package/src/useA2AMessages.ts +0 -180
package/dist/useA2ARuntime.js
CHANGED
|
@@ -1,188 +1,142 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
pendingToolCalls.set(toolCall.id, toolCall);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
if (message.role === "tool") {
|
|
15
|
-
pendingToolCalls.delete(message.tool_call_id);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
return [...pendingToolCalls.values()];
|
|
19
|
-
};
|
|
20
|
-
const getMessageContent = (msg) => {
|
|
21
|
-
const allContent = [
|
|
22
|
-
...msg.content,
|
|
23
|
-
...(msg.attachments?.flatMap((a) => a.content) ?? []),
|
|
24
|
-
];
|
|
25
|
-
const content = allContent.map((part) => {
|
|
26
|
-
const type = part.type;
|
|
27
|
-
switch (type) {
|
|
28
|
-
case "text":
|
|
29
|
-
return { type: "text", text: part.text };
|
|
30
|
-
case "image":
|
|
31
|
-
return { type: "image_url", image_url: { url: part.image } };
|
|
32
|
-
case "tool-call":
|
|
33
|
-
throw new Error("Tool call appends are not supported.");
|
|
34
|
-
default:
|
|
35
|
-
const _exhaustiveCheck = type;
|
|
36
|
-
throw new Error(`Unsupported append message part type: ${_exhaustiveCheck}`);
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
if (content.length === 1 && content[0]?.type === "text") {
|
|
40
|
-
return content[0].text ?? "";
|
|
41
|
-
}
|
|
42
|
-
return content;
|
|
43
|
-
};
|
|
44
|
-
const symbolA2ARuntimeExtras = Symbol("a2a-runtime-extras");
|
|
45
|
-
const asA2ARuntimeExtras = (extras) => {
|
|
1
|
+
/// <reference types="@assistant-ui/core/store" />
|
|
2
|
+
"use client";
|
|
3
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
4
|
+
import { useExternalStoreRuntime, useRuntimeAdapters, } from "@assistant-ui/core/react";
|
|
5
|
+
import { useAuiState } from "@assistant-ui/store";
|
|
6
|
+
import { A2AClient } from "./A2AClient.js";
|
|
7
|
+
import { A2AThreadRuntimeCore } from "./A2AThreadRuntimeCore.js";
|
|
8
|
+
// --- Extras symbol for A2A-specific state ---
|
|
9
|
+
const symbolA2AExtras = Symbol("a2a-extras");
|
|
10
|
+
const asA2AExtras = (extras) => {
|
|
46
11
|
if (typeof extras !== "object" ||
|
|
47
12
|
extras == null ||
|
|
48
|
-
!(
|
|
49
|
-
throw new Error("This
|
|
13
|
+
!(symbolA2AExtras in extras))
|
|
14
|
+
throw new Error("This hook can only be used inside a useA2ARuntime provider");
|
|
50
15
|
return extras;
|
|
51
16
|
};
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
return
|
|
17
|
+
// --- Public hooks for A2A state ---
|
|
18
|
+
export const useA2ATask = () => {
|
|
19
|
+
return useAuiState((s) => asA2AExtras(s.thread.extras).task);
|
|
55
20
|
};
|
|
56
21
|
export const useA2AArtifacts = () => {
|
|
57
|
-
|
|
58
|
-
return artifacts;
|
|
22
|
+
return useAuiState((s) => asA2AExtras(s.thread.extras).artifacts);
|
|
59
23
|
};
|
|
60
|
-
export const
|
|
61
|
-
|
|
62
|
-
return send;
|
|
24
|
+
export const useA2AAgentCard = () => {
|
|
25
|
+
return useAuiState((s) => asA2AExtras(s.thread.extras).agentCard);
|
|
63
26
|
};
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
27
|
+
// --- Main hook ---
|
|
28
|
+
export function useA2ARuntime(options) {
|
|
29
|
+
const [_version, setVersion] = useState(0);
|
|
30
|
+
const notifyUpdate = useCallback(() => setVersion((v) => v + 1), []);
|
|
31
|
+
const runtimeAdapters = useRuntimeAdapters();
|
|
32
|
+
const historyAdapter = options.adapters?.history ?? runtimeAdapters?.history;
|
|
33
|
+
const threadListAdapter = options.adapters?.threadList;
|
|
34
|
+
// Create or reuse client
|
|
35
|
+
const clientRef = useRef(null);
|
|
36
|
+
if (!clientRef.current) {
|
|
37
|
+
if (options.client) {
|
|
38
|
+
clientRef.current = options.client;
|
|
75
39
|
}
|
|
76
|
-
|
|
77
|
-
|
|
40
|
+
else if (options.baseUrl) {
|
|
41
|
+
clientRef.current = new A2AClient({
|
|
42
|
+
baseUrl: options.baseUrl,
|
|
43
|
+
headers: options.headers,
|
|
44
|
+
});
|
|
78
45
|
}
|
|
79
|
-
|
|
80
|
-
|
|
46
|
+
else {
|
|
47
|
+
throw new Error("useA2ARuntime requires either `client` or `baseUrl`");
|
|
81
48
|
}
|
|
82
|
-
}
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
49
|
+
}
|
|
50
|
+
const client = clientRef.current;
|
|
51
|
+
// Create or reuse core
|
|
52
|
+
const coreRef = useRef(null);
|
|
53
|
+
if (!coreRef.current) {
|
|
54
|
+
coreRef.current = new A2AThreadRuntimeCore({
|
|
55
|
+
client,
|
|
56
|
+
contextId: options.contextId,
|
|
57
|
+
configuration: options.configuration,
|
|
58
|
+
...(options.onError && { onError: options.onError }),
|
|
59
|
+
...(options.onCancel && { onCancel: options.onCancel }),
|
|
60
|
+
...(options.onArtifactComplete && {
|
|
61
|
+
onArtifactComplete: options.onArtifactComplete,
|
|
62
|
+
}),
|
|
63
|
+
...(historyAdapter && { history: historyAdapter }),
|
|
64
|
+
notifyUpdate,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
const core = coreRef.current;
|
|
68
|
+
core.updateOptions({
|
|
69
|
+
client,
|
|
70
|
+
contextId: options.contextId,
|
|
71
|
+
configuration: options.configuration,
|
|
72
|
+
...(options.onError && { onError: options.onError }),
|
|
73
|
+
...(options.onCancel && { onCancel: options.onCancel }),
|
|
74
|
+
...(options.onArtifactComplete && {
|
|
75
|
+
onArtifactComplete: options.onArtifactComplete,
|
|
76
|
+
}),
|
|
77
|
+
...(historyAdapter && { history: historyAdapter }),
|
|
87
78
|
});
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
79
|
+
// Thread list
|
|
80
|
+
const threadList = useMemo(() => {
|
|
81
|
+
if (!threadListAdapter)
|
|
82
|
+
return undefined;
|
|
83
|
+
const { onSwitchToNewThread, onSwitchToThread } = threadListAdapter;
|
|
84
|
+
return {
|
|
85
|
+
threadId: threadListAdapter.threadId,
|
|
86
|
+
onSwitchToNewThread: onSwitchToNewThread
|
|
87
|
+
? async () => {
|
|
88
|
+
await onSwitchToNewThread();
|
|
89
|
+
core.applyExternalMessages([]);
|
|
90
|
+
}
|
|
91
|
+
: undefined,
|
|
92
|
+
onSwitchToThread: onSwitchToThread
|
|
93
|
+
? async (threadId) => {
|
|
94
|
+
const result = await onSwitchToThread(threadId);
|
|
95
|
+
core.applyExternalMessages(result.messages);
|
|
96
|
+
}
|
|
97
|
+
: undefined,
|
|
96
98
|
};
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
99
|
+
}, [threadListAdapter, core]);
|
|
100
|
+
// Adapters
|
|
101
|
+
const adapters = options.adapters;
|
|
102
|
+
const adapterAdapters = useMemo(() => ({
|
|
103
|
+
attachments: adapters?.attachments ?? runtimeAdapters?.attachments,
|
|
104
|
+
speech: adapters?.speech,
|
|
105
|
+
feedback: adapters?.feedback,
|
|
106
|
+
threadList,
|
|
107
|
+
}), [adapters, runtimeAdapters, threadList]);
|
|
108
|
+
// Build store adapter
|
|
109
|
+
const store = useMemo(() => {
|
|
110
|
+
void _version;
|
|
111
|
+
return {
|
|
112
|
+
isLoading: core.isLoading,
|
|
113
|
+
messages: core.getMessages(),
|
|
114
|
+
isRunning: core.isRunning(),
|
|
115
|
+
extras: {
|
|
116
|
+
[symbolA2AExtras]: true,
|
|
117
|
+
task: core.getTask(),
|
|
118
|
+
artifacts: core.getArtifacts(),
|
|
119
|
+
agentCard: core.getAgentCard(),
|
|
105
120
|
},
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
121
|
+
onNew: (message) => core.append(message),
|
|
122
|
+
onEdit: (message) => core.edit(message),
|
|
123
|
+
onReload: (parentId) => core.reload(parentId),
|
|
124
|
+
onCancel: () => core.cancel(),
|
|
125
|
+
setMessages: (messages) => core.applyExternalMessages(messages),
|
|
126
|
+
onImport: (messages) => core.applyExternalMessages(messages),
|
|
127
|
+
adapters: adapterAdapters,
|
|
128
|
+
};
|
|
129
|
+
}, [adapterAdapters, core, _version]);
|
|
130
|
+
const runtime = useExternalStoreRuntime(store);
|
|
110
131
|
useEffect(() => {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
return useExternalStoreRuntime({
|
|
122
|
-
isRunning,
|
|
123
|
-
messages: threadMessages,
|
|
124
|
-
adapters: {
|
|
125
|
-
attachments,
|
|
126
|
-
feedback,
|
|
127
|
-
speech,
|
|
128
|
-
threadList,
|
|
129
|
-
},
|
|
130
|
-
extras: {
|
|
131
|
-
[symbolA2ARuntimeExtras]: true,
|
|
132
|
-
taskState,
|
|
133
|
-
artifacts,
|
|
134
|
-
send: handleSendMessage,
|
|
135
|
-
},
|
|
136
|
-
onNew: (msg) => {
|
|
137
|
-
const cancellations = autoCancelPendingToolCalls !== false
|
|
138
|
-
? getPendingToolCalls(messages).map((t) => ({
|
|
139
|
-
role: "tool",
|
|
140
|
-
tool_call_id: t.id,
|
|
141
|
-
content: JSON.stringify({ cancelled: true }),
|
|
142
|
-
status: {
|
|
143
|
-
type: "incomplete",
|
|
144
|
-
reason: "cancelled",
|
|
145
|
-
},
|
|
146
|
-
}))
|
|
147
|
-
: [];
|
|
148
|
-
const config = {};
|
|
149
|
-
if (contextId !== undefined)
|
|
150
|
-
config.contextId = contextId;
|
|
151
|
-
if (msg.runConfig !== undefined)
|
|
152
|
-
config.runConfig = msg.runConfig;
|
|
153
|
-
return handleSendMessage([
|
|
154
|
-
...cancellations,
|
|
155
|
-
{
|
|
156
|
-
role: "user",
|
|
157
|
-
content: getMessageContent(msg),
|
|
158
|
-
},
|
|
159
|
-
], config);
|
|
160
|
-
},
|
|
161
|
-
onAddToolResult: async ({ toolCallId, toolName: _toolName, result, isError, artifact, }) => {
|
|
162
|
-
// TODO parallel human in the loop calls
|
|
163
|
-
const message = {
|
|
164
|
-
role: "tool",
|
|
165
|
-
tool_call_id: toolCallId,
|
|
166
|
-
content: JSON.stringify(result),
|
|
167
|
-
status: isError
|
|
168
|
-
? { type: "incomplete", reason: "error" }
|
|
169
|
-
: { type: "complete", reason: "stop" },
|
|
170
|
-
};
|
|
171
|
-
if (artifact) {
|
|
172
|
-
message.artifacts = [artifact];
|
|
173
|
-
}
|
|
174
|
-
const config = {};
|
|
175
|
-
if (contextId !== undefined)
|
|
176
|
-
config.contextId = contextId;
|
|
177
|
-
await handleSendMessage([message],
|
|
178
|
-
// TODO reuse runconfig here!
|
|
179
|
-
config);
|
|
180
|
-
},
|
|
181
|
-
onCancel: unstable_allowCancellation
|
|
182
|
-
? async () => {
|
|
183
|
-
cancel();
|
|
184
|
-
}
|
|
185
|
-
: undefined,
|
|
186
|
-
});
|
|
187
|
-
};
|
|
132
|
+
core.attachRuntime(runtime);
|
|
133
|
+
return () => {
|
|
134
|
+
core.detachRuntime();
|
|
135
|
+
};
|
|
136
|
+
}, [core, runtime]);
|
|
137
|
+
useEffect(() => {
|
|
138
|
+
core.__internal_load();
|
|
139
|
+
}, [core]);
|
|
140
|
+
return runtime;
|
|
141
|
+
}
|
|
188
142
|
//# sourceMappingURL=useA2ARuntime.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useA2ARuntime.js","sourceRoot":"","sources":["../src/useA2ARuntime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useA2ARuntime.js","sourceRoot":"","sources":["../src/useA2ARuntime.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC1E,OAAO,EACL,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,0BAA0B,CAAC;AAWlC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,uBAAoB;AAExC,OAAO,EAAE,oBAAoB,EAAE,kCAA+B;AAQ9D,+CAA+C;AAE/C,MAAM,eAAe,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;AAS7C,MAAM,WAAW,GAAG,CAAC,MAAe,EAAa,EAAE;IACjD,IACE,OAAO,MAAM,KAAK,QAAQ;QAC1B,MAAM,IAAI,IAAI;QACd,CAAC,CAAC,eAAe,I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E,eAAe;SACoB,CAAC;IAClD,CAAC,EAAE,CAAC,eAAe,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;IAEtC,MAAM,OAAO,GAAG,uBAAuB,CAAC,KAAK,CAAC,CAAC;IAE/C,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QAC5B,OAAO,GAAG,EAAE;YACV,IAAI,CAAC,aAAa,EAAE,CAAC;QACvB,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;IAEpB,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,eAAe,EAAE,CAAC;IACzB,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAEX,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@assistant-ui/react-a2a",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "A2A protocol adapter for assistant-ui",
|
|
3
|
+
"version": "0.2.7",
|
|
4
|
+
"description": "A2A (Agent-to-Agent) v1.0 protocol adapter for assistant-ui",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"a2a",
|
|
7
7
|
"agent-to-agent",
|
|
@@ -30,11 +30,10 @@
|
|
|
30
30
|
],
|
|
31
31
|
"sideEffects": false,
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"assistant-
|
|
34
|
-
"
|
|
33
|
+
"@assistant-ui/core": "^0.1.7",
|
|
34
|
+
"@assistant-ui/store": "^0.2.3"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@assistant-ui/react": "^0.12.12",
|
|
38
37
|
"@types/react": "*",
|
|
39
38
|
"react": "^18 || ^19"
|
|
40
39
|
},
|
|
@@ -45,10 +44,9 @@
|
|
|
45
44
|
},
|
|
46
45
|
"devDependencies": {
|
|
47
46
|
"@types/react": "^19.2.14",
|
|
48
|
-
"@types/uuid": "^11.0.0",
|
|
49
47
|
"react": "^19.2.4",
|
|
50
|
-
"
|
|
51
|
-
"@assistant-ui/x-buildutils": "0.0.
|
|
48
|
+
"vitest": "^4.1.0",
|
|
49
|
+
"@assistant-ui/x-buildutils": "0.0.3"
|
|
52
50
|
},
|
|
53
51
|
"publishConfig": {
|
|
54
52
|
"access": "public",
|
|
@@ -64,6 +62,8 @@
|
|
|
64
62
|
"url": "https://github.com/assistant-ui/assistant-ui/issues"
|
|
65
63
|
},
|
|
66
64
|
"scripts": {
|
|
67
|
-
"build": "aui-build"
|
|
65
|
+
"build": "aui-build",
|
|
66
|
+
"test": "vitest run",
|
|
67
|
+
"test:watch": "vitest"
|
|
68
68
|
}
|
|
69
69
|
}
|