@livx.cc/agentx 0.99.150 → 0.99.151

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.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env bun
2
- import { w as RouterState, H as Hooks, c as AgentOptions, x as RunResult, f as ChatUsage, R as ReasoningEffort, d as ChannelMode, b as Agent } from './secondChannel-CJ1eYZKA.js';
2
+ import { w as RouterState, H as Hooks, c as AgentOptions, x as RunResult, f as ChatUsage, R as ReasoningEffort, d as ChannelMode, b as Agent } from './secondChannel--iqPHPO_.js';
3
3
  import { IFilesystem } from '@livx.cc/wcli/core';
4
4
  import { M as Message, U as UserQuestion, H as HostBridge, c as ContentPart, o as MessageContent } from './tools-DwfeF8VQ.js';
5
5
 
package/dist/cli.js CHANGED
@@ -14710,6 +14710,8 @@ var SecondChannel = class {
14710
14710
  // live: that draft settled
14711
14711
  askLeaf = null;
14712
14712
  // live: this turn's ask leaf
14713
+ barged = false;
14714
+ // the user cut in since their last turn: that turn is a steer, not a story to react to
14713
14715
  leafReady = Promise.resolve();
14714
14716
  // live: the turn-end leaf pick settled
14715
14717
  recent = [];
@@ -14924,9 +14926,11 @@ var SecondChannel = class {
14924
14926
  this.detect(this.heard);
14925
14927
  this.main = "idle";
14926
14928
  this.onAgentState("queued");
14929
+ const steer = this.barged;
14930
+ this.barged = false;
14927
14931
  if (this.tree) {
14928
14932
  this.noteTalk("them", this.heard);
14929
- this.leafReady = this.turnEndLeaf();
14933
+ this.leafReady = this.turnEndLeaf(steer);
14930
14934
  }
14931
14935
  }
14932
14936
  /** The main answer's streamed text (before its audio): channel-1 is responding — no bridge from here on. */
@@ -14941,6 +14945,7 @@ var SecondChannel = class {
14941
14945
  /** The user barged in: cut the in-flight line now and drop every pending decision. */
14942
14946
  onBargeIn() {
14943
14947
  this.gen++;
14948
+ this.barged = true;
14944
14949
  this.cutLine = this.inflight || this.live ? this.live : null;
14945
14950
  if (this.inflight) {
14946
14951
  this.inflight = null;
@@ -15098,7 +15103,7 @@ var SecondChannel = class {
15098
15103
  }
15099
15104
  /** The user's turn went to MAIN: the armed leaf at once, else the quick model may name one in time. It plays only while
15100
15105
  * MAIN is still silent, as the turn's first sound. */
15101
- async turnEndLeaf() {
15106
+ async turnEndLeaf(steer = false) {
15102
15107
  const tree = this.tree, gen = this.gen, heard = this.heard;
15103
15108
  let hit = tree.turnLeaf();
15104
15109
  if (!hit && this.o.pickLeaf && !tree.empty) {
@@ -15111,6 +15116,7 @@ var SecondChannel = class {
15111
15116
  if (gen === this.gen && echoesHeard(hit.node.line, heard)) this.askLeaf = { gen, text: hit.node.line };
15112
15117
  return;
15113
15118
  }
15119
+ if (hit && steer) return;
15114
15120
  if (hit && gen === this.gen && (this.main === "queued" || this.main === "thinking")) {
15115
15121
  this.playLeaf(hit, "working", "bridge");
15116
15122
  if (this.lastKind === "bridge" && this.bridged) {
@@ -15794,7 +15800,9 @@ var VoiceCall = class {
15794
15800
  log30.warn(`work reply failed \u2014 MAIN only: ${e?.message ?? e}`);
15795
15801
  return "";
15796
15802
  }).finally(() => clearTimeout(late)) : "";
15797
- const ack = workAck(raw, lang ?? "", this.o.gender), line = cleanWorkReply(raw, lang ?? "") || ack, stop = /^\s*stop\s*:/i.test(raw), change = !line || /^\s*work\s*:/i.test(raw);
15803
+ const own = cleanWorkReply(raw, lang ?? ""), answer = own || workAck(raw, lang ?? "", this.o.gender);
15804
+ const line = own || (this.o.mode === "live" ? "" : answer);
15805
+ const stop = /^\s*stop\s*:/i.test(raw), change = !answer || /^\s*work\s*:/i.test(raw);
15798
15806
  const noted = `[The user said this on the call while you worked: "${t.text}".${line ? ` You answered aloud: "${line}".` : ""}${stop ? " That stopped the work." : ""} Take it into account; do not answer it again.]`;
15799
15807
  if (line && !this.ended) {
15800
15808
  for (let i = 0; i < 8 && this.say(line, "aside") === false; i++) {