@sleds/cli 0.1.4 → 0.1.5

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 (2) hide show
  1. package/dist/sleds.mjs +16 -6
  2. 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
- try {
1478
- const res = await fetchFn(`${url}/health`, { signal: AbortSignal.timeout(3000) });
1479
- return res.ok;
1480
- } catch {
1481
- return false;
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}/health`, { 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;
@@ -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.5"}`);
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.4",
3
+ "version": "0.1.5",
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",