@builder.io/dev-tools 1.9.21 → 1.9.23-dev.202508082028.12e70deb7

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.
Files changed (41) hide show
  1. package/angular/index.cjs +46 -1
  2. package/angular/index.mjs +21 -1
  3. package/cli/index.cjs +110734 -3803
  4. package/cli/index.cjs.map +4 -4
  5. package/core/index.cjs +14132 -790
  6. package/core/index.mjs +14122 -790
  7. package/figma/index.cjs +47 -1
  8. package/figma/index.mjs +27 -1
  9. package/node/index.cjs +25310 -105
  10. package/node/index.mjs +25314 -105
  11. package/package.json +1 -4
  12. package/remix/build.cjs +132 -1
  13. package/remix/index.mjs +113 -1
  14. package/server/index.cjs +21981 -1470
  15. package/server/index.mjs +21980 -1470
  16. package/types/cli/code-server.d.ts +0 -0
  17. package/types/cli/code-tools.d.ts +1 -0
  18. package/types/cli/codegen.d.ts +10 -1
  19. package/types/cli/io-service.d.ts +86 -0
  20. package/types/cli/launch/install-jsx-plugin.d.ts +7 -0
  21. package/types/cli/launch/logger.d.ts +38 -0
  22. package/types/cli/launch-init-v2.d.ts +13 -0
  23. package/types/cli/launch-init.d.ts +19 -0
  24. package/types/cli/repo-indexing/component-indexing.d.ts +2 -1
  25. package/types/cli/repo-indexing/repo-indexing.d.ts +2 -2
  26. package/types/cli/repo-indexing/types.d.ts +5 -0
  27. package/types/cli/repo-indexing-utils.d.ts +2 -0
  28. package/types/cli/repo-indexing.d.ts +17 -0
  29. package/types/cli/repo-indexing.mock.d.ts +5 -0
  30. package/types/cli/utils/repo-indexing-group-prompts.d.ts +1 -0
  31. package/types/common/ast/component-input-types.d.ts +1 -1
  32. package/types/common/ast/convert-values.d.ts +1 -1
  33. package/types/common/utils.d.ts +1 -1
  34. package/types/core/adapters/vite/ensure-remix-config.d.ts +6 -0
  35. package/types/core/adapters/vite/remix-utils.d.ts +10 -0
  36. package/types/core/adapters/vite/vite-config-helpers.d.ts +6 -0
  37. package/types/tsconfig.tsbuildinfo +1 -1
  38. package/vite/index.cjs +153 -3
  39. package/vite/index.mjs +119 -3
  40. package/webpack/index.cjs +2883 -27
  41. package/webpack/index.mjs +2871 -27
File without changes
@@ -59,6 +59,7 @@ export interface ToolContext extends Partial<FusionContext> {
59
59
  name?: string;
60
60
  }>;
61
61
  patchFusionConfig: (patch: Partial<FusionConfig>) => void;
62
+ passThrough: (toolCall: LLMToolCalls, signal: AbortSignal) => Promise<ToolResolution>;
62
63
  readFile: (filePath: string) => Promise<string | null>;
63
64
  writeFile: (filePath: string, content: string | Uint8Array) => Promise<boolean>;
64
65
  deleteFile: (filePath: string) => Promise<boolean>;
@@ -2,7 +2,7 @@ import type { DevToolsSys } from "../types";
2
2
  import { type Credentials } from "./credentials";
3
3
  import type { CodegenFeedback, CodeGenToolMap, CodegenTurn, CustomInstruction, FusionConfig, GenerateCompletionState, GenerateCompletionStep, GenerateCompletionStepGit, GenerateUserMessage, UserContext, WorkspaceConfiguration, WorkspaceFolder, LoadWholeSessionOptions, LoadWholeSessionResult, LoadHistoryResult, CodeGenMode, ApplyActionsResult } from "$/ai-utils";
4
4
  import prettier from "prettier";
