@sleds/cli 0.1.39 → 0.1.40
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 +30 -10
- package/package.json +1 -1
package/dist/sleds.mjs
CHANGED
|
@@ -10160,6 +10160,10 @@ var cmuxProbeReason = (r) => {
|
|
|
10160
10160
|
};
|
|
10161
10161
|
var cmuxAuthRefused = (r) => r.status !== 0 && /\b(auth_required|unauthorized|authentication required|invalid password)\b/i.test(`${r.stderr}
|
|
10162
10162
|
${r.stdout}`);
|
|
10163
|
+
var cmuxNeedsForce = (r) => r.status !== 0 && /\bconfirmation_required\b|--force\b/i.test(`${r.stderr}
|
|
10164
|
+
${r.stdout}`);
|
|
10165
|
+
var CMUX_LIST_TRIES = 20;
|
|
10166
|
+
var CMUX_LIST_WAIT_MS = 250;
|
|
10163
10167
|
var CMUX_SETTLE_MS = 300;
|
|
10164
10168
|
var CMUX_ENTER_RETRIES = 2;
|
|
10165
10169
|
var PROMPT_LINE = /^[\s│|]*[>❯›]\s?(.*)$/;
|
|
@@ -10213,6 +10217,12 @@ function cmuxRunner(exec, deps = {}) {
|
|
|
10213
10217
|
return pw ? run(args) : r;
|
|
10214
10218
|
};
|
|
10215
10219
|
const failed = cmuxFailure;
|
|
10220
|
+
const closeWorkspace = (id) => {
|
|
10221
|
+
const c = cmux(["close-workspace", "--workspace", id]);
|
|
10222
|
+
if (!cmuxNeedsForce(c))
|
|
10223
|
+
return c.status === 0;
|
|
10224
|
+
return cmux(["close-workspace", "--workspace", id, "--force"]).status === 0;
|
|
10225
|
+
};
|
|
10216
10226
|
return {
|
|
10217
10227
|
name: "cmux",
|
|
10218
10228
|
makesWorktree: false,
|
|
@@ -10252,19 +10262,29 @@ function cmuxRunner(exec, deps = {}) {
|
|
|
10252
10262
|
const why = failed(r);
|
|
10253
10263
|
const l = cmux(["--id-format", "both", "list-workspaces"]);
|
|
10254
10264
|
const stray = l.status === 0 ? cmuxIdForName(l.stdout, o.name) : null;
|
|
10255
|
-
const left = l.status !== 0 || (stray ?
|
|
10265
|
+
const left = l.status !== 0 || (stray ? !closeWorkspace(stray) : namedLines(l.stdout, o.name).length > 0);
|
|
10256
10266
|
throw new Error(`cmux workspace create ${o.name} failed: ${why}${left ? `; ${UNWATCHED}` : ""}`);
|
|
10257
10267
|
}
|
|
10258
10268
|
let id = parseCmuxWorkspace(r.stdout);
|
|
10259
10269
|
const ref = id ? null : parseCmuxRef(r.stdout);
|
|
10260
10270
|
let closed = false;
|
|
10261
10271
|
if (ref) {
|
|
10262
|
-
|
|
10263
|
-
|
|
10264
|
-
|
|
10265
|
-
|
|
10272
|
+
let listed = null;
|
|
10273
|
+
for (let i = 0;i < CMUX_LIST_TRIES; i++) {
|
|
10274
|
+
if (i > 0)
|
|
10275
|
+
sleep(CMUX_LIST_WAIT_MS);
|
|
10276
|
+
const l = cmux(["--id-format", "both", "list-workspaces"]);
|
|
10277
|
+
if (l.status !== 0)
|
|
10278
|
+
continue;
|
|
10279
|
+
listed = l.stdout;
|
|
10280
|
+
if (namedLines(l.stdout, o.name).length > 0)
|
|
10281
|
+
break;
|
|
10282
|
+
}
|
|
10283
|
+
if (listed !== null) {
|
|
10284
|
+
id = cmuxIdForRef(listed, ref, o.name);
|
|
10285
|
+
const stray = id ? null : cmuxIdForName(listed, o.name);
|
|
10266
10286
|
if (stray)
|
|
10267
|
-
closed =
|
|
10287
|
+
closed = closeWorkspace(stray);
|
|
10268
10288
|
}
|
|
10269
10289
|
}
|
|
10270
10290
|
if (!id) {
|
|
@@ -10402,7 +10422,7 @@ function beatBody(state, flags, host = {}, cap = {}) {
|
|
|
10402
10422
|
name: flags.name,
|
|
10403
10423
|
os: host.os ?? process.platform,
|
|
10404
10424
|
runner: flags.runner,
|
|
10405
|
-
version: host.version ?? "0.1.
|
|
10425
|
+
version: host.version ?? "0.1.40" ?? "dev",
|
|
10406
10426
|
running: live.length,
|
|
10407
10427
|
items: live.slice(0, BEAT_ITEMS).map((r) => `${r.item}/${r.node}`),
|
|
10408
10428
|
...cap.atOnce !== undefined ? { atOnce: cap.atOnce } : {},
|
|
@@ -16250,7 +16270,7 @@ async function driveEngine(o, flags, deps, until = {}) {
|
|
|
16250
16270
|
runner: deps.runner.name,
|
|
16251
16271
|
atOnce: flags.atOnce,
|
|
16252
16272
|
interval: flags.interval,
|
|
16253
|
-
cliVersion: "0.1.
|
|
16273
|
+
cliVersion: "0.1.40"
|
|
16254
16274
|
};
|
|
16255
16275
|
const beat = (checkedAt) => {
|
|
16256
16276
|
const m = deps.machine;
|
|
@@ -18303,7 +18323,7 @@ async function driveEngine2(o, flags, deps, until = {}) {
|
|
|
18303
18323
|
runner: deps.runner.name,
|
|
18304
18324
|
atOnce: flags.atOnce,
|
|
18305
18325
|
interval: flags.interval,
|
|
18306
|
-
cliVersion: "0.1.
|
|
18326
|
+
cliVersion: "0.1.40"
|
|
18307
18327
|
};
|
|
18308
18328
|
const beat = (checkedAt) => {
|
|
18309
18329
|
const m = deps.machine;
|
|
@@ -24763,7 +24783,7 @@ ${renderHelpText(argv[1])}`);
|
|
|
24763
24783
|
case "version":
|
|
24764
24784
|
case "--version":
|
|
24765
24785
|
case "-v":
|
|
24766
|
-
console.log("sleds 0.1.
|
|
24786
|
+
console.log("sleds 0.1.40");
|
|
24767
24787
|
return 0;
|
|
24768
24788
|
default:
|
|
24769
24789
|
console.error(`unknown command: ${cmd}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sleds/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.40",
|
|
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",
|