mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 19:01:08 +02:00
feat(ai-tools): server-side web-research + contacts for agents
Two major tool expansions — the Recherche-Agent and Today-Agent can now research the web autonomously (no browser needed), and a future Meeting-Prep agent can read + create contacts. === research_news (server-side execution) === The biggest addition: mana-ai can now call mana-api's news-research endpoints (POST /discover + /search) directly, without a browser. Infrastructure: - services/mana-ai/src/planner/news-research-client.ts — full HTTP client with discover→search pipeline. 15s/30s timeouts. Graceful null on any failure (network, mana-api down, bad response) so the tick never crashes from research errors. - config.manaApiUrl added (default http://localhost:3060); wired in docker-compose.macmini.yml as http://mana-api:3060 + depends_on mana-api with service_healthy condition. Pre-planning research step (cron/tick.ts): - Before the planner prompt is built, the tick checks if the mission's objective or conceptMarkdown matches research keywords (same RESEARCH_TRIGGER regex the webapp uses). When it matches: * NewsResearchClient.research(objective) runs discovery + search * Results are injected as a synthetic ResolvedInput with id '__web-research__' and a formatted markdown context block * The Planner then sees real article URLs/titles/excerpts and can reference them in create_note / save_news_article steps * Log line: "pre-research: N feeds, M articles" Tool registration: - research_news added to AI_PROPOSABLE_TOOL_NAMES + mana-ai tools.ts with params (query, language?, limit?). This lets the planner also explicitly propose a research step as a PlanStep (in addition to the pre-planning auto-injection). === create_contact === - Added to AI_PROPOSABLE_TOOL_NAMES + mana-ai tools.ts with params (firstName required, lastName/email/phone/company/notes optional). - Contacts are encrypted at rest; server planner can plan the step but execution stays on the webapp (same as all propose tools). Full server-side contact resolution via Key-Grant is a future enhancement. - get_contacts added to webapp AUTO_TOOLS so agents can inspect existing contacts without nagging (read-only, auto-policy). Module coverage now: ✅ todo (5) ✅ calendar (2) ✅ notes (5) ✅ places (4) ✅ drink (3) ✅ food (2) ✅ news (1) ✅ journal (1) ✅ habits (3) ✅ news-research (1) ✅ contacts (1) 11 modules, 28 tools total (17 propose, 11 auto). Tests: mana-ai 41/41 (drift-guard passes), shared-ai type-check clean, webapp svelte-check 0 errors, 0 warnings. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
ae53e93b9a
commit
23b8cc13fb
7 changed files with 253 additions and 2 deletions
|
|
@ -40,6 +40,10 @@ export const AI_PROPOSABLE_TOOL_NAMES = [
|
|||
// ── Habits ────────────────────────────────
|
||||
'create_habit',
|
||||
'log_habit',
|
||||
// ── News-Research ─────────────────────────
|
||||
'research_news',
|
||||
// ── Contacts ──────────────────────────────
|
||||
'create_contact',
|
||||
] as const;
|
||||
|
||||
export type AiProposableToolName = (typeof AI_PROPOSABLE_TOOL_NAMES)[number];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue