agent.libx.js 0.92.4 → 0.92.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.
package/cli/cli.ts CHANGED
@@ -986,7 +986,8 @@ async function repl(args: Args, ai: ChatLike, cfg: Partial<AgentConfig>, cwd: st
986
986
  // the line editor for raw stdin). Auto-deny with a narratable reason — the worker adapts or reports
987
987
  // back and the voice narrates it. Allow/deny rules (config, --allowedTools, --yes) apply as-is.
988
988
  const duplexAsk = async (call: ToolUse): Promise<{ decision: 'allow' | 'deny' }> => {
989
- err(yellow(` ⊘ worker asked to run ${call.name} — auto-denied (no interactive approval in duplex; use --yes or --allowedTools)\n`));
989
+ err('\r\x1b[0J' + yellow(` ⊘ worker asked to run ${call.name} — auto-denied (no interactive approval in duplex; use --yes or --allowedTools)\n`));
990
+ editorRef?.redrawNow(); // background event at a live prompt — repaint below the notice
990
991
  return { decision: 'deny' };
991
992
  };
992
993
  if (duplex) {
@@ -1039,6 +1040,15 @@ async function repl(args: Args, ai: ChatLike, cfg: Partial<AgentConfig>, cwd: st
1039
1040
  editorRef?.redrawNow();
1040
1041
  return;
1041
1042
  }
1043
+ // Remaining task_* events (started/progress/cancelled/error) land ASYNC at a live prompt —
1044
+ // same treatment as task_done: clear the prompt line, print, repaint (bare err() leaves
1045
+ // residue glued to 'agentx › '). task_done returned above; everything else falls through.
1046
+ if (typeof e.kind === 'string' && e.kind.startsWith('task_')) {
1047
+ spinner.stop();
1048
+ err('\r\x1b[0J' + dim(` · ${e.message}\n`));
1049
+ editorRef?.redrawNow();
1050
+ return;
1051
+ }
1042
1052
  base.notify!(e); // makeHost always provides notify (the HostBridge type just marks it optional)
1043
1053
  },
1044
1054
  };
package/dist/cli.js CHANGED
@@ -7710,8 +7710,9 @@ async function repl(args, ai, cfg, cwd) {
7710
7710
  let duplexAccount = () => {
7711
7711
  };
7712
7712
  const duplexAsk = async (call) => {
7713
- err(yellow(` \u2298 worker asked to run ${call.name} \u2014 auto-denied (no interactive approval in duplex; use --yes or --allowedTools)
7713
+ err("\r\x1B[0J" + yellow(` \u2298 worker asked to run ${call.name} \u2014 auto-denied (no interactive approval in duplex; use --yes or --allowedTools)
7714
7714
  `));
7715
+ editorRef?.redrawNow();
7715
7716
  return { decision: "deny" };
7716
7717
  };
7717
7718
  if (duplex) {
@@ -7752,6 +7753,13 @@ async function repl(args, ai, cfg, cwd) {
7752
7753
  editorRef?.redrawNow();
7753
7754
  return;
7754
7755
  }
7756
+ if (typeof e.kind === "string" && e.kind.startsWith("task_")) {
7757
+ spinner.stop();
7758
+ err("\r\x1B[0J" + dim(` \xB7 ${e.message}
7759
+ `));
7760
+ editorRef?.redrawNow();
7761
+ return;
7762
+ }
7755
7763
  base.notify(e);
7756
7764
  }
7757
7765
  };