@pify/usage 0.9.0 → 0.9.1

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.
@@ -206,7 +206,10 @@ export default function usage(pi: ExtensionAPI) {
206
206
  try {
207
207
  const projectTrusted = (ctx as { isProjectTrusted?: () => boolean }).isProjectTrusted?.() ?? false;
208
208
  const settings = SettingsManager.create(ctx.cwd, getAgentDir(), { projectTrusted });
209
- return settings.getCompactionEnabled() ? Math.max(0, settings.getCompactionReserveTokens()) : 0;
209
+ // Per model since pi 0.86 (compaction.modelOverrides); the global value
210
+ // would misstate "free space" for a model with its own reserve.
211
+ const model = ctx.model ? { provider: ctx.model.provider, id: ctx.model.id } : undefined;
212
+ return settings.getCompactionEnabled() ? Math.max(0, settings.getCompactionReserveTokens(model)) : 0;
210
213
  } catch {
211
214
  return 0;
212
215
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pify/usage",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "Token and cost reporting for pi sessions: live footer, local-history dashboard with per-project costs, opt-in provider quota",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -58,7 +58,8 @@
58
58
  }
59
59
  },
60
60
  "devDependencies": {
61
- "@earendil-works/pi-coding-agent": "^0.85.1",
61
+ "@earendil-works/pi-coding-agent": "^0.87.0",
62
+ "@earendil-works/pi-tui": "^0.87.0",
62
63
  "@types/node": "^22.10.2",
63
64
  "typebox": "^1.1.38",
64
65
  "typescript": "^5.7.2"