@vogent/vogent-web-client 0.1.4 → 0.1.6

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 ADDED
@@ -0,0 +1,265 @@
1
+ # Vogent Web Client
2
+
3
+ A TypeScript/JavaScript client library for integrating Vogent into web applications.
4
+
5
+ ## Installation
6
+
7
+ ### Bun
8
+ ```bash
9
+ bun add @vogent/vogent-web-client
10
+ ```
11
+
12
+ ### NPM
13
+ ```bash
14
+ npm install @vogent/vogent-web-client
15
+ ```
16
+
17
+ ### Yarn
18
+ ```bash
19
+ yarn add @vogent/vogent-web-client
20
+ ```
21
+
22
+ ## Prerequisites
23
+
24
+ Before using VogentCall, you need to obtain the following from the Vogent API:
25
+ - `sessionId`: Unique session identifier
26
+ - `dialId`: Unique dial/call identifier
27
+ - `token`: Authentication token
28
+
29
+ You may call the [Create Dial](https://docs.vogent.ai/api-reference/create-a-new-dial) endpoint on the browser to create a browser dial (not a phone call), **but you must be using a public API key**. Do not use a private API key on the client.
30
+
31
+ ## Usage
32
+
33
+ ```typescript
34
+ import { VogentCall } from '@vogent/vogent-web-client';
35
+
36
+ // First, create a dial using the Vogent API
37
+ const response = await fetch('https://api.vogent.ai/api/dials', {
38
+ method: 'POST',
39
+ headers: {
40
+ 'Authorization': 'Bearer pub_vogent_...', // Make sure this is a public key, and not a private key.
41
+ 'Content-Type': 'application/json'
42
+ },
43
+ body: JSON.stringify({
44
+ callAgentId: 'your_call_agent_id',
45
+ browserCall: true // Set to true for web-based calls
46
+ })
47
+ });
48
+
49
+ const { dialToken, sessionId, dialId } = await response.json();
50
+
51
+ // Create a new call instance with the dial details
52
+ const call = new VogentCall({
53
+ sessionId: sessionId,
54
+ dialId: dialId,
55
+ token: dialToken
56
+ });
57
+
58
+ // Start the call
59
+ await call.start();
60
+
61
+ // Connect audio
62
+ const audioConn = await call.connectAudio();
63
+
64
+ // Monitor transcripts in real-time
65
+ const unsubscribe = call.monitorTranscript((transcript) => {
66
+ transcript.forEach(({ text, speaker }) => {
67
+ console.log(`${speaker}: ${text}`);
68
+ });
69
+ });
70
+
71
+ // Listen for status changes
72
+ call.on('status', (status) => {
73
+ console.log('Call status:', status);
74
+ });
75
+
76
+ // When done, clean up
77
+ unsubscribe();
78
+ await call.hangup();
79
+ ```
80
+
81
+ ## API Reference
82
+
83
+ ### Constructor
84
+
85
+ ```typescript
86
+ new VogentCall(dialDetails, config?)
87
+ ```
88
+
89
+ **Parameters:**
90
+
91
+ - `dialDetails` (required):
92
+ - `sessionId` (string): Unique session identifier
93
+ - `dialId` (string): Unique dial/call identifier
94
+ - `token` (string): Authentication token
95
+
96
+ - `config` (optional):
97
+ - `baseUrl` (string): API base URL (defaults to 'https://api.vogent.ai')
98
+
99
+ **Example:**
100
+
101
+ ```typescript
102
+ const call = new VogentCall(
103
+ {
104
+ sessionId: "session_123",
105
+ dialId: "dial_456",
106
+ token: "auth_token_789"
107
+ },
108
+ {
109
+ baseUrl: "https://api.vogent.ai" // optional
110
+ }
111
+ );
112
+ ```
113
+
114
+ ### Methods
115
+
116
+ #### `start()`
117
+
118
+ Starts the call session. Note: This does not connect audio automatically.
119
+
120
+ ```typescript
121
+ await call.start();
122
+ ```
123
+
124
+ **Returns:** `Promise<void>`
125
+
126
+ ---
127
+
128
+ #### `connectAudio(liveListen?)`
129
+
130
+ Establishes the audio connection for the call.
131
+
132
+ ```typescript
133
+ const audioConn = await call.connectAudio();
134
+ ```
135
+
136
+ **Parameters:**
137
+ - `liveListen` (boolean, optional): Set to `true` for monitoring legs (e.g., humans listening to the call who the AI should not interact with). Defaults to `false`.
138
+
139
+ **Returns:** `Promise<VogentAudioConn>` - Audio connection handle
140
+
141
+ **Example:**
142
+
143
+ ```typescript
144
+ // Regular participant
145
+ const audioConn = await call.connectAudio();
146
+
147
+ // Monitor-only participant (live listening)
148
+ const monitorConn = await call.connectAudio(true);
149
+ ```
150
+
151
+ ---
152
+
153
+ #### `monitorTranscript(callback)`
154
+
155
+ Subscribes to real-time transcript updates.
156
+
157
+ ```typescript
158
+ const unsubscribe = call.monitorTranscript((transcript) => {
159
+ // Handle transcript updates
160
+ });
161
+ ```
162
+
163
+ **Parameters:**
164
+ - `callback` (function): Called with transcript updates. Receives an array of transcript objects.
165
+
166
+ **Transcript Object:**
167
+ ```typescript
168
+ type Transcript = {
169
+ text: string; // The transcript text
170
+ speaker: string; // 'HUMAN', 'AI', or 'IVR' (if IVR detection is enabled)
171
+ }[];
172
+ ```
173
+
174
+ **Returns:** `() => void` - Unsubscribe function
175
+
176
+ **Example:**
177
+
178
+ ```typescript
179
+ const unsubscribe = call.monitorTranscript((transcript) => {
180
+ transcript.forEach(({ text, speaker }) => {
181
+ if (speaker === 'AI') {
182
+ console.log('AI said:', text);
183
+ } else if (speaker === 'HUMAN') {
184
+ console.log('Human said:', text);
185
+ }
186
+ });
187
+ });
188
+
189
+ // Later, when you want to stop monitoring
190
+ unsubscribe();
191
+ ```
192
+
193
+ ---
194
+
195
+ #### `on(event, callback)`
196
+
197
+ Registers an event handler for call status changes.
198
+
199
+ ```typescript
200
+ call.on('status', (status) => {
201
+ console.log('Status changed:', status);
202
+ });
203
+ ```
204
+
205
+ **Parameters:**
206
+ - `event` (string): Currently only supports `'status'`
207
+ - `callback` (function): Called when the dial status changes
208
+ ---
209
+
210
+ #### `setPaused(paused)`
211
+
212
+ Pauses or resumes the AI during the call.
213
+
214
+ ```typescript
215
+ await call.setPaused(true); // Pause the AI
216
+ await call.setPaused(false); // Resume the AI
217
+ ```
218
+
219
+ **Parameters:**
220
+ - `paused` (boolean): `true` to pause the AI, `false` to resume
221
+
222
+ **Returns:** `Promise<void>`
223
+
224
+ ---
225
+
226
+ #### `hangup()`
227
+
228
+ Ends the current call.
229
+
230
+ ```typescript
231
+ await call.hangup();
232
+ ```
233
+
234
+ **Returns:** `Promise<void>`
235
+
236
+ ## Utilities
237
+
238
+ ### `dialStatusIsComplete(status)`
239
+
240
+ Helper function to check if a dial status indicates the call has completed.
241
+
242
+ ```typescript
243
+ import { dialStatusIsComplete } from '@vogent/vogent-web-client';
244
+
245
+ call.on('status', (status) => {
246
+ if (dialStatusIsComplete(status)) {
247
+ console.log('Call is complete');
248
+ // Clean up resources
249
+ }
250
+ });
251
+ ```
252
+
253
+ ## TypeScript Support
254
+
255
+ This library is written in TypeScript and includes full type definitions.
256
+
257
+ ```typescript
258
+ import { VogentCall, Transcript, VogentAudioConn } from '@vogent/vogent-web-client';
259
+ ```
260
+
261
+ ## Support
262
+
263
+ For more information and support:
264
+ - Documentation: [https://docs.vogent.ai](https://docs.vogent.ai)
265
+ - Issues: Please report issues on the GitHub repository
@@ -44,6 +44,8 @@ export type Transcript = {
44
44
  /** The text of the transcript */
45
45
  text: string;
46
46
  /** The speaker of the transcript currently either 'HUMAN' or 'AI', or 'IVR' if IVR detection is enabled */
47
+ role: string;
48
+ /** @deprecated Use role instead */
47
49
  speaker: string;
48
50
  }[];
49
51
  /**
@@ -71,7 +73,7 @@ export declare class VogentCall {
71
73
  * @param dialDetails.dialId - Unique dial/call identifier
72
74
  * @param dialDetails.token - Authentication token
73
75
  * @param config - Configuration options
74
- * @param config.baseUrl - API base URL (defaults to 'https://api.getelto.com')
76
+ * @param config.baseUrl - API base URL (defaults to 'https://api.vogent.ai')
75
77
  */
76
78
  constructor(dialDetails: {
77
79
  sessionId: string;
@@ -39,11 +39,11 @@
39
39
  * @see {@link https://docs.vogent.ai} for complete server documentation
40
40
  * @module VogentCall
41
41
  */
42
- import { ApolloClient, createHttpLink, InMemoryCache, split } from '@apollo/client/core';
42
+ import { ApolloClient, createHttpLink, InMemoryCache, split, } from '@apollo/client/core';
43
43
  import { setContext } from '@apollo/client/link/context';
44
44
  import { GraphQLWsLink } from '@apollo/client/link/subscriptions';
45
45
  import { getMainDefinition } from '@apollo/client/utilities';
46
- import { BrowserDialTokenType, SessionMessageType, } from './__generated__/graphql';
46
+ import { BrowserDialTokenType, LiveTranscriptEventType, SessionMessageType, } from './__generated__/graphql';
47
47
  import { AI_CONNECT_SESSION, AI_GET_TOKEN, AI_HANGUP_CALL, AI_START_DIAL_SESSION, AI_SET_PAUSED, REFRESH_TRANSCRIPT, } from './queries';
48
48
  import { createClient } from 'graphql-ws';
49
49
  import { VonageDevice } from './devices/VonageDevice';
@@ -60,15 +60,15 @@ export class VogentCall {
60
60
  * @param dialDetails.dialId - Unique dial/call identifier
61
61
  * @param dialDetails.token - Authentication token
62
62
  * @param config - Configuration options
63
- * @param config.baseUrl - API base URL (defaults to 'https://api.getelto.com')
63
+ * @param config.baseUrl - API base URL (defaults to 'https://api.vogent.ai')
64
64
  */
65
65
  constructor(dialDetails, config = {
66
- baseUrl: 'https://api.getelto.com',
66
+ baseUrl: 'https://api.vogent.ai',
67
67
  }) {
68
68
  this._handlers = [];
69
69
  this.sessionId = dialDetails.sessionId;
70
70
  this.dialId = dialDetails.dialId;
71
- let token = dialDetails.token;
71
+ const token = dialDetails.token;
72
72
  const authLink = setContext((_, { headers }) => {
73
73
  return {
74
74
  headers: {
@@ -82,9 +82,9 @@ export class VogentCall {
82
82
  uri: `${this.baseUrl}/query`,
83
83
  headers: {
84
84
  Authorization: `Bearer ${token}`,
85
- }
85
+ },
86
86
  });
87
- const wsBaseUrl = this.baseUrl.replace('https://', 'wss://').replace("http://", "ws://");
87
+ const wsBaseUrl = this.baseUrl.replace('https://', 'wss://').replace('http://', 'ws://');
88
88
  const wsLink = new GraphQLWsLink(createClient({
89
89
  url: `${wsBaseUrl}/query`,
90
90
  connectionParams: () => ({
@@ -120,6 +120,17 @@ export class VogentCall {
120
120
  * @returns Function to unsubscribe from transcript updates
121
121
  */
122
122
  monitorTranscript(fn) {
123
+ const transcriptLines = [];
124
+ const liveTranscriptLines = {};
125
+ let appendToTranscriptLines = (transcriptLine) => {
126
+ delete liveTranscriptLines[transcriptLine.role];
127
+ if (transcriptLines.length > 0 && transcriptLine.role === transcriptLines[transcriptLines.length - 1].role) {
128
+ transcriptLines[transcriptLines.length - 1].text += ' ' + transcriptLine.text;
129
+ }
130
+ else {
131
+ transcriptLines.push(transcriptLine);
132
+ }
133
+ };
123
134
  const subscription = this.client
124
135
  .subscribe({
125
136
  query: REFRESH_TRANSCRIPT,
@@ -129,13 +140,28 @@ export class VogentCall {
129
140
  })
130
141
  .subscribe(({ data }) => {
131
142
  console.log('monitorTranscript', data);
132
- if (!data?.watchTranscript) {
143
+ if (!data?.watchLiveTranscriptEvents) {
133
144
  return;
134
145
  }
135
- fn(data.watchTranscript.map((t) => ({
146
+ switch (data.watchLiveTranscriptEvents.eventType) {
147
+ case LiveTranscriptEventType.Final:
148
+ appendToTranscriptLines(data.watchLiveTranscriptEvents.transcriptLine);
149
+ break;
150
+ case LiveTranscriptEventType.Live:
151
+ liveTranscriptLines[data.watchLiveTranscriptEvents.transcriptLine.role] = data.watchLiveTranscriptEvents.transcriptLine;
152
+ break;
153
+ default:
154
+ break;
155
+ }
156
+ fn(transcriptLines.map((t) => ({
157
+ text: t.text,
158
+ role: t.role,
159
+ speaker: t.speaker,
160
+ })).concat(Object.values(liveTranscriptLines).map((t) => ({
136
161
  text: t.text,
162
+ role: t.role,
137
163
  speaker: t.speaker,
138
- })));
164
+ }))));
139
165
  });
140
166
  return () => {
141
167
  subscription.unsubscribe();
@@ -175,12 +201,13 @@ export class VogentCall {
175
201
  input: {
176
202
  type: BrowserDialTokenType.DialSession,
177
203
  dialSessionId: this.sessionId,
204
+ liveListen: liveListen,
178
205
  },
179
206
  },
180
207
  });
181
208
  let d;
182
209
  if (token.data.browserDialToken.telephonyProvider === 'livekit') {
183
- d = await LivekitDevice.getDevice(token.data.browserDialToken.token, token.data.browserDialToken.url);
210
+ d = await LivekitDevice.getDevice(token.data.browserDialToken.token, token.data.browserDialToken.url ?? '');
184
211
  }
185
212
  else {
186
213
  d = await VonageDevice.getDevice(token.data.browserDialToken.token, true);
@@ -24,7 +24,7 @@ declare const documents: {
24
24
  dialId: types.Scalars["ID"]["input"];
25
25
  pauseStatus: types.Scalars["Boolean"]["input"];
26
26
  }>>;
27
- "\n subscription RefreshTranscript($dialId: ID!) {\n watchTranscript(dialId: $dialId) {\n speaker\n text\n detailType\n }\n }\n": DocumentNode<types.RefreshTranscriptSubscription, types.Exact<{
27
+ "\n subscription RefreshTranscript($dialId: ID!) {\n watchLiveTranscriptEvents(dialId: $dialId) {\n eventType\n transcriptLine {\n role\n speaker\n text\n detailType\n audioStart\n audioEnd\n functionCalls {\n name\n arguments\n }\n }\n }\n }\n": DocumentNode<types.RefreshTranscriptSubscription, types.Exact<{
28
28
  dialId: types.Scalars["ID"]["input"];
29
29
  }>>;
30
30
  "\n mutation BrowserDialToken($input: BrowserDialTokenInput!) {\n browserDialToken(input: $input) {\n token\n iceConfig\n telephonyProvider\n url\n }\n }\n": DocumentNode<types.BrowserDialTokenMutation, types.Exact<{
@@ -62,7 +62,7 @@ export declare function gql(source: "\n mutation SetPaused($dialId: ID!, $pause
62
62
  /**
63
63
  * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
64
64
  */
65
- export declare function gql(source: "\n subscription RefreshTranscript($dialId: ID!) {\n watchTranscript(dialId: $dialId) {\n speaker\n text\n detailType\n }\n }\n"): (typeof documents)["\n subscription RefreshTranscript($dialId: ID!) {\n watchTranscript(dialId: $dialId) {\n speaker\n text\n detailType\n }\n }\n"];
65
+ export declare function gql(source: "\n subscription RefreshTranscript($dialId: ID!) {\n watchLiveTranscriptEvents(dialId: $dialId) {\n eventType\n transcriptLine {\n role\n speaker\n text\n detailType\n audioStart\n audioEnd\n functionCalls {\n name\n arguments\n }\n }\n }\n }\n"): (typeof documents)["\n subscription RefreshTranscript($dialId: ID!) {\n watchLiveTranscriptEvents(dialId: $dialId) {\n eventType\n transcriptLine {\n role\n speaker\n text\n detailType\n audioStart\n audioEnd\n functionCalls {\n name\n arguments\n }\n }\n }\n }\n"];
66
66
  /**
67
67
  * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
68
68
  */
@@ -15,7 +15,7 @@ const documents = {
15
15
  "\n mutation StartDialSession($sessionId: ID!) {\n startDialSession(dialSessionId: $sessionId)\n }\n": types.StartDialSessionDocument,
16
16
  "\n mutation HangupCall($dialId: ID!, $dropVoicemail: Boolean, $transferNumber: String) {\n hangupCall(dialId: $dialId, dropVoicemail: $dropVoicemail, transferNumber: $transferNumber)\n }\n": types.HangupCallDocument,
17
17
  "\n mutation SetPaused($dialId: ID!, $pauseStatus: Boolean!) {\n pauseAI(dialId: $dialId, pauseStatus: $pauseStatus) {\n id\n }\n }\n": types.SetPausedDocument,
18
- "\n subscription RefreshTranscript($dialId: ID!) {\n watchTranscript(dialId: $dialId) {\n speaker\n text\n detailType\n }\n }\n": types.RefreshTranscriptDocument,
18
+ "\n subscription RefreshTranscript($dialId: ID!) {\n watchLiveTranscriptEvents(dialId: $dialId) {\n eventType\n transcriptLine {\n role\n speaker\n text\n detailType\n audioStart\n audioEnd\n functionCalls {\n name\n arguments\n }\n }\n }\n }\n": types.RefreshTranscriptDocument,
19
19
  "\n mutation BrowserDialToken($input: BrowserDialTokenInput!) {\n browserDialToken(input: $input) {\n token\n iceConfig\n telephonyProvider\n url\n }\n }\n": types.BrowserDialTokenDocument,
20
20
  "\n subscription ConnectSession($sessionId: ID!) {\n connectSession(sessionId: $sessionId) {\n messageType\n content {\n __typename\n ... on DialsUpdatedMessage {\n contactId\n dials {\n id\n status\n answerType\n callDispositionId\n systemResultType\n toNumber\n }\n contactComplete\n }\n ... on DialConnectMessage {\n dialId\n }\n ... on SessionUpdatedMessage {\n dialSession {\n id\n status\n }\n reason\n }\n }\n }\n }\n": types.ConnectSessionDocument,
21
21
  };
@@ -63,7 +63,7 @@ export type AiChat = {
63
63
  __typename?: 'AIChat';
64
64
  id: Scalars['ID']['output'];
65
65
  prompt: Scalars['String']['output'];
66
- transcript: Array<SpeakerTextRes>;
66
+ transcript: Array<TranscriptLine>;
67
67
  };
68
68
  export type AiEvalAggregateResult = {
69
69
  __typename?: 'AIEvalAggregateResult';
@@ -108,7 +108,7 @@ export type AiEvalRecordsResult = {
108
108
  export type AiEvalResult = {
109
109
  __typename?: 'AIEvalResult';
110
110
  createdAt: Scalars['Time']['output'];
111
- evalTranscript: Array<SpeakerTextRes>;
111
+ evalTranscript: Array<TranscriptLine>;
112
112
  id: Scalars['ID']['output'];
113
113
  numAlerts: Scalars['Int']['output'];
114
114
  record: AiEvalRecord;
@@ -222,9 +222,14 @@ export type ApiKey = {
222
222
  createdAt: Scalars['Time']['output'];
223
223
  createdBy: User;
224
224
  key: Scalars['String']['output'];
225
+ keyType: ApiKeyType;
225
226
  lastUsed?: Maybe<Scalars['Time']['output']>;
226
227
  name: Scalars['String']['output'];
227
228
  };
229
+ export declare enum ApiKeyType {
230
+ Private = "private",
231
+ Public = "public"
232
+ }
228
233
  export declare enum AccessType {
229
234
  Deny = "DENY",
230
235
  Grant = "GRANT"
@@ -513,6 +518,7 @@ export type CallAgent = {
513
518
  defaultPrompt?: Maybe<VersionedPrompt>;
514
519
  endpointDetectorConfig: EndpointDetectorConfig;
515
520
  extractors: Array<CallAgentExtractor>;
521
+ fillEmptyStringVariables: Scalars['Boolean']['output'];
516
522
  functionDefinitions: Array<CallAgentFunctionDefinition>;
517
523
  id: Scalars['ID']['output'];
518
524
  idleMessageConfig: IdleMessageConfig;
@@ -536,6 +542,7 @@ export type CallAgent = {
536
542
  transcriberConfig: TranscriberConfig;
537
543
  transferNumber?: Maybe<Scalars['String']['output']>;
538
544
  utteranceDetectorConfig: UtteranceDetectorConfig;
545
+ versionedPromptAbTestDetails?: Maybe<VersionedPromptAbTestDetails>;
539
546
  versionedPromptBackupDetails?: Maybe<VersionedPromptBackupDetails>;
540
547
  voiceOptionValues?: Maybe<Array<ModelOptionValue>>;
541
548
  voiceVolumeLevel: Scalars['Int']['output'];
@@ -569,6 +576,7 @@ export type CallAgentInput = {
569
576
  defaultVersionedPrompt?: InputMaybe<CallAgentVersionedPromptInput>;
570
577
  defaultVoiceId: Scalars['ID']['input'];
571
578
  endpointDetectorConfig?: InputMaybe<EndpointDetectorConfigInput>;
579
+ fillEmptyStringVariables?: InputMaybe<Scalars['Boolean']['input']>;
572
580
  idleMessageConfig?: InputMaybe<IdleConfigInput>;
573
581
  inboundWebhookResponse?: InputMaybe<Scalars['Boolean']['input']>;
574
582
  inboundWebhookURL?: InputMaybe<Scalars['String']['input']>;
@@ -627,7 +635,7 @@ export type CallRecording = {
627
635
  export type CallTranscript = {
628
636
  __typename?: 'CallTranscript';
629
637
  id: Scalars['ID']['output'];
630
- text: Array<SpeakerTextRes>;
638
+ text: Array<TranscriptLine>;
631
639
  };
632
640
  export declare enum CallType {
633
641
  Browser = "BROWSER",
@@ -1012,6 +1020,7 @@ export type CreateTaskAttemptInput = {
1012
1020
  webhookUrl?: InputMaybe<Scalars['String']['input']>;
1013
1021
  };
1014
1022
  export type CreateUserApiKeyInput = {
1023
+ keyType?: InputMaybe<ApiKeyType>;
1015
1024
  name: Scalars['String']['input'];
1016
1025
  workspaceId: Scalars['ID']['input'];
1017
1026
  };
@@ -1138,6 +1147,7 @@ export type DialFilter = {
1138
1147
  phoneNumber?: InputMaybe<Scalars['String']['input']>;
1139
1148
  range?: InputMaybe<TimeRange>;
1140
1149
  systemResultTypes?: InputMaybe<Array<SystemResultType>>;
1150
+ versionedPrompts?: InputMaybe<Array<Scalars['ID']['input']>>;
1141
1151
  };
1142
1152
  export type DialListResult = {
1143
1153
  __typename?: 'DialListResult';
@@ -1578,6 +1588,15 @@ export type ListListsItem = {
1578
1588
  modifiedTime: Scalars['String']['output'];
1579
1589
  name: Scalars['String']['output'];
1580
1590
  };
1591
+ export type LiveTranscriptEvent = {
1592
+ __typename?: 'LiveTranscriptEvent';
1593
+ eventType: LiveTranscriptEventType;
1594
+ transcriptLine?: Maybe<TranscriptLine>;
1595
+ };
1596
+ export declare enum LiveTranscriptEventType {
1597
+ Final = "FINAL",
1598
+ Live = "LIVE"
1599
+ }
1581
1600
  export type LogCallResponse = {
1582
1601
  __typename?: 'LogCallResponse';
1583
1602
  success: Scalars['Boolean']['output'];
@@ -2498,8 +2517,8 @@ export type RunChatQueryInput = {
2498
2517
  export type RunChatQueryStreamResult = {
2499
2518
  __typename?: 'RunChatQueryStreamResult';
2500
2519
  messageType: ChatStreamMessageType;
2501
- speakerRes?: Maybe<SpeakerTextRes>;
2502
2520
  text?: Maybe<Scalars['String']['output']>;
2521
+ transcriptLine?: Maybe<TranscriptLine>;
2503
2522
  };
2504
2523
  export type RunModelCounterfactualInput = {
2505
2524
  dialId: Scalars['ID']['input'];
@@ -2661,18 +2680,6 @@ export type SpeakerTextKnowledgeBaseContext = {
2661
2680
  file: KnowledgeBaseFile;
2662
2681
  text: Scalars['String']['output'];
2663
2682
  };
2664
- export type SpeakerTextRes = {
2665
- __typename?: 'SpeakerTextRes';
2666
- audioEnd: Scalars['Int']['output'];
2667
- audioStart: Scalars['Int']['output'];
2668
- detailType?: Maybe<Scalars['String']['output']>;
2669
- functionCalls?: Maybe<Array<FunctionCallRes>>;
2670
- knowledgeBaseContext?: Maybe<Array<SpeakerTextKnowledgeBaseContext>>;
2671
- nodeTransitionResult?: Maybe<NodeTransitionResult>;
2672
- playId?: Maybe<Scalars['String']['output']>;
2673
- speaker: Scalars['String']['output'];
2674
- text: Scalars['String']['output'];
2675
- };
2676
2683
  export type StatFilter = {
2677
2684
  contactLists?: InputMaybe<Array<Scalars['ID']['input']>>;
2678
2685
  dialSessions?: InputMaybe<Array<Scalars['ID']['input']>>;
@@ -2702,7 +2709,8 @@ export type Subscription = {
2702
2709
  runChatQueryStream: RunChatQueryStreamResult;
2703
2710
  runModelTranscriptCounterfactual: RunModelCounterfactualResult;
2704
2711
  watchDialEvents: DialEvent;
2705
- watchTranscript: Array<SpeakerTextRes>;
2712
+ watchLiveTranscriptEvents: LiveTranscriptEvent;
2713
+ watchTranscript: Array<TranscriptLine>;
2706
2714
  watchWorkspaceDialEvents: WorkspaceDialEvent;
2707
2715
  };
2708
2716
  export type SubscriptionConnectRoomArgs = {
@@ -2732,6 +2740,9 @@ export type SubscriptionRunModelTranscriptCounterfactualArgs = {
2732
2740
  export type SubscriptionWatchDialEventsArgs = {
2733
2741
  dialId: Scalars['ID']['input'];
2734
2742
  };
2743
+ export type SubscriptionWatchLiveTranscriptEventsArgs = {
2744
+ dialId: Scalars['ID']['input'];
2745
+ };
2735
2746
  export type SubscriptionWatchTranscriptArgs = {
2736
2747
  dialId: Scalars['ID']['input'];
2737
2748
  };
@@ -2815,6 +2826,28 @@ export type TranscriberParamsInput = {
2815
2826
  keywords?: InputMaybe<Array<Scalars['String']['input']>>;
2816
2827
  type: Scalars['String']['input'];
2817
2828
  };
2829
+ export type TranscriptLine = {
2830
+ __typename?: 'TranscriptLine';
2831
+ audioEnd: Scalars['Int']['output'];
2832
+ audioStart: Scalars['Int']['output'];
2833
+ /** @deprecated Use role instead */
2834
+ detailType?: Maybe<Scalars['String']['output']>;
2835
+ functionCalls?: Maybe<Array<FunctionCallRes>>;
2836
+ knowledgeBaseContext?: Maybe<Array<SpeakerTextKnowledgeBaseContext>>;
2837
+ nodeTransitionResult?: Maybe<NodeTransitionResult>;
2838
+ playId?: Maybe<Scalars['String']['output']>;
2839
+ role: TranscriptLineRole;
2840
+ /** @deprecated Use role instead */
2841
+ speaker: Scalars['String']['output'];
2842
+ text: Scalars['String']['output'];
2843
+ };
2844
+ export declare enum TranscriptLineRole {
2845
+ Ai = "AI",
2846
+ FunctionResult = "FUNCTION_RESULT",
2847
+ Human = "HUMAN",
2848
+ Ivr = "IVR",
2849
+ NodeTransition = "NODE_TRANSITION"
2850
+ }
2818
2851
  export type UnlinkPhoneNumberAgentInput = {
2819
2852
  agentId: Scalars['ID']['input'];
2820
2853
  phoneNumberId: Scalars['ID']['input'];
@@ -2885,6 +2918,7 @@ export type UpdateCallAgentInput = {
2885
2918
  callAgentExtractorId?: InputMaybe<NullableStringInput>;
2886
2919
  defaultPromptId?: InputMaybe<Scalars['ID']['input']>;
2887
2920
  endpointDetectorConfig?: InputMaybe<EndpointDetectorConfigInput>;
2921
+ fillEmptyStringVariables?: InputMaybe<Scalars['Boolean']['input']>;
2888
2922
  idleMessageConfig?: InputMaybe<IdleConfigInput>;
2889
2923
  inboundWebhookResponse?: InputMaybe<Scalars['Boolean']['input']>;
2890
2924
  inboundWebhookURL?: InputMaybe<Scalars['String']['input']>;
@@ -2903,7 +2937,7 @@ export type UpdateCallAgentInput = {
2903
2937
  transcriberParams?: InputMaybe<TranscriberParamsInput>;
2904
2938
  transferNumber?: InputMaybe<NullableStringInput>;
2905
2939
  utteranceDetectorConfig?: InputMaybe<UtteranceDetectorConfigInput>;
2906
- versionedPromptBackupDetails?: InputMaybe<VersionedPromptBackupDetailsInput>;
2940
+ versionedPromptAbTestDetails?: InputMaybe<VersionedPromptAbTestDetailsInput>;
2907
2941
  voiceId?: InputMaybe<Scalars['ID']['input']>;
2908
2942
  voiceOptionValues?: InputMaybe<Array<ModelOptionValueInput>>;
2909
2943
  voiceVolumeLevel?: InputMaybe<Scalars['Int']['input']>;
@@ -2963,6 +2997,7 @@ export type UpdateSystemResultMappingInput = {
2963
2997
  export type UpdateVersionedPromptInput = {
2964
2998
  agentType?: InputMaybe<AgentType>;
2965
2999
  aiModelId?: InputMaybe<Scalars['ID']['input']>;
3000
+ backupDetails?: InputMaybe<VersionedPromptBackupDetailsInput>;
2966
3001
  flowDefinition?: InputMaybe<FlowDefinitionInput>;
2967
3002
  flowDefinitionJSON?: InputMaybe<Scalars['String']['input']>;
2968
3003
  modelOptionValues?: InputMaybe<Array<ModelOptionValueInput>>;
@@ -3087,6 +3122,7 @@ export type VersionedPrompt = {
3087
3122
  __typename?: 'VersionedPrompt';
3088
3123
  agentType: AgentType;
3089
3124
  aiModel?: Maybe<AiModel>;
3125
+ backupDetails?: Maybe<VersionedPromptBackupDetails>;
3090
3126
  createdAt: Scalars['Time']['output'];
3091
3127
  flowDefinition?: Maybe<FlowDefinition>;
3092
3128
  id: Scalars['ID']['output'];
@@ -3096,6 +3132,25 @@ export type VersionedPrompt = {
3096
3132
  prompt?: Maybe<Scalars['String']['output']>;
3097
3133
  updatedAt: Scalars['Time']['output'];
3098
3134
  };
3135
+ export type VersionedPromptAbTestDetails = {
3136
+ __typename?: 'VersionedPromptABTestDetails';
3137
+ disable: Scalars['Boolean']['output'];
3138
+ variants: Array<VersionedPromptAbTestVariant>;
3139
+ };
3140
+ export type VersionedPromptAbTestDetailsInput = {
3141
+ disable?: InputMaybe<Scalars['Boolean']['input']>;
3142
+ variants?: InputMaybe<Array<VersionedPromptAbTestVariantInput>>;
3143
+ };
3144
+ export type VersionedPromptAbTestVariant = {
3145
+ __typename?: 'VersionedPromptABTestVariant';
3146
+ percentage: Scalars['Int']['output'];
3147
+ versionedPrompt: VersionedPrompt;
3148
+ versionedPromptId: Scalars['ID']['output'];
3149
+ };
3150
+ export type VersionedPromptAbTestVariantInput = {
3151
+ percentage: Scalars['Int']['input'];
3152
+ versionedPromptId: Scalars['ID']['input'];
3153
+ };
3099
3154
  export type VersionedPromptBackupDetails = {
3100
3155
  __typename?: 'VersionedPromptBackupDetails';
3101
3156
  backupPrompts: Array<VersionedPromptBackupPrompt>;
@@ -3197,6 +3252,7 @@ export type Workspace = {
3197
3252
  aggregateStats: AggregateStats;
3198
3253
  aiEvalConfigs: Array<AiEvalConfig>;
3199
3254
  aiModels: AiModelsResult;
3255
+ allowExternalVoiceAPI: Scalars['Boolean']['output'];
3200
3256
  apiKeys?: Maybe<Array<ApiKey>>;
3201
3257
  apolloPurposes: Array<ApolloPurpose>;
3202
3258
  apolloUsers: Array<ApolloUser>;
@@ -3373,6 +3429,7 @@ export type WorkspaceLimits = {
3373
3429
  userPhoneNumberLimit: Scalars['Int']['output'];
3374
3430
  };
3375
3431
  export type WorkspaceLimitsInput = {
3432
+ allowExternalVoiceAPI?: InputMaybe<Scalars['Boolean']['input']>;
3376
3433
  concurrentDialLimit?: InputMaybe<Scalars['Int']['input']>;
3377
3434
  cpsLimit?: InputMaybe<Scalars['Int']['input']>;
3378
3435
  maxExportLimit?: InputMaybe<Scalars['Int']['input']>;
@@ -3432,12 +3489,24 @@ export type RefreshTranscriptSubscriptionVariables = Exact<{
3432
3489
  }>;
3433
3490
  export type RefreshTranscriptSubscription = {
3434
3491
  __typename?: 'Subscription';
3435
- watchTranscript: Array<{
3436
- __typename?: 'SpeakerTextRes';
3437
- speaker: string;
3438
- text: string;
3439
- detailType?: string | null;
3440
- }>;
3492
+ watchLiveTranscriptEvents: {
3493
+ __typename?: 'LiveTranscriptEvent';
3494
+ eventType: LiveTranscriptEventType;
3495
+ transcriptLine?: {
3496
+ __typename?: 'TranscriptLine';
3497
+ role: TranscriptLineRole;
3498
+ speaker: string;
3499
+ text: string;
3500
+ detailType?: string | null;
3501
+ audioStart: number;
3502
+ audioEnd: number;
3503
+ functionCalls?: Array<{
3504
+ __typename?: 'FunctionCallRes';
3505
+ name: string;
3506
+ arguments: string;
3507
+ }> | null;
3508
+ } | null;
3509
+ };
3441
3510
  };
3442
3511
  export type BrowserDialTokenMutationVariables = Exact<{
3443
3512
  input: BrowserDialTokenInput;
@@ -15,6 +15,11 @@ export var AiModelOptionValueType;
15
15
  AiModelOptionValueType["Int"] = "INT";
16
16
  AiModelOptionValueType["String"] = "STRING";
17
17
  })(AiModelOptionValueType || (AiModelOptionValueType = {}));
18
+ export var ApiKeyType;
19
+ (function (ApiKeyType) {
20
+ ApiKeyType["Private"] = "private";
21
+ ApiKeyType["Public"] = "public";
22
+ })(ApiKeyType || (ApiKeyType = {}));
18
23
  export var AccessType;
19
24
  (function (AccessType) {
20
25
  AccessType["Deny"] = "DENY";
@@ -187,6 +192,11 @@ export var KnowledgeBaseFileStatus;
187
192
  KnowledgeBaseFileStatus["Active"] = "ACTIVE";
188
193
  KnowledgeBaseFileStatus["Processing"] = "PROCESSING";
189
194
  })(KnowledgeBaseFileStatus || (KnowledgeBaseFileStatus = {}));
195
+ export var LiveTranscriptEventType;
196
+ (function (LiveTranscriptEventType) {
197
+ LiveTranscriptEventType["Final"] = "FINAL";
198
+ LiveTranscriptEventType["Live"] = "LIVE";
199
+ })(LiveTranscriptEventType || (LiveTranscriptEventType = {}));
190
200
  export var OpeningLineType;
191
201
  (function (OpeningLineType) {
192
202
  OpeningLineType["InboundOnly"] = "INBOUND_ONLY";
@@ -266,6 +276,14 @@ export var SystemResultType;
266
276
  SystemResultType["VoicemailLeft"] = "VOICEMAIL_LEFT";
267
277
  SystemResultType["VoicemailNotLeft"] = "VOICEMAIL_NOT_LEFT";
268
278
  })(SystemResultType || (SystemResultType = {}));
279
+ export var TranscriptLineRole;
280
+ (function (TranscriptLineRole) {
281
+ TranscriptLineRole["Ai"] = "AI";
282
+ TranscriptLineRole["FunctionResult"] = "FUNCTION_RESULT";
283
+ TranscriptLineRole["Human"] = "HUMAN";
284
+ TranscriptLineRole["Ivr"] = "IVR";
285
+ TranscriptLineRole["NodeTransition"] = "NODE_TRANSITION";
286
+ })(TranscriptLineRole || (TranscriptLineRole = {}));
269
287
  export var UserActivityMessageType;
270
288
  (function (UserActivityMessageType) {
271
289
  UserActivityMessageType["SessionDialConnect"] = "SESSION_DIAL_CONNECT";
@@ -320,6 +338,6 @@ export var WorkspaceDialEventType;
320
338
  export const StartDialSessionDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "StartDialSession" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "sessionId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "ID" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "startDialSession" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "dialSessionId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "sessionId" } } }] }] } }] };
321
339
  export const HangupCallDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "HangupCall" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "dialId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "ID" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "dropVoicemail" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Boolean" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "transferNumber" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "hangupCall" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "dialId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "dialId" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "dropVoicemail" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "dropVoicemail" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "transferNumber" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "transferNumber" } } }] }] } }] };
322
340
  export const SetPausedDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "SetPaused" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "dialId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "ID" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "pauseStatus" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Boolean" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "pauseAI" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "dialId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "dialId" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "pauseStatus" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "pauseStatus" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }] } }] } }] };
323
- export const RefreshTranscriptDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "subscription", "name": { "kind": "Name", "value": "RefreshTranscript" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "dialId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "ID" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "watchTranscript" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "dialId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "dialId" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "speaker" } }, { "kind": "Field", "name": { "kind": "Name", "value": "text" } }, { "kind": "Field", "name": { "kind": "Name", "value": "detailType" } }] } }] } }] };
341
+ export const RefreshTranscriptDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "subscription", "name": { "kind": "Name", "value": "RefreshTranscript" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "dialId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "ID" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "watchLiveTranscriptEvents" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "dialId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "dialId" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "eventType" } }, { "kind": "Field", "name": { "kind": "Name", "value": "transcriptLine" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "role" } }, { "kind": "Field", "name": { "kind": "Name", "value": "speaker" } }, { "kind": "Field", "name": { "kind": "Name", "value": "text" } }, { "kind": "Field", "name": { "kind": "Name", "value": "detailType" } }, { "kind": "Field", "name": { "kind": "Name", "value": "audioStart" } }, { "kind": "Field", "name": { "kind": "Name", "value": "audioEnd" } }, { "kind": "Field", "name": { "kind": "Name", "value": "functionCalls" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "arguments" } }] } }] } }] } }] } }] };
324
342
  export const BrowserDialTokenDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "BrowserDialToken" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "BrowserDialTokenInput" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "browserDialToken" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "input" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "token" } }, { "kind": "Field", "name": { "kind": "Name", "value": "iceConfig" } }, { "kind": "Field", "name": { "kind": "Name", "value": "telephonyProvider" } }, { "kind": "Field", "name": { "kind": "Name", "value": "url" } }] } }] } }] };
325
343
  export const ConnectSessionDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "subscription", "name": { "kind": "Name", "value": "ConnectSession" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "sessionId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "ID" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "connectSession" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "sessionId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "sessionId" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "messageType" } }, { "kind": "Field", "name": { "kind": "Name", "value": "content" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "__typename" } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "DialsUpdatedMessage" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "contactId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "dials" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "status" } }, { "kind": "Field", "name": { "kind": "Name", "value": "answerType" } }, { "kind": "Field", "name": { "kind": "Name", "value": "callDispositionId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "systemResultType" } }, { "kind": "Field", "name": { "kind": "Name", "value": "toNumber" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "contactComplete" } }] } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "DialConnectMessage" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "dialId" } }] } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "SessionUpdatedMessage" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "dialSession" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "status" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "reason" } }] } }] } }] } }] } }] };
