soothe-client-python 0.9.10__tar.gz → 0.10.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.
Files changed (33) hide show
  1. {soothe_client_python-0.9.10 → soothe_client_python-0.10.0}/PKG-INFO +4 -4
  2. {soothe_client_python-0.9.10 → soothe_client_python-0.10.0}/README.md +3 -3
  3. soothe_client_python-0.10.0/src/soothe_client/__init__.py +104 -0
  4. soothe_client_python-0.9.10/src/soothe_client/ws_command_client.py → soothe_client_python-0.10.0/src/soothe_client/command_client.py +15 -38
  5. {soothe_client_python-0.9.10 → soothe_client_python-0.10.0}/src/soothe_client/helpers.py +1 -1
  6. soothe_client_python-0.9.10/src/soothe_client/__init__.py +0 -189
  7. {soothe_client_python-0.9.10 → soothe_client_python-0.10.0}/.gitignore +0 -0
  8. {soothe_client_python-0.9.10 → soothe_client_python-0.10.0}/LICENSE +0 -0
  9. {soothe_client_python-0.9.10 → soothe_client_python-0.10.0}/pyproject.toml +0 -0
  10. {soothe_client_python-0.9.10 → soothe_client_python-0.10.0}/src/soothe_client/appkit/__init__.py +0 -0
  11. {soothe_client_python-0.9.10 → soothe_client_python-0.10.0}/src/soothe_client/appkit/attachments.py +0 -0
  12. {soothe_client_python-0.9.10 → soothe_client_python-0.10.0}/src/soothe_client/appkit/broadcaster.py +0 -0
  13. {soothe_client_python-0.9.10 → soothe_client_python-0.10.0}/src/soothe_client/appkit/chunk_filter.py +0 -0
  14. {soothe_client_python-0.9.10 → soothe_client_python-0.10.0}/src/soothe_client/appkit/classifier.py +0 -0
  15. {soothe_client_python-0.9.10 → soothe_client_python-0.10.0}/src/soothe_client/appkit/daemon_session.py +0 -0
  16. {soothe_client_python-0.9.10 → soothe_client_python-0.10.0}/src/soothe_client/appkit/events.py +0 -0
  17. {soothe_client_python-0.9.10 → soothe_client_python-0.10.0}/src/soothe_client/appkit/managed_client.py +0 -0
  18. {soothe_client_python-0.9.10 → soothe_client_python-0.10.0}/src/soothe_client/appkit/observability.py +0 -0
  19. {soothe_client_python-0.9.10 → soothe_client_python-0.10.0}/src/soothe_client/appkit/pool.py +0 -0
  20. {soothe_client_python-0.9.10 → soothe_client_python-0.10.0}/src/soothe_client/appkit/query_gate.py +0 -0
  21. {soothe_client_python-0.9.10 → soothe_client_python-0.10.0}/src/soothe_client/appkit/session_store.py +0 -0
  22. {soothe_client_python-0.9.10 → soothe_client_python-0.10.0}/src/soothe_client/appkit/thinking_step.py +0 -0
  23. {soothe_client_python-0.9.10 → soothe_client_python-0.10.0}/src/soothe_client/appkit/turn.py +0 -0
  24. {soothe_client_python-0.9.10 → soothe_client_python-0.10.0}/src/soothe_client/appkit/turn_runner.py +0 -0
  25. {soothe_client_python-0.9.10 → soothe_client_python-0.10.0}/src/soothe_client/errors.py +0 -0
  26. {soothe_client_python-0.9.10 → soothe_client_python-0.10.0}/src/soothe_client/intent_hints.py +0 -0
  27. {soothe_client_python-0.9.10 → soothe_client_python-0.10.0}/src/soothe_client/protocol_params.py +0 -0
  28. {soothe_client_python-0.9.10 → soothe_client_python-0.10.0}/src/soothe_client/py.typed +0 -0
  29. {soothe_client_python-0.9.10 → soothe_client_python-0.10.0}/src/soothe_client/schemas.py +0 -0
  30. {soothe_client_python-0.9.10 → soothe_client_python-0.10.0}/src/soothe_client/session.py +0 -0
  31. {soothe_client_python-0.9.10 → soothe_client_python-0.10.0}/src/soothe_client/stream_terminal.py +0 -0
  32. {soothe_client_python-0.9.10 → soothe_client_python-0.10.0}/src/soothe_client/turn_boundary.py +0 -0
  33. {soothe_client_python-0.9.10 → soothe_client_python-0.10.0}/src/soothe_client/websocket.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: soothe-client-python
