@centive/aria-sdk 0.5.5 → 0.5.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/context/AriaProvider.d.ts.map +1 -1
- package/dist/{index-B3GM9bzB.js → index-D__agxtJ.js} +77 -69
- package/dist/{index-B3GM9bzB.js.map → index-D__agxtJ.js.map} +1 -1
- package/dist/{index-B5eKfkTN.js → index-ydydPYp9.js} +3 -3
- package/dist/{index-B5eKfkTN.js.map → index-ydydPYp9.js.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/AriaSessionManager.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AriaProvider.d.ts","sourceRoot":"","sources":["../../src/context/AriaProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA4C,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAU1F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAK7C,UAAU,iBAAiB;IACzB,MAAM,EAAE,aAAa,CAAC;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAMD,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,
|
|
1
|
+
{"version":3,"file":"AriaProvider.d.ts","sourceRoot":"","sources":["../../src/context/AriaProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA4C,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAU1F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAK7C,UAAU,iBAAiB;IACzB,MAAM,EAAE,aAAa,CAAC;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAMD,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CA6a9C,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as b, jsxs as O, Fragment as pt } from "react/jsx-runtime";
|
|
2
2
|
import * as be from "react";
|
|
3
|
-
import { createContext as ur, useContext as hr, useState as re, useRef as Qe, useEffect as He, useCallback as
|
|
3
|
+
import { createContext as ur, useContext as hr, useState as re, useRef as Qe, useEffect as He, useCallback as ee } from "react";
|
|
4
4
|
import { CheckCircle2 as xt, AlertCircle as ct, Zap as St, RefreshCw as ft, Clock as gr, MessageCircle as Pt, Sparkles as mt, User as pr, Bot as fr, Send as mr, X as Ut, MicOff as wr, Mic as vr, Phone as br } from "lucide-react";
|
|
5
5
|
import { createPortal as yr } from "react-dom";
|
|
6
6
|
const Lt = ur(null), Ze = () => {
|
|
@@ -261,9 +261,9 @@ const Er = (n, e) => {
|
|
|
261
261
|
continue;
|
|
262
262
|
d.push(H);
|
|
263
263
|
const L = c(M, _);
|
|
264
|
-
for (let
|
|
265
|
-
const
|
|
266
|
-
d.push(V +
|
|
264
|
+
for (let te = 0; te < L.length; ++te) {
|
|
265
|
+
const Y = L[te];
|
|
266
|
+
d.push(V + Y);
|
|
267
267
|
}
|
|
268
268
|
m = f + (m.length > 0 ? " " + m : m);
|
|
269
269
|
}
|
|
@@ -326,7 +326,7 @@ const Er = (n, e) => {
|
|
|
326
326
|
"bottom-left",
|
|
327
327
|
// Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
|
|
328
328
|
"left-bottom"
|
|
329
|
-
], L = () => [...H(), C, k],
|
|
329
|
+
], L = () => [...H(), C, k], te = () => ["auto", "hidden", "clip", "visible", "scroll"], Y = () => ["auto", "contain", "none"], T = () => [C, k, m], ne = () => [We, "full", "auto", ...T()], me = () => [Ne, "none", "subgrid", C, k], ye = () => ["auto", {
|
|
330
330
|
span: ["full", Ne, C, k]
|
|
331
331
|
}, Ne, C, k], Ce = () => [Ne, "auto", C, k], N = () => ["auto", "min", "max", "fr", C, k], ue = () => ["start", "end", "center", "between", "around", "evenly", "stretch", "baseline", "center-safe", "end-safe"], he = () => ["start", "end", "center", "stretch", "center-safe", "end-safe"], ae = () => ["auto", ...T()], le = () => [We, "auto", "full", "dvw", "dvh", "lvw", "lvh", "svw", "svh", "min", "max", "fit", ...T()], R = () => [n, C, k], Ie = () => [...H(), Tt, Rt, {
|
|
332
332
|
position: [C, k]
|
|
@@ -342,7 +342,7 @@ const Er = (n, e) => {
|
|
|
342
342
|
w,
|
|
343
343
|
C,
|
|
344
344
|
k
|
|
345
|
-
],
|
|
345
|
+
], Z = () => ["", D, Xe, Ge], Ae = () => ["solid", "dashed", "dotted", "double"], Ue = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"], z = () => [D, dt, Tt, Rt], ce = () => [
|
|
346
346
|
// Deprecated since Tailwind CSS v4.0.0
|
|
347
347
|
"",
|
|
348
348
|
"none",
|
|
@@ -480,42 +480,42 @@ const Er = (n, e) => {
|
|
|
480
480
|
* @see https://tailwindcss.com/docs/overflow
|
|
481
481
|
*/
|
|
482
482
|
overflow: [{
|
|
483
|
-
overflow:
|
|
483
|
+
overflow: te()
|
|
484
484
|
}],
|
|
485
485
|
/**
|
|
486
486
|
* Overflow X
|
|
487
487
|
* @see https://tailwindcss.com/docs/overflow
|
|
488
488
|
*/
|
|
489
489
|
"overflow-x": [{
|
|
490
|
-
"overflow-x":
|
|
490
|
+
"overflow-x": te()
|
|
491
491
|
}],
|
|
492
492
|
/**
|
|
493
493
|
* Overflow Y
|
|
494
494
|
* @see https://tailwindcss.com/docs/overflow
|
|
495
495
|
*/
|
|
496
496
|
"overflow-y": [{
|
|
497
|
-
"overflow-y":
|
|
497
|
+
"overflow-y": te()
|
|
498
498
|
}],
|
|
499
499
|
/**
|
|
500
500
|
* Overscroll Behavior
|
|
501
501
|
* @see https://tailwindcss.com/docs/overscroll-behavior
|
|
502
502
|
*/
|
|
503
503
|
overscroll: [{
|
|
504
|
-
overscroll:
|
|
504
|
+
overscroll: Y()
|
|
505
505
|
}],
|
|
506
506
|
/**
|
|
507
507
|
* Overscroll Behavior X
|
|
508
508
|
* @see https://tailwindcss.com/docs/overscroll-behavior
|
|
509
509
|
*/
|
|
510
510
|
"overscroll-x": [{
|
|
511
|
-
"overscroll-x":
|
|
511
|
+
"overscroll-x": Y()
|
|
512
512
|
}],
|
|
513
513
|
/**
|
|
514
514
|
* Overscroll Behavior Y
|
|
515
515
|
* @see https://tailwindcss.com/docs/overscroll-behavior
|
|
516
516
|
*/
|
|
517
517
|
"overscroll-y": [{
|
|
518
|
-
"overscroll-y":
|
|
518
|
+
"overscroll-y": Y()
|
|
519
519
|
}],
|
|
520
520
|
/**
|
|
521
521
|
* Position
|
|
@@ -1492,70 +1492,70 @@ const Er = (n, e) => {
|
|
|
1492
1492
|
* @see https://tailwindcss.com/docs/border-width
|
|
1493
1493
|
*/
|
|
1494
1494
|
"border-w": [{
|
|
1495
|
-
border:
|
|
1495
|
+
border: Z()
|
|
1496
1496
|
}],
|
|
1497
1497
|
/**
|
|
1498
1498
|
* Border Width X
|
|
1499
1499
|
* @see https://tailwindcss.com/docs/border-width
|
|
1500
1500
|
*/
|
|
1501
1501
|
"border-w-x": [{
|
|
1502
|
-
"border-x":
|
|
1502
|
+
"border-x": Z()
|
|
1503
1503
|
}],
|
|
1504
1504
|
/**
|
|
1505
1505
|
* Border Width Y
|
|
1506
1506
|
* @see https://tailwindcss.com/docs/border-width
|
|
1507
1507
|
*/
|
|
1508
1508
|
"border-w-y": [{
|
|
1509
|
-
"border-y":
|
|
1509
|
+
"border-y": Z()
|
|
1510
1510
|
}],
|
|
1511
1511
|
/**
|
|
1512
1512
|
* Border Width Start
|
|
1513
1513
|
* @see https://tailwindcss.com/docs/border-width
|
|
1514
1514
|
*/
|
|
1515
1515
|
"border-w-s": [{
|
|
1516
|
-
"border-s":
|
|
1516
|
+
"border-s": Z()
|
|
1517
1517
|
}],
|
|
1518
1518
|
/**
|
|
1519
1519
|
* Border Width End
|
|
1520
1520
|
* @see https://tailwindcss.com/docs/border-width
|
|
1521
1521
|
*/
|
|
1522
1522
|
"border-w-e": [{
|
|
1523
|
-
"border-e":
|
|
1523
|
+
"border-e": Z()
|
|
1524
1524
|
}],
|
|
1525
1525
|
/**
|
|
1526
1526
|
* Border Width Top
|
|
1527
1527
|
* @see https://tailwindcss.com/docs/border-width
|
|
1528
1528
|
*/
|
|
1529
1529
|
"border-w-t": [{
|
|
1530
|
-
"border-t":
|
|
1530
|
+
"border-t": Z()
|
|
1531
1531
|
}],
|
|
1532
1532
|
/**
|
|
1533
1533
|
* Border Width Right
|
|
1534
1534
|
* @see https://tailwindcss.com/docs/border-width
|
|
1535
1535
|
*/
|
|
1536
1536
|
"border-w-r": [{
|
|
1537
|
-
"border-r":
|
|
1537
|
+
"border-r": Z()
|
|
1538
1538
|
}],
|
|
1539
1539
|
/**
|
|
1540
1540
|
* Border Width Bottom
|
|
1541
1541
|
* @see https://tailwindcss.com/docs/border-width
|
|
1542
1542
|
*/
|
|
1543
1543
|
"border-w-b": [{
|
|
1544
|
-
"border-b":
|
|
1544
|
+
"border-b": Z()
|
|
1545
1545
|
}],
|
|
1546
1546
|
/**
|
|
1547
1547
|
* Border Width Left
|
|
1548
1548
|
* @see https://tailwindcss.com/docs/border-width
|
|
1549
1549
|
*/
|
|
1550
1550
|
"border-w-l": [{
|
|
1551
|
-
"border-l":
|
|
1551
|
+
"border-l": Z()
|
|
1552
1552
|
}],
|
|
1553
1553
|
/**
|
|
1554
1554
|
* Divide Width X
|
|
1555
1555
|
* @see https://tailwindcss.com/docs/border-width#between-children
|
|
1556
1556
|
*/
|
|
1557
1557
|
"divide-x": [{
|
|
1558
|
-
"divide-x":
|
|
1558
|
+
"divide-x": Z()
|
|
1559
1559
|
}],
|
|
1560
1560
|
/**
|
|
1561
1561
|
* Divide Width X Reverse
|
|
@@ -1567,7 +1567,7 @@ const Er = (n, e) => {
|
|
|
1567
1567
|
* @see https://tailwindcss.com/docs/border-width#between-children
|
|
1568
1568
|
*/
|
|
1569
1569
|
"divide-y": [{
|
|
1570
|
-
"divide-y":
|
|
1570
|
+
"divide-y": Z()
|
|
1571
1571
|
}],
|
|
1572
1572
|
/**
|
|
1573
1573
|
* Divide Width Y Reverse
|
|
@@ -1729,7 +1729,7 @@ const Er = (n, e) => {
|
|
|
1729
1729
|
* @see https://tailwindcss.com/docs/box-shadow#adding-a-ring
|
|
1730
1730
|
*/
|
|
1731
1731
|
"ring-w": [{
|
|
1732
|
-
ring:
|
|
1732
|
+
ring: Z()
|
|
1733
1733
|
}],
|
|
1734
1734
|
/**
|
|
1735
1735
|
* Ring Width Inset
|
|
@@ -1768,7 +1768,7 @@ const Er = (n, e) => {
|
|
|
1768
1768
|
* @see https://tailwindcss.com/docs/box-shadow#adding-an-inset-ring
|
|
1769
1769
|
*/
|
|
1770
1770
|
"inset-ring-w": [{
|
|
1771
|
-
"inset-ring":
|
|
1771
|
+
"inset-ring": Z()
|
|
1772
1772
|
}],
|
|
1773
1773
|
/**
|
|
1774
1774
|
* Inset Ring Color
|
|
@@ -4051,7 +4051,7 @@ function Ei() {
|
|
|
4051
4051
|
}
|
|
4052
4052
|
return v < B ? -1 : B < v ? 1 : 0;
|
|
4053
4053
|
};
|
|
4054
|
-
function
|
|
4054
|
+
function te(a, t, r, s, g) {
|
|
4055
4055
|
if (a.length === 0) return -1;
|
|
4056
4056
|
if (typeof r == "string" ? (s = r, r = 0) : r > 2147483647 ? r = 2147483647 : r < -2147483648 && (r = -2147483648), r = +r, lt(r) && (r = g ? 0 : a.length - 1), r < 0 && (r = a.length + r), r >= a.length) {
|
|
4057
4057
|
if (g) return -1;
|
|
@@ -4060,12 +4060,12 @@ function Ei() {
|
|
|
4060
4060
|
if (g) r = 0;
|
|
4061
4061
|
else return -1;
|
|
4062
4062
|
if (typeof t == "string" && (t = l.from(t, s)), l.isBuffer(t))
|
|
4063
|
-
return t.length === 0 ? -1 :
|
|
4063
|
+
return t.length === 0 ? -1 : Y(a, t, r, s, g);
|
|
4064
4064
|
if (typeof t == "number")
|
|
4065
|
-
return t = t & 255, typeof Uint8Array.prototype.indexOf == "function" ? g ? Uint8Array.prototype.indexOf.call(a, t, r) : Uint8Array.prototype.lastIndexOf.call(a, t, r) :
|
|
4065
|
+
return t = t & 255, typeof Uint8Array.prototype.indexOf == "function" ? g ? Uint8Array.prototype.indexOf.call(a, t, r) : Uint8Array.prototype.lastIndexOf.call(a, t, r) : Y(a, [t], r, s, g);
|
|
4066
4066
|
throw new TypeError("val must be string, number or Buffer");
|
|
4067
4067
|
}
|
|
4068
|
-
function
|
|
4068
|
+
function Y(a, t, r, s, g) {
|
|
4069
4069
|
let p = 1, v = a.length, B = t.length;
|
|
4070
4070
|
if (s !== void 0 && (s = String(s).toLowerCase(), s === "ucs2" || s === "ucs-2" || s === "utf16le" || s === "utf-16le")) {
|
|
4071
4071
|
if (a.length < 2 || t.length < 2)
|
|
@@ -4098,9 +4098,9 @@ function Ei() {
|
|
|
4098
4098
|
l.prototype.includes = function(t, r, s) {
|
|
4099
4099
|
return this.indexOf(t, r, s) !== -1;
|
|
4100
4100
|
}, l.prototype.indexOf = function(t, r, s) {
|
|
4101
|
-
return
|
|
4101
|
+
return te(this, t, r, s, !0);
|
|
4102
4102
|
}, l.prototype.lastIndexOf = function(t, r, s) {
|
|
4103
|
-
return
|
|
4103
|
+
return te(this, t, r, s, !1);
|
|
4104
4104
|
};
|
|
4105
4105
|
function T(a, t, r, s) {
|
|
4106
4106
|
r = Number(r) || 0;
|
|
@@ -4377,7 +4377,7 @@ function Ei() {
|
|
|
4377
4377
|
let v = Number(t >> BigInt(32) & BigInt(4294967295));
|
|
4378
4378
|
return a[r++] = v, v = v >> 8, a[r++] = v, v = v >> 8, a[r++] = v, v = v >> 8, a[r++] = v, r;
|
|
4379
4379
|
}
|
|
4380
|
-
function
|
|
4380
|
+
function Z(a, t, r, s, g) {
|
|
4381
4381
|
xe(t, s, g, a, r, 7);
|
|
4382
4382
|
let p = Number(t & BigInt(4294967295));
|
|
4383
4383
|
a[r + 7] = p, p = p >> 8, a[r + 6] = p, p = p >> 8, a[r + 5] = p, p = p >> 8, a[r + 4] = p;
|
|
@@ -4387,7 +4387,7 @@ function Ei() {
|
|
|
4387
4387
|
l.prototype.writeBigUInt64LE = _e(function(t, r = 0) {
|
|
4388
4388
|
return q(this, t, r, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
4389
4389
|
}), l.prototype.writeBigUInt64BE = _e(function(t, r = 0) {
|
|
4390
|
-
return
|
|
4390
|
+
return Z(this, t, r, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
4391
4391
|
}), l.prototype.writeIntLE = function(t, r, s, g) {
|
|
4392
4392
|
if (t = +t, r = r >>> 0, !g) {
|
|
4393
4393
|
const J = Math.pow(2, 8 * s - 1);
|
|
@@ -4419,7 +4419,7 @@ function Ei() {
|
|
|
4419
4419
|
}, l.prototype.writeBigInt64LE = _e(function(t, r = 0) {
|
|
4420
4420
|
return q(this, t, r, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
4421
4421
|
}), l.prototype.writeBigInt64BE = _e(function(t, r = 0) {
|
|
4422
|
-
return
|
|
4422
|
+
return Z(this, t, r, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
4423
4423
|
});
|
|
4424
4424
|
function Ae(a, t, r, s, g, p) {
|
|
4425
4425
|
if (r + s > a.length) throw new RangeError("Index out of range");
|
|
@@ -5965,7 +5965,7 @@ class mn {
|
|
|
5965
5965
|
startSession(e) {
|
|
5966
5966
|
return Oe(this, void 0, void 0, function* () {
|
|
5967
5967
|
var i, o, c, u, d, l, m, w, f, h, I, A;
|
|
5968
|
-
const y = this.personaConfig, x = this.buildStartSessionOptionsForClient(), _ = yield this.apiClient.startSession(y, x), { sessionId: M, clientConfig: P, engineHost: V, engineProtocol: H, signallingEndpoint: L } = _, { heartbeatIntervalSeconds:
|
|
5968
|
+
const y = this.personaConfig, x = this.buildStartSessionOptionsForClient(), _ = yield this.apiClient.startSession(y, x), { sessionId: M, clientConfig: P, engineHost: V, engineProtocol: H, signallingEndpoint: L } = _, { heartbeatIntervalSeconds: te, maxWsReconnectionAttempts: Y, iceServers: T } = P;
|
|
5969
5969
|
this.sessionId = M, Je({
|
|
5970
5970
|
sessionId: this.sessionId
|
|
5971
5971
|
});
|
|
@@ -5976,8 +5976,8 @@ class mn {
|
|
|
5976
5976
|
baseUrl: `${H}://${V}`
|
|
5977
5977
|
},
|
|
5978
5978
|
signalling: {
|
|
5979
|
-
heartbeatIntervalSeconds:
|
|
5980
|
-
maxWsReconnectionAttempts:
|
|
5979
|
+
heartbeatIntervalSeconds: te,
|
|
5980
|
+
maxWsReconnectionAttempts: Y,
|
|
5981
5981
|
url: {
|
|
5982
5982
|
baseUrl: V,
|
|
5983
5983
|
protocol: H,
|
|
@@ -6539,7 +6539,7 @@ class pe {
|
|
|
6539
6539
|
console.log("[AriaSessionManager] Initializing Anam client for preloading"), this.setStatus("preloading");
|
|
6540
6540
|
try {
|
|
6541
6541
|
this.createHiddenVideoElement();
|
|
6542
|
-
const { createClient: i } = await import("./index-
|
|
6542
|
+
const { createClient: i } = await import("./index-ydydPYp9.js"), o = i(e);
|
|
6543
6543
|
o.addListener(F.SESSION_READY, () => {
|
|
6544
6544
|
const u = o.getActiveSessionId();
|
|
6545
6545
|
u && (this.updateSessionState({ session_id: u }), console.log("[AriaSessionManager] Session ready with ID:", u)), this.setStatus("ready"), this.emit({ type: "session_ready", data: { sessionId: u } }), this.config.onSessionReady?.(), this.config.onSessionPreloaded?.();
|
|
@@ -6687,7 +6687,7 @@ class pe {
|
|
|
6687
6687
|
}
|
|
6688
6688
|
this.anamClient = null;
|
|
6689
6689
|
}
|
|
6690
|
-
this.audioInputStream && (this.audioInputStream.getTracks().forEach((e) => e.stop()), this.audioInputStream = null), this.videoStream = null, this.chatMessages = [], this.liveTranscript = "", this.lastMessageHistory = [];
|
|
6690
|
+
this.audioInputStream && (this.audioInputStream.getTracks().forEach((e) => e.stop()), this.audioInputStream = null), this.videoStream = null, this.chatMessages = [], this.liveTranscript = "", this.lastMessageHistory = [], this.resetSessionState(), this.setStatus("idle");
|
|
6691
6691
|
}
|
|
6692
6692
|
// ============================================================================
|
|
6693
6693
|
// Session Refresh
|
|
@@ -6894,7 +6894,7 @@ class pe {
|
|
|
6894
6894
|
}
|
|
6895
6895
|
}
|
|
6896
6896
|
const wn = ({ config: n, children: e }) => {
|
|
6897
|
-
const [i, o] = re(!1), [c, u] = re(!1), [d, l] = re(!1), [m, w] = re([]), [f, h] = re(""), [I, A] = re(!1), [y, x] = re(!1), [_, M] = re(null), [P, V] = re("user"), [H, L] = re("bottom-right"), [
|
|
6897
|
+
const [i, o] = re(!1), [c, u] = re(!1), [d, l] = re(!1), [m, w] = re([]), [f, h] = re(""), [I, A] = re(!1), [y, x] = re(!1), [_, M] = re(null), [P, V] = re("user"), [H, L] = re("bottom-right"), [te, Y] = re({
|
|
6898
6898
|
session_id: null,
|
|
6899
6899
|
token: null,
|
|
6900
6900
|
expires_at: null,
|
|
@@ -6902,39 +6902,39 @@ const wn = ({ config: n, children: e }) => {
|
|
|
6902
6902
|
lastError: null,
|
|
6903
6903
|
isPreloaded: !1,
|
|
6904
6904
|
isRefreshing: !1
|
|
6905
|
-
}), [T, ne] = re("idle"), [me, ye] = re(!1), Ce = n.theme || "light", N = Qe(null), ue = Qe(null), he = Qe(null), ae =
|
|
6905
|
+
}), [T, ne] = re("idle"), [me, ye] = re(!1), Ce = n.theme || "light", N = Qe(null), ue = Qe(null), he = Qe(null), ae = ee((S) => {
|
|
6906
6906
|
const { newStatus: U } = S.data;
|
|
6907
6907
|
ne(U), U === "preloading" || U === "connecting" ? i && l(!0) : U === "ready" ? (l(!1), u(!0)) : U === "error" && l(!1);
|
|
6908
|
-
}, [i]), le =
|
|
6908
|
+
}, [i]), le = ee((S) => {
|
|
6909
6909
|
if (console.log("[AriaProvider] Session ready event:", S.data), N.current) {
|
|
6910
6910
|
const U = N.current.getSessionState();
|
|
6911
|
-
|
|
6911
|
+
Y(U);
|
|
6912
6912
|
}
|
|
6913
6913
|
u(!0), l(!1), M(null);
|
|
6914
|
-
}, []), R =
|
|
6914
|
+
}, []), R = ee((S) => {
|
|
6915
6915
|
const U = S.error?.message || "Session error";
|
|
6916
6916
|
if (console.error("[AriaProvider] Session error:", U), M(U), l(!1), N.current) {
|
|
6917
6917
|
const ge = N.current.getSessionState();
|
|
6918
|
-
|
|
6918
|
+
Y(ge);
|
|
6919
6919
|
}
|
|
6920
|
-
}, []), Ie =
|
|
6920
|
+
}, []), Ie = ee((S) => {
|
|
6921
6921
|
const { connected: U } = S.data;
|
|
6922
6922
|
if (u(U), !U && N.current) {
|
|
6923
6923
|
const ge = N.current.getSessionState();
|
|
6924
|
-
|
|
6924
|
+
Y(ge);
|
|
6925
6925
|
}
|
|
6926
|
-
}, []), Re =
|
|
6926
|
+
}, []), Re = ee((S) => {
|
|
6927
6927
|
const { messages: U } = S.data;
|
|
6928
6928
|
U && w(U);
|
|
6929
|
-
}, []), j =
|
|
6929
|
+
}, []), j = ee((S) => {
|
|
6930
6930
|
const { liveTranscript: U } = S.data;
|
|
6931
6931
|
U !== void 0 && h(U);
|
|
6932
|
-
}, []), Q =
|
|
6932
|
+
}, []), Q = ee((S) => {
|
|
6933
6933
|
console.log("[AriaProvider] WebSocket trigger event:", S.data), he.current?.("websocket");
|
|
6934
6934
|
}, []);
|
|
6935
6935
|
He(() => {
|
|
6936
6936
|
const S = pe.getInstance(n);
|
|
6937
|
-
return N.current = S, S.addEventListener("status_change", ae), S.addEventListener("session_ready", le), S.addEventListener("session_error", R), S.addEventListener("connection_change", Ie), S.addEventListener("message_history", Re), S.addEventListener("message_stream", j), S.setWebSocketTriggerCallback(Q),
|
|
6937
|
+
return N.current = S, S.addEventListener("status_change", ae), S.addEventListener("session_ready", le), S.addEventListener("session_error", R), S.addEventListener("connection_change", Ie), S.addEventListener("message_history", Re), S.addEventListener("message_stream", j), S.setWebSocketTriggerCallback(Q), Y(S.getSessionState()), ne(S.getStatus()), u(S.isConnected()), w(S.getChatMessages()), h(S.getLiveTranscript()), x(S.isMuted()), ye(S.isSessionPaused()), !S.isConnected() && S.getStatus() === "idle" && S.connect(), () => {
|
|
6938
6938
|
S.removeEventListener("status_change", ae), S.removeEventListener("session_ready", le), S.removeEventListener("session_error", R), S.removeEventListener("connection_change", Ie), S.removeEventListener("message_history", Re), S.removeEventListener("message_stream", j), S.setWebSocketTriggerCallback(null);
|
|
6939
6939
|
};
|
|
6940
6940
|
}, [
|
|
@@ -6947,36 +6947,36 @@ const wn = ({ config: n, children: e }) => {
|
|
|
6947
6947
|
j,
|
|
6948
6948
|
Q
|
|
6949
6949
|
]);
|
|
6950
|
-
const q =
|
|
6950
|
+
const q = ee((S) => {
|
|
6951
6951
|
ue.current = S, S && N.current ? N.current.attachToVideoElement(S) : !S && ue.current && N.current && N.current.detachFromVideoElement(ue.current);
|
|
6952
|
-
}, []),
|
|
6952
|
+
}, []), Z = ee((S) => {
|
|
6953
6953
|
if (!N.current) {
|
|
6954
6954
|
console.error("[AriaProvider] Session manager not initialized");
|
|
6955
6955
|
return;
|
|
6956
6956
|
}
|
|
6957
6957
|
const U = S?.userTrigger ?? !0;
|
|
6958
6958
|
N.current.triggerSession(U);
|
|
6959
|
-
}, []), Ae =
|
|
6959
|
+
}, []), Ae = ee(async () => {
|
|
6960
6960
|
N.current && (N.current.isConnected() || N.current.connect());
|
|
6961
|
-
}, []), Ue =
|
|
6961
|
+
}, []), Ue = ee(async () => {
|
|
6962
6962
|
if (N.current)
|
|
6963
6963
|
try {
|
|
6964
6964
|
await N.current.forceEndSession(), u(!1), w([]), h("");
|
|
6965
6965
|
const S = N.current.getSessionState();
|
|
6966
|
-
|
|
6966
|
+
Y(S);
|
|
6967
6967
|
} catch (S) {
|
|
6968
6968
|
const U = S instanceof Error ? S.message : "Failed to stop session";
|
|
6969
6969
|
M(U), n.onError?.(S instanceof Error ? S : new Error(U));
|
|
6970
6970
|
}
|
|
6971
|
-
}, [n]), z =
|
|
6971
|
+
}, [n]), z = ee(async () => {
|
|
6972
6972
|
N.current && await N.current.refreshSession();
|
|
6973
|
-
}, []), ce =
|
|
6973
|
+
}, []), ce = ee((S = "user") => {
|
|
6974
6974
|
if (V(S), L(S === "websocket" ? "center" : "bottom-right"), o(!0), M(null), !N.current) return;
|
|
6975
6975
|
if (N.current.isSessionPaused()) {
|
|
6976
6976
|
console.log("[AriaProvider] Resuming paused session"), l(!0), N.current.resumeSession().then(() => {
|
|
6977
6977
|
l(!1), u(!0), ye(!1);
|
|
6978
6978
|
const Ve = N.current.getSessionState();
|
|
6979
|
-
|
|
6979
|
+
Y(Ve), w(N.current.getChatMessages());
|
|
6980
6980
|
}).catch((Ve) => {
|
|
6981
6981
|
console.error("[AriaProvider] Failed to resume session:", Ve), l(!1), ye(!1), M(Ve instanceof Error ? Ve.message : "Failed to resume session");
|
|
6982
6982
|
});
|
|
@@ -6988,11 +6988,19 @@ const wn = ({ config: n, children: e }) => {
|
|
|
6988
6988
|
He(() => {
|
|
6989
6989
|
he.current = ce;
|
|
6990
6990
|
}, [ce]);
|
|
6991
|
-
const we =
|
|
6992
|
-
o(!1), N.current && (ue.current && N.current.detachFromVideoElement(ue.current), h(""), N.current.clearLiveTranscript(), N.current.isPersistSessionEnabled() ? (console.log("[AriaProvider] Pausing session (persistSession: true)"), N.current.pauseSession(), ye(!0)) : (console.log("[AriaProvider] Ending session (persistSession: false)"), N.current.sendSessionEnd(), N.current.stopStreaming(),
|
|
6993
|
-
|
|
6991
|
+
const we = ee(() => {
|
|
6992
|
+
o(!1), N.current && (ue.current && N.current.detachFromVideoElement(ue.current), h(""), N.current.clearLiveTranscript(), N.current.isPersistSessionEnabled() ? (console.log("[AriaProvider] Pausing session (persistSession: true)"), N.current.pauseSession(), ye(!0)) : (console.log("[AriaProvider] Ending session (persistSession: false)"), N.current.sendSessionEnd(), N.current.stopStreaming(), Y({
|
|
6993
|
+
session_id: null,
|
|
6994
|
+
token: null,
|
|
6995
|
+
expires_at: null,
|
|
6996
|
+
isSessionReady: !1,
|
|
6997
|
+
lastError: null,
|
|
6998
|
+
isPreloaded: !1,
|
|
6999
|
+
isRefreshing: !1
|
|
7000
|
+
}), u(!1), w([])));
|
|
7001
|
+
}, []), Ee = ee(() => {
|
|
6994
7002
|
A((S) => !S);
|
|
6995
|
-
}, []), Le =
|
|
7003
|
+
}, []), Le = ee(async (S) => {
|
|
6996
7004
|
if (!N.current || !c)
|
|
6997
7005
|
throw new Error("Not connected to Aria");
|
|
6998
7006
|
try {
|
|
@@ -7001,11 +7009,11 @@ const wn = ({ config: n, children: e }) => {
|
|
|
7001
7009
|
const ge = U instanceof Error ? U.message : "Failed to send message";
|
|
7002
7010
|
throw M(ge), n.onError?.(U instanceof Error ? U : new Error(ge)), U;
|
|
7003
7011
|
}
|
|
7004
|
-
}, [c, n]), xe =
|
|
7012
|
+
}, [c, n]), xe = ee(() => {
|
|
7005
7013
|
if (!N.current) return;
|
|
7006
7014
|
const S = N.current.toggleMute();
|
|
7007
7015
|
x(S);
|
|
7008
|
-
}, []), Te =
|
|
7016
|
+
}, []), Te = ee(() => te.session_id, [te.session_id]), Fe = {
|
|
7009
7017
|
// UI State
|
|
7010
7018
|
isOpen: i,
|
|
7011
7019
|
isConnected: c,
|
|
@@ -7016,9 +7024,9 @@ const wn = ({ config: n, children: e }) => {
|
|
|
7016
7024
|
isMuted: y,
|
|
7017
7025
|
error: _,
|
|
7018
7026
|
// Session State
|
|
7019
|
-
sessionState:
|
|
7027
|
+
sessionState: te,
|
|
7020
7028
|
sessionManagerStatus: T,
|
|
7021
|
-
isSessionPreloaded:
|
|
7029
|
+
isSessionPreloaded: te.isPreloaded && T === "ready",
|
|
7022
7030
|
isSessionPaused: me,
|
|
7023
7031
|
// Actions
|
|
7024
7032
|
openAssistant: ce,
|
|
@@ -7028,7 +7036,7 @@ const wn = ({ config: n, children: e }) => {
|
|
|
7028
7036
|
toggleMute: xe,
|
|
7029
7037
|
startSession: Ae,
|
|
7030
7038
|
stopSession: Ue,
|
|
7031
|
-
triggerSession:
|
|
7039
|
+
triggerSession: Z,
|
|
7032
7040
|
refreshSession: z,
|
|
7033
7041
|
setVideoElement: q,
|
|
7034
7042
|
// Display State
|
|
@@ -7225,4 +7233,4 @@ export {
|
|
|
7225
7233
|
nn as y,
|
|
7226
7234
|
on as z
|
|
7227
7235
|
};
|
|
7228
|
-
//# sourceMappingURL=index-
|
|
7236
|
+
//# sourceMappingURL=index-D__agxtJ.js.map
|