@sleds/cli 0.1.4 → 0.1.6
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/dist/sleds.mjs +18 -8
- package/package.json +1 -1
package/dist/sleds.mjs
CHANGED
|
@@ -1473,13 +1473,17 @@ function normalizeProxyUrl(raw) {
|
|
|
1473
1473
|
return null;
|
|
1474
1474
|
}
|
|
1475
1475
|
}
|
|
1476
|
-
async function probeProxy(url, fetchFn = fetch) {
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1476
|
+
async function probeProxy(url, fetchFn = fetch, opts = {}) {
|
|
1477
|
+
const tries = opts.tries ?? 2;
|
|
1478
|
+
const timeoutMs = opts.timeoutMs ?? 1e4;
|
|
1479
|
+
for (let i = 0;i < tries; i++) {
|
|
1480
|
+
try {
|
|
1481
|
+
const res = await fetchFn(`${url}/healthz`, { signal: AbortSignal.timeout(timeoutMs) });
|
|
1482
|
+
if (res.ok)
|
|
1483
|
+
return true;
|
|
1484
|
+
} catch {}
|
|
1482
1485
|
}
|
|
1486
|
+
return false;
|
|
1483
1487
|
}
|
|
1484
1488
|
var resolveToken = async (o) => {
|
|
1485
1489
|
const env = o.env ?? process.env;
|
|
@@ -1537,7 +1541,7 @@ var init = async (o) => {
|
|
|
1537
1541
|
return 2;
|
|
1538
1542
|
}
|
|
1539
1543
|
if (!o.noProbe && !await probeProxy(url, o.fetchFn)) {
|
|
1540
|
-
error(`No SLEDS proxy answered at ${url}/
|
|
1544
|
+
error(`No SLEDS proxy answered at ${url}/healthz. Check the URL (or pass --no-probe to save it anyway).`);
|
|
1541
1545
|
return 2;
|
|
1542
1546
|
}
|
|
1543
1547
|
const wrote = [];
|
|
@@ -3238,7 +3242,7 @@ commands:
|
|
|
3238
3242
|
init Point Claude Code at a SLEDS proxy, install the /sled skill and the status line.
|
|
3239
3243
|
--token <sled_\u2026> seat token (else SLEDS_TOKEN, ~/.sleds-token, or prompt)
|
|
3240
3244
|
--url <proxy-url> proxy base URL (else SLEDS_PROXY_URL, default ${DEFAULT_PROXY_URL})
|
|
3241
|
-
--no-probe skip the /
|
|
3245
|
+
--no-probe skip the /healthz check of the proxy URL
|
|
3242
3246
|
--non-interactive never prompt; exit 2 if no token is available
|
|
3243
3247
|
--signup no org? create an individual seat: your email + your own
|
|
3244
3248
|
Anthropic API key (validated, stored encrypted, the only key it spends)
|
|
@@ -3268,6 +3272,7 @@ commands:
|
|
|
3268
3272
|
seat-event Claude Code hook: record a seat wall and say how to continue. Reads hook JSON on stdin.
|
|
3269
3273
|
spec-event Claude Code PostToolUse hook: when a spec-shaped markdown file is written, size it
|
|
3270
3274
|
(POST /proxy/estimate with the file path as the project). Silent unless it estimates.
|
|
3275
|
+
--version Print the CLI version.
|
|
3271
3276
|
--help Show this message.
|
|
3272
3277
|
|
|
3273
3278
|
env:
|
|
@@ -3376,6 +3381,11 @@ var main = async (argv) => {
|
|
|
3376
3381
|
case "-h":
|
|
3377
3382
|
console.log(USAGE);
|
|
3378
3383
|
return 0;
|
|
3384
|
+
case "version":
|
|
3385
|
+
case "--version":
|
|
3386
|
+
case "-v":
|
|
3387
|
+
console.log(`sleds ${"0.1.6"}`);
|
|
3388
|
+
return 0;
|
|
3379
3389
|
default:
|
|
3380
3390
|
console.error(`unknown command: ${cmd}
|
|
3381
3391
|
`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sleds/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "SLEDS CLI — the cost and limits of AI agent work, decided at the wall. Point Claude Code at a SLEDS proxy; estimate before you run; hold, switch model, or run overnight when you hit a limit.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|