builder.io 1.11.12 → 1.11.14

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.
@@ -17,6 +17,7 @@ interface BackupGitRepoOptions {
17
17
  isConnectedToProvider: boolean;
18
18
  debug: boolean;
19
19
  forcedFullBackup: boolean;
20
+ canAbortMerge: boolean;
20
21
  }
21
22
  /**
22
23
  * Creates a backup of git repository changes made by the AI system.
@@ -30,10 +31,10 @@ interface BackupGitRepoOptions {
30
31
  * The aiBranch is where the AI creates commits as work progresses, while featureBranch
31
32
  * is the base branch where work started (usually "main").
32
33
  */
33
- export declare function backupGitRepo({ sys, credentials, projectId, branchName, repoPath, aiBranch, featureBranch, workspace, isConnectedToProvider, debug, forcedFullBackup, }: BackupGitRepoOptions): Promise<BackupGitRepoResult>;
34
+ export declare function backupGitRepo({ sys, credentials, projectId, branchName, repoPath, aiBranch, featureBranch, workspace, isConnectedToProvider, debug, forcedFullBackup, canAbortMerge, }: BackupGitRepoOptions): Promise<BackupGitRepoResult>;
34
35
  type InitialCommitHashResult = {
35
36
  initialBranch: string;
36
- initialCommitHash: undefined;
37
+ initialCommitHash: string | undefined;
37
38
  partial: false;
38
39
  forcedFullBackup: true;
39
40
  } | {
@@ -1,4 +1,4 @@
1
- import type { CodeGenPosition, CodeGenTools, CodegenTurn, ContentMessageItemToolResult, FusionConfig, GenerateCompletionStep, ProjectFile, UserSource, WorkspaceFolder } from "$/ai-utils";
1
+ import type { AccessResult, CodeGenPosition, CodeGenTools, CodegenTurn, ContentMessageItemToolResult, FusionConfig, GenerateCompletionStep, Permission, ProjectFile, UserSource, WorkspaceFolder } from "$/ai-utils";
2
2
  import type { DevToolsSys } from "../core";
3
3
  import { type DevServerOrchestrator } from "./launch/dev-server-orchestrator";
4
4
  import type { CodeGenEventEmitter } from "./codegen";
@@ -61,10 +61,16 @@ export interface ToolContext extends Partial<FusionContext> {
61
61
  patchFusionConfig: (patch: Partial<FusionConfig>) => void;
62
62
  passThrough: (toolCall: LLMToolCalls, signal: AbortSignal) => Promise<ToolResolution>;
63
63
  readFile: (filePath: string) => Promise<string | null>;
64
- writeFile: (filePath: string, content: string | Uint8Array) => Promise<boolean>;
65
- deleteFile: (filePath: string) => Promise<boolean>;
66
- fileExists: (filePath: string) => Promise<boolean>;
64
+ writeFile: (filePath: string, content: string | Uint8Array) => Promise<string | null>;
65
+ deleteFile: (filePath: string) => Promise<string | null>;
66
+ fileExists: (filePath: string) => Promise<{
67
+ absolutePath: string | undefined;
68
+ recommendedPath: string | undefined;
69
+ workspaceFolder: WorkspaceFolder | undefined;
70
+ virtual: boolean;
71
+ }>;
67
72
  listDir: (dirPath: string) => Promise<string[]>;
73
+ evaluateAccess: (resource: string, permission: Permission) => AccessResult;
68
74
  stat: (filePath: string) => Promise<{
69
75
  isDirectory: () => boolean;
70
76
  isFile: () => boolean;
@@ -56,6 +56,7 @@ export declare class CodeGenSession {
56
56
  loadHistory(): Promise<LoadHistoryResult>;
57
57
  loadWholeSession(opts?: LoadWholeSessionOptions): Promise<LoadWholeSessionResult>;
58
58
  loadMoreTurns(): Promise<CodegenTurn[]>;
59
+ setCustomInstructions(instructions: CustomInstruction[]): void;
59
60
  pushRepoV2(repoInfo: {
60
61
  repoFullName: string;
61
62
  repoUrl: string;
@@ -63,6 +64,16 @@ export declare class CodeGenSession {
63
64
  success: boolean;
64
65
  error: string;
65
66
  details?: undefined;
67
+ } | {
68
+ success: boolean;
69
+ message: string;
70
+ output?: undefined;
71
+ upToDate?: undefined;
72
+ createdBranch?: undefined;
73
+ setUpToStream?: undefined;
74
+ status?: undefined;
75
+ error?: undefined;
76
+ details?: undefined;
66
77
  } | {
67
78
  output: string;
68
79
  upToDate: boolean;
@@ -70,6 +81,7 @@ export declare class CodeGenSession {
70
81
  setUpToStream: boolean;
71
82
  status: GenerateCompletionStepGit | null;
72
83
  success: boolean;
84
+ message?: undefined;
73
85
  error?: undefined;
74
86
  details?: undefined;
75
87
  } | {
@@ -87,11 +99,21 @@ export declare class CodeGenSession {
87
99
  }>;
88
100
  getCommitMode(): import("$/ai-utils").CommitMode;
89
101
  pushChanges(pullFirst?: boolean): Promise<{
102
+ success: boolean;
103
+ message: string;
104
+ output?: undefined;
105
+ upToDate?: undefined;
106
+ createdBranch?: undefined;
107
+ setUpToStream?: undefined;
108
+ status?: undefined;
109
+ } | {
90
110
  output: string;
91
111
  upToDate: boolean;
92
112
  createdBranch: boolean;
93
113
  setUpToStream: boolean;
94
114
  status: GenerateCompletionStepGit | null;
115
+ success?: undefined;
116
+ message?: undefined;
95
117
  }>;
96
118
  hasChangesRelativeToRemote(): Promise<boolean>;
97
119
  pullLatestFromRemote(): Promise<{
@@ -103,11 +125,32 @@ export declare class CodeGenSession {
103
125
  conflicts: boolean;
104
126
  message: string;
105
127
  }>;
128
+ abortMerge(emitStatus?: boolean): Promise<{
129
+ success: boolean;
130
+ message: string;
131
+ }>;
132
+ syncChangesFromRemote(): Promise<{
133
+ success: boolean;
134
+ message: string;
135
+ conflicts?: undefined;
136
+ } | {
137
+ success: boolean;
138
+ conflicts: boolean;
139
+ message: string;
140
+ }>;
106
141
  syncChangesFromMain(arg: string | {
107
142
  mainBranchName: string;
108
143
  allowUnrelatedHistory?: boolean;
109
144
  pullCurrentBranch?: boolean;
110
- }): Promise<void>;
145
+ }): Promise<{
146
+ success: boolean;
147
+ message: string;
148
+ conflicts?: undefined;
149
+ } | {
150
+ success: boolean;
151
+ conflicts: boolean;
152
+ message: string;
153
+ }>;
111
154
  /**
112
155
  * Get the current commit hash
113
156
  */
@@ -242,7 +285,7 @@ export declare class CodeGenSession {
242
285
  connectToEventLoop(shouldReplay: boolean, onStep: (step: GenerateCompletionStep) => void): () => void;
243
286
  waitUntilIdle(): Promise<void>;
244
287
  waitForEventLoop(): Promise<void>;
245
- commitWorkInProgress(lastTurn: CodegenTurn): Promise<string | undefined>;
288
+ commitWorkInProgress(lastTurn: CodegenTurn, changedFiles: string[]): Promise<string | false | undefined>;
246
289
  getChangesReport(): Promise<{
247
290
  diff: string;
248
291
  files: string[];
@@ -269,13 +312,18 @@ export declare class CodeGenSession {
269
312
  * @param filePath A file path that may include a workspace prefix
270
313
  * @returns The file content or null if the file doesn't exist
271
314
  */
272
- readFile(filePath: string): Promise<string | null>;
315
+ readFile(filePath: string, skipAclCheck?: boolean): Promise<string | null>;
273
316
  /**
274
317
  * Checks if a file exists in the workspace
275
318
  * @param filePath A file path that may include a workspace prefix
276
319
  * @returns True if the file exists, false otherwise
277
320
  */
278
- fileExists(filePath: string): Promise<boolean>;
321
+ fileExists(filePath: string): Promise<{
322
+ absolutePath: string | undefined;
323
+ recommendedPath: string | undefined;
324
+ workspaceFolder: WorkspaceFolder | undefined;
325
+ virtual: boolean;
326
+ }>;
279
327
  /**
280
328
  * Reads a file from the workspace synchronously
281
329
  * @param filePath A file path that may include a workspace prefix
@@ -288,7 +336,7 @@ export declare class CodeGenSession {
288
336
  * @param content The content to write
289
337
  * @returns True if the write was successful, false otherwise
290
338
  */
291
- writeFile(filePath: string, content: string | Uint8Array): Promise<boolean>;
339
+ writeFile(filePath: string, content: string | Uint8Array, skipAclCheck?: boolean): Promise<string | null>;
292
340
  /**
293
341
  * Lists files in a directory in the workspace
294
342
  * @param dirPath A directory path that may include a workspace prefix
@@ -300,7 +348,7 @@ export declare class CodeGenSession {
300
348
  * @param filePath A file path that may include a workspace prefix
301
349
  * @returns The file stats or null if the file doesn't exist
302
350
  */
303
- stat(filePath: string): Promise<{
351
+ stat(filePath: string, skipAclCheck?: boolean): Promise<{
304
352
  isDirectory: () => boolean;
305
353
  isFile: () => boolean;
306
354
  } | null>;
@@ -309,7 +357,7 @@ export declare class CodeGenSession {
309
357
  * @param filePath A file path that may include a workspace prefix
310
358
  * @returns True if the delete was successful, false otherwise
311
359
  */
312
- deleteFile(filePath: string): Promise<boolean>;
360
+ deleteFile(filePath: string, skipAclCheck?: boolean): Promise<string | null>;
313
361
  getLinesStats(): {
314
362
  net: number;
315
363
  added: number;
@@ -16,7 +16,15 @@ export declare const runCodeGen: (sys: DevToolsSys, credentials: Credentials, se
16
16
  tags?: object;
17
17
  maxTokens?: number;
18
18
  }, metadata?: any) => Promise<string>;
19
- export declare const getAllDesignSystems: (credentials: Credentials, userSettings: UserSettings | null, onlyEditAccess?: boolean) => Promise<DesignSystem[]>;
19
+ export declare const getAllDesignSystems: (credentials: Credentials, opts?: {
20
+ /**
21
+ * If true, only design systems that the user has permission to edit will be
22
+ * returned. If false, all design systems that the user has permission to edit
23
+ * as well as design systems that the user has permission to read but not edit
24
+ * will be returned. Defaults to false.
25
+ */
26
+ onlyEditAccess?: boolean;
27
+ }) => Promise<DesignSystem[]>;
20
28
  export declare const getDisplayDesignSystems: (credentials: Credentials) => Promise<DisplayDesignSystem[]>;
21
29
  export declare const getDesignSystemsByScope: (scope: DesignSystemScope, designSystems: DesignSystem[]) => DesignSystem[];
22
30
  export declare const getDesignSystemByName: (designSystemName: string, designSystems: DesignSystem[]) => DesignSystem | null;