@sleds/cli 0.1.72 → 0.1.73
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 +69 -14
- package/package.json +1 -1
package/dist/sleds.mjs
CHANGED
|
@@ -10189,7 +10189,7 @@ function beatBody(state, flags, host = {}, cap = {}) {
|
|
|
10189
10189
|
name: flags.name,
|
|
10190
10190
|
os: host.os ?? process.platform,
|
|
10191
10191
|
runner: flags.runner,
|
|
10192
|
-
version: host.version ?? "0.1.
|
|
10192
|
+
version: host.version ?? "0.1.73" ?? "dev",
|
|
10193
10193
|
running: live.length,
|
|
10194
10194
|
items: live.slice(0, BEAT_ITEMS).map((r) => `${r.item}/${r.node}`),
|
|
10195
10195
|
...cap.atOnce !== undefined ? { atOnce: cap.atOnce } : {},
|
|
@@ -12123,6 +12123,14 @@ function mockBandText(b) {
|
|
|
12123
12123
|
const hi = num4(b.highMin);
|
|
12124
12124
|
return lo !== undefined && hi !== undefined ? `${lo}–${hi} min` : undefined;
|
|
12125
12125
|
}
|
|
12126
|
+
function reviseOf(v) {
|
|
12127
|
+
if (!isObject7(v))
|
|
12128
|
+
return;
|
|
12129
|
+
const assetId = str7(v.assetId);
|
|
12130
|
+
const name = str7(v.name);
|
|
12131
|
+
const url = str7(v.url);
|
|
12132
|
+
return assetId && name && url ? { assetId, name, url } : undefined;
|
|
12133
|
+
}
|
|
12126
12134
|
function instructionsFrom(waiting) {
|
|
12127
12135
|
if (!Array.isArray(waiting))
|
|
12128
12136
|
return [];
|
|
@@ -12594,6 +12602,7 @@ function sledsSource(client, o) {
|
|
|
12594
12602
|
const band = isObject7(j.band) ? mockBandText(j.band) : undefined;
|
|
12595
12603
|
o.log?.(`Pickup: Auto is drawing ${key}'s mock — a no-code session${band ? `, sized ${band}` : ""}`);
|
|
12596
12604
|
const leaseUntil = num4(j.leaseUntil);
|
|
12605
|
+
const revise = reviseOf(j.revise);
|
|
12597
12606
|
return {
|
|
12598
12607
|
item: key,
|
|
12599
12608
|
node: MOCK_NODE,
|
|
@@ -12604,7 +12613,8 @@ function sledsSource(client, o) {
|
|
|
12604
12613
|
runId: str7(j.runId),
|
|
12605
12614
|
...leaseUntil !== undefined ? { leaseUntil } : {},
|
|
12606
12615
|
...str7(j.seatId) ? { seatId: str7(j.seatId) } : {},
|
|
12607
|
-
...str7(j.runToken) ? { runToken: str7(j.runToken) } : {}
|
|
12616
|
+
...str7(j.runToken) ? { runToken: str7(j.runToken) } : {},
|
|
12617
|
+
...revise ? { revise } : {}
|
|
12608
12618
|
};
|
|
12609
12619
|
}
|
|
12610
12620
|
async function postMock(body, what) {
|
|
@@ -15429,16 +15439,18 @@ async function startMock(d, claim, state, started, finished) {
|
|
|
15429
15439
|
base = d.defaultBranch(d.exec, repoPath);
|
|
15430
15440
|
const worktree = d.runner.makesWorktree ? repoPath : d.ensureDraftWorktree(d.exec, repoPath, worktreePath(repoPath, name), base) ?? worktreePath(repoPath, name);
|
|
15431
15441
|
out = d.mockOut(name);
|
|
15442
|
+
const revise = await currentMock(d, claim, out, at);
|
|
15432
15443
|
const prompt = mockPrompt({
|
|
15433
15444
|
item: claim.item,
|
|
15434
15445
|
title: claim.title,
|
|
15435
15446
|
pack: claim.pack,
|
|
15436
15447
|
out,
|
|
15437
15448
|
base,
|
|
15438
|
-
engine: d.engine
|
|
15449
|
+
engine: d.engine,
|
|
15450
|
+
...revise ? { revise } : {}
|
|
15439
15451
|
});
|
|
15440
15452
|
launch = nodeLaunchFor(d, at);
|
|
15441
|
-
const allow = [`Edit(/${out})`];
|
|
15453
|
+
const allow = [`Edit(/${out})`, ...revise ? [`Read(/${revise.path})`] : []];
|
|
15442
15454
|
handle = d.runner.start({
|
|
15443
15455
|
name,
|
|
15444
15456
|
repoPath,
|
|
@@ -15480,6 +15492,31 @@ async function startMock(d, claim, state, started, finished) {
|
|
|
15480
15492
|
}
|
|
15481
15493
|
started.push({ item: claim.item, node: MOCK_NODE, watch, watchTarget: watchTarget(handle) });
|
|
15482
15494
|
}
|
|
15495
|
+
function currentMockPath(out) {
|
|
15496
|
+
return `${out.replace(/\.html$/i, "")}.current.html`;
|
|
15497
|
+
}
|
|
15498
|
+
async function currentMock(d, claim, out, at) {
|
|
15499
|
+
const r = claim.revise;
|
|
15500
|
+
if (!r)
|
|
15501
|
+
return;
|
|
15502
|
+
const fresh = (why) => {
|
|
15503
|
+
d.log(`${at}: could not read ${r.name} to revise it (${why}) — drawing a fresh mock`);
|
|
15504
|
+
return;
|
|
15505
|
+
};
|
|
15506
|
+
if (!d.fetchMock || !d.writeMock)
|
|
15507
|
+
return fresh("this engine cannot fetch mocks");
|
|
15508
|
+
try {
|
|
15509
|
+
const html = await d.fetchMock(r.url);
|
|
15510
|
+
if (!html)
|
|
15511
|
+
return fresh(`nothing came back from ${r.url}`);
|
|
15512
|
+
const path = currentMockPath(out);
|
|
15513
|
+
d.writeMock(path, html);
|
|
15514
|
+
d.log(`${at}: revising ${r.name} — its current HTML is at ${path}`);
|
|
15515
|
+
return { name: r.name, path };
|
|
15516
|
+
} catch (e) {
|
|
15517
|
+
return fresh(message(e));
|
|
15518
|
+
}
|
|
15519
|
+
}
|
|
15483
15520
|
function mockChangedCode(exec, cwd, base) {
|
|
15484
15521
|
const status = exec("git", ["-C", cwd, "status", "--porcelain"]);
|
|
15485
15522
|
if (status.status !== 0)
|
|
@@ -18595,7 +18632,7 @@ async function fetchVersion(o) {
|
|
|
18595
18632
|
const platform = o.platform ?? process.platform;
|
|
18596
18633
|
const arch = o.arch ?? process.arch;
|
|
18597
18634
|
const publicKey = o.publicKey ?? RELEASE_PUBLIC_KEY;
|
|
18598
|
-
const running = o.running ?? "0.1.
|
|
18635
|
+
const running = o.running ?? "0.1.73";
|
|
18599
18636
|
if (!publicKey)
|
|
18600
18637
|
return { ok: false, why: "no release key yet" };
|
|
18601
18638
|
if (!VERSION_RE2.test(o.version))
|
|
@@ -19821,7 +19858,7 @@ function engineUpdater(o) {
|
|
|
19821
19858
|
|
|
19822
19859
|
// src/version.ts
|
|
19823
19860
|
function cliVersion(env) {
|
|
19824
|
-
return "0.1.
|
|
19861
|
+
return "0.1.73";
|
|
19825
19862
|
}
|
|
19826
19863
|
|
|
19827
19864
|
// src/commands/update.ts
|
|
@@ -20207,7 +20244,7 @@ function engineClient(o, org, breaker) {
|
|
|
20207
20244
|
...src,
|
|
20208
20245
|
...breaker ? { fetchFn: breaker.fetch } : {},
|
|
20209
20246
|
timeoutMs: ENGINE_TIMEOUT_MS,
|
|
20210
|
-
version: "0.1.
|
|
20247
|
+
version: "0.1.73"
|
|
20211
20248
|
});
|
|
20212
20249
|
const asked = org?.trim() || env.SLEDS_ORG?.trim();
|
|
20213
20250
|
if (asked && !selectOrg(readConfig(o.home), org, env).seat)
|
|
@@ -20399,6 +20436,15 @@ function engineDeps(o, flags, source, runner, stateName) {
|
|
|
20399
20436
|
return null;
|
|
20400
20437
|
}
|
|
20401
20438
|
},
|
|
20439
|
+
fetchMock: async (url) => {
|
|
20440
|
+
try {
|
|
20441
|
+
const r = await fetch(url, { signal: AbortSignal.timeout(15000) });
|
|
20442
|
+
return r.ok ? await r.text() : null;
|
|
20443
|
+
} catch {
|
|
20444
|
+
return null;
|
|
20445
|
+
}
|
|
20446
|
+
},
|
|
20447
|
+
writeMock: (p, html) => writeFileSync15(p, html, { mode: 384 }),
|
|
20402
20448
|
ensureWorktree: (e, repoPath, branch, path, base, install) => ensureWorktree(e, repoPath, branch, path, base, o.worktreeFs ?? { ...realWorktreeFs, exists }, { ...install ? { command: install } : {}, log: o.log ?? console.log }),
|
|
20403
20449
|
ensureDraftWorktree: (e, repoPath, path, base) => ensureDetachedWorktree(e, repoPath, path, base, o.worktreeFs ?? { ...realWorktreeFs, exists }),
|
|
20404
20450
|
defaultBranch,
|
|
@@ -20565,7 +20611,7 @@ async function driveEngine(o, flags, deps, until = {}) {
|
|
|
20565
20611
|
runner: deps.runner.name,
|
|
20566
20612
|
atOnce: flags.atOnce,
|
|
20567
20613
|
interval: flags.interval,
|
|
20568
|
-
cliVersion: "0.1.
|
|
20614
|
+
cliVersion: "0.1.73"
|
|
20569
20615
|
};
|
|
20570
20616
|
const beat = (checkedAt) => {
|
|
20571
20617
|
const m = deps.machine;
|
|
@@ -23630,7 +23676,7 @@ function engineClient2(o, org, breaker) {
|
|
|
23630
23676
|
...src,
|
|
23631
23677
|
...breaker ? { fetchFn: breaker.fetch } : {},
|
|
23632
23678
|
timeoutMs: ENGINE_TIMEOUT_MS2,
|
|
23633
|
-
version: "0.1.
|
|
23679
|
+
version: "0.1.73"
|
|
23634
23680
|
});
|
|
23635
23681
|
const asked = org?.trim() || env.SLEDS_ORG?.trim();
|
|
23636
23682
|
if (asked && !selectOrg(readConfig(o.home), org, env).seat)
|
|
@@ -23844,6 +23890,15 @@ function engineDeps2(o, flags, source, runner, stateName) {
|
|
|
23844
23890
|
return null;
|
|
23845
23891
|
}
|
|
23846
23892
|
},
|
|
23893
|
+
fetchMock: async (url) => {
|
|
23894
|
+
try {
|
|
23895
|
+
const r = await fetch(url, { signal: AbortSignal.timeout(15000) });
|
|
23896
|
+
return r.ok ? await r.text() : null;
|
|
23897
|
+
} catch {
|
|
23898
|
+
return null;
|
|
23899
|
+
}
|
|
23900
|
+
},
|
|
23901
|
+
writeMock: (p, html) => writeFileSync20(p, html, { mode: 384 }),
|
|
23847
23902
|
ensureWorktree: (e, repoPath, branch, path, base, install) => ensureWorktree(e, repoPath, branch, path, base, o.worktreeFs ?? { ...realWorktreeFs, exists }, { ...install ? { command: install } : {}, log: o.log ?? console.log }),
|
|
23848
23903
|
ensureDraftWorktree: (e, repoPath, path, base) => ensureDetachedWorktree(e, repoPath, path, base, o.worktreeFs ?? { ...realWorktreeFs, exists }),
|
|
23849
23904
|
defaultBranch,
|
|
@@ -24023,7 +24078,7 @@ async function driveEngine2(o, flags, deps, until = {}) {
|
|
|
24023
24078
|
runner: deps.runner.name,
|
|
24024
24079
|
atOnce: flags.atOnce,
|
|
24025
24080
|
interval: flags.interval,
|
|
24026
|
-
cliVersion: "0.1.
|
|
24081
|
+
cliVersion: "0.1.73"
|
|
24027
24082
|
};
|
|
24028
24083
|
const beat = (checkedAt) => {
|
|
24029
24084
|
const m = deps.machine;
|
|
@@ -26135,7 +26190,7 @@ function contextFor(deps) {
|
|
|
26135
26190
|
...src,
|
|
26136
26191
|
fetchFn: deps.fetchFn,
|
|
26137
26192
|
timeoutMs: deps.timeoutMs,
|
|
26138
|
-
version: "0.1.
|
|
26193
|
+
version: "0.1.73"
|
|
26139
26194
|
}), deps.home, now) : null;
|
|
26140
26195
|
return {
|
|
26141
26196
|
channel: "code",
|
|
@@ -32829,7 +32884,7 @@ var realPidAlive4 = (pid) => {
|
|
|
32829
32884
|
};
|
|
32830
32885
|
function machineClient(home, env) {
|
|
32831
32886
|
const src = meterSource(home, undefined, { env });
|
|
32832
|
-
return src ? fetchClient({ ...src, version: "0.1.
|
|
32887
|
+
return src ? fetchClient({ ...src, version: "0.1.73" }) : null;
|
|
32833
32888
|
}
|
|
32834
32889
|
async function noteAnswer2(home, a, now) {
|
|
32835
32890
|
try {
|
|
@@ -33928,7 +33983,7 @@ var main = async (argv) => {
|
|
|
33928
33983
|
now: Date.now(),
|
|
33929
33984
|
stderr: (line) => console.error(line),
|
|
33930
33985
|
isTTY: !!process.stderr.isTTY,
|
|
33931
|
-
version: "0.1.
|
|
33986
|
+
version: "0.1.73"
|
|
33932
33987
|
});
|
|
33933
33988
|
switch (cmd) {
|
|
33934
33989
|
case "update":
|
|
@@ -34198,7 +34253,7 @@ ${renderHelpText(argv[1])}`);
|
|
|
34198
34253
|
case "version":
|
|
34199
34254
|
case "--version":
|
|
34200
34255
|
case "-v":
|
|
34201
|
-
console.log("sleds 0.1.
|
|
34256
|
+
console.log("sleds 0.1.73");
|
|
34202
34257
|
return 0;
|
|
34203
34258
|
default:
|
|
34204
34259
|
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.73",
|
|
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",
|