@builder.io/ai-utils 0.1.4 → 0.1.5

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/codegen.d.ts +10 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builder.io/ai-utils",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Builder.io AI utils",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/codegen.d.ts CHANGED
@@ -247,9 +247,17 @@ export interface GenerateCompletionStepWaitForInput {
247
247
  export interface GenerateCompletionStepAbort {
248
248
  type: "user-abort";
249
249
  }
250
+ export interface GenerateCompletionStepRestore {
251
+ type: "restore";
252
+ location: "before" | "after";
253
+ files: string[];
254
+ targetCompletionId: string;
255
+ lastCompletionId: string;
256
+ commitHash: string | undefined;
257
+ }
250
258
  export type GenerateCompletionStep = {
251
259
  timestamp?: number;
252
- } & (GenerateCompletionStepPlanning | GenerateCompletionStepStart | GenerateCompletionStepDelta | GenerateCompletionStepUser | GenerateCompletionStepFile | GenerateCompletionStepDiff | GenerateCompletionStepTool | GenerateCompletionStepError | GenerateCompletionStepContinue | GenerateCompletionStepWaitForInput | GenerateCompletionStepAbort | GenerateCompletionStepDone | GenerateCompletionStepUserInput | GenerateCompletionStepText | GenerateCompletionStepToolResult);
260
+ } & (GenerateCompletionStepPlanning | GenerateCompletionStepStart | GenerateCompletionStepDelta | GenerateCompletionStepUser | GenerateCompletionStepFile | GenerateCompletionStepDiff | GenerateCompletionStepTool | GenerateCompletionStepError | GenerateCompletionStepContinue | GenerateCompletionStepWaitForInput | GenerateCompletionStepAbort | GenerateCompletionStepDone | GenerateCompletionStepUserInput | GenerateCompletionStepText | GenerateCompletionStepRestore | GenerateCompletionStepToolResult);
253
261
  export interface ApplyActionsResult {
254
262
  filePath: string;
255
263
  addedLines: number;
@@ -283,7 +291,7 @@ export interface CodegenTurn {
283
291
  completionId: string;
284
292
  title: string;
285
293
  nextUrl: string | undefined;
286
- isUserMessage: boolean;
294
+ role: "user" | "agent";
287
295
  actions: ActionItem[];
288
296
  sentiment: "positive" | "negative" | "undo" | undefined;
289
297
  applyResults: ApplyActionsResult[];