@boldvideo/bold-js 1.9.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,36 @@
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
+
23
+ ## 1.10.0
24
+
25
+ ### Minor Changes
26
+
27
+ - a9402d1: Add missing SSE event types and fix streaming termination
28
+
29
+ - Add `token`, `answer`, and `complete` event types to the `AIEvent` type union
30
+ - Add `AnswerMetadata` interface for answer event metadata
31
+ - Fix AsyncIterable not signaling completion: now terminates on `complete` event in addition to `message_complete` and `error`
32
+ - Add error logging for malformed SSE JSON to aid debugging
33
+
3
34
  ## 1.9.0
4
35
 
5
36
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -273,7 +273,8 @@ async function* parseSSE(response) {
273
273
  await reader.cancel();
274
274
  return;
275
275
  }
276
- } catch {
276
+ } catch (err) {
277
+ console.error("[bold-js] Failed to parse SSE JSON:", json, err);
277
278
  }
278
279
  }
279
280
  if (done)
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
  */
@@ -207,14 +215,10 @@ type AIEvent = {
207
215
  videoId?: string;
208
216
  } | {
209
217
  type: "sources";
210
- sources: Source[];
218
+ sources: Segment[];
211
219
  } | {
212
220
  type: "text_delta";
213
221
  delta: string;
214
- } | {
215
- type: "clarification";
216
- content: string;
217
- questions: string[];
218
222
  } | {
219
223
  type: "recommendations";
220
224
  recommendations: Recommendation[];
@@ -222,7 +226,8 @@ type AIEvent = {
222
226
  type: "message_complete";
223
227
  conversationId?: string;
224
228
  content: string;
225
- sources: Source[];
229
+ citations: Segment[];
230
+ responseType: "answer" | "clarification";
226
231
  usage?: AIUsage;
227
232
  context?: AIContextMessage[];
228
233
  recommendations?: Recommendation[];
@@ -484,4 +489,4 @@ declare const DEFAULT_API_BASE_URL = "https://app.boldvideo.io/api/v1/";
484
489
  */
485
490
  declare const DEFAULT_INTERNAL_API_BASE_URL = "https://app.boldvideo.io/i/v1/";
486
491
 
487
- 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
@@ -235,7 +235,8 @@ async function* parseSSE(response) {
235
235
  await reader.cancel();
236
236
  return;
237
237
  }
238
- } catch {
238
+ } catch (err) {
239
+ console.error("[bold-js] Failed to parse SSE JSON:", json, err);
239
240
  }
240
241
  }
241
242
  if (done)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@boldvideo/bold-js",
3
3
  "license": "MIT",
4
- "version": "1.9.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",