@mcp-use/inspector 9.0.0-canary.1 → 9.0.1-canary.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26903,7 +26903,7 @@ var Ud = class {
26903
26903
  //#region src/client/telemetry/utils.ts
26904
26904
  function of() {
26905
26905
  try {
26906
- return "9.0.0-canary.1";
26906
+ return "9.0.1-canary.0";
26907
26907
  } catch {
26908
26908
  return "0.0.0";
26909
26909
  }
@@ -48436,9 +48436,9 @@ var IA, LA, RA, zA, BA, VA, HA, UA, WA, GA, KA, qA, JA, YA, rle, ile, XA, ZA, QA
48436
48436
  }(), zue);
48437
48437
  }));
48438
48438
  //#endregion
48439
- //#region ../mcp-use/dist/chunk-PU57CKXY.js
48439
+ //#region ../mcp-use/dist/chunk-4P7KGCIT.js
48440
48440
  Yp();
48441
- var Wue = "1.31.0-canary.1";
48441
+ var Wue = "1.31.1-canary.0";
48442
48442
  function VF() {
48443
48443
  return Wue;
48444
48444
  }
@@ -56464,36 +56464,36 @@ function AL(e) {
56464
56464
  }
56465
56465
  }
56466
56466
  W(AL, "hasStoredTokens");
