Skip to main content

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

  • ConversationsPOST /chat/api/conversations (direct / group / support); direct is get-or-create by participant pair. GET lists your conversations (anchor-paginated) with unread_count.

  • MessagesGET/POST /chat/api/conversations/{id}/messages. History is anchored on seq (newest-first, both directions). Sending allocates the next seq and emits chat.message in one transaction.

  • Read markersPOST /chat/api/conversations/{id}/read (upto_seq).

  • SupportGET /chat/api/support/queue, POST .../support/conversations/{id}/{assign,resolve,reopen}.

  • Realtime (optional)stapel_chat.consumers.ChatConsumer over 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.JWTAuthMiddlewareStack in your asgi.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

stapel_chat-0.1.0.tar.gz (41.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stapel_chat-0.1.0-py3-none-any.whl (40.5 kB view details)

Uploaded Python 3

File details

Details for the file stapel_chat-0.1.0.tar.gz.

File metadata

  • Download URL: stapel_chat-0.1.0.tar.gz
  • Upload date:
  • Size: 41.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for stapel_chat-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5f75613d37d2262c08dadae4e058e8a2faf58d7023d6ffea78d84127ab66562f
MD5 5d4daf8a8e148d8ff3e378b5d381bc29
BLAKE2b-256 3d4e127e8dfa19541134a9f9968ddd4fa58cd59e8f1c1f40239fab12d2e802b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for stapel_chat-0.1.0.tar.gz:

Publisher: publish.yml on usestapel/stapel-chat

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file stapel_chat-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: stapel_chat-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 40.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for stapel_chat-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e55502666f1a09e03af5e0e626dc4c2e39c201ee352c4489af3d1373b9977a3d
MD5 f14ffa243ec579fdc81e141889c719a3
BLAKE2b-256 f0c60d2a5a150e23367ae670ccceb0c3ae85c8177f51e2d6422c9ed49efa62a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for stapel_chat-0.1.0-py3-none-any.whl:

Publisher: publish.yml on usestapel/stapel-chat

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page