@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/src/events.d.ts
CHANGED
|
@@ -2,139 +2,92 @@ import type { BuilderContent, BuilderElement } from "@builder.io/sdk";
|
|
|
2
2
|
import type { AssistantMessage, AssistantMessageAction } from "./messages.js";
|
|
3
3
|
import type { AssistantSettings } from "./settings.js";
|
|
4
4
|
export type BuilderAssistantEventHandler = (ev: BuilderAssistantEvent) => void;
|
|
5
|
-
export type BuilderAssistantEvent =
|
|
6
|
-
| AssistantCompletionResultEvent
|
|
7
|
-
| AssistantErrorEvent
|
|
8
|
-
| AssistantStreamErrorEvent
|
|
9
|
-
| AppCloseEvent
|
|
10
|
-
| AppMessagesClickEvent
|
|
11
|
-
| AppMessagesGenerationEvent
|
|
12
|
-
| AppMessageEditCustomInstructionsEvent
|
|
13
|
-
| AppPromptAbortEvent
|
|
14
|
-
| AppPromptFocusEvent
|
|
15
|
-
| AppPromptSubmitEvent
|
|
16
|
-
| AppReadyEvent
|
|
17
|
-
| AppSettingsSetEvent
|
|
18
|
-
| AppThreadNewEvent
|
|
19
|
-
| AssistantStatsEvent
|
|
20
|
-
| AssistantThemeEvent
|
|
21
|
-
| BuilderEditorAuthEvent
|
|
22
|
-
| BuilderEditorStateEvent
|
|
23
|
-
| ContentUpdateEvent
|
|
24
|
-
| ContentApplySnapshotEvent
|
|
25
|
-
| ModelUndoEvent
|
|
26
|
-
| ModelRedoEvent
|
|
27
|
-
| ResultEvent
|
|
28
|
-
| ThreadCreatedEvent
|
|
29
|
-
| ThreadMessageCompletedEvent
|
|
30
|
-
| ThreadMessageCreatedEvent
|
|
31
|
-
| ThreadMessageDeltaEvent
|
|
32
|
-
| ThreadMessageFeedbackEvent
|
|
33
|
-
| ThreadRunStepCreatedEvent
|
|
34
|
-
| ThreadRunStepDeltaEvent
|
|
35
|
-
| AppAcceptChangeEvent
|
|
36
|
-
| AppAcceptRejectEvent
|
|
37
|
-
| AssistantTrackEvent
|
|
38
|
-
| AssistantEditorAuthMessage
|
|
39
|
-
| AppAttachmentTemplateEvent
|
|
40
|
-
| AppPasteSmartExportEvent
|
|
41
|
-
| ThreadMessageRetryEvent
|
|
42
|
-
| AppFigmaImportEvent
|
|
43
|
-
| AppWebImportEvent
|
|
44
|
-
| AppMcpServersEvent
|
|
45
|
-
| AssistantContentInitialEvent
|
|
46
|
-
| ThreadMessageSummaryEvent
|
|
47
|
-
| ThreadMessageSummaryCodegenDeltaEvent
|
|
48
|
-
| ThreadMessageThinkingDeltaEvent
|
|
49
|
-
| AssistantHeartbeatEvent
|
|
50
|
-
| ShowUpgradeDialogEvent
|
|
51
|
-
| AssistantFusionSuggestionEvent
|
|
52
|
-
| AppNavigateToFusionEvent;
|
|
5
|
+
export type BuilderAssistantEvent = AssistantCompletionResultEvent | AssistantErrorEvent | AssistantStreamErrorEvent | AppCloseEvent | AppMessagesClickEvent | AppMessagesGenerationEvent | AppMessageEditCustomInstructionsEvent | AppPromptAbortEvent | AppPromptFocusEvent | AppPromptSubmitEvent | AppReadyEvent | AppSettingsSetEvent | AppThreadNewEvent | AssistantStatsEvent | AssistantThemeEvent | BuilderEditorAuthEvent | BuilderEditorStateEvent | ContentUpdateEvent | ContentApplySnapshotEvent | ModelUndoEvent | ModelRedoEvent | ResultEvent | ThreadCreatedEvent | ThreadMessageCompletedEvent | ThreadMessageCreatedEvent | ThreadMessageDeltaEvent | ThreadMessageFeedbackEvent | ThreadRunStepCreatedEvent | ThreadRunStepDeltaEvent | AppAcceptChangeEvent | AppAcceptRejectEvent | AssistantTrackEvent | AssistantEditorAuthMessage | AppAttachmentTemplateEvent | AppPasteSmartExportEvent | ThreadMessageRetryEvent | AppFigmaImportEvent | AppWebImportEvent | AppMcpServersEvent | AssistantContentInitialEvent | ThreadMessageSummaryEvent | ThreadMessageSummaryCodegenDeltaEvent | ThreadMessageThinkingDeltaEvent | AssistantHeartbeatEvent | ShowUpgradeDialogEvent | AssistantFusionSuggestionEvent | AppNavigateToFusionEvent;
|
|
53
6
|
export interface AssistantCompletionResultEvent {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
7
|
+
type: "assistant.result";
|
|
8
|
+
data: {
|
|
9
|
+
content?: BuilderContent;
|
|
10
|
+
stats?: AssistantStats;
|
|
11
|
+
};
|
|
12
|
+
resolveId?: string;
|
|
60
13
|
}
|
|
61
14
|
export interface AssistantError {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
15
|
+
message: string;
|
|
16
|
+
status?: number;
|
|
17
|
+
actions?: AssistantMessageAction[];
|
|
65
18
|
}
|
|
66
19
|
export interface AssistantErrorEvent {
|
|
67
|
-
|
|
68
|
-
|
|
20
|
+
type: "assistant.error";
|
|
21
|
+
data: AssistantError;
|
|
69
22
|
}
|
|
70
23
|
export interface AssistantStreamErrorEvent {
|
|
71
|
-
|
|
72
|
-
|
|
24
|
+
type: "assistant.stream.error";
|
|
25
|
+
data: AssistantError;
|
|
73
26
|
}
|
|
74
27
|
export interface AppFigmaImportEvent {
|
|
75
|
-
|
|
28
|
+
type: "assistant.app.figmaImport";
|
|
76
29
|
}
|
|
77
30
|
export interface AppWebImportEvent {
|
|
78
|
-
|
|
31
|
+
type: "assistant.app.webImport";
|
|
79
32
|
}
|
|
80
33
|
export interface AppMcpServersEvent {
|
|
81
|
-
|
|
34
|
+
type: "assistant.app.mcpServers";
|
|
82
35
|
}
|
|
83
36
|
export interface AppNavigateToFusionEvent {
|
|
84
|
-
|
|
37
|
+
type: "assistant.app.navigateToFusion";
|
|
85
38
|
}
|
|
86
39
|
export interface AssistantTrackEvent {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
40
|
+
type: "assistant.track";
|
|
41
|
+
data: {
|
|
42
|
+
name: string;
|
|
43
|
+
properties: Record<string, any>;
|
|
44
|
+
};
|
|
92
45
|
}
|
|
93
46
|
export interface AssistantThemeEvent {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
47
|
+
type: "assistant.app.theme.update";
|
|
48
|
+
data: {
|
|
49
|
+
theme: string;
|
|
50
|
+
};
|
|
98
51
|
}
|
|
99
52
|
export interface AppCloseEvent {
|
|
100
|
-
|
|
53
|
+
type: "assistant.app.close";
|
|
101
54
|
}
|
|
102
55
|
export interface AppMessagesClickEvent {
|
|
103
|
-
|
|
56
|
+
type: "assistant.app.messages.click";
|
|
104
57
|
}
|
|
105
58
|
export interface ShowUpgradeDialogEvent {
|
|
106
|
-
|
|
59
|
+
type: "assistant.app.showUpgradeDialog";
|
|
107
60
|
}
|
|
108
61
|
export interface AppAcceptChangeEvent {
|
|
109
|
-
|
|
62
|
+
type: "assistant.app.change.accept";
|
|
110
63
|
}
|
|
111
64
|
export interface AppAcceptRejectEvent {
|
|
112
|
-
|
|
65
|
+
type: "assistant.app.change.reject";
|
|
113
66
|
}
|
|
114
67
|
export interface AppMessageEditCustomInstructionsEvent {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
68
|
+
type: "assistant.app.messages.editCustomInstructions";
|
|
69
|
+
data: {
|
|
70
|
+
hasChatMessages: boolean;
|
|
71
|
+
};
|
|
119
72
|
}
|
|
120
73
|
export interface AppAttachmentTemplateEvent {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
74
|
+
type: "assistant.app.attachment.template";
|
|
75
|
+
data: {
|
|
76
|
+
id: number;
|
|
77
|
+
name: string;
|
|
78
|
+
};
|
|
126
79
|
}
|
|
127
80
|
export interface AppPasteSmartExportEvent {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
81
|
+
type: "assistant.app.paste.smartExport";
|
|
82
|
+
data: {
|
|
83
|
+
clipboardText: string;
|
|
84
|
+
};
|
|
132
85
|
}
|
|
133
86
|
export interface AppMessagesGenerationEvent {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
87
|
+
type: "assistant.app.messages.generation";
|
|
88
|
+
data: {
|
|
89
|
+
state: GenerationState;
|
|
90
|
+
};
|
|
138
91
|
}
|
|
139
92
|
/**
|
|
140
93
|
* idle: no messages are being generated or queued to be generated
|
|
@@ -145,330 +98,325 @@ export interface AppMessagesGenerationEvent {
|
|
|
145
98
|
*/
|
|
146
99
|
export type GenerationState = "idle" | "queued" | "generating";
|
|
147
100
|
export interface AppPromptAbortEvent {
|
|
148
|
-
|
|
101
|
+
type: "assistant.app.prompt.abort";
|
|
149
102
|
}
|
|
150
103
|
export interface AppPromptFocusEvent {
|
|
151
|
-
|
|
104
|
+
type: "assistant.app.prompt.focus";
|
|
152
105
|
}
|
|
153
106
|
export interface AppPromptSubmitEvent {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
107
|
+
type: "assistant.app.prompt.submit";
|
|
108
|
+
data: {
|
|
109
|
+
prompt: string;
|
|
110
|
+
attachments: any[];
|
|
111
|
+
};
|
|
159
112
|
}
|
|
160
113
|
export interface AppReadyEvent {
|
|
161
|
-
|
|
114
|
+
type: "assistant.app.ready";
|
|
162
115
|
}
|
|
163
116
|
export interface AppSettingsSetEvent {
|
|
164
|
-
|
|
165
|
-
|
|
117
|
+
type: "assistant.app.settings.set";
|
|
118
|
+
data: Partial<AssistantSettings>;
|
|
166
119
|
}
|
|
167
120
|
export interface AppThreadNewEvent {
|
|
168
|
-
|
|
121
|
+
type: "assistant.app.thread.new";
|
|
169
122
|
}
|
|
170
123
|
export interface AssistantEditorAuthMessage {
|
|
171
|
-
|
|
124
|
+
type: "assistant.editor.auth.update";
|
|
172
125
|
}
|
|
173
126
|
export interface BuilderEditorAuthEvent extends AwaitResultEvent {
|
|
174
|
-
|
|
127
|
+
type: "assistant.editor.auth";
|
|
175
128
|
}
|
|
176
129
|
export interface BuilderEditorStateEvent extends AwaitResultEvent {
|
|
177
|
-
|
|
130
|
+
type: "assistant.editor.state";
|
|
178
131
|
}
|
|
179
132
|
export interface AwaitResultEvent {
|
|
180
|
-
|
|
133
|
+
resolveId?: string;
|
|
181
134
|
}
|
|
182
135
|
export interface ResultEvent {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
136
|
+
type: "assistant.result";
|
|
137
|
+
resolveId: string;
|
|
138
|
+
data: any;
|
|
186
139
|
}
|
|
187
140
|
export interface ContentCreatePatch {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
141
|
+
parentId: string;
|
|
142
|
+
insertBeforeId: string;
|
|
143
|
+
element: BuilderElement;
|
|
191
144
|
}
|
|
192
145
|
export interface ContentApplySnapshot {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
146
|
+
/**
|
|
147
|
+
* The id of the BuilderContent to apply the snapshot to
|
|
148
|
+
*/
|
|
149
|
+
id: string;
|
|
150
|
+
/**
|
|
151
|
+
* Each snapshot can be either a full BuilderContent or individual BuilderElements.
|
|
152
|
+
* Order matters, as the snapshots will be applied in the order they are listed.
|
|
153
|
+
* The builder app will handle the logic of applying the snapshots in the correct order
|
|
154
|
+
* and to the right content/elements.
|
|
155
|
+
*/
|
|
156
|
+
snapshots: (BuilderElement | BuilderContent)[];
|
|
204
157
|
}
|
|
205
158
|
export interface ContentApplySnapshotEvent {
|
|
206
|
-
|
|
207
|
-
|
|
159
|
+
type: "assistant.content.applysnapshot";
|
|
160
|
+
data: ContentApplySnapshot;
|
|
208
161
|
}
|
|
209
162
|
export interface ContentUpdateEvent {
|
|
210
|
-
|
|
211
|
-
|
|
163
|
+
type: "assistant.content.update";
|
|
164
|
+
data: ContentUpdatePatch[];
|
|
212
165
|
}
|
|
213
|
-
export type ContentUpdatePatch =
|
|
214
|
-
| ContentTsUpdateComponentPatch
|
|
215
|
-
| ContentThinkingPatch
|
|
216
|
-
| ContentCodegenPatch;
|
|
166
|
+
export type ContentUpdatePatch = ContentTsUpdateComponentPatch | ContentThinkingPatch | ContentCodegenPatch;
|
|
217
167
|
interface ContentPatchBase {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
168
|
+
id: string;
|
|
169
|
+
nodeId?: string;
|
|
170
|
+
builderId?: string;
|
|
171
|
+
description?: string;
|
|
172
|
+
value: string;
|
|
173
|
+
displayValue?: string;
|
|
174
|
+
ts: number;
|
|
175
|
+
/**
|
|
176
|
+
* A change value is considered incomplete until we also parsed it's closing xml tag.
|
|
177
|
+
*/
|
|
178
|
+
incomplete?: boolean;
|
|
179
|
+
/**
|
|
180
|
+
* If there was an error applying the patch, this will contain the error message.
|
|
181
|
+
*/
|
|
182
|
+
error?: string;
|
|
183
|
+
/**
|
|
184
|
+
* If `true`, Editor AI attempted to process this patch. It could be that the patch
|
|
185
|
+
* had invalid syntax or that the LLM made its changes incorrectly. This can be used
|
|
186
|
+
* to differentiate between a patch that is actively being streamed in, as indicated by
|
|
187
|
+
* the "incomplete" property, and a patch that is has finished streaming and is being
|
|
188
|
+
* processed.
|
|
189
|
+
*/
|
|
190
|
+
attemptedProcess?: boolean;
|
|
241
191
|
}
|
|
242
192
|
export interface ContentTsUpdateComponentPatch extends ContentPatchBase {
|
|
243
|
-
|
|
193
|
+
type: "update_component";
|
|
244
194
|
}
|
|
245
195
|
export interface ContentThinkingPatch extends ContentPatchBase {
|
|
246
|
-
|
|
196
|
+
type: "thinking";
|
|
247
197
|
}
|
|
248
198
|
export interface ContentCodegenPatch extends ContentPatchBase {
|
|
249
|
-
|
|
199
|
+
type: "codegen-text";
|
|
250
200
|
}
|
|
251
201
|
export interface AssistantStatsEvent {
|
|
252
|
-
|
|
253
|
-
|
|
202
|
+
type: "assistant.stats";
|
|
203
|
+
data: AssistantStats;
|
|
254
204
|
}
|
|
255
205
|
export interface AssistantStats {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
206
|
+
/**
|
|
207
|
+
* The unique id of the thread (not the openai threadId)
|
|
208
|
+
*/
|
|
209
|
+
threadId: string;
|
|
210
|
+
/**
|
|
211
|
+
* The unique id of the completion, which is a combination of the user's prompt and assistant's response.
|
|
212
|
+
*/
|
|
213
|
+
completionId: string;
|
|
214
|
+
/**
|
|
215
|
+
* The model id used to generate this completion.
|
|
216
|
+
*/
|
|
217
|
+
modelId: string;
|
|
218
|
+
/**
|
|
219
|
+
* The assistant's response message.
|
|
220
|
+
*/
|
|
221
|
+
assistantMessage: string;
|
|
222
|
+
/**
|
|
223
|
+
* The assistant's summary of what it did. This appears after assistantMessage
|
|
224
|
+
* as well as any changes it made.
|
|
225
|
+
*/
|
|
226
|
+
assistantSummary: string;
|
|
227
|
+
/**
|
|
228
|
+
* The user's prompt message.
|
|
229
|
+
*/
|
|
230
|
+
userMessage: string;
|
|
231
|
+
/**
|
|
232
|
+
* The index within the thread the assistant message is.
|
|
233
|
+
* For a first assistant message, the index will be 1 (the user message is index 0).
|
|
234
|
+
* For a second assistant message, the index will be 3 (the user message is index 2), and so on.
|
|
235
|
+
*/
|
|
236
|
+
assistantMessageIndex: number;
|
|
237
|
+
/**
|
|
238
|
+
* The timestamp (Date.now()) of when the user first submitted their prompt.
|
|
239
|
+
*/
|
|
240
|
+
userPromptMs: number;
|
|
241
|
+
/**
|
|
242
|
+
* The timestamp of the first assistant chunk in the response.
|
|
243
|
+
*/
|
|
244
|
+
firstChunkMs: number;
|
|
245
|
+
/**
|
|
246
|
+
* The timestamp of the last assistant chunk in the response.
|
|
247
|
+
*/
|
|
248
|
+
lastChunkMs: number;
|
|
249
|
+
/**
|
|
250
|
+
* The total number of chunks in the assistant's streamed response.
|
|
251
|
+
*/
|
|
252
|
+
chunkCount: number;
|
|
253
|
+
/**
|
|
254
|
+
* The total number of characters in the generated prompt sent to the LLM.
|
|
255
|
+
*/
|
|
256
|
+
promptLength: number;
|
|
257
|
+
/**
|
|
258
|
+
* The total number of characters in the assistant's response.
|
|
259
|
+
*/
|
|
260
|
+
completionLength: number;
|
|
261
|
+
/**
|
|
262
|
+
* If the user provided custom instructions for the prompt.
|
|
263
|
+
*/
|
|
264
|
+
hasCustomInstructions: boolean;
|
|
265
|
+
/**
|
|
266
|
+
* The deployed version.
|
|
267
|
+
*/
|
|
268
|
+
version: string;
|
|
269
|
+
/**
|
|
270
|
+
* Error message if there was one.
|
|
271
|
+
*/
|
|
272
|
+
errorMessage?: string;
|
|
273
|
+
/**
|
|
274
|
+
* Input tokens
|
|
275
|
+
*/
|
|
276
|
+
inputTokens?: number;
|
|
277
|
+
/**
|
|
278
|
+
* Output tokens
|
|
279
|
+
*/
|
|
280
|
+
outputTokens?: number;
|
|
281
|
+
/**
|
|
282
|
+
* Output tokens
|
|
283
|
+
*/
|
|
284
|
+
completionCost?: number;
|
|
285
|
+
/**
|
|
286
|
+
* Number of streamed snapshots
|
|
287
|
+
*/
|
|
288
|
+
streamedSnapshots?: number;
|
|
289
|
+
/**
|
|
290
|
+
* Number of cached input tokens
|
|
291
|
+
*/
|
|
292
|
+
cacheInputTokens?: number;
|
|
293
|
+
/**
|
|
294
|
+
* Number of cached created tokens
|
|
295
|
+
*/
|
|
296
|
+
cacheCreatedTokens?: number;
|
|
347
297
|
}
|
|
348
298
|
export interface ModelUndoEvent {
|
|
349
|
-
|
|
299
|
+
type: "assistant.model.undo";
|
|
350
300
|
}
|
|
351
301
|
export interface ModelRedoEvent {
|
|
352
|
-
|
|
302
|
+
type: "assistant.model.redo";
|
|
353
303
|
}
|
|
354
304
|
export interface BuilderModel {
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
305
|
+
name?: string;
|
|
306
|
+
friendlyName?: string;
|
|
307
|
+
description?: string;
|
|
308
|
+
type?: string;
|
|
309
|
+
fields?: BuilderModelField[];
|
|
360
310
|
}
|
|
361
311
|
export interface BuilderModelField {
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
312
|
+
name?: string;
|
|
313
|
+
type?: string;
|
|
314
|
+
description?: string;
|
|
365
315
|
}
|
|
366
316
|
export interface ThreadMessageFeedbackEvent {
|
|
367
|
-
|
|
368
|
-
|
|
317
|
+
type: "assistant.thread.message.feedback";
|
|
318
|
+
data: CompletionResponseFeedback;
|
|
369
319
|
}
|
|
370
320
|
export interface CompletionResponseFeedback {
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
321
|
+
userId: string;
|
|
322
|
+
builderUserId?: string;
|
|
323
|
+
builderEmail?: string;
|
|
324
|
+
responseId?: string;
|
|
325
|
+
frontendUrl: string | undefined;
|
|
326
|
+
frontendCommitId: string | undefined;
|
|
327
|
+
backendDomain?: string;
|
|
328
|
+
backendCommitId: string | undefined;
|
|
329
|
+
feedbackText: string;
|
|
330
|
+
sentiment?: "positive" | "negative" | "neutral";
|
|
331
|
+
frustration_level?: "none" | "low" | "medium" | "high";
|
|
332
|
+
repeated_attempts?: boolean;
|
|
333
|
+
confusion_level?: "none" | "low" | "medium" | "high";
|
|
334
|
+
urgency?: "none" | "low" | "medium" | "high";
|
|
335
|
+
satisfaction?: "none" | "low" | "medium" | "high";
|
|
386
336
|
}
|
|
387
337
|
export interface ThreadCreatedEvent {
|
|
388
|
-
|
|
389
|
-
|
|
338
|
+
type: "assistant.thread.created";
|
|
339
|
+
data: ThreadCreated;
|
|
390
340
|
}
|
|
391
341
|
export interface ThreadCreated {
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
342
|
+
platformId: string;
|
|
343
|
+
threadId: string;
|
|
344
|
+
vectorStoreId: string;
|
|
395
345
|
}
|
|
396
346
|
export interface ThreadMessageCreatedEvent {
|
|
397
|
-
|
|
398
|
-
|
|
347
|
+
type: "assistant.thread.message.created";
|
|
348
|
+
data: ThreadMessageCreated;
|
|
399
349
|
}
|
|
400
350
|
export interface ThreadMessageCreated {
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
351
|
+
id: string;
|
|
352
|
+
responseId: string;
|
|
353
|
+
threadId: string;
|
|
404
354
|
}
|
|
405
355
|
export interface ThreadMessageDeltaEvent {
|
|
406
|
-
|
|
407
|
-
|
|
356
|
+
type: "assistant.thread.message.delta";
|
|
357
|
+
data: ThreadMessageDelta;
|
|
408
358
|
}
|
|
409
359
|
export interface AssistantHeartbeatEvent {
|
|
410
|
-
|
|
360
|
+
type: "assistant.heartbeat";
|
|
411
361
|
}
|
|
412
362
|
export interface ThreadMessageDelta {
|
|
413
|
-
|
|
414
|
-
|
|
363
|
+
id: string;
|
|
364
|
+
text: string;
|
|
415
365
|
}
|
|
416
366
|
export interface ThreadMessageCompletedEvent {
|
|
417
|
-
|
|
418
|
-
|
|
367
|
+
type: "assistant.thread.message.completed";
|
|
368
|
+
data: ThreadMessageCompleted;
|
|
419
369
|
}
|
|
420
370
|
export interface ThreadMessageRetryEvent {
|
|
421
|
-
|
|
371
|
+
type: "assistant.thread.message.retry";
|
|
422
372
|
}
|
|
423
373
|
export interface ThreadMessageSummaryEvent {
|
|
424
|
-
|
|
425
|
-
|
|
374
|
+
type: "assistant.thread.message.summary.delta";
|
|
375
|
+
data: ThreadMessageDelta;
|
|
426
376
|
}
|
|
427
377
|
export interface ThreadMessageSummaryCodegenDeltaEvent {
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
378
|
+
type: "assistant.thread.message.summary.codegen.delta";
|
|
379
|
+
data: {
|
|
380
|
+
id: string;
|
|
381
|
+
text: string;
|
|
382
|
+
};
|
|
433
383
|
}
|
|
434
384
|
export interface ThreadMessageThinkingDeltaEvent {
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
385
|
+
type: "assistant.thread.message.thinking.delta";
|
|
386
|
+
data: {
|
|
387
|
+
id: string;
|
|
388
|
+
text: string;
|
|
389
|
+
};
|
|
440
390
|
}
|
|
441
391
|
export interface ThreadMessageCompleted extends AssistantMessage {
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
392
|
+
platformId: string;
|
|
393
|
+
threadId: string;
|
|
394
|
+
commitId?: string;
|
|
445
395
|
}
|
|
446
396
|
export interface ThreadRunStepDeltaEvent {
|
|
447
|
-
|
|
448
|
-
|
|
397
|
+
type: "assistant.thread.run.step.delta";
|
|
398
|
+
data: ThreadMessageStepDelta;
|
|
449
399
|
}
|
|
450
400
|
export interface ThreadMessageStepDelta {
|
|
451
|
-
|
|
401
|
+
delta: any;
|
|
452
402
|
}
|
|
453
403
|
export interface ThreadRunStepCreatedEvent {
|
|
454
|
-
|
|
404
|
+
type: "assistant.thread.run.step.created";
|
|
455
405
|
}
|
|
456
|
-
export type DeepPartial<T> = T extends object
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
}
|
|
460
|
-
: T;
|
|
406
|
+
export type DeepPartial<T> = T extends object ? {
|
|
407
|
+
[P in keyof T]?: DeepPartial<T[P]>;
|
|
408
|
+
} : T;
|
|
461
409
|
export interface AssistantContentInitialEvent {
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
410
|
+
type: "assistant.content.initial";
|
|
411
|
+
data: {
|
|
412
|
+
code: string;
|
|
413
|
+
};
|
|
466
414
|
}
|
|
467
415
|
export interface AssistantFusionSuggestionEvent {
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
416
|
+
type: "assistant.fusion.suggestion";
|
|
417
|
+
data: {
|
|
418
|
+
url: string;
|
|
419
|
+
message: string;
|
|
420
|
+
};
|
|
473
421
|
}
|
|
474
422
|
export {};
|