Commit Graph

103 Commits

Author SHA1 Message Date
Peter Steinberger
38b49aa0f6 feat: expand skill command registration 2026-01-16 20:17:32 +00:00
Peter Steinberger
0d6af15d1c feat: add user-invocable skill commands 2026-01-16 12:10:29 +00:00
juanpablodlc
4a99b9b651 feat(whatsapp): add debounceMs for batching rapid messages (#971)
* feat(whatsapp): add debounceMs for batching rapid messages

Add a `debounceMs` configuration option to WhatsApp channel settings
that batches rapid consecutive messages from the same sender into a
single response. This prevents triggering separate agent runs for
each message when a user sends multiple short messages in quick
succession (e.g., "Hey!", "how are you?", "I was wondering...").

Changes:
- Add `debounceMs` config to WhatsAppConfig and WhatsAppAccountConfig
- Implement message buffering in `monitorWebInbox` with:
  - Map-based buffer keyed by sender (DM) or chat ID (groups)
  - Debounce timer that resets on each new message
  - Message combination with newline separator
  - Single message optimization (no modification if only one message)
- Wire `debounceMs` through account resolution and monitor tuning
- Add UI hints and schema documentation

Usage example:
{
  "channels": {
    "whatsapp": {
      "debounceMs": 5000  // 5 second window
    }
  }
}

Default behavior: `debounceMs: 0` (disabled by default)

Verified: All existing tests pass (3204 tests), TypeScript compilation
succeeds with no errors.

Implemented with assistance from AI coding tools.

Closes #967

* chore: wip inbound debounce

* fix: debounce inbound messages across channels (#971) (thanks @juanpablodlc)

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-01-15 23:07:19 +00:00
Peter Steinberger
7dea403302 chore: purge DS_Store files 2026-01-15 22:59:16 +00:00
Peter Steinberger
cf81cb942b fix: guard Slack cmdarg decode 2026-01-15 10:25:35 +00:00
Peter Steinberger
52f876bfbc fix: native command arg menus follow-ups (#936) (thanks @thewilloftheshadow) 2026-01-15 09:33:31 +00:00
Shadow
74bc5bfd7c Commands: add dynamic arg menus 2026-01-15 09:31:16 +00:00
Peter Steinberger
4291d56e0b chore: format + fix telegram thread ids 2026-01-15 09:13:19 +00:00
Peter Steinberger
c269d5f258 fix: isolate Slack thread sessions (#758) 2026-01-15 08:11:03 +00:00
Peter Steinberger
f3519d895c fix: normalize slack channel types for sessions 2026-01-15 08:00:20 +00:00
Sebastian
113eea5047 fix: mutate prefixContext object instead of reassigning for closure correctness 2026-01-14 23:20:19 -05:00
Sebastian
d0a4cce41e feat: add dynamic template variables to messages.responsePrefix (#923)
Adds support for template variables in `messages.responsePrefix` that
resolve dynamically at runtime with the actual model used (including
after fallback).

Supported variables (case-insensitive):
- {model} - short model name (e.g., "claude-opus-4-5", "gpt-4o")
- {modelFull} - full model identifier (e.g., "anthropic/claude-opus-4-5")
- {provider} - provider name (e.g., "anthropic", "openai")
- {thinkingLevel} or {think} - thinking level ("high", "low", "off")
- {identity.name} or {identityName} - agent identity name

Example: "[{model} | think:{thinkingLevel}]" → "[claude-opus-4-5 | think:high]"

Variables show the actual model used after fallback, not the intended
model. Unresolved variables remain as literal text.

Implementation:
- New module: src/auto-reply/reply/response-prefix-template.ts
- Template interpolation in normalize-reply.ts via context provider
- onModelSelected callback in agent-runner-execution.ts
- Updated all 6 provider message handlers (web, signal, discord,
  telegram, slack, imessage)
- 27 unit tests covering all variables and edge cases
- Documentation in docs/gateway/configuration.md and JSDoc

Fixes #923
2026-01-14 23:05:08 -05:00
Peter Steinberger
765196d5c3 style(slack): satisfy oxfmt (#850) 2026-01-15 02:23:22 +00:00
Jonathan Wilkins
09ce6ff99e fix(slack): respect top-level requireMention config
The `channels.slack.requireMention` setting was defined in the schema
but never passed to `resolveSlackChannelConfig()`, which always
defaulted to `true`. This meant setting `requireMention: false` at the
top level had no effect—channels still required mentions.

Pass `slackCfg.requireMention` as `defaultRequireMention` to the
resolver and use it as the fallback instead of hardcoded `true`.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 02:17:27 +00:00
Peter Steinberger
ad8799522c feat(config): gate channel config writes 2026-01-15 01:41:15 +00:00
Peter Steinberger
e5c8abab9e fix: preserve markdown code fences 2026-01-15 00:31:07 +00:00
Peter Steinberger
bd7d362d3b refactor: unify markdown formatting pipeline 2026-01-15 00:31:07 +00:00
Peter Steinberger
dadef27d7a fix(slack): drop mismatched Socket Mode events (#889)
Filter Slack Socket Mode events by api_app_id/team_id.
Refs: #828
Contributor: @roshanasingh4

Co-authored-by: Roshan Singh <roshanasingh4@users.noreply.github.com>
2026-01-14 15:54:37 +00:00
Peter Steinberger
c379191f80 chore: migrate to oxlint and oxfmt
Co-authored-by: Christoph Nakazawa <christoph.pojer@gmail.com>
2026-01-14 15:02:19 +00:00
Peter Steinberger
ebea98b8ec test(slack): rename split suites 2026-01-14 05:40:55 +00:00
Peter Steinberger
bcbfb357be refactor(src): split oversized modules 2026-01-14 01:17:56 +00:00
Peter Steinberger
90342a4f3a refactor!: rename chat providers to channels 2026-01-13 08:40:39 +00:00
Shadow
68569afb4b Slack: accept slash command names with or without leading slash
Closes #798
2026-01-12 21:27:04 -06:00
Peter Steinberger
dd8f7552ad refactor: reuse dispatcher helper for native commands 2026-01-13 01:07:59 +00:00
Peter Steinberger
6a48688c09 fix: stream native slash tool replies 2026-01-13 00:53:30 +00:00
Peter Steinberger
4f3bedfdb7 fix: align discord autoThread config types 2026-01-13 00:22:42 +00:00
Peter Steinberger
a4bd960880 refactor: streamline thread reply planning 2026-01-13 00:15:29 +00:00
Peter Steinberger
bb9a9633a8 fix: align reply threading refs 2026-01-12 23:41:40 +00:00
Peter Steinberger
59c8d2d17f docs: clarify sandbox bind mounts (#790) 2026-01-12 22:06:35 +00:00
Peter Steinberger
26d5cca97c feat: auto native commands defaults 2026-01-12 21:49:44 +00:00
Peter Steinberger
9554292083 fix: default groupPolicy to open 2026-01-12 08:55:02 +00:00
Peter Steinberger
98e75fce17 test: align group policy defaults 2026-01-12 08:45:57 +00:00
Peter Steinberger
842e91d019 fix: default groupPolicy to allowlist 2026-01-12 08:22:01 +00:00
Peter Steinberger
e0bf86f06c feat: improve gateway services and auto-reply commands 2026-01-11 02:27:16 +01:00
Peter Steinberger
7c76561569 fix: dedupe inbound messages across providers 2026-01-11 00:12:25 +01:00
Peter Steinberger
82f71d25e5 refactor: centralize history context wrapping 2026-01-10 19:16:26 +01:00
Peter Steinberger
b977ae19af chore: fix lint and typing 2026-01-10 19:16:25 +01:00
Peter Steinberger
d41372b9d9 feat: unify provider history context 2026-01-10 19:16:25 +01:00
Lloyd
ab994d2c63 feat(agent): add human-like delay between block replies
Adds `agent.humanDelay` config option to create natural rhythm between
streamed message bubbles. When enabled, introduces a random delay
(default 800-2500ms) between block replies, making multi-message
responses feel more like natural human texting.

Config example:
```json
{
  "agent": {
    "blockStreamingDefault": "on",
    "humanDelay": {
      "enabled": true,
      "minMs": 800,
      "maxMs": 2500
    }
  }
}
```

- First message sends immediately
- Subsequent messages wait a random delay before sending
- Works with iMessage, Signal, and Discord providers

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 17:12:50 +01:00
Peter Steinberger
4f79122068 test: stabilize gateway mock + lint 2026-01-10 03:14:13 +00:00
Peter Steinberger
f241859c98 fix: relax fetch typing for Bun 2026-01-10 04:01:06 +01:00
Peter Steinberger
f28a4a34ad refactor: unify inline directives and media fetch 2026-01-10 03:01:04 +01:00
Peter Steinberger
38e2362be6 fix: remove ack reactions after reply (#633) (thanks @levifig) 2026-01-10 02:14:14 +01:00
Levi Figueira
b5858c0148 feat: add removeAckAfterReply option for Discord, Slack, and Telegram
Add `messages.removeAckAfterReply` config option to automatically remove
acknowledgment reactions after the bot sends a reply, reducing visual
clutter while still providing immediate feedback.

Platforms: Discord, Slack, Telegram

Implementation:
- Added removeAckAfterReply boolean field to MessagesConfig (default: false)
- Track ack reaction state in all three platform handlers
- Remove ack reaction after successful reply delivery
- Graceful error handling with verbose logging

Platform-specific:
- Discord: uses removeReactionDiscord()
- Slack: uses removeSlackReaction()
- Telegram: uses setMessageReaction() with empty array

Closes #627
2026-01-10 02:13:46 +01:00
Peter Steinberger
96e17d407a fix: filter NO_REPLY prefixes 2026-01-09 23:29:05 +00:00
Peter Steinberger
6c7a27c010 refactor: normalize main session key handling 2026-01-09 22:30:15 +01:00
Peter Steinberger
84046cbad8 fix(slack): mrkdwn + thread edge cases (#464) (thanks @austinm911) 2026-01-09 22:09:02 +01:00
Austin Mudd
8ae0429162 Slack: add mrkdwn formatter for proper bold/italic/strikethrough rendering 2026-01-09 21:59:51 +01:00
Austin Mudd
909c14d443 fix: resolve merge conflicts and fix threading tests
- Update MessageToolOptions type to include Slack threading options
- Remove duplicate threadTs property in slack/actions.ts
- Fix replyThreadTs parameter name in monitor.ts
- Update test to correctly verify 'first' mode threading behavior:
  - 'off' mode: no threading unless already in a thread
  - 'first' mode: first reply starts a thread
- Add new test case for 'first' mode threading
2026-01-09 21:59:51 +01:00
Austin Mudd
b4663ed11c Slack: implement replyToMode threading for tool path
- Add shared hasRepliedRef state between auto-reply and tool paths
- Extract buildSlackThreadingContext helper in agent-runner.ts
- Extract resolveThreadTsFromContext helper in slack-actions.ts
- Update docs with clear replyToMode table (off/first/all)
- Add tests for first mode behavior across multiple messages
2026-01-09 21:59:51 +01:00