@builder.io/ai-utils
Advanced tools
Comparing version 0.0.17 to 0.0.18
@@ -6,3 +6,3 @@ import type { BuilderContent, BuilderElement, Component } from "@builder.io/sdk"; | ||
export type BuilderAssistantEventHandler = (ev: BuilderAssistantEvent) => void; | ||
export type BuilderAssistantEvent = AppCloseEvent | AppMessagesClickEvent | AppMessagesGenerationEvent | AppPromptAbortEvent | AppPromptFocusEvent | AppPromptTextEvent | AppReadyEvent | AppSettingsResetEvent | AppSettingsSetEvent | AppThreadNewEvent | BuiderEditorStateEvent | ContentCreateEvent | ContentUpdateEvent | ContentApplySnapshotEvent | ContentCompleteEvent | ModelCreateEvent | ModelUpdateEvent | ResultEvent | ThreadCreatedEvent | ThreadMessageDeltaEvent | ThreadMessageCompletedEvent | ThreadMessageFeedbackEvent | ThreadRunRequiresActionEvent | ThreadRunStepCreatedEvent | ThreadRunStepDeltaEvent; | ||
export type BuilderAssistantEvent = AppCloseEvent | AppMessagesClickEvent | AppMessagesGenerationEvent | AppPromptAbortEvent | AppPromptFocusEvent | AppPromptTextEvent | AppReadyEvent | AppSettingsResetEvent | AppSettingsSetEvent | AppThreadNewEvent | BuiderEditorStateEvent | ContentUpdateEvent | ContentApplySnapshotEvent | ContentCompleteEvent | ModelCreateEvent | ModelUpdateEvent | ResultEvent | ThreadCreatedEvent | ThreadMessageDeltaEvent | ThreadMessageCompletedEvent | ThreadMessageFeedbackEvent | ThreadRunRequiresActionEvent | ThreadRunStepCreatedEvent | ThreadRunStepDeltaEvent; | ||
export interface AppCloseEvent { | ||
@@ -72,6 +72,2 @@ type: "assistant.app.close"; | ||
} | ||
export interface ContentCreateEvent { | ||
type: "assistant.content.create"; | ||
data: ContentCreatePatch[]; | ||
} | ||
export interface ContentCreatePatch { | ||
@@ -82,6 +78,2 @@ parentId: string; | ||
} | ||
export interface ContentUpdateEvent { | ||
type: "assistant.content.update"; | ||
data: ContentUpdatePatch[]; | ||
} | ||
export interface ContentApplySnapshot { | ||
@@ -96,20 +88,24 @@ id: string; | ||
} | ||
export type ContentUpdatePatch = ContentPropsUpdatePatch | ContentStyleUpdatePatch | ContentTextUpdatePatch; | ||
export interface ContentPropsUpdatePatch { | ||
type: "props"; | ||
export interface ContentUpdateEvent { | ||
type: "assistant.content.update"; | ||
data: ContentUpdatePatch[]; | ||
} | ||
export type ContentUpdatePatch = ContentInsertAdjacentPatch | ContentPropsUpdatePatch | ContentSetChildrenPatch | ContentStyleUpdatePatch; | ||
interface ContentPatchBase { | ||
id: string; | ||
value: Record<string, any>; | ||
patchId: string; | ||
value: string; | ||
ts: number; | ||
} | ||
export interface ContentStyleUpdatePatch { | ||
export interface ContentInsertAdjacentPatch extends ContentPatchBase { | ||
type: "insert_adjacent"; | ||
} | ||
export interface ContentPropsUpdatePatch extends ContentPatchBase { | ||
type: "props"; | ||
} | ||
export interface ContentStyleUpdatePatch extends ContentPatchBase { | ||
type: "style"; | ||
id: string; | ||
value: Record<string, any>; | ||
ts: number; | ||
} | ||
export interface ContentTextUpdatePatch { | ||
type: "content"; | ||
id: string; | ||
value: string; | ||
ts: number; | ||
export interface ContentSetChildrenPatch extends ContentPatchBase { | ||
type: "children"; | ||
} | ||
@@ -217,1 +213,2 @@ export interface ContentCompleteEvent { | ||
} : T; | ||
export {}; |
{ | ||
"name": "@builder.io/ai-utils", | ||
"version": "0.0.17", | ||
"version": "0.0.18", | ||
"description": "Builder.io AI utils", | ||
@@ -5,0 +5,0 @@ "type": "module", |
19380
624