@mcp-use/inspector 0.26.2-canary.4 → 0.27.0-canary.5
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/cdn/inspector.js +362 -295
- package/dist/client/components/ChatTab.d.ts +20 -1
- package/dist/client/components/ChatTab.d.ts.map +1 -1
- package/dist/client/components/chat/types.d.ts +1 -0
- package/dist/client/components/chat/types.d.ts.map +1 -1
- package/dist/client/components/chat/useChatMessages.d.ts +24 -2
- package/dist/client/components/chat/useChatMessages.d.ts.map +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +211 -143
- package/dist/web/assets/{browser-Bh6zBogB.js → browser-Cyay4eSr.js} +3 -3
- package/dist/web/assets/{chunk-RPN2XO5I-DyjPqgp4.js → chunk-RPN2XO5I-yrrAKptp.js} +1 -1
- package/dist/web/assets/{chunk-AXGUHL5P-BfX7SSSb.js → chunk-UN4HTJ53-UHTSWXbL.js} +1 -1
- package/dist/web/assets/{chunk_array-Bfk9qCoL.js → chunk_array-C34y19C8.js} +1 -1
- package/dist/web/assets/{client-5TSCHUC2-Dz2_hOgx.js → client-FP3U5ACX-EHqe6LYS.js} +3 -3
- package/dist/web/assets/{client-BIuR8cwX.js → client-vvLPAP7R.js} +1 -1
- package/dist/web/assets/{dist-nQdFkqmk.js → dist-CXtDOp58.js} +1 -1
- package/dist/web/assets/{dist-BEcqcGrN.js → dist-p054hNAE.js} +1 -1
- package/dist/web/assets/{dist-CxYRpuhy.js → dist-qYMcaYKa.js} +1 -1
- package/dist/web/assets/{function_calling-UVV-kvrQ.js → function_calling-CtMlF_FJ.js} +1 -1
- package/dist/web/assets/{index-CQWpDGwO.js → index-W_tOTbdF.js} +112 -112
- package/dist/web/assets/{llms-BPTpOb1I.js → llms-SXx-C0Gt.js} +1 -1
- package/dist/web/assets/messages-D-rNcYX8.js +1 -0
- package/dist/web/assets/react-Dyz2pEjt.js +1 -0
- package/dist/web/assets/{rpc-logger-TPNV75J4-CUMGngNb.js → rpc-logger-TPNV75J4-Ba-UGeE3.js} +1 -1
- package/dist/web/assets/{stdio-ZAQMG5KG-DazuhLNu.js → stdio-C4Y5NJDQ-DOY3z4ue.js} +1 -1
- package/dist/web/assets/{tools-BTMvJEqS.js → tools-DEZZk64_.js} +1 -1
- package/dist/web/index.html +4 -4
- package/package.json +3 -3
- package/dist/web/assets/messages-JuHB-gHd.js +0 -1
- package/dist/web/assets/react-Cp7_hQ-A.js +0 -1
package/dist/cdn/inspector.js
CHANGED
|
@@ -23064,7 +23064,7 @@ var WT, GT, Gre, Kre, qre, KT, qT, JT, YT, XT, Jre, ZT, QT, $T, Yre, Xre, Zre, e
|
|
|
23064
23064
|
}(), nse);
|
|
23065
23065
|
}));
|
|
23066
23066
|
//#endregion
|
|
23067
|
-
//#region ../mcp-use/dist/chunk-
|
|
23067
|
+
//#region ../mcp-use/dist/chunk-R573KM3Y.js
|
|
23068
23068
|
function yk() {
|
|
23069
23069
|
return gse;
|
|
23070
23070
|
}
|
|
@@ -23189,7 +23189,7 @@ function hse(e) {
|
|
|
23189
23189
|
Ek.getInstance().setSource(e);
|
|
23190
23190
|
}
|
|
23191
23191
|
var gse, Ck, _se, vse, yse, bse, xse, Sse, Cse, wse, Tse, Ese, Dse, Ose, wk, Tk, Ek, Dk, kse, Ok = o((() => {
|
|
23192
|
-
C(), g(), Kne(), Qf(), gse = "1.22.4-canary.
|
|
23192
|
+
C(), g(), Kne(), Qf(), gse = "1.22.4-canary.5", m(yk, "getPackageVersion"), Ck = class {
|
|
23193
23193
|
static {
|
|
23194
23194
|
m(this, "BaseTelemetryEvent");
|
|
23195
23195
|
}
|
|
@@ -30086,7 +30086,7 @@ var yue, bue, gA, _A, vA, yA, bA, xA, SA, CA, wA, TA, EA, DA, OA, kA, AA, jA, MA
|
|
|
30086
30086
|
};
|
|
30087
30087
|
}));
|
|
30088
30088
|
//#endregion
|
|
30089
|
-
//#region ../mcp-use/dist/chunk-
|
|
30089
|
+
//#region ../mcp-use/dist/chunk-UN4HTJ53.js
|
|
30090
30090
|
function UA(e, t) {
|
|
30091
30091
|
return {
|
|
30092
30092
|
onSampling: e?.onSampling ?? e?.samplingCallback ?? t?.onSampling ?? t?.samplingCallback,
|
|
@@ -30515,7 +30515,7 @@ var kue, GA, KA, qA, JA = o((() => {
|
|
|
30515
30515
|
};
|
|
30516
30516
|
}));
|
|
30517
30517
|
//#endregion
|
|
30518
|
-
//#region ../mcp-use/dist/chunk-
|
|
30518
|
+
//#region ../mcp-use/dist/chunk-WWC4DXO7.js
|
|
30519
30519
|
function Aue(e) {
|
|
30520
30520
|
let t = Object.keys(e.mcpServers ?? {});
|
|
30521
30521
|
Ek.getInstance().trackMCPClientInit({
|
|
@@ -59897,7 +59897,7 @@ var Tbe = class {
|
|
|
59897
59897
|
//#region src/client/telemetry/utils.ts
|
|
59898
59898
|
function Nbe() {
|
|
59899
59899
|
try {
|
|
59900
|
-
return "0.
|
|
59900
|
+
return "0.27.0-canary.5";
|
|
59901
59901
|
} catch {
|
|
59902
59902
|
return "0.0.0";
|
|
59903
59903
|
}
|
|
@@ -165643,27 +165643,27 @@ var _It = (e) => {
|
|
|
165643
165643
|
};
|
|
165644
165644
|
//#endregion
|
|
165645
165645
|
//#region src/client/components/chat/useChatMessages.ts
|
|
165646
|
-
function vIt({ mcpServerUrl: e, llmConfig: t, authConfig: n, isConnected: r, chatApiUrl: i, waitForChatApiUrl: a, widgetModelContexts: o, initialMessages: s, disabledTools: c }) {
|
|
165647
|
-
let [
|
|
165646
|
+
function vIt({ mcpServerUrl: e, llmConfig: t, authConfig: n, isConnected: r, chatApiUrl: i, waitForChatApiUrl: a, widgetModelContexts: o, initialMessages: s, disabledTools: c, streamProtocol: l = "sse", credentials: u, extraHeaders: d, body: f }) {
|
|
165647
|
+
let [p, m] = (0, K.useState)(s ?? []), [h, g] = (0, K.useState)(!1), [_, v] = (0, K.useState)([]), y = (0, K.useRef)(null);
|
|
165648
165648
|
return {
|
|
165649
|
-
messages:
|
|
165650
|
-
isLoading:
|
|
165651
|
-
attachments:
|
|
165652
|
-
sendMessage: (0, K.useCallback)(async (s,
|
|
165653
|
-
let
|
|
165654
|
-
if (!(s.trim() ||
|
|
165655
|
-
let
|
|
165656
|
-
if (s.trim() ||
|
|
165649
|
+
messages: p,
|
|
165650
|
+
isLoading: h,
|
|
165651
|
+
attachments: _,
|
|
165652
|
+
sendMessage: (0, K.useCallback)(async (s, h, b) => {
|
|
165653
|
+
let x = [..._, ...b ?? []];
|
|
165654
|
+
if (!(s.trim() || h.length > 0 || x.length > 0) || !t || !r) return;
|
|
165655
|
+
let S = [..._It(h)];
|
|
165656
|
+
if (s.trim() || x.length > 0) {
|
|
165657
165657
|
let e = {
|
|
165658
165658
|
id: `user-${Date.now()}`,
|
|
165659
165659
|
role: "user",
|
|
165660
165660
|
content: s.trim(),
|
|
165661
165661
|
timestamp: Date.now(),
|
|
165662
|
-
attachments:
|
|
165662
|
+
attachments: x.length > 0 ? x : void 0
|
|
165663
165663
|
};
|
|
165664
|
-
|
|
165664
|
+
S.push(e);
|
|
165665
165665
|
}
|
|
165666
|
-
|
|
165666
|
+
m((e) => [...e, ...S]), g(!0), v([]), y.current = new AbortController();
|
|
165667
165667
|
try {
|
|
165668
165668
|
let r = n;
|
|
165669
165669
|
if (n?.type === "oauth") try {
|
|
@@ -165687,89 +165687,147 @@ function vIt({ mcpServerUrl: e, llmConfig: t, authConfig: n, isConnected: r, cha
|
|
|
165687
165687
|
content: `[Current Widget State]\n${e.join("\n")}`
|
|
165688
165688
|
});
|
|
165689
165689
|
}
|
|
165690
|
-
let
|
|
165690
|
+
let h = i ?? (a ? await a() : void 0) ?? "/inspector/api/chat/stream", g = [...[...p, ...S].map((e) => ({
|
|
165691
|
+
role: e.role,
|
|
165692
|
+
content: e.content || (e.parts?.filter((e) => e.type === "text").map((e) => e.text).join("") ?? ""),
|
|
165693
|
+
attachments: e.attachments
|
|
165694
|
+
})), ...s], _ = await fetch(h, {
|
|
165691
165695
|
method: "POST",
|
|
165692
|
-
headers: {
|
|
165693
|
-
|
|
165694
|
-
|
|
165696
|
+
headers: {
|
|
165697
|
+
"Content-Type": "application/json",
|
|
165698
|
+
...d
|
|
165699
|
+
},
|
|
165700
|
+
signal: y.current.signal,
|
|
165701
|
+
...u ? { credentials: u } : {},
|
|
165702
|
+
body: JSON.stringify(f ? f(g) : {
|
|
165695
165703
|
mcpServerUrl: e,
|
|
165696
165704
|
llmConfig: t,
|
|
165697
165705
|
authConfig: r,
|
|
165698
|
-
messages:
|
|
165699
|
-
role: e.role,
|
|
165700
|
-
content: e.content || (e.parts?.filter((e) => e.type === "text").map((e) => e.text).join("") ?? ""),
|
|
165701
|
-
attachments: e.attachments
|
|
165702
|
-
})), ...s],
|
|
165706
|
+
messages: g,
|
|
165703
165707
|
...c && c.size > 0 ? { disabledTools: [...c] } : {}
|
|
165704
165708
|
})
|
|
165705
165709
|
});
|
|
165706
|
-
if (!
|
|
165707
|
-
let
|
|
165708
|
-
|
|
165709
|
-
id:
|
|
165710
|
+
if (!_.ok) throw Error(`HTTP error! status: ${_.status}`);
|
|
165711
|
+
let v = `assistant-${Date.now()}`, b = "", x = [];
|
|
165712
|
+
m((e) => [...e, {
|
|
165713
|
+
id: v,
|
|
165710
165714
|
role: "assistant",
|
|
165711
165715
|
content: "",
|
|
165712
165716
|
timestamp: Date.now(),
|
|
165713
165717
|
parts: []
|
|
165714
165718
|
}]);
|
|
165715
|
-
let
|
|
165716
|
-
if (!
|
|
165717
|
-
let
|
|
165719
|
+
let C = _.body?.getReader(), w = new TextDecoder();
|
|
165720
|
+
if (!C) throw Error("No response body");
|
|
165721
|
+
let T = () => {
|
|
165722
|
+
m((e) => e.map((e) => e.id === v ? {
|
|
165723
|
+
...e,
|
|
165724
|
+
parts: [...x]
|
|
165725
|
+
} : e));
|
|
165726
|
+
}, E = () => {
|
|
165727
|
+
m((e) => e.map((e) => e.id === v ? {
|
|
165728
|
+
...e,
|
|
165729
|
+
parts: [...x],
|
|
165730
|
+
content: ""
|
|
165731
|
+
} : e));
|
|
165732
|
+
}, D = (e) => {
|
|
165733
|
+
b += e;
|
|
165734
|
+
let t = x[x.length - 1];
|
|
165735
|
+
t && t.type === "text" ? t.text = b : x.push({
|
|
165736
|
+
type: "text",
|
|
165737
|
+
text: b
|
|
165738
|
+
}), T();
|
|
165739
|
+
}, O = (e, t) => {
|
|
165740
|
+
b &&= "", x.push({
|
|
165741
|
+
type: "tool-invocation",
|
|
165742
|
+
toolInvocation: {
|
|
165743
|
+
toolName: e,
|
|
165744
|
+
args: t,
|
|
165745
|
+
state: "pending"
|
|
165746
|
+
}
|
|
165747
|
+
}), T();
|
|
165748
|
+
}, k = (e, t) => {
|
|
165749
|
+
let n;
|
|
165750
|
+
n = e.by === "toolName" ? x.find((t) => t.type === "tool-invocation" && t.toolInvocation?.toolName === e.toolName && !t.toolInvocation?.result) : x[e.index], n?.toolInvocation && (n.toolInvocation.result = t, n.toolInvocation.state = t?.isError ? "error" : "result", T());
|
|
165751
|
+
}, A = /* @__PURE__ */ new Map(), j = "";
|
|
165718
165752
|
for (;;) {
|
|
165719
|
-
if (
|
|
165720
|
-
await
|
|
165753
|
+
if (y.current?.signal.aborted) {
|
|
165754
|
+
await C.cancel();
|
|
165721
165755
|
break;
|
|
165722
165756
|
}
|
|
165723
|
-
let { done: e, value: t } = await
|
|
165757
|
+
let { done: e, value: t } = await C.read();
|
|
165724
165758
|
if (e) break;
|
|
165725
|
-
|
|
165726
|
-
let n =
|
|
165727
|
-
|
|
165728
|
-
for (let e of n) if (e.trim()
|
|
165729
|
-
|
|
165730
|
-
|
|
165731
|
-
|
|
165732
|
-
|
|
165733
|
-
|
|
165734
|
-
|
|
165735
|
-
|
|
165736
|
-
|
|
165737
|
-
}), console.log("[Parts after text]", g.length, "parts, text length:", m.length), u((e) => e.map((e) => e.id === p ? {
|
|
165738
|
-
...e,
|
|
165739
|
-
parts: [...g]
|
|
165740
|
-
} : e));
|
|
165741
|
-
} else if (t.type === "tool-call") m &&= "", g.push({
|
|
165742
|
-
type: "tool-invocation",
|
|
165743
|
-
toolInvocation: {
|
|
165744
|
-
toolName: t.toolName,
|
|
165745
|
-
args: t.args,
|
|
165746
|
-
state: "pending"
|
|
165759
|
+
j += w.decode(t, { stream: !0 });
|
|
165760
|
+
let n = j.split("\n");
|
|
165761
|
+
j = n.pop() || "";
|
|
165762
|
+
for (let e of n) if (e.trim()) try {
|
|
165763
|
+
if (l === "data-stream") {
|
|
165764
|
+
let t = e.indexOf(":");
|
|
165765
|
+
if (t === -1) continue;
|
|
165766
|
+
let n = e.slice(0, t), r = e.slice(t + 1), i;
|
|
165767
|
+
try {
|
|
165768
|
+
i = JSON.parse(r);
|
|
165769
|
+
} catch {
|
|
165770
|
+
continue;
|
|
165747
165771
|
}
|
|
165748
|
-
|
|
165749
|
-
|
|
165750
|
-
|
|
165751
|
-
|
|
165752
|
-
|
|
165753
|
-
|
|
165754
|
-
|
|
165755
|
-
|
|
165756
|
-
|
|
165757
|
-
|
|
165758
|
-
|
|
165759
|
-
|
|
165760
|
-
|
|
165761
|
-
|
|
165762
|
-
|
|
165763
|
-
|
|
165772
|
+
switch (n) {
|
|
165773
|
+
case "0":
|
|
165774
|
+
D(typeof i == "string" ? i : String(i));
|
|
165775
|
+
break;
|
|
165776
|
+
case "9": {
|
|
165777
|
+
let e = i, t = e.args ?? {};
|
|
165778
|
+
if (typeof t.input == "string" && Object.keys(t).length === 1) try {
|
|
165779
|
+
let e = JSON.parse(t.input);
|
|
165780
|
+
typeof e == "object" && e && (t = e);
|
|
165781
|
+
} catch {}
|
|
165782
|
+
O(String(e.toolName ?? ""), t), e.toolCallId && A.set(e.toolCallId, x.length - 1);
|
|
165783
|
+
break;
|
|
165784
|
+
}
|
|
165785
|
+
case "a": {
|
|
165786
|
+
let e = i, t = A.get(e.toolCallId), n = e.result, r = n;
|
|
165787
|
+
if (r?.lc === 1 && r?.type === "constructor" && r?.kwargs?.content) {
|
|
165788
|
+
let e = r.kwargs.content;
|
|
165789
|
+
if (typeof e == "string") try {
|
|
165790
|
+
n = JSON.parse(e);
|
|
165791
|
+
} catch {
|
|
165792
|
+
n = e;
|
|
165793
|
+
}
|
|
165794
|
+
}
|
|
165795
|
+
t !== void 0 && k({
|
|
165796
|
+
by: "index",
|
|
165797
|
+
index: t
|
|
165798
|
+
}, n);
|
|
165799
|
+
break;
|
|
165800
|
+
}
|
|
165801
|
+
case "d":
|
|
165802
|
+
E();
|
|
165803
|
+
break;
|
|
165804
|
+
case "3": throw Error(typeof i == "string" ? i : JSON.stringify(i));
|
|
165805
|
+
default: break;
|
|
165806
|
+
}
|
|
165807
|
+
} else {
|
|
165808
|
+
if (!e.startsWith("data: ")) continue;
|
|
165809
|
+
let t = JSON.parse(e.slice(6));
|
|
165810
|
+
if (t.type !== "message") {
|
|
165811
|
+
if (t.type === "text") D(t.content);
|
|
165812
|
+
else if (t.type === "tool-call") O(t.toolName, t.args);
|
|
165813
|
+
else if (t.type === "tool-result") k({
|
|
165814
|
+
by: "toolName",
|
|
165815
|
+
toolName: t.toolName
|
|
165816
|
+
}, t.result);
|
|
165817
|
+
else if (t.type === "done") E();
|
|
165818
|
+
else if (t.type === "error") throw Error(t.message || "Streaming error");
|
|
165819
|
+
}
|
|
165820
|
+
}
|
|
165764
165821
|
} catch (t) {
|
|
165765
|
-
console.error("Failed to parse streaming event:", t, e);
|
|
165822
|
+
if (t instanceof Error && t.message !== "Streaming error") console.error("Failed to parse streaming event:", t, e);
|
|
165823
|
+
else throw t;
|
|
165766
165824
|
}
|
|
165767
165825
|
}
|
|
165768
|
-
if (
|
|
165769
|
-
for (let e of
|
|
165770
|
-
|
|
165826
|
+
if (y.current?.signal.aborted) {
|
|
165827
|
+
for (let e of x) e.type === "tool-invocation" && e.toolInvocation?.state === "pending" && (e.toolInvocation.state = "error", e.toolInvocation.result = "Cancelled by user");
|
|
165828
|
+
m((e) => e.map((e) => e.id === v ? {
|
|
165771
165829
|
...e,
|
|
165772
|
-
parts: [...
|
|
165830
|
+
parts: [...x],
|
|
165773
165831
|
content: ""
|
|
165774
165832
|
} : e));
|
|
165775
165833
|
}
|
|
@@ -165787,32 +165845,37 @@ function vIt({ mcpServerUrl: e, llmConfig: t, authConfig: n, isConnected: r, cha
|
|
|
165787
165845
|
content: `Error: ${t}`,
|
|
165788
165846
|
timestamp: Date.now()
|
|
165789
165847
|
};
|
|
165790
|
-
|
|
165848
|
+
m((e) => [...e, n]);
|
|
165791
165849
|
} finally {
|
|
165792
|
-
|
|
165850
|
+
g(!1), y.current = null;
|
|
165793
165851
|
}
|
|
165794
165852
|
}, [
|
|
165795
165853
|
t,
|
|
165796
165854
|
r,
|
|
165797
165855
|
e,
|
|
165798
|
-
l,
|
|
165799
|
-
n,
|
|
165800
165856
|
p,
|
|
165857
|
+
n,
|
|
165858
|
+
_,
|
|
165801
165859
|
i,
|
|
165802
165860
|
a,
|
|
165803
|
-
|
|
165861
|
+
o,
|
|
165862
|
+
c,
|
|
165863
|
+
l,
|
|
165864
|
+
u,
|
|
165865
|
+
d,
|
|
165866
|
+
f
|
|
165804
165867
|
]),
|
|
165805
165868
|
clearMessages: (0, K.useCallback)(() => {
|
|
165806
|
-
|
|
165869
|
+
m([]);
|
|
165807
165870
|
}, []),
|
|
165808
|
-
setMessages:
|
|
165871
|
+
setMessages: m,
|
|
165809
165872
|
stop: (0, K.useCallback)(() => {
|
|
165810
|
-
|
|
165873
|
+
y.current && y.current.abort();
|
|
165811
165874
|
}, []),
|
|
165812
165875
|
addAttachment: (0, K.useCallback)(async (e) => {
|
|
165813
165876
|
try {
|
|
165814
165877
|
let t = await C2e(e);
|
|
165815
|
-
|
|
165878
|
+
v((e) => {
|
|
165816
165879
|
let n = [...e, t];
|
|
165817
165880
|
return x2e(n) ? n : (alert("Total attachment size exceeds 20MB limit"), e);
|
|
165818
165881
|
});
|
|
@@ -165821,10 +165884,10 @@ function vIt({ mcpServerUrl: e, llmConfig: t, authConfig: n, isConnected: r, cha
|
|
|
165821
165884
|
}
|
|
165822
165885
|
}, []),
|
|
165823
165886
|
removeAttachment: (0, K.useCallback)((e) => {
|
|
165824
|
-
|
|
165887
|
+
v((t) => t.filter((t, n) => n !== e));
|
|
165825
165888
|
}, []),
|
|
165826
165889
|
clearAttachments: (0, K.useCallback)(() => {
|
|
165827
|
-
|
|
165890
|
+
v([]);
|
|
165828
165891
|
}, [])
|
|
165829
165892
|
};
|
|
165830
165893
|
}
|
|
@@ -205416,37 +205479,41 @@ var EZt = /(?:^\/$|\s+\/$)/, DZt = [
|
|
|
205416
205479
|
"Escape",
|
|
205417
205480
|
"Enter"
|
|
205418
205481
|
];
|
|
205419
|
-
function OZt({ connection: e, isConnected: t, useClientSide: n = !0, enableKeyboardShortcuts: r = !0, prompts: i, serverId: a, callPrompt: o, readResource: s, chatApiUrl: c, waitForChatApiUrl: l, initialMessages: u, managedLlmConfig: d, clearButtonLabel: f, hideTitle: p, hideModelBadge: m, hideServerUrl: h, clearButtonHideIcon: g, clearButtonHideShortcut: _, clearButtonVariant: v, hideClearButton: y, hideToolSelector: b, chatQuickQuestions: x = [], chatFollowups: S = [] }) {
|
|
205420
|
-
let [
|
|
205482
|
+
function OZt({ connection: e, isConnected: t, useClientSide: n = !0, enableKeyboardShortcuts: r = !0, prompts: i, serverId: a, callPrompt: o, readResource: s, chatApiUrl: c, waitForChatApiUrl: l, initialMessages: u, managedLlmConfig: d, clearButtonLabel: f, hideTitle: p, hideModelBadge: m, hideServerUrl: h, clearButtonHideIcon: g, clearButtonHideShortcut: _, clearButtonVariant: v, hideClearButton: y, hideToolSelector: b, chatQuickQuestions: x = [], chatFollowups: S = [], streamProtocol: C, credentials: w, extraHeaders: T, body: E }) {
|
|
205483
|
+
let [D, O] = (0, K.useState)(""), [k, A] = (0, K.useState)(!1), [j, M] = (0, K.useState)(-1), [N, P] = (0, K.useState)(x), [F, I] = (0, K.useState)(S), [L, ee] = (0, K.useState)(/* @__PURE__ */ new Set()), te = (0, K.useRef)(null), R = (0, K.useRef)(null), z = (0, K.useMemo)(() => (e.tools ?? []).map((e) => ({
|
|
205421
205484
|
name: e.name,
|
|
205422
205485
|
description: e.description
|
|
205423
|
-
})), [e.tools]), { llmConfig:
|
|
205486
|
+
})), [e.tools]), { llmConfig: ne, authConfig: re, configDialogOpen: ie, setConfigDialogOpen: ae, tempProvider: oe, setTempProvider: se, tempApiKey: ce, setTempApiKey: le, tempModel: ue, setTempModel: de, saveLLMConfig: fe, clearConfig: pe } = TZt({ mcpServerUrl: e.url }), me = d ?? ne, he = !!d, { getAllModelContexts: ge } = pH(), _e = ge(), ve = {
|
|
205424
205487
|
connection: e,
|
|
205425
|
-
llmConfig:
|
|
205488
|
+
llmConfig: me,
|
|
205426
205489
|
isConnected: t,
|
|
205427
205490
|
readResource: s,
|
|
205428
|
-
widgetModelContexts:
|
|
205429
|
-
disabledTools:
|
|
205430
|
-
},
|
|
205491
|
+
widgetModelContexts: _e,
|
|
205492
|
+
disabledTools: L
|
|
205493
|
+
}, ye = vIt({
|
|
205431
205494
|
mcpServerUrl: e.url,
|
|
205432
|
-
llmConfig:
|
|
205433
|
-
authConfig:
|
|
205495
|
+
llmConfig: me,
|
|
205496
|
+
authConfig: re,
|
|
205434
205497
|
isConnected: t,
|
|
205435
205498
|
chatApiUrl: c,
|
|
205436
205499
|
waitForChatApiUrl: l,
|
|
205437
|
-
widgetModelContexts:
|
|
205500
|
+
widgetModelContexts: _e,
|
|
205438
205501
|
initialMessages: u,
|
|
205439
|
-
disabledTools:
|
|
205440
|
-
|
|
205502
|
+
disabledTools: L,
|
|
205503
|
+
streamProtocol: C,
|
|
205504
|
+
credentials: w,
|
|
205505
|
+
extraHeaders: T,
|
|
205506
|
+
body: E
|
|
205507
|
+
}), be = CZt(ve), { messages: xe, isLoading: Se, attachments: Ce, sendMessage: we, clearMessages: Te, setMessages: Ee, stop: De, addAttachment: Oe, removeAttachment: ke } = n ? be : ye, { filteredPrompts: Ae, setSelectedPrompt: je, selectedPrompt: Me, setPromptArgs: Ne, executePrompt: Pe, results: Fe, handleDeleteResult: Ie, clearPromptResults: Le } = x0e({
|
|
205441
205508
|
prompts: i,
|
|
205442
205509
|
callPrompt: o,
|
|
205443
205510
|
serverId: a
|
|
205444
|
-
}),
|
|
205511
|
+
}), Re = (0, K.useCallback)((e) => Array.isArray(e) ? e.filter((e) => typeof e == "string").map((e) => e.trim()).filter(Boolean).slice(0, 8) : [], []), ze = (0, K.useCallback)((e) => typeof e.content == "string" ? e.content : Array.isArray(e.content) ? e.content.map((e) => typeof e == "string" ? e : e.text ?? "").join("") : "", []), Be = (0, K.useCallback)(() => xe.map((e) => ({
|
|
205445
205512
|
id: e.id,
|
|
205446
205513
|
role: e.role,
|
|
205447
|
-
content:
|
|
205514
|
+
content: ze(e),
|
|
205448
205515
|
timestamp: e.timestamp
|
|
205449
|
-
})), [
|
|
205516
|
+
})), [xe, ze]), Ve = (0, K.useCallback)((e, t = {}) => {
|
|
205450
205517
|
typeof window > "u" || window.parent === window || window.parent.postMessage({
|
|
205451
205518
|
type: e,
|
|
205452
205519
|
serverId: a,
|
|
@@ -205454,7 +205521,7 @@ function OZt({ connection: e, isConnected: t, useClientSide: n = !0, enableKeybo
|
|
|
205454
205521
|
}, "*");
|
|
205455
205522
|
}, [a]);
|
|
205456
205523
|
(0, K.useEffect)(() => {
|
|
205457
|
-
|
|
205524
|
+
Ve("mcp-inspector:chat:ready", { capabilities: {
|
|
205458
205525
|
send: !0,
|
|
205459
205526
|
clear: !0,
|
|
205460
205527
|
getState: !0,
|
|
@@ -205462,28 +205529,28 @@ function OZt({ connection: e, isConnected: t, useClientSide: n = !0, enableKeybo
|
|
|
205462
205529
|
setFollowups: !0,
|
|
205463
205530
|
loadMessages: !0
|
|
205464
205531
|
} });
|
|
205465
|
-
}, [
|
|
205466
|
-
|
|
205467
|
-
isLoading:
|
|
205468
|
-
messageCount:
|
|
205469
|
-
messages:
|
|
205470
|
-
quickQuestions:
|
|
205471
|
-
followups:
|
|
205532
|
+
}, [Ve]), (0, K.useEffect)(() => {
|
|
205533
|
+
Ve("mcp-inspector:chat:state_changed", {
|
|
205534
|
+
isLoading: Se,
|
|
205535
|
+
messageCount: xe.length,
|
|
205536
|
+
messages: Be(),
|
|
205537
|
+
quickQuestions: N,
|
|
205538
|
+
followups: F
|
|
205472
205539
|
});
|
|
205473
205540
|
}, [
|
|
205474
|
-
|
|
205475
|
-
|
|
205476
|
-
|
|
205477
|
-
|
|
205478
|
-
|
|
205479
|
-
|
|
205541
|
+
F,
|
|
205542
|
+
Be,
|
|
205543
|
+
Se,
|
|
205544
|
+
xe.length,
|
|
205545
|
+
Ve,
|
|
205546
|
+
N
|
|
205480
205547
|
]), (0, K.useEffect)(() => {
|
|
205481
205548
|
let e = (e) => {
|
|
205482
205549
|
if (!e.data || typeof e.data != "object") return;
|
|
205483
205550
|
let n = e.data;
|
|
205484
205551
|
if (!n.type?.startsWith("mcp-inspector:chat:") || n.serverId && n.serverId !== a) return;
|
|
205485
205552
|
let r = n.requestId, i = (e, t = {}) => {
|
|
205486
|
-
|
|
205553
|
+
Ve("mcp-inspector:chat:command_result", {
|
|
205487
205554
|
requestId: r,
|
|
205488
205555
|
ok: e,
|
|
205489
205556
|
...t
|
|
@@ -205495,12 +205562,12 @@ function OZt({ connection: e, isConnected: t, useClientSide: n = !0, enableKeybo
|
|
|
205495
205562
|
i(!1, { error: "Missing message" });
|
|
205496
205563
|
return;
|
|
205497
205564
|
}
|
|
205498
|
-
if (!
|
|
205565
|
+
if (!me || !t) {
|
|
205499
205566
|
i(!1, { error: "Chat is not ready to send messages" });
|
|
205500
205567
|
return;
|
|
205501
205568
|
}
|
|
205502
|
-
|
|
205503
|
-
|
|
205569
|
+
we(e, []).then(() => {
|
|
205570
|
+
Ve("mcp-inspector:chat:message_sent", {
|
|
205504
205571
|
requestId: r,
|
|
205505
205572
|
message: e,
|
|
205506
205573
|
source: "bridge"
|
|
@@ -205511,28 +205578,28 @@ function OZt({ connection: e, isConnected: t, useClientSide: n = !0, enableKeybo
|
|
|
205511
205578
|
return;
|
|
205512
205579
|
}
|
|
205513
205580
|
if (n.type === "mcp-inspector:chat:clear") {
|
|
205514
|
-
|
|
205581
|
+
Te(), Ve("mcp-inspector:chat:cleared", { requestId: r }), i(!0);
|
|
205515
205582
|
return;
|
|
205516
205583
|
}
|
|
205517
205584
|
if (n.type === "mcp-inspector:chat:get_state") {
|
|
205518
|
-
|
|
205585
|
+
Ve("mcp-inspector:chat:state", {
|
|
205519
205586
|
requestId: r,
|
|
205520
|
-
isLoading:
|
|
205521
|
-
messageCount:
|
|
205522
|
-
messages:
|
|
205523
|
-
quickQuestions:
|
|
205524
|
-
followups:
|
|
205587
|
+
isLoading: Se,
|
|
205588
|
+
messageCount: xe.length,
|
|
205589
|
+
messages: Be(),
|
|
205590
|
+
quickQuestions: N,
|
|
205591
|
+
followups: F
|
|
205525
205592
|
}), i(!0);
|
|
205526
205593
|
return;
|
|
205527
205594
|
}
|
|
205528
205595
|
if (n.type === "mcp-inspector:chat:set_quick_questions") {
|
|
205529
|
-
let e =
|
|
205530
|
-
|
|
205596
|
+
let e = Re(n.questions);
|
|
205597
|
+
P(e), i(!0, { quickQuestions: e });
|
|
205531
205598
|
return;
|
|
205532
205599
|
}
|
|
205533
205600
|
if (n.type === "mcp-inspector:chat:set_followups") {
|
|
205534
|
-
let e =
|
|
205535
|
-
|
|
205601
|
+
let e = Re(n.followups);
|
|
205602
|
+
I(e), i(!0, { followups: e });
|
|
205536
205603
|
return;
|
|
205537
205604
|
}
|
|
205538
205605
|
if (n.type === "mcp-inspector:chat:load_messages") {
|
|
@@ -205541,192 +205608,192 @@ function OZt({ connection: e, isConnected: t, useClientSide: n = !0, enableKeybo
|
|
|
205541
205608
|
i(!1, { error: "messages must be an array" });
|
|
205542
205609
|
return;
|
|
205543
205610
|
}
|
|
205544
|
-
|
|
205611
|
+
Ee(e), i(!0, { count: e.length });
|
|
205545
205612
|
return;
|
|
205546
205613
|
}
|
|
205547
205614
|
};
|
|
205548
205615
|
return window.addEventListener("message", e), () => window.removeEventListener("message", e);
|
|
205549
205616
|
}, [
|
|
205550
|
-
|
|
205617
|
+
Te,
|
|
205618
|
+
Ee,
|
|
205619
|
+
F,
|
|
205620
|
+
Be,
|
|
205551
205621
|
Se,
|
|
205552
|
-
|
|
205553
|
-
|
|
205554
|
-
|
|
205555
|
-
|
|
205556
|
-
|
|
205557
|
-
k,
|
|
205558
|
-
Pe,
|
|
205559
|
-
be,
|
|
205622
|
+
xe.length,
|
|
205623
|
+
Ve,
|
|
205624
|
+
N,
|
|
205625
|
+
Re,
|
|
205626
|
+
we,
|
|
205560
205627
|
a,
|
|
205561
|
-
|
|
205628
|
+
me,
|
|
205562
205629
|
t
|
|
205563
|
-
]), x1e(r ? { onNewChat:
|
|
205564
|
-
let
|
|
205565
|
-
|
|
205566
|
-
}, []),
|
|
205567
|
-
if (!
|
|
205568
|
-
let e =
|
|
205569
|
-
|
|
205630
|
+
]), x1e(r ? { onNewChat: Te } : {});
|
|
205631
|
+
let He = (0, K.useCallback)(() => {
|
|
205632
|
+
M(-1), A(!1), R.current = null;
|
|
205633
|
+
}, []), Ue = (0, K.useCallback)(() => {
|
|
205634
|
+
if (!te.current) return;
|
|
205635
|
+
let e = te.current.selectionStart, t = D.slice(0, e), n = EZt.test(t);
|
|
205636
|
+
A(n), n ? (R.current = {
|
|
205570
205637
|
start: e - 1,
|
|
205571
205638
|
end: e
|
|
205572
|
-
},
|
|
205573
|
-
}, [
|
|
205639
|
+
}, M(0)) : He();
|
|
205640
|
+
}, [D, He]);
|
|
205574
205641
|
(0, K.useEffect)(() => {
|
|
205575
|
-
|
|
205576
|
-
}, [
|
|
205577
|
-
!
|
|
205578
|
-
}, [
|
|
205579
|
-
|
|
205580
|
-
}, [
|
|
205581
|
-
let
|
|
205582
|
-
|
|
205583
|
-
}, [
|
|
205584
|
-
if (
|
|
205585
|
-
|
|
205642
|
+
me && xe.length === 0 && te.current && te.current.focus();
|
|
205643
|
+
}, [me, xe.length]), (0, K.useEffect)(() => {
|
|
205644
|
+
!Se && xe.length > 0 && te.current && te.current.focus();
|
|
205645
|
+
}, [Se, xe.length]), (0, K.useEffect)(() => {
|
|
205646
|
+
te.current && Ue();
|
|
205647
|
+
}, [D, Ue]);
|
|
205648
|
+
let We = (0, K.useCallback)(() => {
|
|
205649
|
+
je(null), Ne({}), He();
|
|
205650
|
+
}, [He]), B = (0, K.useCallback)(async (e) => {
|
|
205651
|
+
if (je(e), e.arguments && e.arguments.length > 0) {
|
|
205652
|
+
je(null), iF.error("Prompts with arguments are not supported", { description: "This prompt requires arguments which are not yet supported in chat mode." });
|
|
205586
205653
|
return;
|
|
205587
205654
|
}
|
|
205588
205655
|
try {
|
|
205589
|
-
await
|
|
205656
|
+
await Pe(e, {});
|
|
205590
205657
|
} catch (e) {
|
|
205591
205658
|
console.error("Error executing prompt", e);
|
|
205592
205659
|
} finally {
|
|
205593
|
-
if (
|
|
205594
|
-
let { start: e, end: t } =
|
|
205595
|
-
|
|
205596
|
-
|
|
205660
|
+
if (te.current && R.current) {
|
|
205661
|
+
let { start: e, end: t } = R.current;
|
|
205662
|
+
O(D.slice(0, e) + D.slice(t)), requestAnimationFrame(() => {
|
|
205663
|
+
te.current?.focus(), te.current?.setSelectionRange(e, e);
|
|
205597
205664
|
});
|
|
205598
205665
|
}
|
|
205599
|
-
|
|
205666
|
+
We();
|
|
205600
205667
|
}
|
|
205601
205668
|
}, [
|
|
205602
|
-
|
|
205603
|
-
|
|
205604
|
-
|
|
205605
|
-
]),
|
|
205606
|
-
(
|
|
205669
|
+
Pe,
|
|
205670
|
+
We,
|
|
205671
|
+
D
|
|
205672
|
+
]), Ge = (0, K.useCallback)(() => {
|
|
205673
|
+
(D.trim() || Fe.length > 0 || Ce.length > 0) && (we(D, Fe), O(""), Le());
|
|
205607
205674
|
}, [
|
|
205608
|
-
|
|
205609
|
-
|
|
205610
|
-
|
|
205611
|
-
|
|
205612
|
-
|
|
205613
|
-
]),
|
|
205614
|
-
if (e.key === "ArrowDown")
|
|
205615
|
-
else if (e.key === "ArrowUp")
|
|
205616
|
-
else if (e.key === "Escape") e.stopPropagation(),
|
|
205617
|
-
else if (e.key === "Enter" &&
|
|
205618
|
-
let e =
|
|
205619
|
-
e &&
|
|
205675
|
+
D,
|
|
205676
|
+
Fe,
|
|
205677
|
+
we,
|
|
205678
|
+
Le,
|
|
205679
|
+
Ce
|
|
205680
|
+
]), Ke = (0, K.useCallback)((e) => {
|
|
205681
|
+
if (e.key === "ArrowDown") M((e) => Ae.length === 0 ? -1 : (e + 1) % Ae.length);
|
|
205682
|
+
else if (e.key === "ArrowUp") M((e) => Ae.length === 0 ? -1 : (e - 1 + Ae.length) % Ae.length);
|
|
205683
|
+
else if (e.key === "Escape") e.stopPropagation(), He();
|
|
205684
|
+
else if (e.key === "Enter" && j >= 0) {
|
|
205685
|
+
let e = Ae[j];
|
|
205686
|
+
e && B(e);
|
|
205620
205687
|
}
|
|
205621
205688
|
}, [
|
|
205622
|
-
|
|
205623
|
-
|
|
205624
|
-
|
|
205625
|
-
|
|
205626
|
-
]),
|
|
205627
|
-
DZt.includes(e.key) &&
|
|
205689
|
+
Ae,
|
|
205690
|
+
j,
|
|
205691
|
+
B,
|
|
205692
|
+
He
|
|
205693
|
+
]), qe = (0, K.useCallback)((e) => {
|
|
205694
|
+
DZt.includes(e.key) && k ? (e.preventDefault(), Ke(e)) : e.key === "Enter" && !e.shiftKey && (e.preventDefault(), Ge());
|
|
205628
205695
|
}, [
|
|
205629
|
-
|
|
205630
|
-
|
|
205631
|
-
|
|
205632
|
-
]),
|
|
205633
|
-
(e.key === "ArrowLeft" || e.key === "ArrowRight") &&
|
|
205634
|
-
}, [
|
|
205635
|
-
|
|
205636
|
-
}, [
|
|
205637
|
-
e.trim() && (!
|
|
205638
|
-
|
|
205696
|
+
Ge,
|
|
205697
|
+
Ke,
|
|
205698
|
+
k
|
|
205699
|
+
]), Je = (0, K.useCallback)((e) => {
|
|
205700
|
+
(e.key === "ArrowLeft" || e.key === "ArrowRight") && Ue();
|
|
205701
|
+
}, [Ue]), Ye = (0, K.useCallback)(() => {
|
|
205702
|
+
pe(), Te();
|
|
205703
|
+
}, [pe, Te]), Xe = (0, K.useCallback)((e) => {
|
|
205704
|
+
e.trim() && (!me || !t || we(e, []).then(() => {
|
|
205705
|
+
Ve("mcp-inspector:chat:message_sent", {
|
|
205639
205706
|
message: e,
|
|
205640
205707
|
source: "quick_question"
|
|
205641
205708
|
});
|
|
205642
205709
|
}));
|
|
205643
205710
|
}, [
|
|
205644
|
-
|
|
205645
|
-
|
|
205646
|
-
|
|
205711
|
+
Ve,
|
|
205712
|
+
we,
|
|
205713
|
+
me,
|
|
205647
205714
|
t
|
|
205648
|
-
]),
|
|
205649
|
-
e.trim() && (!
|
|
205650
|
-
|
|
205715
|
+
]), Ze = (0, K.useCallback)((e) => {
|
|
205716
|
+
e.trim() && (!me || !t || we(e, []).then(() => {
|
|
205717
|
+
Ve("mcp-inspector:chat:message_sent", {
|
|
205651
205718
|
message: e,
|
|
205652
205719
|
source: "followup"
|
|
205653
205720
|
});
|
|
205654
205721
|
}));
|
|
205655
205722
|
}, [
|
|
205656
|
-
|
|
205657
|
-
|
|
205658
|
-
|
|
205723
|
+
Ve,
|
|
205724
|
+
we,
|
|
205725
|
+
me,
|
|
205659
205726
|
t
|
|
205660
205727
|
]);
|
|
205661
|
-
return
|
|
205728
|
+
return me && xe.length === 0 ? /* @__PURE__ */ (0, q.jsxs)("div", {
|
|
205662
205729
|
className: "flex flex-col h-full",
|
|
205663
|
-
children: [!
|
|
205730
|
+
children: [!he && /* @__PURE__ */ (0, q.jsx)("div", {
|
|
205664
205731
|
className: "absolute top-4 right-4 z-10",
|
|
205665
205732
|
children: /* @__PURE__ */ (0, q.jsx)(e2e, {
|
|
205666
|
-
open:
|
|
205667
|
-
onOpenChange:
|
|
205668
|
-
tempProvider:
|
|
205669
|
-
tempModel:
|
|
205670
|
-
tempApiKey:
|
|
205671
|
-
onProviderChange:
|
|
205672
|
-
onModelChange:
|
|
205673
|
-
onApiKeyChange:
|
|
205674
|
-
onSave:
|
|
205675
|
-
onClear:
|
|
205733
|
+
open: ie,
|
|
205734
|
+
onOpenChange: ae,
|
|
205735
|
+
tempProvider: oe,
|
|
205736
|
+
tempModel: ue,
|
|
205737
|
+
tempApiKey: ce,
|
|
205738
|
+
onProviderChange: se,
|
|
205739
|
+
onModelChange: de,
|
|
205740
|
+
onApiKeyChange: le,
|
|
205741
|
+
onSave: fe,
|
|
205742
|
+
onClear: Ye,
|
|
205676
205743
|
showClearButton: !0,
|
|
205677
205744
|
buttonLabel: "Change API Key"
|
|
205678
205745
|
})
|
|
205679
205746
|
}), /* @__PURE__ */ (0, q.jsx)(A2e, {
|
|
205680
205747
|
mcpServerUrl: e.url,
|
|
205681
|
-
inputValue:
|
|
205748
|
+
inputValue: D,
|
|
205682
205749
|
isConnected: t,
|
|
205683
|
-
isLoading:
|
|
205684
|
-
textareaRef:
|
|
205685
|
-
llmConfig:
|
|
205686
|
-
promptsDropdownOpen:
|
|
205687
|
-
promptFocusedIndex:
|
|
205688
|
-
prompts:
|
|
205689
|
-
selectedPrompt:
|
|
205690
|
-
promptResults:
|
|
205691
|
-
attachments:
|
|
205692
|
-
tools: b ? void 0 :
|
|
205693
|
-
disabledTools: b ? void 0 :
|
|
205694
|
-
onDisabledToolsChange: b ? void 0 :
|
|
205695
|
-
onDeletePromptResult:
|
|
205696
|
-
onPromptSelect:
|
|
205697
|
-
onInputChange:
|
|
205698
|
-
onKeyDown:
|
|
205699
|
-
onKeyUp:
|
|
205700
|
-
onClick:
|
|
205750
|
+
isLoading: Se,
|
|
205751
|
+
textareaRef: te,
|
|
205752
|
+
llmConfig: me,
|
|
205753
|
+
promptsDropdownOpen: k,
|
|
205754
|
+
promptFocusedIndex: j,
|
|
205755
|
+
prompts: Ae,
|
|
205756
|
+
selectedPrompt: Me,
|
|
205757
|
+
promptResults: Fe,
|
|
205758
|
+
attachments: Ce,
|
|
205759
|
+
tools: b ? void 0 : z,
|
|
205760
|
+
disabledTools: b ? void 0 : L,
|
|
205761
|
+
onDisabledToolsChange: b ? void 0 : ee,
|
|
205762
|
+
onDeletePromptResult: Ie,
|
|
205763
|
+
onPromptSelect: B,
|
|
205764
|
+
onInputChange: O,
|
|
205765
|
+
onKeyDown: qe,
|
|
205766
|
+
onKeyUp: Je,
|
|
205767
|
+
onClick: Ue,
|
|
205701
205768
|
onSubmit: (e) => {
|
|
205702
|
-
e.preventDefault(),
|
|
205769
|
+
e.preventDefault(), Ge();
|
|
205703
205770
|
},
|
|
205704
|
-
onConfigDialogOpenChange:
|
|
205705
|
-
onAttachmentAdd:
|
|
205706
|
-
onAttachmentRemove:
|
|
205771
|
+
onConfigDialogOpenChange: ae,
|
|
205772
|
+
onAttachmentAdd: Oe,
|
|
205773
|
+
onAttachmentRemove: ke,
|
|
205707
205774
|
hideModelBadge: m,
|
|
205708
205775
|
hideServerUrl: h,
|
|
205709
|
-
quickQuestions:
|
|
205710
|
-
onQuickQuestionSelect:
|
|
205776
|
+
quickQuestions: N,
|
|
205777
|
+
onQuickQuestionSelect: Xe
|
|
205711
205778
|
})]
|
|
205712
205779
|
}) : /* @__PURE__ */ (0, q.jsxs)("div", {
|
|
205713
205780
|
className: "flex flex-col h-full relative",
|
|
205714
205781
|
children: [
|
|
205715
205782
|
/* @__PURE__ */ (0, q.jsx)(t2e, {
|
|
205716
|
-
llmConfig:
|
|
205717
|
-
hasMessages:
|
|
205718
|
-
configDialogOpen:
|
|
205719
|
-
onConfigDialogOpenChange:
|
|
205720
|
-
onClearChat:
|
|
205721
|
-
tempProvider:
|
|
205722
|
-
tempModel:
|
|
205723
|
-
tempApiKey:
|
|
205724
|
-
onProviderChange:
|
|
205725
|
-
onModelChange:
|
|
205726
|
-
onApiKeyChange:
|
|
205727
|
-
onSaveConfig:
|
|
205728
|
-
onClearConfig:
|
|
205729
|
-
hideConfigButton:
|
|
205783
|
+
llmConfig: me,
|
|
205784
|
+
hasMessages: xe.length > 0,
|
|
205785
|
+
configDialogOpen: he ? !1 : ie,
|
|
205786
|
+
onConfigDialogOpenChange: he ? () => {} : ae,
|
|
205787
|
+
onClearChat: Te,
|
|
205788
|
+
tempProvider: oe,
|
|
205789
|
+
tempModel: ue,
|
|
205790
|
+
tempApiKey: ce,
|
|
205791
|
+
onProviderChange: se,
|
|
205792
|
+
onModelChange: de,
|
|
205793
|
+
onApiKeyChange: le,
|
|
205794
|
+
onSaveConfig: fe,
|
|
205795
|
+
onClearConfig: Ye,
|
|
205796
|
+
hideConfigButton: he,
|
|
205730
205797
|
clearButtonLabel: f,
|
|
205731
205798
|
hideTitle: p,
|
|
205732
205799
|
clearButtonHideIcon: g,
|
|
@@ -205736,42 +205803,42 @@ function OZt({ connection: e, isConnected: t, useClientSide: n = !0, enableKeybo
|
|
|
205736
205803
|
}),
|
|
205737
205804
|
/* @__PURE__ */ (0, q.jsx)("div", {
|
|
205738
205805
|
className: "flex-1 overflow-y-auto p-2 sm:p-4 pt-[80px] sm:pt-[100px]",
|
|
205739
|
-
children:
|
|
205740
|
-
messages:
|
|
205741
|
-
isLoading:
|
|
205806
|
+
children: me ? /* @__PURE__ */ (0, q.jsx)(pIt, {
|
|
205807
|
+
messages: xe,
|
|
205808
|
+
isLoading: Se,
|
|
205742
205809
|
serverId: e.url,
|
|
205743
205810
|
readResource: s,
|
|
205744
205811
|
tools: e.tools,
|
|
205745
|
-
sendMessage: (e, t) =>
|
|
205812
|
+
sendMessage: (e, t) => we(e, [], t),
|
|
205746
205813
|
serverBaseUrl: e.url
|
|
205747
|
-
}) : /* @__PURE__ */ (0, q.jsx)(j2e, { onConfigureClick: () =>
|
|
205814
|
+
}) : /* @__PURE__ */ (0, q.jsx)(j2e, { onConfigureClick: () => ae(!0) })
|
|
205748
205815
|
}),
|
|
205749
|
-
|
|
205750
|
-
inputValue:
|
|
205816
|
+
me && /* @__PURE__ */ (0, q.jsx)(O2e, {
|
|
205817
|
+
inputValue: D,
|
|
205751
205818
|
isConnected: t,
|
|
205752
|
-
isLoading:
|
|
205753
|
-
textareaRef:
|
|
205754
|
-
promptsDropdownOpen:
|
|
205755
|
-
promptFocusedIndex:
|
|
205756
|
-
prompts:
|
|
205757
|
-
promptResults:
|
|
205758
|
-
selectedPrompt:
|
|
205759
|
-
attachments:
|
|
205760
|
-
tools: b ? void 0 :
|
|
205761
|
-
disabledTools: b ? void 0 :
|
|
205762
|
-
onDisabledToolsChange: b ? void 0 :
|
|
205763
|
-
onDeletePromptResult:
|
|
205764
|
-
onPromptSelect:
|
|
205765
|
-
onInputChange:
|
|
205766
|
-
onKeyDown:
|
|
205767
|
-
onKeyUp:
|
|
205768
|
-
onClick:
|
|
205769
|
-
onSendMessage:
|
|
205770
|
-
onStopStreaming:
|
|
205771
|
-
onAttachmentAdd:
|
|
205772
|
-
onAttachmentRemove:
|
|
205773
|
-
followups:
|
|
205774
|
-
onFollowupSelect:
|
|
205819
|
+
isLoading: Se,
|
|
205820
|
+
textareaRef: te,
|
|
205821
|
+
promptsDropdownOpen: k,
|
|
205822
|
+
promptFocusedIndex: j,
|
|
205823
|
+
prompts: Ae,
|
|
205824
|
+
promptResults: Fe,
|
|
205825
|
+
selectedPrompt: Me,
|
|
205826
|
+
attachments: Ce,
|
|
205827
|
+
tools: b ? void 0 : z,
|
|
205828
|
+
disabledTools: b ? void 0 : L,
|
|
205829
|
+
onDisabledToolsChange: b ? void 0 : ee,
|
|
205830
|
+
onDeletePromptResult: Ie,
|
|
205831
|
+
onPromptSelect: B,
|
|
205832
|
+
onInputChange: O,
|
|
205833
|
+
onKeyDown: qe,
|
|
205834
|
+
onKeyUp: Je,
|
|
205835
|
+
onClick: Ue,
|
|
205836
|
+
onSendMessage: Ge,
|
|
205837
|
+
onStopStreaming: De,
|
|
205838
|
+
onAttachmentAdd: Oe,
|
|
205839
|
+
onAttachmentRemove: ke,
|
|
205840
|
+
followups: F,
|
|
205841
|
+
onFollowupSelect: Ze
|
|
205775
205842
|
})
|
|
205776
205843
|
]
|
|
205777
205844
|
});
|