@builder.io/ai-utils 0.5.34 → 0.5.36
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.d.ts +38 -13
- package/src/events.d.ts +6 -1
- package/src/messages.d.ts +3 -1
- package/src/projects.d.ts +1 -1
package/package.json
CHANGED
package/src/codegen.d.ts
CHANGED
|
@@ -147,6 +147,10 @@ export interface GetScreenshotToolInput {
|
|
|
147
147
|
width?: number;
|
|
148
148
|
height?: number;
|
|
149
149
|
}
|
|
150
|
+
export interface WebFetchToolInput {
|
|
151
|
+
url: string;
|
|
152
|
+
prompt: string;
|
|
153
|
+
}
|
|
150
154
|
export interface CodeGenToolMap {
|
|
151
155
|
view_path: ViewPathToolInput;
|
|
152
156
|
glob_search: GlobSearchToolInput;
|
|
@@ -182,6 +186,7 @@ export interface CodeGenToolMap {
|
|
|
182
186
|
TodoWrite: TodoWriteToolInput;
|
|
183
187
|
BuilderEdit: BuilderEditToolInput;
|
|
184
188
|
LS: ListDirToolInput;
|
|
189
|
+
WebFetch: WebFetchToolInput;
|
|
185
190
|
}
|
|
186
191
|
export type CodeGenTools = keyof CodeGenToolMap;
|
|
187
192
|
export type AllCodeGenTools = CodeGenTools | "web_search";
|
|
@@ -200,6 +205,7 @@ export interface CodeGenInputOptions {
|
|
|
200
205
|
customInstructions?: CustomInstruction[];
|
|
201
206
|
userPrompt?: string;
|
|
202
207
|
ephemeralUserPrompt?: string;
|
|
208
|
+
uiContextPrompt?: string;
|
|
203
209
|
displayUserPrompt?: string;
|
|
204
210
|
files?: ProjectFile[];
|
|
205
211
|
rerankFiles?: number;
|
|
@@ -209,6 +215,8 @@ export interface CodeGenInputOptions {
|
|
|
209
215
|
workingDirectory?: string;
|
|
210
216
|
encryptKey?: string;
|
|
211
217
|
modelOverride?: string;
|
|
218
|
+
redactUserMessages?: boolean;
|
|
219
|
+
redactLLMMessages?: boolean;
|
|
212
220
|
builderContent?: BuilderContent;
|
|
213
221
|
framework?: CodeGenFramework;
|
|
214
222
|
styleLibrary?: CodeGenStyleLibrary;
|
|
@@ -227,6 +235,7 @@ export interface CodeGenInputOptions {
|
|
|
227
235
|
pingEvents?: boolean;
|
|
228
236
|
forceCompact?: boolean;
|
|
229
237
|
hadPagination?: boolean;
|
|
238
|
+
repair?: boolean;
|
|
230
239
|
searchResponse?: any | null;
|
|
231
240
|
prettierConfig?: PrettierOptions;
|
|
232
241
|
role?: "user" | "agent";
|
|
@@ -553,7 +562,7 @@ export interface UserSourceBuilder {
|
|
|
553
562
|
userId?: string;
|
|
554
563
|
userName?: string;
|
|
555
564
|
userEmail?: string;
|
|
556
|
-
role: "user";
|
|
565
|
+
role: "user" | "agent";
|
|
557
566
|
photoURL?: string;
|
|
558
567
|
principals?: string[];
|
|
559
568
|
}
|
|
@@ -588,13 +597,14 @@ export interface UserSourceBitbucket {
|
|
|
588
597
|
}
|
|
589
598
|
export interface UserSourceAgent {
|
|
590
599
|
source: "agent";
|
|
591
|
-
role: "agent";
|
|
600
|
+
role: "agent" | "user";
|
|
592
601
|
principals?: string[];
|
|
593
602
|
}
|
|
594
603
|
export type UserSource = UserSourceBuilder | UserSourceGithub | UserSourceGitlab | UserSourceAzure | UserSourceBitbucket | UserSourceAgent;
|
|
595
604
|
export interface GenerateUserMessage {
|
|
596
605
|
user?: UserSource;
|
|
597
606
|
userPrompt: string;
|
|
607
|
+
uiContextPrompt?: string;
|
|
598
608
|
ephemeralUserPrompt?: string;
|
|
599
609
|
displayPrompt?: string;
|
|
600
610
|
files?: string[];
|
|
@@ -605,6 +615,7 @@ export interface GenerateUserMessage {
|
|
|
605
615
|
dropAbortedPrompt?: boolean;
|
|
606
616
|
modelOverride?: string;
|
|
607
617
|
maxCompletions?: number;
|
|
618
|
+
repair?: boolean;
|
|
608
619
|
}
|
|
609
620
|
export interface UserInput {
|
|
610
621
|
userMessage: GenerateUserMessage | undefined;
|
|
@@ -618,6 +629,7 @@ export interface UserInput {
|
|
|
618
629
|
user: UserSource;
|
|
619
630
|
patchFusionConfig?: Partial<FusionConfig> | undefined;
|
|
620
631
|
modelOverride?: string;
|
|
632
|
+
repair?: boolean;
|
|
621
633
|
}
|
|
622
634
|
export interface CodegenTurn {
|
|
623
635
|
state: "running" | "done" | "error";
|
|
@@ -753,7 +765,7 @@ export interface CheckBackupDataResultValid {
|
|
|
753
765
|
}
|
|
754
766
|
export interface CheckBackupDataResultInvalid {
|
|
755
767
|
hasValidBackup: false;
|
|
756
|
-
outcome: "no-backup" | "hash-mismatch" | "error" | "not-completed" | "no-session-id" | "no-last-commit-hash" | "no-backup-file" | "empty-full-backup" | "no-vcpCodeGenEvent" | "no-after-commit" | "no-signed-url" | "no-git-branch-name" | "repo-url-mismatch" | "branch-uninitialized";
|
|
768
|
+
outcome: "no-backup" | "hash-mismatch" | "error" | "not-completed" | "no-session-id" | "no-last-commit-hash" | "no-backup-file" | "empty-full-backup" | "no-vcpCodeGenEvent" | "no-after-commit" | "no-signed-url" | "no-git-branch-name" | "repo-url-mismatch" | "branch-uninitialized" | "unexpected-partial-backup" | "unexpected-full-backup";
|
|
757
769
|
message: string;
|
|
758
770
|
backup: BranchBackup | undefined;
|
|
759
771
|
}
|
|
@@ -809,6 +821,28 @@ export type MachineConfig = (RemoteMachineConfig & {
|
|
|
809
821
|
arch: string;
|
|
810
822
|
environment: "local";
|
|
811
823
|
};
|
|
824
|
+
export interface PrivacyMode {
|
|
825
|
+
encrypt: boolean;
|
|
826
|
+
encryptKey?: string;
|
|
827
|
+
/**
|
|
828
|
+
* If true, the user messages will be redacted from the history.
|
|
829
|
+
*
|
|
830
|
+
* @default false
|
|
831
|
+
*/
|
|
832
|
+
redactUserMessages?: boolean;
|
|
833
|
+
/**
|
|
834
|
+
* If true, all the text messages from the LLM will be redacted.
|
|
835
|
+
*
|
|
836
|
+
* @default false
|
|
837
|
+
*/
|
|
838
|
+
redactLLMMessages?: boolean;
|
|
839
|
+
/**
|
|
840
|
+
* If true, the CLI will enable MCP servers during privacy mode.
|
|
841
|
+
*
|
|
842
|
+
* @default false
|
|
843
|
+
*/
|
|
844
|
+
mcpServers?: boolean;
|
|
845
|
+
}
|
|
812
846
|
export interface FusionConfig {
|
|
813
847
|
devCommand?: string;
|
|
814
848
|
checkCommand?: string;
|
|
@@ -829,16 +863,7 @@ export interface FusionConfig {
|
|
|
829
863
|
isLocal?: boolean;
|
|
830
864
|
envVariables?: Record<string, string>;
|
|
831
865
|
accessControl?: AclPolicy;
|
|
832
|
-
privacyMode?:
|
|
833
|
-
encrypt: boolean;
|
|
834
|
-
encryptKey?: string;
|
|
835
|
-
/**
|
|
836
|
-
* If true, the CLI will enable MCP servers during privacy mode.
|
|
837
|
-
*
|
|
838
|
-
* @default false
|
|
839
|
-
*/
|
|
840
|
-
mcpServers?: boolean;
|
|
841
|
-
};
|
|
866
|
+
privacyMode?: PrivacyMode;
|
|
842
867
|
repoIndexingConfig?: RepoIndexingConfig;
|
|
843
868
|
machine?: RemoteMachineConfig;
|
|
844
869
|
_attemptDryRunBackupGit?: boolean;
|
package/src/events.d.ts
CHANGED
|
@@ -312,7 +312,12 @@ export interface CompletionResponseFeedback {
|
|
|
312
312
|
backendDomain?: string;
|
|
313
313
|
backendCommitId: string | undefined;
|
|
314
314
|
feedbackText: string;
|
|
315
|
-
sentiment?: "positive" | "negative";
|
|
315
|
+
sentiment?: "positive" | "negative" | "neutral";
|
|
316
|
+
frustration_level?: "none" | "low" | "medium" | "high";
|
|
317
|
+
repeated_attempts?: boolean;
|
|
318
|
+
confusion_level?: "none" | "low" | "medium" | "high";
|
|
319
|
+
urgency?: "none" | "low" | "medium" | "high";
|
|
320
|
+
satisfaction?: "none" | "low" | "medium" | "high";
|
|
316
321
|
}
|
|
317
322
|
export interface ThreadCreatedEvent {
|
|
318
323
|
type: "assistant.thread.created";
|
package/src/messages.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export interface ContentMessageItemText {
|
|
|
10
10
|
cache?: boolean;
|
|
11
11
|
citations?: TextCitationParam[] | null;
|
|
12
12
|
ephemeral?: boolean;
|
|
13
|
+
thoughtSignature?: string;
|
|
13
14
|
}
|
|
14
15
|
export interface ContentMessageItemImage {
|
|
15
16
|
type: "image";
|
|
@@ -65,7 +66,7 @@ export interface ContentMessageItemThinking {
|
|
|
65
66
|
export interface ContentMessageItemRedactedThinking {
|
|
66
67
|
type: "redacted_thinking";
|
|
67
68
|
data: string;
|
|
68
|
-
source?: "openai";
|
|
69
|
+
source?: "openai" | "gemini";
|
|
69
70
|
id?: string;
|
|
70
71
|
}
|
|
71
72
|
export interface ContentMessageItemToolUse {
|
|
@@ -73,6 +74,7 @@ export interface ContentMessageItemToolUse {
|
|
|
73
74
|
id: string;
|
|
74
75
|
input: unknown;
|
|
75
76
|
completion?: string;
|
|
77
|
+
thoughtSignature?: string;
|
|
76
78
|
name: string;
|
|
77
79
|
}
|
|
78
80
|
export interface CitationCharLocationParam {
|
package/src/projects.d.ts
CHANGED
|
@@ -135,7 +135,7 @@ export interface ReadyMessage extends BaseMessage {
|
|
|
135
135
|
export type MachineState = "unknown" | "created" | "starting" | "started" | "stopping" | "stopped" | "suspending" | "suspended" | "replacing" | "destroying" | "destroyed" | "not-found" | "running" | "failed";
|
|
136
136
|
export type FlyVolumeState = "unknown" | "creating" | "created" | "extending" | "restoring" | "enabling_remote_export" | "hydrating" | "recovering" | "scheduling_destroy" | "pending_destroy" | "failed";
|
|
137
137
|
export type GitAuthErrorCode = "git-auth-failed" | "git-auth-failed-root-repo" | "git-auth-failed-folder-added-by" | "git-auth-failed-folder-created-by" | "git-auth-failed-folder-server-token" | "git-auth-failed-root-repo-server-token";
|
|
138
|
-
export type EnsureContainerErrorCode = "FLY_APP_CHECK_ERROR" | "FLY_CAPACITY_ERROR" | "FLY_PERMISSIONS_TOKEN_ERROR" | "FLY_VOLUME_CREATE_ERROR" | "FLY_VOLUME_FORK_ERROR" | "FLY_VOLUME_DELETE_RECENTLY_FORKED_ERROR" | "FLY_MACHINE_CREATE_ERROR" | "FLY_VOLUME_CHECK_ERROR" | "FLY_NON_MOUNTABLE_VOLUME_ERROR" | "FLY_DEPRECATED_REGION_ERROR" | "FLY_VOLUME_NOT_FOUND" | "ensure-checking-existing-machines" | "found-multiple-failed-machine" | "maximun-retries-machine-creation" | GitAuthErrorCode | "unknown" | "project-bad-state" | "project-not-found" | "project-branch-not-found" | "project-repo-full-name-not-found" | "project-org-not-found" | "no-available-regions" | "invalid-backup-without-volume-id" | "missing-app-with-machine-or-volume" | "update-branch-info-in-firebase" | "update-branch-app-name-in-firebase" | `machine-status-polling-${MachineState}` | `volume-not-found-${FlyVolumeState}` | "trying-to-remove-used-volume" | "timeout" | "fatal:zod-validation-error" | `fatal:${string}`;
|
|
138
|
+
export type EnsureContainerErrorCode = "FLY_APP_CHECK_ERROR" | "FLY_CAPACITY_ERROR" | "FLY_PERMISSIONS_TOKEN_ERROR" | "FLY_VOLUME_CREATE_ERROR" | "FLY_VOLUME_FORK_ERROR" | "FLY_VOLUME_DELETE_RECENTLY_FORKED_ERROR" | "FLY_MACHINE_CREATE_ERROR" | "FLY_VOLUME_CHECK_ERROR" | "FLY_NON_MOUNTABLE_VOLUME_ERROR" | "FLY_DEPRECATED_REGION_ERROR" | "FLY_VOLUME_NOT_FOUND" | "ensure-checking-existing-machines" | "found-multiple-failed-machine" | "maximun-retries-machine-creation" | GitAuthErrorCode | "unknown" | "project-bad-state" | "project-not-found" | "project-branch-not-found" | "project-branch-no-session-id" | "project-repo-full-name-not-found" | "project-org-not-found" | "no-available-regions" | "invalid-backup-without-volume-id" | "missing-app-with-machine-or-volume" | "update-branch-info-in-firebase" | "update-branch-app-name-in-firebase" | `machine-status-polling-${MachineState}` | `volume-not-found-${FlyVolumeState}` | "trying-to-remove-used-volume" | "timeout" | "fatal:zod-validation-error" | `fatal:${string}`;
|
|
139
139
|
export interface ErrorStateMessage extends BaseMessage {
|
|
140
140
|
state: "error";
|
|
141
141
|
message: string;
|