Commit Graph

482 Commits

Author SHA1 Message Date
William Valentin be3363fdc8 docs: update state.json and gap analysis — file.patch + Gmail (87/116 = 75%) 2026-02-07 15:40:45 -08:00
William Valentin 308e7f228e docs: update state.json with tier 2 completion stats 2026-02-07 14:53:50 -08:00
William Valentin 93c0d64e8d docs: update gap analysis — mark Tier 2 as complete (85/116 = 73%) 2026-02-07 14:46:23 -08:00
William Valentin b50c140d25 feat: add Docker support and inbound webhooks (Tier 2)
- Dockerfile: multi-stage build (node:22-alpine), better-sqlite3 native deps handled
- .dockerignore + docker-compose.yml for deployment
- FLYNN_DATA_DIR env var support in daemon, CLI, and TUI
- WebhookHandler: ChannelAdapter for HTTP POST /webhooks/:name
- Per-webhook HMAC auth, template rendering ({{body}}, {{json.field}})
- Config schema: automation.webhooks array with name/secret/message/output
- Gateway routes webhook requests before static files (bypasses gateway auth)
- 23 new tests for webhook functionality, 874 total tests passing
2026-02-07 14:36:05 -08:00
William Valentin d5694649bf docs: update gap analysis for tier 1 implementation (65% → 69%)
Mark 5 features as MATCH: tool groups, session pruning, /think,
/verbose, typing indicators. Update scorecard (80/116 features),
remove completed Tier 1 section from remaining gaps.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 13:36:22 -08:00
William Valentin 1c2f54fae3 feat: implement tier 1 quick wins (tool groups, typing, pruning, verbose, think)
Five additive features with no breaking changes:

- Tool groups: group:fs, group:runtime, group:web, group:memory syntactic
  sugar for allow/deny lists in tool policy config
- Typing indicators: Discord sendTyping() and WhatsApp sendStateTyping()
  on message receipt for better UX feedback
- Session pruning: TTL-based auto-cleanup via sessions.ttl config with
  hourly daemon timer and SQLite GROUP BY pruning
- /verbose command: TUI command parser toggle for raw streaming display
- !!think prefix: per-message extended thinking mode wired through
  Anthropic (budget_tokens), OpenAI/GitHub (reasoning_effort), and
  Gemini (thinkingConfig) providers

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 13:35:00 -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 130711a377 docs: update documentation for P7 web UI dashboard completion
- README: add Web UI Dashboard section, update features list with all
  current capabilities (multi-channel, media pipeline, sandboxing, etc.),
  expand model providers table, update architecture diagram
- CHANGELOG: add P7 entries (dashboard SPA, 4 new gateway handlers)
- state.json: add P7 entry with all 6 phases and file lists, update
  overall_progress to reflect P0-P7 completion
- web-ui-dashboard.md: mark as completed with detailed phase outcomes
2026-02-07 10:11:54 -08:00
William Valentin 22230a3e3f feat: add web UI dashboard SPA with dashboard, chat, sessions, and settings pages
- Add SPA shell with hash-based router, sidebar navigation, and WebSocket RPC client
- Add dashboard page with system health cards, channel status, and auto-refresh
- Add chat page with session selector, streaming tool events, and markdown rendering
- Add sessions page with list, history viewer, and delete functionality
- Add settings page with hook pattern editor, tool list, and config viewer
- Add backend handlers: sessions.delete, sessions.switch, system.channels, system.usage
- Wire channelRegistry into gateway server for channel status reporting
- Extend static file server with .mjs, .png, .ico, .woff2 content types
2026-02-07 10:07:45 -08:00
William Valentin f7d889e35e docs: update state.json with P6 completion and overall progress 2026-02-07 09:11:49 -08:00
William Valentin d4530a7034 feat: add runtime provider/model switching via /model <tier> <provider/model>
- ModelRouter: add setClient(), labels map, getLabel(), getAllLabels()
- TUI commands: parse /model <tier> <provider/model> syntax with autocompletion
- TUI minimal: handle provider switching via createClientFromConfig factory
- Daemon: wire initial labels into router config
- Fix /model alias mappings (opus=complex, sonnet=default, haiku=fast)
- Add design doc and update state.json with feature status
2026-02-06 23:42:14 -08:00
William Valentin cfdd448495 docs: add Docker sandbox and multi-agent routing design/implementation plans 2026-02-06 16:52:38 -08:00
William Valentin e8e4fcd758 docs: update state.json with Docker sandbox and multi-agent routing 2026-02-06 16:04:51 -08:00
William Valentin e4eea764e7 docs: update state.json with tool allow/deny profiles and test count (606) 2026-02-06 15:31:04 -08:00
William Valentin 8238d3e981 docs: update state.json with P2 phase entries and test counts 2026-02-06 15:13:14 -08:00
William Valentin de68deb1b2 feat: add WhatsApp channel adapter (Phase 3c) 2026-02-06 14:42:07 -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 0180d4fb8f docs: add Phase 0/1 implementation plan and feature gap analysis 2026-02-06 13:17:51 -08:00
William Valentin 224c023028 docs: add Phase 5a design and implementation plans 2026-02-05 22:10:41 -08:00
William Valentin aa95f2132c feat: add channel adapter abstraction with Telegram and WebChat adapters
Implement Phase 3 channel adapters that decouple message sources from
the agent via a uniform ChannelAdapter interface and ChannelRegistry.

