@mast-ai/react-ui 0.1.1 → 0.2.0
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/components/AssistantMessage.d.ts +39 -1
- package/dist/components/ConversationPanel.d.ts +20 -1
- package/dist/components/MessageItem.d.ts +13 -1
- package/dist/components/MessageList.d.ts +21 -1
- package/dist/components/ToolCallBlock.d.ts +23 -1
- package/dist/components/ToolLabelContext.d.ts +20 -0
- package/dist/context.d.ts +34 -3
- package/dist/hooks/useAgentStream.d.ts +7 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +527 -461
- package/dist/styles.css +25 -3
- package/dist/themes/tailwind-shadcn.css +55 -0
- package/package.json +4 -3
package/dist/index.js
CHANGED
|
@@ -1,122 +1,134 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
import { jsx as e, jsxs as
|
|
3
|
-
import { AgentRunner as
|
|
4
|
-
import { useVirtualizer as
|
|
5
|
-
function
|
|
1
|
+
import { useState as j, useEffect as G, useRef as R, useCallback as _, createContext as X, useMemo as Z, useContext as Y, lazy as kt, Fragment as lt, Suspense as xt, useId as yt } from "react";
|
|
2
|
+
import { jsx as e, jsxs as I } from "react/jsx-runtime";
|
|
3
|
+
import { AgentRunner as It } from "@mast-ai/core";
|
|
4
|
+
import { useVirtualizer as St } from "@tanstack/react-virtual";
|
|
5
|
+
function at(t, n, r) {
|
|
6
6
|
return { id: crypto.randomUUID(), role: t, text: n, toolEvents: [], isStreaming: r };
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function O(t, n, r) {
|
|
9
9
|
return t.map((s) => s.id === n ? r(s) : s);
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
return
|
|
11
|
+
function z(t, n, r, s) {
|
|
12
|
+
return O(t, n, (a) => {
|
|
13
13
|
let i = !1;
|
|
14
14
|
const l = a.toolEvents.map((o) => !i && o.name === r && o.isStreaming ? (i = !0, s(o)) : o);
|
|
15
15
|
return { ...a, toolEvents: l };
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
return
|
|
18
|
+
function Nt(t, n, r, s, a) {
|
|
19
|
+
return z(t, n, r, (i) => {
|
|
20
20
|
let l = !1;
|
|
21
|
-
const o = (i.nestedToolEvents ?? []).map((
|
|
21
|
+
const o = (i.nestedToolEvents ?? []).map((c) => !l && c.name === s && c.isStreaming ? (l = !0, a(c)) : c);
|
|
22
22
|
return { ...i, nestedToolEvents: o };
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
const [r, s] =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
function wt(t, n) {
|
|
26
|
+
const [r, s] = j(() => (n == null ? void 0 : n.initialEntries) ?? []), [a, i] = j(
|
|
27
|
+
() => t ? [...t.history] : []
|
|
28
|
+
), [l, o] = j(!1);
|
|
29
|
+
G(() => {
|
|
30
|
+
t && i([...t.history]);
|
|
31
|
+
}, [t]);
|
|
32
|
+
const [c, u] = j(0), m = R(null), g = R(n == null ? void 0 : n.onTurnComplete);
|
|
33
|
+
g.current = n == null ? void 0 : n.onTurnComplete, G(() => {
|
|
34
|
+
var b;
|
|
35
|
+
c !== 0 && ((b = g.current) == null || b.call(g, r, a));
|
|
36
|
+
}, [c]);
|
|
37
|
+
const x = (b) => {
|
|
38
|
+
for (let y = b.length - 1; y >= 0; y--) {
|
|
39
|
+
const N = b[y];
|
|
34
40
|
if (N.role === "assistant" && N.isStreaming) return N.id;
|
|
35
41
|
}
|
|
36
|
-
},
|
|
42
|
+
}, T = _((b, y) => {
|
|
37
43
|
s((N) => {
|
|
38
|
-
const
|
|
39
|
-
return
|
|
40
|
-
...
|
|
41
|
-
awaitingApproval:
|
|
44
|
+
const P = x(N);
|
|
45
|
+
return P === void 0 ? N : z(N, P, b, (w) => ({
|
|
46
|
+
...w,
|
|
47
|
+
awaitingApproval: y
|
|
42
48
|
}));
|
|
43
49
|
});
|
|
44
|
-
}, []),
|
|
50
|
+
}, []), A = _((b, y) => {
|
|
45
51
|
s((N) => {
|
|
46
|
-
const
|
|
47
|
-
return
|
|
52
|
+
const P = x(N);
|
|
53
|
+
return P === void 0 ? N : z(N, P, b, (w) => ({ ...w, status: y }));
|
|
48
54
|
});
|
|
49
|
-
}, []),
|
|
50
|
-
(
|
|
55
|
+
}, []), D = _(
|
|
56
|
+
(b, y) => {
|
|
51
57
|
if (l) return;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
58
|
+
if (t === null) {
|
|
59
|
+
console.warn(
|
|
60
|
+
"useAgent().sendMessage was called while no AgentRunner is configured. Pass a non-null `runner` to <AgentProvider> to enable the agent."
|
|
61
|
+
);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const N = at("user", y ?? b, !1), P = at("assistant", "", !0), w = P.id;
|
|
65
|
+
s((S) => [...S, N, P]), o(!0);
|
|
66
|
+
const f = new AbortController();
|
|
67
|
+
m.current = f, (async () => {
|
|
56
68
|
try {
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
(d,
|
|
61
|
-
if (
|
|
69
|
+
const S = t.runStream(
|
|
70
|
+
b,
|
|
71
|
+
f.signal,
|
|
72
|
+
(d, p) => {
|
|
73
|
+
if (p.type === "thinking")
|
|
62
74
|
s(
|
|
63
|
-
(
|
|
64
|
-
...
|
|
65
|
-
subThinking: (
|
|
75
|
+
(h) => z(h, w, d, (M) => ({
|
|
76
|
+
...M,
|
|
77
|
+
subThinking: (M.subThinking ?? "") + p.delta
|
|
66
78
|
}))
|
|
67
79
|
);
|
|
68
|
-
else if (
|
|
80
|
+
else if (p.type === "text_delta")
|
|
69
81
|
s(
|
|
70
|
-
(
|
|
71
|
-
...
|
|
72
|
-
subText: (
|
|
82
|
+
(h) => z(h, w, d, (M) => ({
|
|
83
|
+
...M,
|
|
84
|
+
subText: (M.subText ?? "") + p.delta
|
|
73
85
|
}))
|
|
74
86
|
);
|
|
75
|
-
else if (
|
|
76
|
-
const
|
|
87
|
+
else if (p.type === "tool_call_started") {
|
|
88
|
+
const h = {
|
|
77
89
|
id: crypto.randomUUID(),
|
|
78
90
|
type: "tool_call_started",
|
|
79
|
-
name:
|
|
80
|
-
args:
|
|
91
|
+
name: p.name,
|
|
92
|
+
args: p.args,
|
|
81
93
|
isStreaming: !0
|
|
82
94
|
};
|
|
83
95
|
s(
|
|
84
|
-
(
|
|
85
|
-
...
|
|
86
|
-
nestedToolEvents: [...
|
|
96
|
+
(M) => z(M, w, d, (k) => ({
|
|
97
|
+
...k,
|
|
98
|
+
nestedToolEvents: [...k.nestedToolEvents ?? [], h]
|
|
87
99
|
}))
|
|
88
100
|
);
|
|
89
|
-
} else if (
|
|
90
|
-
const
|
|
101
|
+
} else if (p.type === "tool_call_completed") {
|
|
102
|
+
const h = p;
|
|
91
103
|
s(
|
|
92
|
-
(
|
|
93
|
-
...
|
|
104
|
+
(M) => Nt(M, w, d, h.name, (k) => ({
|
|
105
|
+
...k,
|
|
94
106
|
type: "tool_call_completed",
|
|
95
|
-
result:
|
|
107
|
+
result: h.result,
|
|
96
108
|
isStreaming: !1,
|
|
97
|
-
status:
|
|
109
|
+
status: h.error ? "error" : "success"
|
|
98
110
|
}))
|
|
99
111
|
);
|
|
100
112
|
}
|
|
101
113
|
}
|
|
102
114
|
);
|
|
103
|
-
for await (const d of
|
|
115
|
+
for await (const d of S)
|
|
104
116
|
if (d.type === "text_delta")
|
|
105
117
|
s(
|
|
106
|
-
(
|
|
107
|
-
...
|
|
108
|
-
text:
|
|
118
|
+
(p) => O(p, w, (h) => ({
|
|
119
|
+
...h,
|
|
120
|
+
text: h.text + d.delta
|
|
109
121
|
}))
|
|
110
122
|
);
|
|
111
123
|
else if (d.type === "thinking")
|
|
112
124
|
s(
|
|
113
|
-
(
|
|
114
|
-
...
|
|
115
|
-
thinking: (
|
|
125
|
+
(p) => O(p, w, (h) => ({
|
|
126
|
+
...h,
|
|
127
|
+
thinking: (h.thinking ?? "") + d.delta
|
|
116
128
|
}))
|
|
117
129
|
);
|
|
118
130
|
else if (d.type === "tool_call_started") {
|
|
119
|
-
const
|
|
131
|
+
const p = {
|
|
120
132
|
id: crypto.randomUUID(),
|
|
121
133
|
type: "tool_call_started",
|
|
122
134
|
name: d.name,
|
|
@@ -124,36 +136,36 @@ function xt(t, n) {
|
|
|
124
136
|
isStreaming: !0
|
|
125
137
|
};
|
|
126
138
|
s(
|
|
127
|
-
(
|
|
128
|
-
...
|
|
129
|
-
toolEvents: [...
|
|
139
|
+
(h) => O(h, w, (M) => ({
|
|
140
|
+
...M,
|
|
141
|
+
toolEvents: [...M.toolEvents, p]
|
|
130
142
|
}))
|
|
131
143
|
);
|
|
132
144
|
} else if (d.type === "tool_call_completed")
|
|
133
145
|
s(
|
|
134
|
-
(
|
|
135
|
-
...
|
|
146
|
+
(p) => z(p, w, d.name, (h) => ({
|
|
147
|
+
...h,
|
|
136
148
|
type: "tool_call_completed",
|
|
137
149
|
result: d.result,
|
|
138
150
|
isStreaming: !1,
|
|
139
151
|
// Preserve a status set by the proxy (e.g. 'cancelled'); only
|
|
140
152
|
// fall back to error/success based on the runner's flag.
|
|
141
|
-
status:
|
|
153
|
+
status: h.status ?? (d.error ? "error" : "success")
|
|
142
154
|
}))
|
|
143
155
|
);
|
|
144
156
|
else if (d.type === "done") {
|
|
145
|
-
const
|
|
157
|
+
const p = d.history;
|
|
146
158
|
s(
|
|
147
|
-
(
|
|
148
|
-
...
|
|
159
|
+
(h) => O(h, w, (M) => ({
|
|
160
|
+
...M,
|
|
149
161
|
text: d.output,
|
|
150
162
|
isStreaming: !1
|
|
151
163
|
}))
|
|
152
|
-
), i(
|
|
164
|
+
), i(p), u((h) => h + 1);
|
|
153
165
|
}
|
|
154
166
|
} catch {
|
|
155
167
|
s(
|
|
156
|
-
(
|
|
168
|
+
(S) => O(S, w, (d) => ({ ...d, isStreaming: !1 }))
|
|
157
169
|
);
|
|
158
170
|
} finally {
|
|
159
171
|
o(!1);
|
|
@@ -161,25 +173,25 @@ function xt(t, n) {
|
|
|
161
173
|
})();
|
|
162
174
|
},
|
|
163
175
|
[t, l]
|
|
164
|
-
),
|
|
165
|
-
var
|
|
166
|
-
(
|
|
167
|
-
}, []),
|
|
168
|
-
var
|
|
169
|
-
(
|
|
176
|
+
), C = _(() => {
|
|
177
|
+
var b;
|
|
178
|
+
(b = m.current) == null || b.abort();
|
|
179
|
+
}, []), E = _(() => {
|
|
180
|
+
var b;
|
|
181
|
+
(b = m.current) == null || b.abort(), m.current = null, s([]), i([]), o(!1);
|
|
170
182
|
}, []);
|
|
171
183
|
return {
|
|
172
184
|
entries: r,
|
|
173
185
|
history: a,
|
|
174
186
|
isRunning: l,
|
|
175
|
-
sendMessage:
|
|
176
|
-
cancel:
|
|
177
|
-
reset:
|
|
178
|
-
setToolAwaitingApproval:
|
|
179
|
-
setToolStatus:
|
|
187
|
+
sendMessage: D,
|
|
188
|
+
cancel: C,
|
|
189
|
+
reset: E,
|
|
190
|
+
setToolAwaitingApproval: T,
|
|
191
|
+
setToolStatus: A
|
|
180
192
|
};
|
|
181
193
|
}
|
|
182
|
-
const
|
|
194
|
+
const V = {
|
|
183
195
|
width: 16,
|
|
184
196
|
height: 16,
|
|
185
197
|
viewBox: "0 0 24 24",
|
|
@@ -191,78 +203,78 @@ const K = {
|
|
|
191
203
|
"aria-hidden": !0,
|
|
192
204
|
focusable: !1
|
|
193
205
|
};
|
|
194
|
-
function
|
|
195
|
-
return /* @__PURE__ */
|
|
206
|
+
function Tt() {
|
|
207
|
+
return /* @__PURE__ */ I("svg", { ...V, children: [
|
|
196
208
|
/* @__PURE__ */ e("path", { d: "M9 3a3 3 0 0 0-3 3v.5a3 3 0 0 0-2 5.2A3 3 0 0 0 6 17v.5a3 3 0 0 0 6 0V3a3 3 0 0 0-3 0Z" }),
|
|
197
209
|
/* @__PURE__ */ e("path", { d: "M15 3a3 3 0 0 1 3 3v.5a3 3 0 0 1 2 5.2A3 3 0 0 1 18 17v.5a3 3 0 0 1-6 0V3a3 3 0 0 1 3 0Z" })
|
|
198
210
|
] });
|
|
199
211
|
}
|
|
200
|
-
function
|
|
201
|
-
return /* @__PURE__ */ e("svg", { ...
|
|
212
|
+
function At() {
|
|
213
|
+
return /* @__PURE__ */ e("svg", { ...V, children: /* @__PURE__ */ e("path", { d: "M14.7 6.3a4 4 0 0 0-5.4 5.4L3 18l3 3 6.3-6.3a4 4 0 0 0 5.4-5.4l-2.6 2.6-2.4-2.4 2.6-2.6Z" }) });
|
|
202
214
|
}
|
|
203
|
-
function
|
|
204
|
-
return /* @__PURE__ */
|
|
215
|
+
function Ct() {
|
|
216
|
+
return /* @__PURE__ */ I("svg", { ...V, children: [
|
|
205
217
|
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "9" }),
|
|
206
218
|
/* @__PURE__ */ e("path", { d: "m8 12 3 3 5-6" })
|
|
207
219
|
] });
|
|
208
220
|
}
|
|
209
|
-
function
|
|
210
|
-
return /* @__PURE__ */
|
|
221
|
+
function Et() {
|
|
222
|
+
return /* @__PURE__ */ I("svg", { ...V, children: [
|
|
211
223
|
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "9" }),
|
|
212
224
|
/* @__PURE__ */ e("path", { d: "m9 9 6 6" }),
|
|
213
225
|
/* @__PURE__ */ e("path", { d: "m15 9-6 6" })
|
|
214
226
|
] });
|
|
215
227
|
}
|
|
216
|
-
function
|
|
217
|
-
return /* @__PURE__ */
|
|
228
|
+
function Mt() {
|
|
229
|
+
return /* @__PURE__ */ I("svg", { ...V, children: [
|
|
218
230
|
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "9" }),
|
|
219
231
|
/* @__PURE__ */ e("path", { d: "M5.5 5.5 18.5 18.5" })
|
|
220
232
|
] });
|
|
221
233
|
}
|
|
222
|
-
function
|
|
223
|
-
return /* @__PURE__ */ e("svg", { ...
|
|
234
|
+
function Pt() {
|
|
235
|
+
return /* @__PURE__ */ e("svg", { ...V, className: "mast-spin", children: /* @__PURE__ */ e("path", { d: "M12 3a9 9 0 1 0 9 9" }) });
|
|
224
236
|
}
|
|
225
|
-
function
|
|
226
|
-
return /* @__PURE__ */ e("svg", { ...
|
|
237
|
+
function Rt() {
|
|
238
|
+
return /* @__PURE__ */ e("svg", { ...V, fill: "currentColor", stroke: "none", children: /* @__PURE__ */ e("path", { d: "M3 3 21 12 3 21l3-9-3-9Z" }) });
|
|
227
239
|
}
|
|
228
|
-
function
|
|
229
|
-
return /* @__PURE__ */ e("svg", { ...
|
|
230
|
-
}
|
|
231
|
-
const
|
|
232
|
-
brain: /* @__PURE__ */ e(
|
|
233
|
-
wrench: /* @__PURE__ */ e(
|
|
234
|
-
check: /* @__PURE__ */ e(
|
|
235
|
-
error: /* @__PURE__ */ e(
|
|
236
|
-
cancelled: /* @__PURE__ */ e(
|
|
237
|
-
loader: /* @__PURE__ */ e(
|
|
238
|
-
send: /* @__PURE__ */ e(
|
|
239
|
-
stop: /* @__PURE__ */ e(
|
|
240
|
-
},
|
|
241
|
-
function
|
|
242
|
-
const r =
|
|
243
|
-
brain: t.brain ??
|
|
244
|
-
wrench: t.wrench ??
|
|
245
|
-
check: t.check ??
|
|
246
|
-
error: t.error ??
|
|
247
|
-
cancelled: t.cancelled ??
|
|
248
|
-
loader: t.loader ??
|
|
249
|
-
send: t.send ??
|
|
250
|
-
stop: t.stop ??
|
|
251
|
-
} :
|
|
252
|
-
return /* @__PURE__ */ e(
|
|
253
|
-
}
|
|
254
|
-
function
|
|
255
|
-
return
|
|
256
|
-
}
|
|
257
|
-
const
|
|
258
|
-
function
|
|
240
|
+
function _t() {
|
|
241
|
+
return /* @__PURE__ */ e("svg", { ...V, fill: "currentColor", stroke: "none", children: /* @__PURE__ */ e("rect", { x: "5", y: "5", width: "14", height: "14", rx: "1" }) });
|
|
242
|
+
}
|
|
243
|
+
const U = {
|
|
244
|
+
brain: /* @__PURE__ */ e(Tt, {}),
|
|
245
|
+
wrench: /* @__PURE__ */ e(At, {}),
|
|
246
|
+
check: /* @__PURE__ */ e(Ct, {}),
|
|
247
|
+
error: /* @__PURE__ */ e(Et, {}),
|
|
248
|
+
cancelled: /* @__PURE__ */ e(Mt, {}),
|
|
249
|
+
loader: /* @__PURE__ */ e(Pt, {}),
|
|
250
|
+
send: /* @__PURE__ */ e(Rt, {}),
|
|
251
|
+
stop: /* @__PURE__ */ e(_t, {})
|
|
252
|
+
}, ot = X(U);
|
|
253
|
+
function Dt({ icons: t, children: n }) {
|
|
254
|
+
const r = Z(() => t ? {
|
|
255
|
+
brain: t.brain ?? U.brain,
|
|
256
|
+
wrench: t.wrench ?? U.wrench,
|
|
257
|
+
check: t.check ?? U.check,
|
|
258
|
+
error: t.error ?? U.error,
|
|
259
|
+
cancelled: t.cancelled ?? U.cancelled,
|
|
260
|
+
loader: t.loader ?? U.loader,
|
|
261
|
+
send: t.send ?? U.send,
|
|
262
|
+
stop: t.stop ?? U.stop
|
|
263
|
+
} : U, [t]);
|
|
264
|
+
return /* @__PURE__ */ e(ot.Provider, { value: r, children: n });
|
|
265
|
+
}
|
|
266
|
+
function J() {
|
|
267
|
+
return Y(ot);
|
|
268
|
+
}
|
|
269
|
+
const $t = Symbol.for("@mast-ai/react-ui.INLINE_APPROVAL"), jt = "User cancelled the tool call.";
|
|
270
|
+
function Lt(t, n) {
|
|
259
271
|
let r = !1, s = !1;
|
|
260
272
|
if (n)
|
|
261
273
|
for (const a of n)
|
|
262
274
|
a.startsWith("!") ? a.slice(1) === t.name && (s = !0) : a === t.name && (r = !0);
|
|
263
275
|
return (t.requiresApproval === !0 || r) && !s;
|
|
264
276
|
}
|
|
265
|
-
class
|
|
277
|
+
class Bt {
|
|
266
278
|
constructor(n, r, s) {
|
|
267
279
|
this.inner = n, this.onApprovalRequired = r, this.hooks = s;
|
|
268
280
|
}
|
|
@@ -270,40 +282,40 @@ class Rt {
|
|
|
270
282
|
return this.inner.definition();
|
|
271
283
|
}
|
|
272
284
|
async call(n, r) {
|
|
273
|
-
var i, l, o, u, m
|
|
285
|
+
var i, l, o, c, u, m;
|
|
274
286
|
const s = this.inner.definition();
|
|
275
287
|
(l = (i = this.hooks).notifyAwaiting) == null || l.call(i, s.name, !0);
|
|
276
288
|
let a;
|
|
277
289
|
try {
|
|
278
|
-
const
|
|
290
|
+
const g = await this.onApprovalRequired({
|
|
279
291
|
id: "",
|
|
280
292
|
type: "tool_call_started",
|
|
281
293
|
name: s.name,
|
|
282
294
|
args: n,
|
|
283
295
|
isStreaming: !0
|
|
284
296
|
});
|
|
285
|
-
|
|
297
|
+
g === $t ? this.hooks.enqueueInline ? a = await this.hooks.enqueueInline(s.name, n) : a = !0 : a = g;
|
|
286
298
|
} finally {
|
|
287
|
-
(
|
|
299
|
+
(c = (o = this.hooks).notifyAwaiting) == null || c.call(o, s.name, !1);
|
|
288
300
|
}
|
|
289
|
-
return a === !1 ? ((
|
|
301
|
+
return a === !1 ? ((m = (u = this.hooks).setStatus) == null || m.call(u, s.name, "cancelled"), jt) : typeof a == "string" ? a : this.inner.call(n, r);
|
|
290
302
|
}
|
|
291
303
|
}
|
|
292
|
-
function
|
|
304
|
+
function Ut(t, n, r, s = {}) {
|
|
293
305
|
return {
|
|
294
306
|
getTools: () => t.getTools(),
|
|
295
307
|
getTool: (a) => {
|
|
296
308
|
const i = t.getTool(a);
|
|
297
309
|
if (!i) return;
|
|
298
310
|
const l = i.definition();
|
|
299
|
-
if (!
|
|
311
|
+
if (!Lt(l, r())) return i;
|
|
300
312
|
const o = n();
|
|
301
|
-
return o ? new
|
|
313
|
+
return o ? new Bt(i, o, s) : i;
|
|
302
314
|
}
|
|
303
315
|
};
|
|
304
316
|
}
|
|
305
|
-
const
|
|
306
|
-
function
|
|
317
|
+
const ct = X(null);
|
|
318
|
+
function ue({
|
|
307
319
|
runner: t,
|
|
308
320
|
agent: n,
|
|
309
321
|
children: r,
|
|
@@ -312,98 +324,110 @@ function re({
|
|
|
312
324
|
approvalOverride: i,
|
|
313
325
|
initialHistory: l,
|
|
314
326
|
initialEntries: o,
|
|
315
|
-
onConversationChange:
|
|
327
|
+
onConversationChange: c,
|
|
328
|
+
theme: u,
|
|
329
|
+
disableRoot: m
|
|
316
330
|
}) {
|
|
317
|
-
const
|
|
318
|
-
|
|
319
|
-
const
|
|
320
|
-
|
|
321
|
-
const
|
|
322
|
-
|
|
323
|
-
const
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
331
|
+
const g = R(c);
|
|
332
|
+
g.current = c;
|
|
333
|
+
const x = R(l), T = R(o), A = R(a);
|
|
334
|
+
A.current = a;
|
|
335
|
+
const D = R(i);
|
|
336
|
+
D.current = i;
|
|
337
|
+
const C = R(null), E = R(null), b = R(null), y = Z(() => {
|
|
338
|
+
if (t === null) return null;
|
|
339
|
+
const $ = a !== void 0, H = i !== void 0 && i.length > 0;
|
|
340
|
+
if (!$ && !H) return t;
|
|
341
|
+
const F = {
|
|
342
|
+
notifyAwaiting: (K, L) => {
|
|
343
|
+
var B;
|
|
344
|
+
return (B = C.current) == null ? void 0 : B.call(C, K, L);
|
|
330
345
|
},
|
|
331
|
-
setStatus: (
|
|
332
|
-
var
|
|
333
|
-
return (
|
|
346
|
+
setStatus: (K, L) => {
|
|
347
|
+
var B;
|
|
348
|
+
return (B = E.current) == null ? void 0 : B.call(E, K, L);
|
|
334
349
|
},
|
|
335
|
-
enqueueInline: (
|
|
336
|
-
var
|
|
337
|
-
return ((
|
|
350
|
+
enqueueInline: (K, L) => {
|
|
351
|
+
var B;
|
|
352
|
+
return ((B = b.current) == null ? void 0 : B.call(b, K, L)) ?? Promise.resolve(!0);
|
|
338
353
|
}
|
|
339
|
-
},
|
|
354
|
+
}, q = Ut(
|
|
340
355
|
t.registry,
|
|
341
|
-
() =>
|
|
342
|
-
() =>
|
|
343
|
-
|
|
356
|
+
() => A.current,
|
|
357
|
+
() => D.current,
|
|
358
|
+
F
|
|
344
359
|
);
|
|
345
|
-
return new
|
|
346
|
-
}, [t, a, i]), [
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
360
|
+
return new It(t.adapter, q);
|
|
361
|
+
}, [t, a, i]), [N, P] = j(() => {
|
|
362
|
+
if (y === null) return null;
|
|
363
|
+
const $ = y.conversation(n);
|
|
364
|
+
return x.current && x.current.length > 0 && ($.history = [...x.current]), $;
|
|
365
|
+
});
|
|
366
|
+
G(() => {
|
|
367
|
+
if (y !== null && N === null) {
|
|
368
|
+
const $ = y.conversation(n);
|
|
369
|
+
x.current && x.current.length > 0 && ($.history = [...x.current]), P($);
|
|
370
|
+
}
|
|
371
|
+
}, [y, N, n]);
|
|
372
|
+
const w = _(
|
|
373
|
+
($, H) => {
|
|
374
|
+
var F;
|
|
375
|
+
(F = g.current) == null || F.call(g, H, $);
|
|
353
376
|
},
|
|
354
377
|
[]
|
|
355
378
|
), {
|
|
356
|
-
entries:
|
|
357
|
-
history:
|
|
358
|
-
sendMessage:
|
|
359
|
-
cancel:
|
|
360
|
-
isRunning:
|
|
361
|
-
reset:
|
|
362
|
-
setToolAwaitingApproval:
|
|
363
|
-
setToolStatus:
|
|
364
|
-
} =
|
|
365
|
-
initialEntries:
|
|
366
|
-
onTurnComplete:
|
|
379
|
+
entries: f,
|
|
380
|
+
history: v,
|
|
381
|
+
sendMessage: S,
|
|
382
|
+
cancel: d,
|
|
383
|
+
isRunning: p,
|
|
384
|
+
reset: h,
|
|
385
|
+
setToolAwaitingApproval: M,
|
|
386
|
+
setToolStatus: k
|
|
387
|
+
} = wt(N, {
|
|
388
|
+
initialEntries: T.current,
|
|
389
|
+
onTurnComplete: w
|
|
367
390
|
});
|
|
368
|
-
|
|
369
|
-
const [
|
|
370
|
-
|
|
371
|
-
const
|
|
372
|
-
const
|
|
373
|
-
|
|
374
|
-
},
|
|
391
|
+
C.current = M, E.current = k;
|
|
392
|
+
const [W, et] = j([]), nt = R(W);
|
|
393
|
+
nt.current = W;
|
|
394
|
+
const ft = _(($, H) => new Promise((F) => {
|
|
395
|
+
const q = (L) => {
|
|
396
|
+
et((B) => B.filter((vt) => vt !== K)), F(L);
|
|
397
|
+
}, K = {
|
|
375
398
|
toolName: $,
|
|
376
|
-
args:
|
|
377
|
-
approve: () =>
|
|
378
|
-
reject: () =>
|
|
379
|
-
respondWith: (
|
|
399
|
+
args: H,
|
|
400
|
+
approve: () => q(!0),
|
|
401
|
+
reject: () => q(!1),
|
|
402
|
+
respondWith: (L) => q(L)
|
|
380
403
|
};
|
|
381
|
-
|
|
404
|
+
et((L) => [...L, K]);
|
|
382
405
|
}), []);
|
|
383
|
-
|
|
384
|
-
const
|
|
385
|
-
|
|
386
|
-
}, [
|
|
406
|
+
b.current = ft;
|
|
407
|
+
const st = _(() => {
|
|
408
|
+
nt.current.forEach(($) => $.reject()), h(), P(y === null ? null : y.conversation(n));
|
|
409
|
+
}, [h, y, n]), rt = y !== null, gt = Z(
|
|
387
410
|
() => ({
|
|
388
|
-
messages:
|
|
389
|
-
history:
|
|
390
|
-
sendMessage:
|
|
391
|
-
cancel:
|
|
392
|
-
isRunning:
|
|
393
|
-
reset:
|
|
394
|
-
pendingApprovals:
|
|
411
|
+
messages: f,
|
|
412
|
+
history: v,
|
|
413
|
+
sendMessage: S,
|
|
414
|
+
cancel: d,
|
|
415
|
+
isRunning: p,
|
|
416
|
+
reset: st,
|
|
417
|
+
pendingApprovals: W,
|
|
418
|
+
isReady: rt
|
|
395
419
|
}),
|
|
396
|
-
[
|
|
397
|
-
);
|
|
398
|
-
return /* @__PURE__ */ e(
|
|
420
|
+
[f, v, S, d, p, st, W, rt]
|
|
421
|
+
), bt = m ? r : /* @__PURE__ */ e("div", { "data-mast-root": !0, "data-mast-theme": u, children: r });
|
|
422
|
+
return /* @__PURE__ */ e(ct.Provider, { value: gt, children: /* @__PURE__ */ e(Dt, { icons: s, children: bt }) });
|
|
399
423
|
}
|
|
400
|
-
function
|
|
401
|
-
const t =
|
|
424
|
+
function Q() {
|
|
425
|
+
const t = Y(ct);
|
|
402
426
|
if (!t)
|
|
403
427
|
throw new Error("useAgent() must be called from a component rendered inside <AgentProvider>.");
|
|
404
428
|
return t;
|
|
405
429
|
}
|
|
406
|
-
function
|
|
430
|
+
function Kt(t) {
|
|
407
431
|
if (t === void 0) return "";
|
|
408
432
|
if (typeof t == "string") return t;
|
|
409
433
|
try {
|
|
@@ -412,16 +436,16 @@ function $t(t) {
|
|
|
412
436
|
return String(t);
|
|
413
437
|
}
|
|
414
438
|
}
|
|
415
|
-
function
|
|
416
|
-
const a =
|
|
417
|
-
return /* @__PURE__ */
|
|
418
|
-
/* @__PURE__ */
|
|
439
|
+
function Vt({ entry: t, approve: n, reject: r, className: s }) {
|
|
440
|
+
const a = J(), i = ["mast-inline-approval", s].filter(Boolean).join(" "), l = Kt(t.args);
|
|
441
|
+
return /* @__PURE__ */ I("div", { "data-mast-inline-approval": !0, "data-tool-name": t.name, className: i, children: [
|
|
442
|
+
/* @__PURE__ */ I("div", { className: "mast-inline-approval-header", children: [
|
|
419
443
|
/* @__PURE__ */ e("span", { className: "mast-inline-approval-icon", "aria-hidden": "true", children: a.wrench }),
|
|
420
444
|
/* @__PURE__ */ e("span", { className: "mast-inline-approval-name", children: t.name }),
|
|
421
445
|
/* @__PURE__ */ e("span", { className: "mast-inline-approval-label", children: "requires approval" })
|
|
422
446
|
] }),
|
|
423
447
|
l ? /* @__PURE__ */ e("pre", { className: "mast-inline-approval-args", children: /* @__PURE__ */ e("code", { children: l }) }) : null,
|
|
424
|
-
/* @__PURE__ */
|
|
448
|
+
/* @__PURE__ */ I("div", { className: "mast-inline-approval-actions", children: [
|
|
425
449
|
/* @__PURE__ */ e(
|
|
426
450
|
"button",
|
|
427
451
|
{
|
|
@@ -443,15 +467,15 @@ function jt({ entry: t, approve: n, reject: r, className: s }) {
|
|
|
443
467
|
] })
|
|
444
468
|
] });
|
|
445
469
|
}
|
|
446
|
-
function
|
|
470
|
+
function ut({
|
|
447
471
|
content: t,
|
|
448
472
|
isStreaming: n = !1,
|
|
449
473
|
className: r,
|
|
450
474
|
label: s = "Thinking Process",
|
|
451
475
|
open: a
|
|
452
476
|
}) {
|
|
453
|
-
const i =
|
|
454
|
-
return /* @__PURE__ */
|
|
477
|
+
const i = J(), l = ["mast-thinking-block", r].filter(Boolean).join(" ");
|
|
478
|
+
return /* @__PURE__ */ I(
|
|
455
479
|
"details",
|
|
456
480
|
{
|
|
457
481
|
"data-mast-thinking-block": !0,
|
|
@@ -459,7 +483,7 @@ function lt({
|
|
|
459
483
|
className: l,
|
|
460
484
|
open: a,
|
|
461
485
|
children: [
|
|
462
|
-
/* @__PURE__ */
|
|
486
|
+
/* @__PURE__ */ I("summary", { className: "mast-thinking-block-summary", children: [
|
|
463
487
|
/* @__PURE__ */ e("span", { className: "mast-thinking-block-icon", "aria-hidden": "true", children: i.brain }),
|
|
464
488
|
/* @__PURE__ */ e("span", { className: "mast-thinking-block-label", children: s }),
|
|
465
489
|
n ? /* @__PURE__ */ e(
|
|
@@ -476,7 +500,8 @@ function lt({
|
|
|
476
500
|
}
|
|
477
501
|
);
|
|
478
502
|
}
|
|
479
|
-
|
|
503
|
+
const dt = X(void 0);
|
|
504
|
+
function it(t) {
|
|
480
505
|
if (t === void 0) return "";
|
|
481
506
|
if (typeof t == "string") return t;
|
|
482
507
|
try {
|
|
@@ -485,7 +510,7 @@ function et(t) {
|
|
|
485
510
|
return String(t);
|
|
486
511
|
}
|
|
487
512
|
}
|
|
488
|
-
function
|
|
513
|
+
function Wt(t, n) {
|
|
489
514
|
if (t.isStreaming) return n.loader;
|
|
490
515
|
switch (t.status) {
|
|
491
516
|
case "error":
|
|
@@ -496,60 +521,72 @@ function Lt(t, n) {
|
|
|
496
521
|
return n.check;
|
|
497
522
|
}
|
|
498
523
|
}
|
|
499
|
-
function
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
524
|
+
function zt(t, n) {
|
|
525
|
+
return t === "streaming" ? n ? !0 : void 0 : t;
|
|
526
|
+
}
|
|
527
|
+
function mt({
|
|
528
|
+
entry: t,
|
|
529
|
+
className: n,
|
|
530
|
+
defaultOpen: r = "streaming",
|
|
531
|
+
label: s
|
|
532
|
+
}) {
|
|
533
|
+
const a = J(), i = Y(dt), l = ["mast-tool-call-block", n].filter(Boolean).join(" "), o = t.subThinking !== void 0 || t.subText !== void 0, c = t.nestedToolEvents ?? [], u = Wt(t, a), m = it(t.args), g = it(t.result), x = zt(r, t.isStreaming), T = s ?? (i == null ? void 0 : i(t)) ?? t.name;
|
|
534
|
+
return /* @__PURE__ */ I(
|
|
535
|
+
"details",
|
|
503
536
|
{
|
|
504
537
|
"data-mast-tool-call-block": !0,
|
|
505
538
|
"data-streaming": t.isStreaming ? "true" : void 0,
|
|
506
539
|
"data-status": t.status,
|
|
507
540
|
"data-tool-name": t.name,
|
|
508
|
-
className:
|
|
541
|
+
className: l,
|
|
542
|
+
open: x,
|
|
509
543
|
children: [
|
|
510
|
-
/* @__PURE__ */
|
|
544
|
+
/* @__PURE__ */ I("summary", { className: "mast-tool-call-block-header", children: [
|
|
545
|
+
/* @__PURE__ */ e("span", { className: "mast-tool-call-block-chevron", "aria-hidden": "true", children: "▸" }),
|
|
511
546
|
/* @__PURE__ */ e(
|
|
512
547
|
"span",
|
|
513
548
|
{
|
|
514
549
|
className: "mast-tool-call-block-status",
|
|
515
550
|
"data-testid": "mast-tool-call-status",
|
|
516
551
|
"aria-hidden": "true",
|
|
517
|
-
children:
|
|
552
|
+
children: u
|
|
518
553
|
}
|
|
519
554
|
),
|
|
520
|
-
/* @__PURE__ */ e("span", { className: "mast-tool-call-block-wrench", "aria-hidden": "true", children:
|
|
521
|
-
/* @__PURE__ */ e("span", { className: "mast-tool-call-block-name", children:
|
|
555
|
+
/* @__PURE__ */ e("span", { className: "mast-tool-call-block-wrench", "aria-hidden": "true", children: a.wrench }),
|
|
556
|
+
/* @__PURE__ */ e("span", { className: "mast-tool-call-block-name", children: T })
|
|
522
557
|
] }),
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
/* @__PURE__ */
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
/* @__PURE__ */
|
|
542
|
-
|
|
543
|
-
|
|
558
|
+
/* @__PURE__ */ I("div", { className: "mast-tool-call-block-body", children: [
|
|
559
|
+
o ? /* @__PURE__ */ I("div", { className: "mast-tool-call-block-sub-output", children: [
|
|
560
|
+
t.subThinking !== void 0 ? /* @__PURE__ */ e(
|
|
561
|
+
ut,
|
|
562
|
+
{
|
|
563
|
+
content: t.subThinking,
|
|
564
|
+
isStreaming: t.isStreaming,
|
|
565
|
+
className: "mast-tool-call-block-sub-thinking",
|
|
566
|
+
open: t.isStreaming ? !0 : void 0
|
|
567
|
+
}
|
|
568
|
+
) : null,
|
|
569
|
+
t.subText !== void 0 ? /* @__PURE__ */ e("div", { className: "mast-tool-call-block-sub-text", "data-testid": "mast-tool-call-sub-text", children: t.subText }) : null
|
|
570
|
+
] }) : null,
|
|
571
|
+
c.length > 0 ? /* @__PURE__ */ e("div", { className: "mast-tool-call-block-nested", "data-testid": "mast-tool-call-nested", children: c.map((A) => /* @__PURE__ */ e(mt, { entry: A }, A.id)) }) : null,
|
|
572
|
+
m ? /* @__PURE__ */ I("details", { className: "mast-tool-call-block-args", children: [
|
|
573
|
+
/* @__PURE__ */ e("summary", { children: "Arguments" }),
|
|
574
|
+
/* @__PURE__ */ e("pre", { className: "mast-tool-call-block-pre", children: /* @__PURE__ */ e("code", { children: m }) })
|
|
575
|
+
] }) : null,
|
|
576
|
+
!t.isStreaming && g ? /* @__PURE__ */ I("details", { className: "mast-tool-call-block-result", children: [
|
|
577
|
+
/* @__PURE__ */ e("summary", { children: "Result" }),
|
|
578
|
+
/* @__PURE__ */ e("pre", { className: "mast-tool-call-block-pre", children: /* @__PURE__ */ e("code", { children: g }) })
|
|
579
|
+
] }) : null
|
|
580
|
+
] })
|
|
544
581
|
]
|
|
545
582
|
}
|
|
546
583
|
);
|
|
547
584
|
}
|
|
548
|
-
function
|
|
585
|
+
function Ft({ entry: t, className: n }) {
|
|
549
586
|
const r = ["mast-user-message", n].filter(Boolean).join(" ");
|
|
550
587
|
return /* @__PURE__ */ e("div", { "data-mast-user-message": !0, className: r, children: /* @__PURE__ */ e("div", { className: "mast-user-message-bubble", children: t.text }) });
|
|
551
588
|
}
|
|
552
|
-
const
|
|
589
|
+
const Ot = kt(async () => {
|
|
553
590
|
try {
|
|
554
591
|
const [{ default: t }, { default: n }, { default: r }] = await Promise.all([
|
|
555
592
|
import("react-markdown"),
|
|
@@ -565,39 +602,41 @@ const Ut = pt(async () => {
|
|
|
565
602
|
};
|
|
566
603
|
}
|
|
567
604
|
});
|
|
568
|
-
function
|
|
605
|
+
function Ht({
|
|
569
606
|
entry: t,
|
|
570
607
|
className: n,
|
|
571
608
|
renderMessage: r,
|
|
572
|
-
renderToolCall: s
|
|
609
|
+
renderToolCall: s,
|
|
610
|
+
renderApproval: a,
|
|
611
|
+
getToolLabel: i
|
|
573
612
|
}) {
|
|
574
|
-
const
|
|
575
|
-
const
|
|
576
|
-
return s ? s(
|
|
577
|
-
|
|
613
|
+
const l = ["mast-assistant-message", n].filter(Boolean).join(" "), { pendingApprovals: o } = Q(), c = (u) => {
|
|
614
|
+
const m = u.awaitingApproval ? o.find((g) => g.toolName === u.name) : void 0;
|
|
615
|
+
return m && a ? a(u, m) : s ? s(u, m) : m ? /* @__PURE__ */ e(
|
|
616
|
+
Vt,
|
|
578
617
|
{
|
|
579
|
-
entry:
|
|
580
|
-
approve:
|
|
581
|
-
reject:
|
|
582
|
-
respondWith:
|
|
618
|
+
entry: u,
|
|
619
|
+
approve: m.approve,
|
|
620
|
+
reject: m.reject,
|
|
621
|
+
respondWith: m.respondWith
|
|
583
622
|
}
|
|
584
|
-
) : /* @__PURE__ */ e(
|
|
623
|
+
) : /* @__PURE__ */ e(mt, { entry: u });
|
|
585
624
|
};
|
|
586
|
-
return /* @__PURE__ */
|
|
625
|
+
return /* @__PURE__ */ e(dt.Provider, { value: i, children: /* @__PURE__ */ I(
|
|
587
626
|
"div",
|
|
588
627
|
{
|
|
589
628
|
"data-mast-assistant-message": !0,
|
|
590
629
|
"data-streaming": t.isStreaming ? "true" : void 0,
|
|
591
|
-
className:
|
|
630
|
+
className: l,
|
|
592
631
|
children: [
|
|
593
|
-
t.thinking ? /* @__PURE__ */ e(
|
|
594
|
-
t.toolEvents.map((
|
|
595
|
-
t.text ? r ? r(t.text) : /* @__PURE__ */ e(
|
|
632
|
+
t.thinking ? /* @__PURE__ */ e(ut, { content: t.thinking, isStreaming: t.isStreaming }) : null,
|
|
633
|
+
t.toolEvents.map((u, m) => /* @__PURE__ */ e(lt, { children: c(u) }, `${u.id}-${m}`)),
|
|
634
|
+
t.text ? r ? r(t.text) : /* @__PURE__ */ e(xt, { fallback: /* @__PURE__ */ e("p", { className: "mast-assistant-message-text", children: t.text }), children: /* @__PURE__ */ e(Ot, { children: t.text }) }) : null
|
|
596
635
|
]
|
|
597
636
|
}
|
|
598
|
-
);
|
|
637
|
+
) });
|
|
599
638
|
}
|
|
600
|
-
function
|
|
639
|
+
function qt({
|
|
601
640
|
items: t,
|
|
602
641
|
activeIndex: n,
|
|
603
642
|
onSelect: r,
|
|
@@ -612,18 +651,18 @@ function Vt({
|
|
|
612
651
|
role: "listbox",
|
|
613
652
|
"aria-label": "Mention picker",
|
|
614
653
|
children: t.map((i, l) => {
|
|
615
|
-
const o = l === n,
|
|
654
|
+
const o = l === n, c = o ? "mast-mention-picker-item mast-mention-picker-active" : "mast-mention-picker-item";
|
|
616
655
|
return /* @__PURE__ */ e(
|
|
617
656
|
"li",
|
|
618
657
|
{
|
|
619
658
|
id: `${s}-${l}`,
|
|
620
659
|
role: "option",
|
|
621
660
|
"aria-selected": o,
|
|
622
|
-
className:
|
|
623
|
-
onMouseDown: (
|
|
624
|
-
|
|
661
|
+
className: c,
|
|
662
|
+
onMouseDown: (u) => {
|
|
663
|
+
u.preventDefault(), r(i);
|
|
625
664
|
},
|
|
626
|
-
children: a ? a(i, o) : /* @__PURE__ */
|
|
665
|
+
children: a ? a(i, o) : /* @__PURE__ */ I("div", { children: [
|
|
627
666
|
/* @__PURE__ */ e("div", { className: "mast-mention-picker-item-label", children: i.label }),
|
|
628
667
|
i.description && /* @__PURE__ */ e("div", { className: "mast-mention-picker-item-description", children: i.description })
|
|
629
668
|
] })
|
|
@@ -634,114 +673,114 @@ function Vt({
|
|
|
634
673
|
}
|
|
635
674
|
);
|
|
636
675
|
}
|
|
637
|
-
const
|
|
638
|
-
function
|
|
676
|
+
const tt = "@";
|
|
677
|
+
function ht(t) {
|
|
639
678
|
return t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
640
679
|
}
|
|
641
|
-
function
|
|
642
|
-
const r =
|
|
680
|
+
function Gt(t, n = tt) {
|
|
681
|
+
const r = ht(n), s = new RegExp(`${r}([^\\s${r}]*)$`), a = t.match(s);
|
|
643
682
|
return a ? a[1] : null;
|
|
644
683
|
}
|
|
645
|
-
function
|
|
646
|
-
const r =
|
|
684
|
+
function Jt(t, n = tt) {
|
|
685
|
+
const r = ht(n), s = new RegExp(`${r}[^\\s${r}]*$`);
|
|
647
686
|
return t.replace(s, "");
|
|
648
687
|
}
|
|
649
|
-
function
|
|
650
|
-
return t.map((r) => `${r.text}${
|
|
688
|
+
function Qt(t, n) {
|
|
689
|
+
return t.map((r) => `${r.text}${tt}${r.item.label}`).join("") + n;
|
|
651
690
|
}
|
|
652
|
-
function
|
|
653
|
-
const n = t.trigger ?? "@", [r, s] =
|
|
654
|
-
|
|
655
|
-
const
|
|
656
|
-
|
|
657
|
-
const
|
|
658
|
-
|
|
691
|
+
function Zt(t) {
|
|
692
|
+
const n = t.trigger ?? "@", [r, s] = j([]), [a, i] = j(""), [l, o] = j(null), [c, u] = j(0), [m, g] = j([]), x = R(r);
|
|
693
|
+
x.current = r;
|
|
694
|
+
const T = R(a);
|
|
695
|
+
T.current = a;
|
|
696
|
+
const A = R(0);
|
|
697
|
+
G(() => {
|
|
659
698
|
if (l === null) {
|
|
660
|
-
|
|
699
|
+
g([]);
|
|
661
700
|
return;
|
|
662
701
|
}
|
|
663
|
-
const
|
|
702
|
+
const f = ++A.current;
|
|
664
703
|
if (t.onSearch) {
|
|
665
|
-
const
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
}) : v
|
|
704
|
+
const v = t.onSearch(l);
|
|
705
|
+
v instanceof Promise ? v.then((S) => {
|
|
706
|
+
f === A.current && g(S);
|
|
707
|
+
}) : g(v);
|
|
669
708
|
}
|
|
670
709
|
}, [l, t.onSearch]);
|
|
671
|
-
const
|
|
710
|
+
const D = new Set(r.map((f) => f.item.id)), C = (() => {
|
|
672
711
|
if (l === null) return [];
|
|
673
712
|
if (t.onSearch)
|
|
674
|
-
return
|
|
675
|
-
const
|
|
713
|
+
return m.filter((v) => !D.has(v.id));
|
|
714
|
+
const f = l.toLowerCase();
|
|
676
715
|
return (t.items ?? []).filter(
|
|
677
|
-
(
|
|
716
|
+
(v) => !D.has(v.id) && v.label.toLowerCase().includes(f)
|
|
678
717
|
);
|
|
679
|
-
})(),
|
|
680
|
-
(
|
|
681
|
-
i(
|
|
718
|
+
})(), E = _(
|
|
719
|
+
(f) => {
|
|
720
|
+
i(f), o(Gt(f, n)), u(0);
|
|
682
721
|
},
|
|
683
722
|
[n]
|
|
684
|
-
),
|
|
685
|
-
(
|
|
686
|
-
const
|
|
687
|
-
if (
|
|
688
|
-
const
|
|
689
|
-
s([...
|
|
723
|
+
), b = _(
|
|
724
|
+
(f) => {
|
|
725
|
+
const v = x.current;
|
|
726
|
+
if (v.some((d) => d.item.id === f.id)) return;
|
|
727
|
+
const S = Jt(T.current, n);
|
|
728
|
+
s([...v, { text: S, item: f }]), i(""), o(null), u(0);
|
|
690
729
|
},
|
|
691
730
|
[n]
|
|
692
|
-
),
|
|
693
|
-
const
|
|
694
|
-
if (
|
|
695
|
-
const d =
|
|
696
|
-
if (
|
|
697
|
-
|
|
731
|
+
), y = _((f) => {
|
|
732
|
+
const v = x.current, S = v.findIndex((h) => h.item.id === f);
|
|
733
|
+
if (S === -1) return;
|
|
734
|
+
const d = v[S].text, p = [...v.slice(0, S), ...v.slice(S + 1)];
|
|
735
|
+
if (S < p.length) {
|
|
736
|
+
p[S] = { ...p[S], text: d + p[S].text }, s(p);
|
|
698
737
|
return;
|
|
699
738
|
}
|
|
700
|
-
s(
|
|
739
|
+
s(p), i(d + T.current);
|
|
701
740
|
}, []), N = _(
|
|
702
|
-
(
|
|
703
|
-
if (l === null ||
|
|
704
|
-
switch (
|
|
741
|
+
(f) => {
|
|
742
|
+
if (l === null || C.length === 0) return !1;
|
|
743
|
+
switch (f.key) {
|
|
705
744
|
case "ArrowDown":
|
|
706
|
-
return
|
|
745
|
+
return f.preventDefault(), u((v) => (v + 1) % C.length), !0;
|
|
707
746
|
case "ArrowUp":
|
|
708
|
-
return
|
|
747
|
+
return f.preventDefault(), u((v) => v === 0 ? C.length - 1 : v - 1), !0;
|
|
709
748
|
case "Enter":
|
|
710
|
-
return
|
|
749
|
+
return f.preventDefault(), b(C[c] ?? C[0]), !0;
|
|
711
750
|
case "Escape":
|
|
712
|
-
return
|
|
751
|
+
return f.preventDefault(), o(null), !0;
|
|
713
752
|
default:
|
|
714
753
|
return !1;
|
|
715
754
|
}
|
|
716
755
|
},
|
|
717
|
-
[l,
|
|
718
|
-
),
|
|
719
|
-
const
|
|
720
|
-
return { prompt: t.buildPrompt ? t.buildPrompt(r, a) :
|
|
721
|
-
}, [r, a, t.buildPrompt]),
|
|
722
|
-
s([]), i(""), o(null),
|
|
756
|
+
[l, C, c, b]
|
|
757
|
+
), P = _(() => {
|
|
758
|
+
const f = Qt(r, a);
|
|
759
|
+
return { prompt: t.buildPrompt ? t.buildPrompt(r, a) : f, displayText: f };
|
|
760
|
+
}, [r, a, t.buildPrompt]), w = _(() => {
|
|
761
|
+
s([]), i(""), o(null), u(0);
|
|
723
762
|
}, []);
|
|
724
763
|
return {
|
|
725
764
|
segments: r,
|
|
726
765
|
trailingInput: a,
|
|
727
766
|
mentionQuery: l,
|
|
728
|
-
filteredItems:
|
|
729
|
-
pickerIndex:
|
|
730
|
-
setTrailingInput:
|
|
767
|
+
filteredItems: C,
|
|
768
|
+
pickerIndex: c,
|
|
769
|
+
setTrailingInput: E,
|
|
731
770
|
handleKeyDown: N,
|
|
732
|
-
selectItem:
|
|
733
|
-
removeChip:
|
|
734
|
-
buildSubmission:
|
|
735
|
-
clear:
|
|
771
|
+
selectItem: b,
|
|
772
|
+
removeChip: y,
|
|
773
|
+
buildSubmission: P,
|
|
774
|
+
clear: w
|
|
736
775
|
};
|
|
737
776
|
}
|
|
738
|
-
const
|
|
739
|
-
function
|
|
777
|
+
const Xt = 1, Yt = 8;
|
|
778
|
+
function pt(t) {
|
|
740
779
|
const n = t.split(`
|
|
741
780
|
`).length;
|
|
742
|
-
return Math.min(
|
|
781
|
+
return Math.min(Yt, Math.max(Xt, n));
|
|
743
782
|
}
|
|
744
|
-
function
|
|
783
|
+
function te({
|
|
745
784
|
className: t,
|
|
746
785
|
placeholder: n = "Type a message and press Enter.",
|
|
747
786
|
sendLabel: r,
|
|
@@ -749,7 +788,7 @@ function Gt({
|
|
|
749
788
|
mentions: a
|
|
750
789
|
}) {
|
|
751
790
|
return a ? /* @__PURE__ */ e(
|
|
752
|
-
|
|
791
|
+
ne,
|
|
753
792
|
{
|
|
754
793
|
className: t,
|
|
755
794
|
placeholder: n,
|
|
@@ -758,7 +797,7 @@ function Gt({
|
|
|
758
797
|
mentions: a
|
|
759
798
|
}
|
|
760
799
|
) : /* @__PURE__ */ e(
|
|
761
|
-
|
|
800
|
+
ee,
|
|
762
801
|
{
|
|
763
802
|
className: t,
|
|
764
803
|
placeholder: n,
|
|
@@ -767,19 +806,19 @@ function Gt({
|
|
|
767
806
|
}
|
|
768
807
|
);
|
|
769
808
|
}
|
|
770
|
-
function
|
|
771
|
-
const { sendMessage: a, cancel: i, isRunning: l } =
|
|
772
|
-
T && (a(
|
|
773
|
-
},
|
|
774
|
-
|
|
809
|
+
function ee({ className: t, placeholder: n, sendLabel: r, cancelLabel: s }) {
|
|
810
|
+
const { sendMessage: a, cancel: i, isRunning: l, isReady: o } = Q(), c = J(), [u, m] = j(""), g = ["mast-chat-input", t].filter(Boolean).join(" "), x = u.trim(), T = o && !l && x.length > 0, A = !o || l, D = () => {
|
|
811
|
+
T && (a(x), m(""));
|
|
812
|
+
}, C = (E) => {
|
|
813
|
+
E.key === "Enter" && !E.shiftKey && (E.preventDefault(), D());
|
|
775
814
|
};
|
|
776
|
-
return /* @__PURE__ */
|
|
815
|
+
return /* @__PURE__ */ I(
|
|
777
816
|
"form",
|
|
778
817
|
{
|
|
779
818
|
"data-mast-chat-input": !0,
|
|
780
|
-
className:
|
|
781
|
-
onSubmit: (
|
|
782
|
-
|
|
819
|
+
className: g,
|
|
820
|
+
onSubmit: (E) => {
|
|
821
|
+
E.preventDefault(), D();
|
|
783
822
|
},
|
|
784
823
|
children: [
|
|
785
824
|
/* @__PURE__ */ e("label", { className: "mast-chat-input-label mast-visually-hidden", htmlFor: "mast-chat-input-field", children: "Message" }),
|
|
@@ -790,10 +829,10 @@ function Jt({ className: t, placeholder: n, sendLabel: r, cancelLabel: s }) {
|
|
|
790
829
|
className: "mast-chat-input-textarea",
|
|
791
830
|
value: u,
|
|
792
831
|
placeholder: n,
|
|
793
|
-
rows:
|
|
794
|
-
disabled:
|
|
795
|
-
onChange: (
|
|
796
|
-
onKeyDown:
|
|
832
|
+
rows: pt(u),
|
|
833
|
+
disabled: A,
|
|
834
|
+
onChange: (E) => m(E.target.value),
|
|
835
|
+
onKeyDown: C
|
|
797
836
|
}
|
|
798
837
|
),
|
|
799
838
|
l ? /* @__PURE__ */ e(
|
|
@@ -803,7 +842,7 @@ function Jt({ className: t, placeholder: n, sendLabel: r, cancelLabel: s }) {
|
|
|
803
842
|
className: "mast-chat-input-cancel",
|
|
804
843
|
"aria-label": "Cancel",
|
|
805
844
|
onClick: i,
|
|
806
|
-
children: s ??
|
|
845
|
+
children: s ?? c.stop
|
|
807
846
|
}
|
|
808
847
|
) : /* @__PURE__ */ e(
|
|
809
848
|
"button",
|
|
@@ -812,94 +851,94 @@ function Jt({ className: t, placeholder: n, sendLabel: r, cancelLabel: s }) {
|
|
|
812
851
|
className: "mast-chat-input-send",
|
|
813
852
|
"aria-label": "Send",
|
|
814
853
|
disabled: !T,
|
|
815
|
-
children: r ??
|
|
854
|
+
children: r ?? c.send
|
|
816
855
|
}
|
|
817
856
|
)
|
|
818
857
|
]
|
|
819
858
|
}
|
|
820
859
|
);
|
|
821
860
|
}
|
|
822
|
-
function
|
|
861
|
+
function ne({
|
|
823
862
|
className: t,
|
|
824
863
|
placeholder: n,
|
|
825
864
|
sendLabel: r,
|
|
826
865
|
cancelLabel: s,
|
|
827
866
|
mentions: a
|
|
828
867
|
}) {
|
|
829
|
-
const { sendMessage: i, cancel: l, isRunning: o } =
|
|
830
|
-
segments:
|
|
831
|
-
trailingInput:
|
|
868
|
+
const { sendMessage: i, cancel: l, isRunning: o, isReady: c } = Q(), u = J(), m = yt(), {
|
|
869
|
+
segments: g,
|
|
870
|
+
trailingInput: x,
|
|
832
871
|
mentionQuery: T,
|
|
833
|
-
filteredItems:
|
|
834
|
-
pickerIndex:
|
|
835
|
-
setTrailingInput:
|
|
836
|
-
handleKeyDown:
|
|
837
|
-
selectItem:
|
|
838
|
-
removeChip:
|
|
839
|
-
buildSubmission:
|
|
840
|
-
clear:
|
|
841
|
-
} =
|
|
842
|
-
if (!
|
|
843
|
-
const { prompt:
|
|
844
|
-
|
|
845
|
-
},
|
|
846
|
-
|
|
872
|
+
filteredItems: A,
|
|
873
|
+
pickerIndex: D,
|
|
874
|
+
setTrailingInput: C,
|
|
875
|
+
handleKeyDown: E,
|
|
876
|
+
selectItem: b,
|
|
877
|
+
removeChip: y,
|
|
878
|
+
buildSubmission: N,
|
|
879
|
+
clear: P
|
|
880
|
+
} = Zt(a), w = ["mast-chat-input", "mast-mention-input", t].filter(Boolean).join(" "), f = g.length > 0 || x.trim().length > 0, v = c && !o && f, S = !c || o, d = T !== null && A.length > 0, p = d ? `${m}-${D}` : void 0, h = () => {
|
|
881
|
+
if (!v) return;
|
|
882
|
+
const { prompt: k, displayText: W } = N();
|
|
883
|
+
W.trim() && (i(k, W), P());
|
|
884
|
+
}, M = (k) => {
|
|
885
|
+
E(k) || k.key === "Enter" && !k.shiftKey && (k.preventDefault(), h());
|
|
847
886
|
};
|
|
848
|
-
return /* @__PURE__ */
|
|
887
|
+
return /* @__PURE__ */ I(
|
|
849
888
|
"form",
|
|
850
889
|
{
|
|
851
890
|
"data-mast-chat-input": !0,
|
|
852
|
-
className:
|
|
853
|
-
onSubmit: (
|
|
854
|
-
|
|
891
|
+
className: w,
|
|
892
|
+
onSubmit: (k) => {
|
|
893
|
+
k.preventDefault(), h();
|
|
855
894
|
},
|
|
856
895
|
children: [
|
|
857
896
|
/* @__PURE__ */ e("label", { className: "mast-chat-input-label mast-visually-hidden", htmlFor: "mast-chat-input-field", children: "Message" }),
|
|
858
|
-
/* @__PURE__ */
|
|
859
|
-
|
|
860
|
-
|
|
897
|
+
/* @__PURE__ */ I("div", { className: "mast-mention-input-field", children: [
|
|
898
|
+
d && /* @__PURE__ */ e(
|
|
899
|
+
qt,
|
|
861
900
|
{
|
|
862
|
-
items:
|
|
863
|
-
activeIndex:
|
|
864
|
-
onSelect:
|
|
901
|
+
items: A,
|
|
902
|
+
activeIndex: D,
|
|
903
|
+
onSelect: b,
|
|
865
904
|
idPrefix: m,
|
|
866
905
|
renderItem: a.renderItem
|
|
867
906
|
}
|
|
868
907
|
),
|
|
869
|
-
/* @__PURE__ */
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
a.renderChip ? a.renderChip(
|
|
908
|
+
/* @__PURE__ */ I("div", { className: "mast-mention-input-content", children: [
|
|
909
|
+
g.map((k) => /* @__PURE__ */ I(lt, { children: [
|
|
910
|
+
k.text && /* @__PURE__ */ e("span", { className: "mast-mention-segment-text", children: k.text }),
|
|
911
|
+
a.renderChip ? a.renderChip(k.item, () => y(k.item.id)) : /* @__PURE__ */ I("span", { className: "mast-mention-chip", children: [
|
|
873
912
|
"@",
|
|
874
|
-
|
|
913
|
+
k.item.label,
|
|
875
914
|
/* @__PURE__ */ e(
|
|
876
915
|
"button",
|
|
877
916
|
{
|
|
878
917
|
type: "button",
|
|
879
918
|
className: "mast-mention-chip-remove",
|
|
880
|
-
"aria-label": `Remove reference to ${
|
|
881
|
-
onClick: () =>
|
|
919
|
+
"aria-label": `Remove reference to ${k.item.label}`,
|
|
920
|
+
onClick: () => y(k.item.id),
|
|
882
921
|
children: "×"
|
|
883
922
|
}
|
|
884
923
|
)
|
|
885
924
|
] })
|
|
886
|
-
] },
|
|
925
|
+
] }, k.item.id)),
|
|
887
926
|
/* @__PURE__ */ e(
|
|
888
927
|
"textarea",
|
|
889
928
|
{
|
|
890
929
|
id: "mast-chat-input-field",
|
|
891
930
|
className: "mast-chat-input-textarea mast-mention-input-textarea",
|
|
892
|
-
value:
|
|
893
|
-
placeholder:
|
|
894
|
-
rows:
|
|
895
|
-
disabled:
|
|
896
|
-
onChange: (
|
|
897
|
-
onKeyDown:
|
|
931
|
+
value: x,
|
|
932
|
+
placeholder: g.length === 0 ? n : "",
|
|
933
|
+
rows: pt(x),
|
|
934
|
+
disabled: S,
|
|
935
|
+
onChange: (k) => C(k.target.value),
|
|
936
|
+
onKeyDown: M,
|
|
898
937
|
role: "combobox",
|
|
899
|
-
"aria-expanded":
|
|
900
|
-
"aria-controls":
|
|
938
|
+
"aria-expanded": d,
|
|
939
|
+
"aria-controls": d ? `${m}-listbox` : void 0,
|
|
901
940
|
"aria-autocomplete": "list",
|
|
902
|
-
"aria-activedescendant":
|
|
941
|
+
"aria-activedescendant": p
|
|
903
942
|
}
|
|
904
943
|
)
|
|
905
944
|
] })
|
|
@@ -919,7 +958,7 @@ function Qt({
|
|
|
919
958
|
type: "submit",
|
|
920
959
|
className: "mast-chat-input-send",
|
|
921
960
|
"aria-label": "Send",
|
|
922
|
-
disabled: !
|
|
961
|
+
disabled: !v,
|
|
923
962
|
children: r ?? u.send
|
|
924
963
|
}
|
|
925
964
|
)
|
|
@@ -927,86 +966,113 @@ function Qt({
|
|
|
927
966
|
}
|
|
928
967
|
);
|
|
929
968
|
}
|
|
930
|
-
function
|
|
931
|
-
|
|
932
|
-
|
|
969
|
+
function se({
|
|
970
|
+
entry: t,
|
|
971
|
+
className: n,
|
|
972
|
+
renderToolCall: r,
|
|
973
|
+
renderApproval: s,
|
|
974
|
+
renderMessage: a,
|
|
975
|
+
getToolLabel: i
|
|
976
|
+
}) {
|
|
977
|
+
return t.role === "user" ? /* @__PURE__ */ e(Ft, { entry: t, className: n }) : /* @__PURE__ */ e(
|
|
978
|
+
Ht,
|
|
933
979
|
{
|
|
934
980
|
entry: t,
|
|
935
981
|
className: n,
|
|
936
982
|
renderToolCall: r,
|
|
937
|
-
|
|
983
|
+
renderApproval: s,
|
|
984
|
+
renderMessage: a,
|
|
985
|
+
getToolLabel: i
|
|
938
986
|
}
|
|
939
987
|
);
|
|
940
988
|
}
|
|
941
|
-
const
|
|
942
|
-
function
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
989
|
+
const re = 80;
|
|
990
|
+
function ae({
|
|
991
|
+
className: t,
|
|
992
|
+
renderToolCall: n,
|
|
993
|
+
renderApproval: r,
|
|
994
|
+
renderMessage: s,
|
|
995
|
+
getToolLabel: a
|
|
996
|
+
}) {
|
|
997
|
+
const { messages: i } = Q(), l = R(null), o = St({
|
|
998
|
+
count: i.length,
|
|
999
|
+
getScrollElement: () => l.current,
|
|
1000
|
+
estimateSize: () => re,
|
|
947
1001
|
overscan: 4
|
|
948
|
-
}),
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
}, [
|
|
952
|
-
const
|
|
953
|
-
return /* @__PURE__ */ e("div", { ref:
|
|
954
|
-
const
|
|
1002
|
+
}), c = i.length > 0 ? i[i.length - 1] : void 0, u = (c == null ? void 0 : c.text.length) ?? 0;
|
|
1003
|
+
G(() => {
|
|
1004
|
+
i.length !== 0 && o.scrollToIndex(i.length - 1, { align: "end" });
|
|
1005
|
+
}, [i.length, u, o]);
|
|
1006
|
+
const m = o.getTotalSize(), g = o.getVirtualItems(), x = ["mast-message-list", t].filter(Boolean).join(" ");
|
|
1007
|
+
return /* @__PURE__ */ e("div", { ref: l, "data-mast-message-list": !0, className: x, role: "log", "aria-live": "polite", children: /* @__PURE__ */ e("div", { style: { height: `${m}px`, position: "relative", width: "100%" }, children: g.map((T) => {
|
|
1008
|
+
const A = i[T.index];
|
|
955
1009
|
return /* @__PURE__ */ e(
|
|
956
1010
|
"div",
|
|
957
1011
|
{
|
|
958
|
-
"data-index":
|
|
959
|
-
ref:
|
|
1012
|
+
"data-index": T.index,
|
|
1013
|
+
ref: o.measureElement,
|
|
960
1014
|
style: {
|
|
961
1015
|
position: "absolute",
|
|
962
1016
|
top: 0,
|
|
963
1017
|
left: 0,
|
|
964
1018
|
width: "100%",
|
|
965
|
-
transform: `translateY(${
|
|
1019
|
+
transform: `translateY(${T.start}px)`
|
|
966
1020
|
},
|
|
967
1021
|
children: /* @__PURE__ */ e(
|
|
968
|
-
|
|
1022
|
+
se,
|
|
969
1023
|
{
|
|
970
|
-
entry:
|
|
1024
|
+
entry: A,
|
|
971
1025
|
renderToolCall: n,
|
|
972
|
-
|
|
1026
|
+
renderApproval: r,
|
|
1027
|
+
renderMessage: s,
|
|
1028
|
+
getToolLabel: a
|
|
973
1029
|
}
|
|
974
1030
|
)
|
|
975
1031
|
},
|
|
976
|
-
|
|
1032
|
+
A.id
|
|
977
1033
|
);
|
|
978
1034
|
}) }) });
|
|
979
1035
|
}
|
|
980
|
-
function
|
|
1036
|
+
function de({
|
|
981
1037
|
theme: t,
|
|
982
1038
|
className: n,
|
|
983
1039
|
renderToolCall: r,
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
1040
|
+
renderApproval: s,
|
|
1041
|
+
renderMessage: a,
|
|
1042
|
+
getToolLabel: i,
|
|
1043
|
+
inputPlaceholder: l,
|
|
1044
|
+
mentions: o
|
|
987
1045
|
}) {
|
|
988
|
-
const
|
|
989
|
-
return /* @__PURE__ */
|
|
990
|
-
/* @__PURE__ */ e(
|
|
991
|
-
|
|
1046
|
+
const c = ["mast-conversation-panel", n].filter(Boolean).join(" ");
|
|
1047
|
+
return /* @__PURE__ */ I("div", { "data-mast-root": !0, "data-mast-theme": t, className: c, children: [
|
|
1048
|
+
/* @__PURE__ */ e(
|
|
1049
|
+
ae,
|
|
1050
|
+
{
|
|
1051
|
+
renderToolCall: r,
|
|
1052
|
+
renderApproval: s,
|
|
1053
|
+
renderMessage: a,
|
|
1054
|
+
getToolLabel: i
|
|
1055
|
+
}
|
|
1056
|
+
),
|
|
1057
|
+
/* @__PURE__ */ e(te, { placeholder: l, mentions: o })
|
|
992
1058
|
] });
|
|
993
1059
|
}
|
|
994
1060
|
export {
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1061
|
+
ue as AgentProvider,
|
|
1062
|
+
Ht as AssistantMessage,
|
|
1063
|
+
te as ChatInput,
|
|
1064
|
+
de as ConversationPanel,
|
|
1065
|
+
$t as INLINE_APPROVAL,
|
|
1066
|
+
Vt as InlineApproval,
|
|
1067
|
+
se as MessageItem,
|
|
1068
|
+
ae as MessageList,
|
|
1069
|
+
ut as ThinkingBlock,
|
|
1070
|
+
mt as ToolCallBlock,
|
|
1071
|
+
Ft as UserMessage,
|
|
1072
|
+
Qt as buildInlineMentionPrompt,
|
|
1073
|
+
Gt as extractMentionQuery,
|
|
1074
|
+
Jt as removeMentionTrigger,
|
|
1075
|
+
Q as useAgent,
|
|
1076
|
+
wt as useAgentStream,
|
|
1077
|
+
Zt as useMentions
|
|
1012
1078
|
};
|