builder.io 1.6.20 → 1.6.22
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 +360 -345
- package/cli/index.cjs.map +4 -4
- package/core/index.cjs +35 -35
- package/core/index.mjs +34 -34
- package/node/index.cjs +3 -3
- package/node/index.mjs +15 -15
- package/package.json +2 -1
- package/server/index.cjs +113 -112
- package/server/index.mjs +113 -112
- package/types/cli/code-tools.d.ts +4 -3
- package/types/cli/code.d.ts +8 -4
- package/types/cli/figma.d.ts +1 -0
- package/types/cli/index.d.ts +2 -2
- package/types/cli/sync-utils.d.ts +2 -1
- package/types/tsconfig.tsbuildinfo +1 -1
- package/types/types.d.ts +2 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type { CodeGenTools, ContentMessageItemToolResult } from "$/ai-utils";
|
|
1
|
+
import type { CodeGenTools, ContentMessageItemToolResult, ProjectFile } from "$/ai-utils";
|
|
2
|
+
import type { DevToolsSys } from "../core";
|
|
2
3
|
export interface LLMToolCalls {
|
|
3
4
|
name: CodeGenTools;
|
|
4
5
|
input: Record<string, any>;
|
|
5
6
|
id: string;
|
|
6
7
|
}
|
|
7
|
-
export declare function resolveToolCalls(toolCalls: LLMToolCalls[]): Promise<{
|
|
8
|
+
export declare function resolveToolCalls(sys: DevToolsSys, toolCalls: LLMToolCalls[]): Promise<{
|
|
8
9
|
toolResults: ContentMessageItemToolResult[];
|
|
9
|
-
|
|
10
|
+
projectFiles: ProjectFile[];
|
|
10
11
|
}>;
|
package/types/cli/code.d.ts
CHANGED
|
@@ -4,13 +4,15 @@ import { type Credentials } from "./credentials";
|
|
|
4
4
|
import { type Checkpoint } from "./incremental-tsc";
|
|
5
5
|
import { type IOService } from "./io-service";
|
|
6
6
|
import type { ContentMessageItemToolResult, CustomInstruction, ProjectFile, UserContext } from "$/ai-utils";
|
|
7
|
+
import prettier from "prettier";
|
|
7
8
|
interface UndoState {
|
|
8
9
|
files: {
|
|
9
10
|
path: string;
|
|
10
|
-
content:
|
|
11
|
+
content: Uint8Array | null;
|
|
11
12
|
}[];
|
|
12
13
|
isAgent: boolean;
|
|
13
14
|
url: string | undefined;
|
|
15
|
+
toolResults: ContentMessageItemToolResult[];
|
|
14
16
|
}
|
|
15
17
|
interface CodeGenSearchResponse {
|
|
16
18
|
ranked: RankedResult[];
|
|
@@ -23,12 +25,15 @@ interface RankedResult {
|
|
|
23
25
|
score: number;
|
|
24
26
|
id: string;
|
|
25
27
|
}
|
|
28
|
+
type State = "initial-with-url" | "initial-without-url" | "success" | "success-just-text" | "abort" | "error";
|
|
26
29
|
export interface SessionContext {
|
|
27
30
|
sessionId: string;
|
|
28
31
|
undoStates: UndoState[];
|
|
29
32
|
selectedFilePaths: Map<string, number>;
|
|
30
33
|
customInstructions: CustomInstruction[];
|
|
31
34
|
userContext: UserContext;
|
|
35
|
+
prettierConfig: prettier.Config | null;
|
|
36
|
+
state: State;
|
|
32
37
|
}
|
|
33
38
|
export interface UserInput {
|
|
34
39
|
userPrompt: string;
|
|
@@ -37,7 +42,6 @@ export interface UserInput {
|
|
|
37
42
|
searchResponse: CodeGenSearchResponse | null;
|
|
38
43
|
rerankFiles?: number;
|
|
39
44
|
mostRelevantFile: string | null;
|
|
40
|
-
toolResults: ContentMessageItemToolResult[];
|
|
41
45
|
role: "user" | "agent";
|
|
42
46
|
}
|
|
43
47
|
export declare const runCodeCommand: (sys: DevToolsSys, subCommand: string, args: CLIArgs, io?: IOService) => Promise<void>;
|
|
@@ -48,8 +52,8 @@ interface InteractiveAnswer {
|
|
|
48
52
|
userPrompt: string | undefined;
|
|
49
53
|
feedback: "positive" | "negative" | "undo" | undefined;
|
|
50
54
|
}
|
|
51
|
-
export declare function getUserInput(sys: DevToolsSys, credentials: Credentials, args: CLIArgs, sessionContext: SessionContext, answer: InteractiveAnswer, io?: IOService): Promise<UserInput>;
|
|
52
|
-
export declare function agentCompletion(sys: DevToolsSys, credentials: Credentials, args: CLIArgs, sessionContext: SessionContext, userInput: UserInput, url: string | undefined, baselineCheckpoint: Checkpoint, io?: IOService): Promise<Checkpoint>;
|
|
55
|
+
export declare function getUserInput(sys: DevToolsSys, credentials: Credentials, args: CLIArgs, sessionContext: SessionContext, answer: InteractiveAnswer, signal: AbortSignal | undefined, io?: IOService): Promise<UserInput>;
|
|
56
|
+
export declare function agentCompletion(sys: DevToolsSys, credentials: Credentials, args: CLIArgs, sessionContext: SessionContext, userInput: UserInput, url: string | undefined, baselineCheckpoint: Checkpoint, signal: AbortSignal | undefined, io?: IOService): Promise<Checkpoint>;
|
|
53
57
|
export declare function createApp(userId: string, spaceId: string, privateKey: string, body: any): Promise<void>;
|
|
54
58
|
export declare function transformStream(body: ReadableStream<Uint8Array> | null): AsyncGenerator<string, void, unknown>;
|
|
55
59
|
export declare function checkProjectRoot(sys: DevToolsSys, interactive: boolean, io?: IOService): Promise<void>;
|
package/types/cli/figma.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { DevToolsSys } from "../types";
|
|
2
2
|
import type { CLIArgs } from ".";
|
|
3
3
|
export declare const runFigmaCommand: (sys: DevToolsSys, subCommand: string, args: CLIArgs) => Promise<void>;
|
|
4
|
+
export declare function askToInstallBuilder(sys: DevToolsSys, args: CLIArgs): Promise<void>;
|
package/types/cli/index.d.ts
CHANGED
|
@@ -29,8 +29,8 @@ export interface CLIArgs {
|
|
|
29
29
|
url?: string;
|
|
30
30
|
/** Prompt text for non-interactive mode */
|
|
31
31
|
prompt?: string;
|
|
32
|
-
/** Generation mode
|
|
33
|
-
mode?: "
|
|
32
|
+
/** Generation mode */
|
|
33
|
+
mode?: "fast" | "quality" | "quality-v3";
|
|
34
34
|
/** Working directory to run commands from */
|
|
35
35
|
cwd?: string;
|
|
36
36
|
/** Debug mode */
|
|
@@ -4,8 +4,9 @@ export declare function extractSignatureInfo(content: string): {
|
|
|
4
4
|
sessionKey?: string;
|
|
5
5
|
snippetId?: string;
|
|
6
6
|
};
|
|
7
|
-
export declare function getAllProjectFiles(basePath: string): Promise<string[]>;
|
|
7
|
+
export declare function getAllProjectFiles(basePath: string, globPattern?: string): Promise<string[]>;
|
|
8
8
|
export declare function findBuilderFiles(basePath: string, targetContentId: string, targetSessionKey: string): Promise<FileNode[]>;
|
|
9
|
+
export declare function filterNonImportantFiles(files: string[]): string[];
|
|
9
10
|
export declare function getIgnorePatterns(basePath: string): (path: string) => boolean;
|
|
10
11
|
export declare function watchDirectory(basePath: string, syncInfo: SyncInfo, onChange: (updatedSyncInfo: SyncInfo) => void): () => Promise<void>;
|
|
11
12
|
export declare function setupSyncServer(sys: DevToolsSys, initialSyncInfo?: SyncInfo): Promise<void>;
|