@blade-hq/agent-kit 1.0.30 → 1.0.32

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.
Files changed (42) hide show
  1. package/dist/{chunk-7OEW3P7R.js → chunk-E7FQV4IX.js} +56 -35
  2. package/dist/chunk-E7FQV4IX.js.map +1 -0
  3. package/dist/{chunk-6G5LCDOS.js → chunk-EGGBOVVF.js} +2 -2
  4. package/dist/{chunk-L4C2TY6S.js → chunk-F4Y7SUBC.js} +2 -2
  5. package/dist/{chunk-GAVSC2AW.js → chunk-FK4CV6R2.js} +46 -2
  6. package/dist/chunk-FK4CV6R2.js.map +1 -0
  7. package/dist/{chunk-WOKDHXS7.js → chunk-IDVNG3YJ.js} +37 -12
  8. package/dist/chunk-IDVNG3YJ.js.map +1 -0
  9. package/dist/{chunk-3XDPNPE3.js → chunk-IGMLETZX.js} +1001 -713
  10. package/dist/chunk-IGMLETZX.js.map +1 -0
  11. package/dist/{chunk-MJPVAXJN.js → chunk-OICNN4K4.js} +2 -2
  12. package/dist/client/index.js +1 -1
  13. package/dist/client/types/rest.d.ts +65 -136
  14. package/dist/react/api/published-apps.js +3 -3
  15. package/dist/react/api/sessions.js +2 -2
  16. package/dist/react/components/chat/FileDeliveryCards.d.ts +11 -0
  17. package/dist/react/components/chat/MessageList.d.ts +1 -0
  18. package/dist/react/components/chat/PlanningToggle.d.ts +7 -0
  19. package/dist/react/components/chat/ResourceIframe.d.ts +1 -1
  20. package/dist/react/components/chat/UserMessageBubble.d.ts +1 -1
  21. package/dist/react/components/chat/index.d.ts +1 -0
  22. package/dist/react/components/chat/index.js +7 -5
  23. package/dist/react/components/plan/index.js +4 -4
  24. package/dist/react/components/session/index.js +3 -3
  25. package/dist/react/components/workspace/index.js +61 -42
  26. package/dist/react/components/workspace/index.js.map +1 -1
  27. package/dist/react/hooks/use-model-preferences.d.ts +2 -0
  28. package/dist/react/index.d.ts +1 -1
  29. package/dist/react/index.js +9 -7
  30. package/dist/react/index.js.map +1 -1
  31. package/dist/react/lib/ui-meta.d.ts +1 -0
  32. package/dist/react/stores/ui-store.d.ts +5 -0
  33. package/dist/react/types/solution.d.ts +1 -0
  34. package/dist/style.css +1 -1
  35. package/package.json +1 -1
  36. package/dist/chunk-3XDPNPE3.js.map +0 -1
  37. package/dist/chunk-7OEW3P7R.js.map +0 -1
  38. package/dist/chunk-GAVSC2AW.js.map +0 -1
  39. package/dist/chunk-WOKDHXS7.js.map +0 -1
  40. /package/dist/{chunk-6G5LCDOS.js.map → chunk-EGGBOVVF.js.map} +0 -0
  41. /package/dist/{chunk-L4C2TY6S.js.map → chunk-F4Y7SUBC.js.map} +0 -0
  42. /package/dist/{chunk-MJPVAXJN.js.map → chunk-OICNN4K4.js.map} +0 -0
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  BladeClient,
6
6
  ClientProjectionBuilder
