python-slack-agents 0.6.0__tar.gz → 0.6.1__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.
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/AGENTS.md +7 -5
- python_slack_agents-0.6.1/CHANGELOG.md +60 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/PKG-INFO +7 -8
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/README.md +6 -7
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/docs/private-repo.md +3 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/docs/setup.md +25 -8
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/llms-full.txt +47 -15
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/pyproject.toml +1 -1
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/cli/build_docker.py +22 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/cli/init.py +40 -6
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/config.py +6 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/uv.lock +1 -1
- python_slack_agents-0.6.0/CHANGELOG.md +0 -22
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/.dockerignore +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/.env.example +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/.github/workflows/ci.yml +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/.github/workflows/publish.yml +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/.gitignore +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/.pre-commit-config.yaml +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/CODE_OF_CONDUCT.md +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/CONTRIBUTING.md +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/LICENSE +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/SECURITY.md +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/agents/README.md +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/agents/docs-assistant/config.yaml +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/agents/docs-assistant/system_prompt.txt +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/agents/hello-world/config.yaml +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/agents/hello-world/system_prompt.txt +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/agents/kitchen-sink/config.yaml +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/agents/kitchen-sink/system_prompt.txt +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/docs/access-control.md +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/docs/agents.md +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/docs/canvas.md +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/docs/cli.md +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/docs/deployment.md +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/docs/llm.md +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/docs/media/demo.gif +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/docs/observability.md +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/docs/slack-app-manifest.json +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/docs/storage.md +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/docs/tools.md +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/docs/user-context.md +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/llms.txt +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/Dockerfile +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/__init__.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/access/__init__.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/access/allow_all.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/access/allow_list.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/access/base.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/agent_loop.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/cli/__init__.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/cli/export_conversations.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/cli/export_conversations_html.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/cli/export_usage.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/cli/export_usage_csv.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/cli/healthcheck.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/cli/run.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/conversations.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/files.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/llm/__init__.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/llm/anthropic.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/llm/base.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/llm/openai.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/main.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/observability.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/py.typed +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/scripts/__init__.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/scripts/download_fonts.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/scripts/generate_llms_full.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/slack/__init__.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/slack/actions.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/slack/agent.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/slack/canvases.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/slack/files.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/slack/format.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/slack/streaming.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/slack/streaming_formatter.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/slack/tool_blocks.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/storage/__init__.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/storage/base.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/storage/postgres.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/storage/postgres.sql +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/storage/sqlite.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/storage/sqlite.sql +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/tools/__init__.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/tools/base.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/tools/canvas.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/tools/file_exporter.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/tools/file_importer.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/tools/mcp_http.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/tools/user_context.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/tests/__init__.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/tests/test_access.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/tests/test_agent_loop.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/tests/test_cli.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/tests/test_config.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/tests/test_conversations.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/tests/test_cost.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/tests/test_export_documents.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/tests/test_export_usage.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/tests/test_file_extractors.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/tests/test_format.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/tests/test_llm_factory.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/tests/test_mcp_client.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/tests/test_openai_convert.py +0 -0
- {python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/tests/test_tool_blocks.py +0 -0
|
@@ -103,12 +103,13 @@ The project includes AI-agent-friendly documentation following the llms.txt conv
|
|
|
103
103
|
## Releasing
|
|
104
104
|
|
|
105
105
|
1. Update `version` in `pyproject.toml`
|
|
106
|
-
2. Update the
|
|
107
|
-
3.
|
|
108
|
-
|
|
109
|
-
|
|
106
|
+
2. Update `CHANGELOG.md` with the new version and changes
|
|
107
|
+
3. Run `python3 src/slack_agents/scripts/generate_llms_full.py` to regenerate `llms-full.txt`
|
|
108
|
+
4. Commit and push to `main`
|
|
109
|
+
5. Create a GitHub Release (which creates a git tag)
|
|
110
|
+
6. The `publish.yml` workflow automatically builds and publishes to PyPI via trusted publishing
|
|
110
111
|
|
|
111
|
-
Do NOT publish to PyPI manually — the GitHub Release trigger handles it.
|
|
112
|
+
The PyPI deployment requires manual approval in the GitHub Actions UI. Do NOT publish to PyPI manually — the GitHub Release trigger handles it.
|
|
112
113
|
|
|
113
114
|
## Style
|
|
114
115
|
|
|
@@ -116,3 +117,4 @@ Do NOT publish to PyPI manually — the GitHub Release trigger handles it.
|
|
|
116
117
|
- Ruff rules: E, F, I (errors, pyflakes, isort)
|
|
117
118
|
- Keep it simple. Minimal abstractions, no unnecessary indirection.
|
|
118
119
|
- Commit messages: Conventional Commits — `feat:`, `fix:`, `docs:`, `chore:`, `test:`, `refactor:`. Lowercase, imperative, under 72 chars.
|
|
120
|
+
- **Always propose the commit message and wait for explicit user approval before committing or pushing.** Never commit or push autonomously.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/), and this project adheres to [Semantic Versioning](https://semver.org/).
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
## [0.6.1] - 2026-03-19
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- `slack-agents init` now generates `.gitignore`
|
|
14
|
+
- `.env.example` template includes comments explaining where to get each token and links to setup guide
|
|
15
|
+
- `build-docker` lists required environment variables after build completes
|
|
16
|
+
- `build-docker` errors if `req*.txt` files are found (dependencies must be in `pyproject.toml`)
|
|
17
|
+
- `init` warns when `req*.txt` files are found with migration instructions
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- `pyproject.toml` template uses `python-slack-agents<2` (no minimum pin)
|
|
22
|
+
- Setup flow uses venv-first approach: create venv, install package, then `slack-agents init`
|
|
23
|
+
- Updated README, docs/setup.md, and docs/private-repo.md with new setup flow
|
|
24
|
+
|
|
25
|
+
### Fixed
|
|
26
|
+
|
|
27
|
+
- Config loader now strips YAML comments before env var interpolation — commented-out `{ENV_VAR}` patterns no longer cause `KeyError`
|
|
28
|
+
- `init` shows proposed file content when skipping existing files
|
|
29
|
+
|
|
30
|
+
## [0.6.0] - 2026-03-18
|
|
31
|
+
|
|
32
|
+
### Added
|
|
33
|
+
|
|
34
|
+
- `slack-agents init <project_name>` CLI command to scaffold new projects
|
|
35
|
+
- `llms.txt` and `llms-full.txt` for AI agent discoverability
|
|
36
|
+
- `llms-full.txt` bundled in PyPI wheel
|
|
37
|
+
- Script to generate `llms-full.txt` from docs (`src/slack_agents/scripts/generate_llms_full.py`)
|
|
38
|
+
- "Project Structure" section in README
|
|
39
|
+
- Release process documentation in AGENTS.md
|
|
40
|
+
|
|
41
|
+
### Changed
|
|
42
|
+
|
|
43
|
+
- Simplified Dockerfile: empty placeholders for README.md and llms-full.txt so builds work for both framework and user projects
|
|
44
|
+
- Updated docs/private-repo.md to use `slack-agents init`
|
|
45
|
+
- Updated docs/cli.md with `init` command reference
|
|
46
|
+
|
|
47
|
+
## [0.5.0] - 2025-03-13
|
|
48
|
+
|
|
49
|
+
### Added
|
|
50
|
+
|
|
51
|
+
- Plugin architecture for LLM providers, storage backends, and tools
|
|
52
|
+
- Anthropic and OpenAI LLM providers
|
|
53
|
+
- SQLite and PostgreSQL storage providers
|
|
54
|
+
- MCP over HTTP tool provider
|
|
55
|
+
- Built-in document export tools (PDF, DOCX, XLSX, CSV, PPTX)
|
|
56
|
+
- Streaming output with native Slack table rendering
|
|
57
|
+
- Socket Mode support (no public URL required)
|
|
58
|
+
- OpenTelemetry observability
|
|
59
|
+
- `{ENV_VAR}` interpolation in agent configs
|
|
60
|
+
- Per-agent Docker builds via `docker-build-and-push.sh`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-slack-agents
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.1
|
|
4
4
|
Summary: A Python framework for deploying AI agents as Slack bots
|
|
5
5
|
Project-URL: Homepage, https://github.com/CompareNetworks/python-slack-agents
|
|
6
6
|
Project-URL: Repository, https://github.com/CompareNetworks/python-slack-agents
|
|
@@ -82,17 +82,16 @@ Each agent is a directory with two files: a `config.yaml` and a `system_prompt.t
|
|
|
82
82
|
## Quick Start
|
|
83
83
|
|
|
84
84
|
```bash
|
|
85
|
+
mkdir my-agents && cd my-agents
|
|
86
|
+
python3 -m venv .venv
|
|
87
|
+
source .venv/bin/activate
|
|
85
88
|
pip install python-slack-agents
|
|
86
89
|
|
|
87
|
-
# Scaffold
|
|
88
|
-
mkdir my-agents && cd my-agents
|
|
90
|
+
# Scaffold the project
|
|
89
91
|
slack-agents init my-agents
|
|
90
92
|
|
|
91
|
-
# Add your tokens
|
|
92
|
-
cp .env.example .env
|
|
93
|
-
# Edit .env: SLACK_BOT_TOKEN, SLACK_APP_TOKEN, ANTHROPIC_API_KEY
|
|
94
|
-
|
|
95
|
-
# Install for development (makes custom providers importable)
|
|
93
|
+
# Add your tokens and install for development
|
|
94
|
+
cp .env.example .env # add your Slack and LLM tokens
|
|
96
95
|
pip install -e .
|
|
97
96
|
|
|
98
97
|
# Run the hello-world agent
|
|
@@ -36,17 +36,16 @@ Each agent is a directory with two files: a `config.yaml` and a `system_prompt.t
|
|
|
36
36
|
## Quick Start
|
|
37
37
|
|
|
38
38
|
```bash
|
|
39
|
+
mkdir my-agents && cd my-agents
|
|
40
|
+
python3 -m venv .venv
|
|
41
|
+
source .venv/bin/activate
|
|
39
42
|
pip install python-slack-agents
|
|
40
43
|
|
|
41
|
-
# Scaffold
|
|
42
|
-
mkdir my-agents && cd my-agents
|
|
44
|
+
# Scaffold the project
|
|
43
45
|
slack-agents init my-agents
|
|
44
46
|
|
|
45
|
-
# Add your tokens
|
|
46
|
-
cp .env.example .env
|
|
47
|
-
# Edit .env: SLACK_BOT_TOKEN, SLACK_APP_TOKEN, ANTHROPIC_API_KEY
|
|
48
|
-
|
|
49
|
-
# Install for development (makes custom providers importable)
|
|
47
|
+
# Add your tokens and install for development
|
|
48
|
+
cp .env.example .env # add your Slack and LLM tokens
|
|
50
49
|
pip install -e .
|
|
51
50
|
|
|
52
51
|
# Run the hello-world agent
|
|
@@ -16,6 +16,9 @@ For production agents with company-specific prompts, tools, and configs, create
|
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
18
|
mkdir my-agents && cd my-agents
|
|
19
|
+
python3 -m venv .venv
|
|
20
|
+
source .venv/bin/activate
|
|
21
|
+
pip install python-slack-agents
|
|
19
22
|
slack-agents init my-agents
|
|
20
23
|
pip install -e .
|
|
21
24
|
```
|
|
@@ -6,9 +6,32 @@
|
|
|
6
6
|
- A Slack workspace (all plans supported, including free)
|
|
7
7
|
- API key for your LLM provider (Anthropic and/or OpenAI)
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## New Project
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
+
mkdir my-agents && cd my-agents
|
|
13
|
+
python3 -m venv .venv
|
|
14
|
+
source .venv/bin/activate
|
|
15
|
+
pip install python-slack-agents
|
|
16
|
+
|
|
17
|
+
# Scaffold the project
|
|
18
|
+
slack-agents init my-agents
|
|
19
|
+
|
|
20
|
+
# Add your tokens and install for development
|
|
21
|
+
cp .env.example .env # add your Slack and LLM tokens (see below)
|
|
22
|
+
pip install -e .
|
|
23
|
+
|
|
24
|
+
# Run the hello-world agent
|
|
25
|
+
slack-agents run agents/hello-world
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Framework Development
|
|
29
|
+
|
|
30
|
+
If you're working on the framework itself:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
git clone https://github.com/CompareNetworks/python-slack-agents.git
|
|
34
|
+
cd python-slack-agents
|
|
12
35
|
python3 -m venv .venv
|
|
13
36
|
source .venv/bin/activate
|
|
14
37
|
pip install -e ".[dev]"
|
|
@@ -40,7 +63,7 @@ ANTHROPIC_API_KEY=sk-ant-...
|
|
|
40
63
|
- Copy: App Token (eg, SLACK_APP_TOKEN=xapp-...)
|
|
41
64
|
- Settings > Install App
|
|
42
65
|
- Copy: Bot User OAuth Token (eg, SLACK_BOT_TOKEN=xoxb-...)
|
|
43
|
-
3. If App does not
|
|
66
|
+
3. If App does not appear in your Slack client:
|
|
44
67
|
- ... > Tools > Apps > (search by name and add the app)
|
|
45
68
|
|
|
46
69
|
## Download Fonts
|
|
@@ -53,12 +76,6 @@ python -m slack_agents.scripts.download_fonts
|
|
|
53
76
|
|
|
54
77
|
This downloads `DejaVuSans.ttf` and `DejaVuSans-Bold.ttf` into `fonts/` (~700KB total). Without these fonts, PDF generation falls back to Helvetica (latin-1 only).
|
|
55
78
|
|
|
56
|
-
## Running an Agent
|
|
57
|
-
|
|
58
|
-
```bash
|
|
59
|
-
slack-agents run agents/hello-world
|
|
60
|
-
```
|
|
61
|
-
|
|
62
79
|
## Optional: PostgreSQL
|
|
63
80
|
|
|
64
81
|
For conversation persistence via PostgreSQL, update your agent's `config.yaml`:
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# python-slack-agents: Complete Reference
|
|
2
2
|
|
|
3
3
|
> A Python framework for deploying AI agents as Slack bots.
|
|
4
|
-
> Each agent is a YAML config and a system prompt — pick your LLM,
|
|
4
|
+
> Each agent is a YAML config and a system prompt — pick your LLM,
|
|
5
|
+
> connect some MCP tools, and `slack-agents run`.
|
|
5
6
|
|
|
6
7
|
- **Package:** `pip install python-slack-agents`
|
|
7
8
|
- **CLI entry point:** `slack-agents`
|
|
@@ -11,15 +12,26 @@
|
|
|
11
12
|
|
|
12
13
|
## How to read this document
|
|
13
14
|
|
|
14
|
-
This file is a concatenation of all documentation files,
|
|
15
|
-
|
|
15
|
+
This file is a concatenation of all documentation files,
|
|
16
|
+
designed to be consumed in a single read.
|
|
17
|
+
The sections below correspond to individual doc files
|
|
18
|
+
in the `docs/` directory.
|
|
16
19
|
|
|
17
20
|
### Key concepts
|
|
18
21
|
|
|
19
|
-
- **Config-driven:** each agent is a directory with
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
- **
|
|
22
|
+
- **Config-driven:** each agent is a directory with
|
|
23
|
+
`config.yaml` + `system_prompt.txt`.
|
|
24
|
+
All behavior is configured in YAML.
|
|
25
|
+
- **Plugin pattern:** every pluggable component (LLM, storage,
|
|
26
|
+
tools, access) uses a `type` field with a dotted Python import
|
|
27
|
+
path pointing to a module with a `Provider` class. All other
|
|
28
|
+
config keys are passed as kwargs to `Provider.__init__`.
|
|
29
|
+
- **Two kinds of tool providers:** `BaseToolProvider` (tools the
|
|
30
|
+
LLM calls) and `BaseFileImporterProvider` (file handlers the
|
|
31
|
+
*framework* calls automatically — invisible to the LLM). Both
|
|
32
|
+
are configured under `tools:` in config.yaml.
|
|
33
|
+
- **Environment variables:** `{ENV_VAR}` patterns in config values
|
|
34
|
+
are resolved from environment variables at startup.
|
|
23
35
|
|
|
24
36
|
---
|
|
25
37
|
|
|
@@ -31,9 +43,32 @@ The sections below correspond to individual doc files in the `docs/` directory.
|
|
|
31
43
|
- A Slack workspace (all plans supported, including free)
|
|
32
44
|
- API key for your LLM provider (Anthropic and/or OpenAI)
|
|
33
45
|
|
|
34
|
-
##
|
|
46
|
+
## New Project
|
|
35
47
|
|
|
36
48
|
```bash
|
|
49
|
+
mkdir my-agents && cd my-agents
|
|
50
|
+
python3 -m venv .venv
|
|
51
|
+
source .venv/bin/activate
|
|
52
|
+
pip install python-slack-agents
|
|
53
|
+
|
|
54
|
+
# Scaffold the project
|
|
55
|
+
slack-agents init my-agents
|
|
56
|
+
|
|
57
|
+
# Add your tokens and install for development
|
|
58
|
+
cp .env.example .env # add your Slack and LLM tokens (see below)
|
|
59
|
+
pip install -e .
|
|
60
|
+
|
|
61
|
+
# Run the hello-world agent
|
|
62
|
+
slack-agents run agents/hello-world
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Framework Development
|
|
66
|
+
|
|
67
|
+
If you're working on the framework itself:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
git clone https://github.com/CompareNetworks/python-slack-agents.git
|
|
71
|
+
cd python-slack-agents
|
|
37
72
|
python3 -m venv .venv
|
|
38
73
|
source .venv/bin/activate
|
|
39
74
|
pip install -e ".[dev]"
|
|
@@ -65,7 +100,7 @@ ANTHROPIC_API_KEY=sk-ant-...
|
|
|
65
100
|
- Copy: App Token (eg, SLACK_APP_TOKEN=xapp-...)
|
|
66
101
|
- Settings > Install App
|
|
67
102
|
- Copy: Bot User OAuth Token (eg, SLACK_BOT_TOKEN=xoxb-...)
|
|
68
|
-
3. If App does not
|
|
103
|
+
3. If App does not appear in your Slack client:
|
|
69
104
|
- ... > Tools > Apps > (search by name and add the app)
|
|
70
105
|
|
|
71
106
|
## Download Fonts
|
|
@@ -78,12 +113,6 @@ python -m slack_agents.scripts.download_fonts
|
|
|
78
113
|
|
|
79
114
|
This downloads `DejaVuSans.ttf` and `DejaVuSans-Bold.ttf` into `fonts/` (~700KB total). Without these fonts, PDF generation falls back to Helvetica (latin-1 only).
|
|
80
115
|
|
|
81
|
-
## Running an Agent
|
|
82
|
-
|
|
83
|
-
```bash
|
|
84
|
-
slack-agents run agents/hello-world
|
|
85
|
-
```
|
|
86
|
-
|
|
87
116
|
## Optional: PostgreSQL
|
|
88
117
|
|
|
89
118
|
For conversation persistence via PostgreSQL, update your agent's `config.yaml`:
|
|
@@ -1101,6 +1130,9 @@ For production agents with company-specific prompts, tools, and configs, create
|
|
|
1101
1130
|
|
|
1102
1131
|
```bash
|
|
1103
1132
|
mkdir my-agents && cd my-agents
|
|
1133
|
+
python3 -m venv .venv
|
|
1134
|
+
source .venv/bin/activate
|
|
1135
|
+
pip install python-slack-agents
|
|
1104
1136
|
slack-agents init my-agents
|
|
1105
1137
|
pip install -e .
|
|
1106
1138
|
```
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "python-slack-agents"
|
|
7
|
-
version = "0.6.
|
|
7
|
+
version = "0.6.1"
|
|
8
8
|
description = "A Python framework for deploying AI agents as Slack bots"
|
|
9
9
|
authors = [{name = "Eric Pichon", email = "epichon@comparenetworks.com"}]
|
|
10
10
|
readme = "README.md"
|
{python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/cli/build_docker.py
RENAMED
|
@@ -33,6 +33,7 @@ def _is_valid_docker_name(name: str) -> bool:
|
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
def execute(args):
|
|
36
|
+
import re
|
|
36
37
|
import subprocess
|
|
37
38
|
import sys
|
|
38
39
|
from pathlib import Path
|
|
@@ -66,6 +67,18 @@ def execute(args):
|
|
|
66
67
|
else:
|
|
67
68
|
image_tag = f"{image_name}:{version}"
|
|
68
69
|
|
|
70
|
+
req_files = sorted(Path(".").glob("req*.txt"))
|
|
71
|
+
if req_files:
|
|
72
|
+
names = ", ".join(f.name for f in req_files)
|
|
73
|
+
print(
|
|
74
|
+
f"Error: found {names} in the project root.\n"
|
|
75
|
+
"Docker builds install dependencies from pyproject.toml, not\n"
|
|
76
|
+
"requirements files. Move your dependencies into pyproject.toml\n"
|
|
77
|
+
"under [project] dependencies, then remove the requirements file(s).",
|
|
78
|
+
file=sys.stderr,
|
|
79
|
+
)
|
|
80
|
+
sys.exit(1)
|
|
81
|
+
|
|
69
82
|
print(f"Building {image_tag} ...")
|
|
70
83
|
result = subprocess.run(
|
|
71
84
|
[
|
|
@@ -92,3 +105,12 @@ def execute(args):
|
|
|
92
105
|
sys.exit(result.returncode)
|
|
93
106
|
|
|
94
107
|
print(f"Done: {image_tag}")
|
|
108
|
+
|
|
109
|
+
# Show required env vars last so they're visible without scrolling
|
|
110
|
+
raw_config = (agent_dir / "config.yaml").read_text()
|
|
111
|
+
active_config = re.sub(r"(?m)^(\s*)#.*$", r"\1", raw_config)
|
|
112
|
+
env_vars = sorted(set(re.findall(r"\{([A-Z_][A-Z0-9_]*)\}", active_config)))
|
|
113
|
+
if env_vars:
|
|
114
|
+
print(f"\nRequired environment variables ({len(env_vars)}):")
|
|
115
|
+
for var in env_vars:
|
|
116
|
+
print(f" {var}")
|
|
@@ -10,20 +10,39 @@ name = "{project_name}"
|
|
|
10
10
|
version = "0.1.0"
|
|
11
11
|
requires-python = ">=3.12"
|
|
12
12
|
dependencies = [
|
|
13
|
-
"python-slack-agents
|
|
13
|
+
"python-slack-agents<2",
|
|
14
|
+
# add packages required by your plugins here
|
|
14
15
|
]
|
|
15
16
|
|
|
16
17
|
[tool.setuptools.packages.find]
|
|
17
|
-
where = ["src"]
|
|
18
|
+
where = ["src"] # required to import plugins and to build docker images
|
|
18
19
|
"""
|
|
19
20
|
|
|
20
21
|
ENV_EXAMPLE = """\
|
|
22
|
+
# Full setup guide:
|
|
23
|
+
# https://github.com/CompareNetworks/python-slack-agents/blob/main/docs/setup.md
|
|
24
|
+
|
|
21
25
|
SLACK_BOT_TOKEN=xoxb-...
|
|
22
26
|
SLACK_APP_TOKEN=xapp-...
|
|
27
|
+
|
|
28
|
+
# LLM provider
|
|
23
29
|
ANTHROPIC_API_KEY=sk-ant-...
|
|
24
30
|
# OPENAI_API_KEY=sk-...
|
|
25
31
|
"""
|
|
26
32
|
|
|
33
|
+
GITIGNORE = """\
|
|
34
|
+
.env
|
|
35
|
+
.venv/
|
|
36
|
+
__pycache__/
|
|
37
|
+
*.pyc
|
|
38
|
+
*.egg-info/
|
|
39
|
+
*.db
|
|
40
|
+
.DS_Store
|
|
41
|
+
.idea/
|
|
42
|
+
.vscode/
|
|
43
|
+
dist/
|
|
44
|
+
"""
|
|
45
|
+
|
|
27
46
|
HELLO_WORLD_CONFIG = """\
|
|
28
47
|
version: "1.0.0"
|
|
29
48
|
schema: "slack-agents/v1"
|
|
@@ -74,6 +93,7 @@ def execute(args):
|
|
|
74
93
|
),
|
|
75
94
|
f"src/{package_name}/__init__.py": "",
|
|
76
95
|
".env.example": ENV_EXAMPLE,
|
|
96
|
+
".gitignore": GITIGNORE,
|
|
77
97
|
"agents/hello-world/config.yaml": HELLO_WORLD_CONFIG,
|
|
78
98
|
"agents/hello-world/system_prompt.txt": HELLO_WORLD_PROMPT,
|
|
79
99
|
}
|
|
@@ -82,13 +102,27 @@ def execute(args):
|
|
|
82
102
|
path = Path(rel_path)
|
|
83
103
|
if path.exists():
|
|
84
104
|
print(f"Skipping {rel_path} (already exists — remove it to regenerate)")
|
|
105
|
+
print(" Proposed content:\n")
|
|
106
|
+
for line in content.splitlines():
|
|
107
|
+
print(f" {line}")
|
|
108
|
+
print()
|
|
85
109
|
continue
|
|
86
110
|
path.parent.mkdir(parents=True, exist_ok=True)
|
|
87
111
|
path.write_text(content)
|
|
88
112
|
print(f"Created {rel_path}")
|
|
89
113
|
|
|
90
|
-
|
|
114
|
+
# Warn about requirements files that won't be picked up by Docker builds
|
|
115
|
+
req_files = sorted(Path(".").glob("req*.txt"))
|
|
116
|
+
if req_files:
|
|
117
|
+
names = ", ".join(f.name for f in req_files)
|
|
118
|
+
print(f"WARNING: found {names}")
|
|
119
|
+
print(" Docker builds install dependencies from pyproject.toml, not")
|
|
120
|
+
print(" requirements files. Move your dependencies into pyproject.toml")
|
|
121
|
+
print(" under [project] dependencies or your Docker images will be")
|
|
122
|
+
print(" missing packages.")
|
|
123
|
+
print()
|
|
124
|
+
|
|
91
125
|
print("Next steps:")
|
|
92
|
-
print(" cp .env.example .env
|
|
93
|
-
print(" pip install -e .
|
|
94
|
-
print(" slack-agents run agents/hello-world")
|
|
126
|
+
print(" cp .env.example .env # add your tokens")
|
|
127
|
+
print(" pip install -e . # install for development")
|
|
128
|
+
print(" slack-agents run agents/hello-world # run the example agent")
|
|
@@ -14,8 +14,14 @@ logger = logging.getLogger(__name__)
|
|
|
14
14
|
CURRENT_SCHEMA = "slack-agents/v1"
|
|
15
15
|
|
|
16
16
|
|
|
17
|
+
def _strip_yaml_comments(text: str) -> str:
|
|
18
|
+
"""Blank out YAML comment lines, preserving line numbers for error messages."""
|
|
19
|
+
return re.sub(r"(?m)^(\s*)#.*$", r"\1", text)
|
|
20
|
+
|
|
21
|
+
|
|
17
22
|
def _resolve_env_vars(text: str) -> str:
|
|
18
23
|
"""Replace {VAR_NAME} with os.environ[VAR_NAME]. Only matches uppercase/underscore names."""
|
|
24
|
+
text = _strip_yaml_comments(text)
|
|
19
25
|
return re.sub(r"\{([A-Z_][A-Z0-9_]*)\}", lambda m: os.environ[m.group(1)], text)
|
|
20
26
|
|
|
21
27
|
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
|
|
5
|
-
The format is based on [Keep a Changelog](https://keepachangelog.com/), and this project adheres to [Semantic Versioning](https://semver.org/).
|
|
6
|
-
|
|
7
|
-
## [Unreleased]
|
|
8
|
-
|
|
9
|
-
## [0.5.0] - 2025-03-13
|
|
10
|
-
|
|
11
|
-
### Added
|
|
12
|
-
|
|
13
|
-
- Plugin architecture for LLM providers, storage backends, and tools
|
|
14
|
-
- Anthropic and OpenAI LLM providers
|
|
15
|
-
- SQLite and PostgreSQL storage providers
|
|
16
|
-
- MCP over HTTP tool provider
|
|
17
|
-
- Built-in document export tools (PDF, DOCX, XLSX, CSV, PPTX)
|
|
18
|
-
- Streaming output with native Slack table rendering
|
|
19
|
-
- Socket Mode support (no public URL required)
|
|
20
|
-
- OpenTelemetry observability
|
|
21
|
-
- `{ENV_VAR}` interpolation in agent configs
|
|
22
|
-
- Per-agent Docker builds via `docker-build-and-push.sh`
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/agents/docs-assistant/system_prompt.txt
RENAMED
|
File without changes
|
|
File without changes
|
{python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/agents/hello-world/system_prompt.txt
RENAMED
|
File without changes
|
|
File without changes
|
{python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/agents/kitchen-sink/system_prompt.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/access/allow_all.py
RENAMED
|
File without changes
|
{python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/access/allow_list.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/cli/export_conversations.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/cli/export_usage.py
RENAMED
|
File without changes
|
{python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/cli/export_usage_csv.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/scripts/__init__.py
RENAMED
|
File without changes
|
{python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/scripts/download_fonts.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/slack/tool_blocks.py
RENAMED
|
File without changes
|
{python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/storage/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/storage/postgres.py
RENAMED
|
File without changes
|
{python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/storage/postgres.sql
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/tools/file_exporter.py
RENAMED
|
File without changes
|
{python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/tools/file_importer.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_slack_agents-0.6.0 → python_slack_agents-0.6.1}/src/slack_agents/tools/user_context.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|