@telnyx/ai-agent-lib 0.4.3 → 0.4.5

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 CHANGED
@@ -152,6 +152,7 @@ function VoiceChat() {
152
152
  |------|------|----------|---------|-------------|
153
153
  | `agentId` | `string` | ✅ | - | Your Telnyx AI agent ID |
154
154
  | `versionId` | `string` | ❌ | `"main"` | Agent version to use |
155
+ | `widgetVersion` | `string` | ❌ | - | Widget package version forwarded to voice-sdk-proxy for observability |
155
156
  | `environment` | `"production" \| "development"` | ❌ | `"production"` | Telnyx environment |
156
157
  | `debug` | `boolean` | ❌ | `false` | Enable debug logging |
157
158
  | `vad` | `VADOptions` | ❌ | See below | Voice Activity Detection configuration |
@@ -235,6 +236,7 @@ import { TelnyxAIAgent } from '@telnyx/ai-agent-lib';
235
236
  const agent = new TelnyxAIAgent({
236
237
  agentId: 'your-agent-id',
237
238
  versionId: 'main',
239
+ widgetVersion: '0.33.6',
238
240
  environment: 'production'
239
241
  });
240
242
 
package/dist/client.d.ts CHANGED
@@ -4,6 +4,7 @@ import type { AIAgentEvents, TranscriptItem, VADOptions } from "./types";
4
4
  export type TelnyxAIAgentConstructorParams = {
5
5
  agentId: string;
6
6
  versionId?: string;
7
+ widgetVersion?: string;
7
8
  conversationId?: string;
8
9
  environment?: "production" | "development";
9
10
  debug?: boolean;
@@ -38,8 +39,12 @@ export type TelnyxAIAgentConstructorParams = {
38
39
  export declare class TelnyxAIAgent extends EventEmitter<AIAgentEvents> {
39
40
  private telnyxRTC;
40
41
  private transcription;
42
+ private removeLoginSuccessHook;
43
+ private authenticated;
44
+ private authenticating;
41
45
  agentId: string;
42
46
  versionId: string;
47
+ widgetVersion?: string;
43
48
  conversationId?: string;
44
49
  debug: boolean;
45
50
  private audioStreamMonitor;
@@ -76,6 +81,19 @@ export declare class TelnyxAIAgent extends EventEmitter<AIAgentEvents> {
76
81
  * @returns Promise that resolves when the connection is established
77
82
  */
78
83
  connect(): Promise<void>;
84
+ /**
85
+ * True once the underlying WebRTC login request has succeeded. This can be
86
+ * true before `agent.connected`, which waits for REGED / client-ready.
87
+ */
88
+ get isAuthenticated(): boolean;
89
+ /**
90
+ * True while the underlying WebRTC login request is waiting for a response.
91
+ */
92
+ get isAuthenticating(): boolean;
93
+ /**
94
+ * Current Telnyx WebRTC session id, populated by successful login.
95
+ */
96
+ get sessionId(): string | null;
79
97
  /**
80
98
  * Clears the reconnect token stored by the underlying WebRTC SDK.
81
99
  *
@@ -159,7 +177,12 @@ export declare class TelnyxAIAgent extends EventEmitter<AIAgentEvents> {
159
177
  */
160
178
  setRemoteStream(stream: MediaStream): void;
161
179
  private onClientReady;
180
+ private installLoginSuccessHook;
181
+ private emitLoginStarted;
182
+ private emitLoginSuccess;
162
183
  private onClientOrSocketError;
184
+ private onSocketClose;
185
+ private onSocketMessage;
163
186
  private onNotification;
164
187
  private onTranscriptItem;
165
188
  private onAgentStateChange;