@mcp-use/inspector 3.0.1-canary.4 → 3.0.1-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.
@@ -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.4";
26923
+ return "3.0.1-canary.5";
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-CZQVQ5BD.js
48460
+ //#region ../mcp-use/dist/chunk-AMFD73PD.js
48461
48461
  Zp();
48462
- var Hue = "1.25.1-canary.4";
48462
+ var Hue = "1.25.1-canary.5";
48463
48463
  function KF() {
48464
48464
  return Hue;
48465
48465
  }
@@ -56296,8 +56296,6 @@ async function epe() {
56296
56296
  });
56297
56297
  let o = null, s = null, c = null;
56298
56298
  try {
56299
- if (r) throw Error(`OAuth error: ${r} - ${i || "No description provided."}`);
56300
- if (!t) throw Error("Authorization code not found in callback query parameters.");
56301
56299
  if (!n) throw Error("State parameter not found or invalid in callback query parameters.");
56302
56300
  console.log(`[mcp-callback] Looking for state: ${n}`), console.log("[mcp-callback] All localStorage keys:", Object.keys(localStorage));
56303
56301
  let e = `mcp:auth:state_${n}`;
@@ -56324,6 +56322,28 @@ async function epe() {
56324
56322
  throw Error("Failed to parse stored OAuth state.");
56325
56323
  }
56326
56324
  if (!s.expiry || s.expiry < Date.now()) throw localStorage.removeItem(c), Error("OAuth state has expired. Please try initiating authentication again.");
56325
+ if (r) {
56326
+ console.log(`${a} OAuth error received: ${r} - ${i || "No description"}`);
56327
+ let e = s.flowType === "redirect", t = window.opener && !window.opener.closed, n = /* @__PURE__ */ W((e) => {
56328
+ console.log(`${a} Returning to: ${e}`), localStorage.removeItem(c);
56329
+ let t = new URL(e);
56330
+ t.searchParams.set("auth_error", r), i && t.searchParams.set("auth_error_description", i), window.location.href = t.toString();
56331
+ }, "redirectWithError");
56332
+ if (s.returnUrl && (e || !t)) {
56333
+ n(s.returnUrl);
56334
+ return;
56335
+ }
56336
+ if (t) {
56337
+ window.opener.postMessage({
56338
+ type: "mcp_auth_callback",
56339
+ success: !1,
56340
+ error: `${r}${i ? `: ${i}` : ""}`
56341
+ }, window.location.origin), localStorage.removeItem(c), window.close();
56342
+ return;
56343
+ }
56344
+ throw Error(`OAuth error: ${r}${i ? ` - ${i}` : ""}`);
56345
+ }
56346
+ if (!t) throw Error("Authorization code not found in callback query parameters.");
56327
56347
  if (!s.providerOptions) throw Error("Stored state is missing required provider options.");
56328
56348
  let { serverUrl: u, ...d } = s.providerOptions, f = d.connectionUrl, p = !!(f && /run\.mcp-use\.com|mcp-use\.run/.test(f)), m = p ? f : void 0, h = d.oauthProxyUrl, g = m;
56329
56349
  if (!h && g) try {
@@ -144779,7 +144799,7 @@ function O0e({ children: e }) {
144779
144799
  }) });
144780
144800
  }
144781
144801
  //#endregion
144782
- //#region ../mcp-use/dist/chunk-MABQH6G4.js
144802
+ //#region ../mcp-use/dist/chunk-O2TPTMPL.js
144783
144803
  Zp();
