@d-id/client-sdk 1.1.11 → 1.1.12

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.
Files changed (65) hide show
  1. package/dist/index-BHt2AhLb.js +1284 -0
  2. package/dist/index.js +27 -1399
  3. package/dist/index.umd.cjs +38 -1
  4. package/dist/livekit-client.esm-C1GRQdZY.js +16663 -0
  5. package/dist/livekit-manager-DZ_BAT5P.js +123 -0
  6. package/dist/src/api/agents.d.ts +1 -0
  7. package/dist/src/api/apiClient.d.ts +4 -3
  8. package/dist/src/api/knowledge.d.ts +1 -0
  9. package/dist/src/api/streams/streamApi.d.ts +1 -0
  10. package/dist/src/api/streams/streamsApiV2.d.ts +5 -0
  11. package/dist/src/auth/get-auth-header.d.ts +1 -0
  12. package/dist/src/errors/chat/chat-creation-failed.d.ts +1 -0
  13. package/dist/src/errors/chat/chat-mode-downgraded.d.ts +1 -0
  14. package/dist/src/errors/validation-error.d.ts +1 -0
  15. package/dist/src/errors/ws-error.d.ts +1 -0
  16. package/dist/src/services/agent-manager/connect-to-manager.d.ts +1 -0
  17. package/dist/src/services/agent-manager/connect-to-manager.test.d.ts +1 -0
  18. package/dist/src/services/agent-manager/index.d.ts +1 -0
  19. package/dist/src/services/agent-manager/index.test.d.ts +1 -0
  20. package/dist/src/services/analytics/mixpanel.d.ts +1 -0
  21. package/dist/src/services/chat/index.d.ts +2 -2
  22. package/dist/src/services/chat/intial-messages.d.ts +1 -0
  23. package/dist/src/services/interrupt/index.d.ts +1 -0
  24. package/dist/src/services/socket-manager/index.d.ts +1 -0
  25. package/dist/src/services/socket-manager/message-queue.d.ts +1 -0
  26. package/dist/src/services/streaming-manager/advanced.test.d.ts +5 -0
  27. package/dist/src/services/streaming-manager/business-flows.test.d.ts +5 -0
  28. package/dist/src/services/streaming-manager/common.d.ts +43 -0
  29. package/dist/src/services/streaming-manager/disconnect.test.d.ts +5 -0
  30. package/dist/src/services/streaming-manager/edge-cases.test.d.ts +5 -0
  31. package/dist/src/services/streaming-manager/factory.d.ts +3 -0
  32. package/dist/src/services/streaming-manager/factory.test.d.ts +1 -0
  33. package/dist/src/services/streaming-manager/index.d.ts +4 -27
  34. package/dist/src/services/streaming-manager/livekit-manager.d.ts +5 -0
  35. package/dist/src/services/streaming-manager/stats/poll.d.ts +1 -1
  36. package/dist/src/services/streaming-manager/stats/report.d.ts +1 -0
  37. package/dist/src/services/streaming-manager/webrtc-core.test.d.ts +5 -0
  38. package/dist/src/services/streaming-manager/webrtc-manager.d.ts +12 -0
  39. package/dist/src/services/streaming-manager/webrtc-utils.test.d.ts +5 -0
  40. package/dist/src/test-utils/factories/agent-manager.factory.d.ts +3 -0
  41. package/dist/src/test-utils/factories/agent.factory.d.ts +4 -0
  42. package/dist/src/test-utils/factories/agents-api.factory.d.ts +1 -0
  43. package/dist/src/test-utils/factories/analytics.factory.d.ts +1 -0
  44. package/dist/src/test-utils/factories/chat.factory.d.ts +1 -0
  45. package/dist/src/test-utils/factories/index.d.ts +8 -0
  46. package/dist/src/test-utils/factories/socket-manager.factory.d.ts +1 -0
  47. package/dist/src/test-utils/factories/stream-api.factory.d.ts +1 -0
  48. package/dist/src/test-utils/factories/streaming-manager.factory.d.ts +4 -0
  49. package/dist/src/types/entities/agents/agent.d.ts +1 -0
  50. package/dist/src/types/entities/agents/manager.d.ts +7 -1
  51. package/dist/src/types/entities/agents/presenter.d.ts +6 -2
  52. package/dist/src/types/entities/knowledge/document.d.ts +1 -0
  53. package/dist/src/types/entities/knowledge/record.d.ts +1 -0
  54. package/dist/src/types/entities/video.d.ts +2 -1
  55. package/dist/src/types/stream/api/clip.d.ts +1 -0
  56. package/dist/src/types/stream/api/talk.d.ts +1 -0
  57. package/dist/src/types/stream/index.d.ts +1 -0
  58. package/dist/src/types/stream/rtc.d.ts +1 -0
  59. package/dist/src/types/stream/stream.d.ts +1 -0
  60. package/dist/src/types/stream/streams-v2.d.ts +12 -0
  61. package/dist/src/types/stream-script.d.ts +1 -0
  62. package/dist/src/utils/agent.d.ts +2 -1
  63. package/dist/src/utils/analytics.d.ts +3 -2
  64. package/dist/src/utils/chat.d.ts +1 -0
  65. package/package.json +21 -2
