@vogent/vogent-web-client 0.1.5 → 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/dist/VogentCall.d.ts +2 -0
- package/dist/VogentCall.js +30 -4
- package/dist/__generated__/gql.d.ts +2 -2
- package/dist/__generated__/gql.js +1 -1
- package/dist/__generated__/graphql.d.ts +93 -24
- package/dist/__generated__/graphql.js +19 -1
- package/dist/devices/LivekitDevice.js +7 -0
- package/dist/index.d.ts +1 -1
- package/dist/queries.js +14 -4
- package/package.json +6 -7
- package/src/VogentCall.ts +0 -350
- package/src/__generated__/gql.ts +0 -68
- package/src/__generated__/graphql.ts +0 -4228
- package/src/__generated__/index.ts +0 -1
- package/src/devices/LivekitDevice.ts +0 -130
- package/src/devices/VogentDevice.ts +0 -49
- package/src/devices/VonageDevice.ts +0 -104
- package/src/index.ts +0 -3
- package/src/queries.ts +0 -75
- package/src/utils.ts +0 -16
package/dist/VogentCall.d.ts
CHANGED
|
@@ -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
|
/**
|
package/dist/VogentCall.js
CHANGED
|
@@ -43,7 +43,7 @@ import { ApolloClient, createHttpLink, InMemoryCache, split, } from '@apollo/cli
|
|
|
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';
|
|
@@ -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?.
|
|
143
|
+
if (!data?.watchLiveTranscriptEvents) {
|
|
133
144
|
return;
|
|
134
145
|
}
|
|
135
|
-
|
|
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();
|
|
@@ -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
|
|
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
|
|
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
|
|
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<
|
|
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<
|
|
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<
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
3436
|
-
__typename?: '
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
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": "
|
|
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" } }] } }] } }] } }] } }] };
|
|
@@ -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,6 +68,9 @@ export class LivekitDevice {
|
|
|
64
68
|
this._room.disconnect();
|
|
65
69
|
}
|
|
66
70
|
handleTrackSubscribed(track, _publication, _participant) {
|
|
71
|
+
if (isReactNative()) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
67
74
|
if (track.kind === 'audio') {
|
|
68
75
|
const audioElement = track.attach();
|
|
69
76
|
document.body.appendChild(audioElement);
|
package/dist/index.d.ts
CHANGED
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
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@apollo/client": "^3.12.4",
|
|
@@ -9,16 +9,15 @@
|
|
|
9
9
|
"graphql-ws": "^5.16.0",
|
|
10
10
|
"livekit-client": "2.15.8"
|
|
11
11
|
},
|
|
12
|
-
"main": "
|
|
13
|
-
"types": "
|
|
12
|
+
"main": "dist/index.js",
|
|
13
|
+
"types": "dist/index.d.ts",
|
|
14
14
|
"files": [
|
|
15
|
-
"dist"
|
|
16
|
-
"src"
|
|
15
|
+
"dist"
|
|
17
16
|
],
|
|
18
17
|
"exports": {
|
|
19
18
|
".": {
|
|
20
|
-
"types": "./
|
|
21
|
-
"default": "./
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"default": "./dist/index.js"
|
|
22
21
|
}
|
|
23
22
|
},
|
|
24
23
|
"repository": {
|