builder.io 1.7.11 → 1.7.13

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.
@@ -13,18 +13,20 @@ export declare function requestSignedDownloadUrl(credentials: Credentials, body:
13
13
  * Records a successful git backup in Firebase
14
14
  */
15
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<{
16
+ export type GitBackupDownloadResult = {
21
17
  success: boolean;
18
+ partial?: boolean;
22
19
  exists?: boolean;
23
20
  bundlePath?: string;
24
21
  bundleSize?: number;
25
22
  error?: Error;
26
23
  message?: string;
27
- }>;
24
+ };
25
+ /**
26
+ * Downloads a git backup bundle
27
+ * @returns The path to the downloaded bundle file, or null if no backup exists
28
+ */
29
+ export declare function downloadGitBackup(sys: DevToolsSys, credentials: Credentials, options: GitBackupDownloadUrlOptions): Promise<GitBackupDownloadResult>;
28
30
  /**
29
31
  * Uploads a file stream to a signed URL
30
32
  */
@@ -1,6 +1,6 @@
1
1
  import type { DevToolsSys } from "../types";
2
2
  import { type Credentials } from "./credentials";
3
- import type { CodegenFeedback, CodeGenToolMap, CodegenTurn, CommitMode, CustomInstruction, FusionConfig, GenerateCompletionState, GenerateCompletionStep, GenerateCompletionStepGit, GenerateUserMessage, UserContext, WorkspaceConfiguration, WorkspaceFolder, LoadWholeSessionOptions, LoadWholeSessionResult, LoadHistoryResult, CodeGenMode } from "$/ai-utils";
3
+ import { type CodegenFeedback, type CodeGenToolMap, type CodegenTurn, type CommitMode, type CustomInstruction, type FusionConfig, type GenerateCompletionState, type GenerateCompletionStep, type GenerateCompletionStepGit, type GenerateUserMessage, type UserContext, type WorkspaceConfiguration, type WorkspaceFolder, type LoadWholeSessionOptions, type LoadWholeSessionResult, type LoadHistoryResult, type CodeGenMode } from "$/ai-utils";
4
4
  import prettier from "prettier";
5
5
  import { type FusionContext } from "./code-tools";
6
6
  import EventEmitter from "node:events";
@@ -1,6 +1,8 @@
1
+ import { exec } from "child_process";
1
2
  import type { DevToolsSys } from "@builder.io/dev-tools/core";
2
3
  import { type FusionConfig, type WorkspaceFolder, type InitState, type InitStateStep, type InitStatusLog } from "$/ai-utils";
3
4
  import type { Credentials } from "../credentials";
5
+ import { type GitBackupDownloadResult } from "../backup";
4
6
  export interface InitConfig {
5
7
  fusionConfig: FusionConfig;
6
8
  credentials: Credentials;
@@ -11,11 +13,16 @@ export interface InitStatus {
11
13
  message: string;
12
14
  error?: string;
13
15
  }
16
+ declare const _execAsync: typeof exec.__promisify__;
14
17
  export declare class InitStateMachine {
15
18
  logIdCounter: number;
16
19
  initStatusLogs: InitStatusLog[];
17
20
  initState: InitState;
18
21
  debug: boolean;
22
+ execAsync(...args: Parameters<typeof _execAsync>): Promise<{
23
+ stdout: string | Buffer;
24
+ stderr: string | Buffer;
25
+ }>;
19
26
  init(config: InitConfig, signal?: AbortSignal): Promise<boolean>;
20
27
  addInitLog(type: "status" | "log" | "error" | "complete", message: string, options?: {
21
28
  step?: InitStateStep;
@@ -30,5 +37,16 @@ export declare class InitStateMachine {
30
37
  private isGitConfigured;
31
38
  private getGitRemoteUrl;
32
39
  private sanitizeGitRemoteUrl;
33
- cloneRepository(repo: Required<WorkspaceFolder>, repoPath: string, signal?: AbortSignal): Promise<boolean>;
40
+ /**
41
+ * If a backup is available, perform a backup recovery (and throw if it fails and cannot be recovered from).
42
+ * If no backup is available, do nothing.
43
+ */
44
+ private restoreFromPartialBackup;
45
+ cloneRepository({ repo, repoPath, signal, backupResult, }: {
46
+ repo: Required<WorkspaceFolder>;
47
+ repoPath: string;
48
+ signal?: AbortSignal;
49
+ backupResult: GitBackupDownloadResult | undefined;
50
+ }): Promise<boolean>;
34
51
  }
52
+ export {};