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 +22 -14
- package/build/index.mjs +22 -14
- package/package.json +1 -1
package/build/index.cjs
CHANGED
|
@@ -13053,20 +13053,28 @@ class SwarmMetaService {
|
|
|
13053
13053
|
}
|
|
13054
13054
|
|
|
13055
13055
|
const sanitizeMarkdown = (input) => {
|
|
13056
|
-
|
|
13057
|
-
|
|
13058
|
-
|
|
13059
|
-
|
|
13060
|
-
|
|
13061
|
-
|
|
13062
|
-
.replace(
|
|
13063
|
-
// Remove
|
|
13064
|
-
.replace(
|
|
13065
|
-
// Remove
|
|
13066
|
-
.replace(
|
|
13067
|
-
// Remove
|
|
13068
|
-
.replace(
|
|
13069
|
-
|
|
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 ()
|
|
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
|
-
|
|
13055
|
-
|
|
13056
|
-
|
|
13057
|
-
|
|
13058
|
-
|
|
13059
|
-
|
|
13060
|
-
.replace(
|
|
13061
|
-
// Remove
|
|
13062
|
-
.replace(
|
|
13063
|
-
// Remove
|
|
13064
|
-
.replace(
|
|
13065
|
-
// Remove
|
|
13066
|
-
.replace(
|
|
13067
|
-
|
|
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 ()
|
|
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
|
/**
|