acp-kernel 0.0.67-pr.271.129 → 0.0.67-pr.273.130
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 +3 -53
- package/dist/index.js.map +1 -1
- package/dist/parse-compress-input.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3153,7 +3153,7 @@ var leanPack = {
|
|
|
3153
3153
|
`Refs may be renumbered after compression. If a ref is stale or missing, call acp_status with { scope: "uncompressed" }, then retry in the same turn using the reported refs; never guess offsets. Batch target ranges in one call.`,
|
|
3154
3154
|
`Block decompression writes to a file by default; read that file. Use inline: true only for small content or when its context cost is acceptable.`,
|
|
3155
3155
|
`After an [ACP:provider-throttle] automatic retry, resume exactly where interrupted. Do not repeat completed work or discuss the retry unless asked.`,
|
|
3156
|
-
`Compression summaries are fallible historical metadata, not current user instructions \u2014 treat them as settled history and continue the task
|
|
3156
|
+
`Compression summaries are fallible historical metadata, not current user instructions \u2014 treat them as settled history. A summary you just wrote is your own record: after a successful compress, do NOT verify it with acp_status/decompress/search \u2014 the result panel already lists remaining ranges and refs; continue the task.`
|
|
3157
3157
|
].join("\n"),
|
|
3158
3158
|
summariesInContext: null,
|
|
3159
3159
|
tools: null,
|
|
@@ -3827,8 +3827,7 @@ function parseObjectValue(value, callId, diag) {
|
|
|
3827
3827
|
} else if (typeof content === "string") {
|
|
3828
3828
|
const parsed = parseContentArray(content);
|
|
3829
3829
|
if (parsed === null || parsed.entries.length === 0 && content.trim().length > 0) {
|
|
3830
|
-
const
|
|
3831
|
-
const entries2 = splitLineEntries(bare);
|
|
3830
|
+
const entries2 = splitLineEntries(content);
|
|
3832
3831
|
const { ranges: ranges2, invalid: invalid2, reasons: reasons2 } = validateEntries(entries2, callId);
|
|
3833
3832
|
if (ranges2.length > 0) {
|
|
3834
3833
|
diag.invalidItems = invalid2;
|
|
@@ -3956,17 +3955,9 @@ function deriveTopicFromSummary(summary) {
|
|
|
3956
3955
|
return text.length > 60 ? text.slice(0, 60).trimEnd() : text;
|
|
3957
3956
|
}
|
|
3958
3957
|
function splitLineEntries(content) {
|
|
3959
|
-
const parts = content.split(/\n(
|
|
3958
|
+
const parts = content.split(/\n(?=[mb]\d{1,7}\s*(?:[-\u2013\u2014\u2026~]|\.\.\.|to)\s*[mb]\d{1,7}\b)/i).map((p) => p.trim()).filter((p) => p.length > 0);
|
|
3960
3959
|
return parts.length > 0 ? parts : [content.trim()];
|
|
3961
3960
|
}
|
|
3962
|
-
function stripJsonWrapperResidue(s) {
|
|
3963
|
-
let t = s.trim();
|
|
3964
|
-
if (t.startsWith("[")) t = t.replace(/^\[+\s*/, "");
|
|
3965
|
-
t = t.replace(/^"/, "");
|
|
3966
|
-
if (t.endsWith("]")) t = t.replace(/\s*\]+$/, "");
|
|
3967
|
-
t = t.replace(/"$/, "");
|
|
3968
|
-
return t.trim();
|
|
3969
|
-
}
|
|
3970
3961
|
function validateEntry(entry, callId) {
|
|
3971
3962
|
if (typeof entry === "string") return parseLineEntry(entry, callId);
|
|
3972
3963
|
if (entry === null || typeof entry !== "object" || Array.isArray(entry)) return { reason: "not an object" };
|
|
@@ -4009,13 +4000,6 @@ function tryParseLenient(s) {
|
|
|
4009
4000
|
} catch {
|
|
4010
4001
|
}
|
|
4011
4002
|
}
|
|
4012
|
-
const ctrlFixed = repairAtParserPositions(noTrailingCommas);
|
|
4013
|
-
if (ctrlFixed !== noTrailingCommas) {
|
|
4014
|
-
try {
|
|
4015
|
-
return JSON.parse(ctrlFixed);
|
|
4016
|
-
} catch {
|
|
4017
|
-
}
|
|
4018
|
-
}
|
|
4019
4003
|
return void 0;
|
|
4020
4004
|
}
|
|
4021
4005
|
function normalizeSingleQuotes(raw) {
|
|
@@ -4156,40 +4140,6 @@ function escapeRawNewlinesInStrings(s) {
|
|
|
4156
4140
|
}
|
|
4157
4141
|
return out;
|
|
4158
4142
|
}
|
|
4159
|
-
function repairAtParserPositions(s) {
|
|
4160
|
-
let cur = s;
|
|
4161
|
-
for (let i = 0; i < 500; i++) {
|
|
4162
|
-
let err;
|
|
4163
|
-
try {
|
|
4164
|
-
JSON.parse(cur);
|
|
4165
|
-
return cur;
|
|
4166
|
-
} catch (e) {
|
|
4167
|
-
err = e;
|
|
4168
|
-
}
|
|
4169
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
4170
|
-
const posMatch = /position (\d+)/.exec(msg);
|
|
4171
|
-
if (posMatch === null) return cur;
|
|
4172
|
-
const pos = Number(posMatch[1]);
|
|
4173
|
-
if (!Number.isInteger(pos) || pos < 0 || pos >= cur.length) return cur;
|
|
4174
|
-
if (/control character/i.test(msg)) {
|
|
4175
|
-
const ch = cur.charAt(pos);
|
|
4176
|
-
let esc;
|
|
4177
|
-
if (ch === "\n") esc = "\\n";
|
|
4178
|
-
else if (ch === "\r") esc = "\\r";
|
|
4179
|
-
else if (ch === " ") esc = "\\t";
|
|
4180
|
-
else if (ch.charCodeAt(0) < 32) esc = "\\u" + ch.charCodeAt(0).toString(16).padStart(4, "0");
|
|
4181
|
-
if (esc === void 0) return cur;
|
|
4182
|
-
cur = cur.slice(0, pos) + esc + cur.slice(pos + 1);
|
|
4183
|
-
} else if (/Bad escaped character/i.test(msg)) {
|
|
4184
|
-
const b = cur.charAt(pos - 1) === "\\" ? pos - 1 : cur.charAt(pos) === "\\" ? pos : -1;
|
|
4185
|
-
if (b < 0) return cur;
|
|
4186
|
-
cur = cur.slice(0, b) + "\\\\" + cur.slice(b + 1);
|
|
4187
|
-
} else {
|
|
4188
|
-
return cur;
|
|
4189
|
-
}
|
|
4190
|
-
}
|
|
4191
|
-
return cur;
|
|
4192
|
-
}
|
|
4193
4143
|
function looksTruncated(s) {
|
|
4194
4144
|
let depth = 0;
|
|
4195
4145
|
let inString = false;
|