builder.io 1.6.32 → 1.6.34

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.
@@ -4,16 +4,20 @@ import { type Credentials } from "./credentials";
4
4
  import type { CodegenTurn, CustomInstruction, GenerateCompletionState, GenerateCompletionStep, GenerateUserMessage, UserContext } from "$/ai-utils";
5
5
  import prettier from "prettier";
6
6
  import { type ProvidedToolContext } from "./code-tools";
7
- import type { ChildProcessWithoutNullStreams } from "child_process";
8
7
  export interface RunCommandCtx {
9
8
  command: string;
9
+ state: "running" | "crashed";
10
+ ensureRunning: () => Promise<boolean>;
11
+ addCheckpoint: () => void;
12
+ getCheckpoints: (n: number) => string;
10
13
  getAllStdout: () => string;
11
14
  getAllStderr: () => string;
12
15
  getOutput: () => string;
13
16
  pid: number | undefined;
14
- process: ChildProcessWithoutNullStreams;
17
+ onClose: (callback: (code: number | null) => void) => void;
15
18
  onStdout: (callback: (data: string) => void) => void;
16
19
  onStderr: (callback: (data: string) => void) => void;
20
+ restart: () => Promise<void>;
17
21
  }
18
22
  export interface SessionContext {
19
23
  sessionId: string;
@@ -33,10 +37,12 @@ export interface CodeGenSessionOptionsBase {
33
37
  credentials: Credentials;
34
38
  args: CLIArgs;
35
39
  position: string;
40
+ maxTokens?: number;
36
41
  mode?: "quality" | "quality-v3" | "fast";
37
42
  fusion?: boolean;
38
43
  fusionRemote?: string;
39
44
  fusionAutoInitGit?: boolean;
45
+ builtInCustomInstructions?: CustomInstruction[];
40
46
  featureBranch?: string;
41
47
  providedToolContext?: ProvidedToolContext;
42
48
  }
@@ -41,4 +41,8 @@ export interface CLIArgs {
41
41
  _: string[];
42
42
  /** Auto-initialize a git repository if none exists (for Fusion) */
43
43
  fusionAutoInitGit?: boolean;
44
+ /** Builder private key, used for authentication. */
45
+ builderPrivateKey?: string;
46
+ /** Builder public key, used for authentication. */
47
+ builderPublicKey?: string;
44
48
  }
@@ -29,7 +29,7 @@ export type LaunchStatus = {
29
29
  gitRepo?: {
30
30
  exists?: boolean;
31
31
  configured?: boolean;
32
- repo?: string | undefined;
32
+ repo?: string;
33
33
  branch?: string;
34
34
  error?: string | undefined;
35
35
  current?: string | undefined;
@@ -60,3 +60,14 @@ export type LaunchStatus = {
60
60
  };
61
61
  export declare const updateStatus: <T extends keyof LaunchStatus>(key: T, value: Partial<LaunchStatus[T]>) => void;
62
62
  export declare const getConfigStatus: () => LaunchStatus;
63
+ /**
64
+ * Get the GitHub remote URL for a given repository
65
+ * @param repoFullName - The full name of the repository (e.g. "BuilderIO/fusion-starter")
66
+ * @param githubToken - The GitHub token to use for the remote URL
67
+ * @returns The GitHub remote URL
68
+ */
69
+ export declare const getGitHubRemoteUrl: ({ repoFullName, githubToken, }: {
70
+ repoFullName: string;
71
+ githubToken: string | undefined;
72
+ }) => string;
73
+ export declare const getActiveBranch: () => string;
@@ -1,9 +1,15 @@
1
- import { type Express, type RequestHandler } from "express";
1
+ import { type Express } from "express";
2
2
  export declare const BUILDER_ENDPOINT_PREFIX = "/_builder.io";
3
3
  export declare const BUILDER_API_ENDPOINT_PREFIX: string;
4
- export declare const configureServer: (app: Express) => void;
5
- export declare const serverAuthMiddleware: ({ validBuilderPrivateKey, authenticateProxy, }: {
4
+ /**
5
+ * Endpoints that are not authenticated because they are used by the fly.io health check.
6
+ */
7
+ export declare const NON_AUTHENTICATED_ENDPOINTS: {
8
+ readonly STATUS: "/status";
9
+ readonly PROXY_STATUS: "/proxy-status";
10
+ };
11
+ export declare const configureServer: ({ app, validBuilderPrivateKey, authenticateProxy, }: {
12
+ app: Express;
6
13
  validBuilderPrivateKey: string | undefined;
7
14
  authenticateProxy: boolean;
8
- }) => RequestHandler;
9
- export declare const createLogAndConfigEndpoints: (app: Express) => void;
15
+ }) => void;
@@ -6,6 +6,12 @@ export interface InitArgs extends CLIArgs {
6
6
  githubToken?: string;
7
7
  installCommand?: string;
8
8
  volumePath?: string;
9
+ /**
10
+ * Indicates the type of docker image the CLI is running on.
11
+ *
12
+ * @default "node"
13
+ */
14
+ dockerImageType?: "fusion-starter" | "node";
9
15
  }
10
16
  export declare function runLaunchInitCommand({ args, sys, }: {
11
17
  sys: DevToolsSys;
@@ -29,6 +29,12 @@ export interface LaunchArgs extends CLIArgs {
29
29
  * @default false
30
30
  */
31
31
  authenticateProxy?: boolean;
32
+ /**
33
+ * Indicates the type of docker image the CLI is running on.
34
+ *
35
+ * @default "node"
36
+ */
37
+ dockerImageType?: "fusion-starter" | "node";
32
38
  }
33
39
  export declare function runLaunchCommand({ sys, args, }: {
34
40
  sys: DevToolsSys;