django-chat-ui 0.1.0__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.
- django_chat_ui-0.1.0/.github/workflows/compat-matrix.yml +27 -0
- django_chat_ui-0.1.0/.github/workflows/js-tests.yml +24 -0
- django_chat_ui-0.1.0/.github/workflows/pre-commit.yml +28 -0
- django_chat_ui-0.1.0/.github/workflows/pytest.yml +44 -0
- django_chat_ui-0.1.0/.github/workflows/release.yml +55 -0
- django_chat_ui-0.1.0/.gitignore +42 -0
- django_chat_ui-0.1.0/.pre-commit-config.yaml +66 -0
- django_chat_ui-0.1.0/CHANGELOG.md +53 -0
- django_chat_ui-0.1.0/LICENSE +21 -0
- django_chat_ui-0.1.0/PKG-INFO +470 -0
- django_chat_ui-0.1.0/README.md +422 -0
- django_chat_ui-0.1.0/biome.json +19 -0
- django_chat_ui-0.1.0/demo/demo.css +34 -0
- django_chat_ui-0.1.0/demo/demo.js +243 -0
- django_chat_ui-0.1.0/demo/index.html +24 -0
- django_chat_ui-0.1.0/demo/shirt.svg +5 -0
- django_chat_ui-0.1.0/docs/protocol.md +408 -0
- django_chat_ui-0.1.0/docs/protocol.schema.json +256 -0
- django_chat_ui-0.1.0/docs/screenshots/inbox-dark.png +0 -0
- django_chat_ui-0.1.0/docs/screenshots/inbox.png +0 -0
- django_chat_ui-0.1.0/docs/screenshots/mobile.png +0 -0
- django_chat_ui-0.1.0/docs/screenshots/reactions.png +0 -0
- django_chat_ui-0.1.0/docs/screenshots/replies.png +0 -0
- django_chat_ui-0.1.0/docs/screenshots/templates.png +0 -0
- django_chat_ui-0.1.0/docs/screenshots/widget.png +0 -0
- django_chat_ui-0.1.0/example/example/__init__.py +0 -0
- django_chat_ui-0.1.0/example/example/asgi.py +20 -0
- django_chat_ui-0.1.0/example/example/settings.py +99 -0
- django_chat_ui-0.1.0/example/example/urls.py +10 -0
- django_chat_ui-0.1.0/example/example/wsgi.py +7 -0
- django_chat_ui-0.1.0/example/helpdesk/__init__.py +0 -0
- django_chat_ui-0.1.0/example/helpdesk/admin.py +17 -0
- django_chat_ui-0.1.0/example/helpdesk/apps.py +6 -0
- django_chat_ui-0.1.0/example/helpdesk/migrations/0001_initial.py +60 -0
- django_chat_ui-0.1.0/example/helpdesk/migrations/__init__.py +0 -0
- django_chat_ui-0.1.0/example/helpdesk/models.py +37 -0
- django_chat_ui-0.1.0/example/manage.py +9 -0
- django_chat_ui-0.1.0/example/shop/__init__.py +0 -0
- django_chat_ui-0.1.0/example/shop/apps.py +6 -0
- django_chat_ui-0.1.0/example/shop/chat.py +199 -0
- django_chat_ui-0.1.0/example/shop/management/__init__.py +0 -0
- django_chat_ui-0.1.0/example/shop/management/commands/__init__.py +0 -0
- django_chat_ui-0.1.0/example/shop/management/commands/demo_chat.py +82 -0
- django_chat_ui-0.1.0/example/shop/static/shop/shop.css +46 -0
- django_chat_ui-0.1.0/example/shop/templates/shop/base.html +21 -0
- django_chat_ui-0.1.0/example/shop/templates/shop/home.html +9 -0
- django_chat_ui-0.1.0/example/shop/templates/shop/inbox.html +9 -0
- django_chat_ui-0.1.0/example/shop/views.py +23 -0
- django_chat_ui-0.1.0/package-lock.json +3185 -0
- django_chat_ui-0.1.0/package.json +17 -0
- django_chat_ui-0.1.0/pyproject.toml +176 -0
- django_chat_ui-0.1.0/src/django_chat_ui/__init__.py +2 -0
- django_chat_ui-0.1.0/src/django_chat_ui/admin.py +86 -0
- django_chat_ui-0.1.0/src/django_chat_ui/agui.py +180 -0
- django_chat_ui-0.1.0/src/django_chat_ui/apps.py +19 -0
- django_chat_ui-0.1.0/src/django_chat_ui/backend.py +269 -0
- django_chat_ui-0.1.0/src/django_chat_ui/content.py +215 -0
- django_chat_ui-0.1.0/src/django_chat_ui/locale/es/LC_MESSAGES/django.mo +0 -0
- django_chat_ui-0.1.0/src/django_chat_ui/locale/es/LC_MESSAGES/django.po +571 -0
- django_chat_ui-0.1.0/src/django_chat_ui/management/__init__.py +0 -0
- django_chat_ui-0.1.0/src/django_chat_ui/management/commands/__init__.py +0 -0
- django_chat_ui-0.1.0/src/django_chat_ui/management/commands/chat_ui_prune.py +22 -0
- django_chat_ui-0.1.0/src/django_chat_ui/matrix.py +275 -0
- django_chat_ui-0.1.0/src/django_chat_ui/migrations/0001_initial.py +225 -0
- django_chat_ui-0.1.0/src/django_chat_ui/migrations/__init__.py +0 -0
- django_chat_ui-0.1.0/src/django_chat_ui/models.py +480 -0
- django_chat_ui-0.1.0/src/django_chat_ui/py.typed +0 -0
- django_chat_ui-0.1.0/src/django_chat_ui/rules.py +345 -0
- django_chat_ui-0.1.0/src/django_chat_ui/services.py +644 -0
- django_chat_ui-0.1.0/src/django_chat_ui/static/django_chat_ui/boot.js +61 -0
- django_chat_ui-0.1.0/src/django_chat_ui/static/django_chat_ui/chat-inbox.js +270 -0
- django_chat_ui-0.1.0/src/django_chat_ui/static/django_chat_ui/chat-thread.js +886 -0
- django_chat_ui-0.1.0/src/django_chat_ui/static/django_chat_ui/chat-widget.js +229 -0
- django_chat_ui-0.1.0/src/django_chat_ui/static/django_chat_ui/chat.css +894 -0
- django_chat_ui-0.1.0/src/django_chat_ui/static/django_chat_ui/client.js +370 -0
- django_chat_ui-0.1.0/src/django_chat_ui/static/django_chat_ui/content.js +422 -0
- django_chat_ui-0.1.0/src/django_chat_ui/static/django_chat_ui/dom.js +13 -0
- django_chat_ui-0.1.0/src/django_chat_ui/static/django_chat_ui/homeserver.js +493 -0
- django_chat_ui-0.1.0/src/django_chat_ui/static/django_chat_ui/matrix.js +75 -0
- django_chat_ui-0.1.0/src/django_chat_ui/static/django_chat_ui/preview.js +47 -0
- django_chat_ui-0.1.0/src/django_chat_ui/static/django_chat_ui/store.js +358 -0
- django_chat_ui-0.1.0/src/django_chat_ui/static/django_chat_ui/theme.js +123 -0
- django_chat_ui-0.1.0/src/django_chat_ui/sync.py +438 -0
- django_chat_ui-0.1.0/src/django_chat_ui/templates/django_chat_ui/chat_ui.html +4 -0
- django_chat_ui-0.1.0/src/django_chat_ui/templatetags/__init__.py +0 -0
- django_chat_ui-0.1.0/src/django_chat_ui/templatetags/chat_ui.py +38 -0
- django_chat_ui-0.1.0/src/django_chat_ui/texts.py +76 -0
- django_chat_ui-0.1.0/src/django_chat_ui/urls.py +74 -0
- django_chat_ui-0.1.0/src/django_chat_ui/views.py +699 -0
- django_chat_ui-0.1.0/tests/__init__.py +0 -0
- django_chat_ui-0.1.0/tests/conftest.py +145 -0
- django_chat_ui-0.1.0/tests/e2e/__init__.py +0 -0
- django_chat_ui-0.1.0/tests/e2e/conftest.py +24 -0
- django_chat_ui-0.1.0/tests/e2e/test_e2e.py +263 -0
- django_chat_ui-0.1.0/tests/e2e/test_matrix_sdk.py +78 -0
- django_chat_ui-0.1.0/tests/js/boot.test.js +109 -0
- django_chat_ui-0.1.0/tests/js/chat-inbox.test.js +276 -0
- django_chat_ui-0.1.0/tests/js/chat-thread.test.js +784 -0
- django_chat_ui-0.1.0/tests/js/chat-widget.test.js +245 -0
- django_chat_ui-0.1.0/tests/js/client.test.js +393 -0
- django_chat_ui-0.1.0/tests/js/content.test.js +396 -0
- django_chat_ui-0.1.0/tests/js/dom.test.js +13 -0
- django_chat_ui-0.1.0/tests/js/helpers.js +79 -0
- django_chat_ui-0.1.0/tests/js/homeserver.test.js +176 -0
- django_chat_ui-0.1.0/tests/js/matrix.test.js +58 -0
- django_chat_ui-0.1.0/tests/js/reactions.test.js +192 -0
- django_chat_ui-0.1.0/tests/js/replies.test.js +227 -0
- django_chat_ui-0.1.0/tests/js/store.test.js +466 -0
- django_chat_ui-0.1.0/tests/js/theme.test.js +166 -0
- django_chat_ui-0.1.0/tests/sdk/matrix-js-sdk.mjs +89 -0
- django_chat_ui-0.1.0/tests/settings.py +27 -0
- django_chat_ui-0.1.0/tests/settings_swapped.py +12 -0
- django_chat_ui-0.1.0/tests/test_admin.py +106 -0
- django_chat_ui-0.1.0/tests/test_agui.py +146 -0
- django_chat_ui-0.1.0/tests/test_api.py +400 -0
- django_chat_ui-0.1.0/tests/test_backend.py +112 -0
- django_chat_ui-0.1.0/tests/test_content.py +93 -0
- django_chat_ui-0.1.0/tests/test_example.py +241 -0
- django_chat_ui-0.1.0/tests/test_i18n.py +101 -0
- django_chat_ui-0.1.0/tests/test_matrix.py +104 -0
- django_chat_ui-0.1.0/tests/test_media.py +120 -0
- django_chat_ui-0.1.0/tests/test_prune.py +29 -0
- django_chat_ui-0.1.0/tests/test_send.py +532 -0
- django_chat_ui-0.1.0/tests/test_services.py +323 -0
- django_chat_ui-0.1.0/tests/test_swapped.py +133 -0
- django_chat_ui-0.1.0/tests/test_sync.py +297 -0
- django_chat_ui-0.1.0/tests/test_templatetags.py +51 -0
- django_chat_ui-0.1.0/tests/test_texts.py +29 -0
- django_chat_ui-0.1.0/uv.lock +1612 -0
- django_chat_ui-0.1.0/vitest.config.js +17 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
name: Compatibility Matrix
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [master, main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [master, main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
tox:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
|
|
15
|
+
- name: Install uv
|
|
16
|
+
uses: astral-sh/setup-uv@v5
|
|
17
|
+
with:
|
|
18
|
+
enable-cache: true
|
|
19
|
+
|
|
20
|
+
- name: Install Python versions
|
|
21
|
+
run: uv python install 3.10 3.12 3.13 3.14
|
|
22
|
+
|
|
23
|
+
- name: Install dependencies
|
|
24
|
+
run: uv sync
|
|
25
|
+
|
|
26
|
+
- name: Run compatibility matrix (tox)
|
|
27
|
+
run: uv run tox run
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
name: JavaScript Tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, master]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
test:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v4
|
|
13
|
+
|
|
14
|
+
- name: Setup Node.js
|
|
15
|
+
uses: actions/setup-node@v4
|
|
16
|
+
with:
|
|
17
|
+
node-version: "20"
|
|
18
|
+
cache: "npm"
|
|
19
|
+
|
|
20
|
+
- name: Install dependencies
|
|
21
|
+
run: npm ci
|
|
22
|
+
|
|
23
|
+
- name: Run Tests & Coverage
|
|
24
|
+
run: npm run coverage
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
name: Pre-commit
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, master]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
pre-commit:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v4
|
|
13
|
+
|
|
14
|
+
- name: Install uv
|
|
15
|
+
uses: astral-sh/setup-uv@v5
|
|
16
|
+
with:
|
|
17
|
+
enable-cache: true
|
|
18
|
+
|
|
19
|
+
# The hooks run on python3.14 (default_language_version), found
|
|
20
|
+
# through the venv's bin on PATH under `uv run`.
|
|
21
|
+
- name: Set up Python
|
|
22
|
+
run: uv python install 3.14
|
|
23
|
+
|
|
24
|
+
- name: Install dependencies
|
|
25
|
+
run: uv sync --python 3.14
|
|
26
|
+
|
|
27
|
+
- name: Run pre-commit
|
|
28
|
+
run: uv run pre-commit run --all-files
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
name: Python and Playwright Tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [master, main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [master, main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test-python:
|
|
11
|
+
name: Python Tests
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
|
|
16
|
+
- name: Install uv
|
|
17
|
+
uses: astral-sh/setup-uv@v5
|
|
18
|
+
with:
|
|
19
|
+
enable-cache: true
|
|
20
|
+
|
|
21
|
+
- name: Set up Python
|
|
22
|
+
run: uv python install
|
|
23
|
+
|
|
24
|
+
- name: Install dependencies
|
|
25
|
+
run: uv sync
|
|
26
|
+
|
|
27
|
+
- name: Install Playwright browsers
|
|
28
|
+
run: uv run playwright install --with-deps chromium
|
|
29
|
+
|
|
30
|
+
# matrix-js-sdk, for the test of a Matrix client against the server.
|
|
31
|
+
- name: Set up Node.js
|
|
32
|
+
uses: actions/setup-node@v4
|
|
33
|
+
with:
|
|
34
|
+
node-version: "20"
|
|
35
|
+
cache: "npm"
|
|
36
|
+
|
|
37
|
+
- name: Install the JavaScript dependencies
|
|
38
|
+
run: npm ci
|
|
39
|
+
|
|
40
|
+
- name: Run Pytest
|
|
41
|
+
run: uv run pytest
|
|
42
|
+
|
|
43
|
+
- name: Run Pytest with a site's own models
|
|
44
|
+
run: uv run pytest --ds tests.settings_swapped --cov-append
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types:
|
|
6
|
+
- published
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
release-build:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
|
|
15
|
+
- name: Install uv
|
|
16
|
+
uses: astral-sh/setup-uv@v5
|
|
17
|
+
with:
|
|
18
|
+
enable-cache: true
|
|
19
|
+
|
|
20
|
+
- name: Show project version
|
|
21
|
+
run: |
|
|
22
|
+
grep "version" pyproject.toml
|
|
23
|
+
|
|
24
|
+
- name: Build release distributions
|
|
25
|
+
run: uv build
|
|
26
|
+
|
|
27
|
+
- name: Upload distributions
|
|
28
|
+
uses: actions/upload-artifact@v4
|
|
29
|
+
with:
|
|
30
|
+
name: release-dists
|
|
31
|
+
path: dist/
|
|
32
|
+
|
|
33
|
+
pypi-publish:
|
|
34
|
+
runs-on: ubuntu-latest
|
|
35
|
+
needs:
|
|
36
|
+
- release-build
|
|
37
|
+
permissions:
|
|
38
|
+
id-token: write
|
|
39
|
+
contents: read
|
|
40
|
+
|
|
41
|
+
environment:
|
|
42
|
+
name: pypi
|
|
43
|
+
url: https://pypi.org/project/django-chat-ui/
|
|
44
|
+
|
|
45
|
+
steps:
|
|
46
|
+
- name: Retrieve release distributions
|
|
47
|
+
uses: actions/download-artifact@v4
|
|
48
|
+
with:
|
|
49
|
+
name: release-dists
|
|
50
|
+
path: dist/
|
|
51
|
+
|
|
52
|
+
- name: Publish release distributions to PyPI
|
|
53
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
54
|
+
with:
|
|
55
|
+
packages-dir: dist/
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.egg-info/
|
|
5
|
+
.eggs/
|
|
6
|
+
build/
|
|
7
|
+
dist/
|
|
8
|
+
.installed.cfg
|
|
9
|
+
*.egg
|
|
10
|
+
|
|
11
|
+
# Virtual environments
|
|
12
|
+
.venv/
|
|
13
|
+
venv/
|
|
14
|
+
env/
|
|
15
|
+
|
|
16
|
+
# Testing / coverage
|
|
17
|
+
.pytest_cache/
|
|
18
|
+
.coverage
|
|
19
|
+
.coverage.*
|
|
20
|
+
coverage/
|
|
21
|
+
htmlcov/
|
|
22
|
+
.mypy_cache/
|
|
23
|
+
.ruff_cache/
|
|
24
|
+
.tox/
|
|
25
|
+
|
|
26
|
+
# Django
|
|
27
|
+
*.log
|
|
28
|
+
local_settings.py
|
|
29
|
+
db.sqlite3
|
|
30
|
+
db.sqlite3-journal
|
|
31
|
+
media/
|
|
32
|
+
|
|
33
|
+
# Node / JS
|
|
34
|
+
node_modules/
|
|
35
|
+
|
|
36
|
+
# Editors / OS
|
|
37
|
+
.vscode/
|
|
38
|
+
.idea/
|
|
39
|
+
.DS_Store
|
|
40
|
+
|
|
41
|
+
# Docs
|
|
42
|
+
docs/_build/
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
default_language_version:
|
|
2
|
+
python: &python-version python3.14
|
|
3
|
+
|
|
4
|
+
repos:
|
|
5
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
6
|
+
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0
|
|
7
|
+
hooks:
|
|
8
|
+
- id: check-added-large-files
|
|
9
|
+
- id: check-case-conflict
|
|
10
|
+
- id: check-json
|
|
11
|
+
- id: check-merge-conflict
|
|
12
|
+
- id: check-symlinks
|
|
13
|
+
- id: check-toml
|
|
14
|
+
- id: debug-statements
|
|
15
|
+
- id: end-of-file-fixer
|
|
16
|
+
- id: trailing-whitespace
|
|
17
|
+
|
|
18
|
+
- repo: https://github.com/biomejs/pre-commit
|
|
19
|
+
rev: d1ce4972fb5ad09afd33b432bca71e8c5dfbb2b5 # frozen: v2.5.6
|
|
20
|
+
hooks:
|
|
21
|
+
- id: biome-check
|
|
22
|
+
additional_dependencies:
|
|
23
|
+
- '@biomejs/biome@2.3.8'
|
|
24
|
+
language_version: default
|
|
25
|
+
|
|
26
|
+
- repo: https://github.com/adamchainz/django-upgrade
|
|
27
|
+
rev: bdcc9646c249f00ec9781751791e7b75b48b3722 # frozen: 1.31.1
|
|
28
|
+
hooks:
|
|
29
|
+
- id: django-upgrade
|
|
30
|
+
args: [--target-version, "4.2"]
|
|
31
|
+
|
|
32
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
33
|
+
rev: 39d9ac5938dadb73df0564a45f163e25ff9fa6e2 # frozen: v0.16.1
|
|
34
|
+
hooks:
|
|
35
|
+
- id: ruff-check
|
|
36
|
+
args: [--fix]
|
|
37
|
+
- id: ruff-format
|
|
38
|
+
|
|
39
|
+
- repo: local
|
|
40
|
+
hooks:
|
|
41
|
+
- id: mypy
|
|
42
|
+
name: mypy
|
|
43
|
+
entry: mypy
|
|
44
|
+
language: python
|
|
45
|
+
additional_dependencies:
|
|
46
|
+
- mypy>=1.10
|
|
47
|
+
- django-stubs[compatible-mypy]>=5
|
|
48
|
+
- django>=4.2
|
|
49
|
+
- pytest-django>=4.8
|
|
50
|
+
types: [python]
|
|
51
|
+
files: ^(src|example)/
|
|
52
|
+
pass_filenames: false
|
|
53
|
+
args: [src/django_chat_ui, example]
|
|
54
|
+
|
|
55
|
+
# Only needed if the library ships Django templates (src/<pkg>/templates/).
|
|
56
|
+
# Remove this hook if it doesn't.
|
|
57
|
+
- repo: https://github.com/adamchainz/djade-pre-commit
|
|
58
|
+
rev: 52a7ce253113456c2a1113186a4a19b15c8b68af # frozen: 1.9.0
|
|
59
|
+
hooks:
|
|
60
|
+
- id: djade
|
|
61
|
+
files: '(/|^)templates/'
|
|
62
|
+
|
|
63
|
+
- repo: https://github.com/tox-dev/pyproject-fmt
|
|
64
|
+
rev: d600c142bb19f521ae6a6a345f94a2efd7937759 # frozen: v2.26.0
|
|
65
|
+
hooks:
|
|
66
|
+
- id: pyproject-fmt
|
|
@@ -0,0 +1,53 @@
|
|
|
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/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.1.0] - 2026-10-24
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Matrix as the protocol: the components are Matrix clients (`ChatClient`
|
|
13
|
+
over the Client-Server API: `/sync` with long polling or polling, a local
|
|
14
|
+
echo of what's sent, receipts, typing, reactions, media), and the Django
|
|
15
|
+
app a Matrix homeserver without federation (docs/protocol.md): access
|
|
16
|
+
tokens (`m.login.password`) or the site's session, rooms, their state,
|
|
17
|
+
`/messages`, media, CORS. Tested with matrix-js-sdk.
|
|
18
|
+
- This package's extensions to Matrix, namespaced under
|
|
19
|
+
`io.github.rodolvbg.chat`, each with a fallback any other client shows:
|
|
20
|
+
the conversations' capabilities and channel, quick replies and their
|
|
21
|
+
answers, cards, WhatsApp's templates, shared contacts, link previews,
|
|
22
|
+
system notices, a `delivered` receipt, a message's `failed` status, and
|
|
23
|
+
messages being written (an AI's), as ephemeral events; their JSON Schema.
|
|
24
|
+
- `<chat-thread>`, `<chat-inbox>` and `<chat-widget>`: web components without
|
|
25
|
+
a build step, safe under a strict Content Security Policy (HTML of
|
|
26
|
+
messages rebuilt from the specification's safe subset).
|
|
27
|
+
- `homeserver.js`: a scriptable Matrix homeserver in memory, for demos and
|
|
28
|
+
tests.
|
|
29
|
+
- The Django app: conversations, participants and their events (Matrix
|
|
30
|
+
rooms, users and events); `services` and `content` for integrations;
|
|
31
|
+
`ChatBackend` to decide who chats and what happens (its hooks inline, in
|
|
32
|
+
a thread, or wherever `run_hook()` sends them), with the event types and
|
|
33
|
+
message types of a site's extensions; `{% chat_ui %}`; the admin;
|
|
34
|
+
`chat_ui_prune`.
|
|
35
|
+
- A site's own models of conversations and participants
|
|
36
|
+
(`CHAT_UI_CONVERSATION_MODEL`, `CHAT_UI_PARTICIPANT_MODEL`), subclasses
|
|
37
|
+
of `AbstractConversation` and `AbstractParticipant`; their fields reach
|
|
38
|
+
the clients through `ChatBackend.serialize_conversation()` and
|
|
39
|
+
`serialize_participant()`.
|
|
40
|
+
- `services.stream_text()`: a message written as an AI model streams it,
|
|
41
|
+
shown as it comes, sent when it ends or fails.
|
|
42
|
+
- `django_chat_ui.agui.AgUiAgent`: AI agents that speak AG-UI answer in a
|
|
43
|
+
conversation, as they write.
|
|
44
|
+
- Light or dark as the page around them: Django's admin's theme, the
|
|
45
|
+
`dark` class of Unfold and Tailwind, or the page's background, before the
|
|
46
|
+
system's; following a theme switch (`theme.js`).
|
|
47
|
+
- Replies, where a conversation's `replies` capability allows them: "↩" on
|
|
48
|
+
a message answers it (a bar over the composer says which, Escape cancels
|
|
49
|
+
it), and the answer quotes it, leading to it; `ChatClient.send(…,
|
|
50
|
+
{ replyTo })`.
|
|
51
|
+
- Reactions, where a conversation's `reactions` capability allows them (any
|
|
52
|
+
emoji, or a list).
|
|
53
|
+
- Spanish translation.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Rodolfo Becerra
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|