@livx.cc/agentx 0.99.9 → 0.99.10

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/dist/cli.js CHANGED
@@ -12829,6 +12829,14 @@ async function repl(args, ai, cfg, cwd) {
12829
12829
  voiceLineOpen = false;
12830
12830
  }
12831
12831
  };
12832
+ const showReasoning = process.env.VOICE_SHOW_REASONING === "1";
12833
+ let voiceReasonOpen = false;
12834
+ const voiceReasonEnd = () => {
12835
+ if (voiceReasonOpen) {
12836
+ err("\n");
12837
+ voiceReasonOpen = false;
12838
+ }
12839
+ };
12832
12840
  let toggleVoice;
12833
12841
  let editorRef;
12834
12842
  let repaintStash = () => {
@@ -12885,13 +12893,25 @@ async function repl(args, ai, cfg, cwd) {
12885
12893
  const host = {
12886
12894
  ...base,
12887
12895
  notify(e) {
12888
- if (voiceIO && (e.kind === "thinking_delta" || e.kind === "turn_start")) return;
12896
+ if (voiceIO && e.kind === "turn_start") return;
12897
+ if (voiceIO && e.kind === "thinking_delta") {
12898
+ if (!showReasoning || typeof e.message !== "string") return;
12899
+ spinner.stop();
12900
+ editorRef?.suspend();
12901
+ if (!voiceReasonOpen) {
12902
+ err(dim(" \u{1F4AD} "));
12903
+ voiceReasonOpen = true;
12904
+ }
12905
+ err(dim(e.message.replace(/\s*\n\s*/g, " ")));
12906
+ return;
12907
+ }
12889
12908
  if (e.kind === "diag") {
12890
12909
  voiceDiag?.push({ t: performance.now(), kind: String(e.message), ...e.data ?? {} });
12891
12910
  return;
12892
12911
  }
12893
12912
  if (e.kind === "speak_utterance") {
12894
12913
  if (voiceIO) {
12914
+ voiceReasonEnd();
12895
12915
  spinner.stop();
12896
12916
  voiceIO.enqueueUtterance(e.message);
12897
12917
  editorRef?.suspend();
@@ -12908,6 +12928,7 @@ async function repl(args, ai, cfg, cwd) {
12908
12928
  return;
12909
12929
  }
12910
12930
  if (e.kind === "text_delta" && voiceIO) {
12931
+ voiceReasonEnd();
12911
12932
  spinner.stop();
12912
12933
  const echo = voiceIO.speakDelta(e.message);
12913
12934
  editorRef?.suspend();
@@ -13357,6 +13378,7 @@ ${task}`;
13357
13378
  }
13358
13379
  const r = await runTurn(face, store, session, task, duplex ? void 0 : checkpoints, cwd, sendVia);
13359
13380
  if (voiceIO) {
13381
+ voiceReasonEnd();
13360
13382
  voiceEchoEnd();
13361
13383
  editorRef?.resume();
13362
13384
  }
@@ -14636,6 +14658,7 @@ ${out}
14636
14658
  onBargeIn: (phase) => {
14637
14659
  activeTurn?.abort();
14638
14660
  dx?.parkInFlightDeliveries();
14661
+ voiceReasonEnd();
14639
14662
  voiceEchoEnd();
14640
14663
  if (phase === "speaking") err("\r\x1B[0J" + yellow(" \u270B interrupted\n"));
14641
14664
  },