agent-swarm-kit 1.1.75 → 1.1.76

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.
package/build/index.cjs CHANGED
@@ -13053,20 +13053,28 @@ class SwarmMetaService {
13053
13053
  }
13054
13054
 
13055
13055
  const sanitizeMarkdown = (input) => {
13056
- return input
13057
- // Remove Markdown headers, emphasis, bold, etc.
13058
- .replace(/[_*~`>#-]/g, '')
13059
- // Remove links and images
13060
- .replace(/\[.*?\]\(.*?\)/g, '')
13061
- // Remove inline code blocks
13062
- .replace(/`{1,3}[^`]*`{1,3}/g, '')
13063
- // Remove horizontal rules
13064
- .replace(/-{3,}/g, '')
13065
- // Remove blockquotes
13066
- .replace(/^>+/gm, '')
13067
- // Remove HTML tags (often used in Markdown)
13068
- .replace(/<\/?[^>]+(>|$)/g, '')
13069
- .trim();
13056
+ if (typeof input !== "string") {
13057
+ return input;
13058
+ }
13059
+ return (input
13060
+ // Remove Markdown italic (_text_) and bold (**text** or __text__)
13061
+ .replace(/(?:__|\*\*)(.*?)(?:__|\*\*)/g, "$1")
13062
+ .replace(/(?:_|\*)(.*?)(?:_|\*)/g, "$1")
13063
+ // Remove inline code blocks (`code` or ```code```)
13064
+ .replace(/`{1,3}(.*?)`{1,3}/g, "$1")
13065
+ // Remove links ([text](url))
13066
+ .replace(/\[([^\]]*)\]\([^\)]*\)/g, "$1")
13067
+ // Remove images (![text](url))
13068
+ .replace(/!\[([^\]]*)\]\([^\)]*\)/g, "$1")
13069
+ // Remove headers (# Header)
13070
+ .replace(/^(#+)\s*(.*)/gm, "$2")
13071
+ // Remove blockquotes (> text)
13072
+ .replace(/^>+\s*(.*)/gm, "$1")
13073
+ // Remove horizontal rules (---, ***, ___)
13074
+ .replace(/^-{3,}$|^[*]{3,}$|^_{3,}$/gm, "")
13075
+ // Remove HTML tags
13076
+ .replace(/<\/?[^>]+(>|$)/g, "")
13077
+ .trim());
13070
13078
  };
13071
13079
 
13072
13080
  /**
package/build/index.mjs CHANGED
@@ -13051,20 +13051,28 @@ class SwarmMetaService {
13051
13051
  }
13052
13052
 
13053
13053
  const sanitizeMarkdown = (input) => {
13054
- return input
13055
- // Remove Markdown headers, emphasis, bold, etc.
13056
- .replace(/[_*~`>#-]/g, '')
13057
- // Remove links and images
13058
- .replace(/\[.*?\]\(.*?\)/g, '')
13059
- // Remove inline code blocks
13060
- .replace(/`{1,3}[^`]*`{1,3}/g, '')
13061
- // Remove horizontal rules
13062
- .replace(/-{3,}/g, '')
13063
- // Remove blockquotes
13064
- .replace(/^>+/gm, '')
13065
- // Remove HTML tags (often used in Markdown)
13066
- .replace(/<\/?[^>]+(>|$)/g, '')
13067
- .trim();
13054
+ if (typeof input !== "string") {
13055
+ return input;
13056
+ }
13057
+ return (input
13058
+ // Remove Markdown italic (_text_) and bold (**text** or __text__)
13059
+ .replace(/(?:__|\*\*)(.*?)(?:__|\*\*)/g, "$1")
13060
+ .replace(/(?:_|\*)(.*?)(?:_|\*)/g, "$1")
13061
+ // Remove inline code blocks (`code` or ```code```)
13062
+ .replace(/`{1,3}(.*?)`{1,3}/g, "$1")
13063
+ // Remove links ([text](url))
13064
+ .replace(/\[([^\]]*)\]\([^\)]*\)/g, "$1")
13065
+ // Remove images (![text](url))
13066
+ .replace(/!\[([^\]]*)\]\([^\)]*\)/g, "$1")
13067
+ // Remove headers (# Header)
13068
+ .replace(/^(#+)\s*(.*)/gm, "$2")
13069
+ // Remove blockquotes (> text)
13070
+ .replace(/^>+\s*(.*)/gm, "$1")
13071
+ // Remove horizontal rules (---, ***, ___)
13072
+ .replace(/^-{3,}$|^[*]{3,}$|^_{3,}$/gm, "")
13073
+ // Remove HTML tags
13074
+ .replace(/<\/?[^>]+(>|$)/g, "")
13075
+ .trim());
13068
13076
  };
13069
13077
 
13070
13078
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-swarm-kit",
3
- "version": "1.1.75",
3
+ "version": "1.1.76",
4
4
  "description": "A TypeScript library for building orchestrated framework-agnostic multi-agent AI systems",
5
5
  "author": {
6
6
  "name": "Petr Tripolsky",