@mirasoth/soothe-client 0.1.0
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.
- package/LICENSE +21 -0
- package/README.md +83 -0
- package/dist/chunk-OMAC7LA7.js +647 -0
- package/dist/chunk-OMAC7LA7.js.map +1 -0
- package/dist/client-QS23U6WX.js +7 -0
- package/dist/client-QS23U6WX.js.map +1 -0
- package/dist/index.cjs +1127 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +497 -0
- package/dist/index.d.ts +497 -0
- package/dist/index.js +383 -0
- package/dist/index.js.map +1 -0
- package/package.json +45 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 OpenSoothe
|
|
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.
|
package/README.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# @mirasoth/soothe-client
|
|
2
|
+
|
|
3
|
+
TypeScript WebSocket client for the [Soothe](https://github.com/mirasoth/soothe) daemon.
|
|
4
|
+
|
|
5
|
+
Provides a typed message protocol, session bootstrap, event helpers, and convenience RPCs for
|
|
6
|
+
interacting with a running `soothe-daemon` from Node.js.
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install @mirasoth/soothe-client
|
|
12
|
+
# or
|
|
13
|
+
pnpm add @mirasoth/soothe-client
|
|
14
|
+
# or
|
|
15
|
+
yarn add @mirasoth/soothe-client
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Requires Node.js `>=19`.
|
|
19
|
+
|
|
20
|
+
## Quick start
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import { Client, bootstrapLoopSession, defaultConfig } from '@mirasoth/soothe-client';
|
|
24
|
+
|
|
25
|
+
const config = defaultConfig();
|
|
26
|
+
const client = new Client(config.daemonURL, config);
|
|
27
|
+
|
|
28
|
+
await client.connect();
|
|
29
|
+
const loopId = await bootstrapLoopSession(client, null, config);
|
|
30
|
+
|
|
31
|
+
client.on('message', (msg) => {
|
|
32
|
+
console.log('event:', msg);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
await client.sendMessage({
|
|
36
|
+
type: 'loop_input',
|
|
37
|
+
loop_id: loopId,
|
|
38
|
+
input: 'hello soothe',
|
|
39
|
+
});
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Configuration
|
|
43
|
+
|
|
44
|
+
`defaultConfig()` returns a `Config` object with sensible defaults. `loadConfigFromEnv()` reads
|
|
45
|
+
overrides from these environment variables:
|
|
46
|
+
|
|
47
|
+
| Variable | Default | Description |
|
|
48
|
+
| ------------------------------------- | ------------------------ | ---------------------------------------- |
|
|
49
|
+
| `SOOTHE_DAEMON_URL` | `ws://localhost:8765` | Daemon WebSocket URL |
|
|
50
|
+
| `SOOTHE_VERBOSITY` | `normal` | `quiet` \| `minimal` \| `normal` \| `detailed` \| `debug` |
|
|
51
|
+
| `SOOTHE_MAX_RETRIES` | `5` | Reconnect attempts |
|
|
52
|
+
| `SOOTHE_DAEMON_READY_TIMEOUT_SEC` | `20` | Daemon-ready handshake timeout (seconds) |
|
|
53
|
+
| `SOOTHE_LOOP_STATUS_TIMEOUT_SEC` | `60` | Loop status wait timeout (seconds) |
|
|
54
|
+
| `SOOTHE_SUBSCRIPTION_TIMEOUT_SEC` | `10` | Subscription confirmation timeout (seconds) |
|
|
55
|
+
|
|
56
|
+
## API surface
|
|
57
|
+
|
|
58
|
+
- **`Client`** — WebSocket session, message I/O, request/response, RPC helpers
|
|
59
|
+
- **`bootstrapLoopSession`**, **`waitDaemonReady`**, **`connectWithRetries`** — session helpers
|
|
60
|
+
- **`checkDaemonStatus`**, **`fetchSkillsCatalog`**, **`fetchConfigSection`** — daemon RPCs
|
|
61
|
+
- **`encodeMessage` / `decodeMessage`** — protocol codec
|
|
62
|
+
- **`Event*` classes** — typed event payloads (plan, explore, tacitus, tool, agent-loop)
|
|
63
|
+
- **`VerbosityTier`**, **`classifyEventVerbosity`** — verbosity filtering
|
|
64
|
+
- **Errors** — `ConnectionError`, `DaemonError`, `TimeoutError`
|
|
65
|
+
|
|
66
|
+
See `dist/index.d.ts` (published) or `src/index.ts` (source) for the full export list.
|
|
67
|
+
|
|
68
|
+
## Development
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
make help # list all targets
|
|
72
|
+
make install # install dependencies
|
|
73
|
+
make build # compile to dist/
|
|
74
|
+
make test # run unit tests
|
|
75
|
+
make verify # full pre-publish verification
|
|
76
|
+
make publish # publish to npm (after verify)
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
See [`Makefile`](./Makefile) for the complete list of targets.
|
|
80
|
+
|
|
81
|
+
## License
|
|
82
|
+
|
|
83
|
+
MIT — see [LICENSE](./LICENSE).
|