@builder.io/ai-utils 0.18.0 → 0.18.2
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/package.json +1 -1
- package/src/codegen.d.ts +62 -0
- package/src/completion.d.ts +147 -151
- package/src/events.d.ts +281 -333
- package/src/mapping.d.ts +66 -66
- package/src/messages.d.ts +214 -283
- package/src/messages.js +12 -12
- package/src/organization.d.ts +366 -351
- package/src/projects.d.ts +433 -571
- package/src/projects.js +17 -18
- package/src/repo-indexing.d.ts +96 -114
- package/src/repo-indexing.js +5 -5
- package/src/settings.d.ts +13 -15
- package/src/settings.js +26 -27
- package/src/vscode-tunnel.d.ts +8 -23
- package/src/vscode-tunnel.js +22 -36
package/package.json
CHANGED
package/src/codegen.d.ts
CHANGED
|
@@ -211,6 +211,24 @@ export interface RecordFrameToolInput {
|
|
|
211
211
|
title: string;
|
|
212
212
|
frame: "last-image";
|
|
213
213
|
}
|
|
214
|
+
export interface AddQAReviewComment {
|
|
215
|
+
file_path: string;
|
|
216
|
+
line: number;
|
|
217
|
+
title: string;
|
|
218
|
+
body: string;
|
|
219
|
+
severity: "critical" | "warning" | "info";
|
|
220
|
+
debugInfo?: string;
|
|
221
|
+
}
|
|
222
|
+
export interface AddQAReviewToolInput {
|
|
223
|
+
summary: string;
|
|
224
|
+
comments?: AddQAReviewComment[];
|
|
225
|
+
gif_id: string;
|
|
226
|
+
}
|
|
227
|
+
export interface ReportUIIssueToolInput {
|
|
228
|
+
title: string;
|
|
229
|
+
description: string;
|
|
230
|
+
debugInfo?: string;
|
|
231
|
+
}
|
|
214
232
|
export interface CodeGenToolMap {
|
|
215
233
|
view_path: ReadToolInput;
|
|
216
234
|
glob_search: GlobSearchToolInput;
|
|
@@ -254,6 +272,8 @@ export interface CodeGenToolMap {
|
|
|
254
272
|
ExitPlanMode: ExitPlanModeToolInput;
|
|
255
273
|
ReadMcpResource: ReadMcpResourceToolInput;
|
|
256
274
|
RecordFrame: RecordFrameToolInput;
|
|
275
|
+
AddQAReview: AddQAReviewToolInput;
|
|
276
|
+
ReportUIIssue: ReportUIIssueToolInput;
|
|
257
277
|
}
|
|
258
278
|
export type CodeGenTools = keyof CodeGenToolMap;
|
|
259
279
|
export type AllCodeGenTools = CodeGenTools | "web_search";
|
|
@@ -656,6 +676,7 @@ export interface GenerateCompletionStepDevServerState {
|
|
|
656
676
|
}
|
|
657
677
|
export interface GenerateCompletionStepGit {
|
|
658
678
|
type: "git";
|
|
679
|
+
folderName?: string;
|
|
659
680
|
isSessionDirty: boolean;
|
|
660
681
|
hasGeneratingPlaceholder: boolean;
|
|
661
682
|
remoteBranchExists: boolean;
|
|
@@ -818,6 +839,8 @@ export interface GenerateUserMessage {
|
|
|
818
839
|
enabledMCPs?: string[];
|
|
819
840
|
sessionMode?: SessionMode;
|
|
820
841
|
queue?: boolean;
|
|
842
|
+
/** Enable AddQAReview tool for QA PR review branches */
|
|
843
|
+
enableQAReviewTool?: boolean;
|
|
821
844
|
/** @deprecated */
|
|
822
845
|
repair?: boolean;
|
|
823
846
|
}
|
|
@@ -1058,6 +1081,43 @@ export interface WorkspaceConfiguration {
|
|
|
1058
1081
|
agentsMD?: string;
|
|
1059
1082
|
folders: WorkspaceFolder[];
|
|
1060
1083
|
}
|
|
1084
|
+
/**
|
|
1085
|
+
* Runtime context for a git-enabled repository.
|
|
1086
|
+
* Used to track multiple git working directories in codegen.
|
|
1087
|
+
*/
|
|
1088
|
+
export interface GitRepoContext {
|
|
1089
|
+
/** Folder name from WorkspaceFolder */
|
|
1090
|
+
folderName: string;
|
|
1091
|
+
/** Absolute path to the repository */
|
|
1092
|
+
path: string;
|
|
1093
|
+
/** Feature branch name */
|
|
1094
|
+
branchName: string;
|
|
1095
|
+
/** Original repo URL */
|
|
1096
|
+
repoUrl?: string;
|
|
1097
|
+
/** Repo name (e.g., owner/repo) */
|
|
1098
|
+
repoName?: string;
|
|
1099
|
+
/**
|
|
1100
|
+
* Initial commit when first checked
|
|
1101
|
+
*/
|
|
1102
|
+
initialCommit?: string;
|
|
1103
|
+
}
|
|
1104
|
+
/**
|
|
1105
|
+
* Result from a multi-repo git operation.
|
|
1106
|
+
*/
|
|
1107
|
+
export interface MultiRepoOperationResult<T = unknown> {
|
|
1108
|
+
/** True if all repos succeeded */
|
|
1109
|
+
success: boolean;
|
|
1110
|
+
/** True if some succeeded and some failed */
|
|
1111
|
+
partialSuccess: boolean;
|
|
1112
|
+
/** Per-repo results */
|
|
1113
|
+
results: Array<{
|
|
1114
|
+
folderName: string;
|
|
1115
|
+
success: boolean;
|
|
1116
|
+
result?: T;
|
|
1117
|
+
error?: Error;
|
|
1118
|
+
message?: string;
|
|
1119
|
+
}>;
|
|
1120
|
+
}
|
|
1061
1121
|
export type Permission = "read" | "write" | "list";
|
|
1062
1122
|
export interface AclEntry {
|
|
1063
1123
|
action: "allow" | "deny";
|
|
@@ -1402,6 +1462,8 @@ export interface PushChangesOptions {
|
|
|
1402
1462
|
repoFullName: string;
|
|
1403
1463
|
repoUrl: string;
|
|
1404
1464
|
};
|
|
1465
|
+
/** If specified, only push changes for this folder (multi-repo support) */
|
|
1466
|
+
folderName?: string;
|
|
1405
1467
|
}
|
|
1406
1468
|
export interface SyncChangesFromRemote {
|
|
1407
1469
|
remoteBranches?: "both" | "main" | "ai";
|
package/src/completion.d.ts
CHANGED
|
@@ -1,158 +1,154 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
BuilderContent,
|
|
3
|
-
BuilderElement,
|
|
4
|
-
Component,
|
|
5
|
-
} from "@builder.io/sdk";
|
|
1
|
+
import type { BuilderContent, BuilderElement, Component } from "@builder.io/sdk";
|
|
6
2
|
import type { Message, MessageParam, Attachment } from "./messages.js";
|
|
7
3
|
import type { BuilderModel } from "./events.js";
|
|
8
4
|
export type { BuilderContent, BuilderElement, Component };
|
|
9
5
|
export interface CompletionOptions {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
6
|
+
/**
|
|
7
|
+
* How this assistant is being used. For example, "content-editor"
|
|
8
|
+
* is used when the assistant is being used in the Builder.io content editor.
|
|
9
|
+
*/
|
|
10
|
+
assistantType?: string;
|
|
11
|
+
/**
|
|
12
|
+
* LLM Model identifier to lookup which sdk and model to use.
|
|
13
|
+
* If not provided the default model will be used.
|
|
14
|
+
* Note: This is not the Builder.io data model.
|
|
15
|
+
*/
|
|
16
|
+
modelId?: string;
|
|
17
|
+
/**
|
|
18
|
+
* The unique LOCAL identifier of the thread to submit the user message to.
|
|
19
|
+
* This is used to identify the thread with our own id (openai assistant id is different)
|
|
20
|
+
*/
|
|
21
|
+
id: string;
|
|
22
|
+
/**
|
|
23
|
+
* The unique OPENAI assistant id of the thread to submit the user message to.
|
|
24
|
+
* If the assistantThreadId is not provided, a new thread will be created.
|
|
25
|
+
*/
|
|
26
|
+
assistantThreadId?: string;
|
|
27
|
+
/**
|
|
28
|
+
* The message history of the conversation, user prompt then assistant response.
|
|
29
|
+
* The messages are ordered from oldest to newest. The last message in the array
|
|
30
|
+
* is the message that the user has just sent.
|
|
31
|
+
*/
|
|
32
|
+
messages: (MessageParam | Message)[];
|
|
33
|
+
/**
|
|
34
|
+
* Which platform (framework) the the user has choosen to get help with.
|
|
35
|
+
*/
|
|
36
|
+
platformId?: string;
|
|
37
|
+
/**
|
|
38
|
+
* The user id of the user sending the message.
|
|
39
|
+
* This is used to track the user's progress in the conversation.
|
|
40
|
+
* User id is stored in localStorage for this domain, its not the builder user id.
|
|
41
|
+
*/
|
|
42
|
+
userId: string;
|
|
43
|
+
/**
|
|
44
|
+
* The state of the builder editor.
|
|
45
|
+
*/
|
|
46
|
+
builderState?: BuilderEditorState;
|
|
47
|
+
/**
|
|
48
|
+
* Additional console logs
|
|
49
|
+
*/
|
|
50
|
+
debug?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Date.now() timestamp of when the assistant was started.
|
|
53
|
+
* This is used to calculate the time taken between all events.
|
|
54
|
+
*/
|
|
55
|
+
startMs?: number;
|
|
56
|
+
/**
|
|
57
|
+
* If events should be streamed back throughout the process.
|
|
58
|
+
*
|
|
59
|
+
* Setting to `false` will skip any intermediate processing and emitting
|
|
60
|
+
* events while collecting LLM deltas, but will only emit the final result.
|
|
61
|
+
*
|
|
62
|
+
* Defaults to `true`.
|
|
63
|
+
*/
|
|
64
|
+
stream?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Provide a system prompt id to lookup a pre-defined system prompt
|
|
67
|
+
* text sent to the LLM. Must be a pre-defined system prompt id!
|
|
68
|
+
*/
|
|
69
|
+
systemPromptIds?: {
|
|
70
|
+
"content-edit"?: string;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Option on how this call should handle the conversation thread.
|
|
74
|
+
*
|
|
75
|
+
* `persist`:
|
|
76
|
+
* - When there is no CompletionOptions `id`, it'll create a new thread id
|
|
77
|
+
* - When given an existing `id`, it'll look up the past thread messages and prefix the messages
|
|
78
|
+
*
|
|
79
|
+
* `ephemeral`:
|
|
80
|
+
* - Creates a new conversation each time, ignoring any existing thread history
|
|
81
|
+
* - Will not save the conversation for future use
|
|
82
|
+
*
|
|
83
|
+
* Defaults to `persist`
|
|
84
|
+
*/
|
|
85
|
+
thread?: "persist" | "ephemeral";
|
|
86
|
+
attachments?: Attachment[];
|
|
91
87
|
}
|
|
92
88
|
export interface BuilderEditorState {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
89
|
+
/**
|
|
90
|
+
* The active locale of the builder editor.
|
|
91
|
+
*/
|
|
92
|
+
activeLocale?: string;
|
|
93
|
+
/**
|
|
94
|
+
* The locale of the provided builder content.
|
|
95
|
+
*/
|
|
96
|
+
contentLocale?: string;
|
|
97
|
+
/**
|
|
98
|
+
* Top level Builder content. The data.blocks array contains the BuilderElement.
|
|
99
|
+
*/
|
|
100
|
+
content?: BuilderContent;
|
|
101
|
+
/**
|
|
102
|
+
* Builder custom components.
|
|
103
|
+
*/
|
|
104
|
+
components?: Component[];
|
|
105
|
+
/**
|
|
106
|
+
* Builder design tokens.
|
|
107
|
+
*/
|
|
108
|
+
designTokens?: Record<string, string>;
|
|
109
|
+
/**
|
|
110
|
+
* Builder model. (not the LLM model)
|
|
111
|
+
*/
|
|
112
|
+
model?: BuilderModel;
|
|
113
|
+
/**
|
|
114
|
+
* Other models in the Builder account
|
|
115
|
+
*/
|
|
116
|
+
otherModels?: BuilderModel[];
|
|
117
|
+
/**
|
|
118
|
+
* The URL that the Builder content preview is pointing to.
|
|
119
|
+
*/
|
|
120
|
+
previewUrl?: string;
|
|
121
|
+
/**
|
|
122
|
+
* Selected ids in the builder.
|
|
123
|
+
*/
|
|
124
|
+
selectedIds?: string[];
|
|
125
|
+
/**
|
|
126
|
+
* Builder space id.
|
|
127
|
+
*/
|
|
128
|
+
spaceId?: string;
|
|
129
|
+
/**
|
|
130
|
+
* Builder user id.
|
|
131
|
+
*/
|
|
132
|
+
userId?: string;
|
|
133
|
+
/**
|
|
134
|
+
* Email of the user in the builder.
|
|
135
|
+
*/
|
|
136
|
+
userEmail?: string;
|
|
137
|
+
/**
|
|
138
|
+
* User's jobs
|
|
139
|
+
*/
|
|
140
|
+
userJobs?: string[];
|
|
141
|
+
/**
|
|
142
|
+
* Builder session id.
|
|
143
|
+
*/
|
|
144
|
+
sessionId?: string;
|
|
145
|
+
/**
|
|
146
|
+
* Custom instructions that could be add into the prompt.
|
|
147
|
+
*/
|
|
148
|
+
customInstructions?: Record<string, string>;
|
|
149
|
+
styleInspirationURL?: string;
|
|
150
|
+
/**
|
|
151
|
+
* All targeting attributes of the content.
|
|
152
|
+
*/
|
|
153
|
+
allTargetingAttributes?: Record<string, any>;
|
|
158
154
|
}
|