agent-doorbell 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. agent_doorbell-0.1.0/LICENSE +21 -0
  2. agent_doorbell-0.1.0/PKG-INFO +142 -0
  3. agent_doorbell-0.1.0/README.md +118 -0
  4. agent_doorbell-0.1.0/agent_doorbell.egg-info/PKG-INFO +142 -0
  5. agent_doorbell-0.1.0/agent_doorbell.egg-info/SOURCES.txt +30 -0
  6. agent_doorbell-0.1.0/agent_doorbell.egg-info/dependency_links.txt +1 -0
  7. agent_doorbell-0.1.0/agent_doorbell.egg-info/entry_points.txt +2 -0
  8. agent_doorbell-0.1.0/agent_doorbell.egg-info/requires.txt +4 -0
  9. agent_doorbell-0.1.0/agent_doorbell.egg-info/top_level.txt +1 -0
  10. agent_doorbell-0.1.0/doorbell/__init__.py +2 -0
  11. agent_doorbell-0.1.0/doorbell/__main__.py +3 -0
  12. agent_doorbell-0.1.0/doorbell/agentkit.py +59 -0
  13. agent_doorbell-0.1.0/doorbell/cli.py +278 -0
  14. agent_doorbell-0.1.0/doorbell/config.py +70 -0
  15. agent_doorbell-0.1.0/doorbell/daemon.py +643 -0
  16. agent_doorbell-0.1.0/doorbell/runner.py +87 -0
  17. agent_doorbell-0.1.0/doorbell/server.py +366 -0
  18. agent_doorbell-0.1.0/doorbell/service.py +169 -0
  19. agent_doorbell-0.1.0/doorbell/slackapi.py +72 -0
  20. agent_doorbell-0.1.0/doorbell/store.py +56 -0
  21. agent_doorbell-0.1.0/doorbell/templates/__init__.py +0 -0
  22. agent_doorbell-0.1.0/doorbell/templates/protocol.md +18 -0
  23. agent_doorbell-0.1.0/doorbell/templates/rules.md +48 -0
  24. agent_doorbell-0.1.0/doorbell/templates/sub.yaml +11 -0
  25. agent_doorbell-0.1.0/pyproject.toml +46 -0
  26. agent_doorbell-0.1.0/setup.cfg +4 -0
  27. agent_doorbell-0.1.0/tests/test_agentkit.py +89 -0
  28. agent_doorbell-0.1.0/tests/test_dispatch.py +135 -0
  29. agent_doorbell-0.1.0/tests/test_hooks.py +137 -0
  30. agent_doorbell-0.1.0/tests/test_identity.py +132 -0
  31. agent_doorbell-0.1.0/tests/test_queue.py +246 -0
  32. agent_doorbell-0.1.0/tests/test_routing.py +235 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Mayank Raj and Agent Doorbell contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,142 @@
