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