@livx.cc/agentx 0.99.144 → 0.99.145

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
@@ -1,5 +1,5 @@
1
- import { c as AgentOptions, H as Hooks, x as RunResult, k as Decider, b as Agent, q as PermissionPolicy, G as Gender, L as LineKind, d as ChannelMode, y as SecondChannelOptions, S as SecondChannel } from './secondChannel--Iv3ZQ69.js';
2
- export { A as ADVISE_LIMIT, a as AdvisorSetup, C as CC_WRITE_TOOLS, e as ChatFragment, f as ChatUsage, g as Classification, h as Classifier, i as CompactResult, j as ContextFileSpec, D as DEFAULT_MUTATING, l as Decision, M as ModelRouter, m as ModelRouterOptions, P as PLANNER_BLOCKED, n as PLANNER_REFUSAL, o as PLAN_FIRST, p as PermissionOptions, r as PermissionRule, s as PreToolUseDecision, R as ReasoningEffort, t as RecordingHooks, u as RecordingLifecycle, v as RouteDecision, w as RouterState, T as Tier, z as ToolUse, B as ToolUseMeta, W as WRITE_TOOLS, E as advisorFor, F as advisorPrompt, I as ccModeOptions, J as claudeCodeDisallowedTools, K as composeHooks, N as delegatePrompt, O as delegateTools, Q as delegateWorkerFor, U as estimateTokens, V as jevAvailable, X as jevClassifier, Y as loadContextFiles, Z as loadInstructions, _ as makeAdvisor, $ as meterWorkers, a0 as pickTier, a1 as planMode, a2 as plannerBlocks, a3 as reasoningToChatFragment } from './secondChannel--Iv3ZQ69.js';
1
+ import { c as AgentOptions, H as Hooks, x as RunResult, k as Decider, b as Agent, q as PermissionPolicy, G as Gender, L as LineKind, d as ChannelMode, y as SecondChannelOptions, S as SecondChannel } from './secondChannel-BFPgXN2z.js';
2
+ export { A as ADVISE_LIMIT, a as AdvisorSetup, C as CC_WRITE_TOOLS, e as ChatFragment, f as ChatUsage, g as Classification, h as Classifier, i as CompactResult, j as ContextFileSpec, D as DEFAULT_MUTATING, l as Decision, M as ModelRouter, m as ModelRouterOptions, P as PLANNER_BLOCKED, n as PLANNER_REFUSAL, o as PLAN_FIRST, p as PermissionOptions, r as PermissionRule, s as PreToolUseDecision, R as ReasoningEffort, t as RecordingHooks, u as RecordingLifecycle, v as RouteDecision, w as RouterState, T as Tier, z as ToolUse, B as ToolUseMeta, W as WRITE_TOOLS, E as advisorFor, F as advisorPrompt, I as ccModeOptions, J as claudeCodeDisallowedTools, K as composeHooks, N as delegatePrompt, O as delegateTools, Q as delegateWorkerFor, U as estimateTokens, V as jevAvailable, X as jevClassifier, Y as loadContextFiles, Z as loadInstructions, _ as makeAdvisor, $ as meterWorkers, a0 as pickTier, a1 as planMode, a2 as plannerBlocks, a3 as reasoningToChatFragment } from './secondChannel-BFPgXN2z.js';
3
3
  export { MODEL_ALIASES, ModelSwitch, ResolveModelSwitchOpts, latestClaude, modelShortLabel, resolveModelAlias, resolveModelSwitch } from './models.js';
4
4
  import { IFilesystem, FileMetadata } from '@livx.cc/wcli/core';
5
5
  export { CommandExecutor, FileMetadata, IFilesystem, IndexedDbFilesystem, MemFilesystem, registerHeadlessCommands } from '@livx.cc/wcli/core';
package/dist/index.js CHANGED
@@ -10127,7 +10127,16 @@ function fitsLanguage(line, lang) {
10127
10127
  }
