@voxket-ai/voxket-live 1.0.153 → 1.0.154
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/core/client.d.ts +9 -0
- package/dist/index.cjs +4 -4
- package/dist/index.js +107 -85
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var Yg = Object.defineProperty;
|
|
2
2
|
var Zg = (e, t, n) => t in e ? Yg(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
-
var
|
|
3
|
+
var ot = (e, t, n) => Zg(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import * as P from "react";
|
|
5
5
|
import Fe, { createContext as Tn, useRef as tn, useLayoutEffect as Xg, useEffect as Ct, useId as Ha, useContext as _t, useInsertionEffect as Cf, useMemo as Zt, useCallback as qe, Children as Qg, isValidElement as Jg, useState as we, Fragment as Tf, createElement as eb, forwardRef as tb, Component as nb } from "react";
|
|
6
6
|
import { jsx as m, Fragment as Nn, jsxs as A } from "react/jsx-runtime";
|
|
@@ -195,7 +195,7 @@ function Qf(e, t) {
|
|
|
195
195
|
s[Li[C]].cancel(E);
|
|
196
196
|
}, state: i, steps: s };
|
|
197
197
|
}
|
|
198
|
-
const { schedule:
|
|
198
|
+
const { schedule: at, cancel: $n, state: It, steps: is } = /* @__PURE__ */ Qf(typeof requestAnimationFrame < "u" ? requestAnimationFrame : nn, !0);
|
|
199
199
|
let ro;
|
|
200
200
|
function Mb() {
|
|
201
201
|
ro = void 0;
|
|
@@ -397,7 +397,7 @@ function sh(e, t, n) {
|
|
|
397
397
|
const ty = (e) => {
|
|
398
398
|
const t = ({ timestamp: n }) => e(n);
|
|
399
399
|
return {
|
|
400
|
-
start: (n = !0) =>
|
|
400
|
+
start: (n = !0) => at.update(t, n),
|
|
401
401
|
stop: () => $n(t),
|
|
402
402
|
/**
|
|
403
403
|
* If we're processing this frame we can use the
|
|
@@ -980,7 +980,7 @@ class ul {
|
|
|
980
980
|
this.state = "pending", this.isAsync = !1, this.needsMeasurement = !1, this.unresolvedKeyframes = [...t], this.onComplete = n, this.name = r, this.motionValue = i, this.element = o, this.isAsync = s;
|
|
981
981
|
}
|
|
982
982
|
scheduleResolve() {
|
|
983
|
-
this.state = "scheduled", this.isAsync ? (tr.add(this), fa || (fa = !0,
|
|
983
|
+
this.state = "scheduled", this.isAsync ? (tr.add(this), fa || (fa = !0, at.read(dh), at.resolveKeyframes(uh))) : (this.readKeyframes(), this.complete());
|
|
984
984
|
}
|
|
985
985
|
readKeyframes() {
|
|
986
986
|
const { unresolvedKeyframes: t, name: n, element: r, motionValue: i } = this;
|
|
@@ -1628,7 +1628,7 @@ class a0 {
|
|
|
1628
1628
|
this.events[t] || (this.events[t] = new Xa());
|
|
1629
1629
|
const r = this.events[t].add(n);
|
|
1630
1630
|
return t === "change" ? () => {
|
|
1631
|
-
r(),
|
|
1631
|
+
r(), at.read(() => {
|
|
1632
1632
|
this.events.change.getSize() || this.stop();
|
|
1633
1633
|
});
|
|
1634
1634
|
} : r;
|
|
@@ -2656,7 +2656,7 @@ class sx {
|
|
|
2656
2656
|
this.current && (this.triggerBuild(), this.renderInstance(this.current, this.renderState, this.props.style, this.projection));
|
|
2657
2657
|
}, this.renderScheduledAt = 0, this.scheduleRender = () => {
|
|
2658
2658
|
const f = Ut.now();
|
|
2659
|
-
this.renderScheduledAt < f && (this.renderScheduledAt = f,
|
|
2659
|
+
this.renderScheduledAt < f && (this.renderScheduledAt = f, at.render(this.render, !1, !0));
|
|
2660
2660
|
};
|
|
2661
2661
|
const { latestValues: l, renderState: c } = s;
|
|
2662
2662
|
this.latestValues = l, this.baseTarget = { ...l }, this.initialValues = n.initial ? { ...l } : {}, this.renderState = c, this.parent = t, this.props = n, this.presenceContext = r, this.depth = t ? t.depth + 1 : 0, this.reducedMotionConfig = i, this.options = a, this.blockInitialAnimation = !!o, this.isControllingVariants = Oo(n), this.isVariantNode = Mh(n), this.isVariantNode && (this.variantChildren = /* @__PURE__ */ new Set()), this.manuallyAnimateOnMount = !!(t && t.current);
|
|
@@ -2692,7 +2692,7 @@ class sx {
|
|
|
2692
2692
|
const r = $r.has(t);
|
|
2693
2693
|
r && this.onBindTransform && this.onBindTransform();
|
|
2694
2694
|
const i = n.on("change", (s) => {
|
|
2695
|
-
this.latestValues[t] = s, this.props.onUpdate &&
|
|
2695
|
+
this.latestValues[t] = s, this.props.onUpdate && at.preRender(this.notifyUpdate), r && this.projection && (this.projection.isTransformDirty = !0), this.scheduleRender();
|
|
2696
2696
|
});
|
|
2697
2697
|
let o;
|
|
2698
2698
|
window.MotionCheckAppearSync && (o = window.MotionCheckAppearSync(this, t, n)), this.valueSubscriptions.set(t, () => {
|
|
@@ -3047,7 +3047,7 @@ const Sl = (e, t, n, r = {}, i, o) => (s) => {
|
|
|
3047
3047
|
if ((u.type === !1 || u.duration === 0 && !u.repeatDelay) && (ma(u), u.delay === 0 && (d = !0)), (_n.instantAnimations || _n.skipAnimations) && (d = !0, ma(u), u.delay = 0), u.allowFlatten = !a.type && !a.ease, d && !o && t.get() !== void 0) {
|
|
3048
3048
|
const f = bx(u.keyframes, a);
|
|
3049
3049
|
if (f !== void 0) {
|
|
3050
|
-
|
|
3050
|
+
at.update(() => {
|
|
3051
3051
|
u.onUpdate(f), u.onComplete();
|
|
3052
3052
|
});
|
|
3053
3053
|
return;
|
|
@@ -3077,7 +3077,7 @@ function Xh(e, t, { delay: n = 0, transitionOverride: r, type: i } = {}) {
|
|
|
3077
3077
|
if (window.MotionHandoffAnimation) {
|
|
3078
3078
|
const y = Zh(e);
|
|
3079
3079
|
if (y) {
|
|
3080
|
-
const k = window.MotionHandoffAnimation(y, u,
|
|
3080
|
+
const k = window.MotionHandoffAnimation(y, u, at);
|
|
3081
3081
|
k !== null && (h.startTime = k, p = !0);
|
|
3082
3082
|
}
|
|
3083
3083
|
}
|
|
@@ -3086,7 +3086,7 @@ function Xh(e, t, { delay: n = 0, transitionOverride: r, type: i } = {}) {
|
|
|
3086
3086
|
x && l.push(x);
|
|
3087
3087
|
}
|
|
3088
3088
|
return s && Promise.all(l).then(() => {
|
|
3089
|
-
|
|
3089
|
+
at.update(() => {
|
|
3090
3090
|
s && px(e, s);
|
|
3091
3091
|
});
|
|
3092
3092
|
}), l;
|
|
@@ -3416,7 +3416,7 @@ class ip {
|
|
|
3416
3416
|
const { onStart: y, onMove: k } = this.handlers;
|
|
3417
3417
|
h || (y && y(this.lastMoveEvent, f), this.startEvent = this.lastMoveEvent), k && k(this.lastMoveEvent, f);
|
|
3418
3418
|
}, this.handlePointerMove = (f, h) => {
|
|
3419
|
-
this.lastMoveEvent = f, this.lastMoveEventInfo = fs(h, this.transformPagePoint),
|
|
3419
|
+
this.lastMoveEvent = f, this.lastMoveEventInfo = fs(h, this.transformPagePoint), at.update(this.updatePoint, !0);
|
|
3420
3420
|
}, this.handlePointerUp = (f, h) => {
|
|
3421
3421
|
this.end();
|
|
3422
3422
|
const { onEnd: g, onSessionEnd: p, resumeAnimation: x } = this.handlers;
|
|
@@ -3553,7 +3553,7 @@ class ew {
|
|
|
3553
3553
|
}
|
|
3554
3554
|
}
|
|
3555
3555
|
this.originPoint[y] = k;
|
|
3556
|
-
}), p &&
|
|
3556
|
+
}), p && at.postRender(() => p(d, f)), va(this.visualElement, "transform");
|
|
3557
3557
|
const { animationState: x } = this.visualElement;
|
|
3558
3558
|
x && x.setActive("whileDrag", !0);
|
|
3559
3559
|
}, a = (d, f) => {
|
|
@@ -3596,7 +3596,7 @@ class ew {
|
|
|
3596
3596
|
const { velocity: s } = i;
|
|
3597
3597
|
this.startAnimation(s);
|
|
3598
3598
|
const { onDragEnd: a } = this.getProps();
|
|
3599
|
-
a &&
|
|
3599
|
+
a && at.postRender(() => a(r, i));
|
|
3600
3600
|
}
|
|
3601
3601
|
/**
|
|
3602
3602
|
* @internal
|
|
@@ -3739,7 +3739,7 @@ class ew {
|
|
|
3739
3739
|
const { dragConstraints: l } = this.getProps();
|
|
3740
3740
|
kr(l) && l.current && (this.constraints = this.resolveRefConstraints());
|
|
3741
3741
|
}, { projection: i } = this.visualElement, o = i.addEventListener("measure", r);
|
|
3742
|
-
i && !i.layout && (i.root && i.root.updateScroll(), i.updateLayout()),
|
|
3742
|
+
i && !i.layout && (i.root && i.root.updateScroll(), i.updateLayout()), at.read(r);
|
|
3743
3743
|
const s = bi(window, "resize", () => this.scalePositionWithinConstraints()), a = i.addEventListener("didUpdate", ({ delta: l, hasLayoutChanged: c }) => {
|
|
3744
3744
|
this.isDragging && c && (Qt((u) => {
|
|
3745
3745
|
const d = this.getAxisMotionValue(u);
|
|
@@ -3783,7 +3783,7 @@ class nw extends Hn {
|
|
|
3783
3783
|
}
|
|
3784
3784
|
}
|
|
3785
3785
|
const uu = (e) => (t, n) => {
|
|
3786
|
-
e &&
|
|
3786
|
+
e && at.postRender(() => e(t, n));
|
|
3787
3787
|
};
|
|
3788
3788
|
class rw extends Hn {
|
|
3789
3789
|
constructor() {
|
|
@@ -3802,7 +3802,7 @@ class rw extends Hn {
|
|
|
3802
3802
|
onStart: uu(n),
|
|
3803
3803
|
onMove: r,
|
|
3804
3804
|
onEnd: (o, s) => {
|
|
3805
|
-
delete this.session, i &&
|
|
3805
|
+
delete this.session, i && at.postRender(() => i(o, s));
|
|
3806
3806
|
}
|
|
3807
3807
|
};
|
|
3808
3808
|
}
|
|
@@ -3872,7 +3872,7 @@ class ow extends nb {
|
|
|
3872
3872
|
}
|
|
3873
3873
|
getSnapshotBeforeUpdate(t) {
|
|
3874
3874
|
const { layoutDependency: n, visualElement: r, drag: i, isPresent: o } = this.props, { projection: s } = r;
|
|
3875
|
-
return s && (s.isPresent = o, ps = !0, i || t.layoutDependency !== n || n === void 0 || t.isPresent !== o ? s.willUpdate() : this.safeToRemove(), t.isPresent !== o && (o ? s.promote() : s.relegate() ||
|
|
3875
|
+
return s && (s.isPresent = o, ps = !0, i || t.layoutDependency !== n || n === void 0 || t.isPresent !== o ? s.willUpdate() : this.safeToRemove(), t.isPresent !== o && (o ? s.promote() : s.relegate() || at.postRender(() => {
|
|
3876
3876
|
const a = s.getStack();
|
|
3877
3877
|
(!a || !a.members.length) && this.safeToRemove();
|
|
3878
3878
|
}))), null;
|
|
@@ -3939,7 +3939,7 @@ function uw(e, t) {
|
|
|
3939
3939
|
const o = i - n;
|
|
3940
3940
|
o >= t && ($n(r), e(o - t));
|
|
3941
3941
|
};
|
|
3942
|
-
return
|
|
3942
|
+
return at.setup(r, !0), () => $n(r);
|
|
3943
3943
|
}
|
|
3944
3944
|
const ap = ["TopLeft", "TopRight", "BottomLeft", "BottomRight"], dw = ap.length, fu = (e) => typeof e == "string" ? parseFloat(e) : e, hu = (e) => typeof e == "number" || xe.test(e);
|
|
3945
3945
|
function fw(e, t, n, r, i, o) {
|
|
@@ -4088,7 +4088,7 @@ function dp(e) {
|
|
|
4088
4088
|
const n = Zh(t);
|
|
4089
4089
|
if (window.MotionHasOptimisedAnimation(n, "transform")) {
|
|
4090
4090
|
const { layout: i, layoutId: o } = e.options;
|
|
4091
|
-
window.MotionCancelOptimisedAnimation(n, "transform",
|
|
4091
|
+
window.MotionCancelOptimisedAnimation(n, "transform", at, !(i || o));
|
|
4092
4092
|
}
|
|
4093
4093
|
const { parent: r } = e;
|
|
4094
4094
|
r && !r.hasCheckedOptimisedAppear && dp(r);
|
|
@@ -4126,7 +4126,7 @@ function fp({ attachResizeListener: e, defaultParent: t, measureScroll: n, check
|
|
|
4126
4126
|
if (c && !c.current && c.mount(s), this.root.nodes.add(this), this.parent && this.parent.children.add(this), this.root.hasTreeAnimated && (l || a) && (this.isLayoutDirty = !0), e) {
|
|
4127
4127
|
let u, d = 0;
|
|
4128
4128
|
const f = () => this.root.updateBlockedByResize = !1;
|
|
4129
|
-
|
|
4129
|
+
at.read(() => {
|
|
4130
4130
|
d = window.innerWidth;
|
|
4131
4131
|
}), e(s, () => {
|
|
4132
4132
|
const h = window.innerWidth;
|
|
@@ -4216,10 +4216,10 @@ function fp({ attachResizeListener: e, defaultParent: t, measureScroll: n, check
|
|
|
4216
4216
|
this.nodes.forEach(Tw), this.sharedNodes.forEach(Iw);
|
|
4217
4217
|
}
|
|
4218
4218
|
scheduleUpdateProjection() {
|
|
4219
|
-
this.projectionUpdateScheduled || (this.projectionUpdateScheduled = !0,
|
|
4219
|
+
this.projectionUpdateScheduled || (this.projectionUpdateScheduled = !0, at.preRender(this.updateProjection, !1, !0));
|
|
4220
4220
|
}
|
|
4221
4221
|
scheduleCheckAfterUnmount() {
|
|
4222
|
-
|
|
4222
|
+
at.postRender(() => {
|
|
4223
4223
|
this.isLayoutDirty ? this.root.didUpdate() : this.root.checkUpdateFailed();
|
|
4224
4224
|
});
|
|
4225
4225
|
}
|
|
@@ -4410,7 +4410,7 @@ function fp({ attachResizeListener: e, defaultParent: t, measureScroll: n, check
|
|
|
4410
4410
|
}
|
|
4411
4411
|
startAnimation(s) {
|
|
4412
4412
|
var a, l, c;
|
|
4413
|
-
this.notifyListeners("animationStart"), (a = this.currentAnimation) == null || a.stop(), (c = (l = this.resumingFrom) == null ? void 0 : l.currentAnimation) == null || c.stop(), this.pendingAnimation && ($n(this.pendingAnimation), this.pendingAnimation = void 0), this.pendingAnimation =
|
|
4413
|
+
this.notifyListeners("animationStart"), (a = this.currentAnimation) == null || a.stop(), (c = (l = this.resumingFrom) == null ? void 0 : l.currentAnimation) == null || c.stop(), this.pendingAnimation && ($n(this.pendingAnimation), this.pendingAnimation = void 0), this.pendingAnimation = at.update(() => {
|
|
4414
4414
|
so.hasAnimatedSinceResize = !0, this.motionValue || (this.motionValue = Mr(0)), this.currentAnimation = aw(this.motionValue, [0, 1e3], {
|
|
4415
4415
|
...s,
|
|
4416
4416
|
velocity: 0,
|
|
@@ -4698,7 +4698,7 @@ function Ou(e, t, n) {
|
|
|
4698
4698
|
const { props: r } = e;
|
|
4699
4699
|
e.animationState && r.whileHover && e.animationState.setActive("whileHover", n === "Start");
|
|
4700
4700
|
const i = "onHover" + n, o = r[i];
|
|
4701
|
-
o &&
|
|
4701
|
+
o && at.postRender(() => o(t, Si(t)));
|
|
4702
4702
|
}
|
|
4703
4703
|
class Vw extends Hn {
|
|
4704
4704
|
mount() {
|
|
@@ -4736,7 +4736,7 @@ function Pu(e, t, n) {
|
|
|
4736
4736
|
return;
|
|
4737
4737
|
e.animationState && r.whileTap && e.animationState.setActive("whileTap", n === "Start");
|
|
4738
4738
|
const i = "onTap" + (n === "End" ? "" : n), o = r[i];
|
|
4739
|
-
o &&
|
|
4739
|
+
o && at.postRender(() => o(t, Si(t)));
|
|
4740
4740
|
}
|
|
4741
4741
|
class Uw extends Hn {
|
|
4742
4742
|
mount() {
|
|
@@ -35962,10 +35962,10 @@ function PM(e, t) {
|
|
|
35962
35962
|
});
|
|
35963
35963
|
}
|
|
35964
35964
|
const DM = 0.2, LM = 0.14, FM = 0.12;
|
|
35965
|
-
function
|
|
35965
|
+
function st(...e) {
|
|
35966
35966
|
return [`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${DM})`, `${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${LM})`, `${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${FM})`].join(",");
|
|
35967
35967
|
}
|
|
35968
|
-
const BM = ["none",
|
|
35968
|
+
const BM = ["none", st(0, 2, 1, -1, 0, 1, 1, 0, 0, 1, 3, 0), st(0, 3, 1, -2, 0, 2, 2, 0, 0, 1, 5, 0), st(0, 3, 3, -2, 0, 3, 4, 0, 0, 1, 8, 0), st(0, 2, 4, -1, 0, 4, 5, 0, 0, 1, 10, 0), st(0, 3, 5, -1, 0, 5, 8, 0, 0, 1, 14, 0), st(0, 3, 5, -1, 0, 6, 10, 0, 0, 1, 18, 0), st(0, 4, 5, -2, 0, 7, 10, 1, 0, 2, 16, 1), st(0, 5, 5, -3, 0, 8, 10, 1, 0, 3, 14, 2), st(0, 5, 6, -3, 0, 9, 12, 1, 0, 3, 16, 2), st(0, 6, 6, -3, 0, 10, 14, 1, 0, 4, 18, 3), st(0, 6, 7, -4, 0, 11, 15, 1, 0, 4, 20, 3), st(0, 7, 8, -4, 0, 12, 17, 2, 0, 5, 22, 4), st(0, 7, 8, -4, 0, 13, 19, 2, 0, 5, 24, 4), st(0, 7, 9, -4, 0, 14, 21, 2, 0, 5, 26, 4), st(0, 8, 9, -5, 0, 15, 22, 2, 0, 6, 28, 5), st(0, 8, 10, -5, 0, 16, 24, 2, 0, 6, 30, 5), st(0, 8, 11, -5, 0, 17, 26, 2, 0, 6, 32, 5), st(0, 9, 11, -5, 0, 18, 28, 2, 0, 7, 34, 6), st(0, 9, 12, -6, 0, 19, 29, 2, 0, 7, 36, 6), st(0, 10, 13, -6, 0, 20, 31, 3, 0, 8, 38, 7), st(0, 10, 13, -6, 0, 21, 33, 3, 0, 8, 40, 7), st(0, 10, 14, -6, 0, 22, 35, 3, 0, 8, 42, 7), st(0, 11, 14, -7, 0, 23, 36, 3, 0, 9, 44, 8), st(0, 11, 15, -7, 0, 24, 38, 3, 0, 9, 46, 8)], $M = {
|
|
35969
35969
|
// This is the most common easing curve.
|
|
35970
35970
|
easeInOut: "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
35971
35971
|
// Objects enter the screen at full velocity from off-screen and
|
|
@@ -36976,7 +36976,7 @@ function mI({
|
|
|
36976
36976
|
}
|
|
36977
36977
|
class vg {
|
|
36978
36978
|
constructor() {
|
|
36979
|
-
|
|
36979
|
+
ot(this, "listeners", {});
|
|
36980
36980
|
}
|
|
36981
36981
|
/**
|
|
36982
36982
|
* Add an event listener
|
|
@@ -37038,9 +37038,9 @@ class vg {
|
|
|
37038
37038
|
}
|
|
37039
37039
|
class gI {
|
|
37040
37040
|
constructor(t) {
|
|
37041
|
-
|
|
37042
|
-
|
|
37043
|
-
|
|
37041
|
+
ot(this, "plugins", /* @__PURE__ */ new Map());
|
|
37042
|
+
ot(this, "installedPlugins", /* @__PURE__ */ new Set());
|
|
37043
|
+
ot(this, "context");
|
|
37044
37044
|
this.context = {
|
|
37045
37045
|
client: t,
|
|
37046
37046
|
emit: t.emit.bind(t),
|
|
@@ -37312,10 +37312,10 @@ function Rn() {
|
|
|
37312
37312
|
class bI extends vg {
|
|
37313
37313
|
constructor(n) {
|
|
37314
37314
|
super();
|
|
37315
|
-
|
|
37316
|
-
|
|
37317
|
-
|
|
37318
|
-
|
|
37315
|
+
ot(this, "room", null);
|
|
37316
|
+
ot(this, "registeredMethods", /* @__PURE__ */ new Map());
|
|
37317
|
+
ot(this, "activeInteractions", /* @__PURE__ */ new Map());
|
|
37318
|
+
ot(this, "currentInteraction", null);
|
|
37319
37319
|
n && this.setRoom(n);
|
|
37320
37320
|
}
|
|
37321
37321
|
/**
|
|
@@ -37496,28 +37496,29 @@ class Ge extends Error {
|
|
|
37496
37496
|
}
|
|
37497
37497
|
const Ln = /* @__PURE__ */ new WeakSet(), ea = /* @__PURE__ */ new WeakSet();
|
|
37498
37498
|
class oc extends vg {
|
|
37499
|
-
// Track agent state
|
|
37500
37499
|
constructor(n) {
|
|
37501
37500
|
super();
|
|
37502
|
-
|
|
37503
|
-
|
|
37504
|
-
|
|
37505
|
-
|
|
37506
|
-
|
|
37507
|
-
|
|
37508
|
-
|
|
37509
|
-
|
|
37510
|
-
|
|
37501
|
+
ot(this, "config");
|
|
37502
|
+
ot(this, "room", null);
|
|
37503
|
+
ot(this, "pluginManager");
|
|
37504
|
+
ot(this, "rpcManager");
|
|
37505
|
+
ot(this, "isConnected", !1);
|
|
37506
|
+
ot(this, "currentSession", null);
|
|
37507
|
+
ot(this, "connectionState", br.Disconnected);
|
|
37508
|
+
ot(this, "renderedComponents", /* @__PURE__ */ new Map());
|
|
37509
|
+
ot(this, "textStreamHandlersRegistered", !1);
|
|
37511
37510
|
// Track if handlers are already registered
|
|
37512
|
-
|
|
37511
|
+
ot(this, "currentAgentInfo", null);
|
|
37513
37512
|
// Store current agent information
|
|
37514
|
-
|
|
37513
|
+
ot(this, "chatMessages", []);
|
|
37515
37514
|
// Store chat messages for persistence across UI changes
|
|
37516
37515
|
// Track active transcriptions to prevent duplicates within time windows
|
|
37517
|
-
|
|
37518
|
-
|
|
37516
|
+
ot(this, "activeTranscriptions", /* @__PURE__ */ new Map());
|
|
37517
|
+
ot(this, "isAgentConnected", !1);
|
|
37519
37518
|
// Track if agent is actually connected and responding
|
|
37520
|
-
|
|
37519
|
+
ot(this, "agentState", "idle");
|
|
37520
|
+
// Track agent state
|
|
37521
|
+
ot(this, "_eventEmitters", /* @__PURE__ */ new Map());
|
|
37521
37522
|
this.config = n, this.pluginManager = new gI(this), this.rpcManager = new bI(), this.setupEventListeners(), this.initializeClient();
|
|
37522
37523
|
}
|
|
37523
37524
|
setupEventListeners() {
|
|
@@ -37900,7 +37901,15 @@ class oc extends vg {
|
|
|
37900
37901
|
var o;
|
|
37901
37902
|
try {
|
|
37902
37903
|
const s = await r.readAll(), a = ((o = r.info) == null ? void 0 : o.topic) || "unknown";
|
|
37903
|
-
|
|
37904
|
+
if (this._eventEmitters.has(a)) {
|
|
37905
|
+
const l = this._eventEmitters.get(a);
|
|
37906
|
+
try {
|
|
37907
|
+
l(s), console.log(`📝 VoxketClient: Processed custom topic '${a}' via event emitter`);
|
|
37908
|
+
} catch (c) {
|
|
37909
|
+
console.error(`VoxketClient: Error in custom handler for topic '${a}':`, c);
|
|
37910
|
+
}
|
|
37911
|
+
} else
|
|
37912
|
+
console.log(`📝 VoxketClient: Received unhandled text stream for topic '${a}':`, s), this.emit("text.stream.unhandled", { topic: a, data: s, participantInfo: i });
|
|
37904
37913
|
} catch (s) {
|
|
37905
37914
|
console.error("VoxketClient: Failed to process unhandled text stream:", s);
|
|
37906
37915
|
}
|
|
@@ -38872,19 +38881,32 @@ class oc extends vg {
|
|
|
38872
38881
|
registerEventEmitter(n, r) {
|
|
38873
38882
|
if (!this.room)
|
|
38874
38883
|
throw new Error("Room not available");
|
|
38884
|
+
this._eventEmitters.set(n, r), console.log(`📝 VoxketClient: Stored handler for topic '${n}' in event emitters map`);
|
|
38875
38885
|
try {
|
|
38876
38886
|
this.room.registerTextStreamHandler(n, async (i) => {
|
|
38877
38887
|
try {
|
|
38878
38888
|
const o = await i.readAll();
|
|
38879
|
-
r(o);
|
|
38889
|
+
console.log(`📝 VoxketClient: Direct handler called for topic '${n}'`), r(o);
|
|
38880
38890
|
} catch (o) {
|
|
38881
38891
|
console.error(`Error processing event for topic '${n}':`, o);
|
|
38882
38892
|
}
|
|
38883
|
-
});
|
|
38893
|
+
}), console.log(`📝 VoxketClient: Successfully registered direct handler for topic '${n}'`);
|
|
38884
38894
|
} catch (i) {
|
|
38885
|
-
console.warn(`VoxketClient:
|
|
38895
|
+
console.warn(`VoxketClient: Direct handler registration failed for topic '${n}':`, i), console.log(`📝 VoxketClient: Wildcard handler will process topic '${n}' instead`);
|
|
38886
38896
|
}
|
|
38887
38897
|
}
|
|
38898
|
+
/**
|
|
38899
|
+
* Get the list of registered custom event emitters (for debugging)
|
|
38900
|
+
*/
|
|
38901
|
+
getRegisteredEventEmitters() {
|
|
38902
|
+
return Array.from(this._eventEmitters.keys());
|
|
38903
|
+
}
|
|
38904
|
+
/**
|
|
38905
|
+
* Check if a custom event emitter is registered for a topic
|
|
38906
|
+
*/
|
|
38907
|
+
hasEventEmitter(n) {
|
|
38908
|
+
return this._eventEmitters.has(n);
|
|
38909
|
+
}
|
|
38888
38910
|
/**
|
|
38889
38911
|
* Convert markdown text to plain text by removing common markdown formatting
|
|
38890
38912
|
* @param markdownText The markdown text to convert
|
|
@@ -40911,20 +40933,20 @@ function CO({
|
|
|
40911
40933
|
] });
|
|
40912
40934
|
}
|
|
40913
40935
|
const QI = ({ handler: e, loadData: t, data: n, client: r, addLocalMessage: i }) => {
|
|
40914
|
-
const [o, s] = P.useState(null), [a, l] = P.useState(!0), [c, u] = P.useState(!1), [d] = P.useState(Date.now());
|
|
40936
|
+
const [o, s] = P.useState(null), [a, l] = P.useState(!0), [c, u] = P.useState(!1), [d] = P.useState(Date.now()), [f, h] = P.useState("pending");
|
|
40915
40937
|
P.useEffect(() => {
|
|
40916
40938
|
(async () => {
|
|
40917
40939
|
try {
|
|
40918
|
-
if (l(!0),
|
|
40919
|
-
const
|
|
40940
|
+
if (l(!0), n && typeof n == "object") {
|
|
40941
|
+
const k = {
|
|
40920
40942
|
title: n.title || "Untitled Assignment",
|
|
40921
40943
|
description: n.description || "No description provided",
|
|
40922
40944
|
estimated_time_of_completion: n.estimated_time_of_completion || "Unknown"
|
|
40923
40945
|
};
|
|
40924
|
-
s(
|
|
40946
|
+
s(k), console.log("📋 AssignmentView: Assignment loaded from RPC data:", k);
|
|
40925
40947
|
}
|
|
40926
|
-
} catch (
|
|
40927
|
-
console.error("📋 AssignmentView: Error loading assignment:",
|
|
40948
|
+
} catch (k) {
|
|
40949
|
+
console.error("📋 AssignmentView: Error loading assignment:", k), s({
|
|
40928
40950
|
title: "Assignment Loading Error",
|
|
40929
40951
|
description: "There was an error loading the assignment details. Please try again.",
|
|
40930
40952
|
estimated_time_of_completion: "Unknown"
|
|
@@ -40934,44 +40956,38 @@ const QI = ({ handler: e, loadData: t, data: n, client: r, addLocalMessage: i })
|
|
|
40934
40956
|
}
|
|
40935
40957
|
})();
|
|
40936
40958
|
}, [n, t]);
|
|
40937
|
-
const
|
|
40938
|
-
const
|
|
40939
|
-
return /* @__PURE__ */ A("div", { className: `max-w-sm mx-auto ${
|
|
40940
|
-
/* @__PURE__ */ m("div", { className: "text-2xl mb-2", children:
|
|
40941
|
-
/* @__PURE__ */ m("div", { className: `${
|
|
40942
|
-
/* @__PURE__ */ m("div", { className: "text-xs text-gray-600 text-center mb-1", children:
|
|
40959
|
+
const g = ({ message: y, assignment: k }) => {
|
|
40960
|
+
const E = y.toLowerCase().includes("declined"), C = E ? "bg-red-50 border-red-200" : "bg-green-50 border-green-200", v = E ? "text-red-700" : "text-green-700", _ = E ? "❌" : "🎉";
|
|
40961
|
+
return /* @__PURE__ */ A("div", { className: `max-w-sm mx-auto ${C} border rounded-lg shadow p-3 flex flex-col items-center`, children: [
|
|
40962
|
+
/* @__PURE__ */ m("div", { className: "text-2xl mb-2", children: _ }),
|
|
40963
|
+
/* @__PURE__ */ m("div", { className: `${v} font-semibold text-sm mb-1`, children: y }),
|
|
40964
|
+
/* @__PURE__ */ m("div", { className: "text-xs text-gray-600 text-center mb-1", children: k.title }),
|
|
40943
40965
|
/* @__PURE__ */ m("div", { className: "text-xs text-gray-500", children: "Thank you for your response!" })
|
|
40944
40966
|
] });
|
|
40945
|
-
},
|
|
40967
|
+
}, p = async () => {
|
|
40946
40968
|
if (!(!o || !e)) {
|
|
40947
40969
|
u(!0);
|
|
40948
40970
|
try {
|
|
40949
|
-
const
|
|
40971
|
+
const y = {
|
|
40950
40972
|
message: "accepted"
|
|
40951
40973
|
};
|
|
40952
|
-
console.log("📋 AssignmentView: Assignment accepted:",
|
|
40953
|
-
|
|
40954
|
-
|
|
40955
|
-
);
|
|
40956
|
-
} catch (p) {
|
|
40957
|
-
console.error("📋 AssignmentView: Error accepting assignment:", p), e.didFail({ error: "Failed to accept assignment" });
|
|
40974
|
+
console.log("📋 AssignmentView: Assignment accepted:", y), e.didSuccess(y), h("accepted");
|
|
40975
|
+
} catch (y) {
|
|
40976
|
+
console.error("📋 AssignmentView: Error accepting assignment:", y), e.didFail({ error: "Failed to accept assignment" }), h("error");
|
|
40958
40977
|
} finally {
|
|
40959
40978
|
u(!1);
|
|
40960
40979
|
}
|
|
40961
40980
|
}
|
|
40962
|
-
},
|
|
40981
|
+
}, x = async () => {
|
|
40963
40982
|
if (!(!o || !e)) {
|
|
40964
40983
|
u(!0);
|
|
40965
40984
|
try {
|
|
40966
|
-
const
|
|
40985
|
+
const y = {
|
|
40967
40986
|
message: "declined"
|
|
40968
40987
|
};
|
|
40969
|
-
console.log("📋 AssignmentView: Assignment declined:",
|
|
40970
|
-
|
|
40971
|
-
|
|
40972
|
-
);
|
|
40973
|
-
} catch (p) {
|
|
40974
|
-
console.error("📋 AssignmentView: Error declining assignment:", p), e.didFail({ error: "Failed to decline assignment" });
|
|
40988
|
+
console.log("📋 AssignmentView: Assignment declined:", y), e.didSuccess(y), h("declined");
|
|
40989
|
+
} catch (y) {
|
|
40990
|
+
console.error("📋 AssignmentView: Error declining assignment:", y), e.didFail({ error: "Failed to decline assignment" }), h("error");
|
|
40975
40991
|
} finally {
|
|
40976
40992
|
u(!1);
|
|
40977
40993
|
}
|
|
@@ -40980,7 +40996,13 @@ const QI = ({ handler: e, loadData: t, data: n, client: r, addLocalMessage: i })
|
|
|
40980
40996
|
return a ? /* @__PURE__ */ m("div", { className: "max-w-sm mx-auto bg-white rounded-lg shadow-lg p-3", children: /* @__PURE__ */ A("div", { className: "flex items-center justify-center py-4", children: [
|
|
40981
40997
|
/* @__PURE__ */ m("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600" }),
|
|
40982
40998
|
/* @__PURE__ */ m("span", { className: "ml-2 text-xs text-gray-600", children: "Loading assignment..." })
|
|
40983
|
-
] }) }) : o ?
|
|
40999
|
+
] }) }) : o ? f === "accepted" || f === "declined" || f === "error" ? /* @__PURE__ */ m(
|
|
41000
|
+
g,
|
|
41001
|
+
{
|
|
41002
|
+
message: f === "accepted" ? "Assignment accepted!" : f === "declined" ? "Assignment declined" : "Assignment error occurred",
|
|
41003
|
+
assignment: o
|
|
41004
|
+
}
|
|
41005
|
+
) : /* @__PURE__ */ A("div", { className: "max-w-sm mx-auto bg-white rounded-lg shadow-lg overflow-hidden", children: [
|
|
40984
41006
|
/* @__PURE__ */ m("div", { className: "bg-gradient-to-r from-blue-600 to-purple-600 text-white p-3", children: /* @__PURE__ */ m("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ m("h3", { className: "text-xs font-semibold text-white truncate", children: o.title }) }) }),
|
|
40985
41007
|
/* @__PURE__ */ A("div", { className: "p-3 text-black", children: [
|
|
40986
41008
|
/* @__PURE__ */ m("div", { className: "bg-gray-50 rounded p-2 mb-3", children: /* @__PURE__ */ m("p", { className: "text-xs text-black leading-snug", children: o.description }) }),
|
|
@@ -40995,7 +41017,7 @@ const QI = ({ handler: e, loadData: t, data: n, client: r, addLocalMessage: i })
|
|
|
40995
41017
|
/* @__PURE__ */ m(
|
|
40996
41018
|
"button",
|
|
40997
41019
|
{
|
|
40998
|
-
onClick:
|
|
41020
|
+
onClick: p,
|
|
40999
41021
|
disabled: c,
|
|
41000
41022
|
className: "flex-1 bg-green-600 text-white py-2 px-3 rounded text-xs font-medium hover:bg-green-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
|
|
41001
41023
|
children: c ? /* @__PURE__ */ A("span", { className: "flex items-center justify-center", children: [
|
|
@@ -41007,7 +41029,7 @@ const QI = ({ handler: e, loadData: t, data: n, client: r, addLocalMessage: i })
|
|
|
41007
41029
|
/* @__PURE__ */ m(
|
|
41008
41030
|
"button",
|
|
41009
41031
|
{
|
|
41010
|
-
onClick:
|
|
41032
|
+
onClick: x,
|
|
41011
41033
|
disabled: c,
|
|
41012
41034
|
className: "flex-1 bg-red-600 text-white py-2 px-3 rounded text-xs font-medium hover:bg-red-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
|
|
41013
41035
|
children: "Decline"
|