@vogent/vogent-web-client 0.1.0 → 0.1.2

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.
@@ -42,6 +42,14 @@ export var ArrayConditionType;
42
42
  ArrayConditionType["All"] = "all";
43
43
  ArrayConditionType["Any"] = "any";
44
44
  })(ArrayConditionType || (ArrayConditionType = {}));
45
+ export var BatchDialJobStatus;
46
+ (function (BatchDialJobStatus) {
47
+ BatchDialJobStatus["Active"] = "ACTIVE";
48
+ BatchDialJobStatus["Cancelled"] = "CANCELLED";
49
+ BatchDialJobStatus["Complete"] = "COMPLETE";
50
+ BatchDialJobStatus["Init"] = "INIT";
51
+ BatchDialJobStatus["Paused"] = "PAUSED";
52
+ })(BatchDialJobStatus || (BatchDialJobStatus = {}));
45
53
  export var BrowserDialTokenType;
46
54
  (function (BrowserDialTokenType) {
47
55
  BrowserDialTokenType["DialSession"] = "DIAL_SESSION";
@@ -114,6 +122,17 @@ export var DialTreeStrategy;
114
122
  DialTreeStrategy["Connect"] = "CONNECT";
115
123
  DialTreeStrategy["Skip"] = "SKIP";
116
124
  })(DialTreeStrategy || (DialTreeStrategy = {}));
125
+ export var EndpointDetectorMode;
126
+ (function (EndpointDetectorMode) {
127
+ EndpointDetectorMode["Aggressive"] = "AGGRESSIVE";
128
+ EndpointDetectorMode["Conservative"] = "CONSERVATIVE";
129
+ EndpointDetectorMode["Default"] = "DEFAULT";
130
+ })(EndpointDetectorMode || (EndpointDetectorMode = {}));
131
+ export var EndpointDetectorType;
132
+ (function (EndpointDetectorType) {
133
+ EndpointDetectorType["Semantic"] = "SEMANTIC";
134
+ EndpointDetectorType["Simple"] = "SIMPLE";
135
+ })(EndpointDetectorType || (EndpointDetectorType = {}));
117
136
  export var ExtractorFieldType;
118
137
  (function (ExtractorFieldType) {
119
138
  ExtractorFieldType["Boolean"] = "BOOLEAN";
@@ -174,6 +193,17 @@ export var OpeningLineType;
174
193
  OpeningLineType["InboundOutbound"] = "INBOUND_OUTBOUND";
175
194
  OpeningLineType["None"] = "NONE";
176
195
  })(OpeningLineType || (OpeningLineType = {}));
196
+ export var OutputType;
197
+ (function (OutputType) {
198
+ OutputType["Mp3"] = "MP3";
199
+ OutputType["RawPcm16"] = "RAW_PCM16";
200
+ OutputType["WavPcm16"] = "WAV_PCM16";
201
+ })(OutputType || (OutputType = {}));
202
+ export var PhoneNumberType;
203
+ (function (PhoneNumberType) {
204
+ PhoneNumberType["Pstn"] = "PSTN";
205
+ PhoneNumberType["SipUsername"] = "SIP_USERNAME";
206
+ })(PhoneNumberType || (PhoneNumberType = {}));
177
207
  export var RecordingSettingType;
178
208
  (function (RecordingSettingType) {
179
209
  RecordingSettingType["BlockAreaCodes"] = "BLOCK_AREA_CODES";
@@ -210,18 +240,29 @@ export var SessionMessageType;
210
240
  SessionMessageType["SessionContactUpdate"] = "SESSION_CONTACT_UPDATE";
211
241
  SessionMessageType["SessionUpdate"] = "SESSION_UPDATE";
212
242
  })(SessionMessageType || (SessionMessageType = {}));
243
+ export var SilenceHangupType;
244
+ (function (SilenceHangupType) {
245
+ SilenceHangupType["Disabled"] = "DISABLED";
246
+ SilenceHangupType["FirstMessageOnly"] = "FIRST_MESSAGE_ONLY";
247
+ SilenceHangupType["WholeCall"] = "WHOLE_CALL";
248
+ })(SilenceHangupType || (SilenceHangupType = {}));
213
249
  export var SystemResultType;
