@builder.io/ai-utils 0.3.17 → 0.3.18
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/codegen.ts +7 -6
- package/src/messages.ts +58 -5
package/package.json
CHANGED
package/src/codegen.ts
CHANGED
|
@@ -141,10 +141,7 @@ export interface CodeGenToolMap {
|
|
|
141
141
|
|
|
142
142
|
export type CodeGenTools = keyof CodeGenToolMap;
|
|
143
143
|
|
|
144
|
-
export type AllCodeGenTools =
|
|
145
|
-
| CodeGenTools
|
|
146
|
-
| "str_replace_editor"
|
|
147
|
-
| "web_search";
|
|
144
|
+
export type AllCodeGenTools = CodeGenTools | "web_search";
|
|
148
145
|
|
|
149
146
|
export type CodeGenMode =
|
|
150
147
|
| "exact" // @deprecated
|
|
@@ -190,6 +187,7 @@ export interface CodeGenInputOptions {
|
|
|
190
187
|
promptCaching?: boolean;
|
|
191
188
|
llmSuggestions?: boolean;
|
|
192
189
|
conclusionText?: boolean;
|
|
190
|
+
mcpServers?: boolean;
|
|
193
191
|
|
|
194
192
|
searchResponse?: any | null;
|
|
195
193
|
|
|
@@ -205,8 +203,6 @@ export interface CodeGenInputOptions {
|
|
|
205
203
|
/** @deprecated */
|
|
206
204
|
prevId?: string;
|
|
207
205
|
/** @deprecated */
|
|
208
|
-
nextPage?: boolean;
|
|
209
|
-
/** @deprecated */
|
|
210
206
|
vcpId?: string;
|
|
211
207
|
}
|
|
212
208
|
|
|
@@ -667,6 +663,10 @@ export interface GenerateCodeEventDelta {
|
|
|
667
663
|
content: string;
|
|
668
664
|
}
|
|
669
665
|
|
|
666
|
+
export interface GenerateCodeEventPing {
|
|
667
|
+
type: "ping";
|
|
668
|
+
}
|
|
669
|
+
|
|
670
670
|
export interface GenerateCodeEventUser {
|
|
671
671
|
type: "user";
|
|
672
672
|
id: string;
|
|
@@ -683,4 +683,5 @@ export type GenerateCodeEvent =
|
|
|
683
683
|
| GenerateCodeEventPagination
|
|
684
684
|
| GenerateCodeEventDelta
|
|
685
685
|
| GenerateCodeEventError
|
|
686
|
+
| GenerateCodeEventPing
|
|
686
687
|
| GenerateCodeEventUser;
|
package/src/messages.ts
CHANGED
|
@@ -48,7 +48,7 @@ export interface ContentMessageItemToolResult {
|
|
|
48
48
|
tool_name?: string;
|
|
49
49
|
tool_input?: string;
|
|
50
50
|
title?: string;
|
|
51
|
-
content: string;
|
|
51
|
+
content: string | (ContentMessageItemText | ContentMessageItemImage)[];
|
|
52
52
|
is_error?: boolean;
|
|
53
53
|
cache?: boolean;
|
|
54
54
|
ephemeral?: boolean;
|
|
@@ -56,7 +56,7 @@ export interface ContentMessageItemToolResult {
|
|
|
56
56
|
|
|
57
57
|
export interface ImageBase64Source {
|
|
58
58
|
type: "base64";
|
|
59
|
-
media_type: "image/webp" | "image/png" | "image/jpeg";
|
|
59
|
+
media_type: "image/webp" | "image/png" | "image/jpeg" | "image/gif";
|
|
60
60
|
data: string;
|
|
61
61
|
}
|
|
62
62
|
|
|
@@ -170,16 +170,65 @@ export type ServerToolUseContentUnion =
|
|
|
170
170
|
export interface ContentMessageItemServerToolUse {
|
|
171
171
|
type: "server_tool_use";
|
|
172
172
|
id: string;
|
|
173
|
-
name: "web_search";
|
|
173
|
+
name: "web_search" | "code_execution";
|
|
174
174
|
input: unknown;
|
|
175
175
|
completion?: string;
|
|
176
|
-
content?:
|
|
176
|
+
content?: any;
|
|
177
|
+
cache?: boolean;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export interface MCPServerURLDefinition {
|
|
181
|
+
name: string;
|
|
182
|
+
|
|
183
|
+
type: "url";
|
|
184
|
+
|
|
185
|
+
url: string;
|
|
186
|
+
|
|
187
|
+
authorization_token?: string | null;
|
|
188
|
+
|
|
189
|
+
tool_configuration?: MCPServerToolConfiguration | null;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export interface MCPServerToolConfiguration {
|
|
193
|
+
allowed_tools?: Array<string> | null;
|
|
194
|
+
|
|
195
|
+
enabled?: boolean | null;
|
|
177
196
|
}
|
|
178
197
|
|
|
179
198
|
export interface ContentMessageItemWebSearchToolResult {
|
|
180
199
|
content: ServerToolUseContent[] | ServerToolUseContentError;
|
|
181
200
|
tool_use_id: string;
|
|
182
201
|
type: "web_search_tool_result";
|
|
202
|
+
cache?: boolean;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export interface ContentMessageItemMCPToolUse {
|
|
206
|
+
type: "mcp_tool_use";
|
|
207
|
+
id: string;
|
|
208
|
+
name: string;
|
|
209
|
+
input: unknown;
|
|
210
|
+
server_name: string;
|
|
211
|
+
cache?: boolean;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export interface ContentMessageItemContainerUpload {
|
|
215
|
+
type: "container_upload";
|
|
216
|
+
file_id: string;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export interface ContentMessageItemMCPToolResult {
|
|
220
|
+
type: "mcp_tool_result";
|
|
221
|
+
tool_use_id: string;
|
|
222
|
+
content: string | ContentMessageItemText[];
|
|
223
|
+
is_error: boolean;
|
|
224
|
+
cache?: boolean;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export interface ContentMessageItemCodeExecutionToolResult {
|
|
228
|
+
type: "code_execution_tool_result";
|
|
229
|
+
tool_use_id: string;
|
|
230
|
+
content: any;
|
|
231
|
+
cache?: boolean;
|
|
183
232
|
}
|
|
184
233
|
|
|
185
234
|
export type ContentMessageItem =
|
|
@@ -191,7 +240,11 @@ export type ContentMessageItem =
|
|
|
191
240
|
| ContentMessageItemToolUse
|
|
192
241
|
| ContentMessageItemToolResult
|
|
193
242
|
| ContentMessageItemWebSearchToolResult
|
|
194
|
-
| ContentMessageItemServerToolUse
|
|
243
|
+
| ContentMessageItemServerToolUse
|
|
244
|
+
| ContentMessageItemMCPToolUse
|
|
245
|
+
| ContentMessageItemMCPToolResult
|
|
246
|
+
| ContentMessageItemContainerUpload
|
|
247
|
+
| ContentMessageItemCodeExecutionToolResult;
|
|
195
248
|
|
|
196
249
|
export type ContentMessage = ContentMessageItem[];
|
|
197
250
|
|