@escapeaihq/client-core 0.138.0 → 0.139.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@escapeaihq/client-core",
3
- "version": "0.138.0",
3
+ "version": "0.139.0",
4
4
  "description": "Framework-agnostic Seer client library: audio I/O, viseme lip-sync, WebSocket framing, REST. Consumed by both seer-agent's React web/ and the Vue Escape web-app.",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -357,6 +357,27 @@ describe('listPersonasByVideo', () => {
357
357
  });
358
358
  });
359
359
 
360
+ describe('listViewerPersonasByVideo (§Q SHOW.8)', () => {
361
+ it('GETs the viewer roster: source_video_id + includeBlessed=true', async () => {
362
+ const fetchMock = mockJson({ personas: [], total: 0, next_token: null, traceId: 't-1' });
363
+
364
+ const result = await makeClient().listViewerPersonasByVideo('the-trade-main-video');
365
+
366
+ const [url] = fetchMock.mock.calls[0];
367
+ expect(url).toBe(
368
+ `${TEST_CHAT_BASE_URL}/api/v1/personas?source_video_id=the-trade-main-video&includeBlessed=true`,
369
+ );
370
+ expect(result.traceId).toBe('t-1');
371
+ });
372
+
373
+ it('leaves the plain video roster request unchanged', async () => {
374
+ const fetchMock = mockJson({ personas: [], total: 0, next_token: null });
375
+ await makeClient().listPersonas({ sourceVideoId: 'v-9', includeBlessed: false });
376
+ const [url] = fetchMock.mock.calls[0];
377
+ expect(url).toBe(`${TEST_CHAT_BASE_URL}/api/v1/personas?source_video_id=v-9`);
378
+ });
379
+ });
380
+
360
381
  // A fetch mock returning a binary body via `.blob()` (the audio/wav response).
361
382
  const mockBlob = (
362
383
  body: BlobPart,
package/src/api.ts CHANGED
@@ -4525,6 +4525,8 @@ export interface PersonaListResponse {
4525
4525
  personas: PersonaConfig[];
4526
4526
  total: number;
4527
4527
  next_token?: string | null;
4528
+ /** §Q SHOW.8 — per-request correlation id; absent from an older backend. */
4529
+ traceId?: string | null;
4528
4530
  }
4529
4531
 
4530
4532
  // ==================== C3a persona-generation types ====================
@@ -10003,10 +10005,25 @@ export class ApiClient {
10003
10005
  nextToken?: string;
10004
10006
  status?: 'pending' | 'approved';
10005
10007
  sourceVideoId?: string;
10008
+ includeBlessed?: boolean;
10006
10009
  }): Promise<PersonaListResponse> {
10007
10010
  return this.personas.listPersonas(params);
10008
10011
  }
10009
10012
 
10013
+ /**
10014
+ * §Q SHOW.8: the VIEWER roster of one video — the personas a viewer may pick
10015
+ * and chat with. The caller's own personas of the video (as
10016
+ * {@link listPersonasByVideo} returns them), plus other creators' personas of
10017
+ * it that this caller may read (blessed and approved), each shaped exactly
10018
+ * like {@link getPersona}'s viewer copy (no authored prompt). Sends
10019
+ * `?source_video_id=<id>&includeBlessed=true`; the backend answers 403 when
10020
+ * the caller may not read the video. An older backend answers 400 (unknown
10021
+ * parameter).
10022
+ */
10023
+ async listViewerPersonasByVideo(sourceVideoId: string): Promise<PersonaListResponse> {
10024
+ return this.personas.listViewerPersonasByVideo(sourceVideoId);
10025
+ }
10026
+
10010
10027
  /**
10011
10028
  * C3a: list the personas auto-generated from a given source video. Thin
10012
10029
  * wrapper over {@link listPersonas} with ``sourceVideoId`` — backs the review
@@ -212,6 +212,7 @@ export class PersonasApi {
212
212
  nextToken?: string;
213
213
  status?: 'pending' | 'approved';
214
214
  sourceVideoId?: string;
215
+ includeBlessed?: boolean;
215
216
  }): Promise<PersonaListResponse> {
216
217
  const searchParams = new URLSearchParams();
217
218
  if (params?.limit) searchParams.append('limit', params.limit.toString());
@@ -219,6 +220,7 @@ export class PersonasApi {
219
220
  if (params?.status) searchParams.append('status', params.status);
220
221
  // Wire param is snake_case (matches the backend Query alias).
221
222
  if (params?.sourceVideoId) searchParams.append('source_video_id', params.sourceVideoId);
223
+ if (params?.includeBlessed) searchParams.append('includeBlessed', 'true');
222
224
 
223
225
  const query = searchParams.toString();
224
226
  const endpoint = `/api/v1/personas${query ? `?${query}` : ''}`;
@@ -231,6 +233,11 @@ export class PersonasApi {
231
233
  return this.listPersonas({ sourceVideoId });
232
234
  }
233
235
 
236
+ /** See {@link ApiClient.listViewerPersonasByVideo}. */
237
+ async listViewerPersonasByVideo(sourceVideoId: string): Promise<PersonaListResponse> {
238
+ return this.listPersonas({ sourceVideoId, includeBlessed: true });
239
+ }
240
+
234
241
  /** See {@link ApiClient.getDefaultPersona}. */
235
242
  async getDefaultPersona(): Promise<PersonaConfig | null> {
236
243
  return this.transport.requestJson<PersonaConfig | null>(
@@ -665,6 +665,11 @@ export const GENERATED_AGENT_TOOL_CONTRACT: readonly GeneratedAgentToolContract[
665
665
  type: "string",
666
666
  required: false,
667
667
  },
668
+ {
669
+ name: "includeBlessed",
670
+ type: "boolean",
671
+ required: false,
672
+ },
668
673
  ],
669
674
  },
670
675
  {
@@ -73,6 +73,7 @@ export const AGENT_TOOL_SCHEMAS = [
73
73
  { name: 'prefix', type: 'string', required: false, description: 'Optional prefix to filter objects by directory path' },
74
74
  { name: 'pageSize', type: 'integer', required: false, description: 'Maximum number of videos to return per page (1-100)' },
75
75
  { name: 'continuationToken', type: 'string', required: false, description: 'Token from previous response to continue pagination' },
76
+ { name: 'includeBlessed', type: 'boolean', required: false, description: 'Also list videos published to every user (blessed); those rows have no download URL. Defaults to true for the tool.' },
76
77
  ],
77
78
  },
78
79
  {