@cogitator-ai/a2a 0.2.0 → 0.3.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/README.md +348 -0
- package/dist/agent-card.d.ts +10 -0
- package/dist/agent-card.d.ts.map +1 -1
- package/dist/agent-card.js +18 -0
- package/dist/agent-card.js.map +1 -1
- package/dist/client.d.ts +9 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +38 -4
- package/dist/client.js.map +1 -1
- package/dist/errors.d.ts +2 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +14 -0
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +7 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/push-notifications.d.ts +15 -0
- package/dist/push-notifications.d.ts.map +1 -0
- package/dist/push-notifications.js +58 -0
- package/dist/push-notifications.js.map +1 -0
- package/dist/redis-task-store.d.ts +25 -0
- package/dist/redis-task-store.d.ts.map +1 -0
- package/dist/redis-task-store.js +70 -0
- package/dist/redis-task-store.js.map +1 -0
- package/dist/server.d.ts +10 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +123 -13
- package/dist/server.js.map +1 -1
- package/dist/task-manager.d.ts +4 -1
- package/dist/task-manager.d.ts.map +1 -1
- package/dist/task-manager.js +26 -0
- package/dist/task-manager.js.map +1 -1
- package/dist/task-store.d.ts.map +1 -1
- package/dist/task-store.js +5 -0
- package/dist/task-store.js.map +1 -1
- package/dist/types.d.ts +39 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -2
package/README.md
ADDED
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
# @cogitator-ai/a2a
|
|
2
|
+
|
|
3
|
+
Native implementation of [Google's A2A Protocol v0.3](https://a2a-protocol.org) for Cogitator. Expose agents as A2A services or connect to any A2A-compatible agent across frameworks.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @cogitator-ai/a2a
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
- **A2AServer** - Expose any Cogitator agent as an A2A-compliant service
|
|
14
|
+
- **A2AClient** - Connect to remote A2A agents with discovery and streaming
|
|
15
|
+
- **asTool() Bridge** - Wrap remote A2A agents as local Cogitator tools
|
|
16
|
+
- **Agent Card** - Auto-generate A2A Agent Cards from agent metadata
|
|
17
|
+
- **Task Management** - Full task lifecycle (working, completed, failed, canceled)
|
|
18
|
+
- **Multi-Turn Conversations** - Stateful conversations with contextId and continueTask
|
|
19
|
+
- **SSE Streaming** - Real-time streaming with token-level events
|
|
20
|
+
- **Push Notifications** - Webhook-based task event notifications
|
|
21
|
+
- **Agent Card Signing** - HMAC-SHA256 signing and verification
|
|
22
|
+
- **Extended Agent Card** - Authenticated endpoint with extra details
|
|
23
|
+
- **RedisTaskStore** - Production-grade task persistence
|
|
24
|
+
- **Framework Adapters** - Express, Hono, Fastify, Koa, Next.js
|
|
25
|
+
- **Zero Dependencies** - Own implementation from spec, no external A2A deps
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Quick Start
|
|
30
|
+
|
|
31
|
+
### Expose an Agent via A2A
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
import { Cogitator, Agent } from '@cogitator-ai/core';
|
|
35
|
+
import { A2AServer } from '@cogitator-ai/a2a';
|
|
36
|
+
import { a2aExpress } from '@cogitator-ai/a2a/express';
|
|
37
|
+
import express from 'express';
|
|
38
|
+
|
|
39
|
+
const cogitator = new Cogitator();
|
|
40
|
+
const agent = new Agent({
|
|
41
|
+
name: 'researcher',
|
|
42
|
+
description: 'Research agent',
|
|
43
|
+
model: 'openai/gpt-4o',
|
|
44
|
+
instructions: 'You are a research assistant.',
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const a2aServer = new A2AServer({
|
|
48
|
+
agents: { researcher: agent },
|
|
49
|
+
cogitator,
|
|
50
|
+
cardUrl: 'https://my-server.com',
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
const app = express();
|
|
54
|
+
app.use(a2aExpress(a2aServer));
|
|
55
|
+
app.listen(3000);
|
|
56
|
+
// Agent Card: GET /.well-known/agent.json
|
|
57
|
+
// JSON-RPC: POST /a2a
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Connect to a Remote A2A Agent
|
|
61
|
+
|
|
62
|
+
```typescript
|
|
63
|
+
import { A2AClient } from '@cogitator-ai/a2a';
|
|
64
|
+
|
|
65
|
+
const client = new A2AClient('https://remote-agent.example.com');
|
|
66
|
+
|
|
67
|
+
// Discover
|
|
68
|
+
const card = await client.agentCard();
|
|
69
|
+
console.log(card.name, card.skills);
|
|
70
|
+
|
|
71
|
+
// Send message
|
|
72
|
+
const task = await client.sendMessage({
|
|
73
|
+
role: 'user',
|
|
74
|
+
parts: [{ type: 'text', text: 'Research quantum computing' }],
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
// Stream
|
|
78
|
+
for await (const event of client.sendMessageStream({
|
|
79
|
+
role: 'user',
|
|
80
|
+
parts: [{ type: 'text', text: 'Analyze market trends' }],
|
|
81
|
+
})) {
|
|
82
|
+
console.log(event.type, event);
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Use Remote Agent as a Tool
|
|
87
|
+
|
|
88
|
+
```typescript
|
|
89
|
+
const client = new A2AClient('https://research-agent.example.com');
|
|
90
|
+
const card = await client.agentCard();
|
|
91
|
+
const remoteTool = client.asToolFromCard(card);
|
|
92
|
+
|
|
93
|
+
const orchestrator = new Agent({
|
|
94
|
+
name: 'orchestrator',
|
|
95
|
+
model: 'openai/gpt-4o',
|
|
96
|
+
instructions: 'Use the researcher for information gathering.',
|
|
97
|
+
tools: [remoteTool],
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
const result = await cogitator.run(orchestrator, {
|
|
101
|
+
input: 'Write a report on AI trends',
|
|
102
|
+
});
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Multi-Turn Conversations
|
|
106
|
+
|
|
107
|
+
Continue tasks within the same conversation context using `contextId` and `continueTask`:
|
|
108
|
+
|
|
109
|
+
```typescript
|
|
110
|
+
const client = new A2AClient('https://remote-agent.example.com');
|
|
111
|
+
|
|
112
|
+
// Start a conversation
|
|
113
|
+
const task = await client.sendMessage({
|
|
114
|
+
role: 'user',
|
|
115
|
+
parts: [{ type: 'text', text: 'Research quantum computing' }],
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
// Continue the same task with follow-up
|
|
119
|
+
const updated = await client.continueTask(task.id, 'Now compare it with classical computing');
|
|
120
|
+
|
|
121
|
+
// Both tasks share the same contextId
|
|
122
|
+
console.log(task.contextId === updated.contextId); // true
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
On the server side, multi-turn is handled automatically. When a message includes a `taskId`, the server calls `continueTask` which appends to the existing task history and re-runs the agent with full context.
|
|
126
|
+
|
|
127
|
+
## Listing Tasks
|
|
128
|
+
|
|
129
|
+
Query tasks with filtering and pagination via `tasks/list`:
|
|
130
|
+
|
|
131
|
+
```typescript
|
|
132
|
+
const client = new A2AClient('https://remote-agent.example.com');
|
|
133
|
+
|
|
134
|
+
// List all tasks
|
|
135
|
+
const tasks = await client.listTasks();
|
|
136
|
+
|
|
137
|
+
// Filter by context (conversation)
|
|
138
|
+
const conversationTasks = await client.listTasks({
|
|
139
|
+
contextId: 'ctx_abc123',
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
// Filter by state with pagination
|
|
143
|
+
const completedTasks = await client.listTasks({
|
|
144
|
+
state: 'completed',
|
|
145
|
+
limit: 10,
|
|
146
|
+
offset: 0,
|
|
147
|
+
});
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Token Streaming
|
|
151
|
+
|
|
152
|
+
SSE streaming includes token-level events alongside status and artifact updates:
|
|
153
|
+
|
|
154
|
+
```typescript
|
|
155
|
+
for await (const event of client.sendMessageStream({
|
|
156
|
+
role: 'user',
|
|
157
|
+
parts: [{ type: 'text', text: 'Write a poem' }],
|
|
158
|
+
})) {
|
|
159
|
+
switch (event.type) {
|
|
160
|
+
case 'token':
|
|
161
|
+
process.stdout.write(event.token);
|
|
162
|
+
break;
|
|
163
|
+
case 'status-update':
|
|
164
|
+
console.log(`\nStatus: ${event.status.state}`);
|
|
165
|
+
break;
|
|
166
|
+
case 'artifact-update':
|
|
167
|
+
console.log(`\nArtifact: ${event.artifact.id}`);
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
The server emits `TokenStreamEvent` for each token generated by the LLM via the `onToken` callback, giving clients real-time character-by-character output.
|
|
174
|
+
|
|
175
|
+
## RedisTaskStore
|
|
176
|
+
|
|
177
|
+
For production deployments, use `RedisTaskStore` instead of the default in-memory store:
|
|
178
|
+
|
|
179
|
+
```typescript
|
|
180
|
+
import { A2AServer, RedisTaskStore } from '@cogitator-ai/a2a';
|
|
181
|
+
import Redis from 'ioredis';
|
|
182
|
+
|
|
183
|
+
const redis = new Redis('redis://localhost:6379');
|
|
184
|
+
|
|
185
|
+
const a2aServer = new A2AServer({
|
|
186
|
+
agents: { researcher },
|
|
187
|
+
cogitator,
|
|
188
|
+
taskStore: new RedisTaskStore({
|
|
189
|
+
client: redis,
|
|
190
|
+
keyPrefix: 'a2a:task:',
|
|
191
|
+
ttl: 86400, // 24h expiry
|
|
192
|
+
}),
|
|
193
|
+
});
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
`RedisTaskStore` implements the full `TaskStore` interface including `list()` with filtering by `contextId`, `state`, pagination, and timestamp-based sorting.
|
|
197
|
+
|
|
198
|
+
## Push Notifications
|
|
199
|
+
|
|
200
|
+
Register webhooks to receive task event notifications:
|
|
201
|
+
|
|
202
|
+
```typescript
|
|
203
|
+
const client = new A2AClient('https://remote-agent.example.com');
|
|
204
|
+
|
|
205
|
+
// Start a task
|
|
206
|
+
const task = await client.sendMessage({
|
|
207
|
+
role: 'user',
|
|
208
|
+
parts: [{ type: 'text', text: 'Long running analysis' }],
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
// Register a webhook for this task
|
|
212
|
+
const config = await client.createPushNotification(task.id, {
|
|
213
|
+
webhookUrl: 'https://my-app.com/webhooks/a2a',
|
|
214
|
+
authenticationInfo: {
|
|
215
|
+
scheme: 'bearer',
|
|
216
|
+
credentials: { token: 'my-webhook-secret' },
|
|
217
|
+
},
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
// List registered webhooks
|
|
221
|
+
const configs = await client.listPushNotifications(task.id);
|
|
222
|
+
|
|
223
|
+
// Remove a webhook
|
|
224
|
+
await client.deletePushNotification(task.id, config.id!);
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
Server-side setup requires a `PushNotificationStore`:
|
|
228
|
+
|
|
229
|
+
```typescript
|
|
230
|
+
import { A2AServer, InMemoryPushNotificationStore } from '@cogitator-ai/a2a';
|
|
231
|
+
|
|
232
|
+
const a2aServer = new A2AServer({
|
|
233
|
+
agents: { researcher },
|
|
234
|
+
cogitator,
|
|
235
|
+
pushNotificationStore: new InMemoryPushNotificationStore(),
|
|
236
|
+
});
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
When configured, the server automatically sends POST requests with `A2AStreamEvent` payloads to registered webhook URLs on task status and artifact updates. The Agent Card will advertise `pushNotifications: true`.
|
|
240
|
+
|
|
241
|
+
## Agent Card Signing
|
|
242
|
+
|
|
243
|
+
Sign Agent Cards with HMAC-SHA256 for integrity verification:
|
|
244
|
+
|
|
245
|
+
```typescript
|
|
246
|
+
import { signAgentCard, verifyAgentCardSignature } from '@cogitator-ai/a2a';
|
|
247
|
+
|
|
248
|
+
// Server-side: sign cards automatically
|
|
249
|
+
const a2aServer = new A2AServer({
|
|
250
|
+
agents: { researcher },
|
|
251
|
+
cogitator,
|
|
252
|
+
cardSigning: {
|
|
253
|
+
algorithm: 'hmac-sha256',
|
|
254
|
+
secret: process.env.CARD_SIGNING_SECRET!,
|
|
255
|
+
},
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
// Client-side: verify a card's signature
|
|
259
|
+
const client = new A2AClient('https://remote-agent.example.com');
|
|
260
|
+
const isValid = await client.verifyAgentCard(process.env.CARD_SIGNING_SECRET!);
|
|
261
|
+
|
|
262
|
+
// Or manually
|
|
263
|
+
const card = await client.agentCard();
|
|
264
|
+
const valid = verifyAgentCardSignature(card, 'shared-secret');
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
## Extended Agent Card
|
|
268
|
+
|
|
269
|
+
Provide an authenticated endpoint with additional agent details (rate limits, pricing, extended skills):
|
|
270
|
+
|
|
271
|
+
```typescript
|
|
272
|
+
// Server-side: configure extended card generator
|
|
273
|
+
const a2aServer = new A2AServer({
|
|
274
|
+
agents: { researcher },
|
|
275
|
+
cogitator,
|
|
276
|
+
extendedCardGenerator: (agentName) => ({
|
|
277
|
+
...a2aServer.getAgentCard(agentName),
|
|
278
|
+
extendedSkills: [
|
|
279
|
+
{
|
|
280
|
+
id: 'deep_research',
|
|
281
|
+
name: 'deep_research',
|
|
282
|
+
description: 'Multi-source deep research',
|
|
283
|
+
inputModes: ['text/plain'],
|
|
284
|
+
outputModes: ['text/plain', 'application/json'],
|
|
285
|
+
},
|
|
286
|
+
],
|
|
287
|
+
rateLimit: { requestsPerMinute: 60 },
|
|
288
|
+
pricing: { model: 'per-request', details: '$0.01 per task' },
|
|
289
|
+
metadata: { version: '2.1.0', region: 'us-east-1' },
|
|
290
|
+
}),
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
// Client-side: fetch the extended card (requires auth)
|
|
294
|
+
const client = new A2AClient('https://remote-agent.example.com', {
|
|
295
|
+
headers: { Authorization: 'Bearer my-token' },
|
|
296
|
+
});
|
|
297
|
+
const extendedCard = await client.extendedAgentCard();
|
|
298
|
+
console.log(extendedCard.rateLimit, extendedCard.pricing);
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
The `agent/extendedCard` method is only available when `extendedCardGenerator` is configured on the server. The Agent Card advertises this via `capabilities.extendedAgentCard: true`.
|
|
302
|
+
|
|
303
|
+
## Framework Adapters
|
|
304
|
+
|
|
305
|
+
```typescript
|
|
306
|
+
// Express
|
|
307
|
+
import { a2aExpress } from '@cogitator-ai/a2a/express';
|
|
308
|
+
app.use(a2aExpress(server));
|
|
309
|
+
|
|
310
|
+
// Hono
|
|
311
|
+
import { a2aHono } from '@cogitator-ai/a2a/hono';
|
|
312
|
+
app.route('/a2a', a2aHono(server));
|
|
313
|
+
|
|
314
|
+
// Fastify
|
|
315
|
+
import { a2aFastify } from '@cogitator-ai/a2a/fastify';
|
|
316
|
+
fastify.register(a2aFastify(server));
|
|
317
|
+
|
|
318
|
+
// Koa
|
|
319
|
+
import { a2aKoa } from '@cogitator-ai/a2a/koa';
|
|
320
|
+
app.use(a2aKoa(server));
|
|
321
|
+
|
|
322
|
+
// Next.js
|
|
323
|
+
import { a2aNext } from '@cogitator-ai/a2a/next';
|
|
324
|
+
export const { GET, POST } = a2aNext(server);
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
## A2A Protocol
|
|
328
|
+
|
|
329
|
+
| Method | Description |
|
|
330
|
+
| ------------------------------- | ----------------------------------------- |
|
|
331
|
+
| `message/send` | Send a message, get completed task |
|
|
332
|
+
| `message/stream` | Send with SSE streaming (incl. tokens) |
|
|
333
|
+
| `tasks/get` | Retrieve task by ID |
|
|
334
|
+
| `tasks/cancel` | Cancel a running task |
|
|
335
|
+
| `tasks/list` | List tasks with filtering and pagination |
|
|
336
|
+
| `tasks/pushNotification/create` | Register a webhook for task events |
|
|
337
|
+
| `tasks/pushNotification/get` | Get a push notification config |
|
|
338
|
+
| `tasks/pushNotification/list` | List push notification configs for a task |
|
|
339
|
+
| `tasks/pushNotification/delete` | Remove a push notification config |
|
|
340
|
+
| `agent/extendedCard` | Fetch extended Agent Card (authenticated) |
|
|
341
|
+
|
|
342
|
+
## Part of Cogitator
|
|
343
|
+
|
|
344
|
+
This package is part of the [Cogitator](https://github.com/cogitator-ai/Cogitator-AI) ecosystem — a self-hosted, production-grade AI agent runtime for TypeScript.
|
|
345
|
+
|
|
346
|
+
## License
|
|
347
|
+
|
|
348
|
+
MIT
|
package/dist/agent-card.d.ts
CHANGED
|
@@ -6,4 +6,14 @@ export interface AgentCardOptions {
|
|
|
6
6
|
provider?: AgentProvider;
|
|
7
7
|
}
|
|
8
8
|
export declare function generateAgentCard(agent: IAgent, options: AgentCardOptions): AgentCard;
|
|
9
|
+
export interface AgentCardSigningOptions {
|
|
10
|
+
algorithm?: 'hmac-sha256';
|
|
11
|
+
secret: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function signAgentCard(card: AgentCard, options: AgentCardSigningOptions): AgentCard & {
|
|
14
|
+
signature: string;
|
|
15
|
+
};
|
|
16
|
+
export declare function verifyAgentCardSignature(card: AgentCard & {
|
|
17
|
+
signature?: string;
|
|
18
|
+
}, secret: string): boolean;
|
|
9
19
|
//# sourceMappingURL=agent-card.d.ts.map
|
package/dist/agent-card.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-card.d.ts","sourceRoot":"","sources":["../src/agent-card.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"agent-card.d.ts","sourceRoot":"","sources":["../src/agent-card.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,IAAI,MAAM,EAAQ,MAAM,qBAAqB,CAAC;AACjE,OAAO,KAAK,EAAE,SAAS,EAAc,aAAa,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAExF,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;IACxC,QAAQ,CAAC,EAAE,aAAa,CAAC;CAC1B;AAYD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,GAAG,SAAS,CAuBrF;AAED,MAAM,WAAW,uBAAuB;IACtC,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,aAAa,CAC3B,IAAI,EAAE,SAAS,EACf,OAAO,EAAE,uBAAuB,GAC/B,SAAS,GAAG;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAKnC;AAED,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,SAAS,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,EACxC,MAAM,EAAE,MAAM,GACb,OAAO,CAQT"}
|
package/dist/agent-card.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createHmac } from 'node:crypto';
|
|
1
2
|
function toolToSkill(tool) {
|
|
2
3
|
return {
|
|
3
4
|
id: tool.name,
|
|
@@ -28,4 +29,21 @@ export function generateAgentCard(agent, options) {
|
|
|
28
29
|
}
|
|
29
30
|
return card;
|
|
30
31
|
}
|
|
32
|
+
export function signAgentCard(card, options) {
|
|
33
|
+
const algorithm = options.algorithm ?? 'hmac-sha256';
|
|
34
|
+
const payload = JSON.stringify(card);
|
|
35
|
+
const signature = createHmac('sha256', options.secret).update(payload).digest('hex');
|
|
36
|
+
return { ...card, signature: `${algorithm}:${signature}` };
|
|
37
|
+
}
|
|
38
|
+
export function verifyAgentCardSignature(card, secret) {
|
|
39
|
+
if (!card.signature)
|
|
40
|
+
return false;
|
|
41
|
+
const [algorithm, sig] = card.signature.split(':');
|
|
42
|
+
if (algorithm !== 'hmac-sha256')
|
|
43
|
+
return false;
|
|
44
|
+
const { signature: _, ...cardWithoutSig } = card;
|
|
45
|
+
const payload = JSON.stringify(cardWithoutSig);
|
|
46
|
+
const expected = createHmac('sha256', secret).update(payload).digest('hex');
|
|
47
|
+
return sig === expected;
|
|
48
|
+
}
|
|
31
49
|
//# sourceMappingURL=agent-card.js.map
|
package/dist/agent-card.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-card.js","sourceRoot":"","sources":["../src/agent-card.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"agent-card.js","sourceRoot":"","sources":["../src/agent-card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAUzC,SAAS,WAAW,CAAC,IAAU;IAC7B,OAAO;QACL,EAAE,EAAE,IAAI,CAAC,IAAI;QACb,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,UAAU,EAAE,CAAC,YAAY,EAAE,kBAAkB,CAAC;QAC9C,WAAW,EAAE,CAAC,YAAY,EAAE,kBAAkB,CAAC;KAChD,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,KAAa,EAAE,OAAyB;IACxE,MAAM,YAAY,GAAoB;QACpC,SAAS,EAAE,IAAI;QACf,iBAAiB,EAAE,KAAK;QACxB,GAAG,OAAO,CAAC,YAAY;KACxB,CAAC;IAEF,MAAM,IAAI,GAAc;QACtB,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,WAAW;QACrC,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,OAAO,EAAE,KAAK;QACd,YAAY;QACZ,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC;QACpC,iBAAiB,EAAE,CAAC,YAAY,CAAC;QACjC,kBAAkB,EAAE,CAAC,YAAY,EAAE,kBAAkB,CAAC;KACvD,CAAC;IAEF,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;QACrB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;IACnC,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAOD,MAAM,UAAU,aAAa,CAC3B,IAAe,EACf,OAAgC;IAEhC,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,aAAa,CAAC;IACrD,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACrC,MAAM,SAAS,GAAG,UAAU,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACrF,OAAO,EAAE,GAAG,IAAI,EAAE,SAAS,EAAE,GAAG,SAAS,IAAI,SAAS,EAAE,EAAE,CAAC;AAC7D,CAAC;AAED,MAAM,UAAU,wBAAwB,CACtC,IAAwC,EACxC,MAAc;IAEd,IAAI,CAAC,IAAI,CAAC,SAAS;QAAE,OAAO,KAAK,CAAC;IAClC,MAAM,CAAC,SAAS,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACnD,IAAI,SAAS,KAAK,aAAa;QAAE,OAAO,KAAK,CAAC;IAC9C,MAAM,EAAE,SAAS,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,GAAG,IAAI,CAAC;IACjD,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC/C,MAAM,QAAQ,GAAG,UAAU,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC5E,OAAO,GAAG,KAAK,QAAQ,CAAC;AAC1B,CAAC"}
|
package/dist/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Tool } from '@cogitator-ai/types';
|
|
2
|
-
import type { AgentCard, A2AMessage, A2ATask, A2AStreamEvent, A2AClientConfig, SendMessageConfiguration } from './types.js';
|
|
2
|
+
import type { AgentCard, ExtendedAgentCard, A2AMessage, A2ATask, A2AStreamEvent, A2AClientConfig, SendMessageConfiguration, TaskFilter, PushNotificationConfig } from './types.js';
|
|
3
3
|
export interface A2AToolOptions {
|
|
4
4
|
name?: string;
|
|
5
5
|
description?: string;
|
|
@@ -23,9 +23,17 @@ export declare class A2AClient {
|
|
|
23
23
|
sendMessageStream(message: A2AMessage, config?: SendMessageConfiguration): AsyncGenerator<A2AStreamEvent>;
|
|
24
24
|
getTask(taskId: string, historyLength?: number): Promise<A2ATask>;
|
|
25
25
|
cancelTask(taskId: string): Promise<A2ATask>;
|
|
26
|
+
continueTask(taskId: string, text: string, config?: SendMessageConfiguration): Promise<A2ATask>;
|
|
27
|
+
listTasks(filter?: TaskFilter): Promise<A2ATask[]>;
|
|
26
28
|
asTool(options?: A2AToolOptions): Tool<{
|
|
27
29
|
task: string;
|
|
28
30
|
}, A2AToolResult>;
|
|
31
|
+
createPushNotification(taskId: string, config: PushNotificationConfig): Promise<PushNotificationConfig>;
|
|
32
|
+
getPushNotification(taskId: string, configId: string): Promise<PushNotificationConfig | null>;
|
|
33
|
+
listPushNotifications(taskId: string): Promise<PushNotificationConfig[]>;
|
|
34
|
+
deletePushNotification(taskId: string, configId: string): Promise<void>;
|
|
35
|
+
verifyAgentCard(secret: string): Promise<boolean>;
|
|
36
|
+
extendedAgentCard(): Promise<ExtendedAgentCard>;
|
|
29
37
|
asToolFromCard(card: AgentCard, options?: A2AToolOptions): Tool<{
|
|
30
38
|
task: string;
|
|
31
39
|
}, A2AToolResult>;
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAA2B,MAAM,qBAAqB,CAAC;AAEzE,OAAO,KAAK,EACV,SAAS,EACT,UAAU,EACV,OAAO,EACP,cAAc,EACd,eAAe,EACf,wBAAwB,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"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E,wBAAwB,GAChC,OAAO,CAAC,OAAO,CAAC;IAWb,SAAS,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAKxD,MAAM,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,aAAa,CAAC;IAoEjE,sBAAsB,CAC1B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,sBAAsB,GAC7B,OAAO,CAAC,sBAAsB,CAAC;IAK5B,mBAAmB,CACvB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC;IAKnC,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,EAAE,CAAC;IAKxE,sBAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIvE,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAKjD,iBAAiB,IAAI,OAAO,CAAC,iBAAiB,CAAC;IAKrD,cAAc,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,aAAa,CAAC;YAQlF,GAAG;YA+BH,OAAO;YAaN,cAAc;IA2C7B,OAAO,CAAC,qBAAqB;IAmB7B,OAAO,CAAC,iBAAiB;CAG1B"}
|
package/dist/client.js
CHANGED
|
@@ -2,6 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { isTerminalState } from './types.js';
|
|
3
3
|
import { A2AError } from './errors.js';
|
|
4
4
|
import * as errors from './errors.js';
|
|
5
|
+
import { verifyAgentCardSignature } from './agent-card.js';
|
|
5
6
|
export class A2AClient {
|
|
6
7
|
baseUrl;
|
|
7
8
|
headers;
|
|
@@ -63,8 +64,18 @@ export class A2AClient {
|
|
|
63
64
|
const result = await this.rpc('tasks/cancel', { id: taskId });
|
|
64
65
|
return result;
|
|
65
66
|
}
|
|
67
|
+
async continueTask(taskId, text, config) {
|
|
68
|
+
return this.sendMessage({
|
|
69
|
+
role: 'user',
|
|
70
|
+
parts: [{ type: 'text', text }],
|
|
71
|
+
taskId,
|
|
72
|
+
}, config);
|
|
73
|
+
}
|
|
74
|
+
async listTasks(filter) {
|
|
75
|
+
const result = (await this.rpc('tasks/list', filter ?? {}));
|
|
76
|
+
return result.tasks;
|
|
77
|
+
}
|
|
66
78
|
asTool(options) {
|
|
67
|
-
const client = this;
|
|
68
79
|
const toolName = options?.name ?? 'a2a_remote_agent';
|
|
69
80
|
const toolDescription = options?.description ?? 'Remote A2A agent';
|
|
70
81
|
const toolTimeout = options?.timeout ?? this.timeout;
|
|
@@ -77,15 +88,15 @@ export class A2AClient {
|
|
|
77
88
|
parameters,
|
|
78
89
|
timeout: toolTimeout,
|
|
79
90
|
sideEffects: ['external'],
|
|
80
|
-
async
|
|
91
|
+
execute: async (params, _context) => {
|
|
81
92
|
try {
|
|
82
93
|
const message = {
|
|
83
94
|
role: 'user',
|
|
84
95
|
parts: [{ type: 'text', text: params.task }],
|
|
85
96
|
};
|
|
86
|
-
const task = await
|
|
97
|
+
const task = await this.sendMessage(message);
|
|
87
98
|
if (task.status.state === 'completed') {
|
|
88
|
-
const output =
|
|
99
|
+
const output = this.extractOutputFromTask(task);
|
|
89
100
|
return { output, success: true };
|
|
90
101
|
}
|
|
91
102
|
if (task.status.state === 'failed') {
|
|
@@ -124,6 +135,29 @@ export class A2AClient {
|
|
|
124
135
|
},
|
|
125
136
|
};
|
|
126
137
|
}
|
|
138
|
+
async createPushNotification(taskId, config) {
|
|
139
|
+
const result = await this.rpc('tasks/pushNotification/create', { taskId, config });
|
|
140
|
+
return result;
|
|
141
|
+
}
|
|
142
|
+
async getPushNotification(taskId, configId) {
|
|
143
|
+
const result = await this.rpc('tasks/pushNotification/get', { taskId, configId });
|
|
144
|
+
return result;
|
|
145
|
+
}
|
|
146
|
+
async listPushNotifications(taskId) {
|
|
147
|
+
const result = await this.rpc('tasks/pushNotification/list', { taskId });
|
|
148
|
+
return result;
|
|
149
|
+
}
|
|
150
|
+
async deletePushNotification(taskId, configId) {
|
|
151
|
+
await this.rpc('tasks/pushNotification/delete', { taskId, configId });
|
|
152
|
+
}
|
|
153
|
+
async verifyAgentCard(secret) {
|
|
154
|
+
const card = await this.agentCard();
|
|
155
|
+
return verifyAgentCardSignature(card, secret);
|
|
156
|
+
}
|
|
157
|
+
async extendedAgentCard() {
|
|
158
|
+
const result = await this.rpc('agent/extendedCard', {});
|
|
159
|
+
return result;
|
|
160
|
+
}
|
|
127
161
|
asToolFromCard(card, options) {
|
|
128
162
|
return this.asTool({
|
|
129
163
|
name: options?.name ?? card.name,
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAc3D,MAAM,OAAO,SAAS;IACZ,OAAO,CAAS;IAChB,OAAO,CAAyB;IAChC,OAAO,CAAS;IAChB,aAAa,CAAS;IACtB,OAAO,CAAS;IAChB,UAAU,GAAqB,IAAI,CAAC;IAE5C,YAAY,OAAe,EAAE,MAAwB;QACnD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC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@@
|
|
|
1
1
|
import type { JsonRpcError } from './json-rpc.js';
|
|
2
2
|
export declare function taskNotFound(taskId: string): JsonRpcError;
|
|
3
3
|
export declare function taskNotCancelable(taskId: string): JsonRpcError;
|
|
4
|
+
export declare function taskNotContinuable(taskId: string, state: string): JsonRpcError;
|
|
4
5
|
export declare function pushNotificationsNotSupported(): JsonRpcError;
|
|
6
|
+
export declare function pushNotificationsNotConfigured(taskId: string): JsonRpcError;
|
|
5
7
|
export declare function unsupportedOperation(method: string): JsonRpcError;
|
|
6
8
|
export declare function contentTypeNotSupported(contentType: string): JsonRpcError;
|
|
7
9
|
export declare function invalidAgentResponse(detail: string): JsonRpcError;
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,CAEzD;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,CAE9D;AAED,wBAAgB,6BAA6B,IAAI,YAAY,CAE5D;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,CAEjE;AAED,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,MAAM,GAAG,YAAY,CAMzE;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,CAEjE;AAED,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,YAAY,CAE7D;AAED,wBAAgB,UAAU,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,YAAY,CAExD;AAED,wBAAgB,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,YAAY,CAE5D;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,CAE3D;AAED,wBAAgB,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a,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,YAAY,CAE3D;AAED,qBAAa,QAAS,SAAQ,KAAK;aACL,YAAY,EAAE,YAAY;gBAA1B,YAAY,EAAE,YAAY;IAKtD,IAAI,IAAI,IAAI,MAAM,CAEjB;CACF"}
|
package/dist/errors.js
CHANGED
|
@@ -4,9 +4,23 @@ export function taskNotFound(taskId) {
|
|
|
4
4
|
export function taskNotCancelable(taskId) {
|
|
5
5
|
return { code: -32002, message: `Task is not cancelable: ${taskId}`, data: { taskId } };
|
|
6
6
|
}
|
|
7
|
+
export function taskNotContinuable(taskId, state) {
|
|
8
|
+
return {
|
|
9
|
+
code: -32008,
|
|
10
|
+
message: `Task cannot be continued in state '${state}': ${taskId}`,
|
|
11
|
+
data: { taskId, state },
|
|
12
|
+
};
|
|
13
|
+
}
|
|
7
14
|
export function pushNotificationsNotSupported() {
|
|
8
15
|
return { code: -32003, message: 'Push notifications are not supported' };
|
|
9
16
|
}
|
|
17
|
+
export function pushNotificationsNotConfigured(taskId) {
|
|
18
|
+
return {
|
|
19
|
+
code: -32009,
|
|
20
|
+
message: `Push notifications not configured for task: ${taskId}`,
|
|
21
|
+
data: { taskId },
|
|
22
|
+
};
|
|
23
|
+
}
|
|
10
24
|
export function unsupportedOperation(method) {
|
|
11
25
|
return { code: -32004, message: `Unsupported operation: ${method}`, data: { method } };
|
|
12
26
|
}
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,YAAY,CAAC,MAAc;IACzC,OAAO,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,mBAAmB,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC;AAClF,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,MAAc;IAC9C,OAAO,EAAE,IAAI,EAAE,CAAC,KAAK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server.js';
|
|
2
2
|
export { A2AClient } from './client.js';
|
|
3
3
|
export type { A2AToolOptions } from './client.js';
|
|
4
|
-
export { generateAgentCard } from './agent-card.js';
|
|
5
|
-
export type { AgentCardOptions } from './agent-card.js';
|
|
4
|
+
export { generateAgentCard, signAgentCard, verifyAgentCardSignature } from './agent-card.js';
|
|
5
|
+
export type { AgentCardOptions, AgentCardSigningOptions } from './agent-card.js';
|
|
6
6
|
export { InMemoryTaskStore } from './task-store.js';
|
|
7
|
+
export { RedisTaskStore } from './redis-task-store.js';
|
|
8
|
+
export type { RedisClientLike, RedisTaskStoreConfig } from './redis-task-store.js';
|
|
7
9
|
export { TaskManager } from './task-manager.js';
|
|
8
10
|
export type { TaskManagerConfig } from './task-manager.js';
|
|
11
|
+
export { InMemoryPushNotificationStore, PushNotificationSender } from './push-notifications.js';
|
|
9
12
|
export { parseJsonRpcRequest, createSuccessResponse, createErrorResponse, isValidRequest, JsonRpcParseError, } from './json-rpc.js';
|
|
10
13
|
export type { JsonRpcRequest, JsonRpcResponse, JsonRpcError } from './json-rpc.js';
|
|
11
|
-
export { taskNotFound, taskNotCancelable, pushNotificationsNotSupported, unsupportedOperation, contentTypeNotSupported, invalidAgentResponse, agentNotFound, parseError, invalidRequest, methodNotFound, invalidParams, internalError, A2AError, } from './errors.js';
|
|
14
|
+
export { taskNotFound, taskNotCancelable, taskNotContinuable, pushNotificationsNotSupported, pushNotificationsNotConfigured, unsupportedOperation, contentTypeNotSupported, invalidAgentResponse, agentNotFound, parseError, invalidRequest, methodNotFound, invalidParams, internalError, A2AError, } from './errors.js';
|
|
12
15
|
export { TERMINAL_STATES, isTerminalState } from './types.js';
|
|
13
|
-
export type { TaskState, TextPart, FilePart, DataPart, Part, A2AMessage, Artifact, A2AErrorDetail, TaskStatus, A2ATask, AgentProvider, A2ACapabilities, AgentSkill, SecurityScheme, AgentCard, SendMessageConfiguration, TaskFilter, TaskStore, TaskStatusUpdateEvent, TaskArtifactUpdateEvent, A2AStreamEvent, AgentRunResult, CogitatorLike, A2AAuthConfig, A2AServerConfig, A2AClientConfig, } from './types.js';
|
|
16
|
+
export type { TaskState, TextPart, FilePart, DataPart, Part, A2AMessage, Artifact, A2AErrorDetail, TaskStatus, A2ATask, AgentProvider, A2ACapabilities, AgentSkill, SecurityScheme, AgentCard, ExtendedAgentCard, SendMessageConfiguration, TaskFilter, TaskStore, TaskStatusUpdateEvent, TaskArtifactUpdateEvent, TokenStreamEvent, A2AStreamEvent, AgentRunResult, CogitatorLike, A2AAuthConfig, A2AServerConfig, A2AClientConfig, PushNotificationConfig, PushNotificationStore, } from './types.js';
|
|
14
17
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC7F,YAAY,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAEjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,YAAY,EAAE,eAAe,EAAE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