@mcp-use/inspector 0.26.2-canary.3 → 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 +365 -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 +26 -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 +214 -142
- package/dist/web/assets/{browser-BooRvV2d.js → browser-Cyay4eSr.js} +3 -3
- package/dist/web/assets/{chunk-RPN2XO5I-Dan1acyM.js → chunk-RPN2XO5I-yrrAKptp.js} +1 -1
- package/dist/web/assets/{chunk-CPYHFP37-DKNg2Uzk.js → chunk-UN4HTJ53-UHTSWXbL.js} +1 -1
- package/dist/web/assets/{chunk_array-BxGdovlo.js → chunk_array-C34y19C8.js} +1 -1
- package/dist/web/assets/{client-Z2IZ3TRJ-DRh-kjpU.js → client-FP3U5ACX-EHqe6LYS.js} +3 -3
- package/dist/web/assets/{client-BsfvtnhC.js → client-vvLPAP7R.js} +1 -1
- package/dist/web/assets/{dist-C5VkGiyH.js → dist-CXtDOp58.js} +1 -1
- package/dist/web/assets/{dist-CzxBJ3Sn.js → dist-p054hNAE.js} +1 -1
- package/dist/web/assets/{dist-y_j0ocM9.js → dist-qYMcaYKa.js} +1 -1
- package/dist/web/assets/{function_calling-BhYEU91I.js → function_calling-CtMlF_FJ.js} +1 -1
- package/dist/web/assets/{index-DDOC4cFw.js → index-W_tOTbdF.js} +112 -112
- package/dist/web/assets/{llms-B0dBUNEd.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-CxjLIuFP.js → rpc-logger-TPNV75J4-Ba-UGeE3.js} +1 -1
- package/dist/web/assets/{stdio-KYKHYDDI-BRLnxXi1.js → stdio-C4Y5NJDQ-DOY3z4ue.js} +1 -1
- package/dist/web/assets/{tools-_onBLDxQ.js → tools-DEZZk64_.js} +1 -1
- package/dist/web/index.html +4 -4
- package/package.json +3 -3
- package/dist/web/assets/messages-BatQVC15.js +0 -1
- package/dist/web/assets/react-XUTZng08.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 }) {
|
|
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,88 +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
|
-
|
|
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,
|
|
165707
|
+
...c && c.size > 0 ? { disabledTools: [...c] } : {}
|
|
165703
165708
|
})
|
|
165704
165709
|
});
|
|
165705
|
-
if (!
|
|
165706
|
-
let
|
|
165707
|
-
|
|
165708
|
-
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,
|
|
165709
165714
|
role: "assistant",
|
|
165710
165715
|
content: "",
|
|
165711
165716
|
timestamp: Date.now(),
|
|
165712
165717
|
parts: []
|
|
165713
165718
|
}]);
|
|
165714
|
-
let
|
|
165715
|
-
if (!
|
|
165716
|
-
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 = "";
|
|
165717
165752
|
for (;;) {
|
|
165718
|
-
if (
|
|
165719
|
-
await
|
|
165753
|
+
if (y.current?.signal.aborted) {
|
|
165754
|
+
await C.cancel();
|
|
165720
165755
|
break;
|
|
165721
165756
|
}
|
|
165722
|
-
let { done: e, value: t } = await
|
|
165757
|
+
let { done: e, value: t } = await C.read();
|
|
165723
165758
|
if (e) break;
|
|
165724
|
-
|
|
165725
|
-
let n =
|
|
165726
|
-
|
|
165727
|
-
for (let e of n) if (e.trim()
|
|
165728
|
-
|
|
165729
|
-
|
|
165730
|
-
|
|
165731
|
-
|
|
165732
|
-
|
|
165733
|
-
|
|
165734
|
-
|
|
165735
|
-
|
|
165736
|
-
}), console.log("[Parts after text]", h.length, "parts, text length:", p.length), l((e) => e.map((e) => e.id === f ? {
|
|
165737
|
-
...e,
|
|
165738
|
-
parts: [...h]
|
|
165739
|
-
} : e));
|
|
165740
|
-
} else if (t.type === "tool-call") p &&= "", h.push({
|
|
165741
|
-
type: "tool-invocation",
|
|
165742
|
-
toolInvocation: {
|
|
165743
|
-
toolName: t.toolName,
|
|
165744
|
-
args: t.args,
|
|
165745
|
-
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;
|
|
165746
165771
|
}
|
|
165747
|
-
|
|
165748
|
-
|
|
165749
|
-
|
|
165750
|
-
|
|
165751
|
-
|
|
165752
|
-
|
|
165753
|
-
|
|
165754
|
-
|
|
165755
|
-
|
|
165756
|
-
|
|
165757
|
-
|
|
165758
|
-
|
|
165759
|
-
|
|
165760
|
-
|
|
165761
|
-
|
|
165762
|
-
|
|
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
|
+
}
|
|
165763
165821
|
} catch (t) {
|
|
165764
|
-
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;
|
|
165765
165824
|
}
|
|
165766
165825
|
}
|
|
165767
|
-
if (
|
|
165768
|
-
for (let e of
|
|
165769
|
-
|
|
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 ? {
|
|
165770
165829
|
...e,
|
|
165771
|
-
parts: [...
|
|
165830
|
+
parts: [...x],
|
|
165772
165831
|
content: ""
|
|
165773
165832
|
} : e));
|
|
165774
165833
|
}
|
|
@@ -165786,31 +165845,37 @@ function vIt({ mcpServerUrl: e, llmConfig: t, authConfig: n, isConnected: r, cha
|
|
|
165786
165845
|
content: `Error: ${t}`,
|
|
165787
165846
|
timestamp: Date.now()
|
|
165788
165847
|
};
|
|
165789
|
-
|
|
165848
|
+
m((e) => [...e, n]);
|
|
165790
165849
|
} finally {
|
|
165791
|
-
|
|
165850
|
+
g(!1), y.current = null;
|
|
165792
165851
|
}
|
|
165793
165852
|
}, [
|
|
165794
165853
|
t,
|
|
165795
165854
|
r,
|
|
165796
165855
|
e,
|
|
165797
|
-
|
|
165856
|
+
p,
|
|
165798
165857
|
n,
|
|
165799
|
-
|
|
165858
|
+
_,
|
|
165800
165859
|
i,
|
|
165801
|
-
a
|
|
165860
|
+
a,
|
|
165861
|
+
o,
|
|
165862
|
+
c,
|
|
165863
|
+
l,
|
|
165864
|
+
u,
|
|
165865
|
+
d,
|
|
165866
|
+
f
|
|
165802
165867
|
]),
|
|
165803
165868
|
clearMessages: (0, K.useCallback)(() => {
|
|
165804
|
-
|
|
165869
|
+
m([]);
|
|
165805
165870
|
}, []),
|
|
165806
|
-
setMessages:
|
|
165871
|
+
setMessages: m,
|
|
165807
165872
|
stop: (0, K.useCallback)(() => {
|
|
165808
|
-
|
|
165873
|
+
y.current && y.current.abort();
|
|
165809
165874
|
}, []),
|
|
165810
165875
|
addAttachment: (0, K.useCallback)(async (e) => {
|
|
165811
165876
|
try {
|
|
165812
165877
|
let t = await C2e(e);
|
|
165813
|
-
|
|
165878
|
+
v((e) => {
|
|
165814
165879
|
let n = [...e, t];
|
|
165815
165880
|
return x2e(n) ? n : (alert("Total attachment size exceeds 20MB limit"), e);
|
|
165816
165881
|
});
|
|
@@ -165819,10 +165884,10 @@ function vIt({ mcpServerUrl: e, llmConfig: t, authConfig: n, isConnected: r, cha
|
|
|
165819
165884
|
}
|
|
165820
165885
|
}, []),
|
|
165821
165886
|
removeAttachment: (0, K.useCallback)((e) => {
|
|
165822
|
-
|
|
165887
|
+
v((t) => t.filter((t, n) => n !== e));
|
|
165823
165888
|
}, []),
|
|
165824
165889
|
clearAttachments: (0, K.useCallback)(() => {
|
|
165825
|
-
|
|
165890
|
+
v([]);
|
|
165826
165891
|
}, [])
|
|
165827
165892
|
};
|
|
165828
165893
|
}
|
|
@@ -205414,36 +205479,41 @@ var EZt = /(?:^\/$|\s+\/$)/, DZt = [
|
|
|
205414
205479
|
"Escape",
|
|
205415
205480
|
"Enter"
|
|
205416
205481
|
];
|
|
205417
|
-
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 = [] }) {
|
|
205418
|
-
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) => ({
|
|
205419
205484
|
name: e.name,
|
|
205420
205485
|
description: e.description
|
|
205421
|
-
})), [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 = {
|
|
205422
205487
|
connection: e,
|
|
205423
|
-
llmConfig:
|
|
205488
|
+
llmConfig: me,
|
|
205424
205489
|
isConnected: t,
|
|
205425
205490
|
readResource: s,
|
|
205426
|
-
widgetModelContexts:
|
|
205427
|
-
disabledTools:
|
|
205428
|
-
},
|
|
205491
|
+
widgetModelContexts: _e,
|
|
205492
|
+
disabledTools: L
|
|
205493
|
+
}, ye = vIt({
|
|
205429
205494
|
mcpServerUrl: e.url,
|
|
205430
|
-
llmConfig:
|
|
205431
|
-
authConfig:
|
|
205495
|
+
llmConfig: me,
|
|
205496
|
+
authConfig: re,
|
|
205432
205497
|
isConnected: t,
|
|
205433
205498
|
chatApiUrl: c,
|
|
205434
205499
|
waitForChatApiUrl: l,
|
|
205435
|
-
widgetModelContexts:
|
|
205436
|
-
initialMessages: u
|
|
205437
|
-
|
|
205500
|
+
widgetModelContexts: _e,
|
|
205501
|
+
initialMessages: u,
|
|
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({
|
|
205438
205508
|
prompts: i,
|
|
205439
205509
|
callPrompt: o,
|
|
205440
205510
|
serverId: a
|
|
205441
|
-
}),
|
|
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) => ({
|
|
205442
205512
|
id: e.id,
|
|
205443
205513
|
role: e.role,
|
|
205444
|
-
content:
|
|
205514
|
+
content: ze(e),
|
|
205445
205515
|
timestamp: e.timestamp
|
|
205446
|
-
})), [
|
|
205516
|
+
})), [xe, ze]), Ve = (0, K.useCallback)((e, t = {}) => {
|
|
205447
205517
|
typeof window > "u" || window.parent === window || window.parent.postMessage({
|
|
205448
205518
|
type: e,
|
|
205449
205519
|
serverId: a,
|
|
@@ -205451,7 +205521,7 @@ function OZt({ connection: e, isConnected: t, useClientSide: n = !0, enableKeybo
|
|
|
205451
205521
|
}, "*");
|
|
205452
205522
|
}, [a]);
|
|
205453
205523
|
(0, K.useEffect)(() => {
|
|
205454
|
-
|
|
205524
|
+
Ve("mcp-inspector:chat:ready", { capabilities: {
|
|
205455
205525
|
send: !0,
|
|
205456
205526
|
clear: !0,
|
|
205457
205527
|
getState: !0,
|
|
@@ -205459,28 +205529,28 @@ function OZt({ connection: e, isConnected: t, useClientSide: n = !0, enableKeybo
|
|
|
205459
205529
|
setFollowups: !0,
|
|
205460
205530
|
loadMessages: !0
|
|
205461
205531
|
} });
|
|
205462
|
-
}, [
|
|
205463
|
-
|
|
205464
|
-
isLoading:
|
|
205465
|
-
messageCount:
|
|
205466
|
-
messages:
|
|
205467
|
-
quickQuestions:
|
|
205468
|
-
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
|
|
205469
205539
|
});
|
|
205470
205540
|
}, [
|
|
205471
|
-
|
|
205472
|
-
|
|
205473
|
-
|
|
205474
|
-
|
|
205475
|
-
|
|
205476
|
-
|
|
205541
|
+
F,
|
|
205542
|
+
Be,
|
|
205543
|
+
Se,
|
|
205544
|
+
xe.length,
|
|
205545
|
+
Ve,
|
|
205546
|
+
N
|
|
205477
205547
|
]), (0, K.useEffect)(() => {
|
|
205478
205548
|
let e = (e) => {
|
|
205479
205549
|
if (!e.data || typeof e.data != "object") return;
|
|
205480
205550
|
let n = e.data;
|
|
205481
205551
|
if (!n.type?.startsWith("mcp-inspector:chat:") || n.serverId && n.serverId !== a) return;
|
|
205482
205552
|
let r = n.requestId, i = (e, t = {}) => {
|
|
205483
|
-
|
|
205553
|
+
Ve("mcp-inspector:chat:command_result", {
|
|
205484
205554
|
requestId: r,
|
|
205485
205555
|
ok: e,
|
|
205486
205556
|
...t
|
|
@@ -205492,12 +205562,12 @@ function OZt({ connection: e, isConnected: t, useClientSide: n = !0, enableKeybo
|
|
|
205492
205562
|
i(!1, { error: "Missing message" });
|
|
205493
205563
|
return;
|
|
205494
205564
|
}
|
|
205495
|
-
if (!
|
|
205565
|
+
if (!me || !t) {
|
|
205496
205566
|
i(!1, { error: "Chat is not ready to send messages" });
|
|
205497
205567
|
return;
|
|
205498
205568
|
}
|
|
205499
|
-
|
|
205500
|
-
|
|
205569
|
+
we(e, []).then(() => {
|
|
205570
|
+
Ve("mcp-inspector:chat:message_sent", {
|
|
205501
205571
|
requestId: r,
|
|
205502
205572
|
message: e,
|
|
205503
205573
|
source: "bridge"
|
|
@@ -205508,28 +205578,28 @@ function OZt({ connection: e, isConnected: t, useClientSide: n = !0, enableKeybo
|
|
|
205508
205578
|
return;
|
|
205509
205579
|
}
|
|
205510
205580
|
if (n.type === "mcp-inspector:chat:clear") {
|
|
205511
|
-
|
|
205581
|
+
Te(), Ve("mcp-inspector:chat:cleared", { requestId: r }), i(!0);
|
|
205512
205582
|
return;
|
|
205513
205583
|
}
|
|
205514
205584
|
if (n.type === "mcp-inspector:chat:get_state") {
|
|
205515
|
-
|
|
205585
|
+
Ve("mcp-inspector:chat:state", {
|
|
205516
205586
|
requestId: r,
|
|
205517
|
-
isLoading:
|
|
205518
|
-
messageCount:
|
|
205519
|
-
messages:
|
|
205520
|
-
quickQuestions:
|
|
205521
|
-
followups:
|
|
205587
|
+
isLoading: Se,
|
|
205588
|
+
messageCount: xe.length,
|
|
205589
|
+
messages: Be(),
|
|
205590
|
+
quickQuestions: N,
|
|
205591
|
+
followups: F
|
|
205522
205592
|
}), i(!0);
|
|
205523
205593
|
return;
|
|
205524
205594
|
}
|
|
205525
205595
|
if (n.type === "mcp-inspector:chat:set_quick_questions") {
|
|
205526
|
-
let e =
|
|
205527
|
-
|
|
205596
|
+
let e = Re(n.questions);
|
|
205597
|
+
P(e), i(!0, { quickQuestions: e });
|
|
205528
205598
|
return;
|
|
205529
205599
|
}
|
|
205530
205600
|
if (n.type === "mcp-inspector:chat:set_followups") {
|
|
205531
|
-
let e =
|
|
205532
|
-
|
|
205601
|
+
let e = Re(n.followups);
|
|
205602
|
+
I(e), i(!0, { followups: e });
|
|
205533
205603
|
return;
|
|
205534
205604
|
}
|
|
205535
205605
|
if (n.type === "mcp-inspector:chat:load_messages") {
|
|
@@ -205538,192 +205608,192 @@ function OZt({ connection: e, isConnected: t, useClientSide: n = !0, enableKeybo
|
|
|
205538
205608
|
i(!1, { error: "messages must be an array" });
|
|
205539
205609
|
return;
|
|
205540
205610
|
}
|
|
205541
|
-
|
|
205611
|
+
Ee(e), i(!0, { count: e.length });
|
|
205542
205612
|
return;
|
|
205543
205613
|
}
|
|
205544
205614
|
};
|
|
205545
205615
|
return window.addEventListener("message", e), () => window.removeEventListener("message", e);
|
|
205546
205616
|
}, [
|
|
205547
|
-
|
|
205617
|
+
Te,
|
|
205618
|
+
Ee,
|
|
205619
|
+
F,
|
|
205620
|
+
Be,
|
|
205548
205621
|
Se,
|
|
205549
|
-
|
|
205550
|
-
|
|
205551
|
-
|
|
205552
|
-
|
|
205553
|
-
|
|
205554
|
-
k,
|
|
205555
|
-
Pe,
|
|
205556
|
-
be,
|
|
205622
|
+
xe.length,
|
|
205623
|
+
Ve,
|
|
205624
|
+
N,
|
|
205625
|
+
Re,
|
|
205626
|
+
we,
|
|
205557
205627
|
a,
|
|
205558
|
-
|
|
205628
|
+
me,
|
|
205559
205629
|
t
|
|
205560
|
-
]), x1e(r ? { onNewChat:
|
|
205561
|
-
let
|
|
205562
|
-
|
|
205563
|
-
}, []),
|
|
205564
|
-
if (!
|
|
205565
|
-
let e =
|
|
205566
|
-
|
|
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 = {
|
|
205567
205637
|
start: e - 1,
|
|
205568
205638
|
end: e
|
|
205569
|
-
},
|
|
205570
|
-
}, [
|
|
205639
|
+
}, M(0)) : He();
|
|
205640
|
+
}, [D, He]);
|
|
205571
205641
|
(0, K.useEffect)(() => {
|
|
205572
|
-
|
|
205573
|
-
}, [
|
|
205574
|
-
!
|
|
205575
|
-
}, [
|
|
205576
|
-
|
|
205577
|
-
}, [
|
|
205578
|
-
let
|
|
205579
|
-
|
|
205580
|
-
}, [
|
|
205581
|
-
if (
|
|
205582
|
-
|
|
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." });
|
|
205583
205653
|
return;
|
|
205584
205654
|
}
|
|
205585
205655
|
try {
|
|
205586
|
-
await
|
|
205656
|
+
await Pe(e, {});
|
|
205587
205657
|
} catch (e) {
|
|
205588
205658
|
console.error("Error executing prompt", e);
|
|
205589
205659
|
} finally {
|
|
205590
|
-
if (
|
|
205591
|
-
let { start: e, end: t } =
|
|
205592
|
-
|
|
205593
|
-
|
|
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);
|
|
205594
205664
|
});
|
|
205595
205665
|
}
|
|
205596
|
-
|
|
205666
|
+
We();
|
|
205597
205667
|
}
|
|
205598
205668
|
}, [
|
|
205599
|
-
|
|
205600
|
-
|
|
205601
|
-
|
|
205602
|
-
]),
|
|
205603
|
-
(
|
|
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());
|
|
205604
205674
|
}, [
|
|
205605
|
-
|
|
205606
|
-
|
|
205607
|
-
|
|
205608
|
-
|
|
205609
|
-
|
|
205610
|
-
]),
|
|
205611
|
-
if (e.key === "ArrowDown")
|
|
205612
|
-
else if (e.key === "ArrowUp")
|
|
205613
|
-
else if (e.key === "Escape") e.stopPropagation(),
|
|
205614
|
-
else if (e.key === "Enter" &&
|
|
205615
|
-
let e =
|
|
205616
|
-
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);
|
|
205617
205687
|
}
|
|
205618
205688
|
}, [
|
|
205619
|
-
|
|
205620
|
-
|
|
205621
|
-
|
|
205622
|
-
|
|
205623
|
-
]),
|
|
205624
|
-
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());
|
|
205625
205695
|
}, [
|
|
205626
|
-
|
|
205627
|
-
|
|
205628
|
-
|
|
205629
|
-
]),
|
|
205630
|
-
(e.key === "ArrowLeft" || e.key === "ArrowRight") &&
|
|
205631
|
-
}, [
|
|
205632
|
-
|
|
205633
|
-
}, [
|
|
205634
|
-
e.trim() && (!
|
|
205635
|
-
|
|
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", {
|
|
205636
205706
|
message: e,
|
|
205637
205707
|
source: "quick_question"
|
|
205638
205708
|
});
|
|
205639
205709
|
}));
|
|
205640
205710
|
}, [
|
|
205641
|
-
|
|
205642
|
-
|
|
205643
|
-
|
|
205711
|
+
Ve,
|
|
205712
|
+
we,
|
|
205713
|
+
me,
|
|
205644
205714
|
t
|
|
205645
|
-
]),
|
|
205646
|
-
e.trim() && (!
|
|
205647
|
-
|
|
205715
|
+
]), Ze = (0, K.useCallback)((e) => {
|
|
205716
|
+
e.trim() && (!me || !t || we(e, []).then(() => {
|
|
205717
|
+
Ve("mcp-inspector:chat:message_sent", {
|
|
205648
205718
|
message: e,
|
|
205649
205719
|
source: "followup"
|
|
205650
205720
|
});
|
|
205651
205721
|
}));
|
|
205652
205722
|
}, [
|
|
205653
|
-
|
|
205654
|
-
|
|
205655
|
-
|
|
205723
|
+
Ve,
|
|
205724
|
+
we,
|
|
205725
|
+
me,
|
|
205656
205726
|
t
|
|
205657
205727
|
]);
|
|
205658
|
-
return
|
|
205728
|
+
return me && xe.length === 0 ? /* @__PURE__ */ (0, q.jsxs)("div", {
|
|
205659
205729
|
className: "flex flex-col h-full",
|
|
205660
|
-
children: [!
|
|
205730
|
+
children: [!he && /* @__PURE__ */ (0, q.jsx)("div", {
|
|
205661
205731
|
className: "absolute top-4 right-4 z-10",
|
|
205662
205732
|
children: /* @__PURE__ */ (0, q.jsx)(e2e, {
|
|
205663
|
-
open:
|
|
205664
|
-
onOpenChange:
|
|
205665
|
-
tempProvider:
|
|
205666
|
-
tempModel:
|
|
205667
|
-
tempApiKey:
|
|
205668
|
-
onProviderChange:
|
|
205669
|
-
onModelChange:
|
|
205670
|
-
onApiKeyChange:
|
|
205671
|
-
onSave:
|
|
205672
|
-
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,
|
|
205673
205743
|
showClearButton: !0,
|
|
205674
205744
|
buttonLabel: "Change API Key"
|
|
205675
205745
|
})
|
|
205676
205746
|
}), /* @__PURE__ */ (0, q.jsx)(A2e, {
|
|
205677
205747
|
mcpServerUrl: e.url,
|
|
205678
|
-
inputValue:
|
|
205748
|
+
inputValue: D,
|
|
205679
205749
|
isConnected: t,
|
|
205680
|
-
isLoading:
|
|
205681
|
-
textareaRef:
|
|
205682
|
-
llmConfig:
|
|
205683
|
-
promptsDropdownOpen:
|
|
205684
|
-
promptFocusedIndex:
|
|
205685
|
-
prompts:
|
|
205686
|
-
selectedPrompt:
|
|
205687
|
-
promptResults:
|
|
205688
|
-
attachments:
|
|
205689
|
-
tools: b ? void 0 :
|
|
205690
|
-
disabledTools: b ? void 0 :
|
|
205691
|
-
onDisabledToolsChange: b ? void 0 :
|
|
205692
|
-
onDeletePromptResult:
|
|
205693
|
-
onPromptSelect:
|
|
205694
|
-
onInputChange:
|
|
205695
|
-
onKeyDown:
|
|
205696
|
-
onKeyUp:
|
|
205697
|
-
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,
|
|
205698
205768
|
onSubmit: (e) => {
|
|
205699
|
-
e.preventDefault(),
|
|
205769
|
+
e.preventDefault(), Ge();
|
|
205700
205770
|
},
|
|
205701
|
-
onConfigDialogOpenChange:
|
|
205702
|
-
onAttachmentAdd:
|
|
205703
|
-
onAttachmentRemove:
|
|
205771
|
+
onConfigDialogOpenChange: ae,
|
|
205772
|
+
onAttachmentAdd: Oe,
|
|
205773
|
+
onAttachmentRemove: ke,
|
|
205704
205774
|
hideModelBadge: m,
|
|
205705
205775
|
hideServerUrl: h,
|
|
205706
|
-
quickQuestions:
|
|
205707
|
-
onQuickQuestionSelect:
|
|
205776
|
+
quickQuestions: N,
|
|
205777
|
+
onQuickQuestionSelect: Xe
|
|
205708
205778
|
})]
|
|
205709
205779
|
}) : /* @__PURE__ */ (0, q.jsxs)("div", {
|
|
205710
205780
|
className: "flex flex-col h-full relative",
|
|
205711
205781
|
children: [
|
|
205712
205782
|
/* @__PURE__ */ (0, q.jsx)(t2e, {
|
|
205713
|
-
llmConfig:
|
|
205714
|
-
hasMessages:
|
|
205715
|
-
configDialogOpen:
|
|
205716
|
-
onConfigDialogOpenChange:
|
|
205717
|
-
onClearChat:
|
|
205718
|
-
tempProvider:
|
|
205719
|
-
tempModel:
|
|
205720
|
-
tempApiKey:
|
|
205721
|
-
onProviderChange:
|
|
205722
|
-
onModelChange:
|
|
205723
|
-
onApiKeyChange:
|
|
205724
|
-
onSaveConfig:
|
|
205725
|
-
onClearConfig:
|
|
205726
|
-
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,
|
|
205727
205797
|
clearButtonLabel: f,
|
|
205728
205798
|
hideTitle: p,
|
|
205729
205799
|
clearButtonHideIcon: g,
|
|
@@ -205733,42 +205803,42 @@ function OZt({ connection: e, isConnected: t, useClientSide: n = !0, enableKeybo
|
|
|
205733
205803
|
}),
|
|
205734
205804
|
/* @__PURE__ */ (0, q.jsx)("div", {
|
|
205735
205805
|
className: "flex-1 overflow-y-auto p-2 sm:p-4 pt-[80px] sm:pt-[100px]",
|
|
205736
|
-
children:
|
|
205737
|
-
messages:
|
|
205738
|
-
isLoading:
|
|
205806
|
+
children: me ? /* @__PURE__ */ (0, q.jsx)(pIt, {
|
|
205807
|
+
messages: xe,
|
|
205808
|
+
isLoading: Se,
|
|
205739
205809
|
serverId: e.url,
|
|
205740
205810
|
readResource: s,
|
|
205741
205811
|
tools: e.tools,
|
|
205742
|
-
sendMessage: (e, t) =>
|
|
205812
|
+
sendMessage: (e, t) => we(e, [], t),
|
|
205743
205813
|
serverBaseUrl: e.url
|
|
205744
|
-
}) : /* @__PURE__ */ (0, q.jsx)(j2e, { onConfigureClick: () =>
|
|
205814
|
+
}) : /* @__PURE__ */ (0, q.jsx)(j2e, { onConfigureClick: () => ae(!0) })
|
|
205745
205815
|
}),
|
|
205746
|
-
|
|
205747
|
-
inputValue:
|
|
205816
|
+
me && /* @__PURE__ */ (0, q.jsx)(O2e, {
|
|
205817
|
+
inputValue: D,
|
|
205748
205818
|
isConnected: t,
|
|
205749
|
-
isLoading:
|
|
205750
|
-
textareaRef:
|
|
205751
|
-
promptsDropdownOpen:
|
|
205752
|
-
promptFocusedIndex:
|
|
205753
|
-
prompts:
|
|
205754
|
-
promptResults:
|
|
205755
|
-
selectedPrompt:
|
|
205756
|
-
attachments:
|
|
205757
|
-
tools: b ? void 0 :
|
|
205758
|
-
disabledTools: b ? void 0 :
|
|
205759
|
-
onDisabledToolsChange: b ? void 0 :
|
|
205760
|
-
onDeletePromptResult:
|
|
205761
|
-
onPromptSelect:
|
|
205762
|
-
onInputChange:
|
|
205763
|
-
onKeyDown:
|
|
205764
|
-
onKeyUp:
|
|
205765
|
-
onClick:
|
|
205766
|
-
onSendMessage:
|
|
205767
|
-
onStopStreaming:
|
|
205768
|
-
onAttachmentAdd:
|
|
205769
|
-
onAttachmentRemove:
|
|
205770
|
-
followups:
|
|
205771
|
-
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
|
|
205772
205842
|
})
|
|
205773
205843
|
]
|
|
205774
205844
|
});
|