routstrd 0.4.11 → 0.4.12
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/README.md +22 -1
- package/SKILL.md +29 -4
- package/dist/daemon/index.js +93713 -72282
- package/dist/index.js +65080 -43216
- package/package.json +2 -2
- package/src/cli.ts +358 -23
- package/src/daemon/http/index.ts +318 -27
- package/src/daemon/http/request-path.ts +39 -0
- package/src/daemon/index.ts +1 -1
- package/src/daemon/models.ts +46 -11
- package/src/daemon/wallet/auto-refill.ts +20 -8
- package/src/daemon/wallet/cleanup.ts +16 -2
- package/src/daemon/wallet/coco-client.ts +921 -110
- package/src/daemon/wallet/index.ts +168 -50
- package/src/daemon/wallet/mint-quote-recovery.ts +119 -0
- package/src/daemon/wallet/recovery-probe.ts +312 -0
- package/src/daemon/wallet/recovery-work.ts +45 -0
- package/src/daemon/wallet/testing/fake-mint.ts +347 -0
- package/src/daemon/wallet/trusted-mints.ts +3 -3
- package/src/daemon/wallet/wallet-client.ts +206 -0
- package/src/integrations/pi.ts +53 -3
- package/src/utils/config.ts +3 -2
- package/src/utils/cooldowns.ts +134 -0
- package/src/utils/daemon-client.ts +53 -9
- package/src/utils/history.ts +9 -0
- package/src/utils/with-timeout.ts +21 -0
- package/src/daemon/wallet/cocod-client.ts +0 -505
package/README.md
CHANGED
|
@@ -163,6 +163,12 @@ Stop the daemon:
|
|
|
163
163
|
routstrd stop
|
|
164
164
|
```
|
|
165
165
|
|
|
166
|
+
See which providers/models the router is currently skipping (cooldowns):
|
|
167
|
+
```sh
|
|
168
|
+
routstrd cooldowns
|
|
169
|
+
routstrd cooldowns --json
|
|
170
|
+
```
|
|
171
|
+
|
|
166
172
|
### NPC (Lightning Address)
|
|
167
173
|
|
|
168
174
|
The in-process wallet registers the NPC (npubx.cash) plugin, which gives the
|
|
@@ -194,6 +200,16 @@ The daemon exposes an HTTP server (default port 8008) with the following endpoin
|
|
|
194
200
|
GET /health
|
|
195
201
|
```
|
|
196
202
|
|
|
203
|
+
#### Cooldowns
|
|
204
|
+
```
|
|
205
|
+
GET /cooldowns
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Providers and models the router is currently skipping. Each entry reports its
|
|
209
|
+
scope (`provider` blocks every model on that provider, `model` blocks one),
|
|
210
|
+
when the cooldown started, and when it lifts. Expired entries are filtered out,
|
|
211
|
+
and the cooldown window comes from the SDK (`cooldownDurationMs`).
|
|
212
|
+
|
|
197
213
|
#### Automatic Refresh Settings
|
|
198
214
|
```
|
|
199
215
|
POST /settings/auto-refresh
|
|
@@ -259,7 +275,7 @@ Configuration is stored in `~/.routstrd/config.json`:
|
|
|
259
275
|
"port": 8008,
|
|
260
276
|
"host": "127.0.0.1",
|
|
261
277
|
"provider": null,
|
|
262
|
-
"
|
|
278
|
+
"autoModelPath": false,
|
|
263
279
|
"autoRefresh": { "enabled": true }
|
|
264
280
|
}
|
|
265
281
|
```
|
|
@@ -271,6 +287,11 @@ every 21 minutes. Set it to `false` (or run
|
|
|
271
287
|
refresh manually with `routstrd clients --manual-refresh`. `autoRefresh.intervalMs`
|
|
272
288
|
overrides the 21-minute interval.
|
|
273
289
|
|
|
290
|
+
`autoModelPath` defaults to `false`. Set it to `true` to let the SDK automatically
|
|
291
|
+
choose and pin an advertised model path for `deepseek-v4.1-flash` requests.
|
|
292
|
+
Explicit `x-routstr-model-path` request headers work independently of this
|
|
293
|
+
setting and take precedence. Restart the daemon after changing `autoModelPath`.
|
|
294
|
+
|
|
274
295
|
### Environment Variables
|
|
275
296
|
|
|
276
297
|
- `ROUTSTRD_DIR` - Config directory (default: `~/.routstrd`)
|
package/SKILL.md
CHANGED
|
@@ -121,6 +121,8 @@ Show wallet transaction history.
|
|
|
121
121
|
|--------|---------|-------------|
|
|
122
122
|
| `-n, --limit <number>` | 50 | Number of entries to show |
|
|
123
123
|
| `--offset <number>` | 0 | Number of entries to skip |
|
|
124
|
+
| `-t, --type <type...>` | all | Filter by transaction type (`send`, `receive`, `mint`, `melt`). Repeatable or comma-separated |
|
|
125
|
+
| `-i, --id <id>` | | Show a single transaction by its ID (prints one summary line; add `--verbose` for full details) |
|
|
124
126
|
| `-v, --verbose` | false | Show full details including encoded Cashu tokens |
|
|
125
127
|
| `--json` | false | Output raw JSON with token objects (no encoding) |
|
|
126
128
|
|
|
@@ -165,6 +167,30 @@ routstrd providers enable 0 2 5
|
|
|
165
167
|
|
|
166
168
|
Show all known providers with their stored review events and event IDs.
|
|
167
169
|
|
|
170
|
+
### `routstrd cooldowns`
|
|
171
|
+
|
|
172
|
+
List every provider and model the router is currently skipping because of a
|
|
173
|
+
cooldown. Cooldowns are scoped: a provider-wide entry blocks every model on
|
|
174
|
+
that provider, a model-scoped entry blocks only that model. Entries lift
|
|
175
|
+
automatically once the cooldown window (210s) elapses — nothing needs to be
|
|
176
|
+
cleared by hand.
|
|
177
|
+
|
|
178
|
+
| Option | Default | Description |
|
|
179
|
+
|--------|---------|-------------|
|
|
180
|
+
| `--json` | false | Print the raw daemon response (timestamps and remaining ms per entry) |
|
|
181
|
+
|
|
182
|
+
```
|
|
183
|
+
Cooldowns (210s window)
|
|
184
|
+
|
|
185
|
+
2 active across 2 providers:
|
|
186
|
+
|
|
187
|
+
PROVIDER https://api.nonkycai.com/ expires in 3m 20s
|
|
188
|
+
MODEL https://ai.redsh1ft.com/ deepseek-v4.1-flash expires in 2m 30s
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Reads `GET /cooldowns` from the daemon; a daemon built before this command
|
|
192
|
+
existed has no such endpoint and must be restarted on a newer build.
|
|
193
|
+
|
|
168
194
|
### `routstrd clients`
|
|
169
195
|
|
|
170
196
|
List and manage API clients (subcommand required).
|
|
@@ -298,8 +324,8 @@ Manage routstrd as a system service using PM2, so it survives reboots.
|
|
|
298
324
|
|
|
299
325
|
## Wallet Commands
|
|
300
326
|
|
|
301
|
-
New wallets trust two mints out of the box: `https://mint.
|
|
302
|
-
`https://mint.
|
|
327
|
+
New wallets trust two mints out of the box: `https://mint.minibits.cash/Bitcoin`
|
|
328
|
+
and `https://mint.cubabitcoin.org`. `https://mint.minibits.cash/Bitcoin` is the
|
|
303
329
|
default mint, and the default is used when a wallet command does not include
|
|
304
330
|
`--mint-url`. An existing wallet keeps whatever default it already has; the
|
|
305
331
|
shipped mints are only added as trusted, never as the default. Use
|
|
@@ -376,7 +402,7 @@ Pay a Lightning invoice.
|
|
|
376
402
|
|
|
377
403
|
### `routstrd wallet mints list`
|
|
378
404
|
|
|
379
|
-
List configured wallet mints. Includes the mints trusted by default (`https://mint.
|
|
405
|
+
List configured wallet mints. Includes the mints trusted by default (`https://mint.minibits.cash/Bitcoin`, `https://mint.cubabitcoin.org`) plus any added manually.
|
|
380
406
|
|
|
381
407
|
### `routstrd wallet mints add <url>`
|
|
382
408
|
|
|
@@ -462,7 +488,6 @@ Config file: `~/.routstrd/config.json`
|
|
|
462
488
|
| `port` | number | 8008 | Daemon HTTP port |
|
|
463
489
|
| `host` | string | `"127.0.0.1"` | Bind address |
|
|
464
490
|
| `provider` | string\|null | null | Default provider URL |
|
|
465
|
-
| `cocodPath` | string\|null | null | Custom path to a legacy cocod executable |
|
|
466
491
|
| `mode` | string | `"apikeys"` | Client mode (`apikeys` or `xcashu`) |
|
|
467
492
|
| `maxTokens` | number | 64000 | Completion budget applied when a client sets no output-token limit |
|
|
468
493
|
| `daemonUrl` | string | — | Remote daemon URL (set by `routstrd remote`) |
|