Capabilities · Voice / Vision / Web / MCP
The capability layer unifies "the senses and hands beyond the model": TTS, ASR, OCR, vision, web search/fetch, and MCP external tools. Every capability has an explicit engine choice, hard limits and an egress record — cloud keys enable egress; without them a local engine runs or the call fails explicitly. Never silent fake data.
Speech synthesis (TTS)
| Engine | Trigger | Details |
|---|---|---|
deepseek-tts | DeepSeek key configured | POST /v1/tools/tts; voices stella / tide; formats wav / pcm; filter_markdown: true; 120 s timeout |
IFG_TTS_CMD | custom command env var | local synthesis port; the command picks the engine |
macos-say | macOS fallback | say --data-format=LEI16@22050 emits 16-bit PCM WAV (decodable by every browser), 60 s timeout |
| none | none of the above | 503 "no TTS engine configured", no fake synthesis |
Billing chars (billingChars): CJK characters count as 2, others as 1; per-call caps 10,000 billing chars and a 64 KiB request body. Usage bills chars / 1000 × ttsPer1kChars (default 0.0208, editable in service settings) into the usage and egress ledgers.
Speech recognition (ASR)
- Cloud engine is DeepSeek ASR only: audio ≤8 MiB per segment; multipart upload ≤12 MB overall.
- No key → 400
asr_not_configured(pointing at Services & Keys), never a silent transcript. - Local/demo engines are labeled
mock-asr; transcripts carry anenginefield so UI and reports can tell real from mock. - Glossary correction (
asr-glossary): post-transcript substitution against the role glossary, returningcorrections.applieddetail. - Language
IFG_ASR_LANGUAGE(defaultzh-CN); recordings persist inrecordings; transcripts are editable (editable: true). - Billing
seconds / 60 × asrPerMinute(default 0.006).
OCR and vision
- OCR: single file ≤100 MiB;
purposewhitelisttext_recognition/rich_layout_recognition; local portIFG_OCR_CMD(receives the image path as{file}), errors when unconfigured. - Vision:
deepseek-flashwith OpenAI-styleimage_urlcontent blocks; MIME whitelistjpeg / png / gif / webp; image ≤32 MiB;max_tokens: 1200.
Web search and fetch
- Search:
countclamped to 1–50;need_content: falsekeeps hit summaries only; without cloud search it falls back to Bing (IFG_SEARCH_ENDPOINToverridable). - Fetch: returns Markdown body truncated to 200,000 chars; persists a
web_snapshotsrow with idW + sha256(text)[0:12]— same text, same id, so citations can point back at the snapshot. - SSRF guard:
assertFetchableUrlrejects private/loopback/metadata addresses; redirects are followed hop by hop manually (redirect: 'manual'), re-running the guard on every Location, capped at 5 hops — a public page 302-ing into the intranet is still blocked.IFG_ALLOW_PRIVATE_FETCH=1is an explicit opt-out. - Web timing is enforced at the tool layer by
webTiming(off / prepare / live / auto).
MCP external tools
- Transports:
http(URL) andstdio(command, spawned via/bin/sh -c, detached). - Handshake:
protocolVersion: 2024-11-05,clientInfo: interviewforge-agent-host 0.4.0. - stdio stdout buffer has an 8 MiB guard, failing past it so a hostile server cannot flood memory.
disabled_toolsdisables tools per server;approval_mode: auto | confirm— confirm mode requires user approval before a call (tool_approvals).- Every
mcp.list/mcp.callwrites an audit row; egress for MCP calls is decided by the server address and recorded in the ledger.
Egress boundary
All capability calls are recorded via capability routes (capability_routes) and the egress ledger (egress): who, when, to which target, at what cost. Local-first ≠ purely local: capabilities with cloud keys configured do egress; without them a local engine runs or the call returns an explicit 4xx/5xx — never fabricated results. See Auth & Security and Providers & Routing.
Structure at a glance
Figure 1 · One capability layer, each capability choosing its engine and egress