@tutti-os/agent-gui 0.0.184 → 0.0.186

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.
@@ -3729,11 +3729,15 @@ function userPromptContentBlocks(message, fallbackWorkspaceId) {
3729
3729
  (candidate) => typeof candidate.payload?.displayPrompt === "string" ? candidate.payload.displayPrompt : ""
3730
3730
  ) ?? []
3731
3731
  );
3732
+ const visibleDisplayPrompt = isSyntheticImageOnlyDisplayPrompt(
3733
+ displayPrompt,
3734
+ content
3735
+ ) ? "" : displayPrompt;
3732
3736
  const blocks = content.flatMap((raw) => {
3733
3737
  const block = raw && typeof raw === "object" && !Array.isArray(raw) ? raw : null;
3734
3738
  if (!block) return [];
3735
3739
  if (block.type === "text" && typeof block.text === "string") {
3736
- return displayPrompt ? [] : [{ type: "text", text: linkifyPastedTextReferences(block.text) }];
3740
+ return visibleDisplayPrompt ? [] : [{ type: "text", text: linkifyPastedTextReferences(block.text) }];
3737
3741
  }
3738
3742
  if (block.type !== "image") return [];
3739
3743
  const mimeType = typeof block.mimeType === "string" ? block.mimeType.trim() : "";
@@ -3752,7 +3756,24 @@ function userPromptContentBlocks(message, fallbackWorkspaceId) {
3752
3756
  }
3753
3757
  ];
3754
3758
  });
3755
- return displayPrompt ? [{ type: "text", text: displayPrompt }, ...blocks] : blocks;
3759
+ return visibleDisplayPrompt ? [{ type: "text", text: visibleDisplayPrompt }, ...blocks] : blocks;
3760
+ }
3761
+ function isSyntheticImageOnlyDisplayPrompt(displayPrompt, content) {
3762
+ if (displayPrompt !== "[Image]" && displayPrompt !== "[Images]") {
3763
+ return false;
3764
+ }
3765
+ let imageCount = 0;
3766
+ for (const raw of content) {
3767
+ const block = raw && typeof raw === "object" && !Array.isArray(raw) ? raw : null;
3768
+ if (!block) continue;
3769
+ if (block.type === "text" && typeof block.text === "string" && block.text.trim()) {
3770
+ return false;
3771
+ }
3772
+ if (block.type === "image") {
3773
+ imageCount += 1;
3774
+ }
3775
+ }
3776
+ return displayPrompt === "[Image]" ? imageCount === 1 : imageCount > 1;
3756
3777
  }
3757
3778
  function optionalString(value) {
3758
3779
  return typeof value === "string" && value.trim() ? value.trim() : null;
@@ -14917,4 +14938,4 @@ export {
14917
14938
  AgentConversationFlow,
14918
14939
  useProjectedAgentConversation
14919
14940
  };
14920
- //# sourceMappingURL=chunk-GAXQI5K6.js.map
14941
+ //# sourceMappingURL=chunk-62JB3KCN.js.map