builder.io 1.12.2 → 1.12.4
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.
- package/cli/index.cjs +561 -560
- package/cli/index.cjs.map +4 -4
- package/core/index.cjs +1 -1
- package/core/index.mjs +1 -1
- package/node/index.cjs +1 -1
- package/node/index.mjs +1 -1
- package/package.json +1 -1
- package/server/index.cjs +210 -210
- package/server/index.mjs +210 -210
- package/types/cli/codegen.d.ts +14 -19
- package/types/cli/launch/dev-server-orchestrator.d.ts +8 -10
- package/types/cli/repo-indexing/repo-indexing-utils.d.ts +12 -3
- package/types/cli/repo-metrics.d.ts +6 -0
- package/types/cli/utils/terminal-buffer.d.ts +2 -0
- package/types/tsconfig.tsbuildinfo +1 -1
package/types/cli/codegen.d.ts
CHANGED
|
@@ -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, PrivacyMode, CodeGenPosition, BackupGitRepoResult, PushChangesArgs, CodegenApiResult } from "$/ai-utils";
|
|
3
|
+
import type { CodegenFeedback, CodeGenToolMap, CodegenTurn, CustomInstruction, FusionConfig, GenerateCompletionState, GenerateCompletionStep, GenerateCompletionStepGit, GenerateUserMessage, UserContext, WorkspaceConfiguration, WorkspaceFolder, LoadWholeSessionOptions, LoadWholeSessionResult, LoadHistoryResult, CodeGenMode, ApplyActionsResult, PrivacyMode, CodeGenPosition, BackupGitRepoResult, PushChangesArgs, CodegenApiResult, CodegenApiTerminal, ConfigureDevOrchestratorOpts, ConfigureDevOrchestratorUpdates, RepoMetrics } 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";
|
|
@@ -91,14 +91,22 @@ export declare class CodeGenSession {
|
|
|
91
91
|
git(args: string[], opts?: string | RunCommandOptions): Promise<string>;
|
|
92
92
|
setDebug(debug: boolean): void;
|
|
93
93
|
createTerminal(options?: {
|
|
94
|
+
terminalId?: string;
|
|
95
|
+
title?: string;
|
|
94
96
|
cwd?: string;
|
|
95
97
|
env?: Record<string, string | undefined>;
|
|
96
98
|
cols?: number;
|
|
97
99
|
rows?: number;
|
|
98
100
|
shell?: string;
|
|
99
|
-
|
|
101
|
+
createdBy?: string;
|
|
102
|
+
}): CodegenApiTerminal;
|
|
103
|
+
emitTerminals(): void;
|
|
104
|
+
updateTerminal({ terminalId, cols, rows, title, }: {
|
|
100
105
|
terminalId: string;
|
|
101
|
-
|
|
106
|
+
cols?: number;
|
|
107
|
+
rows?: number;
|
|
108
|
+
title?: string;
|
|
109
|
+
}): boolean;
|
|
102
110
|
writeTerminal({ terminalId, data }: {
|
|
103
111
|
terminalId: string;
|
|
104
112
|
data: string;
|
|
@@ -121,6 +129,7 @@ export declare class CodeGenSession {
|
|
|
121
129
|
includePattern?: string;
|
|
122
130
|
gitignore?: boolean;
|
|
123
131
|
}): Promise<string[]>;
|
|
132
|
+
collectRepoMetrics(): Promise<RepoMetrics>;
|
|
124
133
|
getSessionId(): string;
|
|
125
134
|
getSpaceId(): string | undefined;
|
|
126
135
|
revertToCommitHash(commitHash: string): Promise<void>;
|
|
@@ -180,7 +189,7 @@ export declare class CodeGenSession {
|
|
|
180
189
|
sendMessage(message: GenerateUserMessage, immediate?: boolean): Promise<void>;
|
|
181
190
|
getTurns(): CodegenTurn[];
|
|
182
191
|
getSessionContext(): SessionContext;
|
|
183
|
-
runSetupCommand(): Promise<import("
|
|
192
|
+
runSetupCommand(): Promise<import("$/ai-utils").SetupCommandResult | undefined>;
|
|
184
193
|
abortSetupCommand(): void;
|
|
185
194
|
toolsRunning(): boolean;
|
|
186
195
|
abortAllTools(): void;
|
|
@@ -196,21 +205,7 @@ export declare class CodeGenSession {
|
|
|
196
205
|
abort(cleanCurrentMessage?: boolean): Promise<boolean>;
|
|
197
206
|
stopEventLoop(): Promise<void>;
|
|
198
207
|
requestRefresh(): void;
|
|
199
|
-
configureDevOrchestrator(opts:
|
|
200
|
-
devCommand?: string;
|
|
201
|
-
setupCommand?: string;
|
|
202
|
-
proxyPort?: number;
|
|
203
|
-
proxyServer?: string;
|
|
204
|
-
env?: Record<string, string | null>;
|
|
205
|
-
replaceEnvs?: boolean;
|
|
206
|
-
forceSetupCommand?: boolean;
|
|
207
|
-
forceDevCommand?: boolean;
|
|
208
|
-
}): Promise<{
|
|
209
|
-
devCommand: boolean;
|
|
210
|
-
setupCommand: boolean;
|
|
211
|
-
proxyServer: boolean;
|
|
212
|
-
env: boolean;
|
|
213
|
-
}>;
|
|
208
|
+
configureDevOrchestrator(opts: ConfigureDevOrchestratorOpts): Promise<ConfigureDevOrchestratorUpdates>;
|
|
214
209
|
close(uploadGitBackup?: boolean): Promise<void>;
|
|
215
210
|
emitGitStatus(): Promise<GenerateCompletionStepGit | null>;
|
|
216
211
|
manualCommit(options: {
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import type { DevToolsSys } from "@builder.io/dev-tools/core";
|
|
2
2
|
import type { ProxyMiddleware } from "../../types/proxy-middleware";
|
|
3
|
-
import type { DevCommandState, EnvironmentVariable, HttpServerState } from "$/ai-utils";
|
|
3
|
+
import type { DevCommandState, EnvironmentVariable, HttpServerState, SetupCommandResult } from "$/ai-utils";
|
|
4
4
|
import EventEmitter from "events";
|
|
5
5
|
import { ChildProcess } from "node:child_process";
|
|
6
6
|
import type { FusionConfig, SetupCommandState } from "$/ai-utils";
|
|
7
7
|
export type DevServerState = Exclude<SetupCommandState | DevCommandState, "installed" | "starting">;
|
|
8
|
-
export interface SetupCommandResult {
|
|
9
|
-
code: number | null;
|
|
10
|
-
output: string;
|
|
11
|
-
}
|
|
12
8
|
export interface DevCommandProcess {
|
|
13
9
|
type: "devCommandProcess";
|
|
14
10
|
getPid: () => number | undefined;
|
|
@@ -40,8 +36,8 @@ export interface DevServerOrchestrator {
|
|
|
40
36
|
devState: DevCommandState;
|
|
41
37
|
httpServerState: HttpServerState;
|
|
42
38
|
state: DevServerState;
|
|
43
|
-
proxyTarget: string;
|
|
44
|
-
proxyPort: number;
|
|
39
|
+
proxyTarget: string | undefined;
|
|
40
|
+
proxyPort: number | undefined;
|
|
45
41
|
environmentVariables: EnvironmentVariable[];
|
|
46
42
|
envVars: Record<string, string>;
|
|
47
43
|
proxyMiddleware: ProxyMiddleware | undefined;
|
|
@@ -54,8 +50,8 @@ export interface DevServerOrchestrator {
|
|
|
54
50
|
ensureSetupCommand: (abortSignal?: AbortSignal) => Promise<boolean>;
|
|
55
51
|
setupCommandPromise: Promise<SetupCommandResult> | undefined;
|
|
56
52
|
runSetupCommand: (signal?: AbortSignal) => Promise<SetupCommandResult>;
|
|
57
|
-
setSetupCommand: (newCommand: string, forceRestart?: boolean, signal?: AbortSignal) => Promise<SetupCommandResult | null>;
|
|
58
|
-
setDevCommand: (newCommand: string, forceRestart?: boolean, signal?: AbortSignal) => Promise<boolean>;
|
|
53
|
+
setSetupCommand: (newCommand: string | undefined, forceRestart?: boolean, signal?: AbortSignal) => Promise<SetupCommandResult | null>;
|
|
54
|
+
setDevCommand: (newCommand: string | undefined, forceRestart?: boolean, signal?: AbortSignal) => Promise<boolean>;
|
|
59
55
|
setProxyServer: (newProxyServer: string) => Promise<boolean>;
|
|
60
56
|
setPort: (newPort: number) => Promise<boolean>;
|
|
61
57
|
addCheckpoint: () => void;
|
|
@@ -64,6 +60,8 @@ export interface DevServerOrchestrator {
|
|
|
64
60
|
getAllStdout: () => string;
|
|
65
61
|
getAllStderr: () => string;
|
|
66
62
|
getOutput: () => string;
|
|
63
|
+
getSetupWrite: () => string;
|
|
64
|
+
getDevWrite: () => string;
|
|
67
65
|
getSetupOutput: () => string;
|
|
68
66
|
waitUntilIdle: (initialWaitMs?: number, idleTimeMs?: number) => Promise<void>;
|
|
69
67
|
onClose: (callback: (code: number | null) => void) => void;
|
|
@@ -82,6 +80,6 @@ export interface DevServerOrchestrator {
|
|
|
82
80
|
close: () => Promise<void>;
|
|
83
81
|
}
|
|
84
82
|
export declare const importPty: (sys: DevToolsSys) => typeof import("@lydell/node-pty") | undefined;
|
|
85
|
-
export declare function devServerOrchestrator(sys: DevToolsSys, fusionConfig: FusionConfig, initialSetupState: "installed" | "not-installed" | "install-failed"): Promise<DevServerOrchestrator>;
|
|
83
|
+
export declare function devServerOrchestrator(sys: DevToolsSys, fusionConfig: FusionConfig, initialSetupState: "installed" | "not-installed" | "install-failed" | "unset"): Promise<DevServerOrchestrator>;
|
|
86
84
|
export declare const checkPortsListenedByPid: (pid: number) => number[];
|
|
87
85
|
export declare function killProcess(sys: DevToolsSys, proc: ChildProcess | DevCommandProcess | undefined, abortSignal?: AbortSignal, timeout?: number): Promise<boolean>;
|
|
@@ -18,7 +18,7 @@ export declare const runCodeGen: (sys: DevToolsSys, credentials: Credentials, se
|
|
|
18
18
|
tags?: object;
|
|
19
19
|
maxTokens?: number;
|
|
20
20
|
}, metadata?: any) => Promise<string>;
|
|
21
|
-
|
|
21
|
+
interface GetAllDesignSystemsOpts {
|
|
22
22
|
/**
|
|
23
23
|
* If true, only design systems that the user has permission to edit will be
|
|
24
24
|
* returned. If false, all design systems that the user has permission to edit
|
|
@@ -31,8 +31,16 @@ export declare const getAllDesignSystems: (credentials: Credentials, opts?: {
|
|
|
31
31
|
* Defaults to false.
|
|
32
32
|
*/
|
|
33
33
|
includeGlobalScopeDesignSystems?: boolean;
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
/**
|
|
35
|
+
* If true, the # of component docs in each design system will also be returned.
|
|
36
|
+
* Defaults to false.
|
|
37
|
+
*/
|
|
38
|
+
includeDocumentCount?: boolean;
|
|
39
|
+
}
|
|
40
|
+
export declare function getAllDesignSystems(credentials: Credentials, opts: {
|
|
41
|
+
includeDocumentCount: true;
|
|
42
|
+
} & Omit<GetAllDesignSystemsOpts, "includeDocumentCount">): Promise<DisplayDesignSystem[]>;
|
|
43
|
+
export declare function getAllDesignSystems(credentials: Credentials, opts?: GetAllDesignSystemsOpts): Promise<DesignSystem[]>;
|
|
36
44
|
export declare const getDesignSystemsByScope: (scope: DesignSystemScope, designSystems: DesignSystem[]) => DesignSystem[];
|
|
37
45
|
export declare const getDesignSystemByName: (designSystemName: string, designSystems: DesignSystem[]) => DesignSystem | null;
|
|
38
46
|
export declare const getDesignSystemByNameAndScope: (credentials: Credentials, designSystemName: string, scope: DesignSystemScope, designSystems: DesignSystem[]) => DesignSystem | null;
|
|
@@ -45,3 +53,4 @@ export declare const addDesignSystem: (credentials: Credentials, body: {
|
|
|
45
53
|
}) => Promise<any>;
|
|
46
54
|
export declare const updateDesignSystem: (credentials: Credentials, body: UpdateDesignSystemInput) => Promise<any>;
|
|
47
55
|
export declare const checkRepoIndexingFolder: (sys: DevToolsSys) => Promise<boolean>;
|
|
56
|
+
export {};
|
|
@@ -8,9 +8,11 @@ export declare class TerminalBuffer {
|
|
|
8
8
|
private currentColumn;
|
|
9
9
|
private maxLines;
|
|
10
10
|
private maxColumns;
|
|
11
|
+
private chunks;
|
|
11
12
|
constructor(maxLines?: number, maxColumns?: number);
|
|
12
13
|
write(data: string): void;
|
|
13
14
|
private ensureLineExists;
|
|
15
|
+
getWrite(): string;
|
|
14
16
|
getContent(): string;
|
|
15
17
|
clear(): void;
|
|
16
18
|
/**
|