10128
10128
  var norm3 = (s) => s.toLowerCase().replace(/[^\p{L}\p{N}' ]/gu, "").replace(/\s+/g, " ").trim();
10129
10129
  function cleanLine(s, lang, maxWords = 6) {
10130
- const raw = s.trim().split("\n")[0];
10130
+ const first = s.trim().split("\n")[0];
10131
+ const tags = [...first.matchAll(LINE_TAG)].map((m) => `[${m[1].toLowerCase()}]`).filter((t, i, a) => a.indexOf(t) === i).join(" ");
10132
+ const raw = first.replace(LINE_TAG, " ").trim();
10133
+ if (tags && !/[\p{L}\p{N}]/u.test(raw)) return /laughter|gasp/.test(tags) ? tags : "";
10134
+ const words3 = cleanWords(raw, lang, maxWords);
10135
+ return words3 && tags ? `${tags} ${words3}` : words3;
10136
+ }
10137
+ var LINE_TAG = /\[(laughter|gasp|quiet)\]/gi;
10138
+ var lineWords = (line) => line.replace(LINE_TAG, " ").trim();
10139
+ function cleanWords(raw, lang, maxWords) {
10131
10140
  const l = raw.replace(/^[-*•\d.)\s]+/, "").replace(/^["'“”«»]+|["'“”«»]+$/g, "").replace(new RegExp("^\\p{L}+:\\s*", "u"), "").trim();
10132
10141
  if (!l || isLeakSuspect(raw) || isLeakSuspect(l)) {
10133
10142
  if (l) log24.debug(`line "${raw}" reads as meta \u2014 rejected`);
@@ -13660,7 +13669,7 @@ var SecondChannel = class {
13660
13669
  }
13661
13670
  if (this.o.generate && this.o.generateFor.includes(kind) && (kind !== "backchannel" || react)) {
13662
13671
  const ac = new AbortController();
13663
- const ctx = { kind, heard: this.tail(), state: this.main, avoid: [...this.recent], lang: this.lang, ...kind === "backchannel" && this.o.reactionGapMs ? { react: true } : {} };
13672
+ const ctx = { kind, heard: this.tail(), state: this.main, avoid: [...this.recent], lang: this.lang, ...kind === "backchannel" && this.o.reactionGapMs ? { react: true } : {}, ...kind === "backchannel" && this.o.mode === "live" ? { tags: true } : {} };
13664
13673
  const raw = await withBudget(this.o.generate(ctx, ac.signal), this.o.generateBudgetMs, `${kind} generate`);
13665
13674
  if (raw === null) ac.abort();
13666
13675
  const text = cleanLine(raw ?? "", this.lang);
@@ -13696,8 +13705,9 @@ var SecondChannel = class {
13696
13705
  if (kind === "backchannel") this.bcTimes.push(this.lastAt);
13697
13706
  if (kind === "bridge") this.bridged = true;
13698
13707
  this.recent = [...this.recent, text].slice(-this.o.avoidLines);
13699
- this.live = text.trim();
13700
- this.o.show(text, kind);
13708
+ this.live = lineWords(text);
13709
+ const words3 = this.live;
13710
+ if (words3) this.o.show(words3, kind);
13701
13711
  const p = Promise.resolve(r).then(() => {
13702
13712
  }, (e) => {
13703
13713
  log29.warn(`channel line playback failed: ${e?.message ?? e}`);
@@ -13737,10 +13747,12 @@ var KIND_HINT2 = {
13737
13747
  bridge: 'a neutral one-moment cue while the answer is prepared ("let me see\u2026", "one sec\u2026") \u2014 never the start of a statement or opinion ("the thing is", "well actually")'
13738
13748
  };
13739
13749
  var REACT_HINT = 'a short reaction to their LAST words instead: feeling ("oh no", "ha, nice", "ugh"), surprise ("wait, really?", "huh"), a light laugh if they joke or laugh ("ha!"), or an echo of their key word ("the deploy?") \u2014 still never asks for an answer or takes the turn; if nothing there deserves a reaction, a plain "mm-hm"';
13750
+ var TAG_HINT = 'Real listeners often react without words: the line may be, or begin with, [laughter] or [gasp], and [quiet] before words breathes them under the voice ("[gasp]", "[laughter]", "[gasp] [quiet] no way"). Use a sound when it fits what they said.';
13740
13751
  function fastLineGenerator(ai, model, gender) {
13741
13752
  return async (c, signal) => {
13742
13753
  const prompt = `You voice the tiny side-sounds of a live spoken conversation. Write ONE line of 1-5 words: ${KIND_HINT2[c.kind]}.
13743
13754
  ` + (c.react ? `Here the line may be ${REACT_HINT}.
13755
+ ` : "") + (c.tags ? `${TAG_HINT}
13744
13756
  ` : "") + `The user just said: "${c.heard}"
13745
13757
  The assistant is: ${c.state}.
13746
13758
  ` + (c.avoid.length ? `Do not reuse any of: ${c.avoid.map((a) => `"${a}"`).join(", ")}.