@mcp-use/client 2.0.0-beta.5 → 2.0.0-beta.6

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.
@@ -128,7 +128,7 @@ var Logger = class {
128
128
  var logger = Logger.get();
129
129
 
130
130
  // src/utils/version.ts
131
- var VERSION = "2.0.0-beta.4";
131
+ var VERSION = "2.0.0-beta.5";
132
132
  function getPackageVersion() {
133
133
  return VERSION;
134
134
  }
package/dist/index.js CHANGED
@@ -1108,7 +1108,7 @@ init_connector_telemetry();
1108
1108
  init_logging();
1109
1109
 
1110
1110
  // src/utils/version.ts
1111
- var VERSION = "2.0.0-beta.4";
1111
+ var VERSION = "2.0.0-beta.5";
1112
1112
  function getPackageVersion() {
1113
1113
  return VERSION;
1114
1114
  }
@@ -1473,7 +1473,7 @@ var HttpConnector = class extends BaseConnector {
1473
1473
  };
1474
1474
 
1475
1475
  // src/utils/version.ts
1476
- var VERSION = "2.0.0-beta.4";
1476
+ var VERSION = "2.0.0-beta.5";
1477
1477
  function getPackageVersion() {
1478
1478
  return VERSION;
1479
1479
  }
@@ -7355,6 +7355,9 @@ function ViewRendererBase({
7355
7355
  const iframeRef = useRef4(null);
7356
7356
  const bridgeRef = useRef4(null);
7357
7357
  const containerRef = useRef4(null);
7358
+ const pendingBlobRevocationsRef = useRef4(
7359
+ /* @__PURE__ */ new Map()
7360
+ );
7358
7361
  const connectionRef = useRef4(
7359
7362
  source.kind === "live" ? source.connection : null
7360
7363
  );
@@ -7510,10 +7513,18 @@ function ViewRendererBase({
7510
7513
  }, [source.kind, liveResourceUri, preloadedHtml, cspMode, resolveSandboxUrl]);
7511
7514
  useEffect5(() => {
7512
7515
  const url = activeSandboxUrl;
7516
+ if (!url || url.protocol !== "blob:") return;
7517
+ const pending = pendingBlobRevocationsRef.current.get(url.href);
7518
+ if (pending) {
7519
+ clearTimeout(pending);
7520
+ pendingBlobRevocationsRef.current.delete(url.href);
7521
+ }
7513
7522
  return () => {
7514
- if (url?.protocol === "blob:") {
7523
+ const timer = setTimeout(() => {
7515
7524
  URL.revokeObjectURL(url.href);
7516
- }
7525
+ pendingBlobRevocationsRef.current.delete(url.href);
7526
+ }, 1e3);
7527
+ pendingBlobRevocationsRef.current.set(url.href, timer);
7517
7528
  };
7518
7529
  }, [activeSandboxUrl]);
7519
7530
  const isBlobSandbox = activeSandboxUrl?.protocol === "blob:";
@@ -7574,7 +7585,14 @@ function ViewRendererBase({
7574
7585
  iframe.setAttribute("allow", allowAttribute);
7575
7586
  }
7576
7587
  const readyPromise = waitForSandboxProxyReady(iframe);
7577
- iframe.src = activeSandboxUrl.href;
7588
+ if (activeSandboxUrl.protocol === "blob:") {
7589
+ const response = await fetch(activeSandboxUrl.href);
7590
+ const sandboxHtml = await response.text();
7591
+ if (disposed) return;
7592
+ iframe.srcdoc = sandboxHtml;
7593
+ } else {
7594
+ iframe.src = activeSandboxUrl.href;
7595
+ }
7578
7596
  await readyPromise;
7579
7597
  if (disposed) return;
7580
7598
  const capabilities = {