Metadata-Version: 2.5
Name: slackwright
Version: 0.1.2
Summary: Building blocks for AI agents that live in Slack
Project-URL: Homepage, https://github.com/gmr/slackwright
Project-URL: Bug Tracker, https://github.com/gmr/slackwright/issues
Author-email: "Gavin M. Roy" <gavinmroy@gmail.com>
License-Expression: BSD-3-Clause
License-File: LICENSE
Keywords: agent,block-kit,bot,canvas,markdown,slack
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Communications :: Chat
Classifier: Topic :: Software Development :: Libraries
Classifier: Typing :: Typed
Requires-Python: >=3.12
Requires-Dist: aiohttp>=3.9
Requires-Dist: httpx>=0.27
Requires-Dist: markdown-it-py>=3.0
Requires-Dist: pydantic>=2.10
Requires-Dist: slack-sdk>=3.47
Provides-Extra: postgres
Requires-Dist: psycopg[pool]>=3.2; extra == 'postgres'
Provides-Extra: valkey
Requires-Dist: valkey>=6; extra == 'valkey'
Description-Content-Type: text/markdown

# slackwright

Building blocks for AI agents that live in Slack.

slackwright is a library, not a framework. Your bot keeps its own event
loop and agent; slackwright gives it the Slack parts:

- **Render**: post LLM Markdown answers with Slack's native Markdown
  support, split long answers, and stream replies with task cards.
- **Tools**: expose the parts below to an LLM agent as tools, with
  Anthropic tool definitions and validated inputs.
- **Forms**: forms that an agent designs, in a modal or inline in a
  message, with validated submissions.
- **Canvases**: create, edit, and read canvas documents.
- **Ingest**: turn a Slack thread, its mentions, and its files into LLM
  messages.
- **Lifecycle**: progress updates and an in-flight drain for graceful
  shutdown.

> Status: early development. The API will change.

## Installation

```bash
pip install slackwright
pip install 'slackwright[valkey]'    # ValkeyFormStore
pip install 'slackwright[postgres]'  # PostgresFormStore
```

## Example

```python
import slackwright
from slackwright import forms, stores

runtime = forms.Runtime(stores.ValkeyFormStore(valkey), on_submit)
runtime.register(bolt_app)  # handles form buttons and modals

toolkit = slackwright.Toolkit(
    slack_client,
    channel_id=channel_id,
    thread_ts=thread_ts,
    user_id=user_id,
    forms=runtime,
    canvases=True,
)
tools = toolkit.anthropic()                     # give these to Claude
result = await toolkit.call(name, tool_input)   # run a tool_use block
```

See [docs/design.md](docs/design.md) for the design.

## Development

```bash
uv sync --all-groups
docker compose up -d --wait   # Valkey and PostgreSQL for integration tests
uv run pre-commit run --all-files
uv run coverage run
uv run coverage report
```

Without the compose services, the Valkey and PostgreSQL tests are
skipped. When `VALKEY_URL` or `POSTGRES_URL` is set (CI sets both),
those tests always run against that URL.

## License

BSD 3-Clause. See [LICENSE](LICENSE).
