@builder.io/ai-utils 0.0.40 → 0.0.41

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,5 +1,5 @@
1
1
  import type { BuilderContent, BuilderElement, Component } from "@builder.io/sdk";
2
- import type { Message, MessageParam, SnippetParams } from "./messages";
2
+ import type { Message, MessageParam } from "./messages";
3
3
  import type { BuilderModel } from "./events";
4
4
  export type BuilderContentData = BuilderContent["data"];
5
5
  export type { BuilderContent, BuilderElement, Component };
@@ -113,6 +113,10 @@ export interface BuilderEditorState {
113
113
  * Custom instructions that could be add into the prompt.
114
114
  */
115
115
  customInstructions?: Record<string, string>;
116
+ /**
117
+ * All targeting attributes of the content.
118
+ */
119
+ allTargetingAttributes?: Record<string, any>;
116
120
  }
117
121
  /**
118
122
  * @deprecated Uggh, spelling is hard. Use `BuilderEditorState` instead.
@@ -120,6 +124,4 @@ export interface BuilderEditorState {
120
124
  export type BuiderEditorState = BuilderEditorState;
121
125
  export type OnPromptSubmit = (opts: {
122
126
  prompt?: string;
123
- snippetId?: string;
124
- snippetParams?: SnippetParams;
125
127
  }) => void;
package/dist/events.d.ts CHANGED
@@ -26,9 +26,11 @@ export interface AppMessagesGenerationEvent {
26
26
  };
27
27
  }
28
28
  /**
29
- * idle - no messages are being generated or queued to be generated
30
- * queued - messages have been sent, but no response has been received yet
31
- * generating - messages are actively being generated
29
+ * idle: no messages are being generated or queued to be generated
30
+ *
31
+ * queued: messages have been sent to the LLM, but no response has been received yet
32
+ *
33
+ * generating: messages are actively being generated and streaming back to the UI
32
34
  */
33
35
  export type GenerationState = "idle" | "queued" | "generating";
34
36
  export interface AppPromptAbortEvent {
@@ -25,21 +25,7 @@ export interface UserMessageParam {
25
25
  */
26
26
  role: "user";
27
27
  id?: string;
28
- /**
29
- * Predefined snippets that the user can select from.
30
- * We still need the content to be set so the message they read
31
- * is added to the conversation, however, the assistant will
32
- * ignore the content and use the snippet to know what to do instead.
33
- */
34
- snippetId?: string;
35
- /**
36
- * Extra parameters to pass to the assistant when the snippet is used.
37
- * For example, a predefined snippet to translate content needs to know
38
- * what language to translate to.
39
- */
40
- snippetParams?: SnippetParams;
41
28
  }
42
- export type SnippetParams = Record<string, any>;
43
29
  export interface AssistantMessageParam {
44
30
  /**
45
31
  * The contents of the assistant message.
@@ -89,6 +75,4 @@ export interface AssistantActionMessage {
89
75
  * and is the output message.
90
76
  */
91
77
  export type Message = SystemMessage | UserMessage | AssistantMessage;
92
- export type GeneratingMessage = null | (Partial<AssistantActionMessage | AssistantMessage> & {
93
- generating?: boolean;
94
- });
78
+ export type GeneratingMessage = null | Partial<AssistantActionMessage | AssistantMessage>;
@@ -1,4 +1,3 @@
1
- import type { SnippetParams } from "./messages";
2
1
  export interface AssistantSettings {
3
2
  assistantType?: string;
4
3
  viewId?: string;
@@ -39,14 +38,6 @@ export interface Snippet {
39
38
  * This prompt is also what's added to the chat conversation from the user.
40
39
  */
41
40
  prompt?: string;
42
- /**
43
- * The ID of the snippet that will be sent to the assistant when the user clicks the chat snippet button.
44
- */
45
- snippetId?: string;
46
- /**
47
- * The parameters that will be sent to the assistant when the user clicks the chat snippet button.
48
- */
49
- snippetParams?: SnippetParams;
50
41
  }
51
42
  interface IframeSettings extends Partial<AssistantSettings> {
52
43
  local?: boolean;
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@builder.io/ai-utils",
3
- "version": "0.0.40",
3
+ "version": "0.0.41",
4
4
  "description": "Builder.io AI utils",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
- "types": "dist/index.d.ts",
7
+ "types": "dist/index.d.tss",
8
8
  "exports": {
9
9
  ".": {
10
10
  "import": "./dist/index.js",