@builder.io/ai-utils 0.1.1 → 0.1.2
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 +12 -6
- package/src/events.ts +9 -1
package/package.json
CHANGED
package/src/codegen.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type {
|
|
2
|
+
Attachment,
|
|
2
3
|
ContentMessageItemToolResult,
|
|
3
4
|
UserMessageParam,
|
|
4
5
|
} from "./messages";
|
|
@@ -117,6 +118,7 @@ export interface CodeGenInputOptions {
|
|
|
117
118
|
files?: ProjectFile[];
|
|
118
119
|
rerankFiles?: number;
|
|
119
120
|
toolResults?: ContentMessageItemToolResult[];
|
|
121
|
+
attachments?: Attachment[];
|
|
120
122
|
|
|
121
123
|
// Code options
|
|
122
124
|
builderContent?: BuilderContent;
|
|
@@ -248,7 +250,6 @@ export interface RankedResult {
|
|
|
248
250
|
|
|
249
251
|
export interface GenerateCompletionStepThinking {
|
|
250
252
|
type: "thinking";
|
|
251
|
-
id: string;
|
|
252
253
|
}
|
|
253
254
|
|
|
254
255
|
export interface FileInfo {
|
|
@@ -265,7 +266,6 @@ export interface GenerateCompletionStepUserInput {
|
|
|
265
266
|
export interface GenerateCompletionStepPlanning {
|
|
266
267
|
type: "planning";
|
|
267
268
|
content: string;
|
|
268
|
-
id: string;
|
|
269
269
|
}
|
|
270
270
|
|
|
271
271
|
export interface GenerateCompletionStepUser {
|
|
@@ -300,7 +300,6 @@ export interface GenerateCompletionStepTool {
|
|
|
300
300
|
export interface GenerateCompletionStepText {
|
|
301
301
|
type: "text";
|
|
302
302
|
content: string;
|
|
303
|
-
id: string;
|
|
304
303
|
}
|
|
305
304
|
|
|
306
305
|
export interface GenerateCompletionStepDone {
|
|
@@ -311,7 +310,8 @@ export interface GenerateCompletionStepDone {
|
|
|
311
310
|
actions: ActionItem[];
|
|
312
311
|
usage: CodegenUsage | undefined;
|
|
313
312
|
url?: string;
|
|
314
|
-
stopReason?: "
|
|
313
|
+
stopReason?: "error" | "limit" | CompletionStopReason;
|
|
314
|
+
stopReasonMessage?: string;
|
|
315
315
|
}
|
|
316
316
|
|
|
317
317
|
export interface GenerateCompletionStepStart {
|
|
@@ -333,7 +333,6 @@ export interface GenerateCompletionStepDelta {
|
|
|
333
333
|
|
|
334
334
|
export interface GenerateCompletionStepError {
|
|
335
335
|
type: "error";
|
|
336
|
-
id: string;
|
|
337
336
|
error: string;
|
|
338
337
|
metadata: any;
|
|
339
338
|
}
|
|
@@ -346,7 +345,6 @@ export interface GenerateCompletionStepContinue {
|
|
|
346
345
|
|
|
347
346
|
export interface GenerateCompletionStepWaitForInput {
|
|
348
347
|
type: "wait-for-input";
|
|
349
|
-
id: string;
|
|
350
348
|
}
|
|
351
349
|
|
|
352
350
|
export interface GenerateCompletionStepAbort {
|
|
@@ -378,3 +376,11 @@ export interface ApplyActionsResult {
|
|
|
378
376
|
content?: string;
|
|
379
377
|
oldContent?: string;
|
|
380
378
|
}
|
|
379
|
+
|
|
380
|
+
export interface GenerateUserMessage {
|
|
381
|
+
userPrompt: string;
|
|
382
|
+
files?: string[];
|
|
383
|
+
includeBaseFiles?: boolean;
|
|
384
|
+
skipSearch?: boolean;
|
|
385
|
+
attachments?: Attachment[];
|
|
386
|
+
}
|
package/src/events.ts
CHANGED
|
@@ -42,7 +42,8 @@ export type BuilderAssistantEvent =
|
|
|
42
42
|
| ThreadMessageRetryEvent
|
|
43
43
|
| AppFigmaImportEvent
|
|
44
44
|
| AppWebImportEvent
|
|
45
|
-
| AppAiTemplatesEvent
|
|
45
|
+
| AppAiTemplatesEvent
|
|
46
|
+
| AssistantContentInitialEvent;
|
|
46
47
|
|
|
47
48
|
export interface AssistantCompletionResultEvent {
|
|
48
49
|
type: "assistant.result";
|
|
@@ -442,3 +443,10 @@ export type DeepPartial<T> = T extends object
|
|
|
442
443
|
[P in keyof T]?: DeepPartial<T[P]>;
|
|
443
444
|
}
|
|
444
445
|
: T;
|
|
446
|
+
|
|
447
|
+
export interface AssistantContentInitialEvent {
|
|
448
|
+
type: "assistant.content.initial";
|
|
449
|
+
data: {
|
|
450
|
+
code: string;
|
|
451
|
+
};
|
|
452
|
+
}
|