@livx.cc/agentx 0.99.142 → 0.99.143

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/index.d.ts CHANGED
@@ -959,6 +959,8 @@ interface GateTurn {
959
959
  type GateDrop = 'empty' | 'dupe' | 'stale' | 'goodbye';
960
960
  declare class TurnGateOptions {
961
961
  holdMs: number;
962
+ /** A finished statement (not a question) waits this long for more speech before it is a turn. 0 = sent at once. */
963
+ settleMs: number;
962
964
  /** An identical final within this window is a duplicate. */
963
965
  dupWindowMs: number;
964
966
  /** A fuller final within this window of the last turn (or with its sttId) is a re-final of it. */
package/dist/index.js CHANGED
@@ -10338,6 +10338,8 @@ function isClosing(text) {
10338
10338
  }
10339
10339
  var TurnGateOptions = class {
10340
10340
  holdMs = 1200;
10341
+ /** A finished statement (not a question) waits this long for more speech before it is a turn. 0 = sent at once. */
10342
+ settleMs = 0;
10341
10343
  /** An identical final within this window is a duplicate. */
10342
10344
  dupWindowMs = 5e3;
10343
10345
  /** A fuller final within this window of the last turn (or with its sttId) is a re-final of it. */
@@ -10396,8 +10398,10 @@ var TurnGate = class {
10396
10398
  if (sameStt || age < this.o.refinalWindowMs && key.startsWith(last.key + " ")) return this.refinal(last, t, key, sttId);
10397
10399
  }
10398
10400
  if (this.closed && isClosing(t)) return this.o.onDrop(t, "goodbye");
10399
- if (endsMidPhrase(t)) {
10400
- this.held = { text: t, sttId, timer: setTimeout(() => this.flush(), this.o.holdMs) };
10401
+ const mid = endsMidPhrase(t);
10402
+ if (mid || this.o.settleMs && !/\?["')\]]*$/.test(t)) {
10403
+ const ms = mid ? this.o.holdMs : this.o.settleMs;
10404
+ this.held = { text: t, sttId, ms, timer: setTimeout(() => this.flush(), ms) };
10401
10405
  return this.o.onHold(t);
10402
10406
  }
10403
10407
  this.send(t, key, sttId, "new");
@@ -10406,7 +10410,7 @@ var TurnGate = class {
10406
10410
  speaking() {
10407
10411
  if (!this.held) return;
10408
10412
  clearTimeout(this.held.timer);
10409
- this.held.timer = setTimeout(() => this.flush(), this.o.holdMs);
10413
+ this.held.timer = setTimeout(() => this.flush(), this.held.ms);
10410
10414
  }
10411
10415
  /** MAIN started replying to turn `id` (its first text/tool/audio): a later re-final only adds its new words. */
10412
10416
  replyStarted(id) {
@@ -13134,7 +13138,7 @@ var CHANNEL_MODES = {
13134
13138
  anticipate: true,
13135
13139
  cueOnly: false,
13136
13140
  generateFor: ["backchannel"],
13137
- reactionGapMs: 3e3,
13141
+ reactionGapMs: 0,
13138
13142
  generateBudgetMs: 400,
13139
13143
  backchannelMinWords: 3,
13140
13144
  shortTurnWords: 2,
@@ -13833,6 +13837,7 @@ var VoiceCall = class {
13833
13837
  this.judge = new OverlapJudge({ ...ai ? { model: overlapModelFor(ai) } : {}, now: o.now });
13834
13838
  this.gate = new TurnGate({
13835
13839
  now: o.now,
13840
+ ...o.mode === "live" ? { settleMs: 700 } : {},
13836
13841
  ...o.gate,
13837
13842
  onTurn: (t) => this.onTurn(t),
13838
13843
  onDrop: (text, why) => this.onDrop(text, why),