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