@telnyx/ai-agent-lib 0.4.3 → 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 +21 -0
- package/dist/index.js +1044 -974
- package/dist/types.d.ts +21 -0
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -38,6 +38,9 @@ export type TelnyxAIAgentConstructorParams = {
|
|
|
38
38
|
export declare class TelnyxAIAgent extends EventEmitter<AIAgentEvents> {
|
|
39
39
|
private telnyxRTC;
|
|
40
40
|
private transcription;
|
|
41
|
+
private removeLoginSuccessHook;
|
|
42
|
+
private authenticated;
|
|
43
|
+
private authenticating;
|
|
41
44
|
agentId: string;
|
|
42
45
|
versionId: string;
|
|
43
46
|
conversationId?: string;
|
|
@@ -76,6 +79,19 @@ export declare class TelnyxAIAgent extends EventEmitter<AIAgentEvents> {
|
|
|
76
79
|
* @returns Promise that resolves when the connection is established
|
|
77
80
|
*/
|
|
78
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;
|
|
79
95
|
/**
|
|
80
96
|
* Clears the reconnect token stored by the underlying WebRTC SDK.
|
|
81
97
|
*
|
|
@@ -159,7 +175,12 @@ export declare class TelnyxAIAgent extends EventEmitter<AIAgentEvents> {
|
|
|
159
175
|
*/
|
|
160
176
|
setRemoteStream(stream: MediaStream): void;
|
|
161
177
|
private onClientReady;
|
|
178
|
+
private installLoginSuccessHook;
|
|
179
|
+
private emitLoginStarted;
|
|
180
|
+
private emitLoginSuccess;
|
|
162
181
|
private onClientOrSocketError;
|
|
182
|
+
private onSocketClose;
|
|
183
|
+
private onSocketMessage;
|
|
163
184
|
private onNotification;
|
|
164
185
|
private onTranscriptItem;
|
|
165
186
|
private onAgentStateChange;
|