@hmharness/cli 0.6.7 → 0.6.8

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.
@@ -109,8 +109,11 @@ export async function serveMcp() {
109
109
  const name = msg.params?.name ?? '';
110
110
  const tool = byName.get(name);
111
111
  if (!tool) {
112
- void logCall(name, false, 0);
113
- reply(msg.id, { content: [{ type: 'text', text: `unknown or not exposed tool: ${name}` }], isError: true });
112
+ // log-then-reply: the call log is an audit trail ("external agents'
113
+ // HarmonyOS usage"), so it must be durable BEFORE the caller can see
114
+ // the response. Fire-and-forget here raced with the client reading
115
+ // the file, so a rejected call sometimes had no log line yet.
116
+ void logCall(name, false, 0).then(() => reply(msg.id, { content: [{ type: 'text', text: `unknown or not exposed tool: ${name}` }], isError: true }));
114
117
  break;
115
118
  }
116
119
  const t0 = Date.now();
package/dist/tui.d.ts CHANGED
@@ -114,7 +114,9 @@ export declare class TuiRuntime {
114
114
  * below, right-aligned to the terminal width so it reads as "the human
115
115
  * side" against left-aligned model output. */
116
116
  addUser(text: string): void;
117
- startStream(kind: 'think' | 'say'): (chunk: string) => void;
117
+ startStream(kind: 'think' | 'say'): ((chunk: string) => void) & {
118
+ drop: () => void;
119
+ };
118
120
  /** Collapse a streamed thinking block to its final folded summary line. */
119
121
  foldThinking(): void;
120
122
  setBusy(busy: boolean, label?: string): void;
package/dist/tui.js CHANGED
@@ -386,10 +386,19 @@ export class TuiRuntime {
386
386
  repaint();
387
387
  this.entries.push(entry);
388
388
  this.scrollFromBottom = 0;
389
- return (chunk) => {
389
+ const append = (chunk) => {
390
390
  buf += chunk;
391
391
  repaint();
392
392
  };
393
+ // a provider retry restarts the response: remove THIS block so the
394
+ // regenerated text does not appear as a second copy of a half answer
395
+ append.drop = () => {
396
+ const i = this.entries.indexOf(entry);
397
+ if (i >= 0)
398
+ this.entries.splice(i, 1);
399
+ this.dirty = true;
400
+ };
401
+ return append;
393
402
  }
394
403
  /** Collapse a streamed thinking block to its final folded summary line. */
395
404
  foldThinking() {
@@ -1005,6 +1014,13 @@ export async function tui(yes, noWeb = false) {
1005
1014
  onLine: (l) => { if (kind === 'reasoning')
1006
1015
  rt.foldThinking(); appender = null; kind = null; rt.addText(l, 'dim'); },
1007
1016
  onDelta: (k, chunk) => {
1017
+ if (k === 'reset') {
1018
+ // provider retry after a mid-stream cut: drop the half answer
1019
+ appender?.drop?.();
1020
+ appender = null;
1021
+ kind = null;
1022
+ return;
1023
+ }
1008
1024
  if (k !== kind) {
1009
1025
  if (kind === 'reasoning')
1010
1026
  rt.foldThinking();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hmharness/cli",
3
- "version": "0.6.7",
3
+ "version": "0.6.8",
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.7",
47
- "@hmharness/evolution": "0.6.7",
48
- "@hmharness/domain-harmony": "0.6.7",
49
- "@hmharness/domain-ops": "0.6.7",
50
- "@hmharness/agent": "0.6.7",
51
- "@hmharness/web": "0.6.7"
46
+ "@hmharness/kernel": "0.6.8",
47
+ "@hmharness/evolution": "0.6.8",
48
+ "@hmharness/domain-harmony": "0.6.8",
49
+ "@hmharness/domain-ops": "0.6.8",
50
+ "@hmharness/agent": "0.6.8",
51
+ "@hmharness/web": "0.6.8"
52
52
  }
53
53
  }