@threadbase-sh/scanner 0.25.1 → 0.25.2
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/dist/cli.js +10 -3
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +9 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -2
- package/dist/index.js.map +1 -1
- package/dist/parse-helpers.d.ts.map +1 -1
- package/dist/parse.cjs +9 -2
- package/dist/parse.cjs.map +1 -1
- package/dist/parse.js +9 -2
- package/dist/parse.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -679,16 +679,23 @@ function asQueuedPromptUserEntry(entry) {
|
|
|
679
679
|
message: { role: "user", content: att.prompt }
|
|
680
680
|
};
|
|
681
681
|
}
|
|
682
|
+
var COMMAND_RE = /^\s*<command-name>([\s\S]*?)<\/command-name>/;
|
|
683
|
+
var COMMAND_ARGS_RE = /<command-args>([\s\S]*?)<\/command-args>/;
|
|
684
|
+
function cleanText(text) {
|
|
685
|
+
const name = text.match(COMMAND_RE)?.[1]?.trim();
|
|
686
|
+
const args = name ? text.match(COMMAND_ARGS_RE)?.[1]?.trim() : void 0;
|
|
687
|
+
return name && args ? `${name} ${args}` : cleanSystemTags(text);
|
|
688
|
+
}
|
|
682
689
|
function extractTextContent(content) {
|
|
683
690
|
if (!content) return "";
|
|
684
|
-
if (typeof content === "string") return
|
|
691
|
+
if (typeof content === "string") return cleanText(content);
|
|
685
692
|
if (Array.isArray(content)) {
|
|
686
693
|
return content.map((item) => {
|
|
687
694
|
if (typeof item === "string") return item;
|
|
688
695
|
if (item?.type === "text" && item?.text) return item.text;
|
|
689
696
|
if (item?.type === "tool_result" && typeof item?.content === "string") return item.content;
|
|
690
697
|
return "";
|
|
691
|
-
}).filter(Boolean).map(
|
|
698
|
+
}).filter(Boolean).map(cleanText).join(" ");
|
|
692
699
|
}
|
|
693
700
|
return "";
|
|
694
701
|
}
|