@hmharness/cli 0.6.4 → 0.6.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/dist/tui.js +31 -2
  2. package/package.json +7 -7
package/dist/tui.js CHANGED
@@ -1144,9 +1144,38 @@ export async function tui(yes, noWeb = false) {
1144
1144
  return;
1145
1145
  }
1146
1146
  history = tr.messages;
1147
- const firstUser = tr.messages.find((m) => m.role === 'user')?.content ?? '';
1148
1147
  rt.clearScreen();
1149
- rt.addUser(firstUser.replace(/\n/g, ' ').slice(0, 120));
1148
+ // Render the FULL session window, not just the first line (user
1149
+ // feedback: "恢复的应该是整个会话窗口,而不仅仅是片段"). Long sessions
1150
+ // are bounded from the tail so the visible window stays usable while
1151
+ // the complete transcript still lives in `history` for the model.
1152
+ const MAX_RENDER = 80;
1153
+ const msgs = tr.messages;
1154
+ const skipped = Math.max(0, msgs.length - MAX_RENDER);
1155
+ rt.addText('--- resumed ' + (tr.id || arg) + ' · ' + msgs.length + ' messages'
1156
+ + (skipped > 0 ? ' (' + skipped + ' earlier kept in context, not shown)' : '')
1157
+ + ' ---', 'dim');
1158
+ for (const m of (skipped > 0 ? msgs.slice(skipped) : msgs)) {
1159
+ const text = typeof m.content === 'string' ? m.content : '';
1160
+ if (m.role === 'user') {
1161
+ rt.addUser(text.replace(/\n+/g, ' ').slice(0, 400));
1162
+ }
1163
+ else if (m.role === 'assistant') {
1164
+ const calls = m.tool_calls ?? [];
1165
+ if (text.trim())
1166
+ rt.addText(text.slice(0, 2000));
1167
+ for (const c of calls)
1168
+ rt.addText('● ' + CYAN(String(c.function?.name ?? 'tool')) + DIM(' …'), 'dim');
1169
+ }
1170
+ else if (m.role === 'tool') {
1171
+ const first = text.split('\n').find((l) => l.trim()) ?? '';
1172
+ if (first)
1173
+ rt.addText(' ' + DIM('⎿ ' + first.trim().slice(0, 100)), 'dim');
1174
+ }
1175
+ else if (m.role === 'system' && text && !text.startsWith('[context pruned')) {
1176
+ rt.addText(DIM(text.slice(0, 300)), 'dim');
1177
+ }
1178
+ }
1150
1179
  rt.addText(t.cmdResumeLoaded(tr.messages.length), 'dim');
1151
1180
  return;
1152
1181
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hmharness/cli",
3
- "version": "0.6.4",
3
+ "version": "0.6.5",
4
4
  "description": "hmharness command line: one-shot tasks, an interactive REPL, a fullscreen TUI, the web frontend, and direct tool invocation.",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",
@@ -43,11 +43,11 @@
43
43
  "build": "tsc -p tsconfig.build.json"
44
44
  },
45
45
  "dependencies": {
46
- "@hmharness/kernel": "0.6.4",
47
- "@hmharness/evolution": "0.6.4",
48
- "@hmharness/domain-harmony": "0.6.4",
49
- "@hmharness/domain-ops": "0.6.4",
50
- "@hmharness/agent": "0.6.4",
51
- "@hmharness/web": "0.6.4"
46
+ "@hmharness/kernel": "0.6.5",
47
+ "@hmharness/evolution": "0.6.5",
48
+ "@hmharness/domain-harmony": "0.6.5",
49
+ "@hmharness/domain-ops": "0.6.5",
50
+ "@hmharness/agent": "0.6.5",
51
+ "@hmharness/web": "0.6.5"
52
52
  }
53
53
  }