@mcp-use/inspector 3.0.1-canary.2 → 3.0.1-canary.4

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.
@@ -26920,7 +26920,7 @@ var Gd = class {
26920
26920
  //#region src/client/telemetry/utils.ts
26921
26921
  function cf() {
26922
26922
  try {
26923
- return "3.0.1-canary.2";
26923
+ return "3.0.1-canary.4";
26924
26924
  } catch {
26925
26925
  return "0.0.0";
26926
26926
  }
@@ -48457,9 +48457,9 @@ var aj, oj, sj, cj, lj, uj, dj, fj, pj, mj, hj, gj, _j, vj, Lce, Rce, yj, bj, xj
48457
48457
  }(), VF);
48458
48458
  }));
48459
48459
  //#endregion
48460
- //#region ../mcp-use/dist/chunk-Z64EF45A.js
48460
+ //#region ../mcp-use/dist/chunk-CZQVQ5BD.js
48461
48461
  Zp();
48462
- var Hue = "1.25.1-canary.2";
48462
+ var Hue = "1.25.1-canary.4";
48463
48463
  function KF() {
48464
48464
  return Hue;
48465
48465
  }
@@ -134254,36 +134254,36 @@ function jZe({ connection: e, isConnected: t, useClientSide: n = !0, enableKeybo
134254
134254
  let [k, j] = (0, A.useState)(""), [M, N] = (0, A.useState)(!1), [P, F] = (0, A.useState)(-1), [I, L] = (0, A.useState)(S), [ee, te] = (0, A.useState)(C), [ne, re] = (0, A.useState)(/* @__PURE__ */ new Set()), ie = (0, A.useRef)(null), R = (0, A.useRef)(null), z = (0, A.useRef)(null), ae = (0, A.useMemo)(() => (e.tools ?? []).map((e) => ({
134255
134255
  name: e.name,
134256
134256
  description: e.description
134257
- })), [e.tools]), { llmConfig: oe, authConfig: se, configDialogOpen: ce, setConfigDialogOpen: le, tempProvider: ue, setTempProvider: de, tempApiKey: fe, setTempApiKey: pe, tempModel: me, setTempModel: he, saveLLMConfig: ge, clearConfig: _e } = Y7({ mcpServerUrl: e.url }), [ve, ye] = (0, A.useState)(() => !!oe), be = n || ve || !!oe, xe = be ? oe : d ?? oe, Se = !be && !!d, { getAllModelContexts: Ce } = Z4(), we = Ce(), Te = {
134257
+ })), [e.tools]), { llmConfig: oe, authConfig: se, configDialogOpen: ce, setConfigDialogOpen: le, tempProvider: ue, setTempProvider: de, tempApiKey: fe, setTempApiKey: pe, tempModel: me, setTempModel: he, saveLLMConfig: ge, clearConfig: _e } = Y7({ mcpServerUrl: e.url }), ve = !n && d != null, [ye, be] = (0, A.useState)(() => ve ? !1 : !!oe), xe = ve ? ye : n || ye || !!oe, Se = xe ? oe : d ?? oe, Ce = !xe && !!d, { getAllModelContexts: we } = Z4(), Te = we(), Ee = {
134258
134258
  connection: e,
134259
- llmConfig: xe,
134259
+ llmConfig: Se,
134260
134260
  isConnected: t,
134261
134261
  readResource: s,
134262
- widgetModelContexts: we,
134262
+ widgetModelContexts: Te,
134263
134263
  disabledTools: ne
134264
- }, Ee = yZe({
134264
+ }, De = yZe({
134265
134265
  mcpServerUrl: e.url,
134266
- llmConfig: xe,
134266
+ llmConfig: Se,
134267
134267
  authConfig: se,
134268
134268
  isConnected: t,
134269
134269
  chatApiUrl: c,
134270
134270
  waitForChatApiUrl: l,
134271
- widgetModelContexts: we,
134271
+ widgetModelContexts: Te,
134272
134272
  initialMessages: u,
134273
134273
  disabledTools: ne,
134274
134274
  streamProtocol: w,
134275
134275
  credentials: T,
134276
134276
  extraHeaders: E,
134277
134277
  body: D
134278
- }), De = CZe(Te), { messages: Oe, isLoading: ke, attachments: Ae, sendMessage: je, clearMessages: Me, setMessages: Ne, stop: Pe, addAttachment: Fe, removeAttachment: Ie } = be ? De : Ee, Le = be ? null : Ee.rateLimitInfo ?? null, Re = be ? void 0 : Ee.clearRateLimitInfo, ze = (0, A.useCallback)(() => {
134279
- Re?.(), ye(!0), le(!0);
134280
- }, [Re, le]), [Be, Ve] = (0, A.useState)(!1), He = (0, A.useCallback)(() => {
134281
- le(!1), Ve(!0);
134282
- }, [le]), B = Se && f ? { onLoginClick: He } : void 0, { filteredPrompts: Ue, setSelectedPrompt: We, selectedPrompt: Ge, setPromptArgs: Ke, executePrompt: qe, results: Je, handleDeleteResult: Ye, clearPromptResults: Xe } = fIe({
134278
+ }), Oe = CZe(Ee), { messages: ke, isLoading: Ae, attachments: je, sendMessage: Me, clearMessages: Ne, setMessages: Pe, stop: Fe, addAttachment: Ie, removeAttachment: Le } = xe ? Oe : De, Re = xe ? null : De.rateLimitInfo ?? null, ze = xe ? void 0 : De.clearRateLimitInfo, Be = (0, A.useCallback)(() => {
134279
+ ze?.(), be(!0), le(!0);
134280
+ }, [ze, le]), [Ve, He] = (0, A.useState)(!1), B = (0, A.useCallback)(() => {
134281
+ le(!1), He(!0);
134282
+ }, [le]), Ue = Ce && f ? { onLoginClick: B } : void 0, We = !!d && !!h, Ge = We || !!h && !xe, { filteredPrompts: Ke, setSelectedPrompt: qe, selectedPrompt: Je, setPromptArgs: Ye, executePrompt: Xe, results: Ze, handleDeleteResult: Qe, clearPromptResults: $e } = fIe({
134283
134283
  prompts: i,
134284
134284
  callPrompt: o,
134285
134285
  serverId: a
134286
- }), Ze = (0, A.useCallback)((e) => Array.isArray(e) ? e.filter((e) => typeof e == "string").map((e) => e.trim()).filter(Boolean).slice(0, 8) : [], []), Qe = (0, A.useCallback)((e) => {
134286
+ }), et = (0, A.useCallback)((e) => Array.isArray(e) ? e.filter((e) => typeof e == "string").map((e) => e.trim()).filter(Boolean).slice(0, 8) : [], []), tt = (0, A.useCallback)((e) => {
134287
134287
  if (typeof e.content == "string" && e.content.trim()) return e.content;
134288
134288
  if (Array.isArray(e.content) && e.content.length > 0) return e.content.map((e) => typeof e == "string" ? e : e.text ?? "").join("");
134289
134289
  if (e.parts && e.parts.length > 0) {
@@ -134291,7 +134291,7 @@ function jZe({ connection: e, isConnected: t, useClientSide: n = !0, enableKeybo
134291
134291
  if (t.length > 0) return t.join("\n");
134292
134292
  }
134293
134293
  return "";
134294
- }, []), $e = (0, A.useCallback)((e) => {
134294
+ }, []), nt = (0, A.useCallback)((e) => {
134295
134295
  if (e == null) return "No result";
134296
134296
  if (typeof e == "string") try {
134297
134297
  let t = JSON.parse(e);
@@ -134314,8 +134314,8 @@ function jZe({ connection: e, isConnected: t, useClientSide: n = !0, enableKeybo
134314
134314
  }).join("\n\n");
134315
134315
  }
134316
134316
  return JSON.stringify(e, null, 2);
134317
- }, []), et = (0, A.useCallback)(() => Oe.map((e) => {
134318
- let t = Qe(e), n = e.parts?.filter((e) => e.type === "tool-invocation" && e.toolInvocation).map((e) => ({
134317
+ }, []), rt = (0, A.useCallback)(() => ke.map((e) => {
134318
+ let t = tt(e), n = e.parts?.filter((e) => e.type === "tool-invocation" && e.toolInvocation).map((e) => ({
134319
134319
  toolName: e.toolInvocation.toolName,
134320
134320
  args: e.toolInvocation.args,
134321
134321
  state: e.toolInvocation.state,
@@ -134328,7 +134328,7 @@ function jZe({ connection: e, isConnected: t, useClientSide: n = !0, enableKeybo
134328
134328
  timestamp: e.timestamp,
134329
134329
  toolInvocations: n?.length ? n : void 0
134330
134330
  };
134331
- }), [Oe, Qe]), tt = (0, A.useCallback)((e, t = {}) => {
134331
+ }), [ke, tt]), it = (0, A.useCallback)((e, t = {}) => {
134332
134332
  typeof window > "u" || window.parent === window || window.parent.postMessage({
134333
134333
  type: e,
134334
134334
  serverId: a,
@@ -134336,7 +134336,7 @@ function jZe({ connection: e, isConnected: t, useClientSide: n = !0, enableKeybo
134336
134336
  }, "*");
134337
134337
  }, [a]);
134338
134338
  (0, A.useEffect)(() => {
134339
- tt("mcp-inspector:chat:ready", { capabilities: {
134339
+ it("mcp-inspector:chat:ready", { capabilities: {
134340
134340
  send: !0,
134341
134341
  clear: !0,
134342
134342
  getState: !0,
@@ -134344,20 +134344,20 @@ function jZe({ connection: e, isConnected: t, useClientSide: n = !0, enableKeybo
134344
134344
  setFollowups: !0,
134345
134345
  loadMessages: !0
134346
134346
  } });
134347
- }, [tt]), (0, A.useEffect)(() => {
134348
- tt("mcp-inspector:chat:state_changed", {
134349
- isLoading: ke,
134350
- messageCount: Oe.length,
134351
- messages: et(),
134347
+ }, [it]), (0, A.useEffect)(() => {
134348
+ it("mcp-inspector:chat:state_changed", {
134349
+ isLoading: Ae,
134350
+ messageCount: ke.length,
134351
+ messages: rt(),
134352
134352
  quickQuestions: I,
134353
134353
  followups: ee
134354
134354
  });
134355
134355
  }, [
134356
134356
  ee,
134357
- et,
134358
- ke,
134359
- Oe.length,
134360
- tt,
134357
+ rt,
134358
+ Ae,
134359
+ ke.length,
134360
+ it,
134361
134361
  I
134362
134362
  ]), (0, A.useEffect)(() => {
134363
134363
  let e = (e) => {
@@ -134365,7 +134365,7 @@ function jZe({ connection: e, isConnected: t, useClientSide: n = !0, enableKeybo
134365
134365
  let n = e.data;
134366
134366
  if (!n.type?.startsWith("mcp-inspector:chat:") || n.serverId && n.serverId !== a) return;
134367
134367
  let r = n.requestId, i = (e, t = {}) => {
134368
- tt("mcp-inspector:chat:command_result", {
134368
+ it("mcp-inspector:chat:command_result", {
134369
134369
  requestId: r,
134370
134370
  ok: e,
134371
134371
  ...t
@@ -134377,12 +134377,12 @@ function jZe({ connection: e, isConnected: t, useClientSide: n = !0, enableKeybo
134377
134377
  i(!1, { error: "Missing message" });
134378
134378
  return;
134379
134379
  }
134380
- if (!xe || !t) {
134380
+ if (!Se || !t) {
134381
134381
  i(!1, { error: "Chat is not ready to send messages" });
134382
134382
  return;
134383
134383
  }
134384
- je(e, []).then(() => {
134385
- tt("mcp-inspector:chat:message_sent", {
134384
+ Me(e, []).then(() => {
134385
+ it("mcp-inspector:chat:message_sent", {
134386
134386
  requestId: r,
134387
134387
  message: e,
134388
134388
  source: "bridge"
@@ -134393,27 +134393,27 @@ function jZe({ connection: e, isConnected: t, useClientSide: n = !0, enableKeybo
134393
134393
  return;
134394
134394
  }
134395
134395
  if (n.type === "mcp-inspector:chat:clear") {
134396
- Me(), tt("mcp-inspector:chat:cleared", { requestId: r }), i(!0);
134396
+ Ne(), it("mcp-inspector:chat:cleared", { requestId: r }), i(!0);
134397
134397
  return;
134398
134398
  }
134399
134399
  if (n.type === "mcp-inspector:chat:get_state") {
134400
- tt("mcp-inspector:chat:state", {
134400
+ it("mcp-inspector:chat:state", {
134401
134401
  requestId: r,
134402
- isLoading: ke,
134403
- messageCount: Oe.length,
134404
- messages: et(),
134402
+ isLoading: Ae,
134403
+ messageCount: ke.length,
134404
+ messages: rt(),
134405
134405
  quickQuestions: I,
134406
134406
  followups: ee
134407
134407
  }), i(!0);
134408
134408
  return;
134409
134409
  }
134410
134410
  if (n.type === "mcp-inspector:chat:set_quick_questions") {
134411
- let e = Ze(n.questions);
134411
+ let e = et(n.questions);
134412
134412
  L(e), i(!0, { quickQuestions: e });
134413
134413
  return;
134414
134414
  }
134415
134415
  if (n.type === "mcp-inspector:chat:set_followups") {
134416
- let e = Ze(n.followups);
134416
+ let e = et(n.followups);
134417
134417
  te(e), i(!0, { followups: e });
134418
134418
  return;
134419
134419
  }
@@ -134423,7 +134423,7 @@ function jZe({ connection: e, isConnected: t, useClientSide: n = !0, enableKeybo
134423
134423
  i(!1, { error: "messages must be an array" });
134424
134424
  return;
134425
134425
  }
134426
- Ne(e), i(!0, { count: e.length });
134426
+ Pe(e), i(!0, { count: e.length });
134427
134427
  return;
134428
134428
  }
134429
134429
  if (n.type === "mcp-inspector:chat:screenshot") {
@@ -134469,7 +134469,7 @@ function jZe({ connection: e, isConnected: t, useClientSide: n = !0, enableKeybo
134469
134469
  } catch (e) {
134470
134470
  s = e instanceof Error ? e.message : String(e);
134471
134471
  }
134472
- if (a) tt("mcp-inspector:chat:screenshot_result", {
134472
+ if (a) it("mcp-inspector:chat:screenshot_result", {
134473
134473
  requestId: r,
134474
134474
  toolCallId: e || null,
134475
134475
  image: a,
@@ -134477,7 +134477,7 @@ function jZe({ connection: e, isConnected: t, useClientSide: n = !0, enableKeybo
134477
134477
  }), i(!0);
134478
134478
  else {
134479
134479
  let t = R.current || document.body, n = t.innerText?.substring(0, 5e3) || "", a = t.innerHTML?.substring(0, 1e4) || "";
134480
- tt("mcp-inspector:chat:screenshot_result", {
134480
+ it("mcp-inspector:chat:screenshot_result", {
134481
134481
  requestId: r,
134482
134482
  toolCallId: e || null,
134483
134483
  image: "",
@@ -134489,7 +134489,7 @@ function jZe({ connection: e, isConnected: t, useClientSide: n = !0, enableKeybo
134489
134489
  }
134490
134490
  } catch (t) {
134491
134491
  let n = (R.current || document.body).innerText?.substring(0, 5e3) || "";
134492
- tt("mcp-inspector:chat:screenshot_result", {
134492
+ it("mcp-inspector:chat:screenshot_result", {
134493
134493
  requestId: r,
134494
134494
  toolCallId: e || null,
134495
134495
  image: "",
@@ -134504,46 +134504,46 @@ function jZe({ connection: e, isConnected: t, useClientSide: n = !0, enableKeybo
134504
134504
  };
134505
134505
  return window.addEventListener("message", e), () => window.removeEventListener("message", e);
134506
134506
  }, [
134507
- Me,
134508
134507
  Ne,
134508
+ Pe,
134509
134509
  ee,
134510
- et,
134511
- ke,
134512
- Oe.length,
134513
- tt,
134510
+ rt,
134511
+ Ae,
134512
+ ke.length,
134513
+ it,
134514
134514
  I,
134515
- Ze,
134516
- je,
134515
+ et,
134516
+ Me,
134517
134517
  a,
134518
- xe,
134518
+ Se,
134519
134519
  t
134520
- ]), a0(r ? { onNewChat: Me } : {});
134521
- let nt = (0, A.useCallback)(() => {
134520
+ ]), a0(r ? { onNewChat: Ne } : {});
134521
+ let at = (0, A.useCallback)(() => {
134522
134522
  F(-1), N(!1), z.current = null;
134523
- }, []), rt = (0, A.useCallback)(() => {
134523
+ }, []), ot = (0, A.useCallback)(() => {
134524
134524
  if (!ie.current) return;
134525
134525
  let e = ie.current.selectionStart, t = k.slice(0, e), n = kZe.test(t);
134526
134526
  N(n), n ? (z.current = {
134527
134527
  start: e - 1,
134528
134528
  end: e
134529
- }, F(0)) : nt();
134530
- }, [k, nt]);
134529
+ }, F(0)) : at();
134530
+ }, [k, at]);
134531
134531
  (0, A.useEffect)(() => {
134532
- xe && Oe.length === 0 && ie.current && ie.current.focus();
134533
- }, [xe, Oe.length]), (0, A.useEffect)(() => {
134534
- !ke && Oe.length > 0 && ie.current && ie.current.focus();
134535
- }, [ke, Oe.length]), (0, A.useEffect)(() => {
134536
- ie.current && rt();
134537
- }, [k, rt]);
134538
- let it = (0, A.useCallback)(() => {
134539
- We(null), Ke({}), nt();
134540
- }, [nt]), at = (0, A.useCallback)(async (e) => {
134541
- if (We(e), e.arguments && e.arguments.length > 0) {
134542
- We(null), EB.error("Prompts with arguments are not supported", { description: "This prompt requires arguments which are not yet supported in chat mode." });
134532
+ Se && ke.length === 0 && ie.current && ie.current.focus();
134533
+ }, [Se, ke.length]), (0, A.useEffect)(() => {
134534
+ !Ae && ke.length > 0 && ie.current && ie.current.focus();
134535
+ }, [Ae, ke.length]), (0, A.useEffect)(() => {
134536
+ ie.current && ot();
134537
+ }, [k, ot]);
134538
+ let st = (0, A.useCallback)(() => {
134539
+ qe(null), Ye({}), at();
134540
+ }, [at]), ct = (0, A.useCallback)(async (e) => {
134541
+ if (qe(e), e.arguments && e.arguments.length > 0) {
134542
+ qe(null), EB.error("Prompts with arguments are not supported", { description: "This prompt requires arguments which are not yet supported in chat mode." });
134543
134543
  return;
134544
134544
  }
134545
134545
  try {
134546
- await qe(e, {});
134546
+ await Xe(e, {});
134547
134547
  } catch (e) {
134548
134548
  console.error("Error executing prompt", e);
134549
134549
  } finally {
@@ -134553,65 +134553,65 @@ function jZe({ connection: e, isConnected: t, useClientSide: n = !0, enableKeybo
134553
134553
  ie.current?.focus(), ie.current?.setSelectionRange(e, e);
134554
134554
  });
134555
134555
  }
134556
- it();
134556
+ st();
134557
134557
  }
134558
134558
  }, [
134559
- qe,
134560
- it,
134559
+ Xe,
134560
+ st,
134561
134561
  k
134562
- ]), ot = (0, A.useCallback)(() => {
134563
- (k.trim() || Je.length > 0 || Ae.length > 0) && (je(k, Je), j(""), Xe());
134562
+ ]), lt = (0, A.useCallback)(() => {
134563
+ (k.trim() || Ze.length > 0 || je.length > 0) && (Me(k, Ze), j(""), $e());
134564
134564
  }, [
134565
134565
  k,
134566
- Je,
134567
- je,
134568
- Xe,
134569
- Ae
134570
- ]), st = (0, A.useCallback)((e) => {
134571
- if (e.key === "ArrowDown") F((e) => Ue.length === 0 ? -1 : (e + 1) % Ue.length);
134572
- else if (e.key === "ArrowUp") F((e) => Ue.length === 0 ? -1 : (e - 1 + Ue.length) % Ue.length);
134573
- else if (e.key === "Escape") e.stopPropagation(), nt();
134566
+ Ze,
134567
+ Me,
134568
+ $e,
134569
+ je
134570
+ ]), ut = (0, A.useCallback)((e) => {
134571
+ if (e.key === "ArrowDown") F((e) => Ke.length === 0 ? -1 : (e + 1) % Ke.length);
134572
+ else if (e.key === "ArrowUp") F((e) => Ke.length === 0 ? -1 : (e - 1 + Ke.length) % Ke.length);
134573
+ else if (e.key === "Escape") e.stopPropagation(), at();
134574
134574
  else if (e.key === "Enter" && P >= 0) {
134575
- let e = Ue[P];
134576
- e && at(e);
134575
+ let e = Ke[P];
134576
+ e && ct(e);
134577
134577
  }
134578
134578
  }, [
134579
- Ue,
134579
+ Ke,
134580
134580
  P,
134581
- at,
134582
- nt
134583
- ]), ct = (0, A.useCallback)((e) => {
134584
- AZe.includes(e.key) && M ? (e.preventDefault(), st(e)) : e.key === "Enter" && !e.shiftKey && (e.preventDefault(), ot());
134581
+ ct,
134582
+ at
134583
+ ]), dt = (0, A.useCallback)((e) => {
134584
+ AZe.includes(e.key) && M ? (e.preventDefault(), ut(e)) : e.key === "Enter" && !e.shiftKey && (e.preventDefault(), lt());
134585
134585
  }, [
134586
- ot,
134587
- st,
134586
+ lt,
134587
+ ut,
134588
134588
  M
134589
- ]), lt = (0, A.useCallback)((e) => {
134590
- (e.key === "ArrowLeft" || e.key === "ArrowRight") && rt();
134591
- }, [rt]), ut = (0, A.useCallback)((e) => {
134589
+ ]), ft = (0, A.useCallback)((e) => {
134590
+ (e.key === "ArrowLeft" || e.key === "ArrowRight") && ot();
134591
+ }, [ot]), pt = (0, A.useCallback)((e) => {
134592
134592
  let t = `# Chat Export - ${(/* @__PURE__ */ new Date()).toLocaleString()}\n\n`;
134593
134593
  return t += e.map((e) => {
134594
134594
  let t = e.role.charAt(0).toUpperCase() + e.role.slice(1);
134595
134595
  if (!e.parts || e.parts.length === 0) {
134596
- let n = Qe(e).trim();
134596
+ let n = tt(e).trim();
134597
134597
  return n ? `## ${t}\n${n}` : "";
134598
134598
  }
134599
134599
  let n = [];
134600
134600
  for (let t of e.parts) if (t.type === "text" && t.text?.trim()) n.push(t.text.trim());
134601
134601
  else if (t.type === "tool-invocation" && t.toolInvocation) {
134602
- let e = t.toolInvocation, r = $e(e.result);
134602
+ let e = t.toolInvocation, r = nt(e.result);
134603
134603
  n.push(`#### ${e.toolName}\n**Arguments:**\n\`\`\`json\n${JSON.stringify(e.args, null, 2)}\n\`\`\`\n**Result:**\n\n${r}`);
134604
134604
  }
134605
134605
  return n.length === 0 ? "" : `## ${t}\n\n${n.join("\n\n")}`;
134606
134606
  }).filter((e) => e !== "").join("\n\n---\n\n"), t;
134607
- }, [Qe, $e]), dt = (0, A.useCallback)(() => {
134608
- yz(ut(Oe)).then(() => EB.success("Chat copied to clipboard"), () => EB.error("Failed to copy chat"));
134609
- }, [Oe, ut]), ft = (0, A.useCallback)((e) => {
134607
+ }, [tt, nt]), mt = (0, A.useCallback)(() => {
134608
+ yz(pt(ke)).then(() => EB.success("Chat copied to clipboard"), () => EB.error("Failed to copy chat"));
134609
+ }, [ke, pt]), ht = (0, A.useCallback)((e) => {
134610
134610
  let t = `chat-export-${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}`;
134611
- if (e === "json") Uye(Oe.map((e) => ({
134611
+ if (e === "json") Uye(ke.map((e) => ({
134612
134612
  id: e.id,
134613
134613
  role: e.role,
134614
- content: Qe(e),
134614
+ content: tt(e),
134615
134615
  timestamp: e.timestamp,
134616
134616
  toolInvocations: e.parts?.filter((e) => e.type === "tool-invocation" && e.toolInvocation).map((e) => ({
134617
134617
  toolName: e.toolInvocation.toolName,
@@ -134620,48 +134620,48 @@ function jZe({ connection: e, isConnected: t, useClientSide: n = !0, enableKeybo
134620
134620
  }))
134621
134621
  })), t + ".json");
134622
134622
  else {
134623
- let e = ut(Oe), n = new Blob([e], { type: "text/markdown" }), r = URL.createObjectURL(n), i = document.createElement("a");
134623
+ let e = pt(ke), n = new Blob([e], { type: "text/markdown" }), r = URL.createObjectURL(n), i = document.createElement("a");
134624
134624
  i.href = r, i.download = t + ".md", document.body.appendChild(i), i.click(), document.body.removeChild(i), setTimeout(() => URL.revokeObjectURL(r), 100);
134625
134625
  }
134626
134626
  EB.success(`Chat exported as ${e.toUpperCase()}`);
134627
134627
  }, [
134628
- Oe,
134629
- ut,
134630
- Qe
134631
- ]), pt = (0, A.useCallback)(() => {
134632
- _e(), Me();
134633
- }, [_e, Me]), mt = (0, A.useCallback)((e) => {
134634
- e.trim() && (!xe || !t || je(e, []).then(() => {
134635
- tt("mcp-inspector:chat:message_sent", {
134628
+ ke,
134629
+ pt,
134630
+ tt
134631
+ ]), gt = (0, A.useCallback)(() => {
134632
+ _e(), Ne();
134633
+ }, [_e, Ne]), _t = (0, A.useCallback)((e) => {
134634
+ e.trim() && (!Se || !t || Me(e, []).then(() => {
134635
+ it("mcp-inspector:chat:message_sent", {
134636
134636
  message: e,
134637
134637
  source: "quick_question"
134638
134638
  });
134639
134639
  }));
134640
134640
  }, [
134641
- tt,
134642
- je,
134643
- xe,
134641
+ it,
134642
+ Me,
134643
+ Se,
134644
134644
  t
134645
- ]), ht = (0, A.useCallback)((e) => {
134646
- e.trim() && (!xe || !t || je(e, []).then(() => {
134647
- tt("mcp-inspector:chat:message_sent", {
134645
+ ]), vt = (0, A.useCallback)((e) => {
134646
+ e.trim() && (!Se || !t || Me(e, []).then(() => {
134647
+ it("mcp-inspector:chat:message_sent", {
134648
134648
  message: e,
134649
134649
  source: "followup"
134650
134650
  });
134651
134651
  }));
134652
134652
  }, [
134653
- tt,
134654
- je,
134655
- xe,
134653
+ it,
134654
+ Me,
134655
+ Se,
134656
134656
  t
134657
- ]), gt = (Le || Be) && c ? /* @__PURE__ */ (0, O.jsx)(OZe, {
134657
+ ]), yt = (Re || Ve) && c ? /* @__PURE__ */ (0, O.jsx)(OZe, {
134658
134658
  authOrigin: new URL(c).origin,
134659
134659
  onDismiss: () => {
134660
- Re?.(), Ve(!1);
134660
+ ze?.(), He(!1);
134661
134661
  },
134662
- onUseApiKey: ze
134662
+ onUseApiKey: Be
134663
134663
  }) : null;
134664
- return xe && Oe.length === 0 ? /* @__PURE__ */ (0, O.jsxs)("div", {
134664
+ return Se && ke.length === 0 ? /* @__PURE__ */ (0, O.jsxs)("div", {
134665
134665
  className: "flex flex-col h-full",
134666
134666
  children: [
134667
134667
  /* @__PURE__ */ (0, O.jsx)("div", {
@@ -134676,57 +134676,57 @@ function jZe({ connection: e, isConnected: t, useClientSide: n = !0, enableKeybo
134676
134676
  onModelChange: he,
134677
134677
  onApiKeyChange: pe,
134678
134678
  onSave: ge,
134679
- onClear: pt,
134680
- showClearButton: !Se,
134679
+ onClear: gt,
134680
+ showClearButton: !Ce,
134681
134681
  buttonLabel: "Change API Key",
134682
- freeTierInfo: B
134682
+ freeTierInfo: Ue
134683
134683
  })
134684
134684
  }),
134685
134685
  /* @__PURE__ */ (0, O.jsx)(xLe, {
134686
134686
  mcpServerUrl: e.url,
134687
134687
  inputValue: k,
134688
134688
  isConnected: t,
134689
- isLoading: ke,
134689
+ isLoading: Ae,
134690
134690
  textareaRef: ie,
134691
- llmConfig: xe,
134691
+ llmConfig: Se,
134692
134692
  promptsDropdownOpen: M,
134693
134693
  promptFocusedIndex: P,
134694
- prompts: Ue,
134695
- selectedPrompt: Ge,
134696
- promptResults: Je,
134697
- attachments: Ae,
134694
+ prompts: Ke,
134695
+ selectedPrompt: Je,
134696
+ promptResults: Ze,
134697
+ attachments: je,
134698
134698
  tools: x ? void 0 : ae,
134699
134699
  disabledTools: x ? void 0 : ne,
134700
134700
  onDisabledToolsChange: x ? void 0 : re,
134701
- onDeletePromptResult: Ye,
134702
- onPromptSelect: at,
134701
+ onDeletePromptResult: Qe,
134702
+ onPromptSelect: ct,
134703
134703
  onInputChange: j,
134704
- onKeyDown: ct,
134705
- onKeyUp: lt,
134706
- onClick: rt,
134704
+ onKeyDown: dt,
134705
+ onKeyUp: ft,
134706
+ onClick: ot,
134707
134707
  onSubmit: (e) => {
134708
- e.preventDefault(), ot();
134708
+ e.preventDefault(), lt();
134709
134709
  },
134710
134710
  onConfigDialogOpenChange: le,
134711
- onAttachmentAdd: Fe,
134712
- onAttachmentRemove: Ie,
134713
- hideModelBadge: h && !be,
134711
+ onAttachmentAdd: Ie,
134712
+ onAttachmentRemove: Le,
134713
+ hideModelBadge: Ge,
134714
134714
  hideServerUrl: g,
134715
134715
  quickQuestions: I,
134716
- onQuickQuestionSelect: mt,
134717
- freeTierInfo: B
134716
+ onQuickQuestionSelect: _t,
134717
+ freeTierInfo: Ue
134718
134718
  }),
134719
- gt
134719
+ yt
134720
134720
  ]
134721
134721
  }) : /* @__PURE__ */ (0, O.jsxs)("div", {
134722
134722
  className: "flex flex-col h-full relative",
134723
134723
  children: [
134724
134724
  /* @__PURE__ */ (0, O.jsx)(KIe, {
134725
- llmConfig: xe,
134726
- hasMessages: Oe.length > 0,
134725
+ llmConfig: Se,
134726
+ hasMessages: ke.length > 0,
134727
134727
  configDialogOpen: ce,
134728
134728
  onConfigDialogOpenChange: le,
134729
- onClearChat: Me,
134729
+ onClearChat: Ne,
134730
134730
  tempProvider: ue,
134731
134731
  tempModel: me,
134732
134732
  tempApiKey: fe,
@@ -134734,11 +134734,11 @@ function jZe({ connection: e, isConnected: t, useClientSide: n = !0, enableKeybo
134734
134734
  onModelChange: he,
134735
134735
  onApiKeyChange: pe,
134736
134736
  onSaveConfig: ge,
134737
- onClearConfig: pt,
134738
- hideConfigButton: Se && !B,
134739
- freeTierInfo: B,
134740
- onCopyChat: dt,
134741
- onExportChat: ft,
134737
+ onClearConfig: gt,
134738
+ hideConfigButton: Ce && !Ue || We,
134739
+ freeTierInfo: Ue,
134740
+ onCopyChat: mt,
134741
+ onExportChat: ht,
134742
134742
  clearButtonLabel: p,
134743
134743
  hideTitle: m,
134744
134744
  clearButtonHideIcon: _,
@@ -134749,46 +134749,46 @@ function jZe({ connection: e, isConnected: t, useClientSide: n = !0, enableKeybo
134749
134749
  /* @__PURE__ */ (0, O.jsx)("div", {
134750
134750
  ref: R,
134751
134751
  className: "flex-1 overflow-y-auto p-2 sm:p-4 pt-[80px] sm:pt-[100px]",
134752
- children: xe ? /* @__PURE__ */ (0, O.jsx)(gZe, {
134753
- messages: Oe,
134754
- isLoading: ke,
134752
+ children: Se ? /* @__PURE__ */ (0, O.jsx)(gZe, {
134753
+ messages: ke,
134754
+ isLoading: Ae,
134755
134755
  serverId: e.url,
134756
134756
  readResource: s,
134757
134757
  tools: e.tools,
134758
- sendMessage: (e, t) => je(e, [], t),
134758
+ sendMessage: (e, t) => Me(e, [], t),
134759
134759
  serverBaseUrl: e.url,
134760
134760
  pendingElicitationRequests: e.pendingElicitationRequests,
134761
134761
  onApproveElicitation: e.approveElicitation,
134762
134762
  onRejectElicitation: e.rejectElicitation
134763
134763
  }) : /* @__PURE__ */ (0, O.jsx)(SLe, { onConfigureClick: () => le(!0) })
134764
134764
  }),
134765
- gt,
134766
- xe && /* @__PURE__ */ (0, O.jsx)(yLe, {
134765
+ yt,
134766
+ Se && /* @__PURE__ */ (0, O.jsx)(yLe, {
134767
134767
  inputValue: k,
134768
- isConnected: t && !Le,
134769
- isLoading: ke,
134768
+ isConnected: t && !Re,
134769
+ isLoading: Ae,
134770
134770
  textareaRef: ie,
134771
134771
  promptsDropdownOpen: M,
134772
134772
  promptFocusedIndex: P,
134773
- prompts: Ue,
134774
- promptResults: Je,
134775
- selectedPrompt: Ge,
134776
- attachments: Ae,
134773
+ prompts: Ke,
134774
+ promptResults: Ze,
134775
+ selectedPrompt: Je,
134776
+ attachments: je,
134777
134777
  tools: x ? void 0 : ae,
134778
134778
  disabledTools: x ? void 0 : ne,
134779
134779
  onDisabledToolsChange: x ? void 0 : re,
134780
- onDeletePromptResult: Ye,
134781
- onPromptSelect: at,
134780
+ onDeletePromptResult: Qe,
134781
+ onPromptSelect: ct,
134782
134782
  onInputChange: j,
134783
- onKeyDown: ct,
134784
- onKeyUp: lt,
134785
- onClick: rt,
134786
- onSendMessage: ot,
134787
- onStopStreaming: Pe,
134788
- onAttachmentAdd: Fe,
134789
- onAttachmentRemove: Ie,
134783
+ onKeyDown: dt,
134784
+ onKeyUp: ft,
134785
+ onClick: ot,
134786
+ onSendMessage: lt,
134787
+ onStopStreaming: Fe,
134788
+ onAttachmentAdd: Ie,
134789
+ onAttachmentRemove: Le,
134790
134790
  followups: ee,
134791
- onFollowupSelect: ht
134791
+ onFollowupSelect: vt
134792
134792
  })
134793
134793
  ]
134794
134794
  });
@@ -1 +1 @@
1
- {"version":3,"file":"ChatTab.d.ts","sourceRoot":"","sources":["../../../src/client/components/ChatTab.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,MAAM,EACP,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AA4B/C,KAAK,aAAa,GAAG;KAClB,CAAC,IAAI,MAAM,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC;CACrC,CAAC;AAGF,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,aAAa,CAAC;IAC1B,WAAW,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;kFAC8E;IAC9E,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IAC7C,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EA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