7
- } from "./chunk-GAVSC2AW.js";
7
+ } from "./chunk-FK4CV6R2.js";
8
8
  import {
9
9
  createClientActions,
10
10
  useCardStateStore
@@ -593,6 +593,18 @@ function buildToolPreviewKey(content, type2, toolCallId) {
593
593
  }
594
594
 
595
595
  // src/react/lib/ui-meta.ts
596
+ var LOOPBACK_HOSTS = /* @__PURE__ */ new Set(["localhost", "127.0.0.1", "[::1]"]);
597
+ function resolveBrowserResourceUri(value, browserHostname = typeof window === "undefined" ? "" : window.location.hostname) {
598
+ if (!browserHostname) return value;
599
+ try {
600
+ const url = new URL(value);
601
+ if (!LOOPBACK_HOSTS.has(url.hostname)) return value;
602
+ url.hostname = browserHostname;
603
+ return url.toString();
604
+ } catch {
605
+ return value;
606
+ }
607
+ }
596
608
  function isNonEmptyString(value) {
597
609
  return typeof value === "string" && value.trim().length > 0;
598
610
  }
@@ -881,14 +893,22 @@ function upsertArtifactState(state, target, options) {
881
893
  const reveal = options?.reveal ?? true;
882
894
  const activate = options?.activate ?? true;
883
895
  const targetKey = target.key ?? target.title;
884
- const applyUiState = (partial) => ({
885
- ...partial,
886
- ...reveal ? {
887
- rightPanelCollapsed: false,
888
- activeRightTab: "preview",
889
- rightTabActivationId: state.rightTabActivationId + 1
890
- } : {}
891
- });
896
+ const clearsUnread = Boolean(activate && targetKey && state.previewUnreadArtifactKeys.includes(targetKey));
897
+ const applyUiState = (partial) => {
898
+ const nextUnread = clearsUnread ? state.previewUnreadArtifactKeys.filter((key) => key !== targetKey) : state.previewUnreadArtifactKeys;
899
+ return {
900
+ ...partial,
901
+ ...clearsUnread ? {
902
+ previewUnreadArtifactKeys: nextUnread,
903
+ rightPanelUnreadTabs: nextUnread.length === 0 ? state.rightPanelUnreadTabs.filter((tab) => tab !== "files") : state.rightPanelUnreadTabs
904
+ } : {},
905
+ ...reveal ? {
906
+ rightPanelCollapsed: false,
907
+ activeRightTab: "preview",
908
+ rightTabActivationId: state.rightTabActivationId + 1
909
+ } : {}
910
+ };
911
+ };
892
912
  const existing = state.artifacts.findIndex((artifact) => targetKey && (artifact.key ?? artifact.title) === targetKey);
893
913
  if (existing >= 0) {
894
914
  const updated = [...state.artifacts];
@@ -917,7 +937,9 @@ var useUiStore = create2()((set) => ({
917
937
  artifacts: [],
918
938
  activeArtifactIndex: -1,
919
939
  previewUnreadArtifactKeys: [],
940
+ filePreviewMode: "preview",
920
941
  theme: storedTheme,
942
+ setFilePreviewMode: (mode) => set({ filePreviewMode: mode }),
921
943
  setLeftPanelSize: (size) => set({ leftPanelSize: size }),
922
944
  setRightPanelSize: (size) => set({ rightPanelSize: size }),
923
945
  setLeftPanelCollapsed: (collapsed) => set({ leftPanelCollapsed: collapsed }),
@@ -2668,7 +2690,7 @@ var AgentSocket = class {
2668
2690
  revision: Date.now()
2669
2691
  };
2670
2692
  const uiStore = useUiStore.getState();
2671
- if (uiStore.rightPanelAutoJump) {
2693
+ if (uiStore.rightPanelAutoJump && !uiStore.rightPanelCollapsed) {
2672
2694
  uiStore.clearRightPanelTabUnread("files");
2673
2695
  uiStore.clearPreviewArtifactUnread(data.file_path);
2674
2696
  uiStore.setActiveRightTab("preview");
@@ -2737,7 +2759,7 @@ var AgentSocket = class {
2737
2759
  key: data.file_path
2738
2760
  };
2739
2761
  const uiStore = useUiStore.getState();
2740
- if (uiStore.rightPanelAutoJump) {
2762
+ if (uiStore.rightPanelAutoJump && !uiStore.rightPanelCollapsed) {
2741
2763
  uiStore.clearRightPanelTabUnread("files");
2742
2764
  uiStore.clearPreviewArtifactUnread(data.file_path);
2743
2765
  uiStore.setActiveRightTab("preview");
@@ -2903,6 +2925,7 @@ var AgentSocket = class {
2903
2925
  if (uiStore.rightPanelAutoJump) {
2904
2926
  uiStore.clearRightPanelTabUnread("browser");
2905
2927
  uiStore.setActiveRightTab("browser");
2928
+ if (uiStore.rightPanelCollapsed) uiStore.setRightPanelCollapsed(false);
2906
2929
  } else {
2907
2930
  uiStore.markRightPanelTabUnread("browser");
2908
2931
  }
@@ -3476,6 +3499,7 @@ export {
3476
3499
  dispatchBladeBridge,
3477
3500
  postToParent,
3478
3501
  attachHostBridgeListener,
3502
+ normalizeMessageContent,
3479
3503
  getTextContent,
3480
3504
  isHiddenInternalMessage,
3481
3505
  buildMessageContent,
@@ -3488,6 +3512,7 @@ export {
3488
3512
  setAnalyticsClient,
3489
3513
  trackEvent,
3490
3514
  buildToolPreviewKey,
3515
+ resolveBrowserResourceUri,
3491
3516
  isUiMeta,
3492
3517
  auth_exports,
3493
3518
  agentSocket,
@@ -3559,4 +3584,4 @@ export {
3559
3584
  bootstrapBladeClient,
3560
3585
  getBootstrappedClient
3561
3586
  };
3562
- //# sourceMappingURL=chunk-WOKDHXS7.js.map
3587
+ //# sourceMappingURL=chunk-IDVNG3YJ.js.map