mini-coder 0.5.13 → 0.5.14

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.
@@ -21,6 +21,8 @@ import { COMMANDS, SKILL_COMMAND } from "../input.ts";
21
21
  import { connectMcpServer, disconnectMcpServer } from "../mcp.ts";
22
22
  import {
23
23
  clearConversationState,
24
+ computeSessionContextTokens,
25
+ computeSessionStats,
24
26
  forkSession,
25
27
  listPromptHistory,
26
28
  listSessions,
@@ -546,6 +548,11 @@ export function createCommandController(
546
548
  if (picked) {
547
549
  state.session = picked;
548
550
  replaceConversationState(state, loadMessages(state.db, picked.id));
551
+ state.stats = computeSessionStats(state.db, picked.id);
552
+ state.contextTokens = computeSessionContextTokens(
553
+ state.db,
554
+ picked.id,
555
+ );
549
556
  runtime.scrollConversationToBottom();
550
557
  }
551
558
  }
@@ -574,6 +581,8 @@ export function createCommandController(
574
581
  const forked = forkSession(state.db, state.session.id);
575
582
  state.session = forked;
576
583
  replaceConversationState(state, loadMessages(state.db, forked.id));
584
+ state.stats = computeSessionStats(state.db, forked.id);
585
+ state.contextTokens = computeSessionContextTokens(state.db, forked.id);
577
586
  runtime.appendInfoMessage("Forked session.", state);
578
587
  };
579
588
 
@@ -594,6 +603,11 @@ export function createCommandController(
594
603
  const removed = undoLastTurn(state.db, state.session.id);
595
604
  if (removed) {
596
605
  replaceConversationState(state, loadMessages(state.db, state.session.id));
606
+ state.stats = computeSessionStats(state.db, state.session.id);
607
+ state.contextTokens = computeSessionContextTokens(
608
+ state.db,
609
+ state.session.id,
610
+ );
597
611
  runtime.scrollConversationToBottom();
598
612
  runtime.requestRender("normal");
599
613
  }