@sleds/cli 0.1.55 → 0.1.56
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 +60 -19
- package/package.json +1 -1
package/dist/sleds.mjs
CHANGED
|
@@ -2565,9 +2565,18 @@ ${rows.map((r) => statusLine(r, now)).join(`
|
|
|
2565
2565
|
|
|
2566
2566
|
`)}${more}`;
|
|
2567
2567
|
}
|
|
2568
|
+
function mineSection(rows, now, count) {
|
|
2569
|
+
if (rows.length === 0)
|
|
2570
|
+
return null;
|
|
2571
|
+
return `On your sled (${count ?? rows.length}):
|
|
2572
|
+
|
|
2573
|
+
${rows.map((r) => statusLine(r, now)).join(`
|
|
2574
|
+
|
|
2575
|
+
`)}`;
|
|
2576
|
+
}
|
|
2568
2577
|
function sledText(s, now) {
|
|
2569
2578
|
const parts = [
|
|
2570
|
-
|
|
2579
|
+
mineSection(s.mine, now, s.mineCount),
|
|
2571
2580
|
section("Proposed to you", s.proposed, now, s.proposedCount),
|
|
2572
2581
|
section("Sent to you", s.sent, now)
|
|
2573
2582
|
].filter((p) => p !== null);
|
|
@@ -3519,6 +3528,7 @@ async function sledTool(ctx, args) {
|
|
|
3519
3528
|
return {
|
|
3520
3529
|
text: sledText({
|
|
3521
3530
|
mine: rows("mine"),
|
|
3531
|
+
...typeof r.mineCount === "number" ? { mineCount: r.mineCount } : {},
|
|
3522
3532
|
proposed: rows("proposed"),
|
|
3523
3533
|
...typeof r.proposedCount === "number" ? { proposedCount: r.proposedCount } : {},
|
|
3524
3534
|
sent: rows("sent")
|
|
@@ -11536,7 +11546,7 @@ function beatBody(state, flags, host = {}, cap = {}) {
|
|
|
11536
11546
|
name: flags.name,
|
|
11537
11547
|
os: host.os ?? process.platform,
|
|
11538
11548
|
runner: flags.runner,
|
|
11539
|
-
version: host.version ?? "0.1.
|
|
11549
|
+
version: host.version ?? "0.1.56" ?? "dev",
|
|
11540
11550
|
running: live.length,
|
|
11541
11551
|
items: live.slice(0, BEAT_ITEMS).map((r) => `${r.item}/${r.node}`),
|
|
11542
11552
|
...cap.atOnce !== undefined ? { atOnce: cap.atOnce } : {},
|
|
@@ -11937,6 +11947,7 @@ function parsePrView(stdout) {
|
|
|
11937
11947
|
authorFeedback: 0,
|
|
11938
11948
|
draft: o.isDraft === true,
|
|
11939
11949
|
updatedAt: typeof o.updatedAt === "string" ? o.updatedAt : "",
|
|
11950
|
+
queued: typeof o.autoMergeRequest === "object" && o.autoMergeRequest !== null,
|
|
11940
11951
|
...mock ? { mock } : {},
|
|
11941
11952
|
...typeof o.headRefOid === "string" && o.headRefOid ? { head: o.headRefOid } : {},
|
|
11942
11953
|
...typeof mergeCommit === "string" && mergeCommit ? { mergeCommit } : {}
|
|
@@ -11985,6 +11996,27 @@ function prFeedback(exec, repoPath, url, author) {
|
|
|
11985
11996
|
}
|
|
11986
11997
|
return total;
|
|
11987
11998
|
}
|
|
11999
|
+
var MERGE_QUEUE_QUERY = "query($url: URI!) { resource(url: $url) { ... on PullRequest { mergeQueueEntry { state } } } }";
|
|
12000
|
+
function prInMergeQueue(exec, repoPath, url) {
|
|
12001
|
+
try {
|
|
12002
|
+
const r = exec("gh", [
|
|
12003
|
+
"api",
|
|
12004
|
+
"graphql",
|
|
12005
|
+
"-f",
|
|
12006
|
+
`query=${MERGE_QUEUE_QUERY}`,
|
|
12007
|
+
"-f",
|
|
12008
|
+
`url=${url}`,
|
|
12009
|
+
"--jq",
|
|
12010
|
+
".data.resource.mergeQueueEntry != null"
|
|
12011
|
+
], { cwd: repoPath });
|
|
12012
|
+
if (r.status !== 0)
|
|
12013
|
+
return null;
|
|
12014
|
+
const out = r.stdout.trim();
|
|
12015
|
+
return out === "true" ? true : out === "false" ? false : null;
|
|
12016
|
+
} catch {
|
|
12017
|
+
return null;
|
|
12018
|
+
}
|
|
12019
|
+
}
|
|
11988
12020
|
function prView(exec, repoPath, url, last) {
|
|
11989
12021
|
try {
|
|
11990
12022
|
const r = exec("gh", [
|
|
@@ -11992,11 +12024,13 @@ function prView(exec, repoPath, url, last) {
|
|
|
11992
12024
|
"view",
|
|
11993
12025
|
url,
|
|
11994
12026
|
"--json",
|
|
11995
|
-
"state,author,statusCheckRollup,reviewDecision,headRefOid,mergeable,baseRefName,mergeCommit,isDraft,body,updatedAt"
|
|
12027
|
+
"state,author,statusCheckRollup,reviewDecision,headRefOid,mergeable,baseRefName,mergeCommit,isDraft,body,updatedAt,autoMergeRequest"
|
|
11996
12028
|
], { cwd: repoPath });
|
|
11997
|
-
const
|
|
11998
|
-
if (!
|
|
11999
|
-
return
|
|
12029
|
+
const parsed = r.status === 0 ? parsePrView(r.stdout) : null;
|
|
12030
|
+
if (!parsed || parsed.state !== "OPEN")
|
|
12031
|
+
return parsed;
|
|
12032
|
+
const ready = !parsed.queued && parsed.failing.length === 0 && parsed.pending === 0 && parsed.reviewDecision === "APPROVED";
|
|
12033
|
+
const view = ready && prInMergeQueue(exec, repoPath, url) === true ? { ...parsed, queued: true } : parsed;
|
|
12000
12034
|
let read = view.updatedAt && last?.updatedAt === view.updatedAt ? last : undefined;
|
|
12001
12035
|
if (!read) {
|
|
12002
12036
|
const f = prFeedback(exec, repoPath, url, view.author);
|
|
@@ -15589,16 +15623,22 @@ async function follow(d, state, run, claim, runner, finished, attention, changes
|
|
|
15589
15623
|
pr.failing = view.failing;
|
|
15590
15624
|
pr.feedback = Math.max(pr.feedback, view.feedback);
|
|
15591
15625
|
pr.authorFeedback = Math.max(pr.authorFeedback ?? 0, view.authorFeedback) || undefined;
|
|
15592
|
-
const
|
|
15626
|
+
const queued = view.queued;
|
|
15627
|
+
if (queued && !pr.queued)
|
|
15628
|
+
d.log(`${ref(run)}: ${pr.url} is queued to merge`);
|
|
15629
|
+
else if (!queued && pr.queued)
|
|
15630
|
+
d.log(`${ref(run)}: ${pr.url} left the merge queue`);
|
|
15631
|
+
pr.queued = queued || undefined;
|
|
15632
|
+
const clear = view.failing.length === 0 && view.pending === 0 && view.reviewDecision === "APPROVED" && !queued;
|
|
15593
15633
|
if (clear && !pr.clear) {
|
|
15594
15634
|
d.log(`${ref(run)}: ${pr.url} is green and approved — ready for your merge call`);
|
|
15595
15635
|
attention.push({ ...at, what: "green and approved: ready for a merge" });
|
|
15596
15636
|
}
|
|
15597
15637
|
pr.clear = clear;
|
|
15598
15638
|
const prRead = d.source.prRead;
|
|
15599
|
-
const posted = `${ci}|${review}|${clear}`;
|
|
15639
|
+
const posted = `${ci}|${review}|${clear}|${queued}`;
|
|
15600
15640
|
if (prRead && posted !== pr.posted) {
|
|
15601
|
-
const read = { ci, ...review ? { review } : {}, clear };
|
|
15641
|
+
const read = { ci, ...review ? { review } : {}, clear, queued };
|
|
15602
15642
|
if (await prRead.call(d.source, run.item, run.node, read))
|
|
15603
15643
|
pr.posted = posted;
|
|
15604
15644
|
}
|
|
@@ -17514,7 +17554,7 @@ async function fetchVersion(o) {
|
|
|
17514
17554
|
const platform = o.platform ?? process.platform;
|
|
17515
17555
|
const arch = o.arch ?? process.arch;
|
|
17516
17556
|
const publicKey = o.publicKey ?? RELEASE_PUBLIC_KEY;
|
|
17517
|
-
const running = o.running ?? "0.1.
|
|
17557
|
+
const running = o.running ?? "0.1.56";
|
|
17518
17558
|
if (!publicKey)
|
|
17519
17559
|
return { ok: false, why: "no release key yet" };
|
|
17520
17560
|
if (!VERSION_RE2.test(o.version))
|
|
@@ -19099,7 +19139,7 @@ function engineClient(o, org, breaker) {
|
|
|
19099
19139
|
...src,
|
|
19100
19140
|
...breaker ? { fetchFn: breaker.fetch } : {},
|
|
19101
19141
|
timeoutMs: ENGINE_TIMEOUT_MS,
|
|
19102
|
-
version: "0.1.
|
|
19142
|
+
version: "0.1.56"
|
|
19103
19143
|
});
|
|
19104
19144
|
const asked = org?.trim() || env.SLEDS_ORG?.trim();
|
|
19105
19145
|
if (asked && !selectOrg(readConfig(o.home), org, env).seat)
|
|
@@ -19390,7 +19430,7 @@ async function driveEngine(o, flags, deps, until = {}) {
|
|
|
19390
19430
|
runner: deps.runner.name,
|
|
19391
19431
|
atOnce: flags.atOnce,
|
|
19392
19432
|
interval: flags.interval,
|
|
19393
|
-
cliVersion: "0.1.
|
|
19433
|
+
cliVersion: "0.1.56"
|
|
19394
19434
|
};
|
|
19395
19435
|
const beat = (checkedAt) => {
|
|
19396
19436
|
const m = deps.machine;
|
|
@@ -21257,7 +21297,7 @@ function engineClient2(o, org, breaker) {
|
|
|
21257
21297
|
...src,
|
|
21258
21298
|
...breaker ? { fetchFn: breaker.fetch } : {},
|
|
21259
21299
|
timeoutMs: ENGINE_TIMEOUT_MS2,
|
|
21260
|
-
version: "0.1.
|
|
21300
|
+
version: "0.1.56"
|
|
21261
21301
|
});
|
|
21262
21302
|
const asked = org?.trim() || env.SLEDS_ORG?.trim();
|
|
21263
21303
|
if (asked && !selectOrg(readConfig(o.home), org, env).seat)
|
|
@@ -21583,7 +21623,7 @@ async function driveEngine2(o, flags, deps, until = {}) {
|
|
|
21583
21623
|
runner: deps.runner.name,
|
|
21584
21624
|
atOnce: flags.atOnce,
|
|
21585
21625
|
interval: flags.interval,
|
|
21586
|
-
cliVersion: "0.1.
|
|
21626
|
+
cliVersion: "0.1.56"
|
|
21587
21627
|
};
|
|
21588
21628
|
const beat = (checkedAt) => {
|
|
21589
21629
|
const m = deps.machine;
|
|
@@ -22782,6 +22822,7 @@ function engineStatus(i) {
|
|
|
22782
22822
|
failing: r.pr.failing,
|
|
22783
22823
|
...opt("review", r.pr.review || undefined),
|
|
22784
22824
|
mergeable: r.pr.clear === true,
|
|
22825
|
+
queued: r.pr.queued === true,
|
|
22785
22826
|
...opt("conflict", conflictOf(r, i.state.decisions, i.watchOf))
|
|
22786
22827
|
});
|
|
22787
22828
|
continue;
|
|
@@ -22859,7 +22900,7 @@ function statusLines(s, now) {
|
|
|
22859
22900
|
lines.push(` ${r.item}/${r.node} ${r.title} · ${r.answerer ? `parked, the decider answers${r.answerer.model ? ` on ${r.answerer.model}` : ""}${r.answerer.effort ? ` · ${r.answerer.effort}` : ""}` : r.parked ? "parked, waiting for your answer" : ago(r.startedAt)} · watch: ${r.watch}`);
|
|
22860
22901
|
lines.push(`following ${s.following.length}`);
|
|
22861
22902
|
for (const f of s.following) {
|
|
22862
|
-
lines.push(` ${f.item}/${f.node} ${f.pr}${f.checks ? ` checks ${f.checks}` : ""}${f.review ? ` · ${f.review}` : ""}${f.mergeable ? " · ready for your merge" : ""}`);
|
|
22903
|
+
lines.push(` ${f.item}/${f.node} ${f.pr}${f.checks ? ` checks ${f.checks}` : ""}${f.review ? ` · ${f.review}` : ""}${f.mergeable ? " · ready for your merge" : ""}${f.queued ? " · queued to merge" : ""}`);
|
|
22863
22904
|
const c = f.conflict;
|
|
22864
22905
|
if (c)
|
|
22865
22906
|
lines.push(` conflict on ${c.files.join(", ")}${c.cause ? ` · ${c.cause}` : ""} · ${CONFLICT_STAGE[c.stage]} · since ${ago(c.since)} ago${c.watch ? ` · watch: ${c.watch}` : ""}`);
|
|
@@ -23685,7 +23726,7 @@ function contextFor(deps) {
|
|
|
23685
23726
|
...src,
|
|
23686
23727
|
fetchFn: deps.fetchFn,
|
|
23687
23728
|
timeoutMs: deps.timeoutMs,
|
|
23688
|
-
version: "0.1.
|
|
23729
|
+
version: "0.1.56"
|
|
23689
23730
|
}), deps.home, now) : null;
|
|
23690
23731
|
return {
|
|
23691
23732
|
channel: "code",
|
|
@@ -27803,7 +27844,7 @@ var realPidAlive4 = (pid) => {
|
|
|
27803
27844
|
};
|
|
27804
27845
|
function machineClient(home, env) {
|
|
27805
27846
|
const src = meterSource(home, undefined, { env });
|
|
27806
|
-
return src ? fetchClient({ ...src, version: "0.1.
|
|
27847
|
+
return src ? fetchClient({ ...src, version: "0.1.56" }) : null;
|
|
27807
27848
|
}
|
|
27808
27849
|
async function noteAnswer2(home, a, now) {
|
|
27809
27850
|
try {
|
|
@@ -28663,7 +28704,7 @@ var main = async (argv) => {
|
|
|
28663
28704
|
now: Date.now(),
|
|
28664
28705
|
stderr: (line) => console.error(line),
|
|
28665
28706
|
isTTY: !!process.stderr.isTTY,
|
|
28666
|
-
version: "0.1.
|
|
28707
|
+
version: "0.1.56"
|
|
28667
28708
|
});
|
|
28668
28709
|
switch (cmd) {
|
|
28669
28710
|
case "update":
|
|
@@ -28896,7 +28937,7 @@ ${renderHelpText(argv[1])}`);
|
|
|
28896
28937
|
case "version":
|
|
28897
28938
|
case "--version":
|
|
28898
28939
|
case "-v":
|
|
28899
|
-
console.log("sleds 0.1.
|
|
28940
|
+
console.log("sleds 0.1.56");
|
|
28900
28941
|
return 0;
|
|
28901
28942
|
default:
|
|
28902
28943
|
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.56",
|
|
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",
|