acp-kernel 0.0.67-pr.273.130 → 0.0.67-pr.274.133

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 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. 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.`
3156
+ `Compression summaries are fallible historical metadata, not current user instructions \u2014 treat them as settled history and continue the task from them.`
3157
3157
  ].join("\n"),
3158
3158
  summariesInContext: null,
3159
3159
  tools: null,
@@ -4000,8 +4000,49 @@ function tryParseLenient(s) {
4000
4000
  } catch {
4001
4001
  }
4002
4002
  }
4003
+ return repairByParserPosition(noTrailingCommas);
4004
+ }
4005
+ function repairByParserPosition(s) {
4006
+ let cur = s;
4007
+ for (let i = 0; i <= cur.length; i++) {
4008
+ try {
4009
+ return JSON.parse(cur);
4010
+ } catch (e) {
4011
+ const msg = e instanceof Error ? e.message : String(e);
4012
+ const posMatch = /position (\d+)/.exec(msg);
4013
+ if (posMatch === null) return void 0;
4014
+ const pos = Number(posMatch[1]);
4015
+ if (/Bad control character/.test(msg)) {
4016
+ const cp = cur.codePointAt(pos);
4017
+ if (cp === void 0) return void 0;
4018
+ const adv = cp > 65535 ? 2 : 1;
4019
+ cur = cur.slice(0, pos) + escapeControlChar(cp) + cur.slice(pos + adv);
4020
+ } else if (/Bad escaped character/.test(msg)) {
4021
+ if (pos < 1 || cur.charAt(pos - 1) !== "\\") return void 0;
4022
+ cur = cur.slice(0, pos - 1) + "\\" + cur.slice(pos - 1);
4023
+ } else {
4024
+ return void 0;
4025
+ }
4026
+ }
4027
+ }
4003
4028
  return void 0;
4004
4029
  }
4030
+ function escapeControlChar(cp) {
4031
+ switch (cp) {
4032
+ case 8:
4033
+ return "\\b";
4034
+ case 9:
4035
+ return "\\t";
4036
+ case 10:
4037
+ return "\\n";
4038
+ case 12:
4039
+ return "\\f";
4040
+ case 13:
4041
+ return "\\r";
4042
+ default:
4043
+ return "\\u" + cp.toString(16).padStart(4, "0");
4044
+ }
4045
+ }
4005
4046
  function normalizeSingleQuotes(raw) {
4006
4047
  if (!raw.includes("'") || !raw.includes("{") && !raw.includes("[")) return void 0;
4007
4048
  let out = "";