@voicethere/agent 0.20.0 → 0.21.0

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.
@@ -35149,15 +35149,26 @@ ${validated.errors.map((e) => `${e.path || "(root)"}: ${e.message}`).join("\n")}
35149
35149
  function replyOpts(t) {
35150
35150
  return t.inReplyTo ? { turnId: t.turnId, inReplyTo: t.inReplyTo } : { turnId: t.turnId };
35151
35151
  }
35152
- function sendReplyDelta(s, t, text) {
35153
- sendToClient(s.sessionId, t.source === "chat" ? { type: "assistant_delta", turnId: t.turnId, text } : {
35152
+ function sendSpokenDelta(sessionId, turnId, text, inReplyTo) {
35153
+ sendToClient(sessionId, {
35154
35154
  type: "assistant_delta",
35155
- turnId: t.turnId,
35155
+ turnId,
35156
35156
  text,
35157
35157
  spoken: true,
35158
- ...t.inReplyTo ? { inReplyTo: t.inReplyTo } : {}
35158
+ ...inReplyTo ? { inReplyTo } : {}
35159
35159
  });
35160
35160
  }
35161
+ function sendReplyDelta(s, t, text) {
35162
+ if (t.source === "chat") {
35163
+ sendToClient(s.sessionId, {
35164
+ type: "assistant_delta",
35165
+ turnId: t.turnId,
35166
+ text
35167
+ });
35168
+ } else {
35169
+ sendSpokenDelta(s.sessionId, t.turnId, text, t.inReplyTo);
35170
+ }
35171
+ }
35161
35172
  function deliver(s, t, text, interruptible = true) {
35162
35173
  flushSpeech(s, t);
35163
35174
  t.spoken.push(text);
@@ -35174,9 +35185,23 @@ ${validated.errors.map((e) => `${e.path || "(root)"}: ${e.message}`).join("\n")}
35174
35185
  }
35175
35186
  function speakAnnouncement(s, turnId, text, interruptible) {
35176
35187
  if (interruptible) {
35177
- speak(s.sessionId, text, { turnId });
35178
- } else {
35179
- trackAnnouncement(s, announce(s.sessionId, text, { turnId }).done);
35188
+ return speak(s.sessionId, text, { turnId });
35189
+ }
35190
+ const h = announce(s.sessionId, text, { turnId });
35191
+ trackAnnouncement(s, h.done);
35192
+ return h;
35193
+ }
35194
+ function greetingDoneStatus(status) {
35195
+ switch (status) {
35196
+ case "played":
35197
+ case "unsupported":
35198
+ return "completed";
35199
+ case "interrupted":
35200
+ return "interrupted";
35201
+ case "cancelled":
35202
+ return "cancelled";
35203
+ case "failed":
35204
+ return "failed";
35180
35205
  }
35181
35206
  }
35182
35207
  function clearFillerTimer(t, kind) {
@@ -35983,7 +36008,22 @@ ${t.inputText}` : t.inputText, {
35983
36008
  if (greeting) {
35984
36009
  const turnId = `greet-${randomUUID3()}`;
35985
36010
  s.history.addAssistant({ role: "assistant", text: greeting.text }, { turnId });
35986
- speakAnnouncement(s, turnId, greeting.text, greeting.interruptible ?? D.greetingInterruptible);
36011
+ sendSpokenDelta(s.sessionId, turnId, greeting.text);
36012
+ const handle = speakAnnouncement(s, turnId, greeting.text, greeting.interruptible ?? D.greetingInterruptible);
36013
+ void handle.done.then((result) => {
36014
+ if (s.ended)
36015
+ return;
36016
+ if (result.errorCode === "session_ended" || result.errorCode === "reset") {
36017
+ return;
36018
+ }
36019
+ sendToClient(s.sessionId, {
36020
+ type: "assistant_done",
36021
+ turnId,
36022
+ text: greeting.text,
36023
+ spoken: true,
36024
+ status: greetingDoneStatus(result.status)
36025
+ });
36026
+ });
35987
36027
  }
35988
36028
  },
35989
36029
  onUserSpeechFinal(ctx) {
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/templates/registry.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,KAAK,CAAC;AAE7C,MAAM,MAAM,gBAAgB,GACxB,OAAO,GACP,MAAM,GACN,YAAY,GACZ,aAAa,GACb,OAAO,CAAC;AAEZ,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,mFAAmF;IACnF,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,YAAY,CAAC;IACnB,mFAAmF;IACnF,YAAY,EAAE,OAAO,CAAC;IACtB,wCAAwC;IACxC,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,EAAE,CAAC;IACtB,oFAAoF;IACpF,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC1C;AAED,eAAO,MAAM,eAAe,EAAE,SAAS,uBAAuB,EA0UpD,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC;AAMrE,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,EAAE,IAAI,eAAe,CAEnE;AAED,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,uBAAuB,CAMnE;AAED,wBAAgB,yBAAyB,IAAI,uBAAuB,EAAE,CAErE"}
@@ -223,6 +223,31 @@ export const AGENT_TEMPLATES = [
223
223
  ioredis: "^5.11.1",
224
224
  },
225
225
  },
226
+ {
227
+ id: "llm-docs-rag",
228
+ entry: "llm-docs-rag/agent.ts",
229
+ kind: "product",
230
+ seedOnCreate: true,
231
+ title: "LLM agent + docs search",
232
+ summary: "LLM agent that answers from your docs through a project service with hybrid vector and full-text search.",
233
+ category: "voice-data",
234
+ description: "Same LLM agent as llm-agent, wired to a docs search service as its tool source (toolSources kind service, path /mcp, tools search_docs and get_doc). The README shows how to build your docs into the public docs-rag-mcp base image and set it as the project service. The prompt searches before it states a fact and cites the page URL.",
235
+ sourceFiles: [
236
+ "llm-docs-rag/agent.ts",
237
+ "llm-docs-rag/voicethere.llm.json",
238
+ "llm-docs-rag/prompt.md",
239
+ "llm-docs-rag/tools.ts",
240
+ "llm-docs-rag/hooks.ts",
241
+ "llm-docs-rag/md.d.ts",
242
+ ],
243
+ npmDependencies: {
244
+ openai: "^7.43.0",
245
+ "@anthropic-ai/sdk": "^1.3.0",
246
+ "@google/genai": "^2.31.0",
247
+ "@modelcontextprotocol/sdk": "^1.32.2",
248
+ ioredis: "^5.11.1",
249
+ },
250
+ },
226
251
  {
227
252
  id: "echo-smoke",
228
253
  entry: "echo-smoke/agent.ts",
@@ -1 +1 @@
1
- {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/templates/registry.ts"],"names":[],"mappings":"AA6BA,MAAM,CAAC,MAAM,eAAe,GAAuC;IACjE;QACE,EAAE,EAAE,MAAM;QACV,KAAK,EAAE,eAAe;QACtB,IAAI,EAAE,SAAS;QACf,YAAY,EAAE,IAAI;QAClB,KAAK,EAAE,qBAAqB;QAC5B,OAAO,EAAE,0DAA0D;QACnE,QAAQ,EAAE,OAAO;QACjB,WAAW,EACT,8EAA8E;QAChF,WAAW,EAAE,CAAC,eAAe,CAAC;KAC/B;IACD;QACE,EAAE,EAAE,SAAS;QACb,KAAK,EAAE,kBAAkB;QACzB,IAAI,EAAE,SAAS;QACf,YAAY,EAAE,IAAI;QAClB,KAAK,EAAE,6BAA6B;QACpC,OAAO,EAAE,2CAA2C;QACpD,QAAQ,EAAE,OAAO;QACjB,WAAW,EACT,qEAAqE;QACvE,WAAW,EAAE,CAAC,kBAAkB,CAAC;KAClC;IACD;QACE,EAAE,EAAE,iBAAiB;QACrB,KAAK,EAAE,0BAA0B;QACjC,IAAI,EAAE,SAAS;QACf,YAAY,EAAE,IAAI;QAClB,KAAK,EAAE,iBAAiB;QACxB,OAAO,EAAE,qIAAqI;QAC9I,QAAQ,EAAE,OAAO;QACjB,WAAW,EACT,qVAAqV;QACvV,WAAW,EAAE,CAAC,0BAA0B,CAAC;KAC1C;IACD;QACE,EAAE,EAAE,eAAe;QACnB,KAAK,EAAE,wBAAwB;QAC/B,IAAI,EAAE,SAAS;QACf,YAAY,EAAE,IAAI;QAClB,KAAK,EAAE,eAAe;QACtB,OAAO,EAAE,4CAA4C;QACrD,QAAQ,EAAE,OAAO;QACjB,WAAW,EACT,uFAAuF;QACzF,WAAW,EAAE,CAAC,wBAAwB,CAAC;KACxC;IACD;QACE,EAAE,EAAE,YAAY;QAChB,KAAK,EAAE,qBAAqB;QAC5B,IAAI,EAAE,SAAS;QACf,YAAY,EAAE,IAAI;QAClB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EAAE,CAAC,CAAC;IACxC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,8BAA8B,EAAE,EAAE,CAAC,CAAC;IACtD,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,yBAAyB;IACvC,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;AACrE,CAAC"}
package/eject/llm/loop.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Copied from @voicethere/agent 0.20.0. Package updates no longer change this file.
1
+ // Copied from @voicethere/agent 0.21.0. Package updates no longer change this file.
2
2
  import { randomUUID } from "node:crypto";
3
3
  import {
4
4
  type AgentHandlers,
@@ -12,6 +12,8 @@ import {
12
12
  setAgentState,
13
13
  setBargeIn,
14
14
  speak,
15
+ type SpeakHandle,
16
+ type SpeakResultStatus,
15
17
  } from "@voicethere/agent";
16
18
  import {
17
19
  ConversationHistory,
@@ -293,19 +295,31 @@ export function createLlmAgent(opts: CreateLlmAgentOptions): AgentHandlers {
293
295
  * The one place where reply text reaches the client as `assistant_delta`.
294
296
  * Chat deltas are unchanged; voice turns add `spoken: true`.
295
297
  */
298
+ function sendSpokenDelta(
299
+ sessionId: string,
300
+ turnId: string,
301
+ text: string,
302
+ inReplyTo?: string,
303
+ ): void {
304
+ sendToClient(sessionId, {
305
+ type: "assistant_delta",
306
+ turnId,
307
+ text,
308
+ spoken: true,
309
+ ...(inReplyTo ? { inReplyTo } : {}),
310
+ });
311
+ }
312
+
296
313
  function sendReplyDelta(s: SessionState, t: TurnState, text: string): void {
297
- sendToClient(
298
- s.sessionId,
299
- t.source === "chat"
300
- ? { type: "assistant_delta", turnId: t.turnId, text }
301
- : {
302
- type: "assistant_delta",
303
- turnId: t.turnId,
304
- text,
305
- spoken: true,
306
- ...(t.inReplyTo ? { inReplyTo: t.inReplyTo } : {}),
307
- },
308
- );
314
+ if (t.source === "chat") {
315
+ sendToClient(s.sessionId, {
316
+ type: "assistant_delta",
317
+ turnId: t.turnId,
318
+ text,
319
+ });
320
+ } else {
321
+ sendSpokenDelta(s.sessionId, t.turnId, text, t.inReplyTo);
322
+ }
309
323
  }
310
324
 
311
325
  /** The one place where a sentence of a reply leaves the agent. */
@@ -334,11 +348,28 @@ export function createLlmAgent(opts: CreateLlmAgentOptions): AgentHandlers {
334
348
  turnId: string,
335
349
  text: string,
336
350
  interruptible: boolean,
337
- ): void {
351
+ ): SpeakHandle {
338
352
  if (interruptible) {
339
- speak(s.sessionId, text, { turnId });
340
- } else {
341
- trackAnnouncement(s, announce(s.sessionId, text, { turnId }).done);
353
+ return speak(s.sessionId, text, { turnId });
354
+ }
355
+ const h = announce(s.sessionId, text, { turnId });
356
+ trackAnnouncement(s, h.done);
357
+ return h;
358
+ }
359
+
360
+ function greetingDoneStatus(
361
+ status: SpeakResultStatus,
362
+ ): "completed" | "interrupted" | "cancelled" | "failed" {
363
+ switch (status) {
364
+ case "played":
365
+ case "unsupported":
366
+ return "completed";
367
+ case "interrupted":
368
+ return "interrupted";
369
+ case "cancelled":
370
+ return "cancelled";
371
+ case "failed":
372
+ return "failed";
342
373
  }
343
374
  }
344
375
 
@@ -1339,12 +1370,31 @@ export function createLlmAgent(opts: CreateLlmAgentOptions): AgentHandlers {
1339
1370
  { role: "assistant", text: greeting.text },
1340
1371
  { turnId },
1341
1372
  );
1342
- speakAnnouncement(
1373
+ sendSpokenDelta(s.sessionId, turnId, greeting.text);
1374
+ const handle = speakAnnouncement(
1343
1375
  s,
1344
1376
  turnId,
1345
1377
  greeting.text,
1346
1378
  greeting.interruptible ?? D.greetingInterruptible,
1347
1379
  );
1380
+ void handle.done.then((result) => {
1381
+ if (s.ended) return;
1382
+ // The runtime cancels pending speaks when the session ends or is
1383
+ // reset; that is teardown, not a greeting outcome.
1384
+ if (
1385
+ result.errorCode === "session_ended" ||
1386
+ result.errorCode === "reset"
1387
+ ) {
1388
+ return;
1389
+ }
1390
+ sendToClient(s.sessionId, {
1391
+ type: "assistant_done",
1392
+ turnId,
1393
+ text: greeting.text,
1394
+ spoken: true,
1395
+ status: greetingDoneStatus(result.status),
1396
+ });
1397
+ });
1348
1398
  }
1349
1399
  },
1350
1400
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voicethere/agent",
3
- "version": "0.20.0",
3
+ "version": "0.21.0",
4
4
  "description": "VoiceThere customer agent SDK — IPC types and runtime helpers for sandboxed child bundles",
5
5
  "type": "module",
6
6
  "exports": {
@@ -76,6 +76,7 @@ Each folder has its own README. Summary:
76
76
  | `webhooks-redis` | `webhooks-redis/` | Webhooks plus Redis counter |
77
77
  | `llm-agent` | `llm-agent/` | LLM voice and chat agent, tools, MCP, optional knowledge (RAG) |
78
78
  | `llm-mcp-service` | `llm-mcp-service/` | `llm-agent` plus a project service that serves MCP tools |
79
+ | `llm-docs-rag` | `llm-docs-rag/` | `llm-agent` answering from your docs via the `docs-rag-mcp` image |
79
80
 
80
81
  ## E2e templates
81
82
 
@@ -0,0 +1,49 @@
1
+ # llm-docs-rag
2
+
3
+ An LLM agent that answers questions about your own documentation. The docs live in a project service that runs the `docs-rag-mcp` image: a read-only index with vector search and full-text search, baked into the image next to a small embedding model. The agent lists the service's tools at `/mcp` (`toolSources: [{ "kind": "service", "path": "/mcp", "allow": ["search_docs", "get_doc"] }]` in `voicethere.llm.json`), and the prompt tells the model to call `search_docs` before it states any product fact and to name the page URL. Retrieval inside the agent (`knowledge`) stays off. Source: `templates/llm-docs-rag/agent.ts`.
4
+
5
+ Search runs in the service. No API key, no outside call and no runtime write: the index is built when you build the image.
6
+
7
+ ## Build your docs image
8
+
9
+ 1. Put your Markdown files in a `docs/` folder. The page id is the file path, the title is the first `#` heading.
10
+ 2. Copy `Dockerfile.customer` from the `services/docs-rag-mcp/examples` folder of the `@voicethere/agent` repository next to `docs/`, then build and push it:
11
+
12
+ ```bash
13
+ docker build -f Dockerfile.customer \
14
+ --build-arg BASE=ghcr.io/voicethere/docs-rag-mcp:<version> \
15
+ --build-arg BASE_URL=https://docs.example.com/ \
16
+ -t registry.example.com/acme/docs-mcp:1 .
17
+ docker push registry.example.com/acme/docs-mcp:1
18
+ ```
19
+
20
+ `BASE_URL` is optional. With it, each page gets a URL (`BASE_URL` plus the file path without `.md`), and the agent can read it out. Use a release tag of the base image, or `latest`.
21
+
22
+ To get a corpus from rendered pages instead of Markdown files, pass a JSON file with `docs-rag build --corpus corpus.json --out /index`; the format is in the service README.
23
+
24
+ ## Set the project service
25
+
26
+ In the dashboard, open **Services** and set:
27
+
28
+ - Image: the one you pushed. A public image needs no registry credential.
29
+ - Port: `8080`, HTTP health check path `/healthz`
30
+ - CPU 500 m and memory 1024 MiB are a safe start; the service takes about 260 MiB after the first searches. Choose "always on" so the first caller does not wait for a cold start.
31
+
32
+ Redeploy the project. The agent connects to `/mcp` on the service with the project's service token and discovers `search_docs` and `get_doc`; the agent log shows an `llm tools discovered` line.
33
+
34
+ ## Make it yours
35
+
36
+ - Tool names and the search tool's description are set with environment variables on the image: `DOCS_RAG_TOOL_PREFIX` (for example `acme_`, which gives `acme_search_docs` and `acme_get_doc`; update `allow` and the prompt to match) and `DOCS_RAG_DESCRIPTION` (for example `Search the Acme docs`).
37
+ - Edit `prompt.md` for tone and scope. Keep the rule that the model searches before it states a fact.
38
+ - Set the provider, model and API key as in the `llm-agent` template: the template starts on OpenRouter with `amazon/nova-micro-v1`, key `AGENT_OPENROUTER_API_KEY` (a project secret).
39
+
40
+ ## Files
41
+
42
+ - `agent.ts` wires the pieces together. You rarely need to change it.
43
+ - `voicethere.llm.json` holds the provider, model, greeting, barge-in, history and tool settings. The dashboard LLM tab edits this file.
44
+ - `prompt.md` is the system prompt.
45
+ - `tools.ts` lists your own tools. It is empty: the docs tools come from the service.
46
+ - `hooks.ts` is where you adjust a turn in code. It is empty by default.
47
+ - `md.d.ts` lets TypeScript accept `import prompt from "./prompt.md"`.
48
+
49
+ See the docs page `/docs/llm-agents` for the full list of settings.
@@ -0,0 +1,27 @@
1
+ import { defineAgent } from "@voicethere/agent";
2
+ import { createLlmAgent } from "@voicethere/agent/llm";
3
+ import { openai } from "@voicethere/agent/llm/openai";
4
+ import config from "./voicethere.llm.json";
5
+ import systemPrompt from "./prompt.md";
6
+ import { tools } from "./tools";
7
+ import { hooks } from "./hooks";
8
+
9
+ // The template runs on OpenRouter, which is served by the openai module, so
10
+ // switching between openai and openrouter needs no import change. To use
11
+ // another provider, change "provider" in voicethere.llm.json and import its
12
+ // module instead:
13
+ // anthropic → import { anthropic } from "@voicethere/agent/llm/anthropic";
14
+ // gemini → import { gemini } from "@voicethere/agent/llm/gemini";
15
+ //
16
+ // The docs come from a project service that runs the docs-rag-mcp image
17
+ // (toolSources in voicethere.llm.json), so knowledge (RAG inside the agent)
18
+ // stays off.
19
+ defineAgent(
20
+ createLlmAgent({
21
+ config,
22
+ systemPrompt,
23
+ tools,
24
+ hooks,
25
+ providers: [openai],
26
+ }),
27
+ );
@@ -0,0 +1,21 @@
1
+ import type { LlmAgentHooks } from "@voicethere/agent/llm";
2
+
3
+ export const hooks: LlmAgentHooks = {};
4
+
5
+ // Example: rewrite or drop a sentence before it is spoken.
6
+ //
7
+ // export const hooks: LlmAgentHooks = {
8
+ // onAssistantText: (text) => text.replace(/\*+/g, ""),
9
+ // };
10
+ //
11
+ // Example: take over a turn, then fall back to the model.
12
+ //
13
+ // export const hooks: LlmAgentHooks = {
14
+ // respond: async (ctx, next) => {
15
+ // if (/^(bye|goodbye)\b/i.test(ctx.inputText)) {
16
+ // ctx.speak("Goodbye!");
17
+ // return;
18
+ // }
19
+ // return next();
20
+ // },
21
+ // };
@@ -0,0 +1,4 @@
1
+ declare module "*.md" {
2
+ const text: string;
3
+ export default text;
4
+ }
@@ -0,0 +1,17 @@
1
+ You are a helpful assistant that answers questions about our documentation. People may talk to you by voice, so everything you say can be read aloud.
2
+
3
+ Call search_docs before you state any fact about the product: prices, limits, settings, commands, names or steps. Answer from what the search returns and give the number or name as the page shows it. If the first search does not answer the question, search again with different words, or call get_doc with the page id of the best hit to read the whole page.
4
+
5
+ Name the page you used and say its URL. If the search finds nothing relevant, say you could not find it in the documentation instead of guessing.
6
+
7
+ Answer in short, spoken sentences. Two or three sentences are usually enough. Do not use markdown, bullet lists, headings, emoji or special characters, because they sound wrong when spoken. Say prices and dates the way a person would, and round long numbers when the exact value does not matter.
8
+
9
+ Ask one question at a time and wait for the answer before asking the next one.
10
+
11
+ ## Voice call
12
+
13
+ You are on a live phone call. Always answer right away; never leave the caller in silence.
14
+
15
+ Keep sentences short; one idea per sentence. No lists, no markdown, no emojis; say numbers and dates the way a person would.
16
+
17
+ If you cannot help, say so in one sentence and offer what you can do.
@@ -0,0 +1,5 @@
1
+ import type { CustomTool } from "@voicethere/agent/llm";
2
+
3
+ // The docs tools (search_docs, get_doc) come from the project service over MCP.
4
+ // Add your own tools here with defineTool from "@voicethere/agent/llm".
5
+ export const tools: CustomTool[] = [];
@@ -0,0 +1,51 @@
1
+ {
2
+ "$schema": "./node_modules/@voicethere/agent/schema/voicethere.llm.schema.json",
3
+ "version": 1,
4
+ "provider": "openrouter",
5
+ "model": "amazon/nova-micro-v1",
6
+ "apiKeySecret": "AGENT_OPENROUTER_API_KEY",
7
+ "maxOutputTokens": 300,
8
+ "greeting": {
9
+ "text": "Hi! Ask me anything about our documentation.",
10
+ "interruptible": true
11
+ },
12
+ "bargeIn": {
13
+ "mode": "project"
14
+ },
15
+ "history": {
16
+ "turns": 20,
17
+ "interruptionNote": true
18
+ },
19
+ "fillers": {
20
+ "thinking": {
21
+ "phrases": ["Okay.", "Right.", "Sure.", "Let me see."],
22
+ "afterMs": 1500
23
+ },
24
+ "toolCall": {
25
+ "phrases": [
26
+ "Let me check that for you.",
27
+ "One moment, I'll look that up."
28
+ ]
29
+ },
30
+ "toolWait": {
31
+ "phrases": ["Still checking, one moment.", "Almost there."],
32
+ "afterMs": 4000
33
+ },
34
+ "interruptible": true
35
+ },
36
+ "tools": {
37
+ "maxRounds": 5,
38
+ "timeoutMs": 15000
39
+ },
40
+ "toolSources": [
41
+ {
42
+ "kind": "service",
43
+ "path": "/mcp",
44
+ "allow": ["search_docs", "get_doc"]
45
+ }
46
+ ],
47
+ "knowledge": {
48
+ "store": "off"
49
+ },
50
+ "interruptPolicy": "cancel"
51
+ }