@livx.cc/agentx 0.99.164 → 0.99.165

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
@@ -5340,12 +5340,17 @@ var Agent = class _Agent {
5340
5340
  * No model call; the transcript gains only that system message. Other models: nothing to warm. */
5341
5341
  async prewarm() {
5342
5342
  const o = this.options;
5343
- if (!o.model.startsWith("claude-code/") || !o.providerOptions?.claudeCodeSession) return;
5343
+ const api = o.model.startsWith("anthropic/") && o.promptCache;
5344
+ if (!api && (!o.model.startsWith("claude-code/") || !o.providerOptions?.claudeCodeSession)) return;
5344
5345
  await this.ensureFs();
5345
5346
  const systemPrompt = await this.prepare(), startCtx = await this.fireSessionStart();
5346
5347
  const sys = { role: "system", content: systemPrompt + (startCtx ? "\n\n" + startCtx : "") };
5347
5348
  if (this.transcript[0]?.role === "system") this.transcript[0] = sys;
5348
5349
  else this.transcript.unshift(sys);
5350
+ if (api) {
5351
+ await o.ai.chat({ model: o.model, messages: [sys, { role: "user", content: "." }], tools: toWireTools(this.activeTools), stream: false, maxTokens: 1, promptCache: true, ...o.providerOptions ? { providerOptions: o.providerOptions } : {} });
5352
+ return;
5353
+ }
5349
5354
  const po = this.claudeCodePo(), frag = reasoningToChatFragment(o.model, o.reasoning);
5350
5355
  const r = await o.ai.chat({ model: o.model, messages: this.trimContext(), tools: [], stream: true, ...frag, ...o.promptCache ? { promptCache: true } : {}, providerOptions: { ...frag.providerOptions, ...o.providerOptions, ...po, prewarm: true } });
5351
5356
  for await (const _ of r) {
@@ -10687,6 +10692,8 @@ var REACT = /^(?:(?:oh|and|so|wait|but|ok|okay|yeah)\s+)*(?:wow|whoa|woah|really
10687
10692
  var WH_LEAD = "^(?:(?:oh|and|so|wait|but|ok|okay|um|uh|sorry)\\s+)*";
10688
10693
  var WH_QUESTION = new RegExp(WH_LEAD + "(?:who|whom|whose|where|which|why|how|when|what|\u05DE\u05D9|\u05D0\u05D9\u05E4\u05D4|\u05DC\u05DE\u05D4|\u05D0\u05D9\u05DA|\u05DE\u05EA\u05D9|\u05DE\u05D4)\\s+\\S", "u");
10689
10694
  var WH_EXCLAIM = new RegExp(WH_LEAD + "(?:what an? |how (?:cool|nice|fun|sweet|sad|funny|weird|crazy|strange|interesting|beautiful|lovely|cute|amazing|awesome)\\b)", "u");
10695
+ var BARE = /* @__PURE__ */ new Set(["yeah", "yea", "yes", "yep", "yup", "ok", "okay", "k", "right", "sure", "mm", "mmm", "hmm", "mhm", "mm-hm", "mm-hmm", "uh-huh", "um", "uh", "ah", "oh"]);
10696
+ var isBareCue = (text) => BARE.has(norm2(text).replace(/^-+|-+$/g, ""));
10690
10697
  var isReaction = (text) => {
10691
10698
  const t = norm2(text);
10692
10699
  return REACT.test(t) || new RegExp("\\s\\p{L}{1,3}$", "u").test(t) && REACT.test(t.replace(new RegExp("\\s\\p{L}{1,3}$", "u"), ""));
@@ -16075,6 +16082,10 @@ var VoiceCall = class {
16075
16082
  this.barge();
16076
16083
  return "cut";
16077
16084
  }
16085
+ if (isBareCue(text)) {
16086
+ this.o.onMetric({ name: "drop", kind: "bare cue", text });
16087
+ return "keep";
16088
+ }
16078
16089
  if (this.o.mode === "live" && isReaction(text)) return this.kept(text), "keep";
16079
16090
  const d = await this.judge.judge(text);
16080
16091
  if (d.verdict === "cut") this.barge();
@@ -16119,7 +16130,7 @@ var VoiceCall = class {
16119
16130
  * fill line: never MAIN history. */
16120
16131
  aside(text) {
16121
16132
  const now4 = this.o.now();
16122
- if (now4 - this.lastAside.at < this.o.asideGapMs) return null;
16133
+ if (isBareCue(text) || now4 - this.lastAside.at < this.o.asideGapMs) return null;
16123
16134
  const line = overlapAside(text, this.lang, this.lastAside.text, void 0, this.o.mode === "live");
16124
16135
  if (!line) return null;
16125
16136
  this.lastAside = { text: line, at: now4 };
@@ -16158,7 +16169,10 @@ var VoiceCall = class {
16158
16169
  onTurn(t) {
16159
16170
  this.floor = "";
16160
16171
  this.flushKept(t.text);
16161
- if (this.o.noteTurn && this.o.workReply && t.kind !== "replace" && this.working && !isClosing(t.text)) return void this.overWork(this.cur, t);
16172
+ if (this.o.noteTurn && this.o.workReply && t.kind !== "replace" && this.working && !isClosing(t.text)) {
16173
+ if (isBareCue(t.text)) return void this.o.onMetric({ name: "drop", id: t.id, kind: "bare cue", text: t.text });
16174
+ return void this.overWork(this.cur, t);
16175
+ }
16162
16176
  const prev = this.cur, quick = this.quickOn && !this.working && (t.kind === "new" || prev?.lane !== "deep");
16163
16177
  const now4 = this.o.now(), lastWord = this.lastWordAt !== null;
16164
16178
  const at = this.lastWordAt ?? this.firstFinalAt ?? now4;
@@ -18748,7 +18762,7 @@ They just said: "${c.heard}"
18748
18762
  Reply with exactly ONE line, one of:
18749
18763
  BYE: <a short farewell> \u2014 they mean to end the call ("no, thank you, bye", "okay, talk later"): the call hangs up after it. Judge the intent: "say bye to Dan" or "before I go, one more thing" is not an end.
18750
18764
  SAY: <your words> \u2014 ONLY a greeting or how-are-you, a short reaction ("wow", "really?"), or when they ask exactly to repeat something ALREADY said ("say that again", "which one was that?"). Any request ("tell me a story\u2026"), any question about content ("what is\u2026?", "wait, what?", "how long is it?") is DEEP, even if you could guess${c.rest ? " (or CLARIFY, below)" : ""}. Max two short sentences. Use only facts from the call above; never invent a name, number, news item or result.
18751
- DEEP: <a 2-8 word acknowledgement> | <what the colleague must do, names spelled right> \u2014 anything needing a lookup, current information, tools, files, or real thinking. The acknowledgement is your natural first reaction to THIS kind of ask, in your own voice: ${tools ? `a lookup says you're on it and names what you'll look at ("Sure, let me pull up the kitty changelog."); ` : `never say you will check, look up, pull up, find or fetch anything \u2014 nothing can be; a question gets a short thinking reaction ("Hmm, okay\u2026", "Right, so\u2026"); `}a story, joke or idea gets a reaction to the idea itself (a story about a dragon: "Ooh, a dragon story, okay\u2026"); a question about what was said gets a short "ah"-type reaction ("Ah, good question."). Say "checking" or "looking" only when something is actually looked up. Never a result. The speech-to-text misspells names: fix them from context ("Haka News" \u2192 Hacker News).
18765
+ DEEP: <a 2-8 word acknowledgement> | <what the colleague must do, names spelled right> \u2014 anything needing a lookup, current information, tools, files, or real thinking. The acknowledgement is your natural first reaction to THIS kind of ask, in your own voice: ${tools ? `an ask that needs current or outside information (news, weather, prices, a site, a file) says you're on it and names what you'll look at ("Sure, let me pull up the kitty changelog."); a question the colleague simply knows (a fact, a tip, a recommendation, a sum) is NOT a lookup: a short thinking reaction ("Hmm, good one\u2026", "Ooh, let me think\u2026"), never "let me check / look up" for it; ` : `never say you will check, look up, pull up, find or fetch anything \u2014 nothing can be; a question gets a short thinking reaction ("Hmm, okay\u2026", "Right, so\u2026"); `}a story, joke or idea gets a reaction to the idea itself (a story about a dragon: "Ooh, a dragon story, okay\u2026"); a question about what was said gets a short "ah"-type reaction ("Ah, good question."). Say "checking" or "looking" only when something is actually looked up. Never a result. The speech-to-text misspells names: fix them from context ("Haka News" \u2192 Hacker News).
18752
18766
  ` + (c.rest ? `CLARIFY: <one short answer> | <the exact words of your cut answer or its rest that answer it, copied verbatim> \u2014 they cut your answer to ask a quick question ABOUT it ("who?", "where do they sit?", "which one?") that your words above or the unsaid rest already answer. Find the exact span first, then answer from it only; your cut answer then goes on by itself. A new request, a change of topic, or a question those words do not answer is DEEP.
18753
18767
  ` : "") + `QUIET \u2014 nothing is owed: a bare "okay", "mm-hm", or a reaction you already answered.
18754
18768
  "Wait" / "hold on" with nothing new: a brief SAY ("Sure.") \u2014 no work for the colleague. Vary your words: never reuse an acknowledgement or reaction already said in this call.