@hmharness/cli 0.14.22 → 0.14.23

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 +23 -4
  2. package/package.json +2 -2
package/dist/tui.js CHANGED
@@ -736,10 +736,20 @@ export class TuiRuntime {
736
736
  addUser(text) {
737
737
  const width = Math.max(20, (stdout.columns || 100) - 2);
738
738
  const lines = [''];
739
- for (const l of wrapTo(text.replace(/\n+/g, ' '), width)) {
739
+ const wrapped = wrapTo(text.replace(/\n+/g, ' '), width);
740
+ // long prompts fold to two lines + a count marker (user ask 2026-09-21:
741
+ // a pasted prompt used to eat half the screen); the driver archives the
742
+ // full text into the Ctrl+T replay so nothing is lost
743
+ const shown = wrapped.length > 2 ? wrapped.slice(0, 2) : wrapped;
744
+ for (const l of shown) {
740
745
  const pad = Math.max(1, width - strWidth(l));
741
746
  lines.push(' '.repeat(pad) + BOLD(l));
742
747
  }
748
+ if (wrapped.length > 2) {
749
+ const note = this.t.tuiUserFolded(wrapped.length - 2);
750
+ const pad = Math.max(1, width - strWidth(note));
751
+ lines.push(' '.repeat(pad) + DIM(note));
752
+ }
743
753
  lines.push('');
744
754
  this.entries.push({ lines });
745
755
  this.scrollFromBottom = 0;
@@ -1982,6 +1992,9 @@ export async function tui(yes, noWeb = false, opts = {}) {
1982
1992
  }
1983
1993
  async function runSingleTask(line, forkFrom, forkResume) {
1984
1994
  rt.addUser(line);
1995
+ // the folded echo hides everything past line 2 - keep the full prompt
1996
+ // retrievable in the Ctrl+T replay
1997
+ fullToolLog.push({ name: 'user', output: line.slice(0, 4000) });
1985
1998
  rt.setBusy(true, t.running);
1986
1999
  currentAbort = new AbortController();
1987
2000
  const injectCh = { queue: [], active: false };
@@ -1992,6 +2005,10 @@ export async function tui(yes, noWeb = false, opts = {}) {
1992
2005
  : [];
1993
2006
  const resumeBase = [...planDirective, ...(forkResume ?? history)];
1994
2007
  let appender = null;
2008
+ let reasoningBuf = '';
2009
+ const foldThinking = () => { if (reasoningBuf.trim()) {
2010
+ fullToolLog.push({ name: 'thinking', output: reasoningBuf.slice(0, 8000) });
2011
+ } reasoningBuf = ''; rt.foldThinking(); };
1995
2012
  let kind = null;
1996
2013
  try {
1997
2014
  const result = await runAgentTask({
@@ -2010,8 +2027,10 @@ export async function tui(yes, noWeb = false, opts = {}) {
2010
2027
  approvalAsk: (name, args) => rt.requestApproval(name, args),
2011
2028
  events: {
2012
2029
  onLine: (l) => { if (kind === 'reasoning')
2013
- rt.foldThinking(); appender = null; kind = null; rt.addText(l, 'dim'); },
2030
+ foldThinking(); appender = null; kind = null; rt.addText(l, 'dim'); },
2014
2031
  onDelta: (k, chunk) => {
2032
+ if (k === 'reasoning')
2033
+ reasoningBuf += chunk;
2015
2034
  if (k === 'reset') {
2016
2035
  // provider retry after a mid-stream cut: drop the half answer
2017
2036
  appender?.drop?.();
@@ -2021,7 +2040,7 @@ export async function tui(yes, noWeb = false, opts = {}) {
2021
2040
  }
2022
2041
  if (k !== kind) {
2023
2042
  if (kind === 'reasoning')
2024
- rt.foldThinking();
2043
+ foldThinking();
2025
2044
  appender = rt.startStream(k === 'reasoning' ? 'think' : 'say');
2026
2045
  kind = k;
2027
2046
  }
@@ -2029,7 +2048,7 @@ export async function tui(yes, noWeb = false, opts = {}) {
2029
2048
  },
2030
2049
  onToolCall: (name, args) => {
2031
2050
  if (kind === 'reasoning')
2032
- rt.foldThinking();
2051
+ foldThinking();
2033
2052
  appender = null;
2034
2053
  kind = null;
2035
2054
  const brief = name === 'run_command' && typeof args.command === 'string'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hmharness/cli",
3
- "version": "0.14.22",
3
+ "version": "0.14.23",
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",
@@ -48,7 +48,7 @@
48
48
  "@hmharness/evolution": "0.14.15",
49
49
  "@hmharness/domain-harmony": "0.13.6",
50
50
  "@hmharness/domain-ops": "0.8.1",
51
- "@hmharness/agent": "0.14.12",
51
+ "@hmharness/agent": "0.14.13",
52
52
  "@hmharness/evaluation": "0.8.0",
53
53
  "@hmharness/web": "0.9.2"
54
54
  }