@builder.io/ai-utils 0.0.22 → 0.0.23

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.
@@ -10,7 +10,9 @@ export interface CompletionOptions {
10
10
  */
11
11
  assistantType?: string;
12
12
  /**
13
- * Model identifier to lookup which sdk and model to use. If not provided the default model will be used.
13
+ * LLM Model identifier to lookup which sdk and model to use.
14
+ * If not provided the default model will be used.
15
+ * Note: This is not the Builder.io data model.
14
16
  */
15
17
  modelId?: string;
16
18
  /**
@@ -37,47 +39,53 @@ export interface CompletionOptions {
37
39
  * User id is stored in localStorage for this domain, its not the builder user id.
38
40
  */
39
41
  userId: string;
42
+ /**
43
+ * The state of the builder editor.
44
+ */
45
+ builderState?: BuiderEditorState;
46
+ /**
47
+ * Additional console logs
48
+ */
49
+ debug?: boolean;
50
+ /**
51
+ * Date.now() timestamp of when the assistant was started.
52
+ * This is used to calculate the time taken between all events.
53
+ */
54
+ startMs?: number;
55
+ }
56
+ export interface BuiderEditorState {
40
57
  /**
41
58
  * The active locale of the builder editor.
42
59
  */
43
- builderActiveLocale?: string;
60
+ activeLocale?: string;
44
61
  /**
45
62
  * The locale of the provided builder content.
46
63
  */
47
- builderContentLocale?: string;
64
+ contentLocale?: string;
48
65
  /**
49
66
  * Top level Builder content. The data.blocks array contains the BuilderElement.
50
67
  */
51
- builderContent?: BuilderContent;
68
+ content?: BuilderContent;
52
69
  /**
53
70
  * Builder custom components.
54
71
  */
55
- builderComponents?: Component[];
72
+ components?: Component[];
56
73
  /**
57
74
  * Builder design tokens.
58
75
  */
59
- builderDesignTokens?: Record<string, string>;
76
+ designTokens?: Record<string, string>;
60
77
  /**
61
- * Builder model.
78
+ * Builder model. (not the LLM model)
62
79
  */
63
- builderModel?: BuilderModel;
80
+ model?: BuilderModel;
64
81
  /**
65
82
  * Selected ids in the builder.
66
83
  */
67
- builderSelectedIds?: string[];
84
+ selectedIds?: string[];
68
85
  /**
69
86
  * Builder space id.
70
87
  */
71
- builderSpaceId?: string;
72
- /**
73
- * Additional console logs
74
- */
75
- debug?: boolean;
76
- /**
77
- * Date.now() timestamp of when the assistant was started.
78
- * This is used to calculate the time taken between all
79
- */
80
- start: number;
88
+ spaceId?: string;
81
89
  }
82
90
  export type OnPromptSubmit = (opts: {
83
91
  prompt?: string;
package/dist/events.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { BuilderContent, BuilderElement, Component } from "@builder.io/sdk";
1
+ import type { BuilderContent, BuilderElement } from "@builder.io/sdk";
2
2
  import type { Thread } from "./thread";
3
3
  import type { AssistantMessage } from "./messages";
4
4
  import { AssistantSettings } from "./settings";
@@ -67,16 +67,6 @@ export interface ResultEvent {
67
67
  resolveId: string;
68
68
  data: any;
69
69
  }
70
- export interface BuiderEditorState {
71
- activeLocale?: string;
72
- contentLocale?: string;
73
- content?: BuilderContent;
74
- components?: Component[];
75
- designTokens?: Record<string, string>;
76
- model?: BuilderModel;
77
- selectedIds?: string[];
78
- spaceId?: string;
79
- }
80
70
  export interface ContentCreatePatch {
81
71
  parentId: string;
82
72
  insertBeforeId: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builder.io/ai-utils",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "description": "Builder.io AI utils",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",