@artinet/sdk 0.5.6 → 0.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -1
- package/README.md +73 -0
- package/dist/services/a2a/factory/builder.js +1 -1
- package/dist/services/a2a/factory/event.js +1 -1
- package/dist/services/a2a/service.js +2 -5
- package/dist/services/a2a/service.js.map +1 -1
- package/dist/services/index.js +1 -0
- package/dist/services/index.js.map +1 -1
- package/dist/services/mcp/index.js +2 -0
- package/dist/services/mcp/index.js.map +1 -0
- package/dist/services/mcp/service.js +123 -0
- package/dist/services/mcp/service.js.map +1 -0
- package/dist/transport/trpc/a2a/routes/tasks/route.js +1 -1
- package/dist/transport/trpc/a2a/routes/tasks/route.js.map +1 -1
- package/dist/types/interfaces/services/a2a/builder.js +4 -0
- package/dist/types/interfaces/services/a2a/builder.js.map +1 -1
- package/dist/types/interfaces/services/index.js +1 -0
- package/dist/types/interfaces/services/index.js.map +1 -1
- package/dist/types/interfaces/services/mcp/index.js +2 -0
- package/dist/types/interfaces/services/mcp/index.js.map +1 -0
- package/dist/types/interfaces/services/mcp/service.js +6 -0
- package/dist/types/interfaces/services/mcp/service.js.map +1 -0
- package/dist/types/schemas/a2a/agent.js +9 -3
- package/dist/types/schemas/a2a/agent.js.map +1 -1
- package/dist/types/schemas/a2a/auth.js +11 -1
- package/dist/types/schemas/a2a/auth.js.map +1 -1
- package/dist/types/schemas/a2a/error.js +1 -1
- package/dist/types/schemas/a2a/error.js.map +1 -1
- package/dist/types/schemas/a2a/kind.js +1 -1
- package/dist/types/schemas/a2a/kind.js.map +1 -1
- package/dist/types/schemas/a2a/message.js +1 -1
- package/dist/types/schemas/a2a/message.js.map +1 -1
- package/dist/types/schemas/a2a/notification.js +2 -1
- package/dist/types/schemas/a2a/notification.js.map +1 -1
- package/dist/types/schemas/a2a/parameters.js +1 -1
- package/dist/types/schemas/a2a/parameters.js.map +1 -1
- package/dist/types/schemas/a2a/protocol.js +1 -1
- package/dist/types/schemas/a2a/protocol.js.map +1 -1
- package/dist/types/schemas/a2a/rpc.js +1 -1
- package/dist/types/schemas/a2a/rpc.js.map +1 -1
- package/dist/types/schemas/a2a/task.js +1 -1
- package/dist/types/schemas/a2a/task.js.map +1 -1
- package/dist/types/schemas/a2a/transport.js +2 -1
- package/dist/types/schemas/a2a/transport.js.map +1 -1
- package/dist/types/schemas/deployment/request.js +2 -2
- package/dist/types/schemas/deployment/request.js.map +1 -1
- package/dist/types/server/express/server.d.ts +7 -7
- package/dist/types/services/a2a/factory/builder.d.ts +8 -8
- package/dist/types/services/a2a/factory/context.d.ts +1 -1
- package/dist/types/services/a2a/factory/event.d.ts +1 -1
- package/dist/types/services/a2a/methods/get-task.d.ts +17 -17
- package/dist/types/services/a2a/service.d.ts +57 -58
- package/dist/types/services/a2a/service.d.ts.map +1 -1
- package/dist/types/services/index.d.ts +1 -0
- package/dist/types/services/index.d.ts.map +1 -1
- package/dist/types/services/mcp/index.d.ts +2 -0
- package/dist/types/services/mcp/index.d.ts.map +1 -0
- package/dist/types/services/mcp/service.d.ts +31 -0
- package/dist/types/services/mcp/service.d.ts.map +1 -0
- package/dist/types/transport/trpc/a2a/factory/router.d.ts +370 -370
- package/dist/types/transport/trpc/a2a/routes/info.d.ts +15 -15
- package/dist/types/transport/trpc/a2a/routes/message/route.d.ts +79 -79
- package/dist/types/transport/trpc/a2a/routes/tasks/route.d.ts +84 -84
- package/dist/types/transport/trpc/a2a/trpc.d.ts +35 -35
- package/dist/types/types/interfaces/services/a2a/builder.d.ts +4 -0
- package/dist/types/types/interfaces/services/a2a/builder.d.ts.map +1 -1
- package/dist/types/types/interfaces/services/a2a/context.d.ts +1 -1
- package/dist/types/types/interfaces/services/a2a/service.d.ts +1 -1
- package/dist/types/types/interfaces/services/core/context/context.d.ts +1 -1
- package/dist/types/types/interfaces/services/core/context/types.d.ts.map +1 -1
- package/dist/types/types/interfaces/services/core/execution/engine.d.ts +1 -1
- package/dist/types/types/interfaces/services/core/managers/event.d.ts +1 -1
- package/dist/types/types/interfaces/services/core/managers/stream.d.ts +1 -1
- package/dist/types/types/interfaces/services/core/service.d.ts +1 -1
- package/dist/types/types/interfaces/services/index.d.ts +1 -0
- package/dist/types/types/interfaces/services/index.d.ts.map +1 -1
- package/dist/types/types/interfaces/services/mcp/index.d.ts +2 -0
- package/dist/types/types/interfaces/services/mcp/index.d.ts.map +1 -0
- package/dist/types/types/interfaces/services/mcp/service.d.ts +50 -0
- package/dist/types/types/interfaces/services/mcp/service.d.ts.map +1 -0
- package/dist/types/types/schemas/a2a/agent.d.ts +2371 -296
- package/dist/types/types/schemas/a2a/agent.d.ts.map +1 -1
- package/dist/types/types/schemas/a2a/auth.d.ts +795 -171
- package/dist/types/types/schemas/a2a/auth.d.ts.map +1 -1
- package/dist/types/types/schemas/a2a/error.d.ts +243 -27
- package/dist/types/types/schemas/a2a/error.d.ts.map +1 -1
- package/dist/types/types/schemas/a2a/kind.d.ts +3 -19
- package/dist/types/types/schemas/a2a/kind.d.ts.map +1 -1
- package/dist/types/types/schemas/a2a/message.d.ts +9580 -1806
- package/dist/types/types/schemas/a2a/message.d.ts.map +1 -1
- package/dist/types/types/schemas/a2a/notification.d.ts +1283 -103
- package/dist/types/types/schemas/a2a/notification.d.ts.map +1 -1
- package/dist/types/types/schemas/a2a/parameters.d.ts +814 -165
- package/dist/types/types/schemas/a2a/parameters.d.ts.map +1 -1
- package/dist/types/types/schemas/a2a/protocol.d.ts +13378 -2221
- package/dist/types/types/schemas/a2a/protocol.d.ts.map +1 -1
- package/dist/types/types/schemas/a2a/rpc.d.ts +137 -11
- package/dist/types/types/schemas/a2a/rpc.d.ts.map +1 -1
- package/dist/types/types/schemas/a2a/task.d.ts +5409 -1020
- package/dist/types/types/schemas/a2a/task.d.ts.map +1 -1
- package/dist/types/types/schemas/a2a/transport.d.ts +17 -13
- package/dist/types/types/schemas/a2a/transport.d.ts.map +1 -1
- package/dist/types/types/schemas/deployment/request.d.ts +2639 -299
- package/dist/types/types/schemas/deployment/request.d.ts.map +1 -1
- package/dist/types/utils/common/zAsyncIterable-v3.d.ts +25 -0
- package/dist/types/utils/common/zAsyncIterable-v3.d.ts.map +1 -0
- package/dist/types/utils/common/zAsyncIterable.d.ts.map +1 -1
- package/dist/types/utils/deployment/full-deployment.d.ts +2 -2
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/utils/index.d.ts.map +1 -1
- package/dist/utils/common/zAsyncIterable-v3.js +39 -0
- package/dist/utils/common/zAsyncIterable-v3.js.map +1 -0
- package/dist/utils/common/zAsyncIterable.js +1 -0
- package/dist/utils/common/zAsyncIterable.js.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -2,307 +2,956 @@
|
|
|
2
2
|
* Copyright 2025 The Artinet Project
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
|
-
import { z } from "zod
|
|
5
|
+
import { z } from "zod";
|
|
6
6
|
/**
|
|
7
7
|
* @description Defines base properties common to all message or artifact parts.
|
|
8
8
|
*/
|
|
9
9
|
export declare const PartBaseSchema: z.ZodObject<{
|
|
10
|
+
/**
|
|
11
|
+
* @optional Optional metadata associated with this part.
|
|
12
|
+
*/
|
|
10
13
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
11
|
-
}, z.
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
metadata?: Record<string, unknown> | undefined;
|
|
16
|
+
}, {
|
|
17
|
+
metadata?: Record<string, unknown> | undefined;
|
|
18
|
+
}>;
|
|
12
19
|
export type PartBase = z.infer<typeof PartBaseSchema>;
|
|
13
20
|
/**
|
|
14
21
|
* @description Defines base properties for a file.
|
|
15
22
|
*/
|
|
16
23
|
export declare const FileBaseSchema: z.ZodObject<{
|
|
24
|
+
/**
|
|
25
|
+
* @optional An optional name for the file (e.g., "document.pdf").
|
|
26
|
+
*/
|
|
17
27
|
name: z.ZodOptional<z.ZodString>;
|
|
28
|
+
/**
|
|
29
|
+
* @optional The MIME type of the file (e.g., "application/pdf").
|
|
30
|
+
*/
|
|
18
31
|
mimeType: z.ZodOptional<z.ZodString>;
|
|
19
|
-
}, z.
|
|
32
|
+
}, "strip", z.ZodTypeAny, {
|
|
33
|
+
name?: string | undefined;
|
|
34
|
+
mimeType?: string | undefined;
|
|
35
|
+
}, {
|
|
36
|
+
name?: string | undefined;
|
|
37
|
+
mimeType?: string | undefined;
|
|
38
|
+
}>;
|
|
20
39
|
export type FileBase = z.infer<typeof FileBaseSchema>;
|
|
21
40
|
/**
|
|
22
41
|
* @description Represents a file with its content provided directly as a base64-encoded string.
|
|
23
42
|
*/
|
|
24
43
|
export declare const FileWithBytesSchema: z.ZodObject<{
|
|
44
|
+
/**
|
|
45
|
+
* @optional An optional name for the file (e.g., "document.pdf").
|
|
46
|
+
*/
|
|
25
47
|
name: z.ZodOptional<z.ZodString>;
|
|
48
|
+
/**
|
|
49
|
+
* @optional The MIME type of the file (e.g., "application/pdf").
|
|
50
|
+
*/
|
|
26
51
|
mimeType: z.ZodOptional<z.ZodString>;
|
|
52
|
+
} & {
|
|
53
|
+
/**
|
|
54
|
+
* @required The base64-encoded content of the file.
|
|
55
|
+
*/
|
|
27
56
|
bytes: z.ZodString;
|
|
57
|
+
/**
|
|
58
|
+
* @optional The `uri` property must be absent when `bytes` is present.
|
|
59
|
+
*/
|
|
28
60
|
uri: z.ZodOptional<z.ZodNever>;
|
|
29
|
-
}, z.
|
|
61
|
+
}, "strip", z.ZodTypeAny, {
|
|
62
|
+
bytes: string;
|
|
63
|
+
name?: string | undefined;
|
|
64
|
+
mimeType?: string | undefined;
|
|
65
|
+
uri?: undefined;
|
|
66
|
+
}, {
|
|
67
|
+
bytes: string;
|
|
68
|
+
name?: string | undefined;
|
|
69
|
+
mimeType?: string | undefined;
|
|
70
|
+
uri?: undefined;
|
|
71
|
+
}>;
|
|
30
72
|
export type FileWithBytes = z.infer<typeof FileWithBytesSchema>;
|
|
31
73
|
/**
|
|
32
74
|
* @description Represents a file with its content located at a specific URI.
|
|
33
75
|
*/
|
|
34
76
|
export declare const FileWithUriSchema: z.ZodObject<{
|
|
77
|
+
/**
|
|
78
|
+
* @optional An optional name for the file (e.g., "document.pdf").
|
|
79
|
+
*/
|
|
35
80
|
name: z.ZodOptional<z.ZodString>;
|
|
81
|
+
/**
|
|
82
|
+
* @optional The MIME type of the file (e.g., "application/pdf").
|
|
83
|
+
*/
|
|
36
84
|
mimeType: z.ZodOptional<z.ZodString>;
|
|
85
|
+
} & {
|
|
86
|
+
/**
|
|
87
|
+
* @required A URL pointing to the file's content. (keeping as string for now)
|
|
88
|
+
*/
|
|
37
89
|
uri: z.ZodString;
|
|
90
|
+
/**
|
|
91
|
+
* @optional The `bytes` property must be absent when `uri` is present.
|
|
92
|
+
*/
|
|
38
93
|
bytes: z.ZodOptional<z.ZodNever>;
|
|
39
|
-
}, z.
|
|
94
|
+
}, "strip", z.ZodTypeAny, {
|
|
95
|
+
uri: string;
|
|
96
|
+
name?: string | undefined;
|
|
97
|
+
mimeType?: string | undefined;
|
|
98
|
+
bytes?: undefined;
|
|
99
|
+
}, {
|
|
100
|
+
uri: string;
|
|
101
|
+
name?: string | undefined;
|
|
102
|
+
mimeType?: string | undefined;
|
|
103
|
+
bytes?: undefined;
|
|
104
|
+
}>;
|
|
40
105
|
export type FileWithUri = z.infer<typeof FileWithUriSchema>;
|
|
41
106
|
/**
|
|
42
107
|
* @description Represents a file with its content provided directly as a base64-encoded string or located at a specific URI.
|
|
43
108
|
*/
|
|
44
|
-
export declare const FileSchema: z.ZodUnion<
|
|
109
|
+
export declare const FileSchema: z.ZodUnion<[z.ZodObject<{
|
|
110
|
+
/**
|
|
111
|
+
* @optional An optional name for the file (e.g., "document.pdf").
|
|
112
|
+
*/
|
|
45
113
|
name: z.ZodOptional<z.ZodString>;
|
|
114
|
+
/**
|
|
115
|
+
* @optional The MIME type of the file (e.g., "application/pdf").
|
|
116
|
+
*/
|
|
46
117
|
mimeType: z.ZodOptional<z.ZodString>;
|
|
118
|
+
} & {
|
|
119
|
+
/**
|
|
120
|
+
* @required The base64-encoded content of the file.
|
|
121
|
+
*/
|
|
47
122
|
bytes: z.ZodString;
|
|
123
|
+
/**
|
|
124
|
+
* @optional The `uri` property must be absent when `bytes` is present.
|
|
125
|
+
*/
|
|
48
126
|
uri: z.ZodOptional<z.ZodNever>;
|
|
49
|
-
},
|
|
127
|
+
}, "strip", z.ZodTypeAny, {
|
|
128
|
+
bytes: string;
|
|
129
|
+
name?: string | undefined;
|
|
130
|
+
mimeType?: string | undefined;
|
|
131
|
+
uri?: undefined;
|
|
132
|
+
}, {
|
|
133
|
+
bytes: string;
|
|
134
|
+
name?: string | undefined;
|
|
135
|
+
mimeType?: string | undefined;
|
|
136
|
+
uri?: undefined;
|
|
137
|
+
}>, z.ZodObject<{
|
|
138
|
+
/**
|
|
139
|
+
* @optional An optional name for the file (e.g., "document.pdf").
|
|
140
|
+
*/
|
|
50
141
|
name: z.ZodOptional<z.ZodString>;
|
|
142
|
+
/**
|
|
143
|
+
* @optional The MIME type of the file (e.g., "application/pdf").
|
|
144
|
+
*/
|
|
51
145
|
mimeType: z.ZodOptional<z.ZodString>;
|
|
146
|
+
} & {
|
|
147
|
+
/**
|
|
148
|
+
* @required A URL pointing to the file's content. (keeping as string for now)
|
|
149
|
+
*/
|
|
52
150
|
uri: z.ZodString;
|
|
151
|
+
/**
|
|
152
|
+
* @optional The `bytes` property must be absent when `uri` is present.
|
|
153
|
+
*/
|
|
53
154
|
bytes: z.ZodOptional<z.ZodNever>;
|
|
54
|
-
}, z.
|
|
155
|
+
}, "strip", z.ZodTypeAny, {
|
|
156
|
+
uri: string;
|
|
157
|
+
name?: string | undefined;
|
|
158
|
+
mimeType?: string | undefined;
|
|
159
|
+
bytes?: undefined;
|
|
160
|
+
}, {
|
|
161
|
+
uri: string;
|
|
162
|
+
name?: string | undefined;
|
|
163
|
+
mimeType?: string | undefined;
|
|
164
|
+
bytes?: undefined;
|
|
165
|
+
}>]>;
|
|
55
166
|
export type File = z.infer<typeof FileSchema>;
|
|
56
167
|
/**
|
|
57
168
|
* @description Represents a file segment within a message or artifact. The file content can be
|
|
58
169
|
* provided either directly as bytes or as a URI.
|
|
59
170
|
*/
|
|
60
171
|
export declare const FilePartSchema: z.ZodObject<{
|
|
172
|
+
/**
|
|
173
|
+
* @optional Optional metadata associated with this part.
|
|
174
|
+
*/
|
|
61
175
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
176
|
+
} & {
|
|
177
|
+
/**
|
|
178
|
+
* @required The type of this part, used as a discriminator. Always 'file'.
|
|
179
|
+
*/
|
|
180
|
+
kind: z.ZodEffects<z.ZodEnum<["artifact-update", "data", "file", "message", "status-update", "task", "text"]>, "file", "artifact-update" | "data" | "file" | "message" | "status-update" | "task" | "text">;
|
|
181
|
+
/**
|
|
182
|
+
* @required The file content, represented as either a URI or as base64-encoded bytes.
|
|
183
|
+
*/
|
|
184
|
+
file: z.ZodUnion<[z.ZodObject<{
|
|
185
|
+
/**
|
|
186
|
+
* @optional An optional name for the file (e.g., "document.pdf").
|
|
187
|
+
*/
|
|
72
188
|
name: z.ZodOptional<z.ZodString>;
|
|
189
|
+
/**
|
|
190
|
+
* @optional The MIME type of the file (e.g., "application/pdf").
|
|
191
|
+
*/
|
|
73
192
|
mimeType: z.ZodOptional<z.ZodString>;
|
|
193
|
+
} & {
|
|
194
|
+
/**
|
|
195
|
+
* @required The base64-encoded content of the file.
|
|
196
|
+
*/
|
|
74
197
|
bytes: z.ZodString;
|
|
198
|
+
/**
|
|
199
|
+
* @optional The `uri` property must be absent when `bytes` is present.
|
|
200
|
+
*/
|
|
75
201
|
uri: z.ZodOptional<z.ZodNever>;
|
|
76
|
-
},
|
|
202
|
+
}, "strip", z.ZodTypeAny, {
|
|
203
|
+
bytes: string;
|
|
204
|
+
name?: string | undefined;
|
|
205
|
+
mimeType?: string | undefined;
|
|
206
|
+
uri?: undefined;
|
|
207
|
+
}, {
|
|
208
|
+
bytes: string;
|
|
209
|
+
name?: string | undefined;
|
|
210
|
+
mimeType?: string | undefined;
|
|
211
|
+
uri?: undefined;
|
|
212
|
+
}>, z.ZodObject<{
|
|
213
|
+
/**
|
|
214
|
+
* @optional An optional name for the file (e.g., "document.pdf").
|
|
215
|
+
*/
|
|
77
216
|
name: z.ZodOptional<z.ZodString>;
|
|
217
|
+
/**
|
|
218
|
+
* @optional The MIME type of the file (e.g., "application/pdf").
|
|
219
|
+
*/
|
|
78
220
|
mimeType: z.ZodOptional<z.ZodString>;
|
|
221
|
+
} & {
|
|
222
|
+
/**
|
|
223
|
+
* @required A URL pointing to the file's content. (keeping as string for now)
|
|
224
|
+
*/
|
|
79
225
|
uri: z.ZodString;
|
|
226
|
+
/**
|
|
227
|
+
* @optional The `bytes` property must be absent when `uri` is present.
|
|
228
|
+
*/
|
|
80
229
|
bytes: z.ZodOptional<z.ZodNever>;
|
|
81
|
-
}, z.
|
|
82
|
-
|
|
230
|
+
}, "strip", z.ZodTypeAny, {
|
|
231
|
+
uri: string;
|
|
232
|
+
name?: string | undefined;
|
|
233
|
+
mimeType?: string | undefined;
|
|
234
|
+
bytes?: undefined;
|
|
235
|
+
}, {
|
|
236
|
+
uri: string;
|
|
237
|
+
name?: string | undefined;
|
|
238
|
+
mimeType?: string | undefined;
|
|
239
|
+
bytes?: undefined;
|
|
240
|
+
}>]>;
|
|
241
|
+
}, "strip", z.ZodTypeAny, {
|
|
242
|
+
file: {
|
|
243
|
+
bytes: string;
|
|
244
|
+
name?: string | undefined;
|
|
245
|
+
mimeType?: string | undefined;
|
|
246
|
+
uri?: undefined;
|
|
247
|
+
} | {
|
|
248
|
+
uri: string;
|
|
249
|
+
name?: string | undefined;
|
|
250
|
+
mimeType?: string | undefined;
|
|
251
|
+
bytes?: undefined;
|
|
252
|
+
};
|
|
253
|
+
kind: "file";
|
|
254
|
+
metadata?: Record<string, unknown> | undefined;
|
|
255
|
+
}, {
|
|
256
|
+
file: {
|
|
257
|
+
bytes: string;
|
|
258
|
+
name?: string | undefined;
|
|
259
|
+
mimeType?: string | undefined;
|
|
260
|
+
uri?: undefined;
|
|
261
|
+
} | {
|
|
262
|
+
uri: string;
|
|
263
|
+
name?: string | undefined;
|
|
264
|
+
mimeType?: string | undefined;
|
|
265
|
+
bytes?: undefined;
|
|
266
|
+
};
|
|
267
|
+
kind: "artifact-update" | "data" | "file" | "message" | "status-update" | "task" | "text";
|
|
268
|
+
metadata?: Record<string, unknown> | undefined;
|
|
269
|
+
}>;
|
|
83
270
|
export type FilePart = z.infer<typeof FilePartSchema>;
|
|
84
271
|
/**
|
|
85
272
|
* @description Represents a text segment within a message or artifact.
|
|
86
273
|
*/
|
|
87
274
|
export declare const TextPartSchema: z.ZodObject<{
|
|
275
|
+
/**
|
|
276
|
+
* @optional Optional metadata associated with this part.
|
|
277
|
+
*/
|
|
88
278
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}>;
|
|
279
|
+
} & {
|
|
280
|
+
/**
|
|
281
|
+
* @required The type of this object, used as a discriminator. Always 'text' for a TextPart.
|
|
282
|
+
*/
|
|
283
|
+
kind: z.ZodEffects<z.ZodEnum<["artifact-update", "data", "file", "message", "status-update", "task", "text"]>, "text", "artifact-update" | "data" | "file" | "message" | "status-update" | "task" | "text">;
|
|
284
|
+
/**
|
|
285
|
+
* @required The string content of the text part.
|
|
286
|
+
*/
|
|
98
287
|
text: z.ZodString;
|
|
99
|
-
}, z.
|
|
288
|
+
}, "strip", z.ZodTypeAny, {
|
|
289
|
+
text: string;
|
|
290
|
+
kind: "text";
|
|
291
|
+
metadata?: Record<string, unknown> | undefined;
|
|
292
|
+
}, {
|
|
293
|
+
text: string;
|
|
294
|
+
kind: "artifact-update" | "data" | "file" | "message" | "status-update" | "task" | "text";
|
|
295
|
+
metadata?: Record<string, unknown> | undefined;
|
|
296
|
+
}>;
|
|
100
297
|
export type TextPart = z.infer<typeof TextPartSchema>;
|
|
101
298
|
/**
|
|
102
299
|
* @description Represents a structured data segment (e.g., JSON) within a message or artifact.
|
|
103
300
|
*/
|
|
104
301
|
export declare const DataPartSchema: z.ZodObject<{
|
|
302
|
+
/**
|
|
303
|
+
* @optional Optional metadata associated with this part.
|
|
304
|
+
*/
|
|
105
305
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}>;
|
|
306
|
+
} & {
|
|
307
|
+
/**
|
|
308
|
+
* @required The type of this object, used as a discriminator. Always 'data' for a DataPart.
|
|
309
|
+
*/
|
|
310
|
+
kind: z.ZodEffects<z.ZodEnum<["artifact-update", "data", "file", "message", "status-update", "task", "text"]>, "data", "artifact-update" | "data" | "file" | "message" | "status-update" | "task" | "text">;
|
|
311
|
+
/**
|
|
312
|
+
* @required The structured data content of the data part.
|
|
313
|
+
*/
|
|
115
314
|
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
116
|
-
}, z.
|
|
315
|
+
}, "strip", z.ZodTypeAny, {
|
|
316
|
+
data: Record<string, unknown>;
|
|
317
|
+
kind: "data";
|
|
318
|
+
metadata?: Record<string, unknown> | undefined;
|
|
319
|
+
}, {
|
|
320
|
+
data: Record<string, unknown>;
|
|
321
|
+
kind: "artifact-update" | "data" | "file" | "message" | "status-update" | "task" | "text";
|
|
322
|
+
metadata?: Record<string, unknown> | undefined;
|
|
323
|
+
}>;
|
|
117
324
|
export type DataPart = z.infer<typeof DataPartSchema>;
|
|
118
325
|
/**
|
|
119
326
|
* @description A discriminated union representing a part of a message or artifact, which can
|
|
120
327
|
* be text, a file, or structured data.
|
|
121
328
|
*/
|
|
122
|
-
export declare const PartSchema: z.ZodUnion<
|
|
329
|
+
export declare const PartSchema: z.ZodUnion<[z.ZodObject<{
|
|
330
|
+
/**
|
|
331
|
+
* @optional Optional metadata associated with this part.
|
|
332
|
+
*/
|
|
123
333
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}>;
|
|
334
|
+
} & {
|
|
335
|
+
/**
|
|
336
|
+
* @required The type of this object, used as a discriminator. Always 'text' for a TextPart.
|
|
337
|
+
*/
|
|
338
|
+
kind: z.ZodEffects<z.ZodEnum<["artifact-update", "data", "file", "message", "status-update", "task", "text"]>, "text", "artifact-update" | "data" | "file" | "message" | "status-update" | "task" | "text">;
|
|
339
|
+
/**
|
|
340
|
+
* @required The string content of the text part.
|
|
341
|
+
*/
|
|
133
342
|
text: z.ZodString;
|
|
134
|
-
},
|
|
343
|
+
}, "strip", z.ZodTypeAny, {
|
|
344
|
+
text: string;
|
|
345
|
+
kind: "text";
|
|
346
|
+
metadata?: Record<string, unknown> | undefined;
|
|
347
|
+
}, {
|
|
348
|
+
text: string;
|
|
349
|
+
kind: "artifact-update" | "data" | "file" | "message" | "status-update" | "task" | "text";
|
|
350
|
+
metadata?: Record<string, unknown> | undefined;
|
|
351
|
+
}>, z.ZodObject<{
|
|
352
|
+
/**
|
|
353
|
+
* @optional Optional metadata associated with this part.
|
|
354
|
+
*/
|
|
135
355
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
356
|
+
} & {
|
|
357
|
+
/**
|
|
358
|
+
* @required The type of this part, used as a discriminator. Always 'file'.
|
|
359
|
+
*/
|
|
360
|
+
kind: z.ZodEffects<z.ZodEnum<["artifact-update", "data", "file", "message", "status-update", "task", "text"]>, "file", "artifact-update" | "data" | "file" | "message" | "status-update" | "task" | "text">;
|
|
361
|
+
/**
|
|
362
|
+
* @required The file content, represented as either a URI or as base64-encoded bytes.
|
|
363
|
+
*/
|
|
364
|
+
file: z.ZodUnion<[z.ZodObject<{
|
|
365
|
+
/**
|
|
366
|
+
* @optional An optional name for the file (e.g., "document.pdf").
|
|
367
|
+
*/
|
|
146
368
|
name: z.ZodOptional<z.ZodString>;
|
|
369
|
+
/**
|
|
370
|
+
* @optional The MIME type of the file (e.g., "application/pdf").
|
|
371
|
+
*/
|
|
147
372
|
mimeType: z.ZodOptional<z.ZodString>;
|
|
373
|
+
} & {
|
|
374
|
+
/**
|
|
375
|
+
* @required The base64-encoded content of the file.
|
|
376
|
+
*/
|
|
148
377
|
bytes: z.ZodString;
|
|
378
|
+
/**
|
|
379
|
+
* @optional The `uri` property must be absent when `bytes` is present.
|
|
380
|
+
*/
|
|
149
381
|
uri: z.ZodOptional<z.ZodNever>;
|
|
150
|
-
},
|
|
382
|
+
}, "strip", z.ZodTypeAny, {
|
|
383
|
+
bytes: string;
|
|
384
|
+
name?: string | undefined;
|
|
385
|
+
mimeType?: string | undefined;
|
|
386
|
+
uri?: undefined;
|
|
387
|
+
}, {
|
|
388
|
+
bytes: string;
|
|
389
|
+
name?: string | undefined;
|
|
390
|
+
mimeType?: string | undefined;
|
|
391
|
+
uri?: undefined;
|
|
392
|
+
}>, z.ZodObject<{
|
|
393
|
+
/**
|
|
394
|
+
* @optional An optional name for the file (e.g., "document.pdf").
|
|
395
|
+
*/
|
|
151
396
|
name: z.ZodOptional<z.ZodString>;
|
|
397
|
+
/**
|
|
398
|
+
* @optional The MIME type of the file (e.g., "application/pdf").
|
|
399
|
+
*/
|
|
152
400
|
mimeType: z.ZodOptional<z.ZodString>;
|
|
401
|
+
} & {
|
|
402
|
+
/**
|
|
403
|
+
* @required A URL pointing to the file's content. (keeping as string for now)
|
|
404
|
+
*/
|
|
153
405
|
uri: z.ZodString;
|
|
406
|
+
/**
|
|
407
|
+
* @optional The `bytes` property must be absent when `uri` is present.
|
|
408
|
+
*/
|
|
154
409
|
bytes: z.ZodOptional<z.ZodNever>;
|
|
155
|
-
}, z.
|
|
156
|
-
|
|
410
|
+
}, "strip", z.ZodTypeAny, {
|
|
411
|
+
uri: string;
|
|
412
|
+
name?: string | undefined;
|
|
413
|
+
mimeType?: string | undefined;
|
|
414
|
+
bytes?: undefined;
|
|
415
|
+
}, {
|
|
416
|
+
uri: string;
|
|
417
|
+
name?: string | undefined;
|
|
418
|
+
mimeType?: string | undefined;
|
|
419
|
+
bytes?: undefined;
|
|
420
|
+
}>]>;
|
|
421
|
+
}, "strip", z.ZodTypeAny, {
|
|
422
|
+
file: {
|
|
423
|
+
bytes: string;
|
|
424
|
+
name?: string | undefined;
|
|
425
|
+
mimeType?: string | undefined;
|
|
426
|
+
uri?: undefined;
|
|
427
|
+
} | {
|
|
428
|
+
uri: string;
|
|
429
|
+
name?: string | undefined;
|
|
430
|
+
mimeType?: string | undefined;
|
|
431
|
+
bytes?: undefined;
|
|
432
|
+
};
|
|
433
|
+
kind: "file";
|
|
434
|
+
metadata?: Record<string, unknown> | undefined;
|
|
435
|
+
}, {
|
|
436
|
+
file: {
|
|
437
|
+
bytes: string;
|
|
438
|
+
name?: string | undefined;
|
|
439
|
+
mimeType?: string | undefined;
|
|
440
|
+
uri?: undefined;
|
|
441
|
+
} | {
|
|
442
|
+
uri: string;
|
|
443
|
+
name?: string | undefined;
|
|
444
|
+
mimeType?: string | undefined;
|
|
445
|
+
bytes?: undefined;
|
|
446
|
+
};
|
|
447
|
+
kind: "artifact-update" | "data" | "file" | "message" | "status-update" | "task" | "text";
|
|
448
|
+
metadata?: Record<string, unknown> | undefined;
|
|
449
|
+
}>, z.ZodObject<{
|
|
450
|
+
/**
|
|
451
|
+
* @optional Optional metadata associated with this part.
|
|
452
|
+
*/
|
|
157
453
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}>;
|
|
454
|
+
} & {
|
|
455
|
+
/**
|
|
456
|
+
* @required The type of this object, used as a discriminator. Always 'data' for a DataPart.
|
|
457
|
+
*/
|
|
458
|
+
kind: z.ZodEffects<z.ZodEnum<["artifact-update", "data", "file", "message", "status-update", "task", "text"]>, "data", "artifact-update" | "data" | "file" | "message" | "status-update" | "task" | "text">;
|
|
459
|
+
/**
|
|
460
|
+
* @required The structured data content of the data part.
|
|
461
|
+
*/
|
|
167
462
|
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
168
|
-
}, z.
|
|
463
|
+
}, "strip", z.ZodTypeAny, {
|
|
464
|
+
data: Record<string, unknown>;
|
|
465
|
+
kind: "data";
|
|
466
|
+
metadata?: Record<string, unknown> | undefined;
|
|
467
|
+
}, {
|
|
468
|
+
data: Record<string, unknown>;
|
|
469
|
+
kind: "artifact-update" | "data" | "file" | "message" | "status-update" | "task" | "text";
|
|
470
|
+
metadata?: Record<string, unknown> | undefined;
|
|
471
|
+
}>]>;
|
|
169
472
|
export type Part = z.infer<typeof PartSchema>;
|
|
170
473
|
/**
|
|
171
474
|
* @description Represents a file, data structure, or other resource generated by an agent during a task.
|
|
172
475
|
*/
|
|
173
476
|
export declare const ArtifactSchema: z.ZodObject<{
|
|
477
|
+
/**
|
|
478
|
+
* @required A unique identifier for the artifact within the scope of the task.
|
|
479
|
+
*/
|
|
174
480
|
artifactId: z.ZodString;
|
|
481
|
+
/**
|
|
482
|
+
* @optional A human-readable name for the artifact.
|
|
483
|
+
*/
|
|
175
484
|
name: z.ZodOptional<z.ZodString>;
|
|
485
|
+
/**
|
|
486
|
+
* @optional A human-readable description of the artifact.
|
|
487
|
+
*/
|
|
176
488
|
description: z.ZodOptional<z.ZodString>;
|
|
177
|
-
|
|
489
|
+
/**
|
|
490
|
+
* @optional An array of content parts that make up the artifact.
|
|
491
|
+
*/
|
|
492
|
+
parts: z.ZodArray<z.ZodUnion<[z.ZodObject<{
|
|
493
|
+
/**
|
|
494
|
+
* @optional Optional metadata associated with this part.
|
|
495
|
+
*/
|
|
178
496
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
}>;
|
|
497
|
+
} & {
|
|
498
|
+
/**
|
|
499
|
+
* @required The type of this object, used as a discriminator. Always 'text' for a TextPart.
|
|
500
|
+
*/
|
|
501
|
+
kind: z.ZodEffects<z.ZodEnum<["artifact-update", "data", "file", "message", "status-update", "task", "text"]>, "text", "artifact-update" | "data" | "file" | "message" | "status-update" | "task" | "text">;
|
|
502
|
+
/**
|
|
503
|
+
* @required The string content of the text part.
|
|
504
|
+
*/
|
|
188
505
|
text: z.ZodString;
|
|
189
|
-
},
|
|
506
|
+
}, "strip", z.ZodTypeAny, {
|
|
507
|
+
text: string;
|
|
508
|
+
kind: "text";
|
|
509
|
+
metadata?: Record<string, unknown> | undefined;
|
|
510
|
+
}, {
|
|
511
|
+
text: string;
|
|
512
|
+
kind: "artifact-update" | "data" | "file" | "message" | "status-update" | "task" | "text";
|
|
513
|
+
metadata?: Record<string, unknown> | undefined;
|
|
514
|
+
}>, z.ZodObject<{
|
|
515
|
+
/**
|
|
516
|
+
* @optional Optional metadata associated with this part.
|
|
517
|
+
*/
|
|
190
518
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
519
|
+
} & {
|
|
520
|
+
/**
|
|
521
|
+
* @required The type of this part, used as a discriminator. Always 'file'.
|
|
522
|
+
*/
|
|
523
|
+
kind: z.ZodEffects<z.ZodEnum<["artifact-update", "data", "file", "message", "status-update", "task", "text"]>, "file", "artifact-update" | "data" | "file" | "message" | "status-update" | "task" | "text">;
|
|
524
|
+
/**
|
|
525
|
+
* @required The file content, represented as either a URI or as base64-encoded bytes.
|
|
526
|
+
*/
|
|
527
|
+
file: z.ZodUnion<[z.ZodObject<{
|
|
528
|
+
/**
|
|
529
|
+
* @optional An optional name for the file (e.g., "document.pdf").
|
|
530
|
+
*/
|
|
201
531
|
name: z.ZodOptional<z.ZodString>;
|
|
532
|
+
/**
|
|
533
|
+
* @optional The MIME type of the file (e.g., "application/pdf").
|
|
534
|
+
*/
|
|
202
535
|
mimeType: z.ZodOptional<z.ZodString>;
|
|
536
|
+
} & {
|
|
537
|
+
/**
|
|
538
|
+
* @required The base64-encoded content of the file.
|
|
539
|
+
*/
|
|
203
540
|
bytes: z.ZodString;
|
|
541
|
+
/**
|
|
542
|
+
* @optional The `uri` property must be absent when `bytes` is present.
|
|
543
|
+
*/
|
|
204
544
|
uri: z.ZodOptional<z.ZodNever>;
|
|
205
|
-
},
|
|
545
|
+
}, "strip", z.ZodTypeAny, {
|
|
546
|
+
bytes: string;
|
|
547
|
+
name?: string | undefined;
|
|
548
|
+
mimeType?: string | undefined;
|
|
549
|
+
uri?: undefined;
|
|
550
|
+
}, {
|
|
551
|
+
bytes: string;
|
|
552
|
+
name?: string | undefined;
|
|
553
|
+
mimeType?: string | undefined;
|
|
554
|
+
uri?: undefined;
|
|
555
|
+
}>, z.ZodObject<{
|
|
556
|
+
/**
|
|
557
|
+
* @optional An optional name for the file (e.g., "document.pdf").
|
|
558
|
+
*/
|
|
206
559
|
name: z.ZodOptional<z.ZodString>;
|
|
560
|
+
/**
|
|
561
|
+
* @optional The MIME type of the file (e.g., "application/pdf").
|
|
562
|
+
*/
|
|
207
563
|
mimeType: z.ZodOptional<z.ZodString>;
|
|
564
|
+
} & {
|
|
565
|
+
/**
|
|
566
|
+
* @required A URL pointing to the file's content. (keeping as string for now)
|
|
567
|
+
*/
|
|
208
568
|
uri: z.ZodString;
|
|
569
|
+
/**
|
|
570
|
+
* @optional The `bytes` property must be absent when `uri` is present.
|
|
571
|
+
*/
|
|
209
572
|
bytes: z.ZodOptional<z.ZodNever>;
|
|
210
|
-
}, z.
|
|
211
|
-
|
|
573
|
+
}, "strip", z.ZodTypeAny, {
|
|
574
|
+
uri: string;
|
|
575
|
+
name?: string | undefined;
|
|
576
|
+
mimeType?: string | undefined;
|
|
577
|
+
bytes?: undefined;
|
|
578
|
+
}, {
|
|
579
|
+
uri: string;
|
|
580
|
+
name?: string | undefined;
|
|
581
|
+
mimeType?: string | undefined;
|
|
582
|
+
bytes?: undefined;
|
|
583
|
+
}>]>;
|
|
584
|
+
}, "strip", z.ZodTypeAny, {
|
|
585
|
+
file: {
|
|
586
|
+
bytes: string;
|
|
587
|
+
name?: string | undefined;
|
|
588
|
+
mimeType?: string | undefined;
|
|
589
|
+
uri?: undefined;
|
|
590
|
+
} | {
|
|
591
|
+
uri: string;
|
|
592
|
+
name?: string | undefined;
|
|
593
|
+
mimeType?: string | undefined;
|
|
594
|
+
bytes?: undefined;
|
|
595
|
+
};
|
|
596
|
+
kind: "file";
|
|
597
|
+
metadata?: Record<string, unknown> | undefined;
|
|
598
|
+
}, {
|
|
599
|
+
file: {
|
|
600
|
+
bytes: string;
|
|
601
|
+
name?: string | undefined;
|
|
602
|
+
mimeType?: string | undefined;
|
|
603
|
+
uri?: undefined;
|
|
604
|
+
} | {
|
|
605
|
+
uri: string;
|
|
606
|
+
name?: string | undefined;
|
|
607
|
+
mimeType?: string | undefined;
|
|
608
|
+
bytes?: undefined;
|
|
609
|
+
};
|
|
610
|
+
kind: "artifact-update" | "data" | "file" | "message" | "status-update" | "task" | "text";
|
|
611
|
+
metadata?: Record<string, unknown> | undefined;
|
|
612
|
+
}>, z.ZodObject<{
|
|
613
|
+
/**
|
|
614
|
+
* @optional Optional metadata associated with this part.
|
|
615
|
+
*/
|
|
212
616
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
}>;
|
|
617
|
+
} & {
|
|
618
|
+
/**
|
|
619
|
+
* @required The type of this object, used as a discriminator. Always 'data' for a DataPart.
|
|
620
|
+
*/
|
|
621
|
+
kind: z.ZodEffects<z.ZodEnum<["artifact-update", "data", "file", "message", "status-update", "task", "text"]>, "data", "artifact-update" | "data" | "file" | "message" | "status-update" | "task" | "text">;
|
|
622
|
+
/**
|
|
623
|
+
* @required The structured data content of the data part.
|
|
624
|
+
*/
|
|
222
625
|
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
223
|
-
}, z.
|
|
626
|
+
}, "strip", z.ZodTypeAny, {
|
|
627
|
+
data: Record<string, unknown>;
|
|
628
|
+
kind: "data";
|
|
629
|
+
metadata?: Record<string, unknown> | undefined;
|
|
630
|
+
}, {
|
|
631
|
+
data: Record<string, unknown>;
|
|
632
|
+
kind: "artifact-update" | "data" | "file" | "message" | "status-update" | "task" | "text";
|
|
633
|
+
metadata?: Record<string, unknown> | undefined;
|
|
634
|
+
}>]>, "many">;
|
|
635
|
+
/**
|
|
636
|
+
* @optional Optional metadata for extensions. The key is an extension-specific identifier.
|
|
637
|
+
*/
|
|
224
638
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
225
|
-
|
|
226
|
-
|
|
639
|
+
/**
|
|
640
|
+
* @optional The URIs of extensions that are relevant to this artifact.
|
|
641
|
+
*/
|
|
642
|
+
extension: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
643
|
+
}, "strip", z.ZodTypeAny, {
|
|
644
|
+
artifactId: string;
|
|
645
|
+
parts: ({
|
|
646
|
+
file: {
|
|
647
|
+
bytes: string;
|
|
648
|
+
name?: string | undefined;
|
|
649
|
+
mimeType?: string | undefined;
|
|
650
|
+
uri?: undefined;
|
|
651
|
+
} | {
|
|
652
|
+
uri: string;
|
|
653
|
+
name?: string | undefined;
|
|
654
|
+
mimeType?: string | undefined;
|
|
655
|
+
bytes?: undefined;
|
|
656
|
+
};
|
|
657
|
+
kind: "file";
|
|
658
|
+
metadata?: Record<string, unknown> | undefined;
|
|
659
|
+
} | {
|
|
660
|
+
text: string;
|
|
661
|
+
kind: "text";
|
|
662
|
+
metadata?: Record<string, unknown> | undefined;
|
|
663
|
+
} | {
|
|
664
|
+
data: Record<string, unknown>;
|
|
665
|
+
kind: "data";
|
|
666
|
+
metadata?: Record<string, unknown> | undefined;
|
|
667
|
+
})[];
|
|
668
|
+
description?: string | undefined;
|
|
669
|
+
name?: string | undefined;
|
|
670
|
+
metadata?: Record<string, unknown> | undefined;
|
|
671
|
+
extension?: string[] | undefined;
|
|
672
|
+
}, {
|
|
673
|
+
artifactId: string;
|
|
674
|
+
parts: ({
|
|
675
|
+
file: {
|
|
676
|
+
bytes: string;
|
|
677
|
+
name?: string | undefined;
|
|
678
|
+
mimeType?: string | undefined;
|
|
679
|
+
uri?: undefined;
|
|
680
|
+
} | {
|
|
681
|
+
uri: string;
|
|
682
|
+
name?: string | undefined;
|
|
683
|
+
mimeType?: string | undefined;
|
|
684
|
+
bytes?: undefined;
|
|
685
|
+
};
|
|
686
|
+
kind: "artifact-update" | "data" | "file" | "message" | "status-update" | "task" | "text";
|
|
687
|
+
metadata?: Record<string, unknown> | undefined;
|
|
688
|
+
} | {
|
|
689
|
+
text: string;
|
|
690
|
+
kind: "artifact-update" | "data" | "file" | "message" | "status-update" | "task" | "text";
|
|
691
|
+
metadata?: Record<string, unknown> | undefined;
|
|
692
|
+
} | {
|
|
693
|
+
data: Record<string, unknown>;
|
|
694
|
+
kind: "artifact-update" | "data" | "file" | "message" | "status-update" | "task" | "text";
|
|
695
|
+
metadata?: Record<string, unknown> | undefined;
|
|
696
|
+
})[];
|
|
697
|
+
description?: string | undefined;
|
|
698
|
+
name?: string | undefined;
|
|
699
|
+
metadata?: Record<string, unknown> | undefined;
|
|
700
|
+
extension?: string[] | undefined;
|
|
701
|
+
}>;
|
|
227
702
|
export type Artifact = z.infer<typeof ArtifactSchema>;
|
|
228
703
|
/**
|
|
229
704
|
* @description Represents the role of a message sender.
|
|
230
705
|
*/
|
|
231
|
-
export declare const MessageRoleSchema: z.ZodEnum<
|
|
232
|
-
user: "user";
|
|
233
|
-
agent: "agent";
|
|
234
|
-
}>;
|
|
706
|
+
export declare const MessageRoleSchema: z.ZodEnum<["user", "agent"]>;
|
|
235
707
|
export type MessageRole = z.infer<typeof MessageRoleSchema>;
|
|
236
708
|
/**
|
|
237
709
|
* @description Represents a single message in the conversation between a user and an agent.
|
|
238
710
|
*/
|
|
239
711
|
export declare const MessageSchema: z.ZodObject<{
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
712
|
+
/**
|
|
713
|
+
* @required Identifies the sender of the message. `user` for the client, `agent` for the service.
|
|
714
|
+
*/
|
|
715
|
+
role: z.ZodEnum<["user", "agent"]>;
|
|
716
|
+
/**
|
|
717
|
+
* @required An array of content parts that form the message body. A message can be
|
|
718
|
+
* composed of multiple parts of different types (e.g., text and files).
|
|
719
|
+
*/
|
|
720
|
+
parts: z.ZodArray<z.ZodUnion<[z.ZodObject<{
|
|
721
|
+
/**
|
|
722
|
+
* @optional Optional metadata associated with this part.
|
|
723
|
+
*/
|
|
245
724
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
}>;
|
|
725
|
+
} & {
|
|
726
|
+
/**
|
|
727
|
+
* @required The type of this object, used as a discriminator. Always 'text' for a TextPart.
|
|
728
|
+
*/
|
|
729
|
+
kind: z.ZodEffects<z.ZodEnum<["artifact-update", "data", "file", "message", "status-update", "task", "text"]>, "text", "artifact-update" | "data" | "file" | "message" | "status-update" | "task" | "text">;
|
|
730
|
+
/**
|
|
731
|
+
* @required The string content of the text part.
|
|
732
|
+
*/
|
|
255
733
|
text: z.ZodString;
|
|
256
|
-
},
|
|
734
|
+
}, "strip", z.ZodTypeAny, {
|
|
735
|
+
text: string;
|
|
736
|
+
kind: "text";
|
|
737
|
+
metadata?: Record<string, unknown> | undefined;
|
|
738
|
+
}, {
|
|
739
|
+
text: string;
|
|
740
|
+
kind: "artifact-update" | "data" | "file" | "message" | "status-update" | "task" | "text";
|
|
741
|
+
metadata?: Record<string, unknown> | undefined;
|
|
742
|
+
}>, z.ZodObject<{
|
|
743
|
+
/**
|
|
744
|
+
* @optional Optional metadata associated with this part.
|
|
745
|
+
*/
|
|
257
746
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
747
|
+
} & {
|
|
748
|
+
/**
|
|
749
|
+
* @required The type of this part, used as a discriminator. Always 'file'.
|
|
750
|
+
*/
|
|
751
|
+
kind: z.ZodEffects<z.ZodEnum<["artifact-update", "data", "file", "message", "status-update", "task", "text"]>, "file", "artifact-update" | "data" | "file" | "message" | "status-update" | "task" | "text">;
|
|
752
|
+
/**
|
|
753
|
+
* @required The file content, represented as either a URI or as base64-encoded bytes.
|
|
754
|
+
*/
|
|
755
|
+
file: z.ZodUnion<[z.ZodObject<{
|
|
756
|
+
/**
|
|
757
|
+
* @optional An optional name for the file (e.g., "document.pdf").
|
|
758
|
+
*/
|
|
268
759
|
name: z.ZodOptional<z.ZodString>;
|
|
760
|
+
/**
|
|
761
|
+
* @optional The MIME type of the file (e.g., "application/pdf").
|
|
762
|
+
*/
|
|
269
763
|
mimeType: z.ZodOptional<z.ZodString>;
|
|
764
|
+
} & {
|
|
765
|
+
/**
|
|
766
|
+
* @required The base64-encoded content of the file.
|
|
767
|
+
*/
|
|
270
768
|
bytes: z.ZodString;
|
|
769
|
+
/**
|
|
770
|
+
* @optional The `uri` property must be absent when `bytes` is present.
|
|
771
|
+
*/
|
|
271
772
|
uri: z.ZodOptional<z.ZodNever>;
|
|
272
|
-
},
|
|
773
|
+
}, "strip", z.ZodTypeAny, {
|
|
774
|
+
bytes: string;
|
|
775
|
+
name?: string | undefined;
|
|
776
|
+
mimeType?: string | undefined;
|
|
777
|
+
uri?: undefined;
|
|
778
|
+
}, {
|
|
779
|
+
bytes: string;
|
|
780
|
+
name?: string | undefined;
|
|
781
|
+
mimeType?: string | undefined;
|
|
782
|
+
uri?: undefined;
|
|
783
|
+
}>, z.ZodObject<{
|
|
784
|
+
/**
|
|
785
|
+
* @optional An optional name for the file (e.g., "document.pdf").
|
|
786
|
+
*/
|
|
273
787
|
name: z.ZodOptional<z.ZodString>;
|
|
788
|
+
/**
|
|
789
|
+
* @optional The MIME type of the file (e.g., "application/pdf").
|
|
790
|
+
*/
|
|
274
791
|
mimeType: z.ZodOptional<z.ZodString>;
|
|
792
|
+
} & {
|
|
793
|
+
/**
|
|
794
|
+
* @required A URL pointing to the file's content. (keeping as string for now)
|
|
795
|
+
*/
|
|
275
796
|
uri: z.ZodString;
|
|
797
|
+
/**
|
|
798
|
+
* @optional The `bytes` property must be absent when `uri` is present.
|
|
799
|
+
*/
|
|
276
800
|
bytes: z.ZodOptional<z.ZodNever>;
|
|
277
|
-
}, z.
|
|
278
|
-
|
|
801
|
+
}, "strip", z.ZodTypeAny, {
|
|
802
|
+
uri: string;
|
|
803
|
+
name?: string | undefined;
|
|
804
|
+
mimeType?: string | undefined;
|
|
805
|
+
bytes?: undefined;
|
|
806
|
+
}, {
|
|
807
|
+
uri: string;
|
|
808
|
+
name?: string | undefined;
|
|
809
|
+
mimeType?: string | undefined;
|
|
810
|
+
bytes?: undefined;
|
|
811
|
+
}>]>;
|
|
812
|
+
}, "strip", z.ZodTypeAny, {
|
|
813
|
+
file: {
|
|
814
|
+
bytes: string;
|
|
815
|
+
name?: string | undefined;
|
|
816
|
+
mimeType?: string | undefined;
|
|
817
|
+
uri?: undefined;
|
|
818
|
+
} | {
|
|
819
|
+
uri: string;
|
|
820
|
+
name?: string | undefined;
|
|
821
|
+
mimeType?: string | undefined;
|
|
822
|
+
bytes?: undefined;
|
|
823
|
+
};
|
|
824
|
+
kind: "file";
|
|
825
|
+
metadata?: Record<string, unknown> | undefined;
|
|
826
|
+
}, {
|
|
827
|
+
file: {
|
|
828
|
+
bytes: string;
|
|
829
|
+
name?: string | undefined;
|
|
830
|
+
mimeType?: string | undefined;
|
|
831
|
+
uri?: undefined;
|
|
832
|
+
} | {
|
|
833
|
+
uri: string;
|
|
834
|
+
name?: string | undefined;
|
|
835
|
+
mimeType?: string | undefined;
|
|
836
|
+
bytes?: undefined;
|
|
837
|
+
};
|
|
838
|
+
kind: "artifact-update" | "data" | "file" | "message" | "status-update" | "task" | "text";
|
|
839
|
+
metadata?: Record<string, unknown> | undefined;
|
|
840
|
+
}>, z.ZodObject<{
|
|
841
|
+
/**
|
|
842
|
+
* @optional Optional metadata associated with this part.
|
|
843
|
+
*/
|
|
279
844
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
}>;
|
|
845
|
+
} & {
|
|
846
|
+
/**
|
|
847
|
+
* @required The type of this object, used as a discriminator. Always 'data' for a DataPart.
|
|
848
|
+
*/
|
|
849
|
+
kind: z.ZodEffects<z.ZodEnum<["artifact-update", "data", "file", "message", "status-update", "task", "text"]>, "data", "artifact-update" | "data" | "file" | "message" | "status-update" | "task" | "text">;
|
|
850
|
+
/**
|
|
851
|
+
* @required The structured data content of the data part.
|
|
852
|
+
*/
|
|
289
853
|
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
290
|
-
}, z.
|
|
854
|
+
}, "strip", z.ZodTypeAny, {
|
|
855
|
+
data: Record<string, unknown>;
|
|
856
|
+
kind: "data";
|
|
857
|
+
metadata?: Record<string, unknown> | undefined;
|
|
858
|
+
}, {
|
|
859
|
+
data: Record<string, unknown>;
|
|
860
|
+
kind: "artifact-update" | "data" | "file" | "message" | "status-update" | "task" | "text";
|
|
861
|
+
metadata?: Record<string, unknown> | undefined;
|
|
862
|
+
}>]>, "many">;
|
|
863
|
+
/**
|
|
864
|
+
* @optional Optional metadata for extensions. The key is an extension-specific identifier.
|
|
865
|
+
*/
|
|
291
866
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
292
|
-
|
|
293
|
-
|
|
867
|
+
/**
|
|
868
|
+
* @optional The URIs of extensions that are relevant to this message.
|
|
869
|
+
*/
|
|
870
|
+
extensions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
871
|
+
/**
|
|
872
|
+
* @optional A list of other task IDs that this message references for additional context.
|
|
873
|
+
*/
|
|
874
|
+
referenceTaskIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
875
|
+
/**
|
|
876
|
+
* @required A unique identifier for the message, typically a UUID, generated by the sender.
|
|
877
|
+
*/
|
|
294
878
|
messageId: z.ZodString;
|
|
879
|
+
/**
|
|
880
|
+
* @optional The identifier of the task this message is part of. Can be omitted for the first message of a new task.
|
|
881
|
+
*/
|
|
295
882
|
taskId: z.ZodOptional<z.ZodString>;
|
|
883
|
+
/**
|
|
884
|
+
* @optional The context identifier for this message, used to group related interactions.
|
|
885
|
+
*/
|
|
296
886
|
contextId: z.ZodOptional<z.ZodString>;
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
887
|
+
/**
|
|
888
|
+
* @required The type of this object, used as a discriminator. Always 'message' for a Message.
|
|
889
|
+
*/
|
|
890
|
+
kind: z.ZodEffects<z.ZodEnum<["artifact-update", "data", "file", "message", "status-update", "task", "text"]>, "message", "artifact-update" | "data" | "file" | "message" | "status-update" | "task" | "text">;
|
|
891
|
+
}, "strip", z.ZodTypeAny, {
|
|
892
|
+
kind: "message";
|
|
893
|
+
parts: ({
|
|
894
|
+
file: {
|
|
895
|
+
bytes: string;
|
|
896
|
+
name?: string | undefined;
|
|
897
|
+
mimeType?: string | undefined;
|
|
898
|
+
uri?: undefined;
|
|
899
|
+
} | {
|
|
900
|
+
uri: string;
|
|
901
|
+
name?: string | undefined;
|
|
902
|
+
mimeType?: string | undefined;
|
|
903
|
+
bytes?: undefined;
|
|
904
|
+
};
|
|
905
|
+
kind: "file";
|
|
906
|
+
metadata?: Record<string, unknown> | undefined;
|
|
907
|
+
} | {
|
|
908
|
+
text: string;
|
|
909
|
+
kind: "text";
|
|
910
|
+
metadata?: Record<string, unknown> | undefined;
|
|
911
|
+
} | {
|
|
912
|
+
data: Record<string, unknown>;
|
|
913
|
+
kind: "data";
|
|
914
|
+
metadata?: Record<string, unknown> | undefined;
|
|
915
|
+
})[];
|
|
916
|
+
role: "user" | "agent";
|
|
917
|
+
messageId: string;
|
|
918
|
+
metadata?: Record<string, unknown> | undefined;
|
|
919
|
+
extensions?: string[] | undefined;
|
|
920
|
+
referenceTaskIds?: string[] | undefined;
|
|
921
|
+
taskId?: string | undefined;
|
|
922
|
+
contextId?: string | undefined;
|
|
923
|
+
}, {
|
|
924
|
+
kind: "artifact-update" | "data" | "file" | "message" | "status-update" | "task" | "text";
|
|
925
|
+
parts: ({
|
|
926
|
+
file: {
|
|
927
|
+
bytes: string;
|
|
928
|
+
name?: string | undefined;
|
|
929
|
+
mimeType?: string | undefined;
|
|
930
|
+
uri?: undefined;
|
|
931
|
+
} | {
|
|
932
|
+
uri: string;
|
|
933
|
+
name?: string | undefined;
|
|
934
|
+
mimeType?: string | undefined;
|
|
935
|
+
bytes?: undefined;
|
|
936
|
+
};
|
|
937
|
+
kind: "artifact-update" | "data" | "file" | "message" | "status-update" | "task" | "text";
|
|
938
|
+
metadata?: Record<string, unknown> | undefined;
|
|
939
|
+
} | {
|
|
940
|
+
text: string;
|
|
941
|
+
kind: "artifact-update" | "data" | "file" | "message" | "status-update" | "task" | "text";
|
|
942
|
+
metadata?: Record<string, unknown> | undefined;
|
|
943
|
+
} | {
|
|
944
|
+
data: Record<string, unknown>;
|
|
945
|
+
kind: "artifact-update" | "data" | "file" | "message" | "status-update" | "task" | "text";
|
|
946
|
+
metadata?: Record<string, unknown> | undefined;
|
|
947
|
+
})[];
|
|
948
|
+
role: "user" | "agent";
|
|
949
|
+
messageId: string;
|
|
950
|
+
metadata?: Record<string, unknown> | undefined;
|
|
951
|
+
extensions?: string[] | undefined;
|
|
952
|
+
referenceTaskIds?: string[] | undefined;
|
|
953
|
+
taskId?: string | undefined;
|
|
954
|
+
contextId?: string | undefined;
|
|
955
|
+
}>;
|
|
307
956
|
export type Message = z.infer<typeof MessageSchema>;
|
|
308
957
|
//# sourceMappingURL=parameters.d.ts.map
|