@telnyx/ai-agent-lib 0.3.1 → 0.3.2-beta.1

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/types.d.ts CHANGED
@@ -20,8 +20,30 @@ export type AgentStateData = {
20
20
  /** UTC timestamp (ISO 8601) when user stopped speaking and thinking state began. Only present when state is "thinking". */
21
21
  thinkingStartedAt?: string;
22
22
  };
23
+ /**
24
+ * Connection metadata captured from the REGED message sent by the Telnyx
25
+ * voice-sdk-proxy when the WebRTC session is established.
26
+ *
27
+ * - `dc`: datacenter identifier that handled the connection
28
+ * (e.g. `"ams3-prod"`, `"cn1-prod"`).
29
+ * - `region`: logical region the datacenter belongs to
30
+ * (e.g. `"eu-west"`, `"us-central"`).
31
+ * - `callReportId`: identifier used by the SDK to post periodic call
32
+ * quality reports to voice-sdk-proxy. Useful for correlating client
33
+ * sessions with server-side reports when debugging.
34
+ *
35
+ * All fields are nullable because the underlying SDK only populates them
36
+ * when the proxy advertises the corresponding values in the REGED message.
37
+ * `dc` and `region` require `@telnyx/webrtc` >= the version that ships
38
+ * team-telnyx/webrtc#583; on older versions they will always be `null`.
39
+ */
40
+ export type AgentConnectionInfo = {
41
+ dc: string | null;
42
+ region: string | null;
43
+ callReportId: string | null;
44
+ };
23
45
  export type AIAgentEvents = {
24
- "agent.connected": () => void;
46
+ "agent.connected": (info: AgentConnectionInfo) => void;
25
47
  "agent.disconnected": () => void;
26
48
  "agent.error": (error: Error) => void;
27
49
  "transcript.item": (item: TranscriptItem) => void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@telnyx/ai-agent-lib",
3
3
  "private": false,
4
- "version": "0.3.1",
4
+ "version": "0.3.2-beta.1",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -23,14 +23,15 @@
23
23
  "lint": "eslint .",
24
24
  "format": "prettier --write .",
25
25
  "preview": "vite preview",
26
- "release": "release-it"
26
+ "release": "release-it",
27
+ "postinstall": "node scripts/fix-webrtc-types.mjs"
27
28
  },
28
29
  "peerDependencies": {
29
30
  "react": "^19.1.1",
30
31
  "react-dom": "^19.1.0"
31
32
  },
32
33
  "dependencies": {
33
- "@telnyx/webrtc": "^2.25.25",
34
+ "@telnyx/webrtc": "2.26.1-beta.4",
34
35
  "eventemitter3": "^5.0.1",
35
36
  "jotai": "^2.12.5",
36
37
  "loglevel": "^1.9.2"