stapel-chat
Conversations and messaging: direct (1:1, idempotent by participant pair), group and support threads on one model; text/system messages with a monotonic per-conversation seq, replies and opaque CDN attachment keys; per-participant read markers and unread counts; anchor-paginated history (canonical anchor=seq) and conversation lists; a support layer (unassigned queue, first-come assignment, open/pending/resolved with reopen); and an optional Channels consumer for realtime delivery with seq-replay resume.
Part of the Stapel framework — composable Django apps that deploy as a monolith or as microservices without changing module code.
Install
pip install stapel-chat
At a glance
| Fact | Value |
|---|---|
| Version | 0.2.0 |
| Python | >=3.11 (3.11, 3.12, 3.13, 3.14) |
| HTTP operations | 10 |
| Config axes | 3 |
| Usage surface | 11 |
| Extension points | 4 |
| Error codes | 54 |
| Fleet dependencies | stapel-auth (optional) · stapel-cdn (optional) · stapel-core |
Documentation
OpenAPI · capabilities.json · llms.txt (for agents)
One model backs three kinds of thread: direct (1:1, idempotent by participant pair), group, and support (a customer↔operator thread with a queue and assignment lifecycle). Messages carry a monotonic per-conversation seq that is the canonical anchor for history pagination and the resume cursor for realtime — so nothing depends on a socket staying up.
Quick start
INSTALLED_APPS = [
# ...
"stapel_core.django.apps.CommonDjangoConfig",
"stapel_core.django.users",
"rest_framework",
"stapel_chat",
]
# urls.py
urlpatterns = [
path("chat/", include("stapel_chat.urls")),
]
What you get
-
Conversations —
POST /chat/api/conversations(direct/group/support); direct is get-or-create by participant pair.GETlists your conversations (anchor-paginated) withunread_count. -
Messages —
GET/POST /chat/api/conversations/{id}/messages. History is anchored onseq(newest-first, both directions). Sending allocates the nextseqand emitschat.messagein one transaction. -
Read markers —
POST /chat/api/conversations/{id}/read(upto_seq). -
Support —
GET /chat/api/support/queue,POST .../support/conversations/{id}/{assign,resolve,reopen}. -
Realtime (optional) —
stapel_chat.consumers.ChatConsumerover Channels:hello{last_seq}→ replay by seq → live delivery. Install the extra:pip install 'stapel-chat[channels]'and wire it behind
stapel_core.django.jwt.channels.JWTAuthMiddlewareStackin yourasgi.py.
Configuration (STAPEL_CHAT)
| Key | Default | Meaning |
|---|---|---|
CHAT_KINDS |
["direct","group","support"] |
Enabled thread kinds (drop support to disable the operator queue) |
ATTACHMENTS |
True |
Allow opaque attachment keys on messages |
MAX_BODY_LENGTH |
4000 |
Hard cap on a text body |
SCOPE_PROVIDER |
stapel_chat.scope.DefaultScopeProvider |
Resolve/enforce the opaque scope_key (e.g. per workspace) |
See MODULE.md for the extension seams, comm surface and anti-patterns.
License
MIT — see LICENSE.
This page is assembled by stapel-readme from docs/readme.md plus the contract artifacts in docs/. Edit the prose in docs/readme.md; the badges, facts and links above and below it are generated — do not hand-edit README.md.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stapel_chat-0.2.0.tar.gz.
File metadata
- Download URL: stapel_chat-0.2.0.tar.gz
- Upload date:
- Size: 54.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
85ebd4803cdb320cbfa56a12621ff5d22265e1cf6067829324094322d99f9371
|
|
| MD5 |
93446d698c97e2b82ecf057885819e36
|
|
| BLAKE2b-256 |
20862733ed29f4f4d1f843b4ac7ad11a98175a3130d62c216f77fc06ffc1ff93
|
Provenance
The following attestation bundles were made for stapel_chat-0.2.0.tar.gz:
Publisher:
publish.yml on usestapel/stapel-chat
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
stapel_chat-0.2.0.tar.gz -
Subject digest:
85ebd4803cdb320cbfa56a12621ff5d22265e1cf6067829324094322d99f9371 - Sigstore transparency entry: 2482778093
- Sigstore integration time:
-
Permalink:
usestapel/stapel-chat@9f9874b74c80defb20b8969043eba17a59f3c7d0 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/usestapel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9f9874b74c80defb20b8969043eba17a59f3c7d0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file stapel_chat-0.2.0-py3-none-any.whl.
File metadata
- Download URL: stapel_chat-0.2.0-py3-none-any.whl
- Upload date:
- Size: 54.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9c3f3445f5777ae3d3189f1aa338f97b73d5504d6ec63740c60c3fe4fae19f4
|
|
| MD5 |
eb50f48484059d6aae4f83dd6aabb3f9
|
|
| BLAKE2b-256 |
53262e841a6ca709e1d214c4eee1c9404832c839f5380ae2c773894f76860e90
|
Provenance
The following attestation bundles were made for stapel_chat-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on usestapel/stapel-chat
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
stapel_chat-0.2.0-py3-none-any.whl -
Subject digest:
b9c3f3445f5777ae3d3189f1aa338f97b73d5504d6ec63740c60c3fe4fae19f4 - Sigstore transparency entry: 2482778391
- Sigstore integration time:
-
Permalink:
usestapel/stapel-chat@9f9874b74c80defb20b8969043eba17a59f3c7d0 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/usestapel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9f9874b74c80defb20b8969043eba17a59f3c7d0 -
Trigger Event:
push
-
Statement type: