Conversations, messaging and support chat for the Stapel framework
Project description
stapel-chat
Conversations, messaging and support chat for the Stapel framework — a reusable Django app you mount in a host project.
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.
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.
Project details
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.1.6.tar.gz.
File metadata
- Download URL: stapel_chat-0.1.6.tar.gz
- Upload date:
- Size: 41.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f3cda4f62467ff71f51ec796f767b35617937578aa6da6181759c1988dfc65df
|
|
| MD5 |
1c29898947ee98c63464912727829b29
|
|
| BLAKE2b-256 |
5d190aaea34b82b37b5604c6f89ea10f1ae46ec577ac44524264ed474a2dbe64
|
Provenance
The following attestation bundles were made for stapel_chat-0.1.6.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.1.6.tar.gz -
Subject digest:
f3cda4f62467ff71f51ec796f767b35617937578aa6da6181759c1988dfc65df - Sigstore transparency entry: 2188139345
- Sigstore integration time:
-
Permalink:
usestapel/stapel-chat@ff69d7184203e1948987208843d7f28f4d3f6289 -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/usestapel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ff69d7184203e1948987208843d7f28f4d3f6289 -
Trigger Event:
push
-
Statement type:
File details
Details for the file stapel_chat-0.1.6-py3-none-any.whl.
File metadata
- Download URL: stapel_chat-0.1.6-py3-none-any.whl
- Upload date:
- Size: 41.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d1482b7e64892c41d4d3cac9b3c752557179d3bc4669e60589e92e0c11d43fc9
|
|
| MD5 |
e93e4130882f80be4d051d1356dd765c
|
|
| BLAKE2b-256 |
fbd09edb63543d6dc19a93a5d9edc6ffca2dd1a2bf53f67ae191ec617d64f715
|
Provenance
The following attestation bundles were made for stapel_chat-0.1.6-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.1.6-py3-none-any.whl -
Subject digest:
d1482b7e64892c41d4d3cac9b3c752557179d3bc4669e60589e92e0c11d43fc9 - Sigstore transparency entry: 2188139352
- Sigstore integration time:
-
Permalink:
usestapel/stapel-chat@ff69d7184203e1948987208843d7f28f4d3f6289 -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/usestapel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ff69d7184203e1948987208843d7f28f4d3f6289 -
Trigger Event:
push
-
Statement type: