Commit Graph

72 Commits

Author SHA1 Message Date
William Valentin 76d44a74bf Add LINE channel adapter with webhook ingress and gating 2026-02-16 13:02:26 -08:00
William Valentin 58c4b0b9bb Add iOS node push-token registration foundation 2026-02-16 12:47:34 -08:00
William Valentin fe8674e108 Add node location access RPCs and operator visibility 2026-02-16 12:30:55 -08:00
William Valentin d9f7807ab2 feat(gateway): add node capability negotiation foundation 2026-02-16 12:14:25 -08:00
William Valentin de0c1f41b3 feat(channels): add mattermost adapter and wiring 2026-02-16 12:09:44 -08:00
William Valentin 813a0dc5c5 feat(gateway): complete openclaw phase1 queue parity v2 2026-02-16 12:04:33 -08:00
William Valentin fbd24d4379 feat(gateway): support per-channel and per-session queue policy overrides 2026-02-16 11:51:26 -08:00
William Valentin f7284a4ef1 feat(gateway): add configurable lane queue mode, cap, and overflow 2026-02-16 11:48:45 -08:00
William Valentin 83b8e38b11 feat(runtime): add talk mode and capture tools 2026-02-16 10:17:24 -08:00
William Valentin 8e9f9aa4de feat(channels): add bluebubbles imessage adapter 2026-02-16 09:41:26 -08:00
William Valentin 693dcd8421 feat(channels): add google chat adapter and webhook route 2026-02-16 02:07:55 -08:00
William Valentin 8e35d2d674 feat(channels): add microsoft teams bot framework adapter 2026-02-16 02:00:14 -08:00
William Valentin 0269c6032d feat(channels): add signal-cli channel adapter 2026-02-16 01:54:54 -08:00
William Valentin 323bef0526 feat(gateway): add optional bonjour/mdns discovery 2026-02-16 01:48:59 -08:00
William Valentin ae36248da8 feat(skills): add registry doctor diagnostics and docs 2026-02-16 00:53:25 -08:00
William Valentin 948d4ac6d8 chore(lint): burn down remaining warnings to zero 2026-02-15 23:14:21 -08:00
William Valentin 0220ec10dd feat(config): persist config.patch updates atomically 2026-02-15 22:03:21 -08:00
William Valentin 8709c3c9b4 fix(whatsapp): sandbox chromium by default 2026-02-15 21:57:52 -08:00
William Valentin 63d645bd87 feat(gateway): add websocket ingress rate limiting 2026-02-15 21:56:13 -08:00
William Valentin 7f563b4bb1 fix(agent): raise max iterations default from 10 to 200
The low default caused the agent to stop mid-task prematurely.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 21:48:16 -08:00
William Valentin d93c1c9f8d fix(gateway): enforce request body size limits 2026-02-15 21:44:36 -08:00
William Valentin 81c97a9df1 feat(memory): add experimental qmd search backend 2026-02-15 19:33:43 -08:00
William Valentin 421942f66d feat(automation): add isolated job delivery mode 2026-02-15 19:23:15 -08:00
William Valentin 0470647ee7 feat(models): add minimax and moonshot providers 2026-02-15 19:18:48 -08:00
William Valentin 1a7b7f6ce8 feat(config): support PORT env override 2026-02-15 18:12:05 -08:00
William Valentin 81385745e6 fix(config): align default.yaml with server schema 2026-02-15 18:11:29 -08:00
William Valentin 5fdb9e5a83 feat(config): add Matrix channel config 2026-02-15 18:02:14 -08:00
William Valentin 87e942b4c5 feat(models): add Vercel AI Gateway provider 2026-02-15 10:52:03 -08:00
William Valentin 9755487793 config: add per-tier auth_mode 2026-02-15 10:23:03 -08:00
William Valentin 184ebe4480 models: add synthetic provider 2026-02-14 09:34:39 -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 b773e2bbf3 feat(skills): enable watcher wiring through daemon lifecycle 2026-02-12 17:18:22 -08:00
William Valentin 90ce622080 feat(policy): enforce truthfulness and autonomy guardrails
Add runtime truthfulness modes and autonomy-level tool gating with audit metadata for overrides/denials.

Wire policy through prompt assembly, tool execution context, and daemon/gateway agent paths; update tests and planning state for Phase 3 PR #2 completion.
2026-02-12 16:06:45 -08:00
William Valentin 148219153e feat(audio): add tests, token estimation, and config override for native audio
- Add capabilities.test.ts (18 tests) for supportsAudioInput()
- Add 15 audio tests to media.test.ts (hasAudio, stripAudioParts, attachmentToAudioSource)
- Add estimateAudioTokens() to tokens.ts (base64→bytes→duration→tokens)
- Update estimateMessageTokens() to include audio content parts
- Add 5 audio token tests to tokens.test.ts
- Add supports_audio config override to model schema
- Wire supports_audio from tier config through routing to capability check

