@telnyx/ai-agent-lib 0.4.1 → 0.4.4
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/dist/client.d.ts +29 -0
- package/dist/index.js +1094 -1017
- package/dist/types.d.ts +21 -0
- package/package.json +2 -2
package/dist/client.d.ts
CHANGED
|
@@ -26,10 +26,21 @@ export type TelnyxAIAgentConstructorParams = {
|
|
|
26
26
|
* turns `rtc.telnyx.com` into `us-east-1.rtc.telnyx.com`).
|
|
27
27
|
*/
|
|
28
28
|
region?: string;
|
|
29
|
+
/**
|
|
30
|
+
* When reconnecting with a stored `voice_sdk_id`, ask VSP to route to a
|
|
31
|
+
* different b2bua-rtc instance instead of sticky-reconnecting to the
|
|
32
|
+
* same one. Appends `?skip_last_voice_sdk_id=true` to the WebSocket URL.
|
|
33
|
+
*
|
|
34
|
+
* @default true
|
|
35
|
+
*/
|
|
36
|
+
skipLastVoiceSdkId?: boolean;
|
|
29
37
|
};
|
|
30
38
|
export declare class TelnyxAIAgent extends EventEmitter<AIAgentEvents> {
|
|
31
39
|
private telnyxRTC;
|
|
32
40
|
private transcription;
|
|
41
|
+
private removeLoginSuccessHook;
|
|
42
|
+
private authenticated;
|
|
43
|
+
private authenticating;
|
|
33
44
|
agentId: string;
|
|
34
45
|
versionId: string;
|
|
35
46
|
conversationId?: string;
|
|
@@ -68,6 +79,19 @@ export declare class TelnyxAIAgent extends EventEmitter<AIAgentEvents> {
|
|
|
68
79
|
* @returns Promise that resolves when the connection is established
|
|
69
80
|
*/
|
|
70
81
|
connect(): Promise<void>;
|
|
82
|
+
/**
|
|
83
|
+
* True once the underlying WebRTC login request has succeeded. This can be
|
|
84
|
+
* true before `agent.connected`, which waits for REGED / client-ready.
|
|
85
|
+
*/
|
|
86
|
+
get isAuthenticated(): boolean;
|
|
87
|
+
/**
|
|
88
|
+
* True while the underlying WebRTC login request is waiting for a response.
|
|
89
|
+
*/
|
|
90
|
+
get isAuthenticating(): boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Current Telnyx WebRTC session id, populated by successful login.
|
|
93
|
+
*/
|
|
94
|
+
get sessionId(): string | null;
|
|
71
95
|
/**
|
|
72
96
|
* Clears the reconnect token stored by the underlying WebRTC SDK.
|
|
73
97
|
*
|
|
@@ -151,7 +175,12 @@ export declare class TelnyxAIAgent extends EventEmitter<AIAgentEvents> {
|
|
|
151
175
|
*/
|
|
152
176
|
setRemoteStream(stream: MediaStream): void;
|
|
153
177
|
private onClientReady;
|
|
178
|
+
private installLoginSuccessHook;
|
|
179
|
+
private emitLoginStarted;
|
|
180
|
+
private emitLoginSuccess;
|
|
154
181
|
private onClientOrSocketError;
|
|
182
|
+
private onSocketClose;
|
|
183
|
+
private onSocketMessage;
|
|
155
184
|
private onNotification;
|
|
156
185
|
private onTranscriptItem;
|
|
157
186
|
private onAgentStateChange;
|