@livx.cc/agentx 0.99.152 → 0.99.153
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 +1 -1
- package/dist/cli.js +75 -22
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.js +40 -15
- package/dist/index.js.map +1 -1
- package/dist/{secondChannel-BVmp2lze.d.ts → secondChannel-CR3xWWB_.d.ts} +7 -1
- package/package.json +1 -1
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-
|
|
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-
|
|
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-CR3xWWB_.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-CR3xWWB_.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';
|
|
@@ -1795,6 +1795,9 @@ declare class VoiceCallOptions {
|
|
|
1795
1795
|
* runs as MAIN's next turn. Not injected mid-run: that makes MAIN run again just to hear a remark. Absent: such a line
|
|
1796
1796
|
* barges in as before. */
|
|
1797
1797
|
noteTurn?: (note: string) => void;
|
|
1798
|
+
/** What the user HEARD of MAIN's reply a barge just cut (a peek — the host still takes the cut for MAIN), else null:
|
|
1799
|
+
* a live bridge echoes what their "that" points at. */
|
|
1800
|
+
heardCut?: () => string | null;
|
|
1798
1801
|
/** Writes that immediate answer (fastWorkReply). */
|
|
1799
1802
|
workReply?: WorkReply;
|
|
1800
1803
|
workReplyBudgetMs: number;
|
package/dist/index.js
CHANGED
|
@@ -10589,13 +10589,17 @@ var INTENT_ACK_OVER = {
|
|
|
10589
10589
|
resume: ["agreement", "silent"],
|
|
10590
10590
|
aside: []
|
|
10591
10591
|
};
|
|
10592
|
-
function
|
|
10592
|
+
function heardAt(cut) {
|
|
10593
|
+
const at = Math.min(cut.heard.length, cut.full.length);
|
|
10594
|
+
return /\S/.test(cut.full[at] ?? "") && /\S/.test(cut.full[at - 1] ?? "") ? cut.full.lastIndexOf(" ", at) + 1 : at;
|
|
10595
|
+
}
|
|
10596
|
+
function interruptionNote(cut, intent, hold = true) {
|
|
10593
10597
|
const full = cut.full.trim();
|
|
10594
|
-
|
|
10595
|
-
if (/\S/.test(cut.full[at] ?? "") && /\S/.test(cut.full[at - 1] ?? "")) at = cut.full.lastIndexOf(" ", at) + 1;
|
|
10598
|
+
const at = heardAt(cut);
|
|
10596
10599
|
const heardWords = cut.full.slice(0, at).trim().split(/\s+/).filter(Boolean).length;
|
|
10597
10600
|
const unheard = cut.full.slice(at).trim();
|
|
10598
|
-
const
|
|
10601
|
+
const lastWords = cut.full.slice(0, at).trim().split(/\s+/).slice(-8).join(" ");
|
|
10602
|
+
const landed = heardWords < 4 ? "They cut in almost at once \u2014 treat all of it as unsaid." : `They heard everything before this part. They missed the rest of it: "${unheard}". The last words they heard were "\u2026${lastWords}" \u2014 a "that"/"it"/"this" in their words means the thing those words were naming, never anything in the missed part.`;
|
|
10599
10603
|
const how = {
|
|
10600
10604
|
resume: "They did not ask anything new. Carry on with the part they missed \u2014 no restart, no apology.",
|
|
10601
10605
|
aside: "It was an aside. Answer it briefly FIRST, then finish the part they missed, adjusted to anything they just said. Say each point once: skip whatever they already heard and whatever your answer just covered.",
|
|
@@ -10604,7 +10608,7 @@ function interruptionNote(cut, intent) {
|
|
|
10604
10608
|
unknown: "Decide like a person would: if it was an aside, answer it and then finish your point; if they steered away, follow them and drop or adapt the rest."
|
|
10605
10609
|
};
|
|
10606
10610
|
return `
|
|
10607
|
-
[the user interrupted you mid-speech. You were saying: "${full}" ${landed} ${how[intent ?? "unknown"]} Just talk, like a person picking the thread back up: never tell them what they heard or missed, never say where you were cut off, and never quote your earlier words back
|
|
10611
|
+
[the user interrupted you mid-speech. You were saying: "${full}" ${landed} ${how[intent ?? "unknown"]} Just talk, like a person picking the thread back up: never tell them what they heard or missed, never say where you were cut off, and never quote your earlier words back.` + (hold ? " If their words are still an unfinished fragment, call Hold instead of answering." : "") + "]";
|
|
10608
10612
|
}
|
|
10609
10613
|
|
|
10610
10614
|
// src/voice/unsaid.ts
|
|
@@ -13816,9 +13820,12 @@ var SOFT_CUE = "~";
|
|
|
13816
13820
|
var STOP4 = new Set("about after again also always been before being could does doing down even every from going have here into just know like look make many more most much must never only other over really right same should some still such sure take than that their them then there these they thing think this those through very want well were what when where which while will with would your yeah okay".split(" "));
|
|
13817
13821
|
var isContent = (w) => w.length >= 4 && !STOP4.has(w);
|
|
13818
13822
|
function echoesHeard(line, heard) {
|
|
13819
|
-
const said =
|
|
13820
|
-
return cueWords(lineWords(line)).some((w) =>
|
|
13823
|
+
const said = cueWords(heard).map(stem).filter(echoable);
|
|
13824
|
+
return cueWords(lineWords(line)).map(stem).filter(echoable).some((w) => said.some((h) => h === w || Math.min(h.length, w.length) >= 4 && (h.startsWith(w) || w.startsWith(h))));
|
|
13821
13825
|
}
|
|
13826
|
+
var stem = (w) => w.replace(/['’]s$/, "").replace(new RegExp("(?<=\\p{L}{3})s$", "u"), "");
|
|
13827
|
+
var SHORT_STOP = new Set("the and you are was for not but has had his her its our who why how can did get got let may one out see she two use way yes all any new now off old own say too him hey huh ooh wow yep".split(" "));
|
|
13828
|
+
var echoable = (w) => isContent(w) || w.length === 3 && !SHORT_STOP.has(w) && !new RegExp("^\\p{N}+$", "u").test(w);
|
|
13822
13829
|
var leafKey = (line) => cueWords(lineWords(line)).join(" ");
|
|
13823
13830
|
var ConvoTreeOptions = class {
|
|
13824
13831
|
/** A leaf plays at this confidence or above. */
|
|
@@ -14344,6 +14351,8 @@ var SecondChannel = class {
|
|
|
14344
14351
|
// live: this turn's ask leaf
|
|
14345
14352
|
barged = false;
|
|
14346
14353
|
// the user cut in since their last turn: that turn is a steer, not a story to react to
|
|
14354
|
+
said = "";
|
|
14355
|
+
// live: what the user heard the assistant say last (the cut's heard part, else the last reply)
|
|
14347
14356
|
leafReady = Promise.resolve();
|
|
14348
14357
|
// live: the turn-end leaf pick settled
|
|
14349
14358
|
recent = [];
|
|
@@ -14560,8 +14569,9 @@ var SecondChannel = class {
|
|
|
14560
14569
|
}
|
|
14561
14570
|
}
|
|
14562
14571
|
/** The user's final line was dispatched to the main agent (its words are the bridge's micro-context). */
|
|
14563
|
-
onUserTurn(text, lastWordAgoMs = 0) {
|
|
14572
|
+
onUserTurn(text, lastWordAgoMs = 0, heardCut) {
|
|
14564
14573
|
this.heard = text.trim();
|
|
14574
|
+
this.said = (heardCut ?? this.reply).trim();
|
|
14565
14575
|
this.lastWordAgo = Math.max(0, lastWordAgoMs);
|
|
14566
14576
|
this.floorWords = this.carried + words2(this.heard).length;
|
|
14567
14577
|
this.lastUser = this.heard;
|
|
@@ -14868,12 +14878,14 @@ var SecondChannel = class {
|
|
|
14868
14878
|
this.bridgeReady = Promise.resolve();
|
|
14869
14879
|
this.noLine = "";
|
|
14870
14880
|
if (!this.o.generate || !(this.ownWords || this.o.generateFor.includes("bridge")) || !this.lang || !this.heard) return;
|
|
14871
|
-
const gen = this.gen, ac = new AbortController(), own = this.ownWords
|
|
14872
|
-
const
|
|
14881
|
+
const gen = this.gen, ac = new AbortController(), own = this.ownWords;
|
|
14882
|
+
const said = own ? words2(this.said.replace(/\[[^\]]*\]/g, " ")).slice(-this.o.microWords).join(" ") : "", heard = `${this.heard} ${said}`;
|
|
14883
|
+
const ctx = { kind: "bridge", heard: this.tail(), state: this.main, avoid: [...this.recent], lang: this.lang, ...own ? { ask: true } : {}, ...said ? { said, cut: this.barged } : {} };
|
|
14884
|
+
log31.debug(`bridge ctx: said=${JSON.stringify(ctx.said ?? "")} cut=${!!ctx.cut}`);
|
|
14873
14885
|
this.bridgeReady = withBudget(this.o.generate(ctx, ac.signal), own ? this.o.bridgeBudgetMs : Math.max(this.o.generateBudgetMs, this.o.bridgeDelayMs), "bridge generate", ac).then((raw) => {
|
|
14874
14886
|
const none = own && /^\s*none\b/i.test(raw ?? ""), text = none ? "" : cleanLine(raw ?? "", ctx.lang), echoes = !own || echoesHeard(text, heard);
|
|
14875
14887
|
if (text && gen === this.gen && echoes) this.bridgeDraft = { gen, text };
|
|
14876
|
-
else if (gen === this.gen) this.noLine = raw === null ? "fast model late or failed" : none ? "fast model: none" : !text ? "fast model line unusable" :
|
|
14888
|
+
else if (gen === this.gen) this.noLine = raw === null ? "fast model late or failed" : none ? "fast model: none" : !text ? "fast model line unusable" : `line names nothing heard: "${text}"`;
|
|
14877
14889
|
}).catch((e) => log31.debug(`bridge prefetch failed: ${e?.message ?? e}`));
|
|
14878
14890
|
}
|
|
14879
14891
|
async line(kind, react = true) {
|
|
@@ -14977,11 +14989,21 @@ var KIND_HINT2 = {
|
|
|
14977
14989
|
};
|
|
14978
14990
|
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"';
|
|
14979
14991
|
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.';
|
|
14992
|
+
function askPrompt(c, gender) {
|
|
14993
|
+
const last = c.said ? c.said.split(/(?<=[.!?])\s+/).filter((x) => /\w/.test(x)).pop() : "";
|
|
14994
|
+
const said = !c.said ? "" : c.cut ? `You (the assistant) were saying: "\u2026${c.said}" \u2014 they cut you off there, so the last thing they heard was "${last}". Their "that"/"it" means THAT last thing.
|
|
14995
|
+
` : `You (the assistant) last said: "\u2026${c.said}"
|
|
14996
|
+
`;
|
|
14997
|
+
return `A live voice call. ${said}The user just said: "${c.heard}"
|
|
14998
|
+
Your full answer takes a few seconds. Write ONE spoken line of 2-5 words in ${languageName(c.lang)} to say at once, in their or your own words:
|
|
14999
|
+
- they ask you to look up, check, find or do something \u2192 name the thing and say you are on it ("Hacker News, one sec.")
|
|
15000
|
+
- they ask about something you said ("that", "it", "who", "why") \u2192 echo the thing they mean as a short question ("the OpenAI one?", "the Postman thing?") or a quick reaction to it
|
|
15001
|
+
Never state a fact, a name or an answer that was not already said. If it is a closer, thanks, an ok/yes, small talk or a remark that needs no answer, write: none
|
|
15002
|
+
${personaHint(gender)} Output only the line.`;
|
|
15003
|
+
}
|
|
14980
15004
|
function fastLineGenerator(ai, model, gender) {
|
|
14981
15005
|
return async (c, signal) => {
|
|
14982
|
-
const prompt = c.ask ? `
|
|
14983
|
-
If this asks you to look up, check, find or do something that takes a while, write ONE spoken line of 2-5 words in ${languageName(c.lang)} that names the thing in their own words and says you are on it ("Hacker News, one sec."). If it is small talk, a statement, or something you can answer at once, write: none
|
|
14984
|
-
${personaHint(gender)} Output only the line.` : `You voice the tiny side-sounds of a live spoken conversation. Write ONE line of 1-5 words: ${KIND_HINT2[c.kind]}.
|
|
15006
|
+
const prompt = c.ask ? askPrompt(c, gender) : `You voice the tiny side-sounds of a live spoken conversation. Write ONE line of 1-5 words: ${KIND_HINT2[c.kind]}.
|
|
14985
15007
|
` + (c.react ? `Here the line may be ${REACT_HINT}.
|
|
14986
15008
|
` : "") + (c.tags ? `${TAG_HINT}
|
|
14987
15009
|
` : "") + `The user just said: "${c.heard}"
|
|
@@ -15016,6 +15038,9 @@ var VoiceCallOptions = class {
|
|
|
15016
15038
|
* runs as MAIN's next turn. Not injected mid-run: that makes MAIN run again just to hear a remark. Absent: such a line
|
|
15017
15039
|
* barges in as before. */
|
|
15018
15040
|
noteTurn;
|
|
15041
|
+
/** What the user HEARD of MAIN's reply a barge just cut (a peek — the host still takes the cut for MAIN), else null:
|
|
15042
|
+
* a live bridge echoes what their "that" points at. */
|
|
15043
|
+
heardCut;
|
|
15019
15044
|
/** Writes that immediate answer (fastWorkReply). */
|
|
15020
15045
|
workReply;
|
|
15021
15046
|
workReplyBudgetMs = 1500;
|
|
@@ -15363,7 +15388,7 @@ var VoiceCall = class {
|
|
|
15363
15388
|
this.progress.turn();
|
|
15364
15389
|
this.o.onMetric({ name: "turn", id: t.id, kind: t.kind, text: t.text });
|
|
15365
15390
|
this.o.sendTurn(t.text, { id: t.id, ...t.replaces ? { replaces: t.replaces } : {} });
|
|
15366
|
-
if (t.kind === "new") this.fill.onUserTurn(t.text, now3 - at);
|
|
15391
|
+
if (t.kind === "new") this.fill.onUserTurn(t.text, now3 - at, this.o.heardCut?.() ?? void 0);
|
|
15367
15392
|
}
|
|
15368
15393
|
onDrop(text, why) {
|
|
15369
15394
|
if (!this.gate.holding) {
|