@a2anet/a2a-utils 0.5.0 → 0.6.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 CHANGED
@@ -58,9 +58,11 @@ Create an `A2ASession`, then `A2ATools` to get LLM-friendly tools that can be us
58
58
 
59
59
  ```typescript
60
60
  import { A2ATools, A2ASession, A2AAgents, JSONTaskStore, LocalFileStore } from "@a2anet/a2a-utils";
61
+ import { createAgent, tool } from "langchain";
62
+ import { ChatOpenAI } from "@langchain/openai";
61
63
 
62
64
  const agents = new A2AAgents({
63
- "weather": { url: "https://weather.example.com/.well-known/agent-card.json" },
65
+ weather: { url: "https://weather.example.com/.well-known/agent-card.json" },
64
66
  "research-bot": {
65
67
  url: "https://research.example.com/.well-known/agent-card.json",
66
68
  custom_headers: { "X-API-Key": "key_123" },
@@ -74,14 +76,20 @@ const a2aSession = new A2ASession(agents, {
74
76
 
75
77
  const a2aTools = new A2ATools(a2aSession);
76
78
 
77
- // Pass a2aTools into your agent framework of choice.
79
+ const langchainTools = a2aTools.toolDefinitions.map((def) =>
80
+ tool(def.execute, { name: def.name, description: def.description, schema: def.schema }),
81
+ );
82
+
83
+ const model = new ChatOpenAI({ model: "gpt-5.1", reasoning: { effort: "medium" } });
84
+
85
+ const agent = createAgent({ model, tools: langchainTools });
78
86
  ```
79
87
 
80
88
  ## 📖 API Reference
81
89
 
82
90
  ### A2ATools
83
91
 
84
- Ready-made tools for agents to communicate with A2A servers. Every method has LLM-friendly docstrings, returns JSON-serialisable objects, and returns actionable error messages.
92
+ Ready-made tools for agents to communicate with A2A servers. Each tool is an instance property with `name`, `description`, `schema` (Zod), and `execute`. Use the `toolDefinitions` getter for the full array.
85
93
 
86
94
  ```typescript
87
95
  import { A2ATools, A2ASession, A2AAgents } from "@a2anet/a2a-utils";
@@ -89,10 +97,10 @@ import { A2ATools, A2ASession, A2AAgents } from "@a2anet/a2a-utils";
89
97
  const tools = new A2ATools(session);
90
98
  ```
91
99
 
92
- | Parameter | Type | Required | Description |
93
- |---|---|---|---|
94
- | `session` | `A2ASession` | Yes | The session instance for sending messages and managing agents |
95
- | `artifactSettings` | `ArtifactSettings \| null` | No | Minimization/view settings (default: `new ArtifactSettings()`) |
100
+ | Parameter | Type | Required | Description |
101
+ | ------------------ | -------------------------- | -------- | -------------------------------------------------------------- |
102
+ | `session` | `A2ASession` | Yes | The session instance for sending messages and managing agents |
103
+ | `artifactSettings` | `ArtifactSettings \| null` | No | Minimization/view settings (default: `new ArtifactSettings()`) |
96
104
 
97
105
  `artifactSettings` determines how Artifacts are minimized and viewed:
98
106
 
