realtime-avatar 0.21.0 → 0.23.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/README.md +57 -0
- package/dist/{chunk-2VN375GX.js → chunk-6JLDTWL4.js} +15 -4
- package/dist/{chunk-SQ3AZDX2.js → chunk-ICBVEIRK.js} +1 -1
- package/dist/express.d.ts +2 -2
- package/dist/express.js +2 -2
- package/dist/hono.d.ts +2 -2
- package/dist/hono.js +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/nextjs.d.ts +2 -2
- package/dist/nextjs.js +2 -2
- package/dist/{proxy-client-DsWFCGHn.d.ts → proxy-client-DlFXaXtn.d.ts} +137 -7
- package/dist/react-native.d.ts +2 -2
- package/dist/react-native.js +94 -15
- package/dist/react.d.ts +15 -3
- package/dist/react.js +316 -16
- package/dist/recording-DjswTx5B.d.ts +198 -0
- package/dist/recording.d.ts +34 -133
- package/dist/recording.js +42 -4
- package/dist/server.d.ts +1 -1
- package/dist/server.js +1 -1
- package/dist/tanstack-start.d.ts +2 -2
- package/dist/tanstack-start.js +2 -2
- package/dist/{types-Cmto2uGs.d.ts → types-C7s0yw8q.d.ts} +393 -7
- package/dist/{types-k6pW-wKA.d.ts → types-DP4GsT1R.d.ts} +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -143,6 +143,32 @@ Two facts follow from that picture and drive everything else:
|
|
|
143
143
|
|
|
144
144
|
---
|
|
145
145
|
|
|
146
|
+
## Input source on room messages
|
|
147
|
+
|
|
148
|
+
On React and React Native, `session.sendTurn(text)` automatically observes text.
|
|
149
|
+
For already recognized speech, bind
|
|
150
|
+
`session.createTranscriptSender({ inputSource: "client_stt" })` once per session.
|
|
151
|
+
The adapter defaults to `client_stt`; it captures its own default, and accepts a
|
|
152
|
+
per-send `{ inputSource: "text" }` override. `sendTurn` accepts the same optional
|
|
153
|
+
declaration. Only `text` and `client_stt` are valid client declarations. No speech
|
|
154
|
+
recognition engine is included. `instructions` still work on either sender.
|
|
155
|
+
|
|
156
|
+
`retryTurn()` preserves the resolved source and declaration scope after a timeout,
|
|
157
|
+
with a new `turn_id` and `retry_of_turn_id` pointing to the previous attempt.
|
|
158
|
+
Room consumers receive the attributes through the existing `lk.chat` text stream.
|
|
159
|
+
`useChat().chatMessages` exposes them as `message.attributes`; an imperative receiver
|
|
160
|
+
can read `reader.info.attributes` in `registerTextStreamHandler("lk.chat", handler)`.
|
|
161
|
+
The observation is `rta.observed_input_source`; the optional declaration and scope
|
|
162
|
+
are `rta.declared_input_source` and `rta.input_source_declaration_scope`. Missing
|
|
163
|
+
legacy attributes remain unknown. Use one handler owner per topic; a `useChat`
|
|
164
|
+
consumer should not register a duplicate raw handler on the same room.
|
|
165
|
+
|
|
166
|
+
This path needs no inference or platform changes. The consumer must already be
|
|
167
|
+
connected to the room, and text-stream messages are not durable webhook deliveries.
|
|
168
|
+
The legacy `lk-chat-topic` compatibility path omits attributes. Automatic RTA server
|
|
169
|
+
STT attribution and final transcript webhook provenance are separate work. Existing
|
|
170
|
+
webhook types and behavior are unchanged.
|
|
171
|
+
|
|
146
172
|
## API
|
|
147
173
|
|
|
148
174
|
Everything is on one class. The full types are in
|
|
@@ -359,3 +385,34 @@ for building your own queue UI, and the zod schemas `sessionBehaviorSchema` / `s
|
|
|
359
385
|
- The API is versioned at `/api/v1`; breaking changes get a new version, not a silent edit.
|
|
360
386
|
|
|
361
387
|
MIT licensed.
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
### Continuous participant recordings
|
|
391
|
+
|
|
392
|
+
Use `recording: "participants"` on your server to retain the two participants
|
|
393
|
+
separately. A camera-enabled call has four logical media tracks in two MP4 files:
|
|
394
|
+
user camera/microphone and character video/voice. Each file is continuous through
|
|
395
|
+
camera mute, unpublish and republish; the user's microphone continues while their
|
|
396
|
+
camera is off. `camera: true` is still a separate publication permission, and
|
|
397
|
+
recording alone never opens a camera. Voice-only participants get audio-only MP4s.
|
|
398
|
+
|
|
399
|
+
The returned `call.recordings` contains both pending artifacts, while legacy
|
|
400
|
+
modes retain `call.recording`. Once finalized, use `listRecordings({ sessionId })`
|
|
401
|
+
and `getRecordingAccess(recordingId)` to retrieve authorized, renewable URLs.
|
|
402
|
+
`recording.participant.role` identifies the user or character; media timestamps
|
|
403
|
+
align the files without fixing their visual layout. Keep failed/missing files
|
|
404
|
+
visible instead of treating the surviving participant as a complete recording.
|
|
405
|
+
|
|
406
|
+
```tsx
|
|
407
|
+
import { RecordingPlayer } from "realtime-avatar/react";
|
|
408
|
+
|
|
409
|
+
// assets comes from your authenticated application endpoint.
|
|
410
|
+
// Each item is { recording, url }; refresh expiring URLs through your server.
|
|
411
|
+
<RecordingPlayer assets={assets} />
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
The player provides one play/pause control and one seek bar for both files. It
|
|
415
|
+
plays each file's audio once, preserves start offsets, waits for buffering and
|
|
416
|
+
refuses to guess synchronization when media timestamps are missing. Original
|
|
417
|
+
files remain independently playable and editable. Participant departure ends
|
|
418
|
+
that file; a new call is a new session, not an automatic concatenation.
|
|
@@ -234,15 +234,22 @@ var schema26 = z.strictObject({
|
|
|
234
234
|
var clipLibraryResponseSchema = schema24;
|
|
235
235
|
var clipLibraryUpdateSchema = schema26;
|
|
236
236
|
var RECORDED_MEDIA_MODES = ["audio", "video", "audio_video"];
|
|
237
|
-
var recordingModeSchema = z.enum(["off", ...RECORDED_MEDIA_MODES]).describe("Server-owned recording policy; omitted means off.
|
|
237
|
+
var recordingModeSchema = z.enum(["off", ...RECORDED_MEDIA_MODES, "participants"]).describe("Server-owned recording policy; omitted means off. Legacy audio includes user and avatar audio. participants saves one continuous audio/video file per participant, without mixing their voices.");
|
|
238
238
|
var RECORDING_STATUSES = ["pending", "recording", "processing", "ready", "failed", "expired"];
|
|
239
239
|
z.enum(RECORDING_STATUSES);
|
|
240
|
+
var recordingParticipantSchema = z.object({
|
|
241
|
+
participantIdentity: z.string().min(1).max(160),
|
|
242
|
+
role: z.enum(["user", "avatar"])
|
|
243
|
+
}).strict();
|
|
240
244
|
var recordingMetadataSchema = z.object({
|
|
241
245
|
sessionId: z.string().min(1),
|
|
242
246
|
recordingId: z.string().min(1),
|
|
243
|
-
mode:
|
|
247
|
+
mode: z.enum(RECORDED_MEDIA_MODES),
|
|
244
248
|
createdAt: z.string().datetime({ offset: true }),
|
|
245
|
-
retainedUntil: z.string().datetime({ offset: true })
|
|
249
|
+
retainedUntil: z.string().datetime({ offset: true }),
|
|
250
|
+
participant: recordingParticipantSchema.optional(),
|
|
251
|
+
mediaStartedAt: z.string().datetime({ offset: true }).optional(),
|
|
252
|
+
mediaEndedAt: z.string().datetime({ offset: true }).optional()
|
|
246
253
|
});
|
|
247
254
|
var recordingArtifactSchema = z.discriminatedUnion("status", [
|
|
248
255
|
recordingMetadataSchema.extend({ status: z.enum(["pending", "recording", "processing", "expired"]) }).strict(),
|
|
@@ -548,6 +555,8 @@ z.object({
|
|
|
548
555
|
}).strict();
|
|
549
556
|
var liveKitSessionGrantSchema = z.object({
|
|
550
557
|
recording: recordingArtifactSchema.optional(),
|
|
558
|
+
recording_mode: recordingModeSchema.optional(),
|
|
559
|
+
recordings: z.array(recordingArtifactSchema).max(2).optional(),
|
|
551
560
|
connection_history: connectionHistoryGrantSchema.optional(),
|
|
552
561
|
status: z.literal("ready").default("ready"),
|
|
553
562
|
session_id: z.string().min(1),
|
|
@@ -645,7 +654,7 @@ z.enum([
|
|
|
645
654
|
|
|
646
655
|
// ../http-client/src/client.ts
|
|
647
656
|
var DEFAULT_BASE_URL = "https://realtimeavatar.ai/api/v1";
|
|
648
|
-
var SDK_VERSION = "0.
|
|
657
|
+
var SDK_VERSION = "0.23.0";
|
|
649
658
|
var RealtimeAvatar = class {
|
|
650
659
|
#apiKey;
|
|
651
660
|
#baseUrl;
|
|
@@ -718,6 +727,8 @@ var RealtimeAvatar = class {
|
|
|
718
727
|
return {
|
|
719
728
|
status: "ready",
|
|
720
729
|
...grant.recording === void 0 ? {} : { recording: grant.recording },
|
|
730
|
+
...grant.recording_mode === void 0 ? {} : { recordingMode: grant.recording_mode },
|
|
731
|
+
...grant.recordings === void 0 ? {} : { recordings: grant.recordings },
|
|
721
732
|
sessionId: grant.session_id,
|
|
722
733
|
roomName: grant.room_name,
|
|
723
734
|
livekitUrl: grant.livekit_url,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RealtimeAvatar, isQueued, RealtimeAvatarHttpError } from './chunk-
|
|
1
|
+
import { RealtimeAvatar, isQueued, RealtimeAvatarHttpError } from './chunk-6JLDTWL4.js';
|
|
2
2
|
|
|
3
3
|
// ../proxy/src/config.ts
|
|
4
4
|
var json = (body, status = 200) => new Response(JSON.stringify(body), {
|
package/dist/express.d.ts
CHANGED
package/dist/express.js
CHANGED
package/dist/hono.d.ts
CHANGED
package/dist/hono.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as CallPolicy, C as CallMode, S as StartCallResult, E as EndCallOptions, A as Avatar, b as AvatarUpdate, c as AvatarSourceSwap, d as ClipLibraryDeclaration, e as ClipLibraryUpdate, L as LoopRedirect, f as ClipLibrary, g as AssetKind, h as Asset, i as ListSessionsOptions, U as UsageSessionPage, j as UsageSession, k as ListRecordingsQuery, l as ListRecordingsResponse, R as RecordingArtifact, m as RecordingAccessResponse, n as CreditBalance, T as TranscriptPayload } from './types-
|
|
2
|
-
export { o as AvatarClip, p as CallConnection, q as CallQueued, r as ClipDeclaration, s as ClipLibraryPlan, t as ClipSource, u as ContextMessage, v as EndCallReason, w as RecordingArtifactStatus, x as RecordingMode, V as VideoPolicy, y as isQueued, z as listRecordingsResponseSchema, B as recordingAccessResponseSchema, D as recordingArtifactSchema, F as recordingModeSchema } from './types-
|
|
1
|
+
import { a as CallPolicy, C as CallMode, S as StartCallResult, E as EndCallOptions, A as Avatar, b as AvatarUpdate, c as AvatarSourceSwap, d as ClipLibraryDeclaration, e as ClipLibraryUpdate, L as LoopRedirect, f as ClipLibrary, g as AssetKind, h as Asset, i as ListSessionsOptions, U as UsageSessionPage, j as UsageSession, k as ListRecordingsQuery, l as ListRecordingsResponse, R as RecordingArtifact, m as RecordingAccessResponse, n as CreditBalance, T as TranscriptPayload } from './types-C7s0yw8q.js';
|
|
2
|
+
export { o as AvatarClip, p as CallConnection, q as CallQueued, r as ClipDeclaration, s as ClipLibraryPlan, t as ClipSource, u as ContextMessage, v as EndCallReason, w as RecordingArtifactStatus, x as RecordingMode, V as VideoPolicy, y as isQueued, z as listRecordingsResponseSchema, B as recordingAccessResponseSchema, D as recordingArtifactSchema, F as recordingModeSchema } from './types-C7s0yw8q.js';
|
|
3
3
|
import { ConnectionHistoryResponse } from './connection-history.js';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { RealtimeAvatar, RealtimeAvatarError, RealtimeAvatarHttpError, clipLibraryDeclarationSchema, isQueued, listRecordingsResponseSchema, recordingAccessResponseSchema, recordingArtifactSchema, recordingModeSchema, verifyTranscript } from './chunk-
|
|
1
|
+
export { RealtimeAvatar, RealtimeAvatarError, RealtimeAvatarHttpError, clipLibraryDeclarationSchema, isQueued, listRecordingsResponseSchema, recordingAccessResponseSchema, recordingArtifactSchema, recordingModeSchema, verifyTranscript } from './chunk-6JLDTWL4.js';
|
|
2
2
|
import './chunk-MCIXU6XP.js';
|
package/dist/nextjs.d.ts
CHANGED
package/dist/nextjs.js
CHANGED
|
@@ -135,8 +135,8 @@ declare const liveKitSessionRequestSchema: z.ZodObject<{
|
|
|
135
135
|
instructions: z.ZodOptional<z.ZodString>;
|
|
136
136
|
initialContext: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
137
137
|
role: z.ZodEnum<{
|
|
138
|
-
system: "system";
|
|
139
138
|
user: "user";
|
|
139
|
+
system: "system";
|
|
140
140
|
assistant: "assistant";
|
|
141
141
|
}>;
|
|
142
142
|
content: z.ZodString;
|
|
@@ -253,6 +253,15 @@ declare const liveKitSessionGrantSchema: z.ZodObject<{
|
|
|
253
253
|
}>;
|
|
254
254
|
createdAt: z.ZodString;
|
|
255
255
|
retainedUntil: z.ZodString;
|
|
256
|
+
participant: z.ZodOptional<z.ZodObject<{
|
|
257
|
+
participantIdentity: z.ZodString;
|
|
258
|
+
role: z.ZodEnum<{
|
|
259
|
+
user: "user";
|
|
260
|
+
avatar: "avatar";
|
|
261
|
+
}>;
|
|
262
|
+
}, z.core.$strict>>;
|
|
263
|
+
mediaStartedAt: z.ZodOptional<z.ZodString>;
|
|
264
|
+
mediaEndedAt: z.ZodOptional<z.ZodString>;
|
|
256
265
|
status: z.ZodEnum<{
|
|
257
266
|
pending: "pending";
|
|
258
267
|
recording: "recording";
|
|
@@ -269,6 +278,15 @@ declare const liveKitSessionGrantSchema: z.ZodObject<{
|
|
|
269
278
|
}>;
|
|
270
279
|
createdAt: z.ZodString;
|
|
271
280
|
retainedUntil: z.ZodString;
|
|
281
|
+
participant: z.ZodOptional<z.ZodObject<{
|
|
282
|
+
participantIdentity: z.ZodString;
|
|
283
|
+
role: z.ZodEnum<{
|
|
284
|
+
user: "user";
|
|
285
|
+
avatar: "avatar";
|
|
286
|
+
}>;
|
|
287
|
+
}, z.core.$strict>>;
|
|
288
|
+
mediaStartedAt: z.ZodOptional<z.ZodString>;
|
|
289
|
+
mediaEndedAt: z.ZodOptional<z.ZodString>;
|
|
272
290
|
status: z.ZodLiteral<"ready">;
|
|
273
291
|
mediaType: z.ZodEnum<{
|
|
274
292
|
"audio/mp4": "audio/mp4";
|
|
@@ -286,12 +304,104 @@ declare const liveKitSessionGrantSchema: z.ZodObject<{
|
|
|
286
304
|
}>;
|
|
287
305
|
createdAt: z.ZodString;
|
|
288
306
|
retainedUntil: z.ZodString;
|
|
307
|
+
participant: z.ZodOptional<z.ZodObject<{
|
|
308
|
+
participantIdentity: z.ZodString;
|
|
309
|
+
role: z.ZodEnum<{
|
|
310
|
+
user: "user";
|
|
311
|
+
avatar: "avatar";
|
|
312
|
+
}>;
|
|
313
|
+
}, z.core.$strict>>;
|
|
314
|
+
mediaStartedAt: z.ZodOptional<z.ZodString>;
|
|
315
|
+
mediaEndedAt: z.ZodOptional<z.ZodString>;
|
|
289
316
|
status: z.ZodLiteral<"failed">;
|
|
290
317
|
errorCode: z.ZodEnum<{
|
|
291
318
|
recording_failed: "recording_failed";
|
|
292
319
|
recording_unavailable: "recording_unavailable";
|
|
293
320
|
}>;
|
|
294
321
|
}, z.core.$strict>], "status">>;
|
|
322
|
+
recording_mode: z.ZodOptional<z.ZodEnum<{
|
|
323
|
+
audio: "audio";
|
|
324
|
+
video: "video";
|
|
325
|
+
audio_video: "audio_video";
|
|
326
|
+
off: "off";
|
|
327
|
+
participants: "participants";
|
|
328
|
+
}>>;
|
|
329
|
+
recordings: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
330
|
+
sessionId: z.ZodString;
|
|
331
|
+
recordingId: z.ZodString;
|
|
332
|
+
mode: z.ZodEnum<{
|
|
333
|
+
audio: "audio";
|
|
334
|
+
video: "video";
|
|
335
|
+
audio_video: "audio_video";
|
|
336
|
+
}>;
|
|
337
|
+
createdAt: z.ZodString;
|
|
338
|
+
retainedUntil: z.ZodString;
|
|
339
|
+
participant: z.ZodOptional<z.ZodObject<{
|
|
340
|
+
participantIdentity: z.ZodString;
|
|
341
|
+
role: z.ZodEnum<{
|
|
342
|
+
user: "user";
|
|
343
|
+
avatar: "avatar";
|
|
344
|
+
}>;
|
|
345
|
+
}, z.core.$strict>>;
|
|
346
|
+
mediaStartedAt: z.ZodOptional<z.ZodString>;
|
|
347
|
+
mediaEndedAt: z.ZodOptional<z.ZodString>;
|
|
348
|
+
status: z.ZodEnum<{
|
|
349
|
+
pending: "pending";
|
|
350
|
+
recording: "recording";
|
|
351
|
+
processing: "processing";
|
|
352
|
+
expired: "expired";
|
|
353
|
+
}>;
|
|
354
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
355
|
+
sessionId: z.ZodString;
|
|
356
|
+
recordingId: z.ZodString;
|
|
357
|
+
mode: z.ZodEnum<{
|
|
358
|
+
audio: "audio";
|
|
359
|
+
video: "video";
|
|
360
|
+
audio_video: "audio_video";
|
|
361
|
+
}>;
|
|
362
|
+
createdAt: z.ZodString;
|
|
363
|
+
retainedUntil: z.ZodString;
|
|
364
|
+
participant: z.ZodOptional<z.ZodObject<{
|
|
365
|
+
participantIdentity: z.ZodString;
|
|
366
|
+
role: z.ZodEnum<{
|
|
367
|
+
user: "user";
|
|
368
|
+
avatar: "avatar";
|
|
369
|
+
}>;
|
|
370
|
+
}, z.core.$strict>>;
|
|
371
|
+
mediaStartedAt: z.ZodOptional<z.ZodString>;
|
|
372
|
+
mediaEndedAt: z.ZodOptional<z.ZodString>;
|
|
373
|
+
status: z.ZodLiteral<"ready">;
|
|
374
|
+
mediaType: z.ZodEnum<{
|
|
375
|
+
"audio/mp4": "audio/mp4";
|
|
376
|
+
"video/mp4": "video/mp4";
|
|
377
|
+
}>;
|
|
378
|
+
sizeBytes: z.ZodNumber;
|
|
379
|
+
durationMs: z.ZodNullable<z.ZodNumber>;
|
|
380
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
381
|
+
sessionId: z.ZodString;
|
|
382
|
+
recordingId: z.ZodString;
|
|
383
|
+
mode: z.ZodEnum<{
|
|
384
|
+
audio: "audio";
|
|
385
|
+
video: "video";
|
|
386
|
+
audio_video: "audio_video";
|
|
387
|
+
}>;
|
|
388
|
+
createdAt: z.ZodString;
|
|
389
|
+
retainedUntil: z.ZodString;
|
|
390
|
+
participant: z.ZodOptional<z.ZodObject<{
|
|
391
|
+
participantIdentity: z.ZodString;
|
|
392
|
+
role: z.ZodEnum<{
|
|
393
|
+
user: "user";
|
|
394
|
+
avatar: "avatar";
|
|
395
|
+
}>;
|
|
396
|
+
}, z.core.$strict>>;
|
|
397
|
+
mediaStartedAt: z.ZodOptional<z.ZodString>;
|
|
398
|
+
mediaEndedAt: z.ZodOptional<z.ZodString>;
|
|
399
|
+
status: z.ZodLiteral<"failed">;
|
|
400
|
+
errorCode: z.ZodEnum<{
|
|
401
|
+
recording_failed: "recording_failed";
|
|
402
|
+
recording_unavailable: "recording_unavailable";
|
|
403
|
+
}>;
|
|
404
|
+
}, z.core.$strict>], "status">>>;
|
|
295
405
|
connection_history: z.ZodOptional<z.ZodObject<{
|
|
296
406
|
endpoint: z.ZodString;
|
|
297
407
|
token: z.ZodString;
|
|
@@ -1379,6 +1489,12 @@ type AvatarConnectionDetails = Readonly<{
|
|
|
1379
1489
|
video: PublisherConnectionDetails | null;
|
|
1380
1490
|
}>;
|
|
1381
1491
|
type SessionLifecycleRoomBridgeProps = {
|
|
1492
|
+
/**
|
|
1493
|
+
* Authoritative agent output, not the requested mode or a missing-track heuristic.
|
|
1494
|
+
* Null means unknown (older worker / retired binding). Changing presentation must
|
|
1495
|
+
* not re-mint the session. Shared by web and native; late joins read stored state.
|
|
1496
|
+
*/
|
|
1497
|
+
onMediaModeChange?: (mode: "avatar" | "voice" | null) => void;
|
|
1382
1498
|
/**
|
|
1383
1499
|
* Opt in to an initial snapshot and changed facts. Null clears a retired binding.
|
|
1384
1500
|
* Callback failures never affect the call; no stats polling or uploads are added.
|
|
@@ -1403,7 +1519,7 @@ type SessionLifecycleRoomBridgeProps = {
|
|
|
1403
1519
|
*
|
|
1404
1520
|
* Renders nothing. Mount it once inside RealtimeAvatarLiveKitRoom.
|
|
1405
1521
|
*/
|
|
1406
|
-
declare function SessionLifecycleRoomBridge({ lifecycle, onConnectionDetailsChange, }: SessionLifecycleRoomBridgeProps): null;
|
|
1522
|
+
declare function SessionLifecycleRoomBridge({ lifecycle, onConnectionDetailsChange, onMediaModeChange, }: SessionLifecycleRoomBridgeProps): null;
|
|
1407
1523
|
|
|
1408
1524
|
/**
|
|
1409
1525
|
* The terminal, LABELED end reason surfaced to the app via `onEnded`. This is the
|
|
@@ -1462,6 +1578,9 @@ type TurnState = "listening" | "thinking" | "speaking" | "quiet";
|
|
|
1462
1578
|
*/
|
|
1463
1579
|
declare function mapTurnState(assistantState: string | null | undefined): TurnState;
|
|
1464
1580
|
|
|
1581
|
+
/** Source an application declares for text sent to an in-room consumer. */
|
|
1582
|
+
type DeclaredInputSource = "text" | "client_stt";
|
|
1583
|
+
|
|
1465
1584
|
/** How early `onApproachingEnd` fires before the hard cap (room to compose the goodbye). */
|
|
1466
1585
|
declare const DEFAULT_APPROACHING_END_LEAD_SECONDS = 45;
|
|
1467
1586
|
/** How early the grace window opens before the cap (fits LLM excuse + send RTT + TTS + playout). */
|
|
@@ -1480,6 +1599,17 @@ type ClosingTurnResult = {
|
|
|
1480
1599
|
type ExtendResult = {
|
|
1481
1600
|
ok: boolean;
|
|
1482
1601
|
};
|
|
1602
|
+
type SendTurnOptions = {
|
|
1603
|
+
instructions?: string;
|
|
1604
|
+
/** Optional declaration; the SDK still observes a text transport. */
|
|
1605
|
+
inputSource?: DeclaredInputSource;
|
|
1606
|
+
};
|
|
1607
|
+
type TranscriptSenderOptions = {
|
|
1608
|
+
/** Captured once for this sender. Defaults to client_stt. */
|
|
1609
|
+
inputSource?: DeclaredInputSource;
|
|
1610
|
+
};
|
|
1611
|
+
/** Send an already recognized transcript. This adapter does not capture or recognize audio. */
|
|
1612
|
+
type TranscriptSender = (text: string, opts?: SendTurnOptions) => Promise<void>;
|
|
1483
1613
|
type ApproachingEndEvent = {
|
|
1484
1614
|
secondsLeft: number;
|
|
1485
1615
|
reason: ApproachingEndReason;
|
|
@@ -1613,10 +1743,10 @@ type RealtimeSessionApi = SessionLifecycleApi & {
|
|
|
1613
1743
|
proof?: string;
|
|
1614
1744
|
}) => ExtendResult;
|
|
1615
1745
|
/** Send a normal turn THROUGH the SDK (arms the turn-timeout watchdog + enables retryTurn). */
|
|
1616
|
-
sendTurn: (text: string, opts?:
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
/** Re-send the last turn
|
|
1746
|
+
sendTurn: (text: string, opts?: SendTurnOptions) => Promise<void>;
|
|
1747
|
+
/** Bind a transcript source once; a send's explicit inputSource takes precedence. */
|
|
1748
|
+
createTranscriptSender: (opts?: TranscriptSenderOptions) => TranscriptSender;
|
|
1749
|
+
/** Re-send the last turn with its resolved provenance, a new ID, and retry_of_turn_id. */
|
|
1620
1750
|
retryTurn: () => void;
|
|
1621
1751
|
/** End gracefully now (the user tapped End). */
|
|
1622
1752
|
end: (reason?: EndReason) => void;
|
|
@@ -1738,4 +1868,4 @@ interface ProxyClientOptions {
|
|
|
1738
1868
|
}
|
|
1739
1869
|
declare function createProxyClient(options: ProxyClientOptions): AvatarSessionClient;
|
|
1740
1870
|
|
|
1741
|
-
export { type
|
|
1871
|
+
export { type ProxyClientOptions as $, type AvatarVideoFit as A, type BehaviorSnapshot as B, type CallTranscript as C, DEFAULT_APPROACHING_END_LEAD_SECONDS as D, type EndReason as E, type FishTtsModel as F, type Governor as G, type GovernorSignal as H, type GovernorState as I, type GraceWindowClosedEvent as J, type GraceWindowOpenEvent as K, type LiveKitSessionGrant as L, type GraceWindowState as M, type IdleWarningEvent as N, type InboundRtpCursor as O, type InboundRtpReading as P, type KnownBehaviorState as Q, type LLMProvider as R, type LLMSelection as S, type LiveKitAvatarGrantState as T, type LiveKitAvatarGrantStatus as U, type LiveKitCapacityState as V, type LiveKitConnectionStatus as W, type LiveKitSessionRequest as X, type LiveKitSessionStartResult as Y, MAX_RECONNECT_ATTEMPTS as Z, MAX_SESSION_INSTRUCTIONS_CHARS as _, AdaptivePlayoutController as a, shouldReplayPendingTurn as a$, type QualityCap as a0, RECONNECT_BACKOFF_MS as a1, type RealtimeAvatarRequestOptions as a2, type RealtimeSessionApi as a3, type RealtimeSessionMedia as a4, type RealtimeSessionRoomSinks as a5, type ReconnectPolicy as a6, type ReconnectingEvent as a7, type RecoveryState as a8, type RetryStep as a9, mapTurnState as aA, readInboundRtp as aB, sessionBehaviorSchema as aC, sessionClipSchema as aD, splitCallTranscript as aE, useAvatarAdaptivePlayoutDelay as aF, useAvatarCamera as aG, useAvatarPlayoutDelay as aH, useAvatarQualityGovernor as aI, useCallTranscript as aJ, useLiveKitAvatarGrant as aK, useLiveTrackProducing as aL, useMicLease as aM, useRealtimeSession as aN, useReleaseMicLeaseOnTrackEnded as aO, useSessionLifecycle as aP, AvatarVideoSurface as aQ, type AvatarVideoSurfaceProps as aR, type LivePlaybackKeeper as aS, MIC_LEASE_ENDED_TIMEOUT_MS as aT, type MicLease as aU, NETWORK_QUALITY_POLICY as aV, type NetworkQualityStatus as aW, type PlayableVideoElement as aX, RealtimeAvatarCapacityError as aY, RealtimeAvatarLiveKitRoom as aZ, type RealtimeAvatarLiveKitRoomProps as a_, type SendTurnOptions as aa, type SessionBehavior as ab, type SessionClip as ac, type SessionClocks as ad, type SessionEndReason as ae, type SessionLifecycleApi as af, type SessionLifecyclePhase as ag, type SessionLifecyclePhaseKind as ah, SessionLifecycleRoomBridge as ai, type SessionLifecycleRoomBridgeProps as aj, type SurfaceLayers as ak, type TranscriptSender as al, type TranscriptSenderOptions as am, type TurnState as an, type TurnTimeoutEvent as ao, type UseAvatarQualityGovernorInput as ap, type UseLiveKitAvatarGrantInput as aq, type UseRealtimeSessionInput as ar, type UseSessionLifecycleInput as as, type VoiceSpec as at, type VoiceSpecInput as au, capacityErrorFromBusy as av, capacityStateFromGrant as aw, createProxyClient as ax, isNativeLiveTrackSubscribed as ay, knownBehaviorStates as az, type AdaptivePlayoutDecision as b, type AdaptivePlayoutOptions as c, type AdaptivePlayoutSample as d, type ApproachingEndEvent as e, type ApproachingEndReason as f, type AvatarConnectionDetails as g, type AvatarSessionClient as h, type CallTranscriptSegment as i, type CartesiaTtsModel as j, type ClipResult as k, type ClosingTurnResult as l, type CreditsLowEvent as m, DEFAULT_CREDITS_LOW_LEAD_SECONDS as n, DEFAULT_GOVERNOR_CONFIG as o, DEFAULT_GRACE_CEILING_SECONDS as p, DEFAULT_GRACE_WINDOW_LEAD_SECONDS as q, DEFAULT_IDLE_SECONDS as r, DEFAULT_IDLE_WARN_LEAD_SECONDS as s, DEFAULT_TURN_TIMEOUT_SECONDS as t, type DeclaredInputSource as u, type EndedEvent as v, type ExtendResult as w, type FreezeReadingFn as x, type GovernorAction as y, type GovernorConfig as z };
|
package/dist/react-native.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LiveKitRoomProps } from '@livekit/react-native';
|
|
2
2
|
export { AudioSession, VideoTrack, VideoTrackProps, registerGlobals } from '@livekit/react-native';
|
|
3
|
-
import { L as LiveKitSessionGrant, A as AvatarVideoFit } from './proxy-client-
|
|
4
|
-
export { a as AdaptivePlayoutController, b as AdaptivePlayoutDecision, c as AdaptivePlayoutOptions, d as AdaptivePlayoutSample, e as ApproachingEndEvent, f as ApproachingEndReason, g as AvatarConnectionDetails, h as AvatarSessionClient, B as BehaviorSnapshot, C as CallTranscript, i as CallTranscriptSegment, j as CartesiaTtsModel, k as ClipResult, l as ClosingTurnResult, m as CreditsLowEvent, D as DEFAULT_APPROACHING_END_LEAD_SECONDS, n as DEFAULT_CREDITS_LOW_LEAD_SECONDS, o as DEFAULT_GOVERNOR_CONFIG, p as DEFAULT_GRACE_CEILING_SECONDS, q as DEFAULT_GRACE_WINDOW_LEAD_SECONDS, r as DEFAULT_IDLE_SECONDS, s as DEFAULT_IDLE_WARN_LEAD_SECONDS, t as DEFAULT_TURN_TIMEOUT_SECONDS, E as EndReason,
|
|
3
|
+
import { L as LiveKitSessionGrant, A as AvatarVideoFit } from './proxy-client-DlFXaXtn.js';
|
|
4
|
+
export { a as AdaptivePlayoutController, b as AdaptivePlayoutDecision, c as AdaptivePlayoutOptions, d as AdaptivePlayoutSample, e as ApproachingEndEvent, f as ApproachingEndReason, g as AvatarConnectionDetails, h as AvatarSessionClient, B as BehaviorSnapshot, C as CallTranscript, i as CallTranscriptSegment, j as CartesiaTtsModel, k as ClipResult, l as ClosingTurnResult, m as CreditsLowEvent, D as DEFAULT_APPROACHING_END_LEAD_SECONDS, n as DEFAULT_CREDITS_LOW_LEAD_SECONDS, o as DEFAULT_GOVERNOR_CONFIG, p as DEFAULT_GRACE_CEILING_SECONDS, q as DEFAULT_GRACE_WINDOW_LEAD_SECONDS, r as DEFAULT_IDLE_SECONDS, s as DEFAULT_IDLE_WARN_LEAD_SECONDS, t as DEFAULT_TURN_TIMEOUT_SECONDS, u as DeclaredInputSource, E as EndReason, v as EndedEvent, w as ExtendResult, F as FishTtsModel, x as FreezeReadingFn, G as Governor, y as GovernorAction, z as GovernorConfig, H as GovernorSignal, I as GovernorState, J as GraceWindowClosedEvent, K as GraceWindowOpenEvent, M as GraceWindowState, N as IdleWarningEvent, O as InboundRtpCursor, P as InboundRtpReading, Q as KnownBehaviorState, R as LLMProvider, S as LLMSelection, T as LiveKitAvatarGrantState, U as LiveKitAvatarGrantStatus, V as LiveKitCapacityState, W as LiveKitConnectionStatus, X as LiveKitSessionRequest, Y as LiveKitSessionStartResult, Z as MAX_RECONNECT_ATTEMPTS, _ as MAX_SESSION_INSTRUCTIONS_CHARS, $ as ProxyClientOptions, a0 as QualityCap, a1 as RECONNECT_BACKOFF_MS, a2 as RealtimeAvatarRequestOptions, a3 as RealtimeSessionApi, a4 as RealtimeSessionMedia, a5 as RealtimeSessionRoomSinks, a6 as ReconnectPolicy, a7 as ReconnectingEvent, a8 as RecoveryState, a9 as RetryStep, aa as SendTurnOptions, ab as SessionBehavior, ac as SessionClip, ad as SessionClocks, ae as SessionEndReason, af as SessionLifecycleApi, ag as SessionLifecyclePhase, ah as SessionLifecyclePhaseKind, ai as SessionLifecycleRoomBridge, aj as SessionLifecycleRoomBridgeProps, ak as SurfaceLayers, al as TranscriptSender, am as TranscriptSenderOptions, an as TurnState, ao as TurnTimeoutEvent, ap as UseAvatarQualityGovernorInput, aq as UseLiveKitAvatarGrantInput, ar as UseRealtimeSessionInput, as as UseSessionLifecycleInput, at as VoiceSpec, au as VoiceSpecInput, av as capacityErrorFromBusy, aw as capacityStateFromGrant, ax as createProxyClient, ay as isNativeLiveTrackSubscribed, az as knownBehaviorStates, aA as mapTurnState, aB as readInboundRtp, aC as sessionBehaviorSchema, aD as sessionClipSchema, aE as splitCallTranscript, aF as useAvatarAdaptivePlayoutDelay, aG as useAvatarCamera, aH as useAvatarPlayoutDelay, aI as useAvatarQualityGovernor, aJ as useCallTranscript, aK as useLiveKitAvatarGrant, aL as useLiveTrackProducing, aM as useMicLease, aN as useRealtimeSession, aO as useReleaseMicLeaseOnTrackEnded, aP as useSessionLifecycle } from './proxy-client-DlFXaXtn.js';
|
|
5
5
|
import { ReactNode, ReactElement } from 'react';
|
|
6
6
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
7
7
|
export { useChat, useConnectionState, useLocalParticipant, useRoomContext, useTrackToggle, useTranscriptions, useVoiceAssistant } from '@livekit/components-react';
|