@builder.io/dev-tools 1.21.3 → 1.21.5
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 +407 -397
- 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 +42 -42
- package/server/index.mjs +45 -45
- package/types/cli/code-tools.d.ts +3 -0
- package/types/cli/codegen.d.ts +10 -0
- package/types/cli/figma-utils.d.ts +2 -2
- package/types/cli/launch/dev-server-orchestrator.d.ts +1 -0
- package/types/cli/server-ws.d.ts +10 -10
- package/types/cli/utils/codegen-utils.d.ts +6 -1
- package/types/tsconfig.tsbuildinfo +1 -1
|
@@ -12,6 +12,7 @@ export interface LLMToolCalls {
|
|
|
12
12
|
abortController: AbortController;
|
|
13
13
|
}
|
|
14
14
|
export interface ToolResolution {
|
|
15
|
+
structuredResult?: Record<string, any>;
|
|
15
16
|
toolResult: string | (ContentMessageItemText | ContentMessageItemImage)[];
|
|
16
17
|
isError: boolean;
|
|
17
18
|
title?: string;
|
|
@@ -33,6 +34,8 @@ export interface ToolContext extends Partial<FusionContext> {
|
|
|
33
34
|
canCollapseWorkspace: boolean;
|
|
34
35
|
signal: AbortSignal;
|
|
35
36
|
workingDirectory: string;
|
|
37
|
+
proxyDst: string | undefined;
|
|
38
|
+
proxyOrigin: string | undefined;
|
|
36
39
|
allowedCommands: RegExp[];
|
|
37
40
|
enabledTools: (keyof CodeGenToolMap)[];
|
|
38
41
|
localMCPManager: LocalMCPClientManager | undefined;
|
package/types/cli/codegen.d.ts
CHANGED
|
@@ -233,6 +233,7 @@ export declare class CodeGenSession {
|
|
|
233
233
|
sendFeedback(feedback: Partial<CodegenFeedback>): Promise<void>;
|
|
234
234
|
lastTurnHasChanges(): Promise<boolean>;
|
|
235
235
|
waitUntilState(state: GenerateCompletionState, timeout?: number): Promise<void>;
|
|
236
|
+
getProxyOrigin(): string | undefined;
|
|
236
237
|
clearSession(): Promise<void>;
|
|
237
238
|
clearMessageQueue(emitUserMessages?: boolean): Promise<void>;
|
|
238
239
|
updateMessage(opts: MessageUpdateOptions): void;
|
|
@@ -285,6 +286,15 @@ export declare class CodeGenSession {
|
|
|
285
286
|
subscribeToFileChanges(onEvent: (event: FolderWatchEvent) => void): () => Promise<void>;
|
|
286
287
|
close(uploadGitBackup?: boolean): Promise<void>;
|
|
287
288
|
emitGitStatus(): Promise<GenerateCompletionStepGit | null>;
|
|
289
|
+
/**
|
|
290
|
+
* Queues a semantic git status reminder for the LLM.
|
|
291
|
+
* Call this after significant git operations to keep the LLM informed.
|
|
292
|
+
*/
|
|
293
|
+
queueGitStatusReminder(context: {
|
|
294
|
+
trigger: "session-start" | "sync-success" | "push-success" | "pull-success";
|
|
295
|
+
syncedBranches?: string[];
|
|
296
|
+
pushedToRemote?: boolean;
|
|
297
|
+
}): void;
|
|
288
298
|
manualCommit(options: {
|
|
289
299
|
add: string;
|
|
290
300
|
commitMessage: string;
|
|
@@ -2,13 +2,13 @@ import { type Credentials, type FigmaAuth } from "./credentials";
|
|
|
2
2
|
import type { DevToolsSys } from "../types";
|
|
3
3
|
import type { CLIArgs } from "./index";
|
|
4
4
|
import type { FigmaBuilderLink, FigmaComponentInfo } from "$/ai-utils";
|
|
5
|
-
|
|
5
|
+
interface FigmaAPIOpts {
|
|
6
6
|
auth: {
|
|
7
7
|
access_token: string;
|
|
8
8
|
oauth: boolean;
|
|
9
9
|
};
|
|
10
10
|
params?: Record<string, any>;
|
|
11
|
-
}
|
|
11
|
+
}
|
|
12
12
|
export declare const parseFigmaURL: (str: string) => {
|
|
13
13
|
fileID: string;
|
|
14
14
|
nodeId: string;
|
|
@@ -38,6 +38,7 @@ export interface DevServerOrchestrator {
|
|
|
38
38
|
httpServerState: HttpServerData;
|
|
39
39
|
state: DevServerState;
|
|
40
40
|
proxyTarget: string | undefined;
|
|
41
|
+
serverUrl: URL | undefined;
|
|
41
42
|
proxyPort: number | undefined;
|
|
42
43
|
proxyServerSelection: ProxyServerSelection | undefined;
|
|
43
44
|
environmentVariables: EnvironmentVariable[];
|
package/types/cli/server-ws.d.ts
CHANGED
|
@@ -2,13 +2,13 @@ import type { Duplex } from "node:stream";
|
|
|
2
2
|
import type { IncomingMessage } from "node:http";
|
|
3
3
|
import type { ServerOptions } from "ws";
|
|
4
4
|
import type { WebSocket } from "ws";
|
|
5
|
-
export
|
|
5
|
+
export interface SocketRequest {
|
|
6
6
|
id: number;
|
|
7
7
|
jsonrpc: string;
|
|
8
8
|
method: string;
|
|
9
9
|
params: any;
|
|
10
|
-
}
|
|
11
|
-
export
|
|
10
|
+
}
|
|
11
|
+
export interface SocketResponse<T = any> {
|
|
12
12
|
id?: number | null;
|
|
13
13
|
jsonrpc: string;
|
|
14
14
|
result?: T;
|
|
@@ -19,24 +19,24 @@ export type SocketResponse<T = any> = {
|
|
|
19
19
|
message: string;
|
|
20
20
|
data?: any;
|
|
21
21
|
};
|
|
22
|
-
}
|
|
23
|
-
export
|
|
22
|
+
}
|
|
23
|
+
export interface SocketSendOptions {
|
|
24
24
|
timeout?: number;
|
|
25
|
-
}
|
|
26
|
-
export
|
|
25
|
+
}
|
|
26
|
+
export interface SocketQueue {
|
|
27
27
|
type: "request" | "notification";
|
|
28
28
|
result?: SocketResponse["result"];
|
|
29
29
|
error?: SocketResponse["error"];
|
|
30
|
-
}
|
|
30
|
+
}
|
|
31
31
|
type RegisterFn<T = any> = (params: T, socketId: string) => Promise<any> | any;
|
|
32
|
-
|
|
32
|
+
interface SocketEvents {
|
|
33
33
|
listening: () => Promise<void> | void;
|
|
34
34
|
connection: (socket: WebSocket, socketId: string) => Promise<void> | void;
|
|
35
35
|
disconnection: (socketId: string) => Promise<void> | void;
|
|
36
36
|
error: (error: Error) => Promise<void> | void;
|
|
37
37
|
"socket-error": (socketId: string, error: Error) => Promise<void> | void;
|
|
38
38
|
close: () => Promise<void> | void;
|
|
39
|
-
}
|
|
39
|
+
}
|
|
40
40
|
export declare function RPCWebSocketServer(opts: ServerOptions): {
|
|
41
41
|
on: <EventKey extends keyof SocketEvents>(event: EventKey, cb: SocketEvents[EventKey]) => void;
|
|
42
42
|
event: (e: string) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DevToolsSys } from "../../core";
|
|
2
2
|
import { type Credentials } from "../credentials";
|
|
3
3
|
export { getCustomInstructions } from "./rules-discovery";
|
|
4
|
-
import type { CodeGenInputOptions, CodegenSetLastCompletion, CodegenTurn, GenerateCodeEvent, GenerateUserMessage, GetSessionTurnsResult, UserContext, WorkspaceConfiguration, EnvironmentVariable, PushChangesArgs, GenerateCompletionStepDevServerState, FusionConfig } from "$/ai-utils";
|
|
4
|
+
import type { CodeGenInputOptions, CodegenSetLastCompletion, CodegenTurn, GenerateCodeEvent, GenerateUserMessage, GetSessionTurnsResult, UserContext, WorkspaceConfiguration, EnvironmentVariable, PushChangesArgs, GenerateCompletionStepDevServerState, FusionConfig, GenerateCompletionStepGit, WorkspaceFolder } from "$/ai-utils";
|
|
5
5
|
import type { SessionContext } from "../codegen";
|
|
6
6
|
import type { DevServerOrchestrator } from "../launch/dev-server-orchestrator";
|
|
7
7
|
export declare const DEFAULT_MAX_COMPLETIONS = 30;
|
|
@@ -80,3 +80,8 @@ export declare function moveArrayElement<T>(arr: T[], old_index: number, new_ind
|
|
|
80
80
|
export declare function canCollapseWorkspace(workspace: WorkspaceConfiguration | undefined): boolean;
|
|
81
81
|
export declare function computeRecommendedRootDir(workspace: WorkspaceConfiguration | undefined): string;
|
|
82
82
|
export declare const getEnvironmentVariablesPrompt: (envs: EnvironmentVariable[]) => string;
|
|
83
|
+
export declare function generateGitStatusReminder(gitStatus: GenerateCompletionStepGit, gitEnabledFolder: WorkspaceFolder | undefined, context: {
|
|
84
|
+
trigger: "session-start" | "sync-success" | "push-success" | "pull-success";
|
|
85
|
+
syncedBranches?: string[];
|
|
86
|
+
pushedToRemote?: boolean;
|
|
87
|
+
}): string;
|