@builder.io/ai-utils 0.0.26 → 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
  */
@@ -108,6 +108,10 @@ export interface BuiderEditorState {
108
108
  */
109
109
  sessionId?: string;
110
110
  }
111
+ /**
112
+ * @deprecated Uggh, spelling is hard. Use `BuilderEditorState` instead.
113
+ */
114
+ export type BuiderEditorState = BuilderEditorState;
111
115
  export type OnPromptSubmit = (opts: {
112
116
  prompt?: string;
113
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
  }
@@ -171,6 +175,8 @@ export interface ThreadMessageFeedback {
171
175
  thread: Thread;
172
176
  platformId: string;
173
177
  sentiment?: "positive" | "negative";
178
+ builderUserId?: string;
179
+ builderEmail?: string;
174
180
  }
175
181
  export interface ThreadCreatedEvent {
176
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.26",
3
+ "version": "0.0.27",
4
4
  "description": "Builder.io AI utils",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",