builder.io 1.6.24 → 1.6.26
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 +460 -353
- package/cli/index.cjs.map +4 -4
- package/core/index.cjs +58 -58
- package/core/index.mjs +58 -58
- package/node/index.cjs +1 -1
- package/node/index.mjs +1 -1
- package/package.json +2 -1
- package/server/index.cjs +55 -55
- package/server/index.mjs +59 -59
- package/types/cli/code-tools.d.ts +10 -0
- package/types/cli/codegen.d.ts +18 -15
- package/types/cli/index.d.ts +2 -4
- package/types/cli/launch/install-jsx-plugin.d.ts +7 -0
- package/types/cli/launch.d.ts +4 -1
- package/types/core/adapters/vite/vite-ensure-config-plugin.d.ts +4 -0
- package/types/core/adapters/webpack/webpack-config-helpers.d.ts +11 -0
- package/types/core/adapters/webpack/webpack-config-helpers.unit.d.ts +1 -0
- package/types/core/adapters/webpack/webpack-ensure-config-plugin.d.ts +1 -1
- package/types/tsconfig.tsbuildinfo +1 -1
- package/types/types.d.ts +1 -1
|
@@ -14,3 +14,13 @@ export declare function resolveToolCalls(sys: DevToolsSys, toolCalls: LLMToolCal
|
|
|
14
14
|
toolResults: ContentMessageItemToolResult[];
|
|
15
15
|
projectFiles: ProjectFile[];
|
|
16
16
|
}>;
|
|
17
|
+
interface RipgrepMatch {
|
|
18
|
+
path: string;
|
|
19
|
+
lineNumber: number;
|
|
20
|
+
lineContent: string;
|
|
21
|
+
}
|
|
22
|
+
interface RipgrepResult {
|
|
23
|
+
matches: RipgrepMatch[];
|
|
24
|
+
}
|
|
25
|
+
export declare function runRipgrep(sys: DevToolsSys, pattern: string, includeGlob?: string, excludeGlob?: string): Promise<RipgrepResult>;
|
|
26
|
+
export {};
|
package/types/cli/codegen.d.ts
CHANGED
|
@@ -2,24 +2,26 @@ import type { DevToolsSys } from "../types";
|
|
|
2
2
|
import type { CLIArgs } from "./index";
|
|
3
3
|
import { type Credentials } from "./credentials";
|
|
4
4
|
import { type Checkpoint } from "./incremental-tsc";
|
|
5
|
-
import type { ApplyActionsResult, CodebaseSearchResponse, ContentMessageItemToolResult, CustomInstruction, GenerateCompletionStep, ProjectFile, UserContext } from "$/ai-utils";
|
|
5
|
+
import type { ApplyActionsResult, Attachment, CodebaseSearchResponse, ContentMessageItemToolResult, CustomInstruction, GenerateCompletionStep, GenerateUserMessage, ProjectFile, UserContext } from "$/ai-utils";
|
|
6
6
|
import prettier from "prettier";
|
|
7
|
-
interface
|
|
8
|
-
|
|
7
|
+
interface Turn {
|
|
8
|
+
completionId: string;
|
|
9
|
+
nextUrl: string | undefined;
|
|
10
|
+
originalFiles: {
|
|
9
11
|
path: string;
|
|
10
12
|
content: Uint8Array | null;
|
|
11
13
|
}[];
|
|
12
14
|
isUserMessage: boolean;
|
|
13
|
-
url: string | undefined;
|
|
14
15
|
toolResults: ContentMessageItemToolResult[];
|
|
15
16
|
sentiment?: "positive" | "negative" | "undo";
|
|
16
17
|
applyResults: ApplyActionsResult[];
|
|
17
18
|
projectFiles: ProjectFile[];
|
|
19
|
+
userInput: UserInput;
|
|
18
20
|
}
|
|
19
|
-
type State = "initial-with-url" | "initial-without-url" | "
|
|
21
|
+
type State = "unknown" | "initial-with-url" | "initial-without-url" | "generating" | "success" | "abort" | "error";
|
|
20
22
|
export interface SessionContext {
|
|
21
23
|
sessionId: string;
|
|
22
|
-
|
|
24
|
+
turns: Turn[];
|
|
23
25
|
selectedFilePaths: Map<string, number>;
|
|
24
26
|
customInstructions: CustomInstruction[];
|
|
25
27
|
userContext: UserContext;
|
|
@@ -28,6 +30,7 @@ export interface SessionContext {
|
|
|
28
30
|
}
|
|
29
31
|
export interface UserInput {
|
|
30
32
|
userPrompt: string;
|
|
33
|
+
attachments: Attachment[];
|
|
31
34
|
sentiment: "positive" | "negative" | "undo";
|
|
32
35
|
files: ProjectFile[];
|
|
33
36
|
searchResponse: CodebaseSearchResponse | null;
|
|
@@ -35,11 +38,6 @@ export interface UserInput {
|
|
|
35
38
|
mostRelevantFile: string | null;
|
|
36
39
|
role: "user" | "agent";
|
|
37
40
|
}
|
|
38
|
-
interface UserMessage {
|
|
39
|
-
userPrompt: string;
|
|
40
|
-
files?: string[];
|
|
41
|
-
includeBaseFiles?: boolean;
|
|
42
|
-
}
|
|
43
41
|
export declare class CodeGenSession {
|
|
44
42
|
#private;
|
|
45
43
|
constructor(sys: DevToolsSys, credentials: Credentials, args: CLIArgs, position: string, initialUrl?: string, mode?: "quality" | "quality-v3" | "fast");
|
|
@@ -49,18 +47,23 @@ export declare class CodeGenSession {
|
|
|
49
47
|
getSessionId(): Promise<string>;
|
|
50
48
|
getSpaceId(): string | undefined;
|
|
51
49
|
undoLastUserMessage(dryRun?: boolean): Promise<string[]>;
|
|
52
|
-
|
|
50
|
+
getLastCompletionId(): string | undefined;
|
|
51
|
+
getCurrentState(): State;
|
|
52
|
+
getLastTurn(): Turn | undefined;
|
|
53
|
+
getNextUrl(): string | undefined;
|
|
54
|
+
getNextMessage(): Promise<GenerateUserMessage>;
|
|
53
55
|
sendFeedback(sentiment: "positive" | "negative" | "undo", message?: string, lastCompletionId?: string | undefined): Promise<void>;
|
|
54
56
|
hasUndoChanges(): Promise<boolean>;
|
|
55
57
|
isBusy(): boolean;
|
|
56
|
-
sendMessage(message:
|
|
58
|
+
sendMessage(message: GenerateUserMessage): void;
|
|
57
59
|
isEventLoopRunning(): boolean;
|
|
60
|
+
getTurns(): void;
|
|
58
61
|
getSessionContext(): Promise<SessionContext>;
|
|
59
62
|
abort(): void;
|
|
60
63
|
stopEventLoop(): void;
|
|
61
64
|
startEventLoop(onStep: (step: GenerateCompletionStep) => void): Promise<void>;
|
|
62
|
-
agentCompletion(userMessage:
|
|
63
|
-
getUserInput(userMessage:
|
|
65
|
+
agentCompletion(userMessage: GenerateUserMessage, baselineCheckpoint: Checkpoint, signal: AbortSignal | undefined, onStep: (step: GenerateCompletionStep) => Promise<void> | void): Promise<Checkpoint>;
|
|
66
|
+
getUserInput(userMessage: GenerateUserMessage, signal: AbortSignal | undefined): Promise<UserInput>;
|
|
64
67
|
}
|
|
65
68
|
export declare const createSessionContext: (sys: DevToolsSys) => Promise<SessionContext>;
|
|
66
69
|
export declare function transformStream(body: ReadableStream<Uint8Array> | null): AsyncGenerator<string, void, unknown>;
|
package/types/cli/index.d.ts
CHANGED
|
@@ -41,9 +41,9 @@ export interface CLIArgs {
|
|
|
41
41
|
port?: number;
|
|
42
42
|
/** Port number for the dev server (shorthand) */
|
|
43
43
|
p?: number;
|
|
44
|
-
/**
|
|
44
|
+
/** Dev server command to execute */
|
|
45
45
|
command?: string;
|
|
46
|
-
/**
|
|
46
|
+
/** Dev server command to execute (shorthand) */
|
|
47
47
|
c?: string;
|
|
48
48
|
/** Skip authentication for testing purposes */
|
|
49
49
|
noAuth?: boolean;
|
|
@@ -57,8 +57,6 @@ export interface CLIArgs {
|
|
|
57
57
|
open?: boolean;
|
|
58
58
|
/** Raw command line arguments */
|
|
59
59
|
_: string[];
|
|
60
|
-
builderPublicKey?: string;
|
|
61
|
-
builderPrivateKey?: string;
|
|
62
60
|
/** Silent mode for launch command */
|
|
63
61
|
silent?: boolean;
|
|
64
62
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DevToolsSys } from "@builder.io/dev-tools/core";
|
|
2
|
+
import type { CLIArgs } from "../index";
|
|
3
|
+
import type { EnsureConfigResult } from "types";
|
|
4
|
+
export type InstallOutcome = EnsureConfigResult["outcome"] | "install-failed";
|
|
5
|
+
export declare const installJsxPlugin: (sys: DevToolsSys, args: CLIArgs) => Promise<{
|
|
6
|
+
installOutcome: InstallOutcome;
|
|
7
|
+
}>;
|
package/types/cli/launch.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type { DevToolsSys } from "@builder.io/dev-tools/core";
|
|
2
2
|
import type { CLIArgs } from "./index";
|
|
3
3
|
export declare const PROXY_PORT = 48752;
|
|
4
|
-
export declare function runLaunchCommand(sys
|
|
4
|
+
export declare function runLaunchCommand({ sys, args, }: {
|
|
5
|
+
sys: DevToolsSys;
|
|
6
|
+
args: CLIArgs;
|
|
7
|
+
}): Promise<number>;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import type { EnsureConfigResult } from "../../../types";
|
|
2
2
|
import type { DevToolsSys } from "../..";
|
|
3
3
|
export declare function viteEnsureConfigPlugin(sys: DevToolsSys, configFilePath: string, configContent: string): Promise<EnsureConfigResult>;
|
|
4
|
+
/**
|
|
5
|
+
* Update a Vite config file to include a plugin
|
|
6
|
+
*/
|
|
7
|
+
export declare function updateViteConfig(sys: DevToolsSys, configFilePath: string, configContent: string, pluginName: string, importPath: string): Promise<EnsureConfigResult>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { DevToolsSys } from "../..";
|
|
2
|
+
import type { EnsureConfigResult } from "../../../types";
|
|
3
|
+
/**
|
|
4
|
+
* Result of a webpack config update operation
|
|
5
|
+
*/
|
|
6
|
+
export interface WebpackConfigUpdateResult extends EnsureConfigResult {
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Update a Webpack config file to include a plugin
|
|
10
|
+
*/
|
|
11
|
+
export declare function updateWebpackConfig(sys: DevToolsSys, configFilePath: string, configContent: string, pluginName: string, importPath: string): Promise<WebpackConfigUpdateResult>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { EnsureConfigResult } from "../../../types";
|
|
2
2
|
import type { DevToolsSys } from "../..";
|
|
3
|
-
export declare function webpackEnsureConfigPlugin(
|
|
3
|
+
export declare function webpackEnsureConfigPlugin(sys: DevToolsSys, configFilePath: string, configContent: string): Promise<EnsureConfigResult>;
|