builder.io 1.7.5 → 1.7.7

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.
@@ -0,0 +1,31 @@
1
+ import type { DevToolsSys } from "../types";
2
+ import type { Credentials } from "./credentials";
3
+ import type { GitBackupDownloadUrlResult, GitBackupDownloadUrlOptions, GitBackupUploadUrlResult, GitBackupUploadUrlOptions, GitBackupRecordOptions, GitBackupRecordResult } from "$/ai-utils";
4
+ /**
5
+ * Requests a signed upload URL for git backup
6
+ */
7
+ export declare function requestSignedUploadUrl(credentials: Credentials, body: GitBackupUploadUrlOptions): Promise<GitBackupUploadUrlResult>;
8
+ /**
9
+ * Requests a signed download URL for git backup
10
+ */
11
+ export declare function requestSignedDownloadUrl(credentials: Credentials, body: GitBackupDownloadUrlOptions): Promise<GitBackupDownloadUrlResult>;
12
+ /**
13
+ * Records a successful git backup in Firebase
14
+ */
15
+ export declare function recordBackupSuccess(credentials: Credentials, body: GitBackupRecordOptions): Promise<GitBackupRecordResult>;
16
+ /**
17
+ * Downloads a git backup bundle
18
+ * @returns The path to the downloaded bundle file, or null if no backup exists
19
+ */
20
+ export declare function downloadGitBackup(sys: DevToolsSys, credentials: Credentials, options: GitBackupDownloadUrlOptions): Promise<{
21
+ success: boolean;
22
+ exists?: boolean;
23
+ bundlePath?: string;
24
+ bundleSize?: number;
25
+ error?: Error;
26
+ message?: string;
27
+ }>;
28
+ /**
29
+ * Uploads a file stream to a signed URL
30
+ */
31
+ export declare function uploadFileStream(filePath: string, signedUrl: string, size: number): Promise<Response>;
@@ -33,6 +33,10 @@ export interface ToolContext extends Partial<FusionContext> {
33
33
  signal: AbortSignal;
34
34
  workingDirectory: string;
35
35
  allowedCommands: RegExp[];
36
+ getAllFiles: (options: {
37
+ getDotFiles?: boolean;
38
+ pattern?: string;
39
+ }) => Promise<string[]>;
36
40
  restore: (options: {
37
41
  location: "before" | "after";
38
42
  predicate: (turn: CodegenTurn | null, index: number) => boolean;
@@ -57,7 +61,7 @@ export interface ToolContext extends Partial<FusionContext> {
57
61
  writeFile: (filePath: string, content: string | Uint8Array) => Promise<boolean>;
58
62
  deleteFile: (filePath: string) => Promise<boolean>;
59
63
  fileExists: (filePath: string) => Promise<boolean>;
60
- listDir: (dirPath: string, ignoreGlobs?: string[]) => Promise<string[]>;
64
+ listDir: (dirPath: string) => Promise<string[]>;
61
65
  stat: (filePath: string) => Promise<{
62
66
  isDirectory: () => boolean;
63
67
  isFile: () => boolean;
@@ -44,6 +44,7 @@ export type CodeGenEventEmitter = EventEmitter<{
44
44
  export declare class CodeGenSession {
45
45
  #private;
46
46
  constructor(options: CodeGenSessionOptions);
47
+ get fusionConfig(): FusionConfig | undefined;
47
48
  get workingDirectory(): string;
48
49
  initializeSession(opts?: {
49
50
  skipSessionLoading?: boolean;
@@ -99,12 +100,36 @@ export declare class CodeGenSession {
99
100
  error: string;
100
101
  }>;
101
102
  archiveProject(): Promise<string>;
103
+ isIdle(): Promise<boolean>;
104
+ needsBackup(): Promise<boolean>;
102
105
  uploadBackup(): Promise<{
106
+ success: boolean;
107
+ skipped: boolean;
108
+ reason: string;
109
+ lastCommitHash: string;
110
+ filePath?: undefined;
111
+ expiresAt?: undefined;
112
+ bundleSize?: undefined;
113
+ error?: undefined;
114
+ } | {
103
115
  success: boolean;
104
116
  filePath: string;
105
117
  expiresAt: string;
106
118
  bundleSize: number;
107
- } | undefined>;
119
+ skipped?: undefined;
120
+ reason?: undefined;
121
+ lastCommitHash?: undefined;
122
+ error?: undefined;
123
+ } | {
124
+ success: boolean;
125
+ error: Error;
126
+ skipped?: undefined;
127
+ reason?: undefined;
128
+ lastCommitHash?: undefined;
129
+ filePath?: undefined;
130
+ expiresAt?: undefined;
131
+ bundleSize?: undefined;
132
+ }>;
108
133
  createPR(...args: [
109
134
  {
110
135
  repoFullName: string;
@@ -169,7 +194,10 @@ export declare class CodeGenSession {
169
194
  logs: string;
170
195
  } | null>;
171
196
  setDebug(debug: boolean): void;
172
- getAllFiles(): Promise<string[]>;
197
+ getAllFiles(options?: {
198
+ getDotFiles?: boolean;
199
+ pattern?: string;
200
+ }): Promise<string[]>;
173
201
  getSessionId(): string;
174
202
  getSpaceId(): string | undefined;
175
203
  revertToCommitHash(commitHash: string): Promise<void>;
@@ -228,9 +256,16 @@ export declare class CodeGenSession {
228
256
  configureDevOrchestrator(opts: {
229
257
  devCommand?: string;
230
258
  setupCommand?: string;
259
+ proxyPort?: number;
231
260
  proxyServer?: string;
232
261
  env?: Record<string, string | null>;
233
- }): Promise<void>;
262
+ replaceEnvs?: boolean;
263
+ }): Promise<{
264
+ devCommand: boolean;
265
+ setupCommand: boolean;
266
+ proxyServer: boolean;
267
+ env: boolean;
268
+ }>;
234
269
  close(uploadGitBackup?: boolean): Promise<void>;
235
270
  emitGitStatus(): Promise<GenerateCompletionStepGit | null>;
236
271
  manualCommit(options: {
@@ -1,7 +1,9 @@
1
1
  import type { DevToolsSys } from "@builder.io/dev-tools/core";
2
2
  import { type FusionConfig, type WorkspaceFolder, type InitState, type InitStateStep, type InitStatusLog } from "$/ai-utils";
3
+ import type { Credentials } from "../credentials";
3
4
  export interface InitConfig {
4
5
  fusionConfig: FusionConfig;
6
+ credentials: Credentials;
5
7
  sys: DevToolsSys;
6
8
  debug?: boolean;
7
9
  }
@@ -23,13 +23,14 @@ export interface DevServerOrchestrator {
23
23
  proxyMiddleware: ProxyRequestHandler | undefined;
24
24
  pid: number | undefined;
25
25
  abortSetupCommand: () => void;
26
+ clearEnvVariables: () => void;
26
27
  setEnvVariable: (key: string, value: string | undefined) => void;
27
28
  ensureDevCommand: (abortSignal?: AbortSignal) => Promise<boolean>;
28
29
  ensureSetupCommand: (abortSignal?: AbortSignal) => Promise<boolean>;
29
30
  setupCommandPromise: Promise<SetupCommandResult> | undefined;
30
31
  runSetupCommand: (signal?: AbortSignal) => Promise<SetupCommandResult>;
31
- setSetupCommand: (newCommand: string, signal?: AbortSignal) => Promise<SetupCommandResult>;
32
- setCommand: (newCommand: string, signal?: AbortSignal) => Promise<boolean>;
32
+ setSetupCommand: (newCommand: string, forceRestart?: boolean, signal?: AbortSignal) => Promise<SetupCommandResult | null>;
33
+ setDevCommand: (newCommand: string, signal?: AbortSignal) => Promise<boolean>;
33
34
  setProxyServer: (newProxyServer: string) => Promise<boolean>;
34
35
  setPort: (newPort: number) => Promise<boolean>;
35
36
  pingServer: (signal?: AbortSignal) => Promise<Response>;
@@ -4,7 +4,7 @@ export declare function extractSignatureInfo(content: string): {
4
4
  sessionKey?: string;
5
5
  snippetId?: string;
6
6
  };
7
- export declare function getAllProjectFiles(basePath: string, globPattern?: string, extraIgnorePatterns?: string[]): Promise<string[]>;
7
+ export declare function getAllProjectFiles(basePath: string, globPattern?: string, extraIgnorePatterns?: string[], getDotFiles?: boolean): Promise<string[]>;
8
8
  export declare function findBuilderFiles(basePath: string, targetContentId: string, targetSessionKey: string): Promise<FileNode[]>;
9
9
  export declare function filterNonImportantFiles(files: string[]): string[];
10
10
  export declare function getIgnorePatterns(basePath: string): (path: string) => boolean;