Commit Graph

50 Commits

Author SHA1 Message Date
William Valentin ca463d5ca2 feat(gateway): add observability sources, series, and service log RPCs 2026-02-22 20:54:37 -08:00
William Valentin abaa9be3f1 Add whisper docker dependency controls to dashboard 2026-02-22 19:48:27 -08:00
William Valentin 8fcbb5f521 Add whisper docker dependency status to gateway dashboard 2026-02-22 19:20:09 -08:00
William Valentin 6f2925ed10 gateway: add local backend daemon controls to dashboard 2026-02-22 16:36:31 -08:00
William Valentin 708683297a feat(gateway): global tier provider/model defaults with catalog-backed options 2026-02-19 10:17:16 -08:00
William Valentin cdba111831 fix(confirmations): guarded-action handling across webchat and tui 2026-02-18 17:43:57 -08:00
William Valentin a13aa3113e feat(gateway): support full /model switching in webchat sessions 2026-02-18 16:55:38 -08:00
William Valentin 42ae4a75df feat(telegram): harden channel reliability with retries and error diagnostics 2026-02-18 13:12:11 -08:00
William Valentin 21232748b9 fix: graceful ctrl+c shutdown and await session-end memory writes 2026-02-18 11:30:47 -08:00
William Valentin 8234cc93f3 feat: add webchat pwa push subscription support 2026-02-18 10:46:55 -08:00
William Valentin 59199731c3 fix(gateway): align node push token typing and router test mock 2026-02-17 16:06:03 -08:00
William Valentin 803de57261 fix(gateway): align session mocks and persist normalized push provider 2026-02-17 15:53:08 -08:00
William Valentin fee8be1de0 feat(gateway): expose context usage and warning events 2026-02-16 15:44:09 -08:00
William Valentin 3d7144b2c5 feat(gateway): add system.sessionAnalytics usage snapshot RPC 2026-02-16 14:45:45 -08:00
William Valentin 8bed99c770 Add Zalo channel adapter with webhook and send path 2026-02-16 13:11:51 -08:00
William Valentin 891ccb696e Add Feishu channel adapter with webhook and send path 2026-02-16 13:07:45 -08:00
William Valentin 76d44a74bf Add LINE channel adapter with webhook ingress and gating 2026-02-16 13:02:26 -08:00
William Valentin a954d7e136 Add Android node foundation with FCM push support 2026-02-16 12:55:22 -08:00
William Valentin 58c4b0b9bb Add iOS node push-token registration foundation 2026-02-16 12:47:34 -08:00
William Valentin bea4c54f3b Add macOS companion node status and system.nodes APIs 2026-02-16 12:41:58 -08:00
William Valentin 8a0b4f3dbb Add canvas artifact RPC foundation for A2UI 2026-02-16 12:36:02 -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 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 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 323bef0526 feat(gateway): add optional bonjour/mdns discovery 2026-02-16 01:48:59 -08:00
William Valentin 49b752e8b0 chore(lint): reduce warning debt across core adapters and model clients 2026-02-15 23:03:42 -08:00
William Valentin 0220ec10dd feat(config): persist config.patch updates atomically 2026-02-15 22:03:21 -08:00
William Valentin 63d645bd87 feat(gateway): add websocket ingress rate limiting 2026-02-15 21:56:13 -08:00
William Valentin d93c1c9f8d fix(gateway): enforce request body size limits 2026-02-15 21:44:36 -08:00
William Valentin c6e3d09ecc feat(gateway): add sender presence tracking 2026-02-15 19:28:16 -08:00
William Valentin 0493660e7d feat(gateway): add system.services and dashboard services grid 2026-02-14 00:42:41 -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 a8a2c59313 feat: implement model persistence with per-session overrides
- Add session_config SQLite table for per-session settings
- Update routing to support session override → agent config → global default resolution chain
- Upgrade WebChat SessionBridge from NativeAgent to AgentOrchestrator
- Add /model, /local, /cloud commands to Telegram adapter
- Add /model command to WebChat gateway handlers
- Clear session overrides on /reset command
- Pass memoryStore and config through to SessionBridge
- Add comprehensive tests for all new functionality

Fixes model persistence bug where TUI model changes didn't affect WebChat/Telegram sessions. Now:
- TUI /model sets global default (persists across restarts, affects all new sessions)
- WebChat/Telegram /model sets session override (only that conversation, cleared on /reset)
- WebChat sessions gain AgentOrchestrator features (delegation, compaction, memory)
2026-02-11 21:51:38 -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 bd1880a44c feat(03-01): create MetricsCollector and wire into gateway
- Add MetricsCollector class with counters, model call ring buffer, event ring buffer, and active request tracking
- Add system.metrics, system.events, system.activeRequests RPC handlers
- Add GET /health unauthenticated HTTP endpoint for Docker HEALTHCHECK
- Add totalPending() to LaneQueue for queue depth metrics
- Add 20 tests for MetricsCollector
2026-02-09 21:28:05 -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 06438bb44f feat: add Gmail Pub/Sub watcher for inbound email automation
New ChannelAdapter that monitors Gmail via Google Cloud Pub/Sub push
notifications with polling fallback. Supports OAuth2 auth, configurable
watch labels, template rendering with email metadata placeholders
(from, to, subject, snippet, date, id, labels).

Wired into daemon lifecycle and gateway (POST /gmail/push endpoint).
Includes 16 tests covering auth, templates, push notifications, and
channel routing.
2026-02-07 15:39:24 -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 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 20930a4816 feat: add query-param token auth and optional HTTP auth to gateway
Support ?token= query parameter as a fallback for WebSocket clients that
cannot set Authorization headers (e.g. browsers). Add authHttp option to
GatewayServer so token auth can be applied to HTTP requests too, returning
401 with WWW-Authenticate header on failure.
2026-02-06 16:51: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 282a15d2b9 feat(gateway): add web UI with dashboard and chat interface
Refactor GatewayServer to serve HTTP and WebSocket on a shared
http.Server. Add static file serving with path traversal protection,
a dark-themed dashboard (system health, sessions, tools) and a
WebSocket chat interface with streaming tool events and markdown
rendering.
2026-02-05 19:39:53 -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