214
250
  (function (SystemResultType) {
251
+ SystemResultType["AgentHangup"] = "AGENT_HANGUP";
215
252
  SystemResultType["Busy"] = "BUSY";
216
253
  SystemResultType["Cancelled"] = "CANCELLED";
254
+ SystemResultType["CounterpartyHangup"] = "COUNTERPARTY_HANGUP";
217
255
  SystemResultType["DialTreeFound"] = "DIAL_TREE_FOUND";
218
256
  SystemResultType["DncSkipped"] = "DNC_SKIPPED";
219
257
  SystemResultType["Failed"] = "FAILED";
258
+ SystemResultType["LongSilenceHangup"] = "LONG_SILENCE_HANGUP";
220
259
  SystemResultType["NoAnswer"] = "NO_ANSWER";
221
260
  SystemResultType["NumberSkipped"] = "NUMBER_SKIPPED";
222
261
  SystemResultType["RateLimited"] = "RATE_LIMITED";
223
262
  SystemResultType["Timeout"] = "TIMEOUT";
263
+ SystemResultType["Transferred"] = "TRANSFERRED";
224
264
  SystemResultType["UserHangup"] = "USER_HANGUP";
265
+ SystemResultType["VoicemailDetectedHangup"] = "VOICEMAIL_DETECTED_HANGUP";
225
266
  SystemResultType["VoicemailLeft"] = "VOICEMAIL_LEFT";
226
267
  SystemResultType["VoicemailNotLeft"] = "VOICEMAIL_NOT_LEFT";
227
268
  })(SystemResultType || (SystemResultType = {}));
@@ -261,6 +302,11 @@ export var VoiceTier;
261
302
  VoiceTier["Premium"] = "PREMIUM";
262
303
  VoiceTier["Standard"] = "STANDARD";
263
304
  })(VoiceTier || (VoiceTier = {}));
305
+ export var VoicemailDetection;
306
+ (function (VoicemailDetection) {
307
+ VoicemailDetection["Disable"] = "DISABLE";
308
+ VoicemailDetection["Hangup"] = "HANGUP";
309
+ })(VoicemailDetection || (VoicemailDetection = {}));
264
310
  export var WebcallType;
