@livx.cc/agentx 0.97.5 → 0.97.7

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
@@ -4585,6 +4585,8 @@ init_logging();
4585
4585
  // src/voice/spokenSplitter.ts
4586
4586
  var OPEN = "<spoken>";
4587
4587
  var CLOSE = "</spoken>";
4588
+ var CLOSERS = `"')]}\xBB\u201D\u2019`;
4589
+ var hasSpeech = (s) => /[\p{L}\p{N}]/u.test(s);
4588
4590
  var SentenceCoalescer = class _SentenceCoalescer {
4589
4591
  buf = "";
4590
4592
  static isEnd(c) {
@@ -4595,14 +4597,15 @@ var SentenceCoalescer = class _SentenceCoalescer {
4595
4597
  let cut = -1;
4596
4598
  for (let i = 0; i < this.buf.length; i++) if (_SentenceCoalescer.isEnd(this.buf[i])) cut = i;
4597
4599
  if (cut < 0) return "";
4600
+ if (this.buf[cut] !== "\n") while (cut + 1 < this.buf.length && CLOSERS.includes(this.buf[cut + 1])) cut++;
4598
4601
  const ready = this.buf.slice(0, cut + 1).trim();
4599
4602
  this.buf = this.buf.slice(cut + 1);
4600
- return ready;
4603
+ return hasSpeech(ready) ? ready : "";
4601
4604
  }
4602
4605
  flush() {
4603
4606
  const s = this.buf.trim();
4604
4607
  this.buf = "";
4605
- return s;
4608
+ return hasSpeech(s) ? s : "";
4606
4609
  }
4607
4610
  };
4608
4611
  var SpokenSplitter = class {
@@ -5822,7 +5825,7 @@ var VoiceEngine = class _VoiceEngine {
5822
5825
  * If nothing is currently speaking it plays immediately; otherwise it queues and plays after the
5823
5826
  * current utterance fully ends (settle → pumpQueue) — never spliced into an open reflex utterance. */
5824
5827
  enqueueUtterance(text) {
5825
- if (!text || !text.trim()) return;
5828
+ if (!text || !/[\p{L}\p{N}]/u.test(text)) return;
5826
5829
  this.uttQueue.push(text);
5827
5830
  if (!this.speaking) this.pumpQueue();
5828
5831
  }