@boldvideo/bold-js 1.4.0 → 1.5.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,38 @@
1
1
  # @boldvideo/bold-js
2
2
 
3
+ ## 1.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - c86e99c: Add conversation context support to AI Search
8
+
9
+ - Added `context` parameter to `SearchOptions` for passing conversation history
10
+ - Added `context` field to `AIResponse` for receiving updated conversation context
11
+ - Added `AIContextMessage` type for type-safe context messages
12
+ - Updated README with multi-turn conversation example
13
+
14
+ Usage:
15
+
16
+ ```typescript
17
+ const first = await bold.ai.search({
18
+ prompt: "How do designers find clients?",
19
+ stream: false,
20
+ });
21
+ const followUp = await bold.ai.search({
22
+ prompt: "What about cold outreach?",
23
+ context: first.context,
24
+ stream: false,
25
+ });
26
+ ```
27
+
28
+ ### Patch Changes
29
+
30
+ - c961807: Fix AI search SSE stream termination: wait for 'complete' event instead of closing on 'message_complete'
31
+
32
+ - Added missing event types to AIEvent union: complete, token, answer
33
+ - Fixed parseSSE to terminate on 'complete' or 'error' events
34
+ - Added optional fields to match backend spec (query, context, response_id)
35
+
3
36
  ## 1.4.0
4
37
 
5
38
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -247,7 +247,7 @@ async function* parseSSE(response) {
247
247
  try {
248
248
  const event = JSON.parse(json);
249
249
  yield event;
250
- if (event.type === "message_complete" || event.type === "error") {
250
+ if (event.type === "complete" || event.type === "error") {
251
251
  await reader.cancel();
252
252
  return;
253
253
  }
package/dist/index.d.ts CHANGED
@@ -208,9 +208,18 @@ type AIEvent = {
208
208
  } | {
209
209
  type: "sources";
210
210
  sources: Source[];
211
+ query?: string;
211
212
  } | {
212
213
  type: "text_delta";
213
214
  delta: string;
215
+ } | {
216
+ type: "token";
217
+ content: string;
218
+ } | {
219
+ type: "answer";
220
+ content: string;
221
+ response_id?: string;
222
+ context?: AIContextMessage[];
214
223
  } | {
215
224
  type: "clarification";
216
225
  questions: string[];
@@ -218,7 +227,10 @@ type AIEvent = {
218
227
  type: "message_complete";
219
228
  content: string;
220
229
  sources: Source[];
221
- usage: AIUsage;
230
+ usage?: AIUsage;
231
+ context?: AIContextMessage[];
232
+ } | {
233
+ type: "complete";
222
234
  } | {
223
235
  type: "error";
224
236
  code: string;
package/dist/index.js CHANGED
@@ -209,7 +209,7 @@ async function* parseSSE(response) {
209
209
  try {
210
210
  const event = JSON.parse(json);
211
211
  yield event;
212
- if (event.type === "message_complete" || event.type === "error") {
212
+ if (event.type === "complete" || event.type === "error") {
213
213
  await reader.cancel();
214
214
  return;
215
215
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@boldvideo/bold-js",
3
3
  "license": "MIT",
4
- "version": "1.4.0",
4
+ "version": "1.5.0",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",