acp-kernel 0.0.74-pr.165.175 → 0.0.74-pr.303.176

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
@@ -3611,7 +3611,7 @@ function collectVisible(messages, state, countTokens) {
3611
3611
  if (!ref) return;
3612
3612
  const tokens = countMessageTokens(message, countTokens);
3613
3613
  const tool = isToolMessage(message) ? message.toolName ?? (message.toolCallId ? toolCallNames.get(message.toolCallId) : void 0) ?? "tool" : "text";
3614
- if (tokens > 0) visible.push({ ref, tokens, tool, index, isUser: message.role === "user" });
3614
+ if (tokens > 0) visible.push({ ref, tokens, tool, index });
3615
3615
  });
3616
3616
  return { visible, summaryTokens };
3617
3617
  }
@@ -3630,7 +3630,7 @@ function buildStatusReport(state, messages, countTokens, options = {}) {
3630
3630
  if (view === "messages") {
3631
3631
  return renderMessageDrilldown(visible, toolFilter, sort, limit);
3632
3632
  }
3633
- return renderUncompressedRanges(visible, sort, limit);
3633
+ return renderUncompressedRanges(visible);
3634
3634
  }
3635
3635
  return renderOverview(visible, summaryTokens, activeBlocks2, state, countTokens, limit, options.meta);
3636
3636
  }
@@ -3698,7 +3698,7 @@ function renderOverview(visible, summaryTokens, blocks, state, countTokens, limi
3698
3698
  );
3699
3699
  return lines.join("\n");
3700
3700
  }
3701
- function renderUncompressedRanges(visible, sort, limit) {
3701
+ function renderUncompressedRanges(visible) {
3702
3702
  const lines = [];
3703
3703
  const totalTokens = visible.reduce((s, m) => s + m.tokens, 0);
3704
3704
  lines.push(`UNCOMPRESSED \u2014 ${formatTokens2(totalTokens)} | ${visible.length} visible messages`);
@@ -3726,9 +3726,7 @@ function renderUncompressedRanges(visible, sort, limit) {
3726
3726
  for (const m of visible) {
3727
3727
  const num = refNum2(m.ref);
3728
3728
  const last = merged[merged.length - 1];
3729
- const contiguous = !!last && num === last.startNum + last.count;
3730
- const turnBoundary = !!last && m.isUser && last.count >= 3;
3731
- if (contiguous && !turnBoundary) {
3729
+ if (last && num === last.startNum + last.count) {
3732
3730
  last.endRef = m.ref;
3733
3731
  last.count += 1;
3734
3732
  last.tokens += m.tokens;
@@ -3738,16 +3736,12 @@ function renderUncompressedRanges(visible, sort, limit) {
3738
3736
  merged.push({ startRef: m.ref, endRef: m.ref, startNum: num, count: 1, tokens: m.tokens, toolTokens });
3739
3737
  }
3740
3738
  }
3741
- if (sort !== "time") merged.sort((a, b) => b.tokens - a.tokens || a.startNum - b.startNum);
3742
- lines.push(`Sorted by ${sort === "time" ? "time" : "size"}`);
3743
- lines.push("");
3744
- const shown = merged.slice(0, limit);
3745
- for (const r of shown) {
3739
+ for (const r of merged.slice(0, 30)) {
3746
3740
  const range = r.count === 1 ? r.startRef : `${r.startRef}\u2013${r.endRef}`;
3747
3741
  lines.push(` ${range} (${r.count} msgs, ${formatTokens2(r.tokens)}${r.count > 1 ? ` (${Math.round(r.tokens / r.count)}/msg)` : ""}) ${dominantTool(r.toolTokens)}`);
3748
3742
  }
3749
- if (merged.length > shown.length) {
3750
- lines.push(` ... and ${merged.length - shown.length} more ranges`);
3743
+ if (merged.length > 30) {
3744
+ lines.push(` ... and ${merged.length - 30} more ranges`);
3751
3745
  }
3752
3746
  return lines.join("\n");
3753
3747
  }