@bd7pil/opencode-deep-memory 0.8.5 → 0.8.6
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/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -15819,13 +15819,23 @@ function compressAssistantText(text) {
|
|
|
15819
15819
|
const head = 3;
|
|
15820
15820
|
const tail = 3;
|
|
15821
15821
|
const kept = [];
|
|
15822
|
+
let inCodeBlock = false;
|
|
15822
15823
|
for (let i = 0; i < lines.length; i++) {
|
|
15823
15824
|
const line = lines[i];
|
|
15824
15825
|
if (i < head || i >= lines.length - tail) {
|
|
15825
15826
|
kept.push(line);
|
|
15826
15827
|
continue;
|
|
15827
15828
|
}
|
|
15828
|
-
if (
|
|
15829
|
+
if (line.trim().startsWith("```")) {
|
|
15830
|
+
inCodeBlock = !inCodeBlock;
|
|
15831
|
+
kept.push(line);
|
|
15832
|
+
continue;
|
|
15833
|
+
}
|
|
15834
|
+
if (inCodeBlock) {
|
|
15835
|
+
kept.push(line);
|
|
15836
|
+
continue;
|
|
15837
|
+
}
|
|
15838
|
+
if (/^#{1,3}\s/.test(line) || /error|fail|warning|critical|important/i.test(line) || /^\s*[-*]\s/.test(line) || /^\s*\d+\.\s/.test(line) || /^\/[^\s:]+/.test(line)) {
|
|
15829
15839
|
kept.push(line);
|
|
15830
15840
|
}
|
|
15831
15841
|
}
|