1
+ Metadata-Version: 2.4
2
+ Name: agent-doorbell
3
+ Version: 0.1.0
4
+ Summary: Agent Doorbell for Slack: a token-free watcher that wakes your AI agents only when a Slack message needs them.
5
+ License-Expression: MIT
6
+ Project-URL: Homepage, https://github.com/mraj602/agent-doorbell
7
+ Project-URL: Documentation, https://github.com/mraj602/agent-doorbell/tree/main/docs
8
+ Project-URL: Issues, https://github.com/mraj602/agent-doorbell/issues
9
+ Keywords: slack,ai-agents,claude-code,codex,automation
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Operating System :: POSIX :: Linux
14
+ Classifier: Operating System :: MacOS
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Topic :: Communications :: Chat
17
+ Requires-Python: >=3.10
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+ Requires-Dist: PyYAML>=6
21
+ Provides-Extra: test
22
+ Requires-Dist: pytest>=8; extra == "test"
23
+ Dynamic: license-file
24
+
25
+ # Agent Doorbell for Slack
26
+
27
+ [![ci](https://github.com/mraj602/agent-doorbell/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/mraj602/agent-doorbell/actions/workflows/ci.yml)
28
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
29
+
30
+ **Let your AI agents sleep. Agent Doorbell watches Slack and wakes them only when someone
31
+ needs them.**
32
+
33
+ An AI agent that "watches Slack" usually does it by checking: every few minutes it spends a
34
+ model turn to find out that nothing happened. Agent Doorbell moves the watching into a tiny
35
+ local daemon with no LLM. It polls Slack with a read-only token, queues the messages meant for
36
+ you, and rings the agent (Claude Code, Codex, Gemini CLI or your own) only when there is
37
+ something to handle. **Zero tokens while nobody is calling.**
38
+
39
+ > **Unofficial.** Agent Doorbell is an independent project. It is not affiliated with,
40
+ > endorsed by or connected to Slack Technologies, Salesforce, Anthropic or OpenAI. "Slack",
41
+ > "Claude" and other names are trademarks of their owners, used only to describe
42
+ > compatibility.
43
+
44
+ ```
45
+ Slack ──(read-only polls; none when no agent listens)──▶ doorbelld ──▶ per-agent queue
46
+ │ rings
47
+ your agent ◀── doorbell wait (blocks, costs nothing) ────────┘
48
+ │ handles the batch: replies or drafts with its own Slack tool, or escalates to you
49
+ └──▶ hooks and observed replies ack each item; unfinished items come back
50
+ ```
51
+
52
+ ## Why
53
+
54
+ - **No token waste.** The agent runs only when a message needs it. With no agents
55
+ registered, the daemon makes no Slack calls at all.
56
+ - **It's your agent, with your context.** Replies come from your own agent, with your repos,
57
+ tools and instructions, not from a generic bot.
58
+ - **Read-only and harness-neutral.** Doorbell itself never posts and never touches your
59
+ agent's settings. Whether the agent replies, drafts or only triages is set where it
60
+ belongs: in your agent's own permissions (for Claude Code, one command-line flag).
61
+ - **Nothing gets lost.** Items are leased and acked. A crashed or rate-limited agent gets them
62
+ back. A laptop that was asleep catches up from where it stopped.
63
+ - **No server, no webhook, no public URL.** It runs on your laptop or dev box, on Slack's free
64
+ plan.
65
+ - **Any agent, any OS.** Linux, macOS and Windows. Agents register themselves and use three
66
+ commands: `wait`, `inbox --claim` and `ack`. Claude Code gets a plugin with a guided
67
+ `/agent-doorbell:setup`, handle and listen skills, and hooks that ack automatically.
68
+
69
+ ## Quick start
70
+
71
+ ```bash
72
+ pipx install agent-doorbell # or: uv tool install agent-doorbell
73
+ # not on PyPI yet? pipx install git+https://github.com/mraj602/agent-doorbell
74
+
75
+ # 1. Create your own read-only Slack app from slack-app-manifest.yaml and save its xoxp- token
76
+ mkdir -p ~/.config/doorbell
77
+ ( umask 077; read -rsp 'Slack user token: ' t; echo; printf '%s\n' "$t" > ~/.config/doorbell/slack-token )
78
+
79
+ # 2. Start the watcher and add the token
80
+ doorbell service install
81
+ doorbell identity add --token-file ~/.config/doorbell/slack-token
82
+
83
+ # 3. Create an agent folder, then edit its AGENTS.md (instructions) and sub.yaml (who to listen to)
84
+ doorbell init-agent ~/doorbell-agents/main --owner "Your Name"
85
+ claude plugin marketplace add mraj602/agent-doorbell # Claude Code: skills and auto-ack hooks
86
+ claude plugin install agent-doorbell@agent-doorbell
87
+
88
+ # 4. Run it headless: one short agent run per batch. The agent registers itself.
89
+ # Your agent's own flags decide what it may do; this one may only write drafts.
90
+ doorbell service install --dispatch main --dir ~/doorbell-agents/main -- \
91
+ claude -p "/agent-doorbell:handle" --model sonnet --allowedTools "Bash(doorbell *)" \
92
+ "mcp__plugin_slack_slack__slack_send_message_draft" \
93
+ --disallowedTools "mcp__plugin_slack_slack__slack_send_message" "mcp__plugin_slack_slack__slack_schedule_message"
94
+ ```
95
+
96
+ On Windows, save the token with the PowerShell lines in the setup guide. The full
97
+ walkthrough, with a check after every step, is in **[docs/SETUP.md](docs/SETUP.md)**. It is
98
+ written so an AI agent can follow it for you too.
99
+
100
+ ## What the agent may do
101
+
102
+ You choose, in your agent's own permissions (see [SETUP step 6](docs/SETUP.md#6-decide-what-the-agent-may-do)):
103
+
104
+ | Level | The agent can | Good for |
105
+ |---|---|---|
106
+ | Triage | post nothing; sort items into escalated (with a summary) or ignored | a filter and a digest |
107
+ | Draft | write drafts in the right DM or thread; you review and send | starting out with replies |
108
+ | Reply | post as you, react, draft | routine questions you trust it with |
109
+
110
+ Sending through Doorbell itself, with drafts you approve from the terminal, is planned for the next release.
111
+
112
+ ## How it compares
113
+
114
+ | | Agent Doorbell | Agent checks Slack on a timer | Hosted bot + LLM API |
115
+ |---|---|---|---|
116
+ | Tokens while idle | **zero** | a model turn per check, all day | zero |
117
+ | Replies as | you, or drafts for you | you | a bot |
118
+ | Your repos and tools | yes | yes | no |
119
+ | Infrastructure | a local daemon | none | server, public URL or socket, API key |
120
+ | Catches up after downtime | yes | no | depends |
121
+
122
+ Why polling and not Slack's Events API or webhooks? Polling needs no public URL or always-on
123
+ socket, and it can catch up after downtime, which events can't. The comparison table,
124
+ pros and cons, and the security model are in **[docs/ARCHITECTURE.md](docs/ARCHITECTURE.md)**.
125
+
126
+ ## Documentation
127
+
128
+ - [Setup guide](docs/SETUP.md): install, Slack app, first agent, test, troubleshooting
129
+ - [Architecture](docs/ARCHITECTURE.md): design, queue and acks, security model, comparisons
130
+ - [Running agents for days](docs/RUNNING.md): live sessions vs headless dispatch, Claude Code limits
131
+ - [Changelog](CHANGELOG.md) · [Contributing](CONTRIBUTING.md) · [Security](SECURITY.md)
132
+
133
+ ## Status and limits
134
+
135
+ Version 0.1.0: early, read-only. Linux is the tested platform; macOS and Windows should work
136
+ but are not covered by CI yet. One person per daemon. Replies arrive
137
+ within about 30 seconds, not instantly. See
138
+ [Limits and known gaps](docs/ARCHITECTURE.md#14-limits-and-known-gaps).
139
+
140
+ ## License
141
+
142
+ [MIT](LICENSE).
@@ -0,0 +1,118 @@
1
+ # Agent Doorbell for Slack
2
+
3
+ [![ci](https://github.com/mraj602/agent-doorbell/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/mraj602/agent-doorbell/actions/workflows/ci.yml)
4
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
5
+
6
+ **Let your AI agents sleep. Agent Doorbell watches Slack and wakes them only when someone
7
+ needs them.**
8
+
9
+ An AI agent that "watches Slack" usually does it by checking: every few minutes it spends a
10
+ model turn to find out that nothing happened. Agent Doorbell moves the watching into a tiny
11
+ local daemon with no LLM. It polls Slack with a read-only token, queues the messages meant for
12
+ you, and rings the agent (Claude Code, Codex, Gemini CLI or your own) only when there is
13
+ something to handle. **Zero tokens while nobody is calling.**
14
+
15
+ > **Unofficial.** Agent Doorbell is an independent project. It is not affiliated with,
16
+ > endorsed by or connected to Slack Technologies, Salesforce, Anthropic or OpenAI. "Slack",
17
+ > "Claude" and other names are trademarks of their owners, used only to describe
18
+ > compatibility.
19
+
20
+ ```
21
+ Slack ──(read-only polls; none when no agent listens)──▶ doorbelld ──▶ per-agent queue
22
+ │ rings
23
+ your agent ◀── doorbell wait (blocks, costs nothing) ────────┘
24
+ │ handles the batch: replies or drafts with its own Slack tool, or escalates to you
25
+ └──▶ hooks and observed replies ack each item; unfinished items come back
26
+ ```
27
+
28
+ ## Why
29
+
30
+ - **No token waste.** The agent runs only when a message needs it. With no agents
31
+ registered, the daemon makes no Slack calls at all.
32
+ - **It's your agent, with your context.** Replies come from your own agent, with your repos,
33
+ tools and instructions, not from a generic bot.
34
+ - **Read-only and harness-neutral.** Doorbell itself never posts and never touches your
35
+ agent's settings. Whether the agent replies, drafts or only triages is set where it
36
+ belongs: in your agent's own permissions (for Claude Code, one command-line flag).
37
+ - **Nothing gets lost.** Items are leased and acked. A crashed or rate-limited agent gets them
38
+ back. A laptop that was asleep catches up from where it stopped.
39
+ - **No server, no webhook, no public URL.** It runs on your laptop or dev box, on Slack's free
40
+ plan.
41
+ - **Any agent, any OS.** Linux, macOS and Windows. Agents register themselves and use three
42
+ commands: `wait`, `inbox --claim` and `ack`. Claude Code gets a plugin with a guided
43
+ `/agent-doorbell:setup`, handle and listen skills, and hooks that ack automatically.
44
+
45
+ ## Quick start
46
+
47
+ ```bash
48
+ pipx install agent-doorbell # or: uv tool install agent-doorbell
49
+ # not on PyPI yet? pipx install git+https://github.com/mraj602/agent-doorbell
50
+
51
+ # 1. Create your own read-only Slack app from slack-app-manifest.yaml and save its xoxp- token
52
+ mkdir -p ~/.config/doorbell
53
+ ( umask 077; read -rsp 'Slack user token: ' t; echo; printf '%s\n' "$t" > ~/.config/doorbell/slack-token )
54
+
55
+ # 2. Start the watcher and add the token
56
+ doorbell service install
57
+ doorbell identity add --token-file ~/.config/doorbell/slack-token
58
+
59
+ # 3. Create an agent folder, then edit its AGENTS.md (instructions) and sub.yaml (who to listen to)
60
+ doorbell init-agent ~/doorbell-agents/main --owner "Your Name"
61
+ claude plugin marketplace add mraj602/agent-doorbell # Claude Code: skills and auto-ack hooks
62
+ claude plugin install agent-doorbell@agent-doorbell
63
+
64
+ # 4. Run it headless: one short agent run per batch. The agent registers itself.
65
+ # Your agent's own flags decide what it may do; this one may only write drafts.
66
+ doorbell service install --dispatch main --dir ~/doorbell-agents/main -- \
67
+ claude -p "/agent-doorbell:handle" --model sonnet --allowedTools "Bash(doorbell *)" \
68
+ "mcp__plugin_slack_slack__slack_send_message_draft" \
69
+ --disallowedTools "mcp__plugin_slack_slack__slack_send_message" "mcp__plugin_slack_slack__slack_schedule_message"
70
+ ```
71
+
72
+ On Windows, save the token with the PowerShell lines in the setup guide. The full
73
+ walkthrough, with a check after every step, is in **[docs/SETUP.md](docs/SETUP.md)**. It is
74
+ written so an AI agent can follow it for you too.
75
+
76
+ ## What the agent may do
77
+
78
+ You choose, in your agent's own permissions (see [SETUP step 6](docs/SETUP.md#6-decide-what-the-agent-may-do)):
79
+
80
+ | Level | The agent can | Good for |
81
+ |---|---|---|
82
+ | Triage | post nothing; sort items into escalated (with a summary) or ignored | a filter and a digest |
83
+ | Draft | write drafts in the right DM or thread; you review and send | starting out with replies |
84
+ | Reply | post as you, react, draft | routine questions you trust it with |
85
+
86
+ Sending through Doorbell itself, with drafts you approve from the terminal, is planned for the next release.
87
+
88
+ ## How it compares
89
+
90
+ | | Agent Doorbell | Agent checks Slack on a timer | Hosted bot + LLM API |
91
+ |---|---|---|---|
92
+ | Tokens while idle | **zero** | a model turn per check, all day | zero |
93
+ | Replies as | you, or drafts for you | you | a bot |
94
+ | Your repos and tools | yes | yes | no |
95
+ | Infrastructure | a local daemon | none | server, public URL or socket, API key |
96
+ | Catches up after downtime | yes | no | depends |
97
+
98
+ Why polling and not Slack's Events API or webhooks? Polling needs no public URL or always-on
99
+ socket, and it can catch up after downtime, which events can't. The comparison table,
100
+ pros and cons, and the security model are in **[docs/ARCHITECTURE.md](docs/ARCHITECTURE.md)**.
101
+
102
+ ## Documentation
103
+
104
+ - [Setup guide](docs/SETUP.md): install, Slack app, first agent, test, troubleshooting
105
+ - [Architecture](docs/ARCHITECTURE.md): design, queue and acks, security model, comparisons
106
+ - [Running agents for days](docs/RUNNING.md): live sessions vs headless dispatch, Claude Code limits
107
+ - [Changelog](CHANGELOG.md) · [Contributing](CONTRIBUTING.md) · [Security](SECURITY.md)
108
+
109
+ ## Status and limits
110
+
111
+ Version 0.1.0: early, read-only. Linux is the tested platform; macOS and Windows should work
112
+ but are not covered by CI yet. One person per daemon. Replies arrive
113
+ within about 30 seconds, not instantly. See
114
+ [Limits and known gaps](docs/ARCHITECTURE.md#14-limits-and-known-gaps).
115
+
116
+ ## License
117
+
118
+ [MIT](LICENSE).
@@ -0,0 +1,142 @@
1
+ Metadata-Version: 2.4
2
+ Name: agent-doorbell
3
+ Version: 0.1.0
4
+ Summary: Agent Doorbell for Slack: a token-free watcher that wakes your AI agents only when a Slack message needs them.
5
+ License-Expression: MIT
6
+ Project-URL: Homepage, https://github.com/mraj602/agent-doorbell
7
+ Project-URL: Documentation, https://github.com/mraj602/agent-doorbell/tree/main/docs
8
+ Project-URL: Issues, https://github.com/mraj602/agent-doorbell/issues
9
+ Keywords: slack,ai-agents,claude-code,codex,automation
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Operating System :: POSIX :: Linux
14
+ Classifier: Operating System :: MacOS
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Topic :: Communications :: Chat
17
+ Requires-Python: >=3.10
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+ Requires-Dist: PyYAML>=6
21
+ Provides-Extra: test
22
+ Requires-Dist: pytest>=8; extra == "test"
23
+ Dynamic: license-file
24
+
25
+ # Agent Doorbell for Slack
26
+
27
+ [![ci](https://github.com/mraj602/agent-doorbell/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/mraj602/agent-doorbell/actions/workflows/ci.yml)
28
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
29
+
30
+ **Let your AI agents sleep. Agent Doorbell watches Slack and wakes them only when someone
31
+ needs them.**
32
+
33
+ An AI agent that "watches Slack" usually does it by checking: every few minutes it spends a
34
+ model turn to find out that nothing happened. Agent Doorbell moves the watching into a tiny
35
+ local daemon with no LLM. It polls Slack with a read-only token, queues the messages meant for
36
+ you, and rings the agent (Claude Code, Codex, Gemini CLI or your own) only when there is
37
+ something to handle. **Zero tokens while nobody is calling.**
38
+
39
+ > **Unofficial.** Agent Doorbell is an independent project. It is not affiliated with,
40
+ > endorsed by or connected to Slack Technologies, Salesforce, Anthropic or OpenAI. "Slack",
41
+ > "Claude" and other names are trademarks of their owners, used only to describe
42
+ > compatibility.
43
+
44
+ ```
45
+ Slack ──(read-only polls; none when no agent listens)──▶ doorbelld ──▶ per-agent queue
46
+ │ rings
47
+ your agent ◀── doorbell wait (blocks, costs nothing) ────────┘
48
+ │ handles the batch: replies or drafts with its own Slack tool, or escalates to you
49
+ └──▶ hooks and observed replies ack each item; unfinished items come back
50
+ ```
51
+
52
+ ## Why
53
+
54
+ - **No token waste.** The agent runs only when a message needs it. With no agents
55
+ registered, the daemon makes no Slack calls at all.
56
+ - **It's your agent, with your context.** Replies come from your own agent, with your repos,
57
+ tools and instructions, not from a generic bot.
58
+ - **Read-only and harness-neutral.** Doorbell itself never posts and never touches your
59
+ agent's settings. Whether the agent replies, drafts or only triages is set where it
60
+ belongs: in your agent's own permissions (for Claude Code, one command-line flag).
61
+ - **Nothing gets lost.** Items are leased and acked. A crashed or rate-limited agent gets them
62
+ back. A laptop that was asleep catches up from where it stopped.
63
+ - **No server, no webhook, no public URL.** It runs on your laptop or dev box, on Slack's free
64
+ plan.
65
+ - **Any agent, any OS.** Linux, macOS and Windows. Agents register themselves and use three
66
+ commands: `wait`, `inbox --claim` and `ack`. Claude Code gets a plugin with a guided
67
+ `/agent-doorbell:setup`, handle and listen skills, and hooks that ack automatically.
68
+
69
+ ## Quick start
70
+
71
+ ```bash
72
+ pipx install agent-doorbell # or: uv tool install agent-doorbell
73
+ # not on PyPI yet? pipx install git+https://github.com/mraj602/agent-doorbell
74
+
75
+ # 1. Create your own read-only Slack app from slack-app-manifest.yaml and save its xoxp- token
76
+ mkdir -p ~/.config/doorbell
77
+ ( umask 077; read -rsp 'Slack user token: ' t; echo; printf '%s\n' "$t" > ~/.config/doorbell/slack-token )
78
+
79
+ # 2. Start the watcher and add the token
80
+ doorbell service install
81
+ doorbell identity add --token-file ~/.config/doorbell/slack-token
82
+
83
+ # 3. Create an agent folder, then edit its AGENTS.md (instructions) and sub.yaml (who to listen to)
84
+ doorbell init-agent ~/doorbell-agents/main --owner "Your Name"
85
+ claude plugin marketplace add mraj602/agent-doorbell # Claude Code: skills and auto-ack hooks
86
+ claude plugin install agent-doorbell@agent-doorbell
87
+
88
+ # 4. Run it headless: one short agent run per batch. The agent registers itself.
89
+ # Your agent's own flags decide what it may do; this one may only write drafts.
90
+ doorbell service install --dispatch main --dir ~/doorbell-agents/main -- \
91
+ claude -p "/agent-doorbell:handle" --model sonnet --allowedTools "Bash(doorbell *)" \
92
+ "mcp__plugin_slack_slack__slack_send_message_draft" \
93
+ --disallowedTools "mcp__plugin_slack_slack__slack_send_message" "mcp__plugin_slack_slack__slack_schedule_message"
94
+ ```
95
+
96
+ On Windows, save the token with the PowerShell lines in the setup guide. The full
97
+ walkthrough, with a check after every step, is in **[docs/SETUP.md](docs/SETUP.md)**. It is
98
+ written so an AI agent can follow it for you too.
99
+
100
+ ## What the agent may do
101
+
102
+ You choose, in your agent's own permissions (see [SETUP step 6](docs/SETUP.md#6-decide-what-the-agent-may-do)):
103
+
104
+ | Level | The agent can | Good for |
105
+ |---|---|---|
106
+ | Triage | post nothing; sort items into escalated (with a summary) or ignored | a filter and a digest |
107
+ | Draft | write drafts in the right DM or thread; you review and send | starting out with replies |
108
+ | Reply | post as you, react, draft | routine questions you trust it with |
109
+
110
+ Sending through Doorbell itself, with drafts you approve from the terminal, is planned for the next release.
111
+
112
+ ## How it compares
113
+
114
+ | | Agent Doorbell | Agent checks Slack on a timer | Hosted bot + LLM API |
115
+ |---|---|---|---|
116
+ | Tokens while idle | **zero** | a model turn per check, all day | zero |
117
+ | Replies as | you, or drafts for you | you | a bot |
118
+ | Your repos and tools | yes | yes | no |
119
+ | Infrastructure | a local daemon | none | server, public URL or socket, API key |
120
+ | Catches up after downtime | yes | no | depends |
121
+
122
+ Why polling and not Slack's Events API or webhooks? Polling needs no public URL or always-on
123
+ socket, and it can catch up after downtime, which events can't. The comparison table,
124
+ pros and cons, and the security model are in **[docs/ARCHITECTURE.md](docs/ARCHITECTURE.md)**.
125
+
126
+ ## Documentation
127
+
128
+ - [Setup guide](docs/SETUP.md): install, Slack app, first agent, test, troubleshooting
129
+ - [Architecture](docs/ARCHITECTURE.md): design, queue and acks, security model, comparisons
130
+ - [Running agents for days](docs/RUNNING.md): live sessions vs headless dispatch, Claude Code limits
131
+ - [Changelog](CHANGELOG.md) · [Contributing](CONTRIBUTING.md) · [Security](SECURITY.md)
132
+
133
+ ## Status and limits
134
+
135
+ Version 0.1.0: early, read-only. Linux is the tested platform; macOS and Windows should work
136
+ but are not covered by CI yet. One person per daemon. Replies arrive
137
+ within about 30 seconds, not instantly. See
138
+ [Limits and known gaps](docs/ARCHITECTURE.md#14-limits-and-known-gaps).
139
+
140
+ ## License
141
+
142
+ [MIT](LICENSE).
@@ -0,0 +1,30 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ agent_doorbell.egg-info/PKG-INFO
5
+ agent_doorbell.egg-info/SOURCES.txt
6
+ agent_doorbell.egg-info/dependency_links.txt
7
+ agent_doorbell.egg-info/entry_points.txt
8
+ agent_doorbell.egg-info/requires.txt
9
+ agent_doorbell.egg-info/top_level.txt
10
+ doorbell/__init__.py
11
+ doorbell/__main__.py
12
+ doorbell/agentkit.py
13
+ doorbell/cli.py
14
+ doorbell/config.py
15
+ doorbell/daemon.py
16
+ doorbell/runner.py
17
+ doorbell/server.py
18
+ doorbell/service.py
19
+ doorbell/slackapi.py
20
+ doorbell/store.py
21
+ doorbell/templates/__init__.py
22
+ doorbell/templates/protocol.md
23
+ doorbell/templates/rules.md
24
+ doorbell/templates/sub.yaml
25
+ tests/test_agentkit.py
26
+ tests/test_dispatch.py
27
+ tests/test_hooks.py
28
+ tests/test_identity.py
29
+ tests/test_queue.py
30
+ tests/test_routing.py
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ doorbell = doorbell.cli:main
@@ -0,0 +1,4 @@
1
+ PyYAML>=6
2
+
3
+ [test]
4
+ pytest>=8
@@ -0,0 +1,2 @@
1
+ """Agent Doorbell for Slack: a token-free Slack watcher that wakes AI agents only when needed."""
2
+ __version__ = "0.1.0"
@@ -0,0 +1,3 @@
1
+ from .cli import main
2
+
3
+ main()
@@ -0,0 +1,59 @@
1
+ """`doorbell init-agent`: generate a harness-neutral agent folder.
2
+
3
+ Doorbell only listens. How the agent replies (its own Slack tool, drafts, or not at all) and
4
+ which tools it may use are decided by the harness that runs it (Claude Code, Codex, ...), so
5
+ this writes instructions and a subscription, never permission settings. Claude Code users get
6
+ skills and auto-ack hooks from the agent-doorbell plugin instead of per-folder files.
7
+ """
8
+ import shutil
9
+ import sys
10
+ from importlib import resources
11
+ from pathlib import Path
12
+
13
+
14
+ def template(name):
15
+ return resources.files("doorbell.templates").joinpath(name).read_text()
16
+
17
+
18
+ def doorbell_cmd():
19
+ """How hooks should invoke doorbell on this machine."""
20
+ exe = shutil.which("doorbell")
21
+ return exe or f"{sys.executable} -m doorbell"
22
+
23
+
24
+ def write(path, text, force, made):
25
+ if path.exists() and not force:
26
+ print(f" keep {path} (exists; --force to overwrite)")
27
+ return
28
+ path.parent.mkdir(parents=True, exist_ok=True)
29
+ path.write_text(text)
30
+ made.append(path)
31
+ print(f" wrote {path}")
32
+
33
+
34
+ def init_agent(folder, name=None, owner=None, force=False):
35
+ root = Path(folder).expanduser().resolve()
36
+ name = name or root.name
37
+ owner = owner or "the owner"
38
+ agents_md = (template("rules.md") + "\n" + template("protocol.md")).replace("{owner}", owner)
39
+ made = []
40
+ print(f"Agent folder {root} (agent {name!r})")
41
+ write(root / ".doorbell-agent", name + "\n", force, made)
42
+ write(root / "sub.yaml", template("sub.yaml"), force, made)
43
+ write(root / "AGENTS.md", agents_md, force, made)
44
+ write(root / "CLAUDE.md", "@AGENTS.md\n", force, made) # Claude Code reads CLAUDE.md; this imports AGENTS.md
45
+ print(NEXT.format(dir=root))
46
+ return made
47
+
48
+
49
+ NEXT = """
50
+ Next:
51
+ 1. Edit {dir}/AGENTS.md (the top half): who you are, what the agent should answer, ignore or
52
+ leave for you, and how it may reply. Edit {dir}/sub.yaml: whose messages to listen to.
53
+ 2. Decide in your agent's own settings which Slack tools it may use (see docs/SETUP.md, step 6).
54
+ Doorbell never posts; replying is up to the agent and its harness.
55
+ 3. Start the agent in {dir}. It registers itself (`doorbell register`) and starts listening.
56
+ Headless, one short run per batch of messages:
57
+ doorbell service install --dispatch <name> --dir {dir} -- <agent command>
58
+ Claude Code: install the agent-doorbell plugin and use claude -p "/agent-doorbell:handle".
59
+ See docs/SETUP.md, step 7, for Claude Code, Codex and Gemini CLI examples."""