pi-mega-compact 0.4.3 → 0.4.4

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.
@@ -333,19 +333,22 @@ export default function (pi: ExtensionAPI) {
333
333
  const dedupStr = storageRate * 100 >= 10
334
334
  ? `${Math.round(storageRate * 100)}%`
335
335
  : `${(storageRate * 100).toFixed(1)}%`;
336
- // saved = cumulative original − stored tokens (this session). Show real
337
- // token counts; use "k" only at/above 1000 so small-but-real savings are
338
- // visible (previously Math.round(x/1000) rounded everything <1000 to 0).
339
- const savedStr = rt.tokensSaved >= 1000
340
- ? `${(rt.tokensSaved / 1000).toFixed(1)}k`
341
- : `${rt.tokensSaved}`;
336
+ // saved = tokens removed from context (cumulative original − stored).
337
+ // Show BOTH this-session (rt.tokensSaved) and repo-wide-total
338
+ // (repo.tokensSaved) so the user sees per-session progress vs the running
339
+ // repo total. "used" = stored checkpoint tokens (repo.totalTokenEstimate
340
+ // vs st.totalTokenEstimate). Use "k" only at/above 1000 so small-but-real
341
+ // numbers stay visible (previously Math.round(x/1000) zeroed <1000).
342
+ const fmt = (x: number) => (x >= 1000 ? `${(x / 1000).toFixed(1)}k` : `${x}`);
343
+ const savedStr = `${fmt(rt.tokensSaved)} sess / ${fmt(repo.tokensSaved)} repo`;
344
+ const usedStr = `${fmt(st.totalTokenEstimate)} sess / ${fmt(repo.totalTokenEstimate)} repo`;
342
345
  const agentStr = activeAgents > 0 ? ` │ 🤖 ${activeAgents} agent${activeAgents === 1 ? "" : "s"}` : "";
343
346
  const turnStr = currentTurn > 0 ? ` │ turn ${currentTurn}` : "";
344
347
  ctx.ui.setWidget(
345
348
  WIDGET_KEY,
346
349
  [
347
350
  ` ⚡ ${config.tier} │ ${tokStr}/${maxStr} tokens (${pctStr}) │ ${st.checkpointCount} chkpt${st.checkpointCount === 1 ? "" : "s"}${agentStr}${turnStr}`,
348
- ` ${triggerLabel} │ dedup: ${dedupStr} │ saved: ${savedStr} tok`,
351
+ ` ${triggerLabel} │ dedup: ${dedupStr} │ used: ${usedStr} │ saved: ${savedStr}`,
349
352
  ],
350
353
  { placement: "aboveEditor" },
351
354
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-mega-compact",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
4
4
  "description": "Layered, local, vector-backed context compressor for pi — supersede/collapse/cluster compaction with deduped inline recall.",
5
5
  "type": "module",
6
6
  "license": "BSD-2-Clause",