- Add ChannelAdapter/InboundMessage/OutboundMessage types
- Add ChannelRegistry for adapter lifecycle and message routing
- Add TelegramAdapter (grammy bot, auth middleware, confirmations, chunking)
- Add WebChatAdapter (thin shim over GatewayServer)
- Refactor daemon to use ChannelRegistry with per-channel-per-user agents
- Add config.get/config.patch gateway handlers (Phase 2 loose end)
- Add system.restart gateway handler (Phase 2 loose end)
- Add implementation plans and design docs

Tests: 225 passing (33 new channel adapter + gateway handler tests)
2026-02-05 20:00:36 -08:00
William Valentin f30a8bc318 feat(gateway): add WebSocket gateway with JSON-RPC protocol and auth
Phase 2 of the Flynn roadmap. Adds a WebSocket gateway server that
starts alongside the Telegram bot, providing real-time API access to
the agent, sessions, and tools.

Protocol: JSON-RPC-like (request/response/event) over WebSocket.
8 methods: agent.send, agent.cancel, sessions.list, sessions.history,
sessions.create, tools.list, tools.invoke, system.health.

Auth: Bearer token + Tailscale identity header support.
Session bridge: per-connection agent instances with shared model router.

New files: src/gateway/ (protocol, router, server, auth, session-bridge,
handlers for agent/sessions/tools/system).
57 new tests (181 total), typecheck clean.
2026-02-05 19:11:25 -08:00
William Valentin 61d9358449 docs: add backend switch implementation plan 2026-02-05 13:32:35 -08:00
William Valentin a893460397 docs: add backend switch command design 2026-02-05 13:30:14 -08:00
William Valentin 3cf28df111 docs: add llama.cpp implementation plan 2026-02-05 13:09:23 -08:00
William Valentin 6f5dd741a9 docs: add llama.cpp integration design
Design for adding LlamaCppClient to support local LLM inference
via llama-server with CUDA. Target model: Qwen 2.5 14B Q4_K_M.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 13:05:58 -08:00
William Valentin 228e7d86bd docs: add TUI redesign implementation plan with 14 tasks 2026-02-05 10:44:49 -08:00
William Valentin 42d1175b02 docs: add TUI redesign plan
- Streaming responses (chunk-based)
- Rich markdown rendering with syntax highlighting
- Model switching via /model command
- Scrollable message history
- Enhanced status bar with token usage
- Inline error handling with auto-retry
- Feature parity between minimal and fullscreen modes
2026-02-05 10:41:20 -08:00
William Valentin 934be021ab docs: add Phase 3 TUI implementation plan
Covers:
- SessionManager for multi-frontend support
- Minimal readline TUI
- Fullscreen Ink-based TUI
- Mode switching and session transfer

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 00:31:28 -08:00
William Valentin 920872423e docs: add Phase 2 implementation plan
8 tasks covering:
- New dependencies (sqlite, ollama, openai)
- OpenAI client for fallback
- Ollama client for local LLM
- Model router with fallback chain
- SQLite session persistence
- Hook engine for sensitive operations
- Telegram confirmation UI
- Full integration

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 21:08:26 -08:00
William Valentin 04fa56d3f1 docs: add Phase 1 implementation plan
8 tasks covering:
- Project scaffolding
- Config schema and loading
- Daemon lifecycle management
- Anthropic client wrapper
- Native agent with conversation history
- Telegram bot frontend
- Integration wiring
- Documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 20:49:55 -08:00
William Valentin ee19c11cc3 Finalize design decisions
- Separate sessions per frontend with explicit transfer
- Automatic backend routing based on task type
- Text responses by default (voice is future)
- Immediate notification delivery

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 20:45:14 -08:00
William Valentin 8717153e48 Add Flynn design document
Initial design for a self-hosted personal AI agent with:
- Telegram + TUI frontends
- Multi-model routing with fallback chain
- Claude Code/OpenCode CLI integration
- Hook-based security for sensitive operations
- Tailscale-only network exposure

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 20:37:53 -08:00