@builder.io/ai-utils 0.0.17 → 0.0.19
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/dist/events.d.ts +22 -22
- package/package.json +1 -1
package/dist/events.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { Thread } from "./thread";
|
|
|
3
3
|
import type { AssistantMessage } from "./messages";
|
|
4
4
|
import { AssistantSettings } from "./settings";
|
|
5
5
|
export type BuilderAssistantEventHandler = (ev: BuilderAssistantEvent) => void;
|
|
6
|
-
export type BuilderAssistantEvent = AppCloseEvent | AppMessagesClickEvent | AppMessagesGenerationEvent | AppPromptAbortEvent | AppPromptFocusEvent | AppPromptTextEvent | AppReadyEvent | AppSettingsResetEvent | AppSettingsSetEvent | AppThreadNewEvent | BuiderEditorStateEvent |
|
|
6
|
+
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;
|
|
7
7
|
export interface AppCloseEvent {
|
|
8
8
|
type: "assistant.app.close";
|
|
9
9
|
}
|
|
@@ -68,19 +68,11 @@ export interface BuiderEditorState {
|
|
|
68
68
|
selectedIds?: string[];
|
|
69
69
|
spaceId?: string;
|
|
70
70
|
}
|
|
71
|
-
export interface ContentCreateEvent {
|
|
72
|
-
type: "assistant.content.create";
|
|
73
|
-
data: ContentCreatePatch[];
|
|
74
|
-
}
|
|
75
71
|
export interface ContentCreatePatch {
|
|
76
72
|
parentId: string;
|
|
77
73
|
insertBeforeId: string;
|
|
78
74
|
element: BuilderElement;
|
|
79
75
|
}
|
|
80
|
-
export interface ContentUpdateEvent {
|
|
81
|
-
type: "assistant.content.update";
|
|
82
|
-
data: ContentUpdatePatch[];
|
|
83
|
-
}
|
|
84
76
|
export interface ContentApplySnapshot {
|
|
85
77
|
id: string;
|
|
86
78
|
blocks?: BuilderElement[];
|
|
@@ -90,24 +82,31 @@ export interface ContentApplySnapshotEvent {
|
|
|
90
82
|
type: "assistant.content.applysnapshot";
|
|
91
83
|
data: ContentApplySnapshot;
|
|
92
84
|
}
|
|
93
|
-
export
|
|
94
|
-
|
|
95
|
-
|
|
85
|
+
export interface ContentUpdateEvent {
|
|
86
|
+
type: "assistant.content.update";
|
|
87
|
+
data: ContentUpdatePatch[];
|
|
88
|
+
}
|
|
89
|
+
export type ContentUpdatePatch = ContentInsertBeforePatch | ContentInsertAfterPatch | ContentPropsUpdatePatch | ContentSetChildrenPatch | ContentStyleUpdatePatch;
|
|
90
|
+
interface ContentPatchBase {
|
|
96
91
|
id: string;
|
|
97
|
-
|
|
92
|
+
patchId: string;
|
|
93
|
+
value: string;
|
|
98
94
|
ts: number;
|
|
99
95
|
}
|
|
100
|
-
export interface
|
|
96
|
+
export interface ContentInsertBeforePatch extends ContentPatchBase {
|
|
97
|
+
type: "insert_before";
|
|
98
|
+
}
|
|
99
|
+
export interface ContentInsertAfterPatch extends ContentPatchBase {
|
|
100
|
+
type: "insert_after";
|
|
101
|
+
}
|
|
102
|
+
export interface ContentPropsUpdatePatch extends ContentPatchBase {
|
|
103
|
+
type: "props";
|
|
104
|
+
}
|
|
105
|
+
export interface ContentStyleUpdatePatch extends ContentPatchBase {
|
|
101
106
|
type: "style";
|
|
102
|
-
id: string;
|
|
103
|
-
value: Record<string, any>;
|
|
104
|
-
ts: number;
|
|
105
107
|
}
|
|
106
|
-
export interface
|
|
107
|
-
type: "
|
|
108
|
-
id: string;
|
|
109
|
-
value: string;
|
|
110
|
-
ts: number;
|
|
108
|
+
export interface ContentSetChildrenPatch extends ContentPatchBase {
|
|
109
|
+
type: "children";
|
|
111
110
|
}
|
|
112
111
|
export interface ContentCompleteEvent {
|
|
113
112
|
type: "assistant.content.complete";
|
|
@@ -210,3 +209,4 @@ export interface ThreadRunStepCreatedEvent {
|
|
|
210
209
|
export type DeepPartial<T> = T extends object ? {
|
|
211
210
|
[P in keyof T]?: DeepPartial<T[P]>;
|
|
212
211
|
} : T;
|
|
212
|
+
export {};
|