@@ -107,78 +115,81 @@ const settings = new ArtifactSettings({
107
115
  const tools = new A2ATools(session, { artifactSettings: settings });
108
116
  ```
109
117
 
110
- | Field | Type | Default | Description |
111
- |---|---|---|---|
112
- | `sendMessageCharacterLimit` | `number` | `50,000` | Character limit above which artifacts are minimized in `sendMessage` |
113
- | `minimizedObjectStringLength` | `number` | `5,000` | Max length for individual string values within minimized data objects |
114
- | `viewArtifactCharacterLimit` | `number` | `50,000` | Character limit for output from `viewTextArtifact` / `viewDataArtifact` |
118
+ | Field | Type | Default | Description |
119
+ | ----------------------------- | -------- | -------- | ----------------------------------------------------------------------- |
120
+ | `sendMessageCharacterLimit` | `number` | `50,000` | Character limit above which artifacts are minimized in `sendMessage` |
121
+ | `minimizedObjectStringLength` | `number` | `5,000` | Max length for individual string values within minimized data objects |
122
+ | `viewArtifactCharacterLimit` | `number` | `50,000` | Character limit for output from `viewTextArtifact` / `viewDataArtifact` |
115
123
 
116
- #### `async getAgents(): Promise<Record<string, unknown>>`
124
+ #### `getAgents`
117
125
 
118
126
  List all available agents with their names and descriptions.
119
127
 
120
128
  ```typescript
121
- const result = await tools.getAgents();
129
+ const result = await tools.getAgents.execute({});
122
130
  ```
123
131
 
124
132
  Example result:
125
133
 
126
134
  ```json
127
135
  {
128
- "research-bot": {
129
- "name": "Research Bot",
130
- "description": "Find and summarize research papers"
131
- },
132
- "weather": {
133
- "name": "Weather Agent",
134
- "description": "Get weather forecasts for any location"
135
- }
136
+ "research-bot": {
137
+ "name": "Research Bot",
138
+ "description": "Find and summarize research papers"
139
+ },
140
+ "weather": {
141
+ "name": "Weather Agent",
142
+ "description": "Get weather forecasts for any location"
143
+ }
136
144
  }
137
145
  ```
138
146
 
139
- #### `async getAgent(agentId: string): Promise<Record<string, unknown>>`
147
+ #### `getAgent`
140
148
 
141
149
  Get detailed information about a specific agent, including its skills.
142
150
 
143
151
  ```typescript
144
- const result = await tools.getAgent("research-bot");
152
+ const result = await tools.getAgent.execute({ agentId: "research-bot" });
145
153
  ```
146
154
 
147
155
  Example result:
148
156
 
149
157
  ```json
150
158
  {
151
- "name": "Research Bot",
152
- "description": "Find and summarize research papers",
153
- "skills": [
154
- {
155
- "name": "Search Papers",
156
- "description": "Search for papers by topic, author, or keyword"
157
- },
158
- {
159
- "name": "Summarize Paper",
160
- "description": "Generate a summary of a specific paper"
161
- }
162
- ]
159
+ "name": "Research Bot",
160
+ "description": "Find and summarize research papers",
161
+ "skills": [
162
+ {
163
+ "name": "Search Papers",
164
+ "description": "Search for papers by topic, author, or keyword"
165
+ },
166
+ {
167
+ "name": "Summarize Paper",
168
+ "description": "Generate a summary of a specific paper"
169
+ }
170
+ ]
163
171
  }
164
172
  ```
165
173
 
166
- #### `async sendMessage(agentId, message, contextId?, taskId?, timeout?): Promise<Record<string, unknown>>`
174
+ #### `sendMessage`
167
175
 
168
176
  Send a message to an agent and receive a structured response. The response includes the agent's reply and any generated Artifacts. Artifacts are automatically minimized to fit the context window.
169
177
 
170
- | Parameter | Type | Required | Description |
171
- |---|---|---|---|
172
- | `agentId` | `string` | Yes | ID of the agent to message (from getAgents) |
173
- | `message` | `string` | Yes | The message content to send |
174
- | `contextId` | `string \| null` | No | Continue an existing conversation by providing its context ID |
175
- | `taskId` | `string \| null` | No | Attach to an existing task (for input-required flows) |
176
- | `timeout` | `number \| null` | No | Override the default timeout in seconds |
178
+ | Parameter | Type | Required | Description |
179
+ | ----------- | ----------- | -------- | ------------------------------------------------------------- |
180
+ | `agentId` | `string` | Yes | ID of the agent to message (from get_agents) |
181
+ | `message` | `string` | Yes | The message content to send |
182
+ | `contextId` | `string` | No | Continue an existing conversation by providing its context ID |
183
+ | `taskId` | `string` | No | Attach to an existing task (for input_required flows) |
184
+ | `timeout` | `number` | No | Override the default timeout in seconds |
185
+ | `data` | `unknown[]` | No | Structured data to include with the message |
186
+ | `files` | `string[]` | No | Files to include (local paths or URLs) |
177
187
 
178
188
  ```typescript
179
- const result = await tools.sendMessage(
180
- "research-bot", "Find recent papers on quantum computing"
181
- );
189
+ const result = await tools.sendMessage.execute({
190
+ agentId: "research-bot",
191
+ message: "Find recent papers on quantum computing",
192
+ });
182
193
  ```
183
194
 
184
195
  Example result:
@@ -202,19 +213,19 @@ Example result:
202
213
  "kind": "data",
203
214
  "data": [
204
215
  {
205
- "title": "Quantum Error Correction Advances",
206
- "year": 2025,
207
- "authors": "Chen et al."
216
+ "title": "Quantum Error Correction Advances",
217
+ "year": 2025,
218
+ "authors": "Chen et al."
208
219
  },
209
220
  {
210
- "title": "Topological Quantum Computing Survey",
211
- "year": 2024,
212
- "authors": "Nakamura et al."
221
+ "title": "Topological Quantum Computing Survey",
222
+ "year": 2024,
223
+ "authors": "Nakamura et al."
213
224
  },
214
225
  {
215
- "title": "Fault-Tolerant Logical Qubits",
216
- "year": 2024,
217
- "authors": "Wang et al."
226
+ "title": "Fault-Tolerant Logical Qubits",
227
+ "year": 2024,
228
+ "authors": "Wang et al."
218
229
  }
219
230
  ]
220
231
  }
@@ -238,46 +249,53 @@ Example result:
238
249
  Continue the conversation using `contextId`:
239
250
 
240
251
  ```typescript
241
- const result2 = await tools.sendMessage(
242
- "research-bot",
243
- "Summarize the most recent result",
244
- "ctx-456",
245
- );
252
+ const result2 = await tools.sendMessage.execute({
253
+ agentId: "research-bot",
254
+ message: "Summarize the most recent result",
255
+ contextId: "ctx-456",
256
+ });
246
257
  ```
247
258
 
248
- #### `async getTask(agentId, taskId, timeout?, pollInterval?): Promise<Record<string, unknown>>`
259
+ #### `getTask`
249
260
 
250
261
  Check the progress of a task that is still in progress. Use this after `sendMessage` returns a task in a non-terminal state (e.g. `"working"`).
251
262
 
252
- | Parameter | Type | Required | Description |
253
- |---|---|---|---|
254
- | `agentId` | `string` | Yes | ID of the agent that owns the task |
255
- | `taskId` | `string` | Yes | Task ID from a previous sendMessage response |
256
- | `timeout` | `number \| null` | No | Override the monitoring timeout in seconds |
257
- | `pollInterval` | `number \| null` | No | Override the interval between status checks in seconds |
263
+ | Parameter | Type | Required | Description |
264
+ | -------------- | -------- | -------- | ------------------------------------------------------ |
265
+ | `agentId` | `string` | Yes | ID of the agent that owns the task |
266
+ | `taskId` | `string` | Yes | Task ID from a previous send_message response |
267
+ | `timeout` | `number` | No | Override the monitoring timeout in seconds |
268
+ | `pollInterval` | `number` | No | Override the interval between status checks in seconds |
258
269
 
259
270
  ```typescript
260
- const result = await tools.getTask("research-bot", "task-123");
271
+ const result = await tools.getTask.execute({
272
+ agentId: "research-bot",
273
+ taskId: "task-123",
274
+ });
261
275
  ```
262
276
 
263
- #### `async viewTextArtifact(agentId, taskId, artifactId, lineStart?, lineEnd?, characterStart?, characterEnd?): Promise<Record<string, unknown>>`
277
+ #### `viewTextArtifact`
264
278
 
265
279
  View text content from an artifact, optionally selecting a range. Use this for artifacts containing text (documents, logs, code, etc.).
266
280
 
267
- | Parameter | Type | Required | Description |
268
- |---|---|---|---|
269
- | `agentId` | `string` | Yes | ID of the agent that produced the artifact |
270
- | `taskId` | `string` | Yes | Task ID containing the artifact |
271
- | `artifactId` | `string` | Yes | The artifact's unique identifier |
272
- | `lineStart` | `number \| null` | No | Starting line number (1-based, inclusive) |
273
- | `lineEnd` | `number \| null` | No | Ending line number (1-based, inclusive) |
274
- | `characterStart` | `number \| null` | No | Starting character index (0-based, inclusive) |
275
- | `characterEnd` | `number \| null` | No | Ending character index (0-based, exclusive) |
281
+ | Parameter | Type | Required | Description |
282
+ | ---------------- | -------- | -------- | --------------------------------------------- |
283
+ | `agentId` | `string` | Yes | ID of the agent that produced the artifact |
284
+ | `taskId` | `string` | Yes | Task ID containing the artifact |
285
+ | `artifactId` | `string` | Yes | The artifact's unique identifier |
286
+ | `lineStart` | `number` | No | Starting line number (1-based, inclusive) |
287
+ | `lineEnd` | `number` | No | Ending line number (1-based, inclusive) |
288
+ | `characterStart` | `number` | No | Starting character index (0-based, inclusive) |
289
+ | `characterEnd` | `number` | No | Ending character index (0-based, exclusive) |
276
290
 
277
291
  ```typescript
278
- const result = await tools.viewTextArtifact(
279
- "research-bot", "task-123", "art-790", 1, 3
280
- );
292
+ const result = await tools.viewTextArtifact.execute({
293
+ agentId: "research-bot",
294
+ taskId: "task-123",
295
+ artifactId: "art-790",
296
+ lineStart: 1,
297
+ lineEnd: 3,
298
+ });
281
299
  ```
282
300
 
283
301
  Example result:
@@ -296,24 +314,27 @@ Example result:
296
314
  }
297
315
  ```
298
316
 
299
- #### `async viewDataArtifact(agentId, taskId, artifactId, jsonPath?, rows?, columns?): Promise<Record<string, unknown>>`
317
+ #### `viewDataArtifact`
300
318
 
301
319
  View structured data from an artifact with optional filtering. Use this for artifacts containing JSON data (objects, arrays, tables).
302
320
 
303
- | Parameter | Type | Required | Description |
304
- |---|---|---|---|
305
- | `agentId` | `string` | Yes | ID of the agent that produced the artifact |
306
- | `taskId` | `string` | Yes | Task ID containing the artifact |
307
- | `artifactId` | `string` | Yes | The artifact's unique identifier |
308
- | `jsonPath` | `string \| null` | No | Dot-separated path to navigate into the data (e.g. `"results.items"`) |
309
- | `rows` | `string \| null` | No | Row selection: `"0"`, `"0-10"`, `"0,2,5"`, `"all"` |
310
- | `columns` | `string \| null` | No | Column selection: `"name"`, `"name,age"`, `"all"` |
321
+ | Parameter | Type | Required | Description |
322
+ | ------------ | -------- | -------- | --------------------------------------------------------------------- |
323
+ | `agentId` | `string` | Yes | ID of the agent that produced the artifact |
324
+ | `taskId` | `string` | Yes | Task ID containing the artifact |
325
+ | `artifactId` | `string` | Yes | The artifact's unique identifier |
326
+ | `jsonPath` | `string` | No | Dot-separated path to navigate into the data (e.g. `"results.items"`) |
327
+ | `rows` | `string` | No | Row selection: `"0"`, `"0-10"`, `"0,2,5"`, `"all"` |
328
+ | `columns` | `string` | No | Column selection: `"name"`, `"name,age"`, `"all"` |
311
329
 
312
330
  ```typescript
313
- const result = await tools.viewDataArtifact(
314
- "research-bot", "task-123", "art-789",
315
- undefined, "0-1", "title,year",
316
- );
331
+ const result = await tools.viewDataArtifact.execute({
332
+ agentId: "research-bot",
333
+ taskId: "task-123",
334
+ artifactId: "art-789",
335
+ rows: "0-1",
336
+ columns: "title,year",
337
+ });
317
338
  ```
318
339
 
319
340
  Example result:
@@ -327,8 +348,8 @@ Example result:
327
348
  {
328
349
  "kind": "data",
329
350
  "data": [
330
- {"title": "Quantum Error Correction Advances", "year": 2025},
331
- {"title": "Topological Quantum Computing Survey", "year": 2024}
351
+ { "title": "Quantum Error Correction Advances", "year": 2025 },
352
+ { "title": "Topological Quantum Computing Survey", "year": 2024 }
332
353
  ]
333
354
  }
334
355
  ]
@@ -353,43 +374,42 @@ const session = new A2ASession(
353
374
  );
354
375
  ```
355
376
 
356
- | Parameter | Type | Required | Description |
357
- |---|---|---|---|
358
- | `agents` | `A2AAgents` | Yes | The agent manager instance |
359
- | `taskStore` | `TaskStore \| undefined` | No | Task store for persistence (default: `InMemoryTaskStore`) |
360
- | `fileStore` | `FileStore \| null` | No | File store for saving file artifacts (default: `null`) |
361
- | `sendMessageTimeout` | `number` | No | HTTP timeout in seconds for `sendMessage` (default: `60.0`) |
362
- | `getTaskTimeout` | `number` | No | Total monitoring timeout in seconds for `getTask` (default: `60.0`) |
363
- | `getTaskPollInterval` | `number` | No | Interval in seconds between `getTask` polls (default: `5.0`) |
377
+ | Parameter | Type | Required | Description |
378
+ | --------------------- | ------------------------ | -------- | ------------------------------------------------------------------- |
379
+ | `agents` | `A2AAgents` | Yes | The agent manager instance |
380
+ | `taskStore` | `TaskStore \| undefined` | No | Task store for persistence (default: `InMemoryTaskStore`) |
381
+ | `fileStore` | `FileStore \| null` | No | File store for saving file artifacts (default: `null`) |
382
+ | `sendMessageTimeout` | `number` | No | HTTP timeout in seconds for `sendMessage` (default: `60.0`) |
383
+ | `getTaskTimeout` | `number` | No | Total monitoring timeout in seconds for `getTask` (default: `60.0`) |
384
+ | `getTaskPollInterval` | `number` | No | Interval in seconds between `getTask` polls (default: `5.0`) |
364
385
 
365
386
  #### `async sendMessage(agentId: string, message: string, opts?): Promise<Task | Message>`
366
387
 
367
388
  Send a message to an A2A agent. The returned task is automatically saved to the task store. File artifacts are saved via the file store.
368
389
 
369
- | Parameter | Type | Required | Description |
370
- |---|---|---|---|
371
- | `agentId` | `string` | Yes | Registered agent identifier |
372
- | `message` | `string` | Yes | The message content to send |
373
- | `opts.contextId` | `string \| null` | No | Context ID to continue a conversation (auto-generated when null) |
374
- | `opts.taskId` | `string \| null` | No | Task ID to attach to the message |
375
- | `opts.timeout` | `number \| null` | No | Override HTTP timeout in seconds (default: `sendMessageTimeout`) |
390
+ | Parameter | Type | Required | Description |
391
+ | ---------------- | ---------------- | -------- | ---------------------------------------------------------------- |
392
+ | `agentId` | `string` | Yes | Registered agent identifier |
393
+ | `message` | `string` | Yes | The message content to send |
394
+ | `opts.contextId` | `string \| null` | No | Context ID to continue a conversation (auto-generated when null) |
395
+ | `opts.taskId` | `string \| null` | No | Task ID to attach to the message |
396
+ | `opts.timeout` | `number \| null` | No | Override HTTP timeout in seconds (default: `sendMessageTimeout`) |
376
397
 
377
398
  ```typescript
378
399
  import type { Task, Message } from "@a2a-js/sdk";
379
400
 
380
401
  const response = await session.sendMessage(
381
- "research-bot", "Find recent papers on quantum computing"
402
+ "research-bot",
403
+ "Find recent papers on quantum computing",
382
404
  );
383
405
  ```
384
406
 
385
407
  Continue the conversation using `contextId`:
386
408
 
387
409
  ```typescript
388
- const response2 = await session.sendMessage(
389
- "research-bot",
390
- "Summarize the most recent result",
391
- { contextId: response.contextId },
392
- );
410
+ const response2 = await session.sendMessage("research-bot", "Summarize the most recent result", {
411
+ contextId: response.contextId,
412
+ });
393
413
  ```
394
414
 
395
415
  **Returns:** `Task | Message` (from `@a2a-js/sdk`)
@@ -400,12 +420,12 @@ Get the current state of a task. Monitors until a terminal state (`completed`, `
400
420
 
401
421
  On monitoring timeout, returns the current task state (which may still be non-terminal, e.g. `working`). The only errors from `getTask` are failed HTTP requests (agent down, network error).
402
422
 
403
- | Parameter | Type | Required | Description |
404
- |---|---|---|---|
405
- | `agentId` | `string` | Yes | Registered agent identifier |
406
- | `taskId` | `string` | Yes | Task ID from a previous `sendMessage` call |
407
- | `opts.timeout` | `number \| null` | No | Override monitoring timeout in seconds (default: `getTaskTimeout`) |
408
- | `opts.pollInterval` | `number \| null` | No | Override interval between polls in seconds (default: `getTaskPollInterval`) |
423
+ | Parameter | Type | Required | Description |
424
+ | ------------------- | ---------------- | -------- | --------------------------------------------------------------------------- |
425
+ | `agentId` | `string` | Yes | Registered agent identifier |
426
+ | `taskId` | `string` | Yes | Task ID from a previous `sendMessage` call |
427
+ | `opts.timeout` | `number \| null` | No | Override monitoring timeout in seconds (default: `getTaskTimeout`) |
428
+ | `opts.pollInterval` | `number \| null` | No | Override interval between polls in seconds (default: `getTaskPollInterval`) |
409
429
 
410
430
  ```typescript
411
431
  const task = await session.getTask("research-bot", "task-123");
@@ -424,7 +444,7 @@ import { A2AAgents } from "@a2anet/a2a-utils";
424
444
  const manager = new A2AAgents({
425
445
  "language-translator": {
426
446
  url: "https://example.com/language-translator/agent-card.json",
427
- custom_headers: { "Authorization": "Bearer tok_123" },
447
+ custom_headers: { Authorization: "Bearer tok_123" },
428
448
  },
429
449
  });
430
450
 
@@ -450,9 +470,9 @@ const agents = await manager.getAgents();
450
470
 
451
471
  Generate summary of all agents, sorted by agent_id.
452
472
 
453
- | Parameter | Type | Required | Description |
454
- |---|---|---|---|
455
- | `detail` | `string` | No | Detail level: `"name"`, `"basic"` (default), `"skills"`, or `"full"` |
473
+ | Parameter | Type | Required | Description |
474
+ | --------- | -------- | -------- | -------------------------------------------------------------------- |
475
+ | `detail` | `string` | No | Detail level: `"name"`, `"basic"` (default), `"skills"`, or `"full"` |
456
476
 
457
477
  **Returns:** `Record<string, Record<string, unknown>>`
458
478
 
@@ -464,8 +484,8 @@ const summaries = await manager.getAgentsForLlm("name");
464
484
 
465
485
  ```json
466
486
  {
467
- "code-reviewer": {"name": "Code Reviewer"},
468
- "language-translator": {"name": "Universal Translator"}
487
+ "code-reviewer": { "name": "Code Reviewer" },
488
+ "language-translator": { "name": "Universal Translator" }
469
489
  }
470
490
  ```
471
491
 
@@ -477,14 +497,14 @@ const summaries = await manager.getAgentsForLlm();
477
497
 
478
498
  ```json
479
499
  {
480
- "code-reviewer": {
481
- "name": "Code Reviewer",
482
- "description": "Review code for best practices"
483
- },
484
- "language-translator": {
485
- "name": "Universal Translator",
486
- "description": "Translate text and audio between 50+ languages"
487
- }
500
+ "code-reviewer": {
501
+ "name": "Code Reviewer",
502
+ "description": "Review code for best practices"
503
+ },
504
+ "language-translator": {
505
+ "name": "Universal Translator",
506
+ "description": "Translate text and audio between 50+ languages"
507
+ }
488
508
  }
489
509
  ```
490
510
 
@@ -496,16 +516,16 @@ const summaries = await manager.getAgentsForLlm("skills");
496
516
 
497
517
  ```json
498
518
  {
499
- "code-reviewer": {
500
- "name": "Code Reviewer",
501
- "description": "Review code for best practices",
502
- "skills": ["Review Code"]
503
- },
504
- "language-translator": {
505
- "name": "Universal Translator",
506
- "description": "Translate text between 50+ languages",
507
- "skills": ["Translate Text", "Translate Audio"]
508
- }
519
+ "code-reviewer": {
520
+ "name": "Code Reviewer",
521
+ "description": "Review code for best practices",
522
+ "skills": ["Review Code"]
523
+ },
524
+ "language-translator": {
525
+ "name": "Universal Translator",
526
+ "description": "Translate text between 50+ languages",
527
+ "skills": ["Translate Text", "Translate Audio"]
528
+ }
509
529
  }
510
530
  ```
511
531
 
@@ -517,30 +537,30 @@ const summaries = await manager.getAgentsForLlm("full");
517
537
 
518
538
  ```json
519
539
  {
520
- "code-reviewer": {
521
- "name": "Code Reviewer",
522
- "description": "Review code for best practices",
523
- "skills": [
524
- {
525
- "name": "Review Code",
526
- "description": "Review code for best practices, identify bugs, and suggest improvements"
527
- }
528
- ]
529
- },
530
- "language-translator": {
531
- "name": "Universal Translator",
532
- "description": "Translate text between 50+ languages",
533
- "skills": [
534
- {
535
- "name": "Translate Text",
536
- "description": "Translate text between any supported language pair"
537
- },
538
- {
539
- "name": "Translate Audio",
540
- "description": "Translate audio between any supported language pair"
541
- }
542
- ]
543
- }
540
+ "code-reviewer": {
541
+ "name": "Code Reviewer",
542
+ "description": "Review code for best practices",
543
+ "skills": [
544
+ {
545
+ "name": "Review Code",
546
+ "description": "Review code for best practices, identify bugs, and suggest improvements"
547
+ }
548
+ ]
549
+ },
550
+ "language-translator": {
551
+ "name": "Universal Translator",
552
+ "description": "Translate text between 50+ languages",
553
+ "skills": [
554
+ {
555
+ "name": "Translate Text",
556
+ "description": "Translate text between any supported language pair"
557
+ },
558
+ {
559
+ "name": "Translate Audio",
560
+ "description": "Translate audio between any supported language pair"
561
+ }
562
+ ]
563
+ }
544
564
  }
545
565
  ```
546
566
 
@@ -549,9 +569,9 @@ const summaries = await manager.getAgentsForLlm("full");
549
569
  Retrieve agent by ID.
550
570
  Note: this should NOT be added to the LLM's context, use `getAgentForLlm` instead.
551
571
 
552
- | Parameter | Type | Required | Description |
553
- |---|---|---|---|
554
- | `agentId` | `string` | Yes | User-defined agent identifier |
572
+ | Parameter | Type | Required | Description |
573
+ | --------- | -------- | -------- | ----------------------------- |
574
+ | `agentId` | `string` | Yes | User-defined agent identifier |
555
575
 
556
576
  **Returns:** [`AgentURLAndCustomHeaders`](#agenturlandcustomheaders) | `null`
557
577
 
@@ -565,10 +585,10 @@ Returns `null` if the agent ID is not registered.
565
585
 
566
586
  Generate summary for a single agent.
567
587
 
568
- | Parameter | Type | Required | Description |
569
- |---|---|---|---|
570
- | `agentId` | `string` | Yes | User-defined agent identifier |
571
- | `detail` | `string` | No | Detail level: `"name"`, `"basic"` (default), `"skills"`, or `"full"` |
588
+ | Parameter | Type | Required | Description |
589
+ | --------- | -------- | -------- | -------------------------------------------------------------------- |
590
+ | `agentId` | `string` | Yes | User-defined agent identifier |
591
+ | `detail` | `string` | No | Detail level: `"name"`, `"basic"` (default), `"skills"`, or `"full"` |
572
592
 
573
593
  **Returns:** `Record<string, unknown> | null` — summary object or `null` if not found.
574
594
 
@@ -578,8 +598,8 @@ const summary = await manager.getAgentForLlm("language-translator");
578
598
 
579
599
  ```json
580
600
  {
581
- "name": "Universal Translator",
582
- "description": "Translate text and audio between 50+ languages"
601
+ "name": "Universal Translator",
602
+ "description": "Translate text and audio between 50+ languages"
583
603
  }
584
604
  ```
585
605
 
@@ -587,20 +607,18 @@ const summary = await manager.getAgentForLlm("language-translator");
587
607
 
588
608
  Register a new agent at runtime.
589
609
 
590
- | Parameter | Type | Required | Description |
591
- |---|---|---|---|
592
- | `agentId` | `string` | Yes | User-defined agent identifier |
593
- | `url` | `string` | Yes | Agent card URL |
594
- | `customHeaders` | `Record<string, string>` | No | Custom HTTP headers |
610
+ | Parameter | Type | Required | Description |
611
+ | --------------- | ------------------------ | -------- | ----------------------------- |
612
+ | `agentId` | `string` | Yes | User-defined agent identifier |
613
+ | `url` | `string` | Yes | Agent card URL |
614
+ | `customHeaders` | `Record<string, string>` | No | Custom HTTP headers |
595
615
 
596
616
  **Throws:** `Error` if `agentId` is already registered.
597
617
 
598
618
  ```typescript
599
- await manager.addAgent(
600
- "code-reviewer",
601
- "https://review.example.com/.well-known/agent-card.json",
602
- { "X-API-Key": "key_123" },
603
- );
619
+ await manager.addAgent("code-reviewer", "https://review.example.com/.well-known/agent-card.json", {
620
+ "X-API-Key": "key_123",
621
+ });
604
622
  ```
605
623
 
606
624
  ### 💾 JSONTaskStore
@@ -664,7 +682,7 @@ const savedPaths = await fileStore.save("task-123", artifact);
664
682
  Example result:
665
683
 
666
684
  ```typescript
667
- ["./storage/files/task-123/art-789/quarterly_report.pdf"]
685
+ ["./storage/files/task-123/art-789/quarterly_report.pdf"];
668
686
  ```
669
687
 
670
688
  ##### `async get(taskId: string, artifactId: string): Promise<string[]>`
@@ -678,7 +696,7 @@ const paths = await fileStore.get("task-123", "art-789");
678
696
  Example result:
679
697
 
680
698
  ```typescript
681
- ["./storage/files/task-123/art-789/quarterly_report.pdf"]
699
+ ["./storage/files/task-123/art-789/quarterly_report.pdf"];
682
700
  ```
683
701
 
684
702
  Returns an empty array if no files are found.
@@ -701,14 +719,14 @@ await fileStore.delete("task-123", "art-789");
701
719
 
702
720
  View text content with optional line or character range selection. Supports line selection (1-based, inclusive) or character selection (0-based, slice semantics). These are mutually exclusive — providing both throws an `Error`.
703
721
 
704
- | Parameter | Type | Required | Description |
705
- |---|---|---|---|
706
- | `text` | `string` | Yes | The text to view |
707
- | `opts.lineStart` | `number \| null` | No | Starting line number (1-based, inclusive) |
708
- | `opts.lineEnd` | `number \| null` | No | Ending line number (1-based, inclusive) |
709
- | `opts.characterStart` | `number \| null` | No | Starting character index (0-based, inclusive) |
710
- | `opts.characterEnd` | `number \| null` | No | Ending character index (0-based, exclusive) |
711
- | `opts.characterLimit` | `number` | No | Maximum output size (default: `50,000`) |
722
+ | Parameter | Type | Required | Description |
723
+ | --------------------- | ---------------- | -------- | --------------------------------------------- |
724
+ | `text` | `string` | Yes | The text to view |
725
+ | `opts.lineStart` | `number \| null` | No | Starting line number (1-based, inclusive) |
726
+ | `opts.lineEnd` | `number \| null` | No | Ending line number (1-based, inclusive) |
727
+ | `opts.characterStart` | `number \| null` | No | Starting character index (0-based, inclusive) |
728
+ | `opts.characterEnd` | `number \| null` | No | Ending character index (0-based, exclusive) |
729
+ | `opts.characterLimit` | `number` | No | Maximum output size (default: `50,000`) |
712
730
 
713
731
  **Returns:** `string`
714
732
 
@@ -743,11 +761,11 @@ Example result:
743
761
 
744
762
  Minimize text content for display. If text is within the character limit, returns it unchanged. If over the limit, shows first and last halves with metadata.
745
763
 
746
- | Parameter | Type | Required | Description |
747
- |---|---|---|---|
748
- | `text` | `string` | Yes | The text content to minimize |
749
- | `opts.characterLimit` | `number` | No | Character limit (default: `50,000`) |
750
- | `opts.tip` | `string \| null` | No | Tip string (default: `null`; pass a string to include one) |
764
+ | Parameter | Type | Required | Description |
765
+ | --------------------- | ---------------- | -------- | ---------------------------------------------------------- |
766
+ | `text` | `string` | Yes | The text content to minimize |
767
+ | `opts.characterLimit` | `number` | No | Character limit (default: `50,000`) |
768
+ | `opts.tip` | `string \| null` | No | Tip string (default: `null`; pass a string to include one) |
751
769
 
752
770
  **Returns:** `Record<string, unknown>`
753
771
 
@@ -760,7 +778,7 @@ TextArtifacts.minimize("Hello, world!");
760
778
  ```
761
779
 
762
780
  ```json
763
- {"text": "Hello, world!"}
781
+ { "text": "Hello, world!" }
764
782
  ```
765
783
 
766
784
  Long text (over limit):
@@ -787,13 +805,13 @@ TextArtifacts.minimize("x".repeat(60_000));
787
805
 
788
806
  View structured data with optional filtering. Navigate with `jsonPath`, then filter with `rows`/`columns`.
789
807
 
790
- | Parameter | Type | Required | Description |
791
- |---|---|---|---|
792
- | `data` | `unknown` | Yes | The data to view |
793
- | `opts.jsonPath` | `string \| null` | No | Dot-separated path to extract specific fields |
794
- | `opts.rows` | `number \| number[] \| string \| null` | No | Row selection |
795
- | `opts.columns` | `string \| string[] \| null` | No | Column selection |
796
- | `opts.characterLimit` | `number` | No | Maximum output size (default: `50,000`) |
808
+ | Parameter | Type | Required | Description |
809
+ | --------------------- | -------------------------------------- | -------- | --------------------------------------------- |
810
+ | `data` | `unknown` | Yes | The data to view |
811
+ | `opts.jsonPath` | `string \| null` | No | Dot-separated path to extract specific fields |
812
+ | `opts.rows` | `number \| number[] \| string \| null` | No | Row selection |
813
+ | `opts.columns` | `string \| string[] \| null` | No | Column selection |
814
+ | `opts.characterLimit` | `number` | No | Maximum output size (default: `50,000`) |
797
815
 
798
816
  **Returns:** `unknown` (filtered data)
799
817
 
@@ -815,8 +833,8 @@ Example result:
815
833
 
816
834
  ```json
817
835
  [
818
- {"name": "Alice", "department": "Engineering"},
819
- {"name": "Bob", "department": "Design"}
836
+ { "name": "Alice", "department": "Engineering" },
837
+ { "name": "Bob", "department": "Design" }
820
838
  ]
821
839
  ```
822
840
 
@@ -824,12 +842,12 @@ Example result:
824
842
 
825
843
  Minimize data content for display based on type. Automatically selects the best strategy: list-of-objects gets a table summary, dicts get string truncation, strings delegate to `TextArtifacts.minimize`.
826
844
 
827
- | Parameter | Type | Required | Description |
828
- |---|---|---|---|
829
- | `data` | `unknown` | Yes | The data to minimize |
830
- | `opts.characterLimit` | `number` | No | Character limit (default: `50,000`) |
831
- | `opts.minimizedObjectStringLength` | `number` | No | Max string length in objects (default: `5,000`) |
832
- | `opts.tip` | `string \| null` | No | Tip string (default: `null`; pass a string to include one) |
845
+ | Parameter | Type | Required | Description |
846
+ | ---------------------------------- | ---------------- | -------- | ---------------------------------------------------------- |
847
+ | `data` | `unknown` | Yes | The data to minimize |
848
+ | `opts.characterLimit` | `number` | No | Character limit (default: `50,000`) |
849
+ | `opts.minimizedObjectStringLength` | `number` | No | Max string length in objects (default: `5,000`) |
850
+ | `opts.tip` | `string \| null` | No | Tip string (default: `null`; pass a string to include one) |
833
851
 
834
852
  **Returns:** `Record<string, unknown>`
835
853
 
@@ -868,46 +886,52 @@ DataArtifacts.minimize(data, { characterLimit: 100, minimizedObjectStringLength:
868
886
  {
869
887
  "count": 100,
870
888
  "unique_count": 100,
871
- "types": [{
872
- "name": "string",
873
- "count": 100,
874
- "percentage": 100.0,
875
- "sample_value": "Employee 42",
876
- "length_minimum": 10,
877
- "length_maximum": 11,
878
- "length_average": 10.9,
879
- "length_stdev": 0.3
880
- }],
889
+ "types": [
890
+ {
891
+ "name": "string",
892
+ "count": 100,
893
+ "percentage": 100.0,
894
+ "sample_value": "Employee 42",
895
+ "length_minimum": 10,
896
+ "length_maximum": 11,
897
+ "length_average": 10.9,
898
+ "length_stdev": 0.3
899
+ }
900
+ ],
881
901
  "name": "name"
882
902
  },
883
903
  {
884
904
  "count": 100,
885
905
  "unique_count": 4,
886
- "types": [{
887
- "name": "string",
888
- "count": 100,
889
- "percentage": 100.0,
890
- "sample_value": "Engineering",
891
- "length_minimum": 5,
892
- "length_maximum": 11,
893
- "length_average": 7.75,
894
- "length_stdev": 2.4
895
- }],
906
+ "types": [
907
+ {
908
+ "name": "string",
909
+ "count": 100,
910
+ "percentage": 100.0,
911
+ "sample_value": "Engineering",
912
+ "length_minimum": 5,
913
+ "length_maximum": 11,
914
+ "length_average": 7.75,
915
+ "length_stdev": 2.4
916
+ }
917
+ ],
896
918
  "name": "department"
897
919
  },
898
920
  {
899
921
  "count": 100,
900
922
  "unique_count": 100,
901
- "types": [{
902
- "name": "int",
903
- "count": 100,
904
- "percentage": 100.0,
905
- "sample_value": 75000,
906
- "minimum": 60000,
907
- "maximum": 109500,
908
- "average": 84750,
909
- "stdev": 14505.75
910
- }],
923
+ "types": [
924
+ {
925
+ "name": "int",
926
+ "count": 100,
927
+ "percentage": 100.0,
928
+ "sample_value": 75000,
929
+ "minimum": 60000,
930
+ "maximum": 109500,
931
+ "average": 84750,
932
+ "stdev": 14505.75
933
+ }
934
+ ],
911
935
  "name": "salary"
912
936
  }
913
937
  ],
@@ -922,9 +946,9 @@ DataArtifacts.minimize(data, { characterLimit: 100, minimizedObjectStringLength:
922
946
 
923
947
  Generate a summary of tabular data (array of objects). Returns one summary object per column with count, unique count, and per-type statistics.
924
948
 
925
- | Parameter | Type | Required | Description |
926
- |---|---|---|---|
927
- | `data` | `Record<string, unknown>[]` | Yes | Table rows |
949
+ | Parameter | Type | Required | Description |
950
+ | --------- | --------------------------- | -------- | ----------- |
951
+ | `data` | `Record<string, unknown>[]` | Yes | Table rows |
928
952
 
929
953
  **Returns:** `Record<string, unknown>[]`
930
954
 
@@ -1000,9 +1024,9 @@ DataArtifacts.summarizeTable(data);
1000
1024
 
1001
1025
  Generate statistics for a list of values (like a single column). Includes count, unique count, and per-type statistics (min/max/avg/stdev for numbers, length stats for strings, etc.). If the summary would be larger than the original values, the original list is returned instead (inflation guard).
1002
1026
 
1003
- | Parameter | Type | Required | Description |
1004
- |---|---|---|---|
1005
- | `values` | `unknown[]` | Yes | Values to summarize |
1027
+ | Parameter | Type | Required | Description |
1028
+ | --------- | ----------- | -------- | ------------------- |
1029
+ | `values` | `unknown[]` | Yes | Values to summarize |
1006
1030
 
1007
1031
  **Returns:** `Record<string, unknown> | unknown[]`
1008
1032
 
@@ -1010,9 +1034,17 @@ Generate statistics for a list of values (like a single column). Includes count,
1010
1034
  import { DataArtifacts } from "@a2anet/a2a-utils";
1011
1035
 
1012
1036
  const salaries = [
1013
- 95000, 72000, 105000, 68000, 88000,
1037
+ 95000,
1038
+ 72000,
1039
+ 105000,
1040
+ 68000,
1041
+ 88000,
1014
1042
  // ... ~100 salary values total, with some nulls
1015
- null, 115000, 92000, null, 78000,
1043
+ null,
1044
+ 115000,
1045
+ 92000,
1046
+ null,
1047
+ 78000,
1016
1048
  ];
1017
1049
 
1018
1050
  DataArtifacts.summarizeValues(salaries);
@@ -1047,14 +1079,14 @@ DataArtifacts.summarizeValues(salaries);
1047
1079
 
1048
1080
  Minimize a list of artifacts for LLM display. Called automatically by `A2ATools.sendMessage`. Combines all TextParts within each artifact into a single [`TextPartForLLM`](#textpartforllm). Handles `FilePart`s by including file metadata and saved paths.
1049
1081
 
1050
- | Parameter | Type | Required | Description |
1051
- |---|---|---|---|
1052
- | `artifacts` | `Artifact[]` | Yes | List of artifacts to minimize |
1053
- | `opts.characterLimit` | `number` | No | Character limit (default: `50,000`) |
1054
- | `opts.minimizedObjectStringLength` | `number` | No | Max string length in objects (default: `5,000`) |
1055
- | `opts.savedFilePaths` | `Record<string, string[]> \| null` | No | Mapping of artifactId to saved file paths |
1056
- | `opts.textTip` | `string \| null` | No | Tip string for minimized text artifacts (default: `null`) |
1057
- | `opts.dataTip` | `string \| null` | No | Tip string for minimized data artifacts (default: `null`) |
1082
+ | Parameter | Type | Required | Description |
1083
+ | ---------------------------------- | ---------------------------------- | -------- | --------------------------------------------------------- |
1084
+ | `artifacts` | `Artifact[]` | Yes | List of artifacts to minimize |
1085
+ | `opts.characterLimit` | `number` | No | Character limit (default: `50,000`) |
1086
+ | `opts.minimizedObjectStringLength` | `number` | No | Max string length in objects (default: `5,000`) |
1087
+ | `opts.savedFilePaths` | `Record<string, string[]> \| null` | No | Mapping of artifactId to saved file paths |
1088
+ | `opts.textTip` | `string \| null` | No | Tip string for minimized text artifacts (default: `null`) |
1089
+ | `opts.dataTip` | `string \| null` | No | Tip string for minimized data artifacts (default: `null`) |
1058
1090
 
1059
1091
  **Returns:** [`ArtifactForLLM`](#artifactforllm)`[]`
1060
1092
 
@@ -1073,14 +1105,16 @@ const artifacts: Artifact[] = [
1073
1105
  artifactId: "art-456",
1074
1106
  description: "Company employee directory with names, departments, and salaries.",
1075
1107
  name: "Employee Directory",
1076
- parts: [{
1077
- kind: "data",
1078
- data: Array.from({ length: 100 }, (_, i) => ({
1079
- name: `Employee ${i}`,
1080
- department: ["Eng", "Marketing", "Design", "Sales"][i % 4],
1081
- salary: 60_000 + i * 500,
1082
- })),
1083
- }],
1108
+ parts: [
1109
+ {
1110
+ kind: "data",
1111
+ data: Array.from({ length: 100 }, (_, i) => ({
1112
+ name: `Employee ${i}`,
1113
+ department: ["Eng", "Marketing", "Design", "Sales"][i % 4],
1114
+ salary: 60_000 + i * 500,
1115
+ })),
1116
+ },
1117
+ ],
1084
1118
  },
1085
1119
  {
1086
1120
  artifactId: "art-789",
@@ -1195,14 +1229,14 @@ const agent: AgentURLAndCustomHeaders = {
1195
1229
  };
1196
1230
  ```
1197
1231
 
1198
- | Field | Type |
1199
- |---|---|
1200
- | `agentCard` | `AgentCard` |
1232
+ | Field | Type |
1233
+ | --------------- | ------------------------ |
1234
+ | `agentCard` | `AgentCard` |
1201
1235
  | `customHeaders` | `Record<string, string>` |
1202
1236
 
1203
1237
  #### `TaskForLLM`
1204
1238
 
1205
- Returned by `A2ATools.sendMessage()` for task responses.
1239
+ Returned by `A2ATools.sendMessage.execute()` for task responses.
1206
1240
 
1207
1241
  ```typescript
1208
1242
  const task: TaskForLLM = {
@@ -1265,17 +1299,17 @@ const task: TaskForLLM = {
1265
1299
  };
1266
1300
  ```
1267
1301
 
1268
- | Field | Type |
1269
- |---|---|
1270
- | `id` | `string` |
1271
- | `contextId` | `string` |
1272
- | `kind` | `string` (`"task"`) |
1273
- | `status` | [`TaskStatusForLLM`](#taskstatusforllm) |
1302
+ | Field | Type |
1303
+ | ----------- | --------------------------------------- |
1304
+ | `id` | `string` |
1305
+ | `contextId` | `string` |
1306
+ | `kind` | `string` (`"task"`) |
1307
+ | `status` | [`TaskStatusForLLM`](#taskstatusforllm) |
1274
1308
  | `artifacts` | [`ArtifactForLLM`](#artifactforllm)`[]` |
1275
1309
 
1276
1310
  #### `MessageForLLM`
1277
1311
 
1278
- Returned by `A2ATools.sendMessage()` for message-only responses, or as `TaskStatusForLLM.message`.
1312
+ Returned by `A2ATools.sendMessage.execute()` for message-only responses, or as `TaskStatusForLLM.message`.
1279
1313
 
1280
1314
  ```typescript
1281
1315
  const message: MessageForLLM = {
@@ -1290,11 +1324,11 @@ const message: MessageForLLM = {
1290
1324
  };
1291
1325
  ```
1292
1326
 
1293
- | Field | Type |
1294
- |---|---|
1295
- | `contextId` | `string \| null` |
1296
- | `kind` | `string` (`"message"`) |
1297
- | `parts` | ([`TextPartForLLM`](#textpartforllm) \| [`DataPartForLLM`](#datapartforllm) \| [`FilePartForLLM`](#filepartforllm))[] |
1327
+ | Field | Type |
1328
+ | ----------- | --------------------------------------------------------------------------------------------------------------------- |
1329
+ | `contextId` | `string \| null` |
1330
+ | `kind` | `string` (`"message"`) |
1331
+ | `parts` | ([`TextPartForLLM`](#textpartforllm) \| [`DataPartForLLM`](#datapartforllm) \| [`FilePartForLLM`](#filepartforllm))[] |
1298
1332
 
1299
1333
  #### `TaskStatusForLLM`
1300
1334
 
@@ -1314,14 +1348,14 @@ const taskStatus: TaskStatusForLLM = {
1314
1348
  };
1315
1349
  ```
1316
1350
 
1317
- | Field | Type |
1318
- |---|---|
1319
- | `state` | `TaskState` |
1351
+ | Field | Type |
1352
+ | --------- | ------------------------------------------- |
1353
+ | `state` | `TaskState` |
1320
1354
  | `message` | [`MessageForLLM`](#messageforllm) `\| null` |
1321
1355
 
1322
1356
  #### `ArtifactForLLM`
1323
1357
 
1324
- Returned by `viewTextArtifact()`, `viewDataArtifact()`, and `minimizeArtifacts()`. Used in `TaskForLLM.artifacts`.
1358
+ Returned by `viewTextArtifact.execute()`, `viewDataArtifact.execute()`, and `minimizeArtifacts()`. Used in `TaskForLLM.artifacts`.
1325
1359
 
1326
1360
  ```typescript
1327
1361
  const artifact: ArtifactForLLM = {
@@ -1337,12 +1371,12 @@ const artifact: ArtifactForLLM = {
1337
1371
  };
1338
1372
  ```
1339
1373
 
1340
- | Field | Type |
1341
- |---|---|
1342
- | `artifactId` | `string` |
1343
- | `description` | `string \| null` |
1344
- | `name` | `string \| null` |
1345
- | `parts` | ([`TextPartForLLM`](#textpartforllm) \| [`DataPartForLLM`](#datapartforllm) \| [`FilePartForLLM`](#filepartforllm))[] |
1374
+ | Field | Type |
1375
+ | ------------- | --------------------------------------------------------------------------------------------------------------------- |
1376
+ | `artifactId` | `string` |
1377
+ | `description` | `string \| null` |
1378
+ | `name` | `string \| null` |
1379
+ | `parts` | ([`TextPartForLLM`](#textpartforllm) \| [`DataPartForLLM`](#datapartforllm) \| [`FilePartForLLM`](#filepartforllm))[] |
1346
1380
 
1347
1381
  #### `TextPartForLLM`
1348
1382
 
@@ -1353,10 +1387,10 @@ const textPart: TextPartForLLM = {
1353
1387
  };
1354
1388
  ```
1355
1389
 
1356
- | Field | Type |
1357
- |---|---|
1390
+ | Field | Type |
1391
+ | ------ | ------------------- |
1358
1392
  | `kind` | `string` (`"text"`) |
1359
- | `text` | `string` |
1393
+ | `text` | `string` |
1360
1394
 
1361
1395
  #### `DataPartForLLM`
1362
1396
 
@@ -1383,10 +1417,10 @@ const dataPart: DataPartForLLM = {
1383
1417
  };
1384
1418
  ```
1385
1419
 
1386
- | Field | Type |
1387
- |---|---|
1420
+ | Field | Type |
1421
+ | ------ | ------------------- |
1388
1422
  | `kind` | `string` (`"data"`) |
1389
- | `data` | `unknown` |
1423
+ | `data` | `unknown` |
1390
1424
 
1391
1425
  #### `FilePartForLLM`
1392
1426
 
@@ -1399,20 +1433,18 @@ const filePart: FilePartForLLM = {
1399
1433
  mimeType: "application/pdf",
1400
1434
  uri: null,
1401
1435
  bytes: {
1402
- _saved_to: [
1403
- "./storage/files/task-123/art-789/q4-report.pdf",
1404
- ],
1436
+ _saved_to: ["./storage/files/task-123/art-789/q4-report.pdf"],
1405
1437
  },
1406
1438
  };
1407
1439
  ```
1408
1440
 
1409
- | Field | Type | Description |
1410
- |---|---|---|
1411
- | `kind` | `string` (`"file"`) | Always `"file"` |
1412
- | `name` | `string \| null` | Filename from the original FilePart |
1413
- | `mimeType` | `string \| null` | MIME type from the original FilePart |
1414
- | `uri` | `string \| Record<string, unknown> \| null` | Raw URI (no FileStore) or `{"_saved_to": [...]}` (FileStore saved it) |
1415
- | `bytes` | `Record<string, unknown> \| null` | `{"_saved_to": [...]}` (FileStore saved it) or `{"_error": "..."}` (no FileStore) |
1441
+ | Field | Type | Description |
1442
+ | ---------- | ------------------------------------------- | --------------------------------------------------------------------------------- |
1443
+ | `kind` | `string` (`"file"`) | Always `"file"` |
1444
+ | `name` | `string \| null` | Filename from the original FilePart |
1445
+ | `mimeType` | `string \| null` | MIME type from the original FilePart |
1446
+ | `uri` | `string \| Record<string, unknown> \| null` | Raw URI (no FileStore) or `{"_saved_to": [...]}` (FileStore saved it) |
1447
+ | `bytes` | `Record<string, unknown> \| null` | `{"_saved_to": [...]}` (FileStore saved it) or `{"_error": "..."}` (no FileStore) |
1416
1448
 
1417
1449
  ## 📄 License
1418
1450