56467
- function Gpe({ popup: e, state: t, tokensKey: n, timeoutMs: r = 5 * 6e4, closePollMs: i = 1e3, expectedOrigin: a = typeof window < "u" ? window.location.origin : "" }) {
56468
- return new Promise((o) => {
56469
- let s = !1, c = null, l = null, u = null, d = null, f = /* @__PURE__ */ W(() => {
56470
- if (c &&= (clearInterval(c), null), l &&= (clearTimeout(l), null), u &&= (clearTimeout(u), null), typeof window < "u" && (window.removeEventListener("message", h), window.removeEventListener("storage", _)), d) {
56467
+ function Gpe({ popup: e, state: t, tokensKey: n, timeoutMs: r = 5 * 6e4, closePollMs: i = 1e3, closeGraceMs: a = 2e4, expectedOrigin: o = typeof window < "u" ? window.location.origin : "" }) {
56468
+ return new Promise((s) => {
56469
+ let c = !1, l = null, u = null, d = null, f = null, p = /* @__PURE__ */ W(() => {
56470
+ if (l &&= (clearInterval(l), null), u &&= (clearTimeout(u), null), d &&= (clearTimeout(d), null), typeof window < "u" && (window.removeEventListener("message", g), window.removeEventListener("storage", v)), f) {
56471
56471
  try {
56472
- d.removeEventListener("message", g), d.close();
56472
+ f.removeEventListener("message", _), f.close();
56473
56473
  } catch {}
56474
- d = null;
56474
+ f = null;
56475
56475
  }
56476
- }, "cleanup"), p = /* @__PURE__ */ W((e) => {
56477
- s || (s = !0, f(), o(e));
56478
- }, "settle"), m = /* @__PURE__ */ W((e) => {
56479
- !e || e.type !== "mcp_auth_callback" || e.state && t && e.state !== t || (e.success ? p({ kind: "success" }) : p({
56476
+ }, "cleanup"), m = /* @__PURE__ */ W((e) => {
56477
+ c || (c = !0, p(), s(e));
56478
+ }, "settle"), h = /* @__PURE__ */ W((e) => {
56479
+ !e || e.type !== "mcp_auth_callback" || e.state && t && e.state !== t || (e.success ? m({ kind: "success" }) : m({
56480
56480
  kind: "error",
56481
56481
  error: e.error ?? "Authentication failed in callback."
56482
56482
  }));
56483
- }, "handlePayload"), h = /* @__PURE__ */ W((e) => {
56484
- a && e.origin !== a || m(e.data);
56485
- }, "messageHandler"), g = /* @__PURE__ */ W((e) => {
56486
- m(e.data);
56487
- }, "broadcastHandler"), _ = /* @__PURE__ */ W((e) => {
56488
- e.key === n && e.newValue && p({ kind: "success" });
56483
+ }, "handlePayload"), g = /* @__PURE__ */ W((e) => {
56484
+ o && e.origin !== o || h(e.data);
56485
+ }, "messageHandler"), _ = /* @__PURE__ */ W((e) => {
56486
+ h(e.data);
56487
+ }, "broadcastHandler"), v = /* @__PURE__ */ W((e) => {
56488
+ e.key === n && e.newValue && m({ kind: "success" });
56489
56489
  }, "storageHandler");
56490
- if (typeof window < "u" && (window.addEventListener("message", h), window.addEventListener("storage", _)), typeof BroadcastChannel < "u") try {
56491
- d = new BroadcastChannel(kL), d.addEventListener("message", g);
56490
+ if (typeof window < "u" && (window.addEventListener("message", g), window.addEventListener("storage", v)), typeof BroadcastChannel < "u") try {
56491
+ f = new BroadcastChannel(kL), f.addEventListener("message", _);
56492
56492
  } catch {
56493
- d = null;
56493
+ f = null;
56494
56494
  }
56495
- e && (c = setInterval(() => {
56496
- if (s) return;
56495
+ e && (l = setInterval(() => {
56496
+ if (c) return;
56497
56497
  let t = !1;
56498
56498
  try {
56499
56499
  t = e.closed;
@@ -56501,16 +56501,16 @@ function Gpe({ popup: e, state: t, tokensKey: n, timeoutMs: r = 5 * 6e4, closePo
56501
56501
  t = !1;
56502
56502
  }
56503
56503
  if (t) {
56504
- if (c &&= (clearInterval(c), null), AL(n)) {
56505
- p({ kind: "success" });
56504
+ if (l &&= (clearInterval(l), null), AL(n)) {
56505
+ m({ kind: "success" });
56506
56506
  return;
56507
56507
  }
56508
- u = setTimeout(() => {
56509
- p(AL(n) ? { kind: "success" } : { kind: "cancelled" });
56510
- }, 400);
56508
+ d = setTimeout(() => {
56509
+ m(AL(n) ? { kind: "success" } : { kind: "cancelled" });
56510
+ }, a);
56511
56511
  }
56512
- }, i)), l = setTimeout(() => {
56513
- p(AL(n) ? { kind: "success" } : { kind: "timeout" });
56512
+ }, i)), u = setTimeout(() => {
56513
+ m(AL(n) ? { kind: "success" } : { kind: "timeout" });
56514
56514
  }, r);
56515
56515
  });
56516
56516
  }
@@ -56548,19 +56548,23 @@ function PL(e, t, n) {
56548
56548
  }
56549
56549
  }
56550
56550
  W(PL, "broadcastAuthCallback");
56551
- function FL(e, t, n = "success") {
56551
+ function FL(e, t, n = "success", r) {
56552
56552
  if (!(typeof document > "u")) try {
56553
56553
  document.body.innerHTML = "";
56554
- let r = document.createElement("div");
56555
- r.style.fontFamily = "sans-serif", r.style.padding = "20px";
56556
- let i = document.createElement("h1");
56557
- i.textContent = e, r.appendChild(i);
56558
- let a = document.createElement("p");
56559
- n === "error" && (a.style.color = "red", a.style.backgroundColor = "#ffebeb", a.style.border = "1px solid red", a.style.padding = "10px", a.style.borderRadius = "4px"), a.textContent = t, r.appendChild(a);
56554
+ let i = document.createElement("div");
56555
+ i.style.fontFamily = "sans-serif", i.style.padding = "20px";
56556
+ let a = document.createElement("h1");
56557
+ a.textContent = e, i.appendChild(a);
56560
56558
  let o = document.createElement("p");
56561
- o.textContent = "You can close this window or ";
56562
- let s = document.createElement("a");
56563
- s.href = "#", s.textContent = "click here to close", s.onclick = (e) => (e.preventDefault(), window.close(), !1), o.appendChild(s), o.appendChild(document.createTextNode(".")), r.appendChild(o), document.body.appendChild(r);
56559
+ n === "error" && (o.style.color = "red", o.style.backgroundColor = "#ffebeb", o.style.border = "1px solid red", o.style.padding = "10px", o.style.borderRadius = "4px"), o.textContent = t, i.appendChild(o);
56560
+ let s = document.createElement("p");
56561
+ s.textContent = "You can close this window or ";
56562
+ let c = document.createElement("a");
56563
+ if (c.href = "#", c.textContent = "click here to close", c.onclick = (e) => (e.preventDefault(), window.close(), !1), s.appendChild(c), s.appendChild(document.createTextNode(".")), i.appendChild(s), r) {
56564
+ let e = document.createElement("p"), t = document.createElement("a");
56565
+ t.href = r, t.textContent = "Return to the app", e.appendChild(t), i.appendChild(e);
56566
+ }
56567
+ document.body.appendChild(i);
56564
56568
  } catch {}
56565
56569
  }
56566
56570
  W(FL, "renderCloseWindowMessage");
@@ -56610,7 +56614,7 @@ async function qpe() {
56610
56614
  };
56611
56615
  if (r) {
56612
56616
  console.log(`${a} OAuth error received: ${r} - ${i || "No description"}`);
56613
- let e = s.flowType === "redirect", t = window.opener && !window.opener.closed, n = ML(), o = /* @__PURE__ */ W((e) => {
56617
+ let e = s.flowType === "redirect", t = window.opener && !window.opener.closed, n = ML() || s.flowType === "popup", o = /* @__PURE__ */ W((e) => {
56614
56618
  console.log(`${a} Returning to: ${e}`), localStorage.removeItem(c);
56615
56619
  let t = new URL(e);
56616
56620
  t.searchParams.set("auth_error", r), i && t.searchParams.set("auth_error_description", i), window.location.href = t.toString();
@@ -56624,7 +56628,7 @@ async function qpe() {
56624
56628
  return;
56625
56629
  }
56626
56630
  if (n) {
56627
- PL(!1, `${r}${i ? `: ${i}` : ""}`, u), localStorage.removeItem(c), FL("Authentication Error", `${r}${i ? `: ${i}` : ""}`, "error");
56631
+ PL(!1, `${r}${i ? `: ${i}` : ""}`, u), localStorage.removeItem(c), FL("Authentication Error", `${r}${i ? `: ${i}` : ""}`, "error", s.returnUrl);
56628
56632
  try {
56629
56633
  window.close();
56630
56634
  } catch {}
@@ -56661,11 +56665,11 @@ async function qpe() {
56661
56665
  });
56662
56666
  if (x === "AUTHORIZED") {
56663
56667
  console.log(`${a} Authorization successful via SDK auth().`);
56664
- let e = s.flowType === "redirect", t = ML();
56668
+ let e = s.flowType === "redirect", t = ML() || s.flowType === "popup";
56665
56669
  if (e && s.returnUrl) console.log(`${a} Redirect flow complete. Returning to: ${s.returnUrl}`), localStorage.removeItem(c), window.location.href = s.returnUrl;
56666
56670
  else if (window.opener && !window.opener.closed) console.log(`${a} Popup flow complete. Notifying opener...`), window.opener.postMessage(NL(!0, void 0, u), window.location.origin), localStorage.removeItem(c), window.close();
56667
56671
  else if (t) {
56668
- console.log(`${a} Popup flow complete but opener was lost; broadcasting success and rendering close-window message.`), PL(!0, void 0, u), localStorage.removeItem(c), FL("Authentication Successful!", "You're authenticated. You can close this window and return to the app.");
56672
+ console.log(`${a} Popup flow complete but opener was lost; broadcasting success and rendering close-window message.`), PL(!0, void 0, u), localStorage.removeItem(c), FL("Authentication Successful!", "You're authenticated. You can close this window and return to the app.", "success", s.returnUrl);
56669
56673
  try {
56670
56674
  window.close();
56671
56675
  } catch {}
@@ -56682,7 +56686,7 @@ async function qpe() {
56682
56686
  state: n,
56683
56687
  serverUrlHash: s?.serverUrlHash
56684
56688
  };
56685
- window.opener && !window.opener.closed ? window.opener.postMessage(NL(!1, t, r), window.location.origin) : ML() && PL(!1, t, r);
56689
+ window.opener && !window.opener.closed ? window.opener.postMessage(NL(!1, t, r), window.location.origin) : (ML() || s?.flowType === "popup") && PL(!1, t, r);
56686
56690
  try {
56687
56691
  document.body.innerHTML = "";
56688
56692
  let n = document.createElement("div");
@@ -146133,7 +146137,7 @@ var X2e = class e {
146133
146137
  }
146134
146138
  };
146135
146139
  //#endregion
146136
- //#region ../mcp-use/dist/chunk-JZM3YBMR.js
146140
+ //#region ../mcp-use/dist/chunk-GGLNYKLW.js
146137
146141
  Yp();
146138
146142
  var Z2e = class {
146139
146143
  static {
@@ -146355,36 +146359,36 @@ function q9(e) {
146355
146359
  }
146356
146360
  }
146357
146361
  W(q9, "hasStoredTokens");
146358
- function n4e({ popup: e, state: t, tokensKey: n, timeoutMs: r = 5 * 6e4, closePollMs: i = 1e3, expectedOrigin: a = typeof window < "u" ? window.location.origin : "" }) {
146359
- return new Promise((o) => {
146360
- let s = !1, c = null, l = null, u = null, d = null, f = /* @__PURE__ */ W(() => {
146361
- if (c &&= (clearInterval(c), null), l &&= (clearTimeout(l), null), u &&= (clearTimeout(u), null), typeof window < "u" && (window.removeEventListener("message", h), window.removeEventListener("storage", _)), d) {
146362
+ function n4e({ popup: e, state: t, tokensKey: n, timeoutMs: r = 5 * 6e4, closePollMs: i = 1e3, closeGraceMs: a = 2e4, expectedOrigin: o = typeof window < "u" ? window.location.origin : "" }) {
146363
+ return new Promise((s) => {
146364
+ let c = !1, l = null, u = null, d = null, f = null, p = /* @__PURE__ */ W(() => {
146365
+ if (l &&= (clearInterval(l), null), u &&= (clearTimeout(u), null), d &&= (clearTimeout(d), null), typeof window < "u" && (window.removeEventListener("message", g), window.removeEventListener("storage", v)), f) {
146362
146366
  try {
146363
- d.removeEventListener("message", g), d.close();
146367
+ f.removeEventListener("message", _), f.close();
146364
146368
  } catch {}
146365
- d = null;
146369
+ f = null;
146366
146370
  }
146367
- }, "cleanup"), p = /* @__PURE__ */ W((e) => {
146368
- s || (s = !0, f(), o(e));
146369
- }, "settle"), m = /* @__PURE__ */ W((e) => {
146370
- !e || e.type !== "mcp_auth_callback" || e.state && t && e.state !== t || (e.success ? p({ kind: "success" }) : p({
146371
+ }, "cleanup"), m = /* @__PURE__ */ W((e) => {
146372
+ c || (c = !0, p(), s(e));
146373
+ }, "settle"), h = /* @__PURE__ */ W((e) => {
146374
+ !e || e.type !== "mcp_auth_callback" || e.state && t && e.state !== t || (e.success ? m({ kind: "success" }) : m({
146371
146375
  kind: "error",
146372
146376
  error: e.error ?? "Authentication failed in callback."
146373
146377
  }));
146374
- }, "handlePayload"), h = /* @__PURE__ */ W((e) => {
146375
- a && e.origin !== a || m(e.data);
146376
- }, "messageHandler"), g = /* @__PURE__ */ W((e) => {
146377
- m(e.data);
146378
- }, "broadcastHandler"), _ = /* @__PURE__ */ W((e) => {
146379
- e.key === n && e.newValue && p({ kind: "success" });
146378
+ }, "handlePayload"), g = /* @__PURE__ */ W((e) => {
146379
+ o && e.origin !== o || h(e.data);
146380
+ }, "messageHandler"), _ = /* @__PURE__ */ W((e) => {
146381
+ h(e.data);
146382
+ }, "broadcastHandler"), v = /* @__PURE__ */ W((e) => {
146383
+ e.key === n && e.newValue && m({ kind: "success" });
146380
146384
  }, "storageHandler");
146381
- if (typeof window < "u" && (window.addEventListener("message", h), window.addEventListener("storage", _)), typeof BroadcastChannel < "u") try {
146382
- d = new BroadcastChannel(e4e), d.addEventListener("message", g);
146385
+ if (typeof window < "u" && (window.addEventListener("message", g), window.addEventListener("storage", v)), typeof BroadcastChannel < "u") try {
146386
+ f = new BroadcastChannel(e4e), f.addEventListener("message", _);
146383
146387
  } catch {
146384
- d = null;
146388
+ f = null;
146385
146389
  }
146386
- e && (c = setInterval(() => {
146387
- if (s) return;
146390
+ e && (l = setInterval(() => {
146391
+ if (c) return;
146388
146392
  let t = !1;
146389
146393
  try {
146390
146394
  t = e.closed;
@@ -146392,16 +146396,16 @@ function n4e({ popup: e, state: t, tokensKey: n, timeoutMs: r = 5 * 6e4, closePo
146392
146396
  t = !1;
146393
146397
  }
146394
146398
  if (t) {
146395
- if (c &&= (clearInterval(c), null), q9(n)) {
146396
- p({ kind: "success" });
146399
+ if (l &&= (clearInterval(l), null), q9(n)) {
146400
+ m({ kind: "success" });
146397
146401
  return;
146398
146402
  }
146399
- u = setTimeout(() => {
146400
- p(q9(n) ? { kind: "success" } : { kind: "cancelled" });
146401
- }, 400);
146403
+ d = setTimeout(() => {
146404
+ m(q9(n) ? { kind: "success" } : { kind: "cancelled" });
146405
+ }, a);
146402
146406
  }
146403
- }, i)), l = setTimeout(() => {
146404
- p(q9(n) ? { kind: "success" } : { kind: "timeout" });
146407
+ }, i)), u = setTimeout(() => {
146408
+ m(q9(n) ? { kind: "success" } : { kind: "timeout" });
146405
146409
  }, r);
146406
146410
  });
146407
146411
  }
@@ -146439,19 +146443,23 @@ function Z9(e, t, n) {
146439
146443
  }
146440
146444
  }
146441
146445
  W(Z9, "broadcastAuthCallback");
146442
- function Q9(e, t, n = "success") {
146446
+ function Q9(e, t, n = "success", r) {
146443
146447
  if (!(typeof document > "u")) try {
146444
146448
  document.body.innerHTML = "";
146445
- let r = document.createElement("div");
146446
- r.style.fontFamily = "sans-serif", r.style.padding = "20px";
146447
- let i = document.createElement("h1");
146448
- i.textContent = e, r.appendChild(i);
146449
- let a = document.createElement("p");
146450
- n === "error" && (a.style.color = "red", a.style.backgroundColor = "#ffebeb", a.style.border = "1px solid red", a.style.padding = "10px", a.style.borderRadius = "4px"), a.textContent = t, r.appendChild(a);
146449
+ let i = document.createElement("div");
146450
+ i.style.fontFamily = "sans-serif", i.style.padding = "20px";
146451
+ let a = document.createElement("h1");
146452
+ a.textContent = e, i.appendChild(a);
146451
146453
  let o = document.createElement("p");
146452
- o.textContent = "You can close this window or ";
146453
- let s = document.createElement("a");
146454
- s.href = "#", s.textContent = "click here to close", s.onclick = (e) => (e.preventDefault(), window.close(), !1), o.appendChild(s), o.appendChild(document.createTextNode(".")), r.appendChild(o), document.body.appendChild(r);
146454
+ n === "error" && (o.style.color = "red", o.style.backgroundColor = "#ffebeb", o.style.border = "1px solid red", o.style.padding = "10px", o.style.borderRadius = "4px"), o.textContent = t, i.appendChild(o);
146455
+ let s = document.createElement("p");
146456
+ s.textContent = "You can close this window or ";
146457
+ let c = document.createElement("a");
146458
+ if (c.href = "#", c.textContent = "click here to close", c.onclick = (e) => (e.preventDefault(), window.close(), !1), s.appendChild(c), s.appendChild(document.createTextNode(".")), i.appendChild(s), r) {
146459
+ let e = document.createElement("p"), t = document.createElement("a");
146460
+ t.href = r, t.textContent = "Return to the app", e.appendChild(t), i.appendChild(e);
146461
+ }
146462
+ document.body.appendChild(i);
146455
146463
  } catch {}
146456
146464
  }
146457
146465
  W(Q9, "renderCloseWindowMessage");
@@ -146501,7 +146509,7 @@ async function i4e() {
146501
146509
  };
146502
146510
  if (r) {
146503
146511
  console.log(`${a} OAuth error received: ${r} - ${i || "No description"}`);
146504
- let e = s.flowType === "redirect", t = window.opener && !window.opener.closed, n = Y9(), o = /* @__PURE__ */ W((e) => {
146512
+ let e = s.flowType === "redirect", t = window.opener && !window.opener.closed, n = Y9() || s.flowType === "popup", o = /* @__PURE__ */ W((e) => {
146505
146513
  console.log(`${a} Returning to: ${e}`), localStorage.removeItem(c);
146506
146514
  let t = new URL(e);
146507
146515
  t.searchParams.set("auth_error", r), i && t.searchParams.set("auth_error_description", i), window.location.href = t.toString();
@@ -146515,7 +146523,7 @@ async function i4e() {
146515
146523
  return;
146516
146524
  }
146517
146525
  if (n) {
146518
- Z9(!1, `${r}${i ? `: ${i}` : ""}`, u), localStorage.removeItem(c), Q9("Authentication Error", `${r}${i ? `: ${i}` : ""}`, "error");
146526
+ Z9(!1, `${r}${i ? `: ${i}` : ""}`, u), localStorage.removeItem(c), Q9("Authentication Error", `${r}${i ? `: ${i}` : ""}`, "error", s.returnUrl);
146519
146527
  try {
146520
146528
  window.close();
146521
146529
  } catch {}
@@ -146552,11 +146560,11 @@ async function i4e() {
146552
146560
  });
146553
146561
  if (x === "AUTHORIZED") {
146554
146562
  console.log(`${a} Authorization successful via SDK auth().`);
146555
- let e = s.flowType === "redirect", t = Y9();
146563
+ let e = s.flowType === "redirect", t = Y9() || s.flowType === "popup";
146556
146564
  if (e && s.returnUrl) console.log(`${a} Redirect flow complete. Returning to: ${s.returnUrl}`), localStorage.removeItem(c), window.location.href = s.returnUrl;
146557
146565
  else if (window.opener && !window.opener.closed) console.log(`${a} Popup flow complete. Notifying opener...`), window.opener.postMessage(X9(!0, void 0, u), window.location.origin), localStorage.removeItem(c), window.close();
146558
146566
  else if (t) {
146559
- console.log(`${a} Popup flow complete but opener was lost; broadcasting success and rendering close-window message.`), Z9(!0, void 0, u), localStorage.removeItem(c), Q9("Authentication Successful!", "You're authenticated. You can close this window and return to the app.");
146567
+ console.log(`${a} Popup flow complete but opener was lost; broadcasting success and rendering close-window message.`), Z9(!0, void 0, u), localStorage.removeItem(c), Q9("Authentication Successful!", "You're authenticated. You can close this window and return to the app.", "success", s.returnUrl);
146560
146568
  try {
146561
146569
  window.close();
146562
146570
  } catch {}
@@ -146573,7 +146581,7 @@ async function i4e() {
146573
146581
  state: n,
146574
146582
  serverUrlHash: s?.serverUrlHash
146575
146583
  };
146576
- window.opener && !window.opener.closed ? window.opener.postMessage(X9(!1, t, r), window.location.origin) : Y9() && Z9(!1, t, r);
146584
+ window.opener && !window.opener.closed ? window.opener.postMessage(X9(!1, t, r), window.location.origin) : (Y9() || s?.flowType === "popup") && Z9(!1, t, r);
146577
146585
  try {
146578
146586
  document.body.innerHTML = "";
146579
146587
  let n = document.createElement("div");