@centive/aria-sdk 0.7.2 → 0.7.3
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 +66 -81
- package/dist/index.js.map +1 -1
- package/dist/lib/AriaSessionManager.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as a, jsxs as y, Fragment as Ie } from "react/jsx-runtime";
|
|
2
2
|
import * as ce from "react";
|
|
3
3
|
import { createContext as Ir, useContext as Pr, useState as T, useRef as le, useEffect as re, useCallback as M, useMemo as Oe } from "react";
|
|
4
|
-
import { CheckCircle2 as $e, AlertCircle as Le, Zap as er, RefreshCw as We, Clock as Dr, MessageCircle as gr, Sparkles as Ge, User as Vr, Bot as Wr, Send as jr, Wrench as rr, MicOff as tr, Mic as or, Maximize2 as
|
|
4
|
+
import { CheckCircle2 as $e, AlertCircle as Le, Zap as er, RefreshCw as We, Clock as Dr, MessageCircle as gr, Sparkles as Ge, User as Vr, Bot as Wr, Send as jr, Wrench as rr, MicOff as tr, Mic as or, Maximize2 as Br, Phone as ar, X as Qe, Minimize2 as Fr } from "lucide-react";
|
|
5
5
|
import { createPortal as Hr } from "react-dom";
|
|
6
6
|
function Or(r) {
|
|
7
7
|
return typeof r == "object" && r !== null && "status" in r && (r.status === "success" || r.status === "error") && !("type" in r);
|
|
@@ -571,7 +571,7 @@ class Q {
|
|
|
571
571
|
console.warn("[AriaSessionManager] Video play failed:", i);
|
|
572
572
|
});
|
|
573
573
|
} else
|
|
574
|
-
console.
|
|
574
|
+
console.log("[AriaSessionManager] No video stream available to attach (session may be initializing)");
|
|
575
575
|
}
|
|
576
576
|
/**
|
|
577
577
|
* Detach video stream from visible element (when widget closes)
|
|
@@ -775,13 +775,7 @@ class Q {
|
|
|
775
775
|
console.log("[AriaSessionManager] No active Anam client, nothing to pause");
|
|
776
776
|
return;
|
|
777
777
|
}
|
|
778
|
-
|
|
779
|
-
try {
|
|
780
|
-
this.anamClient.muteInputAudio();
|
|
781
|
-
} catch (e) {
|
|
782
|
-
console.warn("[AriaSessionManager] Failed to mute input audio:", e);
|
|
783
|
-
}
|
|
784
|
-
this.shouldKeepWebSocketAlive() || (console.log("[AriaSessionManager] Disconnecting WebSocket (keepWebSocketAlive: false)"), this.ws && (this.ws.close(), this.ws = null)), this.config.onSessionPaused?.();
|
|
778
|
+
console.log("[AriaSessionManager] Pausing session - keeping Anam client alive"), this.isPaused = !0, this.hiddenVideoElement && (this.hiddenVideoElement.muted = !0), this.shouldKeepWebSocketAlive() || (console.log("[AriaSessionManager] Disconnecting WebSocket (keepWebSocketAlive: false)"), this.ws && (this.ws.close(), this.ws = null)), this.config.onSessionPaused?.();
|
|
785
779
|
}
|
|
786
780
|
/**
|
|
787
781
|
* Resume the session (called when widget reopens)
|
|
@@ -796,23 +790,14 @@ class Q {
|
|
|
796
790
|
if (console.log("[AriaSessionManager] Resuming session"), this.isPaused = !1, !this.anamClient)
|
|
797
791
|
return console.log("[AriaSessionManager] No Anam client, cannot resume - will create new session"), !1;
|
|
798
792
|
if (this.sessionState.expires_at) {
|
|
799
|
-
const
|
|
800
|
-
if (Date.now() >=
|
|
793
|
+
const o = new Date(this.sessionState.expires_at).getTime();
|
|
794
|
+
if (Date.now() >= o)
|
|
801
795
|
return console.log("[AriaSessionManager] Session expired, will create new session"), await this.stopStreaming(), this.resetSessionState(), !1;
|
|
802
796
|
}
|
|
803
|
-
if (this.videoStream)
|
|
804
|
-
if (!this.videoStream.getTracks().some((o) => o.readyState === "live"))
|
|
805
|
-
return console.log("[AriaSessionManager] Video stream tracks are dead, will create new session"), await this.stopStreaming(), this.resetSessionState(), !1;
|
|
806
|
-
console.log("[AriaSessionManager] Video stream is still active");
|
|
807
|
-
} else
|
|
797
|
+
if (!this.videoStream)
|
|
808
798
|
return console.log("[AriaSessionManager] No video stream available, will create new session"), await this.stopStreaming(), this.resetSessionState(), !1;
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
this.anamClient.unmuteInputAudio(), console.log("[AriaSessionManager] Unmuted input audio");
|
|
812
|
-
} catch (e) {
|
|
813
|
-
console.warn("[AriaSessionManager] Failed to unmute input audio:", e);
|
|
814
|
-
}
|
|
815
|
-
return this.isConnected() || (console.log("[AriaSessionManager] Reconnecting WebSocket for resumed session"), this.reconnectForResume()), this.setStatus("ready"), this.config.onSessionResumed?.(), !0;
|
|
799
|
+
const e = this.videoStream.getTracks(), t = e.filter((o) => o.readyState === "live");
|
|
800
|
+
return console.log("[AriaSessionManager] Video stream tracks:", e.length, "active:", t.length), this.hiddenVideoElement && (this.hiddenVideoElement.muted = !1, console.log("[AriaSessionManager] Unmuted hidden video element")), this.isConnected() || (console.log("[AriaSessionManager] Reconnecting WebSocket for resumed session"), this.reconnectForResume()), this.setStatus("ready"), this.config.onSessionResumed?.(), !0;
|
|
816
801
|
}
|
|
817
802
|
/**
|
|
818
803
|
* Reconnect WebSocket for session resume (without triggering new session)
|
|
@@ -1393,26 +1378,26 @@ const Xr = (r, e) => {
|
|
|
1393
1378
|
d = f + (d.length > 0 ? " " + d : d);
|
|
1394
1379
|
continue;
|
|
1395
1380
|
}
|
|
1396
|
-
let j = !!I,
|
|
1397
|
-
if (!
|
|
1381
|
+
let j = !!I, B = o(j ? x.substring(0, I) : x);
|
|
1382
|
+
if (!B) {
|
|
1398
1383
|
if (!j) {
|
|
1399
1384
|
d = f + (d.length > 0 ? " " + d : d);
|
|
1400
1385
|
continue;
|
|
1401
1386
|
}
|
|
1402
|
-
if (
|
|
1387
|
+
if (B = o(x), !B) {
|
|
1403
1388
|
d = f + (d.length > 0 ? " " + d : d);
|
|
1404
1389
|
continue;
|
|
1405
1390
|
}
|
|
1406
1391
|
j = !1;
|
|
1407
1392
|
}
|
|
1408
|
-
const L = R.length === 0 ? "" : R.length === 1 ? R[0] : l(R).join(":"), P = V ? L + qe : L, h = P +
|
|
1393
|
+
const L = R.length === 0 ? "" : R.length === 1 ? R[0] : l(R).join(":"), P = V ? L + qe : L, h = P + B;
|
|
1409
1394
|
if (n.indexOf(h) > -1)
|
|
1410
1395
|
continue;
|
|
1411
1396
|
n.push(h);
|
|
1412
|
-
const _ = i(
|
|
1397
|
+
const _ = i(B, j);
|
|
1413
1398
|
for (let J = 0; J < _.length; ++J) {
|
|
1414
|
-
const
|
|
1415
|
-
n.push(P +
|
|
1399
|
+
const F = _[J];
|
|
1400
|
+
n.push(P + F);
|
|
1416
1401
|
}
|
|
1417
1402
|
d = f + (d.length > 0 ? " " + d : d);
|
|
1418
1403
|
}
|
|
@@ -1457,7 +1442,7 @@ const Xr = (r, e) => {
|
|
|
1457
1442
|
const o = vr.exec(r);
|
|
1458
1443
|
return o ? o[1] ? e(o[1]) : t : !1;
|
|
1459
1444
|
}, xr = (r) => r === "position" || r === "percentage", Ar = (r) => r === "image" || r === "url", kr = (r) => r === "length" || r === "size" || r === "bg-size", Sr = (r) => r === "length", Dt = (r) => r === "number", Vt = (r) => r === "family-name", Er = (r) => r === "shadow", Wt = () => {
|
|
1460
|
-
const r = O("color"), e = O("font"), t = O("text"), o = O("font-weight"), i = O("tracking"), l = O("leading"), n = O("breakpoint"), c = O("container"), d = O("spacing"), g = O("radius"), f = O("shadow"), E = O("inset-shadow"), R = O("text-shadow"), V = O("drop-shadow"), x = O("blur"), I = O("perspective"), j = O("aspect"),
|
|
1445
|
+
const r = O("color"), e = O("font"), t = O("text"), o = O("font-weight"), i = O("tracking"), l = O("leading"), n = O("breakpoint"), c = O("container"), d = O("spacing"), g = O("radius"), f = O("shadow"), E = O("inset-shadow"), R = O("text-shadow"), V = O("drop-shadow"), x = O("blur"), I = O("perspective"), j = O("aspect"), B = O("ease"), L = O("animate"), P = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], h = () => [
|
|
1461
1446
|
"center",
|
|
1462
1447
|
"top",
|
|
1463
1448
|
"bottom",
|
|
@@ -1475,7 +1460,7 @@ const Xr = (r, e) => {
|
|
|
1475
1460
|
"bottom-left",
|
|
1476
1461
|
// Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
|
|
1477
1462
|
"left-bottom"
|
|
1478
|
-
], _ = () => [...h(), m, p], J = () => ["auto", "hidden", "clip", "visible", "scroll"],
|
|
1463
|
+
], _ = () => [...h(), m, p], J = () => ["auto", "hidden", "clip", "visible", "scroll"], F = () => ["auto", "contain", "none"], k = () => [m, p, d], q = () => [ke, "full", "auto", ...k()], oe = () => [we, "none", "subgrid", m, p], X = () => ["auto", {
|
|
1479
1464
|
span: ["full", we, m, p]
|
|
1480
1465
|
}, we, m, p], G = () => [we, "auto", m, p], pe = () => ["auto", "min", "max", "fr", m, p], ae = () => ["start", "end", "center", "between", "around", "evenly", "stretch", "baseline", "center-safe", "end-safe"], A = () => ["start", "end", "center", "stretch", "center-safe", "end-safe"], U = () => ["auto", ...k()], w = () => [ke, "auto", "full", "dvw", "dvh", "lvw", "lvh", "svw", "svh", "min", "max", "fit", ...k()], v = () => [r, m, p], de = () => [...h(), dr, cr, {
|
|
1481
1466
|
position: [m, p]
|
|
@@ -1650,21 +1635,21 @@ const Xr = (r, e) => {
|
|
|
1650
1635
|
* @see https://tailwindcss.com/docs/overscroll-behavior
|
|
1651
1636
|
*/
|
|
1652
1637
|
overscroll: [{
|
|
1653
|
-
overscroll:
|
|
1638
|
+
overscroll: F()
|
|
1654
1639
|
}],
|
|
1655
1640
|
/**
|
|
1656
1641
|
* Overscroll Behavior X
|
|
1657
1642
|
* @see https://tailwindcss.com/docs/overscroll-behavior
|
|
1658
1643
|
*/
|
|
1659
1644
|
"overscroll-x": [{
|
|
1660
|
-
"overscroll-x":
|
|
1645
|
+
"overscroll-x": F()
|
|
1661
1646
|
}],
|
|
1662
1647
|
/**
|
|
1663
1648
|
* Overscroll Behavior Y
|
|
1664
1649
|
* @see https://tailwindcss.com/docs/overscroll-behavior
|
|
1665
1650
|
*/
|
|
1666
1651
|
"overscroll-y": [{
|
|
1667
|
-
"overscroll-y":
|
|
1652
|
+
"overscroll-y": F()
|
|
1668
1653
|
}],
|
|
1669
1654
|
/**
|
|
1670
1655
|
* Position
|
|
@@ -3400,7 +3385,7 @@ const Xr = (r, e) => {
|
|
|
3400
3385
|
* @see https://tailwindcss.com/docs/transition-timing-function
|
|
3401
3386
|
*/
|
|
3402
3387
|
ease: [{
|
|
3403
|
-
ease: ["linear", "initial",
|
|
3388
|
+
ease: ["linear", "initial", B, m, p]
|
|
3404
3389
|
}],
|
|
3405
3390
|
/**
|
|
3406
3391
|
* Transition Delay
|
|
@@ -3930,7 +3915,7 @@ const Xr = (r, e) => {
|
|
|
3930
3915
|
function s(...r) {
|
|
3931
3916
|
return jt(Jr(r));
|
|
3932
3917
|
}
|
|
3933
|
-
const
|
|
3918
|
+
const Be = ce.forwardRef(
|
|
3934
3919
|
({ className: r, variant: e = "default", size: t = "default", ...o }, i) => {
|
|
3935
3920
|
const l = s(
|
|
3936
3921
|
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-xl text-sm font-medium",
|
|
@@ -3982,7 +3967,7 @@ const Fe = ce.forwardRef(
|
|
|
3982
3967
|
);
|
|
3983
3968
|
}
|
|
3984
3969
|
);
|
|
3985
|
-
|
|
3970
|
+
Be.displayName = "Button";
|
|
3986
3971
|
const Mr = ce.forwardRef(
|
|
3987
3972
|
({ className: r, type: e, ...t }, o) => /* @__PURE__ */ a(
|
|
3988
3973
|
"input",
|
|
@@ -4052,7 +4037,7 @@ const Cr = ce.forwardRef(({ className: r, ...e }, t) => /* @__PURE__ */ a(
|
|
|
4052
4037
|
}
|
|
4053
4038
|
));
|
|
4054
4039
|
Cr.displayName = "Card";
|
|
4055
|
-
const
|
|
4040
|
+
const Bt = ce.forwardRef(({ className: r, ...e }, t) => /* @__PURE__ */ a(
|
|
4056
4041
|
"div",
|
|
4057
4042
|
{
|
|
4058
4043
|
ref: t,
|
|
@@ -4060,8 +4045,8 @@ const Ft = ce.forwardRef(({ className: r, ...e }, t) => /* @__PURE__ */ a(
|
|
|
4060
4045
|
...e
|
|
4061
4046
|
}
|
|
4062
4047
|
));
|
|
4063
|
-
|
|
4064
|
-
const
|
|
4048
|
+
Bt.displayName = "CardHeader";
|
|
4049
|
+
const Ft = ce.forwardRef(({ className: r, ...e }, t) => /* @__PURE__ */ a(
|
|
4065
4050
|
"h3",
|
|
4066
4051
|
{
|
|
4067
4052
|
ref: t,
|
|
@@ -4072,7 +4057,7 @@ const Bt = ce.forwardRef(({ className: r, ...e }, t) => /* @__PURE__ */ a(
|
|
|
4072
4057
|
...e
|
|
4073
4058
|
}
|
|
4074
4059
|
));
|
|
4075
|
-
|
|
4060
|
+
Ft.displayName = "CardTitle";
|
|
4076
4061
|
const Ht = ce.forwardRef(({ className: r, ...e }, t) => /* @__PURE__ */ a(
|
|
4077
4062
|
"p",
|
|
4078
4063
|
{
|
|
@@ -4117,7 +4102,7 @@ const _t = ({ compact: r = !1 }) => {
|
|
|
4117
4102
|
"Ready"
|
|
4118
4103
|
] }),
|
|
4119
4104
|
!e.isSessionReady && /* @__PURE__ */ y(
|
|
4120
|
-
|
|
4105
|
+
Be,
|
|
4121
4106
|
{
|
|
4122
4107
|
variant: "outline",
|
|
4123
4108
|
size: "sm",
|
|
@@ -4200,7 +4185,7 @@ const _t = ({ compact: r = !1 }) => {
|
|
|
4200
4185
|
] })
|
|
4201
4186
|
] }),
|
|
4202
4187
|
!e.isSessionReady && /* @__PURE__ */ y(
|
|
4203
|
-
|
|
4188
|
+
Be,
|
|
4204
4189
|
{
|
|
4205
4190
|
variant: "outline",
|
|
4206
4191
|
size: "sm",
|
|
@@ -4358,7 +4343,7 @@ const _t = ({ compact: r = !1 }) => {
|
|
|
4358
4343
|
}
|
|
4359
4344
|
),
|
|
4360
4345
|
/* @__PURE__ */ a(
|
|
4361
|
-
|
|
4346
|
+
Be,
|
|
4362
4347
|
{
|
|
4363
4348
|
onClick: E,
|
|
4364
4349
|
disabled: !t || !i.trim() || n,
|
|
@@ -4389,7 +4374,7 @@ const _t = ({ compact: r = !1 }) => {
|
|
|
4389
4374
|
refreshSession: x,
|
|
4390
4375
|
minimizeAssistant: I,
|
|
4391
4376
|
maximizeAssistant: j,
|
|
4392
|
-
toolCallState:
|
|
4377
|
+
toolCallState: B
|
|
4393
4378
|
} = Ee(), L = le(null), P = le(null);
|
|
4394
4379
|
re(() => {
|
|
4395
4380
|
P.current && (P.current.scrollTop = P.current.scrollHeight);
|
|
@@ -4427,7 +4412,7 @@ const _t = ({ compact: r = !1 }) => {
|
|
|
4427
4412
|
className: "w-full h-full object-cover"
|
|
4428
4413
|
}
|
|
4429
4414
|
),
|
|
4430
|
-
|
|
4415
|
+
B.isActive && t && /* @__PURE__ */ y(
|
|
4431
4416
|
"div",
|
|
4432
4417
|
{
|
|
4433
4418
|
className: s(
|
|
@@ -4448,7 +4433,7 @@ const _t = ({ compact: r = !1 }) => {
|
|
|
4448
4433
|
/* @__PURE__ */ a("span", { className: s(
|
|
4449
4434
|
"text-[10px] font-semibold",
|
|
4450
4435
|
h ? "text-amber-200" : "text-amber-800"
|
|
4451
|
-
), children:
|
|
4436
|
+
), children: B.toolName ? B.toolName.replace(/_/g, " ") : "Processing..." })
|
|
4452
4437
|
]
|
|
4453
4438
|
}
|
|
4454
4439
|
),
|
|
@@ -4486,7 +4471,7 @@ const _t = ({ compact: r = !1 }) => {
|
|
|
4486
4471
|
h ? "bg-indigo-600 hover:bg-indigo-700 text-white" : "bg-indigo-500 hover:bg-indigo-600 text-white"
|
|
4487
4472
|
),
|
|
4488
4473
|
title: "Maximize",
|
|
4489
|
-
children: /* @__PURE__ */ a(
|
|
4474
|
+
children: /* @__PURE__ */ a(Br, { className: "h-3.5 w-3.5" })
|
|
4490
4475
|
}
|
|
4491
4476
|
),
|
|
4492
4477
|
/* @__PURE__ */ a(
|
|
@@ -4522,8 +4507,8 @@ const _t = ({ compact: r = !1 }) => {
|
|
|
4522
4507
|
src: Ke,
|
|
4523
4508
|
alt: "Aria",
|
|
4524
4509
|
className: "w-full h-full object-cover",
|
|
4525
|
-
onError: (
|
|
4526
|
-
|
|
4510
|
+
onError: (F) => {
|
|
4511
|
+
F.currentTarget.style.display = "none";
|
|
4527
4512
|
}
|
|
4528
4513
|
}
|
|
4529
4514
|
) })
|
|
@@ -4634,8 +4619,8 @@ const _t = ({ compact: r = !1 }) => {
|
|
|
4634
4619
|
src: Ke,
|
|
4635
4620
|
alt: "Aria",
|
|
4636
4621
|
className: "w-full h-full object-cover",
|
|
4637
|
-
onError: (
|
|
4638
|
-
|
|
4622
|
+
onError: (F) => {
|
|
4623
|
+
F.currentTarget.style.display = "none";
|
|
4639
4624
|
}
|
|
4640
4625
|
}
|
|
4641
4626
|
) })
|
|
@@ -4644,7 +4629,7 @@ const _t = ({ compact: r = !1 }) => {
|
|
|
4644
4629
|
"text-2xl font-bold tracking-tight mb-2",
|
|
4645
4630
|
h ? "text-white" : "text-gray-900"
|
|
4646
4631
|
), children: "Aria is joining..." }),
|
|
4647
|
-
/* @__PURE__ */ a("div", { className: "flex items-center gap-1.5 mb-6", children: [0, 1, 2].map((
|
|
4632
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-1.5 mb-6", children: [0, 1, 2].map((F) => /* @__PURE__ */ a(
|
|
4648
4633
|
"div",
|
|
4649
4634
|
{
|
|
4650
4635
|
className: s(
|
|
@@ -4653,10 +4638,10 @@ const _t = ({ compact: r = !1 }) => {
|
|
|
4653
4638
|
),
|
|
4654
4639
|
style: {
|
|
4655
4640
|
animation: "aria-loading-bounce 1.4s ease-in-out infinite",
|
|
4656
|
-
animationDelay: `${
|
|
4641
|
+
animationDelay: `${F * 0.15}s`
|
|
4657
4642
|
}
|
|
4658
4643
|
},
|
|
4659
|
-
|
|
4644
|
+
F
|
|
4660
4645
|
)) }),
|
|
4661
4646
|
/* @__PURE__ */ a("p", { className: s(
|
|
4662
4647
|
"text-sm font-medium px-4 py-2 rounded-full",
|
|
@@ -4716,7 +4701,7 @@ const _t = ({ compact: r = !1 }) => {
|
|
|
4716
4701
|
className: "w-full h-full object-contain"
|
|
4717
4702
|
}
|
|
4718
4703
|
),
|
|
4719
|
-
|
|
4704
|
+
B.isActive && t && /* @__PURE__ */ y(
|
|
4720
4705
|
"div",
|
|
4721
4706
|
{
|
|
4722
4707
|
className: s(
|
|
@@ -4738,13 +4723,13 @@ const _t = ({ compact: r = !1 }) => {
|
|
|
4738
4723
|
/* @__PURE__ */ a("span", { className: s(
|
|
4739
4724
|
"text-xs font-semibold",
|
|
4740
4725
|
h ? "text-amber-200" : "text-amber-800"
|
|
4741
|
-
), children:
|
|
4726
|
+
), children: B.toolName ? `Running: ${B.toolName.replace(/_/g, " ")}` : "Processing..." }),
|
|
4742
4727
|
/* @__PURE__ */ a("span", { className: s(
|
|
4743
4728
|
"text-[10px]",
|
|
4744
4729
|
h ? "text-amber-400" : "text-amber-600"
|
|
4745
4730
|
), children: "Please wait..." })
|
|
4746
4731
|
] }),
|
|
4747
|
-
/* @__PURE__ */ a("div", { className: "flex items-center gap-0.5 ml-1", children: [0, 1, 2].map((
|
|
4732
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-0.5 ml-1", children: [0, 1, 2].map((F) => /* @__PURE__ */ a(
|
|
4748
4733
|
"div",
|
|
4749
4734
|
{
|
|
4750
4735
|
className: s(
|
|
@@ -4753,15 +4738,15 @@ const _t = ({ compact: r = !1 }) => {
|
|
|
4753
4738
|
),
|
|
4754
4739
|
style: {
|
|
4755
4740
|
animation: "aria-loading-bounce 1.4s ease-in-out infinite",
|
|
4756
|
-
animationDelay: `${
|
|
4741
|
+
animationDelay: `${F * 0.15}s`
|
|
4757
4742
|
}
|
|
4758
4743
|
},
|
|
4759
|
-
|
|
4744
|
+
F
|
|
4760
4745
|
)) })
|
|
4761
4746
|
]
|
|
4762
4747
|
}
|
|
4763
4748
|
),
|
|
4764
|
-
n && t && !
|
|
4749
|
+
n && t && !B.isActive && /* @__PURE__ */ a(
|
|
4765
4750
|
"div",
|
|
4766
4751
|
{
|
|
4767
4752
|
className: s(
|
|
@@ -4823,7 +4808,7 @@ const _t = ({ compact: r = !1 }) => {
|
|
|
4823
4808
|
h ? "bg-gray-800/80 hover:bg-gray-700 text-gray-300" : "bg-gray-100/80 hover:bg-gray-200 text-gray-600"
|
|
4824
4809
|
),
|
|
4825
4810
|
title: "Minimize",
|
|
4826
|
-
children: /* @__PURE__ */ a(
|
|
4811
|
+
children: /* @__PURE__ */ a(Fr, { className: "h-4 w-4" })
|
|
4827
4812
|
}
|
|
4828
4813
|
),
|
|
4829
4814
|
/* @__PURE__ */ a(
|
|
@@ -4847,7 +4832,7 @@ const _t = ({ compact: r = !1 }) => {
|
|
|
4847
4832
|
] })
|
|
4848
4833
|
}
|
|
4849
4834
|
);
|
|
4850
|
-
},
|
|
4835
|
+
}, Fe = ({
|
|
4851
4836
|
children: r,
|
|
4852
4837
|
styles: e = "",
|
|
4853
4838
|
className: t,
|
|
@@ -4899,7 +4884,7 @@ const so = Tr, Gt = ({
|
|
|
4899
4884
|
}) => {
|
|
4900
4885
|
const { openAssistant: l, isSessionPreloaded: n, sessionManagerStatus: c, config: d, isOpen: g, theme: f } = Ee(), E = r || d.triggerLabel || "Talk to Aria", R = f === "dark", V = n || c === "ready";
|
|
4901
4886
|
return g ? null : /* @__PURE__ */ a(
|
|
4902
|
-
|
|
4887
|
+
Fe,
|
|
4903
4888
|
{
|
|
4904
4889
|
styles: He(),
|
|
4905
4890
|
style: {
|
|
@@ -5011,7 +4996,7 @@ const so = Tr, Gt = ({
|
|
|
5011
4996
|
}
|
|
5012
4997
|
),
|
|
5013
4998
|
/* @__PURE__ */ a(
|
|
5014
|
-
|
|
4999
|
+
Fe,
|
|
5015
5000
|
{
|
|
5016
5001
|
styles: He(),
|
|
5017
5002
|
style: {
|
|
@@ -5027,7 +5012,7 @@ const so = Tr, Gt = ({
|
|
|
5027
5012
|
] })
|
|
5028
5013
|
] });
|
|
5029
5014
|
}, lo = ({ config: r, children: e }) => {
|
|
5030
|
-
const [t, o] = T(!1), [i, l] = T(!1), [n, c] = T(!1), [d, g] = T(!1), [f, E] = T([]), [R, V] = T(""), [x, I] = T(!1), [j,
|
|
5015
|
+
const [t, o] = T(!1), [i, l] = T(!1), [n, c] = T(!1), [d, g] = T(!1), [f, E] = T([]), [R, V] = T(""), [x, I] = T(!1), [j, B] = T(!1), [L, P] = T(null), [h, _] = T("user"), [J, F] = T("bottom-right"), [k, q] = T({
|
|
5031
5016
|
isActive: !1,
|
|
5032
5017
|
toolName: null,
|
|
5033
5018
|
toolData: null
|
|
@@ -5087,7 +5072,7 @@ const so = Tr, Gt = ({
|
|
|
5087
5072
|
}, []);
|
|
5088
5073
|
re(() => {
|
|
5089
5074
|
const u = Q.getInstance(r);
|
|
5090
|
-
w.current = u, u.addEventListener("status_change", ie), u.addEventListener("session_ready", te), u.addEventListener("session_error", W), u.addEventListener("connection_change", H), u.addEventListener("message_history", K), u.addEventListener("message_stream", ne), u.addEventListener("tool_call", se), u.setWebSocketTriggerCallback(D), X(u.getSessionState()), pe(u.getStatus()), c(u.isConnected()), E(u.getChatMessages()), V(u.getLiveTranscript()),
|
|
5075
|
+
w.current = u, u.addEventListener("status_change", ie), u.addEventListener("session_ready", te), u.addEventListener("session_error", W), u.addEventListener("connection_change", H), u.addEventListener("message_history", K), u.addEventListener("message_stream", ne), u.addEventListener("tool_call", se), u.setWebSocketTriggerCallback(D), X(u.getSessionState()), pe(u.getStatus()), c(u.isConnected()), E(u.getChatMessages()), V(u.getLiveTranscript()), B(u.isMuted()), A(u.isSessionPaused());
|
|
5091
5076
|
const S = u.getToolCallState();
|
|
5092
5077
|
return q(S), !u.isConnected() && u.getStatus() === "idle" && u.connect(), () => {
|
|
5093
5078
|
u.removeEventListener("status_change", ie), u.removeEventListener("session_ready", te), u.removeEventListener("session_error", W), u.removeEventListener("connection_change", H), u.removeEventListener("message_history", K), u.removeEventListener("message_stream", ne), u.removeEventListener("tool_call", se), u.setWebSocketTriggerCallback(null);
|
|
@@ -5130,7 +5115,7 @@ const so = Tr, Gt = ({
|
|
|
5130
5115
|
}, [r]), b = M(async () => {
|
|
5131
5116
|
w.current && await w.current.refreshSession();
|
|
5132
5117
|
}, []), N = M((u = "user") => {
|
|
5133
|
-
if (_(u),
|
|
5118
|
+
if (_(u), F(u === "websocket" ? "center" : "bottom-right"), o(!0), l(!1), P(null), !w.current) return;
|
|
5134
5119
|
const S = w.current.isSessionPaused();
|
|
5135
5120
|
if (console.log("[AriaProvider] openAssistant - isSessionPaused:", S, "persistSession:", r.persistSession), S) {
|
|
5136
5121
|
console.log("[AriaProvider] Resuming paused session"), g(!0), w.current.resumeSession().then((ee) => {
|
|
@@ -5183,7 +5168,7 @@ const so = Tr, Gt = ({
|
|
|
5183
5168
|
}, [n, r]), xe = M(() => {
|
|
5184
5169
|
if (!w.current) return;
|
|
5185
5170
|
const u = w.current.toggleMute();
|
|
5186
|
-
|
|
5171
|
+
B(u);
|
|
5187
5172
|
}, []), Rr = M(() => oe.session_id, [oe.session_id]), zr = {
|
|
5188
5173
|
// UI State
|
|
5189
5174
|
isOpen: t,
|
|
@@ -5287,13 +5272,13 @@ const so = Tr, Gt = ({
|
|
|
5287
5272
|
await d();
|
|
5288
5273
|
}, [d]), j = M((L = !0) => {
|
|
5289
5274
|
g({ userTrigger: L });
|
|
5290
|
-
}, [g]),
|
|
5275
|
+
}, [g]), B = Oe(() => ({
|
|
5291
5276
|
endSession: V,
|
|
5292
5277
|
refreshSession: x,
|
|
5293
5278
|
startSession: I,
|
|
5294
5279
|
triggerSession: j
|
|
5295
5280
|
}), [V, x, I, j]);
|
|
5296
|
-
return { session: R, actions:
|
|
5281
|
+
return { session: R, actions: B };
|
|
5297
5282
|
}, go = ({ open: r, onOpenChange: e, children: t }) => /* @__PURE__ */ a(Ie, { children: r && /* @__PURE__ */ y("div", { className: "fixed inset-0 z-50 flex items-center justify-center aria-animate-fade-in", children: [
|
|
5298
5283
|
/* @__PURE__ */ a(
|
|
5299
5284
|
"div",
|
|
@@ -5429,7 +5414,7 @@ const $t = ({
|
|
|
5429
5414
|
triggerLabel: e,
|
|
5430
5415
|
container: t
|
|
5431
5416
|
}) => {
|
|
5432
|
-
const [o, i] = T(!1), [l, n] = T(!1), [c, d] = T(!1), [g, f] = T(!1), [E, R] = T([]), [V, x] = T(""), [I, j] = T(!1), [
|
|
5417
|
+
const [o, i] = T(!1), [l, n] = T(!1), [c, d] = T(!1), [g, f] = T(!1), [E, R] = T([]), [V, x] = T(""), [I, j] = T(!1), [B, L] = T(!1), [P, h] = T(null), [_, J] = T("user"), [F, k] = T("bottom-right"), [q, oe] = T({
|
|
5433
5418
|
isActive: !1,
|
|
5434
5419
|
toolName: null,
|
|
5435
5420
|
toolData: null
|
|
@@ -5595,7 +5580,7 @@ const $t = ({
|
|
|
5595
5580
|
}
|
|
5596
5581
|
),
|
|
5597
5582
|
/* @__PURE__ */ a(
|
|
5598
|
-
|
|
5583
|
+
Fe,
|
|
5599
5584
|
{
|
|
5600
5585
|
styles: He(),
|
|
5601
5586
|
style: {
|
|
@@ -5611,14 +5596,14 @@ const $t = ({
|
|
|
5611
5596
|
isMinimized: l,
|
|
5612
5597
|
onMaximize: D,
|
|
5613
5598
|
theme: r,
|
|
5614
|
-
displayMode:
|
|
5599
|
+
displayMode: F,
|
|
5615
5600
|
triggerMode: _,
|
|
5616
5601
|
isConnected: c,
|
|
5617
5602
|
isLoading: g,
|
|
5618
5603
|
chatMessages: E,
|
|
5619
5604
|
liveTranscript: V,
|
|
5620
5605
|
isChatVisible: I,
|
|
5621
|
-
isMuted:
|
|
5606
|
+
isMuted: B,
|
|
5622
5607
|
error: P,
|
|
5623
5608
|
toolCallState: q,
|
|
5624
5609
|
sessionState: X,
|
|
@@ -5638,7 +5623,7 @@ const $t = ({
|
|
|
5638
5623
|
theme: t,
|
|
5639
5624
|
onClick: o
|
|
5640
5625
|
}) => /* @__PURE__ */ a(
|
|
5641
|
-
|
|
5626
|
+
Fe,
|
|
5642
5627
|
{
|
|
5643
5628
|
styles: He(),
|
|
5644
5629
|
style: {
|
|
@@ -5682,13 +5667,13 @@ export {
|
|
|
5682
5667
|
Gt as AriaTriggerButton,
|
|
5683
5668
|
Nr as AriaWidget,
|
|
5684
5669
|
Se as Badge,
|
|
5685
|
-
|
|
5670
|
+
Be as Button,
|
|
5686
5671
|
Cr as Card,
|
|
5687
5672
|
Ot as CardContent,
|
|
5688
5673
|
Ht as CardDescription,
|
|
5689
5674
|
Lt as CardFooter,
|
|
5690
|
-
|
|
5691
|
-
|
|
5675
|
+
Bt as CardHeader,
|
|
5676
|
+
Ft as CardTitle,
|
|
5692
5677
|
Ut as ChatPanel,
|
|
5693
5678
|
go as Dialog,
|
|
5694
5679
|
Xt as DialogClose,
|
|
@@ -5697,7 +5682,7 @@ export {
|
|
|
5697
5682
|
Jt as DialogTitle,
|
|
5698
5683
|
Mr as Input,
|
|
5699
5684
|
_t as SessionInfo,
|
|
5700
|
-
|
|
5685
|
+
Fe as ShadowContainer,
|
|
5701
5686
|
so as ariaStyles,
|
|
5702
5687
|
s as cn,
|
|
5703
5688
|
Xe as decodeJWT,
|