@boldvideo/bold-js 1.10.0 → 1.11.0

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @boldvideo/bold-js
2
2
 
3
+ ## 1.11.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 88c5d1c: Remove deprecated SSE event types and add Segment type
8
+
9
+ **Breaking changes to `AIEvent` type:**
10
+
11
+ - Remove deprecated event types: `token`, `clarification`, `answer`, `complete`
12
+ - Remove `AnswerMetadata` interface
13
+ - Change `message_complete` event: `sources` field renamed to `citations`, added `responseType: "answer" | "clarification"`
14
+
15
+ **New exports:**
16
+
17
+ - `Segment` - Primary type for video segments (replaces Source)
18
+ - `Citation` - Semantic alias for Segment (for cited chunks)
19
+ - `Source` - Now a deprecated alias for Segment (kept for backwards compatibility)
20
+
21
+ This aligns the SDK with the simplified backend SSE event structure.
22
+
3
23
  ## 1.10.0
4
24
 
5
25
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -269,7 +269,7 @@ async function* parseSSE(response) {
269
269
  const raw = JSON.parse(json);
270
270
  const event = camelizeKeys(raw);
271
271
  yield event;
272
- if (event.type === "message_complete" || event.type === "complete" || event.type === "error") {
272
+ if (event.type === "message_complete" || event.type === "error") {
273
273
  await reader.cancel();
274
274
  return;
275
275
  }
package/dist/index.d.ts CHANGED
@@ -179,9 +179,9 @@ type Settings = {
179
179
  version: string;
180
180
  };
181
181
  /**
182
- * Source citation from AI responses
182
+ * Video segment from AI responses (used for both sources and citations)
183
183
  */
184
- interface Source {
184
+ interface Segment {
185
185
  id: string;
186
186
  videoId: string;
187
187
  title: string;
@@ -191,6 +191,14 @@ interface Source {
191
191
  playbackId: string;
192
192
  speaker?: string;
193
193
  }
194
+ /**
195
+ * @deprecated Use Segment instead
196
+ */
197
+ type Source = Segment;
198
+ /**
199
+ * Alias for Segment - represents chunks the LLM actually cited
200
+ */
201
+ type Citation = Segment;
194
202
  /**
195
203
  * Token usage statistics
196
204
  */
@@ -198,14 +206,6 @@ interface AIUsage {
198
206
  inputTokens: number;
199
207
  outputTokens: number;
200
208
  }
201
- /**
202
- * Metadata included with answer events
203
- */
204
- interface AnswerMetadata {
205
- topScore: number;
206
- chunksFound: number;
207
- videosSearched: number;
208
- }
209
209
  /**
210
210
  * SSE event types for AI streaming responses
211
211
  */
@@ -215,39 +215,23 @@ type AIEvent = {
215
215
  videoId?: string;
216
216
  } | {
217
217
  type: "sources";
218
- sources: Source[];
218
+ sources: Segment[];
219
219
  } | {
220
220
  type: "text_delta";
221
221
  delta: string;
222
- } | {
223
- type: "token";
224
- content: string;
225
- } | {
226
- type: "clarification";
227
- content: string;
228
- questions: string[];
229
222
  } | {
230
223
  type: "recommendations";
231
224
  recommendations: Recommendation[];
232
- } | {
233
- type: "answer";
234
- content: string;
235
- metadata: AnswerMetadata;
236
- usage?: AIUsage;
237
- confidence?: string;
238
- responseStrategy?: string;
239
- citations?: Source[];
240
225
  } | {
241
226
  type: "message_complete";
242
227
  conversationId?: string;
243
228
  content: string;
244
- sources: Source[];
229
+ citations: Segment[];
230
+ responseType: "answer" | "clarification";
245
231
  usage?: AIUsage;
246
232
  context?: AIContextMessage[];
247
233
  recommendations?: Recommendation[];
248
234
  guidance?: string;
249
- } | {
250
- type: "complete";
251
235
  } | {
252
236
  type: "error";
253
237
  code: string;
@@ -505,4 +489,4 @@ declare const DEFAULT_API_BASE_URL = "https://app.boldvideo.io/api/v1/";
505
489
  */
506
490
  declare const DEFAULT_INTERNAL_API_BASE_URL = "https://app.boldvideo.io/i/v1/";
507
491
 
508
- export { AIContextMessage, AIEvent, AIResponse, AIUsage, Account, AccountAI, AskOptions, AssistantConfig, ChatOptions, ClientOptions, DEFAULT_API_BASE_URL, DEFAULT_INTERNAL_API_BASE_URL, MenuItem, Playlist, Portal, PortalDisplay, PortalLayout, PortalNavigation, PortalTheme, RecommendOptions, RecommendResponse, Recommendation, RecommendationVideo, RecommendationsOptions, RecommendationsResponse, SearchOptions, Settings, Source, ThemeColors, ThemeConfig, Video, VideoAttachment, VideoDownloadUrls, VideoMetadata, VideoSubtitles, VideoTranscript, createClient };
492
+ export { AIContextMessage, AIEvent, AIResponse, AIUsage, Account, AccountAI, AskOptions, AssistantConfig, ChatOptions, Citation, ClientOptions, DEFAULT_API_BASE_URL, DEFAULT_INTERNAL_API_BASE_URL, MenuItem, Playlist, Portal, PortalDisplay, PortalLayout, PortalNavigation, PortalTheme, RecommendOptions, RecommendResponse, Recommendation, RecommendationVideo, RecommendationsOptions, RecommendationsResponse, SearchOptions, Segment, Settings, Source, ThemeColors, ThemeConfig, Video, VideoAttachment, VideoDownloadUrls, VideoMetadata, VideoSubtitles, VideoTranscript, createClient };
package/dist/index.js CHANGED
@@ -231,7 +231,7 @@ async function* parseSSE(response) {
231
231
  const raw = JSON.parse(json);
232
232
  const event = camelizeKeys(raw);
233
233
  yield event;
234
- if (event.type === "message_complete" || event.type === "complete" || event.type === "error") {
234
+ if (event.type === "message_complete" || event.type === "error") {
235
235
  await reader.cancel();
236
236
  return;
237
237
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@boldvideo/bold-js",
3
3
  "license": "MIT",
4
- "version": "1.10.0",
4
+ "version": "1.11.0",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",