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.
- package/extensions/mega-compact.ts +10 -7
- package/package.json +1 -1
|
@@ -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
|
|
337
|
-
//
|
|
338
|
-
//
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
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}
|
|
351
|
+
` ${triggerLabel} │ dedup: ${dedupStr} │ used: ${usedStr} │ saved: ${savedStr}`,
|
|
349
352
|
],
|
|
350
353
|
{ placement: "aboveEditor" },
|
|
351
354
|
);
|
package/package.json
CHANGED