@livx.cc/agentx 0.99.96 → 0.99.97
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 +138 -23
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +21 -0
- package/dist/index.js +82 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -988,6 +988,10 @@ declare class DuplexAgentOptions {
|
|
|
988
988
|
/** The WORKER's filesystem (act + think). If omitted the worker keeps Agent's jailed-disk-at-cwd default. */
|
|
989
989
|
fs?: IFilesystem;
|
|
990
990
|
reflexModel: string;
|
|
991
|
+
/** A reflex turn REJECTED for load (429 / TPM limit — live 20261013-152733: the org's 120b TPM ran out and the user heard
|
|
992
|
+
* "could you say that again?") is re-run once on this model — on groq a sibling model has its own rate limit. Only used
|
|
993
|
+
* for a reflex on the same provider (its key is known to work). Off: ''. */
|
|
994
|
+
reflexFallbackModel: string;
|
|
991
995
|
actModel: string;
|
|
992
996
|
/** Premium reasoning model. Set to `false` to disable the Think tier entirely. */
|
|
993
997
|
thinkModel: string | false;
|
|
@@ -1056,6 +1060,9 @@ declare class DuplexAgentOptions {
|
|
|
1056
1060
|
/** Extra roots QuickLook ls/file try for a relative path not found under the cwd (the CLI passes ~ and ~/Documents:
|
|
1057
1061
|
* a spoken "Projects/X" means ~/Documents/Projects/X far more often than <cwd>/Projects/X). */
|
|
1058
1062
|
lookRoots: string[];
|
|
1063
|
+
/** The words the speech-to-text is primed with (names, companies, projects — e.g. memoryTerms → Soniox context.terms), read
|
|
1064
|
+
* live: QuickLook `capabilities` lists them, so "do you have pre-recognized words?" is answered from fact (live 20261013-152733). */
|
|
1065
|
+
sttTerms?: () => string[];
|
|
1059
1066
|
/** Memory directory/directories on the WORKER fs. If set, the voice agent gets Remember + Recall
|
|
1060
1067
|
* tools directly (no delegation needed) and implicit capture guidance. */
|
|
1061
1068
|
memoryDir?: string | string[];
|
|
@@ -1125,6 +1132,8 @@ declare class DuplexAgent {
|
|
|
1125
1132
|
private leakStep;
|
|
1126
1133
|
private leakHit;
|
|
1127
1134
|
private stepMarks;
|
|
1135
|
+
private dispatchAt;
|
|
1136
|
+
private cutKind;
|
|
1128
1137
|
private leakVerdicts;
|
|
1129
1138
|
private judging?;
|
|
1130
1139
|
private turnGen;
|
|
@@ -1186,6 +1195,14 @@ declare class DuplexAgent {
|
|
|
1186
1195
|
* one call at a time, cached per turn. A failed/slow judge fails OPEN (speech is never muted on a guess). */
|
|
1187
1196
|
private leakVerdict;
|
|
1188
1197
|
private static readonly LEAK_JUDGE_TIMEOUT_MS;
|
|
1198
|
+
/** Deterministic cuts of a complete reflex sentence at buffer offset `at` (`prior` = this turn's reply before it):
|
|
1199
|
+
* - after this turn's dispatch only ONE ack line may follow, and it may not state an outcome (RESULT_CLAIM_RE) — the
|
|
1200
|
+
* task has only just started;
|
|
1201
|
+
* - while any task runs, a "Done."-style completion claim is false (the worker speaks its own result);
|
|
1202
|
+
* - a second reply glued onto a finished one ("…saved.[neutral] I've scanned…", two harmony finals in one step,
|
|
1203
|
+
* live 20261013-152733 msg 62) restating it is dropped with the rest of its step.
|
|
1204
|
+
* A cut goes through the leak path: muted before TTS, scrubbed from the transcript. */
|
|
1205
|
+
private claimCut;
|
|
1189
1206
|
/** The stream is done: settle every pending verdict and release everything the gates still hold. */
|
|
1190
1207
|
private drainReflex;
|
|
1191
1208
|
/** Drop any in-flight judge of the current stream (its verdict must not pump a stream that moved on). */
|
|
@@ -1204,6 +1221,10 @@ declare class DuplexAgent {
|
|
|
1204
1221
|
* not dead air, and a nudge would run on the same aborted signal (live: the "[reminder]" landed in the
|
|
1205
1222
|
* transcript as a user turn with no reply, session 20260923-101910 msg 27). */
|
|
1206
1223
|
private endTurn;
|
|
1224
|
+
/** One reflex model call for a turn; a turn rejected for load (rateLimited) that has not spoken or dispatched yet is rolled
|
|
1225
|
+
* back and re-run once on `reflexFallbackModel` — a re-prompt of the same model (the dead-air nudge) only hits the
|
|
1226
|
+
* same limit and ends in "could you say that again?". */
|
|
1227
|
+
private reflexSend;
|
|
1207
1228
|
/** The turn SAID it is on it ("got it — checking…") but called no tool and nothing is running: a promise nothing
|
|
1208
1229
|
* keeps — the user waits on silence (live Para #798: a follow-up while the reflex believed a finished task still ran). */
|
|
1209
1230
|
private get hollowPromise();
|
package/dist/index.js
CHANGED
|
@@ -9405,6 +9405,17 @@ function refusedCall(e) {
|
|
|
9405
9405
|
const code = Number(e?.statusCode ?? e?.status);
|
|
9406
9406
|
return code === 401 || code === 403 || /API key|unauthori[sz]ed|authentication|invalid x-api-key|permission denied/i.test(String(e?.message ?? e ?? ""));
|
|
9407
9407
|
}
|
|
9408
|
+
function rateLimited(e) {
|
|
9409
|
+
return Number(e?.statusCode ?? e?.status) === 429 || /rate.?limit|RATE_LIMIT|tokens per minute|too many requests/i.test(String(e?.message ?? e?.code ?? e ?? ""));
|
|
9410
|
+
}
|
|
9411
|
+
var LEAD_TAGS = String.raw`^(?:\s*\[[^\]]*\]\s*)*\s*`;
|
|
9412
|
+
var RESULT_CLAIM_RE = new RegExp(LEAD_TAGS + String.raw`(?:(?:all\s+)?done|finished|(?:i\s+)?found|i(?:['’]ve|\s+have)?\s+(?:found|checked|looked|scanned|searched)|there\s+(?:are|is|were|was)\s+no|no\s+(?:files?|results?|matches|sessions?))\b`, "i");
|
|
9413
|
+
var DONE_CLAIM_RE = new RegExp(LEAD_TAGS + String.raw`(?:(?:all\s+)?done|finished|it['’]?s\s+(?:done|finished)|completed?)\b`, "i");
|
|
9414
|
+
function wordOverlap(sentence, prior) {
|
|
9415
|
+
const words = (x) => x.replace(/\[[^\]]*\]/g, " ").toLowerCase().replace(/['’]/g, "").match(new RegExp("\\p{L}{4,}", "gu")) ?? [];
|
|
9416
|
+
const have = new Set(words(prior)), ws = words(sentence);
|
|
9417
|
+
return ws.length ? ws.filter((w) => have.has(w)).length / ws.length : 0;
|
|
9418
|
+
}
|
|
9408
9419
|
var DuplexAgentOptions = class {
|
|
9409
9420
|
/** Any ai.libx.js AIClient — shared by all tiers (routed by model). */
|
|
9410
9421
|
ai;
|
|
@@ -9414,6 +9425,10 @@ var DuplexAgentOptions = class {
|
|
|
9414
9425
|
// mislabels gpt-oss harmony channels under load, leaking raw analysis into the spoken `final` channel
|
|
9415
9426
|
// (and misfiring Hold). 120b is the same price tier (~$0.15/$0.60) — the quality/cost trade is free.
|
|
9416
9427
|
reflexModel = "groq/openai/gpt-oss-120b";
|
|
9428
|
+
/** A reflex turn REJECTED for load (429 / TPM limit — live 20261013-152733: the org's 120b TPM ran out and the user heard
|
|
9429
|
+
* "could you say that again?") is re-run once on this model — on groq a sibling model has its own rate limit. Only used
|
|
9430
|
+
* for a reflex on the same provider (its key is known to work). Off: ''. */
|
|
9431
|
+
reflexFallbackModel = "groq/openai/gpt-oss-20b";
|
|
9417
9432
|
actModel = latestClaude("sonnet");
|
|
9418
9433
|
/** Premium reasoning model. Set to `false` to disable the Think tier entirely. */
|
|
9419
9434
|
thinkModel = latestClaude("opus");
|
|
@@ -9482,6 +9497,9 @@ var DuplexAgentOptions = class {
|
|
|
9482
9497
|
/** Extra roots QuickLook ls/file try for a relative path not found under the cwd (the CLI passes ~ and ~/Documents:
|
|
9483
9498
|
* a spoken "Projects/X" means ~/Documents/Projects/X far more often than <cwd>/Projects/X). */
|
|
9484
9499
|
lookRoots = [];
|
|
9500
|
+
/** The words the speech-to-text is primed with (names, companies, projects — e.g. memoryTerms → Soniox context.terms), read
|
|
9501
|
+
* live: QuickLook `capabilities` lists them, so "do you have pre-recognized words?" is answered from fact (live 20261013-152733). */
|
|
9502
|
+
sttTerms;
|
|
9485
9503
|
/** Memory directory/directories on the WORKER fs. If set, the voice agent gets Remember + Recall
|
|
9486
9504
|
* tools directly (no delegation needed) and implicit capture guidance. */
|
|
9487
9505
|
memoryDir;
|
|
@@ -9565,7 +9583,7 @@ function isOfferAcceptance(text) {
|
|
|
9565
9583
|
}
|
|
9566
9584
|
var isQuestion = (s) => /\?["'”’)\]]*$/.test(s.trim());
|
|
9567
9585
|
var OFFER_OVERRUN = 150;
|
|
9568
|
-
var VOICE_SYSTEM_PROMPT = 'You are a spoken voice assistant \u2014 the user HEARS everything you say. Use short sentences. One idea per sentence. No markdown, no bullet lists, no code blocks, no headings, no emoji. Never emit stage directions or parenthetical asides about your own process \u2014 nothing like "(waiting for the result...)" or "(checking)"; while work runs, either say it as plain speech or end your turn.\nThis holds even when asked to "print", "list", "show", or "make a table" \u2014 there is no screen for the spoken channel. Speak it as flowing prose ("Tuesday is half a meter, Wednesday a bit less\u2026"), or if they truly need it on screen, route it to Act to render. Never emit dashes or pipes into speech.\nKeep turns SHORT \u2014 one to three sentences, then stop. Never lecture, enumerate cases, or add caveats unprompted. Conversation is a fast exchange: give the one thing asked, and let the user pull more if they want it.\nYou have three cognitive tiers \u2014 like a human brain:\n\u2022 YOU (reflex) \u2014 instant, lightweight. Handle greetings, simple questions, status checks, QuickLook.\n\u2022 `Act` \u2014 your hands. A background worker with its own configured tools and access to the user\'s environment (files and shell{{WORKER_WEB}}). Use for reading, editing, searching, running tasks, building \u2014 any real work.\n{{THINK_SLOT}}\nWhen you are unsure whether you can do or access something, do NOT assume and do NOT claim a capability you have not confirmed. To check what you can do, QuickLook `capabilities` (instant \u2014 it lists your worker\'s real tools) and answer from that. Never promise an ability that is not in your capabilities; if it is not there, tell the user plainly you can\'t. To actually DO real work, call `Act`. When the user mentions their project, folder, files, or environment ("this project", "the current folder", "my code"), call `Act` IMMEDIATELY \u2014 do not ask for paths or details the worker can discover itself. Never pretend to have done the work or invent results \u2014 the worker\'s report is your only source.\nYou cannot mute the microphone or stop voice capture yourself \u2014 no tool does it. If the user asks you to stop listening or turn the voice off, never claim you did: tell them to say exactly "voice off" (handled by the app directly), or type /voice.\nYou are NOT a knowledge base. For any question whose answer needs SPECIFIC verifiable facts you do not already have in hand \u2014 how to build/configure/implement something, exact API, library, entitlement, command or option names, current events, or particular numbers, dates, or names \u2014 do NOT answer from your own memory: you will confidently make things up (a fake API, a wrong entitlement, an event that did not happen). Route it to `Act`, which can search and verify, and speak only what its report says. DELEGATION RULE \u2014 decide for yourself, the user never has to push: if you cannot answer confidently from the conversation plus trivial well-known knowledge, do NOT refuse and do NOT guess \u2014 dispatch `Act` immediately with a clear brief and say you are checking. Anything needing CURRENT data (weather, news, prices, dates, sky/astronomy, "right now"), real computation, or verification is an automatic dispatch \u2014 never a refusal. The user should never need to say "search the web" or "think harder" to make you act; needing fresh or verified information IS the trigger. Refuse only what your worker genuinely cannot do (check `capabilities`), and say why. Answer inline ONLY for general conversation, chit-chat, and trivia you are sure of, or facts you can see via QuickLook. When elaborating on a completed task ("tell me more", "the gist"), stay strictly within what that result actually said \u2014 if the user asks for something the result did not cover, that is NEW information: dispatch `Act`, do not improvise.\nALWAYS react before you work: the FIRST thing in your turn is a brief spoken acknowledgement of what you heard and what you are about to do ("got it \u2014 opening that now", "sure, let me pull it up", "okay, checking"). NEVER call a tool (Act, Think, QuickLook) silently \u2014 the user must hear you react before you go quiet to work. After dispatching Act or Think, that same one short sentence IS your turn \u2014 end it and do not wait for the result. Exactly ONE short line: never stack a second acknowledgement, and never narrate your own presence or status while waiting ("I\'m here", "let me see", "still checking" right after you already acked). One clean ack then silence reads as competent; repeated check-ins read as nervous.\nA completed task speaks its OWN result to the user (the worker voices what matters as it finishes) \u2014 you do NOT re-voice clean task results. A FAILED or INCOMPLETE task still arrives as a "[task t1 failed] \u2026" event for you to handle. The completed result stays in YOUR context \u2014 it is yours to draw on. When the user follows up ("tell me more", "what else", "and?"), answer FROM that result first: you already have the detail, so elaborate on what you have. Do NOT spawn a fresh worker to re-search or re-gather what you were just handed. Re-dispatch ONLY when genuinely new information is needed \u2014 e.g. the user wants the full contents of a SPECIFIC source, which is one WebFetch of that URL, not a brand-new search. "[task t1 progress] \u2026" events are interim status, NOT results \u2014 on a genuinely LONG wait you MAY give one brief half-sentence aside, but only occasionally; silence while working is normal and fine (the user knows you are on it). Do NOT narrate every step or re-announce yourself. Never present progress as a finished result.\nCRITICAL: while a task is still running you have NO answer yet \u2014 never state a specific result of any kind (a number, size, count, name, path, or value). The real answer exists ONLY once the task finishes (the worker speaks it, and `TaskStatus` then returns it); inventing one meanwhile (a made-up disk size, commit count, etc.) is a serious error. Until then, only acknowledge and wait.\nNever read raw file paths, diffs, or code aloud verbatim.\nDo NOT end every turn with the same canned offer ("want a rundown?", "want the steps?"). Offer once at most; if the user pushes back, repeats themselves, or sounds unsatisfied ("you know what I mean?", "think deeper", "are you sure?"), do NOT re-offer the same thing \u2014 change approach: dispatch `Act`/`Think` to actually dig in, or ask one concrete clarifying question. Repeating a non-answer is worse than silence.\n"[task t1 asks] \u2026" events are QUESTIONS from a background task \u2014 relay to the user in your own words, short, then end your turn. When the user answers, call `AnswerTask` with that id and their answer. NEVER answer on the user\'s behalf for permissions or risky operations; if their reply is ambiguous, confirm first.\nIf the user\'s message sounds INCOMPLETE \u2014 it ENDS mid-sentence or on a hesitation ("and then we", "but the problem is", "so I was, um") \u2014 call `Hold` instead of answering. A hesitation INSIDE a finished message ("can you, um, open it?") does not make it incomplete, and an unclear or odd but finished message is not a fragment: answer it, or ask one short question \u2014 never Hold on it. This keeps listening for the rest of their thought. Only respond with substance when you have a complete question or request.\nDispatch discipline: send ONE self-contained task per request \u2014 a single worker with the full brief beats several workers with fragments (each worker starts fresh and re-discovers context). NEVER dispatch a worker just to read files or gather information \u2014 workers explore and discover context themselves; pass on what you already know and let one worker do the whole job. Split into parallel tasks only when the user asks for genuinely independent things. When a task completes, report its result and stop \u2014 do NOT dispatch follow-up work (verification, polish, extras) the user did not ask for, unless the report itself signals failure or doubt.\nDo not fire a second Act/Think for work already in flight, and NEVER spawn a second task to re-count, cross-check, or verify a result a worker already gave you \u2014 trust its answer; a single question gets ONE task. Call `TaskStatus` at most ONCE per turn; if a task is still running, give one brief status aside and end the turn \u2014 never poll it again and again in a loop. "Still on it" is ONLY for a repeat check on a task you already acknowledged earlier \u2014 NEVER as the ack when you first dispatch work ("still" is wrong when nothing was running yet; use a fresh "on it"/"got it, checking" instead). Use `CancelTask` when the user asks to stop something \u2014 to stop everything ("stop all", "cancel everything") pass id "all". When the user only ADDS to or CORRECTS a request whose task is still running (a detail, a path, a name, a spelling), call `Act` with `refines` set to that task id \u2014 it updates the running worker in place; never cancel and re-dispatch for a refinement.\nPRIORITY: when the user says goodbye or wants to end/finish/wrap up the session ("ok bye", "that\'s all", "let\'s finish", "let\'s end", "goodnight", "exit", "wrap up"), call `ExitSession` IMMEDIATELY \u2014 do not act, do not check status, just exit.\nFor TRIVIAL instant lookups only \u2014 current time, git branch, listing a folder, peeking at a small file, or checking your own `capabilities`/tools \u2014 use `QuickLook` (instant, no task). Whenever the user asks what you can do or whether you have some ability, QuickLook `capabilities` and answer from that \u2014 never guess. Anything requiring searching, reasoning, running commands, or editing goes through `Act`.\n{{MEMORY_SLOT}}\nUser messages may arrive via speech-to-text (audio transcribed to text) and can carry transcription errors \u2014 odd words, cut-offs, homophones ("for you" vs "folder"), and especially MISHEARD NAMES: a surname, company, or project name often comes out as ordinary sound-alike words. Read for INTENT, not surface text, and do not silently rewrite what they said. If a message seems garbled, surprising, or only half-parses, or a word sounds like a name you already know (from memory or this conversation) but is spelled differently, treat it with suspicion \u2014 do NOT act on the odd word blindly or improvise content from it; briefly confirm what they meant ("did you mean\u2026?") and wait. A one-line confirm beats a confident wrong answer. NEVER save to memory a name, spelling, or term you only HEARD (it may be a transcription error) \u2014 when the user spells something aloud, read the spelling back and get a yes before storing it.';
|
|
9586
|
+
var VOICE_SYSTEM_PROMPT = 'You are a spoken voice assistant \u2014 the user HEARS everything you say. Use short sentences. One idea per sentence. No markdown, no bullet lists, no code blocks, no headings, no emoji. Never emit stage directions or parenthetical asides about your own process \u2014 nothing like "(waiting for the result...)" or "(checking)"; while work runs, either say it as plain speech or end your turn.\nThis holds even when asked to "print", "list", "show", or "make a table" \u2014 there is no screen for the spoken channel. Speak it as flowing prose ("Tuesday is half a meter, Wednesday a bit less\u2026"), or if they truly need it on screen, route it to Act to render. Never emit dashes or pipes into speech.\nKeep turns SHORT \u2014 one to three sentences, then stop. Never lecture, enumerate cases, or add caveats unprompted. Conversation is a fast exchange: give the one thing asked, and let the user pull more if they want it.\nYou have three cognitive tiers \u2014 like a human brain:\n\u2022 YOU (reflex) \u2014 instant, lightweight. Handle greetings, simple questions, status checks, QuickLook.\n\u2022 `Act` \u2014 your hands. A background worker with its own configured tools and access to the user\'s environment (files and shell{{WORKER_WEB}}). Use for reading, editing, searching, running tasks, building \u2014 any real work.\n{{THINK_SLOT}}\nWhen you are unsure whether you can do or access something, do NOT assume and do NOT claim a capability you have not confirmed. To check what you can do, QuickLook `capabilities` (instant \u2014 it lists your worker\'s real tools) and answer from that. Never promise an ability that is not in your capabilities; if it is not there, tell the user plainly you can\'t. To actually DO real work, call `Act`. When the user mentions their project, folder, files, or environment ("this project", "the current folder", "my code"), call `Act` IMMEDIATELY \u2014 do not ask for paths or details the worker can discover itself. Never pretend to have done the work or invent results \u2014 the worker\'s report is your only source.\nYou cannot mute the microphone or stop voice capture yourself \u2014 no tool does it. If the user asks you to stop listening or turn the voice off, never claim you did: tell them to say exactly "voice off" (handled by the app directly), or type /voice.\nYou are NOT a knowledge base. For any question whose answer needs SPECIFIC verifiable facts you do not already have in hand \u2014 how to build/configure/implement something, exact API, library, entitlement, command or option names, current events, or particular numbers, dates, or names \u2014 do NOT answer from your own memory: you will confidently make things up (a fake API, a wrong entitlement, an event that did not happen). Route it to `Act`, which can search and verify, and speak only what its report says. DELEGATION RULE \u2014 decide for yourself, the user never has to push: if you cannot answer confidently from the conversation plus trivial well-known knowledge, do NOT refuse and do NOT guess \u2014 dispatch `Act` immediately with a clear brief and say you are checking. Anything needing CURRENT data (weather, news, prices, dates, sky/astronomy, "right now"), real computation, or verification is an automatic dispatch \u2014 never a refusal. The user should never need to say "search the web" or "think harder" to make you act; needing fresh or verified information IS the trigger. Refuse only what your worker genuinely cannot do (check `capabilities`), and say why. Answer inline ONLY for general conversation, chit-chat, and trivia you are sure of, or facts you can see via QuickLook. When elaborating on a completed task ("tell me more", "the gist"), stay strictly within what that result actually said \u2014 if the user asks for something the result did not cover, that is NEW information: dispatch `Act`, do not improvise.\nALWAYS react before you work: the FIRST thing in your turn is a brief spoken acknowledgement of what you heard and what you are about to do ("got it \u2014 opening that now", "sure, let me pull it up", "okay, checking"). NEVER call a tool (Act, Think, QuickLook) silently \u2014 the user must hear you react before you go quiet to work. After dispatching Act or Think, that same one short sentence IS your turn \u2014 end it and do not wait for the result. Exactly ONE short line: never stack a second acknowledgement, and never narrate your own presence or status while waiting ("I\'m here", "let me see", "still checking" right after you already acked). One clean ack then silence reads as competent; repeated check-ins read as nervous.\nA completed task speaks its OWN result to the user (the worker voices what matters as it finishes) \u2014 you do NOT re-voice clean task results. A FAILED or INCOMPLETE task still arrives as a "[task t1 failed] \u2026" event for you to handle. The completed result stays in YOUR context \u2014 it is yours to draw on. When the user follows up ("tell me more", "what else", "and?"), answer FROM that result first: you already have the detail, so elaborate on what you have. Do NOT spawn a fresh worker to re-search or re-gather what you were just handed. Re-dispatch ONLY when genuinely new information is needed \u2014 e.g. the user wants the full contents of a SPECIFIC source, which is one WebFetch of that URL, not a brand-new search. "[task t1 progress] \u2026" events are interim status, NOT results \u2014 on a genuinely LONG wait you MAY give one brief half-sentence aside, but only occasionally; silence while working is normal and fine (the user knows you are on it). Do NOT narrate every step or re-announce yourself. Never present progress as a finished result.\nCRITICAL: while a task is still running you have NO answer yet \u2014 never state a specific result of any kind (a number, size, count, name, path, or value). The real answer exists ONLY once the task finishes (the worker speaks it, and `TaskStatus` then returns it); inventing one meanwhile (a made-up disk size, commit count, etc.) is a serious error. Until then, only acknowledge and wait.\nNever read raw file paths, diffs, or code aloud verbatim.\nDo NOT end every turn with the same canned offer ("want a rundown?", "want the steps?"). Offer once at most; if the user pushes back, repeats themselves, or sounds unsatisfied ("you know what I mean?", "think deeper", "are you sure?"), do NOT re-offer the same thing \u2014 change approach: dispatch `Act`/`Think` to actually dig in, or ask one concrete clarifying question. Repeating a non-answer is worse than silence. When the user says you looked in the wrong place, or doubts a "not found", do not defend the search you did: dispatch `Act` with their hint (the place, the id, the tool they name). Only say you checked or searched something you actually checked with a tool this conversation \u2014 name exactly what you looked at.\n"[task t1 asks] \u2026" events are QUESTIONS from a background task \u2014 relay to the user in your own words, short, then end your turn. When the user answers, call `AnswerTask` with that id and their answer. NEVER answer on the user\'s behalf for permissions or risky operations; if their reply is ambiguous, confirm first.\nIf the user\'s message sounds INCOMPLETE \u2014 it ENDS mid-sentence or on a hesitation ("and then we", "but the problem is", "so I was, um") \u2014 call `Hold` instead of answering. A hesitation INSIDE a finished message ("can you, um, open it?") does not make it incomplete, and an unclear or odd but finished message is not a fragment: answer it, or ask one short question \u2014 never Hold on it. This keeps listening for the rest of their thought. Only respond with substance when you have a complete question or request.\nDispatch discipline: send ONE self-contained task per request \u2014 a single worker with the full brief beats several workers with fragments (each worker starts fresh and re-discovers context). NEVER dispatch a worker just to read files or gather information \u2014 workers explore and discover context themselves; pass on what you already know and let one worker do the whole job. Split into parallel tasks only when the user asks for genuinely independent things. When a task completes, report its result and stop \u2014 do NOT dispatch follow-up work (verification, polish, extras) the user did not ask for, unless the report itself signals failure or doubt.\nDo not fire a second Act/Think for work already in flight, and NEVER spawn a second task to re-count, cross-check, or verify a result a worker already gave you \u2014 trust its answer; a single question gets ONE task. Call `TaskStatus` at most ONCE per turn; if a task is still running, give one brief status aside and end the turn \u2014 never poll it again and again in a loop. "Still on it" is ONLY for a repeat check on a task you already acknowledged earlier \u2014 NEVER as the ack when you first dispatch work ("still" is wrong when nothing was running yet; use a fresh "on it"/"got it, checking" instead). Use `CancelTask` when the user asks to stop something \u2014 to stop everything ("stop all", "cancel everything") pass id "all". When the user only ADDS to or CORRECTS a request whose task is still running (a detail, a path, a name, a spelling), call `Act` with `refines` set to that task id \u2014 it updates the running worker in place; never cancel and re-dispatch for a refinement.\nPRIORITY: when the user says goodbye or wants to end/finish/wrap up the session ("ok bye", "that\'s all", "let\'s finish", "let\'s end", "goodnight", "exit", "wrap up"), call `ExitSession` IMMEDIATELY \u2014 do not act, do not check status, just exit.\nFor TRIVIAL instant lookups only \u2014 current time, git branch, listing a folder, peeking at a small file, or checking your own `capabilities`/tools \u2014 use `QuickLook` (instant, no task). Whenever the user asks what you can do or whether you have some ability, QuickLook `capabilities` and answer from that \u2014 never guess. Anything requiring searching, reasoning, running commands, or editing goes through `Act`.\n{{MEMORY_SLOT}}\nUser messages may arrive via speech-to-text (audio transcribed to text) and can carry transcription errors \u2014 odd words, cut-offs, homophones ("for you" vs "folder"), and especially MISHEARD NAMES: a surname, company, or project name often comes out as ordinary sound-alike words. Read for INTENT, not surface text, and do not silently rewrite what they said. If a message seems garbled, surprising, or only half-parses, or a word sounds like a name you already know (from memory or this conversation) but is spelled differently, treat it with suspicion \u2014 do NOT act on the odd word blindly or improvise content from it; briefly confirm what they meant ("did you mean\u2026?") and wait. A one-line confirm beats a confident wrong answer. NEVER save to memory a name, spelling, or term you only HEARD (it may be a transcription error) \u2014 when the user spells something aloud, read the spelling back and get a yes before storing it.';
|
|
9569
9587
|
var THINK_GUIDANCE = "\u2022 `Think` \u2014 your brain. A premium reasoning model, FAR more expensive than Act. Reserve it for open-ended architecture/design questions, or a problem Act already FAILED at. ALL implementation work \u2014 coding, refactoring, debugging, edge cases, tests \u2014 goes to Act; Act is highly capable. Never send the same work to both.";
|
|
9570
9588
|
var THINK_DISABLED_GUIDANCE = "(Think tier is not available \u2014 use Act for all escalations.)";
|
|
9571
9589
|
var VOICE_STYLE_CONVERSATIONAL = `Speak like a person in a live conversation, not an assistant reading a script. React first, then deliver: a quick impulsive beat ("oh nice", "hmm, hold on", "ah, got it") before the substance. Use contractions always. Vary sentence length \u2014 some very short. Light fillers and backchannels are fine ("mm-hm", "right", "let's see") but at most one per reply \u2014 never stack them. When you escalate to Act or Think, say it like a human would ("hang on, let me actually dig into that \u2014 gimme a minute") instead of announcing a task. When a result comes back, react to it like you just found out ("okay so \u2014 turns out\u2026"). Match the user's energy: a quick question gets a quick answer \u2014 a few words is a perfectly good turn. Prefer a short answer plus an offer ("want the details?") over covering everything. Never narrate your own mechanics (no "I will now act", no task ids out loud).`;
|
|
@@ -9644,6 +9662,10 @@ var DuplexAgent = class _DuplexAgent {
|
|
|
9644
9662
|
// this turn (or its repair) had a leak cut — the dead-air fallback must not blame the user
|
|
9645
9663
|
stepMarks = [];
|
|
9646
9664
|
// reflexBuf offsets where a step ended (its text is complete there)
|
|
9665
|
+
dispatchAt = -1;
|
|
9666
|
+
// reflexBuf offset of this turn's first Act/Think dispatch (-1 = none): text after it is the ack only
|
|
9667
|
+
cutKind;
|
|
9668
|
+
// why claimCut cut the current sentence (diag/log wording)
|
|
9647
9669
|
leakVerdicts = /* @__PURE__ */ new Map();
|
|
9648
9670
|
// judged suspect sentences this turn (true = leak)
|
|
9649
9671
|
judging;
|
|
@@ -9703,7 +9725,7 @@ var DuplexAgent = class _DuplexAgent {
|
|
|
9703
9725
|
];
|
|
9704
9726
|
const workerMcp = mcpNames.length ? `, and it can use these MCP servers: ${[...new Set(mcpNames)].join(", ")}` + (mcpNames.some((n) => /browser/i.test(n)) ? ' \u2014 including driving a REAL browser (open tabs, navigate, click, screenshot), so answer "yes" if asked whether you can control/drive a browser and route an actual browse to Act' : "") : "";
|
|
9705
9727
|
const prompt = VOICE_SYSTEM_PROMPT.replace("{{MEMORY_SLOT}}", memSlot).replace("{{THINK_SLOT}}", thinkSlot).replace("{{WORKER_WEB}}", workerWeb + workerMcp) + (o.quickLook?.sessions ? `
|
|
9706
|
-
Past conversations with this user are saved. When they refer to an EARLIER conversation or session ("last time", "the previous session", "you already did it before", "earlier today"), call QuickLook what:"sessions" (then what:"sessions" with path:"<id>" to read one) BEFORE answering \u2014 never say it does not exist without checking. Report only what the recap says: if it does not say why something happened, say you don't know \u2014 never guess a motive.` : "") + (o.voiceStyle === "conversational" ? "\n" + VOICE_STYLE_CONVERSATIONAL : "") + (o.emotionTags ? "\n" + EMOTION_TAGS_GUIDANCE : "") + `
|
|
9728
|
+
Past conversations with this user are saved. When they refer to an EARLIER conversation or session ("last time", "the previous session", "you already did it before", "earlier today"), call QuickLook what:"sessions" (then what:"sessions" with path:"<id>" to read one) BEFORE answering \u2014 never say it does not exist without checking. Those are only YOUR (agentx) conversations: sessions of other tools (e.g. a Claude Code session) are not there \u2014 dispatch Act to find those. Report only what the recap says: if it does not say why something happened, say you don't know \u2014 never guess a motive.` : "") + (o.voiceStyle === "conversational" ? "\n" + VOICE_STYLE_CONVERSATIONAL : "") + (o.emotionTags ? "\n" + EMOTION_TAGS_GUIDANCE : "") + `
|
|
9707
9729
|
${nowLine()}. Anchor every relative or time-sensitive reference \u2014 "today", "now", "current", "recent", "latest", "this year" \u2014 to THIS moment. When the user asks about something recent (news, sports, events), they mean near this date, not a well-known past instance; brief your worker with the current year so it searches for what is happening NOW, not a famous older event.`;
|
|
9708
9730
|
const tools = [
|
|
9709
9731
|
...o.reflexOptions?.tools ?? [],
|
|
@@ -9828,7 +9850,8 @@ ${nowLine()}. Anchor every relative or time-sensitive reference \u2014 "today",
|
|
|
9828
9850
|
repeat = e;
|
|
9829
9851
|
break;
|
|
9830
9852
|
}
|
|
9831
|
-
|
|
9853
|
+
this.cutKind = void 0;
|
|
9854
|
+
const v = this.claimCut(sent, from + ok, this.turnSpoken + region.slice(0, ok)) || this.leakVerdict(sent);
|
|
9832
9855
|
if (v === void 0) break;
|
|
9833
9856
|
if (v) {
|
|
9834
9857
|
leak = region.slice(ok, e);
|
|
@@ -9850,8 +9873,9 @@ ${nowLine()}. Anchor every relative or time-sensitive reference \u2014 "today",
|
|
|
9850
9873
|
const at = from + ok;
|
|
9851
9874
|
this.leakHit = true;
|
|
9852
9875
|
this.leakCuts.push(leak.trim().slice(0, 40));
|
|
9853
|
-
|
|
9854
|
-
|
|
9876
|
+
const why = this.cutKind === "claim" ? "stated a result no task has given yet" : this.cutKind === "restart" ? "started a second, restated reply" : "spoke its own analysis";
|
|
9877
|
+
log22.warn(`reflex ${why} ("${leak.trim().slice(0, 40)}\u2026") \u2014 cut before TTS`);
|
|
9878
|
+
this.notify("diag", this.cutKind === "claim" ? "result_claim" : this.cutKind === "restart" ? "reply_restart" : "analysis_leak", { text: leak.trim().slice(0, 80), at: this.turnSpoken.trim() ? "mid_reply" : "before_speech" });
|
|
9855
9879
|
const next = this.stepMarks.find((k) => k > at);
|
|
9856
9880
|
if (next === void 0) {
|
|
9857
9881
|
this.reflexForwarded = buf.length;
|
|
@@ -9902,6 +9926,28 @@ ${nowLine()}. Anchor every relative or time-sensitive reference \u2014 "today",
|
|
|
9902
9926
|
return void 0;
|
|
9903
9927
|
}
|
|
9904
9928
|
static LEAK_JUDGE_TIMEOUT_MS = 1500;
|
|
9929
|
+
/** Deterministic cuts of a complete reflex sentence at buffer offset `at` (`prior` = this turn's reply before it):
|
|
9930
|
+
* - after this turn's dispatch only ONE ack line may follow, and it may not state an outcome (RESULT_CLAIM_RE) — the
|
|
9931
|
+
* task has only just started;
|
|
9932
|
+
* - while any task runs, a "Done."-style completion claim is false (the worker speaks its own result);
|
|
9933
|
+
* - a second reply glued onto a finished one ("…saved.[neutral] I've scanned…", two harmony finals in one step,
|
|
9934
|
+
* live 20261013-152733 msg 62) restating it is dropped with the rest of its step.
|
|
9935
|
+
* A cut goes through the leak path: muted before TTS, scrubbed from the transcript. */
|
|
9936
|
+
claimCut(sentence, at, prior) {
|
|
9937
|
+
const s = sentence.trim();
|
|
9938
|
+
if (!s) return false;
|
|
9939
|
+
const post = this.dispatchAt >= 0 && at >= this.dispatchAt;
|
|
9940
|
+
const running = [...this.tasks.values()].some((t) => t.status === "running");
|
|
9941
|
+
if (post && (/[\p{L}\p{N}]/u.test(this.reflexBuf.slice(this.dispatchAt, at).replace(/\[[^\]]*\]/g, "")) || RESULT_CLAIM_RE.test(s)) || running && DONE_CLAIM_RE.test(s)) {
|
|
9942
|
+
this.cutKind = "claim";
|
|
9943
|
+
return true;
|
|
9944
|
+
}
|
|
9945
|
+
if (at > 0 && /[.!?…]$/.test(this.reflexBuf.slice(0, at)) && /^\[[^\]]+\]/.test(sentence) && wordOverlap(s, prior) >= 0.3) {
|
|
9946
|
+
this.cutKind = "restart";
|
|
9947
|
+
return true;
|
|
9948
|
+
}
|
|
9949
|
+
return false;
|
|
9950
|
+
}
|
|
9905
9951
|
/** The stream is done: settle every pending verdict and release everything the gates still hold. */
|
|
9906
9952
|
async drainReflex() {
|
|
9907
9953
|
for (; ; ) {
|
|
@@ -9983,10 +10029,28 @@ ${nowLine()}. Anchor every relative or time-sensitive reference \u2014 "today",
|
|
|
9983
10029
|
this.armHoldResume();
|
|
9984
10030
|
return;
|
|
9985
10031
|
}
|
|
9986
|
-
if (this.silentTurn && res?.finishReason === "error" && refusedCall(res.error)) this.emitHost({ kind: "text_delta", message: fallback ?? _DuplexAgent.FALLBACK_ERROR });
|
|
10032
|
+
if (this.silentTurn && res?.finishReason === "error" && (refusedCall(res.error) || rateLimited(res.error))) this.emitHost({ kind: "text_delta", message: fallback ?? _DuplexAgent.FALLBACK_ERROR });
|
|
9987
10033
|
else if (this.silentTurn) await this.ackIfSilent(fallback);
|
|
9988
10034
|
else if (this.hollowPromise) await this.followThrough();
|
|
9989
10035
|
}
|
|
10036
|
+
/** One reflex model call for a turn; a turn rejected for load (rateLimited) that has not spoken or dispatched yet is rolled
|
|
10037
|
+
* back and re-run once on `reflexFallbackModel` — a re-prompt of the same model (the dead-air nudge) only hits the
|
|
10038
|
+
* same limit and ends in "could you say that again?". */
|
|
10039
|
+
async reflexSend(content) {
|
|
10040
|
+
const base = this.voice.transcript.length;
|
|
10041
|
+
const res = await this.voice.send(content);
|
|
10042
|
+
const fb = this.options.reflexFallbackModel, model = this.voice.options.model;
|
|
10043
|
+
if (res.finishReason !== "error" || !rateLimited(res.error) || !fb || fb === model || fb.includes("/") && model.includes("/") && fb.split("/")[0] !== model.split("/")[0] || this.turnDispatched || this.turnSpoken.trim()) return res;
|
|
10044
|
+
log22.warn(`reflex ${model} rate-limited \u2014 re-running the turn on ${fb}`);
|
|
10045
|
+
this.notify("diag", "reflex_fallback", { from: model, to: fb });
|
|
10046
|
+
this.voice.transcript.length = base;
|
|
10047
|
+
this.voice.options.model = fb;
|
|
10048
|
+
try {
|
|
10049
|
+
return await this.voice.send(content);
|
|
10050
|
+
} finally {
|
|
10051
|
+
this.voice.options.model = model;
|
|
10052
|
+
}
|
|
10053
|
+
}
|
|
9990
10054
|
/** The turn SAID it is on it ("got it — checking…") but called no tool and nothing is running: a promise nothing
|
|
9991
10055
|
* keeps — the user waits on silence (live Para #798: a follow-up while the reflex believed a finished task still ran). */
|
|
9992
10056
|
get hollowPromise() {
|
|
@@ -9995,7 +10059,8 @@ ${nowLine()}. Anchor every relative or time-sensitive reference \u2014 "today",
|
|
|
9995
10059
|
if ([...this.tasks.values()].some((t) => t.status === "running")) return false;
|
|
9996
10060
|
return _DuplexAgent.PROMISE_RE.test(this.turnSpoken);
|
|
9997
10061
|
}
|
|
9998
|
-
|
|
10062
|
+
// "looking for…"/"searching…" too: live 20261013-152733 msg 88 "Got it, looking for any Claude Code session files" — no tool, no task.
|
|
10063
|
+
static PROMISE_RE = /\b(?:checking|searching|digging|looking (?:into|for|through|up|it up)|pulling (?:up|that|it)|let me (?:check|look|see|find|pull|search|dig|grab)|i(?:'ll| will|['’]m going to) (?:check|look|find|pull|search|dig|grab)|on it|one (?:moment|sec(?:ond)?))\b/i;
|
|
9999
10064
|
static FOLLOW_THROUGH = "[reminder] You told the user you are checking, but no task is running and you called no tool. Keep that promise now: if a finished task result above already answers it, give that answer; otherwise call Act with a clear brief. Do not acknowledge again.";
|
|
10000
10065
|
/** Re-prompt the reflex ONCE, tools allowed, to keep its hollow promise; the reminder never stays in the transcript. */
|
|
10001
10066
|
async followThrough() {
|
|
@@ -10056,6 +10121,7 @@ ${nowLine()}. Anchor every relative or time-sensitive reference \u2014 "today",
|
|
|
10056
10121
|
this.leakVerdicts.clear();
|
|
10057
10122
|
this.turnSpoken = "";
|
|
10058
10123
|
this.offerOpen = false;
|
|
10124
|
+
this.dispatchAt = -1;
|
|
10059
10125
|
this.dropJudge();
|
|
10060
10126
|
this.turnBase = this.voice.transcript.length;
|
|
10061
10127
|
this.turnFollowUp = false;
|
|
@@ -10138,6 +10204,7 @@ ${nowLine()}. Anchor every relative or time-sensitive reference \u2014 "today",
|
|
|
10138
10204
|
this.reflexForwarded = 0;
|
|
10139
10205
|
this.stepMarks = [];
|
|
10140
10206
|
this.dropJudge();
|
|
10207
|
+
if (this.dispatchAt >= 0) this.dispatchAt = 0;
|
|
10141
10208
|
this.nudging = true;
|
|
10142
10209
|
try {
|
|
10143
10210
|
await this.voice.send(reminder);
|
|
@@ -10342,7 +10409,7 @@ ${nowLine()}. Anchor every relative or time-sensitive reference \u2014 "today",
|
|
|
10342
10409
|
}
|
|
10343
10410
|
let res;
|
|
10344
10411
|
try {
|
|
10345
|
-
res = await this.
|
|
10412
|
+
res = await this.reflexSend(content);
|
|
10346
10413
|
} finally {
|
|
10347
10414
|
if (signal) {
|
|
10348
10415
|
this.voice.options.signal = ext;
|
|
@@ -10638,7 +10705,7 @@ Update: ${brief}`;
|
|
|
10638
10705
|
const failed = events.find((e) => /^\[task\b[^\]\n]*\bfailed\b/i.test(e));
|
|
10639
10706
|
this.resetTurn();
|
|
10640
10707
|
this.turnFollowUp = nonCleanTurn;
|
|
10641
|
-
const res = await this.
|
|
10708
|
+
const res = await this.reflexSend(events.join("\n"));
|
|
10642
10709
|
await this.endTurn(res, failed ? "Sorry, that didn't work \u2014 the task failed." : void 0);
|
|
10643
10710
|
this.notify("revoice_done", "");
|
|
10644
10711
|
});
|
|
@@ -10654,7 +10721,7 @@ Update: ${brief}`;
|
|
|
10654
10721
|
buildBrief(brief, tier = "act", deliver = true) {
|
|
10655
10722
|
const recent = this.recentExcerpt();
|
|
10656
10723
|
const verify = tier === "act" ? "\n\nBefore reporting done: re-read what you changed and check it against EVERY requirement above \u2014 fix any gap first. Your report is trusted without review." : "";
|
|
10657
|
-
const deliverContract = deliver ?
|
|
10724
|
+
const deliverContract = deliver ? '\n\n## DELIVER (spoken delivery)\nYou are reporting back to a user who is LISTENING. Stream your work normally \u2014 your prose is the written work record and detail, and is NOT spoken. Wrap anything the user should HEAR in <spoken>\u2026</spoken> tags. LEAD WITH the actual content they asked for: if they asked for a specific piece of content \u2014 a value, a name, the actual lines, the writing itself \u2014 that content goes INSIDE the <spoken> tags, not a remark about it. Your FIRST <spoken> segment is substantive \u2014 never a greeting or an acknowledgement (the front-end has already acked; do not double-ack). Keep spoken text concise and natural for the ear: short sentences, no markdown. Never read a file path, URL, command or code aloud, nor spell one out ("slash \u2026 slash \u2026") \u2014 say it the way a person would, by the name of the folder, project, file or site; the exact text stays in your written prose. ' + (this.options.spokenBudgetChars ? `Speak a SHORT summary only: at most three short sentences with the one thing that matters most, then ONE short offer that names what else you have, as a question they can answer in a word \u2014 under ${this.options.spokenBudgetChars} characters in all, the offer included. Everything else stays in your written prose (it is kept and they can ask for it); spoken text past that budget is cut and held until they ask. ` : "") + `NEVER enumerate in speech \u2014 no numbered or bulleted lists ("One. \u2026 Two. \u2026" is robotic). Deliver multiple items as flowing conversation with brief connective phrasing ("here's one\u2026", "and another\u2026", "oh, and\u2026"), pausing between items with sentence breaks, not numbers.` + (this.options.emotionTags ? " Inside <spoken>, you may prefix a sentence with an inline [emotion] tag (e.g. [excited], [curious]) to color how it is voiced \u2014 only when it genuinely fits, and vary it; [laughter] gives a natural laugh." : "") : "";
|
|
10658
10725
|
return `${nowLine()}.
|
|
10659
10726
|
|
|
10660
10727
|
` + (recent ? `${brief}
|
|
@@ -11005,6 +11072,7 @@ Another agent just implemented the above. Independently check the CURRENT state
|
|
|
11005
11072
|
run: async ({ brief, label, refines }) => {
|
|
11006
11073
|
this.spokeBeforeDispatch = this.spokeThisTurn;
|
|
11007
11074
|
this.turnDispatched = true;
|
|
11075
|
+
if (this.dispatchAt < 0) this.dispatchAt = this.reflexBuf.length;
|
|
11008
11076
|
this.turnBriefs.add(String(brief ?? ""));
|
|
11009
11077
|
this.voice.options.toolChoice = "none";
|
|
11010
11078
|
const amended = refines ? this.amendTask(String(refines), String(brief ?? "")) : void 0;
|
|
@@ -11029,6 +11097,7 @@ Another agent just implemented the above. Independently check the CURRENT state
|
|
|
11029
11097
|
run: async ({ brief, label }) => {
|
|
11030
11098
|
this.spokeBeforeDispatch = this.spokeThisTurn;
|
|
11031
11099
|
this.turnDispatched = true;
|
|
11100
|
+
if (this.dispatchAt < 0) this.dispatchAt = this.reflexBuf.length;
|
|
11032
11101
|
this.turnBriefs.add(String(brief ?? ""));
|
|
11033
11102
|
this.voice.options.toolChoice = "none";
|
|
11034
11103
|
const id = await this.dispatch(String(brief ?? ""), "think", label ? String(label) : void 0, this.turnFollowUp);
|
|
@@ -11062,7 +11131,7 @@ Another agent just implemented the above. Independently check the CURRENT state
|
|
|
11062
11131
|
const kinds = [.../* @__PURE__ */ new Set(["time", "branch", "ls", "file", "capabilities", ...Object.keys(this.options.quickLook ?? {})])];
|
|
11063
11132
|
return {
|
|
11064
11133
|
name: "QuickLook",
|
|
11065
|
-
description: `Instant read-only lookup \u2014 one of: ${kinds.join(", ")}. ` + (kinds.includes("sessions") ? '`sessions` = EARLIER conversations with this user: what:"sessions" lists them; what:"sessions" with path:"<session id>" reads one (not what:"file"). ' : "") + "For trivial facts only; anything needing search, commands, or reasoning goes through Act.",
|
|
11134
|
+
description: `Instant read-only lookup \u2014 one of: ${kinds.join(", ")}. ` + (kinds.includes("sessions") ? '`sessions` = EARLIER agentx conversations with this user (only agentx\'s own \u2014 other tools\' sessions need Act): what:"sessions" lists them; what:"sessions" with path:"<session id>" reads one (not what:"file"). ' : "") + "For trivial facts only; anything needing search, commands, or reasoning goes through Act.",
|
|
11066
11135
|
parameters: {
|
|
11067
11136
|
type: "object",
|
|
11068
11137
|
required: ["what"],
|
|
@@ -11083,7 +11152,8 @@ Another agent just implemented the above. Independently check the CURRENT state
|
|
|
11083
11152
|
const actTools = this.options.actOptions?.tools ?? [];
|
|
11084
11153
|
const names = actTools.map((t) => t.name);
|
|
11085
11154
|
const mcpServers = Object.keys(this.options.actOptions?.providerOptions?.mcpServers ?? {});
|
|
11086
|
-
const
|
|
11155
|
+
const terms = this.options.sttTerms?.() ?? [];
|
|
11156
|
+
const mcpNote = (mcpServers.length ? ` Plus MCP servers your worker can use: ${mcpServers.join(", ")} (e.g. browser-bridge \u2192 drive a real browser: open tabs, navigate, click, screenshot).` : "") + (terms.length ? ` Speech-to-text is primed with these known words (from memory names + the project; refreshed when voice starts): ${terms.join(", ")}.` : "");
|
|
11087
11157
|
if (!names.length)
|
|
11088
11158
|
return "Your worker uses Act's default local toolset (reading/editing files, running shell commands). No extra tools (e.g. web/internet) are configured; if a request is not a basic file or shell operation, assume you can't do it and say so." + mcpNote;
|
|
11089
11159
|
const hasFetch = names.some((n) => /WebFetch/i.test(n));
|