@@ -0,0 +1,123 @@
1
+ import { c as x, a as N, S as O, C as g, b as U, d as P, e as V, A as w, f as q, T as J } from "./index-BHt2AhLb.js";
2
+ function Q(u, T, h, i) {
3
+ const p = x(u, `${T}/v2/agents/${h}`, i);
4
+ return {
5
+ async createStream(d) {
6
+ return p.post("/streams", d);
7
+ }
8
+ };
9
+ }
10
+ async function W() {
11
+ try {
12
+ return await import("./livekit-client.esm-C1GRQdZY.js");
13
+ } catch {
14
+ throw new Error(
15
+ "LiveKit client is required for this streaming manager. Please install it using: npm install livekit-client"
16
+ );
17
+ }
18
+ }
19
+ async function H(u, T, h) {
20
+ var E, K, I;
21
+ const i = N(h.debug || !1, "LiveKitStreamingManager"), {
22
+ Room: p,
23
+ RoomEvent: d,
24
+ ConnectionState: C,
25
+ RemoteParticipant: z,
26
+ RemoteTrack: B
27
+ } = await W(), { callbacks: e, auth: j, baseURL: F, analytics: M } = h;
28
+ let a = null, v = !1, y = null, c = null;
29
+ const L = O.Fluent;
30
+ a = new p({
31
+ adaptiveStream: !0,
32
+ dynacast: !0
33
+ }), a.on(d.ConnectionStateChanged, (n) => {
34
+ var t, o, r, s, S;
35
+ switch (i("Connection state changed:", n), n) {
36
+ case C.Connecting:
37
+ (t = e.onConnectionStateChange) == null || t.call(e, g.Connecting);
38
+ break;
39
+ case C.Connected:
40
+ i("LiveKit room connected successfully"), v = !0, (o = e.onConnectionStateChange) == null || o.call(e, g.Connected);
41
+ break;
42
+ case C.Disconnected:
43
+ i("LiveKit room disconnected"), v = !1, (r = e.onConnectionStateChange) == null || r.call(e, g.Disconnected);
44
+ break;
45
+ case C.Reconnecting:
46
+ i("LiveKit room reconnecting..."), (s = e.onConnectionStateChange) == null || s.call(e, g.Connecting);
47
+ break;
48
+ case C.SignalReconnecting:
49
+ i("LiveKit room signal reconnecting..."), (S = e.onConnectionStateChange) == null || S.call(e, g.Connecting);
50
+ break;
51
+ }
52
+ }), a.on(d.ConnectionQualityChanged, (n, t) => {
53
+ var o;
54
+ t != null && t.isLocal && n === "poor" && (i("Connection quality is poor"), (o = e.onConnectivityStateChange) == null || o.call(e, U.Weak));
55
+ }), a.on(d.ParticipantConnected, (n) => {
56
+ i("Participant connected:", n.identity);
57
+ }), a.on(d.TrackSubscribed, (n, t, o) => {
58
+ var r, s;
59
+ i(`Track subscribed: ${n.kind} from ${o.identity}`), c ? c.addTrack(n.mediaStreamTrack) : c = new MediaStream([n.mediaStreamTrack]), (r = e.onSrcObjectReady) == null || r.call(e, c), n.kind === "video" && ((s = e.onVideoStateChange) == null || s.call(e, P.Start));
60
+ }), a.on(d.TrackUnsubscribed, (n, t, o) => {
61
+ var r;
62
+ i(`Track unsubscribed: ${n.kind} from ${o.identity}`), n.kind === "video" && ((r = e.onVideoStateChange) == null || r.call(e, P.Stop));
63
+ }), a.on(d.DataReceived, (n, t) => {
64
+ var r, s, S, D, $;
65
+ const o = new TextDecoder().decode(n);
66
+ i("Data received:", o);
67
+ try {
68
+ const m = JSON.parse(o);
69
+ m.subject === V.StreamStarted && ((r = m.metadata) != null && r.videoId) ? (y = m.metadata.videoId, (s = e.onVideoIdChange) == null || s.call(e, y), (S = e.onAgentActivityStateChange) == null || S.call(e, w.Talking)) : m.subject === V.StreamDone && (y = null, (D = e.onVideoIdChange) == null || D.call(e, y), ($ = e.onAgentActivityStateChange) == null || $.call(e, w.Idle));
70
+ } catch (m) {
71
+ i("Failed to parse data channel message:", m);
72
+ }
73
+ }), (E = e.onConnectionStateChange) == null || E.call(e, g.New);
74
+ const _ = Q(j, F || q, u, e.onError);
75
+ let f, A;
76
+ try {
77
+ const n = await _.createStream({
78
+ transport: J.Livekit
79
+ }), { agent_id: t, session_id: o, session_token: r, session_url: s } = n;
80
+ f = t, A = o, await a.connect(s, r), i("LiveKit room joined successfully");
81
+ } catch (n) {
82
+ throw i("Failed to connect to LiveKit room:", n), (K = e.onConnectionStateChange) == null || K.call(e, g.Fail), (I = e.onError) == null || I.call(e, n, { streamId: "" }), n;
83
+ }
84
+ M.enrich({
85
+ "stream-type": L
86
+ });
87
+ async function R(n) {
88
+ var t, o;
89
+ if (!v || !a) {
90
+ i("Room is not connected for sending messages"), (t = e.onError) == null || t.call(e, new Error("Room is not connected for sending messages"), {
91
+ streamId: f
92
+ });
93
+ return;
94
+ }
95
+ try {
96
+ await a.localParticipant.publishData(new TextEncoder().encode(n), { reliable: !0 });
97
+ } catch (r) {
98
+ i("Error sending data channel message", r), (o = e.onError) == null || o.call(e, r, { streamId: f });
99
+ }
100
+ }
101
+ return {
102
+ speak(n) {
103
+ const t = JSON.stringify({
104
+ type: "speak",
105
+ payload: n
106
+ });
107
+ return R(t);
108
+ },
109
+ async disconnect() {
110
+ var n, t;
111
+ a && (await a.disconnect(), a = null), c && (c.getTracks().forEach((o) => o.stop()), c = null), v = !1, (n = e.onConnectionStateChange) == null || n.call(e, g.Completed), (t = e.onAgentActivityStateChange) == null || t.call(e, w.Idle);
112
+ },
113
+ sendDataChannelMessage: R,
114
+ sessionId: A,
115
+ streamId: f,
116
+ streamType: L,
117
+ interruptAvailable: !0,
118
+ triggersAvailable: !1
119
+ };
120
+ }
121
+ export {
122
+ H as createLiveKitStreamingManager
123
+ };
@@ -1,5 +1,6 @@
1
1
  import { Agent, AgentPayload, Auth, Chat, ChatPayload, ChatResponse, RatingEntity, RatingPayload, STTTokenResponse } from '../types/index';
