@sleds/cli 0.1.35 → 0.1.37
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 +75 -7
- package/package.json +1 -1
package/dist/sleds.mjs
CHANGED
|
@@ -5232,6 +5232,12 @@ var init_recommend = __esm(() => {
|
|
|
5232
5232
|
var init_profile2 = __esm(() => {
|
|
5233
5233
|
init_profile();
|
|
5234
5234
|
});
|
|
5235
|
+
// ../../packages/shared/src/item/outcome.ts
|
|
5236
|
+
var OUTCOME_WINDOW_DAYS = 14, OUTCOME_WINDOW_MS;
|
|
5237
|
+
var init_outcome = __esm(() => {
|
|
5238
|
+
OUTCOME_WINDOW_MS = OUTCOME_WINDOW_DAYS * 86400000;
|
|
5239
|
+
});
|
|
5240
|
+
|
|
5235
5241
|
// ../../packages/shared/src/slack/mention.ts
|
|
5236
5242
|
var init_mention = __esm(() => {
|
|
5237
5243
|
init_intake();
|
|
@@ -6115,10 +6121,15 @@ var init_pack = __esm(() => {
|
|
|
6115
6121
|
init_sentry();
|
|
6116
6122
|
init_setup();
|
|
6117
6123
|
});
|
|
6124
|
+
// ../../packages/shared/src/pack/prHeader.ts
|
|
6125
|
+
var PR_HEADER_OPEN = "<!-- sleds:header -->", PR_HEADER_CLOSE = "<!-- /sleds:header -->";
|
|
6126
|
+
var init_prHeader = () => {};
|
|
6127
|
+
|
|
6118
6128
|
// ../../packages/shared/src/pack/index.ts
|
|
6119
6129
|
var init_pack2 = __esm(() => {
|
|
6120
6130
|
init_setup();
|
|
6121
6131
|
init_pack();
|
|
6132
|
+
init_prHeader();
|
|
6122
6133
|
});
|
|
6123
6134
|
|
|
6124
6135
|
// ../../packages/shared/src/newrelic/newrelic.ts
|
|
@@ -6517,6 +6528,9 @@ function nodePrompt(o) {
|
|
|
6517
6528
|
"",
|
|
6518
6529
|
`- Work on branch \`${o.branch}\` from the latest \`origin/${base}\` (create it if this checkout is not on it). One branch, one PR.`,
|
|
6519
6530
|
`- Open the PR against \`${base}\` with \`gh pr create${visual ? " --draft" : ""}\`${o.prTitle ? ` and title it exactly \`${o.prTitle}\` (the repo's CI checks it)` : ""}. Its body carries \`SLEDS-Node: ${claim.node}\` on the line under \`SLEDS-Source:\` when the pack names a source.`,
|
|
6531
|
+
...claim.pack.includes(PR_HEADER_OPEN) ? [
|
|
6532
|
+
`- The PR body starts with the pack's PR header block (\`${PR_HEADER_OPEN}\` … \`${PR_HEADER_CLOSE}\`, in its part 5), above everything else and as given; when you edit the body later, keep it on top.`
|
|
6533
|
+
] : [],
|
|
6520
6534
|
"- Run the repo's own gate before you push. Never merge: a person (or the musher, when the attachment says so) does.",
|
|
6521
6535
|
"- Stay inside this node's scope. Work another node needs goes in the PR description, not in this branch.",
|
|
6522
6536
|
`- End every comment and reply you post on the PR with the line \`${ENGINE_MARK}\`, so the engine knows it is yours and not a reviewer's.`,
|
|
@@ -6841,6 +6855,7 @@ function eventPrompt(o) {
|
|
|
6841
6855
|
}
|
|
6842
6856
|
var DEFAULT_SEAT = "\x00default", MAX_SEAT_AT_ONCE = 16, HOLD_DEFAULTS, DRAFT_NODE = "draft", BRANCH_FIELDS, PR_TITLE_FIELDS, ENGINE_MCP_SERVER = "sleds", RUN_TOKEN_ENV = "SLEDS_RUN_TOKEN", NO_RUN_TOKEN = "no run token from SLEDS: this session acts as the seat", SANDBOX_DOMAIN, SANDBOX_DEFAULT_ALLOW, toolName = (name, engineMcp) => engineMcp ? `mcp__${ENGINE_MCP_SERVER}__${name}` : name, ENGINE_MARK = "<!-- sleds:engine -->", VISUAL_PATH, APPROACH_SHAPE, AUTONOMY_SAYS, IRREVERSIBLE = "deleting or migrating data in place; deploying outside the playbook's window; anything that leaves the org (a message to a customer, a publish, a release, an email); spend past the band or the allowance; force-pushing or deleting a branch someone else holds; granting or removing access; changing the brief. When in doubt, it is irreversible.", oneLine = (s, max) => s.replace(/\s+/g, " ").trim().slice(0, max), VERDICT_SHAPE, DECIDER_RULES, codes = (xs) => xs.map((x) => `\`${x}\``).join(", "), RESOLVE_MAX_FILES = 8;
|
|
6843
6857
|
var init_engine = __esm(() => {
|
|
6858
|
+
init_prHeader();
|
|
6844
6859
|
init_route();
|
|
6845
6860
|
HOLD_DEFAULTS = {
|
|
6846
6861
|
holdCpu: 85,
|
|
@@ -7494,6 +7509,7 @@ var init_src = __esm(() => {
|
|
|
7494
7509
|
init_recommend();
|
|
7495
7510
|
init_due();
|
|
7496
7511
|
init_profile2();
|
|
7512
|
+
init_outcome();
|
|
7497
7513
|
init_mention();
|
|
7498
7514
|
init_productHits();
|
|
7499
7515
|
init_model();
|
|
@@ -8181,6 +8197,7 @@ init_plan3();
|
|
|
8181
8197
|
init_recommend();
|
|
8182
8198
|
init_due();
|
|
8183
8199
|
init_profile2();
|
|
8200
|
+
init_outcome();
|
|
8184
8201
|
init_mention();
|
|
8185
8202
|
init_productHits();
|
|
8186
8203
|
init_model();
|
|
@@ -10321,15 +10338,28 @@ import { join as join15, resolve as resolve7 } from "node:path";
|
|
|
10321
10338
|
// src/engine/beat.ts
|
|
10322
10339
|
var BEAT_EVERY_MS = 60000;
|
|
10323
10340
|
var BEAT_ITEMS = 8;
|
|
10324
|
-
function beatBody(state, flags, host = {}) {
|
|
10341
|
+
function beatBody(state, flags, host = {}, cap = {}) {
|
|
10325
10342
|
const live = state.runs.filter((r) => !r.pr && !r.parked);
|
|
10343
|
+
const m = cap.machine;
|
|
10326
10344
|
return {
|
|
10327
10345
|
name: flags.name,
|
|
10328
10346
|
os: host.os ?? process.platform,
|
|
10329
10347
|
runner: flags.runner,
|
|
10330
|
-
version: host.version ?? "0.1.
|
|
10348
|
+
version: host.version ?? "0.1.37" ?? "dev",
|
|
10331
10349
|
running: live.length,
|
|
10332
|
-
items: live.slice(0, BEAT_ITEMS).map((r) => `${r.item}/${r.node}`)
|
|
10350
|
+
items: live.slice(0, BEAT_ITEMS).map((r) => `${r.item}/${r.node}`),
|
|
10351
|
+
...cap.atOnce !== undefined ? { atOnce: cap.atOnce } : {},
|
|
10352
|
+
...m ? {
|
|
10353
|
+
machine: {
|
|
10354
|
+
cpuPct: m.cpuPct,
|
|
10355
|
+
load1: m.load1,
|
|
10356
|
+
cores: m.cores,
|
|
10357
|
+
loadPerCore: m.loadPerCore,
|
|
10358
|
+
pressure: m.pressure
|
|
10359
|
+
},
|
|
10360
|
+
level: cap.hold?.level ?? "calm",
|
|
10361
|
+
...cap.hold ? { allowed: cap.hold.allowed } : {}
|
|
10362
|
+
} : {}
|
|
10333
10363
|
};
|
|
10334
10364
|
}
|
|
10335
10365
|
async function postBeat(client, body) {
|
|
@@ -18111,7 +18141,12 @@ var engineCmd = async (o) => {
|
|
|
18111
18141
|
const who = { name: flags.name, runner: runner.name };
|
|
18112
18142
|
afterTick = () => {
|
|
18113
18143
|
try {
|
|
18114
|
-
|
|
18144
|
+
const m = deps.machine;
|
|
18145
|
+
send(beatBody(deps.readState(), who, {}, {
|
|
18146
|
+
atOnce: deps.atOnce,
|
|
18147
|
+
...m?.last ? { machine: m.last } : {},
|
|
18148
|
+
...m?.hold && !m.off ? { hold: m.hold } : {}
|
|
18149
|
+
}));
|
|
18115
18150
|
} catch {}
|
|
18116
18151
|
};
|
|
18117
18152
|
}
|
|
@@ -18569,6 +18604,31 @@ function ago(at, now) {
|
|
|
18569
18604
|
// src/commands/engineList.ts
|
|
18570
18605
|
var ENGINE_LIST_USAGE = "usage: sleds engine list [--json]";
|
|
18571
18606
|
var str11 = (x) => typeof x === "string" ? x : "";
|
|
18607
|
+
var numOrNull = (x) => typeof x === "number" && Number.isFinite(x) ? x : null;
|
|
18608
|
+
function machineOf(x) {
|
|
18609
|
+
if (!x || typeof x !== "object")
|
|
18610
|
+
return null;
|
|
18611
|
+
const m = x;
|
|
18612
|
+
const out = { pressure: str11(m.pressure) || "unknown" };
|
|
18613
|
+
for (const k of ["cpuPct", "load1", "cores", "loadPerCore"]) {
|
|
18614
|
+
const n = numOrNull(m[k]);
|
|
18615
|
+
if (n !== null)
|
|
18616
|
+
out[k] = n;
|
|
18617
|
+
}
|
|
18618
|
+
return out;
|
|
18619
|
+
}
|
|
18620
|
+
var LEVELS = ["calm", "strained", "busy"];
|
|
18621
|
+
function workOf(x) {
|
|
18622
|
+
if (!Array.isArray(x))
|
|
18623
|
+
return [];
|
|
18624
|
+
return x.flatMap((w) => {
|
|
18625
|
+
if (!w || typeof w !== "object")
|
|
18626
|
+
return [];
|
|
18627
|
+
const o = w;
|
|
18628
|
+
const item = str11(o.item);
|
|
18629
|
+
return item ? [{ item, node: str11(o.node), title: typeof o.title === "string" ? o.title : null }] : [];
|
|
18630
|
+
});
|
|
18631
|
+
}
|
|
18572
18632
|
function engineRows(raw) {
|
|
18573
18633
|
const rows = Array.isArray(raw.engines) ? raw.engines : [];
|
|
18574
18634
|
return rows.flatMap((r) => {
|
|
@@ -18588,8 +18648,13 @@ function engineRows(raw) {
|
|
|
18588
18648
|
running: typeof e.running === "number" ? e.running : 0,
|
|
18589
18649
|
items: Array.isArray(e.items) ? e.items.filter((i) => typeof i === "string") : [],
|
|
18590
18650
|
seatKind: typeof e.seatKind === "string" ? e.seatKind : null,
|
|
18651
|
+
atOnce: numOrNull(e.atOnce),
|
|
18652
|
+
machine: machineOf(e.machine),
|
|
18653
|
+
level: LEVELS.find((l) => l === e.level) ?? null,
|
|
18654
|
+
allowed: numOrNull(e.allowed),
|
|
18591
18655
|
lastBeatAt: typeof e.lastBeatAt === "number" ? e.lastBeatAt : 0,
|
|
18592
|
-
state: e.state === "up" ? "up" : "down"
|
|
18656
|
+
state: e.state === "up" ? "up" : "down",
|
|
18657
|
+
work: workOf(e.work)
|
|
18593
18658
|
}
|
|
18594
18659
|
];
|
|
18595
18660
|
});
|
|
@@ -18600,7 +18665,10 @@ function engineListLines(rows, now) {
|
|
|
18600
18665
|
"no engines have beaten in this org — start one with `sleds engine` or `sleds engine install`"
|
|
18601
18666
|
];
|
|
18602
18667
|
return rows.map((r) => {
|
|
18603
|
-
const
|
|
18668
|
+
const slots = r.atOnce ? `${r.running} of ${r.atOnce} running` : `${r.running} running`;
|
|
18669
|
+
const parts = [r.name.replace(/^engine:/, ""), r.os || "?", r.state, slots];
|
|
18670
|
+
if (r.state === "up" && r.level && r.level !== "calm")
|
|
18671
|
+
parts.push(r.level);
|
|
18604
18672
|
if (r.state === "down" && r.lastBeatAt)
|
|
18605
18673
|
parts.push(`last beat ${ago(r.lastBeatAt, now)}`);
|
|
18606
18674
|
return clean(parts.join(" · "));
|
|
@@ -24147,7 +24215,7 @@ ${renderHelpText(argv[1])}`);
|
|
|
24147
24215
|
case "version":
|
|
24148
24216
|
case "--version":
|
|
24149
24217
|
case "-v":
|
|
24150
|
-
console.log("sleds 0.1.
|
|
24218
|
+
console.log("sleds 0.1.37");
|
|
24151
24219
|
return 0;
|
|
24152
24220
|
default:
|
|
24153
24221
|
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.37",
|
|
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",
|