@builder.io/ai-utils 0.4.16 → 0.4.17

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 +3 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builder.io/ai-utils",
3
- "version": "0.4.16",
3
+ "version": "0.4.17",
4
4
  "description": "Builder.io AI utils",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/codegen.d.ts CHANGED
@@ -137,6 +137,7 @@ export interface CodeGenInputOptions {
137
137
  /** @deprecated */
138
138
  vcpId?: string;
139
139
  }
140
+ export type CodeGenErrorCodes = "credits-limit-daily" | "credits-limit-monthly" | "credits-limit-other" | "cli-genetic-error" | "prompt-too-long" | "unknown" | "failed-recover-state" | "bad-initial-url" | "invalid-last-message" | "corrupted-session" | "assertion" | "rate-limit";
140
141
  export type Feature = "component-mapping";
141
142
  export interface CodegenUsage {
142
143
  total: number;
@@ -284,6 +285,7 @@ export interface GenerateCompletionStepDelta {
284
285
  export interface GenerateCompletionStepError {
285
286
  type: "error";
286
287
  id?: string;
288
+ code: CodeGenErrorCodes;
287
289
  stopReason?: "error" | "limit";
288
290
  metadata?: any;
289
291
  message: string;
@@ -506,6 +508,7 @@ export interface GenerateCodeEventDone {
506
508
  export interface GenerateCodeEventError {
507
509
  type: "error";
508
510
  stopReason: "error" | "limit";
511
+ code: CodeGenErrorCodes;
509
512
  id: string;
510
513
  message: string;
511
514
  usage?: CodegenUsage;