@builder.io/ai-utils 0.0.25 → 0.0.27

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.
@@ -42,7 +42,7 @@ export interface CompletionOptions {
42
42
  /**
43
43
  * The state of the builder editor.
44
44
  */
45
- builderState?: BuiderEditorState;
45
+ builderState?: BuilderEditorState;
46
46
  /**
47
47
  * Persist the thread conversation context.
48
48
  * Defaults to `true`.
@@ -58,7 +58,7 @@ export interface CompletionOptions {
58
58
  */
59
59
  startMs?: number;
60
60
  }
61
- export interface BuiderEditorState {
61
+ export interface BuilderEditorState {
62
62
  /**
63
63
  * The active locale of the builder editor.
64
64
  */
@@ -83,6 +83,14 @@ export interface BuiderEditorState {
83
83
  * Builder model. (not the LLM model)
84
84
  */
85
85
  model?: BuilderModel;
86
+ /**
87
+ * Other models in the Builder account
88
+ */
89
+ otherModels?: BuilderModel[];
90
+ /**
91
+ * Email of the user in the builder.
92
+ */
93
+ userEmail?: string;
86
94
  /**
87
95
  * Selected ids in the builder.
88
96
  */
@@ -100,6 +108,10 @@ export interface BuiderEditorState {
100
108
  */
101
109
  sessionId?: string;
102
110
  }
111
+ /**
112
+ * @deprecated Uggh, spelling is hard. Use `BuilderEditorState` instead.
113
+ */
114
+ export type BuiderEditorState = BuilderEditorState;
103
115
  export type OnPromptSubmit = (opts: {
104
116
  prompt?: string;
105
117
  snippetId?: string;
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 = AssistantErrorEvent | AppCloseEvent | AppMessagesClickEvent | AppMessagesGenerationEvent | AppPromptAbortEvent | AppPromptFocusEvent | AppPromptTextEvent | AppReadyEvent | AppSettingsResetEvent | AppSettingsSetEvent | AppThreadNewEvent | BuiderEditorStateEvent | ContentUpdateEvent | ContentApplySnapshotEvent | ContentCompleteEvent | ModelCreateEvent | ModelUpdateEvent | ModelUndoEvent | ResultEvent | ThreadCreatedEvent | ThreadMessageDeltaEvent | ThreadMessageCompletedEvent | ThreadMessageFeedbackEvent | ThreadRunRequiresActionEvent | ThreadRunStepCreatedEvent | ThreadRunStepDeltaEvent;
6
+ export type BuilderAssistantEvent = AssistantErrorEvent | AppCloseEvent | AppMessagesClickEvent | AppMessagesGenerationEvent | AppPromptAbortEvent | AppPromptFocusEvent | AppPromptTextEvent | AppReadyEvent | AppSettingsResetEvent | AppSettingsSetEvent | AppThreadNewEvent | BuilderEditorStateEvent | ContentUpdateEvent | ContentApplySnapshotEvent | ContentCompleteEvent | ModelCreateEvent | ModelUpdateEvent | ModelUndoEvent | ResultEvent | ThreadCreatedEvent | ThreadMessageDeltaEvent | ThreadMessageCompletedEvent | ThreadMessageFeedbackEvent | ThreadRunRequiresActionEvent | ThreadRunStepCreatedEvent | ThreadRunStepDeltaEvent;
7
7
  export interface AssistantError {
8
8
  message: string;
9
9
  status?: number;
@@ -56,9 +56,13 @@ export interface AppSettingsSetEvent {
56
56
  export interface AppThreadNewEvent {
57
57
  type: "assistant.app.thread.new";
58
58
  }
59
- export interface BuiderEditorStateEvent extends AwaitResultEvent {
59
+ export interface BuilderEditorStateEvent extends AwaitResultEvent {
60
60
  type: "assistant.editor.state";
61
61
  }
62
+ /**
63
+ * @deprecated Use BuilderEditorStateEvent
64
+ */
65
+ export type BuiderEditorStateEvent = BuilderEditorStateEvent;
62
66
  export interface AwaitResultEvent {
63
67
  resolveId?: string;
64
68
  }
@@ -142,6 +146,7 @@ export interface ModelUpdate {
142
146
  }
143
147
  export interface BuilderModel {
144
148
  name?: string;
149
+ friendlyName?: string;
145
150
  description?: string;
146
151
  type?: string;
147
152
  fields?: BuilderModelField[];
@@ -170,6 +175,8 @@ export interface ThreadMessageFeedback {
170
175
  thread: Thread;
171
176
  platformId: string;
172
177
  sentiment?: "positive" | "negative";
178
+ builderUserId?: string;
179
+ builderEmail?: string;
173
180
  }
174
181
  export interface ThreadCreatedEvent {
175
182
  type: "assistant.thread.created";
@@ -1,6 +1,7 @@
1
1
  import type { SnippetParams } from "./messages";
2
2
  export interface AssistantSettings {
3
3
  assistantType?: string;
4
+ viewId?: string;
4
5
  cssOverrides?: string;
5
6
  headingText: string;
6
7
  hideFrameworkPicker?: boolean;
package/dist/settings.js CHANGED
@@ -10,6 +10,7 @@ const urlParamSettings = [
10
10
  "requestState",
11
11
  "theme",
12
12
  "transparentBackground",
13
+ "viewId",
13
14
  ];
14
15
  export function getAssistantUrl(opts = {}) {
15
16
  const url = new URL(opts.local
package/dist/thread.d.ts CHANGED
@@ -11,7 +11,17 @@ export interface Thread {
11
11
  threadId?: string;
12
12
  platformId?: string;
13
13
  title?: string;
14
+ /**
15
+ * The type of assistant that the thread is associated with.
16
+ * For example, "content-editor" or "docs".
17
+ */
14
18
  assistantType?: string;
19
+ /**
20
+ * The unique identifier of the view that the thread is associated with.
21
+ * For example, the "content-editor" assistant would use the
22
+ * builder content id as the viewId.
23
+ */
24
+ viewId?: string;
15
25
  created: number;
16
26
  messages: Message[];
17
27
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builder.io/ai-utils",
3
- "version": "0.0.25",
3
+ "version": "0.0.27",
4
4
  "description": "Builder.io AI utils",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",