@@ -4,7 +4,7 @@ export declare class LivekitCall {
4
4
  _room: Room;
5
5
  _params: any;
6
6
  _handlers: {
7
- ev: 'mute' | 'disconnect';
7
+ ev: 'mute' | 'disconnect' | 'track-added';
8
8
  fn: (...args: any[]) => void;
9
9
  }[];
10
10
  constructor(room: Room);
@@ -12,7 +12,7 @@ export declare class LivekitCall {
12
12
  sendDigits(k: string): void;
13
13
  disconnect(): void;
14
14
  sendEvent(evName: string, ...args: any[]): void;
15
- on(ev: 'mute' | 'disconnect', fn: (...args: any[]) => void): void;
15
+ on(ev: 'mute' | 'disconnect' | 'track-added', fn: (...args: any[]) => void): void;
16
16
  }
17
17
  export declare class LivekitDevice {
18
18
  _room: Room;
@@ -1,4 +1,8 @@
1
1
  import { Room, RoomEvent, } from 'livekit-client';
2
+ function isReactNative() {
3
+ // navigator.product is deprecated on browsers, but will be set appropriately for react-native.
4
+ return navigator.product == 'ReactNative';
5
+ }
2
6
  export class LivekitCall {
3
7
  constructor(room) {
4
8
  this._room = room;
@@ -64,7 +68,9 @@ export class LivekitDevice {
64
68
  this._room.disconnect();
65
69
  }
66
70
  handleTrackSubscribed(track, _publication, _participant) {
67
- console.log('Track subscribed', track);
71
+ if (isReactNative()) {
72
+ return;
73
+ }
68
74
  if (track.kind === 'audio') {
69
75
  const audioElement = track.attach();
70
76
  document.body.appendChild(audioElement);
@@ -73,7 +79,7 @@ export class LivekitDevice {
73
79
  }
74
80
  handleTrackUnsubscribed(track, _publication, _participant) {
75
81
  if (track.kind === 'audio') {
76
- console.log('Track unsubscribed', track);
82
+ // console.log('Track unsubscribed', track);
77
83
  }
78
84
  }
79
85
  async connect(_p) {
@@ -14,7 +14,7 @@ export declare class VonageCall {
14
14
  sendDigits(k: string): void;
15
15
  disconnect(): void;
16
16
  sendEvent(evName: string, ...args: any[]): void;
17
- on(ev: 'mute' | 'disconnect', fn: (...args: any[]) => void): void;
17
+ on(ev: 'mute' | 'disconnect' | 'track-added', fn: (...args: any[]) => void): void;
18
18
  }
19
19
  export declare class VonageDevice {
20
20
  _sessionId: string;
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { VogentCall } from './VogentCall';
1
+ export { VogentCall, Transcript } from './VogentCall';
2
2
  export * from './devices/VogentDevice';
3
3
  export { dialStatusIsComplete } from './utils';
package/dist/queries.js CHANGED
@@ -18,10 +18,20 @@ export const AI_SET_PAUSED = gql(`
18
18
  `);
19
19
  export const REFRESH_TRANSCRIPT = gql(`
20
20
  subscription RefreshTranscript($dialId: ID!) {
21
- watchTranscript(dialId: $dialId) {
22
- speaker
23
- text
24
- detailType
21
+ watchLiveTranscriptEvents(dialId: $dialId) {
22
+ eventType
23
+ transcriptLine {
24
+ role
25
+ speaker
26
+ text
27
+ detailType
28
+ audioStart
29
+ audioEnd
30
+ functionCalls {
31
+ name
32
+ arguments
33
+ }
34
+ }
25
35
  }
26
36
  }
27
37
  `);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vogent/vogent-web-client",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "license": "MIT",
5
5
  "dependencies": {
6
6
  "@apollo/client": "^3.12.4",
@@ -20,9 +20,29 @@
20
20
  "default": "./dist/index.js"
21
21
  }
22
22
  },
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "github:vogent/vogent-web-client"
26
+ },
27
+ "publishConfig": {
28
+ "main": "dist/index.js",
29
+ "types": "dist/index.d.ts",
30
+ "files": [
31
+ "dist"
32
+ ],
33
+ "exports": {
34
+ ".": {
35
+ "types": "./dist/index.d.ts",
36
+ "default": "./dist/index.js"
37
+ }
38
+ }
39
+ },
23
40
  "scripts": {
24
- "build": "tsc",
25
- "prepublishOnly": "yarn build"
41
+ "build": "bun run tsc",
42
+ "prepublishOnly": "bun run build",
43
+ "release:patch": "bun version patch && git push && git push --tags",
44
+ "release:minor": "bun version minor && git push && git push --tags",
45
+ "release:major": "bun version major && git push && git push --tags"
26
46
  },
27
47
  "devDependencies": {
28
48
  "@graphql-codegen/cli": "^5.0.3",
package/dist/.DS_Store DELETED
Binary file
package/dist/codegen.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import { CodegenConfig } from '@graphql-codegen/cli';
2
- declare const config: CodegenConfig;
3
- export default config;
package/dist/codegen.js DELETED
@@ -1,25 +0,0 @@
1
- const config = {
2
- generates: {
3
- './__generated__/': {
4
- preset: 'client',
5
- schema: 'https://api.getelto.com/query',
6
- documents: ['*.ts'],
7
- plugins: [
8
- {
9
- add: {
10
- content: '/* eslint-disable */',
11
- },
12
- },
13
- ],
14
- presetConfig: {
15
- gqlTagName: 'gql',
16
- fragmentMasking: false,
17
- },
18
- config: {
19
- dedupeFragments: true,
20
- },
21
- },
22
- },
23
- ignoreNoDocuments: true,
24
- };
25
- export default config;