@builder.io/ai-utils 0.6.0 → 0.6.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.d.ts +19 -2
- package/src/projects.d.ts +30 -2
package/package.json
CHANGED
package/src/codegen.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { Attachment, ContentMessageItemToolResult } from "./messages";
|
|
|
2
2
|
import type { BuilderContent } from "./completion";
|
|
3
3
|
import type { Options as PrettierOptions } from "prettier";
|
|
4
4
|
import type { UserContext } from "./mapping";
|
|
5
|
+
import type { ForcedBackup } from "./projects";
|
|
5
6
|
export type ImportType = "named" | "default";
|
|
6
7
|
export interface ESMImport {
|
|
7
8
|
importName: string;
|
|
@@ -151,6 +152,14 @@ export interface WebFetchToolInput {
|
|
|
151
152
|
url: string;
|
|
152
153
|
prompt: string;
|
|
153
154
|
}
|
|
155
|
+
export interface SetImportantFilesToolInput {
|
|
156
|
+
important_files: {
|
|
157
|
+
file_path: string;
|
|
158
|
+
relevance: "high" | "medium" | "low";
|
|
159
|
+
offset?: number;
|
|
160
|
+
limit?: number;
|
|
161
|
+
}[];
|
|
162
|
+
}
|
|
154
163
|
export interface CodeGenToolMap {
|
|
155
164
|
view_path: ViewPathToolInput;
|
|
156
165
|
glob_search: GlobSearchToolInput;
|
|
@@ -187,6 +196,7 @@ export interface CodeGenToolMap {
|
|
|
187
196
|
BuilderEdit: BuilderEditToolInput;
|
|
188
197
|
LS: ListDirToolInput;
|
|
189
198
|
WebFetch: WebFetchToolInput;
|
|
199
|
+
SetImportantFiles: SetImportantFilesToolInput;
|
|
190
200
|
}
|
|
191
201
|
export type CodeGenTools = keyof CodeGenToolMap;
|
|
192
202
|
export type AllCodeGenTools = CodeGenTools | "web_search";
|
|
@@ -763,6 +773,7 @@ export interface BranchBackup {
|
|
|
763
773
|
empty?: boolean;
|
|
764
774
|
repoUrl: string;
|
|
765
775
|
version?: "v1" | "v2";
|
|
776
|
+
forced: ForcedBackup;
|
|
766
777
|
}
|
|
767
778
|
export interface CheckBackupDataResultValid {
|
|
768
779
|
state: "valid";
|
|
@@ -770,6 +781,12 @@ export interface CheckBackupDataResultValid {
|
|
|
770
781
|
message: string;
|
|
771
782
|
backup: BranchBackup;
|
|
772
783
|
}
|
|
784
|
+
export interface CheckBackupDataResultForcedBackup {
|
|
785
|
+
state: "forced-backup";
|
|
786
|
+
outcome: "forced-offline-full-backup";
|
|
787
|
+
message: string;
|
|
788
|
+
backup: BranchBackup;
|
|
789
|
+
}
|
|
773
790
|
export interface CheckBackupDataResultStale {
|
|
774
791
|
state: "stale";
|
|
775
792
|
outcome: "hash-mismatch";
|
|
@@ -782,7 +799,7 @@ export interface CheckBackupDataResultInvalid {
|
|
|
782
799
|
message: string;
|
|
783
800
|
backup: BranchBackup | undefined;
|
|
784
801
|
}
|
|
785
|
-
export type CheckBackupDataResult = CheckBackupDataResultValid | CheckBackupDataResultStale | CheckBackupDataResultInvalid;
|
|
802
|
+
export type CheckBackupDataResult = CheckBackupDataResultValid | CheckBackupDataResultForcedBackup | CheckBackupDataResultStale | CheckBackupDataResultInvalid;
|
|
786
803
|
export interface BackupMetadata {
|
|
787
804
|
check: CheckBackupDataResultValid | CheckBackupDataResultStale;
|
|
788
805
|
downloadUrl: GitBackupDownloadUrlResult | undefined;
|
|
@@ -856,7 +873,7 @@ export interface PrivacyMode {
|
|
|
856
873
|
*/
|
|
857
874
|
mcpServers?: boolean;
|
|
858
875
|
}
|
|
859
|
-
export type Mode = "init-and-launch" | "backup";
|
|
876
|
+
export type Mode = "init-and-launch" | "backup" | "backup-force-full";
|
|
860
877
|
export interface FusionConfig {
|
|
861
878
|
devCommand?: string;
|
|
862
879
|
checkCommand?: string;
|
package/src/projects.d.ts
CHANGED
|
@@ -167,8 +167,6 @@ export interface GitBackupUploadUrlOptions {
|
|
|
167
167
|
projectId: string;
|
|
168
168
|
branchName: string;
|
|
169
169
|
size: number;
|
|
170
|
-
initialCommitHash: string;
|
|
171
|
-
lastCommitHash: string;
|
|
172
170
|
partial: boolean;
|
|
173
171
|
contentMd5: string;
|
|
174
172
|
}
|
|
@@ -178,6 +176,7 @@ export interface GitBackupDownloadUrlOptions {
|
|
|
178
176
|
branchName: string;
|
|
179
177
|
partial: boolean;
|
|
180
178
|
}
|
|
179
|
+
export type ForcedBackup = "offline-full" | "offline" | undefined;
|
|
181
180
|
export interface GitBackupRecordOptions {
|
|
182
181
|
projectId: string;
|
|
183
182
|
branchName: string;
|
|
@@ -191,6 +190,7 @@ export interface GitBackupRecordOptions {
|
|
|
191
190
|
contentMd5?: string;
|
|
192
191
|
repoUrl: string;
|
|
193
192
|
version: "v1" | "v2";
|
|
193
|
+
forced: ForcedBackup;
|
|
194
194
|
}
|
|
195
195
|
export interface GitBackupRecordResult {
|
|
196
196
|
success: boolean;
|
|
@@ -209,4 +209,32 @@ export interface CodegenRuntimeStatus {
|
|
|
209
209
|
lastServerState?: LaunchServerState;
|
|
210
210
|
lastServerVersion?: string;
|
|
211
211
|
}
|
|
212
|
+
export interface BackupGitRepoResultValid {
|
|
213
|
+
success: true;
|
|
214
|
+
partial: boolean;
|
|
215
|
+
repoUrl: string;
|
|
216
|
+
empty: boolean;
|
|
217
|
+
lastCommitHash: string;
|
|
218
|
+
backupRef: string | undefined;
|
|
219
|
+
}
|
|
220
|
+
export interface BackupGitRepoResultInvalid {
|
|
221
|
+
success: false;
|
|
222
|
+
reason: "project_removed";
|
|
223
|
+
}
|
|
224
|
+
export type BackupGitRepoResult = BackupGitRepoResultValid | BackupGitRepoResultInvalid;
|
|
225
|
+
export type ShutdownResponse = {
|
|
226
|
+
success: true;
|
|
227
|
+
message: string;
|
|
228
|
+
skipped: boolean;
|
|
229
|
+
reason: string;
|
|
230
|
+
} | {
|
|
231
|
+
success: false;
|
|
232
|
+
message?: string;
|
|
233
|
+
skipped?: boolean;
|
|
234
|
+
reason?: string;
|
|
235
|
+
error?: Error;
|
|
236
|
+
} | BackupGitRepoResult;
|
|
237
|
+
export type ShutdownResponseSerialized = Omit<ShutdownResponse, "error"> & {
|
|
238
|
+
error?: string;
|
|
239
|
+
};
|
|
212
240
|
export {};
|