agent-swarm-kit 1.1.75 → 1.1.77

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