@agentiffai/design 1.3.14 → 1.3.16

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.
@@ -832,7 +832,7 @@ function AssistantThinking({
832
832
  AssistantThinking.displayName = "AssistantThinking";
833
833
  function parseMarkdown(text) {
834
834
  if (!text) return [];
835
- text = text.replace(/<!--TOOL_CALL:[^>]*-->/g, "").replace(/__TOOL_CALL__:[^:]+:\{[^}]*(?:\{[^}]*\}[^}]*)*\}/g, "");
835
+ text = text.replace(/<!--TOOL_CALL:[^:]+:[\s\S]+?-->/g, "").replace(/__TOOL_CALL__:[^:]+:\{[^}]*(?:\{[^}]*\}[^}]*)*\}/g, "").replace(/<!--TOOL_CALL:[\s\S]*$/g, "").replace(/__TOOL_CALL__:[\s\S]*$/g, "");
836
836
  const elements = [];
837
837
  let key = 0;
838
838
  const paragraphs = text.split(/\n\n+/);
@@ -1310,9 +1310,13 @@ var AssistantMessageBase = ({
1310
1310
  };
1311
1311
  var AssistantMessage = react.memo(AssistantMessageBase);
1312
1312
  AssistantMessage.displayName = "AssistantMessage";
1313
- var TOOL_CALL_MARKER_REGEX = /<!--TOOL_CALL:([^:]+):(.+?)-->/g;
1314
1313
  function stripToolCallMarkers(content) {
1315
- return content.replace(TOOL_CALL_MARKER_REGEX, "").trim();
1314
+ let stripped = content;
1315
+ stripped = stripped.replace(/<!--TOOL_CALL:[^:]+:[\s\S]+?-->/g, "");
1316
+ stripped = stripped.replace(/__TOOL_CALL__:[^:]+:\{[^}]*(?:\{[^}]*\}[^}]*)*\}/g, "");
1317
+ stripped = stripped.replace(/<!--TOOL_CALL:[\s\S]*$/g, "");
1318
+ stripped = stripped.replace(/__TOOL_CALL__:[\s\S]*$/g, "");
1319
+ return stripped.trim();
1316
1320
  }
1317
1321
  var ERROR_PATTERNS = [
1318
1322
  /\bfailed\b/i,