@builder.io/ai-utils 0.4.15 → 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.
- package/package.json +1 -1
- package/src/codegen.d.ts +3 -0
- package/src/messages.d.ts +9 -1
package/package.json
CHANGED
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;
|
package/src/messages.d.ts
CHANGED
|
@@ -241,7 +241,7 @@ export type Message = SystemMessage | UserMessage | AssistantMessage;
|
|
|
241
241
|
export type GeneratingMessage = null | Partial<AssistantActionMessage | AssistantMessage>;
|
|
242
242
|
export declare function getContentText(message: string | ContentMessage): string;
|
|
243
243
|
export declare function getContentAttachments(message: string | ContentMessage): (ImageBase64Source | ImageUrlSource)[];
|
|
244
|
-
export type Attachment = FileUpload | Template | URL;
|
|
244
|
+
export type Attachment = FileUpload | Template | URL | BuilderContentAttachment | FigmaContentAttachment;
|
|
245
245
|
export interface URL {
|
|
246
246
|
type: "url";
|
|
247
247
|
value: string;
|
|
@@ -261,3 +261,11 @@ export interface Template {
|
|
|
261
261
|
name: string;
|
|
262
262
|
id: number;
|
|
263
263
|
}
|
|
264
|
+
export interface BuilderContentAttachment {
|
|
265
|
+
type: "builder";
|
|
266
|
+
html: string;
|
|
267
|
+
}
|
|
268
|
+
export interface FigmaContentAttachment {
|
|
269
|
+
type: "figma";
|
|
270
|
+
html: string;
|
|
271
|
+
}
|