265
311
  (function (WebcallType) {
266
312
  WebcallType["Legacy"] = "legacy";
@@ -276,4 +322,4 @@ export const HangupCallDocument = { "kind": "Document", "definitions": [{ "kind"
276
322
  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" } }] } }] } }] };
277
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" } }] } }] } }] };
278
324
  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" } }] } }] } }] };
279
- 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": "phoneField" } }, { "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" } }] } }] } }] } }] } }] };
325
+ 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,15 +4,17 @@ 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);
11
+ handleTrackSubscribed(track: RemoteTrack, _publication: RemoteTrackPublication, _participant: RemoteParticipant): void;
12
+ handleTrackUnsubscribed(track: RemoteTrack, _publication: RemoteTrackPublication, _participant: RemoteParticipant): void;
11
13
  mute(status: boolean): void;
12
14
  sendDigits(k: string): void;
13
15
  disconnect(): void;
14
16
  sendEvent(evName: string, ...args: any[]): void;
15
- on(ev: 'mute' | 'disconnect', fn: (...args: any[]) => void): void;
17
+ on(ev: 'mute' | 'disconnect' | 'track-added', fn: (...args: any[]) => void): void;
16
18
  }
17
19
  export declare class LivekitDevice {
18
20
  _room: Room;
@@ -21,7 +23,5 @@ export declare class LivekitDevice {
21
23
  private constructor();
22
24
  static getDevice(sessionToken: string, url: string): Promise<LivekitDevice>;
23
25
  disconnect(): void;
24
- handleTrackSubscribed(track: RemoteTrack, _publication: RemoteTrackPublication, _participant: RemoteParticipant): void;
25
- handleTrackUnsubscribed(track: RemoteTrack, _publication: RemoteTrackPublication, _participant: RemoteParticipant): void;
26
26
  connect(_p: any): Promise<VogentAudioConn>;
27
27
  }
@@ -4,6 +4,28 @@ export class LivekitCall {
4
4
  this._room = room;
5
5
  this._params = {};
6
6
  this._handlers = [];
7
+ this._room
8
+ .on(RoomEvent.TrackSubscribed, (...args) => {
9
+ this.handleTrackSubscribed(...args);
10
+ })
11
+ .on(RoomEvent.TrackUnsubscribed, (...args) => this.handleTrackUnsubscribed(...args))
12
+ .on(RoomEvent.Disconnected, () => this.disconnect());
13
+ }
14
+ handleTrackSubscribed(track, _publication, _participant) {
15
+ console.log('Track subscribed', track);
16
+ if (track.kind === 'audio') {
17
+ const audioElement = track.attach();
18
+ document.body.appendChild(audioElement);
19
+ audioElement.style.display = 'none';
20
+ }
21
+ if (_participant.identity === 'livekit-ai-processor') {
22
+ this.sendEvent('track-added', track.mediaStreamTrack);
23
+ }
24
+ }
25
+ handleTrackUnsubscribed(track, _publication, _participant) {
26
+ if (track.kind === 'audio') {
27
+ console.log('Track unsubscribed', track);
28
+ }
7
29
  }
8
30
  mute(status) {
9
31
  if (status) {
@@ -48,10 +70,6 @@ export class LivekitDevice {
48
70
  this._url = url;
49
71
  // speeds up connection attempt
50
72
  this._room.prepareConnection(this._url, this._token);
51
- this._room
52
- .on(RoomEvent.TrackSubscribed, this.handleTrackSubscribed)
53
- .on(RoomEvent.TrackUnsubscribed, this.handleTrackUnsubscribed)
54
- .on(RoomEvent.Disconnected, this.disconnect);
55
73
  }
56
74
  static async getDevice(sessionToken, url) {
57
75
  const room = new Room();
@@ -60,18 +78,6 @@ export class LivekitDevice {
60
78
  disconnect() {
61
79
  this._room.disconnect();
62
80
  }
63
- handleTrackSubscribed(track, _publication, _participant) {
64
- if (track.kind === 'audio') {
65
- const audioElement = track.attach();
66
- document.body.appendChild(audioElement);
67
- audioElement.style.display = 'none';
68
- }
69
- }
70
- handleTrackUnsubscribed(track, _publication, _participant) {
71
- if (track.kind === 'audio') {
72
- console.log('Track unsubscribed', track);
73
- }
74
- }
75
81
  async connect(_p) {
76
82
  await this._room.connect(this._url, this._token, {});
77
83
  const lkcall = new LivekitCall(this._room);
@@ -10,7 +10,7 @@ export interface VogentAudioConn {
10
10
  * - 'disconnect': Fired when the connection is terminated
11
11
  * @param fn - Callback function to handle the event
12
12
  */
13
- on: (ev: 'mute' | 'disconnect', fn: (...args: any[]) => void) => void;
13
+ on: (ev: 'mute' | 'disconnect' | 'track-added', fn: (...args: any[]) => void) => void;
14
14
  /**
15
15
  * Mute or unmute the audio connection
16
16
  * @param status - True to mute, false to unmute
@@ -6,7 +6,7 @@ export declare class VonageCall {
6
6
  _liveListen: boolean;
7
7
  _params: any;
8
8
  _handlers: {
9
- ev: 'mute' | 'disconnect';
9
+ ev: 'mute' | 'disconnect' | 'track-added';
10
10
  fn: (...args: any[]) => void;
11
11
  }[];
12
12
  constructor(callId: string, client: VonageClient, params: any);
package/dist/queries.js CHANGED
@@ -47,7 +47,6 @@ export const AI_CONNECT_SESSION = gql(`
47
47
  id
48
48
  status
49
49
  answerType
50
- phoneField
51
50
  callDispositionId
52
51
  systemResultType
53
52
  toNumber
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vogent/vogent-web-client",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "license": "MIT",
5
5
  "dependencies": {
6
6
  "@apollo/client": "^3.12.4",