troxy-cli 1.29.34 → 1.29.36

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "troxy-cli",
3
- "version": "1.29.34",
3
+ "version": "1.29.36",
4
4
  "description": "A secure control layer for AI agents: policies across payments, messages, logins, destructive actions, model usage, and secrets, all enforceable from the CLI",
5
5
  "homepage": "https://troxy.io",
6
6
  "bugs": {
@@ -112,8 +112,6 @@ function troxyCommand(args, paused) {
112
112
  return { paused, text: paused ? 'Troxy routing is off. Type /troxy on to resume.' : 'Troxy routing is on. Type /troxy off to pause it.' };
113
113
  }
114
114
 
115
- // Whether this session has shown its one "Troxy is active" notice yet.
116
- let announced = false;
117
115
 
118
116
  // Session savings tracking: cumulative % savings from routing
119
117
  let sessionSavingsPercent = 0;
@@ -177,10 +175,7 @@ async function* routeStep($, e, next) {
177
175
  if (savings > 0) {
178
176
  routingCount += 1;
179
177
  sessionSavingsPercent = Math.round((sessionSavingsPercent * (routingCount - 1) + savings) / routingCount);
180
- }
181
- if (!announced) {
182
- announced = true;
183
- $.ui.toast(`Troxy is active · Session: -${sessionSavingsPercent}% saved`);
178
+ $.ui.toast(`Troxy routed to cheaper model · -${savings}% on this turn`);
184
179
  }
185
180
  const sid = await $.session.id();
186
181
  const file = modRouteFile($.plugin.root, sid);
@@ -204,13 +199,18 @@ export function register(on) {
204
199
  await $.store.set('paused', r.paused);
205
200
  return { text: r.text };
206
201
  });
207
- // Status line showing live savings
202
+ // Show session savings bar on every turn
208
203
  on('turn.start', async ($, e, next) => {
209
204
  const paused = Boolean(await $.store.get('paused'));
210
- const status = paused
211
- ? 'Troxy: off'
212
- : (routingCount > 0 ? `Troxy: -${sessionSavingsPercent}% saved` : 'Troxy: active');
213
- $.statusLine.set(status);
205
+
206
+ if (!paused && routingCount > 0) {
207
+ const barLength = 20;
208
+ const filledLength = Math.round((sessionSavingsPercent / 100) * barLength);
209
+ const emptyLength = barLength - filledLength;
210
+ const bar = '█'.repeat(filledLength) + '░'.repeat(emptyLength);
211
+ $.ui.toast(`[${bar}] Session: -${sessionSavingsPercent}% saved`);
212
+ }
213
+
214
214
  return next(e);
215
215
  });
216
216
  // Routing fails open: a scorer or hook error must never break the session,