@builder.io/ai-utils 0.3.6 → 0.3.8
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 +21 -7
package/package.json
CHANGED
package/src/codegen.ts
CHANGED
|
@@ -32,7 +32,8 @@ export interface CustomInstruction {
|
|
|
32
32
|
id: string;
|
|
33
33
|
name: string;
|
|
34
34
|
content: string;
|
|
35
|
-
type?: "always" | "agent-mode"
|
|
35
|
+
type?: "always" | "agent-mode";
|
|
36
|
+
filePath?: string;
|
|
36
37
|
glob?: string;
|
|
37
38
|
description?: string;
|
|
38
39
|
}
|
|
@@ -67,6 +68,8 @@ export type CompletionStopReason =
|
|
|
67
68
|
| "tool_use"
|
|
68
69
|
| "end_turn"
|
|
69
70
|
| "content_filter"
|
|
71
|
+
| "error"
|
|
72
|
+
| "aborted"
|
|
70
73
|
| null;
|
|
71
74
|
|
|
72
75
|
export interface ViewPathToolInput {
|
|
@@ -86,25 +89,30 @@ export interface GrepSearchToolInput {
|
|
|
86
89
|
|
|
87
90
|
export interface GetRuleToolInput {
|
|
88
91
|
name: string;
|
|
89
|
-
type?: "always" | "agent-mode" | string;
|
|
90
|
-
glob?: string;
|
|
91
|
-
description?: string;
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
export interface
|
|
94
|
+
export interface DevServerControlInput {
|
|
95
|
+
restart?: boolean;
|
|
96
|
+
getLogs?: boolean;
|
|
97
|
+
}
|
|
95
98
|
|
|
96
99
|
export interface BashToolInput {
|
|
97
100
|
command?: string;
|
|
98
101
|
restart?: boolean;
|
|
99
102
|
}
|
|
100
103
|
|
|
104
|
+
export interface WebSearchToolInput {
|
|
105
|
+
query: string;
|
|
106
|
+
}
|
|
107
|
+
|
|
101
108
|
export interface CodeGenToolMap {
|
|
102
109
|
view_path: ViewPathToolInput;
|
|
103
110
|
glob_search: GlobSearchToolInput;
|
|
104
111
|
grep_search: GrepSearchToolInput;
|
|
105
112
|
get_rule: GetRuleToolInput;
|
|
106
|
-
|
|
113
|
+
dev_server_control: DevServerControlInput;
|
|
107
114
|
bash: BashToolInput;
|
|
115
|
+
web_search: WebSearchToolInput;
|
|
108
116
|
}
|
|
109
117
|
|
|
110
118
|
export type CodeGenTools = keyof CodeGenToolMap;
|
|
@@ -135,6 +143,7 @@ export interface CodeGenInputOptions {
|
|
|
135
143
|
toolResults?: ContentMessageItemToolResult[];
|
|
136
144
|
attachments?: Attachment[];
|
|
137
145
|
beforeCommit?: string;
|
|
146
|
+
workingDirectory?: string;
|
|
138
147
|
|
|
139
148
|
// Code options
|
|
140
149
|
builderContent?: BuilderContent;
|
|
@@ -186,6 +195,7 @@ export interface PromptSuggestion {
|
|
|
186
195
|
type:
|
|
187
196
|
| "missing-imports"
|
|
188
197
|
| "lazy-code"
|
|
198
|
+
| "no-file-for-diff"
|
|
189
199
|
| "syntax-error"
|
|
190
200
|
| "llm-suggested"
|
|
191
201
|
| "diff-apply";
|
|
@@ -261,6 +271,7 @@ export interface GenerateCompletionStepThinking {
|
|
|
261
271
|
export interface FileInfo {
|
|
262
272
|
filePath: string;
|
|
263
273
|
size: number;
|
|
274
|
+
isCustomInstruction: boolean;
|
|
264
275
|
}
|
|
265
276
|
|
|
266
277
|
export interface GenerateCompletionStepUserInput {
|
|
@@ -346,6 +357,7 @@ export interface GenerateCompletionStepError {
|
|
|
346
357
|
metadata?: any;
|
|
347
358
|
message: string;
|
|
348
359
|
usage?: CodegenUsage;
|
|
360
|
+
contextPrompt?: string;
|
|
349
361
|
}
|
|
350
362
|
|
|
351
363
|
export interface GenerateCompletionStepContinue {
|
|
@@ -393,8 +405,9 @@ export interface GenerateCompletionStepClose {
|
|
|
393
405
|
|
|
394
406
|
export interface GenerateCompletionStepStdio {
|
|
395
407
|
type: "stdio";
|
|
408
|
+
command: string;
|
|
396
409
|
stream: "stdout" | "stderr";
|
|
397
|
-
source: "run-command";
|
|
410
|
+
source: "run-command" | "tool-command";
|
|
398
411
|
content: string;
|
|
399
412
|
}
|
|
400
413
|
|
|
@@ -447,6 +460,7 @@ export interface GenerateUserMessage {
|
|
|
447
460
|
includeBaseFiles?: boolean;
|
|
448
461
|
skipSearch?: boolean;
|
|
449
462
|
attachments?: Attachment[];
|
|
463
|
+
debugMode?: boolean;
|
|
450
464
|
}
|
|
451
465
|
|
|
452
466
|
export interface UserInput {
|