builder.io 1.10.25 → 1.11.0
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 +274 -278
- 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 +44 -44
- package/server/index.mjs +45 -45
- package/types/cli/code-tools.d.ts +2 -2
- package/types/cli/codegen.d.ts +22 -3
- package/types/cli/repo-indexing/types.d.ts +1 -0
- package/types/tsconfig.tsbuildinfo +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CodeGenTools, CodegenTurn, ContentMessageItemToolResult, FusionConfig, GenerateCompletionStep, ProjectFile, UserSource, WorkspaceFolder } from "$/ai-utils";
|
|
1
|
+
import type { CodeGenPosition, CodeGenTools, CodegenTurn, ContentMessageItemToolResult, FusionConfig, GenerateCompletionStep, ProjectFile, UserSource, WorkspaceFolder } from "$/ai-utils";
|
|
2
2
|
import type { DevToolsSys } from "../core";
|
|
3
3
|
import { type DevServerOrchestrator } from "./launch/dev-server-orchestrator";
|
|
4
4
|
import type { CodeGenEventEmitter } from "./codegen";
|
|
@@ -25,7 +25,7 @@ export interface ToolContext extends Partial<FusionContext> {
|
|
|
25
25
|
credentials: Credentials;
|
|
26
26
|
files: ProjectFile[];
|
|
27
27
|
user: UserSource;
|
|
28
|
-
position:
|
|
28
|
+
position: CodeGenPosition;
|
|
29
29
|
emitter: CodeGenEventEmitter;
|
|
30
30
|
fusionConfig: FusionConfig | undefined;
|
|
31
31
|
canCollapseWorkspace: boolean;
|
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, UserContext, WorkspaceConfiguration, WorkspaceFolder, LoadWholeSessionOptions, LoadWholeSessionResult, LoadHistoryResult, CodeGenMode, ApplyActionsResult, PrivacyMode } 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 } 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";
|
|
@@ -21,7 +21,7 @@ export interface SessionContext {
|
|
|
21
21
|
export interface CodeGenSessionOptionsBase {
|
|
22
22
|
sys: DevToolsSys;
|
|
23
23
|
credentials: Credentials;
|
|
24
|
-
position:
|
|
24
|
+
position: CodeGenPosition;
|
|
25
25
|
maxTokens?: number;
|
|
26
26
|
mode: CodeGenMode;
|
|
27
27
|
privacyMode?: PrivacyMode;
|
|
@@ -317,13 +317,32 @@ export declare class CodeGenSession {
|
|
|
317
317
|
/**
|
|
318
318
|
* Get git diff between current commit and remote branch
|
|
319
319
|
* If remote current branch doesn't exist, gets diff between default branch and current branch
|
|
320
|
+
* @param numberOfContextLines - Optional number of context lines to include in the diff
|
|
320
321
|
*/
|
|
321
|
-
getDiffFromRemote(): Promise<ApplyActionsResult[]>;
|
|
322
|
+
getDiffFromRemote(numberOfContextLines?: number): Promise<ApplyActionsResult[]>;
|
|
323
|
+
/**
|
|
324
|
+
* Get git diff based on the specified mode
|
|
325
|
+
* @param mode - The diff mode: 'previous-commit', 'parent-branch', or 'remote'
|
|
326
|
+
* @param numberOfContextLines - Optional number of context lines to include in the diff (e.g., 999 for -U999)
|
|
327
|
+
*/
|
|
328
|
+
getDiff({ mode, numberOfContextLines, }: {
|
|
329
|
+
mode: "remote-parent-branch" | "remote-current-branch";
|
|
330
|
+
numberOfContextLines?: number;
|
|
331
|
+
}): Promise<{
|
|
332
|
+
state: "error" | "success";
|
|
333
|
+
diff?: ApplyActionsResult[];
|
|
334
|
+
error?: Error;
|
|
335
|
+
}>;
|
|
322
336
|
/**
|
|
323
337
|
* Get the default branch name from remote repository
|
|
324
338
|
* Falls back to checking common default branch names
|
|
325
339
|
*/
|
|
326
340
|
private getDefaultBranch;
|
|
341
|
+
/**
|
|
342
|
+
* Get git diff between current branch and its parent branch (main/master)
|
|
343
|
+
* @param numberOfContextLines - Optional number of context lines to include in the diff
|
|
344
|
+
*/
|
|
345
|
+
private getDiffFromParentBranch;
|
|
327
346
|
}
|
|
328
347
|
export declare function getUserContext(sys: DevToolsSys, gitWorkingDirectory?: string): Promise<UserContext>;
|
|
329
348
|
export declare function makeAsyncIterator<T>(): readonly [AsyncGenerator<T, void, void>, (event: T) => void, () => void];
|