mu-harness 0.31.0 → 0.32.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.
@@ -54,7 +54,10 @@ const GREY = '\x1b[38;2;153;153;153m';
54
54
  const BOLD = '\x1b[1m';
55
55
  const ITALIC = '\x1b[3m';
56
56
  const BUFFER_COLOR = '\x1b[38;2;255;193;7m'; // amber — the compaction reserve
57
- const paint = (s, color) => `${color}${s}${RESET}`;
57
+ // Reset BEFORE the colour too: the TUI note prefixes each line with a `dim` muted style,
58
+ // and a bare `\x1b[38;2;…m` only sets the foreground — it wouldn't clear the inherited dim,
59
+ // which darkened the first cell of every row. The leading reset wipes it.
60
+ const paint = (s, color) => `${RESET}${color}${s}${RESET}`;
58
61
  const fmtTok = (n) => (n >= 1e6 ? `${(n / 1e6).toFixed(1)}M` : n >= 1000 ? `${(n / 1000).toFixed(1)}k` : `${n}`);
59
62
  const pctStr = (n, w) => {
60
63
  if (w <= 0)
@@ -144,13 +147,13 @@ export const createContextCommand = () => ({
144
147
  // Right-hand info column — model, totals, then per-category usage (Claude Code's /context).
145
148
  const info = [];
146
149
  if (model) {
147
- info.push(model.split('/').pop() ?? model);
150
+ info.push(`${RESET}${model.split('/').pop() ?? model}`);
148
151
  info.push(paint(model, GREY));
149
152
  }
150
153
  if (window > 0)
151
154
  info.push(paint(`${mark(total)}/${fmtTok(window)} tokens (${pctStr(total, window)})`, GREY));
152
155
  info.push('');
153
- info.push(`${ITALIC}${GREY}Estimated usage by category${RESET}`);
156
+ info.push(`${RESET}${ITALIC}${GREY}Estimated usage by category${RESET}`);
154
157
  for (const c of cats) {
155
158
  info.push(`${paint(USED, c.color)} ${c.label}: ${paint(`${mark(c.n)} tokens (${pctStr(c.n, window)})`, GREY)}`);
156
159
  }
@@ -158,7 +161,7 @@ export const createContextCommand = () => ({
158
161
  info.push(`${paint(USED, BUFFER_COLOR)} Compaction buffer: ${paint(`${fmtTok(buffer)} tokens (${pctStr(buffer, window)})`, GREY)}`);
159
162
  info.push(`${paint(FREEG, GREY)} Free space: ${paint(`${fmtTok(free)} (${pctStr(free, window)})`, GREY)}`);
160
163
  }
161
- const lines = [`${BOLD}Context Usage${RESET}`];
164
+ const lines = [`${RESET}${BOLD}Context Usage${RESET}`];
162
165
  if (window > 0) {
163
166
  // Grid: category cells, then free, with the compaction buffer at the very end.
164
167
  const cellTokens = Math.max(1, window / GRID_CELLS);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mu-harness",
3
- "version": "0.31.0",
3
+ "version": "0.32.0",
4
4
  "description": "Agent harness: createHarness wires mu-core into a host — XDG paths, model registry, plugins, disk-loaded agents & skills, sub-agents, sessions (JSONL + SQLite catalog), slash commands, permission/approval hooks, an optional scheduler, and a composable TUI chat app",
5
5
  "license": "MIT",
6
6
  "main": "./script/index.js",
@@ -23,8 +23,8 @@
23
23
  "@swc/wasm-typescript": "^1.15.0",
24
24
  "cli-highlight": "^2.1.11",
25
25
  "croner": "^9.0.0",
26
- "mu-core": "^0.31.0",
27
- "mu-tui": "^0.31.0",
26
+ "mu-core": "^0.32.0",
27
+ "mu-tui": "^0.32.0",
28
28
  "ws": "^8.18.0"
29
29
  },
30
30
  "_generatedBy": "dnt@dev",
@@ -61,7 +61,10 @@ const GREY = '\x1b[38;2;153;153;153m';
61
61
  const BOLD = '\x1b[1m';
62
62
  const ITALIC = '\x1b[3m';
63
63
  const BUFFER_COLOR = '\x1b[38;2;255;193;7m'; // amber — the compaction reserve
64
- const paint = (s, color) => `${color}${s}${RESET}`;
64
+ // Reset BEFORE the colour too: the TUI note prefixes each line with a `dim` muted style,
65
+ // and a bare `\x1b[38;2;…m` only sets the foreground — it wouldn't clear the inherited dim,
66
+ // which darkened the first cell of every row. The leading reset wipes it.
67
+ const paint = (s, color) => `${RESET}${color}${s}${RESET}`;
65
68
  const fmtTok = (n) => (n >= 1e6 ? `${(n / 1e6).toFixed(1)}M` : n >= 1000 ? `${(n / 1000).toFixed(1)}k` : `${n}`);
66
69
  const pctStr = (n, w) => {
67
70
  if (w <= 0)
@@ -151,13 +154,13 @@ const createContextCommand = () => ({
151
154
  // Right-hand info column — model, totals, then per-category usage (Claude Code's /context).
152
155
  const info = [];
153
156
  if (model) {
154
- info.push(model.split('/').pop() ?? model);
157
+ info.push(`${RESET}${model.split('/').pop() ?? model}`);
155
158
  info.push(paint(model, GREY));
156
159
  }
157
160
  if (window > 0)
158
161
  info.push(paint(`${mark(total)}/${fmtTok(window)} tokens (${pctStr(total, window)})`, GREY));
159
162
  info.push('');
160
- info.push(`${ITALIC}${GREY}Estimated usage by category${RESET}`);
163
+ info.push(`${RESET}${ITALIC}${GREY}Estimated usage by category${RESET}`);
161
164
  for (const c of cats) {
162
165
  info.push(`${paint(USED, c.color)} ${c.label}: ${paint(`${mark(c.n)} tokens (${pctStr(c.n, window)})`, GREY)}`);
163
166
  }
@@ -165,7 +168,7 @@ const createContextCommand = () => ({
165
168
  info.push(`${paint(USED, BUFFER_COLOR)} Compaction buffer: ${paint(`${fmtTok(buffer)} tokens (${pctStr(buffer, window)})`, GREY)}`);
166
169
  info.push(`${paint(FREEG, GREY)} Free space: ${paint(`${fmtTok(free)} (${pctStr(free, window)})`, GREY)}`);
167
170
  }
168
- const lines = [`${BOLD}Context Usage${RESET}`];
171
+ const lines = [`${RESET}${BOLD}Context Usage${RESET}`];
169
172
  if (window > 0) {
170
173
  // Grid: category cells, then free, with the compaction buffer at the very end.
171
174
  const cellTokens = Math.max(1, window / GRID_CELLS);