144784
144804
  function $9(e) {
144785
144805
  let t = /* @__PURE__ */ W(() => {
@@ -145084,8 +145104,6 @@ async function M0e() {
145084
145104
  });
145085
145105
  let o = null, s = null, c = null;
145086
145106
  try {
145087
- if (r) throw Error(`OAuth error: ${r} - ${i || "No description provided."}`);
145088
- if (!t) throw Error("Authorization code not found in callback query parameters.");
145089
145107
  if (!n) throw Error("State parameter not found or invalid in callback query parameters.");
145090
145108
  console.log(`[mcp-callback] Looking for state: ${n}`), console.log("[mcp-callback] All localStorage keys:", Object.keys(localStorage));
145091
145109
  let e = `mcp:auth:state_${n}`;
@@ -145112,6 +145130,28 @@ async function M0e() {
145112
145130
  throw Error("Failed to parse stored OAuth state.");
145113
145131
  }
145114
145132
  if (!s.expiry || s.expiry < Date.now()) throw localStorage.removeItem(c), Error("OAuth state has expired. Please try initiating authentication again.");
145133
+ if (r) {
145134
+ console.log(`${a} OAuth error received: ${r} - ${i || "No description"}`);
145135
+ let e = s.flowType === "redirect", t = window.opener && !window.opener.closed, n = /* @__PURE__ */ W((e) => {
145136
+ console.log(`${a} Returning to: ${e}`), localStorage.removeItem(c);
145137
+ let t = new URL(e);
145138
+ t.searchParams.set("auth_error", r), i && t.searchParams.set("auth_error_description", i), window.location.href = t.toString();
145139
+ }, "redirectWithError");
145140
+ if (s.returnUrl && (e || !t)) {
145141
+ n(s.returnUrl);
145142
+ return;
145143
+ }
145144
+ if (t) {
145145
+ window.opener.postMessage({
145146
+ type: "mcp_auth_callback",
145147
+ success: !1,
145148
+ error: `${r}${i ? `: ${i}` : ""}`
145149
+ }, window.location.origin), localStorage.removeItem(c), window.close();
145150
+ return;
145151
+ }
145152
+ throw Error(`OAuth error: ${r}${i ? ` - ${i}` : ""}`);
145153
+ }
145154
+ if (!t) throw Error("Authorization code not found in callback query parameters.");
145115
145155
  if (!s.providerOptions) throw Error("Stored state is missing required provider options.");
145116
145156
  let { serverUrl: u, ...d } = s.providerOptions, f = d.connectionUrl, p = !!(f && /run\.mcp-use\.com|mcp-use\.run/.test(f)), m = p ? f : void 0, h = d.oauthProxyUrl, g = m;
145117
145157
  if (!h && g) try {
@@ -145320,7 +145360,19 @@ function B0e({ activeTabRef: e }) {
145320
145360
  }
145321
145361
  function V0e() {
145322
145362
  let e = (0, A.useRef)("tools"), t = new URLSearchParams(window.location.search), n = t.get("embedded") === "true", r = t.get("theme"), i = (0, A.useMemo)(() => n ? void 0 : new ype("mcp-inspector-connections"), [n]), a = window.__MCP_PROXY_URL__, o = a ? `${window.location.origin}${a}` : void 0;
145323
- return /* @__PURE__ */ (0, O.jsx)(q_e, {
145363
+ return (0, A.useEffect)(() => {
145364
+ let e = t.get("auth_error");
145365
+ if (!e) return;
145366
+ let n = t.get("auth_error_description");
145367
+ EB.error(`OAuth authentication failed: ${n || e}`, {
145368
+ duration: Infinity,
145369
+ closeButton: !0
145370
+ });
145371
+ let r = new URLSearchParams(t);
145372
+ r.delete("auth_error"), r.delete("auth_error_description");
145373
+ let i = r.toString();
145374
+ window.history.replaceState({}, "", `${window.location.pathname}${i ? `?${i}` : ""}`);
145375
+ }, []), /* @__PURE__ */ (0, O.jsx)(q_e, {
145324
145376
  forcedTheme: r || void 0,
145325
145377
  children: /* @__PURE__ */ (0, O.jsx)(jze, { children: /* @__PURE__ */ (0, O.jsx)(_z, {
145326
145378
  storageProvider: i,