soothe-client-python 0.9.4__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.
- soothe_client_python-0.9.4/.gitignore +218 -0
- soothe_client_python-0.9.4/LICENSE +21 -0
- soothe_client_python-0.9.4/PKG-INFO +131 -0
- soothe_client_python-0.9.4/README.md +97 -0
- soothe_client_python-0.9.4/pyproject.toml +83 -0
- soothe_client_python-0.9.4/src/soothe_client/__init__.py +171 -0
- soothe_client_python-0.9.4/src/soothe_client/appkit/__init__.py +138 -0
- soothe_client_python-0.9.4/src/soothe_client/appkit/attachments.py +118 -0
- soothe_client_python-0.9.4/src/soothe_client/appkit/broadcaster.py +116 -0
- soothe_client_python-0.9.4/src/soothe_client/appkit/chunk_filter.py +99 -0
- soothe_client_python-0.9.4/src/soothe_client/appkit/classifier.py +498 -0
- soothe_client_python-0.9.4/src/soothe_client/appkit/daemon_session.py +657 -0
- soothe_client_python-0.9.4/src/soothe_client/appkit/events.py +63 -0
- soothe_client_python-0.9.4/src/soothe_client/appkit/managed_client.py +163 -0
- soothe_client_python-0.9.4/src/soothe_client/appkit/observability.py +29 -0
- soothe_client_python-0.9.4/src/soothe_client/appkit/pool.py +258 -0
- soothe_client_python-0.9.4/src/soothe_client/appkit/query_gate.py +93 -0
- soothe_client_python-0.9.4/src/soothe_client/appkit/session_store.py +100 -0
- soothe_client_python-0.9.4/src/soothe_client/appkit/thinking_step.py +147 -0
- soothe_client_python-0.9.4/src/soothe_client/appkit/turn.py +362 -0
- soothe_client_python-0.9.4/src/soothe_client/appkit/turn_runner.py +565 -0
- soothe_client_python-0.9.4/src/soothe_client/errors.py +65 -0
- soothe_client_python-0.9.4/src/soothe_client/helpers.py +404 -0
- soothe_client_python-0.9.4/src/soothe_client/intent_hints.py +43 -0
- soothe_client_python-0.9.4/src/soothe_client/protocol_params.py +604 -0
- soothe_client_python-0.9.4/src/soothe_client/schemas.py +55 -0
- soothe_client_python-0.9.4/src/soothe_client/session.py +199 -0
- soothe_client_python-0.9.4/src/soothe_client/websocket.py +1626 -0
- soothe_client_python-0.9.4/src/soothe_client/ws_command_client.py +633 -0
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py.cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
# Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# UV
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
# uv.lock
|
|
102
|
+
|
|
103
|
+
# poetry
|
|
104
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
105
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
106
|
+
# commonly ignored for libraries.
|
|
107
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
108
|
+
# poetry.lock
|
|
109
|
+
# poetry.toml
|
|
110
|
+
|
|
111
|
+
# pdm
|
|
112
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
113
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
114
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
115
|
+
# pdm.lock
|
|
116
|
+
# pdm.toml
|
|
117
|
+
.pdm-python
|
|
118
|
+
.pdm-build/
|
|
119
|
+
|
|
120
|
+
# pixi
|
|
121
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
122
|
+
# pixi.lock
|
|
123
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
124
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
125
|
+
.pixi
|
|
126
|
+
|
|
127
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
128
|
+
__pypackages__/
|
|
129
|
+
|
|
130
|
+
# Celery stuff
|
|
131
|
+
celerybeat-schedule
|
|
132
|
+
celerybeat.pid
|
|
133
|
+
|
|
134
|
+
# Redis
|
|
135
|
+
*.rdb
|
|
136
|
+
*.aof
|
|
137
|
+
*.pid
|
|
138
|
+
|
|
139
|
+
# RabbitMQ
|
|
140
|
+
mnesia/
|
|
141
|
+
rabbitmq/
|
|
142
|
+
rabbitmq-data/
|
|
143
|
+
|
|
144
|
+
# ActiveMQ
|
|
145
|
+
activemq-data/
|
|
146
|
+
|
|
147
|
+
# SageMath parsed files
|
|
148
|
+
*.sage.py
|
|
149
|
+
|
|
150
|
+
# Environments
|
|
151
|
+
.env
|
|
152
|
+
.envrc
|
|
153
|
+
.venv
|
|
154
|
+
env/
|
|
155
|
+
venv/
|
|
156
|
+
ENV/
|
|
157
|
+
env.bak/
|
|
158
|
+
venv.bak/
|
|
159
|
+
|
|
160
|
+
# Spyder project settings
|
|
161
|
+
.spyderproject
|
|
162
|
+
.spyproject
|
|
163
|
+
|
|
164
|
+
# Rope project settings
|
|
165
|
+
.ropeproject
|
|
166
|
+
|
|
167
|
+
# mkdocs documentation
|
|
168
|
+
/site
|
|
169
|
+
|
|
170
|
+
# mypy
|
|
171
|
+
.mypy_cache/
|
|
172
|
+
.dmypy.json
|
|
173
|
+
dmypy.json
|
|
174
|
+
|
|
175
|
+
# Pyre type checker
|
|
176
|
+
.pyre/
|
|
177
|
+
|
|
178
|
+
# pytype static type analyzer
|
|
179
|
+
.pytype/
|
|
180
|
+
|
|
181
|
+
# Cython debug symbols
|
|
182
|
+
cython_debug/
|
|
183
|
+
|
|
184
|
+
# PyCharm
|
|
185
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
186
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
187
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
188
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
189
|
+
# .idea/
|
|
190
|
+
|
|
191
|
+
# Abstra
|
|
192
|
+
# Abstra is an AI-powered process automation framework.
|
|
193
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
194
|
+
# Learn more at https://abstra.io/docs
|
|
195
|
+
.abstra/
|
|
196
|
+
|
|
197
|
+
# Visual Studio Code
|
|
198
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
199
|
+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
200
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
201
|
+
# you could uncomment the following to ignore the entire vscode folder
|
|
202
|
+
# .vscode/
|
|
203
|
+
# Temporary file for partial code execution
|
|
204
|
+
tempCodeRunnerFile.py
|
|
205
|
+
|
|
206
|
+
# Ruff stuff:
|
|
207
|
+
.ruff_cache/
|
|
208
|
+
|
|
209
|
+
# PyPI configuration file
|
|
210
|
+
.pypirc
|
|
211
|
+
|
|
212
|
+
# Marimo
|
|
213
|
+
marimo/_static/
|
|
214
|
+
marimo/_lsp/
|
|
215
|
+
__marimo__/
|
|
216
|
+
|
|
217
|
+
# Streamlit
|
|
218
|
+
.streamlit/secrets.toml
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mirasoth-AI
|
|
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.
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: soothe-client-python
|
|
3
|
+
Version: 0.9.4
|
|
4
|
+
Summary: WebSocket client + appkit for soothe-daemon (Python)
|
|
5
|
+
Project-URL: Homepage, https://github.com/mirasoth/soothe-client-python
|
|
6
|
+
Project-URL: Documentation, https://soothe.readthedocs.io
|
|
7
|
+
Project-URL: Repository, https://github.com/mirasoth/soothe-client-python
|
|
8
|
+
License: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: agents,ai,client,soothe,websocket
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
19
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
20
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
21
|
+
Requires-Python: <3.15,>=3.11
|
|
22
|
+
Requires-Dist: pydantic<3.0.0,>=2.0.0
|
|
23
|
+
Requires-Dist: soothe-sdk<1.0.0,>=0.5.25
|
|
24
|
+
Requires-Dist: websockets>=12.0
|
|
25
|
+
Provides-Extra: dev
|
|
26
|
+
Requires-Dist: mypy>=1.0.0; extra == 'dev'
|
|
27
|
+
Requires-Dist: pytest-asyncio>=1.3.0; extra == 'dev'
|
|
28
|
+
Requires-Dist: pytest-cov; extra == 'dev'
|
|
29
|
+
Requires-Dist: pytest>=8.0.0; extra == 'dev'
|
|
30
|
+
Requires-Dist: ruff>=0.12.0; extra == 'dev'
|
|
31
|
+
Provides-Extra: image
|
|
32
|
+
Requires-Dist: pillow>=10.0.0; extra == 'image'
|
|
33
|
+
Description-Content-Type: text/markdown
|
|
34
|
+
|
|
35
|
+
# soothe-client-python
|
|
36
|
+
|
|
37
|
+
WebSocket client in Python for [soothe-daemon](https://github.com/mirasoth/soothe).
|
|
38
|
+
|
|
39
|
+
Peer of [`soothe-client-go`](https://github.com/mirasoth/soothe-client-go) and
|
|
40
|
+
[`@mirasoth/soothe-client`](https://github.com/mirasoth/soothe-client-typescript).
|
|
41
|
+
|
|
42
|
+
## Install
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
pip install soothe-client-python
|
|
46
|
+
# optional image compaction:
|
|
47
|
+
pip install 'soothe-client-python[image]'
|
|
48
|
+
# or, in the soothe monorepo workspace:
|
|
49
|
+
uv sync --all-packages
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Quick start
|
|
53
|
+
|
|
54
|
+
```python
|
|
55
|
+
from soothe_client import WebSocketClient, bootstrap_loop_session, connect_websocket_with_retries
|
|
56
|
+
|
|
57
|
+
client = WebSocketClient(url="ws://127.0.0.1:8765")
|
|
58
|
+
await connect_websocket_with_retries(client)
|
|
59
|
+
status = await bootstrap_loop_session(client, resume_loop_id=None)
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Layout (RFC-629)
|
|
63
|
+
|
|
64
|
+
### Layer 0 (transport)
|
|
65
|
+
|
|
66
|
+
| Module | Role |
|
|
67
|
+
|--------|------|
|
|
68
|
+
| `websocket` | Protocol-1 `WebSocketClient` |
|
|
69
|
+
| `session` | Connect retries + loop bootstrap |
|
|
70
|
+
| `helpers` | Daemon status / config / skills RPCs |
|
|
71
|
+
| `ws_command_client` | Sync/async command helpers |
|
|
72
|
+
| `protocol_params` | Client-side params models |
|
|
73
|
+
| `intent_hints` | Intent-hint validation + `DEFAULT_DELIVERABLE_PHASES` |
|
|
74
|
+
|
|
75
|
+
### Layer 1 (`soothe_client.appkit`)
|
|
76
|
+
|
|
77
|
+
| Symbol | Role |
|
|
78
|
+
|--------|------|
|
|
79
|
+
| `DaemonSession` | Dual-socket loop session + `iter_turn_chunks` (CLI-grade) |
|
|
80
|
+
| `QueryGate` | Single-flight cancel-before-context gating |
|
|
81
|
+
| `EventClassifier` / `extract_thinking_step` | Deliverable / thinking-step mapping |
|
|
82
|
+
| `SSEBroadcaster` | Drop-on-full SSE-style fan-out |
|
|
83
|
+
| `ConnectionPool` / `TurnRunner` | Pooled multi-session turn execution |
|
|
84
|
+
| Idle / soft-complete / `compact_*` | Turn lifecycle + optional Pillow compaction |
|
|
85
|
+
| `SessionStore` | Persistence seam (Protocol) |
|
|
86
|
+
|
|
87
|
+
```python
|
|
88
|
+
from soothe_client.appkit import DaemonSession
|
|
89
|
+
|
|
90
|
+
session = DaemonSession("ws://127.0.0.1:8765")
|
|
91
|
+
await session.connect()
|
|
92
|
+
await session.send_turn("hello")
|
|
93
|
+
async for namespace, mode, data in session.iter_turn_chunks():
|
|
94
|
+
...
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Shared wire codec and path constants remain in **soothe-sdk**
|
|
98
|
+
(`soothe_sdk.wire`, `soothe_sdk.paths`).
|
|
99
|
+
|
|
100
|
+
## Development
|
|
101
|
+
|
|
102
|
+
From this repository (or the `client/python` submodule):
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
make sync-dev # uv sync --extra dev --extra image
|
|
106
|
+
make fix # ruff --fix + format
|
|
107
|
+
make check # format-check + lint + unit tests
|
|
108
|
+
make test # unit + examples
|
|
109
|
+
make verify # format-check + lint + test + build
|
|
110
|
+
make publish-dry # inspect upload without publishing
|
|
111
|
+
make publish # PyPI (trusted publisher in CI, or UV_PUBLISH_TOKEN locally)
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
| Target | Purpose |
|
|
115
|
+
|--------|---------|
|
|
116
|
+
| `format` / `format-check` | Ruff format |
|
|
117
|
+
| `lint` / `lint-fix` / `fix` | Ruff lint (+ auto-fix) |
|
|
118
|
+
| `test` / `test-unit` / `test-examples` | Pytest |
|
|
119
|
+
| `test-coverage` | Coverage HTML under `htmlcov/` |
|
|
120
|
+
| `build` | `uv build` → `dist/` |
|
|
121
|
+
| `verify` | Full pre-publish gate |
|
|
122
|
+
| `version-patch` / `-minor` / `-major` | Bump `VERSION` |
|
|
123
|
+
|
|
124
|
+
Examples live under `examples/appkit/` (run with `make test-examples`).
|
|
125
|
+
|
|
126
|
+
## Release
|
|
127
|
+
|
|
128
|
+
GitHub Actions:
|
|
129
|
+
|
|
130
|
+
- **CI** (`.github/workflows/ci.yml`) — format, lint, tests on Python 3.11–3.13
|
|
131
|
+
- **Release** (`.github/workflows/release.yml`) — on GitHub Release publish, builds and uploads to PyPI via trusted publishing (skips if the `VERSION` already exists)
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# soothe-client-python
|
|
2
|
+
|
|
3
|
+
WebSocket client in Python for [soothe-daemon](https://github.com/mirasoth/soothe).
|
|
4
|
+
|
|
5
|
+
Peer of [`soothe-client-go`](https://github.com/mirasoth/soothe-client-go) and
|
|
6
|
+
[`@mirasoth/soothe-client`](https://github.com/mirasoth/soothe-client-typescript).
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
pip install soothe-client-python
|
|
12
|
+
# optional image compaction:
|
|
13
|
+
pip install 'soothe-client-python[image]'
|
|
14
|
+
# or, in the soothe monorepo workspace:
|
|
15
|
+
uv sync --all-packages
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Quick start
|
|
19
|
+
|
|
20
|
+
```python
|
|
21
|
+
from soothe_client import WebSocketClient, bootstrap_loop_session, connect_websocket_with_retries
|
|
22
|
+
|
|
23
|
+
client = WebSocketClient(url="ws://127.0.0.1:8765")
|
|
24
|
+
await connect_websocket_with_retries(client)
|
|
25
|
+
status = await bootstrap_loop_session(client, resume_loop_id=None)
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Layout (RFC-629)
|
|
29
|
+
|
|
30
|
+
### Layer 0 (transport)
|
|
31
|
+
|
|
32
|
+
| Module | Role |
|
|
33
|
+
|--------|------|
|
|
34
|
+
| `websocket` | Protocol-1 `WebSocketClient` |
|
|
35
|
+
| `session` | Connect retries + loop bootstrap |
|
|
36
|
+
| `helpers` | Daemon status / config / skills RPCs |
|
|
37
|
+
| `ws_command_client` | Sync/async command helpers |
|
|
38
|
+
| `protocol_params` | Client-side params models |
|
|
39
|
+
| `intent_hints` | Intent-hint validation + `DEFAULT_DELIVERABLE_PHASES` |
|
|
40
|
+
|
|
41
|
+
### Layer 1 (`soothe_client.appkit`)
|
|
42
|
+
|
|
43
|
+
| Symbol | Role |
|
|
44
|
+
|--------|------|
|
|
45
|
+
| `DaemonSession` | Dual-socket loop session + `iter_turn_chunks` (CLI-grade) |
|
|
46
|
+
| `QueryGate` | Single-flight cancel-before-context gating |
|
|
47
|
+
| `EventClassifier` / `extract_thinking_step` | Deliverable / thinking-step mapping |
|
|
48
|
+
| `SSEBroadcaster` | Drop-on-full SSE-style fan-out |
|
|
49
|
+
| `ConnectionPool` / `TurnRunner` | Pooled multi-session turn execution |
|
|
50
|
+
| Idle / soft-complete / `compact_*` | Turn lifecycle + optional Pillow compaction |
|
|
51
|
+
| `SessionStore` | Persistence seam (Protocol) |
|
|
52
|
+
|
|
53
|
+
```python
|
|
54
|
+
from soothe_client.appkit import DaemonSession
|
|
55
|
+
|
|
56
|
+
session = DaemonSession("ws://127.0.0.1:8765")
|
|
57
|
+
await session.connect()
|
|
58
|
+
await session.send_turn("hello")
|
|
59
|
+
async for namespace, mode, data in session.iter_turn_chunks():
|
|
60
|
+
...
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Shared wire codec and path constants remain in **soothe-sdk**
|
|
64
|
+
(`soothe_sdk.wire`, `soothe_sdk.paths`).
|
|
65
|
+
|
|
66
|
+
## Development
|
|
67
|
+
|
|
68
|
+
From this repository (or the `client/python` submodule):
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
make sync-dev # uv sync --extra dev --extra image
|
|
72
|
+
make fix # ruff --fix + format
|
|
73
|
+
make check # format-check + lint + unit tests
|
|
74
|
+
make test # unit + examples
|
|
75
|
+
make verify # format-check + lint + test + build
|
|
76
|
+
make publish-dry # inspect upload without publishing
|
|
77
|
+
make publish # PyPI (trusted publisher in CI, or UV_PUBLISH_TOKEN locally)
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
| Target | Purpose |
|
|
81
|
+
|--------|---------|
|
|
82
|
+
| `format` / `format-check` | Ruff format |
|
|
83
|
+
| `lint` / `lint-fix` / `fix` | Ruff lint (+ auto-fix) |
|
|
84
|
+
| `test` / `test-unit` / `test-examples` | Pytest |
|
|
85
|
+
| `test-coverage` | Coverage HTML under `htmlcov/` |
|
|
86
|
+
| `build` | `uv build` → `dist/` |
|
|
87
|
+
| `verify` | Full pre-publish gate |
|
|
88
|
+
| `version-patch` / `-minor` / `-major` | Bump `VERSION` |
|
|
89
|
+
|
|
90
|
+
Examples live under `examples/appkit/` (run with `make test-examples`).
|
|
91
|
+
|
|
92
|
+
## Release
|
|
93
|
+
|
|
94
|
+
GitHub Actions:
|
|
95
|
+
|
|
96
|
+
- **CI** (`.github/workflows/ci.yml`) — format, lint, tests on Python 3.11–3.13
|
|
97
|
+
- **Release** (`.github/workflows/release.yml`) — on GitHub Release publish, builds and uploads to PyPI via trusted publishing (skips if the `VERSION` already exists)
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "soothe-client-python"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = "WebSocket client + appkit for soothe-daemon (Python)"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = { text = "MIT" }
|
|
11
|
+
requires-python = ">=3.11,<3.15"
|
|
12
|
+
keywords = ["soothe", "client", "websocket", "agents", "ai"]
|
|
13
|
+
classifiers = [
|
|
14
|
+
"Development Status :: 4 - Beta",
|
|
15
|
+
"Intended Audience :: Developers",
|
|
16
|
+
"License :: OSI Approved :: MIT License",
|
|
17
|
+
"Programming Language :: Python :: 3",
|
|
18
|
+
"Programming Language :: Python :: 3.11",
|
|
19
|
+
"Programming Language :: Python :: 3.12",
|
|
20
|
+
"Programming Language :: Python :: 3.13",
|
|
21
|
+
"Programming Language :: Python :: 3.14",
|
|
22
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
23
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
24
|
+
]
|
|
25
|
+
dependencies = [
|
|
26
|
+
"soothe-sdk>=0.5.25,<1.0.0",
|
|
27
|
+
"pydantic>=2.0.0,<3.0.0",
|
|
28
|
+
"websockets>=12.0",
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
[project.optional-dependencies]
|
|
32
|
+
image = [
|
|
33
|
+
"pillow>=10.0.0",
|
|
34
|
+
]
|
|
35
|
+
dev = [
|
|
36
|
+
"pytest>=8.0.0",
|
|
37
|
+
"pytest-asyncio>=1.3.0",
|
|
38
|
+
"pytest-cov",
|
|
39
|
+
"ruff>=0.12.0",
|
|
40
|
+
"mypy>=1.0.0",
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
[project.urls]
|
|
44
|
+
Homepage = "https://github.com/mirasoth/soothe-client-python"
|
|
45
|
+
Documentation = "https://soothe.readthedocs.io"
|
|
46
|
+
Repository = "https://github.com/mirasoth/soothe-client-python"
|
|
47
|
+
|
|
48
|
+
[tool.hatch.build.targets.wheel]
|
|
49
|
+
packages = ["src/soothe_client"]
|
|
50
|
+
|
|
51
|
+
[tool.hatch.build.targets.sdist]
|
|
52
|
+
include = ["src/soothe_client/"]
|
|
53
|
+
exclude = [
|
|
54
|
+
"**/__pycache__",
|
|
55
|
+
"**/*.pyc",
|
|
56
|
+
"**/*.pyo",
|
|
57
|
+
]
|
|
58
|
+
|
|
59
|
+
[tool.ruff]
|
|
60
|
+
line-length = 100
|
|
61
|
+
target-version = "py311"
|
|
62
|
+
|
|
63
|
+
[tool.ruff.lint]
|
|
64
|
+
select = ["E", "F", "I", "N", "W", "UP"]
|
|
65
|
+
ignore = ["E501"]
|
|
66
|
+
|
|
67
|
+
[tool.ruff.format]
|
|
68
|
+
docstring-code-format = true
|
|
69
|
+
|
|
70
|
+
[tool.hatch.version]
|
|
71
|
+
path = "VERSION"
|
|
72
|
+
pattern = "^(?P<version>[0-9]+\\.[0-9]+\\.[0-9]+)$"
|
|
73
|
+
|
|
74
|
+
[tool.mypy]
|
|
75
|
+
python_version = "3.12"
|
|
76
|
+
warn_return_any = true
|
|
77
|
+
warn_unused_configs = true
|
|
78
|
+
disallow_untyped_defs = true
|
|
79
|
+
|
|
80
|
+
[tool.pytest.ini_options]
|
|
81
|
+
asyncio_mode = "auto"
|
|
82
|
+
testpaths = ["tests", "examples"]
|
|
83
|
+
addopts = "--import-mode=importlib"
|