Commit Graph

47 Commits

Author SHA1 Message Date
William Valentin d4f4be068c fix(minio): support mc_path and harden sync against transient objects 2026-02-19 13:18:20 -08:00
William Valentin b0ae5f638b feat(system-info): improve human-readable snapshot formatting 2026-02-18 18:06:46 -08:00
William Valentin 9de52b7d93 feat(system-info): include disk usage in health output 2026-02-18 18:04:35 -08:00
William Valentin 9a2f1e2bb2 chore: checkpoint browser tooling and routing updates 2026-02-17 15:18:37 -08:00
William Valentin 8394086446 Wire agent.delegate into TUI tool registry 2026-02-17 11:03:55 -08:00
William Valentin 776b47f80f feat: wire agent.delegate tool with sub-agent configs
- Export createAgentDelegateTool through builtin/index.ts → tools/index.ts
- Register agent.delegate in routing.ts with lazy orchestrator pattern
- Add agent.delegate + agents.list to messaging and coding policy profiles
- Add group:agents tool group to policy.ts
- Add research/code/comms agent config examples to default.yaml
- Add research/code/comms agent configs to user config.yaml
- Add 11 tests for agent-delegate tool (all pass)
- Typecheck clean, no regressions
2026-02-17 10:28:29 -08:00
William Valentin 0548ab3833 feat(tools): add docx extraction for minio ingestion 2026-02-16 14:45:45 -08:00
William Valentin e8a785b61f feat(tools): add pdf extraction for minio ingestion 2026-02-16 14:45:45 -08:00
William Valentin 63df791b26 feat(tools): add kubernetes homelab awareness tools 2026-02-16 14:45:45 -08:00
William Valentin 22f225998f feat(tools): add minio prefix sync into memory 2026-02-16 14:45:45 -08:00
William Valentin 0be93c20b5 feat(tools): add minio ingestion into memory namespaces 2026-02-16 14:45:45 -08:00
William Valentin 426145386f feat(tools): add minio.share upload and presigned link tool 2026-02-16 14:45:45 -08:00
William Valentin 56854f04bd feat(automation): add timezone-safe daily briefing dedupe 2026-02-16 14:45:45 -08:00
William Valentin 83b8e38b11 feat(runtime): add talk mode and capture tools 2026-02-16 10:17:24 -08:00
William Valentin ae70818ec1 fix: resolve strict typecheck fallout in setup, routing, and tests 2026-02-15 23:22:05 -08:00
William Valentin 948d4ac6d8 chore(lint): burn down remaining warnings to zero 2026-02-15 23:14:21 -08:00
William Valentin 92da407e22 audit follow-up: trim image-analyze test lint warnings 2026-02-15 22:54:36 -08:00
William Valentin 021435ac27 test(lint): reduce warning debt in selected test suites 2026-02-15 22:31:47 -08:00
William Valentin b4006e91ff feat(tools): extend cancellation to browser, web, and process tools 2026-02-15 22:12:03 -08:00
William Valentin 2cdfb66071 feat(tools): propagate timeout abort signals to tool execution 2026-02-15 22:05:43 -08:00
William Valentin 81c97a9df1 feat(memory): add experimental qmd search backend 2026-02-15 19:33:43 -08:00
William Valentin 3451df41b9 feat(tools): enforce skill capabilities and secret scopes 2026-02-15 10:16:51 -08:00
William Valentin 955b9e28e0 feat: add OpenAI OAuth, strict model overrides, and Gmail pull mode 2026-02-13 14:55:40 -08:00
William Valentin 9f81c01603 feat(session): persist model tier overrides per session
Store per-session config in SQLite and route /model and /reset through command fast-paths so channel sessions keep independent model selection across reconnects and restarts.
2026-02-13 01:04:26 -08:00
William Valentin 0b44adbaea fix(audio): add SSRF protection, MIME type fix, and tests for audio-transcribe tool
- Add URL validation blocking localhost, private IPs, and non-http protocols
- Use response Content-Type header instead of hardcoded audio/wav for URL downloads
- Add 25 tests covering validation, SSRF, config errors, transcription paths, and error handling

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 21:57:45 -08:00
William Valentin a875bcc4ae feat(audio): add audio.transcribe tool with Whisper-compatible API support
- Add createAudioTranscribeTool with OpenAI/Groq/Ollama/llama.cpp provider support
- Refactor audio config schema to nested audio.enabled + audio.provider structure
- Move audio tool registration to initTools() for conditional enablement
- Fix duplication bug in audio-transcribe.ts URL download handler
- Support base64 data and URL-based audio input with format detection
2026-02-11 18:13:19 -08:00
William Valentin 6090508bad style: auto-fix ESLint issues (curly braces and formatting)
- Add curly braces to all if/else/for/while statements
- Fix indentation and trailing spaces
- Auto-fixed 372 linting errors using eslint --fix
- Remaining issues are warnings only (non-null assertions, explicit any types)
2026-02-11 10:30:24 -08:00
William Valentin 5270234bbb feat: improve tool usage guidance in SOUL.md and add cron.create/cron.delete tools
- SOUL.md: list all available tools (web.search, memory.*, cron.*, etc.)
  and add Tool Usage Rules section enforcing 'act, don't narrate'