3
- Version: 0.9.10
3
+ Version: 0.10.0
4
4
  Summary: WebSocket client + appkit for soothe-daemon (Python)
5
5
  Project-URL: Homepage, https://github.com/mirasoth/soothe-client-python
6
6
  Project-URL: Documentation, https://soothe.readthedocs.io
@@ -70,12 +70,12 @@ More patterns: [`examples/`](examples/) (hello → streaming → multi-turn →
70
70
  | Need | Use |
71
71
  |------|-----|
72
72
  | One conversation, stream replies | `DaemonSession` (`soothe_client.appkit`) |
73
- | Jobs / cron (async) | `AsyncCommandClient` (alias of `WsCommandClient`) |
74
- | Jobs / cron (scripts / sync) | `CommandClient` (alias of `SyncWsCommandClient`) |
73
+ | Jobs / cron (async) | `AsyncCommandClient` |
74
+ | Jobs / cron (scripts / sync) | `CommandClient` |
75
75
  | Raw WebSocket / custom RPCs | `WebSocketClient` |
76
76
  | Many users / HTTP backend | `ConnectionPool` + `TurnRunner` |
77
77
 
78
- Wire request param models live in `soothe_client.protocol_params` (not at package root).
78
+ Wire request param models: `soothe_client.protocol_params`.
79
79
 
80
80
  ## Develop
81
81
 
@@ -37,12 +37,12 @@ More patterns: [`examples/`](examples/) (hello → streaming → multi-turn →
37
37
  | Need | Use |
38
38
  |------|-----|
39
39
  | One conversation, stream replies | `DaemonSession` (`soothe_client.appkit`) |
40
- | Jobs / cron (async) | `AsyncCommandClient` (alias of `WsCommandClient`) |
41
- | Jobs / cron (scripts / sync) | `CommandClient` (alias of `SyncWsCommandClient`) |
40
+ | Jobs / cron (async) | `AsyncCommandClient` |
41
+ | Jobs / cron (scripts / sync) | `CommandClient` |
42
42
  | Raw WebSocket / custom RPCs | `WebSocketClient` |
43
43
  | Many users / HTTP backend | `ConnectionPool` + `TurnRunner` |
44
44
 
45
- Wire request param models live in `soothe_client.protocol_params` (not at package root).
45
+ Wire request param models: `soothe_client.protocol_params`.
46
46
 
47
47
  ## Develop
48
48
 
@@ -0,0 +1,104 @@
1
+ """Soothe WebSocket client for talking to a running soothe-daemon.
2
+
3
+ Public surface::
4
+
5
+ from soothe_client import WebSocketClient, is_daemon_live
6
+ from soothe_client import AsyncCommandClient, CommandClient
7
+ from soothe_client.appkit import DaemonSession
8
+
9
+ Wire request param models: ``soothe_client.protocol_params``.
10
+ Session / multi-user helpers: ``soothe_client.appkit``.
11
+ """
12
+
13
+ from __future__ import annotations
14
+
15
+ import importlib.metadata
16
+
17
+ from soothe_sdk.wire.codec import ProtocolError
18
+
19
+ from soothe_client.command_client import (
20
+ AsyncCommandClient,
21
+ CommandClient,
22
+ async_command_client_from_config,
23
+ command_client_from_config,
24
+ )
25
+ from soothe_client.errors import (
26
+ DaemonError,
27
+ DisconnectCause,
28
+ ReconnectError,
29
+ StaleLoopError,
30
+ disconnect_cause_name,
31
+ )
32
+ from soothe_client.helpers import (
33
+ check_daemon_status,
34
+ connected_websocket,
35
+ fetch_config_section,
36
+ fetch_loop_cards,
37
+ fetch_loop_history,
38
+ fetch_loop_messages,
39
+ fetch_skills_catalog,
40
+ is_daemon_live,
41
+ protocol1_rpc,
42
+ request_daemon_config_reload,
43
+ request_daemon_shutdown,
44
+ websocket_url_from_config,
45
+ )
46
+ from soothe_client.intent_hints import (
47
+ DEFAULT_DELIVERABLE_PHASES,
48
+ EMBED,
49
+ IMAGE_TO_TEXT,
50
+ OCR,
51
+ TEXT_COMPLETION,
52
+ validate_loop_input_intent_hint,
53
+ )
54
+ from soothe_client.session import (
55
+ bootstrap_loop_session,
56
+ connect_websocket_with_retries,
57
+ )
58
+ from soothe_client.websocket import WebSocketClient
59
+
60
+ try:
61
+ __version__ = importlib.metadata.version("soothe-client-python")
62
+ except importlib.metadata.PackageNotFoundError:
63
+ __version__ = "0.0.0"
64
+
65
+ __all__ = [
66
+ "__version__",
67
+ # Transport
68
+ "WebSocketClient",
69
+ "ProtocolError",
70
+ # Errors
71
+ "DaemonError",
72
+ "DisconnectCause",
73
+ "ReconnectError",
74
+ "StaleLoopError",
75
+ "disconnect_cause_name",
76
+ # Command clients
77
+ "AsyncCommandClient",
78
+ "CommandClient",
79
+ "command_client_from_config",
80
+ "async_command_client_from_config",
81
+ # Session bootstrap
82
+ "bootstrap_loop_session",
83
+ "connect_websocket_with_retries",
84
+ # Helpers
85
+ "websocket_url_from_config",
86
+ "connected_websocket",
87
+ "protocol1_rpc",
88
+ "check_daemon_status",
89
+ "is_daemon_live",
90
+ "request_daemon_config_reload",
91
+ "request_daemon_shutdown",
92
+ "fetch_skills_catalog",
93
+ "fetch_config_section",
94
+ "fetch_loop_history",
95
+ "fetch_loop_cards",
96
+ "fetch_loop_messages",
97
+ # Intent hints
98
+ "TEXT_COMPLETION",
99
+ "IMAGE_TO_TEXT",
100
+ "OCR",
101
+ "EMBED",
102
+ "DEFAULT_DELIVERABLE_PHASES",
103
+ "validate_loop_input_intent_hint",
104
+ ]
@@ -1,8 +1,6 @@
1
- """WebSocket command client for daemon command endpoints.
1
+ """Async and sync daemon command clients (jobs, autopilot, cron).
2
2
 
3
- Provides synchronous and async clients for sending commands over WebSocket
4
- and receiving responses. Replaces HTTP REST clients for autopilot, cron,
5
- and memory profiling operations.
3
+ ``AsyncCommandClient`` for asyncio; ``CommandClient`` for scripts/CLI.
6
4
  """
7
5
 
8
6
  from __future__ import annotations
@@ -162,14 +160,11 @@ _MEMORY_COMMANDS = {
162
160
  }
163
161
 
164
162
 
165
- class WsCommandClient:
163
+ class AsyncCommandClient:
166
164
  """Async client for one-shot daemon RPCs (jobs, autopilot, cron).
167
165
 
168
166
  Prefer this for asyncio apps. For scripts/CLI without an event loop, use
169
- ``SyncWsCommandClient`` (alias ``CommandClient``). For streaming agent
170
- turns, use ``DaemonSession`` instead.
171
-
172
- Preferred community alias: ``AsyncCommandClient``.
167
+ ``CommandClient``. For streaming agent turns, use ``DaemonSession`` instead.
173
168
 
174
169
  Job lifecycle uses ``job_*`` methods. Autopilot goal helpers use
175
170
  ``autopilot_*``. ``job_cancel`` cancels a root job and its descendants;
@@ -177,7 +172,7 @@ class WsCommandClient:
177
172
 
178
173
  Example::
179
174
 
180
- client = WsCommandClient("ws://127.0.0.1:8765")
175
+ client = AsyncCommandClient("ws://127.0.0.1:8765")
181
176
  created = await client.job_create("Summarize the README")
182
177
  await client.job_cancel(created["job_id"])
183
178
 
@@ -416,11 +411,10 @@ class WsCommandClient:
416
411
  return await self._send_command("memory_stats", {"mode": mode})
417
412
 
418
413
 
419
- class SyncWsCommandClient:
420
- """Synchronous wrapper around ``WsCommandClient`` for scripts and CLI.
414
+ class CommandClient:
415
+ """Synchronous wrapper around ``AsyncCommandClient`` for scripts and CLI.
421
416
 
422
- Preferred community alias: ``CommandClient``. Each method opens a short
423
- WebSocket RPC (same behavior as the async client).
417
+ Each method opens a short-lived WebSocket RPC (same behavior as async).
424
418
 
425
419
  Args:
426
420
  ws_url: Daemon WebSocket URL.
@@ -428,7 +422,7 @@ class SyncWsCommandClient:
428
422
  """
429
423
 
430
424
  def __init__(self, ws_url: str, *, timeout: float = 30.0) -> None:
431
- self._client = WsCommandClient(ws_url, timeout=timeout)
425
+ self._client = AsyncCommandClient(ws_url, timeout=timeout)
432
426
 
433
427
  def _run_async(self, coro: Any) -> Any:
434
428
  """Run an async coroutine from sync code."""
@@ -581,38 +575,21 @@ class SyncWsCommandClient:
581
575
  return cast(dict[str, Any], self._run_async(self._client.memory_stats(mode)))
582
576
 
583
577
 
584
- def ws_command_client_from_config(cfg: Any) -> SyncWsCommandClient:
585
- """Build a sync command client from soothe/CLI config (host/port).
586
-
587
- Preferred alias: ``command_client_from_config``.
588
- """
578
+ def command_client_from_config(cfg: Any) -> CommandClient:
579
+ """Build a sync command client from soothe/CLI config (host/port)."""
589
580
  ws_url = websocket_url_from_config(cfg)
590
- return SyncWsCommandClient(ws_url)
591
-
581
+ return CommandClient(ws_url)
592
582
 
593
- def async_ws_command_client_from_config(cfg: Any) -> WsCommandClient:
594
- """Build an async command client from soothe/CLI config (host/port).
595
583
 
596
- Preferred alias: ``async_command_client_from_config``.
597
- """
584
+ def async_command_client_from_config(cfg: Any) -> AsyncCommandClient:
585
+ """Build an async command client from soothe/CLI config (host/port)."""
598
586
  ws_url = websocket_url_from_config(cfg)
599
- return WsCommandClient(ws_url)
587
+ return AsyncCommandClient(ws_url)
600
588
 
601
589
 
602
590
  __all__ = [
603
- "WsCommandClient",
604
- "SyncWsCommandClient",
605
591
  "AsyncCommandClient",
606
592
  "CommandClient",
607
- "ws_command_client_from_config",
608
- "async_ws_command_client_from_config",
609
593
  "command_client_from_config",
610
594
  "async_command_client_from_config",
611
595
  ]
612
-
613
-
614
- # Preferred community names (aliases; wire method names unchanged).
615
- AsyncCommandClient = WsCommandClient
616
- CommandClient = SyncWsCommandClient
617
- command_client_from_config = ws_command_client_from_config
618
- async_command_client_from_config = async_ws_command_client_from_config
@@ -1,7 +1,7 @@
1
1
  """Small WebSocket helpers for CLI and scripts (status, fetch, one-shot RPC).
2
2
 
3
3
  For interactive turns use ``DaemonSession``. For jobs/cron use
4
- ``WsCommandClient`` / ``CommandClient``.
4
+ ``AsyncCommandClient`` / ``CommandClient``.
5
5
  """
6
6
 
7
7
  from __future__ import annotations
@@ -1,189 +0,0 @@
1
- """Soothe WebSocket client for talking to a running soothe-daemon.
2
-
3
- Public surface (community apps)::
4
-
5
- from soothe_client import WebSocketClient, is_daemon_live
6
- from soothe_client.appkit import DaemonSession
7
- from soothe_client import AsyncCommandClient, CommandClient # preferred aliases
8
-
9
- Advanced wire validation lives in ``soothe_client.protocol_params``.
10
- Higher-level session / multi-user helpers live in ``soothe_client.appkit``.
11
- """
12
-
13
- from __future__ import annotations
14
-
15
- import importlib.metadata
16
- import warnings
17
- from typing import Any
18
-
19
- from soothe_sdk.wire.codec import ProtocolError
20
-
21
- from soothe_client.errors import (
22
- DaemonError,
23
- DisconnectCause,
24
- ReconnectError,
25
- StaleLoopError,
26
- disconnect_cause_name,
27
- )
28
- from soothe_client.helpers import (
29
- check_daemon_status,
30
- connected_websocket,
31
- fetch_config_section,
32
- fetch_loop_cards,
33
- fetch_loop_history,
34
- fetch_loop_messages,
35
- fetch_skills_catalog,
36
- is_daemon_live,
37
- protocol1_rpc,
38
- request_daemon_config_reload,
39
- request_daemon_shutdown,
40
- websocket_url_from_config,
41
- )
42
- from soothe_client.intent_hints import (
43
- DEFAULT_DELIVERABLE_PHASES,
44
- EMBED,
45
- IMAGE_TO_TEXT,
46
- OCR,
47
- TEXT_COMPLETION,
48
- validate_loop_input_intent_hint,
49
- )
50
- from soothe_client.session import (
51
- bootstrap_loop_session,
52
- connect_websocket_with_retries,
53
- )
54
- from soothe_client.websocket import WebSocketClient
55
- from soothe_client.ws_command_client import (
56
- AsyncCommandClient,
57
- CommandClient,
58
- SyncWsCommandClient,
59
- WsCommandClient,
60
- async_command_client_from_config,
61
- async_ws_command_client_from_config,
62
- command_client_from_config,
63
- ws_command_client_from_config,
64
- )
65
-
66
- try:
67
- __version__ = importlib.metadata.version("soothe-client-python")
68
- except importlib.metadata.PackageNotFoundError:
69
- __version__ = "0.0.0"
70
-
71
- # Legacy ``*Params`` names formerly re-exported at package root.
72
- _LEGACY_PARAM_NAMES = frozenset(
73
- {
74
- "AuthParams",
75
- "AuthRefreshParams",
76
- "AutopilotCancelAllParams",
77
- "AutopilotCancelGoalParams",
78
- "AutopilotDreamParams",
79
- "AutopilotGetGoalParams",
80
- "AutopilotGetJobParams",
81
- "AutopilotListGoalsParams",
82
- "AutopilotListJobsParams",
83
- "AutopilotResumeParams",
84
- "AutopilotStatusParams",
85
- "AutopilotSubmitParams",
86
- "AutopilotSubscribeParams",
87
- "AutopilotWakeParams",
88
- "ConfigGetParams",
89
- "ConfigReloadParams",
90
- "CronAddParams",
91
- "CronCancelParams",
92
- "CronListParams",
93
- "CronShowParams",
94
- "DaemonShutdownParams",
95
- "DaemonStatusParams",
96
- "DisconnectParams",
97
- "InvokeSkillParams",
98
- "JobCancelParams",
99
- "JobCreateParams",
100
- "JobDagParams",
101
- "JobGuidanceParams",
102
- "JobPauseParams",
103
- "JobResumeParams",
104
- "JobStatusParams",
105
- "LoopCardsFetchParams",
106
- "LoopDeleteParams",
107
- "LoopDetachParams",
108
- "LoopGetParams",
109
- "LoopInputParams",
110
- "LoopListParams",
111
- "LoopMessagesParams",
112
- "LoopNewParams",
113
- "LoopPruneParams",
114
- "LoopReattachParams",
115
- "LoopStateGetParams",
116
- "LoopStateUpdateParams",
117
- "LoopTreeParams",
118
- "McpStatusParams",
119
- "ModelsListParams",
120
- "RpcCommandParams",
121
- "SkillsListParams",
122
- "SlashCommandParams",
123
- "SubscribeParams",
124
- }
125
- )
126
-
127
- __all__ = [
128
- "__version__",
129
- # Transport
130
- "WebSocketClient",
131
- "ProtocolError",
132
- # Errors
133
- "DaemonError",
134
- "DisconnectCause",
135
- "ReconnectError",
136
- "StaleLoopError",
137
- "disconnect_cause_name",
138
- # Command clients (canonical + preferred aliases)
139
- "WsCommandClient",
140
- "SyncWsCommandClient",
141
- "AsyncCommandClient",
142
- "CommandClient",
143
- "ws_command_client_from_config",
144
- "async_ws_command_client_from_config",
145
- "command_client_from_config",
146
- "async_command_client_from_config",
147
- # Session bootstrap
148
- "bootstrap_loop_session",
149
- "connect_websocket_with_retries",
150
- # Helpers
151
- "websocket_url_from_config",
152
- "connected_websocket",
153
- "protocol1_rpc",
154
- "check_daemon_status",
155
- "is_daemon_live",
156
- "request_daemon_config_reload",
157
- "request_daemon_shutdown",
158
- "fetch_skills_catalog",
159
- "fetch_config_section",
160
- "fetch_loop_history",
161
- "fetch_loop_cards",
162
- "fetch_loop_messages",
163
- # Intent hints
164
- "TEXT_COMPLETION",
165
- "IMAGE_TO_TEXT",
166
- "OCR",
167
- "EMBED",
168
- "DEFAULT_DELIVERABLE_PHASES",
169
- "validate_loop_input_intent_hint",
170
- ]
171
-
172
-
173
- def __getattr__(name: str) -> Any:
174
- """Lazy-load legacy ``*Params`` with a deprecation warning.
175
-
176
- Prefer ``from soothe_client.protocol_params import LoopInputParams``.
177
- """
178
- if name in _LEGACY_PARAM_NAMES:
179
- warnings.warn(
180
- f"Importing {name!r} from soothe_client is deprecated; "
181
- f"use soothe_client.protocol_params.{name} instead.",
182
- DeprecationWarning,
183
- stacklevel=2,
184
- )
185
- from soothe_client import protocol_params as _params
186
-
187
- return getattr(_params, name)
188
- msg = f"module {__name__!r} has no attribute {name!r}"
189
- raise AttributeError(msg)