@boldvideo/bold-js 1.10.0 → 1.11.1

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,31 @@
1
1
  # @boldvideo/bold-js
2
2
 
3
+ ## 1.11.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 0428b78: Add `cited` boolean field to Segment type for stable citation ordering
8
+
9
+ ## 1.11.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 88c5d1c: Remove deprecated SSE event types and add Segment type
14
+
15
+ **Breaking changes to `AIEvent` type:**
16
+
17
+ - Remove deprecated event types: `token`, `clarification`, `answer`, `complete`
18
+ - Remove `AnswerMetadata` interface
19
+ - Change `message_complete` event: `sources` field renamed to `citations`, added `responseType: "answer" | "clarification"`
20
+
21
+ **New exports:**
22
+
23
+ - `Segment` - Primary type for video segments (replaces Source)
24
+ - `Citation` - Semantic alias for Segment (for cited chunks)
25
+ - `Source` - Now a deprecated alias for Segment (kept for backwards compatibility)
26
+
27
+ This aligns the SDK with the simplified backend SSE event structure.
28
+
3
29
  ## 1.10.0
4
30
 
5
31
  ### 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;
@@ -190,7 +190,16 @@ interface Source {
190
190
  timestampEnd: number;
191
191
  playbackId: string;
192
192
  speaker?: string;
193
+ cited?: boolean;
193
194
  }
195
+ /**
196
+ * @deprecated Use Segment instead
197
+ */
198
+ type Source = Segment;
199
+ /**
200
+ * Alias for Segment - represents chunks the LLM actually cited
201
+ */
202
+ type Citation = Segment;
194
203
  /**
195
204
  * Token usage statistics
196
205
  */
@@ -198,14 +207,6 @@ interface AIUsage {
198
207
  inputTokens: number;
199
208
  outputTokens: number;
200
209
  }
201
- /**
202
- * Metadata included with answer events
203
- */
204
- interface AnswerMetadata {
205
- topScore: number;
206
- chunksFound: number;
207
- videosSearched: number;
208
- }
209
210
  /**
210
211
  * SSE event types for AI streaming responses
211
212
  */
@@ -215,39 +216,23 @@ type AIEvent = {
215
216
  videoId?: string;
216
217
  } | {
217
218
  type: "sources";
218
- sources: Source[];
219
+ sources: Segment[];
219
220
  } | {
220
221
  type: "text_delta";
221
222
  delta: string;
222
- } | {
223
- type: "token";
224
- content: string;
225
- } | {
226
- type: "clarification";
227
- content: string;
228
- questions: string[];
229
223
  } | {
230
224
  type: "recommendations";
231
225
  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
226
  } | {
241
227
  type: "message_complete";
242
228
  conversationId?: string;
243
229
  content: string;
244
- sources: Source[];
230
+ citations: Segment[];
231
+ responseType: "answer" | "clarification";
245
232
  usage?: AIUsage;
246
233
  context?: AIContextMessage[];
247
234
  recommendations?: Recommendation[];
248
235
  guidance?: string;
249
- } | {
250
- type: "complete";
251
236
  } | {
252
237
  type: "error";
253
238
  code: string;
@@ -505,4 +490,4 @@ declare const DEFAULT_API_BASE_URL = "https://app.boldvideo.io/api/v1/";
505
490
  */
506
491
  declare const DEFAULT_INTERNAL_API_BASE_URL = "https://app.boldvideo.io/i/v1/";
507
492
 
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 };
493
+ 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.1",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",