@sleds/cli 0.1.69 → 0.1.70
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 +154 -38
- package/package.json +1 -1
package/dist/sleds.mjs
CHANGED
|
@@ -295,6 +295,16 @@ var init_sledSort = __esm(() => {
|
|
|
295
295
|
function slugify(text, max = 63) {
|
|
296
296
|
return text.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, max);
|
|
297
297
|
}
|
|
298
|
+
|
|
299
|
+
// ../../packages/shared/src/workspaceLook.ts
|
|
300
|
+
var init_workspaceLook = () => {};
|
|
301
|
+
|
|
302
|
+
// ../../packages/shared/src/org/brand.ts
|
|
303
|
+
var BRAND_LOGO_MAX_BYTES;
|
|
304
|
+
var init_brand = __esm(() => {
|
|
305
|
+
init_workspaceLook();
|
|
306
|
+
BRAND_LOGO_MAX_BYTES = 1024 * 1024;
|
|
307
|
+
});
|
|
298
308
|
// ../../packages/shared/src/seat/agents.ts
|
|
299
309
|
var init_agents = () => {};
|
|
300
310
|
// ../../packages/shared/src/seat/burn.ts
|
|
@@ -1107,6 +1117,9 @@ function norm(label) {
|
|
|
1107
1117
|
function plain(s) {
|
|
1108
1118
|
return s.replace(/[*_`~]+/g, "").replace(/\s+/g, " ").trim();
|
|
1109
1119
|
}
|
|
1120
|
+
function isNoAnswer(s) {
|
|
1121
|
+
return !s || /^(n\/?a|none|no|nil|null|-+|—|tbd|\?+)\.?$/i.test(s.trim());
|
|
1122
|
+
}
|
|
1110
1123
|
function titleOf(s, max = 80) {
|
|
1111
1124
|
const t = plain(s);
|
|
1112
1125
|
const first = /^(.+?[.!?])(\s|$)/.exec(t)?.[1] ?? t;
|
|
@@ -1290,9 +1303,9 @@ function draftBrief(input) {
|
|
|
1290
1303
|
const byKey = form ? {
|
|
1291
1304
|
touches: form.touches,
|
|
1292
1305
|
demand: form.demand,
|
|
1293
|
-
...form.expected ? { done: form.expected } : {}
|
|
1306
|
+
...form.expected && !isNoAnswer(form.expected) ? { done: form.expected } : {}
|
|
1294
1307
|
} : parsed.byKey;
|
|
1295
|
-
const fromText = form?.summary ? form.summary : form?.ask ? form.ask : askFrom(text, preamble);
|
|
1308
|
+
const fromText = form?.summary && !isNoAnswer(form.summary) ? form.summary : form?.ask ? form.ask : askFrom(text, preamble);
|
|
1296
1309
|
const askText = a.ask?.trim() || (fromText ? titleOf(fromText) : undefined);
|
|
1297
1310
|
if (!askText)
|
|
1298
1311
|
return null;
|
|
@@ -4481,6 +4494,7 @@ async function actualTool(ctx, args, to = { path: "/proxy/estimate/actual" }) {
|
|
|
4481
4494
|
...num3(args.usd) !== undefined ? { actualUsd: num3(args.usd) } : {},
|
|
4482
4495
|
...args.usd === null ? { actualUsd: null } : {},
|
|
4483
4496
|
...str5(args.state) ? { state: str5(args.state) } : {},
|
|
4497
|
+
...args.devVerified === true ? { devVerified: true } : {},
|
|
4484
4498
|
...Object.keys(work).length > 0 ? { work } : {}
|
|
4485
4499
|
};
|
|
4486
4500
|
const res = await ctx.client.postFull(to.path, body);
|
|
@@ -5529,6 +5543,10 @@ var init_server = __esm(() => {
|
|
|
5529
5543
|
type: "string",
|
|
5530
5544
|
description: "started · done · merged · shipped · parked (default: done when minutes or finishedAt are given)."
|
|
5531
5545
|
},
|
|
5546
|
+
devVerified: {
|
|
5547
|
+
type: "boolean",
|
|
5548
|
+
description: "true when you verified it yourself — the finish skips verification (the workspace's QA column) and the merge lands it as before. Never set it by rule."
|
|
5549
|
+
},
|
|
5532
5550
|
phases: {
|
|
5533
5551
|
type: "object",
|
|
5534
5552
|
description: "Minutes by phase; total defaults to their sum when `minutes` is absent.",
|
|
@@ -5619,6 +5637,10 @@ var init_server = __esm(() => {
|
|
|
5619
5637
|
type: "string",
|
|
5620
5638
|
description: "started · done · merged · shipped · parked (default: done when minutes or finishedAt are given)."
|
|
5621
5639
|
},
|
|
5640
|
+
devVerified: {
|
|
5641
|
+
type: "boolean",
|
|
5642
|
+
description: "true when you verified it yourself — the finish skips verification (the workspace's QA column) and the merge lands it as before. Never set it by rule."
|
|
5643
|
+
},
|
|
5622
5644
|
phases: {
|
|
5623
5645
|
type: "object",
|
|
5624
5646
|
description: "Minutes by phase; total defaults to their sum when `minutes` is absent.",
|
|
@@ -5668,6 +5690,10 @@ var init_server = __esm(() => {
|
|
|
5668
5690
|
feature: { type: "string" },
|
|
5669
5691
|
ref: { type: "string", description: "Where the output lives: PR url, commit, doc." },
|
|
5670
5692
|
state: { type: "string", description: "done · merged · shipped (default: done)." },
|
|
5693
|
+
devVerified: {
|
|
5694
|
+
type: "boolean",
|
|
5695
|
+
description: "true when you verified it yourself — the finish skips verification (the workspace's QA column) and the merge lands it as before. Never set it by rule."
|
|
5696
|
+
},
|
|
5671
5697
|
model: { type: "string" },
|
|
5672
5698
|
sessionId: { type: "string" },
|
|
5673
5699
|
node: {
|
|
@@ -8174,9 +8200,6 @@ var init_effort = __esm(() => {
|
|
|
8174
8200
|
EFFORTS = ["low", "medium", "high", "xhigh", "max"];
|
|
8175
8201
|
});
|
|
8176
8202
|
|
|
8177
|
-
// ../../packages/shared/src/workspaceLook.ts
|
|
8178
|
-
var init_workspaceLook = () => {};
|
|
8179
|
-
|
|
8180
8203
|
// src/settings.ts
|
|
8181
8204
|
import { execFileSync } from "node:child_process";
|
|
8182
8205
|
import { chmodSync, existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
@@ -8806,6 +8829,7 @@ var init_src = __esm(() => {
|
|
|
8806
8829
|
init_sledConfig();
|
|
8807
8830
|
init_sledSort();
|
|
8808
8831
|
init_gate();
|
|
8832
|
+
init_brand();
|
|
8809
8833
|
init_agents();
|
|
8810
8834
|
init_burn();
|
|
8811
8835
|
init_cowork();
|
|
@@ -9301,6 +9325,7 @@ function parseRun(v) {
|
|
|
9301
9325
|
}
|
|
9302
9326
|
} : {},
|
|
9303
9327
|
...isObject8(v.provider) && typeof v.provider.why === "string" && typeof v.provider.since === "number" && typeof v.provider.tries === "number" ? { provider: { why: v.provider.why, since: v.provider.since, tries: v.provider.tries } } : {},
|
|
9328
|
+
...isObject8(v.atPrompt) && typeof v.atPrompt.since === "number" && typeof v.atPrompt.text === "string" ? { atPrompt: { since: v.atPrompt.since, text: v.atPrompt.text } } : {},
|
|
9304
9329
|
...parked ? { parked } : {},
|
|
9305
9330
|
...isObject8(v.pr) && typeof v.pr.url === "string" ? {
|
|
9306
9331
|
pr: {
|
|
@@ -9586,6 +9611,7 @@ init_envelope();
|
|
|
9586
9611
|
init_sledConfig();
|
|
9587
9612
|
init_sledSort();
|
|
9588
9613
|
init_gate();
|
|
9614
|
+
init_brand();
|
|
9589
9615
|
init_agents();
|
|
9590
9616
|
init_burn();
|
|
9591
9617
|
init_cowork();
|
|
@@ -12353,7 +12379,7 @@ function beatBody(state, flags, host = {}, cap = {}) {
|
|
|
12353
12379
|
name: flags.name,
|
|
12354
12380
|
os: host.os ?? process.platform,
|
|
12355
12381
|
runner: flags.runner,
|
|
12356
|
-
version: host.version ?? "0.1.
|
|
12382
|
+
version: host.version ?? "0.1.70" ?? "dev",
|
|
12357
12383
|
running: live.length,
|
|
12358
12384
|
items: live.slice(0, BEAT_ITEMS).map((r) => `${r.item}/${r.node}`),
|
|
12359
12385
|
...cap.atOnce !== undefined ? { atOnce: cap.atOnce } : {},
|
|
@@ -14593,21 +14619,65 @@ function permissionDialog(screen) {
|
|
|
14593
14619
|
if (t && !isRule(raw[i]) && !DIALOG_FOOTER.test(t) && !isFooter(t))
|
|
14594
14620
|
return null;
|
|
14595
14621
|
}
|
|
14622
|
+
return { text: dialogBody(raw, lines, q), options };
|
|
14623
|
+
}
|
|
14624
|
+
function dialogBody(raw, lines, last) {
|
|
14596
14625
|
let from = 0;
|
|
14597
|
-
for (let j =
|
|
14626
|
+
for (let j = last;j >= 0; j--) {
|
|
14598
14627
|
const t = lines[j].trim();
|
|
14599
14628
|
if (isRule(raw[j]) || /^⏺/.test(t) || /^⎿/.test(t)) {
|
|
14600
14629
|
from = j + 1;
|
|
14601
14630
|
break;
|
|
14602
14631
|
}
|
|
14603
14632
|
}
|
|
14604
|
-
const body = lines.slice(from,
|
|
14605
|
-
const
|
|
14606
|
-
|
|
14633
|
+
const body = lines.slice(from, last + 1);
|
|
14634
|
+
const inked = body.filter((l) => l.trim());
|
|
14635
|
+
if (!inked.length)
|
|
14636
|
+
return "";
|
|
14637
|
+
const indent = Math.min(...inked.map((l) => /^\s*/.exec(l)[0].length));
|
|
14638
|
+
return body.map((l) => l.slice(indent)).join(`
|
|
14607
14639
|
`).replace(/\n{3,}/g, `
|
|
14608
14640
|
|
|
14609
14641
|
`).trim();
|
|
14610
|
-
|
|
14642
|
+
}
|
|
14643
|
+
var CURSOR_CHOICE = /^❯\s*\d\.\s/;
|
|
14644
|
+
var CANCEL_FOOTER = /\besc to cancel\b/i;
|
|
14645
|
+
function stoppedAtPrompt(screen) {
|
|
14646
|
+
const dialog = permissionDialog(screen);
|
|
14647
|
+
if (dialog)
|
|
14648
|
+
return { text: dialog.text };
|
|
14649
|
+
const raw = screen.split(`
|
|
14650
|
+
`);
|
|
14651
|
+
const lines = raw.map(unbox);
|
|
14652
|
+
let c = -1;
|
|
14653
|
+
for (let i = lines.length - 1;i >= 0; i--)
|
|
14654
|
+
if (CURSOR_CHOICE.test(lines[i].trim())) {
|
|
14655
|
+
c = i;
|
|
14656
|
+
break;
|
|
14657
|
+
}
|
|
14658
|
+
if (c < 0)
|
|
14659
|
+
return null;
|
|
14660
|
+
let footer = -1;
|
|
14661
|
+
for (let i = c + 1;i < lines.length; i++) {
|
|
14662
|
+
const t = lines[i].trim();
|
|
14663
|
+
if (/^⏺/.test(t) || isPrompt(t) && !CURSOR_CHOICE.test(t))
|
|
14664
|
+
return null;
|
|
14665
|
+
if (footer < 0 && CANCEL_FOOTER.test(t))
|
|
14666
|
+
footer = i;
|
|
14667
|
+
else if (footer >= 0 && t && !isRule(raw[i]) && !isFooter(t) && !DIALOG_FOOTER.test(t))
|
|
14668
|
+
return null;
|
|
14669
|
+
}
|
|
14670
|
+
if (footer < 0 && !choicePicker(screen))
|
|
14671
|
+
return null;
|
|
14672
|
+
let first = c;
|
|
14673
|
+
for (let i = c;i >= 0 && c - i < PICKER_REACH; i--)
|
|
14674
|
+
if (/^(?:❯\s*)?1\.\s/.test(lines[i].trim())) {
|
|
14675
|
+
first = i;
|
|
14676
|
+
break;
|
|
14677
|
+
}
|
|
14678
|
+
const text = dialogBody(raw, lines, first - 1) || lines.slice(first, c + 1).map((l) => l.trim()).join(`
|
|
14679
|
+
`);
|
|
14680
|
+
return { text };
|
|
14611
14681
|
}
|
|
14612
14682
|
var PROVIDER_FAILURES = [
|
|
14613
14683
|
["connection lost", /\bconnection (?:lost|error)\b/i],
|
|
@@ -15237,7 +15307,9 @@ async function tickOnce(d) {
|
|
|
15237
15307
|
idle = false;
|
|
15238
15308
|
asked = false;
|
|
15239
15309
|
failing = null;
|
|
15240
|
-
|
|
15310
|
+
run.atPrompt = undefined;
|
|
15311
|
+
} else if (runner.readsSession)
|
|
15312
|
+
notePrompt(d, runner, run, shown);
|
|
15241
15313
|
const retry = failing !== null && (run.provider?.tries ?? 0) < PROVIDER_RETRIES;
|
|
15242
15314
|
if (idle || failing || needsHeartbeat(run.leaseUntil, d.now(), d.leaseMin)) {
|
|
15243
15315
|
let beat;
|
|
@@ -15832,6 +15904,17 @@ async function settlePermission(d, runner, run, shown) {
|
|
|
15832
15904
|
d.log(`${at}: stopped at a permission dialog — it waits for a person (${runner.watchHint(run.handle)})`);
|
|
15833
15905
|
return true;
|
|
15834
15906
|
}
|
|
15907
|
+
function notePrompt(d, runner, run, shown) {
|
|
15908
|
+
if (!shown)
|
|
15909
|
+
return;
|
|
15910
|
+
const prompt = stoppedAtPrompt(shown);
|
|
15911
|
+
if (!prompt || run.atPrompt && run.atPrompt.text !== prompt.text)
|
|
15912
|
+
run.atPrompt = undefined;
|
|
15913
|
+
if (!prompt || run.atPrompt || !run.seenTicks)
|
|
15914
|
+
return;
|
|
15915
|
+
run.atPrompt = { since: d.now(), text: prompt.text };
|
|
15916
|
+
d.log(`${ref(run)}: stopped at a prompt the engine cannot answer — answer it in the terminal (${runner.watchHint(run.handle)})`);
|
|
15917
|
+
}
|
|
15835
15918
|
var PRESS_TRIES = 3;
|
|
15836
15919
|
function pressAnswer(d, runner, run, options, answer) {
|
|
15837
15920
|
const at = ref(run);
|
|
@@ -19233,7 +19316,7 @@ async function fetchVersion(o) {
|
|
|
19233
19316
|
const platform = o.platform ?? process.platform;
|
|
19234
19317
|
const arch = o.arch ?? process.arch;
|
|
19235
19318
|
const publicKey = o.publicKey ?? RELEASE_PUBLIC_KEY;
|
|
19236
|
-
const running = o.running ?? "0.1.
|
|
19319
|
+
const running = o.running ?? "0.1.70";
|
|
19237
19320
|
if (!publicKey)
|
|
19238
19321
|
return { ok: false, why: "no release key yet" };
|
|
19239
19322
|
if (!VERSION_RE2.test(o.version))
|
|
@@ -20459,7 +20542,7 @@ function engineUpdater(o) {
|
|
|
20459
20542
|
|
|
20460
20543
|
// src/version.ts
|
|
20461
20544
|
function cliVersion(env) {
|
|
20462
|
-
return "0.1.
|
|
20545
|
+
return "0.1.70";
|
|
20463
20546
|
}
|
|
20464
20547
|
|
|
20465
20548
|
// src/commands/update.ts
|
|
@@ -20845,7 +20928,7 @@ function engineClient(o, org, breaker) {
|
|
|
20845
20928
|
...src,
|
|
20846
20929
|
...breaker ? { fetchFn: breaker.fetch } : {},
|
|
20847
20930
|
timeoutMs: ENGINE_TIMEOUT_MS,
|
|
20848
|
-
version: "0.1.
|
|
20931
|
+
version: "0.1.70"
|
|
20849
20932
|
});
|
|
20850
20933
|
const asked = org?.trim() || env.SLEDS_ORG?.trim();
|
|
20851
20934
|
if (asked && !selectOrg(readConfig(o.home), org, env).seat)
|
|
@@ -21203,7 +21286,7 @@ async function driveEngine(o, flags, deps, until = {}) {
|
|
|
21203
21286
|
runner: deps.runner.name,
|
|
21204
21287
|
atOnce: flags.atOnce,
|
|
21205
21288
|
interval: flags.interval,
|
|
21206
|
-
cliVersion: "0.1.
|
|
21289
|
+
cliVersion: "0.1.70"
|
|
21207
21290
|
};
|
|
21208
21291
|
const beat = (checkedAt) => {
|
|
21209
21292
|
const m = deps.machine;
|
|
@@ -23081,7 +23164,7 @@ function engineClient2(o, org, breaker) {
|
|
|
23081
23164
|
...src,
|
|
23082
23165
|
...breaker ? { fetchFn: breaker.fetch } : {},
|
|
23083
23166
|
timeoutMs: ENGINE_TIMEOUT_MS2,
|
|
23084
|
-
version: "0.1.
|
|
23167
|
+
version: "0.1.70"
|
|
23085
23168
|
});
|
|
23086
23169
|
const asked = org?.trim() || env.SLEDS_ORG?.trim();
|
|
23087
23170
|
if (asked && !selectOrg(readConfig(o.home), org, env).seat)
|
|
@@ -23474,7 +23557,7 @@ async function driveEngine2(o, flags, deps, until = {}) {
|
|
|
23474
23557
|
runner: deps.runner.name,
|
|
23475
23558
|
atOnce: flags.atOnce,
|
|
23476
23559
|
interval: flags.interval,
|
|
23477
|
-
cliVersion: "0.1.
|
|
23560
|
+
cliVersion: "0.1.70"
|
|
23478
23561
|
};
|
|
23479
23562
|
const beat = (checkedAt) => {
|
|
23480
23563
|
const m = deps.machine;
|
|
@@ -24695,7 +24778,8 @@ function engineStatus(i) {
|
|
|
24695
24778
|
...opt("leaseUntil", iso2(r.leaseUntil)),
|
|
24696
24779
|
...opt("runId", r.runId),
|
|
24697
24780
|
...opt("parked", r.parked?.question),
|
|
24698
|
-
...opt("answerer", answererOf(r))
|
|
24781
|
+
...opt("answerer", answererOf(r)),
|
|
24782
|
+
...opt("atPrompt", r.atPrompt ? { since: iso2(r.atPrompt.since) ?? new Date(0).toISOString(), text: r.atPrompt.text } : undefined)
|
|
24699
24783
|
});
|
|
24700
24784
|
}
|
|
24701
24785
|
return {
|
|
@@ -24752,7 +24836,7 @@ function statusLines(s, now) {
|
|
|
24752
24836
|
}
|
|
24753
24837
|
lines.push(`running ${s.running.length}`);
|
|
24754
24838
|
for (const r of s.running)
|
|
24755
|
-
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" : `${r.kind === "mock" ? "drawing a mock · " : ""}${ago(r.startedAt)}`} · watch: ${r.watch}`);
|
|
24839
|
+
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" : r.atPrompt ? `at a prompt · ${ago(r.atPrompt.since)}` : `${r.kind === "mock" ? "drawing a mock · " : ""}${ago(r.startedAt)}`} · watch: ${r.watch}`);
|
|
24756
24840
|
lines.push(`following ${s.following.length}`);
|
|
24757
24841
|
for (const f of s.following) {
|
|
24758
24842
|
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" : f.autoMerge ? " · merge when ready" : ""}`);
|
|
@@ -25585,7 +25669,7 @@ function contextFor(deps) {
|
|
|
25585
25669
|
...src,
|
|
25586
25670
|
fetchFn: deps.fetchFn,
|
|
25587
25671
|
timeoutMs: deps.timeoutMs,
|
|
25588
|
-
version: "0.1.
|
|
25672
|
+
version: "0.1.70"
|
|
25589
25673
|
}), deps.home, now) : null;
|
|
25590
25674
|
return {
|
|
25591
25675
|
channel: "code",
|
|
@@ -30401,16 +30485,20 @@ function readOrgInfo(json) {
|
|
|
30401
30485
|
const org = isObj7(json.org) ? str16(json.org.slug) : str16(json.org);
|
|
30402
30486
|
if (!org)
|
|
30403
30487
|
return "no org";
|
|
30404
|
-
const
|
|
30405
|
-
for (const e of Array.isArray(json.
|
|
30488
|
+
const bySlug = new Map;
|
|
30489
|
+
for (const e of Array.isArray(json.envs) ? json.envs : []) {
|
|
30406
30490
|
if (!isObj7(e) || !str16(e.slug))
|
|
30407
30491
|
continue;
|
|
30408
|
-
const
|
|
30492
|
+
const slug = str16(e.slug).toLowerCase();
|
|
30493
|
+
const env = bySlug.get(slug) ?? { slug, production: false };
|
|
30494
|
+
if (e.production === true)
|
|
30495
|
+
env.production = true;
|
|
30409
30496
|
const ld = str16(e.launchDarklyEnv);
|
|
30410
|
-
if (ld)
|
|
30497
|
+
if (ld && !env.launchDarklyEnv)
|
|
30411
30498
|
env.launchDarklyEnv = ld;
|
|
30412
|
-
|
|
30499
|
+
bySlug.set(slug, env);
|
|
30413
30500
|
}
|
|
30501
|
+
const environments = [...bySlug.values()];
|
|
30414
30502
|
const strings = (v) => Array.isArray(v) ? v.map((x) => str16(x)).filter(Boolean) : [];
|
|
30415
30503
|
return {
|
|
30416
30504
|
org,
|
|
@@ -30450,17 +30538,28 @@ function pickLdProject(given, info) {
|
|
|
30450
30538
|
};
|
|
30451
30539
|
}
|
|
30452
30540
|
var num9 = (v) => typeof v === "number" && Number.isFinite(v) ? v : 0;
|
|
30453
|
-
|
|
30454
|
-
const c = { inserted: 0, existing: 0, skipped: 0 };
|
|
30541
|
+
function countsOf(json) {
|
|
30542
|
+
const c = { inserted: 0, existing: 0, skipped: 0, pulls: 0, skips: [] };
|
|
30455
30543
|
if (!isObj7(json))
|
|
30456
30544
|
return c;
|
|
30457
|
-
const
|
|
30458
|
-
|
|
30459
|
-
|
|
30460
|
-
|
|
30461
|
-
|
|
30545
|
+
const rows = (v) => isObj7(v) ? num9(v.deploys) + num9(v.flags) : num9(v);
|
|
30546
|
+
c.inserted = rows(json.inserted);
|
|
30547
|
+
c.existing = rows(json.existing);
|
|
30548
|
+
c.skipped = rows(json.skipped);
|
|
30549
|
+
c.pulls = isObj7(json.inserted) ? num9(json.inserted.pulls) : num9(json.pulls);
|
|
30550
|
+
for (const s of Array.isArray(json.skips) ? json.skips : []) {
|
|
30551
|
+
const w = isObj7(s) ? str16(s.why) : "";
|
|
30552
|
+
const count = isObj7(s) ? num9(s.count) : 0;
|
|
30553
|
+
if (w && count > 0)
|
|
30554
|
+
c.skips.push({ why: w, count });
|
|
30462
30555
|
}
|
|
30463
30556
|
return c;
|
|
30557
|
+
}
|
|
30558
|
+
var mergeSkips = (...lists) => {
|
|
30559
|
+
const by = new Map;
|
|
30560
|
+
for (const s of lists.flat())
|
|
30561
|
+
by.set(s.why, (by.get(s.why) ?? 0) + s.count);
|
|
30562
|
+
return [...by.entries()].map(([w, count]) => ({ why: w, count })).sort((a, b) => b.count - a.count);
|
|
30464
30563
|
};
|
|
30465
30564
|
var why3 = (json, status) => isObj7(json) && typeof json.error === "string" ? json.error : `HTTP ${status}`;
|
|
30466
30565
|
async function importSleuth(o) {
|
|
@@ -30619,7 +30718,9 @@ async function importSleuth(o) {
|
|
|
30619
30718
|
posted: 0,
|
|
30620
30719
|
inserted: 0,
|
|
30621
30720
|
existing: 0,
|
|
30622
|
-
skipped
|
|
30721
|
+
skipped,
|
|
30722
|
+
prs: 0,
|
|
30723
|
+
serverSkips: []
|
|
30623
30724
|
};
|
|
30624
30725
|
o.onMapping?.(result);
|
|
30625
30726
|
for (let b = 0;b < result.batches; b++) {
|
|
@@ -30644,6 +30745,8 @@ async function importSleuth(o) {
|
|
|
30644
30745
|
result.inserted += n.inserted;
|
|
30645
30746
|
result.existing += n.existing;
|
|
30646
30747
|
result.skipped += n.skipped;
|
|
30748
|
+
result.prs += n.pulls;
|
|
30749
|
+
result.serverSkips = mergeSkips(result.serverSkips, n.skips);
|
|
30647
30750
|
if ((b + 1) % 10 === 0 || b + 1 === result.batches)
|
|
30648
30751
|
log(` ${at} · ${result.posted} rows sent`);
|
|
30649
30752
|
}
|
|
@@ -30668,6 +30771,18 @@ function historyLine(r) {
|
|
|
30668
30771
|
return ` PR history: ${missing} merged PRs without a first commit — SLEDS is reading them from GitHub, paced; lead time fills in as it goes`;
|
|
30669
30772
|
return missing ? ` PR history: ${missing} merged PRs without a first commit — not reading them: connect GitHub (Settings › Integrations), then re-run` : " PR history: every merged PR has its first commit";
|
|
30670
30773
|
}
|
|
30774
|
+
function summaryLines(r) {
|
|
30775
|
+
const tail = `already there ${r.existing}, skipped ${r.skipped}`;
|
|
30776
|
+
const out = [
|
|
30777
|
+
r.dryRun ? ` would write ~${r.inserted}, ${tail} · ~${r.prs} PRs — run again without --dry-run to write` : ` wrote ${r.inserted}, ${tail} · ${r.prs} PRs`
|
|
30778
|
+
];
|
|
30779
|
+
if (r.serverSkips.length) {
|
|
30780
|
+
out.push("", " server skipped, and why:");
|
|
30781
|
+
for (const s of r.serverSkips)
|
|
30782
|
+
out.push(` ${String(s.count).padStart(6)} ${s.why}`);
|
|
30783
|
+
}
|
|
30784
|
+
return out;
|
|
30785
|
+
}
|
|
30671
30786
|
function mappingTable(r) {
|
|
30672
30787
|
const head = [
|
|
30673
30788
|
"Sleuth deployment",
|
|
@@ -31275,7 +31390,8 @@ var importCmd = async (o, { words, flags, all }) => {
|
|
|
31275
31390
|
log(JSON.stringify(result));
|
|
31276
31391
|
return code;
|
|
31277
31392
|
}
|
|
31278
|
-
|
|
31393
|
+
for (const l of summaryLines(result))
|
|
31394
|
+
log(l);
|
|
31279
31395
|
const history = historyLine(result);
|
|
31280
31396
|
if (history)
|
|
31281
31397
|
(result.historyError ? error : log)(history);
|
|
@@ -32153,7 +32269,7 @@ var realPidAlive4 = (pid) => {
|
|
|
32153
32269
|
};
|
|
32154
32270
|
function machineClient(home, env) {
|
|
32155
32271
|
const src = meterSource(home, undefined, { env });
|
|
32156
|
-
return src ? fetchClient({ ...src, version: "0.1.
|
|
32272
|
+
return src ? fetchClient({ ...src, version: "0.1.70" }) : null;
|
|
32157
32273
|
}
|
|
32158
32274
|
async function noteAnswer2(home, a, now) {
|
|
32159
32275
|
try {
|
|
@@ -33104,7 +33220,7 @@ var main = async (argv) => {
|
|
|
33104
33220
|
now: Date.now(),
|
|
33105
33221
|
stderr: (line) => console.error(line),
|
|
33106
33222
|
isTTY: !!process.stderr.isTTY,
|
|
33107
|
-
version: "0.1.
|
|
33223
|
+
version: "0.1.70"
|
|
33108
33224
|
});
|
|
33109
33225
|
switch (cmd) {
|
|
33110
33226
|
case "update":
|
|
@@ -33368,7 +33484,7 @@ ${renderHelpText(argv[1])}`);
|
|
|
33368
33484
|
case "version":
|
|
33369
33485
|
case "--version":
|
|
33370
33486
|
case "-v":
|
|
33371
|
-
console.log("sleds 0.1.
|
|
33487
|
+
console.log("sleds 0.1.70");
|
|
33372
33488
|
return 0;
|
|
33373
33489
|
default:
|
|
33374
33490
|
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.70",
|
|
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",
|