@builder.io/ai-utils 0.2.0 → 0.3.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/package.json +1 -1
- package/src/codegen.ts +22 -0
- package/src/events.ts +11 -0
- package/src/messages.ts +2 -0
package/package.json
CHANGED
package/src/codegen.ts
CHANGED
|
@@ -345,6 +345,7 @@ export interface GenerateCompletionStepContinue {
|
|
|
345
345
|
|
|
346
346
|
export interface GenerateCompletionStepWaitForInput {
|
|
347
347
|
type: "wait-for-input";
|
|
348
|
+
state: GenerateCompletionState;
|
|
348
349
|
}
|
|
349
350
|
|
|
350
351
|
export interface GenerateCompletionStepAbort {
|
|
@@ -359,6 +360,26 @@ export interface GenerateCompletionStepRestore {
|
|
|
359
360
|
commitHash: string | undefined;
|
|
360
361
|
}
|
|
361
362
|
|
|
363
|
+
export type GenerateCompletionState =
|
|
364
|
+
| "unknown"
|
|
365
|
+
| "initial-with-url"
|
|
366
|
+
| "initial-without-url"
|
|
367
|
+
| "generating"
|
|
368
|
+
| "success"
|
|
369
|
+
| "abort"
|
|
370
|
+
| "error"
|
|
371
|
+
| "close";
|
|
372
|
+
|
|
373
|
+
export interface GenerateCompletionStepState {
|
|
374
|
+
type: "state";
|
|
375
|
+
previousState: GenerateCompletionState;
|
|
376
|
+
newState: GenerateCompletionState;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
export interface GenerateCompletionStepClose {
|
|
380
|
+
type: "close";
|
|
381
|
+
}
|
|
382
|
+
|
|
362
383
|
export type GenerateCompletionStep = { timestamp?: number } & (
|
|
363
384
|
| GenerateCompletionStepPlanning
|
|
364
385
|
| GenerateCompletionStepStart
|
|
@@ -375,6 +396,7 @@ export type GenerateCompletionStep = { timestamp?: number } & (
|
|
|
375
396
|
| GenerateCompletionStepUserInput
|
|
376
397
|
| GenerateCompletionStepText
|
|
377
398
|
| GenerateCompletionStepRestore
|
|
399
|
+
| GenerateCompletionStepState
|
|
378
400
|
| GenerateCompletionStepToolResult
|
|
379
401
|
);
|
|
380
402
|
|
package/src/events.ts
CHANGED
|
@@ -44,6 +44,7 @@ export type BuilderAssistantEvent =
|
|
|
44
44
|
| AppWebImportEvent
|
|
45
45
|
| AppAiTemplatesEvent
|
|
46
46
|
| AssistantContentInitialEvent
|
|
47
|
+
| ThreadMessageSummaryEvent
|
|
47
48
|
| AssistantHeartbeatEvent;
|
|
48
49
|
|
|
49
50
|
export interface AssistantCompletionResultEvent {
|
|
@@ -267,6 +268,11 @@ export interface AssistantStats {
|
|
|
267
268
|
* The assistant's response message.
|
|
268
269
|
*/
|
|
269
270
|
assistantMessage: string;
|
|
271
|
+
/**
|
|
272
|
+
* The assistant's summary of what it did. This appears after assistantMessage
|
|
273
|
+
* as well as any changes it made.
|
|
274
|
+
*/
|
|
275
|
+
assistantSummary: string;
|
|
270
276
|
/**
|
|
271
277
|
* The user's prompt message.
|
|
272
278
|
*/
|
|
@@ -425,6 +431,11 @@ export interface ThreadMessageRetryEvent {
|
|
|
425
431
|
type: "assistant.thread.message.retry";
|
|
426
432
|
}
|
|
427
433
|
|
|
434
|
+
export interface ThreadMessageSummaryEvent {
|
|
435
|
+
type: "assistant.thread.message.summary.delta";
|
|
436
|
+
data: ThreadMessageDelta;
|
|
437
|
+
}
|
|
438
|
+
|
|
428
439
|
export interface ThreadMessageCompleted extends AssistantMessage {
|
|
429
440
|
platformId: string;
|
|
430
441
|
threadId: string;
|
package/src/messages.ts
CHANGED
|
@@ -175,6 +175,8 @@ export interface UserMessage extends UserMessageParam {
|
|
|
175
175
|
export interface AssistantMessage extends AssistantMessageParam {
|
|
176
176
|
id: string;
|
|
177
177
|
status?: "accepted" | "rejected" | "aborted";
|
|
178
|
+
// Optional summary from the LLM that explains why it did
|
|
179
|
+
summary?: string;
|
|
178
180
|
}
|
|
179
181
|
|
|
180
182
|
export interface AssistantActionMessage {
|