Total tests: 1369 (was 1331, +38 audio-related)
2026-02-11 18:27:19 -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 d62e836b5d feat(audit): Add core audit logging infrastructure
- Add AuditLogger class with rotation support
- Add audit configuration to config schema
- Instrument tool execution with full audit logging
- Instrument session lifecycle (create, message, delete, transfer, compact)
- Add audit logger initialization in daemon
- Add cron scheduler audit logging

Audit events captured:
- tool.start/success/error/denied
- session.create/message/delete/transfer/compact
- cron.trigger/add/remove

All logs go to ~/.local/share/flynn/audit.log (JSON lines)
with rotation (10MB files, 30-day retention)
2026-02-11 15:58:07 -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 60b214e7c4 feat: add per-cron-job model tier selection
Allow cron jobs to specify a `model_tier` field that controls which LLM
tier handles the job, without needing separate agent configs. Precedence:
cron job model_tier > agent config > global primary_tier > 'default'.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 22:31:18 -08:00
William Valentin 25482b8516 feat: sync PROVIDER_NAMES with config schema and update README docs
Extract MODEL_PROVIDERS const from config schema as single source of truth
for provider names. PROVIDER_NAMES in TUI commands now imports from schema
instead of maintaining a hardcoded list. Adds tests verifying sync.

Updates README TUI Commands section with /model hot-swap documentation,
supported providers, and runtime model switching examples.
2026-02-10 21:26:18 -08:00
William Valentin bf9ca690f3 fix(agent): detect repeated tool call loops and make max_iterations configurable
Local LLMs often get stuck calling the same tool repeatedly because they
lack the sophistication to synthesize results. The agent loop had no
safeguard — it re-executed whatever the model requested up to 10 times.

Add fingerprint-based loop detection: if the same tool+args combination
repeats 3 consecutive times, break the loop and return the last results.
Also add agents.max_iterations to the config schema so the iteration
limit is user-configurable (default: 10).
2026-02-10 19:35:09 -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 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 213dba855a refactor: make telegram config optional for non-telegram setups
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 09:27:18 -08:00
William Valentin 35f4cab0dc feat: add log-level system to suppress noisy fallback debug output
Replace console.debug/log/warn calls in model router, retry, and daemon
startup with a structured logger that respects a configurable log_level.
Default level is 'info', suppressing verbose fallback debug messages in
the TUI while keeping them available via config when needed.

- Add src/logger.ts with debug/info/warn/error/silent levels
- Wire log_level into config schema (default: 'info')
- Initialize log level in both daemon and TUI startup paths
- Convert all console.debug in router.ts and retry.ts to logger.debug
- Convert console.log/warn in daemon/models.ts to logger.info/warn
2026-02-09 21:23:07 -08:00
William Valentin c2cc052694 feat(02-01): implement deepMerge and overlay-aware loadConfig with tests
- Add deepMerge utility for recursive object merging (arrays replace, not concat)
- Extend loadConfig with optional overlayPath parameter
- Merge happens before env var expansion and Zod validation
- Add 6 deepMerge unit tests and 4 overlay integration tests
- Re-export deepMerge from config/index.ts
- All 1087 existing tests still pass
2026-02-09 20:56:29 -08:00
William Valentin 1e29da4da2 feat: complete DM pairing codes with channel adapters, gateway handlers, and TUI command (Tier 4 feature 4) 2026-02-09 18:28:10 -08:00
William Valentin 4413c4dc7c feat: add gateway lock, shell completion, and tailscale serve (Tier 4 features 1-3) 2026-02-09 13:29:59 -08:00
William Valentin 9be8f76bc7 feat: implement Tier 3 features — lane queue, credential redaction, token dashboard, xAI, Voyage AI
- Lane Queue: per-session FIFO queue in gateway replacing reject-when-busy (9 tests)
- Credential Redaction: redactConfig() expanded to cover 18+ secret fields (16 tests)
- Web UI Token Dashboard: system.tokenUsage endpoint + Usage page with summary cards
- xAI (Grok) Provider: OpenAI-compatible client with model pricing
- Voyage AI Embeddings: new embedding provider with configurable dimensions (5 tests)
- Update gap analysis: 90→95 match (70%→74%), Tier 3 section marked DONE
- Update state.json: test count 1001→1034, add tier3_completion entry

Total: 1034 tests passing across 85 files, typecheck clean
2026-02-09 10:32:57 -08:00
William Valentin 1d126cddfb feat: add Zhipu AI (GLM) model provider support
Adds zhipuai as a new provider using the OpenAI-compatible API at
api.z.ai. Supports api_key config or ZHIPUAI_API_KEY env var, with
optional endpoint override.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 09:55:13 -08:00