@builder.io/ai-utils 0.58.1 → 0.60.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/package.json +1 -1
- package/src/claw.d.ts +6 -0
- package/src/claw.js +9 -0
- package/src/claw.spec.js +27 -0
- package/src/codegen.d.ts +2818 -1003
- package/src/codegen.js +1885 -0
- package/src/design-systems.d.ts +38 -0
- package/src/design-systems.js +14 -0
- package/src/events.d.ts +2 -0
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -0
- package/src/mapping.d.ts +13 -12
- package/src/mapping.js +15 -1
- package/src/messages.d.ts +305 -107
- package/src/messages.js +158 -0
- package/src/projects.d.ts +145 -16
- package/src/projects.js +24 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export type GenerateDesignSystemAttachmentKind = "fig" | "image" | "pdf" | "text";
|
|
3
|
+
export interface GenerateDesignSystemFormFields {
|
|
4
|
+
/**
|
|
5
|
+
* Human-friendly project name. If omitted, the server generates one from
|
|
6
|
+
* the uploaded `.fig` filenames.
|
|
7
|
+
*/
|
|
8
|
+
projectName?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface GenerateDesignSystemRequest extends GenerateDesignSystemFormFields {
|
|
11
|
+
/**
|
|
12
|
+
* Mixed list of uploaded files in any order. Sent as repeated
|
|
13
|
+
* `attachments` fields in the multipart body.
|
|
14
|
+
*/
|
|
15
|
+
attachments: File[];
|
|
16
|
+
}
|
|
17
|
+
export interface GenerateDesignSystemResponse {
|
|
18
|
+
projectId: string;
|
|
19
|
+
branchName: string;
|
|
20
|
+
branchUrl: string;
|
|
21
|
+
}
|
|
22
|
+
export interface GenerateDesignSystemErrorResponse {
|
|
23
|
+
error: string | Record<string, unknown>;
|
|
24
|
+
}
|
|
25
|
+
export declare const GENERATE_DESIGN_SYSTEM_MAX_FILE_BYTES: number;
|
|
26
|
+
export declare const GENERATE_DESIGN_SYSTEM_MAX_ATTACHMENTS = 50;
|
|
27
|
+
export declare const GENERATE_DESIGN_SYSTEM_MIN_ATTACHMENTS = 1;
|
|
28
|
+
/**
|
|
29
|
+
* Validation for non-file fields posted alongside the multipart upload.
|
|
30
|
+
* Files are parsed out of the body by multer before this schema runs.
|
|
31
|
+
*
|
|
32
|
+
* The inferred type matches `GenerateDesignSystemFormFields` so the wire
|
|
33
|
+
* contract stays in lockstep with the shared type.
|
|
34
|
+
*/
|
|
35
|
+
export declare const generateDesignSystemBodySchema: z.ZodObject<{
|
|
36
|
+
projectName: z.ZodOptional<z.ZodString>;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
export type GenerateDesignSystemBody = z.infer<typeof generateDesignSystemBodySchema>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const GENERATE_DESIGN_SYSTEM_MAX_FILE_BYTES = 100 * 1024 * 1024;
|
|
3
|
+
export const GENERATE_DESIGN_SYSTEM_MAX_ATTACHMENTS = 50;
|
|
4
|
+
export const GENERATE_DESIGN_SYSTEM_MIN_ATTACHMENTS = 1;
|
|
5
|
+
/**
|
|
6
|
+
* Validation for non-file fields posted alongside the multipart upload.
|
|
7
|
+
* Files are parsed out of the body by multer before this schema runs.
|
|
8
|
+
*
|
|
9
|
+
* The inferred type matches `GenerateDesignSystemFormFields` so the wire
|
|
10
|
+
* contract stays in lockstep with the shared type.
|
|
11
|
+
*/
|
|
12
|
+
export const generateDesignSystemBodySchema = z.object({
|
|
13
|
+
projectName: z.string().trim().min(1).max(200).optional(),
|
|
14
|
+
});
|
package/src/events.d.ts
CHANGED
|
@@ -625,6 +625,7 @@ export type ClawMessageSentV1 = FusionEventVariant<"claw.message.sent", {
|
|
|
625
625
|
channelId?: string;
|
|
626
626
|
/** Optional clickable URL for channelId. */
|
|
627
627
|
channelUrl?: string;
|
|
628
|
+
channelName?: string;
|
|
628
629
|
dmId?: string;
|
|
629
630
|
senderDisplayName?: string;
|
|
630
631
|
agentBranchName?: string;
|
|
@@ -785,6 +786,7 @@ export interface SendMessageToOrgAgentInput {
|
|
|
785
786
|
channelId?: string;
|
|
786
787
|
/** Optional clickable URL for channelId. */
|
|
787
788
|
channelUrl?: string;
|
|
789
|
+
channelName?: string;
|
|
788
790
|
senderDisplayName?: string;
|
|
789
791
|
messageContext?: string;
|
|
790
792
|
senderId?: string;
|
package/src/index.d.ts
CHANGED
|
@@ -14,4 +14,5 @@ export * from "./claw.js";
|
|
|
14
14
|
export * from "./kube-error.js";
|
|
15
15
|
export * from "./connectivity/types.js";
|
|
16
16
|
export * from "./single-tenancy.js";
|
|
17
|
+
export * from "./design-systems.js";
|
|
17
18
|
export { connectivityErrorCodeToLikelyCause, mapConnectivityErrorMessage, } from "./connectivity/error-codes.js";
|
package/src/index.js
CHANGED
|
@@ -14,4 +14,5 @@ export * from "./claw.js";
|
|
|
14
14
|
export * from "./kube-error.js";
|
|
15
15
|
export * from "./connectivity/types.js";
|
|
16
16
|
export * from "./single-tenancy.js";
|
|
17
|
+
export * from "./design-systems.js";
|
|
17
18
|
export { connectivityErrorCodeToLikelyCause, mapConnectivityErrorMessage, } from "./connectivity/error-codes.js";
|
package/src/mapping.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
1
2
|
import type { ESMImport } from "./codegen";
|
|
2
3
|
export interface RawFigmaJson {
|
|
3
4
|
documents: any[];
|
|
@@ -7,18 +8,18 @@ export interface RawFigmaJson {
|
|
|
7
8
|
componentSets?: Record<string, any>;
|
|
8
9
|
schemaVersion?: number;
|
|
9
10
|
}
|
|
10
|
-
export
|
|
11
|
-
client:
|
|
12
|
-
clientVersion:
|
|
13
|
-
nodeVersion:
|
|
14
|
-
systemPlatform:
|
|
15
|
-
frameworks:
|
|
16
|
-
systemEOL:
|
|
17
|
-
systemArch:
|
|
18
|
-
systemShell
|
|
19
|
-
inGitRepo
|
|
20
|
-
|
|
21
|
-
|
|
11
|
+
export declare const UserContextSchema: z.ZodObject<{
|
|
12
|
+
client: z.ZodString;
|
|
13
|
+
clientVersion: z.ZodString;
|
|
14
|
+
nodeVersion: z.ZodString;
|
|
15
|
+
systemPlatform: z.ZodString;
|
|
16
|
+
frameworks: z.ZodArray<z.ZodString>;
|
|
17
|
+
systemEOL: z.ZodString;
|
|
18
|
+
systemArch: z.ZodString;
|
|
19
|
+
systemShell: z.ZodOptional<z.ZodString>;
|
|
20
|
+
inGitRepo: z.ZodOptional<z.ZodBoolean>;
|
|
21
|
+
}, z.core.$catchall<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodBoolean, z.ZodUndefined]>>>;
|
|
22
|
+
export type UserContext = z.infer<typeof UserContextSchema>;
|
|
22
23
|
export type ExportType = "default" | "named";
|
|
23
24
|
/**
|
|
24
25
|
* Gets the latest component mappings for a space
|
package/src/mapping.js
CHANGED
|
@@ -1 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const UserContextSchema = z
|
|
3
|
+
.object({
|
|
4
|
+
client: z.string(),
|
|
5
|
+
clientVersion: z.string(),
|
|
6
|
+
nodeVersion: z.string(),
|
|
7
|
+
systemPlatform: z.string(),
|
|
8
|
+
frameworks: z.array(z.string()),
|
|
9
|
+
systemEOL: z.string(),
|
|
10
|
+
systemArch: z.string(),
|
|
11
|
+
systemShell: z.string().optional(),
|
|
12
|
+
inGitRepo: z.boolean().optional(),
|
|
13
|
+
})
|
|
14
|
+
.catchall(z.union([z.string(), z.array(z.string()), z.boolean(), z.undefined()]))
|
|
15
|
+
.meta({ title: "UserContext" });
|
package/src/messages.d.ts
CHANGED
|
@@ -1,24 +1,10 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
1
2
|
import type { ContentUpdatePatch } from "./events.js";
|
|
2
3
|
/**
|
|
3
4
|
* Message param does not know the id of the message.
|
|
4
5
|
* This is an input message.
|
|
5
6
|
*/
|
|
6
7
|
export type MessageParam = SystemMessageParam | UserMessageParam | AssistantMessageParam;
|
|
7
|
-
export interface ContentMessageItemText {
|
|
8
|
-
type: "text";
|
|
9
|
-
text: string;
|
|
10
|
-
cache?: boolean;
|
|
11
|
-
citations?: TextCitationParam[] | null;
|
|
12
|
-
ephemeral?: boolean;
|
|
13
|
-
thoughtSignature?: string;
|
|
14
|
-
tag?: string;
|
|
15
|
-
}
|
|
16
|
-
export interface ContentMessageItemImage {
|
|
17
|
-
type: "image";
|
|
18
|
-
source: ImageBase64Source | ImageUrlSource;
|
|
19
|
-
cache?: boolean;
|
|
20
|
-
ephemeral?: boolean;
|
|
21
|
-
}
|
|
22
8
|
export interface ContentMessageItemDocument {
|
|
23
9
|
type: "document";
|
|
24
10
|
source: DocumentBase64Source | DocumentUrlSource | DocumentTextSource;
|
|
@@ -32,15 +18,6 @@ export interface ContentMessageItemVideo {
|
|
|
32
18
|
cache?: boolean;
|
|
33
19
|
ephemeral?: boolean;
|
|
34
20
|
}
|
|
35
|
-
export interface ContentMessageItemResource {
|
|
36
|
-
type: "resource";
|
|
37
|
-
resource: {
|
|
38
|
-
uri: string;
|
|
39
|
-
mimeType?: string;
|
|
40
|
-
text?: string;
|
|
41
|
-
blob?: string;
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
21
|
export interface DocumentBase64Source {
|
|
45
22
|
type: "base64";
|
|
46
23
|
media_type: "application/pdf";
|
|
@@ -56,28 +33,6 @@ export interface DocumentTextSource {
|
|
|
56
33
|
media_type: "text/plain";
|
|
57
34
|
data: string;
|
|
58
35
|
}
|
|
59
|
-
export interface ContentMessageItemToolResult {
|
|
60
|
-
type: "tool_result";
|
|
61
|
-
tool_use_id: string;
|
|
62
|
-
tool_name?: string;
|
|
63
|
-
tool_input?: string;
|
|
64
|
-
title?: string;
|
|
65
|
-
content: string | (ContentMessageItemText | ContentMessageItemImage | ContentMessageItemResource)[];
|
|
66
|
-
is_error?: boolean;
|
|
67
|
-
cache?: boolean;
|
|
68
|
-
ephemeral?: boolean;
|
|
69
|
-
structured_result?: Record<string, any>;
|
|
70
|
-
}
|
|
71
|
-
export interface ImageBase64Source {
|
|
72
|
-
type: "base64";
|
|
73
|
-
media_type: "image/webp" | "image/png" | "image/jpeg" | "image/gif";
|
|
74
|
-
data: string;
|
|
75
|
-
original_url?: string;
|
|
76
|
-
}
|
|
77
|
-
export interface ImageUrlSource {
|
|
78
|
-
type: "url";
|
|
79
|
-
url: string;
|
|
80
|
-
}
|
|
81
36
|
export interface VideoUrlSource {
|
|
82
37
|
type: "url";
|
|
83
38
|
url: string;
|
|
@@ -105,38 +60,6 @@ export interface ContentMessageItemToolUse {
|
|
|
105
60
|
thoughtSignature?: string;
|
|
106
61
|
name: string;
|
|
107
62
|
}
|
|
108
|
-
export interface CitationCharLocationParam {
|
|
109
|
-
cited_text: string;
|
|
110
|
-
document_index: number;
|
|
111
|
-
document_title: string | null;
|
|
112
|
-
end_char_index: number;
|
|
113
|
-
start_char_index: number;
|
|
114
|
-
type: "char_location";
|
|
115
|
-
}
|
|
116
|
-
export interface CitationContentBlockLocationParam {
|
|
117
|
-
cited_text: string;
|
|
118
|
-
document_index: number;
|
|
119
|
-
document_title: string | null;
|
|
120
|
-
end_block_index: number;
|
|
121
|
-
start_block_index: number;
|
|
122
|
-
type: "content_block_location";
|
|
123
|
-
}
|
|
124
|
-
export interface CitationPageLocationParam {
|
|
125
|
-
cited_text: string;
|
|
126
|
-
document_index: number;
|
|
127
|
-
document_title: string | null;
|
|
128
|
-
end_page_number: number;
|
|
129
|
-
start_page_number: number;
|
|
130
|
-
type: "page_location";
|
|
131
|
-
}
|
|
132
|
-
export interface CitationWebSearchResultLocationParam {
|
|
133
|
-
cited_text: string;
|
|
134
|
-
encrypted_index: string;
|
|
135
|
-
title: string | null;
|
|
136
|
-
type: "web_search_result_location";
|
|
137
|
-
url: string;
|
|
138
|
-
}
|
|
139
|
-
export type TextCitationParam = CitationCharLocationParam | CitationPageLocationParam | CitationContentBlockLocationParam | CitationWebSearchResultLocationParam;
|
|
140
63
|
export interface ServerToolUseContent {
|
|
141
64
|
type: "web_search_result";
|
|
142
65
|
title: string;
|
|
@@ -300,33 +223,308 @@ export interface AssistantActionMessage {
|
|
|
300
223
|
export type Message = SystemMessage | UserMessage | AssistantMessage;
|
|
301
224
|
export type GeneratingMessage = null | Partial<AssistantActionMessage | AssistantMessage>;
|
|
302
225
|
export declare function getContentText(message: string | ContentMessage): string;
|
|
303
|
-
export declare function getContentAttachments(message: string | ContentMessage): (
|
|
304
|
-
|
|
305
|
-
|
|
226
|
+
export declare function getContentAttachments(message: string | ContentMessage): ({
|
|
227
|
+
type: "base64";
|
|
228
|
+
media_type: "image/webp" | "image/png" | "image/jpeg" | "image/gif";
|
|
229
|
+
data: string;
|
|
230
|
+
original_url?: string | undefined;
|
|
231
|
+
} | {
|
|
306
232
|
type: "url";
|
|
307
|
-
|
|
308
|
-
}
|
|
309
|
-
export
|
|
310
|
-
type: "
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
}
|
|
233
|
+
url: string;
|
|
234
|
+
})[];
|
|
235
|
+
export declare const URLSchema: z.ZodObject<{
|
|
236
|
+
type: z.ZodLiteral<"url">;
|
|
237
|
+
value: z.ZodString;
|
|
238
|
+
}, z.core.$strip>;
|
|
239
|
+
export type URL = z.infer<typeof URLSchema>;
|
|
240
|
+
export declare const FileUploadSchema: z.ZodObject<{
|
|
241
|
+
type: z.ZodLiteral<"upload">;
|
|
242
|
+
contentType: z.ZodEnum<{
|
|
243
|
+
"image/webp": "image/webp";
|
|
244
|
+
"image/png": "image/png";
|
|
245
|
+
"image/jpeg": "image/jpeg";
|
|
246
|
+
"image/gif": "image/gif";
|
|
247
|
+
"application/pdf": "application/pdf";
|
|
248
|
+
"application/json": "application/json";
|
|
249
|
+
"text/plain": "text/plain";
|
|
250
|
+
}>;
|
|
251
|
+
name: z.ZodString;
|
|
252
|
+
dataUrl: z.ZodString;
|
|
253
|
+
text: z.ZodOptional<z.ZodString>;
|
|
254
|
+
size: z.ZodNumber;
|
|
255
|
+
id: z.ZodString;
|
|
256
|
+
originalUrl: z.ZodOptional<z.ZodString>;
|
|
257
|
+
ephemeral: z.ZodOptional<z.ZodBoolean>;
|
|
258
|
+
}, z.core.$strip>;
|
|
259
|
+
export type FileUpload = z.infer<typeof FileUploadSchema>;
|
|
260
|
+
export declare const TemplateSchema: z.ZodObject<{
|
|
261
|
+
type: z.ZodLiteral<"template">;
|
|
262
|
+
name: z.ZodString;
|
|
263
|
+
id: z.ZodNumber;
|
|
264
|
+
}, z.core.$strip>;
|
|
265
|
+
export type Template = z.infer<typeof TemplateSchema>;
|
|
266
|
+
export declare const BuilderContentAttachmentSchema: z.ZodObject<{
|
|
267
|
+
type: z.ZodLiteral<"builder">;
|
|
268
|
+
html: z.ZodString;
|
|
269
|
+
}, z.core.$strip>;
|
|
270
|
+
export type BuilderContentAttachment = z.infer<typeof BuilderContentAttachmentSchema>;
|
|
271
|
+
export declare const FigmaContentAttachmentSchema: z.ZodObject<{
|
|
272
|
+
type: z.ZodLiteral<"figma">;
|
|
273
|
+
html: z.ZodString;
|
|
274
|
+
}, z.core.$strip>;
|
|
275
|
+
export type FigmaContentAttachment = z.infer<typeof FigmaContentAttachmentSchema>;
|
|
276
|
+
export declare const AttachmentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
277
|
+
type: z.ZodLiteral<"upload">;
|
|
278
|
+
contentType: z.ZodEnum<{
|
|
279
|
+
"image/webp": "image/webp";
|
|
280
|
+
"image/png": "image/png";
|
|
281
|
+
"image/jpeg": "image/jpeg";
|
|
282
|
+
"image/gif": "image/gif";
|
|
283
|
+
"application/pdf": "application/pdf";
|
|
284
|
+
"application/json": "application/json";
|
|
285
|
+
"text/plain": "text/plain";
|
|
286
|
+
}>;
|
|
287
|
+
name: z.ZodString;
|
|
288
|
+
dataUrl: z.ZodString;
|
|
289
|
+
text: z.ZodOptional<z.ZodString>;
|
|
290
|
+
size: z.ZodNumber;
|
|
291
|
+
id: z.ZodString;
|
|
292
|
+
originalUrl: z.ZodOptional<z.ZodString>;
|
|
293
|
+
ephemeral: z.ZodOptional<z.ZodBoolean>;
|
|
294
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
295
|
+
type: z.ZodLiteral<"template">;
|
|
296
|
+
name: z.ZodString;
|
|
297
|
+
id: z.ZodNumber;
|
|
298
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
299
|
+
type: z.ZodLiteral<"url">;
|
|
300
|
+
value: z.ZodString;
|
|
301
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
302
|
+
type: z.ZodLiteral<"builder">;
|
|
303
|
+
html: z.ZodString;
|
|
304
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
305
|
+
type: z.ZodLiteral<"figma">;
|
|
306
|
+
html: z.ZodString;
|
|
307
|
+
}, z.core.$strip>], "type">;
|
|
308
|
+
export type Attachment = z.infer<typeof AttachmentSchema>;
|
|
309
|
+
export declare const CitationCharLocationParamSchema: z.ZodObject<{
|
|
310
|
+
cited_text: z.ZodString;
|
|
311
|
+
document_index: z.ZodNumber;
|
|
312
|
+
document_title: z.ZodNullable<z.ZodString>;
|
|
313
|
+
end_char_index: z.ZodNumber;
|
|
314
|
+
start_char_index: z.ZodNumber;
|
|
315
|
+
type: z.ZodLiteral<"char_location">;
|
|
316
|
+
}, z.core.$strip>;
|
|
317
|
+
export type CitationCharLocationParam = z.infer<typeof CitationCharLocationParamSchema>;
|
|
318
|
+
export declare const CitationContentBlockLocationParamSchema: z.ZodObject<{
|
|
319
|
+
cited_text: z.ZodString;
|
|
320
|
+
document_index: z.ZodNumber;
|
|
321
|
+
document_title: z.ZodNullable<z.ZodString>;
|
|
322
|
+
end_block_index: z.ZodNumber;
|
|
323
|
+
start_block_index: z.ZodNumber;
|
|
324
|
+
type: z.ZodLiteral<"content_block_location">;
|
|
325
|
+
}, z.core.$strip>;
|
|
326
|
+
export type CitationContentBlockLocationParam = z.infer<typeof CitationContentBlockLocationParamSchema>;
|
|
327
|
+
export declare const CitationPageLocationParamSchema: z.ZodObject<{
|
|
328
|
+
cited_text: z.ZodString;
|
|
329
|
+
document_index: z.ZodNumber;
|
|
330
|
+
document_title: z.ZodNullable<z.ZodString>;
|
|
331
|
+
end_page_number: z.ZodNumber;
|
|
332
|
+
start_page_number: z.ZodNumber;
|
|
333
|
+
type: z.ZodLiteral<"page_location">;
|
|
334
|
+
}, z.core.$strip>;
|
|
335
|
+
export type CitationPageLocationParam = z.infer<typeof CitationPageLocationParamSchema>;
|
|
336
|
+
export declare const CitationWebSearchResultLocationParamSchema: z.ZodObject<{
|
|
337
|
+
cited_text: z.ZodString;
|
|
338
|
+
encrypted_index: z.ZodString;
|
|
339
|
+
title: z.ZodNullable<z.ZodString>;
|
|
340
|
+
type: z.ZodLiteral<"web_search_result_location">;
|
|
341
|
+
url: z.ZodString;
|
|
342
|
+
}, z.core.$strip>;
|
|
343
|
+
export type CitationWebSearchResultLocationParam = z.infer<typeof CitationWebSearchResultLocationParamSchema>;
|
|
344
|
+
export declare const TextCitationParamSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
345
|
+
cited_text: z.ZodString;
|
|
346
|
+
document_index: z.ZodNumber;
|
|
347
|
+
document_title: z.ZodNullable<z.ZodString>;
|
|
348
|
+
end_char_index: z.ZodNumber;
|
|
349
|
+
start_char_index: z.ZodNumber;
|
|
350
|
+
type: z.ZodLiteral<"char_location">;
|
|
351
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
352
|
+
cited_text: z.ZodString;
|
|
353
|
+
document_index: z.ZodNumber;
|
|
354
|
+
document_title: z.ZodNullable<z.ZodString>;
|
|
355
|
+
end_page_number: z.ZodNumber;
|
|
356
|
+
start_page_number: z.ZodNumber;
|
|
357
|
+
type: z.ZodLiteral<"page_location">;
|
|
358
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
359
|
+
cited_text: z.ZodString;
|
|
360
|
+
document_index: z.ZodNumber;
|
|
361
|
+
document_title: z.ZodNullable<z.ZodString>;
|
|
362
|
+
end_block_index: z.ZodNumber;
|
|
363
|
+
start_block_index: z.ZodNumber;
|
|
364
|
+
type: z.ZodLiteral<"content_block_location">;
|
|
365
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
366
|
+
cited_text: z.ZodString;
|
|
367
|
+
encrypted_index: z.ZodString;
|
|
368
|
+
title: z.ZodNullable<z.ZodString>;
|
|
369
|
+
type: z.ZodLiteral<"web_search_result_location">;
|
|
370
|
+
url: z.ZodString;
|
|
371
|
+
}, z.core.$strip>], "type">;
|
|
372
|
+
export type TextCitationParam = z.infer<typeof TextCitationParamSchema>;
|
|
373
|
+
export declare const ImageBase64SourceSchema: z.ZodObject<{
|
|
374
|
+
type: z.ZodLiteral<"base64">;
|
|
375
|
+
media_type: z.ZodEnum<{
|
|
376
|
+
"image/webp": "image/webp";
|
|
377
|
+
"image/png": "image/png";
|
|
378
|
+
"image/jpeg": "image/jpeg";
|
|
379
|
+
"image/gif": "image/gif";
|
|
380
|
+
}>;
|
|
381
|
+
data: z.ZodString;
|
|
382
|
+
original_url: z.ZodOptional<z.ZodString>;
|
|
383
|
+
}, z.core.$strip>;
|
|
384
|
+
export type ImageBase64Source = z.infer<typeof ImageBase64SourceSchema>;
|
|
385
|
+
export declare const ImageUrlSourceSchema: z.ZodObject<{
|
|
386
|
+
type: z.ZodLiteral<"url">;
|
|
387
|
+
url: z.ZodString;
|
|
388
|
+
}, z.core.$strip>;
|
|
389
|
+
export type ImageUrlSource = z.infer<typeof ImageUrlSourceSchema>;
|
|
390
|
+
export declare const ContentMessageItemTextSchema: z.ZodObject<{
|
|
391
|
+
type: z.ZodLiteral<"text">;
|
|
392
|
+
text: z.ZodString;
|
|
393
|
+
cache: z.ZodOptional<z.ZodBoolean>;
|
|
394
|
+
citations: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
395
|
+
cited_text: z.ZodString;
|
|
396
|
+
document_index: z.ZodNumber;
|
|
397
|
+
document_title: z.ZodNullable<z.ZodString>;
|
|
398
|
+
end_char_index: z.ZodNumber;
|
|
399
|
+
start_char_index: z.ZodNumber;
|
|
400
|
+
type: z.ZodLiteral<"char_location">;
|
|
401
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
402
|
+
cited_text: z.ZodString;
|
|
403
|
+
document_index: z.ZodNumber;
|
|
404
|
+
document_title: z.ZodNullable<z.ZodString>;
|
|
405
|
+
end_page_number: z.ZodNumber;
|
|
406
|
+
start_page_number: z.ZodNumber;
|
|
407
|
+
type: z.ZodLiteral<"page_location">;
|
|
408
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
409
|
+
cited_text: z.ZodString;
|
|
410
|
+
document_index: z.ZodNumber;
|
|
411
|
+
document_title: z.ZodNullable<z.ZodString>;
|
|
412
|
+
end_block_index: z.ZodNumber;
|
|
413
|
+
start_block_index: z.ZodNumber;
|
|
414
|
+
type: z.ZodLiteral<"content_block_location">;
|
|
415
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
416
|
+
cited_text: z.ZodString;
|
|
417
|
+
encrypted_index: z.ZodString;
|
|
418
|
+
title: z.ZodNullable<z.ZodString>;
|
|
419
|
+
type: z.ZodLiteral<"web_search_result_location">;
|
|
420
|
+
url: z.ZodString;
|
|
421
|
+
}, z.core.$strip>], "type">>>>;
|
|
422
|
+
ephemeral: z.ZodOptional<z.ZodBoolean>;
|
|
423
|
+
thoughtSignature: z.ZodOptional<z.ZodString>;
|
|
424
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
425
|
+
}, z.core.$strip>;
|
|
426
|
+
export type ContentMessageItemText = z.infer<typeof ContentMessageItemTextSchema>;
|
|
427
|
+
export declare const ContentMessageItemImageSchema: z.ZodObject<{
|
|
428
|
+
type: z.ZodLiteral<"image">;
|
|
429
|
+
source: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
430
|
+
type: z.ZodLiteral<"base64">;
|
|
431
|
+
media_type: z.ZodEnum<{
|
|
432
|
+
"image/webp": "image/webp";
|
|
433
|
+
"image/png": "image/png";
|
|
434
|
+
"image/jpeg": "image/jpeg";
|
|
435
|
+
"image/gif": "image/gif";
|
|
436
|
+
}>;
|
|
437
|
+
data: z.ZodString;
|
|
438
|
+
original_url: z.ZodOptional<z.ZodString>;
|
|
439
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
440
|
+
type: z.ZodLiteral<"url">;
|
|
441
|
+
url: z.ZodString;
|
|
442
|
+
}, z.core.$strip>], "type">;
|
|
443
|
+
cache: z.ZodOptional<z.ZodBoolean>;
|
|
444
|
+
ephemeral: z.ZodOptional<z.ZodBoolean>;
|
|
445
|
+
}, z.core.$strip>;
|
|
446
|
+
export type ContentMessageItemImage = z.infer<typeof ContentMessageItemImageSchema>;
|
|
447
|
+
export declare const ContentMessageItemResourceSchema: z.ZodObject<{
|
|
448
|
+
type: z.ZodLiteral<"resource">;
|
|
449
|
+
resource: z.ZodObject<{
|
|
450
|
+
uri: z.ZodString;
|
|
451
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
452
|
+
text: z.ZodOptional<z.ZodString>;
|
|
453
|
+
blob: z.ZodOptional<z.ZodString>;
|
|
454
|
+
}, z.core.$strip>;
|
|
455
|
+
}, z.core.$strip>;
|
|
456
|
+
export type ContentMessageItemResource = z.infer<typeof ContentMessageItemResourceSchema>;
|
|
457
|
+
export declare const ContentMessageItemToolResultSchema: z.ZodObject<{
|
|
458
|
+
type: z.ZodLiteral<"tool_result">;
|
|
459
|
+
tool_use_id: z.ZodString;
|
|
460
|
+
tool_name: z.ZodOptional<z.ZodString>;
|
|
461
|
+
tool_input: z.ZodOptional<z.ZodString>;
|
|
462
|
+
title: z.ZodOptional<z.ZodString>;
|
|
463
|
+
content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
464
|
+
type: z.ZodLiteral<"text">;
|
|
465
|
+
text: z.ZodString;
|
|
466
|
+
cache: z.ZodOptional<z.ZodBoolean>;
|
|
467
|
+
citations: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
468
|
+
cited_text: z.ZodString;
|
|
469
|
+
document_index: z.ZodNumber;
|
|
470
|
+
document_title: z.ZodNullable<z.ZodString>;
|
|
471
|
+
end_char_index: z.ZodNumber;
|
|
472
|
+
start_char_index: z.ZodNumber;
|
|
473
|
+
type: z.ZodLiteral<"char_location">;
|
|
474
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
475
|
+
cited_text: z.ZodString;
|
|
476
|
+
document_index: z.ZodNumber;
|
|
477
|
+
document_title: z.ZodNullable<z.ZodString>;
|
|
478
|
+
end_page_number: z.ZodNumber;
|
|
479
|
+
start_page_number: z.ZodNumber;
|
|
480
|
+
type: z.ZodLiteral<"page_location">;
|
|
481
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
482
|
+
cited_text: z.ZodString;
|
|
483
|
+
document_index: z.ZodNumber;
|
|
484
|
+
document_title: z.ZodNullable<z.ZodString>;
|
|
485
|
+
end_block_index: z.ZodNumber;
|
|
486
|
+
start_block_index: z.ZodNumber;
|
|
487
|
+
type: z.ZodLiteral<"content_block_location">;
|
|
488
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
489
|
+
cited_text: z.ZodString;
|
|
490
|
+
encrypted_index: z.ZodString;
|
|
491
|
+
title: z.ZodNullable<z.ZodString>;
|
|
492
|
+
type: z.ZodLiteral<"web_search_result_location">;
|
|
493
|
+
url: z.ZodString;
|
|
494
|
+
}, z.core.$strip>], "type">>>>;
|
|
495
|
+
ephemeral: z.ZodOptional<z.ZodBoolean>;
|
|
496
|
+
thoughtSignature: z.ZodOptional<z.ZodString>;
|
|
497
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
498
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
499
|
+
type: z.ZodLiteral<"image">;
|
|
500
|
+
source: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
501
|
+
type: z.ZodLiteral<"base64">;
|
|
502
|
+
media_type: z.ZodEnum<{
|
|
503
|
+
"image/webp": "image/webp";
|
|
504
|
+
"image/png": "image/png";
|
|
505
|
+
"image/jpeg": "image/jpeg";
|
|
506
|
+
"image/gif": "image/gif";
|
|
507
|
+
}>;
|
|
508
|
+
data: z.ZodString;
|
|
509
|
+
original_url: z.ZodOptional<z.ZodString>;
|
|
510
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
511
|
+
type: z.ZodLiteral<"url">;
|
|
512
|
+
url: z.ZodString;
|
|
513
|
+
}, z.core.$strip>], "type">;
|
|
514
|
+
cache: z.ZodOptional<z.ZodBoolean>;
|
|
515
|
+
ephemeral: z.ZodOptional<z.ZodBoolean>;
|
|
516
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
517
|
+
type: z.ZodLiteral<"resource">;
|
|
518
|
+
resource: z.ZodObject<{
|
|
519
|
+
uri: z.ZodString;
|
|
520
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
521
|
+
text: z.ZodOptional<z.ZodString>;
|
|
522
|
+
blob: z.ZodOptional<z.ZodString>;
|
|
523
|
+
}, z.core.$strip>;
|
|
524
|
+
}, z.core.$strip>], "type">>]>;
|
|
525
|
+
is_error: z.ZodOptional<z.ZodBoolean>;
|
|
526
|
+
cache: z.ZodOptional<z.ZodBoolean>;
|
|
527
|
+
ephemeral: z.ZodOptional<z.ZodBoolean>;
|
|
528
|
+
structured_result: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
529
|
+
}, z.core.$strip>;
|
|
530
|
+
export type ContentMessageItemToolResult = z.infer<typeof ContentMessageItemToolResultSchema>;
|