@builder.io/dev-tools 1.10.16 → 1.10.17-dev.202508181908.1b94bf15b

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 +111370 -3816
  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 -1
  12. package/remix/build.cjs +132 -1
  13. package/remix/index.mjs +113 -1
  14. package/server/index.cjs +22129 -1468
  15. package/server/index.mjs +22122 -1462
  16. package/types/cli/backup.d.ts +8 -3
  17. package/types/cli/code-server.d.ts +0 -0
  18. package/types/cli/code-tools.d.ts +1 -1
  19. package/types/cli/codegen.d.ts +2 -1
  20. package/types/cli/io-service.d.ts +86 -0
  21. package/types/cli/launch/InitStateMachine.d.ts +1 -0
  22. package/types/cli/launch/helpers.d.ts +12 -0
  23. package/types/cli/launch/install-jsx-plugin.d.ts +7 -0
  24. package/types/cli/launch/logger.d.ts +38 -0
  25. package/types/cli/launch-init-v2.d.ts +13 -0
  26. package/types/cli/launch-init.d.ts +19 -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
@@ -9,8 +9,12 @@ interface BackupGitRepoOptions {
9
9
  repoPath: string;
10
10
  aiBranch: string;
11
11
  featureBranch: string;
12
- originalRepoUrl: string;
13
12
  workspace: WorkspaceConfiguration | undefined;
13
+ /**
14
+ * If true, the system is connected to the git provider.
15
+ * If false, the system is offline and will not fetch any branches from origin.
16
+ */
17
+ isConnectedToProvider: boolean;
14
18
  debug: boolean;
15
19
  }
16
20
  export interface BackupGitRepoResultValid {
@@ -38,7 +42,7 @@ export type BackupGitRepoResult = BackupGitRepoResultValid | BackupGitRepoResult
38
42
  * The aiBranch is where the AI creates commits as work progresses, while featureBranch
39
43
  * is the base branch where work started (usually "main").
40
44
  */
41
- export declare function backupGitRepo({ sys, credentials, projectId, branchName, repoPath, aiBranch, featureBranch, workspace, originalRepoUrl, debug, }: BackupGitRepoOptions): Promise<BackupGitRepoResult>;
45
+ export declare function backupGitRepo({ sys, credentials, projectId, branchName, repoPath, aiBranch, featureBranch, workspace, isConnectedToProvider, debug, }: BackupGitRepoOptions): Promise<BackupGitRepoResult>;
42
46
  interface InitialCommitHashResult {
43
47
  initialBranch: string;
44
48
  initialCommitHash: string;
@@ -54,12 +58,13 @@ interface InitialCommitHashResult {
54
58
  * For partial backups, we fetch the latest state of the chosen upstream branch from origin
55
59
  * to ensure the backup has the correct commit range reference.
56
60
  */
57
- export declare function getInitialCommitHash({ sys, repoPath, featureBranch, debug, workspace, }: {
61
+ export declare function getInitialCommitHash({ sys, repoPath, featureBranch, debug, workspace, isConnectedToProvider, }: {
58
62
  sys: DevToolsSys;
59
63
  repoPath: string;
60
64
  featureBranch: string;
61
65
  debug: boolean;
62
66
  workspace: WorkspaceConfiguration | undefined;
67
+ isConnectedToProvider: boolean;
63
68
  }): Promise<InitialCommitHashResult>;
64
69
  /**
65
70
  * Requests a signed upload URL for git backup
File without changes
@@ -19,7 +19,6 @@ export interface FusionContext {
19
19
  git: boolean;
20
20
  gitRemote?: string;
21
21
  gitAutoInit?: boolean;
22
- gitFeatureBranch?: string;
23
22
  }
24
23
  export interface ToolContext extends Partial<FusionContext> {
25
24
  sys: DevToolsSys;
@@ -29,6 +28,7 @@ export interface ToolContext extends Partial<FusionContext> {
29
28
  position: string;
30
29
  emitter: CodeGenEventEmitter;
31
30
  fusionConfig: FusionConfig | undefined;
31
+ canCollapseWorkspace: boolean;
32
32
  signal: AbortSignal;
33
33
  workingDirectory: string;
34
34
  allowedCommands: RegExp[];
@@ -56,8 +56,9 @@ export declare class CodeGenSession {
56
56
  loadHistory(): Promise<LoadHistoryResult>;
57
57
  loadWholeSession(opts?: LoadWholeSessionOptions): Promise<LoadWholeSessionResult>;
58
58
  loadMoreTurns(): Promise<CodegenTurn[]>;
59
- pushRepoV2({ repoFullName }: {
59
+ pushRepoV2(repoInfo: {
60
60
  repoFullName: string;
61
+ repoUrl: string;
61
62
  }): Promise<{
62
63
  success: boolean;
63
64
  error: string;
@@ -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
+ }
@@ -24,6 +24,7 @@ export declare class InitStateMachine {
24
24
  checkout(branchName: string, ref: string, repoPath: string): Promise<boolean>;
25
25
  execAsync(exec: string, args: string[], cwd?: string): Promise<string>;
26
26
  git(args: string[], cwd?: string): Promise<string>;
27
+ performBackup(sys: DevToolsSys, credentials: Credentials, fusionConfig: FusionConfig, volumePath: string, repositories: Required<WorkspaceFolder>[]): Promise<void>;
27
28
  init(): Promise<boolean>;
28
29
  addInitLog(type: "status" | "log" | "error" | "complete", message: string, options?: {
29
30
  step?: InitStateStep;
@@ -1,2 +1,14 @@
1
+ import type { FusionConfig } from "$/ai-utils";
2
+ import type { DevToolsSys } from "types";
1
3
  export declare const getCommandWithShellArgs: (command: string, shell: string) => string[];
2
4
  export declare const isInRemoteContainer: () => boolean;
5
+ export declare const getVolumePath: (fusionConfig: FusionConfig) => string;
6
+ export declare function computeAIBranchName(featureBranch: string, sessionId: string): string;
7
+ export declare const getAndParseGitRepoInfo: ({ sys, gitWorkingDirectory, }: {
8
+ sys: DevToolsSys;
9
+ gitWorkingDirectory: string;
10
+ }) => Promise<{
11
+ currentBranch: string;
12
+ featureBranch: string;
13
+ sessionId: string | undefined;
14
+ }>;
@@ -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>;
@@ -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>;