@livx.cc/agentx 0.99.139 → 0.99.141

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-BqUiRI5w.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--Iv3ZQ69.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
@@ -13455,6 +13455,19 @@ var CHANNEL_MODES = {
13455
13455
  minGapMs: 2500,
13456
13456
  backchannelPauseMs: 500,
13457
13457
  maxPerWindow: 6
13458
+ },
13459
+ live: {
13460
+ anticipate: true,
13461
+ cueOnly: false,
13462
+ generateFor: ["backchannel", "bridge"],
13463
+ reactionGapMs: 3e3,
13464
+ generateBudgetMs: 400,
13465
+ backchannelMinWords: 3,
13466
+ shortTurnWords: 2,
13467
+ backchannelGapMs: 2e3,
13468
+ minGapMs: 1800,
13469
+ backchannelPauseMs: 350,
13470
+ maxPerWindow: 9
13458
13471
  }
13459
13472
  };
13460
13473
  var CHANNEL_MODE_NAMES = Object.keys(CHANNEL_MODES);
@@ -13466,6 +13479,8 @@ function parseChannelMode(v) {
13466
13479
  var SecondChannelOptions = class {
13467
13480
  /** Preset (CHANNEL_MODES) under the explicit options. */
13468
13481
  mode = "normal";
13482
+ /** A turn of at most this many words gets no line (a greeting / quick turn). */
13483
+ shortTurnWords = 3;
13469
13484
  /** Line kinds this channel may speak. */
13470
13485
  kinds = ["backchannel", "filler", "bridge"];
13471
13486
  /** A generated (content) backchannel needs this long since the last one; in between, canned light cues. 0 = always. */
@@ -13665,7 +13680,7 @@ var SecondChannel = class {
13665
13680
  }
13666
13681
  get o() {
13667
13682
  const o = this.options;
13668
- return o.mode !== "chatty" || o.aec ? o : { ...o, ...this.normalTiming };
13683
+ return o.mode !== "chatty" && o.mode !== "live" || o.aec ? o : { ...o, ...this.normalTiming };
13669
13684
  }
13670
13685
  /** The user's live partial for the current turn (the whole partial, not a delta). */
13671
13686
  onInterim(text) {
@@ -13860,7 +13875,7 @@ var SecondChannel = class {
13860
13875
  const w = words3(this.heard);
13861
13876
  if (!this.lang) return "silence";
13862
13877
  if (trigger === "working") return this.bridgeBlock() ? "silence" : "bridge";
13863
- if (w.length <= 3 || w.length <= 6 && isPhatic(this.heard, this.bank)) return "silence";
13878
+ if (w.length <= this.o.shortTurnWords || w.length <= 6 && isPhatic(this.heard, this.bank)) return "silence";
13864
13879
  const k = trigger === "interim" ? this.backchannelMoment(w.length, breath) && (!this.o.anticipate || !this.plan || !silentTurn(this.plan) && (!!cue || !this.o.cueOnly && this.plan.density !== "low")) ? "backchannel" : null : trigger === "pause" ? pauseMs >= this.o.fillerPauseMs && w.length >= this.o.fillerMinWords ? "filler" : null : null;
13865
13880
  return k && this.allowed(k) ? k : "silence";
13866
13881
  }
@@ -18555,16 +18570,18 @@ function createLineEditor(out, input = keyInput) {
18555
18570
  const mode = !s.searching ? inputMode(s.buf) : void 0;
18556
18571
  const vimTag = s.vim === "normal" && !s.searching && !mode ? inverse(" N ") + " " : "";
18557
18572
  const prompt = s.searching ? dim2(`(${s.searchMiss ? "failing " : ""}reverse-i-search)\`${s.searchQuery}': `) : mode ? COLOR[mode.name](`${mode.pfx} ${mode.name} \u203A `) : vimTag + promptArg;
18558
- if (curRow > 0) out.write(`\x1B[${curRow}A`);
18559
- out.write("\r\x1B[J");
18573
+ const EOL = "\x1B[K";
18574
+ let frame = "\x1B[?2026h";
18575
+ if (curRow > 0) frame += `\x1B[${curRow}A`;
18576
+ frame += "\r";
18560
18577
  const rawBuf = mode ? s.buf.slice(mode.pfx.length) : s.buf;
18561
18578
  const rawCursor = mode ? Math.max(0, s.cursor - mode.pfx.length) : s.cursor;
18562
18579
  const { text: viewBuf, cursor: viewCursor } = appBidi() ? applyBidi(rawBuf, rawCursor) : { text: rawBuf, cursor: rawCursor };
18563
18580
  const { rows, cursorRow, cursorCol } = wrapLayout(visibleWidth(prompt), viewBuf, viewCursor, cols);
18564
18581
  const ghost = !mode && !s.searching ? s.ghost() : "";
18565
18582
  const ghostFits = ghost && rows.length === 1 && visibleWidth(prompt) + viewBuf.length + ghost.length < cols;
18566
- out.write(prompt + (rows[0] ?? "") + (ghostFits ? dim2(ghost) : ""));
18567
- for (let i = 1; i < rows.length; i++) out.write("\r\n" + rows[i]);
18583
+ frame += prompt + (rows[0] ?? "") + (ghostFits ? dim2(ghost) : "") + EOL;
18584
+ for (let i = 1; i < rows.length; i++) frame += "\r\n" + rows[i] + EOL;
18568
18585
  const inputRows = rows.length - 1;
18569
18586
  let menuRows = 0;
18570
18587
  if (s.menuOpen && s.hits.length) {
@@ -18574,7 +18591,7 @@ function createLineEditor(out, input = keyInput) {
18574
18591
  const d = s.describe?.(hit);
18575
18592
  let label = ` ${hit}${d ? " " + d : ""}`;
18576
18593
  if (visibleWidth(label) > cols - 1) label = label.slice(0, cols - 2) + "\u2026";
18577
- out.write("\r\n" + (i === s.sel ? inverse(label) : dim2(label)));
18594
+ frame += "\r\n" + (i === s.sel ? inverse(label) : dim2(label)) + EOL;
18578
18595
  menuRows++;
18579
18596
  }
18580
18597
  }
@@ -18583,14 +18600,16 @@ function createLineEditor(out, input = keyInput) {
18583
18600
  if (footer) {
18584
18601
  for (const line of footer.split("\n")) {
18585
18602
  const f = visibleWidth(line) > cols - 1 ? line.slice(0, cols - 2) + "\u2026" : line;
18586
- out.write("\r\n" + dim2(f));
18603
+ frame += "\r\n" + dim2(f) + EOL;
18587
18604
  footerRows++;
18588
18605
  }
18589
18606
  }
18590
18607
  const up = inputRows + menuRows + footerRows - cursorRow;
18591
- if (up > 0) out.write(`\x1B[${up}A`);
18592
- out.write("\r");
18593
- if (cursorCol > 0) out.write(`\x1B[${cursorCol}C`);
18608
+ frame += "\x1B[J";
18609
+ if (up > 0) frame += `\x1B[${up}A`;
18610
+ frame += "\r";
18611
+ if (cursorCol > 0) frame += `\x1B[${cursorCol}C`;
18612
+ out.write(frame + "\x1B[?2026l");
18594
18613
  curRow = cursorRow;
18595
18614
  }
18596
18615
  function externalEdit(s) {