2
2
  import { RequestOptions } from './apiClient';
3
+
3
4
  export declare function createAgentsApi(auth: Auth, host?: string, onError?: (error: Error, errorData: object) => void): {
4
5
  create(payload: AgentPayload, options?: RequestOptions): Promise<Agent>;
5
6
  getAgents(tag?: string, options?: RequestOptions): Promise<Agent[]>;
@@ -1,10 +1,11 @@
1
1
  import { Auth } from '../types/auth';
2
+
2
3
  export type RequestOptions = RequestInit & {
3
4
  skipErrorHandler?: boolean;
4
5
  };
5
6
  export declare function createClient(auth: Auth, host?: string, onError?: (error: Error, errorData: object) => void): {
6
7
  get<T = any>(url: string, options?: RequestOptions): Promise<T>;
7
- post<T_1 = any>(url: string, body?: any, options?: RequestOptions): Promise<T_1>;
8
- delete<T_2 = any>(url: string, body?: any, options?: RequestOptions): Promise<T_2>;
9
- patch<T_3 = any>(url: string, body?: any, options?: RequestOptions): Promise<T_3>;
8
+ post<T = any>(url: string, body?: any, options?: RequestOptions): Promise<T>;
9
+ delete<T = any>(url: string, body?: any, options?: RequestOptions): Promise<T>;
10
+ patch<T = any>(url: string, body?: any, options?: RequestOptions): Promise<T>;
10
11
  };
@@ -1,4 +1,5 @@
1
1
  import { Auth, CreateDocumentPayload, DocumentData, KnowledgeData, KnowledgePayload, QueryResult, RecordData } from '../types/index';
2
+
2
3
  export declare function createKnowledgeApi(auth: Auth, host?: string, onError?: (error: Error, errorData: object) => void): {
3
4
  createKnowledge(payload: KnowledgePayload, options?: RequestInit): Promise<KnowledgeData>;
4
5
  getKnowledgeBase(options?: RequestInit): Promise<KnowledgeData[]>;
@@ -1,2 +1,3 @@
1
1
  import { Auth, RtcApi } from '../../types/index';
2
+
2
3
  export declare function createStreamApi(auth: Auth, host: string, agentId: string, onError?: (error: Error, errorData: object) => void): RtcApi;
@@ -0,0 +1,5 @@
1
+ import { Auth, CreateStreamV2Options, CreateStreamV2Response } from '../../types';
2
+
3
+ export declare function createStreamApiV2(auth: Auth, host: string, agentId: string, onError?: (error: Error, errorData: object) => void): {
4
+ createStream(options: CreateStreamV2Options): Promise<CreateStreamV2Response>;
5
+ };
@@ -1,3 +1,4 @@
1
1
  import { Auth } from '../types/auth';
2
+
2
3
  export declare function getExternalId(): string;
3
4
  export declare function getAuthHeader(auth: Auth): string;
@@ -1,5 +1,6 @@
1
1
  import { ChatMode } from '../../types';
2
2
  import { BaseError } from '../base-error';
3
+
3
4
  export declare class ChatCreationFailed extends BaseError {
4
5
  constructor(mode: ChatMode, persistent: boolean);
5
6
  }
@@ -1,5 +1,6 @@
1
1
  import { ChatMode } from '../../types';
2
2
  import { BaseError } from '../base-error';
3
+
3
4
  export declare class ChatModeDowngraded extends BaseError {
4
5
  constructor(mode: ChatMode);
5
6
  }
@@ -1,4 +1,5 @@
1
1
  import { BaseError } from './base-error';
2
+
2
3
  export declare class ValidationError extends BaseError {
3
4
  key?: string;
4
5
  constructor(message: string, key?: string);
@@ -1,4 +1,5 @@
1
1
  import { BaseError } from './base-error';
2
+
2
3
  export declare class WsError extends BaseError {
3
4
  constructor(message: string);
4
5
  }
@@ -1,6 +1,7 @@
1
1
  import { StreamingManager } from '../streaming-manager';
2
2
  import { Agent, AgentManagerOptions, AgentsAPI, Chat, CreateStreamOptions } from '../../types';
3
3
  import { Analytics } from '../analytics/mixpanel';
4
+
4
5
  type ConnectToManagerOptions = AgentManagerOptions & {
5
6
  callbacks: AgentManagerOptions['callbacks'] & {
6
7
  onVideoIdChange?: (videoId: string | null) => void;
@@ -1,6 +1,7 @@
1
1
  import { Agent, AgentManager, AgentManagerOptions, Auth, Chat, ChatMode, CreateStreamOptions, Message } from '../../types';
2
2
  import { SocketManager } from '../socket-manager';
3
3
  import { StreamingManager } from '../streaming-manager';
4
+
4
5
  export interface AgentManagerItems {
5
6
  chat?: Chat;
6
7
  streamingManager?: StreamingManager<CreateStreamOptions>;
@@ -0,0 +1 @@
1
+ export {};
@@ -3,6 +3,7 @@ export interface AnalyticsOptions {
3
3
  agentId: string;
4
4
  isEnabled?: boolean;
5
5
  distinctId?: string;
6
+ mixpanelAdditionalProperties?: Record<string, any>;
6
7
  }
7
8
  export interface Analytics {
8
9
  token: string;
@@ -1,6 +1,6 @@
1
- import type { Agent, AgentsAPI, Chat } from '../../types';
2
- import { ChatMode } from '../../types';
1
+ import { Agent, AgentsAPI, Chat, ChatMode } from '../../types';
3
2
  import { Analytics } from '../analytics/mixpanel';
3
+
4
4
  export declare function getRequestHeaders(chatMode?: ChatMode): Record<string, Record<string, string>>;
5
5
  export declare function createChat(agent: Agent, agentsApi: AgentsAPI, analytics: Analytics, chatMode?: ChatMode, persist?: boolean, chat?: Chat): Promise<{
6
6
  chat: Chat | undefined;
@@ -1,2 +1,3 @@
1
1
  import { Message } from '../../types';
2
+
2
3
  export declare function getInitialMessages(initialMessages?: Message[]): Message[];
@@ -1,4 +1,5 @@
1
1
  import { CreateStreamOptions, StreamType } from '../../types';
2
2
  import { StreamingManager } from '../streaming-manager';
3
+
3
4
  export declare function validateInterrupt(streamingManager: StreamingManager<CreateStreamOptions> | undefined, streamType: StreamType | undefined, videoId: string | null): void;
4
5
  export declare function sendInterrupt(streamingManager: StreamingManager<CreateStreamOptions>, videoId: string): Promise<void>;
@@ -1,5 +1,6 @@
1
1
  import { ChatProgressCallback } from '../../types';
2
2
  import { Auth } from '../../types/auth';
3
+
3
4
  export interface SocketManager {
4
5
  socket?: WebSocket;
5
6
  disconnect: () => void;
@@ -1,6 +1,7 @@
1
1
  import { Agent, AgentManagerOptions, ChatProgress, StreamEvents } from '../../types';
2
2
  import { AgentManagerItems } from '../agent-manager';
3
3
  import { Analytics } from '../analytics/mixpanel';
4
+
4
5
  export interface ChatEventQueue {
5
6
  [sequence: number]: string;
6
7
  answer?: string;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Advanced functionality tests for streaming manager
3
+ * Tests complex scenarios, edge cases, and advanced features
4
+ */
5
+ export {};
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Business flow tests for streaming manager
3
+ * Tests critical end-to-end workflows and configurations
4
+ */
5
+ export {};
@@ -0,0 +1,43 @@
1
+ import { CreateStreamOptions, PayloadType, StreamType } from '../../types';
2
+
3
+ export declare const createStreamingLogger: (debug: boolean, prefix: string) => (message: string, extra?: any) => false | void;
4
+ /**
5
+ * Shared type for all streaming managers (LiveKit, WebRTC, etc.)
6
+ * This type represents the return value of any streaming manager implementation
7
+ */
8
+ export type StreamingManager<T extends CreateStreamOptions> = {
9
+ /**
10
+ * Method to send request to server to get clip or talk depending on payload
11
+ * @param payload The payload to send to the streaming service
12
+ */
13
+ speak(payload: PayloadType<T>): Promise<any>;
14
+ /**
15
+ * Method to close the streaming connection
16
+ */
17
+ disconnect(): Promise<void>;
18
+ /**
19
+ * Method to send data channel messages to the server
20
+ * @param payload The message payload to send
21
+ */
22
+ sendDataChannelMessage(payload: string): void;
23
+ /**
24
+ * Session identifier information, should be returned in the body of all streaming requests
25
+ */
26
+ sessionId: string;
27
+ /**
28
+ * Id of current streaming session
29
+ */
30
+ streamId: string;
31
+ /**
32
+ * Type of streaming implementation being used
33
+ */
34
+ streamType: StreamType;
35
+ /**
36
+ * Whether interrupt functionality is available for this stream
37
+ */
38
+ interruptAvailable: boolean;
39
+ /**
40
+ * Whether triggers functionality is available for this stream
41
+ */
42
+ triggersAvailable: boolean;
43
+ };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Disconnect and cleanup tests for streaming manager
3
+ * Tests disconnection workflows, cleanup, and error handling
4
+ */
5
+ export {};
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Edge cases and branch coverage tests for streaming manager
3
+ * Tests detailed edge cases, error conditions, and branch coverage scenarios
4
+ */
5
+ export {};
@@ -0,0 +1,3 @@
1
+ import { Agent, CreateStreamOptions, StreamingManagerOptions } from '../../types';
2
+
3
+ export declare function createStreamingManager<T extends CreateStreamOptions>(agent: Agent, streamOptions: T, options: StreamingManagerOptions): Promise<import('./common').StreamingManager<T>>;
@@ -1,27 +1,4 @@
1
- import { CreateStreamOptions, PayloadType, StreamType, StreamingManagerOptions } from '../../types/index';
2
- export declare function createStreamingManager<T extends CreateStreamOptions>(agentId: string, agent: T, { debug, callbacks, auth, baseURL, analytics }: StreamingManagerOptions): Promise<{
3
- /**
4
- * Method to send request to server to get clip or talk depend on you payload
5
- * @param payload
6
- */
7
- speak(payload: PayloadType<T>): Promise<import('../../types/index').SendStreamPayloadResponse>;
8
- /**
9
- * Method to close RTC connection
10
- */
11
- disconnect(): Promise<void>;
12
- /**
13
- * Method to send data channel messages to the server
14
- */
15
- sendDataChannelMessage(payload: string): void;
16
- /**
17
- * Session identifier information, should be returned in the body of all streaming requests
18
- */
19
- sessionId: string;
20
- /**
21
- * Id of current RTC stream
22
- */
23
- streamId: string;
24
- streamType: StreamType;
25
- interruptAvailable: boolean | undefined;
26
- }>;
27
- export type StreamingManager<T extends CreateStreamOptions> = Awaited<ReturnType<typeof createStreamingManager<T>>>;
1
+ export { createStreamingManager } from './factory';
2
+ export type { StreamingManager } from './common';
3
+ export type { LiveKitStreamingManager } from './livekit-manager';
4
+ export * from './webrtc-manager';
@@ -0,0 +1,5 @@
1
+ import { CreateStreamOptions, StreamingManagerOptions } from '../../types';
2
+ import { StreamingManager } from './common';
3
+
4
+ export declare function createLiveKitStreamingManager<T extends CreateStreamOptions>(agentId: string, agent: T, options: StreamingManagerOptions): Promise<StreamingManager<T>>;
5
+ export type LiveKitStreamingManager<T extends CreateStreamOptions> = StreamingManager<T>;
@@ -1,4 +1,4 @@
1
- /// <reference types="node" />
2
1
  import { ConnectivityState, StreamingState } from '../../../types';
3
2
  import { VideoRTCStatsReport } from './report';
3
+
4
4
  export declare function pollStats(peerConnection: RTCPeerConnection, getIsConnected: () => boolean, onConnected: () => void, onVideoStateChange?: (state: StreamingState, statsReport?: VideoRTCStatsReport) => void, onConnectivityStateChange?: (state: ConnectivityState) => void, warmup?: boolean): NodeJS.Timeout;
@@ -1,4 +1,5 @@
1
1
  import { AnalyticsRTCStatsReport, SlimRTCStatsReport } from '../../../types';
2
+
2
3
  export interface VideoRTCStatsReport {
3
4
  webRTCStats: {
4
5
  anomalies: AnalyticsRTCStatsReport[];
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Core functionality tests for streaming manager
3
+ * Tests basic streaming manager creation, connection, and operations
4
+ */
5
+ export {};
@@ -0,0 +1,12 @@
1
+ import { ConnectionState, CreateStreamOptions, StreamEvents, StreamingManagerOptions } from '../../types';
2
+ import { createStreamingLogger, StreamingManager } from './common';
3
+
4
+ type DataChannelPayload = string | Record<string, unknown>;
5
+ export declare function mapConnectionState(state: RTCIceConnectionState): ConnectionState;
6
+ export declare const createParseDataChannelMessage: (log: ReturnType<typeof createStreamingLogger>) => (message: string) => {
7
+ subject: StreamEvents;
8
+ data: DataChannelPayload;
9
+ };
10
+ export declare function createWebRTCStreamingManager<T extends CreateStreamOptions>(agentId: string, streamOptions: T, { debug, callbacks, auth, baseURL, analytics }: StreamingManagerOptions): Promise<StreamingManager<T>>;
11
+ export type WebRTCStreamingManager<T extends CreateStreamOptions> = StreamingManager<T>;
12
+ export {};
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Utility function tests for streaming manager
3
+ * Tests helper functions like mapConnectionState and parseDataChannelMessage
4
+ */
5
+ export {};
@@ -0,0 +1,3 @@
1
+ import { AgentManagerOptions } from '../../types';
2
+
3
+ export declare const AgentManagerOptionsFactory: import('rosie').IFactory<AgentManagerOptions>;
@@ -0,0 +1,4 @@
1
+ import { Agent } from '../../types';
2
+
3
+ export declare const AgentFactory: import('rosie').IFactory<Agent>;
4
+ export declare const StreamingAgentFactory: import('rosie').IFactory<any>;
@@ -0,0 +1 @@
1
+ export declare const AgentsApiFactory: import('rosie').IFactory<any>;
@@ -0,0 +1 @@
1
+ export declare const AnalyticsFactory: import('rosie').IFactory<any>;
@@ -0,0 +1 @@
1
+ export declare const ChatFactory: import('rosie').IFactory<any>;
@@ -0,0 +1,8 @@
1
+ export { AgentManagerOptionsFactory } from './agent-manager.factory';
2
+ export { AgentFactory, StreamingAgentFactory } from './agent.factory';
3
+ export { AgentsApiFactory } from './agents-api.factory';
4
+ export { AnalyticsFactory } from './analytics.factory';
5
+ export { ChatFactory } from './chat.factory';
6
+ export { SocketManagerFactory } from './socket-manager.factory';
7
+ export { StreamApiFactory } from './stream-api.factory';
8
+ export { StreamingManagerFactory, StreamingManagerOptionsFactory } from './streaming-manager.factory';
@@ -0,0 +1 @@
1
+ export declare const SocketManagerFactory: import('rosie').IFactory<any>;
@@ -0,0 +1 @@
1
+ export declare const StreamApiFactory: import('rosie').IFactory<any>;
@@ -0,0 +1,4 @@
1
+ import { StreamingManagerOptions } from '../../types';
2
+
3
+ export declare const StreamingManagerFactory: import('rosie').IFactory<any>;
4
+ export declare const StreamingManagerOptionsFactory: import('rosie').IFactory<StreamingManagerOptions>;
@@ -2,6 +2,7 @@ import { Chat, ChatPayload, ChatResponse } from './chat';
2
2
  import { Knowledge } from './knowledge';
3
3
  import { LLM } from './llm';
4
4
  import { Presenter } from './presenter';
5
+
5
6
  export declare enum UserPlan {
6
7
  TRIAL = "trial",
7
8
  BASIC = "basic",
@@ -2,9 +2,10 @@ import { STTTokenResponse } from '../..';
2
2
  import { Auth } from '../../auth';
3
3
  import { AgentActivityState, CompatibilityMode, ConnectionState, ConnectivityState, SendStreamPayloadResponse, StreamEvents, StreamType, StreamingState } from '../../stream';
4
4
  import { SupportedStreamScript } from '../../stream-script';
5
- import type { ManagerCallbacks as StreamManagerCallbacks } from '../../stream/stream';
5
+ import { ManagerCallbacks as StreamManagerCallbacks } from '../../stream/stream';
6
6
  import { Agent } from './agent';
7
7
  import { ChatMode, ChatResponse, Interrupt, Message, RatingEntity } from './chat';
8
+
8
9
  /**
9
10
  * Types of events provided in Chat Progress Callback
10
11
  */
@@ -132,6 +133,7 @@ export interface AgentManagerOptions {
132
133
  debug?: boolean;
133
134
  enableAnalitics?: boolean;
134
135
  mixpanelKey?: string;
136
+ mixpanelAdditionalProperties?: Record<string, any>;
135
137
  /**
136
138
  * Unique ID of agent user used in analytics. Pass it to override the default way to get distinctId
137
139
  */
@@ -154,6 +156,10 @@ export interface AgentManager {
154
156
  * Get if the stream supports interrupt
155
157
  */
156
158
  getIsInterruptAvailable: () => boolean;
159
+ /**
160
+ * Get if the stream supports triggers
161
+ */
162
+ getIsTriggersAvailable: () => boolean;
157
163
  /**
158
164
  * Array of starter messages that will be sent to the agent when the chat starts
159
165
  */
@@ -1,7 +1,8 @@
1
1
  import { ExtendedTextToSpeechProviders } from '../../voice/tts';
2
2
  import { Rect } from '../../face-rect';
3
- export type videoType = 'talk' | 'clip';
4
- export type Presenter = TalkPresenter | ClipPresenter;
3
+
4
+ export type videoType = 'talk' | 'clip' | 'expressive';
5
+ export type Presenter = TalkPresenter | ClipPresenter | ExpresivePresenter;
5
6
  export interface BasePresenter {
6
7
  type: videoType;
7
8
  voice?: ExtendedTextToSpeechProviders & {
@@ -24,3 +25,6 @@ export interface ClipPresenter extends BasePresenter {
24
25
  presenter_id: string;
25
26
  is_greenscreen?: boolean;
26
27
  }
28
+ export interface ExpresivePresenter extends BasePresenter {
29
+ type: 'expressive';
30
+ }
@@ -1,4 +1,5 @@
1
1
  import { KnowledgeType } from './knowledge';
2
+
2
3
  export declare enum Subject {
3
4
  KnowledgeProcessing = "knowledge/processing",
4
5
  KnowledgeIndexing = "knowledge/indexing",
@@ -1,4 +1,5 @@
1
1
  import { KnowledgeType } from './knowledge';
2
+
2
3
  export interface RecordData {
3
4
  created_at: string;
4
5
  modified_at: string;
@@ -1,5 +1,6 @@
1
1
  export declare enum VideoType {
2
2
  Clip = "clip",
3
- Talk = "talk"
3
+ Talk = "talk",
4
+ Expressive = "expressive"
4
5
  }
5
6
  export declare const mapVideoType: (type: string) => VideoType;
@@ -1,5 +1,6 @@
1
1
  import { StickyRequest, StreamScript } from '../..';
2
2
  import { CompatibilityMode } from '../stream';
3
+
3
4
  interface Logo {
4
5
  /**
5
6
  * https url to an ARGB jpg/png image, a default logo is used otherwise
@@ -1,5 +1,6 @@
1
1
  import { StreamScript } from '../..';
2
2
  import { CompatibilityMode } from '../stream';
3
+
3
4
  export interface CreateTalkStreamRequest {
4
5
  driver_url?: string;
5
6
  face?: {
@@ -1,3 +1,4 @@
1
1
  export * from './api';
2
2
  export * from './rtc';
3
3
  export * from './stream';
4
+ export * from './streams-v2';
@@ -35,6 +35,7 @@ export interface ICreateStreamRequestResponse extends StickyRequest {
35
35
  ice_servers: IceServer[];
36
36
  fluent?: boolean;
37
37
  interrupt_enabled?: boolean;
38
+ triggers_enabled?: boolean;
38
39
  }
39
40
  export interface IceCandidate {
40
41
  /**
@@ -3,6 +3,7 @@ import { VideoRTCStatsReport } from '../../services/streaming-manager/stats/repo
3
3
  import { Auth } from '../auth';
4
4
  import { CreateClipStreamRequest, CreateTalkStreamRequest, SendClipStreamPayload, SendTalkStreamPayload } from './api';
5
5
  import { ICreateStreamRequestResponse, IceCandidate, SendStreamPayloadResponse, Status } from './rtc';
6
+
6
7
  export type CompatibilityMode = 'on' | 'off' | 'auto';
7
8
  export declare enum StreamingState {
8
9
  Start = "START",
@@ -0,0 +1,12 @@
1
+ export declare enum Transport {
2
+ Livekit = "livekit"
3
+ }
4
+ export interface CreateStreamV2Options {
5
+ transport: Transport.Livekit;
6
+ }
7
+ export interface CreateStreamV2Response {
8
+ agent_id: 'string';
9
+ session_id: 'string';
10
+ session_url: 'string';
11
+ session_token: 'string';
12
+ }
@@ -1,5 +1,6 @@
1
1
  import { Message } from './entities';
2
2
  import { StreamTextToSpeechProviders } from './voice/tts';
3
+
3
4
  export type StreamScriptType = 'text' | 'audio';
4
5
  export interface BaseStreamScript {
5
6
  type: StreamScriptType;