@builder.io/ai-utils 0.0.64 → 0.0.66

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.
@@ -1,6 +1,6 @@
1
1
  import type { BuilderContent, BuilderElement, Component } from "@builder.io/sdk";
2
- import type { Message, MessageParam } from "./messages";
3
- import type { BuilderModel } from "./events";
2
+ import type { Message, MessageParam } from "./messages.js";
3
+ import type { BuilderModel } from "./events.js";
4
4
  export type BuilderContentData = BuilderContent["data"];
5
5
  export type { BuilderContent, BuilderElement, Component };
6
6
  export interface CompletionOptions {
@@ -45,11 +45,6 @@ export interface CompletionOptions {
45
45
  * The state of the builder editor.
46
46
  */
47
47
  builderState?: BuilderEditorState;
48
- /**
49
- * Persist the thread conversation context.
50
- * Defaults to `true`.
51
- */
52
- persistThread?: boolean;
53
48
  /**
54
49
  * Additional console logs
55
50
  */
@@ -76,6 +71,20 @@ export interface CompletionOptions {
76
71
  "semantic-tags"?: string;
77
72
  "content-edit"?: string;
78
73
  };
74
+ /**
75
+ * Option on how this call should handle the conversation thread.
76
+ *
77
+ * `persist`:
78
+ * - When there is no CompletionOptions `id`, it'll create a new thread id
79
+ * - When given an existing `id`, it'll look up the past thread messages and prefix the messages
80
+ *
81
+ * `ephemeral`:
82
+ * - Creates a new conversation each time, ignoring any existing thread history
83
+ * - Will not save the conversation for future use
84
+ *
85
+ * Defaults to `persist`
86
+ */
87
+ thread?: "persist" | "ephemeral";
79
88
  }
80
89
  export interface BuilderEditorState {
81
90
  /**
package/dist/events.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { BuilderContent, BuilderElement } from "@builder.io/sdk";
2
- import type { Thread } from "./thread";
3
- import type { AssistantMessage } from "./messages";
4
- import { AssistantSettings } from "./settings";
2
+ import type { Thread } from "./thread.js";
3
+ import type { AssistantMessage } from "./messages.js";
4
+ import { AssistantSettings } from "./settings.js";
5
5
  export type BuilderAssistantEventHandler = (ev: BuilderAssistantEvent) => void;
6
6
  export type BuilderAssistantEvent = AssistantCompletionResultEvent | AssistantErrorEvent | AssistantStreamErrorEvent | AppCloseEvent | AppMessagesClickEvent | AppMessagesGenerationEvent | AppMessageEditCustomInstructionsEvent | AppPromptAbortEvent | AppPromptFocusEvent | AppPromptTextEvent | AppReadyEvent | AppSettingsResetEvent | AppSettingsSetEvent | AppThreadNewEvent | AssistantStatsEvent | BuilderEditorAuthEvent | BuilderEditorStateEvent | ContentUpdateEvent | ContentApplySnapshotEvent | ModelCreateEvent | ModelUpdateEvent | ModelUndoEvent | ModelRedoEvent | ResultEvent | ThreadCreatedEvent | ThreadMessageCompletedEvent | ThreadMessageCreatedEvent | ThreadMessageDeltaEvent | ThreadMessageFeedbackEvent | ThreadRunRequiresActionEvent | ThreadRunStepCreatedEvent | ThreadRunStepDeltaEvent | AppAcceptChangeEvent | AppAcceptRejectEvent | AssistantTrackEvent;
7
7
  export interface AssistantCompletionResultEvent {
@@ -14,7 +14,6 @@ export interface AssistantCompletionResultEvent {
14
14
  export interface AssistantError {
15
15
  message: string;
16
16
  status?: number;
17
- stack?: string;
18
17
  }
19
18
  export interface AssistantErrorEvent {
20
19
  type: "assistant.error";
@@ -1,4 +1,4 @@
1
- import { ContentUpdatePatch } from "./events";
1
+ import { ContentUpdatePatch } from "./events.js";
2
2
  /**
3
3
  * Message param does not know the id of the message.
4
4
  * This is an input message.
@@ -60,6 +60,7 @@ export declare function parseAssistantUrlSettings(url: string): Partial<Assistan
60
60
  export interface BuilderEditorAuth {
61
61
  spaceId: string;
62
62
  userId: string;
63
+ userToken: string;
63
64
  privateKey: string;
64
65
  }
65
66
  export {};
package/dist/thread.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Message } from "./messages";
1
+ import type { Message } from "./messages.js";
2
2
  export interface Thread {
3
3
  /**
4
4
  * The unique LOCAL identifier of the thread.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builder.io/ai-utils",
3
- "version": "0.0.64",
3
+ "version": "0.0.66",
4
4
  "description": "Builder.io AI utils",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",