aegis-desktop 0.7.4 → 0.7.5

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/renderer/app.js +26 -3
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "aegis-desktop",
3
3
  "productName": "AEGIS Desktop",
4
- "version": "0.7.4",
4
+ "version": "0.7.5",
5
5
  "description": "Thin Electron host for AEGIS — a local chat UI over the shared client/aegis.js transport. Ships transport + UI only; engine logic stays server-side.",
6
6
  "author": {
7
7
  "name": "AEGIS Code",
package/renderer/app.js CHANGED
@@ -274,12 +274,31 @@ function foldRoll(sessionId, usage, opts = {}) {
274
274
  * Paint the topbar meter. Hidden while a session has accounted for nothing —
275
275
  * an unused thread must not display a `0 tok` it never measured — and shown
276
276
  * the moment a turn is folded in.
277
+ *
278
+ * `live`, when given, previews the in-flight turn on top of the session's
279
+ * already-folded total — text estimated the same way `foldRoll` estimates a
280
+ * turn the wire never reported on — WITHOUT folding it: the preview roll
281
+ * returned by `rollTurn` here is thrown away every frame and `rollsBySession`
282
+ * is never written to, so the real `foldRoll` at completion still starts from
283
+ * the untouched persisted total and cannot double-count this turn. (`turns`/
284
+ * `calls` are left at their default +1 rather than forced to 0 — `fmtRoll`
285
+ * treats a roll with both at 0 as "nothing counted yet" and blanks the line,
286
+ * which hid the preview entirely.) Before this, the meter held the previous
287
+ * turn's total frozen for the whole reply and only jumped at the end, which
288
+ * read as "the counter is dead while the AI works".
277
289
  */
278
- function renderRollMeter(sessionId) {
290
+ function renderRollMeter(sessionId, live) {
279
291
  const el = els.sessionMeter;
280
292
  if (!el) return;
281
- const roll = rollsBySession.get(sessionId || '');
282
- const line = roll && currentSessionId === sessionId ? fmtRoll(roll) : '';
293
+ if (currentSessionId !== sessionId) { el.hidden = true; return; }
294
+ let roll = rollsBySession.get(sessionId || '');
295
+ if (live) {
296
+ roll = rollTurn(roll || emptyRoll(), undefined, {
297
+ prompt: live.prompt,
298
+ reply: live.reply,
299
+ });
300
+ }
301
+ const line = roll ? fmtRoll(roll) : '';
283
302
  el.textContent = line;
284
303
  el.hidden = !line;
285
304
  if (line) el.title = 'This session, counted the way the CLI counts it — every turn rolled into one running total';
@@ -3146,6 +3165,10 @@ async function send() {
3146
3165
  }
3147
3166
  const bodyEl = pendingEl.querySelector('.body');
3148
3167
  if (bodyEl && bodyEl.textContent !== streamedText) bodyEl.textContent = streamedText;
3168
+ // Live estimate so the topbar meter keeps moving while the reply streams
3169
+ // in, instead of sitting frozen on the previous turn's total until this
3170
+ // one resolves — see renderRollMeter's `live` param.
3171
+ renderRollMeter(sessionId, { prompt, reply: streamedText });
3149
3172
  stickToBottom();
3150
3173
  });
3151
3174