agent-yes 1.201.0 → 1.203.0

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 (38) hide show
  1. package/default.config.yaml +8 -8
  2. package/dist/SUPPORTED_CLIS-C2KLyNR9.js +9 -0
  3. package/dist/{SUPPORTED_CLIS-CnGjmp53.js → SUPPORTED_CLIS-CME2rXAO.js} +2 -2
  4. package/dist/{agentShare-lDreSLQE.js → agentShare-LmDLDvCN.js} +2 -2
  5. package/dist/cli.js +4 -4
  6. package/dist/index.js +2 -2
  7. package/dist/{notifyDaemon-C4VzLmmO.js → notifyDaemon-CW7E0ON1.js} +2 -2
  8. package/dist/{rustBinary-CVZsX0za.js → rustBinary-5fGeqzPe.js} +2 -2
  9. package/dist/{schedule-hdbXBwpG.js → schedule-bPb_0xnY.js} +4 -4
  10. package/dist/{serve-DEEesVYn.js → serve-B9RuI_Hb.js} +12 -12
  11. package/dist/{setup-DZbnDas9.js → setup-CnzMLgtM.js} +2 -2
  12. package/dist/{subcommands-IwpLJA-n.js → subcommands-cqz_xIKK.js} +1 -1
  13. package/dist/{subcommands-De-OHc0k.js → subcommands-t8QPivG7.js} +53 -11
  14. package/dist/{ts-ZOEYyQAX.js → ts-DVxj4HLs.js} +2 -2
  15. package/dist/{versionChecker-CBtAasFe.js → versionChecker-mq5B0hM3.js} +2 -2
  16. package/dist/{ws-DLiI3C6R.js → ws-BSyEbL--.js} +2 -2
  17. package/lab/ui/console-logic.js +43 -4
  18. package/lab/ui/index.html +65 -21
  19. package/lab/ui/qrcode.js +548 -565
  20. package/lab/ui/room-client.js +70 -91
  21. package/lab/ui/sw.js +17 -7
  22. package/package.json +7 -7
  23. package/scripts/build-rgui.ts +3 -1
  24. package/ts/agentShare.spec.ts +5 -3
  25. package/ts/badges.spec.ts +84 -1
  26. package/ts/badges.ts +69 -5
  27. package/ts/notifyDaemon.spec.ts +2 -8
  28. package/ts/notifyDaemon.ts +32 -33
  29. package/ts/notifyInbox.spec.ts +2 -1
  30. package/ts/notifyRouter.spec.ts +7 -11
  31. package/ts/notifyStore.spec.ts +4 -1
  32. package/ts/notifyStore.ts +18 -14
  33. package/ts/serve.spec.ts +4 -6
  34. package/ts/serve.ts +69 -17
  35. package/ts/subcommands.ts +46 -18
  36. package/ts/ws.spec.ts +31 -7
  37. package/ts/ws.ts +15 -4
  38. package/dist/SUPPORTED_CLIS-BbWt8-ON.js +0 -9
package/ts/subcommands.ts CHANGED
@@ -28,7 +28,7 @@ import {
28
28
  recordMessage,
29
29
  recordOutbox,
30
30
  } from "./messageLog.ts";