5
- import { type FusionContext } from "./code-tools";
5
+ import { type FusionContext, type ToolResolution } from "./code-tools";
6
6
  import EventEmitter from "node:events";
7
7
  import { type RunGitOptions } from "./utils/git";
8
8
  export interface SessionContext {
@@ -30,6 +30,7 @@ export interface CodeGenSessionOptionsBase {
30
30
  workingDirectory?: string;
31
31
  mcpServers?: boolean;
32
32
  enabledTools?: (keyof CodeGenToolMap)[];
33
+ modelOverride?: string;
33
34
  }
34
35
  export interface CodeGenSessionOptionsSession extends CodeGenSessionOptionsBase {
35
36
  sessionOrCompletionId?: string;
@@ -128,6 +129,7 @@ export declare class CodeGenSession {
128
129
  getSessionId(): string;
129
130
  getSpaceId(): string | undefined;
130
131
  revertToCommitHash(commitHash: string): Promise<void>;
132
+ resetToCommitHash(commitHash: string): Promise<void>;
131
133
  /**
132
134
  * Core function to restore the codebase to a state that matches a predicate.
133
135
  * This is the main function that handles both git-based and file-based restoration.
@@ -194,6 +196,13 @@ export declare class CodeGenSession {
194
196
  abortSetupCommand(): void;
195
197
  toolsRunning(): boolean;
196
198
  abortAllTools(): void;
199
+ /**
200
+ * Fulfil a pending tool call (usually AskUser or any passThrough tool)
201
+ * Exposed via websocket as `toolFullfilment` for the Builder UI to send back
202
+ * the user's response.
203
+ */
204
+ toolFullfilment(id: string, result: ToolResolution | string): boolean;
205
+ fulfillToolCall(id: string, result: ToolResolution): boolean;
197
206
  abortToolCall(id: string): boolean;
198
207
  abort(cleanCurrentMessage?: boolean): Promise<boolean>;
199
208
  stopEventLoop(): Promise<void>;
@@ -0,0 +1,86 @@
1
+ import { type SelectOptions, type ConfirmOptions, type TextOptions } from "@clack/prompts";
2
+ import { spinner } from "./spinner";
3
+ import type { WebSocket } from "ws";
4
+ export interface IOService {
5
+ log(str: string): void;
6
+ info(str: string): void;
7
+ warn(str: string): void;
8
+ error(str: string): void;
9
+ write(text: string): void;
10
+ writeMetadata(metadata: Record<string, any>): void;
11
+ confirm(options: ConfirmOptions): Promise<boolean | symbol>;
12
+ text(options: TextOptions): Promise<string | symbol>;
13
+ select<Value>(options: SelectOptions<Value>): Promise<Value | symbol>;
14
+ createSpinner(): ReturnType<typeof spinner>;
15
+ isInteractive(): boolean;
16
+ isTTY(): boolean;
17
+ exit(code: number): Promise<void>;
18
+ }
19
+ export declare class ConsoleIOService implements IOService {
20
+ log(str: string): void;
21
+ info(str: string): void;
22
+ warn(str: string): void;
23
+ error(str: string): void;
24
+ write(text: string): void;
25
+ writeMetadata(_: Record<string, any>): void;
26
+ confirm(options: ConfirmOptions): Promise<boolean | symbol>;
27
+ text(options: TextOptions): Promise<string | symbol>;
28
+ select<Value>(options: SelectOptions<Value>): Promise<Value | symbol>;
29
+ createSpinner(): ReturnType<typeof spinner>;
30
+ isInteractive(): boolean;
31
+ isTTY(): boolean;
32
+ exit(code: number): Promise<void>;
33
+ }
34
+ export interface BaseMessage {
35
+ type: string;
36
+ [key: string]: any;
37
+ }
38
+ export interface LogMessage extends BaseMessage {
39
+ type: "log";
40
+ level: "info" | "warn" | "error";
41
+ message: string;
42
+ }
43
+ export interface WriteMessage extends BaseMessage {
44
+ type: "write";
45
+ text: string;
46
+ }
47
+ export interface SpinnerMessage extends BaseMessage {
48
+ type: "spinner";
49
+ status: "start" | "stop";
50
+ message: string;
51
+ code?: number;
52
+ }
53
+ export interface PromptRequest extends BaseMessage {
54
+ type: "prompt";
55
+ promptType: "text" | "confirm" | "select";
56
+ options: any;
57
+ requestId: string;
58
+ }
59
+ export interface PromptResponse extends BaseMessage {
60
+ type: "prompt_response";
61
+ requestId: string;
62
+ value: any;
63
+ cancelled?: boolean;
64
+ }
65
+ export declare class WebSocketIOService implements IOService {
66
+ private ws;
67
+ private promptCallbacks;
68
+ private messageQueue;
69
+ private isProcessing;
70
+ constructor(ws: WebSocket);
71
+ private sendMessage;
72
+ private prompt;
73
+ log(...args: any[]): void;
74
+ info(...args: any[]): void;
75
+ warn(...args: any[]): void;
76
+ error(...args: any[]): void;
77
+ write(text: string): void;
78
+ writeMetadata(metadata: Record<string, any>): void;
79
+ confirm(options: ConfirmOptions): Promise<boolean | symbol>;
80
+ text(options: TextOptions): Promise<string | symbol>;
81
+ select<Value>(options: SelectOptions<Value>): Promise<Value | symbol>;
82
+ createSpinner(): ReturnType<typeof spinner>;
83
+ isInteractive(): boolean;
84
+ isTTY(): boolean;
85
+ exit(code: number): Promise<void>;
86
+ }
@@ -0,0 +1,7 @@
1
+ import type { DevToolsSys } from "@builder.io/dev-tools/core";
2
+ import { type InstallOutcome } from "./helpers";
3
+ export declare const installJsxPlugin: (sys: DevToolsSys) => Promise<{
4
+ timestamp: string;
5
+ installOutcome: InstallOutcome;
6
+ error: string | undefined;
7
+ }>;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Initialize logging by wrapping all console methods to write to logs file
3
+ */
4
+ export declare function initializeLogging(): void;
5
+ /**
6
+ * Reset console methods to their original state
7
+ */
8
+ export declare function resetLogging(): void;
9
+ /**
10
+ * Display intro message with logging
11
+ */
12
+ export declare const intro: (message: string) => void;
13
+ /**
14
+ * Wrapped clack logging methods with file logging
15
+ */
16
+ export declare const log: {
17
+ info: (message: string) => void;
18
+ success: (message: string) => void;
19
+ error: (message: string) => void;
20
+ warn: (message: string) => void;
21
+ step: (message: string) => void;
22
+ message: (message?: string, { symbol }?: import("@clack/prompts").LogMessageOptions) => void;
23
+ warning: (message: string) => void;
24
+ };
25
+ /**
26
+ * Display outro message with logging
27
+ */
28
+ export declare const outro: (message: string) => void;
29
+ /**
30
+ * Reads logs with pagination
31
+ * @param nextToken Line number to start reading from (0-indexed)
32
+ * @param limit Number of lines to read
33
+ * @returns Object containing logs array and next token
34
+ */
35
+ export declare const readLogs: (nextToken?: number, limit?: number) => {
36
+ logs: string[];
37
+ nextToken: number | null;
38
+ };
@@ -0,0 +1,13 @@
1
+ import type { DevToolsSys } from "@builder.io/dev-tools/core";
2
+ import type { CLIArgs } from "./index";
3
+ export interface InitArgs extends CLIArgs {
4
+ repoFullName?: string;
5
+ branchName?: string;
6
+ githubToken?: string;
7
+ installCommand?: string;
8
+ dockerImageType?: "fusion-starter" | "node";
9
+ }
10
+ export declare function runLaunchInitCommandV2({ args, sys, }: {
11
+ sys: DevToolsSys;
12
+ args: InitArgs;
13
+ }): Promise<number>;
@@ -0,0 +1,19 @@
1
+ import type { DevToolsSys } from "@builder.io/dev-tools/core";
2
+ import type { CLIArgs } from "./index";
3
+ export interface InitArgs extends CLIArgs {
4
+ repoFullName?: string;
5
+ branchName?: string;
6
+ githubToken?: string;
7
+ installCommand?: string;
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";
15
+ }
16
+ export declare function runLaunchInitCommand({ args, sys, }: {
17
+ sys: DevToolsSys;
18
+ args: InitArgs;
19
+ }): Promise<number>;
@@ -1,6 +1,6 @@
1
1
  import type { DevToolsSys } from "../../types";
2
2
  import type { Credentials } from "../credentials";
3
- import type { Component } from "./types";
3
+ import type { Component, ComponentIssue } from "./types";
4
4
  import type { WorkspaceConfiguration } from "$/ai-utils";
5
5
  export declare const processComponent: (sys: DevToolsSys, credentials: Credentials, sessionId: string, component: Component, opts?: {
6
6
  designSystemId?: string | null;
@@ -10,5 +10,6 @@ export declare const processComponent: (sys: DevToolsSys, credentials: Credentia
10
10
  storeRepoIndexing?: boolean;
11
11
  workspaceConfig?: WorkspaceConfiguration;
12
12
  debug?: boolean;
13
+ onIssue?: (issue: ComponentIssue) => void;
13
14
  }) => Promise<void>;
14
15
  export declare const deprecateObsoleteComponents: (credentials: Credentials, localComponents: Component[], remoteComponents: Component[]) => Promise<void>;
@@ -1,8 +1,8 @@
1
1
  import type { DevToolsSys } from "../../types";
2
2
  import type { CLIArgs } from "../index";
3
3
  import { type Credentials } from "../credentials";
4
- import type { Component } from "./types";
5
- export declare const displayComponentLibrarySummary: (components: Component[], indexedComponents: Component[], startTime: number, numFailed: number | undefined, isForce: boolean | undefined, designSystemName: string) => void;
4
+ import type { Component, ComponentIssue } from "./types";
5
+ export declare const displayComponentLibrarySummary: (components: Component[], indexedComponents: Component[], startTime: number, numFailed: number | undefined, isForce: boolean | undefined, designSystemName: string, issues?: ComponentIssue[]) => void;
6
6
  export interface RepoIndexingDoc {
7
7
  name: string;
8
8
  content: string | {
@@ -9,3 +9,8 @@ export interface Component {
9
9
  hash?: string;
10
10
  designSystemId?: string | null;
11
11
  }
12
+ export interface ComponentIssue {
13
+ componentName: string;
14
+ error: string;
15
+ sessionId: string;
16
+ }
@@ -0,0 +1,2 @@
1
+ import type { DevToolsSys } from "../core";
2
+ export declare const parseDesignSystemVersion: (sys: DevToolsSys, designSystemPackage: string) => Promise<string | null | undefined>;
@@ -0,0 +1,17 @@
1
+ import type { DevToolsSys } from "../types";
2
+ import type { CLIArgs } from "./index";
3
+ export interface RepoIndexingDoc {
4
+ name: string;
5
+ content: string | {
6
+ name: string;
7
+ description: string;
8
+ components: string[];
9
+ relevantFiles: string[];
10
+ }[];
11
+ createdDate: string;
12
+ description: string;
13
+ id: string;
14
+ ownerId: string;
15
+ userId: string;
16
+ }
17
+ export declare const runRepoIndexing: (sys: DevToolsSys, args: CLIArgs) => Promise<void>;
@@ -0,0 +1,5 @@
1
+ export declare const mockDeps: {
2
+ getStoredComponentDocs: () => Promise<never[]>;
3
+ storeComponentDocs: () => Promise<{}>;
4
+ runCodeGen: () => Promise<string>;
5
+ };
@@ -0,0 +1 @@
1
+ export declare const REPO_INDEXING_GROUP_PROMPT: string;
@@ -17,7 +17,7 @@ export declare const NUMBER_TYPES: string[];
17
17
  export declare const BOOLEAN_TYPES: string[];
18
18
  export declare const ARRAY_TYPES: string[];
19
19
  export declare const OBJECT_TYPES: string[];
20
- export declare function getPrimitiveType(t: string): "number" | "string" | "boolean" | "object" | "array";
20
+ export declare function getPrimitiveType(t: string): "string" | "object" | "number" | "boolean" | "array";
21
21
  export declare function removeQuotes(text: string): string;
22
22
  export declare const resolveType: (sys: DevToolsSys, checker: ts.TypeChecker, type: ts.Type) => string[] | undefined;
23
23
  export declare const typeToString: (sys: DevToolsSys, checker: ts.TypeChecker, type: ts.Type) => string;
@@ -8,4 +8,4 @@ export declare function objectExpressionToObjectValue(sys: DevToolsSys, objectLi
8
8
  };
9
9
  export declare function convertArrayExpressionToJsArray(sys: DevToolsSys, arr: ts.ArrayLiteralExpression): any[];
10
10
  export declare function getTextOfPropertyName(sys: DevToolsSys, prop: ts.PropertyAssignment | ts.ObjectLiteralElementLike | undefined): string | undefined;
11
- export declare function valueToExpression(sys: DevToolsSys, val: any): ts.ObjectLiteralExpression | ts.Identifier | ts.StringLiteral | ts.NumericLiteral | ts.TrueLiteral | ts.FalseLiteral | ts.ArrayLiteralExpression;
11
+ export declare function valueToExpression(sys: DevToolsSys, val: any): ts.ObjectLiteralExpression | ts.ArrayLiteralExpression | ts.Identifier | ts.StringLiteral | ts.NumericLiteral | ts.TrueLiteral | ts.FalseLiteral;
@@ -19,7 +19,7 @@ export declare function clone<T>(obj: T): T;
19
19
  export declare function shouldSkipFolder(sys: DevToolsSys, skipFolders: Set<string>, fileName: string): boolean;
20
20
  export declare function getPackageManager(): string;
21
21
  export declare function isWindows(): boolean;
22
- export declare function builderNpxPackage(): "\"@builder.io/dev-tools\"" | "builder.io";
22
+ export declare function builderNpxPackage(): "builder.io" | "\"@builder.io/dev-tools\"";
23
23
  /**
24
24
  * Sanitizes a component name for use in filesystem paths by replacing invalid characters with underscores
25
25
  * @param name The component name to sanitize
@@ -0,0 +1,6 @@
1
+ import type { DevToolsSys } from "../..";
2
+ import type { EnsureConfigResult } from "../../../types";
3
+ /**
4
+ * Ensure the Remix Vite config has the necessary plugins and settings
5
+ */
6
+ export declare function ensureRemixConfig(sys: DevToolsSys, configFilePath: string, configContent: string): Promise<EnsureConfigResult>;
@@ -0,0 +1,10 @@
1
+ import type { DevToolsSys } from "../..";
2
+ import type ts from "typescript";
3
+ /**
4
+ * Check if the current project is using Remix framework
5
+ */
6
+ export declare function isRemixFramework(sys: DevToolsSys): boolean;
7
+ /**
8
+ * Update an object literal to include the external dependencies for Remix
9
+ */
10
+ export declare function updateCommonJsLibrary(sys: DevToolsSys, config: ts.ObjectLiteralExpression): ts.ObjectLiteralExpression | null;
@@ -0,0 +1,6 @@
1
+ import type { DevToolsSys } from "../..";
2
+ import type { EnsureConfigResult } from "../../../types";
3
+ /**
4
+ * Update a Vite config file to include a plugin
5
+ */
6
+ export declare function updateViteConfig(sys: DevToolsSys, configFilePath: string, configContent: string, pluginName: string, importPath: string): Promise<EnsureConfigResult>;