builder.io 1.10.10 → 1.10.12

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.
@@ -51,7 +51,7 @@ interface InitialCommitHashResult {
51
51
  * - The repo is an example/starter template (users can't push to origin, need to fork)
52
52
  * - There's no origin remote configured
53
53
  *
54
- * For partial backups, we fetch the latest state of the feature branch from origin
54
+ * For partial backups, we fetch the latest state of the chosen upstream branch from origin
55
55
  * to ensure the backup has the correct commit range reference.
56
56
  */
57
57
  export declare function getInitialCommitHash({ sys, repoPath, featureBranch, debug, workspace, }: {
@@ -1,6 +1,6 @@
1
1
  import type { DevToolsSys } from "../types";
2
2
  import { type Credentials } from "./credentials";
3
- import type { CodegenFeedback, CodeGenToolMap, CodegenTurn, CustomInstruction, FusionConfig, GenerateCompletionState, GenerateCompletionStep, GenerateCompletionStepGit, GenerateUserMessage, UserContext, WorkspaceConfiguration, WorkspaceFolder, LoadWholeSessionOptions, LoadWholeSessionResult, LoadHistoryResult, CodeGenMode, ApplyActionsResult } from "$/ai-utils";
3
+ import type { CodegenFeedback, CodeGenToolMap, CodegenTurn, CustomInstruction, FusionConfig, GenerateCompletionState, GenerateCompletionStep, GenerateCompletionStepGit, GenerateUserMessage, UserContext, WorkspaceConfiguration, WorkspaceFolder, LoadWholeSessionOptions, LoadWholeSessionResult, LoadHistoryResult, CodeGenMode, ApplyActionsResult, PrivacyMode } from "$/ai-utils";
4
4
  import prettier from "prettier";
5
5
  import { type FusionContext, type ToolResolution } from "./code-tools";
6
6
  import EventEmitter from "node:events";
@@ -23,8 +23,8 @@ export interface CodeGenSessionOptionsBase {
23
23
  credentials: Credentials;
24
24
  position: string;
25
25
  maxTokens?: number;
26
- encryptKey?: string;
27
26
  mode: CodeGenMode;
27
+ privacyMode?: PrivacyMode;
28
28
  builtInCustomInstructions?: CustomInstruction[];
29
29
  fusionContext?: FusionContext;
30
30
  fusionConfig?: FusionConfig;
@@ -49,6 +49,7 @@ export declare class CodeGenSession {
49
49
  constructor(options: CodeGenSessionOptions);
50
50
  get fusionConfig(): FusionConfig | undefined;
51
51
  get workingDirectory(): string;
52
+ setPrivacyMode(privacyMode: PrivacyMode | undefined): Promise<void>;
52
53
  initializeSession(opts?: {
53
54
  skipSessionLoading?: boolean;
54
55
  }): Promise<void>;
@@ -92,11 +93,7 @@ export declare class CodeGenSession {
92
93
  status: GenerateCompletionStepGit | null;
93
94
  }>;
94
95
  hasChangesRelativeToRemote(): Promise<boolean>;
95
- pullLatestFromRemote(): Promise<boolean>;
96
- syncChangesFromMain(arg: string | {
97
- mainBranchName: string;
98
- allowUnrelatedHistory?: boolean;
99
- }): Promise<{
96
+ pullLatestFromRemote(): Promise<{
100
97
  success: boolean;
101
98
  message: string;
102
99
  conflicts?: undefined;
@@ -105,6 +102,11 @@ export declare class CodeGenSession {
105
102
  conflicts: boolean;
106
103
  message: string;
107
104
  }>;
105
+ syncChangesFromMain(arg: string | {
106
+ mainBranchName: string;
107
+ allowUnrelatedHistory?: boolean;
108
+ pullCurrentBranch?: boolean;
109
+ }): Promise<void>;
108
110
  /**
109
111
  * Get the current commit hash
110
112
  */
@@ -220,6 +222,8 @@ export declare class CodeGenSession {
220
222
  proxyServer?: string;
221
223
  env?: Record<string, string | null>;
222
224
  replaceEnvs?: boolean;
225
+ forceSetupCommand?: boolean;
226
+ forceDevCommand?: boolean;
223
227
  }): Promise<{
224
228
  devCommand: boolean;
225
229
  setupCommand: boolean;
@@ -1,4 +1,5 @@
1
- import type { FusionConfig } from "$/ai-utils";
1
+ import { type FusionConfig } from "$/ai-utils";
2
2
  import type { LaunchArgs } from "../launch";
3
3
  import type { DevToolsSys } from "types";
4
4
  export declare function getFusionConfig(sys: DevToolsSys, args: LaunchArgs): Promise<FusionConfig>;
5
+ export declare function trackConfigData(sys: DevToolsSys, fusionConfig: FusionConfig): void;
@@ -23,13 +23,13 @@ export interface DevServerOrchestrator {
23
23
  pid: number | undefined;
24
24
  abortSetupCommand: () => void;
25
25
  clearEnvVariables: () => void;
26
- setEnvVariable: (key: string, value: string | undefined) => void;
26
+ setEnvVariable: (key: string, value: string | undefined) => boolean;
27
27
  ensureDevCommand: (abortSignal?: AbortSignal) => Promise<boolean>;
28
28
  ensureSetupCommand: (abortSignal?: AbortSignal) => Promise<boolean>;
29
29
  setupCommandPromise: Promise<SetupCommandResult> | undefined;
30
30
  runSetupCommand: (signal?: AbortSignal) => Promise<SetupCommandResult>;
31
31
  setSetupCommand: (newCommand: string, forceRestart?: boolean, signal?: AbortSignal) => Promise<SetupCommandResult | null>;
32
- setDevCommand: (newCommand: string, signal?: AbortSignal) => Promise<boolean>;
32
+ setDevCommand: (newCommand: string, forceRestart?: boolean, signal?: AbortSignal) => Promise<boolean>;
33
33
  setProxyServer: (newProxyServer: string) => Promise<boolean>;
34
34
  setPort: (newPort: number) => Promise<boolean>;
35
35
  pingServer: (signal?: AbortSignal) => Promise<Response>;
@@ -4,3 +4,30 @@
4
4
  */
5
5
  export declare class PrivateError extends Error {
6
6
  }
7
+ /**
8
+ * Standardized network error class with structured properties for better diagnostics
9
+ */
10
+ export declare class NetworkError extends PrivateError {
11
+ constructor({ type, cause, message, suggestions, hostname, port, statusCode, errorCode, }: {
12
+ type: NetworkErrorType;
13
+ cause?: Error;
14
+ message: string;
15
+ suggestions?: string[];
16
+ hostname?: string;
17
+ port?: number;
18
+ statusCode?: number;
19
+ errorCode?: string;
20
+ });
21
+ readonly type: NetworkErrorType;
22
+ readonly suggestions: string[];
23
+ readonly hostname?: string;
24
+ readonly port?: number;
25
+ readonly statusCode?: number;
26
+ readonly errorCode?: string;
27
+ }
28
+ export type NetworkErrorType = "connection_refused" | "connection_timeout" | "dns_not_found" | "ssl_error" | "rate_limit" | "server_error" | "authentication_error" | "unknown";
29
+ export declare function convertNodeErrorToNetworkError(error: Error & {
30
+ code?: string;
31
+ }, hostname: string, port?: number): NetworkError;
32
+ export declare function createHttpError(statusCode: number, hostname: string, cause?: Error): NetworkError;
33
+ export declare function displayNetworkError(error: NetworkError): void;