Commit Graph

51 Commits

Author SHA1 Message Date
William Valentin 42ae4a75df feat(telegram): harden channel reliability with retries and error diagnostics 2026-02-18 13:12:11 -08:00
William Valentin 7ca5d5bff5 feat: improve channel message chunking boundary quality 2026-02-18 10:50:34 -08:00
William Valentin 16af5e75fd feat: make /transfer bidirectional across telegram and tui 2026-02-18 07:55:08 -08:00
William Valentin b0d06d0650 chore(rebase): realign duplicate backend/channel/schema files with main 2026-02-17 15:44:47 -08:00
William Valentin 03fa96583c fix(matrix): allow attachment-only outbound messages 2026-02-17 15:43:57 -08:00
William Valentin 63adec9cea feat(channels): implement binary attachment upload for matrix/signal/mattermost 2026-02-17 15:40:50 -08:00
William Valentin 9fbd866435 fix(channels): handle LINE and Zalo outbound attachment references 2026-02-17 15:39:46 -08:00
William Valentin 2fe6495c92 test(channels): cover line and zalo minio upload fallback path 2026-02-17 10:46:54 -08:00
William Valentin 108641415f feat(channels): share line and zalo binary attachments via minio 2026-02-17 10:45:31 -08:00
William Valentin 2007c0c060 feat(channels): emit line and zalo binary attachment fallback notices 2026-02-17 10:36:47 -08:00
William Valentin 80a160a4eb feat(channels): implement binary uploads for matrix signal mattermost 2026-02-17 10:32:01 -08:00
William Valentin 288ef5ac3c fix(channels): forward line and zalo URL attachments 2026-02-17 10:19:00 -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 de0c1f41b3 feat(channels): add mattermost adapter and wiring 2026-02-16 12:09:44 -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 7a298576e8 fix(whatsapp): make inbound typing indicator non-blocking 2026-02-16 00:58:33 -08:00
William Valentin 948d4ac6d8 chore(lint): burn down remaining warnings to zero 2026-02-15 23:14:21 -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 1a075e62b0 audit follow-up: burn down lint hotspots and dedupe channel gating flows 2026-02-15 22:44:04 -08:00
William Valentin 021435ac27 test(lint): reduce warning debt in selected test suites 2026-02-15 22:31:47 -08:00
William Valentin 393aaf2743 refactor(channels): share reset message construction across adapters 2026-02-15 22:26:44 -08:00
William Valentin 8b529a18f2 refactor(channels): share reset-command normalization utility 2026-02-15 22:22:40 -08:00
William Valentin 05d8abc79d fix(slack): bound username cache with ttl and lru eviction 2026-02-15 22:21:06 -08:00
William Valentin 8709c3c9b4 fix(whatsapp): sandbox chromium by default 2026-02-15 21:57:52 -08:00
William Valentin c6e3d09ecc feat(gateway): add sender presence tracking 2026-02-15 19:28:16 -08:00
William Valentin 421942f66d feat(automation): add isolated job delivery mode 2026-02-15 19:23:15 -08:00
William Valentin bc8326cf4a feat(matrix): add Matrix channel adapter 2026-02-15 18:02:14 -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 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 2e235213d9 fix(audio): handle voice message failures gracefully
- Send user feedback when voice/audio download fails instead of silent failure
- Send graceful message when audio transcription is not configured instead of empty text which crashes API
2026-02-11 19:44:42 -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 1e1a68924e feat(pairing): add PairingStore interface for persistence injection 2026-02-09 21:45:04 -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 9d4d440ecf feat: add PairingManager and gateway lock tests (Tier 4 feature 4 foundation) 2026-02-09 13:32:59 -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 42696566f6 fix: resolve whatsapp-web.js ESM import for Node.js v25
whatsapp-web.js lacks proper ESM named exports, causing SyntaxError on
import. Switch to default import with destructuring, use InstanceType
for the Client type annotation, and update test mock to provide both
default and named exports.
2026-02-07 10:15:40 -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 a515912537 feat: add multimodal media pipeline for image support across all providers and channels
Widen Message.content from string to string | MessageContentPart[] to support
multimodal content. Add Attachment type to channel layer, media conversion
utilities, and image extraction to all channel adapters (Telegram, Discord,
Slack, WhatsApp). Update all model clients (Anthropic, OpenAI, Gemini, Bedrock)
to convert structured content to provider-specific formats. Fix downstream
consumers (tokens, compaction, TUI, local models) to handle the widened type
via getMessageText() helper.
2026-02-06 17:17:21 -08:00
William Valentin 647d7779c7 feat: add group chat and mention-gating to channel adapters
Slack: add requireMention option, resolve bot user ID on connect.
Telegram: add group chat mention/reply-to-bot detection, strip @mention
from message text, default requireMention=true for groups.
WhatsApp: add allowedGroupIds for group chat support, mention detection
via mentionedIds and body text, strip bot mention from messages.
2026-02-06 16:51:52 -08:00
William Valentin 4316dbd3be feat: add P2 features — retry policy, prompt templating, usage tracking, tech debt cleanup
- Extract shared splitMessage() into channels/utils.ts (dedup 4 adapters)
- Add Slack user name resolution with caching (users.info API)
- Add withRetry() with exponential backoff + jitter, isRetryable() filter
- Wire retry config into ModelRouter.chat() (non-streaming only)
- Add assembleSystemPrompt() multi-file template system (SOUL/AGENTS/IDENTITY/USER/TOOLS.md)
- Add usage tracking accumulators in NativeAgent + AgentOrchestrator
- Add estimateCost() with per-model pricing table
- Add /usage TUI command with full usage report formatting
- Add retrySchema and promptSchema to config schema

Tests: 569 passing, typecheck clean
2026-02-06 15:12:35 -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 eeaec53893 feat: add Slack channel adapter (Phase 3b)
Implement ChannelAdapter for Slack using @slack/bolt with Socket Mode:
- Thread-aware peer IDs (channelId:threadTs)
- Bot message and channel allowlist filtering
- Bot mention stripping (<@U\w+> pattern)
- Message chunking at 4000 chars for readability
- Error handling in connect/disconnect lifecycle
- Typed SlackMessageEvent interface
- 22 tests covering all behaviors
2026-02-06 14:24:17 -08:00
William Valentin 00db84f6a1 feat: add Discord channel adapter (Phase 3a)
Implement ChannelAdapter for Discord using discord.js:
- Bot mention filtering and mention stripping
- Guild and channel allowlist filtering
- Message chunking at 2000 chars
- Reset command detection (!reset / reset in DMs)
- 22 tests covering all behaviors
2026-02-06 14:24:11 -08:00