docs: document protocol-agnostic bot core in README
- commit
- 15563fff44089e52d2cc9b1d292d5087040b249e
- author
- patriceckhart · · 2026-07-06 06:15 UTC
- parent
- 3cd4df6
- signature
- unsigned
- refs
- tag: v0.2.61
1 file · +8 -0
M README.md +8 -0
| @@ -768,6 +768,12 @@ From then on, any DM you send is forwarded to the agent as a user prompt. Attach | |||
| 768 | 768 | ||
| 769 | 769 | Bot mode respects the usual zot flags: `--provider`, `--model`, `--cwd`, `--reasoning`, `--continue`, `--no-session`, `--no-tools`, and so on. Run `zot tg run -c --model claude-opus-4-1` to resume the latest session on Opus, for example. | |
| 770 | 770 | ||
| 771 | + | ### Architecture: protocol-agnostic bot core | |
| 772 | + | ||
| 773 | + | The messenger functionality is split in two layers. A generic, protocol-agnostic core lives in `packages/agent/modes/bot`: it owns the turn queue, agent prompting, built-in command dispatch (`/start`, `/help`, `/status`, `/stop`), status formatting, and per-turn credential refresh. Concrete transports implement the small `BotAdapter` interface (inbound polling, sending replies, a typing indicator, and optional protocol-specific status text); the Telegram support in `packages/agent/modes/telegram` is one such adapter. | |
| 774 | + | ||
| 775 | + | This means additional messaging backends (Discord, Slack, Signal, and similar) can be added by implementing `BotAdapter` in a new package and wiring up a subcommand. No changes to the runner, agent, or core are required. Channel IDs are opaque strings owned by the adapter, so the shared runner stays free of protocol-specific types. | |
| 776 | + | ||
| 771 | 777 | ## Development | |
| 772 | 778 | ||
| 773 | 779 | ```bash | |
| @@ -790,6 +796,8 @@ packages/agent/ cli wiring, arg parsing, system prompt, co | |||
| 790 | 796 | packages/agent/extensions/ extension subprocess manager | |
| 791 | 797 | packages/agent/extproto/ extension wire-format types | |
| 792 | 798 | packages/agent/modes/ interactive tui, print, json, dialogs | |
| 799 | + | packages/agent/modes/bot/ protocol-agnostic bot runner (BotAdapter interface) | |
| 800 | + | packages/agent/modes/telegram/ telegram adapter, api client, daemon | |
| 793 | 801 | packages/agent/tools/ read, write, edit, bash, sandbox | |
| 794 | 802 | packages/agent/skills/ skill discovery, frontmatter parser, skill tool | |
| 795 | 803 | packages/agent/swarm/ background subagent runtime | |
| @@ -768,6 +768,12 @@ From then on, any DM you send is forwarded to the agent as a user prompt. Attach | |||||
| 768 | 768 | ||||
| 769 | Bot mode respects the usual zot flags: `--provider`, `--model`, `--cwd`, `--reasoning`, `--continue`, `--no-session`, `--no-tools`, and so on. Run `zot tg run -c --model claude-opus-4-1` to resume the latest session on Opus, for example. | 769 | Bot mode respects the usual zot flags: `--provider`, `--model`, `--cwd`, `--reasoning`, `--continue`, `--no-session`, `--no-tools`, and so on. Run `zot tg run -c --model claude-opus-4-1` to resume the latest session on Opus, for example. | ||
| 770 | 770 | ||||
| 771 | + | ### Architecture: protocol-agnostic bot core | |||
| 772 | + | ||||
| 773 | + | The messenger functionality is split in two layers. A generic, protocol-agnostic core lives in `packages/agent/modes/bot`: it owns the turn queue, agent prompting, built-in command dispatch (`/start`, `/help`, `/status`, `/stop`), status formatting, and per-turn credential refresh. Concrete transports implement the small `BotAdapter` interface (inbound polling, sending replies, a typing indicator, and optional protocol-specific status text); the Telegram support in `packages/agent/modes/telegram` is one such adapter. | |||
| 774 | + | ||||
| 775 | + | This means additional messaging backends (Discord, Slack, Signal, and similar) can be added by implementing `BotAdapter` in a new package and wiring up a subcommand. No changes to the runner, agent, or core are required. Channel IDs are opaque strings owned by the adapter, so the shared runner stays free of protocol-specific types. | |||
| 776 | + | ||||
| 771 | ## Development | 777 | ## Development | ||
| 772 | 778 | ||||
| 773 | ```bash | 779 | ```bash | ||
| @@ -790,6 +796,8 @@ packages/agent/ cli wiring, arg parsing, system prompt, co | |||||
| 790 | packages/agent/extensions/ extension subprocess manager | 796 | packages/agent/extensions/ extension subprocess manager | ||
| 791 | packages/agent/extproto/ extension wire-format types | 797 | packages/agent/extproto/ extension wire-format types | ||
| 792 | packages/agent/modes/ interactive tui, print, json, dialogs | 798 | packages/agent/modes/ interactive tui, print, json, dialogs | ||
| 799 | + | packages/agent/modes/bot/ protocol-agnostic bot runner (BotAdapter interface) | |||
| 800 | + | packages/agent/modes/telegram/ telegram adapter, api client, daemon | |||
| 793 | packages/agent/tools/ read, write, edit, bash, sandbox | 801 | packages/agent/tools/ read, write, edit, bash, sandbox | ||
| 794 | packages/agent/skills/ skill discovery, frontmatter parser, skill tool | 802 | packages/agent/skills/ skill discovery, frontmatter parser, skill tool | ||
| 795 | packages/agent/swarm/ background subagent runtime | 803 | packages/agent/swarm/ background subagent runtime | ||