@builder.io/ai-utils 0.94.0 → 0.96.1

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.
@@ -0,0 +1,149 @@
1
+ import { z } from "zod";
2
+ export declare const PublishAgentSessionCursorSchema: z.ZodObject<{
3
+ updatedAt: z.ZodNumber;
4
+ id: z.ZodString;
5
+ }, z.core.$strip>;
6
+ export type PublishAgentSessionCursor = z.infer<typeof PublishAgentSessionCursorSchema>;
7
+ export declare const PublishAgentSessionsQuerySchema: z.ZodObject<{
8
+ apiKey: z.ZodString;
9
+ sessionId: z.ZodOptional<z.ZodString>;
10
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
11
+ cursor: z.ZodOptional<z.ZodString>;
12
+ completionIdCursor: z.ZodOptional<z.ZodString>;
13
+ archived: z.ZodDefault<z.ZodCodec<z.ZodString, z.ZodBoolean>>;
14
+ }, z.core.$strip>;
15
+ export type PublishAgentSessionsQuery = z.infer<typeof PublishAgentSessionsQuerySchema>;
16
+ /**
17
+ * Body of a session rename and/or archive. The space stays in `?apiKey=` /
18
+ * `x-builder-api-key`, where the request middleware binds it from.
19
+ */
20
+ export declare const PublishAgentSessionUpdateRequestSchema: z.ZodObject<{
21
+ sessionId: z.ZodString;
22
+ title: z.ZodOptional<z.ZodString>;
23
+ archived: z.ZodOptional<z.ZodBoolean>;
24
+ }, z.core.$strip>;
25
+ export type PublishAgentSessionUpdateRequest = z.infer<typeof PublishAgentSessionUpdateRequestSchema>;
26
+ export declare const PublishAgentAttachmentReferenceSchema: z.ZodObject<{
27
+ id: z.ZodOptional<z.ZodString>;
28
+ type: z.ZodString;
29
+ name: z.ZodOptional<z.ZodString>;
30
+ size: z.ZodOptional<z.ZodNumber>;
31
+ }, z.core.$strip>;
32
+ export type PublishAgentAttachmentReference = z.infer<typeof PublishAgentAttachmentReferenceSchema>;
33
+ export declare const PublishAgentToolReferenceSchema: z.ZodObject<{
34
+ id: z.ZodOptional<z.ZodString>;
35
+ name: z.ZodString;
36
+ status: z.ZodEnum<{
37
+ completed: "completed";
38
+ requested: "requested";
39
+ }>;
40
+ }, z.core.$strip>;
41
+ export type PublishAgentToolReference = z.infer<typeof PublishAgentToolReferenceSchema>;
42
+ export declare const PublishAgentSessionMessageSchema: z.ZodObject<{
43
+ id: z.ZodString;
44
+ role: z.ZodEnum<{
45
+ assistant: "assistant";
46
+ user: "user";
47
+ }>;
48
+ senderId: z.ZodOptional<z.ZodString>;
49
+ content: z.ZodOptional<z.ZodString>;
50
+ createdAt: z.ZodNumber;
51
+ status: z.ZodEnum<{
52
+ completed: "completed";
53
+ error: "error";
54
+ running: "running";
55
+ }>;
56
+ attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
57
+ id: z.ZodOptional<z.ZodString>;
58
+ type: z.ZodString;
59
+ name: z.ZodOptional<z.ZodString>;
60
+ size: z.ZodOptional<z.ZodNumber>;
61
+ }, z.core.$strip>>>;
62
+ tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
63
+ id: z.ZodOptional<z.ZodString>;
64
+ name: z.ZodString;
65
+ status: z.ZodEnum<{
66
+ completed: "completed";
67
+ requested: "requested";
68
+ }>;
69
+ }, z.core.$strip>>>;
70
+ }, z.core.$strip>;
71
+ export type PublishAgentSessionMessage = z.infer<typeof PublishAgentSessionMessageSchema>;
72
+ export declare const PublishAgentSessionSummarySchema: z.ZodObject<{
73
+ id: z.ZodString;
74
+ spaceId: z.ZodString;
75
+ createdBy: z.ZodString;
76
+ title: z.ZodNullable<z.ZodString>;
77
+ preview: z.ZodNullable<z.ZodString>;
78
+ archived: z.ZodBoolean;
79
+ createdAt: z.ZodNumber;
80
+ updatedAt: z.ZodNumber;
81
+ lastCompletionId: z.ZodNullable<z.ZodString>;
82
+ totalCompletions: z.ZodNumber;
83
+ numUserMessages: z.ZodNumber;
84
+ }, z.core.$strip>;
85
+ export type PublishAgentSessionSummary = z.infer<typeof PublishAgentSessionSummarySchema>;
86
+ export declare const PublishAgentSessionListResponseSchema: z.ZodObject<{
87
+ sessions: z.ZodArray<z.ZodObject<{
88
+ id: z.ZodString;
89
+ spaceId: z.ZodString;
90
+ createdBy: z.ZodString;
91
+ title: z.ZodNullable<z.ZodString>;
92
+ preview: z.ZodNullable<z.ZodString>;
93
+ archived: z.ZodBoolean;
94
+ createdAt: z.ZodNumber;
95
+ updatedAt: z.ZodNumber;
96
+ lastCompletionId: z.ZodNullable<z.ZodString>;
97
+ totalCompletions: z.ZodNumber;
98
+ numUserMessages: z.ZodNumber;
99
+ }, z.core.$strip>>;
100
+ nextCursor: z.ZodNullable<z.ZodString>;
101
+ }, z.core.$strip>;
102
+ export type PublishAgentSessionListResponse = z.infer<typeof PublishAgentSessionListResponseSchema>;
103
+ export declare const PublishAgentSessionDetailResponseSchema: z.ZodObject<{
104
+ session: z.ZodObject<{
105
+ id: z.ZodString;
106
+ spaceId: z.ZodString;
107
+ createdBy: z.ZodString;
108
+ title: z.ZodNullable<z.ZodString>;
109
+ preview: z.ZodNullable<z.ZodString>;
110
+ archived: z.ZodBoolean;
111
+ createdAt: z.ZodNumber;
112
+ updatedAt: z.ZodNumber;
113
+ lastCompletionId: z.ZodNullable<z.ZodString>;
114
+ totalCompletions: z.ZodNumber;
115
+ numUserMessages: z.ZodNumber;
116
+ }, z.core.$strip>;
117
+ messages: z.ZodArray<z.ZodObject<{
118
+ id: z.ZodString;
119
+ role: z.ZodEnum<{
120
+ assistant: "assistant";
121
+ user: "user";
122
+ }>;
123
+ senderId: z.ZodOptional<z.ZodString>;
124
+ content: z.ZodOptional<z.ZodString>;
125
+ createdAt: z.ZodNumber;
126
+ status: z.ZodEnum<{
127
+ completed: "completed";
128
+ error: "error";
129
+ running: "running";
130
+ }>;
131
+ attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
132
+ id: z.ZodOptional<z.ZodString>;
133
+ type: z.ZodString;
134
+ name: z.ZodOptional<z.ZodString>;
135
+ size: z.ZodOptional<z.ZodNumber>;
136
+ }, z.core.$strip>>>;
137
+ tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
138
+ id: z.ZodOptional<z.ZodString>;
139
+ name: z.ZodString;
140
+ status: z.ZodEnum<{
141
+ completed: "completed";
142
+ requested: "requested";
143
+ }>;
144
+ }, z.core.$strip>>>;
145
+ }, z.core.$strip>>;
146
+ messagesCanLoadMore: z.ZodBoolean;
147
+ messagesNextCursor: z.ZodNullable<z.ZodString>;
148
+ }, z.core.$strip>;
149
+ export type PublishAgentSessionDetailResponse = z.infer<typeof PublishAgentSessionDetailResponseSchema>;
@@ -0,0 +1,88 @@
1
+ import { z } from "zod";
2
+ export const PublishAgentSessionCursorSchema = z
3
+ .object({
4
+ updatedAt: z.number().int(),
5
+ id: z.string().min(1),
6
+ })
7
+ .meta({ title: "PublishAgentSessionCursor" });
8
+ export const PublishAgentSessionsQuerySchema = z
9
+ .object({
10
+ apiKey: z.string().min(1).max(256),
11
+ sessionId: z.string().min(1).max(256).optional(),
12
+ limit: z.coerce.number().int().min(1).max(50).default(20),
13
+ cursor: z.string().min(1).max(2048).optional(),
14
+ completionIdCursor: z.string().min(1).max(256).optional(),
15
+ /** Lists archived sessions instead of active ones. Ignored for a detail read. */
16
+ archived: z.stringbool().default(false),
17
+ })
18
+ .meta({ title: "PublishAgentSessionsQuery" });
19
+ /**
20
+ * Body of a session rename and/or archive. The space stays in `?apiKey=` /
21
+ * `x-builder-api-key`, where the request middleware binds it from.
22
+ */
23
+ export const PublishAgentSessionUpdateRequestSchema = z
24
+ .object({
25
+ sessionId: z.string().min(1).max(256),
26
+ title: z.string().trim().min(1).max(200).optional(),
27
+ archived: z.boolean().optional(),
28
+ })
29
+ .refine((body) => body.title !== undefined || body.archived !== undefined, {
30
+ message: "Provide title, archived, or both.",
31
+ })
32
+ .meta({ title: "PublishAgentSessionUpdateRequest" });
33
+ export const PublishAgentAttachmentReferenceSchema = z
34
+ .object({
35
+ id: z.string().optional(),
36
+ type: z.string(),
37
+ name: z.string().optional(),
38
+ size: z.number().optional(),
39
+ })
40
+ .meta({ title: "PublishAgentAttachmentReference" });
41
+ export const PublishAgentToolReferenceSchema = z
42
+ .object({
43
+ id: z.string().optional(),
44
+ name: z.string(),
45
+ status: z.enum(["requested", "completed"]),
46
+ })
47
+ .meta({ title: "PublishAgentToolReference" });
48
+ export const PublishAgentSessionMessageSchema = z
49
+ .object({
50
+ id: z.string(),
51
+ role: z.enum(["user", "assistant"]),
52
+ senderId: z.string().optional(),
53
+ content: z.string().optional(),
54
+ createdAt: z.number(),
55
+ status: z.enum(["completed", "running", "error"]),
56
+ attachments: z.array(PublishAgentAttachmentReferenceSchema).optional(),
57
+ tools: z.array(PublishAgentToolReferenceSchema).optional(),
58
+ })
59
+ .meta({ title: "PublishAgentSessionMessage" });
60
+ export const PublishAgentSessionSummarySchema = z
61
+ .object({
62
+ id: z.string(),
63
+ spaceId: z.string(),
64
+ createdBy: z.string(),
65
+ title: z.string().nullable(),
66
+ preview: z.string().nullable(),
67
+ archived: z.boolean(),
68
+ createdAt: z.number(),
69
+ updatedAt: z.number(),
70
+ lastCompletionId: z.string().nullable(),
71
+ totalCompletions: z.number(),
72
+ numUserMessages: z.number(),
73
+ })
74
+ .meta({ title: "PublishAgentSessionSummary" });
75
+ export const PublishAgentSessionListResponseSchema = z
76
+ .object({
77
+ sessions: z.array(PublishAgentSessionSummarySchema),
78
+ nextCursor: z.string().nullable(),
79
+ })
80
+ .meta({ title: "PublishAgentSessionListResponse" });
81
+ export const PublishAgentSessionDetailResponseSchema = z
82
+ .object({
83
+ session: PublishAgentSessionSummarySchema,
84
+ messages: z.array(PublishAgentSessionMessageSchema),
85
+ messagesCanLoadMore: z.boolean(),
86
+ messagesNextCursor: z.string().nullable(),
87
+ })
88
+ .meta({ title: "PublishAgentSessionDetailResponse" });
@@ -132,6 +132,8 @@ export type LastIndexInput = {
132
132
  export interface DesignSystem {
133
133
  id: string;
134
134
  spaceId: string;
135
+ /** Additional spaces a space-scoped design system is shared with, beyond spaceId. */
136
+ spaceIds?: string[];
135
137
  rootOrgId: string;
136
138
  createdDate: Date;
137
139
  createdByUserId: string;