agent.libx.js 0.93.23 → 0.93.25

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
@@ -347,14 +347,28 @@ interface WebFetchOptions {
347
347
  declare function makeWebFetchTool(options?: WebFetchOptions): AgentTool;
348
348
  interface WebSearchOptions {
349
349
  fetch?: typeof globalThis.fetch;
350
- /** API key for the search provider (default: process.env.TAVILY_API_KEY). */
350
+ /** Provider: 'auto' (default) uses Tavily if an API key is present, else keyless DuckDuckGo. */
351
+ provider?: 'auto' | 'tavily' | 'duckduckgo';
352
+ /** API key for Tavily (default: process.env.TAVILY_API_KEY). */
351
353
  apiKey?: string;
352
- /** Provider endpoint (default: Tavily, an agent-oriented search API). */
354
+ /** Tavily endpoint override. */
353
355
  endpoint?: string;
354
356
  maxResults?: number;
355
357
  timeoutMs?: number;
356
358
  }
357
- /** Build a WebSearch tool backed by a configured provider (Tavily by default). */
359
+ interface SearchHit {
360
+ title: string;
361
+ url: string;
362
+ snippet: string;
363
+ }
364
+ /** Decode a DuckDuckGo HTML result href: results are `//duckduckgo.com/l/?uddg=<encoded-target>` redirects. */
365
+ declare function decodeDdgUrl(href: string): string;
366
+ /** Parse DuckDuckGo's HTML results page into hits (title/url/snippet) — dependency-free, zips anchors to snippets in order. */
367
+ declare function parseDdgHtml(html: string, max: number): SearchHit[];
368
+ /**
369
+ * Build a WebSearch tool. Keyless by default (DuckDuckGo HTML) so it works in any deployment with
370
+ * no setup; auto-upgrades to Tavily (better, agent-oriented results) when TAVILY_API_KEY is present.
371
+ */
358
372
  declare function makeWebSearchTool(options?: WebSearchOptions): AgentTool;
359
373
  /** Default instances (registered in the tool registry; opt-in by name). */
360
374
  declare const webFetchTool: AgentTool;
@@ -1061,4 +1075,4 @@ declare class CartesiaTTS {
1061
1075
  close(): void;
1062
1076
  }
1063
1077
 
1064
- export { Agent, type AgentDef, AgentOptions, AgentTool, type Attempt, type AudioSink, type AudioSource, type AuthProvider, BodDbFilesystem, CartesiaTTS, CartesiaTTSOptions, ChatLike, ChatOptions, ChatResponse, type CommandInfo, ConsoleHostBridge, DEFAULT_DENY, DuplexAgent, DuplexAgentOptions, type DuplexTaskStatus, FakeAIClient, Hooks, HostBridge, JailOptions, JailedFilesystem, type LessonOptions, LessonOptionsDefaults, type LoadMemoryOpts, MEMORY_PROMPT, MessageContent, type Mount, MountFilesystem, NodeDiskFilesystem, OverlayFilesystem, type ReflectOptions, RunResult, STT_SAMPLE_RATE, ScriptedHostBridge, type SkillInfo, SonioxSTT, SonioxSTTOptions, type SttLike, TTS_SAMPLE_RATE, type TaskRecord, type TaskToolOptions, ToolCall, type ToolSpec, type TtsLike, UserQuestion, VOICE_MEMORY_PROMPT, VOICE_SYSTEM_PROMPT, VoiceEngine, VoiceEngineOptions, type VoiceState, type WebFetchOptions, type WebSearchOptions, type WorkerTier, applyEditsTool, askUserQuestionTool, checkpointTool, checkpointTools, compileSynthesizedTool, diskAgentOptions, expandCommand, expandTemplate, forComponent, fullAgentOptions, globTool, grepTool, htmlToText, idfWeights, lessonCapture, loadAgents, loadCommands, loadInstructions, loadMemory, loadSkills, makeTaskBatchTool, makeTaskTool, makeWebFetchTool, makeWebSearchTool, mkdirp, multiEditTool, raceAttempts, reflectOnRun, relevanceScore, repoIndex, repoMapTool, resolveAuth, rollbackTool, sandboxAgentOptions, slugify, tokenize, toolCall, topByRelevance, validateToolCode, webFetchTool, webSearchTool, writeFact, writeTool };
1078
+ export { Agent, type AgentDef, AgentOptions, AgentTool, type Attempt, type AudioSink, type AudioSource, type AuthProvider, BodDbFilesystem, CartesiaTTS, CartesiaTTSOptions, ChatLike, ChatOptions, ChatResponse, type CommandInfo, ConsoleHostBridge, DEFAULT_DENY, DuplexAgent, DuplexAgentOptions, type DuplexTaskStatus, FakeAIClient, Hooks, HostBridge, JailOptions, JailedFilesystem, type LessonOptions, LessonOptionsDefaults, type LoadMemoryOpts, MEMORY_PROMPT, MessageContent, type Mount, MountFilesystem, NodeDiskFilesystem, OverlayFilesystem, type ReflectOptions, RunResult, STT_SAMPLE_RATE, ScriptedHostBridge, type SkillInfo, SonioxSTT, SonioxSTTOptions, type SttLike, TTS_SAMPLE_RATE, type TaskRecord, type TaskToolOptions, ToolCall, type ToolSpec, type TtsLike, UserQuestion, VOICE_MEMORY_PROMPT, VOICE_SYSTEM_PROMPT, VoiceEngine, VoiceEngineOptions, type VoiceState, type WebFetchOptions, type WebSearchOptions, type WorkerTier, applyEditsTool, askUserQuestionTool, checkpointTool, checkpointTools, compileSynthesizedTool, decodeDdgUrl, diskAgentOptions, expandCommand, expandTemplate, forComponent, fullAgentOptions, globTool, grepTool, htmlToText, idfWeights, lessonCapture, loadAgents, loadCommands, loadInstructions, loadMemory, loadSkills, makeTaskBatchTool, makeTaskTool, makeWebFetchTool, makeWebSearchTool, mkdirp, multiEditTool, parseDdgHtml, raceAttempts, reflectOnRun, relevanceScore, repoIndex, repoMapTool, resolveAuth, rollbackTool, sandboxAgentOptions, slugify, tokenize, toolCall, topByRelevance, validateToolCode, webFetchTool, webSearchTool, writeFact, writeTool };
package/dist/index.js CHANGED
@@ -595,35 +595,75 @@ ${capped}`;
595
595
  }
596
596
  };
597
597
  }
598
+ function decodeDdgUrl(href) {
599
+ const m = href.match(/[?&]uddg=([^&]+)/);
600
+ if (m) {
601
+ try {
602
+ return decodeURIComponent(m[1]);
603
+ } catch {
604
+ }
605
+ }
606
+ return href.startsWith("//") ? "https:" + href : href;
607
+ }
608
+ function parseDdgHtml(html, max) {
609
+ const anchors = [...html.matchAll(/<a[^>]*class="[^"]*result__a[^"]*"[^>]*href="([^"]+)"[^>]*>([\s\S]*?)<\/a>/g)];
610
+ const snippets = [...html.matchAll(/<a[^>]*class="[^"]*result__snippet[^"]*"[^>]*>([\s\S]*?)<\/a>/g)].map((m) => htmlToText(m[1]));
611
+ const hits = [];
612
+ for (let i = 0; i < anchors.length && hits.length < max; i++) {
613
+ const url = decodeDdgUrl(anchors[i][1]);
614
+ try {
615
+ if (isPrivateHost(new URL(url).hostname)) continue;
616
+ } catch {
617
+ continue;
618
+ }
619
+ hits.push({ title: htmlToText(anchors[i][2]) || "(untitled)", url, snippet: snippets[i] ?? "" });
620
+ }
621
+ return hits;
622
+ }
623
+ function formatHits(hits) {
624
+ if (!hits.length) return "(no results)";
625
+ return hits.map((r, i) => `${i + 1}. ${r.title}
626
+ ${r.url}
627
+ ${r.snippet.replace(/\s+/g, " ").slice(0, 240)}`).join("\n\n");
628
+ }
598
629
  function makeWebSearchTool(options = {}) {
599
- const endpoint = options.endpoint ?? "https://api.tavily.com/search";
630
+ const tavilyEndpoint = options.endpoint ?? "https://api.tavily.com/search";
600
631
  const maxResults = options.maxResults ?? 5;
601
632
  const timeoutMs = options.timeoutMs ?? 15e3;
602
633
  return {
603
634
  name: "WebSearch",
604
- description: "Search the web; returns ranked results (title, URL, snippet). Requires a configured provider \u2014 set TAVILY_API_KEY to enable.",
635
+ description: "Search the web by query; returns ranked results (title, URL, snippet). Use to look things up, find pages, or research a topic \u2014 then WebFetch a result URL to read it in full.",
605
636
  parameters: { type: "object", required: ["query"], properties: { query: { type: "string" } } },
606
637
  async run({ query }) {
607
638
  const doFetch = options.fetch ?? globalThis.fetch;
608
- const key = options.apiKey ?? process.env.TAVILY_API_KEY;
609
- if (!key) return "Error: WebSearch is not configured. Set TAVILY_API_KEY (https://tavily.com) to enable web search.";
610
639
  if (!doFetch) return "Error: no network (fetch) available in this runtime";
640
+ const q = String(query ?? "").trim();
641
+ if (!q) return "Error: empty query";
642
+ const key = options.apiKey ?? process.env.TAVILY_API_KEY;
643
+ const provider = options.provider ?? "auto";
644
+ const useTavily = provider === "tavily" || provider === "auto" && !!key;
611
645
  const ctl = new AbortController();
612
646
  const timer = setTimeout(() => ctl.abort(), timeoutMs);
613
647
  try {
614
- const res = await doFetch(endpoint, {
615
- method: "POST",
648
+ if (useTavily) {
649
+ if (!key) return "Error: Tavily provider selected but TAVILY_API_KEY is not set";
650
+ const res2 = await doFetch(tavilyEndpoint, {
651
+ method: "POST",
652
+ signal: ctl.signal,
653
+ headers: { "content-type": "application/json" },
654
+ body: JSON.stringify({ api_key: key, query: q, max_results: maxResults })
655
+ });
656
+ if (!res2.ok) return `Error: search provider returned ${res2.status} ${res2.statusText}`;
657
+ const data = await res2.json();
658
+ const results = Array.isArray(data?.results) ? data.results.slice(0, maxResults) : [];
659
+ return formatHits(results.map((r) => ({ title: r.title ?? "(untitled)", url: r.url ?? "", snippet: String(r.content ?? "") })));
660
+ }
661
+ const res = await doFetch("https://html.duckduckgo.com/html/?q=" + encodeURIComponent(q), {
616
662
  signal: ctl.signal,
617
- headers: { "content-type": "application/json" },
618
- body: JSON.stringify({ api_key: key, query: String(query ?? ""), max_results: maxResults })
663
+ headers: { "user-agent": "Mozilla/5.0 (compatible; agentx/1.0; +https://github.com/Livshitz/agent.libx.js)" }
619
664
  });
620
- if (!res.ok) return `Error: search provider returned ${res.status} ${res.statusText}`;
621
- const data = await res.json();
622
- const results = Array.isArray(data?.results) ? data.results.slice(0, maxResults) : [];
623
- if (!results.length) return "(no results)";
624
- return results.map((r, i) => `${i + 1}. ${r.title ?? "(untitled)"}
625
- ${r.url ?? ""}
626
- ${String(r.content ?? "").replace(/\s+/g, " ").slice(0, 240)}`).join("\n\n");
665
+ if (!res.ok) return `Error: search returned ${res.status} ${res.statusText}`;
666
+ return formatHits(parseDdgHtml(await res.text(), maxResults));
627
667
  } catch (e) {
628
668
  log2.debug("WebSearch failed", e);
629
669
  return `Error searching: ${e?.name === "AbortError" ? `timed out after ${timeoutMs}ms` : e?.message ?? e}`;
@@ -3663,7 +3703,7 @@ var DuplexAgentOptions = class {
3663
3703
  /** User-scope memory dir for global facts (type=user/feedback). Forwarded to Remember's routing. */
3664
3704
  memoryUserDir;
3665
3705
  };
3666
- 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.\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 (typically files and shell; other tools such as web access only if this deployment wired them). 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 (e.g. web search, live data) 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.\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.\nResults arrive later as events like "[task t1 completed] \u2026" or "[task t1 failed] \u2026". When one arrives, summarize it for the ear in one or two short sentences. "[task t1 progress] \u2026" events are interim status, NOT results \u2014 give at most a half-sentence aside ("still on it \u2014 running tests now") and end your turn. 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 arrives ONLY in the "[task \u2026 completed]" event; 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.\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 trailing off mid-sentence, a fragment that needs more context ("and then we", "but the problem is"), hesitation fillers ("uh", "um") \u2014 call `Hold` instead of answering. 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, just say "still on it" and end the turn \u2014 never poll it again and again in a loop. Use `CancelTask` when the user asks to stop something.\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 and can carry transcription artifacts \u2014 odd words, cut-offs, homophones ("for you" vs "folder"). Read for INTENT, not surface text. If a message seems garbled or surprising, briefly confirm what they meant ("did you mean\u2026?") instead of answering the literal words.';
3706
+ 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.\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.\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.\nResults arrive later as events like "[task t1 completed] \u2026" or "[task t1 failed] \u2026". When one arrives, summarize it for the ear in one or two short sentences. "[task t1 progress] \u2026" events are interim status, NOT results \u2014 give at most a half-sentence aside ("still on it \u2014 running tests now") and end your turn. 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 arrives ONLY in the "[task \u2026 completed]" event; 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.\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 trailing off mid-sentence, a fragment that needs more context ("and then we", "but the problem is"), hesitation fillers ("uh", "um") \u2014 call `Hold` instead of answering. 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, just say "still on it" and end the turn \u2014 never poll it again and again in a loop. Use `CancelTask` when the user asks to stop something.\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 and can carry transcription artifacts \u2014 odd words, cut-offs, homophones ("for you" vs "folder"). Read for INTENT, not surface text. If a message seems garbled or surprising, briefly confirm what they meant ("did you mean\u2026?") instead of answering the literal words.';
3667
3707
  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.";
3668
3708
  var THINK_DISABLED_GUIDANCE = "(Think tier is not available \u2014 use Act for all escalations.)";
3669
3709
  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).`;
@@ -3698,7 +3738,11 @@ var DuplexAgent = class {
3698
3738
  }
3699
3739
  const memSlot = o.memoryDir && o.fs ? VOICE_MEMORY_PROMPT : "NEVER claim to have stored, saved, or remembered something durably \u2014 you cannot. Anything the user wants persisted (their name, preferences, notes) must go through Act so a worker writes it to memory.";
3700
3740
  const thinkSlot = o.thinkModel !== false ? THINK_GUIDANCE : THINK_DISABLED_GUIDANCE;
3701
- const prompt = VOICE_SYSTEM_PROMPT.replace("{{MEMORY_SLOT}}", memSlot).replace("{{THINK_SLOT}}", thinkSlot) + (o.voiceStyle === "conversational" ? "\n" + VOICE_STYLE_CONVERSATIONAL : "") + `
3741
+ const workerToolNames = (o.actOptions?.tools ?? []).map((t) => t.name);
3742
+ const canSearch = workerToolNames.some((n) => /WebSearch/i.test(n));
3743
+ const canFetch = workerToolNames.some((n) => /WebFetch/i.test(n));
3744
+ const workerWeb = canSearch ? `, and it CAN search the web and read web pages \u2014 so when the user gives you something specific to look up ("search for X", "find me\u2026", "what's the latest on\u2026"), route it to Act. But a bare capability QUESTION like "can you search the web?" just gets a short spoken "yes, I can" \u2014 do NOT dispatch and NEVER invent a query the user did not give you` : canFetch ? ", and it can fetch a specific web page URL (but cannot search the web)" : "";
3745
+ const prompt = VOICE_SYSTEM_PROMPT.replace("{{MEMORY_SLOT}}", memSlot).replace("{{THINK_SLOT}}", thinkSlot).replace("{{WORKER_WEB}}", workerWeb) + (o.voiceStyle === "conversational" ? "\n" + VOICE_STYLE_CONVERSATIONAL : "") + `
3702
3746
  Today's date: ${(/* @__PURE__ */ new Date()).toDateString()}.`;
3703
3747
  const tools = [
3704
3748
  ...o.reflexOptions?.tools ?? [],
@@ -5132,6 +5176,7 @@ export {
5132
5176
  compileSynthesizedTool,
5133
5177
  composeHooks,
5134
5178
  contentText,
5179
+ decodeDdgUrl,
5135
5180
  defaultTools,
5136
5181
  diskAgentOptions,
5137
5182
  editTool,
@@ -5165,6 +5210,7 @@ export {
5165
5210
  mcpToolsToAgentTools,
5166
5211
  mkdirp,
5167
5212
  multiEditTool,
5213
+ parseDdgHtml,
5168
5214
  planMode,
5169
5215
  raceAttempts,
5170
5216
  readTool,