@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.cjs
CHANGED
|
@@ -769,16 +769,23 @@ function asQueuedPromptUserEntry(entry) {
|
|
|
769
769
|
message: { role: "user", content: att.prompt }
|
|
770
770
|
};
|
|
771
771
|
}
|
|
772
|
+
var COMMAND_RE = /^\s*<command-name>([\s\S]*?)<\/command-name>/;
|
|
773
|
+
var COMMAND_ARGS_RE = /<command-args>([\s\S]*?)<\/command-args>/;
|
|
774
|
+
function cleanText(text) {
|
|
775
|
+
const name = text.match(COMMAND_RE)?.[1]?.trim();
|
|
776
|
+
const args = name ? text.match(COMMAND_ARGS_RE)?.[1]?.trim() : void 0;
|
|
777
|
+
return name && args ? `${name} ${args}` : cleanSystemTags(text);
|
|
778
|
+
}
|
|
772
779
|
function extractTextContent(content) {
|
|
773
780
|
if (!content) return "";
|
|
774
|
-
if (typeof content === "string") return
|
|
781
|
+
if (typeof content === "string") return cleanText(content);
|
|
775
782
|
if (Array.isArray(content)) {
|
|
776
783
|
return content.map((item) => {
|
|
777
784
|
if (typeof item === "string") return item;
|
|
778
785
|
if (item?.type === "text" && item?.text) return item.text;
|
|
779
786
|
if (item?.type === "tool_result" && typeof item?.content === "string") return item.content;
|
|
780
787
|
return "";
|
|
781
|
-
}).filter(Boolean).map(
|
|
788
|
+
}).filter(Boolean).map(cleanText).join(" ");
|
|
782
789
|
}
|
|
783
790
|
return "";
|
|
784
791
|
}
|