python-slack-agents 0.5.0__py3-none-any.whl
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.
- python_slack_agents-0.5.0.dist-info/METADATA +318 -0
- python_slack_agents-0.5.0.dist-info/RECORD +54 -0
- python_slack_agents-0.5.0.dist-info/WHEEL +4 -0
- python_slack_agents-0.5.0.dist-info/entry_points.txt +2 -0
- python_slack_agents-0.5.0.dist-info/licenses/LICENSE +202 -0
- slack_agents/Dockerfile +25 -0
- slack_agents/__init__.py +25 -0
- slack_agents/access/__init__.py +0 -0
- slack_agents/access/allow_all.py +9 -0
- slack_agents/access/allow_list.py +19 -0
- slack_agents/access/base.py +20 -0
- slack_agents/agent_loop.py +208 -0
- slack_agents/cli/__init__.py +48 -0
- slack_agents/cli/build_docker.py +94 -0
- slack_agents/cli/export_conversations.py +84 -0
- slack_agents/cli/export_conversations_html.py +605 -0
- slack_agents/cli/export_usage.py +81 -0
- slack_agents/cli/export_usage_csv.py +151 -0
- slack_agents/cli/healthcheck.py +67 -0
- slack_agents/cli/run.py +16 -0
- slack_agents/config.py +113 -0
- slack_agents/conversations.py +273 -0
- slack_agents/files.py +59 -0
- slack_agents/llm/__init__.py +1 -0
- slack_agents/llm/anthropic.py +207 -0
- slack_agents/llm/base.py +82 -0
- slack_agents/llm/openai.py +283 -0
- slack_agents/main.py +55 -0
- slack_agents/observability.py +175 -0
- slack_agents/py.typed +0 -0
- slack_agents/scripts/__init__.py +0 -0
- slack_agents/scripts/download_fonts.py +39 -0
- slack_agents/slack/__init__.py +0 -0
- slack_agents/slack/actions.py +119 -0
- slack_agents/slack/agent.py +688 -0
- slack_agents/slack/canvases.py +225 -0
- slack_agents/slack/files.py +102 -0
- slack_agents/slack/format.py +55 -0
- slack_agents/slack/streaming.py +70 -0
- slack_agents/slack/streaming_formatter.py +182 -0
- slack_agents/slack/tool_blocks.py +97 -0
- slack_agents/storage/__init__.py +0 -0
- slack_agents/storage/base.py +304 -0
- slack_agents/storage/postgres.py +612 -0
- slack_agents/storage/postgres.sql +120 -0
- slack_agents/storage/sqlite.py +473 -0
- slack_agents/storage/sqlite.sql +73 -0
- slack_agents/tools/__init__.py +0 -0
- slack_agents/tools/base.py +140 -0
- slack_agents/tools/canvas.py +401 -0
- slack_agents/tools/file_exporter.py +582 -0
- slack_agents/tools/file_importer.py +363 -0
- slack_agents/tools/mcp_http.py +203 -0
- slack_agents/tools/user_context.py +239 -0
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: python-slack-agents
|
|
3
|
+
Version: 0.5.0
|
|
4
|
+
Summary: A Python framework for deploying AI agents as Slack bots
|
|
5
|
+
Project-URL: Homepage, https://github.com/CompareNetworks/python-slack-agents
|
|
6
|
+
Project-URL: Repository, https://github.com/CompareNetworks/python-slack-agents
|
|
7
|
+
Project-URL: Documentation, https://github.com/CompareNetworks/python-slack-agents/tree/main/docs
|
|
8
|
+
Project-URL: Issues, https://github.com/CompareNetworks/python-slack-agents/issues
|
|
9
|
+
Author-email: Eric Pichon <epichon@comparenetworks.com>
|
|
10
|
+
License: Apache-2.0
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: agents,ai,anthropic,chatbot,llm,mcp,openai,slack
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: Topic :: Communications :: Chat
|
|
18
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
19
|
+
Requires-Python: >=3.12
|
|
20
|
+
Requires-Dist: aiohttp<4,>=3.9
|
|
21
|
+
Requires-Dist: aiosqlite<1,>=0.20
|
|
22
|
+
Requires-Dist: anthropic<1,>=0.40
|
|
23
|
+
Requires-Dist: asyncpg<1,>=0.30
|
|
24
|
+
Requires-Dist: fpdf2<3,>=2.8
|
|
25
|
+
Requires-Dist: httpx<1,>=0.27
|
|
26
|
+
Requires-Dist: mcp<2,>=1.0
|
|
27
|
+
Requires-Dist: openai<2,>=1.50
|
|
28
|
+
Requires-Dist: openpyxl<4,>=3.1
|
|
29
|
+
Requires-Dist: opentelemetry-exporter-otlp-proto-http<2,>=1.20
|
|
30
|
+
Requires-Dist: opentelemetry-sdk<2,>=1.20
|
|
31
|
+
Requires-Dist: pydantic<3,>=2.0
|
|
32
|
+
Requires-Dist: pymupdf4llm<1,>=0.3
|
|
33
|
+
Requires-Dist: pymupdf<2,>=1.24
|
|
34
|
+
Requires-Dist: python-docx<2,>=1.1
|
|
35
|
+
Requires-Dist: python-dotenv<2,>=1.0
|
|
36
|
+
Requires-Dist: python-pptx<2,>=1.0
|
|
37
|
+
Requires-Dist: pyyaml<7,>=6.0
|
|
38
|
+
Requires-Dist: slack-bolt[async]<2,>=1.20
|
|
39
|
+
Requires-Dist: slack-sdk[socket-mode-handlers]<4,>=3.33
|
|
40
|
+
Provides-Extra: dev
|
|
41
|
+
Requires-Dist: pre-commit<5,>=4.0; extra == 'dev'
|
|
42
|
+
Requires-Dist: pytest-asyncio<1,>=0.24; extra == 'dev'
|
|
43
|
+
Requires-Dist: pytest<9,>=8.0; extra == 'dev'
|
|
44
|
+
Requires-Dist: ruff<1,>=0.8; extra == 'dev'
|
|
45
|
+
Description-Content-Type: text/markdown
|
|
46
|
+
|
|
47
|
+
# python-slack-agents
|
|
48
|
+
|
|
49
|
+
[](https://pypi.org/project/python-slack-agents/)
|
|
50
|
+
[](https://pypi.org/project/python-slack-agents/)
|
|
51
|
+
[](https://github.com/CompareNetworks/python-slack-agents/actions/workflows/ci.yml)
|
|
52
|
+
[](https://github.com/CompareNetworks/python-slack-agents/blob/main/LICENSE)
|
|
53
|
+
|
|
54
|
+
A simple Python framework for running AI agents in Slack. Each agent is a YAML config and a system prompt — pick your LLM, connect some [MCP](https://modelcontextprotocol.io/) tools, and `slack-agents run`. Everything you need is included: streaming responses, file handling, conversation persistence, and a plugin system when you need to extend things. Built on [Bolt for Python](https://github.com/slackapi/bolt-python).
|
|
55
|
+
|
|
56
|
+
<p align="center">
|
|
57
|
+
<img src="https://raw.githubusercontent.com/CompareNetworks/python-slack-agents/main/docs/media/demo.gif" alt="Agent streaming a response in Slack" width="800">
|
|
58
|
+
</p>
|
|
59
|
+
|
|
60
|
+
## What You Get
|
|
61
|
+
|
|
62
|
+
Each agent is a directory with two files: a `config.yaml` and a `system_prompt.txt`. Point it at your LLM, give it some tools, and run it.
|
|
63
|
+
|
|
64
|
+
**LLM providers** — Anthropic and OpenAI built in, plus any OpenAI-compatible API (Mistral, Groq, Together, Ollama, vLLM). Extend to any other provider by implementing a simple base class.
|
|
65
|
+
|
|
66
|
+
**Tool calling with MCP** — Connect any [MCP server](https://modelcontextprotocol.io/) over HTTP. Tools are discovered automatically, executed in parallel, and filtered with regex patterns. No tool registration boilerplate.
|
|
67
|
+
|
|
68
|
+
**File handling** — Agents can read files your users upload (PDF, DOCX, XLSX, PPTX, CSV, images) and generate documents back (PDF, DOCX, XLSX, CSV, PPTX). All built in, no extra setup.
|
|
69
|
+
|
|
70
|
+
**Streaming** — Responses stream token-by-token to Slack. Markdown tables are detected and rendered as native Slack tables, not code blocks.
|
|
71
|
+
|
|
72
|
+
**Conversation persistence** — SQLite for development, PostgreSQL for production. Conversations survive restarts, and you can export them to HTML or CSV.
|
|
73
|
+
|
|
74
|
+
**Access control** — Allow everyone, restrict to a list of Slack user IDs, or write a custom provider (LDAP, OAuth, whatever you need).
|
|
75
|
+
|
|
76
|
+
**Observability** — OpenTelemetry tracing out of the box. Send traces to Langfuse, Jaeger, Datadog, Grafana Tempo, or any OTLP-compatible backend.
|
|
77
|
+
|
|
78
|
+
**Docker** — Build per-agent Docker images with a single CLI command. Each agent is its own image with its own config.
|
|
79
|
+
|
|
80
|
+
**Plugin architecture** — LLM, storage, tools, and access control are all pluggable. Same pattern everywhere: a `type` field pointing to a Python module, and a simple `Provider` class in that module.
|
|
81
|
+
|
|
82
|
+
## Quick Start
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
pip install python-slack-agents
|
|
86
|
+
|
|
87
|
+
# Set up your environment
|
|
88
|
+
cp .env.example .env
|
|
89
|
+
|
|
90
|
+
# Edit .env with your Slack and LLM tokens
|
|
91
|
+
SLACK_BOT_TOKEN=xoxb-...
|
|
92
|
+
SLACK_APP_TOKEN=xapp-...
|
|
93
|
+
ANTHROPIC_API_KEY=sk-ant-...
|
|
94
|
+
|
|
95
|
+
# Run the hello-world agent
|
|
96
|
+
slack-agents run agents/hello-world
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
See [Setup](https://github.com/CompareNetworks/python-slack-agents/blob/main/docs/setup.md) for creating a Slack app and getting your tokens.
|
|
100
|
+
|
|
101
|
+
## How It Works
|
|
102
|
+
|
|
103
|
+
An agent is a directory with two files:
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
agents/my-agent/
|
|
107
|
+
├── config.yaml # LLM, tools, storage, access control
|
|
108
|
+
└── system_prompt.txt # what the agent should do
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
**config.yaml**
|
|
112
|
+
|
|
113
|
+
```yaml
|
|
114
|
+
version: "1.0.0" # shown in Slack usage footer, used as Docker image tag
|
|
115
|
+
schema: "slack-agents/v1"
|
|
116
|
+
|
|
117
|
+
slack:
|
|
118
|
+
bot_token: "{SLACK_BOT_TOKEN}"
|
|
119
|
+
app_token: "{SLACK_APP_TOKEN}"
|
|
120
|
+
|
|
121
|
+
llm:
|
|
122
|
+
type: slack_agents.llm.anthropic
|
|
123
|
+
model: claude-sonnet-4-6
|
|
124
|
+
api_key: "{ANTHROPIC_API_KEY}"
|
|
125
|
+
max_tokens: 4096
|
|
126
|
+
max_input_tokens: 200000
|
|
127
|
+
|
|
128
|
+
storage:
|
|
129
|
+
type: slack_agents.storage.sqlite
|
|
130
|
+
path: ":memory:"
|
|
131
|
+
|
|
132
|
+
access:
|
|
133
|
+
type: slack_agents.access.allow_all
|
|
134
|
+
|
|
135
|
+
tools:
|
|
136
|
+
# Connect any MCP server — tools are auto-discovered
|
|
137
|
+
web-search:
|
|
138
|
+
type: slack_agents.tools.mcp_http
|
|
139
|
+
url: "https://mcp.deepwiki.com/mcp"
|
|
140
|
+
allowed_functions: [".*"]
|
|
141
|
+
|
|
142
|
+
# Read uploaded files (PDF, DOCX, XLSX, PPTX, images, text)
|
|
143
|
+
import-files:
|
|
144
|
+
type: slack_agents.tools.file_importer
|
|
145
|
+
allowed_functions: [".*"]
|
|
146
|
+
|
|
147
|
+
# Generate and export documents (PDF, DOCX, XLSX, CSV, PPTX)
|
|
148
|
+
export-documents:
|
|
149
|
+
type: slack_agents.tools.file_exporter
|
|
150
|
+
allowed_functions: ["export_pdf", "export_docx"]
|
|
151
|
+
|
|
152
|
+
# Create, read, edit, and share Slack canvases
|
|
153
|
+
canvas:
|
|
154
|
+
type: slack_agents.tools.canvas
|
|
155
|
+
bot_token: "{SLACK_BOT_TOKEN}"
|
|
156
|
+
allowed_functions: [".*"]
|
|
157
|
+
|
|
158
|
+
# Remember user preferences across conversations in a user-editable slack canvas
|
|
159
|
+
user-context:
|
|
160
|
+
type: slack_agents.tools.user_context
|
|
161
|
+
bot_token: "{SLACK_BOT_TOKEN}"
|
|
162
|
+
max_tokens: 1000
|
|
163
|
+
allowed_functions: [".*"]
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
All secrets in `{ENV_VAR}` are resolved from environment variables at startup.
|
|
167
|
+
|
|
168
|
+
**system_prompt.txt** — plain text or markdown, as long or short as you need.
|
|
169
|
+
|
|
170
|
+
## CLI
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
slack-agents run agents/<name> # start an agent
|
|
174
|
+
slack-agents healthcheck agents/<name> # liveness probe (for k8s)
|
|
175
|
+
slack-agents export-conversations agents/<name> \ # export conversation history
|
|
176
|
+
--format html --output ./conversations
|
|
177
|
+
slack-agents export-usage agents/<name> \ # export usage metrics to CSV
|
|
178
|
+
--format csv --output ./usage.csv
|
|
179
|
+
slack-agents build-docker agents/<name> # build a Docker image
|
|
180
|
+
slack-agents build-docker agents/<name> \ # custom image name
|
|
181
|
+
--image-name my-bot
|
|
182
|
+
slack-agents build-docker agents/<name> \ # build and push to a registry
|
|
183
|
+
--push registry.example.com
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## Built-in Tools
|
|
187
|
+
|
|
188
|
+
### File Import
|
|
189
|
+
|
|
190
|
+
Users can upload files to the conversation. The agent automatically reads them:
|
|
191
|
+
|
|
192
|
+
| Format | What's extracted |
|
|
193
|
+
|--------|-----------------|
|
|
194
|
+
| PDF | Full text with layout preserved (via PyMuPDF) |
|
|
195
|
+
| DOCX | Text, headings, tables, lists |
|
|
196
|
+
| XLSX | Cell values across all sheets |
|
|
197
|
+
| PPTX | Slide text, speaker notes, tables |
|
|
198
|
+
| CSV, Markdown, plain text | Raw content |
|
|
199
|
+
| Images (PNG, JPEG, GIF, WebP) | Sent as vision input to the LLM |
|
|
200
|
+
|
|
201
|
+
### Document Export
|
|
202
|
+
|
|
203
|
+
The agent can generate and upload files to the conversation:
|
|
204
|
+
|
|
205
|
+
| Format | Capabilities |
|
|
206
|
+
|--------|-------------|
|
|
207
|
+
| PDF | Rich text, tables, headings, bullets, Unicode support |
|
|
208
|
+
| DOCX | Styled documents with tables and lists |
|
|
209
|
+
| XLSX | Multi-sheet spreadsheets |
|
|
210
|
+
| CSV | Tabular data export |
|
|
211
|
+
| PPTX | Slide decks with tables and speaker notes |
|
|
212
|
+
|
|
213
|
+
### Slack Canvases
|
|
214
|
+
|
|
215
|
+
[Canvases](https://slack.com/features/canvas) are collaborative documents embedded in Slack — think Google Docs, but native to your workspace. Multiple users and agents can read and write the same canvas, making them a shared surface for collaboration between people and AI. Agents can create, read, update, and manage canvases, which is useful for generating reports, maintaining living documents, or publishing structured content directly where your team works.
|
|
216
|
+
|
|
217
|
+
See [Canvas tool docs](https://github.com/CompareNetworks/python-slack-agents/blob/main/docs/canvas.md) for the full tool reference and setup.
|
|
218
|
+
|
|
219
|
+
### User Context (Optional Per-User Memory)
|
|
220
|
+
|
|
221
|
+
Each user can get a personal Slack canvas that stores their preferences and context across conversations. The agent loads it at the start of every conversation and offers to save important context when users share preferences or corrections. Users can also edit their canvas directly in Slack.
|
|
222
|
+
|
|
223
|
+
See [User context docs](https://github.com/CompareNetworks/python-slack-agents/blob/main/docs/user-context.md) for setup and configuration.
|
|
224
|
+
|
|
225
|
+
### MCP Servers
|
|
226
|
+
|
|
227
|
+
Connect any MCP server over HTTP. Tools are auto-discovered and can be filtered:
|
|
228
|
+
|
|
229
|
+
```yaml
|
|
230
|
+
tools:
|
|
231
|
+
my-mcp-server:
|
|
232
|
+
type: slack_agents.tools.mcp_http
|
|
233
|
+
url: "https://my-server.example.com/mcp"
|
|
234
|
+
headers:
|
|
235
|
+
Authorization: "Bearer {MCP_API_TOKEN}"
|
|
236
|
+
allowed_functions:
|
|
237
|
+
- "search_.*" # regex — only tools matching this pattern
|
|
238
|
+
- "get_document" # exact match works too
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
## Extending
|
|
242
|
+
|
|
243
|
+
Every pluggable component follows the same pattern. Add a new LLM provider, storage backend, tool, or access policy by creating a module with a `Provider` class:
|
|
244
|
+
|
|
245
|
+
```yaml
|
|
246
|
+
# In config.yaml
|
|
247
|
+
llm:
|
|
248
|
+
type: my_package.my_llm_provider
|
|
249
|
+
model: my-model
|
|
250
|
+
api_key: "{MY_API_KEY}"
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
```python
|
|
254
|
+
# In my_package/my_llm_provider.py
|
|
255
|
+
from slack_agents.llm.base import BaseLLMProvider
|
|
256
|
+
|
|
257
|
+
class Provider(BaseLLMProvider):
|
|
258
|
+
def __init__(self, model, api_key, **kwargs):
|
|
259
|
+
...
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
See the docs for the full interface for each component:
|
|
263
|
+
|
|
264
|
+
- [LLM providers](https://github.com/CompareNetworks/python-slack-agents/blob/main/docs/llm.md)
|
|
265
|
+
- [Storage backends](https://github.com/CompareNetworks/python-slack-agents/blob/main/docs/storage.md)
|
|
266
|
+
- [Tool providers](https://github.com/CompareNetworks/python-slack-agents/blob/main/docs/tools.md)
|
|
267
|
+
- [Access control](https://github.com/CompareNetworks/python-slack-agents/blob/main/docs/access-control.md)
|
|
268
|
+
|
|
269
|
+
## Slack Compatibility
|
|
270
|
+
|
|
271
|
+
python-slack-agents uses **Socket Mode**, which connects to Slack over WebSocket. This means:
|
|
272
|
+
|
|
273
|
+
- **No public URL required** — works behind firewalls, on your laptop, in a private cluster (eg, k8s)
|
|
274
|
+
- **All Slack plans supported** — free, Pro, Business+, and Enterprise Grid
|
|
275
|
+
- **One process per agent** — Socket Mode requires a single WebSocket connection per app
|
|
276
|
+
|
|
277
|
+
Agents respond to @mentions in channels, direct messages, and thread replies. File uploads are automatically processed by file importer tools.
|
|
278
|
+
|
|
279
|
+
To create a Slack app, use the manifest in [`docs/slack-app-manifest.json`](https://github.com/CompareNetworks/python-slack-agents/blob/main/docs/slack-app-manifest.json) — it has all the required scopes and event subscriptions pre-configured.
|
|
280
|
+
|
|
281
|
+
## Requirements
|
|
282
|
+
|
|
283
|
+
- Python 3.12+
|
|
284
|
+
- A Slack app with Socket Mode enabled ([setup guide](https://github.com/CompareNetworks/python-slack-agents/blob/main/docs/setup.md))
|
|
285
|
+
- An API key for at least one LLM provider
|
|
286
|
+
|
|
287
|
+
## Documentation
|
|
288
|
+
|
|
289
|
+
- [Setup](https://github.com/CompareNetworks/python-slack-agents/blob/main/docs/setup.md) — installation and Slack app creation
|
|
290
|
+
- [Agents](https://github.com/CompareNetworks/python-slack-agents/blob/main/docs/agents.md) — creating and configuring agents
|
|
291
|
+
- [Tools](https://github.com/CompareNetworks/python-slack-agents/blob/main/docs/tools.md) — MCP servers and custom tool providers
|
|
292
|
+
- [LLM](https://github.com/CompareNetworks/python-slack-agents/blob/main/docs/llm.md) — supported providers and adding your own
|
|
293
|
+
- [Storage](https://github.com/CompareNetworks/python-slack-agents/blob/main/docs/storage.md) — SQLite, PostgreSQL, and custom backends
|
|
294
|
+
- [Access control](https://github.com/CompareNetworks/python-slack-agents/blob/main/docs/access-control.md) — controlling who can use an agent
|
|
295
|
+
- [Canvases](https://github.com/CompareNetworks/python-slack-agents/blob/main/docs/canvas.md) — creating and managing Slack canvases
|
|
296
|
+
- [User context](https://github.com/CompareNetworks/python-slack-agents/blob/main/docs/user-context.md) — per-user memory across conversations
|
|
297
|
+
- [Observability](https://github.com/CompareNetworks/python-slack-agents/blob/main/docs/observability.md) — OpenTelemetry tracing
|
|
298
|
+
- [Deployment](https://github.com/CompareNetworks/python-slack-agents/blob/main/docs/deployment.md) — Docker, docker-compose, and Kubernetes
|
|
299
|
+
- [CLI](https://github.com/CompareNetworks/python-slack-agents/blob/main/docs/cli.md) — command reference
|
|
300
|
+
- [Organizing agents](https://github.com/CompareNetworks/python-slack-agents/blob/main/docs/private-repo.md) — in-repo, separate directory, or private repository
|
|
301
|
+
|
|
302
|
+
## Related Projects
|
|
303
|
+
|
|
304
|
+
If this framework isn't the right fit, here are some good alternatives:
|
|
305
|
+
|
|
306
|
+
- **[Bolt for Python](https://github.com/slackapi/bolt-python)** — The official Slack SDK. python-slack-agents uses it internally. Use Bolt directly if you want full control over Slack interactions without an agent abstraction.
|
|
307
|
+
- **[Slack Machine](https://github.com/DonDebonair/slack-machine)** — A mature Slack bot framework with a great plugin system for traditional chatops. No AI/LLM layer, but solid if you don't need agents.
|
|
308
|
+
- **[bolt-python-ai-chatbot](https://github.com/slack-samples/bolt-python-ai-chatbot)** — Official Slack sample app for AI chatbots. Good starting point if you want to build from scratch rather than use a framework.
|
|
309
|
+
- **[OpenAI Agents SDK](https://github.com/openai/openai-agents-python)**, **[Pydantic AI](https://github.com/pydantic/pydantic-ai)**, **[MCP Agent](https://github.com/lastmile-ai/mcp-agent)** — Powerful general-purpose agent frameworks. None include Slack integration, but if you already use one and want to wire it up to Slack yourself, they're excellent.
|
|
310
|
+
- **[slack-mcp-client](https://github.com/tuannvm/slack-mcp-client)** — A Go application bridging Slack and MCP servers. Deployed app rather than a library, but well-built if you prefer Go.
|
|
311
|
+
|
|
312
|
+
## Disclaimer
|
|
313
|
+
|
|
314
|
+
This is an independent open-source project and is not affiliated with, endorsed by, or sponsored by Slack Technologies, LLC or Salesforce, Inc.
|
|
315
|
+
|
|
316
|
+
## License
|
|
317
|
+
|
|
318
|
+
Apache 2.0 — see [LICENSE](https://github.com/CompareNetworks/python-slack-agents/blob/main/LICENSE).
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
slack_agents/Dockerfile,sha256=Ddkb5ue567ZgRj0rV5DMmhbgH9yVJYUTu-NOck9hc2o,695
|
|
2
|
+
slack_agents/__init__.py,sha256=Wq_hcYJ0JcjbckUcQQ-5sksuiNA0jEZsVypF55KJvtc,565
|
|
3
|
+
slack_agents/agent_loop.py,sha256=Mf8AptURiL6vip1p8wwoJG58CB-BzznLvEKWcpSJbr4,7659
|
|
4
|
+
slack_agents/config.py,sha256=bjhgP6n3o72q12_UJVKlov-x1RUAb41l4CT7ap0U-bU,3246
|
|
5
|
+
slack_agents/conversations.py,sha256=AgaxtuJ8QqLZ81Xr1wFvcLHKwAkxseL3Rkl7YHmpKcY,9635
|
|
6
|
+
slack_agents/files.py,sha256=D1VxTmo20TyajbpJq_kyzhFQjQV2xcsGXqM7p8IuCnI,2286
|
|
7
|
+
slack_agents/main.py,sha256=7KZFyW4M6-IVjSOPCyXPf5_3Rqz1G6ujZC_9Twc3j74,1705
|
|
8
|
+
slack_agents/observability.py,sha256=iooJhrleCKMdVkUZe6lhkgYu0vMmQw4QW9tpanDG-cw,5669
|
|
9
|
+
slack_agents/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
|
+
slack_agents/access/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
|
+
slack_agents/access/allow_all.py,sha256=UxZqtheWKXKwpMVe1Y3q66JcnN_H4rcK6FijysKTO8A,323
|
|
12
|
+
slack_agents/access/allow_list.py,sha256=iq3EXQCbMOfwhU2276AA1w9VQ41lmDKSR-h9BmaHzX4,652
|
|
13
|
+
slack_agents/access/base.py,sha256=SjlsyhkaEbeBcUlXaRV1obxBcHHyoLacnV47COaaZXU,485
|
|
14
|
+
slack_agents/cli/__init__.py,sha256=IxIgAzF4n70zWbc_7ssKJHT-iOpaNeg-L7MocR0IWUc,1220
|
|
15
|
+
slack_agents/cli/build_docker.py,sha256=9gNfzjGA3x4TR58C-l68cFLDDxajtOb5BvXOPrjdkVs,2721
|
|
16
|
+
slack_agents/cli/export_conversations.py,sha256=UJOzk-bP1MNYgQfCV9FNHOz6srfNExBLlKHdTppUalc,2938
|
|
17
|
+
slack_agents/cli/export_conversations_html.py,sha256=Hl2o6v5uHmPpKnv6p4UKLRIzk4WuRmJNBQ1WiFdBprc,22539
|
|
18
|
+
slack_agents/cli/export_usage.py,sha256=22tKtejXJAjH0hmyb8gpuVemvG15oCCXT-XfsuqYxB0,2769
|
|
19
|
+
slack_agents/cli/export_usage_csv.py,sha256=ebvZm4L5e3oPg-7t1suZrn5xmzMyI7b5hLEzJJQ_lZs,4916
|
|
20
|
+
slack_agents/cli/healthcheck.py,sha256=s8a3X6f6vAt4-jZ2dAD9sEuHvK1jHcA7zL5P7T-GSOQ,2026
|
|
21
|
+
slack_agents/cli/run.py,sha256=1u9SiYdO-ZC8Ua1sU1JQ0NTUsjgB9dGm0AtxL3DVvkU,404
|
|
22
|
+
slack_agents/llm/__init__.py,sha256=RigotlJw9KuiknE2e2gBSjslCyvDuOfDTllxq8ne_AU,20
|
|
23
|
+
slack_agents/llm/anthropic.py,sha256=fIf0lMyP2f1P8DmYmsOGvk3wQI4d3ORc_z0PO_AgloE,7858
|
|
24
|
+
slack_agents/llm/base.py,sha256=03DbzdTYALh2eU7fXR5dcwl2Gb9Dwv4NiGaIX0tz4Ro,2250
|
|
25
|
+
slack_agents/llm/openai.py,sha256=uG5OWx5hocWzNmWEU5Q-Ie_QmwsKG-nYOZnKr5nEjBc,10097
|
|
26
|
+
slack_agents/scripts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
27
|
+
slack_agents/scripts/download_fonts.py,sha256=PrmRJMYGPHDTCIfOVywkmn3FY30YDfpMxw-ZqNcqDAw,1128
|
|
28
|
+
slack_agents/slack/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
29
|
+
slack_agents/slack/actions.py,sha256=IW2nFjDkxSU7a6ITyZMQpz3WcSBPdin2J7v3Qo_l__E,4026
|
|
30
|
+
slack_agents/slack/agent.py,sha256=BQ7_2GH16Od5Oyeb-pU2CrquD06ZIy40X85otQSyGDY,29646
|
|
31
|
+
slack_agents/slack/canvases.py,sha256=6MnopiSTrQks1IKOGKtacwG4qnNwjMGA22Uq7-VUGc8,6601
|
|
32
|
+
slack_agents/slack/files.py,sha256=3mefV9oLIv8ju4LL-XnXfSyD5fKSZroFM3DEI5jvyX8,3055
|
|
33
|
+
slack_agents/slack/format.py,sha256=3_XCvdZxN2tCAch8CIjiUnDeRfbekBz9uMFYymZVVYE,1836
|
|
34
|
+
slack_agents/slack/streaming.py,sha256=DRiHWRnp0in6_L1XyYuvVaaOyZeHDYDjuBr7REabsUU,2088
|
|
35
|
+
slack_agents/slack/streaming_formatter.py,sha256=yj0QJr1RyFGj0Ncg37Q6WMCIbg72OcqYOd-uuxss99M,6327
|
|
36
|
+
slack_agents/slack/tool_blocks.py,sha256=uSXFjN5V8mxCIxOFDtZeH0UgSgFxEogrErKDKtEUOEo,2792
|
|
37
|
+
slack_agents/storage/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
38
|
+
slack_agents/storage/base.py,sha256=7D2LKsG41jBMmHYAYf3-gyLreIWGIFbiIG0QKn5fpjI,11044
|
|
39
|
+
slack_agents/storage/postgres.py,sha256=cHyRzkrzWsRU0trtni2Oa0BDf-GRLIdPR_UxSlZwpls,23573
|
|
40
|
+
slack_agents/storage/postgres.sql,sha256=WIkGzRxDwqiQAzhE7-O9K_CWXDDI6wClqtwisZIEoEQ,4630
|
|
41
|
+
slack_agents/storage/sqlite.py,sha256=d_RY3ZG4akT7ofTO2UzLruaQnzcod7iBqT06F6Md_9E,16700
|
|
42
|
+
slack_agents/storage/sqlite.sql,sha256=KTLnEjIfU2VYmEngUSAL2vpWQDefNvnkxViNaWsDWrs,2285
|
|
43
|
+
slack_agents/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
44
|
+
slack_agents/tools/base.py,sha256=_Hj4OTwAfHc1ms6a_E88eY-VvkkqHSl8ppTfM0Gka_A,3726
|
|
45
|
+
slack_agents/tools/canvas.py,sha256=ki-6FkccSQEkrdhK_5YbpL9g42amVlBFMMHJGrmEkZU,13965
|
|
46
|
+
slack_agents/tools/file_exporter.py,sha256=fWr2911OS2EcympxqzLiGxnto5_5WXGH_k8gizeDQfw,19807
|
|
47
|
+
slack_agents/tools/file_importer.py,sha256=oeT7xYMDLMf1D07btyLtueBDNHiTu-vRq_XqJZQ2nHU,11584
|
|
48
|
+
slack_agents/tools/mcp_http.py,sha256=vJprcYYlUzc60pVgSyJbbMTRSIMbUhx5j5qYf1ipzpg,7426
|
|
49
|
+
slack_agents/tools/user_context.py,sha256=rs8ZdVIXc_ZB2cwkcGDy-3erHatVP01AMxj-C5_QCPc,8813
|
|
50
|
+
python_slack_agents-0.5.0.dist-info/METADATA,sha256=9p_OhgQZsS2b4FXcGBdoYROLWXrjrdrOE6Ws1i5lqQI,15274
|
|
51
|
+
python_slack_agents-0.5.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
|
|
52
|
+
python_slack_agents-0.5.0.dist-info/entry_points.txt,sha256=MBw51h0tWOrI925q0tqlYVc5w0D87t3E6FzJhkC0w8g,55
|
|
53
|
+
python_slack_agents-0.5.0.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
|
54
|
+
python_slack_agents-0.5.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
slack_agents/Dockerfile
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
FROM python:3.12-slim
|
|
2
|
+
|
|
3
|
+
RUN apt-get update && \
|
|
4
|
+
apt-get install -y --no-install-recommends libmupdf-dev && \
|
|
5
|
+
rm -rf /var/lib/apt/lists/*
|
|
6
|
+
|
|
7
|
+
WORKDIR /app
|
|
8
|
+
|
|
9
|
+
# Install Python deps first for layer caching
|
|
10
|
+
COPY pyproject.toml README.md ./
|
|
11
|
+
RUN pip install --no-cache-dir $(python -c "import tomllib; f=open('pyproject.toml','rb'); deps=tomllib.load(f)['project']['dependencies']; print(' '.join(deps))")
|
|
12
|
+
|
|
13
|
+
COPY src/ src/
|
|
14
|
+
RUN pip install --no-cache-dir .
|
|
15
|
+
|
|
16
|
+
# Download DejaVu fonts for PDF export with Unicode support
|
|
17
|
+
RUN python -m slack_agents.scripts.download_fonts
|
|
18
|
+
|
|
19
|
+
ARG AGENT_PATH
|
|
20
|
+
COPY ${AGENT_PATH}/ /app/agent/
|
|
21
|
+
|
|
22
|
+
RUN useradd -r -s /bin/false agent
|
|
23
|
+
USER agent
|
|
24
|
+
|
|
25
|
+
CMD ["slack-agents", "run", "agent"]
|
slack_agents/__init__.py
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"""slack-agents: A Python framework for deploying AI agents as Slack bots."""
|
|
2
|
+
|
|
3
|
+
from importlib.metadata import version
|
|
4
|
+
from typing import TypedDict
|
|
5
|
+
|
|
6
|
+
__version__ = version("python-slack-agents")
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class UserConversationContext(TypedDict):
|
|
10
|
+
"""Identity and location of the user making a request."""
|
|
11
|
+
|
|
12
|
+
user_id: str
|
|
13
|
+
user_name: str
|
|
14
|
+
user_handle: str
|
|
15
|
+
channel_id: str
|
|
16
|
+
channel_name: str
|
|
17
|
+
thread_id: str
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class InputFile(TypedDict):
|
|
21
|
+
"""Structured file input for file import handlers."""
|
|
22
|
+
|
|
23
|
+
file_bytes: bytes
|
|
24
|
+
mimetype: str
|
|
25
|
+
filename: str
|
|
File without changes
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"""Access provider that allows all users."""
|
|
2
|
+
|
|
3
|
+
from slack_agents import UserConversationContext
|
|
4
|
+
from slack_agents.access.base import AccessGranted, BaseAccessProvider
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Provider(BaseAccessProvider):
|
|
8
|
+
async def check_access(self, *, context: UserConversationContext) -> AccessGranted:
|
|
9
|
+
return AccessGranted()
|