- cron.ts: add getJob(), addJob(), removeJob() to CronScheduler for
  runtime (ephemeral) cron job management
- cron tools: add cron.create and cron.delete tools, enhance cron.list
  to show schedule/output/message details
- policy.ts: add cron tools to messaging and coding profiles, add
  group:cron to tool groups

Fixes issue where models would narrate tool intent ('let me search...')
then stop without actually calling tools.
2026-02-11 09:32:36 -08:00
William Valentin eea7ca62a8 chore: increase GmailWatcher default poll interval from 60s to 300s 2026-02-11 08:43:48 -08:00
William Valentin 4ce8e81c01 fix(gmail): sanitize HTML entities and tags in tool output
Gmail API returns snippets with HTML entities (&amp;, &#39;, <br>, etc.)
that leaked into LLM responses as raw HTML. Added shared sanitizeHtml()
utility in src/utils/html.ts and applied it to gmail tool snippets,
HTML body fallback, and gmail watcher snippets.
2026-02-10 16:30:14 -08:00
William Valentin f204ff1dd7 feat(tools): add Google Docs, Drive, and Tasks read-only tools
Add three new Google service integrations following the established
Gmail/GCal pattern:

- Google Docs (docs.list, docs.search, docs.read): list, search, and
  read document content as plain text via Docs + Drive APIs
- Google Drive (drive.list, drive.search, drive.read): list, search,
  and read files with export support for Workspace files (Docs→text,
  Sheets→CSV, Slides→text)
- Google Tasks (tasks.lists, tasks.list): list task lists and tasks
  with status, due dates, and notes

Each service has its own config section, OAuth auth command, tool
policy group, and test suite (53 new tests). The setup wizard now
offers to configure all Google services together and run OAuth auth
flows automatically after saving config.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 12:59:15 -08:00
William Valentin 50471d63af feat(tools): add gmail.read tool for full email content
The existing gmail.list and gmail.search tools only return snippets.
gmail.read fetches the full message by ID using format: 'full', decodes
base64url body parts (preferring text/plain, falling back to stripped
HTML), and returns headers + body text. This enables workflows like
searching for invoices and extracting amounts from the full content.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 12:01:49 -08:00
William Valentin 94264e848c feat(tools): add Google Calendar tools and register Gmail/GCal in daemon
Add calendar.today, calendar.list, calendar.search tools mirroring the
Gmail tool pattern. Includes gcal-auth CLI command, config schema, tool
policy entries (messaging/coding profiles + group:gcal), and 17 tests.
Also wires up gmail and gcal tool registration in the daemon and TUI.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 11:40:53 -08:00
William Valentin 8bf88049bf feat: add runtime context awareness — system.info tool + date/time in system prompt
- assembleSystemPrompt() now injects '# Runtime Context' with current date/time
- New system.info tool: date, time, hostname, platform, arch, uptime, memory, Node.js version
- Tool available in all profiles (minimal/messaging/coding/full)
- 983 tests passing (+7 new)
2026-02-07 16:22:17 -08:00
William Valentin 131d23989c feat: add file.patch tool for multi-hunk structured patches
Implements apply_patch equivalent: a single tool call can make multiple
line-based edits (replacements, insertions, deletions) across one or more
files. Hunks are applied bottom-up to preserve line numbers.

Includes 10 tests covering replacement, multi-hunk, insertion, deletion,
multi-file, overlapping hunks error, OOB error, and edge cases.
2026-02-07 15:39:15 -08:00
William Valentin 88731a50e3 feat: add heartbeat monitor and vector memory search (Tier 2)
Heartbeat:
- HeartbeatMonitor with 5 checks: gateway, model, channels, memory, disk
- Configurable interval, failure threshold, notification channel
- Recovery notifications when health restores
- 25 new tests

Vector Memory Search:
- EmbeddingProvider interface with OpenAI, Gemini, Ollama, LlamaCpp backends
- SQLite-backed VectorStore with cosine similarity search
- Text chunker with paragraph-aware splitting and overlap
- HybridSearch merging keyword + vector results with configurable weight
- Background indexer with dirty-namespace tracking
- Graceful fallback to keyword search when embeddings unavailable
- 51 new tests

Config: automation.heartbeat + memory.embedding schema sections
Total: 950 tests passing, all types clean
2026-02-07 14:45:11 -08:00
William Valentin 6bb424cddc feat: add agent tools and sanitize tool names for Anthropic API
Add 8 new agent-callable tools (sessions.list/history/create/delete,
agents.list, message.send, cron.list/trigger) and sanitize tool names
at the API boundary (dots → underscores) to comply with Anthropic's
`^[a-zA-Z0-9_-]{1,128}` requirement. Reverse-maps sanitized names
back to internal names for hook callbacks and tool execution.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 12:23:09 -08:00
William Valentin b9bfee9c5b feat: add outbound attachment support with media.send tool
Introduces OutboundAttachment type on OutboundMessage, an
OutboundAttachmentCollector (push/drain pattern), and a media.send
tool that queues files for outbound delivery. Each channel adapter
(Telegram, Discord, Slack, WhatsApp) sends attachments after the
text reply. Includes 15 tests for collector and tool.
2026-02-07 09:09:00 -08:00
William Valentin 1e6f6bb5a4 feat: add image.analyze tool for vision model analysis
Provides a factory createImageAnalyzeTool(modelClient) that sends images
to a vision-capable model and returns a textual analysis. Includes 15
tests covering base64, URL, multi-image, error, and edge cases.
2026-02-07 09:08:53 -08:00
William Valentin 8c56a5a1a8 feat: add Chrome DevTools Protocol browser tools
Add BrowserManager (puppeteer-core) with page pool and auto-detection of
Chrome/Chromium. Six tools: browser.navigate, browser.screenshot,
browser.click, browser.type, browser.content, browser.eval. Feature is
opt-in (browser.enabled defaults to false). Add to coding tool profile.
Includes 22 unit tests for manager and all tools.
2026-02-06 16:52:03 -08:00
William Valentin 7a35b22458 feat: wire up all Phase 2-6 features into daemon and config
Integrate all new features into the shared infrastructure:
- Config schema: add memory, discord, slack, process, web_search schemas
- Daemon wiring: memory store init, tool registration, channel adapters
- Orchestrator: memory injection into system prompt, extraction on compaction
- Agent: add setSystemPrompt() for dynamic prompt updates
- Channel/tool index: export new adapters and tool factories
- Add @slack/bolt, discord.js, turndown, linkedom, @mozilla/readability deps
- Update state.json with Phase 3b completion (494 tests passing)
2026-02-06 14:24:39 -08:00
William Valentin 6d9e27a591 feat: enhance web-fetch with HTML-to-markdown extraction (Phase 6)
Add turndown + readability for clean content extraction:
- HTML-to-markdown conversion with smart article extraction
- Format parameter (markdown/text/html)
- Response caching for repeated fetches
- 10 tests
2026-02-06 14:24:28 -08:00
William Valentin 6af26f407c feat: add web search and background process tools (Phases 4-5)
Phase 4 - Web search tool:
- Brave Search API + SearXNG fallback
- Configurable provider, max results
- 14 tests

Phase 5 - Background process management:
- ProcessManager with start/status/output/kill/list tools
- Configurable max concurrent, max runtime, buffer size
- 28 tests
2026-02-06 14:24:23 -08:00
William Valentin 2e1071230a feat: add persistent memory system (Phase 2)
Implement file-based persistent memory with read/write/search tools:
- MemoryStore with namespace-scoped JSON storage
- memory-read, memory-write, memory-search builtin tools
- Auto-extraction of facts during context compaction
- Configurable via memory.enabled, memory.dir, memory.max_context_tokens
2026-02-06 14:23:59 -08:00
William Valentin c96165fb2f feat(tools): add barrel exports and allBuiltinTools list 2026-02-05 17:40:13 -08:00
William Valentin b00706325b feat: add tool framework foundation (types, registry, executor, shell tool, model types, SOUL.md)
- Task 0: SOUL.md + loadSystemPrompt() in daemon
- Task 1: Tool type definitions (Tool, ToolCall, ToolResult, etc.)
- Task 2: ToolRegistry with Anthropic/OpenAI serialization
- Task 3: ToolExecutor with hooks, timeout, truncation
- Task 4: shell.exec builtin tool
- Task 8: Model types updated for tool use (ToolDefinition, ModelToolCall, etc.)
- Task 15: Model index exports for tool types
2026-02-05 17:39:40 -08:00
William Valentin 32dd3ad728 feat(tools): add file read/write/edit/list builtin tools 2026-02-05 17:39:20 -08:00