@d-id/client-sdk 1.1.0-beta.11 → 1.1.0-beta.12
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/index.js +586 -554
- package/dist/index.umd.cjs +1 -1
- package/dist/src/types/stream/stream.d.ts +0 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
class
|
|
1
|
+
var me = Object.defineProperty;
|
|
2
|
+
var ge = (e, t, a) => t in e ? me(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a;
|
|
3
|
+
var q = (e, t, a) => (ge(e, typeof t != "symbol" ? t + "" : t, a), a);
|
|
4
|
+
class Q extends Error {
|
|
5
5
|
constructor({
|
|
6
6
|
kind: a,
|
|
7
|
-
description:
|
|
7
|
+
description: r,
|
|
8
8
|
error: o
|
|
9
9
|
}) {
|
|
10
10
|
super(JSON.stringify({
|
|
11
11
|
kind: a,
|
|
12
|
-
description:
|
|
12
|
+
description: r
|
|
13
13
|
}));
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
this.kind = a, this.description =
|
|
14
|
+
q(this, "kind");
|
|
15
|
+
q(this, "description");
|
|
16
|
+
q(this, "error");
|
|
17
|
+
this.kind = a, this.description = r, this.error = o;
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
class
|
|
20
|
+
class he extends Q {
|
|
21
21
|
constructor(t, a) {
|
|
22
22
|
super({
|
|
23
23
|
kind: "ChatCreationFailed",
|
|
@@ -25,7 +25,7 @@ class we extends X {
|
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
class
|
|
28
|
+
class we extends Q {
|
|
29
29
|
constructor(t) {
|
|
30
30
|
super({
|
|
31
31
|
kind: "ChatModeDowngraded",
|
|
@@ -33,17 +33,17 @@ class pe extends X {
|
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
class
|
|
37
|
-
constructor(a,
|
|
36
|
+
class W extends Q {
|
|
37
|
+
constructor(a, r) {
|
|
38
38
|
super({
|
|
39
39
|
kind: "ValidationError",
|
|
40
40
|
description: a
|
|
41
41
|
});
|
|
42
|
-
|
|
43
|
-
this.key =
|
|
42
|
+
q(this, "key");
|
|
43
|
+
this.key = r;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
class
|
|
46
|
+
class pe extends Q {
|
|
47
47
|
constructor(t) {
|
|
48
48
|
super({
|
|
49
49
|
kind: "WSError",
|
|
@@ -51,8 +51,8 @@ class ye extends X {
|
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
var
|
|
55
|
-
const
|
|
54
|
+
var ye = /* @__PURE__ */ ((e) => (e.TRIAL = "trial", e.BASIC = "basic", e.ENTERPRISE = "enterprise", e.LITE = "lite", e.ADVANCED = "advanced", e))(ye || {}), ve = /* @__PURE__ */ ((e) => (e.TRIAL = "deid-trial", e.PRO = "deid-pro", e.ENTERPRISE = "deid-enterprise", e.LITE = "deid-lite", e.ADVANCED = "deid-advanced", e.BUILD = "deid-api-build", e.LAUNCH = "deid-api-launch", e.SCALE = "deid-api-scale", e))(ve || {}), ke = /* @__PURE__ */ ((e) => (e.Created = "created", e.Started = "started", e.Done = "done", e.Error = "error", e.Rejected = "rejected", e.Ready = "ready", e))(ke || {}), De = /* @__PURE__ */ ((e) => (e.Unrated = "Unrated", e.Positive = "Positive", e.Negative = "Negative", e))(De || {}), b = /* @__PURE__ */ ((e) => (e.Functional = "Functional", e.TextOnly = "TextOnly", e.Maintenance = "Maintenance", e.Playground = "Playground", e.DirectPlayback = "DirectPlayback", e))(b || {}), U = /* @__PURE__ */ ((e) => (e.Embed = "embed", e.Query = "query", e.Partial = "partial", e.Answer = "answer", e.Complete = "done", e))(U || {}), Re = /* @__PURE__ */ ((e) => (e.KnowledgeProcessing = "knowledge/processing", e.KnowledgeIndexing = "knowledge/indexing", e.KnowledgeFailed = "knowledge/error", e.KnowledgeDone = "knowledge/done", e))(Re || {}), Ce = /* @__PURE__ */ ((e) => (e.Knowledge = "knowledge", e.Document = "document", e.Record = "record", e))(Ce || {}), Se = /* @__PURE__ */ ((e) => (e.Pdf = "pdf", e.Text = "text", e.Html = "html", e.Word = "word", e.Json = "json", e.Markdown = "markdown", e.Csv = "csv", e.Excel = "excel", e.Powerpoint = "powerpoint", e.Archive = "archive", e.Image = "image", e.Audio = "audio", e.Video = "video", e))(Se || {}), ae = /* @__PURE__ */ ((e) => (e.Clip = "clip", e.Talk = "talk", e))(ae || {});
|
|
55
|
+
const Ee = (e) => {
|
|
56
56
|
switch (e) {
|
|
57
57
|
case "clip":
|
|
58
58
|
return "clip";
|
|
@@ -62,18 +62,12 @@ const _e = (e) => {
|
|
|
62
62
|
throw new Error(`Unknown video type: ${e}`);
|
|
63
63
|
}
|
|
64
64
|
};
|
|
65
|
-
var p = /* @__PURE__ */ ((e) => (e.Start = "START", e.Stop = "STOP", e))(p || {}),
|
|
66
|
-
const
|
|
67
|
-
"stream/started": "START",
|
|
68
|
-
"stream/done": "STOP"
|
|
69
|
-
/* Stop */
|
|
70
|
-
};
|
|
71
|
-
var W = /* @__PURE__ */ ((e) => (e.ChatAnswer = "chat/answer", e.ChatPartial = "chat/partial", e.StreamDone = "stream/done", e.StreamStarted = "stream/started", e.StreamFailed = "stream/error", e.StreamReady = "stream/ready", e.StreamCreated = "stream/created", e.StreamVideoCreated = "stream-video/started", e.StreamVideoDone = "stream-video/done", e.StreamVideoError = "stream-video/error", e.StreamVideoRejected = "stream-video/rejected", e))(W || {}), _ = /* @__PURE__ */ ((e) => (e.New = "new", e.Fail = "fail", e.Connected = "connected", e.Connecting = "connecting", e.Closed = "closed", e.Completed = "completed", e.Disconnected = "disconnected", e))(_ || {}), z = /* @__PURE__ */ ((e) => (e.Legacy = "legacy", e.Fluent = "fluent", e))(z || {}), Me = /* @__PURE__ */ ((e) => (e.Amazon = "amazon", e.Microsoft = "microsoft", e.Afflorithmics = "afflorithmics", e.Elevenlabs = "elevenlabs", e))(Me || {}), Ie = /* @__PURE__ */ ((e) => (e.Public = "public", e.Premium = "premium", e.Private = "private", e))(Ie || {});
|
|
72
|
-
const Te = 45 * 1e3, be = "X-Playground-Chat", V = "https://api.d-id.com", je = "wss://notifications.d-id.com", Pe = "79f81a83a67430be2bc0fd61042b8faa", se = (e) => new Promise((t) => setTimeout(t, e)), J = (e = 16) => {
|
|
65
|
+
var p = /* @__PURE__ */ ((e) => (e.Start = "START", e.Stop = "STOP", e))(p || {}), V = /* @__PURE__ */ ((e) => (e.Strong = "STRONG", e.Weak = "WEAK", e.Unknown = "UNKNOWN", e))(V || {}), X = /* @__PURE__ */ ((e) => (e.Idle = "IDLE", e.Talking = "TALKING", e))(X || {}), N = /* @__PURE__ */ ((e) => (e.ChatAnswer = "chat/answer", e.ChatPartial = "chat/partial", e.StreamDone = "stream/done", e.StreamStarted = "stream/started", e.StreamFailed = "stream/error", e.StreamReady = "stream/ready", e.StreamCreated = "stream/created", e.StreamVideoCreated = "stream-video/started", e.StreamVideoDone = "stream-video/done", e.StreamVideoError = "stream-video/error", e.StreamVideoRejected = "stream-video/rejected", e))(N || {}), M = /* @__PURE__ */ ((e) => (e.New = "new", e.Fail = "fail", e.Connected = "connected", e.Connecting = "connecting", e.Closed = "closed", e.Completed = "completed", e.Disconnected = "disconnected", e))(M || {}), J = /* @__PURE__ */ ((e) => (e.Legacy = "legacy", e.Fluent = "fluent", e))(J || {}), _e = /* @__PURE__ */ ((e) => (e.Amazon = "amazon", e.Microsoft = "microsoft", e.Afflorithmics = "afflorithmics", e.Elevenlabs = "elevenlabs", e))(_e || {}), Me = /* @__PURE__ */ ((e) => (e.Public = "public", e.Premium = "premium", e.Private = "private", e))(Me || {});
|
|
66
|
+
const Ie = 45 * 1e3, be = "X-Playground-Chat", Y = "https://api.d-id.com", Te = "wss://notifications.d-id.com", je = "79f81a83a67430be2bc0fd61042b8faa", ie = (e) => new Promise((t) => setTimeout(t, e)), K = (e = 16) => {
|
|
73
67
|
const t = new Uint8Array(e);
|
|
74
68
|
return window.crypto.getRandomValues(t), Array.from(t, (a) => a.toString(16).padStart(2, "0")).join("").slice(0, 13);
|
|
75
|
-
},
|
|
76
|
-
function
|
|
69
|
+
}, Pe = (e) => [b.TextOnly, b.Playground, b.Maintenance].includes(e);
|
|
70
|
+
function Ae(e, t) {
|
|
77
71
|
let a;
|
|
78
72
|
return {
|
|
79
73
|
promise: new Promise((o, s) => {
|
|
@@ -82,7 +76,7 @@ function Be(e, t) {
|
|
|
82
76
|
clear: () => clearTimeout(a)
|
|
83
77
|
};
|
|
84
78
|
}
|
|
85
|
-
async function
|
|
79
|
+
async function G(e, t) {
|
|
86
80
|
const a = {
|
|
87
81
|
limit: (t == null ? void 0 : t.limit) ?? 3,
|
|
88
82
|
delayMs: (t == null ? void 0 : t.delayMs) ?? 0,
|
|
@@ -92,168 +86,168 @@ async function Q(e, t) {
|
|
|
92
86
|
onRetry: (t == null ? void 0 : t.onRetry) ?? (() => {
|
|
93
87
|
})
|
|
94
88
|
};
|
|
95
|
-
let
|
|
89
|
+
let r;
|
|
96
90
|
for (let o = 1; o <= a.limit; o++)
|
|
97
91
|
try {
|
|
98
92
|
if (!a.timeout)
|
|
99
93
|
return await e();
|
|
100
94
|
const {
|
|
101
95
|
promise: s,
|
|
102
|
-
clear:
|
|
103
|
-
} =
|
|
96
|
+
clear: n
|
|
97
|
+
} = Ae(a.timeout, a.timeoutErrorMessage), c = e().finally(n);
|
|
104
98
|
return await Promise.race([c, s]);
|
|
105
99
|
} catch (s) {
|
|
106
|
-
if (
|
|
100
|
+
if (r = s, !a.shouldRetryFn(s) || o >= a.limit)
|
|
107
101
|
throw s;
|
|
108
|
-
await
|
|
102
|
+
await ie(a.delayMs), a.onRetry(s);
|
|
109
103
|
}
|
|
110
|
-
throw
|
|
104
|
+
throw r;
|
|
111
105
|
}
|
|
112
|
-
function
|
|
106
|
+
function se() {
|
|
113
107
|
let e = window.localStorage.getItem("did_external_key_id");
|
|
114
108
|
if (!e) {
|
|
115
|
-
let t =
|
|
109
|
+
let t = K();
|
|
116
110
|
window.localStorage.setItem("did_external_key_id", t), e = t;
|
|
117
111
|
}
|
|
118
112
|
return e;
|
|
119
113
|
}
|
|
120
|
-
let
|
|
121
|
-
function
|
|
114
|
+
let Be = K();
|
|
115
|
+
function oe(e) {
|
|
122
116
|
if (e.type === "bearer")
|
|
123
117
|
return `Bearer ${e.token}`;
|
|
124
118
|
if (e.type === "basic")
|
|
125
119
|
return `Basic ${btoa(`${e.username}:${e.password}`)}`;
|
|
126
120
|
if (e.type === "key")
|
|
127
|
-
return `Client-Key ${e.clientKey}.${
|
|
121
|
+
return `Client-Key ${e.clientKey}.${se()}_${Be}`;
|
|
128
122
|
throw new Error(`Unknown auth type: ${e}`);
|
|
129
123
|
}
|
|
130
|
-
const
|
|
124
|
+
const $e = (e) => G(e, {
|
|
131
125
|
limit: 3,
|
|
132
126
|
delayMs: 1e3,
|
|
133
127
|
timeout: 0,
|
|
134
128
|
shouldRetryFn: (t) => t.status === 429
|
|
135
129
|
});
|
|
136
|
-
function
|
|
137
|
-
const
|
|
130
|
+
function ee(e, t = Y, a) {
|
|
131
|
+
const r = async (o, s) => {
|
|
138
132
|
const {
|
|
139
|
-
skipErrorHandler:
|
|
133
|
+
skipErrorHandler: n,
|
|
140
134
|
...c
|
|
141
|
-
} = s || {}, i = await
|
|
135
|
+
} = s || {}, i = await $e(() => fetch(t + (o != null && o.startsWith("/") ? o : `/${o}`), {
|
|
142
136
|
...c,
|
|
143
137
|
headers: {
|
|
144
138
|
...c.headers,
|
|
145
|
-
Authorization:
|
|
139
|
+
Authorization: oe(e),
|
|
146
140
|
"Content-Type": "application/json"
|
|
147
141
|
}
|
|
148
142
|
}));
|
|
149
143
|
if (!i.ok) {
|
|
150
144
|
let d = await i.text().catch(() => `Failed to fetch with status ${i.status}`);
|
|
151
|
-
const
|
|
152
|
-
throw a && !
|
|
145
|
+
const u = new Error(d);
|
|
146
|
+
throw a && !n && a(u, {
|
|
153
147
|
url: o,
|
|
154
148
|
options: c,
|
|
155
149
|
headers: i.headers
|
|
156
|
-
}),
|
|
150
|
+
}), u;
|
|
157
151
|
}
|
|
158
152
|
return i.json();
|
|
159
153
|
};
|
|
160
154
|
return {
|
|
161
155
|
get(o, s) {
|
|
162
|
-
return
|
|
156
|
+
return r(o, {
|
|
163
157
|
...s,
|
|
164
158
|
method: "GET"
|
|
165
159
|
});
|
|
166
160
|
},
|
|
167
|
-
post(o, s,
|
|
168
|
-
return
|
|
169
|
-
...
|
|
161
|
+
post(o, s, n) {
|
|
162
|
+
return r(o, {
|
|
163
|
+
...n,
|
|
170
164
|
body: JSON.stringify(s),
|
|
171
165
|
method: "POST"
|
|
172
166
|
});
|
|
173
167
|
},
|
|
174
|
-
delete(o, s,
|
|
175
|
-
return
|
|
176
|
-
...
|
|
168
|
+
delete(o, s, n) {
|
|
169
|
+
return r(o, {
|
|
170
|
+
...n,
|
|
177
171
|
body: JSON.stringify(s),
|
|
178
172
|
method: "DELETE"
|
|
179
173
|
});
|
|
180
174
|
},
|
|
181
|
-
patch(o, s,
|
|
182
|
-
return
|
|
183
|
-
...
|
|
175
|
+
patch(o, s, n) {
|
|
176
|
+
return r(o, {
|
|
177
|
+
...n,
|
|
184
178
|
body: JSON.stringify(s),
|
|
185
179
|
method: "PATCH"
|
|
186
180
|
});
|
|
187
181
|
}
|
|
188
182
|
};
|
|
189
183
|
}
|
|
190
|
-
function
|
|
191
|
-
const
|
|
184
|
+
function ce(e, t = Y, a) {
|
|
185
|
+
const r = ee(e, `${t}/agents`, a);
|
|
192
186
|
return {
|
|
193
187
|
create(o, s) {
|
|
194
|
-
return
|
|
188
|
+
return r.post("/", o, s);
|
|
195
189
|
},
|
|
196
190
|
getAgents(o, s) {
|
|
197
|
-
return
|
|
191
|
+
return r.get(`/${o ? `?tag=${o}` : ""}`, s).then((n) => n ?? []);
|
|
198
192
|
},
|
|
199
193
|
getById(o, s) {
|
|
200
|
-
return
|
|
194
|
+
return r.get(`/${o}`, s);
|
|
201
195
|
},
|
|
202
196
|
delete(o, s) {
|
|
203
|
-
return
|
|
197
|
+
return r.delete(`/${o}`, void 0, s);
|
|
204
198
|
},
|
|
205
|
-
update(o, s,
|
|
206
|
-
return
|
|
199
|
+
update(o, s, n) {
|
|
200
|
+
return r.patch(`/${o}`, s, n);
|
|
207
201
|
},
|
|
208
|
-
newChat(o, s,
|
|
209
|
-
return
|
|
202
|
+
newChat(o, s, n) {
|
|
203
|
+
return r.post(`/${o}/chat`, s, n);
|
|
210
204
|
},
|
|
211
|
-
chat(o, s,
|
|
212
|
-
return
|
|
205
|
+
chat(o, s, n, c) {
|
|
206
|
+
return r.post(`/${o}/chat/${s}`, n, c);
|
|
213
207
|
},
|
|
214
|
-
createRating(o, s,
|
|
215
|
-
return
|
|
208
|
+
createRating(o, s, n, c) {
|
|
209
|
+
return r.post(`/${o}/chat/${s}/ratings`, n, c);
|
|
216
210
|
},
|
|
217
|
-
updateRating(o, s,
|
|
218
|
-
return
|
|
211
|
+
updateRating(o, s, n, c, i) {
|
|
212
|
+
return r.patch(`/${o}/chat/${s}/ratings/${n}`, c, i);
|
|
219
213
|
},
|
|
220
|
-
deleteRating(o, s,
|
|
221
|
-
return
|
|
214
|
+
deleteRating(o, s, n, c) {
|
|
215
|
+
return r.delete(`/${o}/chat/${s}/ratings/${n}`, c);
|
|
222
216
|
},
|
|
223
217
|
getSTTToken(o, s) {
|
|
224
|
-
return
|
|
218
|
+
return r.get(`/${o}/stt-token`, s);
|
|
225
219
|
}
|
|
226
220
|
};
|
|
227
221
|
}
|
|
228
|
-
const
|
|
229
|
-
function
|
|
230
|
-
var o, s,
|
|
222
|
+
const de = (e) => e.type === "clip" && e.presenter_id.startsWith("v2_") ? "clip_v2" : e.type;
|
|
223
|
+
function Le(e) {
|
|
224
|
+
var o, s, n, c;
|
|
231
225
|
const t = () => /Mobi|Android/i.test(navigator.userAgent) ? "Mobile" : "Desktop", a = () => {
|
|
232
226
|
const i = navigator.platform;
|
|
233
227
|
return i.toLowerCase().includes("win") ? "Windows" : i.toLowerCase().includes("mac") ? "Mac OS X" : i.toLowerCase().includes("linux") ? "Linux" : "Unknown";
|
|
234
|
-
},
|
|
228
|
+
}, r = e.presenter;
|
|
235
229
|
return {
|
|
236
230
|
$os: `${a()}`,
|
|
237
231
|
isMobile: `${t() == "Mobile"}`,
|
|
238
232
|
browser: navigator.userAgent,
|
|
239
233
|
origin: window.location.origin,
|
|
240
|
-
agentType:
|
|
234
|
+
agentType: de(r),
|
|
241
235
|
agentVoice: {
|
|
242
236
|
voiceId: (s = (o = e.presenter) == null ? void 0 : o.voice) == null ? void 0 : s.voice_id,
|
|
243
|
-
provider: (c = (
|
|
237
|
+
provider: (c = (n = e.presenter) == null ? void 0 : n.voice) == null ? void 0 : c.type
|
|
244
238
|
}
|
|
245
239
|
};
|
|
246
240
|
}
|
|
247
|
-
const
|
|
248
|
-
function
|
|
249
|
-
var i, d,
|
|
241
|
+
const ze = (e) => e.reduce((t, a) => t + a, 0), te = (e) => ze(e) / e.length;
|
|
242
|
+
function xe(e, t, a) {
|
|
243
|
+
var i, d, u;
|
|
250
244
|
const {
|
|
251
|
-
event:
|
|
245
|
+
event: r,
|
|
252
246
|
...o
|
|
253
247
|
} = e, {
|
|
254
248
|
template: s
|
|
255
249
|
} = (t == null ? void 0 : t.llm) || {}, {
|
|
256
|
-
language:
|
|
250
|
+
language: n
|
|
257
251
|
} = ((i = t == null ? void 0 : t.presenter) == null ? void 0 : i.voice) || {};
|
|
258
252
|
return {
|
|
259
253
|
...o,
|
|
@@ -265,68 +259,63 @@ function Fe(e, t, a) {
|
|
|
265
259
|
...o.script,
|
|
266
260
|
provider: {
|
|
267
261
|
...(d = o == null ? void 0 : o.script) == null ? void 0 : d.provider,
|
|
268
|
-
language:
|
|
262
|
+
language: n
|
|
269
263
|
}
|
|
270
264
|
},
|
|
271
|
-
stitch: (t == null ? void 0 : t.presenter.type) === "talk" ? (
|
|
265
|
+
stitch: (t == null ? void 0 : t.presenter.type) === "talk" ? (u = t == null ? void 0 : t.presenter) == null ? void 0 : u.stitch : void 0,
|
|
272
266
|
...a
|
|
273
267
|
};
|
|
274
268
|
}
|
|
275
|
-
let
|
|
276
|
-
const
|
|
277
|
-
function
|
|
278
|
-
var s,
|
|
279
|
-
const t = window != null && window.hasOwnProperty("DID_AGENTS_API") ? "agents-ui" : "agents-sdk", a = e.agent.presenter,
|
|
269
|
+
let Z = {};
|
|
270
|
+
const Fe = "https://api-js.mixpanel.com/track/?verbose=1&ip=1";
|
|
271
|
+
function Ne(e) {
|
|
272
|
+
var s, n, c, i, d, u;
|
|
273
|
+
const t = window != null && window.hasOwnProperty("DID_AGENTS_API") ? "agents-ui" : "agents-sdk", a = e.agent.presenter, r = (s = e.agent.llm) == null ? void 0 : s.prompt_customization, o = {
|
|
280
274
|
token: e.token || "testKey",
|
|
281
|
-
distinct_id: e.distinctId ||
|
|
275
|
+
distinct_id: e.distinctId || se(),
|
|
282
276
|
agentId: e.agent.id,
|
|
283
|
-
agentType:
|
|
277
|
+
agentType: de(a),
|
|
284
278
|
owner_id: e.agent.owner_id ?? "",
|
|
285
|
-
promptVersion: (
|
|
279
|
+
promptVersion: (n = e.agent.llm) == null ? void 0 : n.prompt_version,
|
|
286
280
|
behavior: {
|
|
287
|
-
role:
|
|
288
|
-
personality:
|
|
281
|
+
role: r == null ? void 0 : r.role,
|
|
282
|
+
personality: r == null ? void 0 : r.personality,
|
|
289
283
|
instructions: (c = e.agent.llm) == null ? void 0 : c.instructions
|
|
290
284
|
},
|
|
291
285
|
temperature: (i = e.agent.llm) == null ? void 0 : i.temperature,
|
|
292
|
-
knowledgeSource:
|
|
293
|
-
starterQuestionsCount: (
|
|
294
|
-
topicsToAvoid:
|
|
295
|
-
maxResponseLength:
|
|
286
|
+
knowledgeSource: r == null ? void 0 : r.knowledge_source,
|
|
287
|
+
starterQuestionsCount: (u = (d = e.agent.knowledge) == null ? void 0 : d.starter_message) == null ? void 0 : u.length,
|
|
288
|
+
topicsToAvoid: r == null ? void 0 : r.topics_to_avoid,
|
|
289
|
+
maxResponseLength: r == null ? void 0 : r.max_response_length
|
|
296
290
|
};
|
|
297
291
|
return {
|
|
298
292
|
...o,
|
|
299
293
|
additionalProperties: {},
|
|
300
294
|
isEnabled: e.isEnabled ?? !0,
|
|
301
|
-
getRandom:
|
|
302
|
-
enrich(
|
|
303
|
-
const D = {};
|
|
304
|
-
if (m && typeof m != "object")
|
|
305
|
-
throw new Error("properties must be a flat json object");
|
|
306
|
-
for (let w in m)
|
|
307
|
-
(typeof m[w] == "string" || typeof m[w] == "number") && (D[w] = m[w]);
|
|
295
|
+
getRandom: K,
|
|
296
|
+
enrich(h) {
|
|
308
297
|
this.additionalProperties = {
|
|
309
298
|
...this.additionalProperties,
|
|
310
|
-
...
|
|
299
|
+
...h
|
|
311
300
|
};
|
|
312
301
|
},
|
|
313
|
-
async track(
|
|
302
|
+
async track(h, _) {
|
|
314
303
|
if (!this.isEnabled)
|
|
315
304
|
return Promise.resolve();
|
|
316
305
|
const {
|
|
317
|
-
audioPath:
|
|
318
|
-
...
|
|
319
|
-
} =
|
|
306
|
+
audioPath: k,
|
|
307
|
+
...D
|
|
308
|
+
} = _ || {}, R = {
|
|
320
309
|
method: "POST",
|
|
321
310
|
headers: {
|
|
322
311
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
323
312
|
},
|
|
324
313
|
body: new URLSearchParams({
|
|
325
314
|
data: JSON.stringify([{
|
|
326
|
-
event:
|
|
315
|
+
event: h,
|
|
327
316
|
properties: {
|
|
328
317
|
...this.additionalProperties,
|
|
329
|
-
...
|
|
318
|
+
...D,
|
|
330
319
|
...o,
|
|
331
320
|
source: t,
|
|
332
321
|
time: Date.now(),
|
|
@@ -340,32 +329,32 @@ function Je(e) {
|
|
|
340
329
|
})
|
|
341
330
|
};
|
|
342
331
|
try {
|
|
343
|
-
return await fetch(
|
|
332
|
+
return await fetch(Fe, R).then((S) => S.json());
|
|
344
333
|
} catch (S) {
|
|
345
334
|
return console.error(S);
|
|
346
335
|
}
|
|
347
336
|
},
|
|
348
|
-
linkTrack(
|
|
349
|
-
|
|
337
|
+
linkTrack(h, _, k, D) {
|
|
338
|
+
Z[h] || (Z[h] = {
|
|
350
339
|
events: {},
|
|
351
340
|
resolvedDependencies: []
|
|
352
|
-
}),
|
|
353
|
-
const R =
|
|
354
|
-
if (R.events[
|
|
355
|
-
props:
|
|
356
|
-
}, R.resolvedDependencies.push(
|
|
357
|
-
const
|
|
341
|
+
}), D.includes(k) || D.push(k);
|
|
342
|
+
const R = Z[h];
|
|
343
|
+
if (R.events[k] = {
|
|
344
|
+
props: _
|
|
345
|
+
}, R.resolvedDependencies.push(k), D.every((B) => R.resolvedDependencies.includes(B))) {
|
|
346
|
+
const B = D.reduce((l, m) => R.events[m] ? {
|
|
358
347
|
...l,
|
|
359
|
-
...R.events[
|
|
348
|
+
...R.events[m].props
|
|
360
349
|
} : l, {});
|
|
361
|
-
this.track(
|
|
350
|
+
this.track(h, B), R.resolvedDependencies = R.resolvedDependencies.filter((l) => !D.includes(l)), D.forEach((l) => {
|
|
362
351
|
delete R.events[l];
|
|
363
352
|
});
|
|
364
353
|
}
|
|
365
354
|
}
|
|
366
355
|
};
|
|
367
356
|
}
|
|
368
|
-
function
|
|
357
|
+
function Je() {
|
|
369
358
|
let e = 0;
|
|
370
359
|
return {
|
|
371
360
|
reset: () => e = 0,
|
|
@@ -373,30 +362,30 @@ function We() {
|
|
|
373
362
|
get: (t = !1) => t ? Date.now() - e : e
|
|
374
363
|
};
|
|
375
364
|
}
|
|
376
|
-
const
|
|
377
|
-
function
|
|
378
|
-
return e ===
|
|
365
|
+
const F = Je();
|
|
366
|
+
function le(e) {
|
|
367
|
+
return e === b.Playground ? {
|
|
379
368
|
headers: {
|
|
380
369
|
[be]: "true"
|
|
381
370
|
}
|
|
382
371
|
} : {};
|
|
383
372
|
}
|
|
384
|
-
async function
|
|
373
|
+
async function ue(e, t, a, r, o = !1, s) {
|
|
385
374
|
try {
|
|
386
|
-
return !s &&
|
|
375
|
+
return !s && r !== b.DirectPlayback && (s = await t.newChat(e.id, {
|
|
387
376
|
persist: o
|
|
388
|
-
},
|
|
377
|
+
}, le(r)), a.track("agent-chat", {
|
|
389
378
|
event: "created",
|
|
390
379
|
chat_id: s.id,
|
|
391
380
|
agent_id: e.id,
|
|
392
|
-
mode:
|
|
381
|
+
mode: r
|
|
393
382
|
})), {
|
|
394
383
|
chat: s,
|
|
395
|
-
chatMode: (s == null ? void 0 : s.chat_mode) ??
|
|
384
|
+
chatMode: (s == null ? void 0 : s.chat_mode) ?? r
|
|
396
385
|
};
|
|
397
|
-
} catch (
|
|
386
|
+
} catch (n) {
|
|
398
387
|
try {
|
|
399
|
-
const c = JSON.parse(
|
|
388
|
+
const c = JSON.parse(n.message);
|
|
400
389
|
if ((c == null ? void 0 : c.kind) === "InsufficientCreditsError")
|
|
401
390
|
throw new Error("InsufficientCreditsError");
|
|
402
391
|
} catch (c) {
|
|
@@ -405,25 +394,25 @@ async function fe(e, t, a, n, o = !1, s) {
|
|
|
405
394
|
throw new Error("Cannot create new chat");
|
|
406
395
|
}
|
|
407
396
|
}
|
|
408
|
-
function
|
|
397
|
+
function We(e) {
|
|
409
398
|
return e && e.length > 0 ? e : [];
|
|
410
399
|
}
|
|
411
|
-
function
|
|
400
|
+
function Ue(e) {
|
|
412
401
|
return new Promise((t, a) => {
|
|
413
402
|
const {
|
|
414
|
-
callbacks:
|
|
403
|
+
callbacks: r,
|
|
415
404
|
host: o,
|
|
416
405
|
auth: s
|
|
417
406
|
} = e, {
|
|
418
|
-
onMessage:
|
|
407
|
+
onMessage: n = null,
|
|
419
408
|
onOpen: c = null,
|
|
420
409
|
onClose: i = null,
|
|
421
410
|
onError: d = null
|
|
422
|
-
} =
|
|
423
|
-
|
|
424
|
-
console.error(
|
|
425
|
-
},
|
|
426
|
-
c == null || c(
|
|
411
|
+
} = r || {}, u = new WebSocket(`${o}?authorization=${oe(s)}`);
|
|
412
|
+
u.onmessage = n, u.onclose = i, u.onerror = (h) => {
|
|
413
|
+
console.error(h), d == null || d("Websocket failed to connect", h), a(h);
|
|
414
|
+
}, u.onopen = (h) => {
|
|
415
|
+
c == null || c(h), t(u);
|
|
427
416
|
};
|
|
428
417
|
});
|
|
429
418
|
}
|
|
@@ -432,38 +421,38 @@ async function Ke(e) {
|
|
|
432
421
|
retries: t = 1
|
|
433
422
|
} = e;
|
|
434
423
|
let a = null;
|
|
435
|
-
for (let
|
|
424
|
+
for (let r = 0; (a == null ? void 0 : a.readyState) !== WebSocket.OPEN; r++)
|
|
436
425
|
try {
|
|
437
|
-
a = await
|
|
426
|
+
a = await Ue(e);
|
|
438
427
|
} catch (o) {
|
|
439
|
-
if (
|
|
428
|
+
if (r === t)
|
|
440
429
|
throw o;
|
|
441
|
-
await
|
|
430
|
+
await ie(r * 500);
|
|
442
431
|
}
|
|
443
432
|
return a;
|
|
444
433
|
}
|
|
445
|
-
async function
|
|
446
|
-
const
|
|
434
|
+
async function He(e, t, a) {
|
|
435
|
+
const r = a != null && a.onMessage ? [a.onMessage] : [], o = await Ke({
|
|
447
436
|
auth: e,
|
|
448
437
|
host: t,
|
|
449
438
|
callbacks: {
|
|
450
439
|
onError: (s) => {
|
|
451
|
-
var
|
|
452
|
-
return (
|
|
440
|
+
var n;
|
|
441
|
+
return (n = a.onError) == null ? void 0 : n.call(a, new pe(s));
|
|
453
442
|
},
|
|
454
443
|
onMessage(s) {
|
|
455
|
-
const
|
|
456
|
-
|
|
444
|
+
const n = JSON.parse(s.data);
|
|
445
|
+
r.forEach((c) => c(n.event, n));
|
|
457
446
|
}
|
|
458
447
|
}
|
|
459
448
|
});
|
|
460
449
|
return {
|
|
461
450
|
socket: o,
|
|
462
451
|
disconnect: () => o.close(),
|
|
463
|
-
subscribeToEvents: (s) =>
|
|
452
|
+
subscribeToEvents: (s) => r.push(s)
|
|
464
453
|
};
|
|
465
454
|
}
|
|
466
|
-
function
|
|
455
|
+
function qe(e) {
|
|
467
456
|
if (e.answer !== void 0)
|
|
468
457
|
return e.answer;
|
|
469
458
|
let t = 0, a = "";
|
|
@@ -471,54 +460,54 @@ function Ve(e) {
|
|
|
471
460
|
a += e[t++];
|
|
472
461
|
return a;
|
|
473
462
|
}
|
|
474
|
-
function
|
|
475
|
-
const s =
|
|
476
|
-
if (!(e ===
|
|
463
|
+
function Ve(e, t, a, r, o) {
|
|
464
|
+
const s = r.messages[r.messages.length - 1];
|
|
465
|
+
if (!(e === U.Partial || e === U.Answer) || (s == null ? void 0 : s.role) !== "assistant")
|
|
477
466
|
return;
|
|
478
467
|
const {
|
|
479
|
-
content:
|
|
468
|
+
content: n,
|
|
480
469
|
sequence: c
|
|
481
470
|
} = t;
|
|
482
|
-
e ===
|
|
483
|
-
const i =
|
|
484
|
-
(s.content !== i || e ===
|
|
471
|
+
e === U.Partial ? a[c] = n : a.answer = n;
|
|
472
|
+
const i = qe(a);
|
|
473
|
+
(s.content !== i || e === U.Answer) && (s.content = i, o == null || o([...r.messages], e));
|
|
485
474
|
}
|
|
486
|
-
function
|
|
475
|
+
function Xe(e, t, a, r, o) {
|
|
487
476
|
let s = {};
|
|
488
477
|
return {
|
|
489
478
|
clearQueue: () => s = {},
|
|
490
|
-
onMessage: (
|
|
479
|
+
onMessage: (n, c) => {
|
|
491
480
|
var i, d;
|
|
492
481
|
if ("content" in c)
|
|
493
|
-
|
|
482
|
+
Ve(n, c, s, t, a.callbacks.onNewMessage), n === U.Answer && e.track("agent-message-received", {
|
|
494
483
|
messages: t.messages.length,
|
|
495
484
|
mode: t.chatMode
|
|
496
485
|
});
|
|
497
486
|
else {
|
|
498
|
-
const
|
|
487
|
+
const u = N, h = [u.StreamVideoDone, u.StreamVideoError, u.StreamVideoRejected], _ = [u.StreamFailed, u.StreamVideoError, u.StreamVideoRejected], k = xe(c, r, {
|
|
499
488
|
mode: t.chatMode
|
|
500
489
|
});
|
|
501
|
-
if (
|
|
502
|
-
e.linkTrack("agent-video",
|
|
503
|
-
else if (
|
|
504
|
-
const
|
|
505
|
-
|
|
506
|
-
...
|
|
507
|
-
event:
|
|
490
|
+
if (n = n, n === u.StreamVideoCreated)
|
|
491
|
+
e.linkTrack("agent-video", k, u.StreamVideoCreated, ["start"]);
|
|
492
|
+
else if (h.includes(n)) {
|
|
493
|
+
const D = n.split("/")[1];
|
|
494
|
+
_.includes(n) ? e.track("agent-video", {
|
|
495
|
+
...k,
|
|
496
|
+
event: D
|
|
508
497
|
}) : e.linkTrack("agent-video", {
|
|
509
|
-
...
|
|
510
|
-
event:
|
|
511
|
-
},
|
|
498
|
+
...k,
|
|
499
|
+
event: D
|
|
500
|
+
}, n, ["done"]);
|
|
512
501
|
}
|
|
513
|
-
|
|
502
|
+
_.includes(n) && ((d = (i = a.callbacks).onError) == null || d.call(i, new Error(`Stream failed with event ${n}`), {
|
|
514
503
|
data: c
|
|
515
|
-
})), c.event ===
|
|
504
|
+
})), c.event === u.StreamDone && o();
|
|
516
505
|
}
|
|
517
506
|
}
|
|
518
507
|
};
|
|
519
508
|
}
|
|
520
|
-
function
|
|
521
|
-
const o =
|
|
509
|
+
function Ye(e, t, a, r) {
|
|
510
|
+
const o = ee(e, `${t}/agents/${a}`, r);
|
|
522
511
|
return {
|
|
523
512
|
createStream(s) {
|
|
524
513
|
return o.post("/streams", {
|
|
@@ -529,35 +518,35 @@ function Qe(e, t, a, n) {
|
|
|
529
518
|
fluent: s.fluent
|
|
530
519
|
});
|
|
531
520
|
},
|
|
532
|
-
startConnection(s,
|
|
521
|
+
startConnection(s, n, c) {
|
|
533
522
|
return o.post(`/streams/${s}/sdp`, {
|
|
534
523
|
session_id: c,
|
|
535
|
-
answer:
|
|
524
|
+
answer: n
|
|
536
525
|
});
|
|
537
526
|
},
|
|
538
|
-
addIceCandidate(s,
|
|
527
|
+
addIceCandidate(s, n, c) {
|
|
539
528
|
return o.post(`/streams/${s}/ice`, {
|
|
540
529
|
session_id: c,
|
|
541
|
-
...
|
|
530
|
+
...n
|
|
542
531
|
});
|
|
543
532
|
},
|
|
544
|
-
sendStreamRequest(s,
|
|
533
|
+
sendStreamRequest(s, n, c) {
|
|
545
534
|
return o.post(`/streams/${s}`, {
|
|
546
|
-
session_id:
|
|
535
|
+
session_id: n,
|
|
547
536
|
...c
|
|
548
537
|
});
|
|
549
538
|
},
|
|
550
|
-
close(s,
|
|
539
|
+
close(s, n) {
|
|
551
540
|
return o.delete(`/streams/${s}`, {
|
|
552
|
-
session_id:
|
|
541
|
+
session_id: n
|
|
553
542
|
});
|
|
554
543
|
}
|
|
555
544
|
};
|
|
556
545
|
}
|
|
557
|
-
function
|
|
558
|
-
const o =
|
|
546
|
+
function Qe(e, t, a, r) {
|
|
547
|
+
const o = ee(e, `${t}/agents/${a}`, r);
|
|
559
548
|
return {
|
|
560
|
-
createStream(s,
|
|
549
|
+
createStream(s, n) {
|
|
561
550
|
return o.post("/streams", {
|
|
562
551
|
driver_url: s.driver_url,
|
|
563
552
|
face: s.face,
|
|
@@ -567,39 +556,39 @@ function Ze(e, t, a, n) {
|
|
|
567
556
|
stream_warmup: s.stream_warmup,
|
|
568
557
|
session_timeout: s.session_timeout,
|
|
569
558
|
fluent: s.fluent
|
|
570
|
-
},
|
|
559
|
+
}, n);
|
|
571
560
|
},
|
|
572
|
-
startConnection(s,
|
|
561
|
+
startConnection(s, n, c, i) {
|
|
573
562
|
return o.post(`/streams/${s}/sdp`, {
|
|
574
563
|
session_id: c,
|
|
575
|
-
answer:
|
|
564
|
+
answer: n
|
|
576
565
|
}, i);
|
|
577
566
|
},
|
|
578
|
-
addIceCandidate(s,
|
|
567
|
+
addIceCandidate(s, n, c, i) {
|
|
579
568
|
return o.post(`/streams/${s}/ice`, {
|
|
580
569
|
session_id: c,
|
|
581
|
-
...
|
|
570
|
+
...n
|
|
582
571
|
}, i);
|
|
583
572
|
},
|
|
584
|
-
sendStreamRequest(s,
|
|
573
|
+
sendStreamRequest(s, n, c, i) {
|
|
585
574
|
return o.post(`/streams/${s}`, {
|
|
586
|
-
session_id:
|
|
575
|
+
session_id: n,
|
|
587
576
|
...c
|
|
588
577
|
}, i);
|
|
589
578
|
},
|
|
590
|
-
close(s,
|
|
579
|
+
close(s, n, c) {
|
|
591
580
|
return o.delete(`/streams/${s}`, {
|
|
592
|
-
session_id:
|
|
581
|
+
session_id: n
|
|
593
582
|
}, c);
|
|
594
583
|
}
|
|
595
584
|
};
|
|
596
585
|
}
|
|
597
|
-
function
|
|
598
|
-
const
|
|
586
|
+
function Ze(e, t, a) {
|
|
587
|
+
const r = (t.timestamp - e.timestamp) / 1e3;
|
|
599
588
|
return {
|
|
600
|
-
duration:
|
|
589
|
+
duration: r,
|
|
601
590
|
bytesReceived: t.bytesReceived - e.bytesReceived,
|
|
602
|
-
bitrate: Math.round((t.bytesReceived - e.bytesReceived) * 8 /
|
|
591
|
+
bitrate: Math.round((t.bytesReceived - e.bytesReceived) * 8 / r),
|
|
603
592
|
packetsReceived: t.packetsReceived - e.packetsReceived,
|
|
604
593
|
packetsLost: t.packetsLost - e.packetsLost,
|
|
605
594
|
framesDropped: t.framesDropped - e.framesDropped,
|
|
@@ -607,52 +596,52 @@ function Ge(e, t, a) {
|
|
|
607
596
|
jitter: t.jitter,
|
|
608
597
|
avgJitterDelayInInterval: (t.jitterBufferDelay - e.jitterBufferDelay) / (t.jitterBufferEmittedCount - e.jitterBufferEmittedCount),
|
|
609
598
|
jitterBufferEmittedCount: t.jitterBufferEmittedCount - e.jitterBufferEmittedCount,
|
|
610
|
-
jitterBufferDelay: (t.jitterBufferDelay - e.jitterBufferDelay) /
|
|
599
|
+
jitterBufferDelay: (t.jitterBufferDelay - e.jitterBufferDelay) / r,
|
|
611
600
|
framesPerSecond: t.framesPerSecond,
|
|
612
601
|
freezeCount: t.freezeCount - e.freezeCount,
|
|
613
602
|
freezeDuration: t.freezeDuration - e.freezeDuration,
|
|
614
603
|
lowFpsCount: a
|
|
615
604
|
};
|
|
616
605
|
}
|
|
617
|
-
function
|
|
606
|
+
function Ge(e) {
|
|
618
607
|
return e.filter((t) => t.freezeCount > 0 || t.framesPerSecond < 21 || t.framesDropped > 0 || t.packetsLost > 0).map((t) => {
|
|
619
608
|
const {
|
|
620
609
|
timestamp: a,
|
|
621
|
-
...
|
|
610
|
+
...r
|
|
622
611
|
} = t, o = [];
|
|
623
612
|
return t.freezeCount > 0 && o.push("freeze"), t.framesPerSecond < 21 && o.push("low fps"), t.framesDropped > 0 && o.push("frames dropped"), t.packetsLost > 0 && o.push("packet loss"), {
|
|
624
|
-
...
|
|
613
|
+
...r,
|
|
625
614
|
causes: o
|
|
626
615
|
};
|
|
627
616
|
});
|
|
628
617
|
}
|
|
629
|
-
function
|
|
618
|
+
function Oe(e) {
|
|
630
619
|
let t = "", a = 0;
|
|
631
|
-
for (const
|
|
632
|
-
if (
|
|
620
|
+
for (const r of e.values())
|
|
621
|
+
if (r && r.type === "codec" && r.mimeType.startsWith("video") && (t = r.mimeType.split("/")[1]), r && r.type === "candidate-pair" && (a = r.currentRoundTripTime), r && r.type === "inbound-rtp" && r.kind === "video")
|
|
633
622
|
return {
|
|
634
623
|
codec: t,
|
|
635
624
|
rtt: a,
|
|
636
|
-
timestamp:
|
|
637
|
-
bytesReceived:
|
|
638
|
-
packetsReceived:
|
|
639
|
-
packetsLost:
|
|
640
|
-
framesDropped:
|
|
641
|
-
framesDecoded:
|
|
642
|
-
jitter:
|
|
643
|
-
jitterBufferDelay:
|
|
644
|
-
jitterBufferEmittedCount:
|
|
645
|
-
avgJitterDelayInInterval:
|
|
646
|
-
frameWidth:
|
|
647
|
-
frameHeight:
|
|
648
|
-
framesPerSecond:
|
|
649
|
-
freezeCount:
|
|
650
|
-
freezeDuration:
|
|
625
|
+
timestamp: r.timestamp,
|
|
626
|
+
bytesReceived: r.bytesReceived,
|
|
627
|
+
packetsReceived: r.packetsReceived,
|
|
628
|
+
packetsLost: r.packetsLost,
|
|
629
|
+
framesDropped: r.framesDropped,
|
|
630
|
+
framesDecoded: r.framesDecoded,
|
|
631
|
+
jitter: r.jitter,
|
|
632
|
+
jitterBufferDelay: r.jitterBufferDelay,
|
|
633
|
+
jitterBufferEmittedCount: r.jitterBufferEmittedCount,
|
|
634
|
+
avgJitterDelayInInterval: r.jitterBufferDelay / r.jitterBufferEmittedCount,
|
|
635
|
+
frameWidth: r.frameWidth,
|
|
636
|
+
frameHeight: r.frameHeight,
|
|
637
|
+
framesPerSecond: r.framesPerSecond,
|
|
638
|
+
freezeCount: r.freezeCount,
|
|
639
|
+
freezeDuration: r.totalFreezesDuration
|
|
651
640
|
};
|
|
652
641
|
return {};
|
|
653
642
|
}
|
|
654
|
-
function
|
|
655
|
-
const
|
|
643
|
+
function et(e, t, a) {
|
|
644
|
+
const r = e.map((i, d) => d === 0 ? a ? {
|
|
656
645
|
timestamp: i.timestamp,
|
|
657
646
|
duration: 0,
|
|
658
647
|
rtt: i.rtt,
|
|
@@ -703,244 +692,288 @@ function tt(e, t, a) {
|
|
|
703
692
|
framesPerSecond: i.framesPerSecond,
|
|
704
693
|
freezeCount: i.freezeCount - e[d - 1].freezeCount,
|
|
705
694
|
freezeDuration: i.freezeDuration - e[d - 1].freezeDuration
|
|
706
|
-
}), o =
|
|
695
|
+
}), o = Ge(r), s = o.reduce((i, d) => i + (d.causes.includes("low fps") ? 1 : 0), 0), n = r.filter((i) => !!i.avgJitterDelayInInterval).map((i) => i.avgJitterDelayInInterval), c = r.filter((i) => !!i.rtt).map((i) => i.rtt);
|
|
707
696
|
return {
|
|
708
697
|
webRTCStats: {
|
|
709
698
|
anomalies: o,
|
|
710
699
|
minRtt: Math.min(...c),
|
|
711
|
-
avgRtt:
|
|
700
|
+
avgRtt: te(c),
|
|
712
701
|
maxRtt: Math.max(...c),
|
|
713
|
-
aggregateReport:
|
|
714
|
-
minJitterDelayInInterval: Math.min(...
|
|
715
|
-
maxJitterDelayInInterval: Math.max(...
|
|
716
|
-
avgJitterDelayInInterval:
|
|
702
|
+
aggregateReport: Ze(e[0], e[e.length - 1], s),
|
|
703
|
+
minJitterDelayInInterval: Math.min(...n),
|
|
704
|
+
maxJitterDelayInInterval: Math.max(...n),
|
|
705
|
+
avgJitterDelayInInterval: te(n)
|
|
717
706
|
},
|
|
718
707
|
codec: e[0].codec,
|
|
719
708
|
resolution: `${e[0].frameWidth}x${e[0].frameHeight}`
|
|
720
709
|
};
|
|
721
710
|
}
|
|
722
|
-
const
|
|
723
|
-
function
|
|
724
|
-
let e = 0, t, a,
|
|
711
|
+
const O = 100, tt = Math.max(Math.ceil(400 / O), 1), rt = 0.25, nt = 0.28;
|
|
712
|
+
function at() {
|
|
713
|
+
let e = 0, t, a, r = 0;
|
|
725
714
|
return (o) => {
|
|
726
715
|
for (const s of o.values())
|
|
727
716
|
if (s && s.type === "inbound-rtp" && s.kind === "video") {
|
|
728
|
-
const
|
|
717
|
+
const n = s.jitterBufferDelay, c = s.jitterBufferEmittedCount;
|
|
729
718
|
if (a && c > a) {
|
|
730
|
-
const
|
|
731
|
-
|
|
719
|
+
const u = n - t, h = c - a;
|
|
720
|
+
r = u / h;
|
|
732
721
|
}
|
|
733
|
-
t =
|
|
722
|
+
t = n, a = c;
|
|
734
723
|
const i = s.framesDecoded, d = i - e > 0;
|
|
735
724
|
return e = i, {
|
|
736
725
|
isReceiving: d,
|
|
737
|
-
avgJitterDelayInInterval:
|
|
726
|
+
avgJitterDelayInInterval: r,
|
|
738
727
|
freezeCount: s.freezeCount
|
|
739
728
|
};
|
|
740
729
|
}
|
|
741
730
|
return {
|
|
742
731
|
isReceiving: !1,
|
|
743
|
-
avgJitterDelayInInterval:
|
|
732
|
+
avgJitterDelayInInterval: r
|
|
744
733
|
};
|
|
745
734
|
};
|
|
746
735
|
}
|
|
747
|
-
function
|
|
748
|
-
let
|
|
749
|
-
const
|
|
736
|
+
function it(e, t, a, r, o, s = !1) {
|
|
737
|
+
let n = [], c, i = 0, d = !1, u = V.Unknown, h = V.Unknown, _ = 0, k = 0;
|
|
738
|
+
const D = at();
|
|
750
739
|
return setInterval(async () => {
|
|
751
740
|
const R = await e.getStats(), {
|
|
752
741
|
isReceiving: S,
|
|
753
|
-
avgJitterDelayInInterval:
|
|
742
|
+
avgJitterDelayInInterval: B,
|
|
754
743
|
freezeCount: l
|
|
755
|
-
} =
|
|
744
|
+
} = D(R), m = Oe(R);
|
|
756
745
|
if (S)
|
|
757
|
-
i = 0,
|
|
758
|
-
else if (d && (i++, i >=
|
|
759
|
-
const
|
|
760
|
-
|
|
746
|
+
i = 0, _ = l - k, h = B < rt ? V.Strong : B > nt && _ > 1 ? V.Weak : u, h !== u && (o == null || o(h), u = h, k += _, _ = 0), d || (r == null || r(p.Start), c = n[n.length - 1], n = [], d = !0), n.push(m);
|
|
747
|
+
else if (d && (i++, i >= tt)) {
|
|
748
|
+
const y = et(n, O, c);
|
|
749
|
+
r == null || r(p.Stop, y), t() || a(), k = l, d = !1;
|
|
761
750
|
}
|
|
762
|
-
},
|
|
751
|
+
}, O);
|
|
763
752
|
}
|
|
764
|
-
let
|
|
765
|
-
const
|
|
766
|
-
function
|
|
753
|
+
let fe = !1;
|
|
754
|
+
const x = (e, t) => fe && console.log(e, t), st = (window.RTCPeerConnection || window.webkitRTCPeerConnection || window.mozRTCPeerConnection).bind(window);
|
|
755
|
+
function re(e) {
|
|
767
756
|
switch (e) {
|
|
768
757
|
case "connected":
|
|
769
|
-
return
|
|
758
|
+
return M.Connected;
|
|
770
759
|
case "checking":
|
|
771
|
-
return
|
|
760
|
+
return M.Connecting;
|
|
772
761
|
case "failed":
|
|
773
|
-
return
|
|
762
|
+
return M.Fail;
|
|
774
763
|
case "new":
|
|
775
|
-
return
|
|
764
|
+
return M.New;
|
|
776
765
|
case "closed":
|
|
777
|
-
return
|
|
766
|
+
return M.Closed;
|
|
778
767
|
case "disconnected":
|
|
779
|
-
return
|
|
768
|
+
return M.Disconnected;
|
|
780
769
|
case "completed":
|
|
781
|
-
return
|
|
770
|
+
return M.Completed;
|
|
782
771
|
default:
|
|
783
|
-
return
|
|
772
|
+
return M.New;
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
function ot(e) {
|
|
776
|
+
const [t, a = ""] = e.split(/:(.+)/);
|
|
777
|
+
try {
|
|
778
|
+
const r = JSON.parse(a);
|
|
779
|
+
return x("parsed data channel message", {
|
|
780
|
+
subject: t,
|
|
781
|
+
data: r
|
|
782
|
+
}), {
|
|
783
|
+
subject: t,
|
|
784
|
+
data: r
|
|
785
|
+
};
|
|
786
|
+
} catch (r) {
|
|
787
|
+
return x("Failed to parse data channel message, returning data as string", {
|
|
788
|
+
subject: t,
|
|
789
|
+
rawData: a,
|
|
790
|
+
error: r
|
|
791
|
+
}), {
|
|
792
|
+
subject: t,
|
|
793
|
+
data: a
|
|
794
|
+
};
|
|
784
795
|
}
|
|
785
796
|
}
|
|
786
797
|
function ct({
|
|
787
798
|
statsSignal: e,
|
|
788
799
|
dataChannelSignal: t,
|
|
789
800
|
onVideoStateChange: a,
|
|
790
|
-
report:
|
|
801
|
+
report: r
|
|
791
802
|
}) {
|
|
792
|
-
e === p.Start && t === p.Start ? a == null || a(p.Start) : e === p.Stop && t === p.Stop && (a == null || a(p.Stop,
|
|
803
|
+
e === p.Start && t === p.Start ? a == null || a(p.Start) : e === p.Stop && t === p.Stop && (a == null || a(p.Stop, r));
|
|
793
804
|
}
|
|
794
805
|
function dt({
|
|
795
806
|
statsSignal: e,
|
|
796
807
|
dataChannelSignal: t,
|
|
797
808
|
onVideoStateChange: a,
|
|
798
|
-
onAgentActivityStateChange:
|
|
809
|
+
onAgentActivityStateChange: r,
|
|
799
810
|
report: o
|
|
800
811
|
}) {
|
|
801
|
-
e === p.Start ? a == null || a(p.Start) : e === p.Stop && (a == null || a(p.Stop, o)), t === p.Start ?
|
|
812
|
+
e === p.Start ? a == null || a(p.Start) : e === p.Stop && (a == null || a(p.Stop, o)), t === p.Start ? r == null || r(X.Talking) : t === p.Stop && (r == null || r(X.Idle));
|
|
802
813
|
}
|
|
803
|
-
function
|
|
814
|
+
function ne({
|
|
804
815
|
statsSignal: e,
|
|
805
816
|
dataChannelSignal: t,
|
|
806
817
|
onVideoStateChange: a,
|
|
807
|
-
onAgentActivityStateChange:
|
|
818
|
+
onAgentActivityStateChange: r,
|
|
808
819
|
streamType: o,
|
|
809
820
|
report: s
|
|
810
821
|
}) {
|
|
811
|
-
o ===
|
|
822
|
+
o === J.Legacy ? ct({
|
|
812
823
|
statsSignal: e,
|
|
813
824
|
dataChannelSignal: t,
|
|
814
825
|
onVideoStateChange: a,
|
|
815
826
|
report: s
|
|
816
|
-
}) : o ===
|
|
827
|
+
}) : o === J.Fluent && dt({
|
|
817
828
|
statsSignal: e,
|
|
818
829
|
dataChannelSignal: t,
|
|
819
830
|
onVideoStateChange: a,
|
|
820
|
-
onAgentActivityStateChange:
|
|
831
|
+
onAgentActivityStateChange: r,
|
|
821
832
|
report: s
|
|
822
833
|
});
|
|
823
834
|
}
|
|
824
835
|
async function lt(e, t, {
|
|
825
836
|
debug: a = !1,
|
|
826
|
-
callbacks:
|
|
837
|
+
callbacks: r,
|
|
827
838
|
auth: o,
|
|
828
|
-
baseURL: s =
|
|
829
|
-
analytics:
|
|
839
|
+
baseURL: s = Y,
|
|
840
|
+
analytics: n
|
|
830
841
|
}) {
|
|
831
|
-
|
|
832
|
-
let c = !1, i = !1, d = p.Stop,
|
|
842
|
+
fe = a;
|
|
843
|
+
let c = !1, i = !1, d = p.Stop, u = p.Stop;
|
|
833
844
|
const {
|
|
834
|
-
startConnection:
|
|
835
|
-
sendStreamRequest:
|
|
836
|
-
close:
|
|
837
|
-
createStream:
|
|
845
|
+
startConnection: h,
|
|
846
|
+
sendStreamRequest: _,
|
|
847
|
+
close: k,
|
|
848
|
+
createStream: D,
|
|
838
849
|
addIceCandidate: R
|
|
839
|
-
} = t.videoType ===
|
|
850
|
+
} = t.videoType === ae.Clip ? Ye(o, s, e, r.onError) : Qe(o, s, e, r.onError), {
|
|
840
851
|
id: S,
|
|
841
|
-
offer:
|
|
852
|
+
offer: B,
|
|
842
853
|
ice_servers: l,
|
|
843
|
-
session_id:
|
|
844
|
-
fluent:
|
|
845
|
-
} = await
|
|
854
|
+
session_id: m,
|
|
855
|
+
fluent: y
|
|
856
|
+
} = await D(t), w = new st({
|
|
846
857
|
iceServers: l
|
|
847
|
-
}), T =
|
|
848
|
-
if (!
|
|
858
|
+
}), T = w.createDataChannel("JanusDataChannel");
|
|
859
|
+
if (!m)
|
|
849
860
|
throw new Error("Could not create session_id");
|
|
850
|
-
const
|
|
851
|
-
|
|
852
|
-
"stream-type":
|
|
861
|
+
const v = y ? J.Fluent : J.Legacy;
|
|
862
|
+
n.enrich({
|
|
863
|
+
"stream-type": v
|
|
853
864
|
});
|
|
854
|
-
const
|
|
855
|
-
var
|
|
856
|
-
c = !0, i && ((
|
|
857
|
-
},
|
|
858
|
-
statsSignal:
|
|
859
|
-
dataChannelSignal:
|
|
860
|
-
onVideoStateChange:
|
|
861
|
-
onAgentActivityStateChange:
|
|
862
|
-
report:
|
|
863
|
-
streamType:
|
|
864
|
-
}), (
|
|
865
|
-
var
|
|
866
|
-
return (
|
|
867
|
-
},
|
|
868
|
-
|
|
869
|
-
var
|
|
870
|
-
|
|
865
|
+
const j = t.stream_warmup && !y, P = () => c, $ = () => {
|
|
866
|
+
var f;
|
|
867
|
+
c = !0, i && ((f = r.onConnectionStateChange) == null || f.call(r, M.Connected));
|
|
868
|
+
}, C = it(w, P, $, (f, g) => ne({
|
|
869
|
+
statsSignal: u = f,
|
|
870
|
+
dataChannelSignal: v === J.Legacy ? d : void 0,
|
|
871
|
+
onVideoStateChange: r.onVideoStateChange,
|
|
872
|
+
onAgentActivityStateChange: r.onAgentActivityStateChange,
|
|
873
|
+
report: g,
|
|
874
|
+
streamType: v
|
|
875
|
+
}), (f) => {
|
|
876
|
+
var g;
|
|
877
|
+
return (g = r.onConnectivityStateChange) == null ? void 0 : g.call(r, f);
|
|
878
|
+
}, j);
|
|
879
|
+
w.onicecandidate = (f) => {
|
|
880
|
+
var g;
|
|
881
|
+
x("peerConnection.onicecandidate", f);
|
|
871
882
|
try {
|
|
872
|
-
|
|
873
|
-
candidate:
|
|
874
|
-
sdpMid:
|
|
875
|
-
sdpMLineIndex:
|
|
876
|
-
},
|
|
883
|
+
f.candidate && f.candidate.sdpMid && f.candidate.sdpMLineIndex !== null ? R(S, {
|
|
884
|
+
candidate: f.candidate.candidate,
|
|
885
|
+
sdpMid: f.candidate.sdpMid,
|
|
886
|
+
sdpMLineIndex: f.candidate.sdpMLineIndex
|
|
887
|
+
}, m) : R(S, {
|
|
877
888
|
candidate: null
|
|
878
|
-
},
|
|
879
|
-
} catch (
|
|
880
|
-
(
|
|
889
|
+
}, m);
|
|
890
|
+
} catch (A) {
|
|
891
|
+
(g = r.onError) == null || g.call(r, A, {
|
|
881
892
|
streamId: S
|
|
882
893
|
});
|
|
883
894
|
}
|
|
884
895
|
}, T.onopen = () => {
|
|
885
|
-
i = !0, (!
|
|
886
|
-
}
|
|
887
|
-
|
|
888
|
-
|
|
896
|
+
i = !0, (!j || c) && $();
|
|
897
|
+
};
|
|
898
|
+
function I(f) {
|
|
899
|
+
d = f === N.StreamStarted ? p.Start : p.Stop, ne({
|
|
900
|
+
statsSignal: v === J.Legacy ? u : void 0,
|
|
889
901
|
dataChannelSignal: d,
|
|
890
|
-
onVideoStateChange:
|
|
891
|
-
onAgentActivityStateChange:
|
|
892
|
-
streamType:
|
|
893
|
-
})
|
|
894
|
-
}
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
}
|
|
903
|
-
const
|
|
904
|
-
|
|
902
|
+
onVideoStateChange: r.onVideoStateChange,
|
|
903
|
+
onAgentActivityStateChange: r.onAgentActivityStateChange,
|
|
904
|
+
streamType: v
|
|
905
|
+
});
|
|
906
|
+
}
|
|
907
|
+
function E(f, g) {
|
|
908
|
+
const A = typeof g == "string" ? g : g == null ? void 0 : g.metadata;
|
|
909
|
+
A && n.enrich({
|
|
910
|
+
streamMetadata: A
|
|
911
|
+
}), n.track("agent-chat", {
|
|
912
|
+
event: "ready"
|
|
913
|
+
});
|
|
914
|
+
}
|
|
915
|
+
const L = {
|
|
916
|
+
[N.StreamStarted]: I,
|
|
917
|
+
[N.StreamDone]: I,
|
|
918
|
+
[N.StreamReady]: E
|
|
919
|
+
};
|
|
920
|
+
T.onmessage = (f) => {
|
|
921
|
+
var H;
|
|
922
|
+
const {
|
|
923
|
+
subject: g,
|
|
924
|
+
data: A
|
|
925
|
+
} = ot(f.data);
|
|
926
|
+
(H = L[g]) == null || H.call(L, g, A);
|
|
927
|
+
}, w.oniceconnectionstatechange = () => {
|
|
928
|
+
var g;
|
|
929
|
+
x("peerConnection.oniceconnectionstatechange => " + w.iceConnectionState);
|
|
930
|
+
const f = re(w.iceConnectionState);
|
|
931
|
+
f !== M.Connected && ((g = r.onConnectionStateChange) == null || g.call(r, f));
|
|
932
|
+
}, w.ontrack = (f) => {
|
|
933
|
+
var g;
|
|
934
|
+
x("peerConnection.ontrack", f), (g = r.onSrcObjectReady) == null || g.call(r, f.streams[0]);
|
|
935
|
+
}, await w.setRemoteDescription(B), x("set remote description OK");
|
|
936
|
+
const z = await w.createAnswer();
|
|
937
|
+
return x("create answer OK"), await w.setLocalDescription(z), x("set local description OK"), await h(S, z, m), x("start connection OK"), {
|
|
905
938
|
/**
|
|
906
939
|
* Method to send request to server to get clip or talk depend on you payload
|
|
907
940
|
* @param payload
|
|
908
941
|
*/
|
|
909
|
-
speak(
|
|
910
|
-
return
|
|
942
|
+
speak(f) {
|
|
943
|
+
return _(S, m, f);
|
|
911
944
|
},
|
|
912
945
|
/**
|
|
913
946
|
* Method to close RTC connection
|
|
914
947
|
*/
|
|
915
948
|
async disconnect() {
|
|
916
|
-
var
|
|
949
|
+
var f;
|
|
917
950
|
if (S) {
|
|
918
|
-
const
|
|
919
|
-
if (
|
|
920
|
-
if (
|
|
921
|
-
clearInterval(
|
|
951
|
+
const g = re(w.iceConnectionState);
|
|
952
|
+
if (w) {
|
|
953
|
+
if (g === M.New) {
|
|
954
|
+
clearInterval(C);
|
|
922
955
|
return;
|
|
923
956
|
}
|
|
924
|
-
|
|
957
|
+
w.close(), w.oniceconnectionstatechange = null, w.onnegotiationneeded = null, w.onicecandidate = null, w.ontrack = null;
|
|
925
958
|
}
|
|
926
959
|
try {
|
|
927
|
-
|
|
960
|
+
g === M.Connected && await k(S, m).catch((A) => {
|
|
928
961
|
});
|
|
929
|
-
} catch (
|
|
930
|
-
|
|
962
|
+
} catch (A) {
|
|
963
|
+
x("Error on close stream connection", A);
|
|
931
964
|
}
|
|
932
|
-
(
|
|
965
|
+
(f = r.onAgentActivityStateChange) == null || f.call(r, X.Idle), clearInterval(C);
|
|
933
966
|
}
|
|
934
967
|
},
|
|
935
968
|
/**
|
|
936
969
|
* Session identifier information, should be returned in the body of all streaming requests
|
|
937
970
|
*/
|
|
938
|
-
sessionId:
|
|
971
|
+
sessionId: m,
|
|
939
972
|
/**
|
|
940
973
|
* Id of current RTC stream
|
|
941
974
|
*/
|
|
942
975
|
streamId: S,
|
|
943
|
-
streamType:
|
|
976
|
+
streamType: v
|
|
944
977
|
};
|
|
945
978
|
}
|
|
946
979
|
function ut(e, t) {
|
|
@@ -948,7 +981,7 @@ function ut(e, t) {
|
|
|
948
981
|
streamOptions: a
|
|
949
982
|
} = t ?? {};
|
|
950
983
|
return {
|
|
951
|
-
videoType:
|
|
984
|
+
videoType: Ee(e.presenter.type),
|
|
952
985
|
output_resolution: a == null ? void 0 : a.outputResolution,
|
|
953
986
|
session_timeout: a == null ? void 0 : a.sessionTimeout,
|
|
954
987
|
stream_warmup: a == null ? void 0 : a.streamWarmup,
|
|
@@ -956,14 +989,14 @@ function ut(e, t) {
|
|
|
956
989
|
fluent: a == null ? void 0 : a.fluent
|
|
957
990
|
};
|
|
958
991
|
}
|
|
959
|
-
function ft(e, t, a,
|
|
960
|
-
o ===
|
|
992
|
+
function ft(e, t, a, r, o) {
|
|
993
|
+
o === J.Fluent ? mt(e, t, a, r, o) : ht(e, t, a, r, o);
|
|
961
994
|
}
|
|
962
|
-
function mt(e, t, a,
|
|
963
|
-
e === p.Start ?
|
|
995
|
+
function mt(e, t, a, r, o) {
|
|
996
|
+
e === p.Start ? r.track("stream-session", {
|
|
964
997
|
event: "start",
|
|
965
998
|
"stream-type": o
|
|
966
|
-
}) : e === p.Stop &&
|
|
999
|
+
}) : e === p.Stop && r.track("stream-session", {
|
|
967
1000
|
event: "stop",
|
|
968
1001
|
is_greenscreen: t.presenter.type === "clip" && t.presenter.is_greenscreen,
|
|
969
1002
|
background: t.presenter.type === "clip" && t.presenter.background,
|
|
@@ -971,50 +1004,50 @@ function mt(e, t, a, n, o) {
|
|
|
971
1004
|
...a
|
|
972
1005
|
});
|
|
973
1006
|
}
|
|
974
|
-
function gt(e, t, a,
|
|
975
|
-
|
|
1007
|
+
function gt(e, t, a, r) {
|
|
1008
|
+
F.get() <= 0 || (e === p.Start ? a.linkTrack("agent-video", {
|
|
976
1009
|
event: "start",
|
|
977
|
-
latency:
|
|
978
|
-
"stream-type":
|
|
979
|
-
}, "start", [
|
|
1010
|
+
latency: F.get(!0),
|
|
1011
|
+
"stream-type": r
|
|
1012
|
+
}, "start", [N.StreamVideoCreated]) : e === p.Stop && a.linkTrack("agent-video", {
|
|
980
1013
|
event: "stop",
|
|
981
1014
|
is_greenscreen: t.presenter.type === "clip" && t.presenter.is_greenscreen,
|
|
982
1015
|
background: t.presenter.type === "clip" && t.presenter.background,
|
|
983
|
-
"stream-type":
|
|
984
|
-
}, "done", [
|
|
1016
|
+
"stream-type": r
|
|
1017
|
+
}, "done", [N.StreamVideoDone]));
|
|
985
1018
|
}
|
|
986
|
-
function ht(e, t, a,
|
|
987
|
-
|
|
1019
|
+
function ht(e, t, a, r, o) {
|
|
1020
|
+
F.get() <= 0 || (e === p.Start ? r.linkTrack("agent-video", {
|
|
988
1021
|
event: "start",
|
|
989
|
-
latency:
|
|
1022
|
+
latency: F.get(!0),
|
|
990
1023
|
"stream-type": o
|
|
991
|
-
}, "start", [
|
|
1024
|
+
}, "start", [N.StreamVideoCreated]) : e === p.Stop && r.linkTrack("agent-video", {
|
|
992
1025
|
event: "stop",
|
|
993
1026
|
is_greenscreen: t.presenter.type === "clip" && t.presenter.is_greenscreen,
|
|
994
1027
|
background: t.presenter.type === "clip" && t.presenter.background,
|
|
995
1028
|
"stream-type": o,
|
|
996
1029
|
...a
|
|
997
|
-
}, "done", [
|
|
1030
|
+
}, "done", [N.StreamVideoDone]));
|
|
998
1031
|
}
|
|
999
1032
|
function wt(e, t, a) {
|
|
1000
|
-
return
|
|
1033
|
+
return F.reset(), new Promise(async (r, o) => {
|
|
1001
1034
|
try {
|
|
1002
1035
|
const s = await lt(e.id, ut(e, t), {
|
|
1003
1036
|
...t,
|
|
1004
1037
|
analytics: a,
|
|
1005
1038
|
callbacks: {
|
|
1006
1039
|
...t.callbacks,
|
|
1007
|
-
onConnectionStateChange: (
|
|
1040
|
+
onConnectionStateChange: (n) => {
|
|
1008
1041
|
var c, i;
|
|
1009
|
-
(i = (c = t.callbacks).onConnectionStateChange) == null || i.call(c,
|
|
1042
|
+
(i = (c = t.callbacks).onConnectionStateChange) == null || i.call(c, n), n === M.Connected && r(s);
|
|
1010
1043
|
},
|
|
1011
|
-
onVideoStateChange: (
|
|
1044
|
+
onVideoStateChange: (n, c) => {
|
|
1012
1045
|
var i, d;
|
|
1013
|
-
(d = (i = t.callbacks).onVideoStateChange) == null || d.call(i,
|
|
1046
|
+
(d = (i = t.callbacks).onVideoStateChange) == null || d.call(i, n), ft(n, e, c, a, s.streamType);
|
|
1014
1047
|
},
|
|
1015
|
-
onAgentActivityStateChange: (
|
|
1048
|
+
onAgentActivityStateChange: (n) => {
|
|
1016
1049
|
var c, i;
|
|
1017
|
-
(i = (c = t.callbacks).onAgentActivityStateChange) == null || i.call(c,
|
|
1050
|
+
(i = (c = t.callbacks).onAgentActivityStateChange) == null || i.call(c, n), gt(n === X.Talking ? p.Start : p.Stop, e, a, s.streamType);
|
|
1018
1051
|
}
|
|
1019
1052
|
}
|
|
1020
1053
|
});
|
|
@@ -1023,240 +1056,240 @@ function wt(e, t, a) {
|
|
|
1023
1056
|
}
|
|
1024
1057
|
});
|
|
1025
1058
|
}
|
|
1026
|
-
async function pt(e, t, a,
|
|
1027
|
-
var i, d,
|
|
1059
|
+
async function pt(e, t, a, r, o) {
|
|
1060
|
+
var i, d, u, h;
|
|
1028
1061
|
const {
|
|
1029
1062
|
chat: s,
|
|
1030
|
-
chatMode:
|
|
1031
|
-
} = await
|
|
1032
|
-
if (
|
|
1033
|
-
return (
|
|
1063
|
+
chatMode: n
|
|
1064
|
+
} = await ue(e, a, r, t.mode, t.persistentChat, o);
|
|
1065
|
+
if (n && n !== t.mode && (t.mode = n, (d = (i = t.callbacks).onModeChange) == null || d.call(i, n), n === b.TextOnly))
|
|
1066
|
+
return (h = (u = t.callbacks).onError) == null || h.call(u, new we(n)), {
|
|
1034
1067
|
chat: s
|
|
1035
1068
|
};
|
|
1036
|
-
const c = await wt(e, t,
|
|
1069
|
+
const c = await wt(e, t, r);
|
|
1037
1070
|
return {
|
|
1038
1071
|
chat: s,
|
|
1039
1072
|
streamingManager: c
|
|
1040
1073
|
};
|
|
1041
1074
|
}
|
|
1042
1075
|
async function vt(e, t) {
|
|
1043
|
-
var R, S,
|
|
1076
|
+
var R, S, B;
|
|
1044
1077
|
let a = !0;
|
|
1045
|
-
const
|
|
1078
|
+
const r = t.mixpanelKey || je, o = t.wsURL || Te, s = t.baseURL || Y, n = {
|
|
1046
1079
|
messages: [],
|
|
1047
|
-
chatMode: t.mode ||
|
|
1048
|
-
}, c =
|
|
1049
|
-
token:
|
|
1080
|
+
chatMode: t.mode || b.Functional
|
|
1081
|
+
}, c = ce(t.auth, s, t.callbacks.onError), i = await c.getById(e), d = Ne({
|
|
1082
|
+
token: r,
|
|
1050
1083
|
agent: i,
|
|
1051
1084
|
isEnabled: t.enableAnalitics,
|
|
1052
1085
|
distinctId: t.distinctId
|
|
1053
1086
|
}), {
|
|
1054
|
-
onMessage:
|
|
1055
|
-
clearQueue:
|
|
1056
|
-
} =
|
|
1087
|
+
onMessage: u,
|
|
1088
|
+
clearQueue: h
|
|
1089
|
+
} = Xe(d, n, t, i, () => {
|
|
1057
1090
|
var l;
|
|
1058
|
-
return (l =
|
|
1091
|
+
return (l = n.socketManager) == null ? void 0 : l.disconnect();
|
|
1059
1092
|
});
|
|
1060
|
-
|
|
1093
|
+
n.messages = We(t.initialMessages), (S = (R = t.callbacks).onNewMessage) == null || S.call(R, [...n.messages], "answer"), d.track("agent-sdk", {
|
|
1061
1094
|
event: "loaded",
|
|
1062
|
-
...
|
|
1095
|
+
...Le(i)
|
|
1063
1096
|
});
|
|
1064
|
-
async function
|
|
1065
|
-
var
|
|
1066
|
-
(
|
|
1067
|
-
const
|
|
1068
|
-
onMessage:
|
|
1097
|
+
async function _(l) {
|
|
1098
|
+
var j, P, $, C, I, E, L;
|
|
1099
|
+
(P = (j = t.callbacks).onConnectionStateChange) == null || P.call(j, M.Connecting), F.reset(), l && !a && (delete n.chat, (C = ($ = t.callbacks).onNewMessage) == null || C.call($, [...n.messages], "answer"));
|
|
1100
|
+
const m = t.mode === b.DirectPlayback ? Promise.resolve(void 0) : He(t.auth, o, {
|
|
1101
|
+
onMessage: u,
|
|
1069
1102
|
onError: t.callbacks.onError
|
|
1070
|
-
}),
|
|
1103
|
+
}), y = G(() => pt(i, t, c, d, n.chat), {
|
|
1071
1104
|
limit: 3,
|
|
1072
|
-
timeout:
|
|
1105
|
+
timeout: Ie,
|
|
1073
1106
|
timeoutErrorMessage: "Timeout initializing the stream",
|
|
1074
1107
|
// Retry on all errors except for connection errors and rate limit errors, these are already handled in client level.
|
|
1075
|
-
shouldRetryFn: (
|
|
1108
|
+
shouldRetryFn: (z) => (z == null ? void 0 : z.message) !== "Could not connect" && z.status !== 429,
|
|
1076
1109
|
delayMs: 1e3
|
|
1077
|
-
}).catch((
|
|
1078
|
-
var
|
|
1079
|
-
throw
|
|
1080
|
-
}), [
|
|
1110
|
+
}).catch((z) => {
|
|
1111
|
+
var f, g;
|
|
1112
|
+
throw D(b.Maintenance), (g = (f = t.callbacks).onConnectionStateChange) == null || g.call(f, M.Fail), z;
|
|
1113
|
+
}), [w, {
|
|
1081
1114
|
streamingManager: T,
|
|
1082
|
-
chat:
|
|
1083
|
-
}] = await Promise.all([
|
|
1084
|
-
|
|
1115
|
+
chat: v
|
|
1116
|
+
}] = await Promise.all([m, y]);
|
|
1117
|
+
v && v.id !== ((I = n.chat) == null ? void 0 : I.id) && ((L = (E = t.callbacks).onNewChat) == null || L.call(E, v.id)), n.streamingManager = T, n.socketManager = w, n.chat = v, a = !1, D((v == null ? void 0 : v.chat_mode) ?? t.mode ?? b.Functional);
|
|
1085
1118
|
}
|
|
1086
|
-
async function
|
|
1087
|
-
var l,
|
|
1088
|
-
(l =
|
|
1119
|
+
async function k() {
|
|
1120
|
+
var l, m, y, w;
|
|
1121
|
+
(l = n.socketManager) == null || l.disconnect(), await ((m = n.streamingManager) == null ? void 0 : m.disconnect()), delete n.streamingManager, delete n.socketManager, (w = (y = t.callbacks).onConnectionStateChange) == null || w.call(y, M.Disconnected);
|
|
1089
1122
|
}
|
|
1090
|
-
async function
|
|
1091
|
-
var
|
|
1092
|
-
l !==
|
|
1123
|
+
async function D(l) {
|
|
1124
|
+
var m, y;
|
|
1125
|
+
l !== n.chatMode && (d.track("agent-mode-change", {
|
|
1093
1126
|
mode: l
|
|
1094
|
-
}),
|
|
1127
|
+
}), n.chatMode = l, n.chatMode !== b.Functional && await k(), (y = (m = t.callbacks).onModeChange) == null || y.call(m, l));
|
|
1095
1128
|
}
|
|
1096
1129
|
return {
|
|
1097
1130
|
agent: i,
|
|
1098
1131
|
getStreamType: () => {
|
|
1099
1132
|
var l;
|
|
1100
|
-
return (l =
|
|
1133
|
+
return (l = n.streamingManager) == null ? void 0 : l.streamType;
|
|
1101
1134
|
},
|
|
1102
|
-
starterMessages: ((
|
|
1135
|
+
starterMessages: ((B = i.knowledge) == null ? void 0 : B.starter_message) || [],
|
|
1103
1136
|
getSTTToken: () => c.getSTTToken(i.id),
|
|
1104
|
-
changeMode:
|
|
1137
|
+
changeMode: D,
|
|
1105
1138
|
enrichAnalytics: d.enrich,
|
|
1106
1139
|
async connect() {
|
|
1107
1140
|
var l;
|
|
1108
|
-
await
|
|
1141
|
+
await _(!0), d.track("agent-chat", {
|
|
1109
1142
|
event: "connect",
|
|
1110
|
-
chatId: (l =
|
|
1143
|
+
chatId: (l = n.chat) == null ? void 0 : l.id,
|
|
1111
1144
|
agentId: i.id,
|
|
1112
|
-
mode:
|
|
1145
|
+
mode: n.chatMode
|
|
1113
1146
|
});
|
|
1114
1147
|
},
|
|
1115
1148
|
async reconnect() {
|
|
1116
1149
|
var l;
|
|
1117
|
-
await
|
|
1150
|
+
await k(), await _(!1), d.track("agent-chat", {
|
|
1118
1151
|
event: "reconnect",
|
|
1119
|
-
chatId: (l =
|
|
1152
|
+
chatId: (l = n.chat) == null ? void 0 : l.id,
|
|
1120
1153
|
agentId: i.id,
|
|
1121
|
-
mode:
|
|
1154
|
+
mode: n.chatMode
|
|
1122
1155
|
});
|
|
1123
1156
|
},
|
|
1124
1157
|
async disconnect() {
|
|
1125
1158
|
var l;
|
|
1126
|
-
await
|
|
1159
|
+
await k(), d.track("agent-chat", {
|
|
1127
1160
|
event: "disconnect",
|
|
1128
|
-
chatId: (l =
|
|
1161
|
+
chatId: (l = n.chat) == null ? void 0 : l.id,
|
|
1129
1162
|
agentId: i.id,
|
|
1130
|
-
mode:
|
|
1163
|
+
mode: n.chatMode
|
|
1131
1164
|
});
|
|
1132
1165
|
},
|
|
1133
1166
|
async chat(l) {
|
|
1134
|
-
var T,
|
|
1135
|
-
const
|
|
1136
|
-
if (t.mode ===
|
|
1137
|
-
throw new
|
|
1167
|
+
var T, v, j, P, $;
|
|
1168
|
+
const m = () => {
|
|
1169
|
+
if (t.mode === b.DirectPlayback)
|
|
1170
|
+
throw new W("Direct playback is enabled, chat is disabled");
|
|
1138
1171
|
if (l.length >= 800)
|
|
1139
|
-
throw new
|
|
1172
|
+
throw new W("Message cannot be more than 800 characters");
|
|
1140
1173
|
if (l.length === 0)
|
|
1141
|
-
throw new
|
|
1142
|
-
if (
|
|
1143
|
-
throw new
|
|
1144
|
-
if (![
|
|
1145
|
-
if (!
|
|
1146
|
-
throw new
|
|
1147
|
-
if (!
|
|
1148
|
-
throw new
|
|
1174
|
+
throw new W("Message cannot be empty");
|
|
1175
|
+
if (n.chatMode === b.Maintenance)
|
|
1176
|
+
throw new W("Chat is in maintenance mode");
|
|
1177
|
+
if (![b.TextOnly, b.Playground].includes(n.chatMode)) {
|
|
1178
|
+
if (!n.streamingManager)
|
|
1179
|
+
throw new W("Streaming manager is not initialized");
|
|
1180
|
+
if (!n.chat)
|
|
1181
|
+
throw new W("Chat is not initialized");
|
|
1149
1182
|
}
|
|
1150
|
-
},
|
|
1151
|
-
var
|
|
1152
|
-
if (!
|
|
1153
|
-
const
|
|
1154
|
-
if (!
|
|
1155
|
-
throw new
|
|
1156
|
-
|
|
1183
|
+
}, y = async () => {
|
|
1184
|
+
var C, I;
|
|
1185
|
+
if (!n.chat) {
|
|
1186
|
+
const E = await ue(i, c, d, n.chatMode, t.persistentChat);
|
|
1187
|
+
if (!E.chat)
|
|
1188
|
+
throw new he(n.chatMode, !!t.persistentChat);
|
|
1189
|
+
n.chat = E.chat, (I = (C = t.callbacks).onNewChat) == null || I.call(C, n.chat.id);
|
|
1157
1190
|
}
|
|
1158
|
-
return
|
|
1159
|
-
},
|
|
1160
|
-
var
|
|
1161
|
-
return c.chat(i.id,
|
|
1162
|
-
chatMode:
|
|
1163
|
-
streamId: (
|
|
1164
|
-
sessionId: (
|
|
1165
|
-
messages:
|
|
1166
|
-
matches:
|
|
1167
|
-
...
|
|
1168
|
-
}) =>
|
|
1191
|
+
return n.chat.id;
|
|
1192
|
+
}, w = async (C, I) => G(() => {
|
|
1193
|
+
var E, L;
|
|
1194
|
+
return c.chat(i.id, I, {
|
|
1195
|
+
chatMode: n.chatMode,
|
|
1196
|
+
streamId: (E = n.streamingManager) == null ? void 0 : E.streamId,
|
|
1197
|
+
sessionId: (L = n.streamingManager) == null ? void 0 : L.sessionId,
|
|
1198
|
+
messages: C.map(({
|
|
1199
|
+
matches: z,
|
|
1200
|
+
...f
|
|
1201
|
+
}) => f)
|
|
1169
1202
|
}, {
|
|
1170
|
-
...
|
|
1203
|
+
...le(n.chatMode),
|
|
1171
1204
|
skipErrorHandler: !0
|
|
1172
1205
|
});
|
|
1173
1206
|
}, {
|
|
1174
1207
|
limit: 2,
|
|
1175
|
-
shouldRetryFn: (
|
|
1176
|
-
var
|
|
1177
|
-
const
|
|
1178
|
-
return !((
|
|
1208
|
+
shouldRetryFn: (E) => {
|
|
1209
|
+
var f, g, A, H;
|
|
1210
|
+
const L = (f = E == null ? void 0 : E.message) == null ? void 0 : f.includes("missing or invalid session_id");
|
|
1211
|
+
return !((g = E == null ? void 0 : E.message) == null ? void 0 : g.includes("Stream Error")) && !L ? ((H = (A = t.callbacks).onError) == null || H.call(A, E), !1) : !0;
|
|
1179
1212
|
},
|
|
1180
1213
|
onRetry: async () => {
|
|
1181
|
-
await
|
|
1214
|
+
await k(), await _(!1);
|
|
1182
1215
|
}
|
|
1183
1216
|
});
|
|
1184
1217
|
try {
|
|
1185
|
-
|
|
1186
|
-
id:
|
|
1218
|
+
h(), m(), n.messages.push({
|
|
1219
|
+
id: K(),
|
|
1187
1220
|
role: "user",
|
|
1188
1221
|
content: l,
|
|
1189
|
-
created_at: new Date(
|
|
1190
|
-
}), (
|
|
1191
|
-
const
|
|
1192
|
-
return
|
|
1193
|
-
id:
|
|
1222
|
+
created_at: new Date(F.update()).toISOString()
|
|
1223
|
+
}), (v = (T = t.callbacks).onNewMessage) == null || v.call(T, [...n.messages], "user");
|
|
1224
|
+
const C = await y(), I = await w([...n.messages], C);
|
|
1225
|
+
return n.messages.push({
|
|
1226
|
+
id: K(),
|
|
1194
1227
|
role: "assistant",
|
|
1195
|
-
content:
|
|
1228
|
+
content: I.result || "",
|
|
1196
1229
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1197
|
-
context:
|
|
1198
|
-
matches:
|
|
1230
|
+
context: I.context,
|
|
1231
|
+
matches: I.matches
|
|
1199
1232
|
}), d.track("agent-message-send", {
|
|
1200
1233
|
event: "success",
|
|
1201
|
-
mode:
|
|
1202
|
-
messages:
|
|
1203
|
-
}),
|
|
1204
|
-
latency:
|
|
1205
|
-
mode:
|
|
1206
|
-
messages:
|
|
1207
|
-
})),
|
|
1208
|
-
} catch (
|
|
1209
|
-
throw ((
|
|
1234
|
+
mode: n.chatMode,
|
|
1235
|
+
messages: n.messages.length + 1
|
|
1236
|
+
}), I.result && ((P = (j = t.callbacks).onNewMessage) == null || P.call(j, [...n.messages], "answer"), d.track("agent-message-received", {
|
|
1237
|
+
latency: F.get(!0),
|
|
1238
|
+
mode: n.chatMode,
|
|
1239
|
+
messages: n.messages.length
|
|
1240
|
+
})), I;
|
|
1241
|
+
} catch (C) {
|
|
1242
|
+
throw (($ = n.messages[n.messages.length - 1]) == null ? void 0 : $.role) === "assistant" && n.messages.pop(), d.track("agent-message-send", {
|
|
1210
1243
|
event: "error",
|
|
1211
|
-
mode:
|
|
1212
|
-
messages:
|
|
1213
|
-
}),
|
|
1244
|
+
mode: n.chatMode,
|
|
1245
|
+
messages: n.messages.length
|
|
1246
|
+
}), C;
|
|
1214
1247
|
}
|
|
1215
1248
|
},
|
|
1216
|
-
rate(l,
|
|
1217
|
-
var
|
|
1218
|
-
const
|
|
1219
|
-
if (
|
|
1220
|
-
if (!
|
|
1249
|
+
rate(l, m, y) {
|
|
1250
|
+
var v, j, P, $;
|
|
1251
|
+
const w = n.messages.find((C) => C.id === l);
|
|
1252
|
+
if (n.chat) {
|
|
1253
|
+
if (!w)
|
|
1221
1254
|
throw new Error("Message not found");
|
|
1222
1255
|
} else
|
|
1223
1256
|
throw new Error("Chat is not initialized");
|
|
1224
|
-
const T = ((
|
|
1257
|
+
const T = ((v = w.matches) == null ? void 0 : v.map((C) => [C.document_id, C.id])) ?? [];
|
|
1225
1258
|
return d.track("agent-rate", {
|
|
1226
|
-
event:
|
|
1227
|
-
thumb:
|
|
1228
|
-
knowledge_id: ((b = i.knowledge) == null ? void 0 : b.id) ?? "",
|
|
1229
|
-
mode: r.chatMode,
|
|
1230
|
-
matches: T,
|
|
1231
|
-
score: g
|
|
1232
|
-
}), v ? c.updateRating(i.id, r.chat.id, v, {
|
|
1259
|
+
event: y ? "update" : "create",
|
|
1260
|
+
thumb: m === 1 ? "up" : "down",
|
|
1233
1261
|
knowledge_id: ((j = i.knowledge) == null ? void 0 : j.id) ?? "",
|
|
1262
|
+
mode: n.chatMode,
|
|
1263
|
+
matches: T,
|
|
1264
|
+
score: m
|
|
1265
|
+
}), y ? c.updateRating(i.id, n.chat.id, y, {
|
|
1266
|
+
knowledge_id: ((P = i.knowledge) == null ? void 0 : P.id) ?? "",
|
|
1234
1267
|
message_id: l,
|
|
1235
1268
|
matches: T,
|
|
1236
|
-
score:
|
|
1237
|
-
}) : c.createRating(i.id,
|
|
1238
|
-
knowledge_id: ((
|
|
1269
|
+
score: m
|
|
1270
|
+
}) : c.createRating(i.id, n.chat.id, {
|
|
1271
|
+
knowledge_id: (($ = i.knowledge) == null ? void 0 : $.id) ?? "",
|
|
1239
1272
|
message_id: l,
|
|
1240
1273
|
matches: T,
|
|
1241
|
-
score:
|
|
1274
|
+
score: m
|
|
1242
1275
|
});
|
|
1243
1276
|
},
|
|
1244
1277
|
deleteRate(l) {
|
|
1245
|
-
var
|
|
1246
|
-
if (!
|
|
1278
|
+
var m;
|
|
1279
|
+
if (!n.chat)
|
|
1247
1280
|
throw new Error("Chat is not initialized");
|
|
1248
1281
|
return d.track("agent-rate-delete", {
|
|
1249
1282
|
type: "text",
|
|
1250
|
-
chat_id: (
|
|
1283
|
+
chat_id: (m = n.chat) == null ? void 0 : m.id,
|
|
1251
1284
|
id: l,
|
|
1252
|
-
mode:
|
|
1253
|
-
}), c.deleteRating(i.id,
|
|
1285
|
+
mode: n.chatMode
|
|
1286
|
+
}), c.deleteRating(i.id, n.chat.id, l);
|
|
1254
1287
|
},
|
|
1255
1288
|
async speak(l) {
|
|
1256
|
-
var T,
|
|
1257
|
-
if (!
|
|
1289
|
+
var T, v, j, P;
|
|
1290
|
+
if (!n.streamingManager)
|
|
1258
1291
|
throw new Error("Please connect to the agent first");
|
|
1259
|
-
function
|
|
1292
|
+
function m() {
|
|
1260
1293
|
if (typeof l == "string") {
|
|
1261
1294
|
if (!i.presenter.voice)
|
|
1262
1295
|
throw new Error("Presenter voice is not initialized");
|
|
@@ -1279,21 +1312,21 @@ async function vt(e, t) {
|
|
|
1279
1312
|
}
|
|
1280
1313
|
return l;
|
|
1281
1314
|
}
|
|
1282
|
-
const
|
|
1283
|
-
d.track("agent-speak",
|
|
1284
|
-
id:
|
|
1315
|
+
const y = m();
|
|
1316
|
+
d.track("agent-speak", y), F.update(), (T = n.chat) != null && T.id && y.type === "text" && (n.messages.push({
|
|
1317
|
+
id: K(),
|
|
1285
1318
|
role: "assistant",
|
|
1286
|
-
content:
|
|
1287
|
-
created_at: new Date(
|
|
1288
|
-
}), (
|
|
1289
|
-
const
|
|
1290
|
-
return
|
|
1319
|
+
content: y.input,
|
|
1320
|
+
created_at: new Date(F.get(!0)).toISOString()
|
|
1321
|
+
}), (j = (v = t.callbacks).onNewMessage) == null || j.call(v, [...n.messages], "answer"));
|
|
1322
|
+
const w = Pe(n.chatMode);
|
|
1323
|
+
return n.chat && w ? {
|
|
1291
1324
|
duration: 0,
|
|
1292
1325
|
status: "success"
|
|
1293
|
-
} :
|
|
1294
|
-
script:
|
|
1326
|
+
} : n.streamingManager.speak({
|
|
1327
|
+
script: y,
|
|
1295
1328
|
metadata: {
|
|
1296
|
-
chat_id: (
|
|
1329
|
+
chat_id: (P = n.chat) == null ? void 0 : P.id,
|
|
1297
1330
|
agent_id: i.id
|
|
1298
1331
|
}
|
|
1299
1332
|
});
|
|
@@ -1302,35 +1335,34 @@ async function vt(e, t) {
|
|
|
1302
1335
|
}
|
|
1303
1336
|
function kt(e, t, a) {
|
|
1304
1337
|
const {
|
|
1305
|
-
getById:
|
|
1306
|
-
} =
|
|
1307
|
-
return
|
|
1338
|
+
getById: r
|
|
1339
|
+
} = ce(t, a || Y);
|
|
1340
|
+
return r(e);
|
|
1308
1341
|
}
|
|
1309
1342
|
export {
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
te as DataChannelSignalMap,
|
|
1343
|
+
X as AgentActivityState,
|
|
1344
|
+
ke as AgentStatus,
|
|
1345
|
+
he as ChatCreationFailed,
|
|
1346
|
+
b as ChatMode,
|
|
1347
|
+
we as ChatModeDowngraded,
|
|
1348
|
+
U as ChatProgress,
|
|
1349
|
+
M as ConnectionState,
|
|
1350
|
+
V as ConnectivityState,
|
|
1319
1351
|
Se as DocumentType,
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1352
|
+
Ce as KnowledgeType,
|
|
1353
|
+
ve as PlanGroup,
|
|
1354
|
+
_e as Providers,
|
|
1355
|
+
De as RateState,
|
|
1356
|
+
N as StreamEvents,
|
|
1357
|
+
J as StreamType,
|
|
1326
1358
|
p as StreamingState,
|
|
1327
1359
|
Re as Subject,
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1360
|
+
ye as UserPlan,
|
|
1361
|
+
W as ValidationError,
|
|
1362
|
+
ae as VideoType,
|
|
1363
|
+
Me as VoiceAccess,
|
|
1364
|
+
pe as WsError,
|
|
1333
1365
|
vt as createAgentManager,
|
|
1334
1366
|
kt as getAgent,
|
|
1335
|
-
|
|
1367
|
+
Ee as mapVideoType
|
|
1336
1368
|
};
|