@artinet/sdk 0.5.15 → 0.5.17

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.
Files changed (34) hide show
  1. package/README.md +11 -34
  2. package/dist/server/express/server.d.ts +24 -24
  3. package/dist/services/a2a/factory/builder.d.ts +26 -26
  4. package/dist/services/a2a/factory/builder.js +38 -72
  5. package/dist/services/a2a/factory/service.js +2 -1
  6. package/dist/services/a2a/helpers/agentcard-builder.d.ts +7 -0
  7. package/dist/services/a2a/helpers/agentcard-builder.js +22 -0
  8. package/dist/services/a2a/helpers/index.d.ts +1 -0
  9. package/dist/services/a2a/helpers/index.js +1 -0
  10. package/dist/services/a2a/methods/get-task.d.ts +46 -46
  11. package/dist/services/a2a/service.d.ts +152 -152
  12. package/dist/transport/trpc/a2a/factory/router.d.ts +1084 -1084
  13. package/dist/transport/trpc/a2a/routes/info.d.ts +36 -36
  14. package/dist/transport/trpc/a2a/routes/message/route.d.ts +225 -225
  15. package/dist/transport/trpc/a2a/routes/tasks/route.d.ts +257 -257
  16. package/dist/transport/trpc/a2a/trpc.d.ts +120 -120
  17. package/dist/types/interfaces/services/a2a/service.d.ts +2 -1
  18. package/dist/types/schemas/a2a/agent.d.ts +818 -818
  19. package/dist/types/schemas/a2a/agent.js +1 -23
  20. package/dist/types/schemas/a2a/auth.d.ts +197 -197
  21. package/dist/types/schemas/a2a/auth.js +4 -19
  22. package/dist/types/schemas/a2a/error.d.ts +24 -24
  23. package/dist/types/schemas/a2a/message.d.ts +4499 -4499
  24. package/dist/types/schemas/a2a/message.js +2 -10
  25. package/dist/types/schemas/a2a/notification.d.ts +403 -403
  26. package/dist/types/schemas/a2a/notification.js +3 -7
  27. package/dist/types/schemas/a2a/parameters.d.ts +264 -264
  28. package/dist/types/schemas/a2a/parameters.js +1 -14
  29. package/dist/types/schemas/a2a/protocol.d.ts +5988 -5988
  30. package/dist/types/schemas/a2a/rpc.d.ts +20 -20
  31. package/dist/types/schemas/a2a/rpc.js +0 -5
  32. package/dist/types/schemas/a2a/task.d.ts +2513 -2513
  33. package/dist/types/schemas/a2a/task.js +10 -11
  34. package/package.json +1 -1
package/README.md CHANGED
@@ -71,7 +71,10 @@ It has [serveral template projects](https://github.com/the-artinet-project/creat
71
71
  - The examples folder will be removed in favor of [`create-agent`](https://github.com/the-artinet-project/create-agent).
72
72
  - In `Task` the `contextId` field is now required (inline with the A2A spec).
73
73
  - In `AgentSkill` the `tag` field is now required (inline with the A2A spec).
74
- - Optional fields in Agent2Agent schema fields are now nullable for better interoperability.
74
+ - ~~Optional fields in Agent2Agent Zod schemas are now nullable for better interoperability.~~ **Nullable Schemas have been reverted.**
75
+ - The `EngineBuilder` constructor is now protected and open for extension.
76
+ - `AgentBuilder` will now throw an error if it recieves an invalid `FilePart`.
77
+ - `createAgent`/`createService` can now take a single string (i.e. agentName) as valid value for the AgentCard and will populate the rest of the required fields with placeholder values (see `src/services/a2a/helpers/agentcard-builder.ts` for reference).
75
78
 
76
79
  ## Installation
77
80
 
@@ -112,21 +115,13 @@ const { app, agent } = createAgentServer({
112
115
  return `You said: ${userInput}`;
113
116
  })
114
117
  .createAgent({
115
- agentCard: {
116
- name: "QuickStart Agent",
117
- description: "A simple agent that echoes the user's message",
118
- url: "http://localhost:4000/a2a",
119
- version: "0.1.0",
120
- capabilities: { streaming: true },
121
- skills: [{ id: "echo", name: "Echo Skill" }],
122
- ...
123
- },
118
+ agentCard: "QuickStart Agent",
124
119
  }),
125
120
  basePath: "/a2a"
126
121
  });
