acp-kernel 0.0.82-pr.165.206 → 0.0.82-pr.186.215
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 +7 -13
- package/dist/index.js.map +1 -1
- package/dist/persist/index.d.ts +1 -1
- package/dist/persist/index.d.ts.map +1 -1
- package/dist/persist/index.js +63 -3
- package/dist/persist/index.js.map +1 -1
- package/dist/persist/store.d.ts +35 -2
- package/dist/persist/store.d.ts.map +1 -1
- package/dist/report.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3904,7 +3904,7 @@ function collectVisible(messages, state, countTokens) {
|
|
|
3904
3904
|
if (!ref) return;
|
|
3905
3905
|
const tokens = countMessageTokens(message, countTokens);
|
|
3906
3906
|
const tool = isToolMessage(message) ? message.toolName ?? (message.toolCallId ? toolCallNames.get(message.toolCallId) : void 0) ?? "tool" : "text";
|
|
3907
|
-
if (tokens > 0) visible.push({ ref, tokens, tool, index
|
|
3907
|
+
if (tokens > 0) visible.push({ ref, tokens, tool, index });
|
|
3908
3908
|
});
|
|
3909
3909
|
return { visible, summaryTokens };
|
|
3910
3910
|
}
|
|
@@ -3923,7 +3923,7 @@ function buildStatusReport(state, messages, countTokens, options = {}) {
|
|
|
3923
3923
|
if (view === "messages") {
|
|
3924
3924
|
return renderMessageDrilldown(visible, toolFilter, sort, limit);
|
|
3925
3925
|
}
|
|
3926
|
-
return renderUncompressedRanges(visible
|
|
3926
|
+
return renderUncompressedRanges(visible);
|
|
3927
3927
|
}
|
|
3928
3928
|
return renderOverview(visible, summaryTokens, activeBlocks2, state, countTokens, limit, options.meta);
|
|
3929
3929
|
}
|
|
@@ -3991,7 +3991,7 @@ function renderOverview(visible, summaryTokens, blocks, state, countTokens, limi
|
|
|
3991
3991
|
);
|
|
3992
3992
|
return lines.join("\n");
|
|
3993
3993
|
}
|
|
3994
|
-
function renderUncompressedRanges(visible
|
|
3994
|
+
function renderUncompressedRanges(visible) {
|
|
3995
3995
|
const lines = [];
|
|
3996
3996
|
const totalTokens = visible.reduce((s, m) => s + m.tokens, 0);
|
|
3997
3997
|
lines.push(`UNCOMPRESSED \u2014 ${formatTokens2(totalTokens)} | ${visible.length} visible messages`);
|
|
@@ -4019,9 +4019,7 @@ function renderUncompressedRanges(visible, sort, limit) {
|
|
|
4019
4019
|
for (const m of visible) {
|
|
4020
4020
|
const num = refNum2(m.ref);
|
|
4021
4021
|
const last = merged[merged.length - 1];
|
|
4022
|
-
|
|
4023
|
-
const turnBoundary = !!last && m.isUser && last.count >= 3;
|
|
4024
|
-
if (contiguous && !turnBoundary) {
|
|
4022
|
+
if (last && num === last.startNum + last.count) {
|
|
4025
4023
|
last.endRef = m.ref;
|
|
4026
4024
|
last.count += 1;
|
|
4027
4025
|
last.tokens += m.tokens;
|
|
@@ -4031,16 +4029,12 @@ function renderUncompressedRanges(visible, sort, limit) {
|
|
|
4031
4029
|
merged.push({ startRef: m.ref, endRef: m.ref, startNum: num, count: 1, tokens: m.tokens, toolTokens });
|
|
4032
4030
|
}
|
|
4033
4031
|
}
|
|
4034
|
-
|
|
4035
|
-
lines.push(`Sorted by ${sort === "time" ? "time" : "size"}`);
|
|
4036
|
-
lines.push("");
|
|
4037
|
-
const shown = merged.slice(0, limit);
|
|
4038
|
-
for (const r of shown) {
|
|
4032
|
+
for (const r of merged.slice(0, 30)) {
|
|
4039
4033
|
const range = r.count === 1 ? r.startRef : `${r.startRef}\u2013${r.endRef}`;
|
|
4040
4034
|
lines.push(` ${range} (${r.count} msgs, ${formatTokens2(r.tokens)}${r.count > 1 ? ` (${Math.round(r.tokens / r.count)}/msg)` : ""}) ${dominantTool(r.toolTokens)}`);
|
|
4041
4035
|
}
|
|
4042
|
-
if (merged.length >
|
|
4043
|
-
lines.push(` ... and ${merged.length -
|
|
4036
|
+
if (merged.length > 30) {
|
|
4037
|
+
lines.push(` ... and ${merged.length - 30} more ranges`);
|
|
4044
4038
|
}
|
|
4045
4039
|
return lines.join("\n");
|
|
4046
4040
|
}
|