@builder.io/dev-tools 1.12.2 → 1.12.3-dev.202510081252.fbe760e6c

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 (51) hide show
  1. package/angular/index.cjs +46 -1
  2. package/angular/index.mjs +21 -1
  3. package/cli/index.cjs +115842 -3819
  4. package/cli/index.cjs.map +4 -4
  5. package/core/index.cjs +14409 -950
  6. package/core/index.mjs +14400 -951
  7. package/figma/index.cjs +47 -1
  8. package/figma/index.mjs +27 -1
  9. package/node/index.cjs +25444 -107
  10. package/node/index.mjs +25448 -107
  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 +22716 -1519
  15. package/server/index.mjs +22702 -1518
  16. package/types/cli/backup.d.ts +2 -2
  17. package/types/cli/codegen.d.ts +22 -37
  18. package/types/cli/figma-publish.d.ts +2 -2
  19. package/types/cli/figma-utils.d.ts +1 -1
  20. package/types/cli/launch/InitStateMachine.d.ts +3 -7
  21. package/types/cli/launch/config.d.ts +1 -1
  22. package/types/cli/launch/dev-server-orchestrator.d.ts +8 -10
  23. package/types/cli/launch/dry-run-backup.d.ts +1 -1
  24. package/types/cli/launch/grafana.d.ts +2 -2
  25. package/types/cli/launch/helpers.d.ts +1 -1
  26. package/types/cli/launch/proxy.d.ts +1 -1
  27. package/types/cli/launch.d.ts +1 -1
  28. package/types/cli/repo-indexing/component-discovery.d.ts +5 -5
  29. package/types/cli/repo-indexing/component-indexing.d.ts +10 -10
  30. package/types/cli/repo-indexing/icons.d.ts +7 -7
  31. package/types/cli/repo-indexing/repo-indexing-utils.d.ts +19 -10
  32. package/types/cli/repo-indexing/repo-indexing.d.ts +3 -3
  33. package/types/cli/repo-metrics.d.ts +6 -0
  34. package/types/cli/server-ws.d.ts +1 -1
  35. package/types/cli/spinner.d.ts +1 -1
  36. package/types/cli/sync-utils.d.ts +1 -1
  37. package/types/cli/utils/git.d.ts +1 -1
  38. package/types/cli/utils/terminal-buffer.d.ts +2 -0
  39. package/types/client/client-api.d.ts +1 -1
  40. package/types/client/utils.d.ts +1 -1
  41. package/types/common/ast/component-input-types.d.ts +1 -1
  42. package/types/common/ast/convert-values.d.ts +1 -1
  43. package/types/common/errors.d.ts +1 -1
  44. package/types/common/estimate-code-tokens.d.ts +0 -7
  45. package/types/core/adapters/next/next-test-utils.d.ts +1 -1
  46. package/types/tsconfig.tsbuildinfo +1 -1
  47. package/types/types/connection-tracker.d.ts +1 -1
  48. package/vite/index.cjs +153 -3
  49. package/vite/index.mjs +119 -3
  50. package/webpack/index.cjs +2883 -27
  51. package/webpack/index.mjs +2871 -27
