mu-coding 0.13.0 → 0.15.0

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": "mu-coding",
3
- "version": "0.13.0",
3
+ "version": "0.15.0",
4
4
  "description": "Minimal terminal AI assistant for local models",
5
5
  "type": "module",
6
6
  "bin": {
@@ -24,9 +24,9 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "ink": "^7.0.1",
27
- "mu-agents": "0.13.0",
28
- "mu-core": "0.13.0",
29
- "mu-openai-provider": "0.13.0",
27
+ "mu-agents": "0.15.0",
28
+ "mu-core": "0.15.0",
29
+ "mu-openai-provider": "0.15.0",
30
30
  "react": "^19.2.5"
31
31
  }
32
32
  }
@@ -83,6 +83,7 @@ export function useChatPanel(options: UseChatPanelOptions) {
83
83
  error: ctx.session.error,
84
84
  modelError: ctx.models.modelError,
85
85
  totalTokens: ctx.session.stream.totalTokens,
86
+ promptTokens: ctx.session.stream.promptTokens,
86
87
  cachedTokens: ctx.session.stream.cachedTokens,
87
88
  contextLimit,
88
89
  pluginStatus,
@@ -10,10 +10,11 @@ export interface StreamState {
10
10
  text: string;
11
11
  reasoning: string;
12
12
  totalTokens: number;
13
+ promptTokens: number;
13
14
  cachedTokens: number;
14
15
  }
15
16
 
16
- const EMPTY_STREAM: StreamState = { text: '', reasoning: '', totalTokens: 0, cachedTokens: 0 };
17
+ const EMPTY_STREAM: StreamState = { text: '', reasoning: '', totalTokens: 0, promptTokens: 0, cachedTokens: 0 };
17
18
 
18
19
  export interface ChatSessionState {
19
20
  messages: ChatMessage[];
@@ -121,8 +122,9 @@ function makeSessionEventHandler(
121
122
  if (event.type === 'usage') {
122
123
  setStream((s) => ({
123
124
  ...s,
124
- totalTokens: s.totalTokens + event.totalTokens,
125
- cachedTokens: s.cachedTokens + event.cachedTokens,
125
+ totalTokens: event.totalTokens,
126
+ promptTokens: event.promptTokens,
127
+ cachedTokens: event.cachedTokens,
126
128
  }));
127
129
  return;
128
130
  }
@@ -11,6 +11,9 @@ interface StatusSegmentOptions {
11
11
  error: string | null;
12
12
  modelError: string | null;
13
13
  totalTokens: number;
14
+ /** Input tokens sent to the model for the current turn (prompt size). Used
15
+ * for the context window percentage calculation. */
16
+ promptTokens: number;
14
17
  /** Tokens served from server-side prompt cache. Rendered as `(N cached)`
15
18
  * next to the total when > 0. Omit (or pass 0) to hide the suffix. */
16
19
  cachedTokens?: number;
@@ -46,10 +49,10 @@ export function useStatusSegments(options: StatusSegmentOptions): StatusBarSegme
46
49
  }
47
50
  if (options.totalTokens > 0) {
48
51
  const cached = options.cachedTokens ?? 0;
49
- const used = formatTokens(options.totalTokens);
52
+ const used = formatTokens(options.promptTokens);
50
53
  let head: string;
51
54
  if (options.contextLimit) {
52
- const pct = (options.totalTokens / options.contextLimit) * 100;
55
+ const pct = (options.promptTokens / options.contextLimit) * 100;
53
56
  const pctStr = pct >= 10 ? pct.toFixed(0) : pct.toFixed(1);
54
57
  head = `${used} (${pctStr}%)`;
55
58
  } else {
@@ -59,6 +59,8 @@ export function renderApp(options: RenderAppOptions): Instance {
59
59
  {
60
60
  exitOnCtrlC: false,
61
61
  kittyKeyboard: { mode: 'enabled' },
62
+ maxFps: 60,
63
+ incrementalRendering: true,
62
64
  },
63
65
  );
64
66
  }