@sleds/cli 0.1.53 → 0.1.54

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.
Files changed (2) hide show
  1. package/dist/sleds.mjs +43 -25
  2. package/package.json +1 -1
package/dist/sleds.mjs CHANGED
@@ -8557,8 +8557,7 @@ function parseParked(v) {
8557
8557
  return {
8558
8558
  question: v.question,
8559
8559
  at: v.at,
8560
- ...typeof v.screen === "string" ? { screen: v.screen } : {},
8561
- ...v.still === true ? { still: true } : {},
8560
+ ...typeof v.words === "string" ? { words: v.words, ...v.still === true ? { still: true } : {} } : {},
8562
8561
  ...answerer ? { answerer } : {}
8563
8562
  };
8564
8563
  }
@@ -8603,6 +8602,7 @@ function parseRun(v) {
8603
8602
  ...v.permission.onScreen === true ? { onScreen: true } : {},
8604
8603
  ...typeof v.permission.dialog === "string" ? { dialog: v.permission.dialog } : {},
8605
8604
  ...typeof v.permission.pressedAt === "number" ? { pressedAt: v.permission.pressedAt } : {},
8605
+ ...typeof v.permission.pressedOn === "string" ? { pressedOn: v.permission.pressedOn } : {},
8606
8606
  ...typeof v.permission.presses === "number" ? { presses: v.permission.presses } : {},
8607
8607
  ...v.permission.gaveUp === true ? { gaveUp: true } : {}
8608
8608
  }
@@ -11535,7 +11535,7 @@ function beatBody(state, flags, host = {}, cap = {}) {
11535
11535
  name: flags.name,
11536
11536
  os: host.os ?? process.platform,
11537
11537
  runner: flags.runner,
11538
- version: host.version ?? "0.1.53" ?? "dev",
11538
+ version: host.version ?? "0.1.54" ?? "dev",
11539
11539
  running: live.length,
11540
11540
  items: live.slice(0, BEAT_ITEMS).map((r) => `${r.item}/${r.node}`),
11541
11541
  ...cap.atOnce !== undefined ? { atOnce: cap.atOnce } : {},
@@ -13733,6 +13733,9 @@ function fingerprint(text) {
13733
13733
  }
13734
13734
  return (h >>> 0).toString(16);
13735
13735
  }
