acp-kernel 0.0.62-pr.247.92 → 0.0.63-pr.246.91
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/compress.d.ts.map +1 -1
- package/dist/index.js +11 -23
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/compress.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compress.d.ts","sourceRoot":"","sources":["../src/compress.ts"],"names":[],"mappings":"AAIA,OAAO,EAAkC,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAehF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAUvD,OAAO,EAGL,KAAK,YAAY,EAElB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EACV,sBAAsB,EACtB,gBAAgB,EAChB,gBAAgB,EAEhB,MAAM,EAEN,WAAW,EAGX,iBAAiB,EAEjB,YAAY,EACb,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,KAAK;IACpB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CACxC;AAED,MAAM,WAAW,eAAe;IAC9B,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,iBAAiB,CAAC;IACxD,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,sBAAsB,CAAC;IACvE,YAAY,IAAI,YAAY,EAAE,CAAC;IAC/B,UAAU,CACR,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,gBAAgB,GACtB,gBAAgB,GAAG,SAAS,CAAC;IAChC,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,GAAG,gBAAgB,EAAE,CAAC;IACnE,MAAM,CACJ,KAAK,EAAE,gBAAgB,EACvB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GACb,YAAY,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,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2494
2494
|
{
|
|
2495
|
-
const
|
|
2496
|
-
const callIds = /* @__PURE__ */ new Set();
|
|
2497
|
-
for (const m of input.messages) {
|
|
2498
|
-
if (!m.id) continue;
|
|
2499
|
-
if (m.contentType === "reasoning") reasoningIds.add(m.id);
|
|
2500
|
-
if (m.role === "assistant" && m.contentType === "tool-call") callIds.add(m.id);
|
|
2501
|
-
}
|
|
2502
|
-
const withdrawIds = /* @__PURE__ */ new Set();
|
|
2495
|
+
const splitTurnIds = /* @__PURE__ */ new Set();
|
|
2503
2496
|
let splitTurnCount = 0;
|
|
2504
2497
|
for (const group of computeTurnGroups(input.messages)) {
|
|
2505
|
-
const
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
(id) => !effectiveMessageIds.has(id) && callIds.has(id)
|
|
2511
|
-
);
|
|
2512
|
-
if (!keptHasCall) continue;
|
|
2513
|
-
splitTurnCount++;
|
|
2514
|
-
for (const id of group) withdrawIds.add(id);
|
|
2498
|
+
const inFold = group.filter((id) => effectiveMessageIds.has(id));
|
|
2499
|
+
if (inFold.length > 0 && inFold.length < group.length) {
|
|
2500
|
+
splitTurnCount++;
|
|
2501
|
+
for (const id of group) splitTurnIds.add(id);
|
|
2502
|
+
}
|
|
2515
2503
|
}
|
|
2516
|
-
if (
|
|
2517
|
-
for (const id of
|
|
2504
|
+
if (splitTurnIds.size > 0) {
|
|
2505
|
+
for (const id of splitTurnIds) effectiveMessageIds.delete(id);
|
|
2518
2506
|
const beforeWithdraw = filteredIds.length;
|
|
2519
|
-
filteredIds = filteredIds.filter((id) => !
|
|
2507
|
+
filteredIds = filteredIds.filter((id) => !splitTurnIds.has(id));
|
|
2520
2508
|
if (filteredIds.length === 0 && consumedBlockIds.length === 0) {
|
|
2521
2509
|
throw new Error(
|
|
2522
|
-
`Range would split ${splitTurnCount} turn(s) at the protected-zone boundary:
|
|
2510
|
+
`Range would split ${splitTurnCount} turn(s) at the protected-zone boundary: part of each turn must stay visible, so none of it can fold (reasoning and tool-calls are atomic \u2014 providers reject a half turn). Shrink the range to end before the turn starts, or wait until the whole turn ages out of the protected zone.`
|
|
2523
2511
|
);
|
|
2524
2512
|
}
|
|
2525
2513
|
warnings.push(
|
|
2526
|
-
`Withdrawn ${beforeWithdraw - filteredIds.length} message(s) from compression range to keep ${splitTurnCount} turn(s)
|
|
2514
|
+
`Withdrawn ${beforeWithdraw - filteredIds.length} message(s) from compression range to keep ${splitTurnCount} turn(s) atomic (reasoning/tool-call split at the protected boundary).`
|
|
2527
2515
|
);
|
|
2528
2516
|
}
|
|
2529
2517
|
}
|