builder.io 1.6.40 → 1.6.42
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 +485 -488
- 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 +2 -2
- package/server/index.cjs +77 -77
- package/server/index.mjs +77 -77
- package/types/cli/code-tools.d.ts +2 -1
- package/types/cli/codegen.d.ts +36 -4
- package/types/cli/launch/github.d.ts +20 -0
- package/types/cli/launch/helpers.d.ts +2 -1
- package/types/cli/launch.d.ts +0 -4
- package/types/cli/track.d.ts +2 -1
- package/types/tsconfig.tsbuildinfo +1 -1
|
@@ -12,12 +12,13 @@ export interface ToolResolution {
|
|
|
12
12
|
isError: boolean;
|
|
13
13
|
title?: string;
|
|
14
14
|
}
|
|
15
|
+
export type CommitMode = "commits" | "draft-prs" | "prs";
|
|
15
16
|
export interface ProvidedToolContext {
|
|
16
17
|
commandCtx?: RunCommandCtx;
|
|
17
18
|
checkCommand?: string;
|
|
18
19
|
localServerUrl?: string;
|
|
19
20
|
allowedCommands?: RegExp[];
|
|
20
|
-
commitMode?:
|
|
21
|
+
commitMode?: CommitMode;
|
|
21
22
|
}
|
|
22
23
|
export interface ToolContext extends ProvidedToolContext {
|
|
23
24
|
sys: DevToolsSys;
|
package/types/cli/codegen.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { DevToolsSys } from "../types";
|
|
2
2
|
import type { CLIArgs } from "./index";
|
|
3
3
|
import { type Credentials } from "./credentials";
|
|
4
|
-
import type { CodegenTurn, CustomInstruction, GenerateCompletionState, GenerateCompletionStep, GenerateUserMessage, UserContext } from "$/ai-utils";
|
|
4
|
+
import type { CodegenFeedback, CodegenTurn, CustomInstruction, GenerateCompletionState, GenerateCompletionStep, GenerateUserMessage, UserContext } from "$/ai-utils";
|
|
5
5
|
import prettier from "prettier";
|
|
6
|
-
import { type ProvidedToolContext } from "./code-tools";
|
|
6
|
+
import { type CommitMode, type ProvidedToolContext } from "./code-tools";
|
|
7
7
|
export interface RunCommandCtx {
|
|
8
8
|
command: string;
|
|
9
9
|
state: "running" | "stopped";
|
|
@@ -59,6 +59,38 @@ export declare class CodeGenSession {
|
|
|
59
59
|
constructor(options: CodeGenSessionOptions);
|
|
60
60
|
get workingDirectory(): string;
|
|
61
61
|
initializeSession(): Promise<void>;
|
|
62
|
+
setRepoUrl(repoUrl: string): void;
|
|
63
|
+
setPrUrl(prUrl: string): void;
|
|
64
|
+
pushRepo(repoFullName: string, githubToken: string): Promise<{
|
|
65
|
+
success: boolean;
|
|
66
|
+
error: string;
|
|
67
|
+
details?: undefined;
|
|
68
|
+
} | {
|
|
69
|
+
success: boolean;
|
|
70
|
+
error?: undefined;
|
|
71
|
+
details?: undefined;
|
|
72
|
+
} | {
|
|
73
|
+
success: boolean;
|
|
74
|
+
error: string;
|
|
75
|
+
details: string;
|
|
76
|
+
}>;
|
|
77
|
+
createPR(repoFullName: string, githubToken: string, branchName: string): Promise<{
|
|
78
|
+
success: boolean;
|
|
79
|
+
prUrl: any;
|
|
80
|
+
prNumber: any;
|
|
81
|
+
error?: undefined;
|
|
82
|
+
details?: undefined;
|
|
83
|
+
} | {
|
|
84
|
+
success: boolean;
|
|
85
|
+
error: string;
|
|
86
|
+
details: unknown;
|
|
87
|
+
prUrl?: undefined;
|
|
88
|
+
prNumber?: undefined;
|
|
89
|
+
}>;
|
|
90
|
+
setCommitMode(commitMode: CommitMode): void;
|
|
91
|
+
pushChanges(pullFirst?: boolean): Promise<void>;
|
|
92
|
+
hasChangesRelativeToRemote(): Promise<boolean>;
|
|
93
|
+
pullLatestFromRemote(): Promise<void>;
|
|
62
94
|
/**
|
|
63
95
|
* Get the current commit hash
|
|
64
96
|
*/
|
|
@@ -112,7 +144,7 @@ export declare class CodeGenSession {
|
|
|
112
144
|
getLastTurn(): CodegenTurn | undefined;
|
|
113
145
|
getNextUrl(): string | undefined;
|
|
114
146
|
getNextMessage(): Promise<GenerateUserMessage>;
|
|
115
|
-
sendFeedback(
|
|
147
|
+
sendFeedback(feedback: Partial<CodegenFeedback>): Promise<void>;
|
|
116
148
|
lastTurnHasChanges(): Promise<boolean>;
|
|
117
149
|
sendMessage(message: GenerateUserMessage, immediate?: boolean): void;
|
|
118
150
|
getTurns(): CodegenTurn[];
|
|
@@ -120,7 +152,7 @@ export declare class CodeGenSession {
|
|
|
120
152
|
abort(): void;
|
|
121
153
|
stopEventLoop(): Promise<void>;
|
|
122
154
|
close(): Promise<void>;
|
|
123
|
-
connectToEventLoop(shouldReplay: boolean, onStep: (step: GenerateCompletionStep) => void): () => void
|
|
155
|
+
connectToEventLoop(shouldReplay: boolean, onStep: (step: GenerateCompletionStep) => void): Promise<() => void>;
|
|
124
156
|
waitForEventLoop(): Promise<void>;
|
|
125
157
|
agentCompletion(userMessage: GenerateUserMessage, signal: AbortSignal | undefined, onStep: (step: GenerateCompletionStep) => void): Promise<void>;
|
|
126
158
|
commitWorkInProgress(lastTurn: CodegenTurn): Promise<string | undefined>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { DevToolsSys } from "@builder.io/dev-tools/core";
|
|
2
|
+
import type { Credentials } from "cli/credentials";
|
|
3
|
+
import type { LaunchArgs } from "cli/launch";
|
|
4
|
+
export declare const getInitialDescription: (projectId: string) => string;
|
|
5
|
+
export declare function updatePRDescription({ repoFullName, githubToken, prNumber, projectId, sys, credentials, args, builderProjectBranchName, }: {
|
|
6
|
+
repoFullName: string;
|
|
7
|
+
githubToken: string;
|
|
8
|
+
prNumber: number;
|
|
9
|
+
projectId: string | undefined;
|
|
10
|
+
sys: DevToolsSys;
|
|
11
|
+
credentials: Credentials;
|
|
12
|
+
args: LaunchArgs;
|
|
13
|
+
builderProjectBranchName: string | undefined;
|
|
14
|
+
}): Promise<{
|
|
15
|
+
success: boolean;
|
|
16
|
+
lastTurn: any;
|
|
17
|
+
responseText: string;
|
|
18
|
+
generatedTitle: string;
|
|
19
|
+
generatedDescription: string;
|
|
20
|
+
}>;
|
|
@@ -70,4 +70,5 @@ export declare const getGitHubRemoteUrl: ({ repoFullName, githubToken, }: {
|
|
|
70
70
|
repoFullName: string;
|
|
71
71
|
githubToken: string | undefined;
|
|
72
72
|
}) => string;
|
|
73
|
-
export declare const
|
|
73
|
+
export declare const getActiveBranchCommand: () => string;
|
|
74
|
+
export declare const getActiveBranch: (cwd?: string) => string;
|
package/types/cli/launch.d.ts
CHANGED
|
@@ -4,10 +4,6 @@ import type { CLIArgs } from "./index";
|
|
|
4
4
|
* Large random-ish port number that is unlikely to be used
|
|
5
5
|
*/
|
|
6
6
|
export declare const PROXY_PORT = 48752;
|
|
7
|
-
/**
|
|
8
|
-
* Maximum number of attempts to generate PR description
|
|
9
|
-
*/
|
|
10
|
-
export declare const MAX_PR_CONTENT_ATTEMPTS = 2;
|
|
11
7
|
export interface LaunchArgs extends CLIArgs {
|
|
12
8
|
cwdAgent?: string;
|
|
13
9
|
/** Fusion project ID */
|
package/types/cli/track.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as Amplitude from "@amplitude/analytics-node";
|
|
2
|
-
|
|
2
|
+
import * as Sentry from "@sentry/node";
|
|
3
|
+
export declare function initTracking(verbose: boolean): Promise<typeof Sentry>;
|
|
3
4
|
export declare function track(eventName: string, options: Record<string, any>): Promise<Amplitude.Types.Result>;
|
|
4
5
|
export declare function setUserId(id: string): Promise<void>;
|