@multiplayer-app/ai-agent-react 0.4.2-beta.1 → 0.4.2-beta.2
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z as U } from "zod";
|
|
2
2
|
import { jsx as T, Fragment as Rt, jsxs as re } from "react/jsx-runtime";
|
|
3
3
|
import * as ee from "react";
|
|
4
|
-
import tr, { forwardRef as ho, createElement as hd, useMemo as it, useState as Ze, useEffect as Be, useLayoutEffect as mo, memo as
|
|
4
|
+
import tr, { forwardRef as ho, createElement as hd, useMemo as it, useState as Ze, useEffect as Be, useLayoutEffect as mo, memo as ft, useCallback as Ge, useRef as Ve, createContext as ip, useContext as op, useImperativeHandle as D7, isValidElement as A5 } from "react";
|
|
5
5
|
import { useInfiniteQuery as sp, useQuery as mr, useQueryClient as z7, useMutation as r2, QueryClient as $7, QueryClientProvider as F7 } from "@tanstack/react-query";
|
|
6
6
|
import { create as P7, useStore as q7 } from "zustand";
|
|
7
7
|
import { nanoid as Tt } from "nanoid";
|
|
@@ -30685,7 +30685,7 @@ const Pn = ({
|
|
|
30685
30685
|
}, fn = () => {
|
|
30686
30686
|
const e = Fe();
|
|
30687
30687
|
return { ...md, ...e.config.translations ?? {} };
|
|
30688
|
-
}, D2 = 300, k3 =
|
|
30688
|
+
}, D2 = 300, k3 = ft(({ field: e, isExpanded: t, canApply: n, onToggleExpand: r, onApply: a }) => {
|
|
30689
30689
|
const i = fn(), o = e.value.length > D2, s = o && !t ? `${e.value.slice(0, D2)}...` : e.value, l = Ge(() => {
|
|
30690
30690
|
r(e.name);
|
|
30691
30691
|
}, [e.name, r]), u = Ge(() => {
|
|
@@ -31031,7 +31031,7 @@ const x3 = 30 * 1e3, E3 = 5 * 60 * 1e3, M3 = 20, Er = {
|
|
|
31031
31031
|
refetchOnWindowFocus: !1
|
|
31032
31032
|
});
|
|
31033
31033
|
}, ii = (e) => e.type === _t.Context && e?.metadata?.kind === "pageContext";
|
|
31034
|
-
var
|
|
31034
|
+
var yt = /* @__PURE__ */ ((e) => (e.Idle = "idle", e.Sending = "sending", e.Streaming = "streaming", e))(yt || {});
|
|
31035
31035
|
const Ia = (e) => e === Yr.Streaming || e === Yr.Processing || e === Yr.WaitingForUserAction ? "streaming" : "idle", N3 = () => ({
|
|
31036
31036
|
messages: [],
|
|
31037
31037
|
reasoning: [],
|
|
@@ -34773,7 +34773,7 @@ const N_e = ip(null), A_e = ({ children: e }) => {
|
|
|
34773
34773
|
}
|
|
34774
34774
|
throw pe;
|
|
34775
34775
|
}, Ce = async () => {
|
|
34776
|
-
h(se.current,
|
|
34776
|
+
h(se.current, yt.Sending);
|
|
34777
34777
|
try {
|
|
34778
34778
|
if (!a.transport.sendMultiUserMessage)
|
|
34779
34779
|
throw new Error("Multi-user chat requires a transport that supports sendMultiUserMessage");
|
|
@@ -34784,7 +34784,7 @@ const N_e = ip(null), A_e = ({ children: e }) => {
|
|
|
34784
34784
|
}
|
|
34785
34785
|
}, ve = async () => {
|
|
34786
34786
|
let pe = `pending-${Date.now()}`, be = "", Re;
|
|
34787
|
-
h(se.current,
|
|
34787
|
+
h(se.current, yt.Streaming), k(se.current, {
|
|
34788
34788
|
id: pe,
|
|
34789
34789
|
content: "",
|
|
34790
34790
|
reasoning: "",
|
|
@@ -34819,7 +34819,7 @@ const N_e = ip(null), A_e = ({ children: e }) => {
|
|
|
34819
34819
|
content: _e,
|
|
34820
34820
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
34821
34821
|
};
|
|
34822
|
-
w(se.current, [{ ...qe, content: _e }]), h(se.current,
|
|
34822
|
+
w(se.current, [{ ...qe, content: _e }]), h(se.current, yt.Idle), Le();
|
|
34823
34823
|
return;
|
|
34824
34824
|
}
|
|
34825
34825
|
if (ne.message && ne.message.role === We.User) {
|
|
@@ -34829,7 +34829,7 @@ const N_e = ip(null), A_e = ({ children: e }) => {
|
|
|
34829
34829
|
ne.message && (pe = ne.message.id, Re = {
|
|
34830
34830
|
...ne.message,
|
|
34831
34831
|
reasoning: be || ne.message.reasoning
|
|
34832
|
-
}, k(se.current, Re)), ne.done && (Re && w(se.current, [Re]), h(se.current,
|
|
34832
|
+
}, k(se.current, Re)), ne.done && (Re && w(se.current, [Re]), h(se.current, yt.Idle), Le());
|
|
34833
34833
|
}, oe = await a.transport.streamMessage(
|
|
34834
34834
|
ue,
|
|
34835
34835
|
X,
|
|
@@ -34856,9 +34856,9 @@ const N_e = ip(null), A_e = ({ children: e }) => {
|
|
|
34856
34856
|
const be = pe?.chat;
|
|
34857
34857
|
be && (p(be), m(be.id));
|
|
34858
34858
|
const Re = pe instanceof Error ? pe : new Error("Failed to send message");
|
|
34859
|
-
return f(se.current, Re.message || "Failed to send message"), h(se.current,
|
|
34859
|
+
return f(se.current, Re.message || "Failed to send message"), h(se.current, yt.Idle), t.current?.setDraft(ye), D.current = !1, { type: "error", error: Re };
|
|
34860
34860
|
} finally {
|
|
34861
|
-
P.current = !1, n || h(se.current,
|
|
34861
|
+
P.current = !1, n || h(se.current, yt.Idle), C.current = void 0;
|
|
34862
34862
|
}
|
|
34863
34863
|
},
|
|
34864
34864
|
[
|
|
@@ -34882,7 +34882,7 @@ const N_e = ip(null), A_e = ({ children: e }) => {
|
|
|
34882
34882
|
f
|
|
34883
34883
|
]
|
|
34884
34884
|
), W = Ge(async () => {
|
|
34885
|
-
if (d !==
|
|
34885
|
+
if (d !== yt.Idle || P.current || !u.length || D.current)
|
|
34886
34886
|
return;
|
|
34887
34887
|
const V = u[0];
|
|
34888
34888
|
P.current = !0, _(q, V.id);
|
|
@@ -34913,7 +34913,7 @@ const N_e = ip(null), A_e = ({ children: e }) => {
|
|
|
34913
34913
|
), H = Ge(
|
|
34914
34914
|
async (V) => {
|
|
34915
34915
|
const K = t.current.getDraft().attachments;
|
|
34916
|
-
if (!n && d !==
|
|
34916
|
+
if (!n && d !== yt.Idle) {
|
|
34917
34917
|
b(q, V, K), t.current?.clearDraft();
|
|
34918
34918
|
return;
|
|
34919
34919
|
}
|
|
@@ -34932,17 +34932,22 @@ const N_e = ip(null), A_e = ({ children: e }) => {
|
|
|
34932
34932
|
), j = Ge(() => {
|
|
34933
34933
|
D.current = !0;
|
|
34934
34934
|
const V = C.current ?? q;
|
|
34935
|
-
I.current.add(V), a.transport.cancelStream?.(V), E(V), h(V,
|
|
34935
|
+
I.current.add(V), a.transport.cancelStream?.(V), E(V), h(V, yt.Idle);
|
|
34936
34936
|
}, [q, a.transport, E, h]), z = Ge(
|
|
34937
34937
|
async (V) => {
|
|
34938
|
-
d ===
|
|
34938
|
+
d === yt.Streaming && j(), await R(V);
|
|
34939
34939
|
},
|
|
34940
34940
|
[d, j, R]
|
|
34941
34941
|
);
|
|
34942
34942
|
return {
|
|
34943
34943
|
pendingKey: q,
|
|
34944
34944
|
queuedMessages: u,
|
|
34945
|
-
|
|
34945
|
+
// Multi-user chats report the real status too: the server keeps chat.status
|
|
34946
|
+
// current over socket ChatUpdate events, and the composer needs it to offer
|
|
34947
|
+
// Stop while the agent (and its subagents) are running. Send is never
|
|
34948
|
+
// queue-blocked in multi-user mode, so surfacing the status only affects
|
|
34949
|
+
// the Stop affordance.
|
|
34950
|
+
activeChatStatus: d,
|
|
34946
34951
|
activeChatId: s,
|
|
34947
34952
|
removeQueuedMessage: _,
|
|
34948
34953
|
handleSubmit: H,
|
|
@@ -35442,7 +35447,7 @@ const G_e = ({
|
|
|
35442
35447
|
}
|
|
35443
35448
|
)
|
|
35444
35449
|
] });
|
|
35445
|
-
}, W_e =
|
|
35450
|
+
}, W_e = ft(() => {
|
|
35446
35451
|
const e = Fe(), t = fe((p) => p.composer), n = fe((p) => p.contextKey), r = fe((p) => p.setComposerOptions), a = e.config.models, { data: i, isLoading: o } = r7e(), s = it(() => {
|
|
35447
35452
|
const p = i && i.length > 0 ? i : a;
|
|
35448
35453
|
return I3(p, e.config.transport).filter((m) => !m.contexts?.length || m.contexts.includes(n));
|
|
@@ -35853,7 +35858,7 @@ const Q_e = () => {
|
|
|
35853
35858
|
}
|
|
35854
35859
|
)
|
|
35855
35860
|
] }),
|
|
35856
|
-
/* @__PURE__ */ T("div", { className: "mp-agent-composer-actions-right", children: n ===
|
|
35861
|
+
/* @__PURE__ */ T("div", { className: "mp-agent-composer-actions-right", children: n === yt.Streaming && !et ? /* @__PURE__ */ T(Pn, { content: o.stopStreaming, children: /* @__PURE__ */ T(
|
|
35857
35862
|
"button",
|
|
35858
35863
|
{
|
|
35859
35864
|
type: "button",
|
|
@@ -36878,7 +36883,7 @@ function bwe(e) {
|
|
|
36878
36883
|
...e
|
|
36879
36884
|
});
|
|
36880
36885
|
}
|
|
36881
|
-
const X3 =
|
|
36886
|
+
const X3 = ft(() => {
|
|
36882
36887
|
const e = fe((n) => n.activeChatId ?? n.draftChatKey), t = fe((n) => De(n, e).composerError);
|
|
36883
36888
|
return t ? /* @__PURE__ */ T("div", { className: "mp-agent-composer-error", children: t }) : null;
|
|
36884
36889
|
});
|
|
@@ -36932,7 +36937,7 @@ const kwe = (e, t) => {
|
|
|
36932
36937
|
/* @__PURE__ */ T("pre", { className: "mp-agent-tool-debug-code", children: /* @__PURE__ */ T("code", { children: _s(e.error) }) })
|
|
36933
36938
|
] })
|
|
36934
36939
|
] })
|
|
36935
|
-
] }) : null, Q3 =
|
|
36940
|
+
] }) : null, Q3 = ft(({ call: e }) => {
|
|
36936
36941
|
const t = Fe(), n = e.status === st.Succeeded || e.status === st.Failed;
|
|
36937
36942
|
if (!t.config.debug || n)
|
|
36938
36943
|
return null;
|
|
@@ -37099,7 +37104,7 @@ const J3 = ({ call: e }) => {
|
|
|
37099
37104
|
);
|
|
37100
37105
|
}, I = async (q, Y) => {
|
|
37101
37106
|
if (!(!e.approvalId || d || f || h)) {
|
|
37102
|
-
p(!0), C({ approved: q, ...Y ? { userResponse: Y } : {} }), l(n,
|
|
37107
|
+
p(!0), C({ approved: q, ...Y ? { userResponse: Y } : {} }), l(n, yt.Streaming), u(n, {
|
|
37103
37108
|
id: `pending-approval-${e.id}`,
|
|
37104
37109
|
chat: n,
|
|
37105
37110
|
role: We.Assistant,
|
|
@@ -37126,7 +37131,7 @@ const J3 = ({ call: e }) => {
|
|
|
37126
37131
|
);
|
|
37127
37132
|
W && o(W.id, W.messages), await r();
|
|
37128
37133
|
} catch (Z) {
|
|
37129
|
-
console.error("Failed to send approval:", Z), C({ approved: void 0, userResponse: void 0 }), l(n,
|
|
37134
|
+
console.error("Failed to send approval:", Z), C({ approved: void 0, userResponse: void 0 }), l(n, yt.Idle);
|
|
37130
37135
|
} finally {
|
|
37131
37136
|
u(n, void 0), p(!1);
|
|
37132
37137
|
}
|
|
@@ -37218,14 +37223,14 @@ const J3 = ({ call: e }) => {
|
|
|
37218
37223
|
const p = await r.transport.getChat(n);
|
|
37219
37224
|
a(p), i(n, Ia(p.status));
|
|
37220
37225
|
} catch (p) {
|
|
37221
|
-
console.error("Failed to refresh chat after approval:", p), i(n,
|
|
37226
|
+
console.error("Failed to refresh chat after approval:", p), i(n, yt.Idle);
|
|
37222
37227
|
}
|
|
37223
37228
|
};
|
|
37224
37229
|
return !l && !u ? null : /* @__PURE__ */ re("div", { className: "mp-agent-tool-approval", children: [
|
|
37225
37230
|
l && /* @__PURE__ */ T(xwe, { call: e, messageId: t, chatId: n, onApprovalSent: d }),
|
|
37226
37231
|
u && /* @__PURE__ */ T(J3, { call: e })
|
|
37227
37232
|
] });
|
|
37228
|
-
}, ev =
|
|
37233
|
+
}, ev = ft(({ chatId: e, isExpanded: t }) => {
|
|
37229
37234
|
const n = Fe(), r = fe((d) => De(d, e).messages), a = fe((d) => De(d, e).pendingAssistant), i = fe((d) => d.chats[e]?.contextKey ?? d.contextKey), [o, s] = Ze(t);
|
|
37230
37235
|
t && !o && s(!0);
|
|
37231
37236
|
const l = A3(e, { requireRegisteredChat: !1, enabled: o }), u = it(() => {
|
|
@@ -37252,7 +37257,7 @@ const Ewe = (e) => {
|
|
|
37252
37257
|
default:
|
|
37253
37258
|
return { key: "running", label: "Running", icon: /* @__PURE__ */ T(Na, { size: 12, className: "mp-agent-subagent-spinner" }) };
|
|
37254
37259
|
}
|
|
37255
|
-
}, tv =
|
|
37260
|
+
}, tv = ft(({ call: e, subagentChatId: t }) => {
|
|
37256
37261
|
const [n, r] = Ze(
|
|
37257
37262
|
() => e.status === st.Running || e.status === st.Pending
|
|
37258
37263
|
), a = fe((o) => {
|
|
@@ -37286,7 +37291,7 @@ const Ewe = (e) => {
|
|
|
37286
37291
|
] });
|
|
37287
37292
|
});
|
|
37288
37293
|
tv.displayName = "SubagentToolCall";
|
|
37289
|
-
const zp =
|
|
37294
|
+
const zp = ft(({ call: e, contextKey: t, messageId: n, chatId: r }) => {
|
|
37290
37295
|
const a = Fe(), i = e.subagentChatId || (typeof e.input?.subagentChatId == "string" ? e.input.subagentChatId : void 0), o = it(() => a.getToolRenderer(e), [a, e.name]), s = i ? /* @__PURE__ */ T(tv, { call: e, subagentChatId: i }) : null;
|
|
37291
37296
|
if (!o) {
|
|
37292
37297
|
const l = !!(e.requiresConfirmation && e.approvalId);
|
|
@@ -37311,12 +37316,12 @@ const Mwe = (e) => {
|
|
|
37311
37316
|
return e.role === We.User ? "You" : "AI";
|
|
37312
37317
|
const n = t.split(/\s+/).filter(Boolean);
|
|
37313
37318
|
return n.length >= 2 ? `${n[0][0]}${n[1][0]}`.toUpperCase() : t.slice(0, 2).toUpperCase();
|
|
37314
|
-
}, nv =
|
|
37319
|
+
}, nv = ft(({ message: e }) => {
|
|
37315
37320
|
const t = e.role === We.User;
|
|
37316
37321
|
return /* @__PURE__ */ T("div", { className: `mp-agent-message-avatar ${t ? "mp-agent-message-avatar-user" : ""}`, children: e.sender?.avatarUrl ? /* @__PURE__ */ T("img", { className: "mp-agent-message-avatar-image", src: e.sender.avatarUrl, alt: "" }) : /* @__PURE__ */ T("div", { className: "mp-agent-message-avatar-icon", children: Mwe(e) }) });
|
|
37317
37322
|
});
|
|
37318
37323
|
nv.displayName = "MessageAvatar";
|
|
37319
|
-
const Swe = (e) => e ? new Date(e).toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" }) : "", Nwe = (e) => e.sender?.displayName ? e.sender.displayName : e.sender?.id && e.sender.id !== "guest" ? e.sender.id : e.agentName ? e.agentName : e.role === We.User ? "You" : "Assistant", rv =
|
|
37324
|
+
const Swe = (e) => e ? new Date(e).toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" }) : "", Nwe = (e) => e.sender?.displayName ? e.sender.displayName : e.sender?.id && e.sender.id !== "guest" ? e.sender.id : e.agentName ? e.agentName : e.role === We.User ? "You" : "Assistant", rv = ft(({ message: e }) => {
|
|
37320
37325
|
const t = Nwe(e);
|
|
37321
37326
|
return /* @__PURE__ */ re("div", { className: "mp-agent-message-header", children: [
|
|
37322
37327
|
/* @__PURE__ */ T("span", { className: "mp-agent-message-role", children: t }),
|
|
@@ -37404,14 +37409,14 @@ Wt.prototype.property = "";
|
|
|
37404
37409
|
Wt.prototype.spaceSeparated = !1;
|
|
37405
37410
|
Wt.prototype.space = void 0;
|
|
37406
37411
|
let Lwe = 0;
|
|
37407
|
-
const Te = Rr(),
|
|
37412
|
+
const Te = Rr(), gt = Rr(), Rd = Rr(), le = Rr(), tt = Rr(), Nr = Rr(), Xt = Rr();
|
|
37408
37413
|
function Rr() {
|
|
37409
37414
|
return 2 ** ++Lwe;
|
|
37410
37415
|
}
|
|
37411
37416
|
const Id = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
37412
37417
|
__proto__: null,
|
|
37413
37418
|
boolean: Te,
|
|
37414
|
-
booleanish:
|
|
37419
|
+
booleanish: gt,
|
|
37415
37420
|
commaOrSpaceSeparated: Xt,
|
|
37416
37421
|
commaSeparated: Nr,
|
|
37417
37422
|
number: le,
|
|
@@ -37464,10 +37469,10 @@ function ia(e) {
|
|
|
37464
37469
|
const iv = ia({
|
|
37465
37470
|
properties: {
|
|
37466
37471
|
ariaActiveDescendant: null,
|
|
37467
|
-
ariaAtomic:
|
|
37472
|
+
ariaAtomic: gt,
|
|
37468
37473
|
ariaAutoComplete: null,
|
|
37469
|
-
ariaBusy:
|
|
37470
|
-
ariaChecked:
|
|
37474
|
+
ariaBusy: gt,
|
|
37475
|
+
ariaChecked: gt,
|
|
37471
37476
|
ariaColCount: le,
|
|
37472
37477
|
ariaColIndex: le,
|
|
37473
37478
|
ariaColSpan: le,
|
|
@@ -37475,36 +37480,36 @@ const iv = ia({
|
|
|
37475
37480
|
ariaCurrent: null,
|
|
37476
37481
|
ariaDescribedBy: tt,
|
|
37477
37482
|
ariaDetails: null,
|
|
37478
|
-
ariaDisabled:
|
|
37483
|
+
ariaDisabled: gt,
|
|
37479
37484
|
ariaDropEffect: tt,
|
|
37480
37485
|
ariaErrorMessage: null,
|
|
37481
|
-
ariaExpanded:
|
|
37486
|
+
ariaExpanded: gt,
|
|
37482
37487
|
ariaFlowTo: tt,
|
|
37483
|
-
ariaGrabbed:
|
|
37488
|
+
ariaGrabbed: gt,
|
|
37484
37489
|
ariaHasPopup: null,
|
|
37485
|
-
ariaHidden:
|
|
37490
|
+
ariaHidden: gt,
|
|
37486
37491
|
ariaInvalid: null,
|
|
37487
37492
|
ariaKeyShortcuts: null,
|
|
37488
37493
|
ariaLabel: null,
|
|
37489
37494
|
ariaLabelledBy: tt,
|
|
37490
37495
|
ariaLevel: le,
|
|
37491
37496
|
ariaLive: null,
|
|
37492
|
-
ariaModal:
|
|
37493
|
-
ariaMultiLine:
|
|
37494
|
-
ariaMultiSelectable:
|
|
37497
|
+
ariaModal: gt,
|
|
37498
|
+
ariaMultiLine: gt,
|
|
37499
|
+
ariaMultiSelectable: gt,
|
|
37495
37500
|
ariaOrientation: null,
|
|
37496
37501
|
ariaOwns: tt,
|
|
37497
37502
|
ariaPlaceholder: null,
|
|
37498
37503
|
ariaPosInSet: le,
|
|
37499
|
-
ariaPressed:
|
|
37500
|
-
ariaReadOnly:
|
|
37504
|
+
ariaPressed: gt,
|
|
37505
|
+
ariaReadOnly: gt,
|
|
37501
37506
|
ariaRelevant: null,
|
|
37502
|
-
ariaRequired:
|
|
37507
|
+
ariaRequired: gt,
|
|
37503
37508
|
ariaRoleDescription: tt,
|
|
37504
37509
|
ariaRowCount: le,
|
|
37505
37510
|
ariaRowIndex: le,
|
|
37506
37511
|
ariaRowSpan: le,
|
|
37507
|
-
ariaSelected:
|
|
37512
|
+
ariaSelected: gt,
|
|
37508
37513
|
ariaSetSize: le,
|
|
37509
37514
|
ariaSort: null,
|
|
37510
37515
|
ariaValueMax: le,
|
|
@@ -37563,7 +37568,7 @@ const Dwe = ia({
|
|
|
37563
37568
|
command: null,
|
|
37564
37569
|
commandFor: null,
|
|
37565
37570
|
content: null,
|
|
37566
|
-
contentEditable:
|
|
37571
|
+
contentEditable: gt,
|
|
37567
37572
|
controls: Te,
|
|
37568
37573
|
controlsList: tt,
|
|
37569
37574
|
coords: le | Nr,
|
|
@@ -37577,7 +37582,7 @@ const Dwe = ia({
|
|
|
37577
37582
|
dirName: null,
|
|
37578
37583
|
disabled: Te,
|
|
37579
37584
|
download: Rd,
|
|
37580
|
-
draggable:
|
|
37585
|
+
draggable: gt,
|
|
37581
37586
|
encType: null,
|
|
37582
37587
|
enterKeyHint: null,
|
|
37583
37588
|
fetchPriority: null,
|
|
@@ -37750,7 +37755,7 @@ const Dwe = ia({
|
|
|
37750
37755
|
sizes: null,
|
|
37751
37756
|
slot: null,
|
|
37752
37757
|
span: le,
|
|
37753
|
-
spellCheck:
|
|
37758
|
+
spellCheck: gt,
|
|
37754
37759
|
src: null,
|
|
37755
37760
|
srcDoc: null,
|
|
37756
37761
|
srcLang: null,
|
|
@@ -37765,7 +37770,7 @@ const Dwe = ia({
|
|
|
37765
37770
|
type: null,
|
|
37766
37771
|
typeMustMatch: Te,
|
|
37767
37772
|
useMap: null,
|
|
37768
|
-
value:
|
|
37773
|
+
value: gt,
|
|
37769
37774
|
width: le,
|
|
37770
37775
|
wrap: null,
|
|
37771
37776
|
writingSuggestions: null,
|
|
@@ -37857,7 +37862,7 @@ const Dwe = ia({
|
|
|
37857
37862
|
// `<table>`
|
|
37858
37863
|
scheme: null,
|
|
37859
37864
|
// `<meta>`
|
|
37860
|
-
scrolling:
|
|
37865
|
+
scrolling: gt,
|
|
37861
37866
|
// `<frame>`. Use overflow in the child context
|
|
37862
37867
|
standby: null,
|
|
37863
37868
|
// `<object>`
|
|
@@ -51013,7 +51018,7 @@ function Ir(e) {
|
|
|
51013
51018
|
}
|
|
51014
51019
|
var oo = function(t) {
|
|
51015
51020
|
return t.type === "ordgroup" && t.body.length === 1 ? t.body[0] : t;
|
|
51016
|
-
},
|
|
51021
|
+
}, mt = function(t) {
|
|
51017
51022
|
return t.type === "ordgroup" ? t.body : [t];
|
|
51018
51023
|
}, jn = Q.makeSpan, kTe = ["leftmost", "mbin", "mopen", "mrel", "mop", "mpunct"], vTe = ["rightmost", "mrel", "mclose", "mpunct"], _Te = {
|
|
51019
51024
|
display: Se.DISPLAY,
|
|
@@ -51853,7 +51858,7 @@ me({
|
|
|
51853
51858
|
mode: n.mode,
|
|
51854
51859
|
mclass: "m" + r.slice(5),
|
|
51855
51860
|
// TODO(kevinb): don't prefix with 'm'
|
|
51856
|
-
body:
|
|
51861
|
+
body: mt(a),
|
|
51857
51862
|
isCharacterBox: Ee.isCharacterBox(a)
|
|
51858
51863
|
};
|
|
51859
51864
|
},
|
|
@@ -51878,7 +51883,7 @@ me({
|
|
|
51878
51883
|
type: "mclass",
|
|
51879
51884
|
mode: n.mode,
|
|
51880
51885
|
mclass: Ho(t[0]),
|
|
51881
|
-
body:
|
|
51886
|
+
body: mt(t[1]),
|
|
51882
51887
|
isCharacterBox: Ee.isCharacterBox(t[1])
|
|
51883
51888
|
};
|
|
51884
51889
|
}
|
|
@@ -51903,7 +51908,7 @@ me({
|
|
|
51903
51908
|
parentIsSupSub: !1,
|
|
51904
51909
|
symbol: !1,
|
|
51905
51910
|
suppressBaseShift: r !== "\\stackrel",
|
|
51906
|
-
body:
|
|
51911
|
+
body: mt(a)
|
|
51907
51912
|
}, l = {
|
|
51908
51913
|
type: "supsub",
|
|
51909
51914
|
mode: i.mode,
|
|
@@ -51937,7 +51942,7 @@ me({
|
|
|
51937
51942
|
type: "pmb",
|
|
51938
51943
|
mode: n.mode,
|
|
51939
51944
|
mclass: Ho(t[0]),
|
|
51940
|
-
body:
|
|
51945
|
+
body: mt(t[0])
|
|
51941
51946
|
};
|
|
51942
51947
|
},
|
|
51943
51948
|
htmlBuilder(e, t) {
|
|
@@ -52178,7 +52183,7 @@ me({
|
|
|
52178
52183
|
type: "color",
|
|
52179
52184
|
mode: n.mode,
|
|
52180
52185
|
color: r,
|
|
52181
|
-
body:
|
|
52186
|
+
body: mt(a)
|
|
52182
52187
|
};
|
|
52183
52188
|
},
|
|
52184
52189
|
htmlBuilder: I6,
|
|
@@ -54154,7 +54159,7 @@ me({
|
|
|
54154
54159
|
type: "href",
|
|
54155
54160
|
mode: n.mode,
|
|
54156
54161
|
href: a,
|
|
54157
|
-
body:
|
|
54162
|
+
body: mt(r)
|
|
54158
54163
|
} : n.formatUnsupportedCmd("\\href");
|
|
54159
54164
|
},
|
|
54160
54165
|
htmlBuilder: (e, t) => {
|
|
@@ -54201,7 +54206,7 @@ me({
|
|
|
54201
54206
|
type: "href",
|
|
54202
54207
|
mode: n.mode,
|
|
54203
54208
|
href: r,
|
|
54204
|
-
body:
|
|
54209
|
+
body: mt(s)
|
|
54205
54210
|
};
|
|
54206
54211
|
}
|
|
54207
54212
|
});
|
|
@@ -54221,7 +54226,7 @@ me({
|
|
|
54221
54226
|
return {
|
|
54222
54227
|
type: "hbox",
|
|
54223
54228
|
mode: n.mode,
|
|
54224
|
-
body:
|
|
54229
|
+
body: mt(t[0])
|
|
54225
54230
|
};
|
|
54226
54231
|
},
|
|
54227
54232
|
htmlBuilder(e, t) {
|
|
@@ -54287,7 +54292,7 @@ me({
|
|
|
54287
54292
|
type: "html",
|
|
54288
54293
|
mode: n.mode,
|
|
54289
54294
|
attributes: l,
|
|
54290
|
-
body:
|
|
54295
|
+
body: mt(o)
|
|
54291
54296
|
} : n.formatUnsupportedCmd(r);
|
|
54292
54297
|
},
|
|
54293
54298
|
htmlBuilder: (e, t) => {
|
|
@@ -54314,8 +54319,8 @@ me({
|
|
|
54314
54319
|
return {
|
|
54315
54320
|
type: "htmlmathml",
|
|
54316
54321
|
mode: n.mode,
|
|
54317
|
-
html:
|
|
54318
|
-
mathml:
|
|
54322
|
+
html: mt(t[0]),
|
|
54323
|
+
mathml: mt(t[1])
|
|
54319
54324
|
};
|
|
54320
54325
|
},
|
|
54321
54326
|
htmlBuilder: (e, t) => {
|
|
@@ -54554,10 +54559,10 @@ me({
|
|
|
54554
54559
|
return {
|
|
54555
54560
|
type: "mathchoice",
|
|
54556
54561
|
mode: n.mode,
|
|
54557
|
-
display:
|
|
54558
|
-
text:
|
|
54559
|
-
script:
|
|
54560
|
-
scriptscript:
|
|
54562
|
+
display: mt(t[0]),
|
|
54563
|
+
text: mt(t[1]),
|
|
54564
|
+
script: mt(t[2]),
|
|
54565
|
+
scriptscript: mt(t[3])
|
|
54561
54566
|
};
|
|
54562
54567
|
},
|
|
54563
54568
|
htmlBuilder: (e, t) => {
|
|
@@ -54764,7 +54769,7 @@ me({
|
|
|
54764
54769
|
limits: !1,
|
|
54765
54770
|
parentIsSupSub: !1,
|
|
54766
54771
|
symbol: !1,
|
|
54767
|
-
body:
|
|
54772
|
+
body: mt(r)
|
|
54768
54773
|
};
|
|
54769
54774
|
},
|
|
54770
54775
|
htmlBuilder: la,
|
|
@@ -54913,7 +54918,7 @@ me({
|
|
|
54913
54918
|
return {
|
|
54914
54919
|
type: "operatorname",
|
|
54915
54920
|
mode: n.mode,
|
|
54916
|
-
body:
|
|
54921
|
+
body: mt(a),
|
|
54917
54922
|
alwaysHandleSupSub: r === "\\operatornamewithlimits",
|
|
54918
54923
|
limits: !1,
|
|
54919
54924
|
parentIsSupSub: !1
|
|
@@ -54988,7 +54993,7 @@ me({
|
|
|
54988
54993
|
return {
|
|
54989
54994
|
type: "phantom",
|
|
54990
54995
|
mode: n.mode,
|
|
54991
|
-
body:
|
|
54996
|
+
body: mt(r)
|
|
54992
54997
|
};
|
|
54993
54998
|
},
|
|
54994
54999
|
htmlBuilder: (e, t) => {
|
|
@@ -55031,7 +55036,7 @@ me({
|
|
|
55031
55036
|
}, t), Q.makeSpan(["mord"], [n], t);
|
|
55032
55037
|
},
|
|
55033
55038
|
mathmlBuilder: (e, t) => {
|
|
55034
|
-
var n = Kt(
|
|
55039
|
+
var n = Kt(mt(e.body), t), r = new ae.MathNode("mphantom", n), a = new ae.MathNode("mpadded", [r]);
|
|
55035
55040
|
return a.setAttribute("height", "0px"), a.setAttribute("depth", "0px"), a;
|
|
55036
55041
|
}
|
|
55037
55042
|
});
|
|
@@ -55057,7 +55062,7 @@ me({
|
|
|
55057
55062
|
return Q.makeSpan(["mord", "rlap"], [n, r], t);
|
|
55058
55063
|
},
|
|
55059
55064
|
mathmlBuilder: (e, t) => {
|
|
55060
|
-
var n = Kt(
|
|
55065
|
+
var n = Kt(mt(e.body), t), r = new ae.MathNode("mphantom", n), a = new ae.MathNode("mpadded", [r]);
|
|
55061
55066
|
return a.setAttribute("width", "0px"), a;
|
|
55062
55067
|
}
|
|
55063
55068
|
});
|
|
@@ -55625,7 +55630,7 @@ me({
|
|
|
55625
55630
|
return {
|
|
55626
55631
|
type: "text",
|
|
55627
55632
|
mode: n.mode,
|
|
55628
|
-
body:
|
|
55633
|
+
body: mt(a),
|
|
55629
55634
|
font: r
|
|
55630
55635
|
};
|
|
55631
55636
|
},
|
|
@@ -96868,7 +96873,7 @@ const iVe = {
|
|
|
96868
96873
|
fontSize: "13px",
|
|
96869
96874
|
lineHeight: "1.5",
|
|
96870
96875
|
overflowX: "auto"
|
|
96871
|
-
}, T7 =
|
|
96876
|
+
}, T7 = ft(
|
|
96872
96877
|
({
|
|
96873
96878
|
code: e,
|
|
96874
96879
|
lang: t,
|
|
@@ -96886,7 +96891,7 @@ const iVe = {
|
|
|
96886
96891
|
) : /* @__PURE__ */ T("pre", { className: "mp-agent-code-block-pre", children: /* @__PURE__ */ T("code", { children: e }) })
|
|
96887
96892
|
);
|
|
96888
96893
|
T7.displayName = "CodeContent";
|
|
96889
|
-
const C7 =
|
|
96894
|
+
const C7 = ft(({ lang: e = "text", codeChildren: t, allowExecution: n = !1 }) => {
|
|
96890
96895
|
const { colorMode: r } = A7e(), a = ap(t).replace(/\n$/, ""), i = r === "light" ? JHe : QHe, { truncated: o, isTruncated: s, totalLines: l } = it(() => aVe(a), [a]), [u, d] = Ze(!1), p = Ge(() => d((f) => !f), []), h = u ? a : o, m = it(() => rVe(h), [h]);
|
|
96891
96896
|
return /* @__PURE__ */ re("div", { className: "mp-agent-code-block-wrapper", children: [
|
|
96892
96897
|
/* @__PURE__ */ re("div", { className: "mp-agent-code-block-header", children: [
|
|
@@ -96898,7 +96903,7 @@ const C7 = gt(({ lang: e = "text", codeChildren: t, allowExecution: n = !1 }) =>
|
|
|
96898
96903
|
] });
|
|
96899
96904
|
});
|
|
96900
96905
|
C7.displayName = "CodeBlock";
|
|
96901
|
-
const oVe = (e) => A5(e) ? e.key?.startsWith("code-") ?? !1 : !1, sVe =
|
|
96906
|
+
const oVe = (e) => A5(e) ? e.key?.startsWith("code-") ?? !1 : !1, sVe = ft(({ className: e, children: t }) => {
|
|
96902
96907
|
const n = /language-(\w+)/.exec(e ?? ""), r = n && n[1], a = r === "math", i = typeof t == "string" && t.split(`
|
|
96903
96908
|
`).length === 1;
|
|
96904
96909
|
return a ? /* @__PURE__ */ T(Rt, { children: t }) : i || !n ? /* @__PURE__ */ T("code", { onDoubleClick: (s) => {
|
|
@@ -96908,10 +96913,10 @@ const oVe = (e) => A5(e) ? e.key?.startsWith("code-") ?? !1 : !1, sVe = gt(({ cl
|
|
|
96908
96913
|
u.selectNodeContents(s.currentTarget), l.removeAllRanges(), l.addRange(u);
|
|
96909
96914
|
}
|
|
96910
96915
|
}, className: e || "mp-agent-inline-code", children: t }) : /* @__PURE__ */ T(C7, { lang: r || void 0, codeChildren: t, allowExecution: !1 });
|
|
96911
|
-
}), lVe =
|
|
96916
|
+
}), lVe = ft(({ children: e, ...t }) => {
|
|
96912
96917
|
const r = (Array.isArray(e) ? e : [e]).find(oVe);
|
|
96913
96918
|
return r ? /* @__PURE__ */ T(Rt, { children: r }) : /* @__PURE__ */ T("pre", { className: "mp-agent-markdown-pre", ...t, children: e });
|
|
96914
|
-
}), cVe =
|
|
96919
|
+
}), cVe = ft(({ children: e, ...t }) => /* @__PURE__ */ T("div", { className: "mp-agent-markdown-p", ...t, children: e })), uVe = ft(
|
|
96915
96920
|
({
|
|
96916
96921
|
href: e,
|
|
96917
96922
|
children: t,
|
|
@@ -96930,7 +96935,7 @@ const oVe = (e) => A5(e) ? e.key?.startsWith("code-") ?? !1 : !1, sVe = gt(({ cl
|
|
|
96930
96935
|
}
|
|
96931
96936
|
);
|
|
96932
96937
|
}
|
|
96933
|
-
), dVe =
|
|
96938
|
+
), dVe = ft(
|
|
96934
96939
|
({
|
|
96935
96940
|
src: e,
|
|
96936
96941
|
alt: t,
|
|
@@ -96964,7 +96969,7 @@ const oVe = (e) => A5(e) ? e.key?.startsWith("code-") ?? !1 : !1, sVe = gt(({ cl
|
|
|
96964
96969
|
], mVe = [
|
|
96965
96970
|
eIe,
|
|
96966
96971
|
[wLe, { detect: !0, ignoreMissing: !0 }]
|
|
96967
|
-
], Jh =
|
|
96972
|
+
], Jh = ft(({ text: e, className: t = "mp-agent-message-markdown" }) => /* @__PURE__ */ T(
|
|
96968
96973
|
nSe,
|
|
96969
96974
|
{
|
|
96970
96975
|
className: t,
|
|
@@ -96999,7 +97004,7 @@ const fVe = ({ content: e, role: t }) => {
|
|
|
96999
97004
|
) })
|
|
97000
97005
|
}
|
|
97001
97006
|
);
|
|
97002
|
-
}, e2 =
|
|
97007
|
+
}, e2 = ft(({ reasoning: e, isStreaming: t }) => {
|
|
97003
97008
|
const [n, r] = Ze(!0), a = Ve(null);
|
|
97004
97009
|
return Be(() => {
|
|
97005
97010
|
if (n)
|
|
@@ -97117,13 +97122,13 @@ const I7 = () => /* @__PURE__ */ re("span", { className: "mp-agent-message-typin
|
|
|
97117
97122
|
] }),
|
|
97118
97123
|
/* @__PURE__ */ T("div", { className: "mp-agent-message-group-body", children: l })
|
|
97119
97124
|
] });
|
|
97120
|
-
}, po =
|
|
97125
|
+
}, po = ft(vVe), N5 = [], _Ve = 120, wVe = (e) => {
|
|
97121
97126
|
const t = e.activeChatId;
|
|
97122
97127
|
return t ? e.chatState[t]?.messages ?? N5 : N5;
|
|
97123
97128
|
}, xVe = ({ showParticipantChrome: e = !1 }) => {
|
|
97124
97129
|
const t = fn(), n = fe((S) => S.contextKey), r = fe((S) => S.draftChatKey), a = fe((S) => S.activeChatId), i = fe(wVe), o = a ?? r, s = A3(a), l = fe(
|
|
97125
97130
|
(S) => De(S, o).pendingAssistant?.content?.length
|
|
97126
|
-
), u = fe((S) => De(S, o).pendingAssistant?.id), d = fe((S) => De(S, o).status), p = d ===
|
|
97131
|
+
), u = fe((S) => De(S, o).pendingAssistant?.id), d = fe((S) => De(S, o).status), p = d === yt.Sending || d === yt.Streaming, h = Ve(null), m = Ve(!0), f = Ve(!1), g = Ve(!1), _ = Ve(null), k = bwe({
|
|
97127
97132
|
count: i.length,
|
|
97128
97133
|
getScrollElement: () => h.current,
|
|
97129
97134
|
estimateSize: () => _Ve,
|
|
@@ -97211,7 +97216,7 @@ const I7 = () => /* @__PURE__ */ re("span", { className: "mp-agent-message-typin
|
|
|
97211
97216
|
),
|
|
97212
97217
|
/* @__PURE__ */ T(X3, {})
|
|
97213
97218
|
] });
|
|
97214
|
-
}, EVe =
|
|
97219
|
+
}, EVe = ft(
|
|
97215
97220
|
({
|
|
97216
97221
|
pendingKey: e,
|
|
97217
97222
|
contextKey: t,
|
|
@@ -97220,7 +97225,7 @@ const I7 = () => /* @__PURE__ */ re("span", { className: "mp-agent-message-typin
|
|
|
97220
97225
|
const r = fe((s) => De(s, e)), a = r.pendingAssistant, i = r.status;
|
|
97221
97226
|
if (!a)
|
|
97222
97227
|
return null;
|
|
97223
|
-
const o = i ===
|
|
97228
|
+
const o = i === yt.Sending || i === yt.Streaming;
|
|
97224
97229
|
return /* @__PURE__ */ T(
|
|
97225
97230
|
po,
|
|
97226
97231
|
{
|
|
@@ -97258,11 +97263,11 @@ const SVe = ({ status: e, generating: t }) => {
|
|
|
97258
97263
|
default:
|
|
97259
97264
|
return /* @__PURE__ */ T(L5, { size: 13, className: "mp-agent-plan-task-icon" });
|
|
97260
97265
|
}
|
|
97261
|
-
}, O7 =
|
|
97266
|
+
}, O7 = ft(() => {
|
|
97262
97267
|
const t = Fe().config.planExtractor, n = fe((h) => h.activeChatId), r = fe((h) => n ? De(h, n).messages : void 0), a = fe(
|
|
97263
97268
|
(h) => n ? De(h, n).pendingAssistant : void 0
|
|
97264
97269
|
), i = fe(
|
|
97265
|
-
(h) => n ? De(h, n).status ===
|
|
97270
|
+
(h) => n ? De(h, n).status === yt.Streaming : !1
|
|
97266
97271
|
), [o, s] = Ze(!1), l = it(
|
|
97267
97272
|
() => t && r ? MVe(r, a, t) : void 0,
|
|
97268
97273
|
[t, r, a]
|