@blade-hq/agent-kit 0.5.34 → 1.0.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.
@@ -4691,13 +4691,14 @@ function ResourceIframe({ ui, sessionId }) {
4691
4691
  }
4692
4692
  const inlineHeight = autoHeight ?? ui.height;
4693
4693
  const sandbox = resourceUri ? "allow-scripts allow-same-origin" : "allow-scripts";
4694
+ const srcDoc = ui.resourceHTML ? injectBaseTag(ui.resourceHTML) : void 0;
4694
4695
  return /* @__PURE__ */ jsx13(
4695
4696
  "iframe",
4696
4697
  {
4697
4698
  ref: iframeRef,
4698
4699
  title: ui.title ?? "\u5DE5\u5177\u754C\u9762",
4699
4700
  src: resourceUri,
4700
- srcDoc: ui.resourceHTML,
4701
+ srcDoc,
4701
4702
  sandbox,
4702
4703
  loading: "lazy",
4703
4704
  scrolling: ui.target === "preview" ? void 0 : "no",
@@ -4710,6 +4711,20 @@ function ResourceIframe({ ui, sessionId }) {
4710
4711
  }
4711
4712
  );
4712
4713
  }
4714
+ function injectBaseTag(html) {
4715
+ const base = `<base href="${window.location.origin}/">`;
4716
+ const headIdx = html.toLowerCase().indexOf("<head");
4717
+ if (headIdx >= 0) {
4718
+ const closeIdx = html.indexOf(">", headIdx);
4719
+ if (closeIdx >= 0) {
4720
+ return `${html.slice(0, closeIdx + 1)}
4721
+ ${base}
4722
+ ${html.slice(closeIdx + 1)}`;
4723
+ }
4724
+ }
4725
+ return `${base}
4726
+ ${html}`;
4727
+ }
4713
4728
 
4714
4729
  // src/react/components/chat/ToolCallBlock.tsx
4715
4730
  import { Check as Check2, ChevronRight as ChevronRight3, Loader2 as Loader23, MessageSquareMore, PanelRightOpen, X as X4 } from "lucide-react";
@@ -8598,4 +8613,4 @@ use-stick-to-bottom/dist/StickToBottom.js:
8598
8613
  * Licensed under the MIT License. See License.txt in the project root for license information.
8599
8614
  *--------------------------------------------------------------------------------------------*)
8600
8615
  */
8601
- //# sourceMappingURL=chunk-7TS36PDU.js.map
8616
+ //# sourceMappingURL=chunk-OVOZQHYQ.js.map