13736
+ function wordsPrint(screen) {
13737
+ return fingerprint(stripTuiChrome(screen));
13738
+ }
13736
13739
  function sandboxFor(d, name, cwd, allow) {
13737
13740
  if (!d.sandbox)
13738
13741
  return {};
@@ -13999,7 +14002,7 @@ async function tickOnce(d) {
13999
14002
  if (beat === "parked") {
14000
14003
  const question = "the session parked itself; the question is on the route";
14001
14004
  d.log(`${ref(run)}: parked with a question — the session waits for the answer (${runner.watchHint(run.handle)})`);
14002
- holdParked(d, runner, run, question);
14005
+ holdParked(d, runner, run, question, shown);
14003
14006
  finished.push({ item: run.item, node: run.node, outcome: { kind: "park", question } });
14004
14007
  keep.push(run);
14005
14008
  continue;
@@ -14034,7 +14037,7 @@ async function tickOnce(d) {
14034
14037
  }
14035
14038
  d.log(`${ref(run)}: ${why}, tries spent — parked for a person (${runner.watchHint(run.handle)})`);
14036
14039
  run.provider = undefined;
14037
- holdParked(d, runner, run, question);
14040
+ holdParked(d, runner, run, question, shown);
14038
14041
  finished.push({ item: run.item, node: run.node, outcome });
14039
14042
  keep.push(run);
14040
14043
  continue;
@@ -14055,7 +14058,7 @@ async function tickOnce(d) {
14055
14058
  continue;
14056
14059
  }
14057
14060
  d.log(asked ? `${ref(run)}: stopped on a question with no PR — parked with its last message as the question (${runner.watchHint(run.handle)})` : `${ref(run)}: idle ${d.idleMin} min with no PR — parked with its last message as the question (${runner.watchHint(run.handle)})`);
14058
- holdParked(d, runner, run, question);
14061
+ holdParked(d, runner, run, question, shown);
14059
14062
  finished.push({ item: run.item, node: run.node, outcome });
14060
14063
  keep.push(run);
14061
14064
  continue;
@@ -14409,7 +14412,7 @@ async function settlePermission(d, runner, run, shown) {
14409
14412
  const dialog = runner.readsSession ? permissionDialog(shown) : null;
14410
14413
  const p = run.permission;
14411
14414
  if (p) {
14412
- const gone = runner.readsSession && (p.onScreen ? !dialog || p.dialog !== undefined && dialogPrint(dialog) !== p.dialog : (run.seenAt ?? 0) > (p.pressedAt ?? p.at));
14415
+ const gone = runner.readsSession && (p.onScreen ? !dialog || p.dialog !== undefined && dialogPrint(dialog) !== p.dialog || p.pressedOn !== undefined && fingerprint(shown) !== p.pressedOn : (run.seenAt ?? 0) > (p.pressedAt ?? p.at));
14413
14416
  const answered = () => {
14414
14417
  run.permission = undefined;
14415
14418
  run.answeredAt = d.now();
@@ -14440,7 +14443,12 @@ async function settlePermission(d, runner, run, shown) {
14440
14443
  if (!pressed)
14441
14444
  return true;
14442
14445
  if (pressed === "key") {
14443
- run.permission = { ...p, pressedAt: d.now(), presses: 1 };
14446
+ run.permission = {
14447
+ ...p,
14448
+ pressedAt: d.now(),
14449
+ pressedOn: fingerprint(shown),
14450
+ presses: 1
14451
+ };
14444
14452
  return true;
14445
14453
  }
14446
14454
  }
@@ -14467,7 +14475,12 @@ async function settlePermission(d, runner, run, shown) {
14467
14475
  return true;
14468
14476
  }
14469
14477
  if (pressAnswer(d, runner, run, p.options, now.answer) === "key")
14470
- run.permission = { ...p, pressedAt: d.now(), presses: presses + 1 };
14478
+ run.permission = {
14479
+ ...p,
14480
+ pressedAt: d.now(),
14481
+ pressedOn: fingerprint(shown),
14482
+ presses: presses + 1
14483
+ };
14471
14484
  return true;
14472
14485
  }
14473
14486
  if (now?.state !== "open" && now?.state !== "escalated") {
@@ -14776,8 +14789,12 @@ function stopOpen(d, run, runner) {
14776
14789
  d.log(`${ref(run)}: could not stop the left-open session: ${message(e)}`);
14777
14790
  }
14778
14791
  }
14779
- function holdParked(d, runner, run, question) {
14780
- run.parked = { question, at: d.now(), ...run.seen ? { screen: run.seen } : {} };
14792
+ function holdParked(d, runner, run, question, shown) {
14793
+ run.parked = {
14794
+ question,
14795
+ at: d.now(),
14796
+ ...runner.readsSession ? { words: wordsPrint(shown) } : {}
14797
+ };
14781
14798
  run.leaseUntil = undefined;
14782
14799
  setLane(d, runner, run.handle, "parked");
14783
14800
  }
@@ -14786,18 +14803,19 @@ async function answeredInSession(d, runner, run) {
14786
14803
  const resumes = resumesOf(d.source);
14787
14804
  if (!resumes || !runner.readsSession || !run.runId)
14788
14805
  return false;
14789
- let print;
14806
+ let shown;
14790
14807
  try {
14791
- print = fingerprint(runner.read(run.handle));
14808
+ shown = runner.read(run.handle);
14792
14809
  } catch {
14793
14810
  return false;
14794
14811
  }
14795
- if (print === parked.screen) {
14812
+ const words = wordsPrint(shown);
14813
+ if (words === parked.words) {
14796
14814
  parked.still = true;
14797
14815
  return false;
14798
14816
  }
14799
14817
  const moved = parked.still === true;
14800
- parked.screen = print;
14818
+ parked.words = words;
14801
14819
  parked.still = false;
14802
14820
  if (!moved)
14803
14821
  return false;
@@ -14815,7 +14833,7 @@ async function answeredInSession(d, runner, run) {
14815
14833
  stopAnswerer(d, run);
14816
14834
  const now = d.now();
14817
14835
  run.parked = undefined;
14818
- run.seen = print;
14836
+ run.seen = fingerprint(shown);
14819
14837
  run.seenAt = now;
14820
14838
  run.seenTicks = 0;
14821
14839
  run.answeredAt = now;
@@ -17410,7 +17428,7 @@ async function fetchVersion(o) {
17410
17428
  const platform = o.platform ?? process.platform;
17411
17429
  const arch = o.arch ?? process.arch;
17412
17430
  const publicKey = o.publicKey ?? RELEASE_PUBLIC_KEY;
17413
- const running = o.running ?? "0.1.53";
17431
+ const running = o.running ?? "0.1.54";
17414
17432
  if (!publicKey)
17415
17433
  return { ok: false, why: "no release key yet" };
17416
17434
  if (!VERSION_RE2.test(o.version))
@@ -18994,7 +19012,7 @@ function engineClient(o, org) {
18994
19012
  return fetchClient({
18995
19013
  ...src,
18996
19014
  timeoutMs: ENGINE_TIMEOUT_MS,
18997
- version: "0.1.53"
19015
+ version: "0.1.54"
18998
19016
  });
18999
19017
  const asked = org?.trim() || env.SLEDS_ORG?.trim();
19000
19018
  if (asked && !selectOrg(readConfig(o.home), org, env).seat)
@@ -19285,7 +19303,7 @@ async function driveEngine(o, flags, deps, until = {}) {
19285
19303
  runner: deps.runner.name,
19286
19304
  atOnce: flags.atOnce,
19287
19305
  interval: flags.interval,
19288
- cliVersion: "0.1.53"
19306
+ cliVersion: "0.1.54"
19289
19307
  };
19290
19308
  const beat = (checkedAt) => {
19291
19309
  const m = deps.machine;
@@ -21142,7 +21160,7 @@ function engineClient2(o, org) {
21142
21160
  return fetchClient({
21143
21161
  ...src,
21144
21162
  timeoutMs: ENGINE_TIMEOUT_MS2,
21145
- version: "0.1.53"
21163
+ version: "0.1.54"
21146
21164
  });
21147
21165
  const asked = org?.trim() || env.SLEDS_ORG?.trim();
21148
21166
  if (asked && !selectOrg(readConfig(o.home), org, env).seat)
@@ -21468,7 +21486,7 @@ async function driveEngine2(o, flags, deps, until = {}) {
21468
21486
  runner: deps.runner.name,
21469
21487
  atOnce: flags.atOnce,
21470
21488
  interval: flags.interval,
21471
- cliVersion: "0.1.53"
21489
+ cliVersion: "0.1.54"
21472
21490
  };
21473
21491
  const beat = (checkedAt) => {
21474
21492
  const m = deps.machine;
@@ -23556,7 +23574,7 @@ function contextFor(deps) {
23556
23574
  ...src,
23557
23575
  fetchFn: deps.fetchFn,
23558
23576
  timeoutMs: deps.timeoutMs,
23559
- version: "0.1.53"
23577
+ version: "0.1.54"
23560
23578
  }), deps.home, now) : null;
23561
23579
  return {
23562
23580
  channel: "code",
@@ -27674,7 +27692,7 @@ var realPidAlive4 = (pid) => {
27674
27692
  };
27675
27693
  function machineClient(home, env) {
27676
27694
  const src = meterSource(home, undefined, { env });
27677
- return src ? fetchClient({ ...src, version: "0.1.53" }) : null;
27695
+ return src ? fetchClient({ ...src, version: "0.1.54" }) : null;
27678
27696
  }
27679
27697
  async function noteAnswer2(home, a, now) {
27680
27698
  try {
@@ -28534,7 +28552,7 @@ var main = async (argv) => {
28534
28552
  now: Date.now(),
28535
28553
  stderr: (line) => console.error(line),
28536
28554
  isTTY: !!process.stderr.isTTY,
28537
- version: "0.1.53"
28555
+ version: "0.1.54"
28538
28556
  });
28539
28557
  switch (cmd) {
28540
28558
  case "update":
@@ -28767,7 +28785,7 @@ ${renderHelpText(argv[1])}`);
28767
28785
  case "version":
28768
28786
  case "--version":
28769
28787
  case "-v":
28770
- console.log("sleds 0.1.53");
28788
+ console.log("sleds 0.1.54");
28771
28789
  return 0;
28772
28790
  default:
28773
28791
  console.error(`unknown command: ${cmd}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleds/cli",
3
- "version": "0.1.53",
3
+ "version": "0.1.54",
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",