31
- import { badgeDef, matchBadges, TYPING_BADGE } from "./badges.ts";
31
+ import { badgeLabel, matchBadges, TYPING_BADGE } from "./badges.ts";
32
32
  import {
33
33
  classifyNeedsInput,
34
34
  isWorkingScreen,
@@ -37,7 +37,13 @@ import {
37
37
  type NeedsInput,
38
38
  } from "./needsInput.ts";
39
39
  import { diffLsStates, type LiveState, type LsAgentState } from "./lsWatch.ts";
40
- import { filterSinceSeq, filterSinceTs, filterUnread, maxSeq, type NotifyEvent } from "./notifyInbox.ts";
40
+ import {
41
+ filterSinceSeq,
42
+ filterSinceTs,
43
+ filterUnread,
44
+ maxSeq,
45
+ type NotifyEvent,
46
+ } from "./notifyInbox.ts";
41
47
  import {
42
48
  clearWatcher,
43
49
  getCursor,
@@ -1283,7 +1289,8 @@ async function runAllRemotesLs(opts: {
1283
1289
  byHost.push({ host: "local", records: enriched });
1284
1290
  }
1285
1291
  for (const res of remoteResults) {
1286
- if (res.status === "fulfilled") byHost.push({ host: res.value.host, records: res.value.records });
1292
+ if (res.status === "fulfilled")
1293
+ byHost.push({ host: res.value.host, records: res.value.records });
1287
1294
  }
1288
1295
 
1289
1296
  // Flatten each host's records into its agent>subagent forest (parent_pid links),
@@ -1471,7 +1478,7 @@ function branchLabel(g: GitInfo | null | undefined): string {
1471
1478
  */
1472
1479
  function badgeLabels(ids: string[] | null | undefined): string {
1473
1480
  if (!ids || ids.length === 0) return "";
1474
- return ids.map((id) => badgeDef(id)?.label ?? id).join(" ");
1481
+ return ids.map((id) => badgeLabel(id)).join(" ");
1475
1482
  }
1476
1483
 
1477
1484
  // porcelain=v2 --branch parser — mirrors parseGitStatus in serve.ts (that copy
@@ -2887,7 +2894,8 @@ export async function backoffWhileTyping(
2887
2894
  const deadline = start + maxWaitMs;
2888
2895
  let waited = false;
2889
2896
  while (Date.now() < deadline) {
2890
- if (!(await isUserTyping(pid))) return { clear: true, waitedMs: waited ? Date.now() - start : 0 };
2897
+ if (!(await isUserTyping(pid)))
2898
+ return { clear: true, waitedMs: waited ? Date.now() - start : 0 };
2891
2899
  waited = true;
2892
2900
  await new Promise((r) => setTimeout(r, SEND_TYPING_POLL_MS));
2893
2901
  }
@@ -4237,9 +4245,7 @@ async function cmdRestart(rest: string[]): Promise<number> {
4237
4245
  cwd: record.cwd,
4238
4246
  detached: true,
4239
4247
  stdio: ["ignore", "ignore", "ignore"],
4240
- env: record.agent_id
4241
- ? { ...process.env, AGENT_YES_AGENT_ID: record.agent_id }
4242
- : process.env,
4248
+ env: record.agent_id ? { ...process.env, AGENT_YES_AGENT_ID: record.agent_id } : process.env,
4243
4249
  });
4244
4250
 
4245
4251
  const { out, err } = restartHintLines(record.cli, record.cwd, strategy);
@@ -4765,15 +4771,38 @@ async function cmdNotify(rest: string[]): Promise<number> {
4765
4771
  }
4766
4772
 
4767
4773
  const y = yargs(args)
4768
- .option("parent", { type: "number", description: "Parent pid whose inbox to drain (default: $AGENT_YES_PID)" })
4774
+ .option("parent", {
4775
+ type: "number",
4776
+ description: "Parent pid whose inbox to drain (default: $AGENT_YES_PID)",
4777
+ })
4769
4778
  .option("since", { type: "number", description: "Only edges with seq greater than this" })
4770
4779
  .option("since-ts", { type: "number", description: "Only edges at/after this epoch-ms" })
4771
- .option("unread", { type: "boolean", default: false, description: "Only edges past the saved cursor" })
4772
- .option("ack", { type: "boolean", default: false, description: "Advance the cursor past what's shown (at-least-once: off by default)" })
4780
+ .option("unread", {
4781
+ type: "boolean",
4782
+ default: false,
4783
+ description: "Only edges past the saved cursor",
4784
+ })
4785
+ .option("ack", {
4786
+ type: "boolean",
4787
+ default: false,
4788
+ description: "Advance the cursor past what's shown (at-least-once: off by default)",
4789
+ })
4773
4790
  .option("json", { type: "boolean", default: false, description: "Emit raw NDJSON events" })
4774
- .option("consumer", { type: "string", default: "parent", description: "Cursor identity (for multiple readers)" })
4775
- .option("interval", { type: "number", default: 2, description: "Poll interval in seconds (watch)" })
4776
- .option("ensure-daemon", { type: "boolean", default: true, description: "Start the notifyd singleton if not running (watch)" })
4791
+ .option("consumer", {
4792
+ type: "string",
4793
+ default: "parent",
4794
+ description: "Cursor identity (for multiple readers)",
4795
+ })
4796
+ .option("interval", {
4797
+ type: "number",
4798
+ default: 2,
4799
+ description: "Poll interval in seconds (watch)",
4800
+ })
4801
+ .option("ensure-daemon", {
4802
+ type: "boolean",
4803
+ default: true,
4804
+ description: "Start the notifyd singleton if not running (watch)",
4805
+ })
4777
4806
  .help(false)
4778
4807
  .version(false)
4779
4808
  .exitProcess(false);
@@ -4810,7 +4839,8 @@ async function cmdNotify(rest: string[]): Promise<number> {
4810
4839
  } else {
4811
4840
  if (sinceSeqOverride !== undefined) events = filterSinceSeq(events, sinceSeqOverride);
4812
4841
  else if (Number.isFinite(argv.since)) events = filterSinceSeq(events, argv.since as number);
4813
- if (Number.isFinite(argv["since-ts"])) events = filterSinceTs(events, argv["since-ts"] as number);
4842
+ if (Number.isFinite(argv["since-ts"]))
4843
+ events = filterSinceTs(events, argv["since-ts"] as number);
4814
4844
  }
4815
4845
  printNotifyEvents(events, argv.json);
4816
4846
  return maxSeq(events);
@@ -4902,9 +4932,7 @@ async function resolveParentStartedAt(parent: number): Promise<number> {
4902
4932
  }).catch(() => [] as GlobalPidRecord[]);
4903
4933
  const live = records.filter(
4904
4934
  (r) =>
4905
- (r.wrapper_pid === parent || r.pid === parent) &&
4906
- r.status !== "exited" &&
4907
- isPidAlive(r.pid),
4935
+ (r.wrapper_pid === parent || r.pid === parent) && r.status !== "exited" && isPidAlive(r.pid),
4908
4936
  );
4909
4937
  // Exactly one live match, or fail closed.
4910
4938
  if (live.length !== 1) return 0;
package/ts/ws.spec.ts CHANGED
@@ -170,9 +170,9 @@ describe("resolveOperand", () => {
170
170
  });
171
171
 
172
172
  it("reports a precise parse error for garbage", async () => {
173
- await expect(resolveOperand(fakeProv("/unused"), "not a spec", "spec", undefined)).rejects.toThrow(
174
- /cannot parse "not a spec"/,
175
- );
173
+ await expect(
174
+ resolveOperand(fakeProv("/unused"), "not a spec", "spec", undefined),
175
+ ).rejects.toThrow(/cannot parse "not a spec"/);
176
176
  });
177
177
  });
178
178
 
@@ -188,7 +188,14 @@ describe("cmdWs (mocked provision)", () => {
188
188
  let err: string[];
189
189
  let homeBackup: string | undefined;
190
190
 
191
- const CLEAN = { branch: "main", head: "abc123", ahead: 0, behind: 0, dirty: false, hasUpstream: true };
191
+ const CLEAN = {
192
+ branch: "main",
193
+ head: "abc123",
194
+ ahead: 0,
195
+ behind: 0,
196
+ dirty: false,
197
+ hasUpstream: true,
198
+ };
192
199
 
193
200
  beforeEach(() => {
194
201
  // realpath: os.tmpdir() is a symlink on macOS (/var → /private/var), and
@@ -312,7 +319,12 @@ describe("cmdWs (mocked provision)", () => {
312
319
  });
313
320
 
314
321
  it("new: branch-not-found hints at --create, and --create falls back to createBranch", async () => {
315
- prov.provision.mockResolvedValue({ ok: false, action: "error", reason: "branch-not-found", error: "nope" });
322
+ prov.provision.mockResolvedValue({
323
+ ok: false,
324
+ action: "error",
325
+ reason: "branch-not-found",
326
+ error: "nope",
327
+ });
316
328
  expect(await cmdWs(["new", "o/r@dev"])).toBe(1);
317
329
  expect(err.join("")).toContain("--create");
318
330
  expect(prov.createBranch).not.toHaveBeenCalled();
@@ -397,7 +409,12 @@ describe("cmdWs (mocked provision)", () => {
397
409
  });
398
410
 
399
411
  it("new: a non-branch failure reports without the --create hint", async () => {
400
- prov.provision.mockResolvedValue({ ok: false, action: "error", reason: "repo-not-found", error: "gone" });
412
+ prov.provision.mockResolvedValue({
413
+ ok: false,
414
+ action: "error",
415
+ reason: "repo-not-found",
416
+ error: "gone",
417
+ });
401
418
  expect(await cmdWs(["new", "o/r"])).toBe(1);
402
419
  const msg = err.join("");
403
420
  expect(msg).toContain("repo-not-found");
@@ -453,7 +470,14 @@ describe("collectWorkspaces / workspaceStatus (mocked provision)", () => {
453
470
  prov.wsRoot = root;
454
471
  prov.readStatus
455
472
  .mockReset()
456
- .mockResolvedValue({ branch: "main", head: "abc123", ahead: 1, behind: 0, dirty: true, hasUpstream: true });
473
+ .mockResolvedValue({
474
+ branch: "main",
475
+ head: "abc123",
476
+ ahead: 1,
477
+ behind: 0,
478
+ dirty: true,
479
+ hasUpstream: true,
480
+ });
457
481
  homeBackup = process.env.AGENT_YES_HOME;
458
482
  process.env.AGENT_YES_HOME = path.join(root, ".ay-home");
459
483
  });
package/ts/ws.ts CHANGED
@@ -231,7 +231,8 @@ export async function resolveOperand(
231
231
  );
232
232
  }
233
233
  const dir = prov.folderFor(spec, wsRoot);
234
- if (!existsSync(dir)) throw new Error(`workspace not provisioned: ${dir} (ay ws new ${operand})`);
234
+ if (!existsSync(dir))
235
+ throw new Error(`workspace not provisioned: ${dir} (ay ws new ${operand})`);
235
236
  return { dir, spec };
236
237
  };
237
238
  if (mode === "path") return asPath();
@@ -311,7 +312,13 @@ export async function collectWorkspaces(opts?: {
311
312
 
312
313
  const [bare, records] = await Promise.all([
313
314
  walkWorkspaces(wsRoot),
314
- listRecords(undefined, { all: false, active: false, json: false, latest: false, cwdScope: null }),
315
+ listRecords(undefined, {
316
+ all: false,
317
+ active: false,
318
+ json: false,
319
+ latest: false,
320
+ cwdScope: null,
321
+ }),
315
322
  ]);
316
323
 
317
324
  let entries: WsEntry[] = bare.map((w) => ({
@@ -432,7 +439,9 @@ async function cmdWsStatus(args: string[]): Promise<number> {
432
439
  const entry = await workspaceStatus(dir, spec);
433
440
 
434
441
  if (flags.json) {
435
- process.stdout.write(JSON.stringify({ schema: WS_JSON_SCHEMA, workspace: entry }, null, 2) + "\n");
442
+ process.stdout.write(
443
+ JSON.stringify({ schema: WS_JSON_SCHEMA, workspace: entry }, null, 2) + "\n",
444
+ );
436
445
  return 0;
437
446
  }
438
447
  const git = entry.git!;
@@ -487,7 +496,9 @@ async function cmdWsFork(args: string[]): Promise<number> {
487
496
  typeof flags.from === "string" ? flags.from : await defaultForkFrom(),
488
497
  );
489
498
 
490
- process.stderr.write(`forking ${fromCwd} → branch ${branch}${flags.wip ? " (with WIP)" : ""} …\n`);
499
+ process.stderr.write(
500
+ `forking ${fromCwd} → branch ${branch}${flags.wip ? " (with WIP)" : ""} …\n`,
501
+ );
491
502
  const res = await prov.forkWorktree({
492
503
  fromCwd,
493
504
  branch,
@@ -1,9 +0,0 @@
1
- import "./ts-ZOEYyQAX.js";
2
- import "./logger-CDIsZ-Pp.js";
3
- import "./versionChecker-CBtAasFe.js";
4
- import "./pidStore-BIvsBQ8X.js";
5
- import "./globalPidIndex-CoNr7tS8.js";
6
- import "./messageLog-CxrKJj77.js";
7
- import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-CnGjmp53.js";
8
-
9
- export { SUPPORTED_CLIS };