127
122
 
128
- app.listen(4000, () => {
129
- console.log("A2A Server running at http://localhost:4000/a2a");
123
+ app.listen(3000, () => {
124
+ console.log("A2A Server running at http://localhost:3000/a2a");
130
125
  });
131
126
  ```
132
127
 
@@ -136,7 +131,7 @@ app.listen(4000, () => {
136
131
  import { A2AClient, TaskStatusUpdateEvent } from "@artinet/sdk";
137
132
 
138
133
  async function runClient() {
139
- const client = new A2AClient("http://localhost:4000/a2a");
134
+ const client = new A2AClient("http://localhost:3000/a2a");
140
135
 
141
136
  const stream = client.sendStreamingMessage("Hello World!");
142
137
 
@@ -269,13 +264,7 @@ const { app, agent } = createAgentServer({
269
264
  return `Task completed. Status: ${status}`;
270
265
  }) //A final Task is returned to the caller which contains all of the emitted parts.
271
266
  .createAgent({
272
- agentCard: {
273
- name: "Multi-Step Agent",
274
- url: "http://localhost:3000/a2a",
275
- version: "1.0.0",
276
- capabilities: { streaming: true },
277
- skills: [{ id: "multi-processor", name: "Multi-Step Processor" }],
278
- },
267
+ agentCard: "Multi-Step Agent",
279
268
  }),
280
269
  basePath: "/a2a",
281
270
  });
@@ -380,13 +369,7 @@ const agent = createAgent({
380
369
  ...
381
370
  });
382
371
  },
383
- agentCard: {
384
- name: "Event-Monitored Agent",
385
- url: "http://localhost:3000/a2a",
386
- version: "1.0.0",
387
- capabilities: { streaming: true },
388
- skills: [{ id: "monitor", name: "Monitored Agent" }],
389
- },
372
+ agentCard: "Event-Monitored Agent",
390
373
  contexts: customContextManager,
391
374
  tasks: new TaskManager(),
392
375
  eventOverrides: { //for even greater control create your own Event Handlers
@@ -600,13 +583,7 @@ const mcpAgent = createMCPAgent({
600
583
  },
601
584
  agent: createAgent({
602
585
  engine: myAgentEngine,
603
- agentCard: {
604
- name: "My Agent",
605
- url: "http://localhost:3000/a2a",
606
- version: "1.0.0",
607
- capabilities: { streaming: true },
608
- skills: [{ id: "helper", name: "Helper Agent" }],
609
- },
586
+ agentCard: "MCP Agent",
610
587
  }),
611
588
  agentCardUri: "agent://card", //customize the URI for your AgentCard
612
589
  });
@@ -23,48 +23,48 @@ export declare function createAgentServer(params: ServerParams & {
23
23
  parts: ({
24
24
  file: {
25
25
  bytes: string;
26
- name?: string | null | undefined;
27
- mimeType?: string | null | undefined;
28
- uri?: null | undefined;
26
+ name?: string | undefined;
27
+ mimeType?: string | undefined;
28
+ uri?: undefined;
29
29
  } | {
30
30
  uri: string;
31
- name?: string | null | undefined;
32
- bytes?: null | undefined;
33
- mimeType?: string | null | undefined;
31
+ name?: string | undefined;
32
+ bytes?: undefined;
33
+ mimeType?: string | undefined;
34
34
  };
35
35
  kind: "file";
36
- metadata?: Record<string, unknown> | null | undefined;
36
+ metadata?: Record<string, unknown> | undefined;
37
37
  } | {
38
38
  text: string;
39
39
  kind: "text";
40
- metadata?: Record<string, unknown> | null | undefined;
40
+ metadata?: Record<string, unknown> | undefined;
41
41
  } | {
42
42
  data: Record<string, unknown>;
43
43
  kind: "data";
44
- metadata?: Record<string, unknown> | null | undefined;
44
+ metadata?: Record<string, unknown> | undefined;
45
45
  })[];
46
46
  messageId: string;
47
- metadata?: Record<string, unknown> | null | undefined;
48
- extensions?: string[] | null | undefined;
49
- referenceTaskIds?: string[] | null | undefined;
50
- taskId?: string | null | undefined;
51
- contextId?: string | null | undefined;
47
+ metadata?: Record<string, unknown> | undefined;
48
+ extensions?: string[] | undefined;
49
+ referenceTaskIds?: string[] | undefined;
50
+ taskId?: string | undefined;
51
+ contextId?: string | undefined;
52
52
  };
53
- metadata?: Record<string, unknown> | null | undefined;
53
+ metadata?: Record<string, unknown> | undefined;
54
54
  configuration?: {
55
- historyLength?: number | null | undefined;
55
+ historyLength?: number | undefined;
56
56
  pushNotificationConfig?: {
57
57
  url: string;
58
- id?: string | null | undefined;
59
- token?: string | null | undefined;
58
+ id?: string | undefined;
59
+ token?: string | undefined;
60
60
  authentication?: {
61
61
  schemes: string[];
62
- credentials?: string | null | undefined;
63
- } | null | undefined;
64
- } | null | undefined;
65
- acceptedOutputModes?: string[] | null | undefined;
66
- blocking?: boolean | null | undefined;
67
- } | null | undefined;
62
+ credentials?: string | undefined;
63
+ } | undefined;
64
+ } | undefined;
65
+ acceptedOutputModes?: string[] | undefined;
66
+ blocking?: boolean | undefined;
67
+ } | undefined;
68
68
  }, import("../../types/index.js").TaskAndHistory, import("../../types/index.js").UpdateEvent>;
69
69
  };
70
70
  export type ExpressAgentServer = ReturnType<typeof createAgentServer>;
@@ -140,11 +140,11 @@ type OutArgsOf<O> = O extends StepOutputWithForwardArgs<any, infer A> ? A : [];
140
140
  export declare class EngineBuilder<TCommand extends MessageSendParams = MessageSendParams, TInboundArgs extends readonly unknown[] = []> implements StepBuilder<TCommand, TInboundArgs> {
141
141
  private steps;
142
142
  /**
143
- * Private constructor to enforce factory method usage.
143
+ * Protected constructor to enforce factory method usage.
144
144
  *
145
145
  * @param steps - Initial steps array
146
146
  */
147
- private constructor();
147
+ protected constructor(steps?: Array<StepWithKind<TCommand, any, any, any, any, any>>);
148
148
  /**
149
149
  * Creates a new EngineBuilder instance.
150
150
  *
@@ -282,48 +282,48 @@ export declare const AgentBuilder: () => EngineBuilder<{
282
282
  parts: ({
283
283
  file: {
284
284
  bytes: string;
285
- name?: string | null | undefined;
286
- mimeType?: string | null | undefined;
287
- uri?: null | undefined;
285
+ name?: string | undefined;
286
+ mimeType?: string | undefined;
287
+ uri?: undefined;
288
288
  } | {
289
289
  uri: string;
290
- name?: string | null | undefined;
291
- bytes?: null | undefined;
292
- mimeType?: string | null | undefined;
290
+ name?: string | undefined;
291
+ bytes?: undefined;
292
+ mimeType?: string | undefined;
293
293
  };
294
294
  kind: "file";
295
- metadata?: Record<string, unknown> | null | undefined;
295
+ metadata?: Record<string, unknown> | undefined;
296
296
  } | {
297
297
  text: string;
298
298
  kind: "text";
299
- metadata?: Record<string, unknown> | null | undefined;
299
+ metadata?: Record<string, unknown> | undefined;
300
300
  } | {
301
301
  data: Record<string, unknown>;
302
302
  kind: "data";
303
- metadata?: Record<string, unknown> | null | undefined;
303
+ metadata?: Record<string, unknown> | undefined;
304
304
  })[];
305
305
  messageId: string;
306
- metadata?: Record<string, unknown> | null | undefined;
307
- extensions?: string[] | null | undefined;
308
- referenceTaskIds?: string[] | null | undefined;
309
- taskId?: string | null | undefined;
310
- contextId?: string | null | undefined;
306
+ metadata?: Record<string, unknown> | undefined;
307
+ extensions?: string[] | undefined;
308
+ referenceTaskIds?: string[] | undefined;
309
+ taskId?: string | undefined;
310
+ contextId?: string | undefined;
311
311
  };
312
- metadata?: Record<string, unknown> | null | undefined;
312
+ metadata?: Record<string, unknown> | undefined;
313
313
  configuration?: {
314
- historyLength?: number | null | undefined;
314
+ historyLength?: number | undefined;
315
315
  pushNotificationConfig?: {
316
316
  url: string;
317
- id?: string | null | undefined;
318
- token?: string | null | undefined;
317
+ id?: string | undefined;
318
+ token?: string | undefined;
319
319
  authentication?: {
320
320
  schemes: string[];
321
- credentials?: string | null | undefined;
322
- } | null | undefined;
323
- } | null | undefined;
324
- acceptedOutputModes?: string[] | null | undefined;
325
- blocking?: boolean | null | undefined;
326
- } | null | undefined;
321
+ credentials?: string | undefined;
322
+ } | undefined;
323
+ } | undefined;
324
+ acceptedOutputModes?: string[] | undefined;
325
+ blocking?: boolean | undefined;
326
+ } | undefined;
327
327
  }, []>;
328
328
  /**
329
329
  * Creates an agent execution engine from a list of workflow steps.
@@ -18,6 +18,7 @@ import { TaskState, } from "../../../types/index.js";
18
18
  import { createAgent } from "./service.js";
19
19
  import { v4 as uuidv4 } from "uuid";
20
20
  import { getContent } from "../helpers/content.js";
21
+ import { SUBMITTED_UPDATE, WORKING_UPDATE } from "../../../utils/index.js";
21
22
  /**
22
23
  * Fluent builder for constructing A2A agent execution engines.
23
24
  *
@@ -50,7 +51,7 @@ export class EngineBuilder {
50
51
  //@typescript-eslint/no-explicit-any
51
52
  steps = [];
52
53
  /**
53
- * Private constructor to enforce factory method usage.
54
+ * Protected constructor to enforce factory method usage.
54
55
  *
55
56
  * @param steps - Initial steps array
56
57
  */
@@ -231,23 +232,27 @@ const partToMessagePart = (kind, part) => {
231
232
  }
232
233
  case "file": {
233
234
  const filePart = part;
234
- return filePart.uri
235
- ? {
235
+ if (filePart.uri) {
236
+ return {
236
237
  kind: "file",
237
238
  file: {
238
239
  uri: filePart.uri,
239
240
  name: filePart.name,
240
241
  mimeType: filePart.mimeType,
241
242
  },
242
- }
243
- : {
244
- kind: "file",
245
- file: {
246
- bytes: filePart.bytes ?? "",
247
- name: filePart.name,
248
- mimeType: filePart.mimeType,
249
- },
250
243
  };
244
+ }
245
+ if (!filePart.bytes) {
246
+ throw new Error("File bytes are required when uri is not provided");
247
+ }
248
+ return {
249
+ kind: "file",
250
+ file: {
251
+ bytes: filePart.bytes,
252
+ name: filePart.name,
253
+ mimeType: filePart.mimeType,
254
+ },
255
+ };
251
256
  }
252
257
  case "data": {
253
258
  return { kind: "data", data: part };
@@ -287,21 +292,12 @@ export function createAgentExecutor(stepsList) {
287
292
  content: content,
288
293
  args: [],
289
294
  };
290
- const contextId = context.contextId ?? context.command.message.contextId;
291
- const taskId = context.State().task.id ?? context.command.message.taskId;
295
+ const contextId = context.contextId;
296
+ const taskId = context.State().task.id;
292
297
  if (!contextId || !taskId) {
293
298
  throw new Error("Context ID and task ID are required");
294
299
  }
295
- const taskStarted = {
296
- taskId: taskId,
297
- contextId: contextId,
298
- kind: "status-update",
299
- status: {
300
- state: TaskState.submitted,
301
- timestamp: new Date().toISOString(),
302
- },
303
- final: false,
304
- };
300
+ const taskStarted = SUBMITTED_UPDATE(taskId, contextId);
305
301
  yield taskStarted;
306
302
  const finalMessage = {
307
303
  taskId: taskId,
@@ -316,65 +312,35 @@ export function createAgentExecutor(stepsList) {
316
312
  let parts = [];
317
313
  if (Array.isArray(ret)) {
318
314
  parts = ret.map((part) => partToMessagePart(step.kind, part));
319
- const taskStatusUpdate = {
320
- taskId: taskId,
321
- contextId: contextId,
322
- kind: "status-update",
323
- status: {
324
- state: TaskState.working,
325
- timestamp: new Date().toISOString(),
326
- message: {
327
- messageId: uuidv4(),
328
- kind: "message",
329
- role: "agent",
330
- parts: parts,
331
- },
332
- },
333
- final: false,
334
- };
315
+ const taskStatusUpdate = WORKING_UPDATE(taskId, contextId, {
316
+ messageId: uuidv4(),
317
+ kind: "message",
318
+ role: "agent",
319
+ parts: parts,
320
+ });
335
321
  yield taskStatusUpdate;
336
322
  }
337
- else if (typeof ret === "object") {
323
+ else if (ret !== null && typeof ret === "object") {
338
324
  parts = Array.isArray(ret.parts)
339
325
  ? ret.parts.map((part) => partToMessagePart(step.kind, part))
340
326
  : [partToMessagePart(step.kind, ret.parts)];
341
- const taskStatusUpdate = {
342
- taskId: taskId,
343
- contextId: contextId,
344
- kind: "status-update",
345
- status: {
346
- state: TaskState.working,
347
- timestamp: new Date().toISOString(),
348
- message: {
349
- messageId: uuidv4(),
350
- kind: "message",
351
- role: "agent",
352
- parts: parts,
353
- },
354
- },
355
- final: false,
356
- };
327
+ const taskStatusUpdate = WORKING_UPDATE(taskId, contextId, {
328
+ messageId: uuidv4(),
329
+ kind: "message",
330
+ role: "agent",
331
+ parts: parts,
332
+ });
357
333
  yield taskStatusUpdate;
358
334
  stepArgs.args = ret.args;
359
335
  }
360
336
  else {
361
337
  parts = [partToMessagePart(step.kind, ret)];
362
- const taskStatusUpdate = {
363
- taskId: taskId,
364
- contextId: contextId,
365
- kind: "status-update",
366
- status: {
367
- state: TaskState.working,
368
- timestamp: new Date().toISOString(),
369
- message: {
370
- messageId: uuidv4(),
371
- kind: "message",
372
- role: "agent",
373
- parts: parts,
374
- },
375
- },
376
- final: false,
377
- };
338
+ const taskStatusUpdate = WORKING_UPDATE(taskId, contextId, {
339
+ messageId: uuidv4(),
340
+ kind: "message",
341
+ role: "agent",
342
+ parts: parts,
343
+ });
378
344
  yield taskStatusUpdate;
379
345
  }
380
346
  finalMessage.parts.push(...parts);
@@ -5,7 +5,8 @@
5
5
  import { A2AService } from "../service.js";
6
6
  import { ContextManager, ConnectionManager, CancellationManager, TaskManager, } from "../managers/index.js";
7
7
  import { createMethods } from "./method.js";
8
+ import { createAgentCard } from "../helpers/agentcard-builder.js";
8
9
  export function createService(params) {
9
- return new A2AService(params.agentCard, params.engine, params.contexts ?? new ContextManager(), params.connections ?? new ConnectionManager(), params.cancellations ?? new CancellationManager(), params.tasks ?? new TaskManager(), createMethods(params.methods), params.events);
10
+ return new A2AService(createAgentCard(params.agentCard), params.engine, params.contexts ?? new ContextManager(), params.connections ?? new ConnectionManager(), params.cancellations ?? new CancellationManager(), params.tasks ?? new TaskManager(), createMethods(params.methods), params.events);
10
11
  }
11
12
  export const createAgent = createService;
@@ -0,0 +1,7 @@
1
+ import { AgentCard, AgentCardParams } from "../../../types/index.js";
2
+ export declare class AgentCardBuilder {
3
+ agentCard: AgentCard;
4
+ constructor(agentCard: Partial<AgentCard> & Required<Pick<AgentCard, "name">>);
5
+ valueOf(): AgentCard;
6
+ }
7
+ export declare function createAgentCard(agentCard: AgentCardParams): AgentCard;
@@ -0,0 +1,22 @@
1
+ export class AgentCardBuilder {
2
+ agentCard;
3
+ constructor(agentCard) {
4
+ this.agentCard = {
5
+ ...agentCard,
6
+ protocolVersion: agentCard.protocolVersion ?? "0.3.0",
7
+ description: agentCard.description ?? "An agent that can use the A2A protocol.",
8
+ url: agentCard.url ?? "https://localhost:3000/a2a",
9
+ version: agentCard.version ?? "0.0.0",
10
+ capabilities: agentCard.capabilities ?? {},
11
+ defaultInputModes: agentCard.defaultInputModes ?? [],
12
+ defaultOutputModes: agentCard.defaultOutputModes ?? [],
13
+ skills: agentCard.skills ?? [],
14
+ };
15
+ }
16
+ valueOf() {
17
+ return this.agentCard;
18
+ }
19
+ }
20
+ export function createAgentCard(agentCard) {
21
+ return new AgentCardBuilder(typeof agentCard === "string" ? { name: agentCard } : agentCard).valueOf();
22
+ }
@@ -1,3 +1,4 @@
1
1
  export * from "./part.js";
2
2
  export * from "./content.js";
3
3
  export * from "./message-builder.js";
4
+ export * from "./agentcard-builder.js";
@@ -1,3 +1,4 @@
1
1
  export * from "./part.js";
2
2
  export * from "./content.js";
3
3
  export * from "./message-builder.js";
4
+ export * from "./agentcard-builder.js";
@@ -13,100 +13,100 @@ export declare function getTask(input: TaskQueryParams, params: Omit<MethodParam
13
13
  parts: ({
14
14
  file: {
15
15
  bytes: string;
16
- name?: string | null | undefined;
17
- mimeType?: string | null | undefined;
18
- uri?: null | undefined;
16
+ name?: string | undefined;
17
+ mimeType?: string | undefined;
18
+ uri?: undefined;
19
19
  } | {
20
20
  uri: string;
21
- name?: string | null | undefined;
22
- bytes?: null | undefined;
23
- mimeType?: string | null | undefined;
21
+ name?: string | undefined;
22
+ bytes?: undefined;
23
+ mimeType?: string | undefined;
24
24
  };
25
25
  kind: "file";
26
- metadata?: Record<string, unknown> | null | undefined;
26
+ metadata?: Record<string, unknown> | undefined;
27
27
  } | {
28
28
  text: string;
29
29
  kind: "text";
30
- metadata?: Record<string, unknown> | null | undefined;
30
+ metadata?: Record<string, unknown> | undefined;
31
31
  } | {
32
32
  data: Record<string, unknown>;
33
33
  kind: "data";
34
- metadata?: Record<string, unknown> | null | undefined;
34
+ metadata?: Record<string, unknown> | undefined;
35
35
  })[];
36
36
  messageId: string;
37
- metadata?: Record<string, unknown> | null | undefined;
38
- extensions?: string[] | null | undefined;
39
- referenceTaskIds?: string[] | null | undefined;
40
- taskId?: string | null | undefined;
41
- contextId?: string | null | undefined;
42
- } | null | undefined;
43
- timestamp?: string | null | undefined;
37
+ metadata?: Record<string, unknown> | undefined;
38
+ extensions?: string[] | undefined;
39
+ referenceTaskIds?: string[] | undefined;
40
+ taskId?: string | undefined;
41
+ contextId?: string | undefined;
42
+ } | undefined;
43
+ timestamp?: string | undefined;
44
44
  };
45
45
  kind: "task";
46
46
  contextId: string;
47
- metadata?: Record<string, unknown> | null | undefined;
47
+ metadata?: Record<string, unknown> | undefined;
48
48
  history?: {
49
49
  role: "user" | "agent";
50
50
  kind: "message";
51
51
  parts: ({
52
52
  file: {
53
53
  bytes: string;
54
- name?: string | null | undefined;
55
- mimeType?: string | null | undefined;
56
- uri?: null | undefined;
54
+ name?: string | undefined;
55
+ mimeType?: string | undefined;
56
+ uri?: undefined;
57
57
  } | {
58
58
  uri: string;
59
- name?: string | null | undefined;
60
- bytes?: null | undefined;
61
- mimeType?: string | null | undefined;
59
+ name?: string | undefined;
60
+ bytes?: undefined;
61
+ mimeType?: string | undefined;
62
62
  };
63
63
  kind: "file";
64
- metadata?: Record<string, unknown> | null | undefined;
64
+ metadata?: Record<string, unknown> | undefined;
65
65
  } | {
66
66
  text: string;
67
67
  kind: "text";
68
- metadata?: Record<string, unknown> | null | undefined;
68
+ metadata?: Record<string, unknown> | undefined;
69
69
  } | {
70
70
  data: Record<string, unknown>;
71
71
  kind: "data";
72
- metadata?: Record<string, unknown> | null | undefined;
72
+ metadata?: Record<string, unknown> | undefined;
73
73
  })[];
74
74
  messageId: string;
75
- metadata?: Record<string, unknown> | null | undefined;
76
- extensions?: string[] | null | undefined;
77
- referenceTaskIds?: string[] | null | undefined;
78
- taskId?: string | null | undefined;
79
- contextId?: string | null | undefined;
80
- }[] | null | undefined;
75
+ metadata?: Record<string, unknown> | undefined;
76
+ extensions?: string[] | undefined;
77
+ referenceTaskIds?: string[] | undefined;
78
+ taskId?: string | undefined;
79
+ contextId?: string | undefined;
80
+ }[] | undefined;
81
81
  artifacts?: {
82
82
  artifactId: string;
83
83
  parts: ({
84
84
  file: {
85
85
  bytes: string;
86
- name?: string | null | undefined;
87
- mimeType?: string | null | undefined;
88
- uri?: null | undefined;
86
+ name?: string | undefined;
87
+ mimeType?: string | undefined;
88
+ uri?: undefined;
89
89
  } | {
90
90
  uri: string;
91
- name?: string | null | undefined;
92
- bytes?: null | undefined;
93
- mimeType?: string | null | undefined;
91
+ name?: string | undefined;
92
+ bytes?: undefined;
93
+ mimeType?: string | undefined;
94
94
  };
95
95
  kind: "file";
96
- metadata?: Record<string, unknown> | null | undefined;
96
+ metadata?: Record<string, unknown> | undefined;
97
97
  } | {
98
98
  text: string;
99
99
  kind: "text";
100
- metadata?: Record<string, unknown> | null | undefined;
100
+ metadata?: Record<string, unknown> | undefined;
101
101
  } | {
102
102
  data: Record<string, unknown>;
103
103
  kind: "data";
104
- metadata?: Record<string, unknown> | null | undefined;
104
+ metadata?: Record<string, unknown> | undefined;
105
105
  })[];
106
- name?: string | null | undefined;
107
- metadata?: Record<string, unknown> | null | undefined;
108
- description?: string | null | undefined;
109
- extension?: string[] | null | undefined;
110
- }[] | null | undefined;
106
+ name?: string | undefined;
107
+ metadata?: Record<string, unknown> | undefined;
108
+ description?: string | undefined;
109
+ extension?: string[] | undefined;
110
+ }[] | undefined;
111
111
  }>;
112
112
  export type GetTaskMethod = typeof getTask;