@builder.io/dev-tools 1.21.10-dev.202601270922.8e39b4484 → 1.21.10-dev.202601271540.a8a64e4cc
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 +507 -866
- package/cli/index.cjs.map +3 -3
- package/cli/pkg-entry.cjs +149 -0
- 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 +2 -2
- package/server/index.mjs +2 -2
- package/types/cli/codegen.d.ts +13 -44
- package/types/cli/utils/browser-qa-agent.d.ts +2 -0
- package/types/cli/utils/codegen-utils.d.ts +2 -2
- package/types/common/ast/component-input-types.d.ts +1 -1
- package/types/tsconfig.tsbuildinfo +1 -1
- package/types/cli/indexing.d.ts +0 -5
- package/types/cli/launch/github.d.ts +0 -3
- package/types/cli/repo-indexing.d.ts +0 -17
- package/types/cli/repo-indexing.mock.d.ts +0 -5
- package/types/cli/utils/dev-server-url-parser.d.ts +0 -12
- package/types/cli/utils/dev-server-url-parser.test.d.ts +0 -1
- package/types/cli/utils/repo-indexing-group-prompts.d.ts +0 -1
- package/types/scripts/analyze-projects.d.ts +0 -18
- package/types/scripts/call-ensure-container.d.ts +0 -4
- package/types/scripts/check-backup.d.ts +0 -1
- package/types/scripts/cli.d.ts +0 -1
- package/types/scripts/download-projects.d.ts +0 -12
- package/types/scripts/utils/db.d.ts +0 -3
- package/types/scripts/utils/ensure-container.d.ts +0 -7
- package/types/scripts/utils/remove-machine-and-volume.d.ts +0 -5
package/types/cli/codegen.d.ts
CHANGED
|
@@ -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, SessionMode, UserContext, UserSource, WorkspaceFolder, LoadWholeSessionOptions, LoadWholeSessionResult, LoadHistoryResult, CodeGenMode, ApplyActionsResult, PrivacyMode, CodeGenPosition, BackupGitRepoResult, SuggestedActionBuildError, PushChangesArgs, CodegenApiResult, CodegenApiTerminal, ConfigureDevOrchestratorOpts, ConfigureDevOrchestratorUpdates, RepoMetrics, FolderWatchEvent, MCPServerConfig, CodegenApiCreateTerminal, SyncChangesFromRemote, SearchFilesOptions, SearchFilesResult, SearchFileTreeOptions, SearchFileTreeResult, ExplorationMetadataToolInput, CodegenAbortOptions, MessageUpdateOptions,
|
|
3
|
+
import type { CodegenFeedback, CodeGenToolMap, CodegenTurn, CustomInstruction, FusionConfig, GenerateCompletionState, GenerateCompletionStep, GenerateCompletionStepGit, GenerateUserMessage, SessionMode, UserContext, UserSource, WorkspaceFolder, LoadWholeSessionOptions, LoadWholeSessionResult, LoadHistoryResult, CodeGenMode, ApplyActionsResult, PrivacyMode, CodeGenPosition, BackupGitRepoResult, SuggestedActionBuildError, PushChangesArgs, CodegenApiResult, CodegenApiTerminal, ConfigureDevOrchestratorOpts, ConfigureDevOrchestratorUpdates, RepoMetrics, FolderWatchEvent, MCPServerConfig, CodegenApiCreateTerminal, SyncChangesFromRemote, SearchFilesOptions, SearchFilesResult, SearchFileTreeOptions, SearchFileTreeResult, ExplorationMetadataToolInput, CodegenAbortOptions, MessageUpdateOptions, SystemReminderObj } from "$/ai-utils";
|
|
4
4
|
import { type FusionContext, type ToolResolution } from "./code-tools";
|
|
5
5
|
import { type SubAgent } from "./utils/agent-discovery";
|
|
6
6
|
import EventEmitter from "node:events";
|
|
@@ -12,12 +12,6 @@ export interface SyncChangesFromBranches {
|
|
|
12
12
|
allowUnrelatedHistory: boolean;
|
|
13
13
|
fastForward: "never" | "required" | "auto";
|
|
14
14
|
requestRefresh?: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* When true, compute the remote branch per-repo using #getRemoteBranch(ctx)
|
|
17
|
-
* instead of using the passed branches array. This handles multi-repo
|
|
18
|
-
* scenarios where each repo may have a different feature branch.
|
|
19
|
-
*/
|
|
20
|
-
syncRemoteBranch?: boolean;
|
|
21
15
|
}
|
|
22
16
|
export interface SessionContext {
|
|
23
17
|
sessionId: string;
|
|
@@ -75,12 +69,7 @@ export declare class CodeGenSession {
|
|
|
75
69
|
#private;
|
|
76
70
|
constructor(options: CodeGenSessionOptions);
|
|
77
71
|
get fusionConfig(): FusionConfig | undefined;
|
|
78
|
-
/** Returns the first git-enabled folder for backwards compatibility */
|
|
79
72
|
get gitEnabledFolder(): WorkspaceFolder | undefined;
|
|
80
|
-
/** Returns all git-enabled folders */
|
|
81
|
-
get gitEnabledFolders(): WorkspaceFolder[];
|
|
82
|
-
/** Returns runtime git repo contexts for all enabled repos */
|
|
83
|
-
get gitRepoContexts(): readonly GitRepoContext[];
|
|
84
73
|
get workingDirectory(): string;
|
|
85
74
|
getSessionMode(): SessionMode;
|
|
86
75
|
switchSessionMode(newMode: SessionMode): Promise<void>;
|
|
@@ -134,8 +123,8 @@ export declare class CodeGenSession {
|
|
|
134
123
|
/**
|
|
135
124
|
* Get the current commit hash
|
|
136
125
|
*/
|
|
137
|
-
getCurrentCommitHash(branchName?: string
|
|
138
|
-
getCurrentBranch(
|
|
126
|
+
getCurrentCommitHash(branchName?: string): Promise<string | undefined>;
|
|
127
|
+
getCurrentBranch(): Promise<string>;
|
|
139
128
|
/**
|
|
140
129
|
* Get the feature branch name
|
|
141
130
|
*/
|
|
@@ -144,7 +133,7 @@ export declare class CodeGenSession {
|
|
|
144
133
|
* Get the AI branch name
|
|
145
134
|
*/
|
|
146
135
|
getAiBranch(): string;
|
|
147
|
-
git(args: string[], opts?: string |
|
|
136
|
+
git(args: string[], opts?: string | RunCommandOptions): Promise<string>;
|
|
148
137
|
setDebug(debug: boolean): void;
|
|
149
138
|
createTerminal(options?: CodegenApiCreateTerminal): Promise<CodegenApiTerminal>;
|
|
150
139
|
emitTerminals(): void;
|
|
@@ -194,7 +183,6 @@ export declare class CodeGenSession {
|
|
|
194
183
|
searchFileTree(options: SearchFileTreeOptions): Promise<SearchFileTreeResult>;
|
|
195
184
|
collectRepoMetrics(opts?: {
|
|
196
185
|
rootPath?: string;
|
|
197
|
-
folderName?: string;
|
|
198
186
|
}): Promise<RepoMetrics>;
|
|
199
187
|
getSessionId(): string;
|
|
200
188
|
getSpaceId(): string | undefined;
|
|
@@ -323,7 +311,6 @@ export declare class CodeGenSession {
|
|
|
323
311
|
manualCommit(options: {
|
|
324
312
|
add: string;
|
|
325
313
|
commitMessage: string;
|
|
326
|
-
folderName?: string;
|
|
327
314
|
}): Promise<boolean>;
|
|
328
315
|
getLastSuggestedAction(): SuggestedActionBuildError | undefined;
|
|
329
316
|
connectToEventLoop(shouldReplay: boolean, onStep: (step: GenerateCompletionStep) => void): () => void;
|
|
@@ -331,12 +318,12 @@ export declare class CodeGenSession {
|
|
|
331
318
|
waitUntilBlockingPendingPromises(): Promise<void>;
|
|
332
319
|
waitUntilIdle(): Promise<void>;
|
|
333
320
|
waitForEventLoop(): Promise<void>;
|
|
334
|
-
commitWorkInProgress(lastTurn: CodegenTurn, changedFiles: string[]): Promise<string | false>;
|
|
321
|
+
commitWorkInProgress(lastTurn: CodegenTurn, changedFiles: string[]): Promise<string | false | undefined>;
|
|
335
322
|
getChangesReport(): Promise<{
|
|
336
323
|
diff: string;
|
|
337
324
|
files: string[];
|
|
338
325
|
} | undefined>;
|
|
339
|
-
isCleanWorkTree(
|
|
326
|
+
isCleanWorkTree(): Promise<boolean>;
|
|
340
327
|
/**
|
|
341
328
|
* Resolves a workspace file path to its actual file system path
|
|
342
329
|
* @param filePath A file path that may include a workspace prefix (e.g., "workspace1/path/to/file.js")
|
|
@@ -380,33 +367,23 @@ export declare class CodeGenSession {
|
|
|
380
367
|
* @param gitRef - The git reference (branch, commit, tag) - defaults to parent branch
|
|
381
368
|
* @returns The file content at that reference, or null if not found
|
|
382
369
|
*/
|
|
383
|
-
getFileAtRef(filePath: string, gitRef?: string
|
|
370
|
+
getFileAtRef(filePath: string, gitRef?: string): Promise<string | null>;
|
|
384
371
|
/**
|
|
385
372
|
* Gets the diff information for a single file including full content
|
|
386
|
-
* @param
|
|
387
|
-
* @param opts.path - The file path, can be folder-prefixed (e.g., 'builder-anime-works/client/App.tsx') or relative
|
|
388
|
-
* @param opts.folderName - Optional folder name (deprecated, prefer folder-prefixed path)
|
|
373
|
+
* @param filePath - The file path to get diff for
|
|
389
374
|
* @returns Object with oldContent (from parent branch) and newContent (current)
|
|
390
375
|
*/
|
|
391
|
-
getSingleFileDiff(
|
|
392
|
-
path: string;
|
|
393
|
-
folderName?: string;
|
|
394
|
-
} | string): Promise<{
|
|
376
|
+
getSingleFileDiff(filePath: string): Promise<{
|
|
395
377
|
oldContent: string | null;
|
|
396
378
|
newContent: string | null;
|
|
397
379
|
action: "create" | "update" | "delete";
|
|
398
380
|
}>;
|
|
399
381
|
/**
|
|
400
382
|
* Discards changes for a specific file by creating a revert commit
|
|
401
|
-
* @param
|
|
402
|
-
* @param opts.filePath - The file path, can be folder-prefixed (e.g., 'builder-anime-works/client/App.tsx')
|
|
403
|
-
* @param opts.folderName - Optional folder name (deprecated, prefer folder-prefixed path)
|
|
383
|
+
* @param filePath - The file path to discard changes for
|
|
404
384
|
* @returns success status, commit hash for reverting, and optional error message
|
|
405
385
|
*/
|
|
406
|
-
discardFileChanges(
|
|
407
|
-
filePath: string;
|
|
408
|
-
folderName?: string;
|
|
409
|
-
} | string): Promise<{
|
|
386
|
+
discardFileChanges(filePath: string): Promise<{
|
|
410
387
|
success: boolean;
|
|
411
388
|
commitHash?: string;
|
|
412
389
|
error?: string;
|
|
@@ -414,12 +391,10 @@ export declare class CodeGenSession {
|
|
|
414
391
|
/**
|
|
415
392
|
* Reverts a discard commit using git revert
|
|
416
393
|
* @param commitHash - The commit hash to revert
|
|
417
|
-
* @param folderName - Optional folder name to target specific repo (more efficient)
|
|
418
394
|
* @returns success status and optional error message
|
|
419
395
|
*/
|
|
420
396
|
revertDiscard(options: {
|
|
421
397
|
commitHash: string;
|
|
422
|
-
folderName?: string;
|
|
423
398
|
}): Promise<{
|
|
424
399
|
success: boolean;
|
|
425
400
|
error?: string;
|
|
@@ -481,13 +456,11 @@ export declare class CodeGenSession {
|
|
|
481
456
|
* @param numberOfContextLines - Optional number of context lines to include in the diff
|
|
482
457
|
* @param includeFilesOnly - If true, only return filePath and action properties
|
|
483
458
|
* @param filePaths - Optional array of file paths to limit the diff to specific files
|
|
484
|
-
* @param folderName - Optional folder name to specify which repo to get diff from
|
|
485
459
|
*/
|
|
486
|
-
getDiffFromRemote({ numberOfContextLines, includeFilesOnly, filePaths,
|
|
460
|
+
getDiffFromRemote({ numberOfContextLines, includeFilesOnly, filePaths, }: {
|
|
487
461
|
numberOfContextLines?: number;
|
|
488
462
|
includeFilesOnly?: boolean;
|
|
489
463
|
filePaths?: Array<string>;
|
|
490
|
-
folderName?: string;
|
|
491
464
|
}): Promise<ApplyActionsResult[]>;
|
|
492
465
|
/**
|
|
493
466
|
* Get git diff based on the specified mode
|
|
@@ -495,14 +468,12 @@ export declare class CodeGenSession {
|
|
|
495
468
|
* @param numberOfContextLines - Optional number of context lines to include in the diff (e.g., 999 for -U999)
|
|
496
469
|
* @param includeFilesOnly - If true, only return filePath and action properties
|
|
497
470
|
* @param filePaths - Optional array of file paths to limit the diff to specific files
|
|
498
|
-
* @param folderName - Optional folder name to specify which repo to get diff from
|
|
499
471
|
*/
|
|
500
|
-
getDiff({ mode, numberOfContextLines, includeFilesOnly, filePaths,
|
|
472
|
+
getDiff({ mode, numberOfContextLines, includeFilesOnly, filePaths, }: {
|
|
501
473
|
mode: "remote-parent-branch" | "remote-current-branch";
|
|
502
474
|
numberOfContextLines?: number;
|
|
503
475
|
includeFilesOnly?: boolean;
|
|
504
476
|
filePaths?: Array<string>;
|
|
505
|
-
folderName?: string;
|
|
506
477
|
}): Promise<{
|
|
507
478
|
state: "error" | "success";
|
|
508
479
|
diff?: ApplyActionsResult[];
|
|
@@ -511,7 +482,6 @@ export declare class CodeGenSession {
|
|
|
511
482
|
/**
|
|
512
483
|
* Get the default branch name from remote repository
|
|
513
484
|
* Falls back to checking common default branch names
|
|
514
|
-
* @param repoPath - Optional repo path to check default branch for
|
|
515
485
|
*/
|
|
516
486
|
private getDefaultBranch;
|
|
517
487
|
/**
|
|
@@ -519,7 +489,6 @@ export declare class CodeGenSession {
|
|
|
519
489
|
* @param numberOfContextLines - Optional number of context lines to include in the diff
|
|
520
490
|
* @param includeFilesOnly - If true, only return filePath and action properties
|
|
521
491
|
* @param filePaths - Optional array of file paths to limit the diff to specific files
|
|
522
|
-
* @param folderName - Optional folder name to specify which repo to get diff from
|
|
523
492
|
*/
|
|
524
493
|
private getDiffFromParentBranch;
|
|
525
494
|
}
|
|
@@ -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,
|
|
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,7 +80,7 @@ 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,
|
|
83
|
+
export declare function generateGitStatusReminder(gitStatus: GenerateCompletionStepGit, gitEnabledFolder: WorkspaceFolder | undefined, context: {
|
|
84
84
|
trigger: "session-start" | "sync-success" | "push-success" | "pull-success";
|
|
85
85
|
syncedBranches?: string[];
|
|
86
86
|
pushedToRemote?: boolean;
|
|
@@ -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): "
|
|
20
|
+
export declare function getPrimitiveType(t: string): "number" | "string" | "boolean" | "object" | "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;
|