@@ -31,7 +31,7 @@ interface BackupGitRepoOptions {
31
31
  * The aiBranch is where the AI creates commits as work progresses, while featureBranch
32
32
  * is the base branch where work started (usually "main").
33
33
  */
34
- export declare function backupGitRepo({ sys, credentials, projectId, branchName, repoPath, aiBranch, featureBranch, workspace, isConnectedToProvider, debug, forcedFullBackup, canAbortMerge, }: BackupGitRepoOptions): Promise<BackupGitRepoResult>;
34
+ export declare function backupGitRepo({ sys, credentials, projectId, branchName, repoPath, aiBranch, featureBranch, workspace, isConnectedToProvider, debug, forcedFullBackup, canAbortMerge }: BackupGitRepoOptions): Promise<BackupGitRepoResult>;
35
35
  type InitialCommitHashResult = {
36
36
  initialBranch: string;
37
37
  initialCommitHash: string | undefined;
@@ -53,7 +53,7 @@ type InitialCommitHashResult = {
53
53
  * For partial backups, we fetch the latest state of the chosen upstream branch from origin
54
54
  * to ensure the backup has the correct commit range reference.
55
55
  */
56
- export declare function getInitialCommitHash({ sys, repoPath, featureBranch, debug, workspace, isConnectedToProvider, forcedFullBackup, credentials, projectId, }: {
56
+ export declare function getInitialCommitHash({ sys, repoPath, featureBranch, debug, workspace, isConnectedToProvider, forcedFullBackup, credentials, projectId }: {
57
57
  sys: DevToolsSys;
58
58
  repoPath: string;
59
59
  featureBranch: string;
@@ -1,6 +1,6 @@
1
1
  import type { DevToolsSys } from "../types";
2
2
  import { type Credentials } from "./credentials";
3
- import type { CodegenFeedback, CodeGenToolMap, CodegenTurn, CustomInstruction, FusionConfig, GenerateCompletionState, GenerateCompletionStep, GenerateCompletionStepGit, GenerateUserMessage, UserContext, WorkspaceConfiguration, WorkspaceFolder, LoadWholeSessionOptions, LoadWholeSessionResult, LoadHistoryResult, CodeGenMode, ApplyActionsResult, PrivacyMode, CodeGenPosition, BackupGitRepoResult, PushChangesArgs, CodegenApiResult } from "$/ai-utils";
3
+ import type { CodegenFeedback, CodeGenToolMap, CodegenTurn, CustomInstruction, FusionConfig, GenerateCompletionState, GenerateCompletionStep, GenerateCompletionStepGit, GenerateUserMessage, UserContext, WorkspaceConfiguration, WorkspaceFolder, LoadWholeSessionOptions, LoadWholeSessionResult, LoadHistoryResult, CodeGenMode, ApplyActionsResult, PrivacyMode, CodeGenPosition, BackupGitRepoResult, PushChangesArgs, CodegenApiResult, CodegenApiTerminal, ConfigureDevOrchestratorOpts, ConfigureDevOrchestratorUpdates, RepoMetrics } from "$/ai-utils";
4
4
  import prettier from "prettier";
5
5
  import { type FusionContext, type ToolResolution } from "./code-tools";
6
6
  import EventEmitter from "node:events";
@@ -70,7 +70,7 @@ export declare class CodeGenSession {
70
70
  success: false;
71
71
  error: Error;
72
72
  }>;
73
- getCommitMode(): import("$/ai-utils").CommitMode;
73
+ getCommitMode(): import("../../../dist/ai-utils/src").CommitMode;
74
74
  pushChanges(opts: PushChangesArgs): Promise<CodegenApiResult>;
75
75
  pullLatestFromRemote(): Promise<CodegenApiResult>;
76
76
  abortMerge(emitStatus?: boolean): Promise<CodegenApiResult>;
@@ -91,26 +91,34 @@ export declare class CodeGenSession {
91
91
  git(args: string[], opts?: string | RunCommandOptions): Promise<string>;
92
92
  setDebug(debug: boolean): void;
93
93
  createTerminal(options?: {
94
+ terminalId?: string;
95
+ title?: string;
94
96
  cwd?: string;
95
97
  env?: Record<string, string | undefined>;
96
98
  cols?: number;
97
99
  rows?: number;
98
100
  shell?: string;
99
- }): {
101
+ createdBy?: string;
102
+ }): CodegenApiTerminal;
103
+ emitTerminals(): void;
104
+ updateTerminal({ terminalId, cols, rows, title }: {
100
105
  terminalId: string;
101
- };
106
+ cols?: number;
107
+ rows?: number;
108
+ title?: string;
109
+ }): boolean;
102
110
  writeTerminal({ terminalId, data }: {
103
111
  terminalId: string;
104
112
  data: string;
105
113
  }): boolean;
106
- signalTerminal({ terminalId, signal, }: {
114
+ signalTerminal({ terminalId, signal }: {
107
115
  terminalId: string;
108
116
  signal: "SIGINT" | "SIGTERM" | "SIGKILL";
109
117
  }): boolean;
110
118
  disposeTerminal({ terminalId }: {
111
119
  terminalId: string;
112
120
  }): boolean;
113
- subscribeTerminal({ terminalId, onData, onExit, }: {
121
+ subscribeTerminal({ terminalId, onData, onExit }: {
114
122
  terminalId: string;
115
123
  onData: (chunk: string) => void;
116
124
  onExit?: (code?: number) => void;
@@ -121,6 +129,7 @@ export declare class CodeGenSession {
121
129
  includePattern?: string;
122
130
  gitignore?: boolean;
123
131
  }): Promise<string[]>;
132
+ collectRepoMetrics(): Promise<RepoMetrics>;
124
133
  getSessionId(): string;
125
134
  getSpaceId(): string | undefined;
126
135
  revertToCommitHash(commitHash: string): Promise<void>;
@@ -133,7 +142,7 @@ export declare class CodeGenSession {
133
142
  * @param dryRun If true, only simulate the restoration without making changes
134
143
  * @returns Array of file paths that were changed
135
144
  */
136
- restore({ location, predicate, revert, dryRun, forceReplay, debug, }: {
145
+ restore({ location, predicate, revert, dryRun, forceReplay, debug }: {
137
146
  location: "before" | "after";
138
147
  predicate: (turn: CodegenTurn | null, index: number) => boolean;
139
148
  dryRun?: boolean;
@@ -144,7 +153,7 @@ export declare class CodeGenSession {
144
153
  undone: string[] | null;
145
154
  message: string;
146
155
  }>;
147
- restoreFromCompletionId({ location, completionId, forceReplay, }: {
156
+ restoreFromCompletionId({ location, completionId, forceReplay }: {
148
157
  location: "before" | "after";
149
158
  completionId: string;
150
159
  forceReplay?: boolean;
@@ -180,7 +189,7 @@ export declare class CodeGenSession {
180
189
  sendMessage(message: GenerateUserMessage, immediate?: boolean): Promise<void>;
181
190
  getTurns(): CodegenTurn[];
182
191
  getSessionContext(): SessionContext;
183
- runSetupCommand(): Promise<import("./launch/dev-server-orchestrator").SetupCommandResult | undefined>;
192
+ runSetupCommand(): Promise<import("../../../dist/ai-utils/src").SetupCommandResult | undefined>;
184
193
  abortSetupCommand(): void;
185
194
  toolsRunning(): boolean;
186
195
  abortAllTools(): void;
@@ -196,21 +205,7 @@ export declare class CodeGenSession {
196
205
  abort(cleanCurrentMessage?: boolean): Promise<boolean>;
197
206
  stopEventLoop(): Promise<void>;
198
207
  requestRefresh(): void;
199
- configureDevOrchestrator(opts: {
200
- devCommand?: string;
201
- setupCommand?: string;
202
- proxyPort?: number;
203
- proxyServer?: string;
204
- env?: Record<string, string | null>;
205
- replaceEnvs?: boolean;
206
- forceSetupCommand?: boolean;
207
- forceDevCommand?: boolean;
208
- }): Promise<{
209
- devCommand: boolean;
210
- setupCommand: boolean;
211
- proxyServer: boolean;
212
- env: boolean;
213
- }>;
208
+ configureDevOrchestrator(opts: ConfigureDevOrchestratorOpts): Promise<ConfigureDevOrchestratorUpdates>;
214
209
  close(uploadGitBackup?: boolean): Promise<void>;
215
210
  emitGitStatus(): Promise<GenerateCompletionStepGit | null>;
216
211
  manualCommit(options: {
@@ -295,9 +290,9 @@ export declare class CodeGenSession {
295
290
  */
296
291
  deleteFile(filePath: string, skipAclCheck?: boolean): Promise<string | null>;
297
292
  getLinesStats(): {
298
- net: number;
299
293
  added: number;
300
294
  removed: number;
295
+ net: number;
301
296
  };
302
297
  /**
303
298
  * Get git diff between current commit and remote branch
@@ -306,7 +301,7 @@ export declare class CodeGenSession {
306
301
  * @param includeFilesOnly - If true, only return filePath and action properties
307
302
  * @param filePaths - Optional array of file paths to limit the diff to specific files
308
303
  */
309
- getDiffFromRemote({ numberOfContextLines, includeFilesOnly, filePaths, }: {
304
+ getDiffFromRemote({ numberOfContextLines, includeFilesOnly, filePaths }: {
310
305
  numberOfContextLines?: number;
311
306
  includeFilesOnly?: boolean;
312
307
  filePaths?: Array<string>;
@@ -318,7 +313,7 @@ export declare class CodeGenSession {
318
313
  * @param includeFilesOnly - If true, only return filePath and action properties
319
314
  * @param filePaths - Optional array of file paths to limit the diff to specific files
320
315
  */
321
- getDiff({ mode, numberOfContextLines, includeFilesOnly, filePaths, }: {
316
+ getDiff({ mode, numberOfContextLines, includeFilesOnly, filePaths }: {
322
317
  mode: "remote-parent-branch" | "remote-current-branch";
323
318
  numberOfContextLines?: number;
324
319
  includeFilesOnly?: boolean;
@@ -328,17 +323,7 @@ export declare class CodeGenSession {
328
323
  diff?: ApplyActionsResult[];
329
324
  error?: Error;
330
325
  }>;
331
- /**
332
- * Get the default branch name from remote repository
333
- * Falls back to checking common default branch names
334
- */
335
326
  private getDefaultBranch;
336
- /**
337
- * Get git diff between current branch and its parent branch (main/master)
338
- * @param numberOfContextLines - Optional number of context lines to include in the diff
339
- * @param includeFilesOnly - If true, only return filePath and action properties
340
- * @param filePaths - Optional array of file paths to limit the diff to specific files
341
- */
342
327
  private getDiffFromParentBranch;
343
328
  }
344
329
  export declare function getUserContext(sys: DevToolsSys, gitWorkingDirectory?: string): Promise<UserContext>;
@@ -9,10 +9,10 @@ export declare function setPublicKey(sys: DevToolsSys, publicKey: string, devToo
9
9
  success: boolean;
10
10
  error: string;
11
11
  } | {
12
- success: boolean;
13
12
  error?: undefined;
13
+ success: boolean;
14
14
  }>;
15
- export declare function findMappingsFromFiles({ sys, mappingFiles, typeCheck, }: {
15
+ export declare function findMappingsFromFiles({ sys, mappingFiles, typeCheck }: {
16
16
  mappingFiles: string[];
17
17
  sys: DevToolsSys;
18
18
  typeCheck?: boolean;
@@ -17,7 +17,7 @@ export declare const figmaApi: <T = any>(sys: DevToolsSys, args: CLIArgs, path:
17
17
  export declare const getFigmaNodeData: (sys: DevToolsSys, args: CLIArgs, auth: {
18
18
  access_token: string;
19
19
  oauth: boolean;
20
- }, fileId: string, nodeIds: string, depth?: number) => Promise<any>;
20
+ }, fileId: string, nodeIds: string, depth?: number | undefined) => Promise<any>;
21
21
  export declare function getImportDataFromToken(credentials: Credentials, token: string, verbose: boolean): Promise<(readonly [string, FigmaComponentInfo])[]>;
22
22
  export declare function needsFigmaAuth(urls: string[]): boolean;
23
23
  export declare function getFigmaNodeDataFromURLs(sys: DevToolsSys, args: CLIArgs, figmaAuth: {
@@ -26,7 +26,7 @@ export declare class InitStateMachine {
26
26
  checkout(branchName: string, ref: string, repoPath: string): Promise<boolean>;
27
27
  execAsync(exec: string, args: string[], cwd?: string, retry?: number): Promise<string>;
28
28
  git(args: string[], cwd?: string, retry?: number): Promise<string>;
29
- performBackup({ sys, credentials, fusionConfig, volumePath, repositories, isConnectedToProvider, forcedFullBackup, }: {
29
+ performBackup({ sys, credentials, fusionConfig, volumePath, repositories, isConnectedToProvider, forcedFullBackup }: {
30
30
  sys: DevToolsSys;
31
31
  credentials: Credentials;
32
32
  fusionConfig: FusionConfig;
@@ -56,14 +56,10 @@ export declare class InitStateMachine {
56
56
  private sanitizeGitRemoteUrl;
57
57
  private cleanupLockFiles;
58
58
  validateGitRepo(repoPath: string): Promise<void>;
59
- /**
60
- * If a backup is available, perform a backup recovery (and throw if it fails and cannot be recovered from).
61
- * If no backup is available, do nothing.
62
- */
63
59
  private restoreFromPartialBackup;
64
60
  private initializeGitRepo;
65
61
  private refreshRepoConfig;
66
- runInitializationCommand({ repo, tempCloningDir, repoPath, initCommand, }: {
62
+ runInitializationCommand({ repo, tempCloningDir, repoPath, initCommand }: {
67
63
  repo: ValidatedWorkspaceFolder;
68
64
  tempCloningDir: string;
69
65
  repoPath: string;
@@ -72,7 +68,7 @@ export declare class InitStateMachine {
72
68
  outcome: boolean;
73
69
  error?: Error;
74
70
  }>;
75
- cloneRepository({ repo, repoPath, backupResult, }: {
71
+ cloneRepository({ repo, repoPath, backupResult }: {
76
72
  repo: WorkspaceFolderWithRepoInfo;
77
73
  repoPath: string;
78
74
  backupResult: GitBackupDownloadResult | undefined;
@@ -1,6 +1,6 @@
1
1
  import { type FusionConfig } from "$/ai-utils";
2
2
  import type { LaunchArgs } from "../launch";
3
- import type { DevToolsSys } from "types";
3
+ import type { DevToolsSys } from "../../types";
4
4
  export declare function getFusionConfig(sys: DevToolsSys, args: LaunchArgs): Promise<FusionConfig>;
5
5
  export declare function saveFusionConfig(sys: DevToolsSys, fusionConfig: FusionConfig): Promise<void>;
6
6
  export declare function trackConfigData(sys: DevToolsSys, fusionConfig: FusionConfig): void;
@@ -1,14 +1,10 @@
1
1
  import type { DevToolsSys } from "@builder.io/dev-tools/core";
2
2
  import type { ProxyMiddleware } from "../../types/proxy-middleware";
3
- import type { DevCommandState, EnvironmentVariable, HttpServerState } from "$/ai-utils";
3
+ import type { DevCommandState, EnvironmentVariable, HttpServerState, SetupCommandResult } from "$/ai-utils";
4
4
  import EventEmitter from "events";
5
5
  import { ChildProcess } from "node:child_process";
6
6
  import type { FusionConfig, SetupCommandState } from "$/ai-utils";
7
7
  export type DevServerState = Exclude<SetupCommandState | DevCommandState, "installed" | "starting">;
8
- export interface SetupCommandResult {
9
- code: number | null;
10
- output: string;
11
- }
12
8
  export interface DevCommandProcess {
13
9
  type: "devCommandProcess";
14
10
  getPid: () => number | undefined;
@@ -40,8 +36,8 @@ export interface DevServerOrchestrator {
40
36
  devState: DevCommandState;
41
37
  httpServerState: HttpServerState;
42
38
  state: DevServerState;
43
- proxyTarget: string;
44
- proxyPort: number;
39
+ proxyTarget: string | undefined;
40
+ proxyPort: number | undefined;
45
41
  environmentVariables: EnvironmentVariable[];
46
42
  envVars: Record<string, string>;
47
43
  proxyMiddleware: ProxyMiddleware | undefined;
@@ -54,8 +50,8 @@ export interface DevServerOrchestrator {
54
50
  ensureSetupCommand: (abortSignal?: AbortSignal) => Promise<boolean>;
55
51
  setupCommandPromise: Promise<SetupCommandResult> | undefined;
56
52
  runSetupCommand: (signal?: AbortSignal) => Promise<SetupCommandResult>;
57
- setSetupCommand: (newCommand: string, forceRestart?: boolean, signal?: AbortSignal) => Promise<SetupCommandResult | null>;
58
- setDevCommand: (newCommand: string, forceRestart?: boolean, signal?: AbortSignal) => Promise<boolean>;
53
+ setSetupCommand: (newCommand: string | undefined, forceRestart?: boolean, signal?: AbortSignal) => Promise<SetupCommandResult | null>;
54
+ setDevCommand: (newCommand: string | undefined, forceRestart?: boolean, signal?: AbortSignal) => Promise<boolean>;
59
55
  setProxyServer: (newProxyServer: string) => Promise<boolean>;
60
56
  setPort: (newPort: number) => Promise<boolean>;
61
57
  addCheckpoint: () => void;
@@ -64,6 +60,8 @@ export interface DevServerOrchestrator {
64
60
  getAllStdout: () => string;
65
61
  getAllStderr: () => string;
66
62
  getOutput: () => string;
63
+ getSetupWrite: () => string;
64
+ getDevWrite: () => string;
67
65
  getSetupOutput: () => string;
68
66
  waitUntilIdle: (initialWaitMs?: number, idleTimeMs?: number) => Promise<void>;
69
67
  onClose: (callback: (code: number | null) => void) => void;
@@ -82,6 +80,6 @@ export interface DevServerOrchestrator {
82
80
  close: () => Promise<void>;
83
81
  }
84
82
  export declare const importPty: (sys: DevToolsSys) => typeof import("@lydell/node-pty") | undefined;
85
- export declare function devServerOrchestrator(sys: DevToolsSys, fusionConfig: FusionConfig, initialSetupState: "installed" | "not-installed" | "install-failed"): Promise<DevServerOrchestrator>;
83
+ export declare function devServerOrchestrator(sys: DevToolsSys, fusionConfig: FusionConfig, initialSetupState: "installed" | "not-installed" | "install-failed" | "unset"): Promise<DevServerOrchestrator>;
86
84
  export declare const checkPortsListenedByPid: (pid: number) => number[];
87
85
  export declare function killProcess(sys: DevToolsSys, proc: ChildProcess | DevCommandProcess | undefined, abortSignal?: AbortSignal, timeout?: number): Promise<boolean>;
@@ -4,6 +4,6 @@ export declare const attemptDryRunBackupGit: (initConfig: InitConfig, realInitSt
4
4
  success: boolean;
5
5
  error: string;
6
6
  } | {
7
- success: boolean;
8
7
  error?: undefined;
8
+ success: boolean;
9
9
  } | null>;
@@ -1,4 +1,4 @@
1
1
  import type { FusionMetrics } from "$/ai-utils";
2
- import type { Credentials } from "cli/credentials";
3
- import type { DevToolsSys } from "types";
2
+ import type { Credentials } from "../credentials";
3
+ import type { DevToolsSys } from "../../types";
4
4
  export declare function pushMetrics(sys: DevToolsSys, credentials: Credentials, body: FusionMetrics): Promise<void>;
@@ -1,5 +1,5 @@
1
1
  import type { FusionConfig } from "$/ai-utils";
2
- import type { DevToolsSys } from "types";
2
+ import type { DevToolsSys } from "../../types";
3
3
  export declare const getTempFolder: () => string;
4
4
  export declare const cleanupTempFolder: () => boolean;
5
5
  /**
@@ -1,3 +1,3 @@
1
- import type { DevToolsSys } from "types";
1
+ import type { DevToolsSys } from "../../types";
2
2
  import type { ProxyMiddleware } from "../../types/proxy-middleware";
3
3
  export declare const createProxy: (serverUrl: string, sys: DevToolsSys) => ProxyMiddleware;
@@ -84,7 +84,7 @@ export interface LaunchArgs extends CLIArgs {
84
84
  */
85
85
  autoDetectDevServer?: boolean;
86
86
  }
87
- export declare function runFusionCommand({ sys, args, }: {
87
+ export declare function runFusionCommand({ sys, args }: {
88
88
  sys: DevToolsSys;
89
89
  args: LaunchArgs;
90
90
  }): Promise<void>;
@@ -3,11 +3,11 @@ import type { Credentials } from "../credentials";
3
3
  import type { WorkspaceConfiguration } from "$/ai-utils";
4
4
  import type { Component } from "./types";
5
5
  export declare const discoverComponents: (sys: DevToolsSys, credentials: Credentials, sessionId: string, remoteComponents: Component[], opts?: {
6
- force?: boolean;
7
- designSystemPackage?: string;
8
- designSystemVersion?: string;
9
- workspaceConfig?: WorkspaceConfiguration;
10
- debug?: boolean;
6
+ force?: boolean | undefined;
7
+ designSystemPackage?: string | undefined;
8
+ designSystemVersion?: string | undefined;
9
+ workspaceConfig?: WorkspaceConfiguration | undefined;
10
+ debug?: boolean | undefined;
11
11
  }) => Promise<{
12
12
  numComponentsFound: number;
13
13
  componentsToIndex: Component[];
@@ -3,17 +3,17 @@ import type { Credentials } from "../credentials";
3
3
  import type { Component } 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
- designSystemId?: string | null;
7
- designSystemPackage?: string;
8
- designSystemVersion?: string;
9
- retriesAllowed?: number;
10
- workspaceConfig?: WorkspaceConfiguration;
11
- debug?: boolean;
6
+ designSystemId?: string | null | undefined;
7
+ designSystemPackage?: string | undefined;
8
+ designSystemVersion?: string | undefined;
9
+ retriesAllowed?: number | undefined;
10
+ workspaceConfig?: WorkspaceConfiguration | undefined;
11
+ debug?: boolean | undefined;
12
12
  }) => Promise<void>;
13
13
  export declare const processAgent: (sys: DevToolsSys, credentials: Credentials, discoveredComponents: Component[], opts?: {
14
- hasIcons?: boolean;
15
- designSystemId?: string | null;
16
- retriesAllowed?: number;
17
- debug?: boolean;
14
+ hasIcons?: boolean | undefined;
15
+ designSystemId?: string | null | undefined;
16
+ retriesAllowed?: number | undefined;
17
+ debug?: boolean | undefined;
18
18
  }) => Promise<void>;
19
19
  export declare const deprecateObsoleteComponents: (credentials: Credentials, localComponents: Component[], remoteComponents: Component[]) => Promise<void>;
@@ -2,9 +2,9 @@ import type { DevToolsSys } from "../../types";
2
2
  import type { Credentials } from "../credentials";
3
3
  import type { WorkspaceConfiguration } from "$/ai-utils";
4
4
  export declare const discoverIcons: (sys: DevToolsSys, credentials: Credentials, sessionId: string, opts?: {
5
- designSystemPackage?: string;
6
- workspaceConfig?: WorkspaceConfiguration;
7
- debug?: boolean;
5
+ designSystemPackage?: string | undefined;
6
+ workspaceConfig?: WorkspaceConfiguration | undefined;
7
+ debug?: boolean | undefined;
8
8
  }) => Promise<{
9
9
  icons: string[];
10
10
  usage: string;
@@ -13,11 +13,11 @@ export declare const discoverIcons: (sys: DevToolsSys, credentials: Credentials,
13
13
  export declare const processIcons: (credentials: Credentials, iconDiscovery: {
14
14
  icons: string[];
15
15
  usage: string;
16
- hash?: string;
16
+ hash?: string | undefined;
17
17
  }, opts: {
18
18
  designSystemId: string;
19
19
  sessionId: string;
20
- debug?: boolean;
21
- previousHash?: string | null;
22
- force?: boolean;
20
+ debug?: boolean | undefined;
21
+ previousHash?: string | null | undefined;
22
+ force?: boolean | undefined;
23
23
  }) => Promise<boolean>;
@@ -9,16 +9,16 @@ export interface UserSettings {
9
9
  email: string;
10
10
  }
11
11
  export declare const promptForDesignSystemScope: (credentials: Credentials, userSettings: UserSettings | null) => Promise<DesignSystemScope | undefined>;
12
- export declare const parseDesignSystem: (sys: DevToolsSys, designSystemPackage?: string) => Promise<{
12
+ export declare const parseDesignSystem: (sys: DevToolsSys, designSystemPackage?: string | undefined) => Promise<{
13
13
  name: any;
14
14
  version: string | undefined;
15
15
  }>;
16
- export declare const storeComponentDocs: (credentials: Credentials, body: StoreComponentDocsInput, debug?: boolean) => Promise<any>;
17
- export declare const runCodeGen: (sys: DevToolsSys, credentials: Credentials, sessionId: string, message: GenerateUserMessage, debug?: boolean, designSystemPackage?: string, workspaceConfig?: WorkspaceConfiguration, opts?: {
18
- tags?: object;
19
- maxTokens?: number;
16
+ export declare const storeComponentDocs: (credentials: Credentials, body: StoreComponentDocsInput, debug?: boolean | undefined) => Promise<any>;
17
+ export declare const runCodeGen: (sys: DevToolsSys, credentials: Credentials, sessionId: string, message: GenerateUserMessage, debug?: boolean | undefined, designSystemPackage?: string | undefined, workspaceConfig?: WorkspaceConfiguration | undefined, opts?: {
18
+ tags?: object | undefined;
19
+ maxTokens?: number | undefined;
20
20
  }, metadata?: any) => Promise<string>;
21
- export declare const getAllDesignSystems: (credentials: Credentials, opts?: {
21
+ interface GetAllDesignSystemsOpts {
22
22
  /**
23
23
  * If true, only design systems that the user has permission to edit will be
24
24
  * returned. If false, all design systems that the user has permission to edit
@@ -31,17 +31,26 @@ export declare const getAllDesignSystems: (credentials: Credentials, opts?: {
31
31
  * Defaults to false.
32
32
  */
33
33
  includeGlobalScopeDesignSystems?: boolean;
34
- }) => Promise<DesignSystem[]>;
35
- export declare const getDisplayDesignSystems: (credentials: Credentials) => Promise<DisplayDesignSystem[]>;
34
+ /**
35
+ * If true, the # of component docs in each design system will also be returned.
36
+ * Defaults to false.
37
+ */
38
+ includeDocumentCount?: boolean;
39
+ }
40
+ export declare function getAllDesignSystems(credentials: Credentials, opts: {
41
+ includeDocumentCount: true;
42
+ } & Omit<GetAllDesignSystemsOpts, "includeDocumentCount">): Promise<DisplayDesignSystem[]>;
43
+ export declare function getAllDesignSystems(credentials: Credentials, opts?: GetAllDesignSystemsOpts): Promise<DesignSystem[]>;
36
44
  export declare const getDesignSystemsByScope: (scope: DesignSystemScope, designSystems: DesignSystem[]) => DesignSystem[];
37
45
  export declare const getDesignSystemByName: (designSystemName: string, designSystems: DesignSystem[]) => DesignSystem | null;
38
46
  export declare const getDesignSystemByNameAndScope: (credentials: Credentials, designSystemName: string, scope: DesignSystemScope, designSystems: DesignSystem[]) => DesignSystem | null;
39
47
  export declare const addDesignSystem: (credentials: Credentials, body: {
40
48
  designSystemName: string;
41
- designSystemVersion?: string;
42
- designSystemPackage?: string;
49
+ designSystemVersion?: string | undefined;
50
+ designSystemPackage?: string | undefined;
43
51
  status: string;
44
52
  scope: DesignSystemScope;
45
53
  }) => Promise<any>;
46
54
  export declare const updateDesignSystem: (credentials: Credentials, body: UpdateDesignSystemInput) => Promise<any>;
47
55
  export declare const checkRepoIndexingFolder: (sys: DevToolsSys) => Promise<boolean>;
56
+ export {};
@@ -2,7 +2,7 @@ import type { DevToolsSys } from "../../types";
2
2
  import type { CLIArgs } from "../index";
3
3
  import { type Credentials } from "../credentials";
4
4
  import type { Component } from "./types";
5
- export declare const displayComponentLibrarySummary: (components: Component[], indexedComponents: Component[], startTime: number, failedComponents: string[] | undefined, isForce: boolean | undefined, designSystemName: string, designSystemId?: string, numIconsIndexed?: number) => void;
5
+ export declare const displayComponentLibrarySummary: (components: Component[], indexedComponents: Component[], startTime: number, failedComponents: string[] | undefined, isForce: boolean | undefined, designSystemName: string, designSystemId?: string | undefined, numIconsIndexed?: number) => void;
6
6
  export interface RepoIndexingDoc {
7
7
  name: string;
8
8
  content: string | {
@@ -18,7 +18,7 @@ export interface RepoIndexingDoc {
18
18
  userId: string;
19
19
  }
20
20
  export declare const runRepoIndexing: (sys: DevToolsSys, args: CLIArgs) => Promise<void>;
21
- export declare const isFeatureAllowed: (credentials: Credentials, debug?: boolean) => Promise<{
21
+ export declare const isFeatureAllowed: (credentials: Credentials, debug?: boolean | undefined) => Promise<{
22
22
  isAllowed: boolean;
23
- reason?: string;
23
+ reason?: string | undefined;
24
24
  }>;
@@ -0,0 +1,6 @@
1
+ import type { RepoMetrics } from "$/ai-utils";
2
+ import type { DevToolsSys } from "../types";
3
+ /**
4
+ * Collect comprehensive repository metrics
5
+ */
6
+ export declare function collectRepoMetrics(sys: DevToolsSys, basePath: string): Promise<RepoMetrics>;
@@ -40,7 +40,7 @@ type SocketEvents = {
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;
43
- handleUpgrade: (req: IncomingMessage, socket: Duplex, upgradeHead: Buffer, callback?: (client: WebSocket, request: IncomingMessage) => void) => Promise<void>;
43
+ handleUpgrade: (req: IncomingMessage, socket: Duplex, upgradeHead: Buffer, callback?: ((client: WebSocket, request: IncomingMessage) => void) | undefined) => Promise<void>;
44
44
  clients: () => Map<string, WebSocket>;
45
45
  register: <T = any>(method: string, fn: RegisterFn<T>) => void;
46
46
  emit: (name: string, ...params: any[]) => void;
@@ -1,6 +1,6 @@
1
1
  export declare const spinner: () => {
2
2
  start: (msg?: string) => void;
3
- stop: (msg?: string, code?: number) => void;
3
+ stop: (msg?: string | undefined, code?: number) => void;
4
4
  message: (msg?: string) => void;
5
5
  extra: (msg?: string) => void;
6
6
  };
@@ -13,7 +13,7 @@ export interface GetAllProjectFilesOptions {
13
13
  deep?: number;
14
14
  gitignore?: boolean;
15
15
  }
16
- export declare function getAllProjectFiles({ basePath, globPattern, extraIgnorePatterns, dot, deep, gitignore, sys, }: GetAllProjectFilesOptions): Promise<string[]>;
16
+ export declare function getAllProjectFiles({ basePath, globPattern, extraIgnorePatterns, dot, deep, gitignore, sys }: GetAllProjectFilesOptions): Promise<string[]>;
17
17
  export declare function findBuilderFiles(basePath: string, targetContentId: string, targetSessionKey: string): Promise<FileNode[]>;
18
18
  export declare function filterNonImportantFiles(files: string[]): string[];
19
19
  export declare function getIgnorePatterns(basePath: string): (path: string) => boolean;
@@ -1,4 +1,4 @@
1
- import type { DevToolsSys } from "types";
1
+ import type { DevToolsSys } from "../../types";
2
2
  import type { Credentials } from "../credentials";
3
3
  import type { GitConfigs } from "$/ai-utils";
4
4
  export interface RunCommandOptions {
@@ -8,9 +8,11 @@ export declare class TerminalBuffer {
8
8
  private currentColumn;
9
9
  private maxLines;
10
10
  private maxColumns;
11
+ private chunks;
11
12
  constructor(maxLines?: number, maxColumns?: number);
12
13
  write(data: string): void;
13
14
  private ensureLineExists;
15
+ getWrite(): string;
14
16
  getContent(): string;
15
17
  clear(): void;
16
18
  /**
@@ -2,7 +2,7 @@ import type { ComponentRegistry, ConnectedBuilder, GetRegistryOptions, LaunchEdi
2
2
  export declare const apiConnectBuilder: (publicApiKey: string, privateAuthKey: string, kind: string | null) => Promise<ConnectedBuilder>;
3
3
  export declare const apiValidateBuilder: () => Promise<ValidatedBuilder>;
4
4
  export declare const apiLaunchEditor: (file: LaunchEditorFile) => Promise<unknown>;
5
- export declare const apiRegistry: (opts?: GetRegistryOptions) => Promise<ComponentRegistry>;
5
+ export declare const apiRegistry: (opts?: GetRegistryOptions | undefined) => Promise<ComponentRegistry>;
6
6
  export declare const apiLoadComponent: (opts: LoadComponentOptions) => Promise<ComponentRegistry>;
7
7
  export declare const apiRegisterComponent: (opts: RegisterComponentOptions) => Promise<ComponentRegistry>;
8
8
  export declare const apiSetComponentInfo: (opts: SetComponentInfoOptions) => Promise<ComponentRegistry>;
@@ -6,7 +6,7 @@ export declare const closeToasts: (shadow: ShadowRoot) => void;
6
6
  export declare const isEditEnabled: () => boolean;
7
7
  export declare const enableEdit: (enable: boolean) => void;
8
8
  export declare const getEditorUrl: () => string;
9
- export declare const getBuilderContentUrl: (contentId?: string | null, blockId?: string | null) => string;
9
+ export declare const getBuilderContentUrl: (contentId?: string | null | undefined, blockId?: string | null | undefined) => string;
10
10
  export declare const DEV_TOOLS_URL = "__DEV_TOOLS_URL__";
11
11
  export declare const APP_STATE: AppState;
12
12
  export declare const updateAppState: (registry: ComponentRegistry) => void;
@@ -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): "array" | "boolean" | "number" | "object" | "string";
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.ArrayLiteralExpression | ts.FalseLiteral | ts.Identifier | ts.NumericLiteral | ts.ObjectLiteralExpression | ts.StringLiteral | ts.TrueLiteral;
@@ -8,7 +8,7 @@ export declare class PrivateError extends Error {
8
8
  * Standardized network error class with structured properties for better diagnostics
9
9
  */
10
10
  export declare class NetworkError extends PrivateError {
11
- constructor({ type, cause, message, suggestions, hostname, port, statusCode, errorCode, }: {
11
+ constructor({ type, cause, message, suggestions, hostname, port, statusCode, errorCode }: {
12
12
  type: NetworkErrorType;
13
13
  cause?: Error;
14
14
  message: string;
@@ -1,8 +1 @@
1
- /**
2
- * Token estimation calculator for OpenAI API
3
- * OpenAI api does not return usage information for some of its apis
4
- * This function returns a rough estimate of the tokens used for a given string
5
- * The function has been copied from webapp and written by @aziz
6
- * Ref: https://github.com/BuilderIO/builder-internal/pull/5255/files
7
- */
8
1
  export declare function estimateCodeTokens(text: string): number;
@@ -11,6 +11,6 @@ export declare function createNextPagesTestFixturesDevTools(sdkVersion?: SDK_VER
11
11
  devTools: import("../../../types").DevToolsAdapter;
12
12
  }>;
13
13
  export declare function createNextAppTestDevTools(): Promise<{
14
- sys: import("../..").DevToolsSys;
14
+ sys: import("@builder.io/dev-tools/node").DevToolsSys;
15
15
  devTools: import("../../../types").DevToolsAdapter;
16
16
  }>;